Show all threads Hide all threads Show all messages Hide all messages |
WA3 ??? | hailoc12 | 1452. Pascal vs. C++ | 13 Apr 2015 23:17 | 1 |
Can somebody give me some hints on Test 3 ? I get WA but don't know why. I 've run all other test in the forum and it gives right answer |
test case - WA 4 | Pavel Nikolov | 1837. Isenbaev's Number | 12 Apr 2015 23:40 | 2 |
5 Isenbaev A B A B C D Q P C H N G N P output: --------------------------------------- A 1 B 1 C 2 D 5 G 4 H 3 Isenbaev 0 N 3 P 4 Q 5 --------------------------------------- Edited by author 04.01.2015 15:44 My program pases it, but I still have WA4. I got AC, problem was small capacity of my arrays :-) Edited by author 13.04.2015 00:22 |
if you always got WA, please pay attention to this sentence, maybe it's the reason why you got WA | youqiong | 1061. Buffer Manager | 12 Apr 2015 20:21 | 1 |
I got wrong 13 times because I ignored this sentence: Those characters are situated on the consecutive lines grouped by 80 characters per line without any spaces. Edited by author 03.05.2015 13:31 |
Error in problem statement | Otrebus | 1117. Hierarchy | 12 Apr 2015 19:09 | 1 |
"There is no subordinate of ordinary employees" vs "an arbitrary employee who has subordinates (an ordinary employee)" |
please help me find the error | prog_islam | 1563. Bayan | 12 Apr 2015 04:52 | 1 |
that is my code #5 test case is the error #include<iostream> #include<cstring> using namespace std; int main() { char nmat[1000][31]; long int no=0; long int n; cin>>n;
cin.ignore(); if(1<=n && n<=1000) { for(int i=0;i<n;i++) cin.getline(nmat[i],30);
for(int i=1;i<n;i++) { for(int j=i-1;j>=0;j--) { if((strcmp(nmat[i],nmat[j]))==0) { no++; break; }
} }
cout<<no; system("pause"); return 0; }
} |
Important: If you are using an array of structs | Otrebus | 1220. Stacks | 12 Apr 2015 02:37 | 1 |
Remember to remove any possible padding of the struct: for example, in MSVC do #pragma pack(push, 1) before the struct definition. |
Some tests for #WA7 and #WA8 | Pinky | 1742. Team building | 11 Apr 2015 21:17 | 1 |
May be this tests can help you, my friends: 7 4 4 4 5 6 7 5 Answer: 3 5 5 4 4 4 5 5 Answer: 3 5 10 2 3 4 1 1 2 3 4 7 9 Answer: 4 7 Good luck! Edited by author 11.04.2015 21:18 |
what is WA2 | Faruk | 1196. History Exam | 11 Apr 2015 19:58 | 1 |
|
No subject | prog_islam | 1563. Bayan | 10 Apr 2015 15:10 | 1 |
where is non-zero exit code in my code solving Bayan problem please help me #include<iostream> #include<cstring> using namespace std; int main() { char nmat[1000][31]; int no=0; int n; cin>>n; cin.ignore(); if(1<=n&&n<=1000) { for(int i=0;i<n;i++) cin.getline(nmat[i],30); for(int i=1;i<n;i++) { for(int j=i-1;j>=0;j--) { if((strcmp(nmat[i],nmat[j]))==0) { no++; break; } } }
cout<<no; } system("pause"); return 0; } |
Time Limit Exceeded C | Shaft | 1209. 1, 10, 100, 1000... | 9 Apr 2015 22:46 | 1 |
#include <cstdio> int main() { unsigned N, i, discharge, count; unsigned long *array; scanf("%u", &N); array = new unsigned long [N]; for(i = 0; i < N; i++) scanf("%lu", &array[i]); for(i = 0; i < N; i++) { discharge = 1; for(count = 0; discharge <= array[i]; count++) discharge += count; discharge--, count--; if(discharge - (count - 1) == array[i]) printf("%d%c", 1, ' '); else printf("%d%c", 0, ' '); }
return 0; } Can smb help me? |
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); } |
Test #7 why? | AlexRad | 1203. Scientific Conference | 6 Apr 2015 14:29 | 1 |
Why my programm does not pass test #7 ? Give me please that test! using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Globalization; using System.Threading; namespace _1203.Научная_конференция { class Program { static void Main(string[] args) { Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; var n = int.Parse(Console.ReadLine().Trim()); var reports = new List<Tuple<int, int>>(n); for(var i = 0; i < n; i++) { var tokens = Console.ReadLine().Trim(). Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries); reports.Add(Tuple.Create(int.Parse(tokens[0]), int.Parse(tokens[1]))); } reports.Sort(); var weights = new int[n]; var weight = -1; var reportStartComparer = new ReportStartComparer(); for (var i = 0; i < n; i++) { if (weights[i] > weight) weight = weights[i]; var nextReport = Tuple.Create(reports[i].Item2 + 1, 0); var idx = reports.BinarySearch(nextReport, reportStartComparer); if (idx < 0) idx = ~idx; if (idx < n && weights[idx] < weight + 1) weights[idx] = weight + 1; } Console.WriteLine(weight + 1); } } class ReportStartComparer: IComparer<Tuple<int, int>> { public int Compare(Tuple<int, int> x, Tuple<int, int> y) { return x.Item1 - y.Item1; } } } |
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? |