Common Board| Show all threads Hide all threads Show all messages Hide all messages | | WA#22 | M@STeR.SoBG | 1435. Financial Error | 9 Apr 2010 00:20 | 3 | WA#22 M@STeR.SoBG 9 Nov 2006 17:09 Who has WA this test. What's wrong? Could you give me some tests. What is the correct answer for this test? Is "Error in record #2. Correct number is: 9."? 2 10 90 19 Re: WA#22 Afgan Abbasov[Azerbaijan] 9 Apr 2010 00:20 Answer: Unrecoverable error. Maybe this test help you 3 335 111 222 667 Answer: Unrecoverable error. | | NO.6 | Chen Wang | 1074. Very Short Problem | 8 Apr 2010 21:18 | 2 | NO.6 Chen Wang 8 Apr 2010 14:56 why WA? Edited by author 08.04.2010 14:57 Re: NO.6 dAFTc0d3r [Yaroslavl SU] 8 Apr 2010 21:18 | | 2 Admins. | Alexander Fedulin | 1237. Evacuation Plan | 8 Apr 2010 20:31 | 4 | 2 Admins. Alexander Fedulin 18 Nov 2009 13:13 Could you verify test #1 and my output for this test? I stressed my solution with earlier one (AC solution) and have not found any bad test or mistake. Also i tested my solution on sample test from statement. May be it connected with difference of compiler i use and your compiler. The 1st test is a 1st sample test. Your last solution gives the following incorrect answer on it: SUBOPTIMAL 0 0 0 0 0 0 6 0 0 0 0 0 Edited by author 18.11.2009 14:05 I have tested it again. Result is as in the statement. Could you place somewhere you compiler.. I can't find it for free. Edited by author 18.11.2009 14:22 Edited by author 18.11.2009 14:22 Why my solution has Stack Overflow on test case #7? Could you admins please just tell me where the overflow happens (on which stack/array)? Or is it an infinite recursion in a function? | | 6 test | Ilmir Tazetdinov [IATE] | 1759. Long-Livers | 8 Apr 2010 11:32 | 2 | 6 test Ilmir Tazetdinov [IATE] 20 Mar 2010 15:03 Give my please 6 test Edited by author 20.03.2010 15:04 I used class DataTime And no problem :) | | To type “!”, press “0” three times. ?? should be four times, right? | Zhihua Lai | 1567. SMS-spam | 8 Apr 2010 10:55 | 3 | #include <iostream> using namespace std; int cnt(char ch) { if ((ch >= 'a') && (ch <= 'z')) { return (((int)(ch - 'a') % 3) + 1); } switch (ch) { case '#': return (1); break; case ' ': return (2); break; case '0': return (1); break; case '.': return (2); break; case ',': return (3); break; case '!': return (4); break; } return (0); } int main() { int n = 0; char ch; while (cin.get(ch)) { n += cnt(ch); } cout << n << endl; return (0); } what is wrong with my code??? i got 122 at the sample test,,,,, could you help me ?? i cannot figure it out.. thanks.. omg... my mistake in understanding the problem... got AC now.... | | Some Tests. | Oleg Strekalovsky [Vologda SPU] | 1531. Zones on a Plane | 8 Apr 2010 01:25 | 1 | Some Tests. Oleg Strekalovsky [Vologda SPU] 8 Apr 2010 01:25 input 5 output 20 input 6 output 28 input 7 output 44 input 100 output 4503599627370492 input 1000 output 13093562431584567480052758787310396608866568184172259157933165472384535185618698219533080369303616628603546736510240284036869026183541572213314110357500 input 2000 output 42860344287450692837937001962400072422456192468221344297750015534814042044997444899727935152627834325103786916702125873007485811427692561743938310298794299215738271099296923941684298420249484567511816728612185899934327765069595070236662175784308251658284785910746168670641719326610497547348822672277500 | | HELLO!!! I have a *QUESTION!* about (in)valid cases! Would you answer it ONCE IN YOUR LIFE!? Thanks. | Dexter | 1177. Like Comparisons | 8 Apr 2010 01:13 | 3 | Is a case with [ in template, without ] after it, valid? For example, will there be any case like this: 'something' like '[a' (without closed bracket)? HELLO! Answer once in your life!!!! SOMEONE is *surely* reading the discussions of this task and has read this text! AND SOMEONE (at least admin) KNOWS THE ANSWER!!!! So REPLYYYYYYYYYY!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Edited by author 07.04.2010 19:09 I believe it is not, but I'm still wrestling with 6. case :) | | WA 7 | Vasilenko Oleg (South Ural State University) | 1300. Taxes | 7 Apr 2010 20:48 | 1 | WA 7 Vasilenko Oleg (South Ural State University) 7 Apr 2010 20:48 I apply rounding (as floor(x*100+0.5)/100) only to RESULT of T(R) and to regional coefficient. But I can't pass test 7. Can anybody help me? | | I Found the Input Format Terrible! | lonelycorn | 1061. Buffer Manager | 7 Apr 2010 08:30 | 4 | i got WA because of it for 3 times! You guys pay attention to it! yeah... I had some problems with it... =( I think I have the same problem, so what is the input format? Any examples ? I don't really know. I use JAVA, and when I changed Scanner and StreamTokenizer to just BufferedReader and in.readLine()s I got AC. | | what if input is 50000 times the number 3??? | bsu.mmf.team | 1587. Flying Pig | 5 Apr 2010 20:00 | 2 | The answer will contain 23857 digits in this case! What to do? Long arithmetic will not help because of TL use long arithmetic on base (9-17)-digits ;) | | DSU rules!!! (-) | Lord(Mamin Oleg) | 1671. Anansi's Cobweb | 5 Apr 2010 18:01 | 2 | Sure ;) By the way my DSU got AC with 0.109 sec time and 2 178 KB memory. WHat about you? | | Compile error - why ? | Mislav Balunović | | 5 Apr 2010 15:22 | 1 | In my code I have this: struct cmpf { bool operator ( )( const int &i, const int &j ){ if ( dist[i] != dist[j] ) return dist[i] < dist[j]; return i < j; } }; ... S.erase(i); Why am I receiving this boring compile error down here, it doesn't make sense! e6a69c8b-fd41-4c39-9a60-1c924ab01be4 S:\checker\compile\\Vc7\include\xtree(988): error: no instance of function "cmpf::operator()" matches the argument list and object (the object has cv-qualifiers that prevent a match) argument types are: (const int, const std::_Tree<std::_Tset_traits<int, cmpf, std::allocator<int>, false>>::key_type) object type is: const cmpf if (this->comp(_Key(_Pnode), _Keyval)) ^ detected during: instantiation of "std::_Tree<_Traits>::_Nodeptr std::_Tree<_Traits>::_Lbound(const std::_Tree<_Traits>::key_type &) const [with _Traits=std::_Tset_traits<int, cmpf, std::allocator<int>, false>]" at line 801 instantiation of "std::_Tree<_Traits>::iterator std::_Tree<_Traits>::lower_bound(const std::_Tree<_Traits>::key_type &) [with _Traits=std::_Tset_traits<int, cmpf, std::allocator<int>, false>]" at line 821 instantiation of "std::_Tree<_Traits>::_Pairii std::_Tree<_Traits>::equal_range(const std::_Tree<_Traits>::key_type &) [with _Traits=std::_Tset_traits<int, cmpf, std::allocator<int>, false>]" at line 757 instantiation of "std::_Tree<_Traits>::size_type std::_Tree<_Traits>::erase(const std::_Tree<_Traits>::key_type &) [with _Traits=std::_Tset_traits<int, cmpf, std::allocator<int>, false>]" at line 71 of "e6a69c8b-fd41-4c39-9a60-1c924ab01be4" S:\checker\compile\\Vc7\include\xtree(1089): error: no instance of function "cmpf::operator()" matches the argument list and object (the object has cv-qualifiers that prevent a match) argument types are: (const std::_Tree<std::_Tset_traits<int, cmpf, std::allocator<int>, false>>::key_type, const int) object type is: const cmpf if (this->comp(_Keyval, _Key(_Pnode))) ^ detected during: instantiation of "std::_Tree<_Traits>::_Nodeptr std::_Tree<_Traits>::_Ubound(const std::_Tree<_Traits>::key_type &) const [with _Traits=std::_Tset_traits<int, cmpf, std::allocator<int>, false>]" at line 811 instantiation of "std::_Tree<_Traits>::iterator std::_Tree<_Traits>::upper_bound(const std::_Tree<_Traits>::key_type &) [with _Traits=std::_Tset_traits<int, cmpf, std::allocator<int>, false>]" at line 821 instantiation of "std::_Tree<_Traits>::_Pairii std::_Tree<_Traits>::equal_range(const std::_Tree<_Traits>::key_type &) [with _Traits=std::_Tset_traits<int, cmpf, std::allocator<int>, false>]" at line 757 instantiation of "std::_Tree<_Traits>::size_type std::_Tree<_Traits>::erase(const std::_Tree<_Traits>::key_type &) [with _Traits=std::_Tset_traits<int, cmpf, std::allocator<int>, false>]" at line 71 of "e6a69c8b-fd41-4c39-9a60-1c924ab01be4" compilation aborted for e6a69c8b-fd41-4c39-9a60-1c924ab01be4 (code 2) | | What's meaning? | zsyzgu | 1727. Znaika's Magic Numbers | 5 Apr 2010 14:54 | 1 | | | why I get crash(access violation) at test 6? | rongyan | 1055. Combinations | 5 Apr 2010 12:44 | 6 | why I get crash(access violation) at test 6? who have the test? S.O.S!! This is not test 6! The answer of 50000 2 is 3 and my program shows it but i have WA on test 6!!! Lol, the question was asked in 2006, first answer came in 2007 and the second one in 2009 ! vava viva ! Delete Edited by author 05.04.2010 10:36 Edited by author 05.04.2010 10:36 #include<iostream> using namespace std; bool prime[50001]; int primes[6000],len=0; int n,m; int primesUp[6000]; int primesDown[6000]; long long ans = 0; long long legendre(long long num,long long p){ long long c = 0; long long tmp = p; while( (num/p) !=0){ c+=num/p; p*=tmp; } return c;
} int main(){ #ifndef ONLINE_JUDGE freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); #endif cin>>n>>m; memset(prime,true,sizeof(prime)); for(int i=2;i<=223;i++){ if(prime[i]){ for(int j=i+i;j<=50000;j+=i) prime[j] = false; } } for(int i=2;i<=n;i++){ if(prime[i]){ primes[len] = i; len++; } } for(int i=0;i<len;i++){ primesUp[i] += legendre(n,primes[i]); primesDown[i] += legendre(m,primes[i]); primesDown[i] += legendre(n-m,primes[i]); } for(int i=0;i<len;i++){ if(primesUp[i] > primesDown[i]) ans++; } cout<<ans<<endl; return 0; } | | HELP!!! | Saturn | 1057. Amount of Degrees | 5 Apr 2010 10:50 | 5 | My program gives right answer all tests in the forum but T've got WA#2.Please give me some test Thanks I have WA #2 too. Can you give me some tests? Some tests: 1 100 2 4 ->6 1 300 4 8 ->0 1 400 4 2 ->111 You can use this full search program to check: ////////////// var x,y,k,b,p,q:longint; function kt(s:longint):longint; var a:array[1..40]of longint; sd,i,j:longint; begin sd:=0; repeat inc(sd); a[sd]:=s mod b; s:=s div b; until s=0; j:=0; for i:=1 to sd do if a[i]=1 then inc(j) else if a[i]>1 then begin kt:=0; exit; end; kt:=j; end; begin read(x,y,k,b); p:=0; for q:=x to y do if kt(q)=k then inc(p); writeln(p); end. ///////// Good luck! | | The algorithm for solving this problem. EASY TO UNDERSTAND ! | Phan Hoài Nam - Đại học Ngoại ngữ Tin Học TP.HCM | 1055. Combinations | 5 Apr 2010 08:52 | 2 | For example : N = 7 and M = 3 you see : 7!/(3!*4!) = (2*3*4*5*6*7)/(2*3*2*3*4) = (5*6*7)/(2*3) = 35 => you need not to calculate the multiple but divide all numbers into prime I assign : the left = (5*6*7), the right = (2*3) after division the left : 5 = 5 6 = 2*3 7 = 7 you will count all prime, the result is following : there are 1 primes with value of 2 there are 1 primes with value of 3 there are 1 primes with value of 5 there are 1 primes with value of 7 I put into the bracket (1,1,1,1) after divison the right : 2 = 2 3 = 3 there are 1 primes with value of 2 there are 1 primes with value of 3 there are 0 primes with value of 5 there are 0 primes with value of 7 I put into the bracket (1,1,0,0) the left - the right = (1,1,1,1) - (1,1,0,0) = (0,0,1,1) and the result 0+0+1+1 = 2 2 is the result GOOD LUCK ! Thank you ,but i don't think this is good algorithm. My opinion. | | To Admin | Zhihua Lai | | 5 Apr 2010 08:00 | 2 | This site is very good,,, just one suggestion It may be good to have some statistics on the languages, for example, i would like to see how many C++ programs i submitted and how many Pascal etc... this can be added to the public author page.. . Edited by author 05.04.2010 08:00 and it may be good to have an advance search engine for authors.. | | What's wrong? (Test 2) | vlad | 1355. Bald Spot Revisited | 5 Apr 2010 05:13 | 3 | var i,ans,n:longint; a,b:array[1..1000] of longint; begin readln(n); for i:=1 to n do readln(a[i],b[i]); for i:=1 to n do begin if a[i]=1 then begin if b[i]=1 then writeln(1) else writeln(0); end else begin ans:=0; while b[i] mod a[i] =0 do begin b[i]:=b[i] div a[i]; inc(ans); end; writeln(ans); end; end; readln; end.
Your code is wrong. For 2 72 it outputs 3; the solution is 5: 2 -> 4 -> 8 -> 24 -> 72 Edited by author 05.04.2010 06:38 | | Could you tell me why ? | Zhihua Lai | 1020. Rope | 5 Apr 2010 05:05 | 3 | Although i get AC, but i want to know how the formula is derived.. 2 PI * R + perimeter of polygon The extra length is formed just a circle (radius = R). i can image with just a few nails. but could you tell me the proof of this... thanks.. if you got AC, it doesn't mean you solved it... It could mean you copied someone's idea or even solution... If you can't solve this kind of problems, how you gonna improve? You can prove it by induction. Consider 1 nail, then 2, then 3, then k, then k+1. Edited by author 05.04.2010 06:03 thanks.. i figured it out with a few number of nails.. just to clarify,, i didn't copy any other's idea or code... just want to know any other mathematic proof,, that is all. by using geometry,, merging angles of each nail,, you 'll get one circle (360 degree, radius = R).. that is my solution without induction. Edited by author 05.04.2010 05:05 Edited by author 05.04.2010 05:12 | | WA5 ? | Grujah | 1237. Evacuation Plan | 5 Apr 2010 01:05 | 1 | WA5 ? Grujah 5 Apr 2010 01:05 I get WA5? Whats that test about? |
|
|