Common Board| Show all threads Hide all threads Show all messages Hide all messages | | Question about statement | Programmer | 1882. Old Nokia | 16 Nov 2015 01:12 | 5 | If I want to type name "de", and both names "dd" and "de" are exist in contacts, how much seconds it will take? Should i wait 1 second after first pressing 'd'-key? Statement doesn't say anything about waiting, it only says "1 push = 1 second", so i guess only this should be taken into account. ok, then I could mean both ways of pressing key 'def' three times: "ed" or "de" (if this names are in list) Edited by author 14.11.2015 18:13 I think so! I'll have a bit of time in 7 hours, so i'll try to solve this task by then to see if i'm right (but i think, most likely i am) Hmm, i started to try to implement it just now and that made me wonder... If we have test data like 53 wwa wwb ... wwz wy wza wzb ... wzz And say, we want to reach "wy" (or anything after it for that matter), and i wonder what happens... 1) we press 9, then press 9 thrice and reach it, or 2) we press 9, then press 9 twice, and at that point it occurs there's nothing starting with "wx", and the 2nd letter is removed? Well i guess i'll follow 2) for now, but that feels somewhat suboptimal for real phones if we talk about it... Edit: alright, nevermind... seems i was wrong, should've looked into neighbouring topics initially. Gotta redo it... Edited by author 16.11.2015 07:20 | | what is test#1 | Hamdan Sultan | 1316. Electronic Auction | 15 Nov 2015 23:21 | 2 | I got problem in test#1. please help Edited by author 15.11.2015 23:24 | | use SQRT decompose. | Adhambek | 2062. Ambitious Experiment | 15 Nov 2015 06:01 | 4 | You may use segment_tree instead of sqrt_decompose, my solution is segment_tree with very easy idea. Edited by author 27.10.2015 18:43 So, what is the detail of the "segment tree" solution? How to update and query? Thx, in advance.:) A fenwick tree will be faster. Hint : you just need range updates and point queries. My complexity : O(Q * logN * 180). | | If u got WA #1 | ELDAN | 1644. A Whole Lot of Walnuts | 15 Nov 2015 02:48 | 1 | Whos use => ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); => Need to delete, for the solve this problem. I think its a problem #CheckerMechanism | | test 24 | Heracle | 1455. Freedom of Speech | 14 Nov 2015 16:00 | 1 | Even if in the statement it is said that: "Albanian dictionary, found exactly N different words S[i] in it", in test 24 there are identical words, so be careful at this particular case. | | WHY TLE ON TEST #9 MY COD IS SIMPLE | Лерник Казарян [RAU] | 1120. Sum of Sequential Numbers | 14 Nov 2015 14:28 | 2 | #include<iostream> #include<math.h> using namespace std; int main() { long long n,p,a=1; cin>>n; while(1) { p=(1-2*a+sqrt((2*a-1)*(2*a-1)+8*n))/2; if(2*n==2*p*a+p*(p-1)) { cout<<a<<" "<<p; break; } a++; } return 0; } On test #9 my solution got the same problem. Edited by author 14.11.2015 14:30 | | In fact, the statement has an another mistake........ | zmj159 | 1301. Cube in Labyrinth | 14 Nov 2015 11:51 | 1 | The first mistake was mentioned by people prior to me, and it can be easily corrected by understanding the sample I/O. Anyway, the statement mentioned " Moreover, in the final position the upper side must be the same as it was in the initial position.", without emphasizing what shape the upper side may have. So in this case, the sample I/O makes sense if and only if the upper side of the cube is a symmetrical shape. Otherwise, you can make a cube by yourself, and draw an asymmetrical shape(e.g. enter shape) to simulate the sample, and you will find that it is IMPOSSIBLE to move 11 steps to satisfy the description. | | Where is mistake? Who knows test 9? | __Andrewy__ | 1966. Cycling Roads | 14 Nov 2015 00:23 | 1 | const Nmax=500; var Stx,Sty,xx1,yy1,xx2,yy2:array[1..Nmax] of real; numb1,numb2:array[1..Nmax] of integer; a:array[1..Nmax,1..Nmax] of boolean; Nnew:array[1..Nmax] of boolean; N,M,i,j,r,n1,n2:integer; ans:string;
procedure Peres(x1,y1,x2,y2,x3,y3,x4,y4:real); var x0,y0:real; A1,B1,C1,A2,B2,C2,Det:real; begin ans:='No';
if(x1>x2) then begin x0:=x1; y0:=y1; x1:=x2; y1:=y2; x2:=x0; y2:=y0; end; if(x3>x4) then begin x0:=x3; y0:=y3; x3:=x4; y3:=y4; x4:=x0; y4:=y0; end;
A1:=y1-y2; B1:=x2-x1; C1:=x1*y2-y1*x2;
A2:=y3-y4; B2:=x4-x3; C2:=x3*y4-y3*x4;
Det:=A1*B2-A2*B1;
if(x3=x4)and(y3=y4) then begin if(A1*x3+B1*y3+C1=0)and((x1-x3)*(x2-x3)+(y1-y3)*(y2-y3)<=0) then ans:='Yes'; end else begin if(Det<>0) then begin x0:=(C2*B1-C1*B2)/Det; y0:=(C1*A2-C2*A1)/Det; if((x1-x0)*(x2-x0)+(y1-y0)*(y2-y0)<=0)and((x3-x0)*(x4-x0)+(y3-y0)*(y4-y0)<=0) then ans:='Yes'; end else begin if(A2*x1+B2*y1+C2=0) then begin if(x1<=x3)and(x3<=x2) then ans:='Yes'; if(x1<=x4)and(x4<=x2) then ans:='Yes'; if(x3<=x1)and(x1<=x4) then ans:='Yes'; if(x3<=x2)and(x2<=x4) then ans:='Yes'; end; end; end; end; procedure G(v:integer); var u:integer; begin Nnew[v]:=false; for u:=1 to N do begin if(Nnew[u])and(a[v,u]) then begin G(u);end; end; end; BEGIN readln(N,M); for i:=1 to N do begin for j:=1 to N do begin a[i,j]:=false; end; end;
for i:=1 to N do begin readln(Stx[i],Sty[i]); Nnew[i]:=true; end;
r:=0;
for i:=1 to M do begin readln(n1,n2); a[n1,n2]:=true; a[n2,n1]:=true; inc(r); xx1[r]:=Stx[n1]; yy1[r]:=Sty[n1]; xx2[r]:=Stx[n2]; yy2[r]:=Sty[n2]; numb1[r]:=n1; numb2[r]:=n2;
for j:=1 to r-1 do begin Peres(xx1[j],yy1[j],xx2[j],yy2[j],Stx[n1],Sty[n1],Stx[n2],Sty[n2]); if(ans='Yes') then begin a[n1,numb1[j]]:=true; a[n1,numb2[j]]:=true; a[numb1[j],n1]:=true; a[numb1[j],n2]:=true; a[n2,numb1[j]]:=true; a[n2,numb2[j]]:=true; a[numb2[j],n1]:=true; a[numb2[j],n2]:=true; end; end; end;
for i:=1 to N do begin for j:=1 to r do begin Peres(xx1[j],yy1[j],xx2[j],yy2[j],Stx[i],Sty[i],Stx[i],Sty[i]); if(ans='Yes') then begin a[i,numb1[j]]:=true; a[i,numb2[j]]:=true; a[numb1[j],i]:=true; a[numb2[j],i]:=true; end; end; end; G(1); ans:='YES'; for i:=1 to N do if(Nnew[i]) then ans:='NO'; write(ans); END.
| | Weird tl | -XraY- | 1198. Jobbery | 13 Nov 2015 23:55 | 1 | Are you sure you want tests with a lot of input data, such that scanf("%d",...) doesn't work on time? I don't think this is okay. There is a read problem with new g++ compilators. | | WHY WA2 | gamepro | 1221. Malevich Strikes Back! | 13 Nov 2015 15:00 | 1 | If anyone knows what test 2 is? | | solution | wangbicheng1 | 1144. The Emperor's Riddle | 13 Nov 2015 09:22 | 1 | Assume each general's gold a[1],a[2],...,a[m] divide them into b[1]&c[1],b[2]&c[2],...,b[m]&c[m],and b[1]+c[1]=a[1],b[2]+c[2]=a[2],... (b[i] can be any partition from a[i]) Then sort b from big to small, sort c from small to big. We can prove that between b[1]+c[1],b[2]+c[2],...,b[m]+c[m], the biggest minus the smallest would not be worse than the previous one. Continuously do this and we'll get the answer. This solution is developed by Wenbin Tang. Thanks to him! | | TLE16 - Go 1.3 | Evgeny Sibil | 1203. Scientific Conference | 12 Nov 2015 18:58 | 2 | My solution in Go (library sort + O(N)) got TLE on 16. Wrote in in C++ and got accepted. But I really surprised that someone (gadget, zalick, rozdestvenskiy) solved it in Python, which is slower then Go Finally got accepted in Go Used bufio instead of fmt. fmt is unbuffered and might be very slow | | Why wa#5? Help pls! | keqidei | 1305. Convex Hull | 11 Nov 2015 17:17 | 1 | Any one who can tell me why wa#5? | | python 2 . Time limit exceeded ???? Help! | andreikin | 1209. 1, 10, 100, 1000... | 11 Nov 2015 11:13 | 1 | from sys import stdin data = [int(x) for x in stdin.read().split()] dig = max(data[1:]) list ='1'+''.join(['1'+'0'*x for x in xrange(dig+1) if dig>sum(xrange (x))]) print ' '.join([list[x-1] for x in data[1:]]) | | runtime error test 5 | Nico | 1242. Werewolf | 11 Nov 2015 09:53 | 2 | I need you help. What could be the #5 test like? I lengthen my array so as to avoid the RE... | | WA 5 | Artem | 1146. Maximum Sum | 11 Nov 2015 06:33 | 3 | WA 5 Artem 9 Sep 2012 12:59 My program gets WA #5. Did anybody have the same problem? Program works correctly with all inputs I have found. Edited by author 09.09.2012 13:01 | | To admins | SigmaPhiZeta | 1053. Pinocchio | 10 Nov 2015 21:18 | 2 | заходит решение берем пары соседних чисел и выводим минимум из их нодов( #include <iostream> #include <vector> using namespace std; int gcd(int a, int b) { if(a == b) return a; while( a != 0 && b !=0) if(a > b) a%=b; else b%=a; return a+b; } int main() { int N; cin >> N; int array[1000]; for(int i = 0; i < N; i++) cin >> array[i]; if(N == 1) cout << array[0]; else{ vector <int> mins; for(int i = 0; i < N-1; i++) mins.push_back(gcd(array[i], array[i+1])); int min = mins[0]; for(int i = 0 ;i < mins.size(); i++) if(min > mins[i]) min = mins[i]; cout << min; } return 0; } это вроде не камильфо! | | About WA#4 | mberdyshev | 1100. Final Standings | 10 Nov 2015 15:25 | 1 | Do not forget that you should compare solved tasks as ints, not as strings :) | | For C++ users getting TLE | pakhandi | 1934. Black Spot | 10 Nov 2015 13:27 | 1 | Use list to make the adjacency list and not vector. | | A good solution found on the net | wangbicheng1 | 1452. Pascal vs. C++ | 8 Nov 2015 09:43 | 1 | |
|
|