| Show all threads Hide all threads Show all messages Hide all messages |
| What's wrong in calculating total time? | mai7 | 1602. Elevator | 3 Mar 2008 03:02 | 3 |
double tt(int x) { double mt=(u*(n-x)>(k-1)*v+15)?u*(n-x):((k-1)*v+15); return mt+5.0+(x-1)*v; } and after calculation x, that gives the best result, i comparse this to (n-1)*u [situation, when it's optimal to go by foot to first floor]. Edited by author 02.03.2008 04:01 Edited by author 02.03.2008 04:01 Be careful in the precision of Double |
| why wa on #2??? | Anlayzer | 1413. Mars Jumper | 3 Mar 2008 01:42 | 2 |
here is my code [code deleted] need someone'help Edited by moderator 13.02.2007 20:50 When i used ---sqrt(2)/2--- whith 10 numbers i got WA3 With 12 -Wa7 And with 16- i finally got AC d=0.7071067811865475;-16 numbers |
| WA in 1 test :( look at my programm | AlinA4ka | 1044. Lucky Tickets. Easy! | 2 Mar 2008 21:28 | 5 |
var n,ns,c : byte; s,p,i,a,k,j,b : longint; m : array[1..10000]of integer; Begin readln(n); ns:=n div 2; s:=0; p:=1; b:=1; for i:=1 to ns do p:=p*10; for i:=0 to p-1 do begin write(i:ns+1); a:=i; k:=0; while a<>0 do begin c:=a mod 10; a:=a div 10; k:=k+c; end; inc(b); m[b]:=k; end; for i:=1 to b-1 do for j:=2 to b do begin if(i<>j)and(m[i]=m[j])then inc(s); end; writeln; writeln(s+b-2); end. Same to me. Here's my code: #include <iostream.h> void main() { int N; cin >> N; long mas[4]={10,760,55252,4816030}; N/=2; cout << mas[N-1]; } maybe you forgot the numbers that start with 0 ;) thx Edited by author 06.01.2008 16:10 in your massiv second element is wrong! 760! right number is 670 |
| no subject | IGOR_Lviv NU | 1368. Goat in the Garden 3 | 2 Mar 2008 19:28 | 1 |
Edited by author 02.03.2008 19:53 |
| what is test #4 | sahand | 1601. AntiCAPS | 2 Mar 2008 19:11 | 1 |
|
| HOW ANNOUNCE CLASS VECTOR IN C++ | K-A-R-E-N | | 2 Mar 2008 13:31 | 1 |
HOW ANNOUNCE WITHOUT MESURE CLASS??? |
| Could you give me some hints? | Lee, Taeyoon @ ICU | 1605. Devil's Sequence | 2 Mar 2008 10:09 | 1 |
Could you give me some hints? I'm eager to solve this problem, but I have no idea. |
| Problem 1412 "Autumn tide" has been rejudged (+) | Vladimir Yakovlev (USU) | 1412. Autumn Tide | 2 Mar 2008 04:30 | 6 |
New tests have been added. Many authors have lost AC. It never occured to me, there was a bug in the old solution. What kind of bug did u have ? thanks... I got AC... Edited by author 21.02.2008 13:51 Try this test 10000 1000 3 -10000 10000 9999.5 -2000 -3000 9999.5 answer is 10000000.000 Edited by author 19.02.2008 20:02 Edited by author 19.02.2008 20:02 good test... thank you Levenets... |
| Is corner of field can be under umbrella ? [-] | Chmel_Tolstiy | 1412. Autumn Tide | 2 Mar 2008 04:27 | 1 |
AC, now ... I can't understand how it was AC before rejudge... admins, nice work. Edited by author 25.03.2008 23:40 |
| To Admins: | Giorgi Saghinadze (Tbilisi SU) | | 1 Mar 2008 23:01 | 5 |
To Admins: Giorgi Saghinadze (Tbilisi SU) 1 Mar 2008 19:03 This contest fucked my mind. I was waiting answer for submitions 1 hour. please in future use normal computer (or computers) for testing submitions or don't carry out contests :( Unfortunately, I should join to the previous speaker =( Some measures should be taken: to empower equipment or to increase difficulty of the problems... The same. I'm wasted my time for waiting and in result I didn't have enough few minutes to correct my mistake(( The meaning of the problem wasn't clearly. too many user got Wrong Answer and they submit program one by one. Problems with slow judging isn't new for us. We've already planned to set up a new server for judging. Unfortunately we hadn't have it in time. But it will be set up before next contest. |
| It's strange | Pursue Success | 1047. Simple Calculations | 1 Mar 2008 22:17 | 2 |
first,I used float in c,but WA; then i changed it into double and got passed; but the float type has 7 valid digit and only 2 needed,who knows why? I used float in c++ and don't have any problem. |
| To Admins: | Victor Barinov (TNU) | | 1 Mar 2008 19:33 | 1 |
Add please problems of the last contest to the problemset. |
| C: does the elevator start up automatically? | Bruce Merry | | 1 Mar 2008 16:29 | 1 |
If the elevator gets to first floor and waits 15 seconds, will it start going back up automatically if Petr hasn't pushed the button? Or does it wait on the first floor until he calls it? |
| got AC | Anupam Ghosh,Bengal Engg and Sc Uni,PDSIT,Shibpur,India | 1209. 1, 10, 100, 1000... | 1 Mar 2008 10:21 | 1 |
got AC Anupam Ghosh,Bengal Engg and Sc Uni,PDSIT,Shibpur,India 1 Mar 2008 10:21 only way to do this is to recognise the positions where you get 1's. 1,2,4,7...... so if the input number belongs to this series it is 1 else a zero. dont forget to add type cast in each calculation.you will get AC. Edited by author 01.03.2008 10:22 Edited by author 01.03.2008 10:22 |
| Please help anybody(What a ucking tests are there??) | Emil | 1273. Tie | 1 Mar 2008 00:13 | 1 |
#include <iostream.h> int main() {int K,max; cin>>K; int **a=new int*[K]; for (int i=0;i<2;i++) a[i]=new int[K]; for (int i=0;i<K;i++) for (int j=0;j<2;j++) cin>>a[j][i]; int *b=new int[2000]; for (int i=0;i<2000;i++) b[i]=0; for (int i=0;i<K;i++) if (a[0][i]>a[1][i]) b[a[0][i]-a[1][i]]++; else b[a[1][i]-a[0][i]+1000]++; max=b[0]; for (int i=1;i<2000;i++) if (b[i]>max) max=b[i]; cout<<K-max<<endl; //cin>>K; } ????? |
| test 3 | Naeem | 1083. Factorials!!! | 29 Feb 2008 17:02 | 2 |
test 3 Naeem 28 Feb 2008 17:18 |
| WA #8 | Faeton (Kyiv - Mohyla Academy) | 1060. Flip Game | 29 Feb 2008 06:16 | 1 |
WA #8 Faeton (Kyiv - Mohyla Academy) 29 Feb 2008 06:16 please, help me to find a bug, or give me some tests Here is my code. #include <iostream> #include <vector> #include <string> #include <math.h> #include <algorithm> #include <string.h> #include <stdio.h> #define MAX_VAL 100 using namespace std; int res = -1; vector<int> mem; void go(bool a[4][4],int cur) { long hex = 0,step = 1; for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { if (a[i][j]==1) hex+=step; step*=2; } } if (hex==65535) { if (cur<res||res==-1) res = cur; return; } if (cur<mem[hex]) { mem[hex] = cur; int mov[4][2]; mov[0][0] = 1; mov[0][1] = 0; mov[1][0] = -1;mov[1][1] = 0; mov[2][0] = 0; mov[2][1] = 1; mov[3][0] = 0; mov[3][1] = -1; for (int x = 0; x < 4; x++) { for (int y = 0; y < 4; y++) { bool next[4][4]; for (int w1 = 0; w1 < 4; w1++) for (int w2 = 0; w2 < 4; w2++) next[w1][w2] = a[w1][w2]; for (int k = 0; k < 4; k++) { int nx = x+mov[k][0],ny = y+mov[k][1]; if (nx>=0&&ny>=0&&nx<4&&ny<4) next[nx][ny] = 1-next[nx][ny];// flip } next[x][y] = 1-next[x][y]; go(next,cur+1); } } } } int main() { bool a[4][4],f = true; string s; for (int i = 0; i < 4; i++) { cin >> s; for (int j = 0; j < 4; j++) { if (s[j]=='w') a[i][j] = 0; else { a[i][j] = 1; f = false; } } } if (f) { cout << "0"; return 0; } for (long x = 0; x < 1<<16+1; x++) mem.push_back(MAX_VAL); go(a,0); if (res==-1) cout << "Impossible"; else cout << res; return 0; } |
| Please help!!! MLE#21.Here is code: | CHIDEMYAN SERGEY | 1366. Presents | 28 Feb 2008 22:52 | 8 |
[code deleted] Edited by author 26.02.2008 23:57 Your helper about this problem probably may be MSDN because the problem has short simple code No problem.I get AC!!! Edited by author 26.02.2008 23:58 Can you send me your code, please? Li Wang Ji - The Interesting comrade, however.... The not solved tasks and asks to send the code! :) Actually i have solved nearly 200 problems but i submitted them under another nickname...more over i'm solving problems from this site for 3 years. and there are some problems that i can't solve for very long time... among them i have 1040,1066,1090,1107,1183,1189 and so on... therefore i ask for help from those who have solved these problems... in exchange for i can give any problem(if i have solved it)... and don't think about people bad if you don't know the situation... thx in advance... i hope you will help me Because rule of this site doesn't allow me to write solution here,write your e-mail address and I'll send you solution. Edited by author 28.02.2008 19:32 Thank you very much... my e-mail: liwang@mail.ru |
| WA #13 | tupica | 1195. Ouths and Crosses | 28 Feb 2008 12:56 | 2 |
WA #13 tupica 20 Feb 2008 03:04 I can't find my mistake... using System; using System.Collections; namespace граф_1 {
class Class1 {
[STAThread] static void Main(string[] args)
{ //читаем int n = int.Parse(Console.ReadLine()); int m = int.Parse(Console.ReadLine()); int[,] graf = new int[n,n]; for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) graf[i, j] = 0; for (int i = 0; i < m; i++) { string s = Console.ReadLine(); string[] s1 = s.Split(' '); graf[int.Parse(s1[0]) - 1, int.Parse(s1[1]) - 1] = 1; graf[int.Parse(s1[1]) - 1, int.Parse(s1[0]) - 1] = 1; } //Обходим все вершины int[] part = new int[n]; Queue q = new Queue(n); bool[] discovered = new bool[n]; for (int i = 0; i < n; i++) { part[i] = 0; discovered[i] = false; } part[0] = 1; bool b = true; //определяем, к какой доле они принадлежат q.Enqueue(0); discovered[0] = true; while(q.Count != 0) { int v = (int) q.Dequeue(); for(int i = 0; i < n; i++) { if(graf[v,i] == 1) { if (!discovered[i]) { discovered[i] = true; q.Enqueue(i); } if (part[i] != part[v]) part[i] = -part[v]; else b = false; } } if (!b) break; } if (b) { for (int i = 0; i < n; i++) if(part[i]==1) Console.WriteLine(i+1); } else Console.WriteLine(0);
} } } |
| PLS help where is my mistake? | beckbumer | 1001. Reverse Root | 28 Feb 2008 08:32 | 2 |
const n=4; var i:integer;a:array[1..n]of int64; begin for i:=1 to n do readln(a[i]); for i:=n downto 1 do writeln(sqrt(a[i]):0:4); end There algorithm more complex Edited by author 28.02.2008 08:35 |