Show all threads Hide all threads Show all messages Hide all messages |
Test #3 | FlashKa | 1116. Piecewise Constant Function | 12 May 2010 23:57 | 2 |
Try to test with zero-length sequences (containing no one interval) |
Precision in 24 test | Adler | 1369. Cockroach Race | 12 May 2010 18:28 | 1 |
In 24 test precision greater than 18? why? |
Format input | alp | 1759. Long-Livers | 12 May 2010 13:32 | 2 |
Always format input is dd.mm.yyyy dd.mm.yyyy dd.mm.yyyy dd.mm.yyyy dd.mm.yyyy dd.mm.yyyy or may be (for example) 2 dd.mm.yyyy dd.mm.yyyy dd.mm.yyyy dd.mm.yyyy dd.mm.yyyy dd.mm.yyyy ? Edited by author 09.05.2010 02:02 Format is dd.mm.yyyy dd.mm.yyyy dd.mm.yyyy dd.mm.yyyy dd.mm.yyyy dd.mm.yyyy |
Test for your WA#4 | Mihran Hovsepyan {1 kurs of <RAU>} | 1038. Spell Checker | 11 May 2010 22:03 | 4 |
,.'A'..'Z'a'..'z in this test my program gave "2" and got WA4, but now I got AC, because the correct answer is "1". , . // . ' A // Ok ' . // . . // . ' Z // Ok ' a // ok ' . // . . // . ' z // mistake thank you very much!!!This test has helped me to receive AC!!!=)) |
Java -> System.exit(1) | Sasha Bar [TNU] | | 11 May 2010 20:01 | 6 |
Why does System.exit(1) get WA instead of Crash? I want to get CRASH on Timus in run() function, how can i do this? public class Main implements Runnable { ....public void run() { ........throw new RuntimeException(); ....} ....public static void main(String[] args) { ........new Thread(new Main()).start(); ....} } This code gets WA instead of Crash! Edited by author 15.04.2010 03:34 I didn't check it, but something like this should cause CRASH: int[] a = new int[10]; System.out.println(a[20]); or... System.out.println(1/0); Yes, it gets WA... But why? Can anybody explain me? |
I do need some help in the 1068 problem, When using IDE is OK, but submit crash many times. | Hufeng Zhou | 1068. Sum | 11 May 2010 15:38 | 3 |
Hello, I tried many times, but do not know where is the problem, I wrote java and run on IDE it seems OK, but every time when I submitted it can not be accepted. Would you please give me some help. Thank you so much! import java.util.*; public class SumAllInt1068 { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); int d = sc.nextInt(); int f = sc.nextInt(); int e = a+b+c+d+f; System.out.println(e); } } The input consists of a SINGLE integer. You have got Crash because try to read 5 integers. Look Sample test. I understand, thank you so much for your help. |
wa4 | Milanin (TNU) | 1524. Men in Black | 11 May 2010 13:32 | 2 |
wa4 Milanin (TNU) 11 May 2010 01:03 Tell please something helpful to pass fourth test. Maybe it is a misunderstanding of statement. Re: wa4 nikonoff ( ex_ONPU ) 11 May 2010 13:32 you must perform the quests in order, that they become available (not in order of appearance in input data) |
Compilation error... | Yermakov Alex <ONPU> | 1225. Flags | 11 May 2010 02:34 | 2 |
#include <iostream> long int fibonacci(const int ); int main() { int N; std:: cin>>N; const int M=N; std::cout << fibonacci(M)*2;; return 0; } long int fibonacci(const int n) { const int m = n; long int t[m],i; int first = 0, second = 1; t[first]=0; t[second]=1; for (i=second+1; i<m-1; ++i) { t[i] = t[first] + t[second]; first = second; second = i; }
return t[i]; } Edited by author 10.05.2010 18:58 When you got Compil. Error you may check the reason clicking on red Caompilation error link at your submit. |
No subject | lql1993 | 1772. Ski-Trails for Robots | 10 May 2010 21:07 | 2 |
why I get wa on test 39? Edited by author 30.04.2010 17:12 |
test 5 | ghostfreak | 1053. Pinocchio | 9 May 2010 19:59 | 4 |
test 5 ghostfreak 14 Jul 2009 20:48 does anybody knows what is this fucking test 5? if you know write the answer please:) sorry i've mistaked i've written knows instead of know Re: SuperLight 14 Jul 2009 22:45 |
My program works right, please check it, or give me some tests please | Redjee | 1207. Median on the Plane | 9 May 2010 19:46 | 1 |
type point=record x,y:longint; end; var vert:array[1..10000] of point; visited:array[1..10000] of byte; min:point; n,i,k,imin,minvert:integer; Procedure Search_Min_Polar_Angle; var i:integer; min_angle,angle,tg,a,b:real; begin min_angle:=pi; for i:=1 to n do if (visited[i]=0) then begin a:=(vert[i].y-vert[imin].y); b:=(vert[i].x-vert[imin].x); if (b=0) then angle:=pi/2 else begin tg:=a/b; angle:=arctan(tg); end; if (angle<min_angle) then begin min_angle:=angle; minvert:=i; end; end; visited[minvert]:=1; end; Begin readln(n); for i:=1 to n do visited[i]:=0;
// naxojdenie samoy nijney levoy to4ki min.y:=maxlongint; for i:=1 to n do begin readln(vert[i].x,vert[i].y); if (vert[i].y<min.y) then begin min:=vert[i]; imin:=i; end else if (vert[i].y=min.y) and (vert[i].x<min.x) then begin min:=vert[i]; imin:=i; end; end; visited[imin]:=1; //----------------------------------- for k:=1 to n div 2 do Search_Min_Polar_Angle; writeln(imin,' ',minvert); End. Edited by author 09.05.2010 19:47 |
Error in Problem 1057 | Sardor | 1057. Amount of Degrees | 9 May 2010 13:56 | 2 |
It says: 17=2^4+2^0 18=2^4+2^1 20=2^4+2^2 But, since the limit is [15;20], 16 must also be included: 16=2^3+2^3 Create a code to determine the amount of integers, lying in the set [X;Y] and being a sum of exactly K different integer degrees of B. DIFFERENT degrees! |
I do not know why I am wrong, Netbeans works OK, but can not be accepted | Hufeng Zhou | 1000. A+B Problem | 9 May 2010 10:13 | 5 |
I do not know why I am wrong, Netbeans works OK, but can not be accepted, below is my code. public class Main { public static void main(String[] args) { System.out.println("Addition of Two Numbers(a,b) the sum is c"); int a = Integer.parseInt(args[0]); int b = Integer.parseInt(args[1]); int c = a+b; System.out.println( "c="+c ); } } I do not know why I am wrong, Netbeans works OK, but can not be accepted, below is my code. public class Main { public static void main(String[] args) { System.out.println("Addition of Two Numbers(a,b) the sum is c"); // remove line int a = Integer.parseInt(args[0]);// use Scanner() to read numbers. Not console arguments. int b = Integer.parseInt(args[1]); int c = a+b; System.out.println( "c="+c );// your output must mutch with example's output. Just "System.out.println( c ); } } Dear Oleg Strekalovsky: Thank you so much for your help! Dear Oleg Strekalovsky: Due to your great help, my submission has finally been accepted. Thank you so much! |
Who can solove this problem in DP?help me,please | liuzhizhi | 1217. Unlucky Tickets | 9 May 2010 03:44 | 8 |
this is a maths problem! you will do it as 1044 And 1036 but could you say it clearly? thank you. D[i,j,k] : i-th digit with the sum of 1st -> i-th digit = j and the difference between sum of even digits and sum of odd digits = k Result = Sum of D[n div 2,i,j] * D[n div 2,i,j] ; Understand ? No, can you explain it clearly ? Ha Ha! I think it's mostly the same as mine. But they're a little bit different. My Solution was 2 deminition DP. Use algorithm from problem #1036 |
Why system give me WA1? | krey | 1005. Stone Pile | 9 May 2010 00:43 | 1 |
my program variation: #include <stdio.h> #include <math.h> int main() { int nrstones, i, min, w1, w2; int *weights; scanf("%d", &nrstones); weights = new int[nrstones]; for(i = 0; i < nrstones; i++) { scanf("%d", &weights[i]); } min = weights[0]; int perm = 1 << nrstones; for(i = 0; i < perm; i++) { w1 = 0; w2 = 0; int j; for(j = 0; j < nrstones; j++) { if((i >> j) % 2 == 0) w1 += weights[j]; else w2 += weights[j]; } if(min > abs((double)w1 - w2)) { min = abs((double)w1 - w2); if(min == 0) { printf("%d", min); return 0; } } } printf("%d", min); return 0; } |
ok | nya | 1404. Easy to Hack! | 9 May 2010 00:25 | 1 |
Edited by author 09.05.2010 11:37 |
The right idea | VladG | 1022. Genealogical Tree | 8 May 2010 20:07 | 6 |
Nice problem! To solve it your needto use the topological sort on the graph (DAG). It can be done with DFS algorithm. Actually I just sorted twice(one ascending and another one descending) and got AC. Your(compiler) idea is interesting, but not clear to me. Can you tell me your idea in details plz? You can also make this via e-mail: akshinioi@yahoo.com Edited by author 27.04.2005 21:52 VladG is right. It's the topological sort problem. See Cormen, Leiserson, Rivest, Stein "Introduction to algorithms" -> Elementary algorithms for graphs -> Topological sort The idea doesn't seem to be so clear. |
Some Tests | Oleg Strekalovsky [Vologda SPU] | 1217. Unlucky Tickets | 8 May 2010 17:08 | 1 |
Some Tests Oleg Strekalovsky [Vologda SPU] 8 May 2010 17:08 2 10 4 100 14 266095289560 20 187019610394369600 Edited by author 09.05.2010 03:36 |
wa 17 | tereshinvs | 1484. Film Rating | 8 May 2010 12:19 | 1 |
wa 17 tereshinvs 8 May 2010 12:19 {$N+} var x, y, temp:extended; n, l, r, m, sum, res:extended; function rnd(t:extended):extended; begin if frac(t)>=0.5 then rnd:=trunc(t)+1 else rnd:=trunc(t); end; begin readln(x, y, n); l:=10; r:=10*n; x:=x*10; sum:=-1; while l<=r do begin m:=trunc((l+r)/2); temp:=rnd(m/n*10); if abs(temp-x)<10e-12 then begin sum:=m; l:=m+1; continue; end; if temp<x then l:=m+1 else r:=m-1; end; {writeln(sum:0:0);} if sum=-1 then begin writeln('Impossible'); exit; end; l:=0; r:=2000000000; res:=-1; while l<=r do begin m:=trunc((l+r)/2); temp:=(sum+m)/(n+m); if rnd(temp*10)<=y*10 then begin res:=m; r:=m-1; end else l:=m+1; end; if res=-1 then writeln('Impossible') else writeln(res:0:0); end. |
No subject | Krum | 1024. Permutations | 7 May 2010 13:36 | 3 |
i think the compiler of this online judge still using old C.HINT,maybe u use comments notation of C++ ,this is , //. and declare it first before u use it . i sugest u use C++ compiler to submit the answer ,perhaps it will work. |