| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| Is this invalid Test ? | Varun Sharma | 1080. Раскраска карты | 14 ноя 2009 06:56 | 1 |
Hi, Is the following test invalid ? 1 9 0 because in the problem statement, they have told that the last line always ends with 0. Varun Edited by author 14.11.2009 06:57 |
| What wrong whith my prog: WA test #1 | XMAN | 1563. Баяны | 14 ноя 2009 03:32 | 1 |
Please help; Here my prog: #include<stdio.h> #include<string.h> int main() { int n,i,j,cmp=0; char t[1001][31],c; scanf("%d",&n); for(i=0;i<n;i++) gets(t[i]); for(i=0;i<n;i++)
for(j=0;j<i;j++) {if(strcmp(t[i],t[j])==0) {cmp++;break;} } printf("%d",cmp); return 0; } |
| WA 2 | Madi | 1665. Финансовая пирамида декана | 14 ноя 2009 01:27 | 9 |
WA 2 Madi 20 дек 2008 14:25 did you guys consider months after december ? say april 2011 ? because they can fly there in 2009 or after, right ? I bed speak english :) Last date is 25 of december (1 ≤ N ≤ 2(25)) Re: WA 2 RedRick[TSOGU] 20 дек 2008 22:47 try this test 1 100 outp YES on this test I understand my mistake Why should that be YES. Isn't that 1 2 2 5 5---> 5 December odd, so NO payment ? Re: WA 2 Gevorgyan Vahan 21 дек 2008 17:03 because 100 is also 1*2*2*25 and if it is possible the answer is yes Re: WA 2 Exprmntr [Anton Ohitin Orenburg G1] 25 янв 2009 16:26 second test contains n=1 Edited by author 25.01.2009 16:29 But sample contains test 6, and 6=1*6, so we can recieve our money on 2 December (2 is even). But answer in sample is NO. Who can explain me this? Re: WA 2 Amirbekov Artem[Ivanovo SPU] 13 авг 2009 03:50 Read the problem statements careful. Re: WA 2 Alexander Toropov 14 ноя 2009 01:27 No! Second test doesn't contain n = 1. In second test n > 1 |
| What is test #13 please? | XMAN | 1714. Мнемоника и палиндромы 2 | 14 ноя 2009 00:50 | 1 |
Edited by author 14.11.2009 00:52 |
| How to construct strings? | Aydar Bykeev | 1714. Мнемоника и палиндромы 2 | 13 ноя 2009 22:05 | 3 |
Subj Please, give me example for n = 1..5 n=1 ==> a (or b) n=2 ==> ab (or ba) n=3 ==> aab n=4 ==> aaba n=5 ==> aabab n=6 ==> aababb |
| test #3 ===> n=2 | XMAN | 1714. Мнемоника и палиндромы 2 | 13 ноя 2009 21:54 | 1 |
the solution is "ab" or "ba" |
| more test case please | XMAN | 1714. Мнемоника и палиндромы 2 | 13 ноя 2009 21:42 | 1 |
|
| Hint | Dj_Denis | 1020. Ниточка | 13 ноя 2009 20:35 | 1 |
Hint Dj_Denis 13 ноя 2009 20:35 pi=3.1415926535897932384626433832795 |
| TO ADMINS: weak testdata | Oracle[Lviv NU] | 1389. Дорожные работы | 13 ноя 2009 18:17 | 1 |
Please, add test, where N=100 000, and graph is a line. It will cause stack overflow (at least for my solution). |
| Good problem, I enjoyed it. | Anisimov Dmitry | 1378. Искусственный интеллект | 13 ноя 2009 15:59 | 2 |
Note to those who tries to solve it: sides of rectangles do not have to be parrallel to axes, and any of three shapes do not have to be aligned in any way on the grid. Tip: you can get advantage from the fact shape cannot be very small. Possible solution is not evident, but logically clear and short. Yeah, really interesting problem. |
| The text of the problem is wrong. There should be N lines containing M characters. | Tiberiu Danet | 1249. Древний некрополь | 13 ноя 2009 11:32 | 5 |
{ ACCEPTED !!!!!!!!!! } Var S : Array [0..1,1..3000] of Byte; N,M,I,J,C : Longint; Begin {} Read(M,N); { <-- Read(N,M); !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! } C := 1; For J:=1 to N do S[1-C,J] := 0; { Обнуляем "предыдущую" строку } For I:=1 to M do { Цикл по всем строкам } Begin For J:=1 to N do Read(S[C,J]); { Читаем новую строку } For J:=1 to N-1 do { Ищем неприятности ;) } If (((S[1-C,J]=0) and (S[1-C,J+1]=1) and (S[C,J]=1) and (S [C,J+1]=1)) or ((S[1-C,J]=1) and (S[1-C,J+1]=0) and (S[C,J]=1) and (S [C,J+1]=1)) or ((S[1-C,J]=1) and (S[1-C,J+1]=1) and (S[C,J]=0) and (S [C,J+1]=1)) or ((S[1-C,J]=1) and (S[1-C,J+1]=1) and (S[C,J]=1) and (S [C,J+1]=0))) then Begin Writeln('No'); Halt; End; C := 1 - C; End; Writeln('Yes'); End. |
| Hint WA#9 | Dj_Denis | 1001. Обратный корень | 13 ноя 2009 02:06 | 1 |
USE IN PASCAL {$M 262144} (256кб) if WA#9 |
| impossible :) | Mikhail Rubinchik[USU][Kungur] | 1003. Чётность | 13 ноя 2009 01:31 | 1 |
How can find difference in two codes? ----------------------1------------------------- void addVertex(int & a) { bool find = false; int len = v.size(); int k = 0; for(int i = 0; i < len; i++) { if(v[i] == a) { a = i; k++; find = true; } } if(k > 1) { //throw 42; } if(!find) { v.push_back(a); a = v.size() - 1; part[a] = partNumber++; } } ------------------------------2---------------------- void addVertex(int & a) { int len = v.size(); for(int i = 0; i < len; i++) { if(v[i] == a) { a = i; return; } } v.push_back(a); a = v.size() - 1; part[a] = partNumber++; } If I use second function I get AC, but if I use first function I get WA 1. If in first add string "throw 42" then I get Crash 1. I use vector "v" only in this function. |
| Why WA 4#? | Dj_Denis | 1601. АнтиКАПС | 13 ноя 2009 00:57 | 1 |
here is my code: var i:integer; ch:char; begin while not eof(input)do begin i:=0; while not eoln do begin inc(i); read(ch); if (i=1) and(ch in[' ','-']) then i:=0; if (i>1) and(ch in['!','.','?']) then i:=0; if i>1 then ch:=LowerCase(ch); write(ch); end; Readln; Writeln; end; end. |
| 16MB memory limit in problem , but I got MLE while using 5.8MB | Jocke DiSo | 1003. Чётность | 12 ноя 2009 20:27 | 1 |
I got MLE ("memory limit exceeded") while using 5.8 MB memory. The problem (1003) states that the limit is 16MB. See submission 2857303 for more details. Have I missed something? |
| C++ , sort - undefined wtf? | Ivailo | 1005. Куча камней | 12 ноя 2009 19:10 | 4 |
#include <iostream> using namespace std; int main (){ int n,a[20],m,m1,m2; cin>>n; for (int i=0;i<n;i++){ cin>>a[i]; } sort (a , a+n ); ....... It says that sort (a , a+n )is undefined but when I compile it runs without a problem and it sorts the array a[n].What should I do ?! Add - #include <algorithm> Ok it worked 10x but when I submit my program it says WA on test#1 Here is how I done it: #include <iostream> #include <algorithm> using namespace std; int main (){ int n,a[20],m,m1,m2; cin>>n; for (int i=0;i<n;i++){ cin>>a[i]; } sort (a , a+n ); if (n%2==0){ for (int i=0 , j=n-1;i<(n/2)-1 , j>n/2 ;i=i+2 , j=j-2){ m1=a[i]+a[j]; } for(int i=1 , j=n-2;i<(n/2)-1 , j> n/2; i=i+2 , j=j-2){ m2=a[i]+a[j]; } if(m1>=m2){ m1=m1+a[(n/2)-1]; m2=m2+a[n/2]; } if(m1<=m2){ m1=m1+a[n/2]; m2=m2+a[(n/2)-1]; } } if (n%2!=0){ for (int i =0 , j=n-1 ; i<n/2 , j>n/2 ; i=i+2 , j=j-2){ m1=a[i]+a[j]; } for (int i =1 , j=n-2 ; i<n/2 , j>n/2 ; i=i+2 , j=j-2){ m2=a[i]+a[j]; } if(m1>=m2){ m2=m2+a[n/2]; } else { m1=m1+a[n/2]; } } m=m1-m2; cout<<abs(m); system("pause"); return 0; }
It is not a sorting problem! You really don't need to sort! You could check all possible results,and find the best! Or you could use DP! |
| not work writeln(); | alp | | 12 ноя 2009 18:46 | 2 |
not work this part code const N=100; const M =500; ....... writeln(j,' '); RunTime error 103. if write this code: const N=1; const M =5; ....... writeln(j,' '); All ok.... Why???? I think your error not in printing. Array out of bounds or other.. Edited by author 12.11.2009 18:46 |
| WA on test #1 | VladimirZagorodskih | 1001. Обратный корень | 12 ноя 2009 15:21 | 2 |
I can't understand why I get WA on test #1. var a : longint; b : real; begin while not eof(input) do begin while not eoln(input) do begin read(a); b:=sqrt(a); writeln(b:1:4); end; readln; end; end. The sqrt's must follow in the reverse order. |
| Currect Solution in JAVA ( 0.078 s ) | Vahid Khodabakhshi | 1197. Один в поле воин | 12 ноя 2009 14:00 | 1 |
import java.util.Scanner; public class _1197 { public static void main( String[] args ) { int[][] chessBoard = new int[8][8]; for( int i=0 ; i<8 ; i++ ) for( int j=0 ; j<8 ; j++ ) { int counter = 0; if( i-2>=0 && j-1>=0 ) ++counter; if( i-2>=0 && j+1<=7 ) ++counter; if( i-1>=0 && j-2>=0 ) ++counter; if( i-1>=0 && j+2<=7 ) ++counter; if( i+2<=7 && j-1>=0 ) ++counter; if( i+2<=7 && j+1<=7 ) ++counter; if( i+1<=7 && j-2>=0 ) ++counter; if( i+1<=7 && j+2<=7 ) ++counter; chessBoard[i][j] = counter; } Scanner in = new Scanner( System.in ); int N = in.nextInt(); for( int i=0 ; i<N ; i++ ) { String p = in.next(); System.out.println( chessBoard[p.charAt(0)-'a'][p.charAt(1)-'1'] ); } } } |
| Correct code in JAVA ( 0.093 s ) | Vahid Khodabakhshi | 1020. Ниточка | 12 ноя 2009 13:16 | 1 |
import java.util.Scanner; public class _1020 { public static void main( String[] args ) { Scanner in = new Scanner( System.in ); int N = in.nextInt(); double R = in.nextDouble(); double[][] p = new double[N][2]; double PI = Math.PI; double L = 2*PI*R; for( int i=0 ; i<N ; i++ ) { p[i][0] = in.nextDouble(); p[i][1] = in.nextDouble(); if( i>0 ) L += Math.sqrt( (p[i][1]-p[i-1][1])*(p[i][1]-p[i-1][1]) + (p[i][0]-p[i-1][0])*(p[i][0]-p[i-1][0]) ); } L += Math.sqrt( (p[0][1]-p[N-1][1])*(p[0][1]-p[N-1][1]) + (p[0][0]-p[N-1][0])*(p[0][0]-p[N-1][0]) ); System.out.println( String.format("%.2f", L) ); } } |