| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| WA test 35 | frufru | 1299. Псилонцы | 9 фев 2014 00:39 | 1 |
can you tell me test 35? i have WA |
| hint for WA 10 | BORODA | 1201. Какой сегодня день? | 8 фев 2014 19:24 | 1 |
The answer for "30 1 2012": mon........2....9...16...23..[30] tue........3...10...17...24...31 wed........4...11...18...25..... thu........5...12...19...26..... fri........6...13...20...27..... sat........7...14...21...28..... sun...1....8...15...22...29..... between first and second column there are exactly 4(!) '.'; |
| Tests are inconsistent | Baz | 1151. Радиомаяки | 8 фев 2014 17:19 | 1 |
Considering my submissions, I concluded that in the 15-th test there is a radiobeacon for which its coordinates can't be integers between 1 and 200. If for such radiobeacons output "UNKNOWN", the solution gets AC. This does not fit with the statement. |
| WA#1 Who can find an error in my prog? =) | intueor | 1513. Басня о лимоне | 7 фев 2014 18:47 | 1 |
I didn't use any long arithmethic but i think it should passes the first test. But judge says WA !!! Help please if you can #include <iostream> using namespace std; long long d[10001][2]; int main () { int n, k;
cin >> n >> k;
d[0][0] = 1; d[0][1] = 0;
int i, j;
for (i = 1; i <= n; ++i) {
d[i][1] = 0; for (j = 1; j <= k; ++j) { if (n - j < 0) continue;
d[i][1] += d[i - j][0]; }
d[i][0] = d[i - 1][0] + d[i - 1][1]; }
cout << d[n][0] + d[n][1];
return 0; } |
| Proof | Noob | 1206. Сумма цифр суммы чисел | 7 фев 2014 01:51 | 4 |
Proof Noob 12 май 2012 03:16 I've solved it using bruteforce for small K and then guessing the formula. But I still don't know the proof. Can anybody write it? S(A + B) = S(A) + S(B) is equal to that that for every pair of corresponding digits of A and B their sum is lower then 10 (1). For example: 12 and 13 :1+1<10;2+3<10 it means S(A + B) = S(A) + S(B) 18 and 19: 8+9>10 it means S(A + B) = S(A) + S(B) is wrong here. Then for every pair of digits from A and B you just count how many varints of pair suits (1) and multiply these quantities for all pairs. Another way to go at it is to think of the number (A+B) as a bunch of stacked blocks, each stack representing a digit. Here is 43 for example: _ |_| _ |_||_| |_||_| |_||_| Now, to find all the A's and B's that can form S(A+B) = S(43), for example 12+31 or 22+21, etc, we can represent this as chopping each stack into two parts, for example in the case of 12+31: _ |_| _ _ |_| |_||_| |_| _ |_||_| Now, if we take the general case of having two digits, if the first digit is 1, we can't split the first digit in two since the first digit of A or B can't be 0. However, if the first digit is 2, we can split it in one way (in the middle), and then we can split the second digit depending on what digit it is. If it is 2, we can split it in 3 different ways ( (0,2),(1,1),(2,0) ). If it is 3, we can split it in 4 different ways, etc. So, if the first digit of the two-digit number is 2, we can split the whole number in 1*(1+2+3+4+5+6+7+8+9+10)=1+(10*11/2) different ways. If the first digit is 3, we can split the whole number in 2*(1+2+3+4+5+6+7+8+9+10)=2*(10*11/2) different ways, etc. If we sum everything we get (8*9)/2*(10*11)/2 ways to split a two digit number. For an n digit number continuing the same way we get (8*9)/2*((10*11)/2)^(n-1). |
| A few description problems | Kuros | 1192. Мячик во сне | 6 фев 2014 20:20 | 1 |
1) "after every fall, the kinetic energy of the ball decreases by a factor of K". So if K > 1, that means the energy becomes negative? E_2 = E_1 - E_1*K might be interpreted to be what you mean when you say something decreases by some factor. 2) "Your task is to determine the maximal distance from the point of throwing that the ball can fly." If the ball is pitched straight up, it will fly some maximal distance from the point of throwing before it reaches the ground again. You should probably exactly what you mean. |
| How to solve it ? | prostack | 1225. Флаги | 6 фев 2014 19:38 | 3 |
I'm newby here and I didn't solve this kind of tasks before. I know, that must be very easy, give me please some pieces of advice to solve it. Think abstractly! It's very easy! Edited by author 06.02.2014 05:58 Edited by author 06.02.2014 05:58 You can either take it the mathematical way, and solve it by induction: assume you know the number of ways for 1..N stripes, how to find out the ways for N+1? Or you can make a brute-force algorithm (backtracking) that simply counts and prints the number of ways for each N between 1 and 10-20 (until it gets too slow), then try to deduce a general rule for N, based on this series. Good luck! |
| It is not serious | ZamNick | 1679. Башня дядюшки Скруджа | 6 фев 2014 18:13 | 1 |
Hey, guys, it is not serious, really ...... I had wa4 with EPS = 1e-8 .... when I've changed EPS = 1e-6 I got AC... Edited by author 06.02.2014 18:13 |
| WA at #39 | George Ciobanu | 1277. Cops and Thieves | 6 фев 2014 03:19 | 1 |
Does anyone know what's this test like? |
| What's wrong in this? (C#) | gholamali | 1001. Обратный корень | 5 фев 2014 22:54 | 1 |
using System; namespace ConsoleApplication4 { class Program { static void SQRT(UInt64 sum) { double ima_ans = Convert.ToDouble(Math.Sqrt(Convert.ToDouble(sum))); Console.WriteLine(Convert.ToDouble((Math.Round(ima_ans = ima_ans * 10000)) / 10000)); } static void Main(string[] args) { string save_str=null; string str = Console.ReadLine(); int i = str.Length; int k; UInt64 sum; i = i - 1; while (i >= 0) { k = 0; while (i >= 0 && str[i] != ' ') { k = 1; save_str += str[i]; i = i - 1; } sum = Convert.ToUInt64(save_str); if (sum > 0 && sum <= Math.Pow(10, 18) || k == 1) SQRT(sum); save_str = null; i = i - 1; } Console.ReadLine(); } } } |
| WA2 | bulka94 | 1868. Конкурс прогнозов | 5 фев 2014 18:39 | 1 |
WA2 bulka94 5 фев 2014 18:39 Don't have any idea, give me that or similar test please. |
| code | Argishty | 1068. Сумма | 5 фев 2014 01:38 | 1 |
code Argishty 5 фев 2014 01:38 #include <iostream> using namespace std; int main() { int a,b; cin>>a; if(a==0 && a<=10000) cout<<"1"; else { if(a>0 && a<=10000) cout<<((a*(a+1))/2); else { if(a<=10000){ b=-((((-a)*((-a)+1))/2)-1); cout<<(b);} else cout<<"error";} } return 0; } Edited by author 05.02.2014 01:45 |
| TLE, how can i decrease program time (2.015)? | bulka94 | 1118. Нетривиальные числа | 4 фев 2014 21:41 | 1 |
Ok, just search biggest prime number :) Edited by author 04.02.2014 22:13 |
| At test 6 | [RISE] Levon Oganesyan [RAU] | 2002. Тестовое задание | 4 фев 2014 20:58 | 1 |
At test 6 [RISE] Levon Oganesyan [RAU] 4 фев 2014 20:58 more than one registrations ;) |
| WA#7,need help!!! | Oyh's 小号 | 1320. Разбиение графа | 4 фев 2014 18:11 | 3 |
who can help me? I WA on #7.Why? here is my program: var a:array[1..1000]of longint; b:array[1..1000,1..1000]of boolean; n,i,j,x,y,m:longint; c:boolean; function find(x,y:longint):boolean; var i:longint; begin if b[x,y] then exit(false); for i:=1 to m do if (b[a[i],x])and(b[a[i],y])then begin b[x,y]:=true;b[y,x]:=true; exit(false); end; exit(true); end; begin while not seekeof do begin readln(x,y); b[x,x]:=true;b[y,y]:=true; b[x,y]:=true;b[y,x]:=true; c:=true; for j:=1 to m do if a[m]=x then begin c:=false;break;end; if c then begin inc(m);a[m]:=x; for i:=1 to m do if find(a[i],x) then begin writeln(0);halt; end; end; c:=true; for j:=1 to m do if a[m]=y then begin c:=false;break;end; if c then begin inc(m);a[m]:=y; for i:=1 to m do if find(a[i],y) then begin writeln(0);halt; end; end; end; writeln(1); end. Pls check for the following case: 5 6 5 8 5 9 6 7 8 9 9 10 Answer should be 1 Test 7 has invert vertexes. 10 1 1 2 asn: 1 I have many times WA, because my programm doesnt check it. |
| Why wrong answer? pleaze help me out..! the answer is correct. | Darwesh | 1025. Демократия в опасности | 4 фев 2014 18:03 | 3 |
[code deleted] Edited by author 10.09.2012 19:45 Edited by moderator 20.11.2019 00:11 OMG,how it was possible to come up with that? you should cout the answer only, without any "The minmum no of voters needed is" |
| Some sample answers will help you find the algorithm for this problem :) | Phan Hoài Nam - Đại học Ngoại ngữ Tin Học TP.HCM | 1692. Флаги провинций | 4 фев 2014 18:00 | 5 |
n = 3 1 2 0 0 2 3 0 0 0 3 1 0 n = 6 1 2 3 0 0 0 3 4 5 0 0 0 0 5 6 1 0 0 0 0 6 2 4 0 n = 10 1 2 3 4 0 0 0 0 4 5 6 7 0 0 0 0 0 7 8 9 1 0 0 0 0 0 9 10 2 5 0 0 0 0 0 10 3 6 8 0 n = 15 1 2 3 4 5 0 0 0 0 0 5 6 7 8 9 0 0 0 0 0 0 9 10 11 12 1 0 0 0 0 0 0 12 13 14 2 6 0 0 0 0 0 0 14 15 3 7 10 0 0 0 0 0 0 15 4 8 11 13 0 n = 21 1 2 3 4 5 6 0 0 0 0 0 0 6 7 8 9 10 11 0 0 0 0 0 0 0 11 12 13 14 15 1 0 0 0 0 0 0 0 15 16 17 18 2 7 0 0 0 0 0 0 0 18 19 20 3 8 12 0 0 0 0 0 0 0 20 21 4 9 13 16 0 0 0 0 0 0 0 21 5 10 14 17 19 0 n = 36 1 2 3 4 5 6 7 8 0 0 0 0 0 0 0 0 8 9 10 11 12 13 14 15 0 0 0 0 0 0 0 0 0 15 16 17 18 19 20 21 1 0 0 0 0 0 0 0 0 0 21 22 23 24 25 26 2 9 0 0 0 0 0 0 0 0 0 26 27 28 29 30 3 10 16 0 0 0 0 0 0 0 0 0 30 31 32 33 4 11 17 22 0 0 0 0 0 0 0 0 0 33 34 35 5 12 18 23 27 0 0 0 0 0 0 0 0 0 35 36 6 13 19 24 28 31 0 0 0 0 0 0 0 0 0 36 7 14 20 25 29 32 34 0 why? n=10 1 2 2 3 3 4 4 5 5 6 6 7 7 8 9 10 1 10 ---- 9>6 is it wrong, why? Edited by author 18.04.2009 00:35 Edited by author 26.11.2010 13:52 Probably easier to grasp: n=10 5 4 1 2 3 4 4 1 5 6 7 4 2 5 8 9 4 3 6 8 10 4 4 7 9 10 n=15 6 5 1 2 3 4 5 5 1 6 7 8 9 5 2 6 10 11 12 5 3 7 10 13 14 5 4 8 11 13 15 5 5 9 12 14 15 |
| Good problem! AC in 0.015 | [RISE] Levon Oganesyan [RAU] | 1228. Массив | 3 фев 2014 23:45 | 1 |
Thanks to author! Edited by author 19.11.2014 21:49 |
| What is test#5? | AlMag | 1357. Чайник для чайников | 3 фев 2014 03:05 | 6 |
Maybe, you know some tricks? input 6 00:00:00 00:00:01 00:00:02 00:00:03 00:00:04 00:13:00 AC output 00:13:58 00:13:58 00:13:58 00:13:58 00:13:58 00:16:46 perhaps you meant this test? 6 00:00:00 00:00:01 00:00:02 00:00:03 00:00:04 00:00:05 my output WA5 00:13:58 00:13:58 00:13:58 00:13:58 00:13:58 00:15:48 why 00:16:46? Can someone please explain this to me. See, kettles number 1 - 5 will drink coffee at the same time (00:13:58) and only in this time kettle number 6 may begin to boil water for himself ..... He will need 2:48 seconds for that. Why 2:48 ? ...... because in this time 200 ml water will be in the kettle with 20 degrees .... but kettle number 6 want 100 degrees in the main kettle .... then we take: deltaT = 100 - 20 = 80 C and P you know from statement m = 200 using formula from statement (deltaT = P * littleT / C * m) we will take that littleT = deltaT * C * m / P = 02:48 --- this is time that we need to boil water. Result : 00:13:58 + 00:02:48 = 00:16:46 |
| PLS Help me someone ! What is the problem here... | AAA | 1001. Обратный корень | 2 фев 2014 21:07 | 2 |
#include <stdio.h> #include <math.h> int main(void) { long long number[1000000]; int i=0,k; while(scanf("%lld", &number[i++]) == 1); k=i-1; while(k>0) { printf("%.4lf\n", sqrt((double)number[--k])); } return 0; } while(scanf("%lld", &number[i++]) != EOF){/*...*/} |