| Show all threads Hide all threads Show all messages Hide all messages |
| test 5????? | zsyzhbc_china | 1712. Cipher Grille | 7 Mar 2010 10:41 | 1 |
|
| check this test please | sich_off (ONPU) | 1600. Airport | 7 Mar 2010 02:19 | 2 |
I have WA 3. what should i output for this test? 2 1 1.000000000001 0 0 0 0 0 0 0 0 -1 0 0 |
| One more test | Fyodor Menshikov | 1146. Maximum Sum | 6 Mar 2010 20:11 | 4 |
Please add the following test: N=100, the following 10000 numbers -127. Awhile there is no test where answer is negative. Thank you. New tests were added, and many authors lost AC. |
| To all C++ coders having problems with T#3 or so... | Intelligent_Design | 1294. Mars Satellites | 6 Mar 2010 17:33 | 3 |
In this problem,rounding the double value to the nearest integer appeares to be the most tricky part of the whole problem. If you want to guarantee correct rounding, do it yourself with floor() and ceil(). At least,as it happened to me.:) You can do it like this: printf("%.0lf\n", res); You are absolutely right: ``cout << int(r)'' is WA, while ``printf("Distance is %.0lf km.", r);'' is AC. |
| Could V[i] be negative? | bsu.mmf.team | 1541. Chase | 6 Mar 2010 14:05 | 1 |
Edited by author 14.05.2010 21:41 |
| Test 2# | Element | 1010. Discrete Function | 6 Mar 2010 13:35 | 2 |
Just change longint into int64. Oh,my god! Don't the author say all values are longint? |
| Hint | ASK | 1497. Cutting a Square | 6 Mar 2010 01:57 | 2 |
Hint ASK 6 Mar 2010 01:52 It is not necessary a rectangle. Try 5 11111 11011 11011 10010 00000 Yes and all its rotations. BTW, to read you can use #define F(i,n) for(int i = 0; i < n; ++i) int n; vector<string> s; [...] cin >> n; s.resize(n, string(n,' ')); F(i,n) cin >> s[i]; and AC at 0.046 second. ... whereas F(i,n) { string str; cin >> str; s.push_back(str); } results in 0.109 seconds and 500 KB of wasted memory. |
| What's the 8th test? | MeLodyloveyr | 1730. ManBearPig | 5 Mar 2010 07:12 | 1 |
I always crash on that test...float point wrong |
| Hint | Yegor Suvorov | 1601. AntiCAPS | 5 Mar 2010 02:27 | 2 |
Hint Yegor Suvorov 23 May 2008 19:50 Correct answer for this test: ---------- iT is HinT ---------- is ---------- It is hint ---------- No. This test no correct. He does not qualify under the condition of the problem. Edited by author 05.03.2010 02:28 |
| Why is WA for Test 9? Pls. Help me. | logic | 1001. Reverse Root | 4 Mar 2010 12:59 | 9 |
#include<stdio.h> #include<math.h> int main() { double a[100000]; signed long int i = 0; while (scanf("%lf", &a[i]) != EOF) { i++; } i--; while ( i >= 0) { printf("%.4lf\n",sqrt(a[i])); i--; } return ; } !!!!!EXTENDED for Pascal!!!!!! !!!!!LONG DOUBLE for C++!!!!!! try this: double a [128*1024] use dinamic memory try double *a = (double *) malloc (sizeof(double)*128*1024); and when you done before return free (a); thats all :) Aleksa_Markoni, thank you! Could you tell me why it should use dinamic memory ? Thank you! There is no need to use dinamic memory ... Just make sure that your array is large enough. But I wonder why the result I get is TLE ... this is my code: #include<stdio.h> #include<string.h> #include<math.h> double a[100010];//make it larger and then I got AC int main() { int k=0; while(scanf("%lf",&a[k])!=EOF)k++; while(k) printf("%.4lf\n",sqrt(a[--k])); return 0; } use dinamic memory try double *a = (double *) malloc (sizeof(double)*128*1024); and when you done before return free (a); thats all :) Edited by author 21.10.2009 00:40 while your program submit it replies Time limit exceeded for what reason? |
| WA#29 | Hatred | 1464. Light | 4 Mar 2010 00:17 | 2 |
WA#29 Hatred 4 Mar 2010 00:12 What it could be? Any tests please. Well, after I started to use double instead of float, it passed the test. |
| Problem with 8 is... | Hanzbrow (TNU) KCC | 1423. String Tale | 3 Mar 2010 21:31 | 4 |
Why I've got MLE(19 MB). I use KMP and I don't understand why at all! I appeal to you for help... #include<iostream> #include<string> #include<vector> using namespace std; int main() { int i, j, f=0, n; string what_to_find, gde; cin>>n>>what_to_find>>gde; what_to_find+="#"; what_to_find+=gde; what_to_find+=gde; gde=""; vector<short> next(what_to_find.size()); next[0]=0; for(i=1; i<what_to_find.size(); i++){ if(what_to_find[i]==what_to_find[next[i-1]]) next[i]=next[i-1]+1; else { j = next[i-1]; while (j>0 && what_to_find[i]!=what_to_find[j]){ j=next[j-1]; if(what_to_find[i]==what_to_find[j]) next[i]=j+1; } } if(next[i]==n) { f=1; break; } } if(f) cout<<i-2*n; else cout<<-1; return 0; } When I was using strings,I had MLE 8. Bit in my AC programm I used arrays of char. I get MLE#8 too, using std::string but my AC program with arrays uses only 4.4 MB... Admins, can you please explain such strange behaviour of the judge system? Try to preallocate strings: int n; cin >> n >> ws; string str(n,' '); getline(cin, str); |
| Mistake in statement | Fyodor Menshikov | 1417. Space Poker 2 | 3 Mar 2010 19:30 | 3 |
подсмотренная ими у каких подвыпивших космонавтов -> подсмотренная ими у каких-то подвыпивших космонавтов |
| Java vs MLE | unlucky [Vologda SPU] | 1287. Mars Canals | 3 Mar 2010 19:19 | 2 |
If you use Java pay attention to size of arrays, that you used. I used 2 arrays for saving current line and prev line of input(every has o(n) elements), and 2 arrays for saving result of calculating in prev Line, and for saving result of calculation in current line (every has o(n) elements). Edited by author 21.02.2010 15:56 This problem is not so memory consuming. Java solution using variable char field[][] = new char[1 + n + 1][1 + n + 1]; gets AC. So it is possible to store whole input in memory, but it is impossible to store significant amount of data for each cell. For example 4 arrays NxN of 16-bit ints need extra 16 Mb of memory while total ML is 16 Mb. |
| Hint: use Java (+) | ASK | 1204. Idempotents | 3 Mar 2010 16:29 | 1 |
Make a table of first 3401 primes to factor n; use BigInteger.modInverse instead of coding extended GCD algorithm. |
| Output limit exceeded | zam_sabina | | 3 Mar 2010 14:48 | 1 |
Who knows what does Output limit exceeded mean? thanks. |
| What is the limit for M? | DEF | 1500. Pass Licenses | 2 Mar 2010 13:14 | 5 |
It is not actual. Possibly K*N*(N+1)/2. It's also not actual. It seems to me test#20 has multiedges. In that case M is not limited at all )))) |
| Help me please... why WA 1? | Winner | 1007. Code Words | 2 Mar 2010 02:05 | 2 |
var n: integer; s: string; function Go(s: string): string; var sum: integer; i: integer; j: integer; stmp: string; tmp: integer; begin s:=trim(s); sum:=0; for i:=1 to length(s) do if s[i]='1' then sum:=sum+i;
if (length(s)=n) and (sum mod (n+1) = 0) then begin result:=s; exit; end; if (length(s)=n-1) then begin if sum mod (n+1) = 0 then result:=s+'0' else result:=s+'1'; exit; end; if (length(s)=n+1) then begin for i:=1 to length(s) do begin stmp:=s; Delete(stmp,i,1); tmp:=0; for j:=1 to length(stmp) do if stmp[j]='1' then tmp:=tmp+j; if tmp mod (n+1) = 0 then begin result:=stmp; exit; end; end; end; for i:=length(s) downto 1 do if (s[i]='1') then if ((sum-i) mod (n+1) = 0) then begin s[i]:='0'; break; end else else if ((sum+i) mod (n+1) = 0) then begin s[i]:='1'; break; end; result:=s; end; begin // assign(input,'input.txt'); reset(input); readln(n); while not eof do begin readln(s); writeln(Go(s)); end; // sleep(12121); end. see also this (or give more test data): #include <iostream> #include <string> using namespace std; short N; char word[2001][1001]; int main(){ int i=0,j,n,s=0,c=0,temp; cin>>N; while(cin>>word[i])i++; n=i; for(i=0;i<n;i++){ ////////////////////// CASE 1 (REPLACED)////////////////////// if(strlen(word[i])==N){ for(j=0;j<N;j++) if(word[i][j]=='1')s+=j+1; s%=(N+1); word[i][s-1]='0'; } ////////////////////// CASE 2 (REMOVED)////////////////////// else if(strlen(word[i])==N-1){ for(j=0;j<N-1;j++) if(word[i][j]=='1'){ s+=j+1; c++; } s%=(N+1); if(s!=0)s=N+1-s; if(s<=c){ // Removed '0' for(j=N-2;s!=0;j--){ word[i][j+1]=word[i][j]; if(word[i][j]=='1')s--; } word[i][j+1]='0'; } else { // Removed '1' short mod=s; c=0; for(j=s;j<N-1;j++) if(word[i][j]=='1')c++; while(s+c!=mod){ s--; if(word[i][s-1]=='1')c++; } for(j=N-1;j>=s;j--)word[i][j]=word[i][j-1]; word[i][s-1]='1'; } } ////////////////////// CASE 3 (INSERTED)////////////////////// else if(strlen(word[i])==N+1){ for(j=0;j<N+1;j++) if(word[i][j]=='1')s+=(j+1); s%=(N+1); for(j=N;j>=0 && c!=s;j--) if(word[i][j]=='1')c++; if(j>=0 && word[i][j]=='0'){ // Inserted '0' for(;j<N;j++)word[i][j]=word[i][j+1]; word[i][j]=0; } else { // Inserted '1' if(s==0)s=N+1; short mod=s; c=0; for(j=s;j<N+1;j++) if(word[i][j]=='1')c++; while(s+c!=mod){ s--; if(word[i][s]=='1')c++; } for(j=s-1;j<N+1;j++)word[i][j]=word[i][j+1]; word[i][j]=0; } } s=c=0; } for(i=0;i<n;i++)cout<<word[i]<<endl; return 0; } |
| Codeforces Beta Round #3 - http://codeforces.com/ | MikeMirzayanov | | 1 Mar 2010 16:02 | 1 |
Welcome to the next http://codeforces.com/ round. I'm glad to invite you to take part in Codeforces Beta Round #3. It starts on Thursday, March 4, 2010 19:30 (UTC +3, Moscow time). Click http://www.timeanddate.com/worldclock/fixedtime.html?year=2010&month=03&day=04&hour=16&min=30&sec=0&p1=0to view the time in the other time zones. The contest duration is 2 hours. The allowed programming languages are C/C++, Pascal, Java, C#, Python, Ruby and PHP. Recently we have introduced Codeforces rating system. Currently vepifanov is the highest-rated coder, but Codeforces is at the initial stage now, and all sorts of changes can be introduced in future. Want to compete? - click http://codeforces.com/contests/ If you are Russian speaking try http://codeforces.ru/. Wish you high rating, MikeMirzayanov --- http://codeforces.com/http://codeforces.ru/ |
| How is this posible? | cNoNim | 1001. Reverse Root | 28 Feb 2010 20:17 | 3 |
execution time depends on at what time starts the test? ie of server load? Try to use the array of chars:) |