| Show all threads Hide all threads Show all messages Hide all messages |
| В чем разница | Olegkyz | 2100. Wedding Dinner | 20 Feb 2019 13:01 | 1 |
Когда использую циклы такого вида выдает ошибку Runtime error (non-zero exit code) i=n; while(i>0) { name[i]=calloc(1,30); scanf(" %s",name[i]); i--; } i=n; while(i>0) { char *buf=name[i]; while(*buf!='\0') { if(*buf=='+') { kol++; break; } else { buf++; } } i--; } А здесь AC for(i=0;i<n;i++) { name[i]=calloc(1,30); scanf(" %s",name[i]); } for(i=0;i<n;i++) { char *buf=name[i]; while(*buf!='\0') { if(*buf=='+') { kol++; break; } else { buf++; } } } |
| if you fucked by test#13 | tqti | 1080. Map Coloring | 20 Feb 2019 01:31 | 3 |
try 6 6 0 3 0 5 0 5 6 0 0 0 and 7 2 0 5 0 6 4 0 5 7 0 0 0 0 Well, I've passed that tests, but still getting WA 13 Any advices? When build the graph, make it undirected rather than directed one. |
| TLE 8 JAVA | Alex | 1196. History Exam | 19 Feb 2019 00:34 | 1 |
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.*; public class Lesson { public static void main(String[] args) throws Exception { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); int countPrepod = Integer.parseInt(bufferedReader.readLine()); TreeSet<Long> prepod = new TreeSet(); for (int i = 0; i < countPrepod; ++i) { prepod.add(Long.parseLong(bufferedReader.readLine())); } int countStudent = Integer.parseInt(bufferedReader.readLine()); ArrayList<Long> student = new ArrayList(); for (int i = 0; i < countStudent; ++i) { student.add(Long.parseLong(bufferedReader.readLine())); } student.sort(((o1, o2) -> Long.compare(o1,o2))); int result=0; for (long find:prepod) { while (Collections.binarySearch(student,find)>=0) { ++result; student.remove(find); } } System.out.println(result); } } |
| No subject | FIERFoS | 1000. A+B Problem | 17 Feb 2019 23:08 | 2 |
|
| Hints | decay | 2085. Magic Programmer | 16 Feb 2019 23:41 | 1 |
Hints decay 16 Feb 2019 23:41 1. This problem can be reduced to the following: Given X, find two vertices such that path weight is equal to X. 2. It probably cannot be solved with naiive DP. Use centroid decomposition. 3. std::unordered_map gets TL while std::map gets AC. |
| please give me some more tests | Berlin | 1149. Sinus Dances | 16 Feb 2019 18:05 | 3 |
i have some problems with (), please give answers for some other cases 1 Edited by author 06.11.2015 00:47 Input: 4 Output: (((sin(1)+4)sin(1-sin(2))+3)sin(1-sin(2+sin(3)))+2)sin(1-sin(2+sin(3-sin(4))))+1 |
| WA#9 | Evgeniy | 1406. Next Number | 16 Feb 2019 16:38 | 3 |
WA#9 Evgeniy 7 Jan 2007 19:27 What it is it? My program overcome all my tests,but system(TIMUS) written me about WA#9! WHY? me too! any ideas, please send to: williamm2006@126.com thanks! program p1406; var a:array[1..2000]of longint; ch:char; i,j,k,n,m:longint; begin while not eof(input) do begin read(ch); if ch in['0'..'9'] then begin inc(n); a[n]:=ord(ch)-48; end; end; for i:=n downto 1 do if a[i]>0 then break; if((i=1)and(a[i]=0))or(n=1) then begin writeln(-1); halt; end; j:=i-1;m:=a[i]-1;a[i]:=0; for j:=i-1 downto 1 do if a[j]<>9 then break; if(j=1)and(a[j]=9) then begin writeln(-1); halt; end; inc(a[j]); for i:=j+1 to n do begin inc(m,a[i]); a[i]:=0; end; i:=n; while m>0 do begin if m>=9 then a[i]:=9 else a[i]:=m; dec(i); dec(m,9); end; for i:=1 to n do write(a[i]); writeln; end. Re: WA#9 Viktor Krivoshchekov`~ 16 Feb 2019 16:38 |
| New problem 1599 Winding Number | Vladimir Yakovlev (USU) | 1599. Winding Number | 16 Feb 2019 15:35 | 6 |
Don't be afraid of geometry, this problem is really easy Please, fix English in the statement: is maked -> is made You standing -> You're standing you have made -> you made Is it supposed to be solved without floating-point numbers at all? This problem is definitely can be solved using integers only Don't be afraid of geometry, this problem is really easy I confirm :) |
| WA 21 | fufnir | 1601. AntiCAPS | 15 Feb 2019 18:50 | 1 |
WA 21 fufnir 15 Feb 2019 18:50 |
| AC in c++ | Yucheng | 1493. One Step from Happiness | 15 Feb 2019 12:48 | 1 |
#include<iostream> using namespace std; int sum(int temp); int main(){ int a[6]; scanf("%1d%1d%1d%1d%1d%1d",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5]); int first=a[0]*100+a[1]*10+a[2]; int second=a[3]*100+a[4]*10+a[5]; if(a[3]==9&&a[4]==9&&a[5]==9){ cout<<"No"; return 0; } int pre=second-1; int next=second+1; if((sum(pre)==(a[0]+a[1]+a[2]))||(sum(next)==(a[0]+a[1]+a[2]))){ cout<<"Yes"; }else{ cout<<"No"; }
return 0; } int sum(int temp){ int count=0; do{ count+=(temp%10); temp/=10; }while(temp/10!=0); count+=temp; return count; } |
| AC in c++ using stable_sort | Yucheng | 1100. Final Standings | 15 Feb 2019 11:43 | 1 |
#include<iostream> #include<vector> #include<string> #include<algorithm> using namespace std; class team{ public: string id; int n; }; bool comp(const team &t1,const team &t2); int main(){ int k; cin>>k; vector<team> T; while(k--){ string temp; int num; cin>>temp>>num; team t; t.id=temp; t.n=num; T.push_back(t); } stable_sort(T.begin(),T.end(),comp); for(int i=0;i<T.size();++i){ cout<<T[i].id<<" "<<T[i].n<<endl; }
return 0; } bool comp(const team &t1,const team &t2){ return t1.n>t2.n; } |
| WA2 | DenisBordachkov | 1654. Cipher Message | 15 Feb 2019 02:29 | 1 |
WA2 DenisBordachkov 15 Feb 2019 02:29 Why Wring answer? import java.util.Scanner; public class T1654 { public static char[] arr; public static String out = ""; public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); String inp = sc.next(); sc.close(); arr = new char[inp.length()]; arr = inp.toCharArray(); format(); if(out != "") { System.out.println(out); } else { System.out.println(""); }
}
public static void format() { boolean isFormat = false; int l = arr.length; for(int i = 0; i< l-1; i++) { if(arr[i] == arr[i+1]) { arr[i] = 0; arr[i+1] = 0; isFormat = true; } else if(arr[i] != arr[i+1] & arr[i] != 0){ out += arr[i]; } } out+= arr[arr.length-1]; if(isFormat == true) { arr = new char[out.length()]; arr = out.toCharArray(); out = ""; format(); } } } |
| В 22 ОШИБКА | diablahaker2004 | 1011. Conductors | 13 Feb 2019 02:18 | 5 |
получил АС, долго искал где долбанный баг, т.к. ТЕСТ 22 выдавал ошибку по времени, если у вас такая же проблема и вы используете преобразование double в int то в 22 тесте точность P и Q 3 знака, поэтому ТЛ и выдает, вероятно на вход подаются какие нибудь числа 22.333 и 22.334 удачи You are wrong! P and Q are given with up to 2 digits after decimal point in all tests. похожая фигня, точности 2 знаков после запятой не хватало, впилил третий знак, всё заработало |
| [gcc] If you have WA#1 - don't use %zu in printf. Only %d (( | malegkin | 1011. Conductors | 13 Feb 2019 02:01 | 1 |
code like: size_t out = 0; printf ("%zu\n", out); result - > wa#1 ((( if i use printf ("%d\n", out); all test accepted (( Why? https://wandbox.org/ & gcc 7.1 - The first version works correctly ((( |
| bad tests? | Vit Demidenko | 2107. Oppa Funcan Style | 12 Feb 2019 23:28 | 1 |
i have ac in 0.187 s, but on this test my program runs at least 0.9: 35 123 2 3 4 5 6 0 8 9 10 11 0 13 14 15 0 17 18 0 20 21 0 23 0 25 0 27 0 0 0 0 0 0 0 0 0 |
| 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 |
| AC in c++ | Yucheng | 1048. Superlong Sums | 12 Feb 2019 20:34 | 1 |
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main(){ int k; cin>>k; vector<int> line1; vector<int> line2; vector<int> sum; while(k--){ int m,n; cin>>m>>n; line1.push_back(m); line2.push_back(n); } bool plus_1=false; for(int i=line1.size()-1;i>=0;i--){ int temp=line1[i]+line2[i]; if(plus_1){ temp++; } if(temp>=10){ plus_1=true; temp-=10; }else{ plus_1=false; } sum.push_back(temp);
} for(vector<int>::reverse_iterator iter=sum.rbegin();iter!=sum.rend();++iter){ cout<<*iter; } return 0; } |
| Maybe this will help you! | niabbf | 1354. Palindrome. Again Palindrome | 12 Feb 2019 19:14 | 5 |
I've been wa on this case for a long time: abaabaaba The right answer is abaabaabaaba Can anyone please suggest the test case which might give me WA35... I have used string , also tried with character array... and KMP algorithm ..... please do reply Edited by author 27.08.2018 13:31 Aren't 'abaabaaba' a palindrome? |
| WA2? | Sherxon | 1982. Electrification Plan | 12 Feb 2019 17:57 | 2 |
WA2? Sherxon 26 Nov 2016 03:19 Can anybody please give me cases for Test2 ? Re: WA2? Manole Victor 12 Feb 2019 17:57 If you only go through the matrix and saved the minimum value, it is not the solution for that problem. |
| TEST FOR WA4 | buyolitsez | 1786. Sandro's Biography | 12 Feb 2019 14:54 | 1 |
|