submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s848548928
p00033
C++
#include <iostream> #include <vector> int ball[10]; int left = 0,right = 0; bool dfs(int de,int left, int right){//??????????????§??????????????? if(de == 9)return true; if(left < ball[de]){ left = ball[de]; return dfs(de + 1); } if(right < ball[de]){ right = ball[de]; return dfs(de + 1); } return false; } int main(){ int n; std::cin >> n; while(n--){ for(int i = 0; i < 10; ++i){ std::cin >> ball[i]; } left = 0, right = 0; if(dfs(0,0,0))std::cout << "YES" << std::endl; else std::cout << "NO" << std::endl; } }
a.cc: In function 'bool dfs(int, int, int)': a.cc:9:27: error: too few arguments to function 'bool dfs(int, int, int)' 9 | return dfs(de + 1); | ~~~^~~~~~~~ a.cc:5:6: note: declared here 5 | bool dfs(int de,int left, int right){//??????????????§??????????????? | ^~~ a.cc:13:27: error: too few arguments to function 'bool dfs(int, int, int)' 13 | return dfs(de + 1); | ~~~^~~~~~~~ a.cc:5:6: note: declared here 5 | bool dfs(int de,int left, int right){//??????????????§??????????????? | ^~~
s228472609
p00033
C++
#include <iostream> #include <vector> int ball[10]; int left = 0,right = 0; bool dfs(int de,int left, int right){//??????????????§??????????????? if(de == 9)return true; if(left < ball[de]){ left = ball[de]; return dfs(de + 1.left,right); } if(right < ball[de]){ right = ball[de]; return dfs(de + 1,left,right); } return false; } int main(){ int n; std::cin >> n; while(n--){ for(int i = 0; i < 10; ++i){ std::cin >> ball[i]; } left = 0, right = 0; if(dfs(0,0,0))std::cout << "YES" << std::endl; else std::cout << "NO" << std::endl; } }
a.cc: In function 'bool dfs(int, int, int)': a.cc:9:33: error: unable to find numeric literal operator 'operator""left' 9 | return dfs(de + 1.left,right); | ^~~~~~
s714554843
p00033
C++
#include <iostream> #include <algorithm> using namespace std; int a[10]; int b[10]; int ball[20]; bool ans; void dfs(int k,int ca,int cb) { if(k==10) { ans = 1; return; } if(ball[k] > a[ca-1]) { a[ca] = ball[k]; dfs(k+1,ca+1,cb); a[ca] = 0; } if(ball[k] > b[cb-1]) { b[cb] = ball[k]; dfs(k+1,ca,cb+1); b[cb] = 0; } return; } int main() { int n; cin >> n; while(n--) { ans = 0; memset(a,0,sizeof(a)); memset(b,0,sizeof(b)); for(int i = 0;i<10;i++) { cin >> ball[i]; } dfs(0,1,1); if(ans == 1) cout << "Yes" << endl; else cout << "No" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:36:17: error: 'memset' was not declared in this scope 36 | memset(a,0,sizeof(a)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <algorithm> +++ |+#include <cstring> 3 | using namespace std;
s210354339
p00033
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,a; int b = 11,c = 11; cin >> n; while(n--){ for(int i = 0;i < 10;i++){ cin >> a; if(b > a)b = a; else if(c > a)c = a; else { cout << "NO" << endl; return; } } cout << "YES" << endl; } }
a.cc: In function 'int main()': a.cc:15:9: error: return-statement with no value, in function returning 'int' [-fpermissive] 15 | return; | ^~~~~~
s511006153
p00033
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,a; int b = 11,c = 11; cin >> n; while(n--){ for(int i = 0;i < 10;i++){ cin >> a; if(b > a)b = a; else if(c > a)c = a; else { cout << "NO" << endl; return; } } cout << "YES" << endl; } return; }
a.cc: In function 'int main()': a.cc:15:9: error: return-statement with no value, in function returning 'int' [-fpermissive] 15 | return; | ^~~~~~ a.cc:20:3: error: return-statement with no value, in function returning 'int' [-fpermissive] 20 | return; | ^~~~~~
s119714287
p00033
C++
??£?????? #include<iostream> #include<memory.h> using namespace std; int arr[10],used[10]; void DFS(int pre,int cur) { if(cur<10&&arr[pre]<arr[cur]) { used[cur]=1; DFS(cur,cur+1); } else if(cur<10&&arr[pre]>=arr[cur]) DFS(pre,cur+1); } int main() { int T,pre; bool judge; cin>>T; while(T--) { for(int i=0;i<10;i++) cin>>arr[i]; for(int i=0;i<10;i++) { memset(used,0,sizeof(used)); used[i]=1; DFS(i,i+1); judge=false; pre=0; for(int j=0;j<10;j++) if(used[j]==0) if(pre>=arr[j]) { judge=true; break; }else pre=arr[j]; if(!judge) { cout<<"YES"<<endl; break; } } if(judge)cout<<"NO"<<endl; } }
a.cc:1:3: error: extended character £ is not valid in an identifier 1 | ??£?????? | ^ a.cc:1:1: error: expected unqualified-id before '?' token 1 | ??£?????? | ^ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:2: /usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type 68 | typedef ptrdiff_t streamsize; // Signed integral type | ^~~~~~~~~ /usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 40 | #include <cwchar> // For mbstate_t +++ |+#include <cstddef> 41 | In file included from /usr/include/c++/14/bits/exception_ptr.h:38, from /usr/include/c++/14/exception:166, from /usr/include/c++/14/ios:41: /usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ In file included from /usr/include/wchar.h:35, from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive] 132 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive] 134 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared 140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared 142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:145:52: error: expected primary-expression before 'const' 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:147:54: error: expected primary-expression before 'const' 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:154:68: error: expected primary-expression before ')' token 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive] 155 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:156:68: error: expected primary-expression before ',' token 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:156:70: error: expected primary-expression before 'const' 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:162:70: error: expected primary-expression before ')' token 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive] 163 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:164:70: error: expected primary-expression before ',' token 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:164:72: error: expected primary-expression before 'const' 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:171:29: error: 'std::size_t' has not been declared 171 | void operator delete(void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:173:31: error: 'std::size_t' has not been declared 173 | void operator delete[](void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:179:33: error: declaration of 'operator new' as non-function 179 | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/
s547441065
p00033
C++
main(){ int topB,topC; int n,tmp; int valid; for (scanf("%d", &n); n--;){ topB=topC=0; valid=1; for (int i=0; i<10; i++){ scanf("%d", &tmp); if (tmp > topB) topB=tmp; else if (tmp > topC)topC=tmp; else { valid=0; break; } } printf("%s\n",valid?"YES":"NO"); } return 0; }
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:6:14: error: 'scanf' was not declared in this scope 6 | for (scanf("%d", &n); n--;){ | ^~~~~ a.cc:17:17: error: 'printf' was not declared in this scope 17 | printf("%s\n",valid?"YES":"NO"); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | main(){
s362913324
p00033
C++
#include <stdio.h> #include <stdbool.h> ?? #define NUM_BALL 10 ?? int main(void) { ????int???????????? n; ????int???????????? num; ????int???????????? left, right; ????bool?? flag = true; ????int???? i, j; ?? ????scanf("%d", &n); ????for (i = 0; i < n; i++) { ????????????????left = right = -1; ????????????????for (j = 0; j < NUM_BALL; j++) { ????????????????????????scanf("%d", &num); ????????????????????????if?????????? (num > left) { left?? = num; } ????????????????????????else if (num > right)?????? { right = num; } ????????????????????????else?????? { flag?? = false; break; } ????????????????} ????????????????puts((flag) ? "YES" : "NO"); ????????} ?? ????????return 0; }
a.cc:3:1: error: expected unqualified-id before '?' token 3 | ?? | ^
s678654843
p00033
C++
#include <stdio.h> ?? #define NUM_BALL 10 ?? int main(void) { ????int???????????? n; ????int???????????? num; ????int???????????? left, right; ????int?? flag = 1; ????int???? i, j; ?? ????scanf("%d", &n); ????for (i = 0; i < n; i++) { ????????????????left = right = -1; ????????????????for (j = 0; j < NUM_BALL; j++) { ????????????????????????scanf("%d", &num); ????????????????????????if?????????? (num > left) { left?? = num; } ????????????????????????else if (num > right)?????? { right = num; } ????????????????????????else?????? { flag?? = 0; break; } ????????????????} ????????????????puts((flag) ? "YES" : "NO"); ????????} ?? ????????return 0; }
a.cc:2:1: error: expected unqualified-id before '?' token 2 | ?? | ^
s965626135
p00033
C++
#include <stdio.h> #include <vector> #include <iostream> using namespace std; int main() { vector<int> left; vector<int> right; vector<int> all; bool flag = true; int n; cin >> n; for (int i = 0; i < n; i++) { for (int j = 0; j < 10; j++) { int temp; cin >> temp; all.push_back(temp); } } for (int i = 0; i < n; i++) { for (int j = 0; j < 10; j++) { if (left.data != NULL) { if (all[10 * i + j] > left[left.size() - 1]) { left.push_back(all[10 * i + j]); } else { if (right.data != NULL) { if (all[10 * i + j] > right[right.size() - 1]) right.push_back(all[10 * i + j]); else flag = false; } else { right.push_back(all[10 * i + j]); } } } else { left.push_back(all[10 * i + j]); } } if (flag) cout << "YES"; else cout << "NO"; flag = true; } }
a.cc: In function 'int main()': a.cc:26:42: warning: NULL used in arithmetic [-Wpointer-arith] 26 | if (left.data != NULL) { | ^~~~ a.cc:26:39: error: invalid operands of types '<unresolved overloaded function type>' and 'long int' to binary 'operator!=' 26 | if (left.data != NULL) { | ^ a.cc:31:59: warning: NULL used in arithmetic [-Wpointer-arith] 31 | if (right.data != NULL) { | ^~~~ a.cc:31:56: error: invalid operands of types '<unresolved overloaded function type>' and 'long int' to binary 'operator!=' 31 | if (right.data != NULL) { | ^
s750862561
p00033
C++
#include<cstdio> #include<iostream> #include<stack> using namespace std; stack<int> B; stack<int> C; int A[10]; int solve(){ for(int i = 0;i<10;i++){ if(!B.empty()){ if(B.top()<A[i]){ B.push(A[i]); }else if(C.top()<A[i] || C.empty()){ C.push(A[i]); }else{ return 0; } }else{ B.push(A[i]); //cout<<B.top()<<endl; } } return 1; } int init(){ while(!B.empty()) B.pop(); while(!C.empty()) C.pop(); B.push(-1); C.push(-1); } int main(void){ int n; cin>>n; for(int j = 0;j<n;j++){ init(); for(int i = 0;i<10;i++){ cin>>A[i]; } if(solve()){ cout<<"YES"<<endl; }else{ cout<<"NO"<<endl; } } return 0; }
a.cc:1:18: warning: extra tokens at end of #include directive 1 | #include<cstdio> #include<iostream> #include<stack> using namespace std; stack<int> B; stack<int> C; int A[10]; int solve(){ for(int i = 0;i<10;i++){ if(!B.empty()){ if(B.top()<A[i]){ B.push(A[i]); }else if(C.top()<A[i] || C.empty()){ C.push(A[i]); }else{ return 0; } }else{ B.push(A[i]); //cout<<B.top()<<endl; } } return 1; } int init(){ while(!B.empty()) B.pop(); while(!C.empty()) C.pop(); B.push(-1); C.push(-1); } int main(void){ int n; cin>>n; for(int j = 0;j<n;j++){ init(); for(int i = 0;i<10;i++){ cin>>A[i]; } if(solve()){ cout<<"YES"<<endl; }else{ cout<<"NO"<<endl; } } return 0; } | ^ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s107816504
p00033
C++
#include <iostream> #include <vector> using namespace std; void solve(vector<int> left, vector<int> right, vector<int> all, int n) { bool flag = true; for (int i = 0; i < n; i++) { for (int j = 0; j < 10; j++) { if (left.size() > 0) { if (all[10 * i + j] > left[left.size() - 1]) { left.push_back(all[10 * i + j]); } else { if (right.size() > 0) { if (all[10 * i + j] > right[right.size() - 1]) right.push_back(all[10 * i + j]); else flag = false; } else { right.push_back(all[10 * i + j]); } } } else { left.push_back(all[10 * i + j]); } } if (flag) printf("YES\n"); else printf("NO\n"); flag = true; } } int main() { vector<int> left; vector<int> right; vector<int> all; int n; scanf_s("%d", &n); if (n <= 0) return -1; for (int i = 0; i < n; i++) { for (int j = 0; j < 10; j++) { int temp; cin >> temp; all.push_back(temp); } } solve(left, right, all, n); return 0; }
a.cc: In function 'int main()': a.cc:47:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 47 | scanf_s("%d", &n); | ^~~~~~~ | scanf
s234477744
p00033
C++
#include <iostream> #include <stack> #include <tuple> using namespace std; int main() { int n, balls[10]; cin >> n; while(n--){ for(int i = 0; i < 10; i++){ cin >> balls[i]; } bool sortable = false; stack<tuple<int, int, int> > states; states.push(make_tuple(0,0,0)); while(!states.empty()){ tuple<int, int, int> now = states.top(); closed.insert(now); states.pop(); int idx = get<0>(now); if(idx < 9){ if(get<1>(now) < balls[idx]){ if(idx + 1 == 9){ sortable = true; break; } states.push(make_tuple(idx+1,balls[idx],get<2>(now))); } if(get<2>(now) < balls[idx]){ if(idx + 1 == 9){ sortable = true; break; } states.push(make_tuple(idx+1,get<1>(now),balls[idx])); } } } if(sortable) cout << "YES" << endl; else cout << "NO" << endl; } }
a.cc: In function 'int main()': a.cc:19:17: error: 'closed' was not declared in this scope; did you mean 'pclose'? 19 | closed.insert(now); | ^~~~~~ | pclose
s121116054
p00033
C++
// AojTemplete.cpp : ??????????????? ??¢????????±????????§????????¨????????? ????????????????????????????????? // #include "stdafx.h" #include<iostream> #include<vector> using namespace std; int main() { int n; cin >> n; for (int i = 0; i < n; i++) { bool flag = false; int prev; int in[10]; int used[10]; for (int j = 0; j < 10; j++) { cin >> in[j]; } prev = in[0]; vector<int> B; vector<int> C; for (int j = 0; j < 10; j++) { if (prev > in[j]) { C.push_back(in[j]); used[j] = false; continue; } else { prev = in[j]; B.push_back(in[j]); used[j] = true; } } prev = C[0]; for (int j = 0; j < C.size(); j++) { if (prev > C[j]) { flag = true; break; } else { prev = C[j]; } } if (flag) cout << "NO" << endl; else cout << "YES" << endl; } return 0; }
a.cc:4:10: fatal error: stdafx.h: No such file or directory 4 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s302142013
p00033
C++
#include <bits/stdc++.h> using namespace std; int a[10]; bool dfs(int i, int l, int r) { if (i == 10) return true; if (l < a[i] && dfs(i + 1, a[i], r)) return true; if (r < a[i] && dfs(i + 1, r, a[i])) return true; return false; } int main() { int n; cin >> n; while (n--) { l = r = 0; for (int i = 0; i < 10; ++i) cin >> a[i]; cout << (dfs(0, 0, 0) ? "YES" : "NO") << endl; } }
a.cc: In function 'int main()': a.cc:22:9: error: 'l' was not declared in this scope 22 | l = r = 0; | ^ a.cc:22:13: error: 'r' was not declared in this scope 22 | l = r = 0; | ^
s065993172
p00033
C++
#include <bits/stdc++.h> using namespace std; int n, ball[10]; bool solve(int idx, int l, int r) { if(idx == 10) return true; bool ret = false; if(ball[idx] > l) ret = ret || solve(idx + 1, ball[idx], r); if(ball[idx] > r) ret = ret || solve(idx + 1, l, ball[idx]); return ret; } int main() { cin >> n; for(int i = 0; i < n; ++i) { for(int j = 0; j < 10; ++j) { cin >> ball[j]; } cout << solve(0, 0, 0) ? "YES" : "NO" << endl; } }
a.cc: In function 'int main()': a.cc:26:47: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<' 26 | cout << solve(0, 0, 0) ? "YES" : "NO" << endl; | ~~~~~^~~~~~~
s720373785
p00033
C++
#include <bits/stdc++.h> using namespace std; int n, ball[10]; bool solve(int idx, int l, int r) { if(idx >= 10) return true; bool ret = false; if(ball[idx] > l) ret = ret || solve(idx + 1, ball[idx], r); if(ball[idx] > r) ret = ret || solve(idx + 1, l, ball[idx]); return ret; } int main() { cin >> n; for(int i = 0; i < n; ++i) { for(int j = 0; j < 10; ++j) { cin >> ball[j]; } cout << solve(0, 0, 0) ? "YES" : "NO" << endl; } }
a.cc: In function 'int main()': a.cc:26:47: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<' 26 | cout << solve(0, 0, 0) ? "YES" : "NO" << endl; | ~~~~~^~~~~~~
s109537752
p00033
C++
import java.util.Scanner; public class Main{ public static void main(String[] args)throws Exception{ new Main().solve(); } void solve(){ Scanner sc=new Scanner(System.in); int n=sc.nextInt();//the number of test case for(int i=0;i<n;i++){ int[] d=new int[10]; for(int j=0;j<10;j++){ d[j]=sc.nextInt(); } int a=-999999;int b=-999999; //??????a<=b???????????????????????? outside:for(int j=0;j<10;j++){ if(d[j]>b)b=d[j]; else if(d[j]>a)a=d[j]; else{ System.out.println("NO"); break outside; } if(a>b){ int dummy=b; b=a; a=dummy; } if(j==9)System.out.println("YES"); } } } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: expected unqualified-id before 'public' 2 | public class Main{ | ^~~~~~
s401965162
p00033
C++
C++ #include <iostream> // C++?????\?????? #include <stdio.h> // C ?????\?????? #include <algorithm> // sort ???????????¢?????´????????? #include <string.h> // C ??????????????¨ #include <ctype.h> // C ??????????¨???¨ #include <string> // C++???????????? #include <math.h> #include <sstream> using namespace std; int ball[10]; bool dfs(int i,int b,int c); int main(void){ int n; cin>>n; for(int i=0;i<n;i++){ for(int s=0;s<10;s++){ cin>>ball[s]; } if(dfs(0,0,0))cout<<"YES"<<endl; else cout<<"NO"<<endl; } return 0; } bool dfs(int i,int b,int c){ if(i==10)return true; if(b<ball[i]){ if(dfs(i+1,ball[i],c))return true; } if(c<ball[i]){ if(dfs(i+1,b,ball[i]))return true; } return false; }
a.cc:1:1: error: 'C' does not name a type 1 | C++ | ^ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:3: /usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type 68 | typedef ptrdiff_t streamsize; // Signed integral type | ^~~~~~~~~ /usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 40 | #include <cwchar> // For mbstate_t +++ |+#include <cstddef> 41 | In file included from /usr/include/c++/14/bits/exception_ptr.h:38, from /usr/include/c++/14/exception:166, from /usr/include/c++/14/ios:41: /usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ In file included from /usr/include/wchar.h:35, from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive] 132 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive] 134 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared 140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared 142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:145:52: error: expected primary-expression before 'const' 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:147:54: error: expected primary-expression before 'const' 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:154:68: error: expected primary-expression before ')' token 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive] 155 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:156:68: error: expected primary-expression before ',' token 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:156:70: error: expected primary-expression before 'const' 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:162:70: error: expected primary-expression before ')' token 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive] 163 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:164:70: error: expected primary-expression before ',' token 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:164:72: error: expected primary-expression before 'const' 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:171:29: error: 'std::size_t' has not been declared 171 | void operator delete(void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:173:31: error: 'std::size_t' has not been declared 173 | void operator delete[](void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:179:33: error: declaration of 'operator new' as non-function 179 | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:179:51: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 179 | _GLIBCXX_NODISCARD inline void* ope
s418887826
p00033
C++
iint main(){ return 0; }
a.cc:1:1: error: 'iint' does not name a type; did you mean 'int'? 1 | iint main(){ | ^~~~ | int
s362996708
p00033
C++
#include<iostream> using namespace std; int d[10]={}; bool f; void dfs(int l,int r int s){ if(s==10) f=true; //cout << d << endl; if(l<d[s]){ dfs(d[s],r,s+1); } if(r<d[s]){ dfs(l,d[s],s+1); } } int main(){ int n;cin >> n; while(n--){ int r=0,l=0,d; f=false; for(int i=0;i<10;i++){ cin >> d; //cout << l << ":" << r << endl; } dfs(0,0,0); if(f) cout << "NO" << endl; else cout << "YES" << endl; } }
a.cc:5:22: error: expected ',' or '...' before 'int' 5 | void dfs(int l,int r int s){ | ^~~ a.cc: In function 'void dfs(int, int)': a.cc:6:6: error: 's' was not declared in this scope 6 | if(s==10) f=true; | ^ a.cc:8:10: error: 's' was not declared in this scope 8 | if(l<d[s]){ | ^ a.cc:11:10: error: 's' was not declared in this scope 11 | if(r<d[s]){ | ^ a.cc: In function 'int main()': a.cc:24:8: error: too many arguments to function 'void dfs(int, int)' 24 | dfs(0,0,0); | ~~~^~~~~~~ a.cc:5:6: note: declared here 5 | void dfs(int l,int r int s){ | ^~~
s234158319
p00033
C++
#include <iostream> #include <cstdio> using namespace std; typedef long long ll; #define rep(i,n) for(int i=0;i<(n);i++) int a[10]; //B:=B?????????????????° C*=C?????????????????° cnt:=??????????????°?????? bool dfs(int B, int C, int cnt){ if(cnt == 10){ return true; } if(B < a[cnt]){ return dfs(a[cnt], C, cnt + 1); } if(C < a[cnt]){ return dfs(B, a[cnt], cnt + 1); } if(B > a[cnt] && C > a[cnt]){ return false; } } int main(void){ int n; cin >> n; for (int i = 0; i < n; ++i){ rep(j, 10) cin >> a[j]; flag = false; dfs(0, 0, 0); if(flag) printf("YES\n"); else printf("NO\n"); } return 0; }
a.cc: In function 'int main()': a.cc:28:17: error: 'flag' was not declared in this scope 28 | flag = false; | ^~~~ a.cc: In function 'bool dfs(int, int, int)': a.cc:23:1: warning: control reaches end of non-void function [-Wreturn-type] 23 | } | ^
s466055042
p00033
C++
#include <iostream> #include <stack> #include <vector> #include <algorithm> using namespace std; static const int MAX_N = 10; int a[MAX_N] = {0}; bool dfs(int a[],vector<int> r,vector<int> l,i){ if(i==MAX_N)return true; if(r.size()==0 || r[r.size()-1]<a[i]){ r.push_back(a[i]); return solve(a,r,l,i+1); } if(l.size()==0 || l[l.size()-1]<a[i]){ l.push_back(a[i]); return solve(a,r,l,i+1); } return false; } int main() { int n; cin>>n; for(int i=0;i<n;i++){ for(int j=0;j<10;j++){//input cin>>a[j]; } vector<int> r; vector<int> l; if dfs(a,r,l,0){ cout<<"YES"<<endl; }else{ cout<<"NO"<<endl; } } }
a.cc:9:46: error: 'i' has not been declared 9 | bool dfs(int a[],vector<int> r,vector<int> l,i){ | ^ a.cc: In function 'bool dfs(int*, std::vector<int>, std::vector<int>, int)': a.cc:10:12: error: 'i' was not declared in this scope 10 | if(i==MAX_N)return true; | ^ a.cc:11:43: error: 'i' was not declared in this scope 11 | if(r.size()==0 || r[r.size()-1]<a[i]){ | ^ a.cc:13:24: error: 'solve' was not declared in this scope 13 | return solve(a,r,l,i+1); | ^~~~~ a.cc:15:43: error: 'i' was not declared in this scope 15 | if(l.size()==0 || l[l.size()-1]<a[i]){ | ^ a.cc:17:24: error: 'solve' was not declared in this scope 17 | return solve(a,r,l,i+1); | ^~~~~ a.cc: In function 'int main()': a.cc:33:20: error: expected '(' before 'dfs' 33 | if dfs(a,r,l,0){ | ^~~ | ( a.cc:35:18: error: 'else' without a previous 'if' 35 | }else{ | ^~~~
s824494565
p00033
C++
#include <iostream> #include <stack> #include <vector> #include <algorithm> using namespace std; static const int MAX_N = 10; int a[MAX_N] = {0}; bool dfs(int a[],vector<int> r,vector<int> l,int i){ if(i==MAX_N)return true; if(r.size()==0 || r[r.size()-1]<a[i]){ r.push_back(a[i]); return solve(a,r,l,i+1); } if(l.size()==0 || l[l.size()-1]<a[i]){ l.push_back(a[i]); return solve(a,r,l,i+1); } return false; } int main() { int n; cin>>n; for(int i=0;i<n;i++){ for(int j=0;j<10;j++){//input cin>>a[j]; } vector<int> r; vector<int> l; if dfs(a,r,l,0){ cout<<"YES"<<endl; }else{ cout<<"NO"<<endl; } } }
a.cc: In function 'bool dfs(int*, std::vector<int>, std::vector<int>, int)': a.cc:13:24: error: 'solve' was not declared in this scope 13 | return solve(a,r,l,i+1); | ^~~~~ a.cc:17:24: error: 'solve' was not declared in this scope 17 | return solve(a,r,l,i+1); | ^~~~~ a.cc: In function 'int main()': a.cc:33:20: error: expected '(' before 'dfs' 33 | if dfs(a,r,l,0){ | ^~~ | ( a.cc:35:18: error: 'else' without a previous 'if' 35 | }else{ | ^~~~
s363829809
p00033
C++
#include <iostream> #include <stack> #include <vector> #include <algorithm> using namespace std; static const int MAX_N = 10; int a[MAX_N] = {0}; bool dfs(int a[],vector<int> r,vector<int> l,int i){ if(i==MAX_N)return true; if(r.size()==0 || r[r.size()-1]<a[i]){ r.push_back(a[i]); return dfs(a,r,l,i+1); } if(l.size()==0 || l[l.size()-1]<a[i]){ l.push_back(a[i]); return dfs(a,r,l,i+1); } return false; } int main() { int n; cin>>n; for(int i=0;i<n;i++){ for(int j=0;j<10;j++){//input cin>>a[j]; } vector<int> r; vector<int> l; if dfs(a,r,l,0){ cout<<"YES"<<endl; }else{ cout<<"NO"<<endl; } } }
a.cc: In function 'int main()': a.cc:33:20: error: expected '(' before 'dfs' 33 | if dfs(a,r,l,0){ | ^~~ | ( a.cc:35:18: error: 'else' without a previous 'if' 35 | }else{ | ^~~~
s662649744
p00033
C++
bool tansaku(vector<int> list,int index,int b,int c) { if (index<10) { if (b < list[index]) { if (tansaku(list, index + 1, list[index], c)) return true; } if (c < list[index]) { if (tansaku(list, index + 1, b, list[index])) return true; } } else { return true; } return false; } int main() { vector<int> s(10); int b; cin >> b; for (int i = 0; i < b; i++) { for (int j = 0; j < 10; j++) { cin >> s[j]; } if (tansaku(s, 0, 0, 0)) { cout << "YES" << endl; } else { cout << "NO" << endl; } } return 0; }
a.cc:1:14: error: 'vector' was not declared in this scope 1 | bool tansaku(vector<int> list,int index,int b,int c) | ^~~~~~ a.cc:1:21: error: expected primary-expression before 'int' 1 | bool tansaku(vector<int> list,int index,int b,int c) | ^~~ a.cc:1:31: error: expected primary-expression before 'int' 1 | bool tansaku(vector<int> list,int index,int b,int c) | ^~~ a.cc:1:41: error: expected primary-expression before 'int' 1 | bool tansaku(vector<int> list,int index,int b,int c) | ^~~ a.cc:1:47: error: expected primary-expression before 'int' 1 | bool tansaku(vector<int> list,int index,int b,int c) | ^~~ a.cc:1:52: error: expression list treated as compound expression in initializer [-fpermissive] 1 | bool tansaku(vector<int> list,int index,int b,int c) | ^ a.cc: In function 'int main()': a.cc:24:9: error: 'vector' was not declared in this scope 24 | vector<int> s(10); | ^~~~~~ a.cc:24:16: error: expected primary-expression before 'int' 24 | vector<int> s(10); | ^~~ a.cc:27:9: error: 'cin' was not declared in this scope 27 | cin >> b; | ^~~ a.cc:32:32: error: 's' was not declared in this scope 32 | cin >> s[j]; | ^ a.cc:34:29: error: 's' was not declared in this scope 34 | if (tansaku(s, 0, 0, 0)) | ^ a.cc:34:28: error: 'tansaku' cannot be used as a function 34 | if (tansaku(s, 0, 0, 0)) | ~~~~~~~^~~~~~~~~~~~ a.cc:36:25: error: 'cout' was not declared in this scope 36 | cout << "YES" << endl; | ^~~~ a.cc:36:42: error: 'endl' was not declared in this scope 36 | cout << "YES" << endl; | ^~~~ a.cc:40:25: error: 'cout' was not declared in this scope 40 | cout << "NO" << endl; | ^~~~ a.cc:40:41: error: 'endl' was not declared in this scope 40 | cout << "NO" << endl; | ^~~~
s466077465
p00033
C++
#include<algorithm> #include<vector> #include<queue> using namespace std; int A[13] = { 0 }; bool solve(int a, int b,int c) { if (++c == 10) return true; else { bool r = false; if (a < A[c]) r = solve(A[c], b, c); if (b < A[c] && r == false) r = solve(a,A[c], c); return r; } } int main(void) { A[10] = A[11] = A[12] = 100; int n = 0; scanf("%d", &n); for (int i = 0; i < n; i++) { for (int j = 0; j < 10; j++) scanf("%d", &A[j]); if (solve(A[0], 0, 0)) printf("YES\n"); else printf("NO\n"); } }
a.cc: In function 'int main()': a.cc:26:9: error: 'scanf' was not declared in this scope 26 | scanf("%d", &n); | ^~~~~ a.cc:31:25: error: 'printf' was not declared in this scope 31 | printf("YES\n"); | ^~~~~~ a.cc:4:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' 3 | #include<queue> +++ |+#include <cstdio> 4 | a.cc:33:25: error: 'printf' was not declared in this scope 33 | printf("NO\n"); | ^~~~~~ a.cc:33:25: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
s516850701
p00033
C++
#include<algorithm> #include<vector> #include<queue> using namespace std; int A[13] = { 0 }; bool solve(int a, int b,int c) { if (++c == 10) return true; else { bool r = false; if (a < A[c]) r = solve(A[c], b, c); if (b < A[c] && r == false) r = solve(a,A[c], c); return r; } } int main(void) { A[10] = A[11] = A[12] = 100; int n = 0; scanf("%d", &n); for (int i = 0; i < n; i++) { for (int j = 0; j < 10; j++) scanf("%d", &A[j]); if (solve(A[0], 0, 0)) printf("YES\n"); else printf("NO\n"); } }
a.cc: In function 'int main()': a.cc:26:9: error: 'scanf' was not declared in this scope 26 | scanf("%d", &n); | ^~~~~ a.cc:31:25: error: 'printf' was not declared in this scope 31 | printf("YES\n"); | ^~~~~~ a.cc:4:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' 3 | #include<queue> +++ |+#include <cstdio> 4 | a.cc:33:25: error: 'printf' was not declared in this scope 33 | printf("NO\n"); | ^~~~~~ a.cc:33:25: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
s239147028
p00033
C++
#include<iostream> #include<stdio.h> #include<string> #include<math.h> #include<iomanip> #include<algorithm> #include<string.h> #include<cctype> #include<map> #include<set> #include<vector> #include<sstream> #include<stack> #include<queue> using namespace std; int main() { int N; cin>>N while(N--) { int arr[10]; bool flag=true; for(int i=0;i<10;i++) cin>>arr[i]; for(int i=0;i<8;i++) { if(arr[i]>arr[i+1]&&arr[i+1]>arr[i+2]) { flag=false; break; } } if(flag) cout<<"YES"<<endl; else cout<<"NO"<<endl; } //while(1); return 0; }
a.cc: In function 'int main()': a.cc:22:10: error: expected ';' before 'while' 22 | cin>>N | ^ | ; 23 | while(N--) | ~~~~~
s620641145
p00033
C++
#include <stdio.h> int ball[10]; bool can(int n,int left,int right){ bool flag; if(n==10) return true; if(ball[n]>right && can(n+1,left ,ball[n]))return true; if(ball[n]>left && can(n+1,ball[n]),right)return true; return false; } int main(){ int N; scanf("%d",&N); for(i=0;i<N;i++){ for(j=0;j<10;j++){ scanf("%d",&ball[j]); } printf(can(0,0,0)?"YES":"NO"); }
a.cc: In function 'bool can(int, int, int)': a.cc:10:32: error: too few arguments to function 'bool can(int, int, int)' 10 | if(ball[n]>left && can(n+1,ball[n]),right)return true; | ~~~^~~~~~~~~~~~~ a.cc:5:6: note: declared here 5 | bool can(int n,int left,int right){ | ^~~ a.cc: In function 'int main()': a.cc:22:13: error: 'i' was not declared in this scope 22 | for(i=0;i<N;i++){ | ^ a.cc:23:21: error: 'j' was not declared in this scope 23 | for(j=0;j<10;j++){ | ^ a.cc:31:2: error: expected '}' at end of input 31 | } | ^ a.cc:16:11: note: to match this '{' 16 | int main(){ | ^
s907600337
p00033
C++
#include <stdio.h> int ball[10]; bool can(int n,int left,int right){ bool flag; if(n==10) return true; if(ball[n]>right && can(n+1,left ,ball[n])return true; if(ball[n]>left && can(n+1,ball[n],right)return true; return false; } int main(){ int N; scanf("%d",&N); for(int i=0;i<N;i++){ for(int j=0;j<10;j++){ scanf("%d",&ball[j]); } printf(can(0,0,0)?"YES":"NO"); } }
a.cc: In function 'bool can(int, int, int)': a.cc:9:51: error: expected ';' before 'return' 9 | if(ball[n]>right && can(n+1,left ,ball[n])return true; | ^~~~~~ | ; a.cc:10:9: error: expected primary-expression before 'if' 10 | if(ball[n]>left && can(n+1,ball[n],right)return true; | ^~ a.cc:9:63: error: expected ')' before 'if' 9 | if(ball[n]>right && can(n+1,left ,ball[n])return true; | ~ ^ | ) 10 | if(ball[n]>left && can(n+1,ball[n],right)return true; | ~~
s981464930
p00033
C++
#include <stdio.h> int ball[10]; bool can(int n,int left,int right){ bool flag; if(n==10) return true; if(ball[n]>right && can(n+1,left ,ball[n])return true; if(ball[n]>left && can(n+1,ball[n],right)return true; return false; } int main(){ int N; scanf("%d",&N); for(int i=0;i<N;i++){ for(int j=0;j<10;j++){ scanf("%d",&ball[j]); } printf(can(0,0,0)?"YES":"NO"); } }
a.cc: In function 'bool can(int, int, int)': a.cc:9:51: error: expected ';' before 'return' 9 | if(ball[n]>right && can(n+1,left ,ball[n])return true; | ^~~~~~ | ; a.cc:10:9: error: expected primary-expression before 'if' 10 | if(ball[n]>left && can(n+1,ball[n],right)return true; | ^~ a.cc:9:63: error: expected ')' before 'if' 9 | if(ball[n]>right && can(n+1,left ,ball[n])return true; | ~ ^ | ) 10 | if(ball[n]>left && can(n+1,ball[n],right)return true; | ~~
s893932746
p00033
C++
#include <iostream> using namespace std; int Balls[10]; bool fork(int balls[], int i, int b, int c) { if (i == 10) return true; if (b > balls[i] && c > balls[i]) return false; if (b < balls[i]) fork(balls, i + 1, balls[i], c); if (c < balls[i]) fork(balls, i + 1, b, balls[i]); } int main() { int n; for (int i = 0; i < n; i++) { for (int j = 0; j < 10; j++) { cin >> Balls[j]; if(fork(Balls, 0, 0, 0)) {cout << "YES" << endl;} else(){cout << "NO" << endl;} } } return 0; }
a.cc: In function 'int main()': a.cc:20:14: error: expected primary-expression before ')' token 20 | else(){cout << "NO" << endl;} | ^ a.cc: In function 'bool fork(int*, int, int, int)': a.cc:11:1: warning: control reaches end of non-void function [-Wreturn-type] 11 | } | ^
s074367522
p00033
C++
#include <iostream> using namespace std; int Balls[10]; bool fork(int balls[], int i, int b, int c) { if (i == 10) return true; if (b > balls[i] && c > balls[i]) return false; if (b < balls[i]) fork(balls, i + 1, balls[i], c); if (c < balls[i]) fork(balls, i + 1, b, balls[i]); } int main() { int n; for (int i = 0; i < n; i++) { for (int j = 0; j < 10; j++) { cin >> Balls[j]; if(fork(Balls, 0, 0, 0)) {cout << "YES" << endl;} else(){cout << "NO" << endl;} } } return 0; }
a.cc: In function 'int main()': a.cc:20:14: error: expected primary-expression before ')' token 20 | else(){cout << "NO" << endl;} | ^ a.cc: In function 'bool fork(int*, int, int, int)': a.cc:11:1: warning: control reaches end of non-void function [-Wreturn-type] 11 | } | ^
s997830152
p00033
C++
#include "stdafx.h" #include <iostream> using namespace std; int main() { int n; int b = 0; int c = 0; int d = 0; int A[10] = {}; int B[10] = {}; int C[10] = {}; cin >> n; for (int i = 0;i < n;i++) { for (int j = 0;j < 10;j++) { cin >> A[j]; } for (int j = 0;j < 10;j++) { if (d == 0) { if (j == 0) { B[0] = A[0]; b++; } if ((A[j] > B[b]) && (B[b] > C[c])) { B[b] = A[j]; b++; } if (A[j] > C[c]) { C[c] = A[j]; c++; } if ((A[j] < B[b - 1]) && (A[j] < C[c - 1])) { cout << "NO" << endl; d = 1; } } } if (d == 0) { cout << "YES" << endl; } d = 0; } return 0; }
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s388001926
p00033
C++
#include<iostream> using namespace std; int B[11]={0}; int C[11]={0}; bool DFS(int *a,int i=0,int b=1,int c=1) { bool judge=true; if(i==10) return judge; judge=false; if(B[b-1]<a[i]){ B[b]=a[i]; judge=DFS(a,i+1,b+1,c); } if(C[c-1]<a[i]){ C[c]=a[i]; judge=DFS(a,i+1,b,c+1); } return judge; } int main() { int N; int i=0; cin>>N; while(i<N){ int A[10]={0}; for(int i=0;i<10;i++) cin>>A[i]; if(DFS(A)==true) cout<<"YES"<<endl; else cout<<"NO"<<endl; ??????????????????i++; } return 0; }
a.cc: In function 'int main()': a.cc:47:1: error: expected primary-expression before '?' token 47 | ??????????????????i++; | ^ a.cc:47:2: error: expected primary-expression before '?' token 47 | ??????????????????i++; | ^ a.cc:47:3: error: expected primary-expression before '?' token 47 | ??????????????????i++; | ^ a.cc:47:4: error: expected primary-expression before '?' token 47 | ??????????????????i++; | ^ a.cc:47:5: error: expected primary-expression before '?' token 47 | ??????????????????i++; | ^ a.cc:47:6: error: expected primary-expression before '?' token 47 | ??????????????????i++; | ^ a.cc:47:7: error: expected primary-expression before '?' token 47 | ??????????????????i++; | ^ a.cc:47:8: error: expected primary-expression before '?' token 47 | ??????????????????i++; | ^ a.cc:47:9: error: expected primary-expression before '?' token 47 | ??????????????????i++; | ^ a.cc:47:10: error: expected primary-expression before '?' token 47 | ??????????????????i++; | ^ a.cc:47:11: error: expected primary-expression before '?' token 47 | ??????????????????i++; | ^ a.cc:47:12: error: expected primary-expression before '?' token 47 | ??????????????????i++; | ^ a.cc:47:13: error: expected primary-expression before '?' token 47 | ??????????????????i++; | ^ a.cc:47:14: error: expected primary-expression before '?' token 47 | ??????????????????i++; | ^ a.cc:47:15: error: expected primary-expression before '?' token 47 | ??????????????????i++; | ^ a.cc:47:16: error: expected primary-expression before '?' token 47 | ??????????????????i++; | ^ a.cc:47:17: error: expected primary-expression before '?' token 47 | ??????????????????i++; | ^ a.cc:47:18: error: expected primary-expression before '?' token 47 | ??????????????????i++; | ^ a.cc:47:22: error: expected ':' before ';' token 47 | ??????????????????i++; | ^ | : a.cc:47:22: error: expected primary-expression before ';' token a.cc:47:22: error: expected ':' before ';' token 47 | ??????????????????i++; | ^ | : a.cc:47:22: error: expected primary-expression before ';' token a.cc:47:22: error: expected ':' before ';' token 47 | ??????????????????i++; | ^ | : a.cc:47:22: error: expected primary-expression before ';' token a.cc:47:22: error: expected ':' before ';' token 47 | ??????????????????i++; | ^ | : a.cc:47:22: error: expected primary-expression before ';' token a.cc:47:22: error: expected ':' before ';' token 47 | ??????????????????i++; | ^ | : a.cc:47:22: error: expected primary-expression before ';' token a.cc:47:22: error: expected ':' before ';' token 47 | ??????????????????i++; | ^ | : a.cc:47:22: error: expected primary-expression before ';' token a.cc:47:22: error: expected ':' before ';' token 47 | ??????????????????i++; | ^ | : a.cc:47:22: error: expected primary-expression before ';' token a.cc:47:22: error: expected ':' before ';' token 47 | ??????????????????i++; | ^ | : a.cc:47:22: error: expected primary-expression before ';' token a.cc:47:22: error: expected ':' before ';' token 47 | ??????????????????i++; | ^ | : a.cc:47:22: error: expected primary-expression before ';' token a.cc:47:22: error: expected ':' before ';' token 47 | ??????????????????i++; | ^ | : a.cc:47:22: error: expected primary-expression before ';' token a.cc:47:22: error: expected ':' before ';' token 47 | ??????????????????i++; | ^ | : a.cc:47:22: error: expected primary-expression before ';' token a.cc:47:22: error: expected ':' before ';' token 47 | ??????????????????i++; | ^ | : a.cc:47:22: error: expected primary-expression before ';' token a.cc:47:22: error: expected ':' before ';' token 47 | ??????????????????i++; | ^ | : a.cc:47:22: error: expected primary-expression before ';' token a.cc:47:22: error: expected ':' before ';' token 47 | ??????????????????i++; | ^ | : a.cc:47:22: error: expected primary-expression before ';' token a.cc:47:22: error: expected ':' before ';' token 47 | ??????????????????i++; | ^ | : a.cc:47:22: error: expected primary-expression before ';' token a.cc:47:22: error: expected ':' before ';' token 47 | ??????????????????i++; | ^ | : a.cc:47:22: error: expected primary-expression before ';' token a.cc:47:22: error: expected ':' before ';' token 47 | ??????????????????i++; | ^ | : a.cc:47:22: error: expected primary-expression before ';' token a.cc:47:22: error: expected ':' before ';' token 47 | ??????????????????i++; | ^ | : a.cc:47:22: error: expected primary-expression before ';' token
s265827552
p00033
C++
#include<iostream> using namespace std; int B[11]={0}; int C[11]={0}; bool DFS(int *a,int i=0,int b=1,int c=1) { bool judge=true; if(i==10) return judge; judge=false; if(B[b-1]<a[i]){ B[b]=a[i]; judge=DFS(a,i+1,b+1,c); } if(C[c-1]<a[i]){ C[c]=a[i]; judge=DFS(a,i+1,b,c+1); } return judge; } int main() { int N; int i=0; cin>>N; while(i<N){ int A[10]={0}; for(int i=0;i<10;i++) cin>>A[i]; ??????????????????if(DFS(A)==true) ????????????????????????cout<<"YES"<<endl; ??????????????????else ????????????????????????cout<<"NO"<<endl; ????????????????????????i++; } return 0; }
a.cc: In function 'int main()': a.cc:41:13: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:14: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:15: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:16: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:17: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:18: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:19: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:20: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:21: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:22: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:23: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:24: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:25: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:26: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:27: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:28: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:29: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:30: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:43:13: error: expected primary-expression before '?' token 43 | ??????????????????else | ^ a.cc:43:14: error: expected primary-expression before '?' token 43 | ??????????????????else | ^ a.cc:43:15: error: expected primary-expression before '?' token 43 | ??????????????????else | ^ a.cc:43:16: error: expected primary-expression before '?' token 43 | ??????????????????else | ^ a.cc:43:17: error: expected primary-expression before '?' token 43 | ??????????????????else | ^ a.cc:43:18: error: expected primary-expression before '?' token 43 | ??????????????????else | ^ a.cc:43:19: error: expected primary-expression before '?' token 43 | ??????????????????else | ^ a.cc:43:20: error: expected primary-expression before '?' token 43 | ??????????????????else | ^ a.cc:43:21: error: expected primary-expression before '?' token 43 | ??????????????????else | ^ a.cc:43:22: error: expected primary-expression before '?' token 43 | ??????????????????else |
s760124316
p00033
C++
#include<iostream> using namespace std; int B[11]={0}; int C[11]={0}; bool DFS(int *a,int i=0,int b=1,int c=1) { bool judge=true; if(i==10) return judge; judge=false; if(B[b-1]<a[i]){ B[b]=a[i]; judge=DFS(a,i+1,b+1,c); } if(C[c-1]<a[i]){ C[c]=a[i]; judge=DFS(a,i+1,b,c+1); } return judge; } int main() { int N; int i=0; cin>>N; while(i<N){ int A[10]={0}; for(int i=0;i<10;i++) cin>>A[i]; ??????????????????if(DFS(A)==true) ????????????????????????cout<<"YES"<<endl; ??????????????????else ????????????????????????cout<<"NO"<<endl; ????????????????????????i++; } return 0; }
a.cc: In function 'int main()': a.cc:41:13: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:14: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:15: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:16: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:17: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:18: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:19: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:20: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:21: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:22: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:23: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:24: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:25: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:26: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:27: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:28: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:29: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:30: error: expected primary-expression before '?' token 41 | ??????????????????if(DFS(A)==true) | ^ a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:41:31: error: expected ':' before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ | : a.cc:41:31: error: expected primary-expression before 'if' 41 | ??????????????????if(DFS(A)==true) | ^~ a.cc:43:13: error: expected primary-expression before '?' token 43 | ??????????????????else | ^ a.cc:43:14: error: expected primary-expression before '?' token 43 | ??????????????????else | ^ a.cc:43:15: error: expected primary-expression before '?' token 43 | ??????????????????else | ^ a.cc:43:16: error: expected primary-expression before '?' token 43 | ??????????????????else | ^ a.cc:43:17: error: expected primary-expression before '?' token 43 | ??????????????????else | ^ a.cc:43:18: error: expected primary-expression before '?' token 43 | ??????????????????else | ^ a.cc:43:19: error: expected primary-expression before '?' token 43 | ??????????????????else | ^ a.cc:43:20: error: expected primary-expression before '?' token 43 | ??????????????????else | ^ a.cc:43:21: error: expected primary-expression before '?' token 43 | ??????????????????else | ^ a.cc:43:22: error: expected primary-expression before '?' token 43 | ??????????????????else |
s540327411
p00033
C++
#include<iostream> using namespace std; int B[11]={0}; int C[11]={0}; bool DFS(int *a,int i=0,int b=1,int c=1) { bool judge=true; if(i==10) return judge; judge=false; if(B[b-1]<a[i]){ B[b]=a[i]; judge=DFS(a,i+1,b+1,c); } if(C[c-1]<a[i]){ C[c]=a[i]; judge=DFS(a,i+1,b,c+1); } return judge; } int main() { int N; int i=0; cin>>N; while(i<N){ ???int A[10]={0}; ???for(int i=0;i<10;i++){ ??? cin>>A[i]; } if(DFS(A)==true){ cout<<"YES"<<endl; } else{ cout<<"NO"<<endl; } ???i++; } return 0; }
a.cc: In function 'int main()': a.cc:37:9: error: expected primary-expression before '?' token 37 | ???int A[10]={0}; | ^ a.cc:37:10: error: expected primary-expression before '?' token 37 | ???int A[10]={0}; | ^ a.cc:37:11: error: expected primary-expression before '?' token 37 | ???int A[10]={0}; | ^ a.cc:37:12: error: expected primary-expression before 'int' 37 | ???int A[10]={0}; | ^~~ a.cc:37:12: error: expected ':' before 'int' 37 | ???int A[10]={0}; | ^~~ | : a.cc:37:12: error: expected primary-expression before 'int' 37 | ???int A[10]={0}; | ^~~ a.cc:37:12: error: expected ':' before 'int' 37 | ???int A[10]={0}; | ^~~ | : a.cc:37:12: error: expected primary-expression before 'int' 37 | ???int A[10]={0}; | ^~~ a.cc:37:12: error: expected ':' before 'int' 37 | ???int A[10]={0}; | ^~~ | : a.cc:37:12: error: expected primary-expression before 'int' 37 | ???int A[10]={0}; | ^~~ a.cc:38:9: error: expected primary-expression before '?' token 38 | ???for(int i=0;i<10;i++){ | ^ a.cc:38:10: error: expected primary-expression before '?' token 38 | ???for(int i=0;i<10;i++){ | ^ a.cc:38:11: error: expected primary-expression before '?' token 38 | ???for(int i=0;i<10;i++){ | ^ a.cc:38:12: error: expected primary-expression before 'for' 38 | ???for(int i=0;i<10;i++){ | ^~~ a.cc:38:12: error: expected ':' before 'for' 38 | ???for(int i=0;i<10;i++){ | ^~~ | : a.cc:38:12: error: expected primary-expression before 'for' 38 | ???for(int i=0;i<10;i++){ | ^~~ a.cc:38:12: error: expected ':' before 'for' 38 | ???for(int i=0;i<10;i++){ | ^~~ | : a.cc:38:12: error: expected primary-expression before 'for' 38 | ???for(int i=0;i<10;i++){ | ^~~ a.cc:38:12: error: expected ':' before 'for' 38 | ???for(int i=0;i<10;i++){ | ^~~ | : a.cc:38:12: error: expected primary-expression before 'for' 38 | ???for(int i=0;i<10;i++){ | ^~~ a.cc:38:32: error: expected ';' before ')' token 38 | ???for(int i=0;i<10;i++){ | ^ | ; a.cc:42:18: error: 'A' was not declared in this scope 42 | if(DFS(A)==true){ | ^ a.cc:49:9: error: expected primary-expression before '?' token 49 | ???i++; | ^ a.cc:49:10: error: expected primary-expression before '?' token 49 | ???i++; | ^ a.cc:49:11: error: expected primary-expression before '?' token 49 | ???i++; | ^ a.cc:49:15: error: expected ':' before ';' token 49 | ???i++; | ^ | : a.cc:49:15: error: expected primary-expression before ';' token a.cc:49:15: error: expected ':' before ';' token 49 | ???i++; | ^ | : a.cc:49:15: error: expected primary-expression before ';' token a.cc:49:15: error: expected ':' before ';' token 49 | ???i++; | ^ | : a.cc:49:15: error: expected primary-expression before ';' token
s532368302
p00033
C++
#include<iostream> using namespace std; int B[11]={0}; int C[11]={0}; bool DFS(int *a,int i=0,int b=1,int c=1) { bool judge=true; if(i==10) return judge; judge=false; if(B[b-1]<a[i]){ B[b]=a[i]; judge=DFS(a,i+1,b+1,c); } if(C[c-1]<a[i]){ C[c]=a[i]; judge=DFS(a,i+1,b,c+1); } return judge; } int main() { int N; int i=0; cin>>N; while(i<N){ ???int A[10]; ???for(int i=0;i<10;i++){ ??? cin>>A[i]; } if(DFS(A)==true){ cout<<"YES"<<endl; } else{ cout<<"NO"<<endl; } ???i++; } return 0; }
a.cc: In function 'int main()': a.cc:37:9: error: expected primary-expression before '?' token 37 | ???int A[10]; | ^ a.cc:37:10: error: expected primary-expression before '?' token 37 | ???int A[10]; | ^ a.cc:37:11: error: expected primary-expression before '?' token 37 | ???int A[10]; | ^ a.cc:37:12: error: expected primary-expression before 'int' 37 | ???int A[10]; | ^~~ a.cc:37:12: error: expected ':' before 'int' 37 | ???int A[10]; | ^~~ | : a.cc:37:12: error: expected primary-expression before 'int' 37 | ???int A[10]; | ^~~ a.cc:37:12: error: expected ':' before 'int' 37 | ???int A[10]; | ^~~ | : a.cc:37:12: error: expected primary-expression before 'int' 37 | ???int A[10]; | ^~~ a.cc:37:12: error: expected ':' before 'int' 37 | ???int A[10]; | ^~~ | : a.cc:37:12: error: expected primary-expression before 'int' 37 | ???int A[10]; | ^~~ a.cc:38:9: error: expected primary-expression before '?' token 38 | ???for(int i=0;i<10;i++){ | ^ a.cc:38:10: error: expected primary-expression before '?' token 38 | ???for(int i=0;i<10;i++){ | ^ a.cc:38:11: error: expected primary-expression before '?' token 38 | ???for(int i=0;i<10;i++){ | ^ a.cc:38:12: error: expected primary-expression before 'for' 38 | ???for(int i=0;i<10;i++){ | ^~~ a.cc:38:12: error: expected ':' before 'for' 38 | ???for(int i=0;i<10;i++){ | ^~~ | : a.cc:38:12: error: expected primary-expression before 'for' 38 | ???for(int i=0;i<10;i++){ | ^~~ a.cc:38:12: error: expected ':' before 'for' 38 | ???for(int i=0;i<10;i++){ | ^~~ | : a.cc:38:12: error: expected primary-expression before 'for' 38 | ???for(int i=0;i<10;i++){ | ^~~ a.cc:38:12: error: expected ':' before 'for' 38 | ???for(int i=0;i<10;i++){ | ^~~ | : a.cc:38:12: error: expected primary-expression before 'for' 38 | ???for(int i=0;i<10;i++){ | ^~~ a.cc:38:32: error: expected ';' before ')' token 38 | ???for(int i=0;i<10;i++){ | ^ | ; a.cc:42:18: error: 'A' was not declared in this scope 42 | if(DFS(A)==true){ | ^ a.cc:49:9: error: expected primary-expression before '?' token 49 | ???i++; | ^ a.cc:49:10: error: expected primary-expression before '?' token 49 | ???i++; | ^ a.cc:49:11: error: expected primary-expression before '?' token 49 | ???i++; | ^ a.cc:49:15: error: expected ':' before ';' token 49 | ???i++; | ^ | : a.cc:49:15: error: expected primary-expression before ';' token a.cc:49:15: error: expected ':' before ';' token 49 | ???i++; | ^ | : a.cc:49:15: error: expected primary-expression before ';' token a.cc:49:15: error: expected ':' before ';' token 49 | ???i++; | ^ | : a.cc:49:15: error: expected primary-expression before ';' token
s438595426
p00033
C++
#include <iostream> int a[10]; int main() { int T; cin >> T; while (T--) { bool ans = true; for (int i = 0; i < 10; ++i) { cin >> a[i]; } int l, r; l = r = 0; for (int i = 0; i < 10; ++i) { if (a[i] > l) { l = a[i]; } else if (a[i] > r) { r = a[i]; } else { and = false; break; } } cout << (ans ? "YES" : "NO") << endl; } }
a.cc: In function 'int main()': a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 7 | cin >> T; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:21:37: error: expected identifier before '=' token 21 | and = false; | ^ a.cc:25:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 25 | cout << (ans ? "YES" : "NO") << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:25:49: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 25 | cout << (ans ? "YES" : "NO") << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s680698659
p00033
C++
#include <iostream> using namespace std; int a[10]; int main() { int T; cin >> T; while (T--) { bool ans = true; for (int i = 0; i < 10; ++i) { cin >> a[i]; } int l, r; l = r = 0; for (int i = 0; i < 10; ++i) { if (a[i] > l) { l = a[i]; } else if (a[i] > r) { r = a[i]; } else { and = false; break; } } cout << (ans ? "YES" : "NO") << endl; } }
a.cc: In function 'int main()': a.cc:22:37: error: expected identifier before '=' token 22 | and = false; | ^
s780308330
p00033
C++
#include <stdio.h> int main(void) { int a,b,c[10]={0},d,e,f,g,h,i; int e=1; scanf("%d",&a); for (b=0;b<a;b++) { e=1; for (i=0;i<10;i++) { scanf("%d",&f); c[i]=f; } if (e==1) { for (g=1;g<8;g++) { if (c[g-1]<c[g]||c[g-1]<c[g+1]) { e=0; } else { e=1; } } } if (e==0) { printf("Yes\n"); } if (e==1) { printf("NO\n"); } } return 0; }
a.cc: In function 'int main()': a.cc:5:13: error: redeclaration of 'int e' 5 | int e=1; | ^ a.cc:4:29: note: 'int e' previously declared here 4 | int a,b,c[10]={0},d,e,f,g,h,i; | ^
s096628800
p00033
C++
2 3 1 4 2 5 6 7 8 9 10 10 9 8 7 6 5 4 3 2 1
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 2 | ^
s928341269
p00033
C++
#include <bits/stdc++.h> using namespace std; int inp[10]; int n; bool dfs(int b, int c, int depth) { if (depth >= 10) return true; if (inp[depth] < b && inp[depth] < c) return false; if (inp[depth] > b) dfs(inp[depth], c, depth+1); if (inp[depth] > c) dfs(inp[depth], c, depth+1); } int main() { cin >> n; for (int i = 0; i < n; i++) { canbe = false; for (int j = 0; j < 10; j++) cin >> inp[j]; cout << (dfs(0,0,0) ? "YES": "NO") << endl; } return 0; }
a.cc: In function 'int main()': a.cc:17:5: error: 'canbe' was not declared in this scope 17 | canbe = false; | ^~~~~ a.cc: In function 'bool dfs(int, int, int)': a.cc:12:1: warning: control reaches end of non-void function [-Wreturn-type] 12 | } | ^
s069048074
p00033
C++
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); input.readLine(); while (input.ready()) { String[] INPUT_STR = input.readLine().split(" "); System.out.println(solver(INPUT_STR)); } } private static String solver(String[] array) { int currentA = 0; int currentB = 0; int currentC = 0; for (int i = 0; i < array.length; i++) { currentA = Integer.parseInt(array[i]); if (i % 2 == 0) { if (currentB > currentA) { return "NO"; } currentB = currentA; } else { if (currentC > currentA) { return "NO"; } currentC = currentA; } } return "YES"; } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.BufferedReader; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.io.IOException; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: 'import' does not name a type 3 | import java.io.InputStreamReader; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:5:1: error: expected unqualified-id before 'public' 5 | public class Main | ^~~~~~
s871263752
p00033
C++
#include <iostream> #include <vector> #include <string> using namespace std; int q; int Ball[10]; bool flag; vector<string> log; bool is_satisfies(vector<int> a) { vector<int> copy = a; sort(a.begin(), a.end()); return a == copy; } void bfs(int i, vector<int> B, vector<int> C) { if (i == 9) { if (is_satisfies(B) && is_satisfies(C)) flag = true; else flag = flag == true ? true : false; } else { vector<int> temp; temp = B; temp.push_back(Ball[i]); bfs(i + 1, temp, C); temp = C; temp.push_back(Ball[i]); bfs(i + 1, B, temp); } } void solve() { vector<int> B, C; flag = false; bfs(0, B, C); if (flag) log.push_back("YES"); else log.push_back("NO"); } int main() { cin >> q; for (int i = 0; i < q; ++i) { for (int j = 0; j < 10; ++j) scanf("%d", &Ball[j]); solve(); } for (int i = 0; i < log.size(); ++i) { cout << log[i] << endl; } }
a.cc:11:16: warning: built-in function 'log' declared as non-function [-Wbuiltin-declaration-mismatch] 11 | vector<string> log; | ^~~ a.cc: In function 'bool is_satisfies(std::vector<int>)': a.cc:15:5: error: 'sort' was not declared in this scope; did you mean 'short'? 15 | sort(a.begin(), a.end()); | ^~~~ | short
s003723824
p00033
C++
#include <iostream> using namespace std; int main() { int n; cin >> n; // ???????????????????????° while(n--){ int balls[10] = {0}; for(int i = 0; i < 10; i++) cin >> balls[I]; // ??????????????????????????\??? bool isYES = true; // ???10??????????????????????????????????????? int topB = 0, topC = 0; // ???B?????????C???????????¨???????????? for(int i = 0; i < 10; i++){ if (topB < balls[i]){ topB = balls[i]; } else if (topC < balls[i]) { topC = balls[i]; } else { isYES = false; break; } } cout << (isYES ? "YES" : "NO") << endl; } }
a.cc: In function 'int main()': a.cc:9:50: error: 'I' was not declared in this scope 9 | for(int i = 0; i < 10; i++) cin >> balls[I]; // ??????????????????????????\??? | ^
s940914823
p00033
C++
// // 0033.cpp // // // Created by Yoshida Satoshi on 2017/11/16. // // #include <iostream> using namespace std; void tsumu(int l,int r,int* in,int j,bool *ans){ if(j==9){ *ans=true; return; } if(in[j]>l) tsumu(in[j],r,in,j+1,ans); if(in[j]>r) tsumu(l,in[j],in,j+1,ans); return; } int main(){ int N; int in[10]; int l; int r; bool ans=false; cin>>N; for(int i=0;i<N;i++){ l=r=0; for(int j=0;j<10;j++){ cin>>in[j]; } if(tsumu(l,r,in,0,&ans)) cout<<"YES"<<endl; else cout<<"NO"<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:36:17: error: could not convert 'tsumu(l, r, ((int*)(& in)), 0, (& ans))' from 'void' to 'bool' 36 | if(tsumu(l,r,in,0,&ans)) cout<<"YES"<<endl; | ~~~~~^~~~~~~~~~~~~~~ | | | void
s709165193
p00033
C++
#include<cstdio> int n,l1,l2,a[15]; int main() { scanf("%d",&n); for(int i=1;i<=n;i++) { bool f=0;l1=-1;l2=0; for(int j=1;j<=10;j++) scanf("%d",&a[j]); for(int j=1;j<=10;j++) if(!f) { if(a[j]<l1&&a[j]<l2){f=1;printf("No\n");break;} if(l1>l2){if(a[j]>l1)l1=a[j];else l2=a[j];} else{if(a[j]>l2)l2=a[j];else l1=a[j];} } if(!f)printf("YES\n");a } }
a.cc: In function 'int main()': a.cc:18:40: error: expected ';' before '}' token 18 | if(!f)printf("YES\n");a | ^ | ; 19 | } | ~
s972952084
p00033
C++
public class Main { void run() { scanner scan = new Scanner(System.in); int n = scan.nextInt(); int[] boll = new int[10]; for(int k = 0; k < n; k++) { for(int i = 0; i < 10; i++) { boll[i] = scan.nextInt(); } int judg = 0; for(int i = 0; i < n; i++) { int right,left; right = boll[0]; left = 0; for(int m = 1; m < 10; m++) { if(right > boll[m]) { if(left < boll[m]) { left = boll[m]; } else { judg = 0; break; } } else if(right < boll[m]) { right = boll[m]; } judg = 1; } if(judg == 0) { System.out.println("NO"); } else { System.out.println("YES"); } } } } public static void main(String[] args) { new Main().run(); } }
a.cc:1:1: error: expected unqualified-id before 'public' 1 | public class Main { | ^~~~~~
s725939588
p00033
C++
Public class Main { void run() { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int[] boll = new int[10]; for(int k = 0; k < n; k++) { for(int i = 0; i < 10; i++) { boll[i] = scan.nextInt(); } int judg = 0; for(int i = 0; i < n; i++) { int right,left; right = boll[0]; left = 0; for(int m = 1; m < 10; m++) { if(right > boll[m]) { if(left < boll[m]) { left = boll[m]; } else { judg = 0; break; } } else if(right < boll[m]) { right = boll[m]; } judg = 1; } if(judg == 0) { System.out.println("NO"); } else { System.out.println("YES"); } } } } public static void main(String[] args) { new Main().run(); } }
a.cc:1:1: error: 'Public' does not name a type 1 | Public class Main { | ^~~~~~
s532130316
p00033
C++
public class Main { void run() { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int[] boll = new int[10]; for(int k = 0; k < n; k++) { for(int i = 0; i < 10; i++) { boll[i] = scan.nextInt(); } int judg = 0; for(int i = 0; i < n; i++) { int right,left; right = boll[0]; left = 0; for(int m = 1; m < 10; m++) { if(right > boll[m]) { if(left < boll[m]) { left = boll[m]; } else { judg = 0; break; } } else if(right < boll[m]) { right = boll[m]; } judg = 1; } if(judg == 0) { System.out.println("NO"); } else { System.out.println("YES"); } } } } public static void main(String[] args) { new Main().run(); } }
a.cc:1:1: error: expected unqualified-id before 'public' 1 | public class Main { | ^~~~~~
s050914537
p00033
C++
# include <iostream> # include <cstdio> using namespace std; int n,len,ball[20],used[20]; int f() { int t = -1; for (int i=1;i<=10;++i) if (!used[i]) { if (ball[i] < t) return 0; t = ball[i]; } t = -1; for (int i=1;i<=10;++i) if (used[i]) { if (ball[i] < t) return 0; t = ball[i]; } return 1; } int dfs(int x,int l) { if (l == len) return f(); for (int i=x+1;i<=10;++i) if (!used[i]) { used[i] = 1; if (dfs(i,l+1)) return 1; used[i] = 0; } return 0; } int main() { // freopen("in.txt","r",stdin); cin>>n; while (n--) { int flag = 0; for (int i=1;i<=10;++i) cin>>ball[i]; for (int i=0;i<=5;++i) { memset(used,0,sizeof(used)); len = i; if (dfs(0,0)) { flag = 1; break; } } if (flag) cout<<"YES"; else cout<<"NO"; puts(""); } return 0; }
a.cc: In function 'int main()': a.cc:49:25: error: 'memset' was not declared in this scope 49 | memset(used,0,sizeof(used)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | # include <cstdio> +++ |+#include <cstring> 3 | using namespace std;
s777604084
p00033
C++
int main() { int n; cin >> n; while (n--) { int a, b = 0, c = 0; bool f = true; for (int i = 0; i < 10; ++i) { cin >> a; if (b < a) b = a; else if (c < a) c = a; else f = false; } if (f) cout << "YES" << endl; else cout << "NO" << endl; } }
a.cc: In function 'int main()': a.cc:3:3: error: 'cin' was not declared in this scope 3 | cin >> n; | ^~~ a.cc:13:12: error: 'cout' was not declared in this scope 13 | if (f) cout << "YES" << endl; | ^~~~ a.cc:13:29: error: 'endl' was not declared in this scope 13 | if (f) cout << "YES" << endl; | ^~~~ a.cc:14:10: error: 'cout' was not declared in this scope 14 | else cout << "NO" << endl; | ^~~~ a.cc:14:26: error: 'endl' was not declared in this scope 14 | else cout << "NO" << endl; | ^~~~
s126690500
p00033
C++
import java.util.*; import java.lang.*; import java.math.*; import java.io.*; import static java.lang.Math.*; import static java.util.Arrays.*; public class Main{ Scanner sc; static final int INF=1<<28; static final double EPS=1e-9; void run(){ sc=new Scanner(System.in); int n=sc.nextInt(); sc.nextLine(); for(int k=0; k<n; k++){ String[] ss=sc.nextLine().split(" "); int[] a=new int[10]; for(int i=0; i<10; i++) a[i]=Integer.parseInt(ss[i]); int x=0; for(int i=0; i<10; i++){ if(a[i]>x){ x=a[i]; a[i]=-1; } } x=0; for(int i=0; i<10; i++){ if(a[i]>x){ x=a[i]; a[i]=-1; } } boolean f=true; for(int i=0; i<10; i++) if(a[i]!=-1){ f=false; break; } println(f?"YES":"NO"); } sc.close(); } void print(String s){ System.out.print(s); } void println(String s){ System.out.println(s); } public static void main(String[] args){ new Main().run(); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.lang.*; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: 'import' does not name a type 3 | import java.math.*; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:1: error: 'import' does not name a type 4 | import java.io.*; | ^~~~~~ a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:6:1: error: 'import' does not name a type 6 | import static java.lang.Math.*; | ^~~~~~ a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:7:1: error: 'import' does not name a type 7 | import static java.util.Arrays.*; | ^~~~~~ a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:9:1: error: expected unqualified-id before 'public' 9 | public class Main{ | ^~~~~~
s877752311
p00033
C++
#include <iostream> #include <cstdio> #include <vector> using namespace std; bool search(int l, int r, int n) { if (n == 10) { return true; } if (l < ball[n]) { if (search(ball[n], r, n + 1)) {return true;} } if (r < ball[n]) { if (search(l, ball[n], n + 1)) {return true;} } return false; } vector<int> ball; int main() { int N; scanf("%d ", &N); for (int i = 0; i < N; i++) { ball.clear(); ball.resize(10); for (int i = 0; i < 10; i++) { scanf("%d ", &ball[i]); } if (search(ball[0], 0, 1)) { cout << "YES" << endl; } else { cout << "NO" << endl; } } return 0; }
a.cc: In function 'bool search(int, int, int)': a.cc:13:11: error: 'ball' was not declared in this scope 13 | if (l < ball[n]) { | ^~~~ a.cc:16:11: error: 'ball' was not declared in this scope 16 | if (r < ball[n]) { | ^~~~
s555988492
p00033
C++
#include <cstdio> #include <stack> using namespace std; int main(void) { int n; scanf("%d", &n); for (int i = 0; i < n; i++){ stack < int > b, c; int j; b.push(0); c.push(0); int ball[10]; for (int i = 0; i < 10; i++){ scanf("%d", &ball[i]); } for (j = 0; j < 10; j++){ if (b.top() < ball[j]){ if (c.top() < ball[j]){ if (c.top() < b.top()){ b.push(ball[j]); } else { c.push(ball[j]); } } else { b.push(ball[j]); } } else if (c.top() < ball[j]){ c.push(ball[j]); } else { break; } } // printf("%d\n", j); if (j == 10){ printf("YES\n"); } else { printf("NO\n"); } return (0); }
a.cc: In function 'int main()': a.cc:54:2: error: expected '}' at end of input 54 | } | ^ a.cc:6:1: note: to match this '{' 6 | { | ^
s688964434
p00033
C++
a[10];int dfs(int l,int r,int i){if(i>9)return 1;if(a[i]>l&&dfs(a[i],r,i+1))return 1;if(a[i]>r&&dfs(l,a[i],i+1))return 1;return 0; }main(n){scanf("%d",&n);for(;n;n--)scanf("%d%d%d%d%d%d%d%d%d%d",a+0,a+1,a+2,a+3,a+4,a+5,a+6,a+7,a+8,a+9),dfs(0,0,0)?puts("YES"):puts("NO");return 0;}
a.cc:1:1: error: 'a' does not name a type 1 | a[10];int dfs(int l,int r,int i){if(i>9)return 1;if(a[i]>l&&dfs(a[i],r,i+1))return 1;if(a[i]>r&&dfs(l,a[i],i+1))return 1;return 0; | ^ a.cc: In function 'int dfs(int, int, int)': a.cc:1:53: error: 'a' was not declared in this scope 1 | a[10];int dfs(int l,int r,int i){if(i>9)return 1;if(a[i]>l&&dfs(a[i],r,i+1))return 1;if(a[i]>r&&dfs(l,a[i],i+1))return 1;return 0; | ^ a.cc:1:89: error: 'a' was not declared in this scope 1 | a[10];int dfs(int l,int r,int i){if(i>9)return 1;if(a[i]>l&&dfs(a[i],r,i+1))return 1;if(a[i]>r&&dfs(l,a[i],i+1))return 1;return 0; | ^ a.cc: At global scope: a.cc:2:6: error: expected constructor, destructor, or type conversion before '(' token 2 | }main(n){scanf("%d",&n);for(;n;n--)scanf("%d%d%d%d%d%d%d%d%d%d",a+0,a+1,a+2,a+3,a+4,a+5,a+6,a+7,a+8,a+9),dfs(0,0,0)?puts("YES"):puts("NO");return 0;} | ^
s147421060
p00033
C++
a[10]; int dfs(int l,int r,int i){ if(i>9)return 1;if(a[i]>l&&dfs(a[i],r,i+1))return 1; if(a[i]>r&&dfs(l,a[i],i+1))return 1; return 0; } main(n){ scanf("%d",&n); for(;n;n--) scanf("%d%d%d%d%d%d%d%d%d%d",a+0,a+1,a+2,a+3,a+4,a+5,a+6,a+7,a+8,a+9),dfs(0,0,0)?puts("YES"):puts("NO"); return 0; }
a.cc:1:1: error: 'a' does not name a type 1 | a[10]; | ^ a.cc: In function 'int dfs(int, int, int)': a.cc:3:20: error: 'a' was not declared in this scope 3 | if(i>9)return 1;if(a[i]>l&&dfs(a[i],r,i+1))return 1; | ^ a.cc:4:4: error: 'a' was not declared in this scope 4 | if(a[i]>r&&dfs(l,a[i],i+1))return 1; | ^ a.cc: At global scope: a.cc:7:5: error: expected constructor, destructor, or type conversion before '(' token 7 | main(n){ | ^
s102666548
p00033
C++
a[10]; int dfs(int l,int r,int i){ if(i>9)return 1; if(a[i]>l&&dfs(a[i],r,i+1))return 1; if(a[i]>r&&dfs(l,a[i],i+1))return 1; return 0; } main(n){ scanf("%d",&n); for(;n;n--) scanf("%d%d%d%d%d%d%d%d%d%d",a+0,a+1,a+2,a+3,a+4,a+5,a+6,a+7,a+8,a+9),dfs(0,0,0)?puts("YES"):puts("NO"); return 0; }
a.cc:1:1: error: 'a' does not name a type 1 | a[10]; | ^ a.cc: In function 'int dfs(int, int, int)': a.cc:4:6: error: 'a' was not declared in this scope 4 | if(a[i]>l&&dfs(a[i],r,i+1))return 1; | ^ a.cc:5:6: error: 'a' was not declared in this scope 5 | if(a[i]>r&&dfs(l,a[i],i+1))return 1; | ^ a.cc: At global scope: a.cc:8:5: error: expected constructor, destructor, or type conversion before '(' token 8 | main(n){ | ^
s474271697
p00033
C++
#include <iostream> using namespace std; int main(){ int n,ball,tp[2],con,bad; cin >> n; for(; n > 0; n--){ tp[0] = tp[1] = 0; for(int i = 0; i < 10; i++){ cin >> ball; if(tp[0] > tp[1]){ con = 0; }else{ con = 1; } if(ball > tp[con]){ tp[con] = ball; }else if(ball > tp[!con]){ tp[!con] = ball; }else{ cout << "NO" << endl; cin.ignore(64, "\n"); } if(i == 9){ cout << "YES" << endl; } } } return 0; }
a.cc: In function 'int main()': a.cc:28:48: error: invalid conversion from 'const char*' to 'std::basic_istream<char>::int_type' {aka 'int'} [-fpermissive] 28 | cin.ignore(64, "\n"); | ^~~~ | | | const char* In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:544:39: note: initializing argument 2 of 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::ignore(std::streamsize, int_type) [with _CharT = char; _Traits = std::char_traits<char>; std::streamsize = long int; int_type = int]' 544 | ignore(streamsize __n, int_type __delim); | ~~~~~~~~~^~~~~~~
s533871227
p00033
C++
#define _USE_MATH_DEFINES #include <iostream> #include <sstream> #include <cmath> #include <algorithm> #include <queue> #include <stack> #include <limits> #include <map> typedef long long ll; using namespace std; typedef pair<int,int> P; void seek_lcs(int a,int b,int dp[10+1][10+1],int* num,int* base,vector<int>& idx){ if(a==0 || b==0){ return; } if(num[a] == base[b]){ seek_lcs(a-1,b-1,dp,num,base,idx); idx.push_back(num[a]); } else{ if(dp[a-1][b] >= dp[a][b-1]){ seek_lcs(a-1,b,dp,num,base,idx); } else{ seek_lcs(a,b-1,dp,num,base,idx); } } } int main() { int T; cin >> T; for(int t=0;t<T;t++){ int num[10+1]; int base[10+1]; int dp[10+1][10+1]; memset(dp,0,sizeof(dp)); for(int i=1;i<=10;i++){ scanf("%d",num+i); base[i]=i; } num[0]=0; base[0]=0; for(int i=0;i<10;i++){ for(int j=0;j<10;j++){ if(num[i+1]==base[j+1]){ dp[i+1][j+1] = max(dp[i+1][j],max(dp[i][j+1],dp[i][j]+1)); } else{ dp[i+1][j+1] = max(dp[i+1][j],max(dp[i][j+1],dp[i][j])); } } } vector<int> idx; stack<int> stk; seek_lcs(10,10,dp,num,base,idx); for(int i=1;i<=10;i++){ if(find(idx.begin(),idx.end(),num[i]) != idx.end()){ continue; } if(stk.empty() || stk.top() < num[i]) stk.push(num[i]); } printf("%s\n",idx.size() + stk.size() == 10 ? "YES" : "NO"); } }
a.cc: In function 'int main()': a.cc:46:17: error: 'memset' was not declared in this scope 46 | memset(dp,0,sizeof(dp)); | ^~~~~~ a.cc:10:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 9 | #include <map> +++ |+#include <cstring> 10 |
s913096658
p00033
C++
#define _USE_MATH_DEFINES #include <iostream> #include <sstream> #include <cmath> #include <algorithm> #include <queue> #include <stack> #include <limits> #include <map> #include <string> typedef long long ll; using namespace std; typedef pair<int,int> P; void seek_lcs(int a,int b,int dp[10+1][10+1],int* num,int* base,vector<int>& idx){ if(a==0 || b==0){ return; } if(num[a] == base[b]){ seek_lcs(a-1,b-1,dp,num,base,idx); idx.push_back(num[a]); } else{ if(dp[a-1][b] >= dp[a][b-1]){ seek_lcs(a-1,b,dp,num,base,idx); } else{ seek_lcs(a,b-1,dp,num,base,idx); } } } int main() { int T; cin >> T; for(int t=0;t<T;t++){ int num[10+1]; int base[10+1]; int dp[10+1][10+1]; memset(dp,0,sizeof(dp)); for(int i=1;i<=10;i++){ scanf("%d",num+i); base[i]=i; } num[0]=0; base[0]=0; for(int i=0;i<10;i++){ for(int j=0;j<10;j++){ if(num[i+1]==base[j+1]){ dp[i+1][j+1] = max(dp[i+1][j],max(dp[i][j+1],dp[i][j]+1)); } else{ dp[i+1][j+1] = max(dp[i+1][j],max(dp[i][j+1],dp[i][j])); } } } vector<int> idx; stack<int> stk; seek_lcs(10,10,dp,num,base,idx); for(int i=1;i<=10;i++){ if(find(idx.begin(),idx.end(),num[i]) != idx.end()){ continue; } if(stk.empty() || stk.top() < num[i]) stk.push(num[i]); } printf("%s\n",idx.size() + stk.size() == 10 ? "YES" : "NO"); } }
a.cc: In function 'int main()': a.cc:47:17: error: 'memset' was not declared in this scope 47 | memset(dp,0,sizeof(dp)); | ^~~~~~ a.cc:10:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 9 | #include <map> +++ |+#include <cstring> 10 | #include <string>
s829580582
p00033
C++
#include<iostream> #include<cstdio> #include<string> #include<vector> using namespace std; bool saiki(int ball[],int ttB,int ttC,int res){ if(res==10)return true; if(ball[res]>ttB){ return saiki(ball,ball[res],ttC,res+1); } if(ball[res]>ttC){ return saiki(ball,ttB,ball[res],res+1); } return false; } int main(void){ int a,b; int ball[11]; int ttB=0,ttC=0; int res=0; int n; scanf("%d",&n); for(a=0;a<n;a++){ memset(ball,0,sizeof(ball)); ttB=0; ttC=0; res=0; for(b=0;b<10;b++){ scanf("%d",&ball[b]); } if(saiki(ball,ttB,ttC,res)==true)printf("Yes\n");else printf("No\n"); } return 0; }
a.cc: In function 'int main()': a.cc:27:17: error: 'memset' was not declared in this scope 27 | memset(ball,0,sizeof(ball)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include<vector> +++ |+#include <cstring> 5 | using namespace std;
s253873713
p00033
C++
#include <iostream> using namespace std; #define MAX_N 10 int N; int ball[MAX_N]; int used[MAX_N]; bool dfs(int max_l, int max_r, int next) { if (next == MAX_N) return true; if(ball[next] > max_l) return dfs(ball[next],max_r,next+1); if(ball[next] > max_r) return dfs(max_l,ball[next],next+1); return false; } string solve() { memset(used,0,sizeof(used)); return dfs(0,0,0) ? "YES" : "NO"; } main() { cin>>N; for(int i=0;i<N;i++) { for(int j=0;j<MAX_N;j++) { cin>>ball[j]; } cout << solve() << endl; } }
a.cc: In function 'std::string solve()': a.cc:20:4: error: 'memset' was not declared in this scope 20 | memset(used,0,sizeof(used)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring> 2 | using namespace std; a.cc: At global scope: a.cc:24:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 24 | main() { | ^~~~
s554677710
p00033
C++
#include <iostream> using namespace std; int Balls[10]; bool dfs(int i, int R, int L) { if(i == 10) return true; if(dfs(i+1, Balls[i], L) && Balls[i] > R) return true; if(dfs(i+1, R, Balls[i]) && Balls[i] > L) return true; return false; } void main() { int n; cin >> n; for(int i=0; i<n; i++){ for(int j=0; j<10; j++) cin >> Balls[j]; if(dfs(0, 0, 0)) cout << "YES\n"; else cout << "NO\n"; } }
a.cc:17:1: error: '::main' must return 'int' 17 | void main() | ^~~~
s489211136
p00033
C++
#include <iostream> using namespace std; int Balls[10]; bool dfs(int i, int R, int L) { if(i == 10) return true; if(dfs(i+1, Balls[i], L) && Balls[i] > R) return true; if(dfs(i+1, R, Balls[i]) && Balls[i] > L) return true; return false; } void main() { int n; cin >> n; for(int i=0; i<n; i++){ for(int j=0; j<10; j++) cin >> Balls[j]; if(dfs(0, 0, 0)) cout << "YES\n"; else cout << "NO\n"; } return 0; }
a.cc:17:1: error: '::main' must return 'int' 17 | void main() | ^~~~
s330567875
p00033
C++
#include <iostream> using namespace std; int main(){ int a; int b; int n; int c; int d; int e; int f; c=0; while(c<n){ f=0; a=0; b=0; d=0; while(d<10){ cin >>e; if(e>a&&a>b){a=e;} else if(e>b&&b>a){b=e;} else if(e>a){a=e;} else if(e>b){b=e;} else{f=1; break;} d=d+1;} if(f==0){cout <<"YES"<<endl;} if(f==1){cout <<"NO"<<endl;} c=c+1;}
a.cc: In function 'int main()': a.cc:27:8: error: expected '}' at end of input 27 | c=c+1;} | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s799668234
p00033
C++
using System; using System.Collections.Generic; class _0033 { public static void Main() { int n = int.Parse(Console.ReadLine()); for (int i = 0; i < n; i++) { string[] data = Console.ReadLine().Split(); Console.WriteLine(Judge(data) ? "YES" : "NO"); } } public static bool Judge(string[] data) { int right = 0; int left = 0; for (int i = 0; i < data.Length; i++) { if (right < int.Parse(data[i])) right = int.Parse(data[i]); else if (left < int.Parse(data[i])) left = int.Parse(data[i]); else return false; } return true; } }
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:5:11: error: expected ':' before 'static' 5 | public static void Main() | ^~~~~~~ | : a.cc:14:11: error: expected ':' before 'static' 14 | public static bool Judge(string[] data) | ^~~~~~~ | : a.cc:14:30: error: 'string' has not been declared 14 | public static bool Judge(string[] data) | ^~~~~~ a.cc:14:39: error: expected ',' or '...' before 'data' 14 | public static bool Judge(string[] data) | ^~~~ a.cc:26:2: error: expected ';' after class definition 26 | } | ^ | ; a.cc: In static member function 'static void _0033::Main()': a.cc:7:17: error: expected primary-expression before 'int' 7 | int n = int.Parse(Console.ReadLine()); | ^~~ a.cc:10:13: error: 'string' was not declared in this scope 10 | string[] data = Console.ReadLine().Split(); | ^~~~~~ a.cc:10:20: error: expected primary-expression before ']' token 10 | string[] data = Console.ReadLine().Split(); | ^ a.cc:11:13: error: 'Console' was not declared in this scope 11 | Console.WriteLine(Judge(data) ? "YES" : "NO"); | ^~~~~~~ a.cc:11:37: error: 'data' was not declared in this scope 11 | Console.WriteLine(Judge(data) ? "YES" : "NO"); | ^~~~ a.cc: In static member function 'static bool _0033::Judge(int*)': a.cc:18:29: error: 'data' was not declared in this scope 18 | for (int i = 0; i < data.Length; i++) | ^~~~ a.cc:20:25: error: expected primary-expression before 'int' 20 | if (right < int.Parse(data[i])) right = int.Parse(data[i]); | ^~~ a.cc:20:25: error: expected ')' before 'int' a.cc:20:16: note: to match this '(' 20 | if (right < int.Parse(data[i])) right = int.Parse(data[i]); | ^ a.cc:20:53: error: expected primary-expression before 'int' 20 | if (right < int.Parse(data[i])) right = int.Parse(data[i]); | ^~~ a.cc:21:29: error: expected primary-expression before 'int' 21 | else if (left < int.Parse(data[i])) left = int.Parse(data[i]); | ^~~ a.cc:21:29: error: expected ')' before 'int' a.cc:21:21: note: to match this '(' 21 | else if (left < int.Parse(data[i])) left = int.Parse(data[i]); | ^ a.cc:21:56: error: expected primary-expression before 'int' 21 | else if (left < int.Parse(data[i])) left = int.Parse(data[i]); | ^~~
s450452069
p00033
C++
using System; class _0033 { public static void Main() { int n = int.Parse(Console.ReadLine()); for (int i = 0; i < n; i++) { string[] data = Console.ReadLine().Split(); Console.WriteLine(Judge(data) ? "YES" : "NO"); } } public static bool Judge(string[] data) { int right = 0; int left = 0; for (int i = 0; i < data.Length; i++) { if (right < int.Parse(data[i])) right = int.Parse(data[i]); else if (left < int.Parse(data[i])) left = int.Parse(data[i]); else return false; } return true; } }
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:4:11: error: expected ':' before 'static' 4 | public static void Main() | ^~~~~~~ | : a.cc:13:11: error: expected ':' before 'static' 13 | public static bool Judge(string[] data) | ^~~~~~~ | : a.cc:13:30: error: 'string' has not been declared 13 | public static bool Judge(string[] data) | ^~~~~~ a.cc:13:39: error: expected ',' or '...' before 'data' 13 | public static bool Judge(string[] data) | ^~~~ a.cc:25:2: error: expected ';' after class definition 25 | } | ^ | ; a.cc: In static member function 'static void _0033::Main()': a.cc:6:17: error: expected primary-expression before 'int' 6 | int n = int.Parse(Console.ReadLine()); | ^~~ a.cc:9:13: error: 'string' was not declared in this scope 9 | string[] data = Console.ReadLine().Split(); | ^~~~~~ a.cc:9:20: error: expected primary-expression before ']' token 9 | string[] data = Console.ReadLine().Split(); | ^ a.cc:10:13: error: 'Console' was not declared in this scope 10 | Console.WriteLine(Judge(data) ? "YES" : "NO"); | ^~~~~~~ a.cc:10:37: error: 'data' was not declared in this scope 10 | Console.WriteLine(Judge(data) ? "YES" : "NO"); | ^~~~ a.cc: In static member function 'static bool _0033::Judge(int*)': a.cc:17:29: error: 'data' was not declared in this scope 17 | for (int i = 0; i < data.Length; i++) | ^~~~ a.cc:19:25: error: expected primary-expression before 'int' 19 | if (right < int.Parse(data[i])) right = int.Parse(data[i]); | ^~~ a.cc:19:25: error: expected ')' before 'int' a.cc:19:16: note: to match this '(' 19 | if (right < int.Parse(data[i])) right = int.Parse(data[i]); | ^ a.cc:19:53: error: expected primary-expression before 'int' 19 | if (right < int.Parse(data[i])) right = int.Parse(data[i]); | ^~~ a.cc:20:29: error: expected primary-expression before 'int' 20 | else if (left < int.Parse(data[i])) left = int.Parse(data[i]); | ^~~ a.cc:20:29: error: expected ')' before 'int' a.cc:20:21: note: to match this '(' 20 | else if (left < int.Parse(data[i])) left = int.Parse(data[i]); | ^ a.cc:20:56: error: expected primary-expression before 'int' 20 | else if (left < int.Parse(data[i])) left = int.Parse(data[i]); | ^~~
s844364279
p00033
C++
#include<iostream> #include<vector> int main(){ int x; std::cin>>x; for(int i=0;i<x;++i){ std::vector<int> vec(10); for(int l=0;l<10;++l){ std::cin>>vec[l]; } std::vector<std::vector<int> > vec2(2); vec2[0].push_back(vec[0]); for(int l=1;l<vec.size();++l){ if(l==1){ if(vec2[0][0]<vec[1]){ vec2[0].push_back(vec[1]); }else vec2[1].push_back(vec[1]); }else{ if(vec[l]>vec2[0][vec2[0].size()-1]){ if(vec2[1].size()!=0&&vec2[1][vec2[1].size()-1]>vec[l]){ if(vec2[0][vec2[0].size()-1]>vec2[1][vec2[1].size()-1])vec2[0].push_back(vec[l]); else vec2[1].push_back(vec[l]); }else{ vec2[0].push_back } }else{ if(vec2[1].size()!=0?vec[l]>vec2[1][vec2[1].size()-1]:true){ vec2[1].push_back(vec[l]); }else{ std::cout<<"NO"<<std::endl; goto cont; } } } } std::cout<<"YES"<<std::endl; cont:; } return 0; }
a.cc: In function 'int main()': a.cc:25:42: error: expected ';' before '}' token 25 | vec2[0].push_back | ^ | ; 26 | } | ~ a.cc:25:33: error: statement cannot resolve address of overloaded function 25 | vec2[0].push_back
s560560334
p00033
C++
#include <iostream> #include <cstdio> using namespace std; int nums[10]; bool check_recursion(int i; int left; int right){ if(i == 10) return true if(nums[i] > left) check_recursion(i+1; nums[i], right); if(nums[i] > right) check_recursion(i+1; left, nums[i]); return false; } int main(){ int n; bool ans; cin>>n; for(;n>0;n--){ scanf("%d %d %d %d %d %d %d %d %d %d",&nums[0],&nums[1],&nums[2],&nums[3],&nums[4],&nums[5],&nums[6],&nums[7],&nums[8],&nums[9]); ans = check_recursion(0,0,0); } return 0; }
a.cc:8:27: error: expected ')' before ';' token 8 | bool check_recursion(int i; int left; int right){ | ~ ^ | ) a.cc:8:48: error: expected initializer before ')' token 8 | bool check_recursion(int i; int left; int right){ | ^ a.cc: In function 'int main()': a.cc:23:39: error: too many arguments to function 'bool check_recursion(int)' 23 | ans = check_recursion(0,0,0); | ~~~~~~~~~~~~~~~^~~~~~~ a.cc:8:6: note: declared here 8 | bool check_recursion(int i; int left; int right){ | ^~~~~~~~~~~~~~~
s922441887
p00033
C++
#include <stdio.h> int main(){ int n,i,j; int a,b,c; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a); b=0; f=0; for(j=1;j<10;j++){ scanf("%d",&c); if(a>c&&b>c)f=1; else if(a<c&&b<c){ if(a>b)a=c; else b=c; } else{ if(a>b)b=c; else a=c; } } if(f==0){ printf("YES\n"); } else if(f==1){ printf("NO\n"); } } return 0; }
a.cc: In function 'int main()': a.cc:11:1: error: 'f' was not declared in this scope 11 | f=0; | ^
s961549861
p00033
C++
#include<iostream> using namespace std; int arr[10],used[10]; void DFS(int pre,int cur) { if(cur<10&&arr[pre]<arr[cur]) { used[cur]=1; DFS(cur,cur+1); } else if(cur<10&&arr[pre]>=arr[cur]) DFS(pre,cur+1); } int main() { int T,pre; bool judge; cin>>T; while(T--) { for(int i=0;i<10;i++) cin>>arr[i]; for(int i=0;i<10;i++) { memset(used,0,sizeof(used)); used[i]=1; DFS(i,i+1); judge=false; pre=0; for(int j=0;j<10;j++) if(used[j]==0) if(pre>=arr[j]) { judge=true; break; }else pre=arr[j]; if(!judge) { cout<<"YES"<<endl; break; } } if(judge)cout<<"NO"<<endl; } }
a.cc: In function 'int main()': a.cc:25:18: error: 'memset' was not declared in this scope 25 | memset(used,0,sizeof(used)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include <cstring> 2 | using namespace std;
s989262021
p00033
C++
#include<iostream> using namespace std; int arr[10],used[10]; void DFS(int pre,int cur) { if(cur<10&&arr[pre]<arr[cur]) { used[cur]=1; DFS(cur,cur+1); } else if(cur<10&&arr[pre]>=arr[cur]) DFS(pre,cur+1); } int main() { int T,pre; bool judge; cin>>T; while(T--) { for(int i=0;i<10;i++) cin>>arr[i]; for(int i=0;i<10;i++) { memset(used,0,sizeof(used)); used[i]=1; DFS(i,i+1); judge=false; pre=0; for(int j=0;j<10;j++) if(used[j]==0) if(pre>=arr[j]) { judge=true; break; }else pre=arr[j]; if(!judge) { cout<<"YES"<<endl; break; } } if(judge)cout<<"NO"<<endl; } }
a.cc: In function 'int main()': a.cc:25:18: error: 'memset' was not declared in this scope 25 | memset(used,0,sizeof(used)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include <cstring> 2 | using namespace std;
s229223632
p00033
C++
#include <iostream> using namespace std; int ball_list[10]; int right_list[10]; int left_list[10]; bool flag; void dfs(int right, int left){ int count = right + left; if(count == 10){ flag = true; }else{ if(right == 0 || right_list[right-1] < ball_list[count]){ if(right == 0){ right_list[0] = ball_list[count]; }else{ right_list[right-1] = ball_list[count]; } dfs(right+1, left); } if(left == 0 || left_list[left-1] < left_list[left]){ if(left == 0){ left_list[0] = ball_list[count]; }else{ left_list[left-1] = ball_list[count]; } dfs(right, left+1); } } } int main(){ int n; cin >> n; for(int i = 0; i < n; i++){ flag = false; memset(right_list, 0, sizeof(right_list)); memset(left_list, 0, sizeof(left_list)); for(int j = 0; j < 10; j++){ cin >> ball_list[j]; } dfs(0, 0); if(flag){ cout << "YES" << endl; }else{ cout << "NO" << endl; } } return 0; }
a.cc: In function 'int main()': a.cc:43:5: error: 'memset' was not declared in this scope 43 | memset(right_list, 0, sizeof(right_list)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring> 2 |
s160791329
p00033
C++
#include<iostream> using namespace std; int main(){ int t; cin >> t; int n[10]; for(int i=0;i<t;i++){ int h = 0,b = 0,c = 0; for(int j=0;j<10;j++) cin >> n[i]; for(int j=0;j<10;j++){ cin >> n[i]; if(b==0) b = n[i]; else if(b>c&&b<n) b = n[i]; else if(c>b&&c<n) c = n[i]; else if(b>c&&b>n&&c<n) c = n[i]; else if(c>b&&c>n&&b<n) b = n[i]; else if(b>n[i]&&c>n[i]){ cout << "NO" << endl; h = 1; break; } } if(h==0) cout << "YES" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:13:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 13 | else if(b>c&&b<n) b = n[i]; | ~^~ a.cc:14:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 14 | else if(c>b&&c<n) c = n[i]; | ~^~ a.cc:15:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 15 | else if(b>c&&b>n&&c<n) c = n[i]; | ~^~ a.cc:15:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 15 | else if(b>c&&b>n&&c<n) c = n[i]; | ~^~ a.cc:16:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 16 | else if(c>b&&c>n&&b<n) b = n[i]; | ~^~ a.cc:16:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 16 | else if(c>b&&c>n&&b<n) b = n[i]; | ~^~
s049279747
p00033
C++
#include<iostream> using namespace std; int main(){ int t; cin >> t; int n[10]; for(int i=0;i<t;i++){ int h = 0,b = 0,c = 0; for(int j=0;j<10;j++) cin >> n[i]; for(int j=0;j<10;j++){ cin >> n[i]; if(b==0) b = n[i]; else if(b>c&&b<n) b = n[i]; else if(c>b&&c<n) c = n[i]; else if(b>c&&b>n&&c<n) c = n[i]; else if(c>b&&c>n&&b<n) b = n[i]; else if(b>n[i]&&c>n[i]){ cout << "NO" << endl; h = 1; break; } } if(h==0) cout << "YES" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:13:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 13 | else if(b>c&&b<n) b = n[i]; | ~^~ a.cc:14:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 14 | else if(c>b&&c<n) c = n[i]; | ~^~ a.cc:15:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 15 | else if(b>c&&b>n&&c<n) c = n[i]; | ~^~ a.cc:15:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 15 | else if(b>c&&b>n&&c<n) c = n[i]; | ~^~ a.cc:16:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 16 | else if(c>b&&c>n&&b<n) b = n[i]; | ~^~ a.cc:16:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 16 | else if(c>b&&c>n&&b<n) b = n[i]; | ~^~
s905452313
p00033
C++
#include<iostream> using namespace std; int main(){ int t; cin >> t; int n[10]; for(int i=0;i<t;i++){ int h = 0,b = 0,c = 0; for(int j=0;j<10;j++) cin >> n[i]; for(int j=0;j<10;j++){ if(b==0) b = n[i]; else if(b>c&&b<n) b = n[i]; else if(c>b&&c<n) c = n[i]; else if(b>c&&b>n&&c<n) c = n[i]; else if(c>b&&c>n&&b<n) b = n[i]; else if(b>n[i]&&c>n[i]){ cout << "NO" << endl; h = 1; break; } } if(h==0) cout << "YES" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:12:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 12 | else if(b>c&&b<n) b = n[i]; | ~^~ a.cc:13:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 13 | else if(c>b&&c<n) c = n[i]; | ~^~ a.cc:14:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 14 | else if(b>c&&b>n&&c<n) c = n[i]; | ~^~ a.cc:14:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 14 | else if(b>c&&b>n&&c<n) c = n[i]; | ~^~ a.cc:15:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 15 | else if(c>b&&c>n&&b<n) b = n[i]; | ~^~ a.cc:15:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 15 | else if(c>b&&c>n&&b<n) b = n[i]; | ~^~
s290924062
p00033
C++
//0033 //include------------------------------------- #include<iostream> #include<string> #include<algorithm> #include<vector> #include<cmath> #include<map> #include<stack> using namespace std; //typedef-------------------------------------- typedef vector<int> VI; typedef vector<string> VS; typedef pair<int, int> PII; typedef long long LL; #define MP make_pair //repetition----------------------------------- #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) //constant------------------------------------- const double PI = acos(-1.0); //cout,cin------------------------------------- #define COUT(x) cout<<(x)<<endl; #define CIN(x) cin>>(x); int main(){ int n; int x[10]; bool ans; CIN(n); REP(i, n){ REP(j, 10) CIN(x[j]); stack<int> B, C; B.push(0); C.push(0); REP(j, 10){ if ((B.top() > x[j]) && (C.top() > x[j])){ ans = false; break; } else { if ((B.top() >= C.top()) && (B.top() < x[j])) B.push(x[j]); else C.push(x[j]); } } COUT(ans==false?"NO":"YES"); }
a.cc: In function 'int main()': a.cc:60:10: error: expected '}' at end of input 60 | } | ^ a.cc:33:11: note: to match this '{' 33 | int main(){ | ^
s870834859
p00033
C++
int main (){ int N,a[20]={0},b[20]={0},t; int ac=0,bc=0; cin>>N; for(int j=0;j<N;j++){ for(int i=0;i<10;i++){ cin>>t; if(a[ac]<t){ a[ac+1]=t; ac++; } else if(b[bc]<t){ b[bc+1]=t; bc++; } else break; } if(ac+bc==10){ cout<<"YES"<<endl; } else cout<<"NO"<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:4:8: error: 'cin' was not declared in this scope 4 | cin>>N; | ^~~ a.cc:19:18: error: 'cout' was not declared in this scope 19 | cout<<"YES"<<endl; | ^~~~ a.cc:19:31: error: 'endl' was not declared in this scope 19 | cout<<"YES"<<endl; | ^~~~ a.cc:21:17: error: 'cout' was not declared in this scope 21 | else cout<<"NO"<<endl; | ^~~~ a.cc:21:29: error: 'endl' was not declared in this scope 21 | else cout<<"NO"<<endl; | ^~~~
s870507097
p00033
C++
#include <iostream> #define CAPACITY 9 using namespace std; int b, c; bool dfs(int pos, int ary[], bool flag) { cout << "B = " << b << "C = " << c << endl; if(pos < 0) { return(false); } flag = dfs(pos - 1, ary, flag); if(ary[pos] > b) { b = ary[pos]; } else if(ary[pos] > c) { c = ary[pos]; } else { return(false); } if(pos == CAPACITY) { flag = true; } return(flag); } int main(void) { int num; cin >> num; int ary[10]; for(int r = 0; r < num; r++) { for(int c = 0; c < 10; c++) { cin >> ary[c]; } b = ary[0]; c = INT_MIN; if(dfs(CAPACITY, ary, true)) { cout << "YES"; } else { cout << "NO"; } cout << endl; } return(0); }
a.cc: In function 'int main()': a.cc:40:13: error: 'INT_MIN' was not declared in this scope 40 | c = INT_MIN; | ^~~~~~~ a.cc:2:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 1 | #include <iostream> +++ |+#include <climits> 2 | #define CAPACITY 9
s691915705
p00033
C++
#include <iostream> #define CAPACITY 9 using namespace std; int b, c; bool dfs(int pos, int ary[], bool flag) { if(pos < 0) { return(false); } flag = dfs(pos - 1, ary, flag); if(pos == CAPACITY) { flag = true; } if(ary[pos] > b) { b = ary[pos]; } else if(ary[pos] > c) { c = ary[pos]; } else { return(false); } cout << "B = " << b << "C = " << c << endl; return(flag); } int main(void) { int num; cin >> num; int ary[10]; for(int r = 0; r < num; r++) { for(int c = 0; c < 10; c++) { cin >> ary[c]; } b = ary[0]; c = INT_MIN; if(dfs(CAPACITY, ary, true)) { cout << "YES"; } else { cout << "NO"; } cout << endl; } return(0); }
a.cc: In function 'int main()': a.cc:39:13: error: 'INT_MIN' was not declared in this scope 39 | c = INT_MIN; | ^~~~~~~ a.cc:2:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 1 | #include <iostream> +++ |+#include <climits> 2 | #define CAPACITY 9
s843741580
p00033
C++
#include <iostream> bool judge(int num){ int i, n, q[2]={0,0}; for (i=0; i<num; i++) { cin >> n; if (q[0]<n) q[0] = n; else if (q[1]<n) q[1] = n; else break; } if (i==num) return true; else return false; } int main(){ int lines; cin >> lines; for (i=0; i<lines; i++) { if (judge(10)) cout << "NO\n"; else cout << "YES\n"; } return 0; }
a.cc: In function 'bool judge(int)': a.cc:7:17: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 7 | cin >> n; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc: In function 'int main()': a.cc:25:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 25 | cin >> lines; | ^~~ | std::cin /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:26:14: error: 'i' was not declared in this scope 26 | for (i=0; i<lines; i++) { | ^ a.cc:28:25: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 28 | cout << "NO\n"; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:30:25: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 30 | cout << "YES\n"; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~
s904166226
p00033
C++
#include <iostream> using namespace std; bool judge(int num){ int i, n, q[2]={0,0}; for (i=0; i<num; i++) { cin >> n; if (q[0]<n) q[0] = n; else if (q[1]<n) q[1] = n; else break; } if (i==num) return true; else return false; } int main(){ int lines; cin >> lines; for (i=0; i<lines; i++) { if (judge(10)) cout << "NO\n"; else cout << "YES\n"; } return 0; }
a.cc: In function 'int main()': a.cc:28:14: error: 'i' was not declared in this scope 28 | for (i=0; i<lines; i++) { | ^
s185388862
p00033
C++
#include <iostream> using namespace std; bool judge(int num){ int i, n, q[2]={0,0}; for (i=0; i<num; i++) { cin >> n; if (q[0]<n) q[0] = n; else if (q[1]<n) q[1] = n; else break; } return ((i==num)? true: false); } int main(){ int i, n; cin >> n; for (i=0; i<n; i++) cout << (jedge(10)? "YES": "NO") << endl; return 0; }
a.cc: In function 'int main()': a.cc:26:26: error: 'jedge' was not declared in this scope; did you mean 'judge'? 26 | cout << (jedge(10)? "YES": "NO") << endl; | ^~~~~ | judge
s569393122
p00033
C++
#include <iostream> using namespace std; int main(void) { int N, a, b, c; cin >> N; for (; N--; ) { b = c = 0; bool ok = true; for (int i = 0; i < 10; i++) { cin >> a; if (a > b) { b = a; } else if (a > c) { c = a; } else { ok = false; break; } } if (ok) cout << "YES" << endl; else cout << "NO" endl; } return 0; }
a.cc: In function 'int main()': a.cc:23:26: error: expected ';' before 'endl' 23 | else cout << "NO" endl; | ^~~~~ | ;
s555616244
p00034
Java
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Programminng { class AOJ_Volume0034 { public static void Main(string[] args) { while (true) { string s = Console.ReadLine(); if (string.IsNullOrEmpty(s)) break; string[] _s = s.Split(','); int[] values = new int[11]; double[] v = new double[2]; for (int i = 0; i < 11; i++) { if (i == 0) { values[i] = 0; } else { values[i] = int.Parse(_s[i - 1]) + values[i - 1]; } } for (int i = 0; i < 2; i++) { v[i] = int.Parse(_s[i + 10]); } double temp = v[0] / (v[0] + v[1]); temp *= values[10]; bool flag = true; for (int i = 0; i < 10; i++) { if (values[i] <= temp && temp <= values[i+1] && flag) { Console.WriteLine(i+1); flag = false; } } } } } }
Main.java:1: error: unnamed classes are a preview feature and are disabled by default. using System; ^ (use --enable-preview to enable unnamed classes) Main.java:2: error: class, interface, enum, or record expected using System.Collections.Generic; ^ Main.java:3: error: class, interface, enum, or record expected using System.Linq; ^ Main.java:4: error: class, interface, enum, or record expected using System.Text; ^ Main.java:6: error: class, interface, enum, or record expected namespace Programminng ^ Main.java:29: error: class expected values[i] = int.Parse(_s[i - 1]) + values[i - 1]; ^ Main.java:29: error: ';' expected values[i] = int.Parse(_s[i - 1]) + values[i - 1]; ^ Main.java:29: error: not a statement values[i] = int.Parse(_s[i - 1]) + values[i - 1]; ^ Main.java:29: error: ';' expected values[i] = int.Parse(_s[i - 1]) + values[i - 1]; ^ Main.java:29: error: not a statement values[i] = int.Parse(_s[i - 1]) + values[i - 1]; ^ Main.java:35: error: class expected v[i] = int.Parse(_s[i + 10]); ^ Main.java:35: error: ';' expected v[i] = int.Parse(_s[i + 10]); ^ Main.java:35: error: not a statement v[i] = int.Parse(_s[i + 10]); ^ Main.java:35: error: ';' expected v[i] = int.Parse(_s[i + 10]); ^ Main.java:53: error: class, interface, enum, or record expected } ^ 15 errors
s443491669
p00034
Java
import java.io.*; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InpurtStreamReader(System.in)); String line; int[] l=new int[11]; l[0]=0; while((line=br.readLine())!=null){ String[] value=line.split(","); for(int i=0;i<10;i++){ l[i+1]=l[i]+Integer.parseInt(value[i]); } v1=Ineger.parseInt(value[10]); v2=Integer.parseInt(value[11]); double d=l[10]*v1/(v1+v2); for(int i=0;i<10;i++){ if(l[i+1]>=d){ System.out.println(i+1); break; } } } } }
Main.java:5: error: cannot find symbol BufferedReader br=new BufferedReader(new InpurtStreamReader(System.in)); ^ symbol: class InpurtStreamReader location: class Main Main.java:14: error: cannot find symbol v1=Ineger.parseInt(value[10]); ^ symbol: variable v1 location: class Main Main.java:14: error: cannot find symbol v1=Ineger.parseInt(value[10]); ^ symbol: variable Ineger location: class Main Main.java:15: error: cannot find symbol v2=Integer.parseInt(value[11]); ^ symbol: variable v2 location: class Main Main.java:16: error: cannot find symbol double d=l[10]*v1/(v1+v2); ^ symbol: variable v1 location: class Main Main.java:16: error: cannot find symbol double d=l[10]*v1/(v1+v2); ^ symbol: variable v1 location: class Main Main.java:16: error: cannot find symbol double d=l[10]*v1/(v1+v2); ^ symbol: variable v2 location: class Main 7 errors
s768002122
p00034
Java
import java.io.*; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line; int[] l=new int[11]; l[0]=0; while((line=br.readLine())!=null){ String[] value=line.split(","); for(int i=0;i<10;i++){ l[i+1]=l[i]+Integer.parseInt(value[i]); } int v1=Ineger.parseInt(value[10]); int v2=Integer.parseInt(value[11]); double d=l[10]*v1/(v1+v2); for(int i=0;i<10;i++){ if(l[i+1]>=d){ System.out.println(i+1); break; } } } } }
Main.java:14: error: cannot find symbol int v1=Ineger.parseInt(value[10]); ^ symbol: variable Ineger location: class Main 1 error
s755325665
p00034
Java
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); double v1, v2; int d; double t; String[] s; int[] a; int sum; while(scan.hasNext()){ s = scan.next().split(","); a = new int[11]; sum = 0; for(int i = 0; i < 10; i++){ a[i]=Integer.parseInt(s[i]); sum += a[i]; } v1 = Double.parseDouble(s[10]); v2 = Double.parseDouble(s[11]); d = 0; for(int i = 0; i < 10; i++){ d += a[i]; t = d / v1; if(d + t*v2 >= sum){ System.out.println( i + 1); break; } } } }
Main.java:38: error: reached end of file while parsing } ^ 1 error
s648054543
p00034
Java
import java.util.*; public class Main{ private static final Scanner scan = new Scanner(System.in) .useDelimiter("[,\\s]+"); public static void main(String[] args){ int[] l = new int[10]; int sum1 = 0, sum2 = 0; double time = 0, tX = 0; while(scan.hasNext()){ for(int i = 0; i < 10; i++){ l[i] = scan.nextInt(); } int v1 = scan.nextInt(); int v2 = scan.nextInt(); for(int i = 0; i < 10; i++){ sum1 += l[i]; } time =(double) (sum1 / (v2 + v1)); tx =(double) v1 * time; for(int i = 0; i < 10; i++){ sum2 += l[i]; if(tx <= sum2){ System.out.printf("%d\n", i+1); sum1 = 0; sum2 = 0; break; } } } } }
Main.java:21: error: cannot find symbol tx =(double) v1 * time; ^ symbol: variable tx location: class Main Main.java:24: error: cannot find symbol if(tx <= sum2){ ^ symbol: variable tx location: class Main 2 errors
s551980272
p00034
Java
import java.util.*; public class Main{ private static final Scanner scan = new Scanner(System.in) .useDelimiter("[,\\s]+"); public static void main(String[] args){ int[] l = new int[10]; int sum1 = 0, sum2 = 0; double time = 0, tX = 0; while(scan.hasNext()){ for(int i = 0; i < 10; i++){ l[i] = scan.nextInt(); } int v1 = scan.nextInt(); int v2 = scan.nextInt(); for(int i = 0; i < 10; i++){ sum1 += l[i]; } time =(double) sum1 / (double)(v2 + v1)); tX =(double) v1 * time; for(int i = 0; i < 10; i++){ sum2 += l[i]; if(tX <= sum2){ System.out.printf("%d\n", i+1); sum1 = 0; sum2 = 0; break; } } } } }
Main.java:20: error: ';' expected time =(double) sum1 / (double)(v2 + v1)); ^ 1 error
s822430446
p00034
C
#include<iostream> #define loop(i,a,b) for(int i = a; i < b; i++) #define rep(i,a) loop(i,0,a) using namespace std; int main(void){ int l[10]; int v[2]; char tmp; double x; while(cin>>l[0]){ cin>>tmp; loop(i,1,10)cin>>l[i]>>tmp; cin>>v[0]>>tmp>>v[1]; int sum = 0; rep(i,10)sum+=l[i]; x = sum * v[0]/(v[0] + v[1]); sum = 0; int cnt=0; rep(i,10){ sum+=l[i]; cnt++; if(sum>=x){ cout<<cnt<<endl; break; } } } }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s500740021
p00034
C
#include<stdio.h> int main(void) { int kukan[10], a1, a2, sum, i, sure, surea; while(1){ scanf( "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,", &kukan[0], &kukan[1], &kukan[2], &kukan[3], &kukan[4], &kukan[5], &kukan[6], &kukan[7], &kukan[8], &kukan[9], &a1, &a2 ); sum = 0; for(i = 0; i < 10; i++){ sum += kukan[i]; } sure = sum * a1 / (a1 + a2); surea = sum * a1 % (a1 + a2); sum = 0; for(i = 0 ; i < 10; i++){ sum += kukan[i]; if(sure < sum) break; else if(sure == sum) { if(kukan[i] > kukan[i+1] || surea > 0) i = i + 1; break; } } printf( "%d\n", i + 1 ); }
main.c: In function 'main': main.c:25:9: error: expected declaration or statement at end of input 25 | } | ^
s390437074
p00034
C
#include<stdio.h> int main(void) { int kukan[10], a1, a2, sum, i, sure, surea, kai; for( kai = 0; kai < 3; kai++){ scanf( "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,", &kukan[0], &kukan[1], &kukan[2], &kukan[3], &kukan[4], &kukan[5], &kukan[6], &kukan[7], &kukan[8], &kukan[9], &a1, &a2 ); sum = 0; for(i = 0; i < 10; i++){ sum += kukan[i]; } sure = sum * a1 / (a1 + a2); surea = sum * a1 % (a1 + a2); sum = 0; for(i = 0 ; i < 10; i++){ sum += kukan[i]; if(sure < sum) break; else if(sure == sum) { if(kukan[i] > kukan[i+1] || surea > 0) i = i + 1; break; } } printf( "%d\n", i + 1 ); }
main.c: In function 'main': main.c:25:9: error: expected declaration or statement at end of input 25 | } | ^
s058856497
p00034
C
#include<stdio.h> int main(void) { int kukan[10], a1, a2, sum, i, sure, surea, kai; while(1){ scanf( "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,", &kukan[0], &kukan[1], &kukan[2], &kukan[3], &kukan[4], &kukan[5], &kukan[6], &kukan[7], &kukan[8], &kukan[9], &a1, &a2 ); sum = 0; for(i = 0; i < 10; i++){ sum += kukan[i]; } sure = sum * a1 / (a1 + a2); surea = sum * a1 % (a1 + a2); sum = 0; for(i = 0 ; i < 10; i++){ sum += kukan[i]; if(sure < sum) break; else if(sure == sum) { if(kukan[i] > kukan[i+1] || surea > 0) i = i + 1; break; } } printf( "%d\n", i + 1 ); } return 0;
main.c: In function 'main': main.c:27:9: error: expected declaration or statement at end of input 27 | return 0; | ^~~~~~
s814361946
p00034
C
#include <stdio.h> int main() { double L[10]; double V1, V2; double meet_pos; double railway_lenth; double cnt1, cnt2; int output[50]; cnt2 = 0; while(1) { if(scanf("%lf,", &L[0]) == EOF) { break; } for(cnt1 = 1; cnt1 < 10; cnt1++) { scanf("%lf,", &L[cnt1]); } scanf("%lf,%lf", &V1, &V2); railway_lenth = 0; for(cnt1 = 0; cnt1 < 10; cnt1++) { railway_lenth += L[cnt1]; } meet_pos = railway_lenth * V1 / (V1 + V2) cnt1 = 0; railway_lenth = 0; while(railway_lenth <= meet_pos) { railway_lenth += L[cnt1]; cnt1++; } output[cnt2] = cnt1; cnt2++; } return 0; }
main.c: In function 'main': main.c:21:41: error: array subscript is not an integer 21 | scanf("%lf,", &L[cnt1]); | ^ main.c:28:43: error: array subscript is not an integer 28 | railway_lenth += L[cnt1]; | ^ main.c:30:50: error: expected ';' before 'cnt1' 30 | meet_pos = railway_lenth * V1 / (V1 + V2) | ^ | ; 31 | 32 | cnt1 = 0; | ~~~~ main.c:36:43: error: array subscript is not an integer 36 | railway_lenth += L[cnt1]; | ^ main.c:39:15: error: array subscript is not an integer 39 | output[cnt2] = cnt1; | ^
s412177459
p00034
C
#include <stdio.h> int main() { double L[10]; double V1, V2; double meet_pos; double railway_lenth; int cnt1, cnt2; int output[50]; cnt2 = 0; while(1) { if(scanf("%lf,", &L[0]) == EOF) { break; } for(cnt1 = 1; cnt1 < 10; cnt1++) { scanf("%lf,", &L[cnt1]); } scanf("%lf,%lf", &V1, &V2); railway_lenth = 0; for(cnt1 = 0; cnt1 < 10; cnt1++) { railway_lenth += L[cnt1]; } meet_pos = railway_lenth * V1 / (V1 + V2) cnt1 = 0; railway_lenth = 0; while(railway_lenth <= meet_pos) { railway_lenth += L[cnt1]; cnt1++; } output[cnt2] = cnt1; cnt2++; } return 0; }
main.c: In function 'main': main.c:30:50: error: expected ';' before 'cnt1' 30 | meet_pos = railway_lenth * V1 / (V1 + V2) | ^ | ; 31 | 32 | cnt1 = 0; | ~~~~