submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s113648110
p03637
C++
#include<iostream> #include<string.h> int main() { int a[100000]; int n; cin >> n >> a; for(i=0;i<=n-1;i++){ if(a[i]*a[i+1]%4!=0){ cout << No << endl; break; if(i==n){ cout << Yes << endl; } } return 0; }
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 >> n >> a; | ^~~ | 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:9:13: error: 'i' was not declared in this scope 9 | for(i=0;i<=n-1;i++){ | ^ a.cc:11:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 11 | cout << 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:11:25: error: 'No' was not declared in this scope 11 | cout << No << endl; | ^~ a.cc:11:31: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 11 | cout << 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) | ^~~~ a.cc:14:33: error: 'Yes' was not declared in this scope 14 | cout << Yes << endl; | ^~~ a.cc:18:2: error: expected '}' at end of input 18 | } | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s775821833
p03637
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { // freopen("input.txt", "r", stdin); //<---------Remove Before Submit int N,a[1000000],ans=1,r,count=0,count1=0; cin>>N; for(int i=0;i<N;i++){ cin>>a[i]; if(a[i]%4==0)count++; ans=ans*a[i]; if(i>0){ if(a[0]*a[i]%4==0)count1++; } } r=ans%4; if(count>0){ if(count>=N-2||count1>count){ cout<<"Yes"<<endl; } else{ cout<<"No"<<endl; } } else{ if(r==0){ cout<<"Yes"<<endl; } else{ cout<<"No"<<endl; } } return 0; } }
a.cc:38:1: error: expected declaration before '}' token 38 | } | ^
s598949091
p03637
C++
#include<iostream> using namespace std; int main(){ int N,a[1000000],ans=1,r,count=0,count1=0; cin>>N; for(int i=0;i<N;i++){ cin>>a[i]; if(a[i]%4==0)count++; ans=ans*a[i]; if(i>0){ if(a[0]*a[i]%4==0)count1++; } } r=ans%4; if(count>0){ if(count=>N-2||count1>count){ cout<<"Yes"<<endl; } else{ cout<<"No"<<endl; } } else{ if(r==0){ cout<<"Yes"<<endl; } else{ cout<<"No"<<endl; } } return 0; }
a.cc: In function 'int main()': a.cc:16:22: error: expected primary-expression before '>' token 16 | if(count=>N-2||count1>count){ | ^
s045745342
p03637
C++
#include<iostream> using namespace std; typedef long long int; int n, cnt[3],flag; int t(int a) { int ans = 0; while (!(a % 2)) { ++ans; a = a / 2; } return ans; } int main() { cin >> n; int a; for (int i = 0; i < n; ++i) { cin >> a; int ans = t(a); if (ans <= 2) { ++cnt[ans]; } else { ++cnt[2]; } } if (!cnt[1]) { cnt[2] = cnt[2] - cnt[0] + 1; if (cnt[2] >= 0) { flag = 1; } } else { cnt[2] = cnt[2] - cnt[0] + 1; cnt[1] = cnt[1] - 2 * cnt[2]; if (cnt[1] <= 0) { flag = 1; } } if(flag) { cout << "Yes" << endl; } else { cout << "No" << endl; } // system("pause"); return 0; }
a.cc:5:19: error: declaration does not declare anything [-fpermissive] 5 | typedef long long int; | ^~~
s274675869
p03637
C++
#include<iostream> using namespace std; int main(){ int N,a[1000000],ans,r,count=0; cin>>N; for(int i=0;i<N;i++){ cin>>a[i]; } for(int j=0;j<N-1;j++){ for(int k=j+1;j<N;k++){ ans=a[j]*a[k]; r=ans%4; if(r==0){ count++; } } if(count==N-1){ cout<<"Yes"<<endl; } else{ cout<<"No"<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:24:6: error: expected '}' at end of input 24 | } | ^ a.cc:3:15: note: to match this '{' 3 | int main(){ | ^
s608306227
p03637
C++
#include<iostream> using namespace std; int main(){ int N,a[1000000],ans,r,count=0; cin>>N; for(int i=0;i<N;i++){ cin>>a[i]; } for(int j=0;j<N-1;j++){ for(int k=j+1;j<N;k++){ ans=a[j]*a[k]; r=ans%4; if(r==0){ count++; } if(count==N-1){ cout<<"Yes"<<endl; } else{ cout<<"No"<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:23:2: error: expected '}' at end of input 23 | } | ^ a.cc:9:23: note: to match this '{' 9 | for(int j=0;j<N-1;j++){ | ^ a.cc:23:2: error: expected '}' at end of input 23 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s216051523
p03637
C++
#include<iostream> using namespace std; int main() { int n; int a[5000]; //z:4で割り切れる   x:他 int z=0,y=0; cin>>n; for(int i=0;i<n;i++) { cin>>a[i]; if(a[i]%4==0) { z++; } else { x++; } } if(y==0) { if(x<=z+1) { cout<<"Yes"<<endl; } else { cout<<"No"<<endl; } } else { if(x<=z) { cout<<"Yes"<<endl; } else { cout<<"No"<<endl; } } }
a.cc: In function 'int main()': a.cc:20:13: error: 'x' was not declared in this scope 20 | x++; | ^ a.cc:26:12: error: 'x' was not declared in this scope 26 | if(x<=z+1) | ^ a.cc:37:12: error: 'x' was not declared in this scope 37 | if(x<=z) | ^
s979150341
p03637
C++
#include <iostream> #include <algorithm> #include <math.h> #include <string> #include <cstdio> #include <vector> #include <set> #include <cassert> #include <cstdlib> #include <complex> #include <cctype> #include <cmath> #include <ctime> #include <deque> #include <queue> #include <stack> #include <map> #include <set> #include <sstream> #include <functional> using namespace std; /**==Info== *Program: *Problem: *Date: *Algorithm: *Stats:*/ int b1,b2,b3; int main(){ int n; for(int i=0;i<n;i++){ int b; cin>>b; if(b%2==1){ b1++; } if(b%2==0 && b%4!=0){ b2++; } if(b%4==0){ b4++; } } if(b2==0){ if(b1<=b4+1){ cout<<"Yes"; }else{ cout<<"No"; } }else{ if(b1<=b4){ cout<<"Yes"; }else{ cout<<"No"; } } return 0; }
a.cc: In function 'int main()': a.cc:42:25: error: 'b4' was not declared in this scope; did you mean 'b'? 42 | b4++; | ^~ | b a.cc:46:24: error: 'b4' was not declared in this scope; did you mean 'b3'? 46 | if(b1<=b4+1){ | ^~ | b3 a.cc:52:24: error: 'b4' was not declared in this scope; did you mean 'b3'? 52 | if(b1<=b4){ | ^~ | b3
s178085949
p03637
C++
#include <iostream> #include <algorithm> #include <math.h> #include <string> #include <cstdio> #include <vector> #include <set> #include <cassert> #include <cstdlib> #include <complex> #include <cctype> #include <cmath> #include <ctime> #include <deque> #include <queue> #include <stack> #include <map> #include <set> #include <sstream> #include <functional> #include <windows.h> //Should be deleted when using AtCoder&POJ using namespace std; /**==Info== *Program: *Problem: *Date: *Algorithm: *Stats:*/ int b1,b2,b3; int main(){ int n; for(int i=0;i<n;i++){ int b; cin>>b; if(b%2==1){ b1++; } if(b%2==0 && b%4!=0){ b2++; } if(b%4==0){ b4++; } } if(b2==0){ if(b1<=b4+1){ cout<<"Yes"; }else{ cout<<"No"; } }else{ if(b1<=b4){ cout<<"Yes"; }else{ cout<<"No"; } } return 0; }
a.cc:21:10: fatal error: windows.h: No such file or directory 21 | #include <windows.h> //Should be deleted when using AtCoder&POJ | ^~~~~~~~~~~ compilation terminated.
s078290492
p03637
C++
#include<iostream> using namespace std; int main(void){ int b1=0,b2=0,b4=0; int N,a; cin>>N; for(int i=0;i<N;i++){ cin>>a; if(a%2==0){ if((a/2)%2==0) b4++; else b2++; } else b1++; } if(b2==0){ if(b1<=b4+1) cout<<"Yes"<<endl; else cout<<"No"<<endl; } else{ if(b1<=b4) cout<<"Yes"<<endl; else cout<<"No"<<endl; } } return 0; }
a.cc:33:1: error: expected unqualified-id before 'return' 33 | return 0; | ^~~~~~ a.cc:34:1: error: expected declaration before '}' token 34 | } | ^
s769047079
p03637
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,two=0,four=0,input; cin >> n; for(int i = 0; i<n; i++){ cin >> input; if(input % 4 = 0){ four++; } else if(input % 2 = 0){ two++; } } if( (four + two/2 ) > n-1){ cout << "Yes" << endl; } else { cout << "No" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:11:14: error: lvalue required as left operand of assignment 11 | if(input % 4 = 0){ | ~~~~~~^~~ a.cc:14:19: error: lvalue required as left operand of assignment 14 | else if(input % 2 = 0){ | ~~~~~~^~~
s210235134
p03637
C++
#include <iostream> #include <cstdio> #include <vector> #include <string> using namespace std; int main(void){ int n, a; cin >> n; vector<int> j(4, 0); for (int i = 0; i < n; i++) { cin >> a; j[a%4]++; } for (int i = 0; i < 4; i++) cout << j[i] << " "; cout << endl; if (j[0] >= j[1]+j[3]) { cout << "Yes" << endl; return 0; } else if (j[0] == j[i]+j[3]-1 && j[2] == 0) { cout << "Yes" << endl; return 0; } else { cout << "No" << endl; return 0; } }
a.cc: In function 'int main()': a.cc:22:24: error: 'i' was not declared in this scope 22 | else if (j[0] == j[i]+j[3]-1 && j[2] == 0) { | ^
s844803861
p03637
C++
#include<iostream> #include<vector> using namespace std; int main(){ int N,gendo,nino=0; long long int num; cin>>N; vector<long long int> a; for(int i=0;i<N;i++){ cin>>num; a.push_back(num); } gendo=N/2; if(N%2!=0){ gendo++; } num=0; /*for(int i=0;i<N;i++){ if(a[i]%2!=0){ num++; if(gendo<num){ break; } } }*/ for(int i=0;i<N;i++){ if(a[i]%4!=0){ if(a[i]%2==0){ nino++; if(nino>=2){ num--; } } num++; if(gendo<num){ break; } } } } if(gendo<num){ cout<<"No"<<endl; }else{ cout<<"Yes"<<endl; } return 0; }
a.cc:47:3: error: expected unqualified-id before 'if' 47 | if(gendo<num){ | ^~ a.cc:49:4: error: expected unqualified-id before 'else' 49 | }else{ | ^~~~ a.cc:53:3: error: expected unqualified-id before 'return' 53 | return 0; | ^~~~~~ a.cc:54:1: error: expected declaration before '}' token 54 | } | ^
s057367420
p03637
C++
#include <stdio.h> int main(){ int n, a; int f = 0, e - 0, o = 0; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%d", &a); if (a % 4 == 0) f++; else if(a % 2 == 0) e++; } if(f*2 + 1 >= n) printf("Yes\n"); else if(f*2 + e >= n) printf("Yes\n"); else printf("No\n"); return 0; }
a.cc: In function 'int main()': a.cc:4:16: error: expected initializer before '-' token 4 | int f = 0, e - 0, o = 0; | ^ a.cc:10:27: error: 'e' was not declared in this scope 10 | else if(a % 2 == 0) e++; | ^ a.cc:14:17: error: 'e' was not declared in this scope 14 | else if(f*2 + e >= n) printf("Yes\n"); | ^
s196950727
p03637
C
#include <cstdio> #include <iostream> #include <algorithm> using namespace std; int n,f; int b[100001]; int main() { scanf("%d",&n); int k=0; int c=0; for(int i=1;i<=n;i++) { scanf("%d",&b[i]); if(b[i]%4==0) k++; if(b[i]%2==0) c++; } int w=c-k; if(((w/2)+k)>=n/2) printf("Yes"); else printf("No"); }
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s348849206
p03637
C
#include <stdio.h> int main(int argc, char *argv[]) { int i, N, kisu = 0, time2 = 0, time4 = 0; scanf("%d", &N); for ( i = 0; i < N; i++ ){ int a; scanf("%d", &a); if ( a%2 == 1 ) kisu++; else if( a%4 == 0 ) time4++; else time2++; } } if ( kisu > time4 + 1 ) printf("No\n"); else if ( kisu == time4 + 1 ) if ( time2 > 0 ) printf("No\n"); else printf("Yes\n"); else printf("Yes\n"); } return 0; }
main.c:19:9: error: expected identifier or '(' before 'if' 19 | if ( kisu > time4 + 1 ) | ^~ main.c:21:9: error: expected identifier or '(' before 'else' 21 | else | ^~~~ main.c:25:25: error: expected identifier or '(' before 'else' 25 | else | ^~~~ main.c:28:17: error: expected identifier or '(' before 'else' 28 | else | ^~~~ main.c:30:9: error: expected identifier or '(' before '}' token 30 | } | ^ main.c:31:9: error: expected identifier or '(' before 'return' 31 | return 0; | ^~~~~~ main.c:32:1: error: expected identifier or '(' before '}' token 32 | } | ^
s410493353
p03637
C++
#include <algorithm> #include <iostream> using namespace std; long long int N,a[100000],b,c,d; int main(){ cin>>N; for(int i=0;i<N;i++){ cin>>a[i]; if(a[i]%2==1){ b++; }else{ if(a[i]%4==0){ c++; }else{ d++; } } } if(d<=1){ if(c>=b+d-1){ cout<<"Yes"<<endl; }else{ cout<<"No"<<endl; } }else{ if(c>=a){ cout<<"Yes"<<endl; }else{ cout<<"No"<<endl; } } }
a.cc: In function 'int main()': a.cc:26:5: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 26 | if(c>=a){ | ~^~~
s456869586
p03637
C++
#include <cstdio> #include <cstring> #include <iostream> using namespace std; const int maxn=100010; int n; int a; int main(){ scanf("%d",&n); int temp1=0,temp2=0; for(int i=0;i<n;i++){ scanf("%d",&a); if(a%2==0) temp1++; if(a%4==0) temp2++; } temp1-=temp2; n=n-temp1+1 if(temp2>=n/2) puts("Yes"); else puts("No"); }
a.cc: In function 'int main()': a.cc:18:15: error: expected ';' before 'if' 18 | n=n-temp1+1 | ^ | ; 19 | if(temp2>=n/2) puts("Yes"); | ~~ a.cc:20:4: error: 'else' without a previous 'if' 20 | else puts("No"); | ^~~~
s271202056
p03637
C++
#include <iostream> #include <math.h> using namespace std; int main(){ long N; long a[N]; int div4 = 0; double div2 = 0; int nodiv = 0; int i = 0; cin >> N; for(i = 0; i < N; i++){ cin >> a[i]; } for(i = 0; i < N; i++){ if((a[i] % 4) == 0){ div4 = div4 + 1; }else if((a[i] % 2) == 0){ div2 = div2 + 1; }else{ nodiv = nodiv + 1; } } if(div2 != 0){ if(fmod(div2) != 0){ nodiv = nodiv + 1; } } if(div4 >= (nodiv - 1)){ cout << "Yes"; }else{ cout << "No"; } return 0; }
a.cc: In function 'int main()': a.cc:25:12: error: no matching function for call to 'fmod(double&)' 25 | if(fmod(div2) != 0){ | ~~~~^~~~~~ In file included from /usr/include/c++/14/math.h:36, from a.cc:2: /usr/include/c++/14/cmath:1065:5: note: candidate: 'template<class _Tp, class _Up> constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type std::fmod(_Tp, _Up)' 1065 | fmod(_Tp __x, _Up __y) | ^~~~ /usr/include/c++/14/cmath:1065:5: note: candidate expects 2 arguments, 1 provided In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683, from /usr/include/c++/14/bits/requires_hosted.h:31, from /usr/include/c++/14/iostream:38, from a.cc:1: /usr/include/x86_64-linux-gnu/bits/mathcalls.h:201:1: note: candidate: 'double fmod(double, double)' 201 | __MATHCALL (fmod,, (_Mdouble_ __x, _Mdouble_ __y)); | ^~~~~~~~~~ /usr/include/x86_64-linux-gnu/bits/mathcalls.h:201:1: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/cmath:280:3: note: candidate: 'constexpr long double std::fmod(long double, long double)' 280 | fmod(long double __x, long double __y) | ^~~~ /usr/include/c++/14/cmath:280:3: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/cmath:276:3: note: candidate: 'constexpr float std::fmod(float, float)' 276 | fmod(float __x, float __y) | ^~~~ /usr/include/c++/14/cmath:276:3: note: candidate expects 2 arguments, 1 provided
s702775114
p03637
C
#include<iostream> #include<algorithm> #include<cstdlib> #include<cstdio> #include<cstring> #include<cmath> #include<string> typedef long long ll; using namespace std; int main() { int i,n,m,k,a; double b; printf("%d",1%2); while(scanf("%d",&n)!=EOF) { for(i=0,m=0,k=0;i<n;i++) { scanf("%d",&a); if(a%4==0) m++; else if(a%2==0) k++; } if(k) n-=k-1; if(m>=n/2) printf("Yes\n"); else printf("No\n"); } return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s917186124
p03637
Java
import java.util.*; import java.lang.*; import java.io.*; import java.math.BigDecimal; public class Main{ public static void main (String[] args) throws java.lang.Exception { InputReader in = new InputReader(System.in); PrintWriter w = new PrintWriter(System.out); int n = in.nextInt(); long[] a = in.nextLongArray(n); int four_mul = 0, tows = 0; for (long x : a) { if (x % 4 == 0) four_mul++; else if (x % 2 == 0) tows++; } int non_mul = n - four_mul - tows ; if (non_mul % 2 == 0 && tows > 0) non_mul; if (four_mul >= (non_mul + 1) / 2) w.println("Yes"); else w.println("No"); w.close(); } static class InputReader { private InputStream stream; private byte[] buf = new byte[1024]; private int curChar; private int numChars; public InputReader(InputStream stream) { this.stream = stream; } public int read() { if (numChars == -1) throw new UnknownError(); if (curChar >= numChars) { curChar = 0; try { numChars = stream.read(buf); } catch (IOException e) { throw new UnknownError(); } if (numChars <= 0) return -1; } return buf[curChar++]; } public int peek() { if (numChars == -1) return -1; if (curChar >= numChars) { curChar = 0; try { numChars = stream.read(buf); } catch (IOException e) { return -1; } if (numChars <= 0) return -1; } return buf[curChar]; } public void skip(int x) { while (x-- > 0) read(); } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } public String nextString() { return next(); } public String next() { int c = read(); while (isSpaceChar(c)) c = read(); StringBuffer res = new StringBuffer(); do { res.appendCodePoint(c); c = read(); } while (!isSpaceChar(c)); return res.toString(); } public String nextLine() { StringBuffer buf = new StringBuffer(); int c = read(); while (c != '\n' && c != -1) { if (c != '\r') buf.appendCodePoint(c); c = read(); } return buf.toString(); } public double nextDouble() { int c = read(); while (isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } double res = 0; while (!isSpaceChar(c) && c != '.') { if (c == 'e' || c == 'E') return res * Math.pow(10, nextInt()); if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } if (c == '.') { c = read(); double m = 1; while (!isSpaceChar(c)) { if (c == 'e' || c == 'E') return res * Math.pow(10, nextInt()); if (c < '0' || c > '9') throw new InputMismatchException(); m /= 10; res += (c - '0') * m; c = read(); } } return res * sgn; } public int[] nextIntArray(int n) { int[] a = new int[n]; for (int i = 0; i < n; i++) a[i] = nextInt(); return a; } public long[] nextLongArray(int n) { long[] a = new long[n]; for (int i = 0; i < n; i++) a[i] = nextLong(); return a; } public boolean hasNext() { int value; while (isSpaceChar(value = peek()) && value != -1) read(); return value != -1; } private boolean isSpaceChar(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } } }
Main.java:22: error: not a statement non_mul; ^ 1 error
s937542638
p03637
C++
#include <iostream> using namespace std; int main() { int n; cin >> n; int oddCnt = 0; int evenCnt = 0; int fourCnt = 0; for(int i = 0; i < n; ++i) { int t; cin >> t; if(t % 4 == 0) { ++fourCnt; } if(t % 2 == 0) { ++evenCnt; } else { ++oddCnt; } } int nhalf = n/2; if(n%2 != 0) { ++nhalf; } string str = "No"; if( (n == 3 && fourCnt >= 1) || (oddCnt <= 2 && fourCnt >= oddCnt && evenCnt >= n - oddCnt) || (foutCnt >= n/2) || (evenCnt == n) ) { str = "Yes"; } cout << str << endl; }
a.cc: In function 'int main()': a.cc:38:10: error: 'foutCnt' was not declared in this scope; did you mean 'fourCnt'? 38 | || (foutCnt >= n/2) | ^~~~~~~ | fourCnt
s237668461
p03637
C++
#include <iostream> #include <vector> using namespace std; int main(){ int N; cin >> N; int mod4 = 0; int modX = 0; vector<unsigned int> A(N); for(int i=0; i<N; i++){ cin >> A[i]; if(A[i] % 4 == 0) mod4++; else if(A[i] % 2 != 0) modX++; } if(mod4 > 0){ if(mod4 >= modX){ cout << "Yes" << endl; } else{ cout << "No" << endl; } }else if(modX = 0 && N % 2==0){ cout << "Yes" << endl; else cout << "No" << endl; return 0; }
a.cc: In function 'int main()': a.cc:27:9: error: expected '}' before 'else' 27 | else | ^~~~ a.cc:25:39: note: to match this '{' 25 | }else if(modX = 0 && N % 2==0){ | ^
s839253867
p03637
C++
#include<stdio.h> #include<string.h> typedef long long ll; const ll maxn=1e5+10; int fn,tn,n; int main(){ while(~scanf("%d",&n)){ fn=tn=odd=0; for(int i=1;i<=n;i++){ ll x; scanf("%lld",&x); if(x&1) odd++; if(x%4==0) fn++; else if(x%2==0) tn++; } if(2*fn+1>=(n-tn/2)||tn==n||fn+tn>=n||fn==1&&odd==1||fn==2&&odd==2) printf("Yes\n"); // if(tn+2*fn+1>=n) else printf("No\n"); } return 0; } /* B char s[110]; int main(){ scanf("%s",s); int len=strlen(s); printf("%c%d%c\n",s[0],len-2,s[len-1]); return 0; } */ /*A int main(){ int a,b; scanf("%d%d",&a,&b); printf("%d\n",(a-1)*(b-1)); return 0; } */
a.cc: In function 'int main()': a.cc:8:23: error: 'odd' was not declared in this scope 8 | fn=tn=odd=0; | ^~~
s846404270
p03637
C++
#include<stdio.h> #include<string.h> typedef long long ll; const ll maxn=1e5+10; int fn,tn,n; int main(){ while(~scanf("%d",&n)){ fn=tn=odd=0; for(int i=1;i<=n;i++){ ll x; scanf("%lld",&x); if(x&1) odd++; if(x%4==0) fn++; else if(x%2==0) tn++; } if(2*fn+1>=(n-tn/2)||tn==n||fn+tn>=n||fn==1&&odd==1||fn==2&&odd==2) printf("Yes\n"); // if(tn+2*fn+1>=n) else printf("No\n"); } return 0; } /* B char s[110]; int main(){ scanf("%s",s); int len=strlen(s); printf("%c%d%c\n",s[0],len-2,s[len-1]); return 0; } */ /*A int main(){ int a,b; scanf("%d%d",&a,&b); printf("%d\n",(a-1)*(b-1)); return 0; } */
a.cc: In function 'int main()': a.cc:8:23: error: 'odd' was not declared in this scope 8 | fn=tn=odd=0; | ^~~
s896697229
p03637
C++
#include<iostream> using namespace std; int main(){ int n; int has2=0,hasno=0,buf; cin>>n; for(int i=0;i<n;i++){ cin>>buf; if(buf%4==0)has4++; if(buf%2==1)hasno++; } if(has4>=hasno)cout<<"Yes"<<endl; else cout<<"No"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:29: error: 'has4' was not declared in this scope; did you mean 'has2'? 9 | if(buf%4==0)has4++; | ^~~~ | has2 a.cc:12:12: error: 'has4' was not declared in this scope; did you mean 'has2'? 12 | if(has4>=hasno)cout<<"Yes"<<endl; | ^~~~ | has2
s463061690
p03637
C++
#include <iostream> #include <string.h> using namespace std; int main() { int n; int a[4]; cin>>n; a[0]=0; a[1]=0; a[2]=0; a[3]=0; long long int k; for(int i=0;i<n;i++){ cin>>k; a[k%4]++; } if(a[2]>0){ if(a[4]-a[1]-a[3]>0){ cout<<"Yes"; } else{ cout<<"No"; } } else{ if(a[4]-a[1]-a[3]>=0){ cout<<"Yes"; } else{ cout<<"No"; } } } }
a.cc:37:1: error: expected declaration before '}' token 37 | } | ^
s554068946
p03637
C++
#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<string> using namespace std; int n[100005]; int main() { int t; while(~scanf("%d",&t)) { memset(n,0,sizeof(n)); int i,j; for(i=0;i<t;i++) cin>>n[i]; for(i=0;i<t;i++) { for(j=i+1;j<t;j++) { __int64 sum=n[i]*n[j]; if(sum%4==0) break; } if(j>=t){printf("No\n");break;} else swap(n[i+1],n[j]); } if(i>=t)printf("Yes\n"); } return 0; }
a.cc: In function 'int main()': a.cc:22:17: error: '__int64' was not declared in this scope; did you mean '__int64_t'? 22 | __int64 sum=n[i]*n[j]; | ^~~~~~~ | __int64_t a.cc:23:20: error: 'sum' was not declared in this scope 23 | if(sum%4==0) break; | ^~~
s461146756
p03637
C++
#include <iostream> using namespace std; int main() { int n,a,two,total; cin >> n; for(int i = 0;i < n;i++){ cin << a; if (a == 2) two++; if (a > 3 && a % 4 == 0) total++; } if (total >= n/2) cout << "Yes"; else if (total + twos/2 >= n/2) cout << "Yes"; else cout << "NO"; return 0; }
a.cc: In function 'int main()': a.cc:8:17: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 8 | cin << a; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:8:17: note: candidate: 'operator<<(int, int)' (built-in) 8 | cin << a; | ~~~~^~~~ a.cc:8:17: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 8 | cin << a; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 8 | cin << a; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:8:13: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 8 | cin << a; | ^~~ In file included from /usr/include/c++/14/bits/ios_base.h:46: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 8 | cin << a; | ^ /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 8 | cin << a; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 8 | cin << a; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 8 | cin << a; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 8 | cin << a; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 8 | cin << a; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 8 | cin << a; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 8 | cin << a; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 8 | cin << a; | ^ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)' 684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 8 | cin << a; | ^ /usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)' 689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 8 | cin << a; | ^ /usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ /usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed: /usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]': a.cc:8:13: required from here 8 | cin << a; | ^ /usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ a.cc:13:26: error: 'twos' was not declared in this scope; did you mean 'two'? 13 | else if (total + twos/2 >= n/2) cout << "Yes"; | ^~~~ | two
s618870697
p03637
C++
#include<algorithm> #include<cstring> #include<cmath> #include<queue> #include<vector> #include<cstdio> #include<iomanip> #include<map> #include<iostream> using namespace std; int main(){ int a[10]={0},b[1001]={0},c[11]={0},n,f,place[100001]={0}; int panda=0; cin>>n; for(int i=1;i<=n;i++){ cin>>f; if(f%2==1){ a[0]++; } else if(f%4==2){ b[0]++; } else { c[0]++; } } for(int i=1;i<=n;i++){ if(place[i-1]==1){ if(c[0]==0){ panda=1;break; } else { c[0]--; place[i]=4; } } else if(place[i-1]==4){ if(a[0]!=0){ a[0]--; place[i]=1; } else if(b[0]!=0){ b[0]--; place[i]=2; } else break; } else { if(i==1){ if(a[0]!=0){ place[1]=1;a[0]--; } else if(b[0]!=0){ place[1]=2;b[0]--; } else break; } else { if(b[0]!=0){ place[i]=2; b[0]--; } else if(c[0]==0){ panda=1;break; } else { place[i]=4;c[0]--; } } } if(place[n]==2&&place[n-1]==1)panda=1; if(n==1&&c[0]==0)panda=1; if(panda==1)cout<<"No"; else cout<<"Yes"; return 0; }
a.cc: In function 'int main()': a.cc:76:2: error: expected '}' at end of input 76 | } | ^ a.cc:11:11: note: to match this '{' 11 | int main(){ | ^
s112119502
p03637
C++
using namespace std; int main(void){ // Here your code ! int num[100000],a=0,b=0,c=0,n=0; cin>>n; for(int i=0;i<n;i++){ cin>>num[i]; } for(int i=0;i<n;i++){ if(num[i]%4==0) a++; else if(num[i]%2==0) b++; else c++; } if(a==c) cout<<"Yes"<<endl; a=a+1; if(a==c) cout<<"Yes"<<endl; else cout<<"No"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:5:5: error: 'cin' was not declared in this scope 5 | cin>>n; | ^~~ 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 std; a.cc:14:14: error: 'cout' was not declared in this scope 14 | if(a==c) cout<<"Yes"<<endl; | ^~~~ a.cc:14:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:14:27: error: 'endl' was not declared in this scope 14 | if(a==c) cout<<"Yes"<<endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | using namespace std; a.cc:16:14: error: 'cout' was not declared in this scope 16 | if(a==c) cout<<"Yes"<<endl; | ^~~~ a.cc:16:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:16:27: error: 'endl' was not declared in this scope 16 | if(a==c) cout<<"Yes"<<endl; | ^~~~ a.cc:16:27: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' a.cc:18:10: error: 'cout' was not declared in this scope 18 | else cout<<"No"<<endl; | ^~~~ a.cc:18:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:18:22: error: 'endl' was not declared in this scope 18 | else cout<<"No"<<endl; | ^~~~ a.cc:18:22: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
s926767175
p03637
C
#include <stdio.h> #include <string.h> #include <algorithm> using namespace std; int main() { int n, a, i, c1=0, c2=0, c4=0; scanf("%d", &n); for(i=0;i<n;i++) { scanf("%d", &a); if(a%2==0) c2++; else if(a%4==0) c4++; else c1++; } if(c2>0 && c4>=c1 || c2==0 && c4>=c1-1) printf("Yes\n"); else printf("No\n"); return 0; }
main.c:3:10: fatal error: algorithm: No such file or directory 3 | #include <algorithm> | ^~~~~~~~~~~ compilation terminated.
s969171262
p03637
C++
#include<stdio.h> #include<iostream> #include<string.h> using namespace std; int main() { int a[100000],n,flag2=0,flag4=0; cin>>n; for(int i=0;i<n;i++) { cin>>a[i]; if(a[i]%4==0)flag4++; else if(a[i]%2==0)flag2++; } if(flag4>(n-flag4))) out<<"Yes"<<endl; else if(flag4>=(n-flag2-flag4)) cout<<"Yes"<<endl; else if(flag4=(n-1)/2) cout<<"Yes"<<endl; else cout<<"No"<<endl; }
a.cc: In function 'int main()': a.cc:15:28: error: expected primary-expression before ')' token 15 | if(flag4>(n-flag4))) | ^
s782946924
p03637
C++
#include <iostream> using namespace std; int main(){ long long int N,a[10000],f=0,t=0,n=0; cin>>N; for(int i=0;i<N;i++)cin>>a[i]; for(int i=0;i<N;i++){ if(a[i]%4==0)f++; else if(a[i]%2==0)t++; else n++; } if(f-n>=0){ if((f-n)%2==0){ if(t%2==0)cout<<"Yes"<<endl; if(t%2==1)cout<<"No"<<endl; if((f-n)%2==1){ if(t%2==0)cout<<"Yes"<<endl; if(t%2==1)cout<<"No"<<endl; } } else cout<<"No"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:25:2: error: expected '}' at end of input 25 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s185890317
p03637
C++
#include <iostream> using namespace std; int main(){ long long int N,a[10000],f=0,t=0,n=0; cin>>N; for(int i=0;i<N;i++)cin>>a[i]; for(int i=0;i<N;i++){ if(a[i]%4==0)f++; else if(t[i]%2==0)t++; else n++; } if(f-n>=0){ if((f-n)%2==0){ if(t%2==0)cout<<"Yes"<<endl; if(t%2==1)cout<<"No"<<endl; if((f-n)%2==1){ if(t%2==0)cout<<"Yes"<<endl; if(t%2==1)cout<<"No"<<endl; } } else cout<<"No"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:26: error: invalid types 'long long int[int]' for array subscript 10 | else if(t[i]%2==0)t++; | ^ a.cc:25:2: error: expected '}' at end of input 25 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s912252451
p03637
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; for(int i = 0; i < n; i++){ cin >> a[i]; if((a[i]*a[i-1]) % 4 != 0){ cout << "No" << endl; break; } } cout << "Yes" << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:12: error: 'a' was not declared in this scope 9 | cin >> a[i]; | ^
s980701676
p03637
C++
#include <iostream> using namespace std; int main(){ long long int N,a[10000],f=0,t=0,n=0; cin>>N; for(int i=0;i<N;i++)cin>>a; for(int i=0;i<N;i++){ if(a[i]%4==0)f++; else if(t[i]%2==0)t++; else n++; } if(f-n>=0){ if((f-n)%2==0){ if(t%2==0)cout<<"Yes"<<endl; if(t%2==1)cout<<"No"<<endl; if((f-n)%2==1){ if(t%2==0)cout<<"Yes"<<endl; if(t%2==1)cout<<"No"<<endl; } } else cout<<"No"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:6:32: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'long long int [10000]') 6 | for(int i=0;i<N;i++)cin>>a; | ~~~^~~ | | | | | long long int [10000] | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed: a.cc:6:34: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'long long int*' 6 | for(int i=0;i<N;i++)cin>>a; | ^ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed: a.cc:6:34: error: invalid conversion from 'long long int*' to 'short int' [-fpermissive] 6 | for(int i=0;i<N;i++)cin>>a; | ^ | | | long long int* a.cc:6:34: error: cannot bind rvalue '(short int)((long long int*)(& a))' to 'short int&' /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed: a.cc:6:34: error: invalid conversion from 'long long int*' to 'short unsigned int' [-fpermissive] 6 | for(int i=0;i<N;i++)cin>>a; | ^ | | | long long int* a.cc:6:34: error: cannot bind rvalue '(short unsigned int)((long long int*)(& a))' to 'short unsigned int&' /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed: a.cc:6:34: error: invalid conversion from 'long long int*' to 'int' [-fpermissive] 6 | for(int i=0;i<N;i++)cin>>a; | ^ | | | long long int* a.cc:6:34: error: cannot bind rvalue '(int)((long long int*)(& a))' to 'int&' /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed: a.cc:6:34: error: invalid conversion from 'long long int*' to 'unsigned int' [-fpermissive] 6 | for(int i=0;i<N;i++)cin>>a; | ^ | | | long long int* a.cc:6:34: error: cannot bind rvalue '(unsigned int)((long long int*)(& a))' to 'unsigned int&' /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed: a.cc:6:34: error: invalid conversion from 'long long int*' to 'long int' [-fpermissive] 6 | for(int i=0;i<N;i++)cin>>a; | ^ | | | long long int* a.cc:6:34: error: cannot bind rvalue '(long int)((long long int*)(& a))' to 'long int&' /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed: a.cc:6:34: error: invalid conversion from 'long long int*' to 'long unsigned int' [-fpermissive] 6 | for(int i=0;i<N;i++)cin>>a; | ^ | | | long long int* a.cc:6:34: error: cannot bind rvalue '(long unsigned int)((long long int*)(& a))' to 'long unsigned int&' /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed: a.cc:6:34: error: invalid conversion from 'long long int*' to 'long long int' [-fpermissive] 6 | for(int i=0;i<N;i++)cin>>a; | ^ | | | long long int* a.cc:6:34: error: cannot bind rvalue '(long long int)((long long int*)(& a))' to 'long long int&' /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed: a.cc:6:34: error: invalid conversion from 'long long int*' to 'long long unsigned int' [-fpermissive] 6 | for(int i=0;i<N;i++)cin>>a; | ^ | | | long long int* a.cc:6:34: error: cannot bind rvalue '(long long unsigned int)((long long int*)(& a))' to 'long long unsigned int&' /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed: a.cc:6:34: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*' 6 | for(int i=0;i<N;i++)cin>>a; | ^ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'long long int [10000]' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'long long int [10000]' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'long long int [10000]' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'long long int [10000]' to 'std::basic_istream<char>::__istre
s621701048
p03637
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; for(int i = 0; i < n; i++){ cin >> a[i]; if((a[i]*a[i-1]) % 4 != 0){ cout << "No" << endl; break; } cout << "Yes" << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:12: error: 'a' was not declared in this scope 9 | cin >> a[i]; | ^ a.cc:16:2: error: expected '}' at end of input 16 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s847891479
p03637
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; for(int i = 0; i < n; i++){ cin >> a[i]; if((a[i]*a[i-1]) % 4 == 0){ cout << "Yes" << endl; break; } cout << "No" << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:12: error: 'a' was not declared in this scope 9 | cin >> a[i]; | ^ a.cc:16:2: error: expected '}' at end of input 16 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s862368631
p03637
C++
#include <bits/stdc++.h> #define ll long long #define mod 1000000007 #define N 100005 using namespace std; int main(){ ll n; cin>>n; ll a[n+3],cnt=0,cnt1=0,cnt2=0; for(int i=0;i<n;i++){ scanf("%lld",&a[i]); if(a[i]%4==0) cnt++; else if(a[i]%2==0){ cnt2++; } if(a[i]%2==1) cnt1++; } if(cnt2%2=1){ cnt1++; } if(cnt+1<cnt1){ cout<<"No\n"; } else{ cout<<"Yes\n"; } }
a.cc: In function 'int main()': a.cc:21:12: error: lvalue required as left operand of assignment 21 | if(cnt2%2=1){ | ~~~~^~
s290979658
p03637
C++
6 2 7 1 8 2 8
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 6 | ^
s839523413
p03637
C++
#include <bits/stdc++.h> using namespace std; const int N=1e5+5; int a[N]; int main() { int n; cin>>n; int cnt4=0,cnt2=0; for(int i=0; i<n; i++) { cin>>a[i]; a[i]%=4; if(a[i]==0) cnt4++; else if(a[i]==2) cnt2++; } int cnt=n-cnt2-cnt4; if(cnt2) { if(cnt4>=cnt) cout<<"Yes"; } else { if(cnt4&&(cnt4+1>=cnt)) cout<<"Yes"; } else cout<<"No"; return 0; }
a.cc: In function 'int main()': a.cc:30:5: error: 'else' without a previous 'if' 30 | else | ^~~~
s313560221
p03637
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; for(int i = 0; i < n; i++){ cin >> a[i]; } for(int i = 0; i < n; i++){ if((a[i]*a[i-1]) % 4 == 0){ cout << "Yes" << endl; }else{ cout << "No" << endl; } } return 0; }
a.cc: In function 'int main()': a.cc:9:12: error: 'a' was not declared in this scope 9 | cin >> a[i]; | ^ a.cc:12:9: error: 'a' was not declared in this scope 12 | if((a[i]*a[i-1]) % 4 == 0){ | ^
s306583372
p03637
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; for(int i = 0; i < n; i++){ cin >> a[i]; } for(int i = 0; i < n; i++){ if((a[i]*a[i-1]) % 4 == 0){ cout << "Yes" << endl; }else{ cout << "No" << endl; } } }
a.cc: In function 'int main()': a.cc:9:12: error: 'a' was not declared in this scope 9 | cin >> a[i]; | ^ a.cc:12:9: error: 'a' was not declared in this scope 12 | if((a[i]*a[i-1]) % 4 == 0){ | ^
s924709209
p03637
C
#include<stdio.h> #include<string.h> #include<stdlib.h> int main(){ int i,n,f=0,d=0; scanf("%d",&n); int a[n]; for(i=0;i<n;i++){ scanf("%d",&a[i]); if(a[i]%2==0){ if(a[i]%4==0) f++; d++; } } if(f==0 && n<=d){ printf("Yes\n"); return 0; } if(f!=0 && (n/f<=3 || n<=d || )){ printf("Yes\n"); return 0; } printf("No\n"); }
main.c: In function 'main': main.c:20:33: error: expected expression before ')' token 20 | if(f!=0 && (n/f<=3 || n<=d || )){ | ^
s614663581
p03637
C++
#include <bits/stdc++.h> using namespace std; const int N=1e5+5; int a[N]; int main() { int n; cin>>n; int cnt4=0,cnt2=0; for(int i=0; i<n; i++) { cin>>a[i]; a[i]%=4; if(a[i]==0) cnt4++; else if(a[i]==2) cnt2++; } int cnt=n-cnt1-cnt; if(cnt2) { if(cnt4>=cnt) cout<<"Yes"; } else { if(cnt4&&cnt4+1>=cnt) cout<<"Yes"; } cout<<"No"; return 0; }
a.cc: In function 'int main()': a.cc:19:15: error: 'cnt1' was not declared in this scope; did you mean 'cnt'? 19 | int cnt=n-cnt1-cnt; | ^~~~ | cnt
s603077691
p03637
C++
void ok() { cout << "Yes" << endl; return; } int main() { int length; cin >> length; int list[length]; for (int i = 0; i < length; i++) { cin >> list[i]; } for (int i = 0; i < length; i++) { for (int j = 0; j < length-1; j++) { cout << list[i] << "," << list[j] << endl; if (i > j) { if (list[i]*list[j] % 4 == 0) { cout << list[i]*list[j] << endl; ok(); return 0; } } else if (i <= j) { if (list[i]*list[j+1] % 4 == 0) { cout << list[i]*list[j+1] << endl; ok(); return 0; } } } } cout << "No" << endl; return 0; }
a.cc: In function 'void ok()': a.cc:2:5: error: 'cout' was not declared in this scope 2 | cout << "Yes" << endl; | ^~~~ a.cc:2:22: error: 'endl' was not declared in this scope 2 | cout << "Yes" << endl; | ^~~~ a.cc: In function 'int main()': a.cc:8:5: error: 'cin' was not declared in this scope 8 | cin >> length; | ^~~ a.cc:15:13: error: 'cout' was not declared in this scope 15 | cout << list[i] << "," << list[j] << endl; | ^~~~ a.cc:15:50: error: 'endl' was not declared in this scope 15 | cout << list[i] << "," << list[j] << endl; | ^~~~ a.cc:31:5: error: 'cout' was not declared in this scope 31 | cout << "No" << endl; | ^~~~ a.cc:31:21: error: 'endl' was not declared in this scope 31 | cout << "No" << endl; | ^~~~
s661946671
p03637
C
#include<stdio.h> int main() { __int64 a[100000],b,c; int n,i; b=c=0; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%I64d",&a[i]); if(a[i]%4==0) b++; else if(a[i]%2!=0) c++; } if(c>b) printf("No\n"); else printf("Yes\n"); }
main.c: In function 'main': main.c:4:9: error: unknown type name '__int64'; did you mean '__int64_t'? 4 | __int64 a[100000],b,c; | ^~~~~~~ | __int64_t
s666887085
p03637
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define _abs(x)((x) < 0 ? (x) * -1 : (x)) #define _max(x, y)(max(0, max((x), (y)))) #define _min(x, y)(max(0, min((x), (y)))) int main() { //freopen("in.txt", "r", stdin); //freopen("out.txt", "w", stdout); //freopen("debug.txt", "w", stderr); cin.tie(0); ios::sync_with_stdio(false); long n; cin >> n; ll a; ll m = 0; ll k = 0; long i; for (i = 0; i < n; i++) { cin >> a; if (a % 4 == 0) m++; if (a == 2) k++; } if (m <= k) m += (k / 2); if (len <= m) cout << "Yes" << endl; else cout << "No" << endl; return 0; }
a.cc: In function 'int main()': a.cc:40:9: error: 'len' was not declared in this scope 40 | if (len <= m) cout << "Yes" << endl; | ^~~
s030755678
p03637
C++
// Example program #include <iostream> #include <string.h> using namespace std; int main() { char a[4]; cin>>n; a[0]=0; a[1]=0; a[2]=0; a[3]=0; long long int k; for(int i=0;i<n;i++){ cin>>k; a[k%4]++; } if(a[0]+a[2]>a[1]+a[3]){ cout<<'Yes'; } else{ cout<<'No'; } }
a.cc:19:10: warning: multi-character character constant [-Wmultichar] 19 | cout<<'Yes'; | ^~~~~ a.cc:23:13: warning: multi-character character constant [-Wmultichar] 23 | cout<<'No'; | ^~~~ a.cc: In function 'int main()': a.cc:8:8: error: 'n' was not declared in this scope 8 | cin>>n; | ^
s830651324
p03637
C++
>()); #define YES cout<<"YES"<< endl #define NO cout<<"NO"<<endl #define Yes cout<<"Yes"<<endl #define No cout<<"No"<<endl #define yes cout<<"yes"<<endl #define no cout<<"no"<<endl #define ret return #define C(i) cin>>i #define C2(i,j) cin>>i>>j #define C3(i,j,k) cin>>i>>j>>k #define C4(i,j,k,m) cin>>i>>j>>k>>m //////////////////////////////////////////////////////////// int main(){ unsigned int n; cin >> n; unsigned int a[n]; long long a1 = 0 , a2 =0, a4 = 0; rep(i,0,n){ cin >> a[i]; if(a[i] %4 == 0 ){ a4++; }else if(a[i] %2 == 0 ){ a2++; }else{ a1++; } } if(a4 - a1 < -1){ No; //P("a"); }else{ if(a2 % 2 == 0){ Yes; //P("b"); } else{ if(a4 - a1 >= 0){ Yes; //P("c"); } else{ No; //P("d"); } } } ret 0; }
a.cc:1:1: error: expected unqualified-id before '>' token 1 | >()); | ^ a.cc: In function 'int main()': a.cc:17:3: error: 'cin' was not declared in this scope 17 | cin >> n; | ^~~ a.cc:22:7: error: 'i' was not declared in this scope 22 | rep(i,0,n){ | ^ a.cc:22:3: error: 'rep' was not declared in this scope; did you mean 'ret'? 22 | rep(i,0,n){ | ^~~ | ret a.cc:5:12: error: 'cout' was not declared in this scope 5 | #define No cout<<"No"<<endl | ^~~~ a.cc:35:5: note: in expansion of macro 'No' 35 | No; | ^~ a.cc:5:24: error: 'endl' was not declared in this scope 5 | #define No cout<<"No"<<endl | ^~~~ a.cc:35:5: note: in expansion of macro 'No' 35 | No; | ^~ a.cc:4:13: error: 'cout' was not declared in this scope 4 | #define Yes cout<<"Yes"<<endl | ^~~~ a.cc:40:7: note: in expansion of macro 'Yes' 40 | Yes; | ^~~ a.cc:4:26: error: 'endl' was not declared in this scope 4 | #define Yes cout<<"Yes"<<endl | ^~~~ a.cc:40:7: note: in expansion of macro 'Yes' 40 | Yes; | ^~~ a.cc:4:13: error: 'cout' was not declared in this scope 4 | #define Yes cout<<"Yes"<<endl | ^~~~ a.cc:45:9: note: in expansion of macro 'Yes' 45 | Yes; | ^~~ a.cc:4:26: error: 'endl' was not declared in this scope 4 | #define Yes cout<<"Yes"<<endl | ^~~~ a.cc:45:9: note: in expansion of macro 'Yes' 45 | Yes; | ^~~ a.cc:5:12: error: 'cout' was not declared in this scope 5 | #define No cout<<"No"<<endl | ^~~~ a.cc:49:9: note: in expansion of macro 'No' 49 | No; | ^~ a.cc:5:24: error: 'endl' was not declared in this scope 5 | #define No cout<<"No"<<endl | ^~~~ a.cc:49:9: note: in expansion of macro 'No' 49 | No; | ^~
s014407269
p03637
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N;cin>>N; int yon=0;int kisuu=0;int ni=0; //vector<int> a(N); for(int i=0;i<N;i++){ int a; cin>>a; if(a%4==0)yon++; else if(a%2==0)ni++; if(a%2==1)kisuu+; } if(N%2==0){ if(yon>=kisuu) cout<<"Yes"<<endl; else cout<<"No"<<endl; }else{ if(yon+1>=kisuu) cout<<"Yes"<<endl; else cout<<"No"<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:12:21: error: expected primary-expression before ';' token 12 | if(a%2==1)kisuu+; | ^
s392415115
p03638
C++
#include<bits/stdc++.h> using namespace std; int main(){ int h,w; cin >> h >> w; int c[h][w]; int n; int a[i]; for(int i=0;i<n;i++)cin >> a[i]; int i; int j; int tmp=0; int color=1; for(i=0;i<h;i++){ if(i%2==0){ for(j=0;j<w;j++){ c[i][j]=color; tmp++; if(tmp==a[color-1]){ color++; tmp=0; } } } else{ for(j=w-1;j>=0;j--){ c[i][j]=color; tmp++; if(tmp==a[color-1]){ color++; tmp=0; } } } } for(i=0;i<h;i++){ for(j=0;j<w;j++)cout << c[i][j]; cout << endl; } }
a.cc: In function 'int main()': a.cc:8:11: error: 'i' was not declared in this scope 8 | int a[i]; | ^ a.cc:9:32: error: 'a' was not declared in this scope 9 | for(int i=0;i<n;i++)cin >> a[i]; | ^ a.cc:17:25: error: 'a' was not declared in this scope 17 | if(tmp==a[color-1]){ | ^ a.cc:27:25: error: 'a' was not declared in this scope 27 | if(tmp==a[color-1]){ | ^
s300447662
p03638
C++
#include <bits/stdc++.h> using namespace std; #define ll long long int //#define f(i,a,n) for(ll i=a;i<n;i++) #define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) ll isPrime(int n) { // Corner cases if (n <= 1) return 1; if (n <= 3) return 2; // This is checked so that we can skip // middle five numbers in below loop if (n % 2 == 0 || n % 3 == 0) return 1; for (int i = 5; i * i <= n; i = i + 6) if (n % i == 0 || n % (i + 2) == 0) return 1; return 2; } ll fact(ll n){ll res = 1;for (ll i = 2; i <= n; i++)res = res * i,res%=1000000007; return res; } int main() { fast; ll t=1; //cin>>t; while(t--) { ll h,w,k=0,d=0,sum=0; cin>>h>>w; ll n; cin>>n; ll A[n]; for(ll i=0;i<n;i++) { cin>>A[i]; sum=sum+A[i]; } ll C[sum]; for(ll i=0;i<n;i++) { for(ll j=0;j<A[i];j++) { C[d]=i+1; //cout<<C[d]<<" "<<endl; d++; } } ll B[h][w]; for(ll i=0;i<h;i++) { for(ll j=0;j<w;j++) { if(i%2==0) { B[i][j]=C[k]; k++; } else { B[i][w-j-1]=C[k]; k++; } } } for(ll i=0;i<h;i++) { for(ll j=0;j<w;j++) { cout<<B[i][j]<<" ; } cout<<endl; } } return 0; }
a.cc:78:31: warning: missing terminating " character 78 | cout<<B[i][j]<<" ; | ^ a.cc:78:31: error: missing terminating " character 78 | cout<<B[i][j]<<" ; | ^~~ a.cc: In function 'int main()': a.cc:79:12: error: expected primary-expression before '}' token 79 | } | ^
s745469808
p03638
C
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; //#define int long long //signed main(){ int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int h,w,n; cin >> h >> w >> n; vector<int> a(n); for(int i = 0; i < n; i++) { cin >> a[i]; } vector<int> c(h*w); int k=0; for(int i = 0; i < n; i++) { for(int j = 0; j < a[i]; j++) { c[k]=(i+1); k++; } } for(int i = 0; i < h; i++) { if(i%2){ for(int j = 0; j < w; j++) { cout << c[i*w+j]; } } else{ for(int j = 0; j < w; j++) { cout << c[i*w+(w-1-j)]; } } cout << "\n"; } return 0; }
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory 1 | #include <bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s380090497
p03638
C++
#include<bits/stdc++.h> using namespace std; #define int long long int #define pb push_back #define mp make_pair #define all(x) x.begin(), x.end() #define tr(it, a) for(auto it = a.begin(); it != a.end(); it++) typedef vector<int> vi; const int mod = 1000000007; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int h,w,n; cin>>h>>w>>n; map <int,int> m; int arr[h][w]; for(int i =0;i <n;i++){ int no; cin>>no; m[i+1] = no;x } int j =0; auto it = m.begin(); for(int i = 0;i < h;i++){ if(i%2==0){ j=0; for(;j <w;j++){ arr[i][j] = it->first; it->second --; if(it->second==0){ it++; } } } else{ j=w-1; for(;j >=0;j--){ arr[i][j] = it->first; it->second --; if(it->second==0){ it++; } } } } for(int i =0;i < h;i++){ for(int j =0;j <w;j++){ cout<<arr[i][j]<<" "; } cout<<endl; } }
a.cc: In function 'int32_t main()': a.cc:26:21: error: 'x' was not declared in this scope 26 | m[i+1] = no;x | ^
s776741181
p03638
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for(ll i = 0; i < (ll)(n); i++) #define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++) #define memi cout << endl #define kono(n) cout << fixed << setprecision(n) #define all(c) (c).begin(), (c).end() #define pb push_back #define hina cout << ' ' #define in(n) cin >> n #define in2(n, m) cin >> n >> m #define in3(n, m, l) cin >> n >> m >> l #define out(n) cout << n const ll mei = (ll)1e9 + 7; int main(){ ll h, w, n, x, y; in3(h, w, n); ll a = 0; vector<ll> c(n); vector<vector<ll>> d(h, vector<ll> (w)); x = y = 0; rep(i, n){ rep(j, c[i]){ a[y][x] = i + 1; if(a == 0 && x == n - 1){ y++; a++; } else if(a == 1 && x == 0){ y++; a--; } else if(a == 0) x++; else x--; } } rep(i, h){ rep(j, w) out(a[i][j]); memi; } }
a.cc: In function 'int main()': a.cc:26:8: error: invalid types 'll {aka long long int}[ll {aka long long int}]' for array subscript 26 | a[y][x] = i + 1; | ^ a.cc:43:12: error: invalid types 'll {aka long long int}[ll {aka long long int}]' for array subscript 43 | out(a[i][j]); | ^ a.cc:14:24: note: in definition of macro 'out' 14 | #define out(n) cout << n | ^
s331604416
p03638
C++
include <iostream> #include <vector> #include <string> #include <unordered_set> #include <unordered_map> #include <sstream> #include <algorithm> #include <cmath> using namespace std; int main() { int H = 0, W = 0; int N = 0; cin >> H >> W; cin >> N; vector<int> vctNum(N); for (auto& elem : vctNum) { cin >> elem; } //vector<stringstream> str(H); vector<vector<int>> table(H, vector<int>(W, 0)); vector<bool> dirPosi(N, true); int numRoomInLine = W; int count = 0; int lineIndex = 0; bool dirPosiFlg = true; for (int k = 0; k < N; ++k) { // color のループ int curNum = vctNum[k]; if (numRoomInLine >= curNum) { // 最初の行内に収まる。 for (int i = 0; i < curNum; ++i) { table[lineIndex][W - numRoomInLine + i] = k + 1; } count += curNum; numRoomInLine -= curNum; if ((count % W) == 0) { dirPosi[lineIndex] = dirPosiFlg; ++lineIndex; dirPosiFlg = !dirPosiFlg; } } else { // 最初の行に収まらない。 for (int i = 0; i < numRoomInLine; ++i) { table[lineIndex][W - numRoomInLine + i] = k + 1; //cout << k + 1; } if (numRoomInLine != 0) { dirPosi[lineIndex] = dirPosiFlg; ++lineIndex; dirPosiFlg = !dirPosiFlg; } count += numRoomInLine; curNum -= numRoomInLine; numRoomInLine = W; int numLines = curNum / W; int numRestCol2 = curNum % W; for (int j = 0; j < numLines; ++j) { for (int i = 0; i < W; ++i) { table[lineIndex][i] = k + 1; //cout << k + 1; } dirPosi[lineIndex] = dirPosiFlg; ++lineIndex; // dirPosiFlg = !dirPosiFlg; } for (int i = 0; i < numRestCol2; ++i) { table[lineIndex][W - numRoomInLine + i] = k + 1; // cout << k + 1; } numRoomInLine = W - numRestCol2; count += curNum; } } for (int i = 0; i < H; ++i) { if (dirPosi[i] ) { for (const auto& elem : table[i]) { cout << " " << elem; } cout << endl; } else { for (auto elem = table[i].rbegin(); elem != table[i].rend(); ++elem) { cout << " " << *elem; } cout << endl; } } return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/vector:62, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 164 | __is_null_pointer(std::nullptr_t) | ^ /usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)' 159 | __is_null_pointer(_Type) | ^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std' 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64: /usr/include/c++/14/type_traits:295:27: error: 'size_t' has not been declared 295 | template <typename _Tp, size_t = sizeof(_Tp)> | ^~~~~~ /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std' 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:984:26: error: 'size_t' has not been declared 984 | template<typename _Tp, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:985:40: error: '_Size' was not declared in this scope 985 | struct __is_array_known_bounds<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:985:46: error: template argument 1 is invalid 985 | struct __is_array_known_bounds<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std' 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std' 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std' 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std' 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1451:32: error: 'size_t' was not declared in this scope 1451 | : public integral_constant<size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:64:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 63 | #include <bits/version.h> +++ |+#include <cstddef> 64 | /usr/include/c++/14/type_traits:1451:41: error: template argument 1 is invalid 1451 | : public integral_constant<size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1451:41: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1453:26: error: 'size_t' has not been declared 1453 | template<typename _Tp, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:1454:23: error: '_Size' was not declared in this scope 1454 | struct extent<_Tp[_Size], 0> | ^~~~~ /usr/include/c++/14/type_traits:1454:32: error: template argument 1 is invalid 1454 | struct extent<_Tp[_Size], 0> | ^ /usr/include/c++/14/type_traits:1455:32: error: 'size_t' was not declared in this scope 1455 | : public integral_constant<size_t, _Size> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1455:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1455:40: error: '_Size' was not declared in this scope 1455 | : public integral_constant<size_t, _Size> { }; | ^~~~~ /usr/include/c++/14/type_traits:1455:45: error: template argument 1 is invalid 1455 | : public integral_constant<size_t, _Size> { }; | ^ /usr/include/c++/14/type_traits:1455:45: error: template argument 2 is invalid /usr/include/c++/14/type_traits:1457:42: error: 'size_t' has not been declared 1457 | template<typename _Tp, unsigned _Uint, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:1458:23: error: '_Size' was not declared in this scope 1458 | struct extent<_Tp[_Size], _Uint> | ^~~~~ /usr/include/c++/14/type_traits:1458:36: error: template argument 1 is invalid 1458 | struct extent<_Tp[_Size], _Uint> | ^ /usr/include/c++/14/type_traits:1463:32: error: 'size_t' was not declared in this scope 1463 | : public integral_constant<size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1463:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1463:41: error: template argument 1 is invalid 1463 | : public integral_constant<size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1463:41: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1857:26: error: 'size_t' does not name a type 1857 | { static constexpr size_t __size = sizeof(_Tp); }; | ^~~~~~ /usr/include/c++/14/type_traits:1857:26: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1859:14: error: 'size_t' has not been declared 1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)> | ^~~~~~ /usr/include/c++/14/type_traits:1859:48: error: '_Sz' was not declared in this scope 1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)> | ^~~ /usr/include/c++/14/type_traits:1860:14: error: no default argument for '_Tp' 1860 | struct __select; | ^~~~~~~~ /usr/include/c++/14/type_traits:1862:14: error: 'size_t' has not been declared 1862 | template<size_t _Sz, typename _Uint, typename... _UInts> | ^~~~~~ /usr/include/c++/14/type_traits:1863:23: error: '_Sz' was not declared in this scope 1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true> | ^~~ /usr/include/c++/14/type_traits:1863:57: error: template argument 1 is invalid 1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true> | ^ /usr/include/c++/14/type_traits:1866:14: error: 'size_t' has not been declared 1866 | template<size_t _Sz, typename _Uint, typename... _UInts> | ^~~~~~ /usr/include/c++/14/type_traits:1867:23: error: '_Sz' was not declared in this scope 1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false> | ^~~ /usr/include/c++/14/type_traits:1867:58: error: template argument 1 is invalid 1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false> |
s398795637
p03638
C++
include <iostream> #include <vector> #include <string> #include <unordered_set> #include <unordered_map> #include <sstream> #include <algorithm> #include <cmath> using namespace std; int main() { int H = 0, W = 0; int N = 0; cin >> H >> W; cin >> N; vector<int> vctNum(N); for (auto& elem : vctNum) { cin >> elem; } //vector<stringstream> str(H); vector<vector<int>> table(H, vector<int>(W, 0)); vector<bool> dirPosi(N, true); int numRoomInLine = W; int count = 0; int lineIndex = 0; bool dirPosiFlg = true; for (int k = 0; k < N; ++k) { // color のループ int curNum = vctNum[k]; if (numRoomInLine >= curNum) { // 最初の行内に収まる。 for (int i = 0; i < curNum; ++i) { table[lineIndex][W - numRoomInLine + i] = k + 1; } count += curNum; numRoomInLine -= curNum; if ((count % W) == 0) { dirPosi[lineIndex] = dirPosiFlg; ++lineIndex; dirPosiFlg = !dirPosiFlg; } } else { // 最初の行に収まらない。 for (int i = 0; i < numRoomInLine; ++i) { table[lineIndex][W - numRoomInLine + i] = k + 1; //cout << k + 1; } if (numRoomInLine != 0) { dirPosi[lineIndex] = dirPosiFlg; ++lineIndex; dirPosiFlg = !dirPosiFlg; } count += numRoomInLine; curNum -= numRoomInLine; numRoomInLine = W; int numLines = curNum / W; int numRestCol2 = curNum % W; for (int j = 0; j < numLines; ++j) { for (int i = 0; i < W; ++i) { table[lineIndex][i] = k + 1; //cout << k + 1; } dirPosi[lineIndex] = dirPosiFlg; ++lineIndex; // dirPosiFlg = !dirPosiFlg; } for (int i = 0; i < numRestCol2; ++i) { table[lineIndex][W - numRoomInLine + i] = k + 1; // cout << k + 1; } numRoomInLine = W - numRestCol2; count += curNum; } } for (int i = 0; i < H; ++i) { if (dirPosi[i] ) { for (const auto& elem : table[i]) { cout << " " << elem; } cout << endl; } else { for (auto elem = table[i].rbegin(); elem != table[i].rend(); ++elem) { cout << " " << *elem; } cout << endl; } } return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/vector:62, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 164 | __is_null_pointer(std::nullptr_t) | ^ /usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)' 159 | __is_null_pointer(_Type) | ^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std' 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64: /usr/include/c++/14/type_traits:295:27: error: 'size_t' has not been declared 295 | template <typename _Tp, size_t = sizeof(_Tp)> | ^~~~~~ /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std' 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:984:26: error: 'size_t' has not been declared 984 | template<typename _Tp, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:985:40: error: '_Size' was not declared in this scope 985 | struct __is_array_known_bounds<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:985:46: error: template argument 1 is invalid 985 | struct __is_array_known_bounds<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std' 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std' 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std' 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std' 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1451:32: error: 'size_t' was not declared in this scope 1451 | : public integral_constant<size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:64:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 63 | #include <bits/version.h> +++ |+#include <cstddef> 64 | /usr/include/c++/14/type_traits:1451:41: error: template argument 1 is invalid 1451 | : public integral_constant<size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1451:41: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1453:26: error: 'size_t' has not been declared 1453 | template<typename _Tp, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:1454:23: error: '_Size' was not declared in this scope 1454 | struct extent<_Tp[_Size], 0> | ^~~~~ /usr/include/c++/14/type_traits:1454:32: error: template argument 1 is invalid 1454 | struct extent<_Tp[_Size], 0> | ^ /usr/include/c++/14/type_traits:1455:32: error: 'size_t' was not declared in this scope 1455 | : public integral_constant<size_t, _Size> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1455:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1455:40: error: '_Size' was not declared in this scope 1455 | : public integral_constant<size_t, _Size> { }; | ^~~~~ /usr/include/c++/14/type_traits:1455:45: error: template argument 1 is invalid 1455 | : public integral_constant<size_t, _Size> { }; | ^ /usr/include/c++/14/type_traits:1455:45: error: template argument 2 is invalid /usr/include/c++/14/type_traits:1457:42: error: 'size_t' has not been declared 1457 | template<typename _Tp, unsigned _Uint, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:1458:23: error: '_Size' was not declared in this scope 1458 | struct extent<_Tp[_Size], _Uint> | ^~~~~ /usr/include/c++/14/type_traits:1458:36: error: template argument 1 is invalid 1458 | struct extent<_Tp[_Size], _Uint> | ^ /usr/include/c++/14/type_traits:1463:32: error: 'size_t' was not declared in this scope 1463 | : public integral_constant<size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1463:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1463:41: error: template argument 1 is invalid 1463 | : public integral_constant<size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1463:41: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1857:26: error: 'size_t' does not name a type 1857 | { static constexpr size_t __size = sizeof(_Tp); }; | ^~~~~~ /usr/include/c++/14/type_traits:1857:26: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1859:14: error: 'size_t' has not been declared 1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)> | ^~~~~~ /usr/include/c++/14/type_traits:1859:48: error: '_Sz' was not declared in this scope 1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)> | ^~~ /usr/include/c++/14/type_traits:1860:14: error: no default argument for '_Tp' 1860 | struct __select; | ^~~~~~~~ /usr/include/c++/14/type_traits:1862:14: error: 'size_t' has not been declared 1862 | template<size_t _Sz, typename _Uint, typename... _UInts> | ^~~~~~ /usr/include/c++/14/type_traits:1863:23: error: '_Sz' was not declared in this scope 1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true> | ^~~ /usr/include/c++/14/type_traits:1863:57: error: template argument 1 is invalid 1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true> | ^ /usr/include/c++/14/type_traits:1866:14: error: 'size_t' has not been declared 1866 | template<size_t _Sz, typename _Uint, typename... _UInts> | ^~~~~~ /usr/include/c++/14/type_traits:1867:23: error: '_Sz' was not declared in this scope 1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false> | ^~~ /usr/include/c++/14/type_traits:1867:58: error: template argument 1 is invalid 1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false> |
s517654807
p03638
C++
#include<bits/stdc++.h> #define int og long using namespace std; signed main() { int n,m,c,a[10000][10000],b[10000]; int y=0,x=0; cin>>n>>m; cin>>c; for(int i=0;i<c;i++) { cin>>b[i]; } int z=0; int d=0; for(int i=0;i<n;i++) { for(int j=0;j<m;j++) { a[z]--; a[i][j]=z+1; if(b[z]==0) { z++; } if(z==c) { break; } } } for(int i=0;i<n;i++) { for(int j=0;j<m;j++) { if(i%2==0) { cout<<a[i][j]<<" "<<endl; } else { cout<<a[i][m-j-1]<<" "<<endl; } } } }
a.cc: In function 'int main()': a.cc:2:13: error: 'og' was not declared in this scope; did you mean 'log'? 2 | #define int og long | ^~ a.cc:6:3: note: in expansion of macro 'int' 6 | int n,m,c,a[10000][10000],b[10000]; | ^~~ a.cc:2:16: error: expected ';' before 'long' 2 | #define int og long | ^~~~ a.cc:7:3: note: in expansion of macro 'int' 7 | int y=0,x=0; | ^~~ a.cc:8:8: error: 'n' was not declared in this scope; did you mean 'yn'? 8 | cin>>n>>m; | ^ | yn a.cc:8:11: error: 'm' was not declared in this scope; did you mean 'tm'? 8 | cin>>n>>m; | ^ | tm a.cc:9:8: error: 'c' was not declared in this scope 9 | cin>>c; | ^ a.cc:2:16: error: expected ';' before 'long' 2 | #define int og long | ^~~~ a.cc:10:7: note: in expansion of macro 'int' 10 | for(int i=0;i<c;i++) | ^~~ a.cc:10:15: error: 'i' was not declared in this scope 10 | for(int i=0;i<c;i++) | ^ a.cc:12:10: error: 'b' was not declared in this scope 12 | cin>>b[i]; | ^ a.cc:2:16: error: expected ';' before 'long' 2 | #define int og long | ^~~~ a.cc:14:3: note: in expansion of macro 'int' 14 | int z=0; | ^~~ a.cc:2:16: error: expected ';' before 'long' 2 | #define int og long | ^~~~ a.cc:15:3: note: in expansion of macro 'int' 15 | int d=0; | ^~~ a.cc:2:16: error: expected ';' before 'long' 2 | #define int og long | ^~~~ a.cc:16:7: note: in expansion of macro 'int' 16 | for(int i=0;i<n;i++) | ^~~ a.cc:16:15: error: 'i' was not declared in this scope 16 | for(int i=0;i<n;i++) | ^ a.cc:2:16: error: expected ';' before 'long' 2 | #define int og long | ^~~~ a.cc:18:9: note: in expansion of macro 'int' 18 | for(int j=0;j<m;j++) | ^~~ a.cc:18:17: error: 'j' was not declared in this scope; did you mean 'jn'? 18 | for(int j=0;j<m;j++) | ^ | jn a.cc:20:7: error: 'a' was not declared in this scope 20 | a[z]--; | ^ a.cc:20:9: error: 'z' was not declared in this scope 20 | a[z]--; | ^ a.cc:22:10: error: 'b' was not declared in this scope 22 | if(b[z]==0) | ^ a.cc:2:16: error: expected ';' before 'long' 2 | #define int og long | ^~~~ a.cc:32:7: note: in expansion of macro 'int' 32 | for(int i=0;i<n;i++) | ^~~ a.cc:32:15: error: 'i' was not declared in this scope 32 | for(int i=0;i<n;i++) | ^ a.cc:2:16: error: expected ';' before 'long' 2 | #define int og long | ^~~~ a.cc:34:9: note: in expansion of macro 'int' 34 | for(int j=0;j<m;j++) | ^~~ a.cc:34:17: error: 'j' was not declared in this scope; did you mean 'jn'? 34 | for(int j=0;j<m;j++) | ^ | jn a.cc:38:13: error: 'a' was not declared in this scope 38 | cout<<a[i][j]<<" "<<endl; | ^ a.cc:42:15: error: 'a' was not declared in this scope 42 | cout<<a[i][m-j-1]<<" "<<endl; | ^
s922886387
p03638
C++
#include<bits/stdc++.h> #define int long long using namespace std; signed main() { int n,m,c,a[10000][10000],b[10000]; int y=0,x=0; cin>>n>>m; cin>>c; for(int i=0;i<c;i++) { cin>>b[i]; } int z=0; int d=0; for(int i=0;i<n;i++) { for(int j=0;j<m;j++) { a[z]--; a[i][j]=z+1; if(b[z]==0) { z++; } if(z==c) { break; } } } for(int i=0;i<n;i++) { for(int j=0;j<m;j++) { if(i%2==0) { cout<<a[i][j]<<" "<<endl; } else { cout<<a[i][m-j-1]<<" "<<endl; } } } }
a.cc: In function 'int main()': a.cc:20:10: error: lvalue required as decrement operand 20 | a[z]--; | ~~~^
s038535483
p03638
C++
#include<bits/stdc++.h> using namespace std; int main() { int n,m,c,a[100][100],b[100]; int y=0,x=0; cin>>n>>m; cin>>c; for(int i=0;i<c;i++) { cin>>b[i]; } int z=0; int d=0; for(int i=0;i<n;i++) { for(int j=0;j<m;j++) { a[z]--; a[i][j]=z+1; if(b[z]==0) { z++; } if(z==c) { break; } } } for(int i=0;i<n;i++) { for(int j=0;j<m;j++) { if(i%2==0) { cout<<a[i][j]<<" "<<endl; } else { cout<<a[i][m-j-1]<<" "<<endl; } } } }
a.cc: In function 'int main()': a.cc:19:10: error: lvalue required as decrement operand 19 | a[z]--; | ~~~^
s225089303
p03638
C++
#include<bits/stdc++.h> using namespace std; int main() { int n,m,c,a[10000][10000],b[10000]; int y=0,x=0; cin>>n>>m; cin>>c; for(int i=0;i<c;i++) { cin>>b[i]; } int z=0; int d=0; for(int i=0;i<n;i++) { for(int j=0;j<m;j++) { a[z]--; a[i][j]=z+1; if(b[z]==0) { z++; } if(z==c) { break; } } } for(int i=0;i<n;i++) { for(int j=0;j<m;j++) { if(i%2==0) { cout<<a[i][j]<<" "<<endl; } else { cout<<a[i][m-j-1]<<" "<<endl; } } } }
a.cc: In function 'int main()': a.cc:19:10: error: lvalue required as decrement operand 19 | a[z]--; | ~~~^
s467227992
p03638
C++
#include<bits/stdc++.h> using namespace std; int main() { int n,m,col, a[1000][1000],b[100004]; int y=0,x=0; cin>>n>>m; cin>>c; for(int i=0;i<c;i++) { cin>>b[i]; } int z=0; int d=0; for(int i=0;i<n;i++) { for(int j=0;j<m;j++) { b[z]--; a[i][j]=z+1; if(b[z]==0) { z++; } if(z==c) { break; } } } for(int i=0;i<n;i++) { for(int j=0;j<m;j++) { if(i%2==0) { cout<<a[i][j]<<" "<<endl; } else { cout<<a[i][m-j-1]<<" "<<endl; } } } }
a.cc: In function 'int main()': a.cc:8:8: error: 'c' was not declared in this scope 8 | cin>>c; | ^
s671617474
p03638
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define INF 1LL<<62 #define inf 1000000007 https://atcoder.jp/contests/abc069/submissions/6395790 写経 ll c[10002]; ll glid[101][101]; int main() { ll h,w,C; cin>>h>>w>>C; for(int i=0;i<C;i++){ cin>>c[i]; } ll k=0; for(int i=0;i<h;i++){ for(int j=0;j<w;j++){ if(c[k]==0){ k++; } c[k]--; glid[i][j]=k+1; } } bool turn=false; for(int i=0;i<h;i++){ if(turn==false){ for(int j=0;j<w;j++){ cout << glid[i][j]<< " "; } } else{ for(int j=w-1;j>=0;j--){ cout << glid[i][j]<<" "; } } cout << endl; if(turn){ turn=false; } else{ turn=true; } } return 0; }
a.cc:7:6: error: found ':' in nested-name-specifier, expected '::' 7 | https://atcoder.jp/contests/abc069/submissions/6395790 写経 | ^ | :: a.cc:7:1: error: 'https' does not name a type 7 | https://atcoder.jp/contests/abc069/submissions/6395790 写経 | ^~~~~ a.cc: In function 'int main()': a.cc:15:22: error: 'c' was not declared in this scope 15 | cin>>c[i]; | ^ a.cc:20:28: error: 'c' was not declared in this scope 20 | if(c[k]==0){ | ^ a.cc:23:25: error: 'c' was not declared in this scope 23 | c[k]--; | ^
s581262260
p03638
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MAXN = 1000100; int H, W; int N; int arr[MAXN]; int res[110][110]; int main() { ios_base::sync_with_stdio(0); cin >> H >> W >> N; for (int i = 0; i < N; i++) cin >> arr[i]; int cloc = 0; for (int i = 0; i < H; i++) for (int j = 0; j < W; j++) { int cj = j; if (i % 2) cj = (W - 1 - j); res[i][c]] = cloc; arr[cloc]--; if (!arr[cloc]) cloc++; } for (int i = 0; i < H; i++) { for (int j =0 ; j < W; j++) cout << res[i][j] << " "; cout << "\n"; } }
a.cc: In function 'int main()': a.cc:26:20: error: 'c' was not declared in this scope; did you mean 'cj'? 26 | res[i][c]] = cloc; | ^ | cj
s882333758
p03638
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int H = Integer.parseInt(sc.next()); int W = Integer.parseInt(sc.next()); int N = Integer.parseInt(sc.next()); int[] a = new int[N]; for (int i=0;i<N;i++) { a[i] = Integer.parseInt(sc.next()); } int[][] grid = new int[H][W]; int index = 0; int i=0; while (i<H*W) { for (int j=0;j<a[index];j++) { grid[i/W][i%W]=index+1; i++; } index++; } for (int i=0;i<H;i++) { StringBuilder sb = new StringBuilder(); for (int j=0;j<W;j++) { sb.append(grid[i][j]); } System.out.println(sb); } } }
Main.java:23: error: variable i is already defined in method main(String[]) for (int i=0;i<H;i++) { ^ 1 error
s702001925
p03638
C++
9:00 UTC+4.5 Contest2 [Cloned] End: 2019-09-02 13:00 UTC+4.5 04:00:00 Ended Overview Problem Status Rank (04:00:00) 0 Comments Previous12345…Next Username Amirack Prob Result Time (ms) Mem (MB) Lang Submit Time Amirack E Wrong Answer C++ 6 days ago Amirack E Language Rejected C++ 6 days ago Amirack B Accepted 6 1.4 C++ 6 days ago Amirack B Wrong Answer C++ 6 days ago Amirack A Accepted 1 0.3 C++ 6 days ago All Copyright Reserved © 2010-2019 Xu Han Server Time: 2019-09-08 18:16:44 UTC+4.5 #21598412 | Amirack's solution for [AtCoder-2687] [Problem B] Status Accepted Time 6ms Memory 1408kB Length 1046 Lang C++14 (GCC 5.3.0) Submitted 2019-09-02 10:16:44 Shared RemoteRunId 7304502 25.0 / 25.0 Select Code #include <bits/stdc++.h> using namespace std; typedef long long ll ; const int maxn=1e2+3,maxxn=1e4+2; vector<pair<int,int> >v[maxn][maxn]; bool mark[maxn][maxn]; int ans[maxn][maxn]; pair<int,int>p[maxxn]; int c; void dfs(int u,int k){ mark[u][k]=1; if(p[c].first<=0)c++; ans[u][k]=p[c].second; p[c].first--; for(int i=0;i<v[u][k].size();i++){ int x1=v[u][k][i].first,y1=v[u][k][i].second; if(!mark[x1][y1])dfs(x1,y1); } } int main() { int h,w,n; cin>>h>>w>>n; for(int i=0;i<n;i++){ int x; cin>>x; p[i]=make_pair(x,i+1); } for(int i=1;i<=h;i++){ for(int j=1;j<=w;j++){ if(j+1<=w)v[i][j].push_back(make_pair(i,j+1)); if(j-1>0)v[i][j].push_back(make_pair(i,j-1)); if(i+1<=h)v[i][j].push_back(make_pair(i+1,j)); if(i-1>0)v[i][j].push_back(make_pair(i-1,j)); } } dfs(1,1); for(int i=1;i<=h;i++){ for(int j=1;j<=w;j++)cout<<ans[i][j]<<" "; cout<<endl; } return 0; }
a.cc:3:11: error: invalid digit "9" in octal constant 3 | End: 2019-09-02 13:00 UTC+4.5 | ^~ a.cc:11:1: error: extended character … is not valid in an identifier 11 | Previous12345…Next | ^ a.cc:49:24: error: extended character © is not valid in an identifier 49 | All Copyright Reserved © 2010-2019 Xu Han | ^ a.cc:50:19: error: invalid digit "9" in octal constant 50 | Server Time: 2019-09-08 18:16:44 UTC+4.5 | ^~ a.cc:50:22: error: invalid digit "8" in octal constant 50 | Server Time: 2019-09-08 18:16:44 UTC+4.5 | ^~ a.cc:52:11: error: "|" is not a valid filename 52 | #21598412 | Amirack's solution for [AtCoder-2687] [Problem B] | ^ a.cc:52:20: warning: missing terminating ' character 52 | #21598412 | Amirack's solution for [AtCoder-2687] [Problem B] | ^ a.cc:62:12: error: too many decimal points in number 62 | C++14 (GCC 5.3.0) | ^~~~~ a.cc:64:6: error: invalid digit "9" in octal constant 64 | 2019-09-02 10:16:44 | ^~ a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 9:00 UTC+4.5 | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:71: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 164 | __is_null_pointer(std::nullptr_t) | ^ /usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)' 159 | __is_null_pointer(_Type) | ^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'? 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/14/cstddef:50, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here 443 | typedef decltype(nullptr) nullptr_t; | ^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64: /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'? 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here 443 | typedef decltype(nullptr) nullptr_t; | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ /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/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /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/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /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/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /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/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared 2086 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope 2087 | struct remove_extent<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid 2087 | struct remove_extent<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared 2099 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope 2100 | struct remove_all_extents<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid 2100 | struct remove_all_extents<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared 2171 | template<std::size_t _Len> | ^~~ /usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope 2176 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^~~~ /usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^ /usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope 2202 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope 2203 | struct __attribute__((__aligned__((_Align)))) { } __align; | ^~~~~~ In file included from /usr/include/c++/14/bits/stl_tempbuf.h:59, from /usr/include/c++/14/bits/stl_algo.h:69, from /usr/include/c++/14/algorithm:61: /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) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:
s558600280
p03638
C++
#include <iostream> #include <vector> #include <cmath> #include <algorithm> #include <iomanip> #include <cstring> #define rep(i, N) for (int i = 0; i < (int)N; i++) using namespace std; typedef long long ll; const ll LLINF = 9223372036854775807; const int MOD = 1000000007; int main() { int H, W; cin >> H >> W; vector<vector<int>> c(H, vector<int>(W)); int N; cin >> N; int pos = 0; for(int i=1; i<=N; i++) { int a; cin >> a; for (int j = pos; j<pos+a; j++) { int pos_h, pos_w; pos_h = j / W; if (pos_h%2==0) pos_w = j%W; else pos_w = (W-1) - j%W; c[pos_h][pos_w] = i; } pos += a; } for(auto x: c) { for(int y=0; y<x.size(); y++) { if (y!=0) cout << " "; cout << r; } cout << endl; } return 0; }
a.cc: In function 'int main()': a.cc:34:15: error: 'r' was not declared in this scope 34 | cout << r; | ^
s770416778
p03638
C++
#include<bits/stdc++.h> using namespace std; #define all(x) (x).begin(),(x).end() typedef long long ll; #define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i) #define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i) template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; } ll gcd(ll a,ll b){return b?gcd(b,a%b):a;} const ll LLINF = 1LL<<60; const int INTINF = 1<<30; const int MOD = 1000000007; void add(long long &a, long long b) { a += b; if (a >= MOD) a -= MOD; } const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; int H, W, N, A[101010]; int ans[1010][1010]; int main(void){ cin.tie(0); ios::sync_with_stdio(false); cin >> H >> W >> N; rep(i,N) cin >> A[i]; int cu = 0; rep(y,H) rep(x,W){ ans[y][x] = cu + 1; A[cu]--; if(!A[cu]) cu++; } rep(y,H){ rep(_x,W){ int x; if(y % 2 == 0) x = _x; else x = W - 1 - _x; if(_x) printf(" "); prinf("%d", ans[y][x]); } printf("\n"); } }
a.cc: In function 'int main()': a.cc:45:9: error: 'prinf' was not declared in this scope; did you mean 'printf'? 45 | prinf("%d", ans[y][x]); | ^~~~~ | printf
s959638288
p03638
Java
import java.util.Scanner; import java.util.stream.Collectors; public class Main { public static void main(String[] args) { Scanner stdin = new Scanner(System.in); int h = stdin.nextInt(); int w = stdin.nextInt(); int n = stdin.nextInt(); int[] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = stdin.nextInt(); } int[] color = new int[h * w]; int k = 0; for (int i = 0; i < n; i++) { for (int j = 0; j < a[i]; j++) { color[k + j] = i + 1; } k += a[i]; } int[][] matrix = new int[h][w]; int x = 0; int y = 0; int d = 1; for (int i = 0; i < h * w; i++) { matrix[x][y] = color[i]; if (d == 1 && y == w - 1) { x += 1; d = -1; } else if (d == -1 && y == 0) { x += 1; d = 1; } else { y += d; } } for (int i = 0; i < h; i++) { String line = Arrays.stream(matrix[i]).mapToObj(Integer::toString).collect(Collectors.joining(" ")); System.out.println(line); } } }
Main.java:42: error: cannot find symbol String line = Arrays.stream(matrix[i]).mapToObj(Integer::toString).collect(Collectors.joining(" ")); ^ symbol: variable Arrays location: class Main 1 error
s146076034
p03638
C++
1 1 1 1
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 1 1 | ^
s184412200
p03638
C++
#include <bits/stdc++.h> using namespace std; int main(){ int h, w, n, i, j, t; int f = 1; map<int, int> mp; int a[101][101]; cin >> h >> w >> n; for( i = 1 ; i <= n ; i = i + 1 ){ cin >> t; mp[i] = t; } for( i = 0 ; i < h ; i = i + 1 ){ for( j = 0 ; j < w ; j = j + 1 ){ if( mp[f] > 0 ){ a[i][j] = f; mp[f] -= 1; } else if( mp[f] == 0 ){ f += 1; a[i][j] = f; mp[f] -= 1; } } } for( i = 0 ; i < h ; i = i + 1 ){ for( j = 0 ; j < w ; j = j + 1 ){ if( i % 2 == 1 ) cout << a[i][w - 1 - j] << " " ; else cout << a[i][j] << " " ; } cout << endl; } return 0;
a.cc: In function 'int main()': a.cc:72:14: error: expected '}' at end of input 72 | return 0; | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s045531445
p03638
C++
#include <iostream> #include <array> #include <vector> #include <iomanip> #include <string> #include <cmath> #include <algorithm> #include <queue> #include <map> #include <set> using namespace std; typedef pair<int,int> P; typedef long long LL; typedef vector<LL> VEC; typedef vector<LL> VVEC; const LL INF=1<<30; const LL MOD=1000000007; LL gcd(LL a,LL b){ if(b==0)return a; return gcd(b,a%b); } LL kaijo(LL n){ LL ans=1; for(LL i=1;i<=n;++i){ (ans*=i)%=MOD; } return ans; } int main(){ int h,w; cin>>h>>w; int n; cin>>n; VEC a(n); VVEC ans(h,VEC(w)); for(int i=1;i<=n;++i){ cin>>a[i]; } //sort(a.begin(),a.end(),greater<LL>()); int k=1; for(int i=0;i<h;i++){ if(i%2==0){ for(int j=0;j<w;++j){ ans[i][j]=k; a[k]--; if(a[k]==0)k++; } }else{ for(int j=w-1;j>=0;--j){ ans[i][j]=k; a[k]--; if(a[k]==0)k++; } } } for(int i=0;i<h;++i){ for(int j=0;j<w;++j){ cout<<ans[i][j]<<" "; } cout<<"\n"; } cout<<endl; }
a.cc: In function 'int main()': a.cc:44:22: error: no matching function for call to 'std::vector<long long int>::vector(int&, VEC)' 44 | VVEC ans(h,VEC(w)); | ^ In file included from /usr/include/c++/14/vector:66, from a.cc:3: /usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate: 'template<class _InputIterator, class> std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) [with <template-parameter-2-2> = _InputIterator; _Tp = long long int; _Alloc = std::allocator<long long int>]' 707 | vector(_InputIterator __first, _InputIterator __last, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:707:9: note: template argument deduction/substitution failed: a.cc:44:22: note: deduced conflicting types for parameter '_InputIterator' ('int' and 'std::vector<long long int>') 44 | VVEC ans(h,VEC(w)); | ^ /usr/include/c++/14/bits/stl_vector.h:678:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = long long int; _Alloc = std::allocator<long long int>; allocator_type = std::allocator<long long int>]' 678 | vector(initializer_list<value_type> __l, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:678:43: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<long long int>' 678 | vector(initializer_list<value_type> __l, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, std::__type_identity_t<_Alloc>&) [with _Tp = long long int; _Alloc = std::allocator<long long int>; std::__type_identity_t<_Alloc> = std::allocator<long long int>]' 659 | vector(vector&& __rv, const __type_identity_t<allocator_type>& __m) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:659:23: note: no known conversion for argument 1 from 'int' to 'std::vector<long long int>&&' 659 | vector(vector&& __rv, const __type_identity_t<allocator_type>& __m) | ~~~~~~~~~^~~~ /usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&, std::false_type) [with _Tp = long long int; _Alloc = std::allocator<long long int>; allocator_type = std::allocator<long long int>; std::false_type = std::false_type]' 640 | vector(vector&& __rv, const allocator_type& __m, false_type) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&, std::true_type) [with _Tp = long long int; _Alloc = std::allocator<long long int>; allocator_type = std::allocator<long long int>; std::true_type = std::true_type]' 635 | vector(vector&& __rv, const allocator_type& __m, true_type) noexcept | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&, std::__type_identity_t<_Alloc>&) [with _Tp = long long int; _Alloc = std::allocator<long long int>; std::__type_identity_t<_Alloc> = std::allocator<long long int>]' 624 | vector(const vector& __x, const __type_identity_t<allocator_type>& __a) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:624:28: note: no known conversion for argument 1 from 'int' to 'const std::vector<long long int>&' 624 | vector(const vector& __x, const __type_identity_t<allocator_type>& __a) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&) [with _Tp = long long int; _Alloc = std::allocator<long long int>]' 620 | vector(vector&&) noexcept = default; | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = long long int; _Alloc = std::allocator<long long int>]' 601 | vector(const vector& __x) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const value_type&, const allocator_type&) [with _Tp = long long int; _Alloc = std::allocator<long long int>; size_type = long unsigned int; value_type = long long int; allocator_type = std::allocator<long long int>]' 569 | vector(size_type __n, const value_type& __value, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:569:47: note: no known conversion for argument 2 from 'VEC' {aka 'std::vector<long long int>'} to 'const std::vector<long long int>::value_type&' {aka 'const long long int&'} 569 | vector(size_type __n, const value_type& __value, | ~~~~~~~~~~~~~~~~~~^~~~~~~ /usr/include/c++/14/bits/stl_vector.h:556:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const allocator_type&) [with _Tp = long long int; _Alloc = std::allocator<long long int>; size_type = long unsigned int; allocator_type = std::allocator<long long int>]' 556 | vector(size_type __n, const allocator_type& __a = allocator_type()) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:556:51: note: no known conversion for argument 2 from 'VEC' {aka 'std::vector<long long int>'} to 'const std::vector<long long int>::allocator_type&' {aka 'const std::allocator<long long int>&'} 556 | vector(size_type __n, const allocator_type& __a = allocator_type()) | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const allocator_type&) [with _Tp = long long int; _Alloc = std::allocator<long long int>; allocator_type = std::allocator<long long int>]' 542 | vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector() [with _Tp = long long int; _Alloc = std::allocator<long long int>]' 531 | vector() = default; | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate expects 0 arguments, 2 provided a.cc:54:23: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type {aka long long int}[int]' for array subscript 54 | ans[i][j]=k; | ^ a.cc:61:23: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type {aka long long int}[int]' for array subscript 61 | ans[i][j]=k; | ^ a.cc:70:25: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type {aka long long int}[int]' for array subscript 70 | cout<<ans[i][j]<<" "; | ^
s459408014
p03638
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define MM 1000000000 #define MOD MM+7 #define MAX 10000 #define MAP 100 #define Pair pair<int,int> int dx[4] = {-1, 0, 1, 0}; int dy[4] = {0, -1, 0, 1}; int main(){ int H,W; cin >> H >> W; int N; cin >> N; int a[N]; for(int i = 0; i < N; i++) cin >> a[i]; int masu[H][W]; for(int i = 0; i < H; i++){ for(int j = 0; j < W; j++){ masu[i][j] = 0; } } int pointer = 0; for(int i = 0; i < H; i++){ int ans[W]; if(i%2 == 0){ for(int j = 0; j < W; j++){ ans[j] = pointer + 1; a[pointer]--; if(a[pointer] == 0) pointer++; } } else { for(int j = w-1; j >= 0; j--){ ans[j] = pointer+1; a[pointer]--; if(a[pointer] == 0) pointer++; } } for(int j = 0; j < w-1; j++) cout << ans[j] << " "; cout << ans[W-1] << endl; } }
a.cc: In function 'int main()': a.cc:34:25: error: 'w' was not declared in this scope 34 | for(int j = w-1; j >= 0; j--){ | ^ a.cc:40:28: error: 'w' was not declared in this scope 40 | for(int j = 0; j < w-1; j++) cout << ans[j] << " "; | ^
s872344856
p03638
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define MM 1000000000 #define MOD MM+7 #define MAX 10000 #define MAP 100 #define Pair pair<int,int> int dx[4] = {-1, 0, 1, 0}; int dy[4] = {0, -1, 0, 1}; int main(){ int H,W; cin >> H >> W; int N; cin >> N; int a[N]; for(int i = 0; i < N; i++) cin >> a[i]; int masu[H][W]; for(int i = 0; i < H; i++){ for(int j = 0; j < W; j++){ masu[i][j] = 0; } } int pointer = 0; for(int i = 0; i < H; i++){ int ans[w]; if(i%2 == 0){ for(int j = 0; j < W; j++){ ans[j] = pointer + 1; a[pointer]--; if(a[pointer] == 0) pointer++; } } else { for(int j = w-1; j >= 0; j--){ ans[j] = pointer+1; a[pointer]--; if(a[pointer] == 0) pointer++; } } for(int j = 0; j < w-1; j++) cout << ans[j] << " "; cout << ans[w-1] << endl; } }
a.cc: In function 'int main()': a.cc:26:17: error: 'w' was not declared in this scope 26 | int ans[w]; | ^ a.cc:29:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 29 | ans[j] = pointer + 1; | ^~~ | abs a.cc:35:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 35 | ans[j] = pointer+1; | ^~~ | abs a.cc:40:46: error: 'ans' was not declared in this scope; did you mean 'abs'? 40 | for(int j = 0; j < w-1; j++) cout << ans[j] << " "; | ^~~ | abs a.cc:41:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 41 | cout << ans[w-1] << endl; | ^~~ | abs
s658683679
p03638
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define MM 1000000000 #define MOD MM+7 #define MAX 10000 #define MAP 100 #define Pair pair<int,int> int dx[4] = {-1, 0, 1, 0}; int dy[4] = {0, -1, 0, 1}; int main(){ int H,W; cin >> H >> W; int N; cin >> N; int a[N]; for(int i = 0; i < N; i++) cin >> a[i]; int masu[H][W]; for(int i = 0; i < H; i++){ for(int j = 0; j < W; j++){ masu[i][j] = 0; } } for(int i = 0; i < H; i++){ int ans[w]; if(i%2 == 0){ for(int j = 0; j < W; j++){ ans[j] = pointer + 1; a[pointer]--; if(a[pointer] == 0) pointer++; } } else { for(int j = w-1; j >= 0; j--){ ans[j] = pointer+1; a[pointer]--; if(a[pointer] == 0) pointer++; } } for(int j = 0; j < w-1; j++) cout << ans[j] << " "; cout << ans[w-1] << endl; } }
a.cc: In function 'int main()': a.cc:25:17: error: 'w' was not declared in this scope 25 | int ans[w]; | ^ a.cc:28:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 28 | ans[j] = pointer + 1; | ^~~ | abs a.cc:28:26: error: 'pointer' was not declared in this scope 28 | ans[j] = pointer + 1; | ^~~~~~~ a.cc:34:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 34 | ans[j] = pointer+1; | ^~~ | abs a.cc:34:26: error: 'pointer' was not declared in this scope 34 | ans[j] = pointer+1; | ^~~~~~~ a.cc:39:46: error: 'ans' was not declared in this scope; did you mean 'abs'? 39 | for(int j = 0; j < w-1; j++) cout << ans[j] << " "; | ^~~ | abs a.cc:40:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 40 | cout << ans[w-1] << endl; | ^~~ | abs
s578580454
p03638
C
#include <bits/stdc++.h> using namespace std; typedef pair <int, int> pii; const int maxn = 10001; int h,w,a[maxn],p=1,n; stack <int> v; void input(); void solve(); int main(){ input(); solve(); return 0; } void input(){ cin>>h>>w>>n; for (int i=1;i<=n;i++){ cin>>a[i]; } } void solve(){ for (int j=0;j<h;j++){ if (j%2==0){ for (int i=0;i<w;i++){ if (a[p]>1){ cout<<p<<" "; a[p]--; } else{ cout<<p<<" "; a[p]--; p++; } } } else{ for (int i=0;i<w;i++){ if (a[p]>1){ v.push(p); a[p]--; } else{ v.push(p); a[p]--; p++; } } for (int i=0;i<w;i++){ cout<<v.top()<<" "; v.pop(); } } cout<<endl; } }
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory 1 | #include <bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s068868705
p03638
C++
For each i (1≤i≤N), the squares painted in Color i are 4-connected. That is, every square painted in Color i can be reached from every square painted in Color i by repeatedly traveling to a horizontally or vertically adjacent square painted in Color i.
a.cc:1:13: error: extended character ≤ is not valid in an identifier 1 | For each i (1≤i≤N), the squares painted in Color i are 4-connected. That is, every square painted in Color i can be reached from every square painted in Color i by repeatedly traveling to a horizontally or vertically adjacent square painted in Color i. | ^ a.cc:1:13: error: extended character ≤ is not valid in an identifier a.cc:1:1: error: 'For' does not name a type 1 | For each i (1≤i≤N), the squares painted in Color i are 4-connected. That is, every square painted in Color i can be reached from every square painted in Color i by repeatedly traveling to a horizontally or vertically adjacent square painted in Color i. | ^~~
s612491940
p03638
C++
#include<iostream> #include<cstdio> #include<cstring> #include<cctype> #include<string> #include<algorithm> #include<vector> #include<climits> #include<stack> #include<queue> #include <utility> using namespace std; using ll = long long; int main() { int H, W; cin >> H >> W; int N; cin >> N; vector< vector<int> > data(H,vector<int>(W,0)); int cnt = 0; for (int i = 0; i < N; i++) { int a; cin >> a; for (int j = 0; j < a; j++) { data[cnt/W][cnt%W] = a; cnt++; } } for (int i = 0; i < H; i++) { if (i % 2 == 0) { for (int j = 0; j < W; j++) { if (j != 0) cout << " " << data[i][j]; else cout << data[i][j]; } } else { for (int j = W-1; j >= 0; j--) { if (j != W-1) cout << " " << data[i][j]; else cout << data[i][j]; } } cout << endl; } return 0; } #include<iostream> #include<cstdio> #include<cstring> #include<cctype> #include<string> #include<algorithm> #include<vector> #include<climits> #include<stack> #include<queue> #include <utility> using namespace std; using ll = long long; int main() { int H, W; cin >> H >> W; int N; cin >> N; vector< vector<int> > data(H,vector<int>(W,0)); int cnt = 0; for (int i = 0; i < N; i++) { int a; cin >> a; for (int j = 0; j < a; j++) { data[cnt/W][cnt%W] = a; cnt++; } } for (int i = 0; i < H; i++) { if (i % 2 == 0) { for (int j = 0; j < W; j++) { if (j != 0) cout << " " << data[i][j]; else cout << data[i][j]; } } else { for (int j = W-1; j >= 0; j--) { if (j != W-1) cout << " " << data[i][j]; else cout << data[i][j]; } } cout << endl; } return 0; } #include<iostream> #include<cstdio> #include<cstring> #include<cctype> #include<string> #include<algorithm> #include<vector> #include<climits> #include<stack> #include<queue> #include <utility> using namespace std; using ll = long long; int main() { int H, W; cin >> H >> W; int N; cin >> N; vector< vector<int> > data(H,vector<int>(W,0)); int cnt = 0; for (int i = 0; i < N; i++) { int a; cin >> a; for (int j = 0; j < a; j++) { data[cnt/W][cnt%W] = a; cnt++; } } for (int i = 0; i < H; i++) { if (i % 2 == 0) { for (int j = 0; j < W; j++) { if (j != 0) cout << " " << data[i][j]; else cout << data[i][j]; } } else { for (int j = W-1; j >= 0; j--) { if (j != W-1) cout << " " << data[i][j]; else cout << data[i][j]; } } cout << endl; } return 0; } #include<iostream> #include<cstdio> #include<cstring> #include<cctype> #include<string> #include<algorithm> #include<vector> #include<climits> #include<stack> #include<queue> #include <utility> using namespace std; using ll = long long; int main() { int H, W; cin >> H >> W; int N; cin >> N; vector< vector<int> > data(H,vector<int>(W,0)); int cnt = 0; for (int i = 0; i < N; i++) { int a; cin >> a; for (int j = 0; j < a; j++) { data[cnt/W][cnt%W] = i+1; cnt++; } } for (int i = 0; i < H; i++) { if (i % 2 == 0) { for (int j = 0; j < W; j++) { if (j != 0) cout << " " << data[i][j]; else cout << data[i][j]; } } else { for (int j = W-1; j >= 0; j--) { if (j != W-1) cout << " " << data[i][j]; else cout << data[i][j]; } } cout << endl; } return 0; }
a.cc:87:5: error: redefinition of 'int main()' 87 | int main() | ^~~~ a.cc:20:5: note: 'int main()' previously defined here 20 | int main() | ^~~~ a.cc:154:5: error: redefinition of 'int main()' 154 | int main() | ^~~~ a.cc:20:5: note: 'int main()' previously defined here 20 | int main() | ^~~~ a.cc:221:5: error: redefinition of 'int main()' 221 | int main() | ^~~~ a.cc:20:5: note: 'int main()' previously defined here 20 | int main() | ^~~~
s462506535
p03638
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main() { int H, W; cin >> H >> W; int N; cin >> N; int a[N + 10]; int c[10001]; for (int i = 0; i < N; i++) { cin >> a[i]; } int cnt=0; for (int i = 0; i<H*W; i++) { c[i]=x+1; cnt++; a[x]--; if(a[x]==0) x++; } cnt=0; for(int i=0; i<H*W; i++){ cout<<c[i]<<" "; cnt++; if(cnt%W==0){cout<<endl; sort(c+W,c+2*W); reverse(c+W,c+2*W);} } }
a.cc: In function 'int main()': a.cc:16:22: error: 'x' was not declared in this scope 16 | c[i]=x+1; | ^
s998705557
p03638
C++
#include<iostream> #include<vector> using namespace std; const int mxhw = 101; int fld[mxhw][mxhw]; int main() { int H, W; cin >> H >> W; int N; cin >> N; vector<int> a(N); for(int i = 0; i < N; i++) cin >> a[i]; memset(fld, -1, sizeof(fld)); int car = 0; for(int i = 0; i < H; i++) { for(int j = 0; j < W; j++) { if(a[car] <= 0) car++; if(i%2 == 0) fld[i][j] = car + 1; else fld[i][W-1-j] = car + 1; a[car]--; } } for(int i = 0; i < H; i++) { for(int j = 0; j < W; j++) { cout << fld[i][j] << " "; } cout << endl; } return 0; }
a.cc: In function 'int main()': a.cc:16:5: error: 'memset' was not declared in this scope 16 | memset(fld, -1, sizeof(fld)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<vector> +++ |+#include <cstring> 3 | using namespace std;
s528282239
p03638
C
#include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #include<set> using namespace std; typedef long long LL; const int INF=0x3f3f3f3f; const int MAXN=1e5+5; int a[MAXN]; int G[105][105]; int main() { int h,w; while(scanf("%d%d",&h,&w)!=EOF) { int n; scanf("%d",&n); for(int i=1;i<=n;++i) scanf("%d",&a[i]); int cnt=1; for(int i=1;i<=h;++i) { if(i&1) { for(int j=1;j<=w;++j) { if(a[cnt]>0) {G[i][j]=cnt;--a[cnt];} else if(a[cnt]==0) {++cnt;G[i][j]=cnt;--a[cnt];} } }else { for(int j=w;j>=1;--j) { if(a[cnt]>0) {G[i][j]=cnt;--a[cnt];} else if(a[cnt]==0) {++cnt;G[i][j]=cnt;--a[cnt];} } } } for(int i=1;i<=h;++i) { for(int j=1;j<=w;++j) { if(j!=w) printf("%d ",G[i][j]); else printf("%d\n",G[i][j]); } } } return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s381863589
p03638
C++
#include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #include<set> using namespace std; typedef long long LL; const int INF=0x3f3f3f3f; const int MAXN=1e5+5; int a[MAXN]; int G[105][105]; int main() { int h,w; while(scanf("%d%d",&h,&w)!=EOF) { int n; scanf("%d",&n); for(int i=1;i<=n;++i) scanf("%d",&a[i]); int cnt=1; for(int i=1;i<=h;++i) { if(i&1) { for(int j=1;j<=w;++j) { if(a[cnt]>0) {G[i][j]=cnt;--a[cnt];} else if(a[cnt]==0) {++cnt;G[i][j]=cnt;--a[cnt];} } }else { for(int j=w;j>=1;--j) { if(a[cnt]>0) {G[i][j]=cnt;--a[cnt];} else if(a[cnt]==0) {++cnt;G[i][j]=cnt;--a[cnt];} } } } for(int i=1;i<=h;++i) { for(int j=1;j<=w;++j) { if(j!=w) printf("%d ",G[i][j]); else printf("%d\n",G[i][j]); } } } return 0; } 1
a.cc:53:1: error: expected unqualified-id before numeric constant 53 | 1 | ^
s900488503
p03638
C++
#include<algorithm> #include<iostream> #include<cstdio> #include<cmath> using namespace std; int n,a[100005], b[5]; int main(){ scanf("%d", &n); for( int i = 1; i <= n; i++ ) scanf("%d", &a[i]); for( int i = 1; i <= n; i++ ){ if( a[i] & 1 ){ b[1]++; continue; } if( a[i]%4 == 0 ) b[4]++; else if( a[i]%2 == 0 ) b[2]++ } if( !b[2] && b[1] > b[4]+1 ) { puts("No"); return 0;} if( b[2] && b[1] > b[4] ) { puts("No"); return 0;} puts("Yes"); return 0; }
a.cc: In function 'int main()': a.cc:13:38: error: expected ';' before '}' token 13 | else if( a[i]%2 == 0 ) b[2]++ | ^ | ; 14 | } | ~
s296279939
p03638
C++
#include <bits/stdc++.h> using namespace std; int h,l; int sumn; int x,y; int answer[200][200]; int main() { cin>>h>>l>>sumn; x=1,y=1; for(int i=1; i<=sumn; i++) { int count; cin>>count; while(count--) { answer[x][y]=i; if(y==h&&x%2==1) {y=h;x++;} else if(y==1&&x%2==0) {y=1;x++;} else if(x&1) y++; else y--; } } for(int i=1; i<=l; i++) for(int j=1; j<=l; j++) { printf("%d%c",ans[i][j],j==c?'\n':' '); } return 0; }
a.cc: In function 'int main()': a.cc:32:40: error: 'ans' was not declared in this scope; did you mean 'abs'? 32 | printf("%d%c",ans[i][j],j==c?'\n':' '); | ^~~ | abs a.cc:32:53: error: 'c' was not declared in this scope 32 | printf("%d%c",ans[i][j],j==c?'\n':' '); | ^
s076793336
p03638
C
#include<stdio.h> int main () { int a[200][200],b[40000]; int h,w; while(true) { scanf("%d %d",&h,&w); int i,j,n,s=0; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",&b[i]); for(i=0;i<h;i++) { if(i%2==0) for(j=0;j<w;j++) { a[i][j]=s+1; b[s]--; if(b[s]==0) s++; } if(i%2==1) for(j=w-1;j>=0;j--) { a[i][j]=s+1; b[s]--; if(b[s]==0) s++; } } for(i=0;i<h;i++) { for(j=0;j<w-1;j++) printf("%d ",a[i][j]); printf("%d\n",a[i][w-1]); } } }
main.c: In function 'main': main.c:6:11: error: 'true' undeclared (first use in this function) 6 | while(true) | ^~~~ main.c:2:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' 1 | #include<stdio.h> +++ |+#include <stdbool.h> 2 | int main () main.c:6:11: note: each undeclared identifier is reported only once for each function it appears in 6 | while(true) | ^~~~
s813402384
p03638
C++
#include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #include <string> #include <cmath> #include <fstream> #include <ctime> #include <time.h> #include <queue> #include <memory.h> #include <vector> #include <algorithm> #include <numeric> #include <conio.h> #define PI 3.1415927 using namespace std; const int maxn=1e5+5; int a[maxn]; int g[105][105]; int main() { int h,w; while(scanf("%d%d",&h,&w)!=EOF) { int n; scanf("%d",&n); for(int i=1;i<=n;++i) scanf("%d",&a[i]); int cnt=1; for(int i=1;i<=h;++i) { if(i&1) { for(int j=1;j<=w;++j) { if(a[cnt]>0) {g[i][j]=cnt;--a[cnt];} else if(a[cnt]==0) {++cnt;g[i][j]=cnt;--a[cnt];} } }else { for(int j=w;j>=1;--j) { if(a[cnt]>0) {g[i][j]=cnt;--a[cnt];} else if(a[cnt]==0) {++cnt;g[i][j]=cnt;--a[cnt];} } } } for(int i=1;i<=h;++i) { for(int j=1;j<=w;++j) { if(j!=w) printf("%d ",g[i][j]); else printf("%d\n",g[i][j]); } } } }
a.cc:15:10: fatal error: conio.h: No such file or directory 15 | #include <conio.h> | ^~~~~~~~~ compilation terminated.
s785304927
p03638
C++
#include <iostream> #include <windows.h> #include <cstdio> #include <cstdlib> #include <cstring> #include <string> #include <cmath> #include <fstream> #include <ctime> #include <time.h> #include <queue> #include <memory.h> #include <vector> #include <algorithm> #include <numeric> #include <conio.h> #define PI 3.1415927 using namespace std; const int maxn=1e5+5; int a[maxn]; int g[105][105]; int main() { int h,w; while(scanf("%d%d",&h,&w)!=EOF) { int n; scanf("%d",&n); for(int i=1;i<=n;++i) scanf("%d",&a[i]); int cnt=1; for(int i=1;i<=h;++i) { if(i&1) { for(int j=1;j<=w;++j) { if(a[cnt]>0) {g[i][j]=cnt;--a[cnt];} else if(a[cnt]==0) {++cnt;g[i][j]=cnt;--a[cnt];} } }else { for(int j=w;j>=1;--j) { if(a[cnt]>0) {g[i][j]=cnt;--a[cnt];} else if(a[cnt]==0) {++cnt;g[i][j]=cnt;--a[cnt];} } } } for(int i=1;i<=h;++i) { for(int j=1;j<=w;++j) { if(j!=w) printf("%d ",g[i][j]); else printf("%d\n",g[i][j]); } } } }
a.cc:2:10: fatal error: windows.h: No such file or directory 2 | #include <windows.h> | ^~~~~~~~~~~ compilation terminated.
s957022983
p03638
C++
typedef long long LL; const int INF=0x3f3f3f3f; const int MAXN=1e5+5; int a[MAXN]; int G[105][105]; int main() { int h,w; while(scanf("%d%d",&h,&w)!=EOF) { int n; scanf("%d",&n); for(int i=1;i<=n;++i) scanf("%d",&a[i]); int cnt=1; for(int i=1;i<=h;++i) { if(i&1) { for(int j=1;j<=w;++j) { if(a[cnt]>0) {G[i][j]=cnt;--a[cnt];} else if(a[cnt]==0) {++cnt;G[i][j]=cnt;--a[cnt];} } }else { for(int j=w;j>=1;--j) { if(a[cnt]>0) {G[i][j]=cnt;--a[cnt];} else if(a[cnt]==0) {++cnt;G[i][j]=cnt;--a[cnt];} } } } for(int i=1;i<=h;++i) { for(int j=1;j<=w;++j) { if(j!=w) printf("%d ",G[i][j]); else printf("%d\n",G[i][j]); } } } return 0; }
a.cc: In function 'int main()': a.cc:10:11: error: 'scanf' was not declared in this scope 10 | while(scanf("%d%d",&h,&w)!=EOF) | ^~~~~ a.cc:10:32: error: 'EOF' was not declared in this scope 10 | while(scanf("%d%d",&h,&w)!=EOF) | ^~~ a.cc:1:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | typedef long long LL; a.cc:39:26: error: 'printf' was not declared in this scope 39 | if(j!=w) printf("%d ",G[i][j]); | ^~~~~~ a.cc:39:26: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' a.cc:40:22: error: 'printf' was not declared in this scope 40 | else printf("%d\n",G[i][j]); | ^~~~~~ a.cc:40:22: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
s818732010
p03638
C++
#include<iostream> #include<algorithm> using namespace std; int main() { int p,q,n,j,k; cin>>p>>q>>n; l=1; int a[10010],map[110][110]; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=p;i++) { if(i%2==1) j=1; else j=q; while(j>=1&&j<=q) { while(a[l]<=0) l++; if(a[l]>0) { map[i][j]=l; a[l]--; if(i%2==1) { j++; } else j--; } } } for(int i=1;i<=q;i++) { for(int j=1;j<=q;j++) { cout<<map[i][j]; } cout<<endl; } }
a.cc: In function 'int main()': a.cc:9:9: error: 'l' was not declared in this scope 9 | l=1; | ^
s221178966
p03638
C
//考试 #include<iostream> using namespace std; int a[10005]; int b[10005]; int main() { int h,w; int n; cin>>h>>w; cin>>n; for(int i=1; i<= n; i++) cin>>b[i]; int flag = 1; int j = 1; for (int i = 1; i <= n; i++) { while (b[i] > 0) { a[j] = flag; j++; b[i]--; } flag++; } for (int i = 1; i <= h; i++) { if (i % 2 == 1) { for (int p = w*(i - 1) + 1; p <= i*w; p++) { cout << a[p] << " "; } if (i != h) cout << endl; } else if (i % 2 == 0) { for (int p = w*i; p >= w*(i - 1) + 1; p--) { cout << a[p] << " "; } if (i != h) cout << endl; } } return 0; }
main.c:3:9: fatal error: iostream: No such file or directory 3 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s018286958
p03638
C
#include<stdio.h> int a[105][105],b[10000+50]; int main () { int h,w; while(scanf("%d %d",&h,&w)!=EOF) { int i,j,t,k=0; scanf("%d",&t); for(i=0;i<t;i++) scanf("%d",&b[i]); for(i=0;i<h;i++) { if(i%2==0) for(j=0;j<w;j++) { a[i][j]=k+1; b[k]--; if(b[k]==0) k++; } if(i%2==1) for(j=w-1;j>=0;j--) { a[i][j]=k+1; b[k]--; if(b[k]==0) k++; } } for(i=0;i<h;i++) { for(j=0;j<w-1;j++) printf("%d ",a[i][j]); printf("%d\n",a[i][w-1]); } }
main.c: In function 'main': main.c:39:5: error: expected declaration or statement at end of input 39 | } | ^
s230872639
p03638
C++
#include<iostream> #include<cstdio> #include<cmath> #include<algorithm> using namespace std; typedef long long LL; int a[100050]; int G[105][105]; int main() { int h,w; while(scanf("%d%d",&h,&w)!=EOF) { int n; cin>>n; for(int i=1;i<=n;++i) cin>>a[i]; int tmp=1; for(int i=1;i<=h;++i) { if(i&1) { for(int j=1;j<=w;++j) { if(a[tmp]>0){ G[i][j]=tmp; a[tmp]-=1; } else if(a[cnt]==0){ tmp++; G[i][j]=tmp; a[tmp]-=1; } } }else { for(int j=w;j>=1;--j) { if(a[tmp]>0) {G[i][j]=tmp;--a[tmp];} else if(a[tmp]==0) {++tmp;G[i][j]=tmp;--a[tmp];} } } } for(int i=1;i<=h;++i) { for(int j=1;j<=w;++j) { if(j!=w) cout<<G[i][j]<<' '; else cout<<G[i][j]<<endl; } } } return 0; }
a.cc: In function 'int main()': a.cc:29:30: error: 'cnt' was not declared in this scope; did you mean 'int'? 29 | else if(a[cnt]==0){ | ^~~ | int
s208577163
p03638
C++
#include<iostream> using namespace std; #define fi first #define se second const ll maxn = 1e3 + 10; const int Move[4][2] = {-1,0,1,0,0,1,0,-1}; char mp[maxn][maxn]; int step[maxn][maxn]; bool vis[maxn][maxn]; int n,m; bool check(int x,int y) { if(x < 0 || y < 0|| x >= n || y >= m || vis[x][y] || mp[x][y] == '#') return false; return true; } int BFS() { queue<pair<int ,int> > q; q.push(make_pair(0,0)); step[0][0] = 1; vis[0][0] = true; while (!q.empty()) { pair<int ,int> t = q.front(); q.pop(); for(int i = 0;i < 4;i++) { int tox = t.fi + Move[i][0]; int toy = t.se + Move[i][1]; if(tox == n - 1 && toy == m - 1) return step[t.fi][t.se] + 1; if(check(tox,toy)) { vis[tox][toy] = true; step[tox][toy] = step[t.fi][t.se] + 1; q.push(make_pair(tox,toy)); } } } return -1; } int main(){ init(); cin>>n>>m; int cnt = 0; for(int i = 0;i < n;i++) for(int j = 0;j < m;j++) { cin>>mp[i][j]; if(mp[i][j] == '#') cnt++; } int res = BFS(); if(res == -1) { cout<<"-1"<<endl; } else { cout<<n*m - res - cnt<<endl; } return 0; }
a.cc:8:7: error: 'll' does not name a type 8 | const ll maxn = 1e3 + 10; | ^~ a.cc:10:9: error: 'maxn' was not declared in this scope 10 | char mp[maxn][maxn]; | ^~~~ a.cc:10:15: error: 'maxn' was not declared in this scope 10 | char mp[maxn][maxn]; | ^~~~ a.cc:11:10: error: 'maxn' was not declared in this scope 11 | int step[maxn][maxn]; | ^~~~ a.cc:11:16: error: 'maxn' was not declared in this scope 11 | int step[maxn][maxn]; | ^~~~ a.cc:12:10: error: 'maxn' was not declared in this scope 12 | bool vis[maxn][maxn]; | ^~~~ a.cc:12:16: error: 'maxn' was not declared in this scope 12 | bool vis[maxn][maxn]; | ^~~~ a.cc: In function 'bool check(int, int)': a.cc:16:45: error: 'vis' was not declared in this scope 16 | if(x < 0 || y < 0|| x >= n || y >= m || vis[x][y] || mp[x][y] == '#') return false; | ^~~ a.cc:16:58: error: 'mp' was not declared in this scope; did you mean 'm'? 16 | if(x < 0 || y < 0|| x >= n || y >= m || vis[x][y] || mp[x][y] == '#') return false; | ^~ | m a.cc: In function 'int BFS()': a.cc:21:5: error: 'queue' was not declared in this scope 21 | queue<pair<int ,int> > q; | ^~~~~ a.cc:2:1: note: 'std::queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>' 1 | #include<iostream> +++ |+#include <queue> 2 | a.cc:21:26: error: expected primary-expression before '>' token 21 | queue<pair<int ,int> > q; | ^ a.cc:21:28: error: 'q' was not declared in this scope 21 | queue<pair<int ,int> > q; | ^ a.cc:23:5: error: 'step' was not declared in this scope 23 | step[0][0] = 1; | ^~~~ a.cc:24:5: error: 'vis' was not declared in this scope 24 | vis[0][0] = true; | ^~~ a.cc: In function 'int main()': a.cc:44:5: error: 'init' was not declared in this scope; did you mean 'int'? 44 | init(); | ^~~~ | int a.cc:49:18: error: 'mp' was not declared in this scope; did you mean 'm'? 49 | cin>>mp[i][j]; | ^~ | m
s878082039
p03638
C++
#include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #include<set> using namespace std; typedef long long LL; const int INF=0x3f3f3f3f; const int MAXN=1e5+5; int a[MAXN]; int G[105][105]; int main() { int a,w; while(scanf("%d%d",&a,&w)!=EOF) { int n; scanf("%d",&n); for(int i=1;i<=n;++i) scanf("%d",&a[i]); int cnt=1; for(int i=1;i<=a;++i) { if(i&1) { for(int j=1;j<=w;++j) { if(a[cnt]>0) {G[i][j]=cnt;--a[cnt];} else if(a[cnt]==0) {++cnt;G[i][j]=cnt;--a[cnt];} } }else { for(int j=w;j>=1;--j) { if(a[cnt]>0) {G[i][j]=cnt;--a[cnt];} else if(a[cnt]==0) {++cnt;G[i][j]=cnt;--a[cnt];} } } } for(int i=1;i<=a;++i) { for(int j=1;j<=w;++j) { if(j!=w) printf("%d ",G[i][j]); else printf("%d\n",G[i][j]); } } } return 0; }
a.cc: In function 'int main()': a.cc:22:26: error: invalid types 'int[int]' for array subscript 22 | scanf("%d",&a[i]); | ^ a.cc:30:24: error: invalid types 'int[int]' for array subscript 30 | if(a[cnt]>0) {G[i][j]=cnt;--a[cnt];} | ^ a.cc:30:49: error: invalid types 'int[int]' for array subscript 30 | if(a[cnt]>0) {G[i][j]=cnt;--a[cnt];} | ^ a.cc:31:29: error: invalid types 'int[int]' for array subscript 31 | else if(a[cnt]==0) {++cnt;G[i][j]=cnt;--a[cnt];} | ^ a.cc:31:61: error: invalid types 'int[int]' for array subscript 31 | else if(a[cnt]==0) {++cnt;G[i][j]=cnt;--a[cnt];} | ^ a.cc:37:25: error: invalid types 'int[int]' for array subscript 37 | if(a[cnt]>0) {G[i][j]=cnt;--a[cnt];} | ^ a.cc:37:50: error: invalid types 'int[int]' for array subscript 37 | if(a[cnt]>0) {G[i][j]=cnt;--a[cnt];} | ^ a.cc:38:30: error: invalid types 'int[int]' for array subscript 38 | else if(a[cnt]==0) {++cnt;G[i][j]=cnt;--a[cnt];} | ^ a.cc:38:62: error: invalid types 'int[int]' for array subscript 38 | else if(a[cnt]==0) {++cnt;G[i][j]=cnt;--a[cnt];} | ^
s747756378
p03638
C++
#include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #include<set> using namespace std; typedef long long LL; const int INF=0x3f3f3f3f; const int MAXN=1e5+5; int a[MAXN]; int G[105][105]; int main() { int h,w; while(scanf("%d%d",&h,&w)!=EOF) { int n; cin>>n; for(int i=1;i<=n;++i) cin<<a[i];//scanf("%d",&a[i]); int cnt=1; for(int i=1;i<=h;++i) { if(i&1) { for(int j=1;j<=w;++j) { if(a[cnt]>0) {G[i][j]=cnt;--a[cnt];} else if(a[cnt]==0) {++cnt;G[i][j]=cnt;--a[cnt];} } }else { for(int j=w;j>=1;--j) { if(a[cnt]>0) {G[i][j]=cnt;--a[cnt];} else if(a[cnt]==0) {++cnt;G[i][j]=cnt;--a[cnt];} } } } for(int i=1;i<=h;++i) { for(int j=1;j<=w;++j) { if(j!=w) printf("%d ",G[i][j]); else printf("%d\n",G[i][j]); } } } return 0; }
a.cc: In function 'int main()': a.cc:22:16: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 22 | cin<<a[i];//scanf("%d",&a[i]); | ~~~^~~~~~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:22:16: note: candidate: 'operator<<(int, int)' (built-in) 22 | cin<<a[i];//scanf("%d",&a[i]); | ~~~^~~~~~ a.cc:22:16: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:22:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 22 | cin<<a[i];//scanf("%d",&a[i]); | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:22:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 22 | cin<<a[i];//scanf("%d",&a[i]); | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:22:13: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 22 | cin<<a[i];//scanf("%d",&a[i]); | ^~~ In file included from /usr/include/c++/14/bits/ios_base.h:46: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:22:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 22 | cin<<a[i];//scanf("%d",&a[i]); | ^ /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:22:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 22 | cin<<a[i];//scanf("%d",&a[i]); | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:22:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 22 | cin<<a[i];//scanf("%d",&a[i]); | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:22:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 22 | cin<<a[i];//scanf("%d",&a[i]); | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:22:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 22 | cin<<a[i];//scanf("%d",&a[i]); | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:22:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 22 | cin<<a[i];//scanf("%d",&a[i]); | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:22:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 22 | cin<<a[i];//scanf("%d",&a[i]); | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:22:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 22 | cin<<a[i];//scanf("%d",&a[i]); | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:22:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 22 | cin<<a[i];//scanf("%d",&a[i]); | ^ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)' 684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed: a.cc:22:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 22 | cin<<a[i];//scanf("%d",&a[i]); | ^ /usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)' 689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed: a.cc:22:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 22 | cin<<a[i];//scanf("%d",&a[i]); | ^ /usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ /usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed: /usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]': a.cc:22:21: required from here 22 | cin<<a[i];//scanf("%d",&a[i]); | ^ /usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 810 | operator<<(_Ost
s504948657
p03638
C
#include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #include<set> using namespace std; typedef long long LL; const int INF=0x3f3f3f3f; const int MAXN=1e5+5; int a[MAXN]; int G[105][105]; int main() { int h,w; while(scanf("%d%d",&h,&w)!=EOF) { int n; scanf("%d",&n); for(int i=1;i<=n;++i) scanf("%d",&a[i]); int cnt=1; for(int i=1;i<=h;++i) { if(i&1) { for(int j=1;j<=w;++j) { if(a[cnt]>0) {G[i][j]=cnt;--a[cnt];} else if(a[cnt]==0) {++cnt;G[i][j]=cnt;--a[cnt];} } }else { for(int j=w;j>=1;--j) { if(a[cnt]>0) {G[i][j]=cnt;--a[cnt];} else if(a[cnt]==0) {++cnt;G[i][j]=cnt;--a[cnt];} } } } for(int i=1;i<=h;++i) { for(int j=1;j<=w;++j) { if(j!=w) cout<<G[i][j]; else printf("%d\n",G[i][j]); } } } return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s692170462
p03638
C
#include <bits/stdc++.h> using namespace std; #define MP make_pair #define PB push_back typedef long long LL; typedef pair<int,int> PII; const double eps=1e-8; const double pi=acos(-1.0); const int K=1e6+7; const int mod=1e9+7; int r,c,n,x,y,ans[200][200]; int main(void) { scanf("%d%d%d",&r,&c,&n); x=1,y=1; for(int i=1,cnt;i<=n;i++) { scanf("%d",&cnt); while(cnt--) { ans[x][y]=i; if(y==c&&x%2==1) y=c,x++; else if(y==1&&x%2==0) y=1,x++; else if(x&1) y++; else y--; } } for(int i=1;i<=r;i++) for(int j=1;j<=c;j++) printf("%d%c",ans[i][j],j==c?'\n':' '); return 0; }
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory 1 | #include <bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s611961263
p03638
C
int a[105][105],b[10000+50]; int main () { int h,w; while(scanf("%d %d",&h,&w)!=EOF) { int i,j,t,k=0; scanf("%d",&t); for(i=0;i<t;i++) scanf("%d",&b[i]); for(i=0;i<h;i++) { if(i%2==0) for(j=0;j<w;j++) { a[i][j]=k+1; b[k]--; if(b[k]==0) k++; } if(i%2==1) for(j=w-1;j>=0;j--) { a[i][j]=k+1; b[k]--; if(b[k]==0) k++; } } for(i=0;i<h;i++) { for(j=0;j<w-1;j++) printf("%d ",a[i][j]); printf("%d\n",a[i][w-1]); } } }
main.c: In function 'main': main.c:6:11: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 6 | while(scanf("%d %d",&h,&w)!=EOF) | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int a[105][105],b[10000+50]; main.c:6:11: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 6 | while(scanf("%d %d",&h,&w)!=EOF) | ^~~~~ main.c:6:11: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:6:33: error: 'EOF' undeclared (first use in this function) 6 | while(scanf("%d %d",&h,&w)!=EOF) | ^~~ main.c:6:33: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:6:33: note: each undeclared identifier is reported only once for each function it appears in main.c:34:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 34 | printf("%d ",a[i][j]); | ^~~~~~ main.c:34:17: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:34:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:34:17: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:35:13: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 35 | printf("%d\n",a[i][w-1]); | ^~~~~~ main.c:35:13: note: include '<stdio.h>' or provide a declaration of 'printf'