| Show all threads Hide all threads Show all messages Hide all messages |
| Why? | n3v3r_die | 1607. Taxi | 3 Jun 2012 15:42 | 2 |
Why? n3v3r_die 18 Feb 2012 14:55 #include <iostream> using namespace std; int taxi(int a,int b,int c,int d){ if ((a+b)>c) {return c;} a+=b; if ((c-d)<a) return a; c-=d; taxi(a,b,c,d); } int main() { int a,b,c,d; cin>>a>>b>>c>>d; cout<<taxi(a,b,c,d); return 0; } Wrong answer test #1 Re: Why? Stefan Eniceicu 3 Jun 2012 15:42 "<=" and ">=" in those ifs. there is one more case where a >= c where you need to return a. |
| Wrong sample or output format | Geno Roupsky | 1015. Test the Difference! | 3 Jun 2012 08:05 | 5 |
The output format says: Print Q And then Print Q lines of the form NumSheme Count But the sample output is written 2 1 2 3 Why there isn't any '1' after the 3. And what does the sentence: 'Numbers in each line of the output must be sorted in increasing order' mean? How can you sort NumSheme and Count when it is said that they should be ano after another in a strict way? > The output format says: > Print Q > And then Print Q lines of the form > NumSheme Count > > But the sample output is written > 2 > 1 2 > 3 > Why there isn't any '1' after the 3. > > And what does the sentence: > 'Numbers in each line of the output must be sorted in > increasing order' mean? How can you sort NumSheme and Count > when it is said that they should be ano after another in a > strict way? The output is wrong - but not in the way you describe. All three die are different - note 1 dot opposite 2 dots, 3 dots and 4 dots for the three die respectively. The output should read: 3 1 2 3 This is the number of different die types followed by the die in each type in increasing order. > The output is wrong - but not in the way you describe. > > All three die are different - note 1 dot opposite 2 dots, 3 > dots and 4 dots for the three die respectively. > > The output should read: > 3 > 1 > 2 > 3 > > This is the number of different die types followed by the > die in each type in increasing order.
No, sample output is correct. Sample input is wrong. Fixed. 'Next Q lines should contain the numbers of dice with the same scheme. ' It is the numbers, not the count. |
| How to solve it? | YSYMYTH | 1730. ManBearPig | 3 Jun 2012 02:58 | 2 |
I know it's something about vector of fractions,but don't know how. Could anyone explain the solution please? 1) We can only make fractions of form a / 2^b where a is odd (this is obvious, you can prove it by induction for example) 2) If all fractions have this form then we can simply build full binary tree. Number of leaves will be equal to the largest denominator and creatures in leaves can be determined quite easily. In fact, problem is easy because we aren't asked to find minimal answer. |
| Need your HELP! Getting WA8! | Shushan Arakelyan | 1104. Don’t Ask Woman about Her Age | 3 Jun 2012 00:23 | 1 |
Here's my solution, can't figure out, what's wrong, it passes all the tests I can think of. Help me, please. #include <iostream> #include <string> int state; long long base(int b, std::string str) { int size = str.size(); int i = 0; long long res = 0; while(i < size) { res *= b; if(str[i] >= 'A') str[i] -=7; str[i] -= 48; if(str[i] >= b) { state = 1; return b; } res += str[i]; ++i; } return res; } int main() { std::string str; std::cin >> str; for(int i = 2; i < 37; ++i) { state = 0;
if(base(i, str)%(i - 1) == 0 && !state) { std::cout << i << std::endl; return 0; } } std::cout << "No solution." << std::endl; return 0; } |
| getting WA on 8 th test please help | anupam ghosh | 1104. Don’t Ask Woman about Her Age | 3 Jun 2012 00:03 | 6 |
considering the number as long is it enough?? i think the number may be as long as 1000000 digits such as 11..1 {there's 1000000 number'1'}. test: 123 answer is 4 be carefull on test 16 when the last char is '0' the strlen of char will been dec() for 123, is the answer suppose to be 3? |
| TLE 65 (+) | Erop [USU] | 1695. Work for Robots | 2 Jun 2012 15:09 | 1 |
I think that the 65th test is a hell for cache. So it is better to use as little memory as possible. I use 48Mb, but some people - less than 10. How they do it? |
| Dr.WDMKhon | Muzaffardjan Karaev | | 1 Jun 2012 01:04 | 1 |
|
| Problem is not clear. | balandini | 1193. Queue at the Exam | 1 Jun 2012 00:25 | 3 |
What happens if 2 or more student are ready at one at the same time(they have equal T1)? Who will be first in queue? read statment carefully "All the numbers T1 are distinct." I made a mistake. It's all right with problem. |
| That is algo? | IgorKoval [PskovSU] | 1681. Brother Bear's Garden | 31 May 2012 22:34 | 1 |
|
| whats wrong and whats test 10 | garra | 1545. Hieroglyphs | 31 May 2012 21:47 | 3 |
#include<stdio.h> #include<stdlib.h> #include<string.h> int main() { int n,i,j=0; char a[100][4]; char b; scanf("%d",&n); for(i=0;i<=n;i++) { gets(a[i]); } scanf("%c",&b); for(i=0;i<=n;i++) { if(a[i][j]==b) { puts(a[i]); } } return 0; } there can be more than 100 hieroglyphs |
| What is Test #11 | elquees | 1031. Railway Tickets | 31 May 2012 07:55 | 1 |
Hi, could you post the test 11 data?.. I made my code but it's always crashing on this test. |
| No subject | Dmitriy | | 31 May 2012 04:12 | 1 |
Edited by author 31.05.2012 04:13 Edited by author 31.05.2012 04:13 |
| WA #4 | MarioYC | 1510. Order | 30 May 2012 12:43 | 3 |
WA #4 MarioYC 23 Jul 2011 12:53 Thanks! This helped me :) |
| why TLE using bfs | rushel | 1379. Cups Transportation | 30 May 2012 01:42 | 5 |
I use bfs where a state is defined by node and time. Is my approach is wrong? please help me. ??? Edited by author 12.09.2005 15:55 Time is integer in 0..1440, We have about 500^2 edges, So 1440*500*500 ~ 4*10^8 (it's of course too big time :) And you think it can get not TLE? Try to invent faster algorithm. BFS is possible if you enhance it doing several tricks. My AC is 0.265 sec, 5421KB, 85 LOC I think you mean Ford-Bellman with queue. 0.625 AC. But i have many operations with vectors resize. I think this solve can work faster. Edited by author 30.05.2012 01:53 |
| You have bugs in tests. | -XraY- | 1168. Radio Stations | 29 May 2012 19:48 | 1 |
In test 2 my solution fails because of some trash in testfile after usefull information. Please, fix that. |
| Tests :) WA 8 | Dawid Drozd | 1792. Hamming Code | 29 May 2012 17:50 | 5 |
IN 0 1 1 0 0 0 0 OUT 1 1 1 0 0 0 0 IN 1 0 1 0 0 0 0 OUT 1 1 1 0 0 0 0 IN 1 1 0 0 0 0 0 OUT 1 1 1 0 0 0 0 IN 1 1 1 1 0 0 0 OUT 1 1 1 0 0 0 0 IN 1 1 1 0 1 0 0 OUT 1 1 1 0 0 0 0 IN 1 1 1 0 0 1 0 OUT 1 1 1 0 0 0 0 IN 1 1 1 0 0 0 1 OUT 1 1 1 0 0 0 0 My program gives correct answer for the above tests. But I am getting wrong answer for Test 35 :( More tests please! the bits are ordered like this: 1, 2, 3, 4, (2^3^4), (1^3^4), (1^2^4) and not: 1, 2, 3, 4, (1^2^4), (1^3^4), (2^3^4) good luck. Edited by author 25.09.2011 20:53 I don't think that, because if we take x^0, x=0 or x=1, so we have always 1! Edited by author 02.10.2011 19:27 Edited by author 02.10.2011 19:28 The seven numbers: a[1] a[2] a[3] a[4] a[5] a[6] a[7] a[5]:=(a[2]+a[3]+a[4]) mod 2 a[6]:=(a[1]+a[3]+a[4]) mod 2 a[7]:=(a[1]+a[2]+a[4]) mod 2 May it help you. Good lucky |
| How to submit solution, that consists of several files? | balandini | | 29 May 2012 01:42 | 4 |
I program on C++. This language lets to create projects that consist of several files. For example, I can create separate files with my own functions(in the project) and then use them in function main. But when I submit my solution there are only 2 options: print source code, or give source file(only one file). And how can I submit my solution if it consists of several files? Make one file and submit it I wanted to know if there is any way to submit several files? |
| Does this test correct? | Andrew Sboev [USU] | 1207. Median on the Plane | 28 May 2012 21:58 | 1 |
3 0 0 0 1 1 0 ? Oh, sorry, of course not, because n is even. Edited by author 28.05.2012 21:59 |
| i thin it's work correct, but can't get acc, please help! | wavejke | 1725. Sold Out! | 27 May 2012 15:29 | 4 |
where is my mistake? falls on 5th var i,nr,n,k,c:integer; begin read(n,k); nr:=trunc(n/2); if (k>nr) then begin for i:=nr+1 to k-1 do inc(c); end; if (k<nr) then begin for i:=k+1 to nr do inc(c); end; write(c); end. A person with mistake in DNA solved more problems than you. really???!!! and how do you know it? |
| Different Russian and English version: | coder | 1369. Cockroach Race | 26 May 2012 19:42 | 2 |
Russian: Далее следуют M строк по 2 целых числа в каждой — координаты тараканов в настоящий момент. M + 2 строка содержит число N (0 ≤ N ≤ 10000). Далее N строк — координаты кусочков сладости. Все координаты — действительные числа. English: M lines follow, containing 2 numbers each — these are coordinates of the cockroaches at the present moment. (M + 2)nd line of the input stream contains the number N (0 ≤ N ≤ 10000). N following lines contain coordinates of sweet pieces. All coordinates are floating point numbers. i.e. are integer or float coordinates of the cockroaches ? All coordinates are floating-point numbers. Statement is fixed. Thank you. |