submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s403659246
p00710
C++
#include <iostream> #include <deque> #include <vector> using namespace std; int main( void ){ vector< int > result; deque< int > card; while( true ){ int n, r; cin >> n >> r; if( n == 0 && r == 0 ) break; for( int i = 1; i < n + 1; i++ ){ card.push_front( i ); } for( int i = 0; i < r; i++ ){ i...
a.cc: In function 'int main()': a.cc:22:47: error: expected primary-expression before '<' token 22 | if( ( *itr ) =< p ){ | ^
s145830751
p00710
C++
#include<cstdio> #include<vector> using namespace std; int solve(int n,int r){ vector<int> m; for(int i=0;i<n;i++){ m.push_back(i); } for(int i=0;i<r;i++){ int p,c; scanf("%d %d",&p,&c); rotate(m.begin(),m.begin()+p-1,m.begin()+p+c-1); } return n-m[0]; } int mai...
a.cc: In function 'int solve(int, int)': a.cc:13:9: error: 'rotate' was not declared in this scope 13 | rotate(m.begin(),m.begin()+p-1,m.begin()+p+c-1); | ^~~~~~
s554404032
p00710
C++
#include<iostream> #include<list> using namespace std; const void ShowList(list<int>); int main() { //ifstream fin("input.txt"); if (!fin)return -1; list<int> stock; while (true) { int number = 0; int shuffleCount = 0; int top = 0; cin >> number >> shuffleCount; if (number == 0 && shuffleCount == ...
a.cc: In function 'int main()': a.cc:11:14: error: 'fin' was not declared in this scope 11 | if (!fin)return -1; | ^~~
s178881667
p00710
C++
#include<iostream> using namespace std; #include<vector> int main() { int N, R, p, c; vector<int>v, buf1, buf2; while (cin >> N >> R&&N) { v.clear(); for (int i = 1; i <= N; i++) v.push_back(i); for (int i = 0; i < R; ++i) { cin >> p >> c; buf1...
a.cc: In function 'int main()': a.cc:31:38: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]' (did you forget the '()' ?) 31 | for (int j = 0; j < buf2.size; j++)...
s677800040
p00710
C++
#include <iostream> #include <vector> using namespace std; int main(int argc, char const* argv[]) { int n, r, p, c; while(true) { cin >> n >> r; if(n == 0 && r == 0) break; std::vector<int> cards(n); for(int i = 0; i < n; ++i) { cards.at(n - i - 1) = i + 1; } for(int i = 0; i < r; ++i) { cin >...
a.cc: In function 'int main(int, const char**)': a.cc:26:30: error: 'copy_n' is not a member of 'std'; did you mean 'copy'? 26 | std::copy_n(cards.begin(), p - 1, std::back_inserter(temp_p)); | ^~~~~~ | copy a.cc:27:30: err...
s489864405
p00710
C++
#include <iostream> #include <vector> using namespace std; int main(int argc, char const* argv[]) { int n, r, p, c; while(true) { cin >> n >> r; if(n == 0 && r == 0) break; std::vector<int> cards(n); for(int i = 0; i < n; ++i) { cards.at(n - i - 1) = i + 1; } for(int i = 0; i < r; ++i) { cin >...
a.cc: In function 'int main(int, const char**)': a.cc:26:30: error: 'copy_n' is not a member of 'std'; did you mean 'copy'? 26 | std::copy_n(cards.begin(), p - 1, std::back_inserter(temp_p)); | ^~~~~~ | copy a.cc:27:30: err...
s592032628
p00710
C++
#include <iostream> using namespace std; void shuffle(int a, int b, int *ans) { int t[a]; a--; for (int i = 0; i < a; i++) { t[i] = ans[i]; } for (int i = a; i < a + b; i++) { ans[i - b] = t[i - e]; } for (int i = b; i < a + b; i++) { ans[i] = t[i - b]; } } int ...
a.cc: In function 'void shuffle(int, int, int*)': a.cc:13:28: error: 'e' was not declared in this scope 13 | ans[i - b] = t[i - e]; | ^
s436398458
p00710
C++
#include <stdio.h> ?? int main() { ?? ????int r,d,n,i,j,k,l; ????int p,c; ????int a[60] = {0}; ????int b[60] = {0}; ?? ?? ????while(1) { ?? ????????scanf("%d %d", &n, &r); ?? ????????if(n == 0 && r == 0) { ????????????break; ????????} ?? ?? ????????for(i =0 ; i<=n ; i++) { ????????????a[n-1-i] = i+1; ????????????b[n-1-...
a.cc:32:7: warning: trigraph ??/ ignored, use -trigraphs to enable [-Wtrigraphs] 32 | ????????//printf("a[%d] = %d\n",j,a[j]); a.cc:36:7: warning: trigraph ??/ ignored, use -trigraphs to enable [-Wtrigraphs] 36 | ????????//printf("a[%d] = %d\n" ,c+j ,a[c+j]); a.cc:2:1: error: expected unqualified-id before '?' to...
s658552191
p00710
C++
#include <iostream> #include <vector> using namespace std; //?±±?????????????????¢??°???????±±???????±±????????°n???p?????????????????????c??? void shuffle(vector<int> &yama, int n, int p, int c); int main(){ int n, r; int p, c; vector<int> yama, v; cin >> n; cin >> r; while(n !=...
/usr/bin/ld: /tmp/ccfkjfu9.o: in function `main': a.cc:(.text+0xcf): undefined reference to `shuffle(std::vector<int, std::allocator<int> >&, int, int, int)' collect2: error: ld returned 1 exit status
s439630939
p00710
C++
#include <iostream> #include <vector> using namespace std; //?±±?????????????????¢??°???????±±???????±±????????°n???p?????????????????????c??? void shuffle(vector<int> &yama, int n, int p, int c); int main(){ int n, r; int p, c; vector<int> yama, v; cin >> n; cin >> r; while(n !=...
/usr/bin/ld: /tmp/cchNkAVh.o: in function `main': a.cc:(.text+0xcf): undefined reference to `shuffle(std::vector<int, std::allocator<int> >&, int, int, int)' collect2: error: ld returned 1 exit status
s143127237
p00710
C++
#include <iostream> #include <vector> using namespace std; //?±±?????????????????¢??°???????±±???????±±????????°n???p?????????????????????c??? void shuffle(vector<int> &yama, int n, int p, int c); int main(){ int n, r; int p, c; vector<int> yama, v; cin >> n; cin >> r; while(n !=...
a.cc: In function 'int main()': a.cc:26:15: error: invalid initialization of non-const reference of type 'std::vector<int>&' from an rvalue of type 'std::vector<int>*' 26 | shuffle(&yama, n, p, c); | ^~~~~ a.cc:6:27: note: in passing argument 1 of 'void shuffle(std::vector<int>&, int, int, ...
s703380375
p00710
C++
Last login: Mon Apr 24 16:33:46 on ttys000 install-no-MacBook-Pro-4:~ g-2019$ cd zemi/ install-no-MacBook-Pro-4:zemi g-2019$ ls #test.rb# 0417 0424 install-no-MacBook-Pro-4:zemi g-2019$ cd 0424 install-no-MacBook-Pro-4:0424 g-2019$ ls #test.cpp# atCoser-iroha.cpp prac1_.cpp~ a.out hanafuda.cpp str.cpp atCoder-B.cp...
a.cc:4:2: error: invalid preprocessing directive #test 4 | #test.rb# 0417 0424 | ^~~~ a.cc:7:2: error: invalid preprocessing directive #test 7 | #test.cpp# atCoser-iroha.cpp prac1_.cpp~ | ^~~~ a.cc:70:60: warning: multi-character character constant [-Wmultichar]...
s051645681
p00710
C++
5 2 3 1 3 1 10 3 1 10 10 1 8 3 0 0
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 5 2 | ^
s844208272
p00710
C++
#include<bits/stdc++.h> using namespace std; int index[51]; int main(){ int n,r; while(cin>>n>>r,n+r){ for(int i=0;i<n;++i) index[i]=n-i; int p,c; for(int k=0;k<r;++k){ cin>>p>>c; int cnt=0; while(cnt!=c){ int tmp=index[p-1+cnt]; for(int j=0;j<p-1;++j) index[p-j+cnt]=index[p-j-1+c...
a.cc:3:13: error: 'int index [51]' redeclared as different kind of entity 3 | int index[51]; | ^ In file included from /usr/include/string.h:462, from /usr/include/c++/14/cstring:43, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121, fro...
s531497168
p00710
C++
#include<bits/stdc++.h> using namespace std; int x[100]; int y[100]; int card [100]; int ans[100]; int n,r,counter; int main (){ counter=0; while(input()){ solve(); } for(int i=0;i<counter;i++){ cout<<ans[i]<<endl; } return 0; } bool input(){ for(int i=0;i<100;i++){ x[i]=0; y[i]=0; } ...
a.cc: In function 'int main()': a.cc:10:11: error: 'input' was not declared in this scope; did you mean 'int'? 10 | while(input()){ | ^~~~~ | int a.cc:11:5: error: 'solve' was not declared in this scope 11 | solve(); | ^~~~~
s938642914
p00710
C++
#include<bits/stdc++.h> using namespace std; int x[100]; int y[100]; int card [100]; int n,r; int ans[1000]; int counter; bool input(){ for(int i=0;i<100;i++){ x[i]=0; y[i]=0; } cin >>n>>r; for(int i=0;i<r;i++){ cin>>x[i]>>y[i]; } if(n==0){ return false; } else{ ret...
a.cc: In function 'int main()': a.cc:53:10: error: expected ';' before 'while' 53 | counter=0 | ^ | ; 54 | while(input()){ | ~~~~~
s099914362
p00710
C++
#include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<climits> #include<iostream> #include<algorithm> #include<stack> #include<queue> #include<vector> #include<list> #include<map> #include<set> using namespace std; int x[100]; int y[100]; int card [100]; int n,r; int ans[1000]; int counter; bool...
a.cc:79:5: error: redefinition of 'int x [100]' 79 | int x[100]; | ^ a.cc:15:5: note: 'int x [100]' previously declared here 15 | int x[100]; | ^ a.cc:80:5: error: redefinition of 'int y [100]' 80 | int y[100]; | ^ a.cc:16:5: note: 'int y [100]' previously declared here 16 | in...
s818955272
p00710
C++
#include <iostream> #include <numeric> #include <vector> using namespace std; int main() { while (true) { int n; int r; cin >> n >> r; if (n == 0 && r == 0) { break; } vector<int> v(static_cast<size_t>(n)); iota(begin(v), end(v), 1); re...
a.cc: In function 'int main()': a.cc:20:9: error: 'reverse' was not declared in this scope 20 | reverse(begin(v), end(v)); | ^~~~~~~ a.cc:26:13: error: 'copy_n' was not declared in this scope 26 | copy_n(begin(v) + (p - 1), c, back_inserter(t)); | ^~~~~~
s714785106
p00710
C++
#include <stdio.h> int main(void){ int n, r, p, c; while(1){ scanf("%d%d", &n, &r); if (n==0 && r==0){ break; } int card[n], temp[n]; for(int i=0;i<n;i++){ card[i] = n-i; } for(i=0;i<r;i++){ scanf("%d%d", &p, &c); //カットの処理 for(i=p-1;i<p+c-1;i++){ te...
a.cc: In function 'int main()': a.cc:14:9: error: 'i' was not declared in this scope 14 | for(i=0;i<r;i++){ | ^
s598336282
p00710
C++
arr=[] ta=[] while true do n, r = gets.split.map(&:to_i) if n == 0 && r == 0 break end arr = (1..n).to_a.reverse r.times do p, c = gets.split.map(&:to_i) p -= 1 ta = arr[p...p+c] + arr[0...p] + arr[p+c..n] arr = ta end puts arr[0] end
a.cc:8:10: error: too many decimal points in number 8 | arr = (1..n).to_a.reverse | ^~~~ a.cc:12:33: error: too many decimal points in number 12 | ta = arr[p...p+c] + arr[0...p] + arr[p+c..n] | ^~~~~ a.cc:1:1: error: 'arr' does not name a type 1 ...
s939840810
p00710
C++
using namespace std; int main(){ int n,r,p,c,a[50]; while(cin >> n >> r,n||r){ for(int i=0;i<n;i++){ a[i] = n-i; } for(int i=0;i<r;i++){ cin >> p >> c; rotate(a,a+p-1,a+p+c-1); } cout << a[0] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:6:11: error: 'cin' was not declared in this scope 6 | while(cin >> n >> r,n||r){ | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace s...
s870857187
p00710
C++
using namespace std; int main(){ int n,r,p,c,a[50]; while(cin >> n >> r,n||r){ for(int i=0;i<n;i++){ a[i] = n-i; } for(int i=0;i<r;i++){ cin >> p >> c; rotate(a,a+p-1,a+p+c-1); } cout << a[0] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:6:11: error: 'cin' was not declared in this scope 6 | while(cin >> n >> r,n||r){ | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace s...
s296572774
p00710
C++
using namespace std; int main(){ int n,r,p,c,a[50]; while(cin >> n >> r,n||r){ for(int i=0;i<n;i++){ a[i] = n-i; } for(int i=0;i<r;i++){ cin >> p >> c; rotate(a,a+p-1,a+p+c-1); } cout << a[0] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:6:11: error: 'cin' was not declared in this scope 6 | while(cin >> n >> r,n||r){ | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace s...
s911641054
p00710
C++
#include <iostream> #include <algorithm> #include <vector> using namespace std; int card[50]; struct CUT{ int p; int c; }; CUT cut[51]; int swap_p[50]; int swap_c[50]; int n,r; void solve(){ for(int i = 0; i < n; i++){ card[i] = n - i; } /* for(int i = 0; i < r ; i++){ for(int x = 0; x < n; x++){ ...
a.cc: In function 'void solve()': a.cc:28:28: error: 'i' was not declared in this scope 28 | for(int j = 0; j < cut[i].p; j++) swap_p[j] = card[j]; | ^ a.cc:29:28: error: 'i' was not declared in this scope 29 | for(int k = 0; k < cut[i].c; k++) swap_c[k] = card[cut[i].p + ...
s816427463
p00710
C++
#include <iostream> #include <algorithm> #include <vector> #define rep(i,n) for(int i = 0; i < n; i++) #define rrep(i,n) for(int i = n - 1; i >= 0; i--) #define REP(i,k,n) for(int i = k; i < n; i++) #define vi vector<int> #define pb push_back using namespace std; int main(){ int n,r; while(cin >> n >> r,n) {...
a.cc: In function 'int main()': a.cc:20:20: error: 'p' was not declared in this scope 20 | cin >> p >> c; | ^ a.cc:20:25: error: 'c' was not declared in this scope 20 | cin >> p >> c; | ^
s853575211
p00710
C++
#include <iostream> using namespace std; int main(){ int n, r; int card[50], shuf[50]; while(cin >> n >> r){ if(!n) break; for(int i=0;i<n;i++) card[i] = n-i; for(int i=0;i<r;i++){ int p, c; cin >> p >> c; int j=0; for(j=0;j<c;j++) shuf[j] = card[p-1+j]; for(j=c;j<c+p-1;j++) shuf[j] = card[j-c]; ...
a.cc: In function 'int main()': a.cc:17:25: error: 'memcpy' was not declared in this scope 17 | memcpy(card,shuf,sizeof(card)); | ^~~~~~ a.cc:2:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #in...
s961391286
p00710
C++
#include <iostream> using namespace std; int main(){ int n, r; int card[50]; while(cin >> n >> r, n){ for(int i=0;i<n;i++) card[i] = n-i; for(int i=0;i<r;i++){ int p, c; cin >> p >> c; rotate(card, card+p-1, card+p+c-1); } cout << card[0] << endl; } }
a.cc: In function 'int main()': a.cc:12:25: error: 'rotate' was not declared in this scope 12 | rotate(card, card+p-1, card+p+c-1); | ^~~~~~
s656921773
p00710
C++
#include<algorithm> #include<iostream> #include<string> #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> using namespace std; struct ml{ int dt; struct ml *nx; }; typedef struct ml Ml; void f(Ml *a,int p,int q){ int i; Ml *b,*c,*d; b=a; for(i=0;i<p-1;i++) b=b->nx; c=b; for(i=0;i<...
a.cc: In function 'int main()': a.cc:46:13: error: 'x' was not declared in this scope 46 | free(a);x | ^
s751194043
p00710
C++
#include <iostream> using namespace std; int n, r, p, c; int cards[50]; int temp[50]; int main() { while( 1 ) { cin >> n >> r; if(n==0 && r==0) break; for(int i=0; i<n; i++) cards[i] = n-i-1; for(int i=0; i<r; i++) { cin >> p >> c; memcpy(&temp[0], &cards[p-1], sizeof(int) * c); memcpy(&temp[...
a.cc: In function 'int main()': a.cc:20:25: error: 'memcpy' was not declared in this scope 20 | memcpy(&temp[0], &cards[p-1], sizeof(int) * c); | ^~~~~~ a.cc:2:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstri...
s029765309
p00710
C++
#include <iostream> #include <vector> using namespace std; int main(void) { int n,r; int p,c; int i1,i2; cin << n << r; vector<int> fuda(n),temp(n); /* syokika */ for(i1=0;i1<n;i1++){ fuda[i1] = i1+1; // cout << fuda[i1] << " "; } /* copy */ for(i1=0;i1<p-1;i1++){ temp[i1] = fuda[i1]; } /...
a.cc: In function 'int main()': a.cc:13:13: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 13 | cin << n << r; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char...
s090545906
p00710
C++
// ・AOJ1142(setの練習問題) // ・AOJ1129(vectorの練習問題) // ・AOJ10032(stackの練習問題) // ・AOJ10027(stringの練習問題) // ・AOJ10021(sort || priority_queueの練習問題) // ・AOJ1064(オーバーロードの練習問題) // ・AOJ0138(mapの練習問題) // ・AOJ0105(mapの練習問題) #include <iostream> #include <cstdio> #include <vector> using namespace std; int main() { int n, r, p, c; ...
a.cc: In function 'int main()': a.cc:38:2: error: expected '}' at end of input 38 | } | ^ a.cc:15:12: note: to match this '{' 15 | int main() { | ^
s868438884
p00710
C++
#include<iostream> #include<string> #include<vector> #include<algorithm> #include<cstdio> using namespace std; int main(){ int maisu[50]; int katto; int swap[50]; int p,c; int i,j=0; int test; for(i=0; i<50; i++){ maisu[i] = i; } cout << maisu[0] << endl; cin >> katto; // while(j <= katto){ ...
a.cc:37:5: error: 'cout' does not name a type 37 | cout << maisu[0] << endl; | ^~~~ a.cc:38:5: error: expected unqualified-id before 'return' 38 | return 0; | ^~~~~~ a.cc:39:1: error: expected declaration before '}' token 39 | } | ^
s559214768
p00710
C++
#include <iostream> using namespace std; int card[50]; int buffer[50]; void main() { int n,r; while(cin>>n>>r,n!=0){ for(int i=0;i<n;i++)card[i]=i+1; for(int i=0;i<r;i++){ int p,c; cin>>p>>c; for(j=0;j<p-1;j++) buffer[j]=card[j]; for(j=0;j<c;j++) card[j]=card[j+p-1]; for(j=0;j<p-1;j++) ...
a.cc:5:1: error: '::main' must return 'int' 5 | void main() | ^~~~ a.cc: In function 'int main()': a.cc:13:29: error: 'j' was not declared in this scope 13 | for(j=0;j<p-1;j++) | ^ a.cc:15:29: error: 'j' was not declared in this scope 15 | ...
s534355986
p00710
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; #define rep(i, j) for(int i = 0; i < j; i++) #define for(i, j, k) for(int i = j; i < k; i++) int main(){ int n, r; while(cin >>n >>r && n){ vector<int> v; for(int i = n; i > 0; i--) v.push_back(i); rep(i, r){ int p, c; ...
a.cc:12:30: error: macro "for" requires 3 arguments, but only 1 given 12 | for(int i = n; i > 0; i--) v.push_back(i); | ^ a.cc:6:9: note: macro "for" defined here 6 | #define for(i, j, k) for(int i = j; i < k; i++) | ^~~ a.cc:14:13: error: macro "for" requires...
s433027485
p00710
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; #define REP(i, j) for(int i = 0; i < j; i++) #define FOR(i, j, k) for(int i = j; i < k; i++) int main(){ int n, r; while(cin >>n >>r && n){ vector<int> v; for(int i = n; i > 0; i--) v.push_back(i); rep(i, r){ int p, c; ...
a.cc: In function 'int main()': a.cc:14:9: error: 'i' was not declared in this scope 14 | rep(i, r){ | ^ a.cc:14:5: error: 'rep' was not declared in this scope 14 | rep(i, r){ | ^~~
s281836032
p00710
C++
#include <iostream> #include <vector> using namespace std; typedef pair<int, int> PII; int main() { int n, r; while (cin >> n >> r, n || r) { vector<PII> shuffles; for (int i = 0; i < r; ++i) { int p, c; cin >> p >> c; shuffles.push_back(make_pair(p, c)); } reverse(shuffles.begin(), shuffles.end());...
a.cc: In function 'int main()': a.cc:16:17: error: 'reverse' was not declared in this scope 16 | reverse(shuffles.begin(), shuffles.end()); | ^~~~~~~
s616691551
p00710
C++
#include <iostream> #include <algorithm> using namespace std; int main() { int N,R,p,c; while (cin>>N>>R&&N) { int A[100]={}; for(int i=0;i<N;i++){ A[i]=i+1; } reverse(A,A+N) for (int i=0; i<R; ++i) { cin >> p >> c ; rotate(A,A+p,A+p+c); } cout << A[0] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:12:23: error: expected ';' before 'for' 12 | reverse(A,A+N) | ^ | ; 13 | for (int i=0; i<R; ++i) { | ~~~ a.cc:13:23: error: 'i' was not declared in this scope 13 | for ...
s618246130
p00710
C++
#include <cstdio> #include <vector> using namespace std; int main(){ int n,r; for(;;){ scanf("%d%d",&n,&r); if(n==0 && r==0) break; int p,c; vector<int> ca(n); for(int i=0;i<n;i++){ ca[i]=n-i; } for(int i=0;i<r;i++){ scanf("%d%d",&...
a.cc: In function 'int main()': a.cc:17:13: error: 'rotate' was not declared in this scope 17 | rotate(begin(ca),begin(ca)+p-1,begin(ca)+p-1+c); | ^~~~~~
s138003354
p00710
C++
#include<iostream> #include<algorithm> #include <vector> #include<array> using namespace std; int N, R, p, c, i, j; int main() { while ( cin >> N >> R && N >0 ) { int A[N] = {}; for ( i = 0; i < N; i++) { A[i] = N - i; } for ( j = 0; j<R; j++) { ...
a.cc: In function 'int main()': a.cc:22:40: error: expected ';' before '}' token 22 | rotate(A,A+(p-1),A+(p+c-1)) | ^ | ; 23 | } | ~
s579495385
p00710
C++
#include<iostream> #include<algorithm> #include <vector> using namespace std; int N, R, p, c, i, j; int A[N] = {}; int main() { while ( cin >> N >> R && N >0 ) { for ( i = 0; i < N; i++) { A[i] = N - i; } for ( j = 0; j<R; j++) { cin >> p >> c; ...
a.cc:8:7: error: size of array 'A' is not an integral constant-expression 8 | int A[N] = {}; | ^ a.cc: In function 'int main()': a.cc:21:40: error: expected ';' before '}' token 21 | rotate(A,A+(p-1),A+(p+c-1)) | ^ | ...
s063022071
p00710
C++
#include<iostream> #include<algorithm> #include <vector> using namespace std; int N, R, p, c, i, j; int A[N] = {}; int main() { while ( cin >> N >> R && N >0 ) { int A[N] = {}; for ( i = 0; i < N; i++) { A[i] = N - i; } for ( j = 0; j<R; j++) { ...
a.cc:8:7: error: size of array 'A' is not an integral constant-expression 8 | int A[N] = {}; | ^ a.cc: In function 'int main()': a.cc:22:40: error: expected ';' before '}' token 22 | rotate(A,A+(p-1),A+(p+c-1)) | ^ | ...
s323640150
p00710
C++
#include<iostream> #include<algorithm> #include <vector> using namespace std; int N, R, p, c, i, j; int main() { while ( cin >> N >> R && N >0 ) { int A[N]; for ( i = 0; i < N; i++) { A[i] = N - i; } for ( j = 0; j<R; j++) { cin >> p >> c; ...
a.cc: In function 'int main()': a.cc:21:40: error: expected ';' before '}' token 21 | rotate(A,A+(p-1),A+(p+c-1)) | ^ | ; 22 | } | ~
s634747065
p00710
C++
#include <algorithm> #include <iostream> #include <vector> using namespace std; int n, r, p, c; vector<int> cards(50); void shuffle(int p, int c) { reverse(cards.begin(), cards.begin() + p); reverse(cards.begin() + p, cards.begin() + p + c); reverse(cards.begin(), cards.begin() + p + c); } int main() { ...
a.cc: In function 'int main()': a.cc:20:9: error: 'iota' was not declared in this scope 20 | iota(cards.rend() - n, cards.rend(), 1); | ^~~~
s643938814
p00710
C++
#include <iostream> #define VARIABLE(x) cerr << #x << "=" << x << endl #define rep(i,n) for(int i=0;i<(int)(n);i++) #define REP(i,m,n) for (int i=m;i<(int)(n);i++) const int INF = 10000000; using namespace std; typedef long long ll; /** Problem1129 : Hanafuda Shuffle **/ int main() { vector<int> card; int n, r, p...
a.cc: In function 'int main()': a.cc:14:9: error: 'vector' was not declared in this scope 14 | vector<int> card; | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include <iostream> +++ |+#include <vector> ...
s456145804
p00710
C++
#include <iostream> #include <stack> using namespace std; int main() { int n,r; while(cin>>n>r){ if(n==0&&r==0)break; stack<int> st1; for(int i=0; i<n; i++){ st1.push(i+1); } for(int rop=0; rop<r; rop++){ int p,c; ci...
a.cc: In function 'int main()': a.cc:9:17: error: no match for 'operator>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int') 9 | while(cin>>n>r){ | ~~~~~~^~ | | | | | int | std::b...
s382580072
p00711
Java
import java.util.Scanner; public class Main { static int w,h; static int[][] tile; public static void main (String[]args) { Scanner in = new Scanner(System.in); while(true) { w = in.nextInt(); h = in.nextInt(); if(w==0) break; tile = new int[w][h]; String s; int x=0,y=0; for(int i=0;...
Main.java:37: error: non-static method canMove(int,int) cannot be referenced from a static context System.out.println(canMove(x,y)); ^ 1 error
s406692779
p00711
Java
package aoj; import java.util.Scanner; /** * AOJ id=1130 * Red and Black * @author scache * */ public class Main1130 { public static void main(String[] args) { Main1130 p = new Main1130(); } public Main1130() { Scanner sc = new Scanner(System.in); while(true){ w = sc.nextInt(); if(w==0) break;...
Main.java:11: error: class Main1130 is public, should be declared in a file named Main1130.java public class Main1130 { ^ 1 error
s369434253
p00711
Java
package com.company; import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; /** * Created by YuyaKita on 2015/05/18. */ public class RedAndBlack { static final int MAX_W = 20, MAX_H = 20; static int W, H; static char[][] tiles = new char[MAX_H + 1][MAX_W + 1]; static in...
Main.java:10: error: class RedAndBlack is public, should be declared in a file named RedAndBlack.java public class RedAndBlack { ^ 1 error
s121667378
p00711
Java
package com.company; import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; /** * Created by YuyaKita on 2015/05/18. */ public class RedAndBlack { static final int MAX_W = 20, MAX_H = 20; static int W, H; static char[][] tiles = new char[MAX_H + 1][MAX_W + 1]; static in...
Main.java:10: error: class RedAndBlack is public, should be declared in a file named RedAndBlack.java public class RedAndBlack { ^ 1 error
s357171577
p00711
Java
package com.company; import java.io.File; import java.util.Scanner; /** * Created by YuyaKita on 2015/05/18. */ public class Main { static final int MAX_W = 20, MAX_H = 20; static int W, H; static char[][] tiles = new char[MAX_H + 1][MAX_W + 1]; static int count = 0; static int[] dx = {-1, 0, 1,...
Main.java:37: error: illegal start of expression static int solve(char[][] input) {javascript:void(0) ^ Main.java:37: error: ';' expected static int solve(char[][] input) {javascript:void(0) ^ 2 errors
s792300389
p00711
Java
import java.util.Scanner; public class DFSKurihara { int H, W; int[] dx = {1, 0, -1, 0}; int[] dy = {0, 1, 0, -1}; void run(){ Scanner sc = new Scanner(System.in); while(true){ W = sc.nextInt(); H = sc.nextInt(); if((H | W) == 0){ break; } sc.nextLine(); char[][] field = new char[H][W]; ...
Main.java:3: error: class DFSKurihara is public, should be declared in a file named DFSKurihara.java public class DFSKurihara { ^ 1 error
s465007071
p00711
Java
#include <iostream> int H, W; int map[20][20]; int c; using namespace std; void printArray(); void check(int, int); int main() { cin >> W >> H; int sy, sx; for (int i = 0; i < H; i++) { string line; cin >> line; for (int j = 0; j < W; j++) { if (line[j] == '@') { sy = i; sx =...
Main.java:1: error: illegal character: '#' #include <iostream> ^ Main.java:1: error: class, interface, enum, or record expected #include <iostream> ^ Main.java:4: error: class, interface, enum, or record expected int map[20][20]; ^ Main.java:5: error: unnamed classes are a preview feature and are disabled by d...
s159242704
p00711
Java
import java.util.NoSuchElementException; import java.util.Scanner; public class RedandBlack { static int c = 0; static int[][] directions = {{0, -1}, {0, 1}, {1, 0}, {-1, 0}}; static int[][] m; public static void spreadFrom(int x, int y) { if (m[y][x] == 0) { m[y][x] = 1; ...
Main.java:4: error: class RedandBlack is public, should be declared in a file named RedandBlack.java public class RedandBlack { ^ 1 error
s111824022
p00711
Java
import java.util.*; public class Main { static int w, h, count, before; static int[][] dir = {{-1,0}, {0,-1}, {1,0}, {0, 1}}; public static void main(String[] args){ Scanner sc = new Scanner(System.in); while(true){ w = sc.nextInt(); h = sc.nextInt(); sc.nextLine(); if(w == 0){ break; } ...
Main.java:72: error: reached end of file while parsing } ^ 1 error
s813875739
p00711
Java
import java.util.*; public class RedAndBlack { static Scanner sc = new Scanner(System.in); static int W, H, res; static char [][]field; static int[]dx = {-1, 0, 1, 0}, dy = {0, 1, 0, -1}; public static void main(String[] args) { while(read()){ search_Start(); System.out.println(res); } } static boolean...
Main.java:2: error: class RedAndBlack is public, should be declared in a file named RedAndBlack.java public class RedAndBlack { ^ 1 error
s612017262
p00711
Java
import java.util.*; public class Main { private static Scanner sc = new Scanner(System.in); public static void main(String...args) { while(sc.hasNext()) { final int W = sc.nextInt(); final int H = sc.nextInt(); if (W == 0 && H == 0) break; solve(W, H); } } private st...
Main.java:16: error: illegal start of expression for(int i = 0; i < H; i+;) ^ Main.java:16: error: not a statement for(int i = 0; i < H; i+;) ^ Main.java:16: error: illegal start of expression for(int i = 0; i < H; i+;) ^ 3 ...
s363104426
p00711
Java
import java.util.*; class Main{ public static void main(String a[]) throws java.io.IOException{ Scanner scan =new Scanner (System.in); Pair pair= new Pair(); Queue<Pair> fifo = new LinkedList<Pair>(); while(true){ int W =scan.nextInt(); int H =scan.nextInt(); ...
Main.java:56: error: reached end of file while parsing } ^ 1 error
s898075879
p00711
Java
import java.util.*; class Main { int dx[]={-1,0,1,0}; int dy[]={0,1,0,-1}; char[][] map; void run() { Scanner sc=new Scanner(System.in); while(true){ int W=sc.nextInt(); int H=sc.nextInt();sc.nextLine(); if(W==0&&H==0)break; int startX=0,startY=0; map=new char[H+2][W...
Main.java:46: error: cannot find symbol new AOJ1130().run(); ^ symbol: class AOJ1130 location: class Main 1 error
s228288041
p00711
Java
import java.util.Scanner; import java.util.Stack; public class Main2 { static int[] v1 = { 0, 1, 0, -1 }; static int[] v2 = { 1, 0, -1, 0 }; static int[][] field; static int count = 0; public static void main(String[] args) { Scanner cin = new Scanner(System.in); while (true) { int w = cin.nextInt(); i...
Main.java:4: error: class Main2 is public, should be declared in a file named Main2.java public class Main2 { ^ 1 error
s792823585
p00711
Java
public class Main { public static void main(String[] args) { search(); } public static void search(){ Queue<Integer> xqueue = new LinkedList<Integer>(); Queue<Integer> yqueue = new LinkedList<Integer>(); int X; int Y; Scanner input = new Scanner(System.in); String[][] grid; int[][] visit; ...
Main.java:8: error: cannot find symbol Queue<Integer> xqueue = new LinkedList<Integer>(); ^ symbol: class Queue location: class Main Main.java:8: error: cannot find symbol Queue<Integer> xqueue = new LinkedList<Integer>(); ^ symbol: class LinkedList location: class Main M...
s229367083
p00711
Java
import java.io.*; import java.util.*; public class p1130 { public static void main(String[] args) { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); try { String line; while(true){ /* input */ line = br.readLine(); int w = Integer.parseInt(line.split(" ")[0]); ...
Main.java:5: error: class p1130 is public, should be declared in a file named p1130.java public class p1130 { ^ 1 error
s751891108
p00711
Java
import java.util.Scanner; /** * Created by Reopard on 2014/05/29. */ public class RedandBlack { static Scanner sc = new Scanner(System.in); static char[][] tile = new char[22][22]; static char black_tile = '.', red_tile = '#', player_tile = '@'; static int W = 0, H = 0; public static void main(...
Main.java:6: error: class RedandBlack is public, should be declared in a file named RedandBlack.java public class RedandBlack { ^ 1 error
s437855714
p00711
Java
import java.util.Scanner; /** * Created by Reopard on 2014/05/29. */ public class RedandBlack { static Scanner sc = new Scanner(System.in); static char[][] tile; static char black_tile = '.', red_tile = '#', player_tile = '@'; static int W = 0, H = 0; public static void main(String args[]) { ...
Main.java:6: error: class RedandBlack is public, should be declared in a file named RedandBlack.java public class RedandBlack { ^ 1 error
s325422954
p00711
C
#include <stdio.h> int que[400][2], top, end; int dir[4][2]={{1,0}{0,1}{0,-1}{-1,0}}; char tile1[22][22], tile2[22][22]; int main(void) { int w, h, i, a1, a2, b1, b2, ans; while(scanf("%d %d ", &w, &h)&&w){ memset(tile1, 0, sizeof(tile1)); for(i=0, a1=0; a1<h; a1++){ scanf("%s...
main.c:4:21: error: expected '}' before '{' token 4 | int dir[4][2]={{1,0}{0,1}{0,-1}{-1,0}}; | ~ ^ main.c: In function 'main': main.c:12:9: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration] 12 | memset(tile1, 0, sizeof(tile1)); | ^~~...
s806324309
p00711
C
#include <stdio.h> int que[400][2], top, end; int dir[4][2]={{1,0}{0,1}{0,-1}{-1,0}}; char tile1[22][22], tile2[22][22]; int main(void) { int w, h, i, a1, a2, b1, b2, ans; while(scanf("%d %d ", &w, &h)&&w){ memset(tile1, 0, sizeof(tile1)); for(i=0, a1=0; a1<h; a1++){ scanf("%s...
main.c:4:21: error: expected '}' before '{' token 4 | int dir[4][2]={{1,0}{0,1}{0,-1}{-1,0}}; | ~ ^ main.c: In function 'main': main.c:12:9: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration] 12 | memset(tile1, 0, sizeof(tile1)); | ^~~...
s315361164
p00711
C
#include <stdio.h> int que[400][2], top, end; int dir[4][2]={{1,0}{0,1}{0,-1}{-1,0}}; char tile1[22][22], tile2[22][22]; int main(void) { int w, h, i, a1, a2, b1, b2, ans; while(scanf("%d %d ", &w, &h)&&w){ memset(tile1, 0, sizeof(tile1)); for(i=0, a1=0; a1<h; a1++){ scanf("%s...
main.c:4:21: error: expected '}' before '{' token 4 | int dir[4][2]={{1,0}{0,1}{0,-1}{-1,0}}; | ~ ^ main.c: In function 'main': main.c:12:9: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration] 12 | memset(tile1, 0, sizeof(tile1)); | ^~~...
s998012730
p00711
C
#include <stdio.h> int que[400][2], top, end; int dir[4][2]={{1,0}{0,1}{0,-1}{-1,0}}; char tile1[22][22], tile2[22][22]; int main(void) { int w, h, i, a1, a2, b1, b2, ans; while(scanf("%d %d ", &w, &h)&&w){ memset(tile1, 0, sizeof(tile1)); for(i=0, a1=0; a1<h; a1++){ scanf("%s...
main.c:4:21: error: expected '}' before '{' token 4 | int dir[4][2]={{1,0}{0,1}{0,-1}{-1,0}}; | ~ ^ main.c: In function 'main': main.c:12:9: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration] 12 | memset(tile1, 0, sizeof(tile1)); | ^~~...
s552958308
p00711
C
#include <stdio.h> int que[400][2], top, end; int dir[4][2]={{1,0}, {0,1}, {0,-1}, {-1,0}}; char tile1[22][22], tile2[22][22]; int main(void) { int w, h, i, a1, a2, b1, b2, ans; while(scanf("%d %d ", &w, &h)&&w){ memset(tile1, 0, sizeof(tile1)); for(i=0, a1=0; a1<h; a1++){ sca...
main.c: In function 'main': main.c:12:9: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration] 12 | memset(tile1, 0, sizeof(tile1)); | ^~~~~~ main.c:2:1: note: include '<string.h>' or provide a declaration of 'memset' 1 | #include <stdio.h> +++ |+#include <str...
s697639635
p00711
C
#include <stdio.h> char s[21][21]; int count, h, w; int dx[] = { 0,0,1,-1 }; int dy[] = { 1,-1,0,0 }; void dfs(int x, int y){ count++; s[y][x] = '#'; int i; for(i = 0; i<4; i++){ int nx = x + dx[i]; int ny = y + dy[i]; if (nx >= 0 && nx < w && ny >= 0 && ny < h && s[ny][nx] == '.') { dfs(nx, ny); } }...
main.c: In function 'main': main.c:25:30: error: 'a' undeclared (first use in this function) 25 | scanf("%s", &a); | ^ main.c:25:30: note: each undeclared identifier is reported only once for each function it appears in
s968125015
p00711
C
#include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <vector> #include <string> #include <algorithm> #include <stack> #include <queue> #include <set> #include <map> #include <functional> #include <utility> using namespace std; #define MOD 1000000007 #define ADD(X,Y) ((X) = ((X) + (Y)%MOD...
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s209321901
p00711
C
#include<stdio.h> #include<stdlib.h> #define MAX 20 // ????????¨?????¨ ?§??????? typedef struct { int row; // ????????? int col; // ????????? } Coord; // ??????????????¨ ?§??????? typedef struct _stack { struct _stack *next; Coord point; } *stack, stackelem; char M[MAX+2][MAX+2];...
main.c: In function 'pop': main.c:128:3: error: expected declaration or statement at end of input 128 | return v; | ^~~~~~
s374504931
p00711
C
#include<stdio.h> #include<stdlib.h> #define MAX 20 // ????????¨?????¨ ?§??????? typedef struct { int row; // ????????? int col; // ????????? } Coord; // ??????????????¨ ?§??????? typedef struct _stack { struct _stack *next; Coord point; } *stack, stackelem; char M[MAX+2][MAX+2];...
main.c: In function 'search_df': main.c:94:10: error: 'c' undeclared (first use in this function) 94 | return c; //??°??????????????¨????????´????????¢?´¢???????????´??????????????????????????? | ^ main.c:94:10: note: each undeclared identifier is reported only once for each function it appears in
s481341284
p00711
C
import java.util.*; public class Main { private static Scanner sc = new Scanner(System.in); public static void main(String...args) { while(sc.hasNext()) { final int W = sc.nextInt(); final int H = sc.nextInt(); if (W == 0 && H == 0) break; solve(W, H); } } private st...
main.c:1:1: error: unknown type name 'import' 1 | import java.util.*; | ^~~~~~ main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 1 | import java.util.*; | ^ main.c:3:1: error: unknown type name 'public' 3 | public class Main { | ^~~~~~ main.c:...
s483224938
p00711
C++
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for(int i = 0;i < (n);i++) #define FOR(i, a, b) for(int i = (a);i < (b);i++) #define all(v) v.begin(),v.end() using int64 = long long; int dx[4] = {-1, 1, 0, 0}; int dy[4] = {0, 0, -1, 1}; int main(void){ int32 H, W; while(cin >> H >> W && H && W){ ...
a.cc: In function 'int main()': a.cc:14:9: error: 'int32' was not declared in this scope 14 | int32 H, W; | ^~~~~ a.cc:15:22: error: 'H' was not declared in this scope 15 | while(cin >> H >> W && H && W){ | ^ a.cc:15:27: error: 'W' was not declared in this ...
s722714574
p00711
C++
'#include <bits/stdc++.h> using namespace std; #define REP(i, n) for(int i = 0;i < (n);i++) #define FOR(i, a, b) for(int i = (a);i < (b);i++) #define all(v) v.begin(),v.end() using int64 = long long; int dx[4] = {-1, 1, 0, 0}; int dy[4] = {0, 0, -1, 1}; int main(void){ int H, W; while(cin >> H >> W && H && W){ ...
a.cc:1:1: warning: missing terminating ' character 1 | '#include <bits/stdc++.h> | ^ a.cc:1:1: error: missing terminating ' character 1 | '#include <bits/stdc++.h> | ^~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:43:2: warning: missing terminating ' character 43 | }' | ^ a.cc:43:2: error: missing terminat...
s423053942
p00711
C++
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for(int i = 0;i < (n);i++) #define FOR(i, a, b) for(int i = (a);i < (b);i++) #define all(v) v.begin(),v.end() using int64 = long long; int dx[4] = {-1, 1, 0, 0}; int dy[4] = {0, 0, -1, 1}; int main(void){ int H, W; while(cin >> H >> W && H && W){ v...
a.cc:43:2: warning: missing terminating ' character 43 | }' | ^ a.cc:43:2: error: missing terminating ' character a.cc: In lambda function: a.cc:36:41: error: use of 'dfs' before deduction of 'auto' 36 | dfs(yy, xx); | ^~...
s241507504
p00711
C++
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for(int i = 0;i < (n);i++) #define FOR(i, a, b) for(int i = (a);i < (b);i++) #define all(v) v.begin(),v.end() using int64 = long long; int dx[4] = {-1, 1, 0, 0}; int dy[4] = {0, 0, -1, 1}; int main(void){ int H, W; while(cin >> H >> W && H && W){ v...
a.cc:44:2: warning: missing terminating ' character 44 | }' | ^ a.cc:44:2: error: missing terminating ' character a.cc: In lambda function: a.cc:37:41: error: use of 'dfs' before deduction of 'auto' 37 | dfs(yy, xx); | ^~...
s767892390
p00711
C++
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for(int i = 0;i < (n);i++) #define FOR(i, a, b) for(int i = (a);i < (b);i++) #define all(v) v.begin(),v.end() using int64 = long long; int dx[4] = {-1, 1, 0, 0}; int dy[4] = {0, 0, -1, 1}; int main(void){ int H, W; while(cin >> H >> W && H && W){ v...
a.cc:43:2: warning: missing terminating ' character 43 | }' | ^ a.cc:43:2: error: missing terminating ' character
s333900659
p00711
C++
#pragma GCC optimize("O3") #include <cstdio> #include <iostream> #include <cstring> #include <cstdlib> #include <algorithm> using namespace std; const int N=25; int a[N*N]; char c[N][N]; int root(int x){ int i=x; while(1){ if(a[x]==x) break; x=a[x]; } int j=x; while(1){ if(a[i]==i) break; x=a[i],a[i]=j,i=...
a.cc: In function 'int main()': a.cc:32:34: error: 'gets' was not declared in this scope; did you mean 'getw'? 32 | for(i=0;i<m;i++) gets(c[i]); | ^~~~ | getw
s521354125
p00711
C++
#include <bits/stdc++.h> using namespace std; #define FOR( i, m, n ) for( int (i) = (m); (i) < (n); (i)++ ) #define REP( i, n ) FOR( i, 0, n ) #define ALL( a ) (a).begin(), (a).end() #define F first #define S second int w, h, cnt = 0; int solve( vector<vector<char>>& f, pair<int, int>...
a.cc: In function 'int solve(std::vector<std::vector<char> >&, std::pair<int, int>&)': a.cc:18:36: error: cannot bind non-const lvalue reference of type 'std::pair<int, int>&' to an rvalue of type 'std::pair<int, int>' 18 | solve( f, make_pair( mp.F - 1, mp.S ) ); | ~~...
s870342738
p00711
C++
#include <bits/stdc++.h> using namespace std; #define FOR( i, m, n ) for( int (i) = (m); (i) < (n); (i)++ ) #define REP( i, n ) FOR( i, 0, n ) #define ALL( a ) (a).begin(), (a).end() #define F first #define S second int w, h, cnt = 0; void solve( vector<vector<char>>& f, pair<int, int...
a.cc: In function 'void solve(std::vector<std::vector<char> >&, std::pair<int, int>&)': a.cc:18:36: error: cannot bind non-const lvalue reference of type 'std::pair<int, int>&' to an rvalue of type 'std::pair<int, int>' 18 | solve( f, make_pair( mp.F - 1, mp.S ) ); | ~...
s803776702
p00711
C++
#include<iostream> #include<string> #include<queue> #include <utility> #include <functional> //#include<> using namespace std; const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1}; //#define int long long; signed main(){ int w, h; while(cin >> w >> h, w){ int cnt{}; vector<string> v(h); for(int i = 0; ...
a.cc: In function 'int main()': a.cc:40:13: error: 'cn' was not declared in this scope; did you mean 'cnt'? 40 | ++cn | ^~ | cnt
s154880945
p00711
C++
#include<iostream> #include<string> #include<queue> #include <utility> #include <functional> //#include<> using namespace std; const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1}; //#define int long long; signed main(){ int w, h; while(cin >> w >> h, w){ int cnt{}; vector<string> v(h); for(int i = 0; ...
a.cc: In function 'int main()': a.cc:40:13: error: 'cn' was not declared in this scope; did you mean 'cnt'? 40 | ++cn | ^~ | cnt
s947460985
p00711
C++
#include <iostream> #include <string> using namespace std; int W, H; string s[20]; int num; int dx[4] = {0, 1, 0, -1}; int dy[4] = {-1, 0, 1, 0}; void dfs(int x, int y){ num++; s[y][x] = '#'; for(int i=0; i<4; i++){ if(0<=x+dx[i] && x+dx[i]<W && 0<=y+dy[i] && y+dy<H && s[y+dy[i]][x+dx[i]]=='.'){ dfs(x...
a.cc: In function 'void dfs(int, int)': a.cc:15:53: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 15 | if(0<=x+dx[i] && x+dx[i]<W && 0<=y+dy[i] && y+dy<H && s[y+dy[i]][x+dx[i]]=='.'){ | ~~~~^~
s246114306
p00711
C++
#include<iostream> #include<queue> #include<string> #include<map> #define F first #define S second using namespace std; char c[33][33]; int w,h; int solve(int x, int y){ typedef pair < int, int > P; queue < P > que; int count = 0; que.push( P(x, y) ); while(!que.empty()){ P q = que.front(); que.pop(...
a.cc: In function 'int main()': a.cc:56:12: error: 'que' was not declared in this scope 56 | while(!que.empty()) que.pop(); | ^~~
s283386918
p00711
C++
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); while (true) { int w = 1; int h = 1; int moveCan = 0; w = scan.nextInt(); h = scan.nextInt(); if (w == 0 && h == 0) break; char[][] table = new char[h][w]; ...
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:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s293062558
p00711
C++
#include <cstdio> #include <string> #include <iostream> using namespace std; const dx[] = {-1, 0, 1, 0}; const dy[] = {0, -1, 0, 1}; char tile[40][40]; int h, w; int search(int nx, int ny) { int sum = 0; if (ny == 0 || nx == 0 || ny == h + 1 || nx == w + 1)return (sum); if (tile[nx][ny] == '.' || tile[nx][ny] == '...
a.cc:6:7: error: 'dx' does not name a type 6 | const dx[] = {-1, 0, 1, 0}; | ^~ a.cc:7:7: error: 'dy' does not name a type 7 | const dy[] = {0, -1, 0, 1}; | ^~ a.cc: In function 'int search(int, int)': a.cc:22:31: error: 'dx' was not declared in this scope; did you mean 'nx'? 22 | ...
s493033436
p00711
C++
#include<iostream> using namespace std; int w,h; char tail[21][21]; int a[]={-1,0,1,0}; int b[]={0,1,0,-1}; int cnt=0; void func(int x,int y); main(){ int sx,sy; while(1){ cin>> w>> h if(w==0&&h==0) break; cnt=0; for(int i=0;i<h;i++){ for(int j=0;j<w;j++){ cin>> tail[i][j]; if(tail[i][j]==...
a.cc:9:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 9 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:12:16: error: expected ';' before 'if' 12 | cin>> w>> h | ^ | ; 13 | if(w==0&&h==0) break; | ~~ ...
s139940406
p00711
C++
#include<iostream> using namespace std; int dfs(int x,int y); int h,w; char ta[22][22]; //int cheak[22][22]={0}; int dx[4]={-1,0,1,0}; int dy[4]={0,-1,0,1}; int cou=0; int main(){ int a,b; while(1){ cin >> w >> h; if(w==0 && h==0) break; cou=0; for(int i=0;i<h;i++){ for(int j=0;j<w;j++)...
a.cc: In function 'int main()': a.cc:22:9: error: 'cheak' was not declared in this scope 22 | cheak[i][j]=0; | ^~~~~ a.cc: At global scope: a.cc:39:6: error: ambiguating new declaration of 'void dfs(int, int)' 39 | void dfs(int x,int y){ | ^~~ a.cc:4:5: note: old declaration 'int ...
s092410316
p00711
C++
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)n; ++i) #define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i) #define rer(i, a, b) for (int i = (int)a; i <= (int)b; ++i) #define each(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i) #define all(v) v.begin(), v.end() #define mset...
a.cc:27:8: error: array size missing in 'field' 27 | string field[]; | ^~~~~ a.cc: In function 'void dfs(int, int)': a.cc:30:36: error: 'w' was not declared in this scope 30 | if (x < 0 || y < 0 || x == w || y == h) return; | ^ a.cc:30:46: error: 'h' w...
s378077082
p00711
C++
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)n; ++i) #define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i) #define rer(i, a, b) for (int i = (int)a; i <= (int)b; ++i) #define each(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i) #define all(v) v.begin(), v.end() #define mset...
a.cc: In function 'void dfs(int, int)': a.cc:30:36: error: 'w' was not declared in this scope 30 | if (x < 0 || y < 0 || x == w || y == h) return; | ^ a.cc:30:46: error: 'h' was not declared in this scope 30 | if (x < 0 || y < 0 || x == w || y == h) return;...
s990265915
p00711
C++
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)n; ++i) #define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i) #define rer(i, a, b) for (int i = (int)a; i <= (int)b; ++i) #define each(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i) #define all(v) v.begin(), v.end() #define mset...
a.cc: In function 'int main()': a.cc:41:34: error: 's' was not declared in this scope 41 | rep(i, H) cin >> s[i]; | ^ a.cc:43:29: error: 's' was not declared in this scope 43 | if (s[i][j] == '@') solve(i, j); | ...
s406964367
p00711
C++
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)n; ++i) #define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i) #define rer(i, a, b) for (int i = (int)a; i <= (int)b; ++i) #define each(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i) #define all(v) v.begin(), v.end() #define mset...
a.cc: In function 'int main()': a.cc:43:29: error: 's' was not declared in this scope 43 | if (s[i][j] == '@') solve(i, j); | ^ a.cc:43:45: error: 'solve' was not declared in this scope 43 | if (s[i][j] == '@') solve(i, j); | ...
s711956124
p00711
C++
#include<iostream> char map[20][20]={0}; int number=1; int h,w; void debug(void) { for(int i=0;i<h;i++) { for(int j=0;j<w;j++) putchar(map[i][j]); putchar('\n'); } } void trace(int x,int y) { if(x-1 >= 0 && map[y][x-1]=='.') { map[y][x-1] = '@'; trace(x-1,y); number++; } if(x+1 < w && map[y][x+1]=='.') {...
a.cc: In function 'int main()': a.cc:53:25: error: 'memcpy' was not declared in this scope 53 | memcpy(&map[i],buf,w); | ^~~~~~ a.cc:2:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<ios...
s362739660
p00711
C++
#include <iostream> #include <queue> #include <utility> #include <array> using namespace std; typedef pair<int, int> pii; int height, width; int sx, sy; int ans = 0; array<int, 4> dx = {0, 0, 1, -1}; array<int, 4> dy = {1, -1, 0, 0}; void bfs() { queue<pii> p; p.push({sx, sy}); while (!p.empty()) ...
a.cc: In function 'void bfs()': a.cc:26:20: error: 'class std::queue<std::pair<int, int> >' has no member named 'first' 26 | int cx = p.first; | ^~~~~ a.cc:27:20: error: 'class std::queue<std::pair<int, int> >' has no member named 'second' 27 | int cy = p.second; | ...
s356449364
p00711
C++
#include<iostream> #include<algorithm> #include<utility> #include<queue> #define loop(i,a,b) for(int i=a;i<b;i++) #define rep(i,a) loop(i,0,a) #define P pair<int, int> using namespace std; char field[20][20]; int W, H,sx,sy,nx,ny; int dx[4] = { 1, 0, -1, 0 }; int dy[4] = { 0, 1, 0, -1 }; int cnt = 1; void bfs(){ qu...
/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
s978634870
p00711
C++
1 #include <bits/stdc++.h> 2 3 using namespace std; 4 5 int w, h, cnt; 6 int vx[] = {0, 1, 0, -1}; 7 int vy[] = {1, 0, -1, 0}; 8 char field[20][20]; 9 10 void solve(int x, int y){ 11 12 ++cnt; 13 field[y][x] = '#'; 14 15 for(int i = 0; i < 4; ++i){ 16 17 int nx = x + vx[i];...
a.cc:1:5: error: stray '#' in program 1 | 1 #include <bits/stdc++.h> | ^ a.cc:1:3: error: expected unqualified-id before numeric constant 1 | 1 #include <bits/stdc++.h> | ^ a.cc:4:3: error: expected unqualified-id before numeric constant 4 | 4 | ^ a.cc:6:3: error: expected un...
s126221540
p00711
C++
#include<iostrem> #include<utility> #include<queue> using namespace std; char room[21][21]; int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1}; typedef pair<int,int> p; int main(){ int x,y; queue<p> que; int w,h; cin>>w>>h; if(w+h==0) return; for(int a=0;a<h;a++){ for(int b=0;b<w;b++){ cin>>room[a][b]; if(room[a][b]...
a.cc:1:9: fatal error: iostrem: No such file or directory 1 | #include<iostrem> | ^~~~~~~~~ compilation terminated.
s015599225
p00711
C++
#include<iostream> #include<utility> #include<queue> using namespace std; char room[21][21]; int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1}; typedef pair<int,int> p; int main(){ int x,y; queue<p> que; int w,h; cin>>w>>h; if(w+h==0) return; for(int a=0;a<h;a++){ for(int b=0;b<w;b++){ cin>>room[a][b]; if(room[a][b...
a.cc: In function 'int main()': a.cc:15:20: error: return-statement with no value, in function returning 'int' [-fpermissive] 15 | if(w+h==0) return; | ^~~~~~ a.cc:31:21: error: invalid use of non-static member function 'void std::queue<_Tp, _Sequence>::pop() [with _Tp = std::pair<in...
s852763388
p00711
C++
#include <iostream> #include <queue> #include <set> using namespace std; const int MAX_SIZE = 20; typedef pair<int, int> P; int calc(char f[][MAX_SIZE], queue<P> q, int W, int H) { set<P> s; while (q.size()) { P p = q.front(); q.pop(); s.insert(p); int di[] = {-1, 1, 0, 0}; int dj[] = {0, 0, -...
a.cc: In function 'int main()': a.cc:43:18: error: cannot convert 'char (*)[21]' to 'char (*)[20]' 43 | cout << calc(f, q, W, H) << endl; | ^ | | | char (*)[21] a.cc:9:15: note: initializing argument 1 of 'int calc(char (*)[20], std::queue<st...