|
|
Common BoardThe first test is something like this 4 4 1 2 1 2 3 1 3 4 2 4 1 1 I hope this helps you Подумайте о пересечение прямой из данных двух точек с окружностью а потом о треугольниках Edited by author 16.02.2020 19:45 И ни в коем случае не думайте о зебрах phi(n) is not equal to number of coprime less than n, IT IS THE NUMBER OF COPRIMES LESS THAN OR EQUAL TO N. the formula of phi(n) work for all except a special number. give me this test please.. 6 1 3 2 5 4 6 Answer: 27 May be this is not 5th test, but if you can solve this, you'll understand what's wrong in your current solving. :-) Can you explain it to me, how you get 27? Achtung! Time limit exceeded Error :( does anyone knows test 5? thank you! big number(10000 maybe) and time more 1 sec. Putting the intermediary values in long double won't work, At least I couldn't get them to work. Putting them in long long and dividing at the end also won't work. You'll have to do something between these two ( ͡° ͜ʖ ͡°) Не слушайте тех кто пишет что убрал проверку за границы и зашла и все в таком духе. Возможно у вас такая же ошибка как и у меня, а то есть когда ввели новые координаты я проверял только то что может ли эту новую координату кто то ударить, а надо было еще проверить что может ли новая координа ударить кого то из врагов I use some shamanism ang get AC. Lets see to the next test: 6 0 20 10 50 30 100 60 120 70 130 110 140 my AC prog outputs: 2 10 50 110 140 but right answer of course is: 3 0 20 30 100 110 140 Your tests must be stronger Your test is added. Problem will be rejudged soon. test 6 0 -20 -10 -50 -30 -100 -60 -120 -70 -130 -110 -140 my AC solution have answer 2 -140 -110 -50 -10 on this test, so you've fucked up twice You have fucked up three times with wrong test my answer is : 10 50 60 120 70 130 this problem is quite easy but output is difficult to suitable to right answer !!!!! perhaps i get WA because of it Edited by author 15.03.2009 12:34 Thanks For the test~ I wa#12 and the test helped me. Edited by author 26.11.2009 08:19 Извините, что по-русски, надеюсь, администраторы знают этот язык. В условии сказано, что длина последовательности задается в первой строке каждого теста. В примерах на форуме длина общая для всех, в каждом тесте задается только количество вопросов. Моя AC-программа действует по форуму: читает длину один раз, а потом только количество вопросов для каждого теста. Хорошо бы привести текст задачи в соответствие с реальностью. Совсем хорошо было бы дать в примере два теста, чтобы сделать структуру входных данных действительно ясной. For Time limit exceeded: If you get time limit exceeded, it must mean that you're trying to modify the input string (i.e. trying to delete i-th chars). Try creating a new OUTPUT string without modifying the INPUT string. Note: if you're using a high language such as java or C#, try using the StringBuilder object to build your output string. For Wrong Answer(WA): If you get WA, try some of these test cases: Input: "dddd" Output: "" Input: "ddddd" Output: "d" Input: "abba" Output: "" Input: "abbbbac" Output: "c" Input: "wliisddsmmleeddw" Output: "" Input: "avcbbffcv" Output: "a" Hope this helps. Edited by author 12.07.2012 00:47 Input: "abbbbac" Output: "c" Спасибо, помогло! For Time limit exceeded: If you get time limit exceeded, it must mean that you're trying to modify the input string (i.e. trying to delete i-th chars). Try creating a new OUTPUT string without modifying the INPUT string. Note: if you're using a high language such as java or C#, try using the StringBuilder object to build your output string. For Wrong Answer(WA): If you get WA, try some of these test cases: Input: "dddd" Output: "" Input: "ddddd" Output: "d" Input: "abba" Output: "" Input: "abbbbac" Output: "c" Input: "wliisddsmmleeddw" Output: "" Input: "avcbbffcv" Output: "a" Hope this helps. Edited by author 12.07.2012 00:47 Thanks a lot...I could'n understand the problem statement first, now, reading ur comment I clearly understood the problem. for me problem was that program was returning "axx" on "aaaxx" Edited by author 18.03.2017 19:56 #include<iostream> using namespace std; int main(){ int k, n, arr[101],x=0; cin>>k>>n;
for(int i=0; i<n; i++){ cin>> arr[i];
} for(int i=0;i<n;i++){ if(k>=arr[i]){ if(i != n-1){ x = x + arr[i+1]; arr[i+1] = x;
x = 0;
} else{ x = 0; }
} else{ if(i != n-1){ x = (arr[i]-k) + arr[i+1]; arr[i+1] = x;
} else{ x = arr[i] - k; } } // printf("X : %d\n",x); } if(x<=0) cout<<0; else cout<<x;
} #include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int n; cin >> n; vector <vector <int>> a(n, vector <int> (n)); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { cin >> a[i][j]; } } int ans = a[0][0]; for (int leng = 1; leng <= n; leng++){ for (int up = 0; up <= n-leng; up++){ vector <long long> sumv(n); for (int j = 0; j < n; j++) { for (int i = up; i < up + leng; i++) { sumv[j] += a[i][j]; } } int sum = 0; for (int r = 0; r < n; ++r) { sum += sumv[r]; ans = max(ans, sum); sum = max(sum, 0); } } } cout << ans; } has anybody got WA8 too? I tried all tests in forum but it didn't help :( Be careful when you implement Manacher's algorithm, when you copy the ready part for the second part, don't forget making all the needed changes, I forgot changing just one sign ! #include <iostream> #include <string> #include <algorithm> using namespace std; int main() { string c = "a"; string word; for (;;) { c = getc(stdin); if (c[0] == EOF) { reverse(word.begin(), word.end()); cout << word; break; } if (((c[0] >= 'a') && (c[0] <= 'z')) || ((c[0] >= 'A') && (c[0] <= 'Z'))) { word.append(c); } else { reverse(word.begin(), word.end()); cout << word << c; word.clear(); } } } instead map use unordered_map once I've solved this exercise, but know a vontto make my algorithm better. I've forced whith WA#12. Could you tell me this test? I've solved it!!))) if you have the same problem, try test: 1233345333 ansver: 12333453335433321 |
|
|