| Show all threads Hide all threads Show all messages Hide all messages |
| AC~~~happy~~ | zxy_snow | 1120. Sum of Sequential Numbers | 7 Aug 2019 04:27 | 3 |
I used some methods, got TLE || WA ...T T ... You can enumerate P . Think carefully and you will get a O(sqrt(n)) solution. Spend some time for enum, cause i don't wanna to calculate in float variables. So fun!) |
| WA test 5 please help me c++ | Abdullahil Baki Adol | 1243. Divorce of the Seven Dwarfs | 6 Aug 2019 22:37 | 1 |
#include<bits/stdc++.h> using namespace std; int main(){ unsigned long long int n; try{ cin >> n; cout << n%7 << endl; }catch(exception e){ cout << 1 << endl; } return 0; } |
| Don't panic! | Otrebus | 1158. Censored! | 6 Aug 2019 12:47 | 2 |
Some have claimed that this is a very difficult problem. Not true! There is a reasonably simple and very fast DP-solution to this problem. No string algorithms are required beyond the naive ones that every non-programmer knows. Hint: Store the solution for sentences of length k in A[k], and store the number of strings that end with some forbidden word i (0 < i < P), but does not contain any other forbidden words as substrings in F[i][k]. Then construct the solution from A[k] to A[k+1], updating F[i][k+1] as well for each i. For each new character that you tuck onto the end of a valid string of length k, you get A[k] more valid strings, except those that end with a forbidden word, so those strings need to be removed. But make sure you don't remove stuff that you've assumed that you already removed earlier in the string - that's where F[i][k] comes in handy. |
| Very Very Very Simple | Locomotive | 1194. Handshakes | 6 Aug 2019 04:13 | 5 |
every body handshakes all else his couple so n*(n-1) div 2 - k (couples doesnt handshake eachother)! --> Var n,k:integer; begin readln(n,k); writeln(((n*(n-1)) div 2) -k); end. Aidin_n7 What is The Autor Thinking? What's the meaning of the spliting group numbers? It just piss me off. Yep, this is the one way for solution. I've met problem like that earlier. Statements consist kinda "you need to get very-very much operation with binary code of number", but after some tests we understood, that solution was kinda "ans = n*(-1)". And it's good to have a short cut in problems for clever men;) |
| Accepted | Alexei | 1110. Power | 5 Aug 2019 22:46 | 1 |
This is my solution O(M log N) #include <bits/stdc++.h> #define in(x) freopen(x,"r",stdin) #define out(x) freopen(x,"w",stdout) #define N 100500 #define oo ll(1e16) #define P pair < int, int > #define PP pair < pair < int, int >, int > #define F first #define S second #define pb push_back #define el endl #define base ll(1e9 + 7) using namespace std; typedef long long ll; typedef long double ld; int n, m, y; bool o; int bin(int x, int st) { int res = 1; for(; st > 0;) { if (st & 1) res = (res * x) % m; x = (x * x) % m; st >>= 1; } return res; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n >> m >> y; o = 0; for (int i = 1; i < m; i++) { int cur = bin(i, n); if (cur == y) cout << i << ' ', o = 1; } if (!o) cout << -1; } |
| WA#15 Can I have sample test please? | Jumabek Alikhanov | 1123. Salary | 5 Aug 2019 19:28 | 3 |
Test: 123131 Answer: 123321 Thanks! Didn't make numbers equal to zero in encreasing numbers after the right one of comparing; |
| Simple and fast solution in O(n) | ironchat(ITMO) | 1883. Ent's Birthday | 5 Aug 2019 17:57 | 1 |
Use scanline y = -x + a We need to use no more than 6 points If you want to be fast use k-statistic in O(n) For better explanation write here: myironmistake@gmail.com Edited by author 06.08.2019 18:42 |
| Not that difficult | Stuxnet | 2135. Pauline and commits | 5 Aug 2019 13:51 | 1 |
Even though it took me almost 2 hours to solve I'm surprised this has difficulty of 1539. It doesn't require any special knowledge and almost anyone can solve this. Solution is pretty straightforward. |
| WA in teste case 12 | Auro Soares | 1471. Distance in the Tree | 5 Aug 2019 07:32 | 1 |
Anyone can give me this test case? |
| DELETED | decay | 2125. Continue the Sequence | 4 Aug 2019 15:15 | 1 |
DELETED Edited by author 04.08.2019 22:55 |
| I didn't know meaning of parting! | lnxdx | 1194. Handshakes | 3 Aug 2019 00:03 | 1 |
|
| week Test! | yuyan | 1466. Magic Square | 2 Aug 2019 18:43 | 3 |
Dear admin: Please add this test: 3 2 4 6 2 1 7 8 I got tle on this test.But fortunately I got AC! My AC solution outputs "YES" on that test case. |
| Please add these tests. | yuyan | 1466. Magic Square | 2 Aug 2019 18:42 | 2 |
3 5 1 4 5 7 3 8 2 4 4 7 5 3 7 7 0 3 5 2 5 1 5 3 4 3 8 8 8 6 0 6 6 1 I got tle on these tests.But I got AC. My AC solution outputs "NO" on both of those test cases. |
| Weak tests | Yermak | 1466. Magic Square | 2 Aug 2019 18:41 | 2 |
My two AC submissions give different answers on this test: 3 4 0 0 0 0 6 1 5 5 2 8 5 3 P.S. The first test case isn't the sample. Edited by author 19.11.2013 01:26 My AC solution outputs "NO" on that test case. |
| Hint for wa6,7,8 | tiancaihb | 1104. Don’t Ask Woman about Her Age | 2 Aug 2019 17:26 | 6 |
I WAed many many times, and finally got AC. Test6 is 0, whose answer is 2. Test 7 is probably 1 or 2, which my previous program had given incorrect answer to. The answer to Test 8 has to be 36, because I used "for(i=x;i<36;i++)" and wa8. (I also saw some prog posted on this forum had the same problem) When I found this and changed into "<=", AC at last. Sorry for my poor English. Hope these can help you guys somehow. Good luck! Thank to your help. Sorry for my poor English,too. Thank you, your hints helped me to get AC. I got Crash (integer division by zero) before. unfortunately, it didn't help me :( still get WA8, any ideas?? I WAed many many times, and finally got AC. Test6 is 0, whose answer is 2. Test 7 is probably 1 or 2, which my previous program had given incorrect answer to. The answer to Test 8 has to be 36, because I used "for(i=x;i<36;i++)" and wa8. (I also saw some prog posted on this forum had the same problem) When I found this and changed into "<=", AC at last. Sorry for my poor English. Hope these can help you guys somehow. Good luck! Thanks... Thanks, my program went in cycle to 35 instead of 36) |
| BUBBLE_SORT? | АРТЕМ | 1100. Final Standings | 2 Aug 2019 16:43 | 2 |
Hi, why is a problem author talking about bubble sort? And why a lot using stl stable_sort? Where is a differents of stl sort? |
| 8 test | 👨💻tproger👨💻[GTGU] | 1634. Spider Mite | 2 Aug 2019 16:38 | 1 |
8 test 👨💻tproger👨💻[GTGU] 2 Aug 2019 16:38 In this test N=50 and the answer is 1069. |
| hint if you get WA 8 | Balan Catalin | 1325. Dirt | 27 Jul 2019 11:06 | 2 |
I spent about an hour till i figured out that: If it is impossible to get from the computer to the refrigerator, you should output 0 0. !!!! Thank u so much! How should I forget this! |
| WA #1 | jiyujie | 1049. Brave Balloonists | 26 Jul 2019 21:38 | 3 |
WA #1 jiyujie 25 Apr 2012 13:57 i really don't understand why i got WA #1...i try a lot of tests and i always have the right answer, could anyone give me test 1, please, thx~ Edited by author 26.04.2012 11:47 Edited by author 26.04.2012 11:48 #include<bits/stdc++.h> using namespace std; int main(){ long long a[10],l,s,z=1,q,f; vector<long long>v; vector<long long>p; bool prime[10000]; memset(prime,true,sizeof(prime)); for(int i=2;i<=10000;i++){ if(prime[i]){ for(int j=i*2;j<=10000;j=j+i){ prime[j]=false; } } } for(int i=2;i<=10000;i++){ if(prime[i]){ v.push_back(i); } } q=v.size(); f=v[q-1]; for(int i=2;i<=f;i++){ p.push_back(0); } for(int j=0;j<10;j++){ cin>>a[j]; } for(int i=0;i<10;i++){ l=0,s=0; while(a[i]>=v[l]){ if(a[i]%v[l]==0){ //cout<<a[i]<<" "<<v[l]<<endl; p[v[l]]++; a[i]=a[i]/v[l]; } else{ l++; } } } for(int i=0;i<=p.size();i++){ z=(z*(p[i]+1))%10000; } z=z%10; cout<<z; return 0; } |
| I wonder what was the reason for the original TL = 10 sec :) | [NRU ITMO] WiNGeR | 2124. Algebra on Segment | 25 Jul 2019 10:26 | 1 |
|