| Show all threads Hide all threads Show all messages Hide all messages |
| WA #25 | igorsky | 1711. Code Names | 23 May 2014 23:41 | 4 |
WA #25 igorsky 12 Oct 2009 16:58 Re: WA #25 DM^Dude (Kherson State University) 22 Oct 2009 01:53 me help test --------------------------------------------------- 16 cipher grille kamkohob names grillee pcodes newtests rejudge timus size volume summit watchmen braineater twosides solution random yesorno keywords subversion commands bosses shooting shaitan game strategy playgame mnemonic palindromes bestname eligibility rectangle rules txxxxxxx txxxyzasd txxxxxas volvo vlot volt vvv vvilia vvobla what is it zina whashing potatoes 2 1 7 10 9 6 11 3 8 4 5 12 13 14 15 16 ------------------------------------------------ answer is ------------------------------------------------ grillee kamkohob keywords mnemonic playgame random rectangle rejudge shaitan size twosides txxxxxas vlot vvilia what zina For your test,i got the same answer ,but my code wa#20 I've had this problem too. THen i found my mistake. My function that compared two strings and returned the lower one: f f("aa","aaaa")="aa"; f("aaaaa","aa")="aaaaa"; - this was a mistake. It should have returned "aa" sorry for my English |
| WA №3 | AKruglyak | 1131. Copying | 22 May 2014 22:33 | 3 |
WA №3 AKruglyak 21 Feb 2012 21:48 Why? This is my solution: #include <iostream> using namespace std; int main(){ long int a,b,f=0; long int k=1; cin>>a>>b; if (a==1) { f=0; cout<<f; return 0;
}
if (b>=a && a<=2) f=1;
else if(a!=1){ while (k<=b){ f++; k*=2;
} a -=k; while (a>0){ f++; a=a-b;
} } cout<<f;
return 0; } Some test for your program 10 1 ans 9 3 8 ans 2 Some test for your program 10 1 ans 9 3 8 ans 2 Спасибо, помогло=) |
| I u have WA #7 | ~ SiriuS ~ | 1419. Maps of the Island Worlds | 22 May 2014 16:47 | 1 |
I got WA #7 several times. If u also got WA just try this test: 9 5 O-O-O-O-O |\ \|/ /| O-O O O-O |/|\ /|\| O-O-O-O-O It helped me to get AC. |
| acmp | Abdulkhakim | 1025. Democracy in Danger | 22 May 2014 15:12 | 3 |
acmp Abdulkhakim 15 Jan 2014 14:54 why this is accepted but in the acmp wrong answer 2 461 in acmp Edited by author 15.01.2014 14:54 Because there numbers may be even. Re: acmp Smilodon_am [Obninsk INPE] 22 May 2014 15:12 Restrictions on number K are different |
| ... Stack overflow... ? C++ | Ingy | 1001. Reverse Root | 22 May 2014 14:58 | 2 |
#include <cmath> #include <iomanip> #include <iostream> using namespace std; int main () { double number [100000]; int i=0; while ( ! cin.eof()) { cin >> number [i]; i++; } for( int j=i-1; j>=0; j--) { cout<< setprecision (4) << sqrt(number[j])<<endl; } return 0; } here's my program but I don't know what's wrong.. when i put the number of elements of the array to 140000 it says "stack overflow", when i put 10000 it says wrong answer. All local variables are allocated in stack. Array "number"[] is local, because it is described in function "main". Standard size of stack is 1 MB, size of double variable is 8 bytes. So it isn't enough space to allocate all array with 140000 elements. You should increase stack size. http://acm.timus.ru/help.aspx?topic=cpp #pragma comment(linker, "/STACK:16777216") Edited by author 22.05.2014 15:07 |
| 2admins: why tle on test42? | svg2003 | 1915. Titan Ruins: Reconstruction of Bygones | 21 May 2014 20:03 | 2 |
This my results. For this task, time limit is 1.0 second, so why it happend with 0.265 time? 5520909 12:24:55 21 фев 2014 svg2003 1915. Руины титанов: воссоздание былого Visual C# 2010 Time limit exceeded 42 0.265 49 708 КБ Edited by author 21.02.2014 12:30 Edited by author 21.02.2014 12:31 May be 0.265 is time of last succefull test. Looks like test 42 uses geometric progression - coins double many times. So solution should work with unlimited stacks. |
| 1083 Runtime error (integer division by zero)? SOS | Dior | 1083. Factorials!!! | 21 May 2014 06:52 | 1 |
|
| AC with DP | Levon Oganesyan | 1786. Sandro's Biography | 21 May 2014 01:42 | 1 |
I solve this problem with dp. Cool problem, similar to the Levenshtein,but with some differents. |
| WA 43 and 51 | Levon Oganesyan | 1769. Old Ural Legend | 20 May 2014 23:01 | 1 |
if you have WA 43 and 51, check this tests 0 00 000 0000 00000 1 01 001 0001 00001 answers is primitive - 1,1,1,1,1,2,2,2,2,2 |
| WA8 | endtimes | 1820. Ural Steaks | 20 May 2014 22:40 | 4 |
WA8 endtimes 7 Dec 2013 19:18 Module Module1 Sub Main() Dim a() As String = Console.ReadLine.Split(" ") Dim n, k As Integer n = 2 * CInt(a(0)) k = CInt(a(1)) Dim rez As Integer = Math.Ceiling(n / k) Console.WriteLine(rez) End Sub End Module I got wrong answer for test#8 but my output is 2. What is wrong? Edited by author 12.05.2014 00:54 |
| WA 27 | Sunnat | 1891. Language Ocean | 20 May 2014 19:02 | 1 |
WA 27 Sunnat 20 May 2014 19:02 what's wrong in my code, please give me some test #include <iostream> #include <vector> #include <string> #include <map> using namespace std; map<string,string>functions; map<string,string>variables; int main(){ int count_function, count_variable,i,j; string line,s1,s2,s, type; cin >> count_function; for(i = 0; i < count_function; i ++){ cin >> s1; while(cin >> s){ if(s == ":") break; s1 = s1 + " " + s; } cin >> s2; functions[s1] = s2; }
cin >> count_variable;
vector<string>variable; vector<string>types;
for(i = 0; i < count_variable; i ++){ cin >> type >> s >> s1 >> s1; while(s1[s1.size() - 1] != ')'){ cin >> s2; s1 = s1 + " " + s2; } if(variables.find(s) == variables.end()){ s2 = ""; j = 0; while(s1[j] != '(') s2 += s1[j++]; s2 += '('; j ++; while(s1[j] != ')'){ line = ""; while(s1[j] != ',' && s1[j] != ')') line += s1[j++]; if(variables.find(line) == variables.end()){ cout << "Error on line " << i + 1 << ": " << "Unknown variable" << endl; return 0; } s2 += variables[line]; if(s1[j] == ','){ s2 += ", "; j += 2; } } s2 += ')';
if(functions.find(s2) == functions.end()){ cout << "Error on line " << i + 1 << ": " << "No such function" << endl; return 0; }
s2 = functions[s2];
if(type == "auto"){ variable.push_back(s); types.push_back(s2); type = s2; } if(type != s2){ cout << "Error on line " << i + 1 << ": " << "Invalid initialization" << endl; return 0; } variables[s] = s2; }else{ cout << "Error on line 2: Double declaration" << endl; return 0; } } for(i = 0; i < types.size(); i ++) cout << variable[i] << " : " << types[i] << endl; return 0; } |
| WA #1 | SeJIya | 1050. Preparing an Article | 20 May 2014 04:00 | 1 |
WA #1 SeJIya 20 May 2014 04:00 |
| WA#8 | b108 | 1754. Explosion in a Pyramid | 19 May 2014 20:25 | 2 |
WA#8 b108 27 Jan 2014 21:31 If you have WA#8 then check that m >= h Thanks a lot. if m<h then writeln('NO'). |
| Test 10 | Neo Nomaly | 1506. Columns of Numbers | 19 May 2014 14:47 | 6 |
Test 10 Neo Nomaly 22 Jan 2007 10:01 WA 10. Give this test please... Have trouble with this test too... and one question: if input is like that: 7 6 1 2 3 4 5 6 7 should be output like that: 1 3 4 5 6 7 2 or that: 1 3 5 7 2 4 6 The answer is: 1 3 5 7 2 4 6 Remember about the correct number of spaces. My AC program show : 1 3 4 5 6 7 2 it is incorrect answer or test >the columns have the same height with the possible exception of the last column, which may be shorter This test is incorrect. Timus Online Judje Team likes give people incorrect tests. |
| A misprint in statement | urusant | 1289. One Way Ticket | 19 May 2014 10:56 | 1 |
The second word should be "crowd", according to the Russian translation. |
| Can you give me test data&//В чем дело? Пролетает то на первом, то на втором тестах. Хотя дома проверку проходит. Можете ли дать мне данные для проверки? | Masturbaev_Alijon | 1297. Palindrome | 19 May 2014 01:07 | 1 |
var a:array[1..1000] of string; S, pol:string; N, i, j, dlina:longint; function Sum(i, j:integer):string; var k:string; var i1:integer; begin k:=''; for i1:= i to j do k:=k+a[i1]; Sum:=k; end; function Sum1(i, j:integer):string; var k:string; var i1:integer; begin k:=''; for i1:= j downto i do k:=k+a[i1]; Sum1:=k; end; begin readln(S); N:=length(S); for i:= 1 to N do a[i]:=copy(lowercase(S), i, 1); dlina:=0; for i:= 1 to N-1 do begin for j:= i+1 to N do if (Sum(i, j)=Sum1(i, j)) and (length(sum(i, j))>dlina) then begin pol:=Sum(i, j); dlina:= length(sum(i, j)); end; end; writeln(pol); end. |
| WA #5, why !! :-( | simon.abdullah | 1350. Canteen | 18 May 2014 18:24 | 1 |
I always get WA in #5 here is my code, somebody help me please. <code> #include<stack> #include<iostream> #include<algorithm> #include<vector> #include<list> #include<iterator> using namespace std; int getSafe(vector<string> a,int an, vector<string> b, int bn){ int d=0; for(int i=0;i<an;i++){ for(int j=0;j<bn;j++) if(a[i]==b[j]){ d++; break; } } return d; } struct ve{ vector<string> v; }; int main(){ int n,N,m; cin>>N; string str; vector<string> menu; for(int i=0;i<N;i++){ cin>>str; menu.push_back(str); } cin>>n; int a,b; cin>>b; vector<string> fMenu; for(int i=0;i<b;i++){ cin>>str; fMenu.push_back(str); } int i=0; int nums[102]; ve res[102]; while(i<n){ cin>>a; nums[i]=a; for(int j=0;j<a;j++){ //cout<<"d"; cin>>str; //cout<<"s"; res[i].v.push_back(str); } i++; } cin>>m; for(int i=0;i<n;i++){ int x=getSafe(res[i].v,nums[i],fMenu,n); int c=getSafe(menu,N,res[i].v,nums[i]); if(x-nums[i]==0) cout<<"YES\n"; else if(N-b-nums[i]+x-m<0) cout<<"NO\n"; else cout<<"MAYBE\n"; } return 0; } </code> |
| test #3 | yarmet | 1917. Titan Ruins: Deadly Accuracy | 18 May 2014 17:52 | 1 |
кто-нибудь знает какой 3 ий тест ? Уже 7ой раз на нем фейлится, long'и использую. Edited by author 18.05.2014 18:13 Edited by author 18.05.2014 18:13 |
| Accepted Solution C++ / Any ideas on how to optimize it? | Haji | 1001. Reverse Root | 18 May 2014 11:40 | 2 |
#include <stack> #include <cmath> using namespace std; int main() { double n; stack<double> numbers; while (scanf("%lf", &n) != EOF) numbers.push(n); while (!numbers.empty()) { printf ( "%.4f\n", sqrt( double(numbers.top()) ) ); numbers.pop(); } return 0; } Yep! Read and parse input manually, scanf is expensive, %lf is even more expensive. As a bonus, you would not have to store read doubles. What surprised me is that printf is even much more expensive, so if you can create text representation of a double in given format - you are welcome! I have just got 0.031s execution time, what is yours? |
| why am i wrong? on c++ | Cui Xiangfei | 1001. Reverse Root | 18 May 2014 10:02 | 2 |
#include <iostream> #include <vector> #include <math.h> #include <stdio.h> using namespace std; int main() { vector<int> v; int value; while(true) { cin >> value; if(cin.eof()) { break; } else if(cin.fail()) { cin.clear(); // 清空错误状态 cin.ignore(); // 忽略掉下一个字符 continue; } else if(value >= 0) { v.push_back(value); } } cout << fixed; cout.precision(4); for(vector<int>::reverse_iterator iter = v.rbegin(); iter != v.rend(); ++iter) { if(*iter == 0) cout << (double)0 << endl; else cout << sqrt(*iter) << endl; } return 0; } Do not break on cin.eof(), it may be set even if a good value is read (in case the last line is not terminated by newline, I guess). Or maybe they terminate data by non-numeric symbols? Nobody would say :) Break on if (!cin), do not clear cin. And why do you check for (*iter==0)? It works fine as in general case. |