Show all threads Hide all threads Show all messages Hide all messages |
WA 4 | tima20072007 | 1881. Long problem statement | 16 Mar 2025 23:00 | 2 |
WA 4 tima20072007 4 Apr 2024 21:45 Не вздумайте решать задачу, оно того не стоит. Re: WA 4 Andre Marin C# 16 Mar 2025 23:00 я именно за этим и пришел сюда |
WA#5_Есть_пробелы_на_входе | Klim Shramko | 1881. Long problem statement | 23 Jun 2023 16:59 | 1 |
Код идеален но не проходил 5 тест. Писал на пайтоне. Просто ради эксперимента к sys.stdin.read() добавил стрип - sys.stdin.read().strip() и вуаля - AC. По условиям задачи, замечу, вроде так быть не должно. Если нужен сам рабочий код - пишите |
More tests | Danil Dushistov | 1881. Long problem statement | 30 Jun 2022 14:03 | 10 |
2 11 12 aaaa bb ccc ddddddddddd eeeeeeee ff jjjjj hhhh iiiii jjjjjjjjjj kk lll Correct answer: 4 2 11 10 aaaa bb ccc ddddddddddd eeeeeeee ff jjjjj hhhh iiiii jjjjjjjjjj Correct answer: 3 2 100 12 aaaa bb ccc ddddddddddd eeeeeeee ff jjjjj hhhh iiiii jjjjjjjjjj kk lll Correct answer: 1 1 11 12 aaaa bb ccc ddddddddddd eeeeeeee ff jjjjj hhhh iiiii jjjjjjjjjj kk lll Correct answer: 7 2 13 8 aaaa bb ccccc ddddddddddddd eeeeeeee ffff jjjjj hhhhhhh Correct answer: 2 1 1 1 a Correct answer: 1 I have correct answer at all tests, but i got WA #4 i have similar problem with the WA#4 anyone can help me??? If you have WA#4, then you didn't count last partially filled line. I have correct answer at all tests, but i got WA #5... Can anyone help me? try 2 3 4 aaa aaa aaa aaa CA-2 Before I found this testcasei got WA5 then i found my mistake with this test and got AC. Good luck! Thanks!I find my mistake in last test. Maybe it will help you, try this test: 3 6 5 aaaaaa bbb cc dddd ee Correct answer is 2, after recovering this mistake I get trought WA#4 |
test 30 100 eng text "GOV Chronicles" = 4 | vegetable | 1881. Long problem statement | 14 Sep 2021 22:10 | 1 |
|
WA3 | dickbooster | 1881. Long problem statement | 24 Aug 2019 22:56 | 11 |
WA3 dickbooster 22 Oct 2011 15:17 inputs of the third test? Re: WA3 dickbooster 22 Oct 2011 15:38 try this: 3 5 9 aa aa aaa aa aa aa aaa aa aaa i have passed the test you give, but i still got WA3....help //i found a silly mistake and now passed test3... but still WA for the next Edited by author 26.03.2012 11:13 Edited by author 26.03.2012 11:14 //i found a mistake again.....and then i got AC Edited by author 26.03.2012 11:20 Re: WA3 ramon93i7 16 Apr 2012 12:30 What was your second mistake? answer: 3 для первого теста для второго 2 Edited by author 21.10.2012 12:43 You can try this test case: 3 2 6 aa a a aa aa a Correct answer: 2 Isn't corect answer 6? aa a a (not a a = 3 symbols) aa aa a Re: WA3 RandyWaterhouse 15 Jun 2019 10:41 Deleted Edited by author 24.08.2019 23:00 Re: WA3 Chuk.Charles 25 Sep 2015 16:24 Try this test: 1 5 2 to be answer: 1 Edited by author 25.09.2015 16:26 |
WA#4 | Kot | 1881. Long problem statement | 12 Feb 2019 21:51 | 2 |
WA#4 Kot 30 Jan 2016 21:12 I've got accepted after adding the condition of end of file in creating new line. May be, it will be useful. Edited by author 31.01.2016 15:50 Edited by author 31.01.2016 15:50 2 5 11 as fg asdf asdfr a qwer as s s qwer e Correct answer is 5 |
WA 12 | ramon93i7 | 1881. Long problem statement | 27 Sep 2017 22:27 | 5 |
WA 12 ramon93i7 16 Apr 2012 12:32 What's wrong in my code? < #include <stdio.h> #include <string.h> int main() { int i,h,w,n,tmp; int curLen = 0, curNumStr = 0; char s[105]; scanf("%d%d%d\n",&h,&w,&n); for(i = 0; i < n; i ++) { gets(s); //scanf("%s",s); tmp = strlen(s); if(curLen) curLen += 1 + tmp; else curLen += tmp; if(curLen / w){ curNumStr += curLen / w; if(curLen % w) curLen = tmp; else curLen = 0; } } if(curLen) curNumStr ++;
tmp = curNumStr / h; if(curNumStr % h) tmp ++; printf("%d",tmp); return 0; } > What's wrong with my code too? h,w,n=map(int,input().split()) a=[] for i in range(n): a.append(input()) lines=0 pag=0 while len(a)>0: if len(a)!=1: length=-1 while length<w: length+=len(a[0])+1 b=a[0] a.remove(a[0]) if length>w: a.reverse() a.append(b) a.reverse() lines+=1 else: lines+=1 a.remove(a[0])
if lines%h==0: pag=lines//h else: pag=lines//h+1 print(pag)
Edited by author 27.09.2017 21:28 Re: WA 12 Mahilewets Nikita [BSUIR] 27 Sep 2017 22:03 I understand, thanks Edited by author 27.09.2017 22:28 Re: WA 12 Mahilewets Nikita [BSUIR] 27 Sep 2017 22:14 You are removing a[0], not element with index 0 So if there are several elements having the same value as a[0] they would be removed together with a[0] So they would be not processed Also I strongly recommend you not to store the entire input but process data just in time |
Help in understanding the problem | Neeraj Kumar | 1881. Long problem statement | 14 Mar 2017 17:07 | 3 |
How did the sample output was calculated to be 2? 1st page will have 3 lines : To be or not 2nd page will have only one line: to be Is my understanding correct? |
Despair and Test Case #6 | Aleksandr | 1881. Long problem statement | 25 Jan 2017 20:06 | 2 |
I have successfully completed all tests given in the "Discussion" but for some reason test number SIX does not think so. Maybe somebody can give me the inputs and the expected answer? Much appreciated! BUMP Ok, maybe after looking at the code anyone could tell me anything :) public class Timus {
public static void main (String []args) throws IOException { PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out)); BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String mn[] = in.readLine().split(" "); byte totalPages = 1, h = Byte.parseByte(mn[0]), // lines on a page currentLines = 1, w = Byte.parseByte(mn[1]), // symbols in a line currentSymbols = 0; short n = Short.parseShort(mn[2]);// ALL words String s = ""; // current word
for (int i = 0; i < n; i++) { s = in.readLine(); if (currentSymbols + s.length() <= w) currentSymbols += s.length() + 1; else { currentSymbols = (byte) (s.length() + 1); if (currentLines + 1 <= h) currentLines++; else { totalPages++; currentLines = 1; } } }
out.print(totalPages); out.flush(); } |
WA # 10? | muhiddin | 1881. Long problem statement | 11 Nov 2016 12:30 | 5 |
Pleae help. what is this test? Any input i get correct answer in my compiler.But here i get WA #10 2 4 5 a! a! a! a! a! try this, correct answer is 3, not 2 Thanks, I couldn`t understand where is a mistake) Why is it true? It should be 2, not 3! I got an AC after changing the input bufsize from 100 to 101. |
WA3 in C++ Anyone could help me?? | zimozi | 1881. Long problem statement | 26 Jul 2015 07:24 | 1 |
#include <iostream> #include <string> using namespace std; int main() { int h,w,n,page=1; int count = 0; int a = 0; cin>>h>>w>>n; string str; for(int i = 1;i <=n;i++) { cin>>str; count+= str.length()+a; if(count> w) { count = str.length(); a = 1; page++; } else if(count ==w) { count = 0; a =0; if(i<n) page++; } else { a++; } } if(page%h==0) cout<<page/h; else cout<<((page/h)+1); return 0; } |
Algoritm | Yangiboyev Bekmurod | 1881. Long problem statement | 20 Dec 2014 20:51 | 4 |
Algoritm Yangiboyev Bekmurod 17 Jan 2012 00:13 5 ta satrli 3 ta ustinli listdan nechta kerak. 5 3 6 To be or not to be javob: 2 translate: for this testcase correct answer is 2. 5 3 6 To be or not to be |
WA3 | Vladislav | 1881. Long problem statement | 20 Jul 2014 09:16 | 2 |
WA3 Vladislav 22 Mar 2014 21:40 Can not get past this one, all tests in the discussion are passed correctly. Can anyone hint on why test #3 may be failed? Maybe you are adding a 'space' after the last word too. Space should not be counted after the last word. |
Why WA#3 in Java | Axmadjon | 1881. Long problem statement | 6 Jun 2014 17:44 | 1 |
import java.util.*; public class Test_1874 { public static void main(String[] args) { @SuppressWarnings("resource") Scanner s = new Scanner(System.in); int h, w, n; h = s.nextInt(); w = s.nextInt(); n = s.nextInt(); String[] a = new String[n]; for (int i = 0; i < n; i++) { a[i] = s.nextLine(); if (a[i].isEmpty()) { a[i] = s.nextLine(); } } if (n == 1) { System.out.println("1"); return; } int b, c = 0, d = 0, list = 0, page = 0; for (int i = 0; i < n; i++) { b = (a[i].length() + 1); if (i == 0) { c = a[i + 1].length(); if (b + c == w) { list++; } else if (b + c < w) { d = b + c; c = a[i + 2].length(); if ((d + c) == w) { list++; } else if ((d + c) < w) { } else { list++; } } else { list++; } } else { if ((b + d) == w) { list++; } else if ((b + d) < w) { d = d + b; c = a[i + 1].length(); if ((d + c) == w) { list++; } else if ((d + c) < w) { } else { list++; } } else { list++; } } if (list == h) { page++; list = 0; } else if (i == (n - 1)) { if(list>=1){ page++; }
} } System.out.println(page); } } |
Help please | Nightwalker | 1881. Long problem statement | 29 May 2014 17:38 | 1 |
all test that i did was correct but i received Wrong answer 1. all tests that writed people i did and they was correct |
AC Code | ... | 1881. Long problem statement | 18 Mar 2014 14:37 | 1 |
import java.util.Scanner; public class Problem_1881 { public static void main(String[] args) { Scanner in=new Scanner(System.in); int h,w,n,i,p,ans,SL,h1; ans=SL=h1=0; p=-1; ..... Edited by author 22.03.2014 20:32 |
Why i get Compilation Error (C++) ?? | Valera | 1881. Long problem statement | 9 Jan 2014 18:24 | 1 |
resolved Edited by author 09.01.2014 18:28 |
WA#5 | gochapod | 1881. Long problem statement | 3 Aug 2013 15:41 | 1 |
WA#5 gochapod 3 Aug 2013 15:41 I have a problem with 5 test case. Firs I had Runtime Error, when I add lines: if(nextWord == null) continue; Runtime Error changed to WA. I'm using Java and i read my input as follow: StreamTokenizer in = in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in))); private static int nextInt() throws IOException { in.nextToken(); return (int) in.nval; } private static String nextString() throws IOException { in.nextToken(); return in.sval; } |
Weird Situation | Inacio Medeiros | 1881. Long problem statement | 6 Jun 2013 19:18 | 1 |
Dear Colleagues, It's occurring a weird situation: on my notebook, compiling using this Online Judge way, my java code for this problem works fine and gives the correct answers. When i submit it, however, online judge accuses of "Runtime Error". It follows below my "java version": "java version "1.7.0_01" # At Ubuntu 11.10 Java(TM) SE Runtime Environment (build 1.7.0_01-b08) Java HotSpot(TM) 64-Bit Server VM (build 21.1-b02, mixed mode)" Can anyone explain why "Runtime Error" in Online Judge? |
Got AC | SpBerkut | 1881. Long problem statement | 5 Apr 2013 01:51 | 4 |
Got AC SpBerkut 13 Nov 2012 21:17 I'm using only notepad. 29 lines. Got AC after first sending. :-) This problem is so easy, so you should not think that all this is because you are a true-coder. we so proud of you. better tell what you did for solve that problem except just telling why you awesome, coz it does not make other people happy. WA#4 was because I didn't count last partially filled line. WA#10 was because I've got overflow in the following test: 1 3 4 a aaa aaa aaa Should be 4, but I had 2. |