Common Board| Show all threads Hide all threads Show all messages Hide all messages | | if array [1..16600000](longint) then crash(acces violation) if array[1..17000000] then memory exceed.... What to do???? | green_smile | 1915. Titan Ruins: Reconstruction of Bygones | 22 Dec 2012 15:33 | 4 | What to do with this problem??? Me too, always access violation if type 0 10^6-2 times, and 2 first elements would be nums, so num of elements in array would be 2^(10^6-2). I think that's the problem | | To admins: does test1 coincide with the sample test from problem statement? | lenny | 1332. Genie Bomber | 21 Dec 2012 19:12 | 1 | | | WA 17 | SKYDOS | 1027. D++ Again | 20 Dec 2012 20:54 | 4 | WA 17 SKYDOS 1 Aug 2009 15:17 what's in this test что в этом тесте может быть такого? перепроверил все уже... все примеры с форума, свои придумал, но все-равно ВА17 кто знает тест? Edited by author 01.08.2009 17:05 решил. спасибо всем ) Edited by author 01.08.2009 17:20 May be somebody knows the answer? I need an advice... Yeah!!! I solved it! You only need to look through themes before Edited by author 07.08.2009 20:52 Do not forget that space character can not be inside arithmetic expression! That was the reason why I got WA17. Re: WA 17 Inspector [Barnaul] 20 Dec 2012 20:54 Thank you, a good man) It realy works! | | WA2 | pmartynov | 1109. Conference | 20 Dec 2012 12:41 | 2 | WA2 pmartynov 19 Dec 2012 03:09 Could someone provide me with a test case? Each test from the discussion list passes ok. But still WA2. Edited by author 20.12.2012 00:01 Re: WA2 pmartynov 20 Dec 2012 12:41 Wrote more than 40 tests by myself to check. All passed correctly. Any help would be appreciated. | | Some tests, please (-) | exwRabbits_AlMag(VNTU) | 1753. Bookshelf | 20 Dec 2012 08:23 | 2 | 12 234 1344 80.7365278858 10 11 12 0 1 999 1000 487.6458506118 | | halp me please | Zamesova | 1020. Rope | 19 Dec 2012 15:25 | 2 | Program NoName; var n,r,i:integer; x: array [1..100] of real; y: array [1..100] of real; s,sg:real; input,output:text; begin s:=0; assign(input, 'input.txt'); reset(input); assign(output, 'output.txt'); rewrite(output); readln(n,r); if n=1 then writeln(1.00)else begin For i:=1 to n do readln(x[i],y[i]); sg:=2*pi*r; For i:=1 to n-1 do s:=s+sqrt(sqr(x[i]-x[i+1])+sqr(y[i]-y[i+1])); s:=s+sqrt(sqr(x[n]-x[1])+sqr(y[n]-y[1])); s:=s+sg; end; writeln(s:1:2); close(input); close(output); end. First, remove the read and write in the txt files, you need to read/write from/to the console. You'll get WA3 now. Try to re-think the case when n=1; the answer is not always 1! | | please give me test 4!!!!! | [TH0112]_o.o | 1837. Isenbaev's Number | 19 Dec 2012 04:15 | 1 | | | wa test 4? | [TH0112]_o.o | 1837. Isenbaev's Number | 19 Dec 2012 04:02 | 1 | Edited by author 19.12.2012 04:05 wrong test 4? 1837, why? Edited by author 19.12.2012 04:06 Edited by author 19.12.2012 04:06 Edited by author 19.12.2012 04:06 Edited by author 19.12.2012 04:07 Edited by author 19.12.2012 04:10 | | Why WA#1? | S.Spooky | 1837. Isenbaev's Number | 18 Dec 2012 22:54 | 3 | I can't realize what my problem is! #1 must be the simplest test case ( or the sample given ) but I can't see anything in my code that seems to be wrong... can YOU help me? I also have a WA #1 Did you find the problem? my problem is using fflush(stdin) after cin>>n ;(n= number of team), When I delete "fflush(stdin);" , I would pass #1. But I have problem with #9. Haha... | | Maybe useful | KNIGHT0X300 | 1075. Thread in a Space | 18 Dec 2012 21:36 | 1 | I got AC as I changed all ints to longs. I thought ints would be sufficient to do the sum. Still can't figure out why longs are needed. | | i don't understand why? | Rustam | 1645. Ski Race | 18 Dec 2012 15:57 | 6 | could you explain me test and answer? i can't understand how this situation may happen finally i understood the problem. solution is much easier than it's problem. the problem's solution is very easy: to find min: min[i] = i -count of a[j] where{j<i and a[j]>a[i]} to find max: max[i] = n -count of a[j] where{j>i and a[j]>a[i]} good luck! Much more harger and so important is to prove the result. here is my solution, i don't know why it is not correct and i always wa at #6 lowest: min[i] = count of a[j] where{j>i and a[j]<a[i]} + 1 highest: max[i] = n - count of a[j] where{j<i and a[j]>a[i]} i need some help, thx. Edited by author 28.10.2008 08:15 finally i understood the problem. solution is much easier than it's problem. the problem's solution is very easy: to find min: min[i] = i -count of a[j] where{j<i and a[j]>a[i]} to find max: max[i] = n -count of a[j] where{j>i and a[j]>a[i]} good luck! I think there are some mistakes in your code. For other: Don't look at this code. Think yourself (As I) :) You are right,that anwer got Wa6 | | Also wa 6,what is the test | Pegasus | 1645. Ski Race | 18 Dec 2012 15:43 | 1 | | | what's is test 15? | BLOODik | 1839. The Mentaculus | 18 Dec 2012 12:53 | 1 | I've got a wrong answer on test 15. By the way... in order to satisfy condition #4 we need to test each "good" point with each "good" point? won't it be too much iterations for n=10000? P.S. "good" point is the point that satisfy the current arc? | | Is it possible to beat MLE with c#? | AIT | 1148. Building Towers | 18 Dec 2012 02:16 | 3 | I tried my solution, I think it should use at most 2MB of memory and got MLE on first test? Is it c# related problem or my solution is that bad? up: i checked the memory usage for 30000 60 10, it's about 300000*4 bytes | | No subject | Rasul | 1000. A+B Problem | 18 Dec 2012 00:25 | 4 | #include<iostream> #include<string> using namespace std; int n,sum[999],l=0; char a[101],b[101]; int main(){ cin>>n; for(int i=0;i<n;i++) cin>>a[i]>>b[i]; for(int i=0;i<n;i++){ if(a[i]=='a') a[i]='1'; if(a[i]=='b') a[i]='2'; if(a[i]=='c') a[i]='3'; if(a[i]=='d') a[i]='4'; if(a[i]=='e') a[i]='5'; if(a[i]=='f') a[i]='6'; if(a[i]=='g') a[i]='7'; if(a[i]=='h') a[i]='8'; } for(int i=0;i<n;i++){ if(a[i]-48+2<=8&&a[i]-48+2>0&&b[i]-48+1<=8&&b[i]-48+1>0) sum[i]=sum[i]+1; if(a[i]-48+1<=8&&a[i]-48+1>0&&b[i]-48+2<=8&&b[i]-48+2>0) sum[i]=sum[i]+1; if(a[i]-48-1<=8&&a[i]-48-1>0&&b[i]-48+2<=8&&b[i]-48+2>0) sum[i]=sum[i]+1; if(a[i]-48-2<=8&&a[i]-48-2>0&&b[i]-48+1<=8&&b[i]-48+1>0) sum[i]=sum[i]+1; if(a[i]-48-2<=8&&a[i]-48-2>0&&b[i]-48-1<=8&&b[i]-48-1>0) sum[i]=sum[i]+1; if(a[i]-48-1<=8&&a[i]-48-1>0&&b[i]-48-2<=8&&b[i]-48-2>0) sum[i]=sum[i]+1; if(a[i]-48+1<=8&&a[i]-48+1>0&&b[i]-48-2<=8&&b[i]-48-2>0) sum[i]=sum[i]+1; if(a[i]-48+2<=8&&a[i]-48+2>0&&b[i]-48-1<=8&&b[i]-48-1>0) sum[i]=sum[i]+1; } for(int i=0;i<n;i++) cout<<sum[i]<<endl; } Подсказка Используйте + var n,i,j,k:integer;s:real;a:array[1..20,1..20] of real;zer:boolean; label 1; begin s:=1; readln(n); for i:=1 to n do for j:=1 to n do read(a[i,j]); for k:=1 to n-1 do if a[k,k]=0 then begin zer:=true;goto 1; end else for i:=k+1 to n do for j:=k+1 to n do a[i,j]:=a[i,j]-a[i,k]*a[k,j]/a[k,k]; for k:=1 to n do s:=s*a[k,k]; writeln(s:0:0); 1:if zer then writeln('0'); for i:=1 to n do begin for j:=1 to n do write(a[i,j],' '); writeln; end; end. var a:array[1..100,1..100] of integer;k,n,m,max,x,y,i,j:integer; begin readln(n,m); readln(x,y); for i:=1 to n do for j:=1 to n do a[i,j]:=abs(i-x)+abs(j-y); for k:=1 to m-1 do begin readln(x,y); for i:=1 to n do for j:=1 to n do if a[i,j]>abs(i-x)+abs(j-y) then a[i,j]:=abs(i-x)+abs(j-y); end; for i:=1 to n do for j:=1 to n do if a[i,j]>max then max:=a[i,j]; writeln(max); end. var ab,bc,ac,ad,bd,cd:real; a1,a2,a3,a4,b1,b2,b3,b4:real; s,s1,s2,s3:real; function stor(x,y,z,t:real):real; begin stor:=sqrt((sqr(x-y))+(sqr(z-t))); end; function square(n,k,v:real):real; var m:real; begin m:=(n+k+v)/2; square:=trunc(sqrt(m*(m-n)*(m-v)*(m-k))*10); end; begin {repeat} writeln ('Введите координату вершины A'); readln (a1,b1); writeln ('Введите координату вершины B'); readln (a2,b2); writeln ('Введите координату вершины C'); readln (a3,b3); writeln ('Введите координаты точки D'); readln(a4,b4); AB:=stor(a1,a2,b1,b2); BC:=stor(a2,a3,b2,b3); AC:=stor(a1,a3,b1,b3); ad:=stor(a1,a4,b1,b4); bd:=stor(a2,a4,b2,b4); cd:=stor(a3,a4,b3,b4); {if(AB>=BC+AC)or(AC>=AB+BC)or(BC>=AB+AC) then writeln('Это не треугольник, введите данные заново'); until (AB<BC+AC)and(AC<AB+BC)and(BC<AB+AC);} s:=square(ab,bc,ac); s1:=square(ab,bd,ad); s2:=square(bd,cd,bc); s3:=square(cd,ad,ac); {writeln(s,' ',s1,' ',s2,' ',s3);} if abs(s-s1-s2-s3)<5 then writeln ('точка D является внутренней точкой треугольника ABC') else writeln ('точка D не является внутренней точкой треугольника ABC'); {writeln(abs(s-s1-s2-s3));} end. | | Strange compilation error | Georgiy Platonov | 1423. String Tale | 17 Dec 2012 17:58 | 3 | I have strange problem, my code is compiled well on my home PC (MS VC++ 2010 also), but the same code getting compilation error on Timus. Let me present here a fragment of my code (All problem-related part was expunged, only variable declaration-initialization and input remained). This is also a compilable code on my PC. Can you consider it please. Thanks in advance. #pragma comment(linker, "/STACK:5000000") #include <iostream> using namespace std; int main() { char tmp, or[250001], samp[750002]; int N, z[750002]; memset(&z[0], 0, 750002*4); scanf("%i", &N); scanf("%c", &tmp); cin.getline(or, 250001); cin.getline(samp, 750002); return 0; } Code above gives CE on Timus: 8002b36b-0800-4fc8-aa2b-53e6cb233ddd 8002b36b-0800-4fc8-aa2b-53e6cb233ddd(7) : error C2059: syntax error : '||' 8002b36b-0800-4fc8-aa2b-53e6cb233ddd(12) : error C2143: syntax error : missing ')' before '||' 8002b36b-0800-4fc8-aa2b-53e6cb233ddd(12) : error C2661: 'std::basic_istream<_Elem,_Traits>::getline' : no overloaded function takes 0 arguments with [ _Elem=char, _Traits=std::char_traits<char> ] 8002b36b-0800-4fc8-aa2b-53e6cb233ddd(12) : error C2059: syntax error : ',' 8002b36b-0800-4fc8-aa2b-53e6cb233ddd(12) : error C2059: syntax error : ')' 8002b36b-0800-4fc8-aa2b-53e6cb233ddd(13) : error C2065: 'samp' : undeclared identifier try rename array "or", I think it can resolve problem Thanks, the idea of renaming really worked! | | Time limit test#10 | Plakhov618 | 1423. String Tale | 17 Dec 2012 02:55 | 2 | Why? code pascal program z1; var s, s1:string; n, x:longint; begin readln(n); readln(s); readln(s1); if s=s1 then write(0) else begin s:=s+s; case pos(s1, s) of 1..250000:writeln(n-pos(s1, s)+1); else write(-1); end; end; readln; end. Your algorithm is wrong, read more about KMP algorithm or string hashing P.S. Test for you: aaa...aaa aaa...aab | | Help for WA2 | casey | 1297. Palindrome | 16 Dec 2012 18:37 | 4 | Input: abc Expected output: a My program was failing test 2 because I was not initialing correctly and so returned b for this case. Just in case any one else has this problem. Thanks a lot I never thought of initializing the first character. Got AC once fixed :) Thank you.You are such a helpful person. | | test 33 | Arsen Babakhanyan (AUA) | 1777. Anindilyakwa | 16 Dec 2012 01:12 | 1 | test 33 Arsen Babakhanyan (AUA) 16 Dec 2012 01:12 What is in test 33 ? The same code with Scanner is accepted but with StreamTokenizer and BufferedReader is giving WA33. Very unexpected result!! O_O Edited by author 16.12.2012 10:56 | | Little typo | Ivan Nikulin | 1082. Gaby Ivanushka | 15 Dec 2012 19:53 | 1 | There is one typo in both codes: Beautiful, not Beutiful. |
|
|