| Show all threads Hide all threads Show all messages Hide all messages |
| Useful Hints! | Grigory 'Stargazer' Javadyan [RAU] | 1005. Stone Pile | 8 Apr 2007 20:18 | 1 |
Useful Hints! Grigory 'Stargazer' Javadyan [RAU] 8 Apr 2007 20:18 To solve this problem, use brute force search. Just generate all the subsets of the given set of stones. For each subset, calculate S=W1-W2, where W1 is the total weight of the subset, W2 is the total weight of the remaining stones. Select the minimal I. |
| [censored] checkers! AC at last! -0 != 0 | Alias aka Alexander Prudaev | 1331. Vladislava | 8 Apr 2007 00:56 | 6 |
if program writes -0, your [censored] checker says WA#3 inspite of accuracy in 2 digits. abs(-0-0) < 0.001 ! Edited by moderator 06.04.2007 22:54 I am tired of you who offends Timus Online Judge again and again. If you continue writing your posts to this board such a way, I will just remove them completely. Edited by author 06.04.2007 22:55 After your edit, observers could have an impression that I have used an abusive word. It's not true, it was word "stupid" you are wrong there is fragment of my program : double Norm(double x) { // if (x>0.001) return x; // else // return 0; } ... printf("%.2lf\n",Norm(abs(...))); ... with these commets program gets WA#3 without - AC if you want, i can send you my program entirely Edited by author 07.04.2007 22:15 Your WA and AC solution have are wrong both but tests are weak. You have WA after rejudge. |
| How to stop please HELP me PLEASE (I think it doesn't work) there is Crush | Erekle Magradze | 1001. Reverse Root | 6 Apr 2007 15:50 | 2 |
#include <iostream> #include <cmath> #include <iomanip> using namespace std; int main(){ long a; double b[100000]; int i=0; cin>>a; while(a!=EOF){ if (a>=0) {b[i]=sqrt((double)a);i++;} else continue; cin>>a; } cout.setf(ios::fixed); cout.setf(ios::showpoint); for(int j=i-1;j>=0;j--) cout<<setprecision(4)<<b[i]<<endl; return 0; } And please check your solution at least on sample test before posting on board. |
| WA #9 | Thunder | 1497. Cutting a Square | 6 Apr 2007 15:38 | 1 |
WA #9 Thunder 6 Apr 2007 15:38 Can anybody help me? I have WA on the test number 9, but I don't know where I have errors in code. I think, my algorithm is true. It work on all my tests, but crash on jury test. Find errors in my code or give me that test, please. He is it: program Sum_1497; {$APPTYPE CONSOLE} var a,b,c,d,e,f,g,h,i,j,n:integer; q:array[1..1000,1..1000]of integer; ch:char; x1,x2,y1,y2:integer; function TestRect(x1,y1,x2,y2,f:integer):boolean; var i,j:integer; a:boolean; x,y:integer; begin a:=true; if f=1 then for j:=y1 to y2 do begin x:=n+1; y:=0; for i:=x1 to x2 do begin if q[j][i]=1 then if i<x then x:=i; if q[j][i]=0 then if i>y then y:=i; end; if x<y then a:=false; end; if f=2 then for j:=y1 to y2 do begin x:=0; y:=n+1; for i:=x1 to x2 do begin if q[j][i]=1 then if i>x then x:=i; if q[j][i]=0 then if i<y then y:=i; end; if x>y then a:=false; end; if f=3 then for j:=x1 to x2 do begin x:=n+1; y:=0; for i:=y1 to y2 do begin if q[i][j]=1 then if i<x then x:=i; if q[i][j]=0 then if i>y then y:=i; end; if x<y then a:=false; end; if f=4 then for j:=x1 to x2 do begin x:=0; y:=n+1; for i:=y1 to y2 do begin if q[i][j]=1 then if i>x then x:=i; if q[i][j]=0 then if i<y then y:=i; end; if x>y then a:=false; end; TestRect:=a; end; begin readln(n); for i:=1 to n do begin for j:=1 to n do begin read(ch); q[i][j]:=Ord(ch)-Ord('0'); end; readln; end; x1:=n+1; y1:=n+1; x2:=0; y2:=0; for i:=1 to n do for j:=1 to n do begin if q[i][j]=0 then begin if i>x2 then x2:=i; if i<x1 then x1:=i; if j>y2 then y2:=j; if j<y1 then y1:=j; end; end; if x1=n+1 then begin writeln('Yes'); halt; end; if (TestRect(1,y1,x2,y2,1))or(TestRect(x1,y1,n,y2,2)) or(TestRect(x1,1,x2,y2,3))or(TestRect(x1,y1,x2,n,4)) then begin writeln('Yes'); // readln(a); halt; end; writeln('No'); // readln(a); end. Comments: I find rect, in which this figure is situated. Then I test all rects, that must bu filles by "0" to free the figure. For this i find the last symbol "0" and the first symbol "1" in each line. If x (position of "0") > y(position of "1") then we cann't free the figure by this direction. There are 4 different directions: up, down, left, and right. If in any of that direction I get "true", then the answer if "Yes". Else the answer is "No". P.S. Sorry for poor English. ^_^ |
| Crash??? | Alexander Kouprin | 1102. Strange Dialog | 6 Apr 2007 09:57 | 3 |
Crash??? Alexander Kouprin 6 Apr 2007 03:13 Please, tell me, why I get access violation?? It's my code: {$apptype console} var i,n,x,k,z:integer; s:ansistring; a:array[-10000..2000001]of boolean; t:array[1..6]of string; function correct(i,j:integer):boolean; begin result:=true; for z:=1 to length(t[j]) do if s[i+z]<>t[j,z] then begin result:=false; exit; end; end; procedure test; var i,j:integer; begin fillchar(a,sizeof(a),false); a[0]:=true; for i:=1 to length(s) do for j:=1 to 6 do if a[i-length(t[j])] then if correct(i-length(t[j]),j) then a[i]:=true; end; begin readln(n); t[1]:='one'; t[2]:='out'; t[3]:='output'; t[4]:='puton'; t[5]:='in'; t[6]:='input'; for i:=1 to n do begin readln(s); test; if a[length(s)] then writeln('YES') else writeln('NO'); end; end. I can't understand. Maybe some hint? Edited by author 06.04.2007 09:56 Re: Crash??? KirillB(Arkhangelsk - PomorSU) 6 Apr 2007 04:17 string can be more 2*10^6 I think.. |
| Pi - Timus | DK [anonymous] | | 6 Apr 2007 02:08 | 1 |
|
| WA #5 | sc92 | 1346. Intervals of Monotonicity | 5 Apr 2007 20:14 | 1 |
WA #5 sc92 5 Apr 2007 20:14 could anyone help me with test number 5 or give some tests for which my solution gives wrong answer? I have checked all the tests from the webboard. |
| if u have wa 15(ADMINS read this) | v0id | 1083. Factorials!!! | 5 Apr 2007 20:00 | 5 |
I tried to solve this test nearly 2 hours and always got WA.The problem was that numbers of "!" can be more than 20 (in 15 test). So my program with next code got wa: char s[20] int n; scanf("%d %s",&n,&s); int k = strlen(s); i changed char s[20] to char s[100] and got ac. Admins, plz correct it. so why i got ac after changing 20 to 100 ? 0_o please , send me your source code |
| I have WA3 and I don't know wherein my bug | Tipikin Evgeniy (USU) | 1002. Phone Numbers | 5 Apr 2007 18:36 | 2 |
I'm using BFS, for my tests program works correctly. Please, give me some tests or/and hints concerning my bug Edited by author 04.04.2007 21:15 Now AC, absolutely stupid bug(q.front(), not q.back()) |
| To admins | Dmytro Dziuma (DixonD) [Lviv NU] | 1306. Sequence Median | 5 Apr 2007 12:58 | 2 |
To admins Dmytro Dziuma (DixonD) [Lviv NU] 5 Apr 2007 01:05 Dear admins. I think you must add max test like this 200000 sorted integers. I think some people may lost AC. Please check this. |
| WHY WRONG ANSWER HELP ME! | Bagrat<#RAU#> | 1352. Mersenne Primes | 5 Apr 2007 11:37 | 3 |
#include <iostream.h> #include <math.h> int prost(int a) { int kol=0; for(int i=2;i<=int (sqrt(a));i++) { if(a%i==0) kol++; } if(kol==0) return 1; else return 0; } int main() { int T,n,kol=0,i=0,p=2; cin>>T; for(int j=0;j<T;j++) { cin>>n; while(i!=n) { if((prost(pow(2,p)-1))==1) { i++; } if(i==n) { cout<<p<<' '; } p++; }
} return 0; } All Mersenne primes you can find in text of problem... Good luck!.. |
| "wrong", why? | coolfire | 1000. A+B Problem | 5 Apr 2007 11:31 | 3 |
i do this in linux, but online judge told me wrong i have run it by gcc... i found there're some difference between turbo c and gcc. Between turbo c and intel c++ also there's some difference, read faq a bit. |
| OH MY GOD!! | genius | 1021. Sacrament of the Sum | 5 Apr 2007 11:28 | 3 |
I Qsorted it for I didn't see it was already fucking sorted,Oh damn!WASTE ME 1 HOUR!!! Edited by author 01.11.2007 14:01 |
| Is it possible to solve this problem without sorting? | Michael_Rybak | 1105. Observers Coloring | 5 Apr 2007 08:52 | 8 |
I'm sure that my algorythm is correct. It's complexity is O (n log n), because I use quicksort, and then 2 linear procedures. Why do I get TimeLimitExceed? Is it possible not to use sorting? > I'm sure that my algorythm is correct. It's complexity is O > (n log n), because I use quicksort, and then 2 linear > procedures. Why do I get TimeLimitExceed? Is it possible > not to use sorting? because complexity of quicksort in worst case is O(n^2) use heapsort or mergesort and ur program 'll get accepted ( or at least not TimeLimitExceeded ) ;) Just use Random-Quick-Sort it'll take a little time to run it. you can use the quick sort in short algorithim Still AC with O(N^2). ::) But sorting i use. do as this #include <algorithm> using namespace std; int a[n]; sort(a,a+n); |
| I have one question!! | PSV | 1512. Zinium | 4 Apr 2007 23:22 | 4 |
As I understand by random selecting I cannt solve this problem, so I have searching a bit in internet some info to find algo of it - AC. But how could ACM participants check this problem? What another approach? Random --> while (true) subbmiting or what? Please tell me... Random solution combined with a local collision minimization is acceptable.
Are you sure? It's only for good luck - my random prog quikly works only for n = 200 at max. Maybe one more hint... I use approach as in standart full search by verticals and O(1) - checking diagonals and horisontals and on every step use random. Yes, the solution has the O(n) complexity. This solution is the the first approach with linear complexity for this problem. |
| New verdict Fail(Judge) :) | Alias aka Alexander Prudaev | | 4 Apr 2007 22:37 | 2 |
Just one of the services wasn't started after server reloading. Everything is ok now. Thank you. |
| I got WA On Test 7 | David Sun | 1041. Nikifor | 4 Apr 2007 13:24 | 3 |
Who have the test case? MAIL ME: sunzheng.david@163.com I've got AC. The tests are very difficult. REMEMBER: The epsilon should be very small!!! I made eps=1e-10 and got ACed |
| 4Admins : Russian description | PSV | 1124. Mosaic | 4 Apr 2007 02:48 | 1 |
in Input format: В следующим M строках находит цвета), числа в строке разделены одним пробелом. Some mistake there - no sense of sentence |
| For Admins | PSV | 1416. Confidential | 4 Apr 2007 01:44 | 3 |
Firstly I've got WA13 but when I check test [ 1 0 ] - it got AC. But description says that N >= 2 - I am not misstaken? |
| Why Crash(access violation)?? | Ronaldinho | 1009. K-based Numbers | 3 Apr 2007 13:37 | 1 |
Thank!!! Programm terminated! Edited by author 03.04.2007 14:19 Edited by author 03.04.2007 14:19 |