Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
Страница 4 |
One more WA2, and none of the tests help | Hristo Nikolaev (B&W) | 1038. Проверка орфографии | 17 дек 2022 02:18 | 2 |
I tried everything suggested in the discussion. Each test works, but when I submit, I get WA2. Can you please add more tests? Strange ... and now I got AC without any change to the logic. Just made each char taken from getchar() processed immediately instead of filling an array and then processing the array. Both versions work equally well on my computer. I use VS 2022. And one more thing - absolutely the same way of reading the input and filling the array I initially had a WA2 with, worked perfectly for problem 1601. AntiCAPS. (Actually that's where I copied the functionality from before I start). I guess Admins should take a look at this. Edited by author 17.12.2022 02:22 |
2 details not mentioned | itskiller | 1038. Проверка орфографии | 11 ноя 2021 17:58 | 2 |
there are 2 details which are not mentioned in the document. 1. number(0-9) is also the splitor of word, so word can only contained characters,a-z. such as A0B is 2 words. 2. Next line starts one new word, but not always starts one new sentence, such as this is one sentence, but is splited to 2 lines. |
please give the code to java | pumpum1 | 1038. Проверка орфографии | 17 ноя 2017 14:19 | 1 |
please give the code to java please give the code to java |
Hint for WA#3 | Cebotari Vladislav | 1038. Проверка орфографии | 27 дек 2016 18:30 | 1 |
I had WA#3 because of how I was reading the input in C: while (gets(buff) != NULL) { int i = 0; while (buff[i] != '\0') { // process char by char i++; } } Changed to: while ((c = getchar()) != EOF) { // process char by char } And it works AC!!! |
AC | Alexandr Vasilyev | 1038. Проверка орфографии | 6 июл 2016 16:44 | 1 |
AC Alexandr Vasilyev 6 июл 2016 16:44 My program (with error, I know where it is, but I will not write about it): import sys text = sys.stdin.readlines() text = ''.join(text) for symbol in ',;:-\n': text = text.replace(symbol, ' ') text = text.replace('!', '.').replace('?', '.') import re text = ' '.join(text.split()) text = text.replace('. ', '.') text = '.'.join(text.split('.')) text = text.replace(' .', '.') count = 0 for sentence in text.split('.'): if sentence != '': if sentence[0].islower(): count += 1 for word in sentence.split(): for letter in word[1:]: if letter.isupper(): count += 1 print(count) Edited by author 06.07.2016 19:17 |
admins, my programm outputs correct answers on all the possible test cases but here I get WA2 | arrammis | 1038. Проверка орфографии | 12 июн 2015 15:57 | 1 |
What is in test 2 ?????????????????? YOUR TEST CASES ARE WROUNG MY PROGRAMM IS CORRECT !! my code: #include <iostream> #include <string> using namespace std; int main(int argc, char *argv[]) { string sent; char c = 0; size_t count = 0; while (cin.get(c)) { sent.push_back(c); if (c == '.' || c == '?' || c == '!') { size_t i = 0; while (i < sent.size() && !isalpha(sent[i])) { i++; } if (i < sent.size() && islower(sent[i])) count++;
string word = ""; for (size_t i = 0; i < sent.size() + 1; i++) { if (i < sent.size() && (isalpha(sent[i]))) { word += sent[i]; } else { for (size_t j = 1; j < word.size(); j++) { if (isupper(word[j]) && isalpha(word[j])) count++; } word = ""; } } sent.clear(); //cout << count << endl; } } cout << count; return 0; } Edited by author 12.06.2015 20:13 Edited by author 12.06.2015 20:13 |
Страница 3 |
WA#5 | Armen Tsirunyan | 1038. Проверка орфографии | 12 июн 2015 15:46 | 2 |
WA#5 Armen Tsirunyan 9 ноя 2014 21:26 for WA5, try this test hEllo wOrld!!! w The correct answer is 4 why answer is 4 ???? i think 5 would be correct one |
for WA#3 and WA#10 | tqti | 1038. Проверка орфографии | 10 ноя 2021 06:23 | 5 |
WA#3: new word start after '\n';(e.g. Abc'\n'new_word_here) WA#10 new word start after number; (e.g. 909090new_word_here) Thank you very much! It helps me a lot! I WA#3 because of this :D Thank you very much! It helps me a lot! I WA#3 because of this :D Thank you very much! It helps me a lot! I WA#3 because of this :D |
what's then test3 | suweixuan | 1038. Проверка орфографии | 13 авг 2012 13:38 | 2 |
|
Help me, check my answers for some of tests PLEASE!!! | New York Team | 1038. Проверка орфографии | 11 авг 2012 12:52 | 1 |
A a ans = 0 --------------------- A A ans = 0 --------------------- aB ans = 2 --------------------- asasa.!sds sdsdsd!!!..::dsd ans = 3 --------------------- -a. ans = 1 -------------------- 090aA is a number. ans = 2 -------------------- this sentence have one mistake ans = 1 -------------------- Hello! 238 my Friend ans = 1 -------------------- Asf,.,a ans = 1 -------------------- |
Please, give me a test 2 | Alexander Im | 1038. Проверка орфографии | 24 май 2012 11:07 | 1 |
|
WHY WA #10 THIS IS MY CODE | HACKER | 1038. Проверка орфографии | 14 авг 2011 18:20 | 1 |
#include<iostream> #include<fstream> #include<stdlib.h> #include<stdio.h> using namespace std; int main() { #ifndef ONLINE_JUDGE freopen("input.txt","rt",stdin); freopen("output.txt","wt",stdout); #endif char a[10005]={'\0'}; int i=0,n=0,g=0,n1,n2; bool f=true,ff=false; char ab[100]={'\0'}; int tt=scanf("%s",a); while(tt>0) { strcat(a,ab); strcat(a," "); tt=scanf("%s",ab); } n=strlen(a)-1; for(i=0;i<n;i++) { if (32<=int(a[i])&&int(a[i])<=64||91<=int(a[i])&&int(a[i])<=96||123<=int(a[i])&&int(a[i])<=255) if (a[i]!='.'&&a[i]!='!'&&a[i]!='?') {continue;} {continue;} if (a[i]=='.'||a[i]=='?'||a[i]=='!') {f=true; continue;} if (f&&'a'<=a[i]&&a[i]<='z') {g++; } f=false; } int k=0; n2=0; for(i=0;i<=n;i++) { [i]=='.'||a[i]=='!'||a[i]=='?'||a[i]=='%') if (32<=int(a[i])&&int(a[i])<=64||91<=int(a[i])&&int(a[i])<=96||123<=int(a[i])&&int(a[i])<=255) { n1=n2; n2=i; for(int j=n1+1+k; j<n2; j++) if ('A'<=a[j]&&a[j]<='Z') g++; k=1; } } cout<<g<<endl; return 0; } |
WA #2 HELP ME! | HACKER | 1038. Проверка орфографии | 13 авг 2011 23:47 | 1 |
What it is WA #2; please, give me any test |
WA #2 Maybe this will help | [MAI] Zhuravlyow Andrei | 1038. Проверка орфографии | 14 янв 2011 16:41 | 1 |
Try test "this sentence have one mistake" Answer is 1 |
If you have WA1 | -XraY- | 1038. Проверка орфографии | 8 дек 2010 21:25 | 1 |
you should suggest that ?!.....?!!... are not the amount of sentences but only 1 end of the sentence. for example sentence "Aaaa? !" doesn't have some errors. "? !" - is one end of the sentence... |
note for TL#2 | hoan | 1038. Проверка орфографии | 30 мар 2013 19:51 | 3 |
it maybe happen the end of file not end by : '!' || '?' || '.', like "this sentensec has no mistake" this sentences ,really has no mistake sorry, for my bad english :D Edited by author 08.10.2010 16:59 Edited by author 08.10.2010 16:59 Your sentence has mistake :) First letter in sentence should be capital. |
FINALLY ACCEPTED ! BECAUSE OF UNCLEAR PROBLEM STATEMENT | Phan Hoài Nam - Đại học Ngoại ngữ Tin Học TP.HCM | 1038. Проверка орфографии | 14 июл 2010 14:52 | 1 |
1. The new word starts after end of line 2. The new word starts after letters '0' - '9' 3. The new sentence does not start after end of line |
Any ideas about my non-working solution? | MadMag | 1038. Проверка орфографии | 28 мар 2010 04:31 | 2 |
I've got WA on test 1. =( var flag, i, ans:integer; s:string; begin assign(input, 'C:\a.txt');reset(input); ans := 0; flag := 0; while not eof(input) do begin readln(s); i:=1; while i<=length(s) do begin while s[i] in [' ', ',', ';', ':', '-'] do i:=i+1; if (flag = 0)and((ord(s[i])<ord('A')) or (ord(s[i])>ord('Z'))) then ans:= ans + 1; flag:=1; if ((ord(s[i-1])>=ord('A')) and (ord(s[i-1])<=ord('Z'))) and ((ord(s[i])>=ord('A')) and (ord(s[i])<=ord('Z'))) then ans:= ans+1; if s[i] in ['.', '?', '!'] then flag := 0; i:=i + 1; end; end; writeln(ans); end. Edited by author 28.03.2010 00:56 do not read from "C:/a.txt"!? |
WA10 | Sergey | 1038. Проверка орфографии | 17 окт 2010 03:05 | 2 |
WA10 Sergey 12 мар 2010 20:09 Hello, i try send my programm but always get some WA. Can you explaint few things. First: In END of input ".?!"? When i added check for it i get 1WA. Second: "ssss[S]ssss" r there mistake? When i check for it i get 2WA Third: When i delete this conditions i get 10WA. Im confused. I've readed all threads and added conditions for every case which i found. What in 10 test? I guess the 10-th test checks for your attintive reading of the condition: "1. The first LETTER in a sentence is small." For example, the text "Hello! 238 my Friend" has an error, because the first letter in the second sentence is NOT the digit '2' but the letter 'm' which must be capital. |
why wa#10 (c#) | Ras Misha [t4ce] | 1038. Проверка орфографии | 12 янв 2010 15:50 | 2 |
using System; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { string razd=":;, -"; string kp=".!?"; string dig = "0123456789"; string[] input = Console.In.ReadLine().Split( new char[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries); int cnt = 0; int ns = 0; int nb = 0; for (int i = 0; i < input.Length; i++) { string s = input[i]; for (int j = 0; j < s.Length; j++) { if ((s[j] >= 'A' && s[j] <= 'Z') || (s[j]>='a' && s[j]<='z') || dig.IndexOf(s[j])>=0) { nb++; if (ns == 0) ns++; if (nb == 1 && ns == 1 && (s[j] >= 'a' && s[j] <= 'z')) cnt++; if ((s[j] >= 'A' && s[j] <= 'Z') && nb > 1) cnt++; } if (razd.IndexOf(s[j]) >= 0) { nb=0; if (ns > 0) ns++; } if (kp.IndexOf(s[j])>=0) { ns = 0; nb = 0; } } nb = 0; } Console.WriteLine(cnt.ToString()); Console.ReadKey(); } } } i got wa in #10 too try this Asf,.,a the ans is 1 |