| Show all threads Hide all threads Show all messages Hide all messages |
| The data must be wrong! Please check it. | zhougelin | 1138. Integer Percentage | 9 Apr 2015 02:38 | 5 |
I got WA3,a AC program getWA3, too. I think all ok. For all : be attantive with start values of array (not zero but -inf!!!) I think all ok. For all : be attantive with start values of array (not zero but -inf!!!) thank you very much! Hi PSV, thanks for the help in finding mistake in my program :) |
| Treap TLE 17 O(N*logN) ??? | Gleb Kazantaev (NNSTU) | 1846. GCD 2010 | 9 Apr 2015 02:36 | 1 |
Hi guys, i tryed to solve this problem with the treap (the randomized binary search tree ). It works for O(N*logN) , but i got TLE!!!!! For examlpe, i tryed to solve one problem (1208) with bruteforce (2^18 * 18), and i also got TLE, but on the CodeForces in max case, i got MAX : 0.3ms on the same complillers... Maybe you shouldn't put such small time limits? (Soz for Eng) |
| What is wrong ? (C++) | PimpMyTest | 1001. Reverse Root | 8 Apr 2015 18:04 | 4 |
// The code compiles and works fine. (It expects Ctrl+Z to stop user's input). #include <iostream> #include <math.h> #include <vector> #include <stdio.h> using namespace std; int main(){ unsigned long long a; vector<unsigned long long> b; cin.clear(); while (cin >> a, !cin.eof()) { b.push_back(a); }
for (vector<unsigned long long>::reverse_iterator it = b.rbegin(); it != b.rend(); ++it){ printf("%.4f\n", sqrt((long double)*it));
}
return 0; } #include <iostream> #include <math.h> #include <vector> #include <stdio.h> using namespace std; int main(){ unsigned long long a; vector<unsigned long long> b; cin.clear(); while (cin >> a ) { b.push_back(a); if (cin.eof()) break; } for (vector<unsigned long long>::reverse_iterator it = b.rbegin(); it != b.rend(); ++it){ printf("%.4f\n", sqrt((long double)*it)); } return 0; } |
| С# | Robert | 1785. Lost in Localization | 8 Apr 2015 01:48 | 2 |
С# Robert 22 Oct 2014 02:23 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Name { class Program { static void Main(string[] args) { int a = int.Parse(Console.ReadLine()); if ((1 >= a)&&(a<=4)) Console.WriteLine("few"); if ((5 >= a)&&(a<=9)) Console.WriteLine("several"); if ((10 >= a)&&(a<=19)) Console.WriteLine("pack"); if ((20 >= a)&&(a<=49)) Console.WriteLine("lots"); if ((50 >= a)&&(a<=99)) Console.WriteLine("horde"); if ((100 >= a)&&(a<=249)) Console.WriteLine("throng"); if ((250 >= a)&&(a<=499)) Console.WriteLine("swarm"); if ((500 >= a)&&(a<=999)) Console.WriteLine("zounds"); if (1000 >= a) Console.WriteLine("legion"); } } } Re: С# PI-2014_Movchan 8 Apr 2015 01:48 (1 >= a)&&(a<=4) using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Name { class Program { static void Main(string[] args) { int a = int.Parse(Console.ReadLine()); if ((1 >= a)&&(a<=4)) Console.WriteLine("few"); if ((5 >= a)&&(a<=9)) Console.WriteLine("several"); if ((10 >= a)&&(a<=19)) Console.WriteLine("pack"); if ((20 >= a)&&(a<=49)) Console.WriteLine("lots"); if ((50 >= a)&&(a<=99)) Console.WriteLine("horde"); if ((100 >= a)&&(a<=249)) Console.WriteLine("throng"); if ((250 >= a)&&(a<=499)) Console.WriteLine("swarm"); if ((500 >= a)&&(a<=999)) Console.WriteLine("zounds"); if (1000 >= a) Console.WriteLine("legion"); } } } |
| Test #5 | Saad Taame | 1182. Team Them Up! | 7 Apr 2015 18:31 | 1 |
Test #5 Saad Taame 7 Apr 2015 18:31 Can somebody share test case #5? |
| WA 8 | pmartynov | 1927. Herbs and Magic | 7 Apr 2015 17:01 | 1 |
WA 8 pmartynov 7 Apr 2015 17:01 443 -39 457 33 386 -773 561 127 Correct answer: -1 |
| Please, give me some test. I have #WA_4. | Tkach Andriy | 1377. Lara Croft | 7 Apr 2015 15:35 | 4 |
Here are some tests: 5 6 1 1 1 2 Answer: 1 5 6 1 2 2 6 Answer: 5 5 6 1 5 2 6 Answer: 2 5 6 1 5 1 2 Answer: 3 (Here I think you may have WA, because second point occur first) 5 6 2 3 3 3 Answer: 9 Good Luck!!! My prog passes all of this test but still wa4.why? Test 4 contains (1,1) as second point imho. |
| What is false? | mediant | 1880. Psych Up's Eigenvalues | 6 Apr 2015 16:47 | 1 |
#include <stdio.h> void main(void) { long a[4000],b[4000],c[4000],i,ai,bi,ci,aj,bj,cj,sum=0; scanf("%d",&aj); for(ai=0;ai<aj;ai++) scanf("%d",&a[ai]); scanf("%d",&bj); for(bi=0;bi<bj;bi++) scanf("%d",&b[bi]); scanf("%d",&cj); for(ci=0;ci<cj;ci++) scanf("%d",&c[ci]); for(ai=0;ai<=aj;ai++) { for(bi=0;bi<=bj;bi++) { if(a[ai]==b[bi]) { for(ci=0;ci<=bj;ci++) { if(a[ai]==c[ci]) sum++; } } } } printf("%d",sum); } |
| 1001. Обратный корень | Shaft | 1001. Reverse Root | 5 Apr 2015 02:00 | 1 |
#include <iostream> #include <cmath> #include <stack> using namespace std; int main() { stack <unsigned long long> __stack_sqrt; unsigned long long ent_val; while(cin >> skipws >> ent_val) __stack_sqrt.push(ent_val); cout.setf(ios::showpoint); cout.precision(5); while(!(__stack_sqrt.empty())) { cout << sqrt(__stack_sqrt.top()) << endl; __stack_sqrt.pop(); } return 0; } Compilator wrote "wrong answer", but when i've test it, everything is ok! Please help smb, what's th problem? |
| be careful. | Adhambek | 1414. Astronomical Database | 4 Apr 2015 16:44 | 1 |
initially, there is "sun" in the DATABASE. |
| test 7 - Wrong Answer | Zeratul | 1977. Energy Wall | 3 Apr 2015 23:45 | 2 |
Can't catch where is error. Is there an error in my algorythm? х - energy quantum, amount of which is calculated by division (power_supply/sqr(d)), where 'power_supply' is amount of energy stored by previous save action and 'd' is an area in which wall segments are enforced. Energy portion for each segment is calculated by formula (d-delta)*x, where delta is a distance from the targeted segment. After energy distribution I just set power_supply to 0. Also energy saving and wall enforcing occurs after energy is generated for time passed from previous action. Edited by author 11.09.2013 19:50 If you get WA/RE on 7th test it makes sense to read statement carefully : n can be up to 10^9. |
| WA6 | chenyushuo | 1540. Battle for the Ring | 3 Apr 2015 17:59 | 1 |
WA6 chenyushuo 3 Apr 2015 17:59 Could you give me some tests to train my code? I WA in test 6 many times and I don't know why anymore.. I need some people to help me. Here is my code: #include <cstdio> #include <cstring> #include <cstdlib> #include <algorithm> using namespace std; int sg[55][110][110]; int a[110][110]; int n; bool v[110], l[110]; int mex ( int l, int r, int x ){ if ( sg[x][l][r] != -1 ) return sg[x][l][r]; if ( l > r ) return 0; int i, j, k; int p, ss; memset ( v, false, sizeof (v) ); for ( i = l; i <= r; i ++ ){ p = a[x][i]; ss = 0; k = l; for ( j = l; j <= r; j ++ ){ if ( a[x][j] <= p ){ ss ^= mex ( k, j-1, x ); k = j+1; } } ss ^= mex ( k, r, x ); v[ss] = true; } for ( i = 0; ; i ++ ){ if ( v[i] == false ){ sg[x][l][r] = i; return i; } } } int get_sg ( int x ){ int i, j, k; for ( i = 1; i <= a[x][0]; i ++ ) sg[x][i][i] = 1; return mex ( 1, a[x][0], x ); } void get_way ( int ans ){ int i, j, k, x, y, o; int p, s; for ( i = 1; i <= n; i ++ ){ for ( j = 1; j <= a[i][0]; j ++ ){ p = a[i][j]; s = 0; o = 1; for ( k = 1; k <= a[i][0]; k ++ ){ if ( a[i][k] <= p ){ s ^= mex ( o, k-1, i ); o = k+1; } } s ^= mex ( o, a[i][0], i ); if ( (ans^sg[i][1][a[i][0]]^s) == 0 ){ printf ( "%d %d\n", i, j ); return; } } } } int main (){ int i, j, k; scanf ( "%d", &n ); k = 0; memset ( sg, -1, sizeof (sg) ); for ( i = 1; i <= n; i ++ ){ scanf ( "%d", &a[i][0] ); for ( j = 1; j <= a[i][0]; j ++ ) scanf ( "%d", &a[i][j] ); get_sg (i); k ^= sg[i][1][a[i][0]]; } if ( k == 0 ) printf ( "S\n" ); else{ printf ( "G\n" ); get_way (k); } return 0; } |
| Guys whats wrong with test #3 | Erik Arakelyan(AUA) | 1211. Collective Guarantee | 3 Apr 2015 14:50 | 1 |
#include <iostream> using namespace std; bool Chekcker(int A[],int k) { int i,j,v; bool circle=true; for(j=1;j<=k;j++) for(v=1;v<=k;v++) { if(A[v]==0 && A[j]==v ) A[j]=0; }
for(j=1;j<=k;j++) for(v=1;v<=k;v++) { if(A[j]==0 && A[v]==j ) A[v]=0; } for(v=1;v<=k;v++) if(A[v]==0) { circle=true;} else{circle=false;break;} return circle; } int main() { int n; cin>>n; int i,j,k = 0,v; int temK; bool circle; int conf; int A[30000]; for(i=1;i<=n;i++) { cin>>k; j=1; v=1; temK=k; circle=true; conf=0;
for(j=1;j<=k;j++) { cin>>A[j];
}
for(j=1;j<=k;j++) { if(A[j]==0) conf++; }
circle=Chekcker(A,k);
if(conf==0 || conf>1) {circle=false;}
if(circle==true) cout<<"YES"<<endl; else cout<<"NO"<<endl;
for(v=1;v<=k;v++) A[v]=0; }
return 0; } this code get correct on every test in the forum, however fails test #3. Whats Wrong???? |
| wa #26 | misis_kulagin | 1277. Cops and Thieves | 2 Apr 2015 23:18 | 1 |
wa #26 misis_kulagin 2 Apr 2015 23:18 PLS GUYS HELP ME WITH WA#26 MY AZZ IS VERYYY HOOOOT because of this test Edited by author 02.04.2015 23:22 |
| To admins | SButterfly [Samara SAU] | 1108. Heritage | 2 Apr 2015 22:16 | 1 |
To admins SButterfly [Samara SAU] 2 Apr 2015 22:16 Why first test isn't like in sample? I checked there are only 1 test, and it is "18". Where another 17 tests have gone? |
| Why have I always got WA on #1 ? (python) | OIdiot | 1108. Heritage | 2 Apr 2015 22:14 | 2 |
N=input() ans=2 print ans for i in range(0,N): ans=(ans-1)*ans+1 print ans It returns correct answer on my PC,but gets WA when submitted. Well, there is only one test in check system. And it is: 18 I don't know why first test isn't "2". |
| Please help me! | Maksat "TheBiggestMax" Orazov | 1423. String Tale | 2 Apr 2015 10:49 | 1 |
# include <iostream> # include <fstream> # include <cmath> # include <vector> # include <algorithm> # include <math.h> # include <time.h> # include <string> # include <string.h> # include <map> # include <queue> # include <stack> using namespace std; const int MAXN = 1000000007;//, Maxn = 1000000009; long long n, a, san, num, dereje = 1, x; bool zero, one; string s, h; int main() { cin >> n >> s >> h;
a = n-1;
for (int i=0; i<n; i++) { san = (san + (dereje * (s[i]-'a'+1))) % MAXN; num = (num + (dereje * (h[i]-'a'+1))) % MAXN; dereje = (dereje * 27) % MAXN; }
if (san == num) {cout << 0 << '\n'; return 0;}
for (int i=0; i<n; i++) { san = (san * 27) % MAXN, san = (san - (((s[a]-'a'+1) * dereje) % MAXN)), san = (san + MAXN) % MAXN, san = (san + (s[a]-'a'+1)) % MAXN;
if (san == num) {cout << i+1 << '\n'; return 0;} a--; }
cout << -1 << '\n';
return 0; } WA 8.why? i used HASH! plz help me! |
| WA TEST #4 c++ | jhujhu | 1327. Fuses | 2 Apr 2015 00:57 | 2 |
#include <iostream> using namespace std; int main() { int aNumber, bNumber; cin>>aNumber; cin>>bNumber; if(bNumber > aNumber) { cout<< ((bNumber-(aNumber + (aNumber%2? 0:1) ))/2) + 1; } else if(bNumber == aNumber) { cout<<"1"; } } what might be test case #4 ? Try this: 4 4 The answer should be 0. Edited by author 02.04.2015 00:59 |
| How compil in MAC OS X? | ooPASHAoo | | 1 Apr 2015 23:18 | 1 |
tell me how to use the compiler, if changed (macbook)OSX. Can I xCode? |
| Idleness limit exceeded | Artyom_Troshkov | 1413. Mars Jumper | 1 Apr 2015 17:41 | 1 |
What is "Idleness limit exceeded"? |