Common Board6 12 +.+-+-+-+-+-+-+-+-+-+-+.+ | | . . . . . . . . . | | +.+.+-+-+-+-+-+-+-+-+.+.+ | | | . . . . . . . | | | +.+.+.+-+-+-+-+-+-+.+.+.+ | | | | . . . . | | . . | +.+.+.+.+.+.+.+.+.+.+-+-+ | . . | . . . . | . | . | +.+.+-+.+.+.+.+.+.+.+.+.+ | | | . . . . . | . | . | +.+.+.+.+.+.+.+.+.+.+.+.+ |1|2| . . . . . | . | . | +-+-+.+.+.+.+.+.+.+.+.+.+ According to the problem statement, right answer is 37. But the solution which returns 40 also got AC. So is the answer 40 or 37? I had WA2 with std::cout and round|trunc|floor functions. Then I used printf("%.2f", result) and got WA4. What's going on with output requirements? WA2 and WA4 happened when I used int64_t as type for main calculations. Then I changed to double and passed tests. ?!?! Hey, this is the test 16 - it was a long path to get there. What can possibly go wrong? I don't understand why my prog don't work Can you give me some data or advice Edited by author 20.03.2007 14:04 Edited by author 20.03.2007 14:04 10 0 9 0 0 I had "Output limit exceeded" on this test, but it actually was WA12. It works. Thanks man, appreciate it! <3 Hello, I've managed to solve this problem using two graphs, I'm not sure where I could use dp to improve my solution. My solve only uses 0.015s with 1456kb. Could you give me some hints as to where dp was supposed to be used in the solution? Please, give me some test! Or, may be, give some advices about this test. if you are dividing something by something, make sure to account for the case where, due to precision double,dividing of two different points gives the same result My max value is 13: ######## #@ $.$.# # $.$.# #$ $.$.# #. $.$.# #$ $.$.# #. $.# ######## Has anybody found more? i have tried all cases and it seems correct but cant pass test 13. Can someone help me what is test 13??? Английский я знаю плохо, поэтому sorry:) У меня тоже был WA 12. Попробуй тест: 1 49999 50000 0 0 TY so much <3 :(( Английский я знаю плохо, поэтому sorry:) У меня тоже был WA 12. Попробуй тест: 1 49999 50000 0 0 Edited by author 25.03.2022 08:26#include <iostream> using namespace std; int main() { int n,c; cin>>n; int a[n]; for(int i=0;i<n;i++) cin>>a[i]; for(int i=0;i<n;i++){ for(int j=0;j<n;j++) if(a[i]<a[j]){c=a[i];a[i]=a[j];a[j]=c;} } c=a[n-1]; for(int i=0;i<n;i++) c=c+a[i]; cout<<c; return 0; } Edited by author 25.03.2022 06:30 #include <iostream> using namespace std; int main() { int n, x=2; cin>>n; x += n; while(n--) { string s; cin >> s; for(int i=0; i<s.size(); i++) { if(s[i]=='+') { x++; } } } if(x!=13) cout << 100*x<< endl; else cout << 100*(x+1) << endl;
return 0; } Edited by author 25.03.2022 06:15 Edited by author 25.03.2022 06:15 If you get WA on test #11, try this test: 4 1 3 4 2 Not a proof Thanks man, I appreciate it Check this: if (!used[j] and min_e[j] < min_e[v] and j!=v) { Edited by author 23.03.2022 22:57 The C# solution fails test #4. Error: Runtime error (access violation). But in C++, exactly the same solution passed. Does test 4 in this problem contain correct data? Notice that the number of pieces you cut the cables needn't be precisely equal to k. Just >=k is OK. It' strange task. My solution is SO STUPID. Watch at 2 last numbers of (k,n), where k = {1,2,3,4} Edited by author 21.03.2022 17:49 Hint 1: How many sequences end with '1' or '2' Hint 2: s_a[0] = 1; s_b[0] = 1; Hint 3: s_a[i+j] = (s_a[i+j] + s_b[i])%inf; Where i+j <=n and i<n and j<= a Repeat this with s_b Good luck! :) What can you tell me about test#10? Is it correct? vector <int> mas = {2, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107, 127, 521, 607, 1279, 2203, 2281, 3217, 4253, 4423, 9689, 9941, 11213, 19937, 21701, 23209, 44497, 86243, 110503, 132049, 216091, 756839, 859433, 1257787, 1398269, 2976221, 3021377, 6972593, 13466917, 20996011, 24036583, 25964951, 30402457, 32582657, 37156667, 42643801, 43112609, 57885161}; pair <int,int> rotate(int x,int y) { return make_pair(y,3-x); } Changed < to <= when comparing dp values, and got AC |
|