| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| 1000 what's the problem? | dds861 | 1000. A+B Problem | 15 май 2015 01:45 | 2 |
#include <iostream> int main() { int a=1+5; std::cout<<a; } Input numbers are not always 1 and 5, they are given to your stdin. |
| Bugurt thread | Izaron | 1133. Последовательность Фибоначчи | 15 май 2015 01:44 | 2 |
I killed a lot of time writing the solution in C++, Python, Java. Java gives AC with BigInteger -_- It is NOT solvable with int64 It is not solvable BY YOU with int64 |
| What answer? | Scalar | 1265. Зеркало | 14 май 2015 00:58 | 3 |
What answer on this test? 0 3 1 1 1 0 3 0 Edited by author 04.01.2009 19:53 On C++ with double I got WA 9, on Pascal with extended - WA 4, but on Pascal with double - WA 11. Why??? Edited by author 04.01.2009 19:55 |
| I can not format output Wrong Answer | Konstantine Babuadze | 1001. Обратный корень | 13 май 2015 20:18 | 2 |
#include <iostream> #include <stdio.h> #include <iomanip> #include <math.h> using namespace std; void main() { int n=0; int i=1,j; double number; float a[140000];
while (cin) {
cin>>number; a[i] = sqrt(number); n+=1; i++;
} for (j = n-1; j>=1; j--) { printf("%f \n",a[j]); } system("pause"); } Edited by author 13.05.2015 15:57 ive done it ! Its impossible to do this with arrays.. should use vectors |
| Answers a bit off | Al.Cash | 2054. Астрономия | 12 май 2015 17:55 | 5 |
For some reason I get answers that are very close but not equal to the ones in example: 14.495347194 0.000000000 56.489368526 Maybe I misunderstood something in the model? There's no any day of year where you can get such answers with latitude = 56. Only if the time differs about 15-20 seconds from the time of original test data. So it seems you choose slightly different Vasya's location because of wrong time calculation. Or maybe the proximity to the correct answers is just a coincidence, and your Earth-moving model is totally wrong. What answer do you get for the test 56 24 21 jun 0 21 jun 1 ... 21 jun 23 ? At least they are symmetric and reach maximum at 12 hours... Could you please post the correct coordinates for 0 and 12 hours and I'll go from there. 0.000000000 0.000000000 0.000000000 0.000000000 4.214527110 11.374704540 19.267892795 27.563494585 35.903413441 43.838560055 50.725478497 55.623901463 57.439281000 55.623901463 50.725478497 43.838560055 35.903413441 27.563494585 19.267892795 11.374704540 4.214527110 0.000000000 0.000000000 0.000000000 Edited by author 11.05.2015 16:35 Edited by author 11.05.2015 16:47 Wow, they're again very close to my answers. Here they are: 0 0 0 0 4.2133420379 11.3735281948 19.2668088249 27.5625655432 35.9026841855 43.8380585719 50.7252091429 55.6238233024 57.4392810000 (totally correct :)) 55.6238233024 50.7252091429 43.8380585719 35.9026841855 27.5625655432 19.2668088249 11.3735281948 4.2133420379 0 0 0 I have no idea what exactly it could be, because any misunderstanding of the model would cause much greater error in the answers. Check the constants you use. Maybe one of them has little inaccuracy or doesn't have enough precision. Found my mistakes. I handled rotation around Earth's axis totally wrong. First, its period is not 24 hours but a little shorter. Second, the fact about closest meridian at midday doesn't imply that Vasya's location is the closest point to the Sun at his latitude. |
| WA #8 please help | Izaron | 1287. Каналы на Марсе | 10 май 2015 13:13 | 1 |
Really dont know what the mistake??? int main() { char src[1405][1405]; int n; cin >> n; for(int i = 0; i < n; i++) { for(int z = 0; z < n; z++) { cin >> src[i][z]; } } int s = 0, S = 0; for(int i = 0; i < n; i++) { int tmps = 0, tmpS = 0; for(int z = 0; z < n; z++) { if(src[i][z] == 's') { tmps++; s = max(s, tmps); tmpS = 0; } else { tmpS++; S = max(S, tmpS); tmps = 0; } } } for(int i = 0; i < n; i++) { int tmps = 0, tmpS = 0; for(int z = 0; z < n; z++) { if(src[z][i] == 's') { tmps++; s = max(s, tmps); tmpS = 0; } else { tmpS++; S = max(S, tmpS); tmps = 0; } } } for(int i = 0; i < n; i++) { int tmps = 0, tmpS = 0; for(int z = 0; z <= i; z++) { if(src[i - z][z] == 's') { tmps++; s = max(s, tmps); tmpS = 0; } else { tmpS++; S = max(S, tmpS); tmps = 0; } } } for(int i = 0; i < n; i++) { int tmps = 0, tmpS = 0; for(int z = i; z < n; z++) { if(src[z][z - i] == 's') { tmps++; s = max(s, tmps); tmpS = 0; } else { tmpS++; S = max(S, tmpS); tmps = 0; } } } if(s > S) { cout << "s\n" << s; } else if(s < S) { cout << "S\n" << S; } else { cout << "?\n" << s; } } |
| What is wrong ? (C++) | Bessovistnyj | 1001. Обратный корень | 7 май 2015 22:40 | 3 |
// ConsoleApplication4.cpp : Defines the entry point for the console application. // #include <cstdlib> #include <iostream> #include <stdio.h> #include <math.h> #include <string.h> using namespace std; int main() { int count = 0; int maxCount = 0; long long MyArray[255]; for(int i=0; i<=255; i++){ MyArray[i] = -1; } while (scanf("%llu", &MyArray[count]) != EOF){ count++; maxCount = count; if (count > 255){ break; } } for (int i = maxCount-1; i >= 0; i--){ if(MyArray[i] != -1){ long double result = 0; result = sqrt((long double)(MyArray[i])); printf("%.4Lf\n", result); } } system("PAUSE"); return EXIT_SUCCESS; } system("pause") must be deleted |
| wa #7 | Лукьянчиков Владимир Игоревич | 1713. Ключевые подстроки | 6 май 2015 20:16 | 5 |
wa #7 Лукьянчиков Владимир Игоревич 3 ноя 2010 15:38 I'm afraid that i'm getting WA on 7-th test because of hash collisions. How to avoid it? Please, give me some recipes) I tried to change prime base - 31,43,57 - anyway WA#7. Edited by author 07.11.2010 10:15 Re: wa #7 Лукьянчиков Владимир Игоревич 7 ноя 2010 10:16 Try 1717 or 3737 or 5757. Edited by author 29.01.2025 23:59 Re: wa #7 Лукьянчиков Владимир Игоревич 7 ноя 2010 20:52 P=1000000007 - only this base helped me! 31,57 - and other small bases - sucks! BTW, I didn't take anything by modulo and I declared hash as integer not long long. Now I have only one question: why 5.000.000 pairs of integers eats ~40 MB memory(it's ok - each pair - (4B+4B) *5.000.000 ~ 40) BUT!!! why 5000 000 pairs of <long long,int> eats ~80MB?? I expected ( 8B(long long)+4B(int) )* 5.000.000 ~60MB!! very strange... Edited by author 07.11.2010 20:58 Edited by author 07.11.2010 20:58 It's due to data alignment. sizeof(pair<long long, int>) == 16. 8B(long long) + 4B(int) + 4B(unused). |
| So stupid ... | baldman88 | 1083. Факториалы!!! | 6 май 2015 13:08 | 3 |
Sorry for my english. First of all check the value of k: 0 < k < n. If False, then the result is n, otherwise -- use formulas. I saw your recent topic, so maybe someone will answer MY Q here (haha). Guys, help me to understand. I see 'n!!…! = n(n−k)(n−2k)…(n mod k)', between '-' sign and 'k' IS value here(which changes from 0...2...X . I used X, 'cause I dont know, TO WHICH number should this value change (of course 'k' or 'n'), tell me to which and why ? Actually, I think this task isn't formalized as shoud be(tell me if i'm wrong please). Thanks, you're right about that ... so stupid. Edited by author 06.05.2015 13:09 |
| I don't know why my code works. | Nekosyndrome | 2050. 3D-моделирование | 6 май 2015 01:27 | 4 |
My solution only outputs alpha=180. Is there any case that it's possible and alpha can't be 180? Oh Yes! Understanding this fact makes the problem being quite easy. The only problem is to output points with |coordinates| <= 2000. But I didn't have to care about it because of weak tests. del Edited by author 06.05.2015 12:45 |
| Что с чекером? | Jimmy Skhirtladze | 2047. Математика | 5 май 2015 22:56 | 4 |
У меня на первый тест (n=3) ответ 1 6 2. Вроде ответ правильный: (1+6)=7 (2 делителя: 1,7), (1+6+2)=9 (3 делителя: 1,3,9). А система выдаёт мне WA на етом тесте. Пожалуйста проверьте чекер :) Судя по примеру из задачи единица не считается делителем. Единица считается делителем У 1 + 6 должно быть 6 делителей, а не 2. |
| if you got WA#1 | ile | 1032. Найдите кратное | 5 май 2015 13:04 | 6 |
The test has only one number: 1 2 Try also this test: 5 3 1 3 3 3 Answer is, of course: 4 1 3 3 3 The test has only one number: 1 2 This test isn't coorectly because numbers is [1, N] correct testcase is: 1 1 And my program print coorect answer: 1 1 But I still have WA1.. someone can help? P.S. my program pass your testcase too =) No, numbers are in [1, 15000], not [1, N]. :) |
| Why MLE is given on test 5? | Ehsan Rayatpishe | 1671. Паутина Ананси | 4 май 2015 22:23 | 2 |
I am not allocating any memory in heap, everything is defined globally, why do I get Memory Limit Exceeded error on test 5? Why this error is not given for test 1? I'm not even using STL. It also happened to me solving another problem(1220. Stacks), I got memory limit exceeded on test 10, same situation as here. Does IO operations use memory? I assume I get this error as test-cases get larger in size... (I also tried disabling IO buffering) Solved. It was a problem with my DSU function. |
| Ни чего не понимаю. | Anton Pavlov | 2049. Химия | 4 май 2015 21:53 | 2 |
4 2 1 => 2 0 1 1 1 4 3 => 2 0 2 0 1 3 1 => 4 0 0 0 1 1 5 => 4 в 1 => нестабильная смесь => улетает чистый кислород. 1 1 1 1 1 2 1 =>2 0 1 1 1 4 3 =>2 0 2 0 1 3 1 =>4 0 0 0 1 1 5 =>3 0 0 0 2 |
| how it can be solved in 0.062? | Alexander Kouprin | 1595. Совершенная последовательность | 4 май 2015 20:37 | 4 |
I had found O(n) solution but I need to out ~2.7 Mb. It's takes ~0.12 sec. So, how this problem can be solved in 0.062? So, nobody wants to answer me. It's pity. printf too slow you can use fwrite(), but first you need to translate the numbers into a string fwrite() also too slow ))) |
| To admins: weak tests? | MVM | 2050. 3D-моделирование | 4 май 2015 05:17 | 2 |
My first solution outputs points P and Q with coordinates more than 2000 on test 0 1000 0 1000 999 0 0 0 0 1 0 0 but passes jury tests. Edited by author 03.05.2015 19:00 Edited by author 03.05.2015 19:08 Edited by author 03.05.2015 20:28 Also, one of my solutions fails on tests -1 1 0 0 0 0 1 1 0 0 0 0 0 0 0 -1 1 0 1 0 0 2 1 0 |
| Single-line solution in Java | naik | 1224. Спираль | 3 май 2015 22:10 | 2 |
System.out.println((Math.min(N - 1L, M - 1L) << 1) + (N > M ? 1 : 0)); |
| IO tips and other | lakerka | 1098. Questions | 3 май 2015 20:43 | 1 |
First of all make sure that you are not reading newlines and carriage return symbols. Input can be read like: char c; int scanfRez; do { scanfRez = scanf("%c", &c); if (scanfRez != EOF && c != '\n' && c != '\r') { chs[chCount++] = c; } }while(scanfRez != EOF); I was getting WA7 with this input reading: char c; int scanfRez; do { scanfRez = scanf("%c", &c); if (c != '\n' && c != '\r') { chs[chCount++] = c; } }while(scanfRez != EOF); If you get WA3 make sure that you are processing sequence correctly with given sequence length > N. For example: let N = 11, input sequence = "abcdefghijkl" (without quotes) then letters should be removed in this order: k 1 j 2 l 3 b 4 e 5 i 6 g 7 h 8 d 9 a 10 c 11 f 12 It does not matter if you put newline at the end of output. |
| two components | dmafa | 1020. Ниточка | 3 май 2015 12:46 | 1 |
Boost up your brains, coders. Length of the thread is just sum of two simple components. One is the polygon perimeter, the other is [think on yourself, mate. The other component contains PI number]. Hello to your school teacher of elementary geometry. |
| USEFUL TESTS | Tigran Hakobyan | 1888. Стаж пилотов | 2 май 2015 14:47 | 1 |
4 5 1 2 2 3 3 4 4 5 7 6 1 2 2 3 3 4 4 1 4 5 5 6 6 1 2 5 1 2 2 3 2 4 1 2 3 4 3 4 3 1 1 2 2 4 4 4 1 2 3 1 2 4 3 4 3 3 1 2 2 3 1 3 |