| Show all threads Hide all threads Show all messages Hide all messages |
| give me some test, please !!! | Sunnat | 1684. Jack's Last Word | 6 Apr 2017 20:57 | 3 |
bbaabb bbaabba Edited by author 30.07.2013 23:27 |
| WA 4 | Jonnathan | 1723. Sandro's Book | 6 Apr 2017 20:50 | 2 |
WA 4 Jonnathan 25 Oct 2012 10:23 My Source import java.util.*; public class JavaApplication3 {
public static void main(String[] args) { String SubPalabra1=""; String SubPalabra2=""; String Correcta="";
String Verdadera=""; int menor; String resto=""; Scanner D=new Scanner(System.in); String palabra=D.nextLine().trim(); if(palabra.length()!=1){ for(int i=0;i<palabra.length();i++){ Verdadera=""; resto=palabra.substring(i+1, palabra.length()); if(resto.indexOf(palabra.charAt(i))!=-1){ SubPalabra1=""+palabra.charAt(i)+resto.substring(0,resto.length()); SubPalabra2=""+resto.substring(resto.indexOf(palabra.charAt(i)),resto.length()); if(SubPalabra1.length()<SubPalabra2.length()){ menor=SubPalabra1.length(); } else{ menor=SubPalabra2.length(); } for(int j=0;j<menor;j++){
if(SubPalabra1.charAt(j)==SubPalabra2.charAt(j)){ Verdadera=Verdadera+SubPalabra1.charAt(j); if(Verdadera.length()>Correcta.length()){ Correcta=Verdadera; } } else{ j=menor; } } }
} } else{ System.out.println(palabra); } System.out.println(Correcta);
} } Who is the word that no work? |
| A problem with the problem | LSBG | 1662. Goat in the Garden 6 | 6 Apr 2017 20:40 | 2 |
I have written solution that reached test 22 during the competition(I think it corresponds to 15th in offline mode) but now I have wa and i have run out of ideas. Can anyone give me a clue on this problem. Is there a problem with precision (I am making calculations with long double but use sqrt which is a bit unprecise). |
| Hint | IlushaMax | 2020. Traffic Jam in Flower Town | 6 Apr 2017 20:33 | 1 |
Hint IlushaMax 6 Apr 2017 20:33 |
| No subject | KAKTUS_OK | 1409. Two Gangsters | 6 Apr 2017 20:31 | 6 |
KTO NIBUD PONIMAET, KAK EE RESHIT #include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; cout << --b << " " << --a; return 0; } vot) |
| for them who have wa on #3 or #11 | amirani | 1688. Team.GOV! | 6 Apr 2017 01:19 | 3 |
Do not use "n/3" or "n div 3" or "input div 3" or "input/3". Do not use any division. while input n, n:=n*3 ; and then you won't have to divide at 3 every input; Sorry for bad english.If any questions please ask. |
| Why WA 1 I've counted 'a','ab','abc' and other subsequences and got satisfying to condition.... | IlushaMax | 1219. Symbolic Sequence | 6 Apr 2017 01:17 | 1 |
#include <bits/stdc++.h> using namespace std; int main() { string letter="abcdefghijklmnopqrstuvwxyz"; int k=letter.size(); int i1,i2,i3; string part,bigpart; for(i1=0;i1<k;i1++) { for(i2=0;i2<k;i2++) { for (i3=0;i3<k;i3++) { part=""; part.pb(letter[i1]); if(part[0]!=letter[i2]) part.pb(letter[i2]); else continue; if(part[0]!=letter[i3]&&part[1]!=letter[i3]) part.pb(letter[i3]); else continue; bigpart.pb(letter[i1]);bigpart.pb(letter[i2]);bigpart.pb(letter[i3]); } } } string ans=""; //cout<<bigpart.size()/3; while(ans.size()<1000000) { ans=ans+bigpart; } /*for (int i=0;i<1000000;i++) { cout<<ans[i]; }*/ int res=0; for (int i=0;i<1000000;i++) { if (ans.substr(i,1)=="a") res++; } cout<<res; return 0; } Maybe 1 test is a sort of tricky? Edited by author 06.04.2017 01:18 |
| Why wrong ? | Pranto Das | 1068. Sum | 5 Apr 2017 22:33 | 2 |
#include<stdio.h> #include<math.h> int main() { int N; scanf("%d",&N); int i,ck = 0; for(i = 2; i <= abs(N); i++) ck += i; if(N < 0) printf("-%d\n",ck); else printf("%d\n",ck); return 0; } |
| Should we multiply by k or n%k if (n - i*k) equals k or n%k ? | Simoren | 1083. Factorials!!! | 5 Apr 2017 22:28 | 3 |
Hello, Should we multiply by k or n%k if (n - i*k) equals k or n%k ? Which sample is correct? Sample 1 8!! = 8 *(8-2)*(8-4)*(8-6)*2 Sample 2 8!! = 8 *(8-2)*(8-4)*(8-6) |
| WA8 Rabin–Karp and AC with KMP | Zura Isakadze [Tbilisi SU] | 1423. String Tale | 5 Apr 2017 22:20 | 4 |
any idea what could be my mistake? i'm using i=n; i< 2n; i++ h2=((mod + h2 - dn * a[i-n] % mod) * d % mod + a[i]) % mod; where d=256, dn=d^(n-1) mod=10^9+9 i had WA8 with hashes, i had maxn = 250100, but it must be doubled for algo and it passed with 500100 Boyer-Moor algorithm gets TL6 - it works slower than naive substrings search! AC with KMP |
| WA 10 | 💻Evgeny Nemtsev [UrFU FT-17] | 1435. Financial Error | 5 Apr 2017 17:54 | 1 |
WA 10 💻Evgeny Nemtsev [UrFU FT-17] 5 Apr 2017 17:54 2 10 15 16 -> Unrecoverable error. (not "Error in record #1. Correct number is: 1.") |
| Ambiguity in statement | Ngo Huy | 1085. Meeting | 5 Apr 2017 10:18 | 1 |
if a route is defined by the stops: 1, 2, 4. Can they go from 4 to 2 then to 1 or is it one-way route? |
| Решение C++ | Solution C++ | Viktor | 1000. A+B Problem | 5 Apr 2017 03:23 | 1 |
#include <iostream> using namespace std; int main(){ unsigned int a, b; cin >> a >> b; cout << a+b; return 0; } |
| Решение C | Solution C | Viktor | 1000. A+B Problem | 5 Apr 2017 03:22 | 1 |
#include <stdio.h> int main(){ int a, b; scanf("%d %d", &a, &b); printf("%d", a + b); return 0; } |
| answer/ответ Java | Vinchester | 1820. Ural Steaks | 4 Apr 2017 19:00 | 1 |
import java.util.Scanner; public class Zadachi { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int x = 2; if(n<=k){ System.out.print(x); }else{
if (n*2 % k == 0){ System.out.print(n*2/k); }else{ System.out.print(n*2/k+1); } }
} } |
| не могу понять, почему не принимает програму (задача 1243) | Bohdan | | 4 Apr 2017 14:49 | 4 |
#include <iostream> #include <math.h> using namespace std; int main() { char N[51]; cin >> N; int i; for (i = 0; N[i] != '\0'; i++); char Y[4]; int counter = 0, a = 0; if (i % 3 == 0) { for (int j = 0; j < i; j += 3) { Y[0] = N[j]; Y[1] = N[j + 1]; Y[2] = N[j + 2]; Y[3] = 0; if (counter % 2 == 0) { int temp = atoi(Y); a += temp; } if (counter % 2 == 1) { int temp = atoi(Y); a -= temp; } counter++; } } if (i % 3 != 0) { int start = i % 3; for (int maloe = 0; maloe < start; maloe++) { Y[maloe] = N[maloe]; } Y[start] = '\0'; int temporary = atoi(Y); a -= temporary; int counter = 0; for (int j = start; j < i; j += 3) { Y[0] = N[j]; Y[1] = N[j + 1]; Y[2] = N[j + 2]; Y[3] = 0; if (counter % 2 == 0) { int temp = atoi(Y); a += temp; } if (counter % 2 == 1) { int temp = atoi(Y); a -= temp; } counter++; } } cout << abs(a%7); system("pause"); return 0; } Я делаю ввод в строку, тогда считываю по 3 элемента и делаю их один числом (например, 123456 в числа 123 и 456), тогда по признаку деления на 7 узнаю остаток. Если число, например 12435 то я делю его на 12 и 435 и по работаю по тому же принципу. На моих проверках всё работает хорошо, а система выдаёт WA на 3 тесте. Could you please open task-related themes in task discussions rather than common? Could you please publish link to mathematical background of your solution? Btw, Test your solution on numbers 222223 and 223222. Could you please read task discussions and find simple division digit-by-digit in the every second topic? Edited by author 26.03.2017 23:20 Сударь, вы очень-очень мудрёно решаете. Код этой задачи - в несколько строк. |
| seems there is illegal tests | Shen Yang | 2016. Magic and Science | 4 Apr 2017 14:14 | 2 |
1 1 366 -565864 609690 15155 516588 775970 765044 814205 -251004 532061 magion will stop in the middle of second args...please check it sorry ,it's my mistake,answer should be 8587308.19597172360000000000 |
| Решение C++ | Solution C++ | Viktor | 1068. Sum | 4 Apr 2017 11:39 | 2 |
#include <iostream> using namespace std; int main(){ int n, i = 0; cin >> n; while (n != 1){ if (n <= 1){ i+= n; n++; } else if (n >= 1){ i+= n; n--; } } cout << i+1; return 0; } |
| Решение C | Solution C | Viktor | 1068. Sum | 4 Apr 2017 04:37 | 1 |
#include <stdio.h> int main() { int n, i = 0; scanf("%d", &n); while (n != 1){ if (n <= 1){ i+= n; n++; } else if (n >= 1){ i+= n; n--; } } printf("%d", i+1); return 0; } |
| I think it is not geometry problem ->>>>>PHYSICS problem | IlushaMax | 1192. Ball in a Dream | 3 Apr 2017 23:19 | 1 |
|