Общий форумsome tests please!!!!!!!!! usually I write the program mixed with c and c++ and submit as a c++ program and no problem occurs on every site until today's "complilation error" on this site. Недоступна функциональность const_reverse_iterator Выдает ошибку Compilation Error, код: #include <vector> #include <iterator> ... std::vector<long long> storage; ... for (std::vector<long long>::const_reverse_iterator ci=storage.rbegin();ci!=ci.rend();++ci) { ... } Просьба исправить. В VC++8 код чистый и без warningov Use __int64 istead of long long People!!!Can you give me test8 and correct answer,please? All tests in this forum work correctly. It is very cruto Edited by author 04.10.2007 22:46 Edited by author 04.10.2007 22:46 Does S(0) always equal 1? S(0) contains one set (I0,...,Ik)of indexes and it is empty. Product over empty set of indexes is 1, because products have multiplicative property with respect to union of disjoint index sets. sum 1 help please!!!!!!!! How to use DP? I don't know how to solve this problem!!! opt[i] = Min{opt[i-len[j]]} + 1 (1<=j<=N and the No.j word in the dict matches the last len[j] numbers of the telephoon number) any one knws anyting abt test case 9 and also.. wat if there are more than one possible outputs...?? На 9ом тесте срок доставки больше, чем 100,000 #include <cstdio> #include <cmath> #include <memory> const int MAX = 170001; bool prime[MAX]; int p[15001]; void findPrime() { int i,j; memset(prime,true,sizeof(prime)); //for(i = 0;i <MAX; i++) // prime[i] = true; for(i = 2;i < sqrt(MAX);) { if(prime[i] == true) for(j = i * i;j < MAX; j += i) prime[j] = false; if(i == 2) i++; else i += 2; } } int main() { findPrime(); int i,k,j; j = 1; for(i = 2;i < MAX; i++) { if(prime[i]) p[j++] = i; } scanf("%d",&k); while(k--) { scanf("%d",&i); printf("%d\n",p[i]); } return 0; } I got it. In the FAQ,it says that, In C/C++ you cannot call functions from header math.h with integer parameters. This code will not be compiled: sqrt(2). You can write correctly sqrt((double)2) or sqrt(2.0). Kollekcioner[Vologda, VML1] WA8 [1] // Задача 1525. Path 7 авг 2007 22:05 Anybody, help!!! I have WA8, but do not understand why??? Plz, can you give me some test? I m also getting WA8 kindly help .. Is there any1 could give me some noticeable points about this test??? I try both accuracy of 2 and 3 decimal digits after the point but in both cases I got Wrong at test # 15. I put Solution=2*(sqrt(Solution*array[i])) i from n-1 downto 1(I omit same numbers before and my array is sorted in increasing order ). Check your code for errors, because I've the same algo and AC!!! First time I solve this problem on C++ with same algo and have WA#15. When I write my code on Pascal I have AC. . . It's strange. . . May be it's problem with precision or type conversion. Edited by author 02.10.2007 00:52 #include<stdio.h> int map[101][101]; int x,y; int sx,sy; int now; int n; int stack[3][101]; int ps,pe; int push(int x,int y) { stack[1][ps]=x; stack[2][ps]=y; ps++; return 0; } int gen(int x,int y) { int tmp; now++; if(map[y][x+1]==1) { printf("R"); map[y][x+1]=0; push(x+1,y); } if(map[y+1][x]==1) { printf("T"); map[y+1][x]=0; push(x,y+1); } if(map[y][x-1]==1) { printf("L"); map[y][x-1]=0; push(x-1,y); } if(map[y-1][x]==1) { printf("B"); map[y-1][x]=0; push(x,y-1); } if(now<n) printf(",\n"); else printf(".\n"); while(pe!=ps) { tmp=pe; pe++; gen(stack[1][tmp],stack[2][tmp]); } return 0; } int main() { int i; scanf("%d",&n); scanf("%d%d",&sx,&sy); for(i=2;i<=n;i++) { scanf("%d%d",&x,&y); map[y][x]=1; } printf("%d %d\n",sx,sy); now=0; gen(sx,sy); return 0; } What's Wrong?? the runid of my submission is 1789597. Oh, I got it... struct Edge{ int from,to,cost; }; a.push_back((Edge){i,j,c}); caused CE :( 5 2 0 0 1 4 0 0 1 5 0 0 1 6 0 0 1 3 0 0 1 My accepted code outputs this answer: 0, 1, 4 2, 3 Obviously the right answer is 0, 1, 2, 3, 4 My corrected code got WA on test #34 (sbm.id 1787693) WA: Memory limit exceeded... Edited by author 30.08.2007 12:47 Edited by author 30.08.2007 12:47 1000000000 bytes is a little bigger then 16 MB Edited by author 29.08.2007 17:53 I think you should find another way to solve this problem) Good Luck) You could save only teacher's list. What's trick in the 1st test??? #include <iostream.h> #include <stdio.h> int main() { unsigned __int64 sum; unsigned __int64 res; scanf("%I64d",&sum); res = sum % 7; printf("%I64d\n",res); return 0; } Do you really think that unsigned __int64 consist of 10^50 digits?? :) You should use long arithmetics, or strings. Think about it. |
|