| Show all threads Hide all threads Show all messages Hide all messages |
| Weak tests | Fyodor Menshikov | 1612. Tram Forum | 3 Jan 2009 21:32 | 3 |
Problem statement does not say that last line of input should be terminated with end of line. I know AC solution that answers "Bus driver" for test "tram" (without quotes and without end of line, whole file length is 4 letters). In all new problems of Timus Online Judge on default last line of input data always should be terminated with end of line characters. Edited by author 03.01.2009 14:05 Which problems of Timus Online Judge are new? Why is there this limitation? Files in real world have no such limitation... |
| Help wanted on 1035!! | Ivan Georgiev | 1035. Cross-stitch | 3 Jan 2009 17:47 | 4 |
As far as I can see the problem has relatively small percent of the difficulty, but I can't think of the way I should walk the pattern by means of minimal number of threads.. Is the problem only a DFS (and if it is how should it be done) or there is something else? Thank you. You need some graph theory and common sense to solve it. Basically after you do the logic the problem breaks down to simple bfs/dfs and counting degrees. The idea comes from the problem of decompossing graph to a minimum amount of paths which is solved by some simple logic - you should be able to prove it yourself. Hint - it has something to do with Euler ... Helpfull to have math invariant(which right for every algo) I think that answer=Nc+Ndb/2 where Ndb- sum of disbalances of vertices of grid's graph. and Nc- number of alternating loops which unreached from disbalanced vertices by alternating pathes. But can't go far then test 8. AC 0.031 now.Idea is right. It taken 3 days to convert idea in quick algo. Edited by author 04.01.2009 10:13 |
| Weak tests | Fyodor Menshikov | 1226. esreveR redrO | 3 Jan 2009 15:04 | 2 |
I know AC solution that answers empty output for input consisting entirely of space characters. |
| did anyone compete on z-trening? | zadmin | | 3 Jan 2009 12:46 | 1 |
|
| How can I show numbers after dot? Which function I have to use? | Lareon | 1417. Space Poker 2 | 3 Jan 2009 12:45 | 1 |
|
| var i:longint; begin for i:=1 to 1000000 do write(chr(random(26)+ord('a'))); end. | BlackShark | 1219. Symbolic Sequence | 3 Jan 2009 01:34 | 1 |
|
| IT IS VERY EASY FOR ME =) (use minimax algo) | Erko | 1195. Ouths and Crosses | 2 Jan 2009 13:59 | 1 |
i studied "experting systems" (Artificial intelligence (AI)) first home task was creating an intelligence to 3x3 CZ ) if any question about minimax write to my email - erko2@inbox.ru |
| Please correct problem statement | Fyodor Menshikov | 1283. Dwarf | 2 Jan 2009 00:16 | 2 |
Первое число — количество золота в гномьем горшочке в начальный момент времени (целое, в граммах). Второе число — количество золота, при котором жизнь гномика лишается смысла (целое, в граммах, не превышает 2^31 − 1). Ограничение для первого числа (2^31 − 1) хорошо бы задать так же, как сейчас задано для второго. Это относится как к русской, так и к английской версии. |
| Test | Retester 11xx | 1226. esreveR redrO | 1 Jan 2009 16:17 | 1 |
Test Retester 11xx 1 Jan 2009 16:17 test Edited by author 01.01.2009 16:19 |
| What is test 9??? | LLIRIK | 1601. AntiCAPS | 1 Jan 2009 05:09 | 3 |
I think my programm is right, but WA test 9 please give me some tests try test "!I AM DONT UNDERSTEND WHAT IS TEST 9!"))) if only your English was good!!! |
| ce | hhh | 1222. Chernobyl’ Eagles | 31 Dec 2008 19:41 | 1 |
#include <iostream> using namespace std; int main() { int n,x=0,s=0,y=1,i; cin>>n; while(x<=n) ( x+=3; s++; } if(n%3==0) { for(i=0; i<s; i++) y*=3; cout<<y<<endl; } if(n%3==1) { for(i=0; i<(s-1); i++) y*=3; cout<<(4*y)<<endl; } if(n%3==2) { for(i=0; i<s; i++) y*=3; cout<<(2*y)<<endl; } return 0; } |
| For Those WHO have WA1 | Madiyar Tursunbayev | 1196. History Exam | 31 Dec 2008 15:08 | 1 |
numbers in Teachers list can be repeated. for example for this test: 2 1 1 3 1 1 1 Answer: 3 (your program probably gives 6 and that's why fails it) |
| what is wrong in my algo??? | hhh | 1493. One Step from Happiness | 31 Dec 2008 14:30 | 1 |
#include <iostream> using namespace std; int main() {int n,s1=0,s2=0,i,m,l; cin>>n; m=n;l=n; for(i=0;i<3;i++) {s1+=m%10; m=m/10;} while(m!=0) {s2+=m%10; m=m/10;} if(s1>s2){ if(n%10!=9) cout<<"Yes"; else cout<<"No";} else {if(l%10!=0) cout<<"Yes"; else cout<<"No";} return 0;} |
| To Admins | vetas | 1407. One-two, One-two | 31 Dec 2008 13:29 | 3 |
I read N next follow (C#): int n=int.Parse(Console.ReadLine().Trim()) and have crash in test 5. When I read N next follow string s=""; string s1=""; while ((s1=Console.ReadLine())!=null) s+=s1; s=s.Trim(); int n = int.Parse(s); have Accepted This is bug (test 5) or no? Sorry for my bad english There were empty lines before the number in the Test 5. We have fixed all tests in this problem. Now they don't contain leading or trailing spaces and empty lines. I think, "int.Parse(Console.ReadLine())" should be OK now. |
| HAPPY NEW YEAR!!! | Asyamov Igor | | 31 Dec 2008 13:13 | 1 |
|
| What's the answer for this test? Help! | joey2005 | 1429. Biscuits | 31 Dec 2008 11:00 | 2 |
What's the answer for: 2 1 1 5 1 1 5 2 or 3 or 4? It's 2. I got it! Changed my solution and Accept |
| what are the last two input lines for? | ababadoo | 1337. Bureaucracy | 31 Dec 2008 04:54 | 9 |
the last two lines are said to provide two lists: the documents he has and the documents he still needs. in some test cases (like case #4) some documents are missing from both lists so, what to do with these missing documents? shall he still require them or not? in test #4 if ignore these documents, it is WA. but if these documents are still required, it is AC. then i am quite wondering what test case #5 expects if it has some missing documents: are they still requred or not? i have tested many understandings with #5 but had all WA with them. well, #5 is 'No Solution' stuck with #7 well, #5 is 'No Solution' stuck with #7 in test 7 we have all necessary documents, so the answer is 0. thanks. the question is: how was it represented in #7 to 'have all documents'? was it a full list in the having-list, or was it a null list in the needing-list, or was it a full list in the having-list but some dup documents still in the needing-list, or was there simply some missing documents in both lists? it seems all these things can happen considering the tests i have met before #7. i have tried this way: if a document is in the having-list, i just remove it from the needing-list (having list has higer priority to needing-list) so if the having-list is a full list, my code will detect it and since there is no document, my output is '0'. this way fails. hence i think it is expressed in another way in #7 to have a full document set. or this time in #7, the needing-list have higher priority? that if the needing list is empty, the having-list shall be full? but this understanding contradicts to the test cases prior to #7. then i see the tests are contradicting themselves. now i check this before everything: if the needing-list is empty, the having-list is full. it passes #7. but now, stuck with #10 for some reason. another understanding to data there? can the test data be ever consistant? or if there are any priority rules be applied, can it be stated clearly in the problem? Edited by author 25.10.2004 18:52 I get WA on test 21. What can be in this test? If who knows, share, please. I can give you tests which I used to solve this problem. 5 18 5 3 18 12 1 2 3 4 5 0 0 4 5 0 5 0 2 0 3 0 1 2 3 4 5 0 The answer is 38 2 5 4 3 1 And 5 18 5 3 18 12 1 2 3 4 5 0 0 4 5 0 5 0 2 0 3 0 3 0 The answer is 33 2 5 4 3 I can give you tests which I used to solve this problem. Thank you a lot! Very strange days counting rules in this problem. Starting day is not counted in answer, but can be used to get documents. Simple test for this (like in statement, but current day of week 2 instead of 1): 2 7 1 2 0 1 0 2 1 0 2 0 Answer: 0 2 can someone advise on this code? i put tests somewhere with 'puts(NULL)' so if the thing i expect happens, i will get 'ACCESS VIOLATION' there. the method is to just get the closest document done as possible until all is finished. if no document can be done in the weekday length period, there is no solution. in this version in input line by line so if there is any garbage at the end of a line, it is ignored. i dont see any other problems though. #include <cstdio> #include <cstdlib> #include <cstring> #include <cctype> #include <cassert> #include <sstream> using namespace std; const int Inf = 1000000000; //const int Inf = 1000000; char buf[4096]; int main (void) { int n, l; gets(buf); sscanf(buf, "%d %d", &n, &l); if (n < 1 || n > 100) puts(NULL); if (l < n || l > 100) puts(NULL); int w[128] = {0}; gets(buf); istringstream is0(buf); for (int i = 1, j; i <= n; ++ i) { // scanf("%d", &j); if (!(is0 >> j)) puts(NULL); if (j < 1 || j > l) puts(NULL); // if (w[j]) puts(NULL); w[j] = i; } bool d[102][102] = {{false}}; int nd[128] = {0}; for (int i = 1, j; i <= n; ++ i) { gets(buf); istringstream is(buf); while (is >> j && j) { // while (1 == scanf("%d", &j) && j) { if (!d[i][j]) { d[i][j] = true; ++ nd[i]; } else puts(NULL); } } int now; gets(buf); sscanf(buf, "%d", &now); if (now < 1 || now > l) puts(NULL); bool having[128] = {false}, need[128] = {false}; gets(buf); istringstream is1(buf); for (int i; is1 >> i && i; having[i] = true); gets(buf); istringstream is2(buf); for (int i; is2 >> i && i; need[i] = true); for (int i = 1; i <= n; ++ i) { if (having[i]) { // testing if a document he has is also required, no failure yet till test #7 // if (need[i]) puts(NULL); // need[i] = false; for (int j = 1; j <= n; ++ j) { if (d[j][i]) { d[j][i] = false; -- nd[j]; } } } else need[i] = true; // the missing documents are all needed } int rest = 0; for (int i = 1; i <= n; ++ i) { // the following line fail on test #4, thus there are missing documents in test #4 // if (having[i] == need[i]) puts(NULL); if (need[i]) ++ rest; } int days = 0, seq[128], k = 0; -- days; -- now; while (rest && days < Inf) { bool nothing = true; // while (days < Inf) { for (int i = l; i >= 0; -- i) { ++ now; ++ days; if (now > l) now = 1; int x; if ((x = w[now]) && 0 == nd[x] && need[x]) { -- rest; need[x] = false; for (int i = 1; i <= n; ++ i) { if (d[i][x]) { d[i][x] = false; -- nd[i]; } } seq[k ++] = x; nothing = false; break; } } if (nothing) days = Inf; } if (days < Inf) { if (days < 0) days = 0; printf("%d\n", days); if (k) { for (int i = 0; i < k; ++ i) { if (i) putchar(' '); printf("%d", seq[i]); } putchar('\n'); } } else { // puts(NULL); puts("No Solution"); } return 0; } Edited by author 25.10.2004 06:30 Edited by author 25.10.2004 06:34 |
| what is the test №9 | bilol | 1601. AntiCAPS | 31 Dec 2008 00:54 | 1 |
I can't find my mistake please give me some tests with right answer thanks for all |
| I need Help | Mihran Hovsepyan {2 kurs of <RAU>} | 1207. Median on the Plane | 30 Dec 2008 21:47 | 1 |
I need Help Mihran Hovsepyan {2 kurs of <RAU>} 30 Dec 2008 21:47 Now I can got WA 1,2,3,5,6,7 and TLE14 This is my code wich got WA6 # include <iostream> # include <algorithm> # include <cmath> using namespace std; typedef long double int64; #define sq(x) x*x int64 myx0=2000000001,myy0=2000000001; struct ket { int64 x; int64 y; int hamar; } a[10010]; bool operator <(ket e, ket f) { double de=sqrt(sq(e.x-myx0)+sq(e.y-myy0)); double df=sqrt(sq(f.x-myx0)+sq(f.y-myy0)); return e.x/de>f.x/df; } int main () { int n,i; int ans1,ans2; cin>>n; for(i=0;i<n;i++) { cin>>a[i].x>>a[i].y; a[i].hamar=i+1; if(a[i].y<myy0) { myx0=a[i].x; myy0=a[i].y; ans1=a[i].hamar; } else if(fabs(a[i].y-myy0)<0.00001 && a[i].x<myx0) { myx0=a[i].x; ans1=a[i].hamar; } } swap(a[0],a[ans1-1]); sort(a+1,a+n); ans2=a[n/2].hamar; cout<<ans1<<" "<<ans2; return 0; } Edited by author 30.12.2008 21:48 |
| This problem is very easy.But I don't know it has such a long text. | TheBeet | 1213. Cockroaches! | 30 Dec 2008 21:28 | 2 |
|