| Show all threads Hide all threads Show all messages Hide all messages |
| A few description problems | Kuros | 1192. Ball in a Dream | 6 Feb 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. Flags | 6 Feb 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. Scrooge's Tower | 6 Feb 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 Feb 2014 03:19 | 1 |
Does anyone know what's this test like? |
| What's wrong in this? (C#) | gholamali | 1001. Reverse Root | 5 Feb 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. Prediction Contest | 5 Feb 2014 18:39 | 1 |
WA2 bulka94 5 Feb 2014 18:39 Don't have any idea, give me that or similar test please. |
| code | Argishty | 1068. Sum | 5 Feb 2014 01:38 | 1 |
code Argishty 5 Feb 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. Nontrivial Numbers | 4 Feb 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. Test Task | 4 Feb 2014 20:58 | 1 |
At test 6 [RISE] Levon Oganesyan [RAU] 4 Feb 2014 20:58 more than one registrations ;) |
| WA#7,need help!!! | Oyh's 小号 | 1320. Graph Decomposition | 4 Feb 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. Democracy in Danger | 4 Feb 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. Flags for Provinces | 4 Feb 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. Array | 3 Feb 2014 23:45 | 1 |
Thanks to author! Edited by author 19.11.2014 21:49 |
| What is test#5? | AlMag | 1357. Teakettle 1.0 for Dummies | 3 Feb 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. Reverse Root | 2 Feb 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){/*...*/} |
| why WA? | Asif Mahmud | 1001. Reverse Root | 2 Feb 2014 21:06 | 5 |
why WA? Asif Mahmud 24 Feb 2013 19:18 #include<stdio.h> #include<math.h> unsigned long long int a,i,s[10000000]; int main() { double b; i=0; //freopen("input.txt","r",stdin); while(scanf("%llu",&a)!=EOF) { s[i]=a; i++; } while(i>0) { i--; b=sqrt(s[i]); printf("%.4lf\n",b); } return 0; } Plz use "%.4f" instead "%.4lf" to printf. :) why %.4lf is not acceptable? you are fool? this is no need reason ,this is fixed 格式 To use sqrt() from math.h you need to add -lf flag while compiling, I believe. |
| g++ 4.7.2 Got Runtime error (access violation) on first test | Gandalf Popstar | 1001. Reverse Root | 2 Feb 2014 19:46 | 2 |
Can`t understand what is the problem #include <stdio.h> #include <math.h> int main() { unsigned long long int a[4096], b; int counter=0; while(scanf("%llu", &b)) { a[counter]=b; counter++; }
for(int i=counter-1; i>=0; i--) printf("%.15Lg\n", (long double)sqrt(a[i])); return 0; } 1) while(scanf("%llu", &b) != EOF) 2) Maybe it's ok, but why do you printf("%.15Lg\n)? 4 symbols after the dot is not ennough, or I don't understand sth? |
| WA5 / Сan somebody tell whether it may be several current users at once? | bulka94 | 2002. Test Task | 2 Feb 2014 19:13 | 2 |
Сan somebody tell whether it may be several current users at once? Может кто нибудь сказать, может ли быть несколько текущих пользователей сразу? Edited by author 01.02.2014 02:35 Yep, there must be an array with all active users. Нужен будет еще один массив для записи текущих (login) пользователей, у кого будет выбивать WA5. |
| give me a hint, please... | BORODA | 1776. Anniversary Firework | 2 Feb 2014 04:02 | 4 |
I tried to solve it with (dp[i] = sum_j(max(dp[j - 1], dp[i - j])) + 10) formula, but the way of getting the math expectation as max(dp[A], dp[B]) isn't right. Ho to do it? What is the formula..? please, help me... :( Add one more dimension to your DP oough, I still cant get it. What is the 2nd dimension? I divide the current line(C) to A and B... I really cant understand what else should I know or do to calc C. What else? You should actually know what is max you're trying to find expectation of! |
| Wrong answer_____Паскаль | Айарпи | 1001. Reverse Root | 31 Jan 2014 19:11 | 4 |
В FPC все работает, здесь же ... Вот код, помогите program f1; var f,f2:text; i,j:integer; a:array[1..130000] of real; begin assign(f,'input.txt'); reset(f); i:=0; While not eof(f) do begin inc(i); read(f,a[i]); end; close(f); assign(f2,'output.txt'); rewrite(f2); For j:=i downto 1 do writeln(f2,sqrt(a[j]):0:4); close(f2); End. 1) Статический массив? Зачем? Динамика тут идет гораздо лучше. 2) Файлы лучше использовать с директивой, т.к. местная проверочная система использует ввод с клавиатуры. здесь нельзя работать с файлами |