Common Board| Show all threads Hide all threads Show all messages Hide all messages | | WA5 | kamsiroy | 1016. Cube on the Walk | 3 Aug 2010 15:17 | 1 | WA5 kamsiroy 3 Aug 2010 15:17 does anyone know what's the Test 5 ? Or can sent some tests. Thx | | If you are stuck | void | 1378. Artificial Intelligence | 3 Aug 2010 03:14 | 1 | Try to find minimal and maximal distance between figure's center and border, and think about possible shapes. | | What's the test 5? | uuu | 1097. Square Country 2 | 1 Aug 2010 15:08 | 1 | Who can give me the test 5?I get WA5!Thanks! | | Wa Test #3 help Me | Quyon | 1085. Meeting | 1 Aug 2010 05:15 | 2 | Try test 4 2 2 1 2 2 2 3 2 0 3 1 0 2 1 answer 1 0 | | if WA9 | yuanyuan | 1060. Flip Game | 31 Jul 2010 19:45 | 2 | if WA9 yuanyuan 7 May 2009 11:48 if WA9, try to check wwww wwww wwwb wwbb ans=1 My solution: program p1060; type frr=array[0..5,0..5] of boolean; var f:frr; ans:byte; procedure init; var i,j:byte; ch:char; begin fillchar(f,sizeof(f),true); for i:=1 to 4 do begin for j:=1 to 4 do begin read(ch); if ch='b' then f[i,j]:=false; end; readln; end; end; function check(f:frr):boolean; var b:boolean; i,j:byte; begin b:=f[1,1]; for i:=1 to 4 do for j:=1 to 4 do if f[i,j]<>b then exit(false); exit(true); end; function min(a,b:byte):byte; begin if a<b then exit(a) else exit(b); end; procedure find(f:frr;x,y,t:byte); begin if check(f) then begin ans:=min(ans,t); exit; end; if x>4 then exit; if y=4 then find(f,x+1,1,t) else find(f,x,y+1,t); f[x,y]:=not(f[x,y]); f[x-1,y]:=not(f[x-1,y]); f[x+1,y]:=not(f[x+1,y]); f[x,y-1]:=not(f[x,y-1]); f[x,y+1]:=not(f[x,y+1]); if y=4 then find(f,x+1,1,t+1) else find(f,x,y+1,t+1); end; procedure outit; begin if ans=17 then writeln('Impossible') else writeln(ans); end; begin init; ans:=17; find(f,1,1,0); outit; end. Edited by author 07.05.2009 11:48 Edited by author 07.05.2009 11:49 Yeah !! Thank you very much; I had tried many times. | | TLE#12. Algo Kruscal doesn't work! Help :( | Alexey | 1416. Confidential | 31 Jul 2010 19:29 | 2 | Please, tell me what kind of mistake can I have? I see that there are a lot of persons who has problems with Test#12. Is there smth speciale? Thanks. Edited by author 14.05.2006 15:27 I also have TLE 12 and write Kruskal and his advanced version with DSU. It doesn't meter. But when at finding secondcost i stoped finding, if secondcost became equal to firstcost i got AC at Java with 0.2 sec with complexity o(n^3) at worst case :-) Edited by author 31.07.2010 19:32 | | Nice problem! | Andrew Hoffmann aka SKYDOS [Vladimir SU] | 1497. Cutting a Square | 31 Jul 2010 19:24 | 1 | Nice problem! Andrew Hoffmann aka SKYDOS [Vladimir SU] 31 Jul 2010 19:24 Try these tests: (1) - No 10001 11001 10011 11111 11111 (2) - Yes 100001 110001 111001 111011 111111 111111 (3) - Yes 111111 111010 111010 111010 111010 000000 Good luck! Edited by author 31.07.2010 19:34 | | IMHO, good test for convex hull solutions | Alexander Samal | 1246. Tethered Dog | 31 Jul 2010 19:03 | 1 | 9 0 0 1 0 1 1 2 2 3 1 3 0 4 0 4 3 0 3 answer: ccw Edited by author 31.07.2010 19:05 | | How to solve it? | Fdg | 1772. Ski-Trails for Robots | 31 Jul 2010 14:43 | 3 | DP + sqrt-decomposition (or tree-like structure) I think that Djkstra in graph of robot's ends will work. | | To admins! Bug with C# compiler. | OpenGL | | 31 Jul 2010 03:38 | 2 | My submit #3115142 get CE. And report on this submit contains strange symbols. Edited by author 31.07.2010 01:15 Fixed Vladimir Yakovlev (USU) 31 Jul 2010 03:38 | | At last I solved it! | bsu.mmf.team | 1763. Expert Flea | 30 Jul 2010 20:30 | 1 | It was really difficult for me, although I read one very good article and understood the idea of the solution. And I don't know how to solve it without any precalculations. I did a lot of them. Does there exists another solution, without using a big recurrence formula? You can read about this problem here: http://www.cse.ust.hk/tcsc/RR/2004-02.ps.gz | | I am sure that my algo is right,but WA#4 | nargiT | 1075. Thread in a Space | 30 Jul 2010 20:19 | 1 | // 1075.cpp : Defines the entry point for the console application. // #include <iostream> #include <cmath> #include <algorithm> #include <iomanip> #include <stdio.h> using namespace std; struct point{ int x; int y; int z; void in(point *); double dist(point *,point *); }Tigran; void point::in(point *a){ cin>>a->x; cin>>a->y; cin>>a->z; } double point::dist(point *a, point *b){ double res_x,res_y,res_z; double total_res; res_x=((a->x)-(b->x))*((a->x)-(b->x)); res_y=((a->y)-(b->y))*((a->y)-(b->y)); res_z=((a->z)-(b->z))*((a->z)-(b->z)); total_res=sqrt(res_x+res_y+res_z); return (total_res); } int main(){ double answer; point a,b,c; double t; double d; double x,y,z; int R; Tigran.in(&a); Tigran.in(&b); Tigran.in(&c); cin>>R; x=Tigran.dist(&a,&c); y=Tigran.dist(&b,&c); z=Tigran.dist(&a,&b); if((x*x+z*z<=y*y) && (y*y+z*z<=x*x)){ answer=z; } else { t=acos((x*x+y*y-z*z)/(2*x*y)); d=(x*y*sin(t))/z; if(d>=(double)R){ answer=z; } else { answer=sqrt(x*x-R*R)+sqrt(y*y-R*R)+R*(t-acos(R/x)-acos(R/y)); } } printf("%0.2f",answer); return (0); } | | "Задач послано" и "Задач решено" | Andrew Hoffmann aka SKYDOS [Vladimir SU] | | 30 Jul 2010 19:41 | 3 | Задач послано 120 Задач решено 111 Задач решено - ясно как подсчитывается, а вот как считается "Задач послано", как-то понять не могу. Возможно ли при "задач послано">"задач решено" уравнять эти значения, если да, то как? Thanks! Solved - number of solved problems (Привет КЭП :) ) Submitted - number of problem, which you tried to solve (may be, unsuccessful). Submitted - number of problem, which you tried to solve (may be, unsuccessful). Got it! Thanks ;) | | What is the answer for n = 10? | DK [Samara SAU] | 1763. Expert Flea | 30 Jul 2010 17:51 | 6 | And what is the answer for n = 20. Is it 19044? Simple backtrack can easily yield the answers up to 30 (and more). However, this didn't help me much. Here there are if it will help you with something. Answer for n = 6 is 12 Answer for n = 7 is 46 Answer for n = 8 is 144 Answer for n = 9 is 110 Answer for n = 10 is 312 Answer for n = 11 is 290 Answer for n = 12 is 670 Answer for n = 13 is 706 Answer for n = 14 is 1538 Answer for n = 15 is 1732 Answer for n = 16 is 3504 Answer for n = 17 is 4288 Answer for n = 18 is 8098 Answer for n = 19 is 10568 Answer for n = 20 is 19044 Answer for n = 21 is 26042 Answer for n = 22 is 45222 Answer for n = 23 is 64220 Answer for n = 24 is 108382 Answer for n = 25 is 158324 Answer for n = 26 is 261754 Answer for n = 27 is 390314 Answer for n = 28 is 635666 Answer for n = 29 is 962282 Answer for n = 30 is 1550244 Answer for n = 31 is 2372372 Answer for n = 32 is 3792560 Thank you! These answers helped me a lot. | | how read data? | tttwet | 1612. Tram Forum | 30 Jul 2010 13:17 | 2 | hi guys how i must read string, using c# i mean read the WHOLE string, not just trim before '\n' sry for my language while((line=Console.ReadLine())!=null){ //..code here } | | time-time-time... | azolotykh | 1100. Final Standings | 30 Jul 2010 11:24 | 2 | that's simply funny - I got result in 1.046sec, but need 1sec... That's unfair.. Simply if you exceed TL, system kill your program and output time of execution of your program. That's why your time a little more than TL. Try to send program, which works infinitelly. | | why, i get compile error | XMAN | 1150. Page Numbers | 30 Jul 2010 04:24 | 2 | #include<conio.h> #include<math.h> #include<stdio.h> int k,t[10]; double fonction (int n, int i) { int h; if(n==1) { if(t[n]>=i) { return 1; } else { return 0; } } else { if(t[n]>i) { return ((pow(10,n-1))+(t[n]*pow(10,n-2))+(fonction(n-1,i))); } if(t[n]==i) { h=int(k/pow(10,n-1)); return (((k-(h*pow(10,n-1)))+1)+(t[n]*pow(10,n-2))+(fonction(n-1,i))); } if(t[n]<i) { return ((t[n]*pow(10,n-2))+(fonction(n-1,i))); } } } int main() { int n=0,i=1,j,m,r=1,w=0; scanf("%d",&k); m=k; // double q=1.56; while(m!=0) { n++; t[n]=m%10; m=m/10; //printf("%d",t[n]);
} for(i=0;i<n;i++) { w+=pow(10,i); } r=int(fonction(n,0)); printf("%d\n",r-w); for(i=1;i<10;i++) { r=int(fonction(n,i)); printf("%d\n",r); } getch();
return 0; } It's not allowed to use <conio.h> and getch(). Read FAQ. | | How to realize long arithmetic in c++?(please, in example) | Cebiyev Ferhad | | 29 Jul 2010 23:06 | 3 | Thank you. I think this will be helpful for me. | | WA2 | remdy21 | 1077. Travelling Tours | 29 Jul 2010 19:59 | 1 | WA2 remdy21 29 Jul 2010 19:59 why WA2?? program ural; var n,a,b,y:byte; m,i,z,r:integer; h,g:array[1..200]of integer; t:array[1..32767]of byte; l:array[1..32767]of integer; p,q:array[1..32767]of boolean; s:array[1..200]of byte; k:array[1..400]of integer; o:array[1..400]of byte; u:array[1..200]of boolean; x:boolean; procedure search(d:byte); var r:integer; begin u[d]:=true; r:=h[d]; while r<>0 do begin if u[t[r]]=false then begin inc(y); k[y]:=g[d]; g[d]:=y; o[y]:=t[r]; inc(y); k[y]:=g[t[r]]; g[t[r]]:=y; o[y]:=d; p[r]:=true; if q[r] then p[r+1]:=true else p[r-1]:=true; search(t[r]); end; r:=l[r]; end; end; procedure track(v,d:byte); var r:byte; begin if d=i then begin write(v,' '); for r:=1 to v-1 do write(s[r],' '); writeln(d); x:=true; exit; end; u[d]:=true; s[v]:=d; r:=g[d]; while r<>0 do begin if u[o[r]]=false then track(v+1,o[r]); if x then exit; r:=k[r]; end; end; begin assign(input,'travel.in'); assign(output,'travel.out'); reset(input); rewrite(output); readln(n,m); for i:=1 to m do begin readln(a,b); inc(r); l[r]:=h[a]; h[a]:=r; t[r]:=b; q[r]:=true; inc(r); l[r]:=h[b]; h[b]:=r; t[r]:=a; end; z:=m-n; for i:=1 to n do if u[i]=false then begin inc(z); search(i); end; if z<=0 then begin writeln(0); exit; end else writeln(z); for i:=1 to n do begin r:=h[i]; while r<>0 do begin if(q[r])and(p[r]=false)then begin x:=false; fillchar(u,sizeof(u),false); track(1,t[r]); end; r:=l[r]; end; end; end. | | No subject | Narek X | 1008. Image Encoding | 29 Jul 2010 15:04 | 1 | Edited by author 29.07.2010 21:50 |
|
|