criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main() {
    int H, W, N;
    cin >> H >> W >> N;
    vector<vector<int> > C(H, vector<int>(W));

    vector<int> as;

    for (int i = 1; i <= N; i++) {
        int a;
        cin >> a;
        for (int j = 0; j < a; j++) {
            as.push_back(i);
        }
    }

    sort(as.begin(), as.end());

    for (int i = 0; i < H; i++) {
        for (int j = W * i; j < W * (i + 1); j++) {
            C[i][j - W * i] = as[j];
            // cout << "(i, j) = ( " << i << ", " << j << " )  == " << C[i][j]
            //     << endl;
        }
        if (i % 2 == 1) reverse(C[i].begin(), C[i].end());
    }

    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            cout << C[i][j] << " ";
        }
        cout << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   21 |     sort(as.begin(), as.end());
      |     ^~~~
      |     short
a.cc:29:25: error: 'reverse' was not declared in this scope
   29 |         if (i % 2 == 1) reverse(C[i].begin(), C[i].end());
      |                         ^~~~~~~
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<cstdlib>

using namespace std;

int main(){
	int n, h, w;
	cin >> h >> w;
	cin >> n;
	int a[n], c[h][w] = {0};
	for(int i = 0; i < n; i++){
		cin >> a[i];
	}
	
	int x = 0, y = 0;
	for(int i = 0; i < n; i++){
		for(int j = x; i < x + a[i]/w; i++){
			for(int k = y; j < y + a[i] % w; j++){
				c[j][k] == a[i];
			}
		}
		x = j;
		y = k;
	}
	
	for(int i = 0; i < h; i++){
		for(int j = 0; j < w; j++){
			cout << c[i][j] << " ";
		}
		cout << endl;
	}
	
 	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:21: error: 'j' was not declared in this scope
   24 |                 x = j;
      |                     ^
a.cc:25:21: error: 'k' was not declared in this scope
   25 |                 y = k;
      |                     ^
Language: C++

#include<iostream>
using namespace std;

int main(){
  int H,W,N,a,b[10050]={},c=0,h=1;
  cin>>H;
  cin>>W;
  cin>>N;
  for(int i=0;i<N;i++){
    cin>>a;
    for(int j=0;j<a;j++){
      b[c+j]=h;
    }
    c += a;
    h += 1;
  }
  for(int k=0;k<H;k++){
    for(int l=0;l<W;l++){
      if(k%2==0){
        cout<<b[W*k+l];
        cout<<' ';
      }else{
        cout<<b[W*(k+1)-l-1)];
        cout<<' ';
      }
    }
    cout<<endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:28: error: expected ']' before ')' token
   23 |         cout<<b[W*(k+1)-l-1)];
      |                            ^
      |                            ]
a.cc:23:28: error: expected ';' before ')' token
   23 |         cout<<b[W*(k+1)-l-1)];
      |                            ^
      |                            ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define rep(i,b) FOR(i,0,b)
#define INF 1e9
#define dump(x) cerr<<#x<<"="<<x<<endl
#define int long long

using ll = long long;
const ll mod = LLONG_MAX;
typedef pair<int,int> P;
int dx[]={0,1,0,-1};
int dy[]={-1,0,1,0};

int h,w;
int N;
int a[10010];
int c[110][110];


void init(){
  rep(i,h)rep(j,w){
    c[j][i]=-1;
  }
}

//hの方が短いとき
P se(int c[110][110]){
  rep(i,h){
    rep(j,w){
      if(c[j][i]==-1)return P(j,i);
    }
  }
}

signed main(){
  cin>>h>>w;
  cin>>N;
  rep(i,N){
    cin>>a[i];
    a[i]--;
  }
  bool mode=0;
  if(h<w){
    swap(h,w);
    mode=1;
  }
  init();
  queue<P> que;
  que.push(P(0,0));
  c[0][0]=1;
  rep(idx,N){
    int step=a[idx];

      while(!que.empty()){
      P n=que.front();que.pop();
      rep(i,4){
        int nx=n.first+dx[i];
        int ny=n.second+dy[i];
        //cout<<"nx="<<nx<<" ny="<<ny<<endl;

        if(nx>=0&&ny>=0&&nx<=w&&ny<=h && c[nx][ny]==-1 && step>0){
          que.push(P(nx,ny));
          c[nx][ny]=idx+1;
          step--;
        }
      }

    }
    P next=se(c);

    //cout<<next.first<<" "<<next.second<<endl;
    que.push(next);
    c[next.first][next.second]=idx+2;

  }
  if(mode==0){
    rep(i,h){
      rep(j,w-1){
        cout<<c[j][i-1]<<" ";
      }
      cout<<c[j][w-1];
      cout<<endl;
    }
  }else{
    rep(i,w){
      rep(j,h-1){
        cout<<c[i][j]<<" ";
      }
      cout<<c[i][h-1];
      cout<<endl;
    }
  }
  return 0;


}


Compiler output:
a.cc: In function 'int main()':
a.cc:82:15: error: 'j' was not declared in this scope
   82 |       cout<<c[j][w-1];
      |               ^
a.cc: In function 'P se(long long int (*)[110])':
a.cc:34:1: warning: control reaches end of non-void function [-Wreturn-type]
   34 | }
      | ^
Language: C++

int a[100000];
int c[150][150];
int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);

    int H,W,N;
    cin >> H;
    cin >> W;
    cin >> N;
    for(int i=0;i<N;i++){
        cin >> a[i];
    }
    int count=1,color=1;
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            if(i%2==0){
                c[i][j]=color;
            }
            else{
                c[i][W-1-j]=color;
            }
            if(count==a[color-1]){
                count=1;
                color++;
            }
            else{
                count++;
            }
        }
    }

    for(int i=0;i<H;i++){
        cout << c[i][0];
        for(int j=1;j<W;j++){
            cout << " "<< c[i][j];
        }
        cout << "\n";
    }
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
    4 |         cin.tie(0);
      |         ^~~
a.cc:5:9: error: 'ios' has not been declared
    5 |         ios::sync_with_stdio(false);
      |         ^~~
a.cc:34:9: error: 'cout' was not declared in this scope; did you mean 'count'?
   34 |         cout << c[i][0];
      |         ^~~~
      |         count
Language: C++

#include <bits/stdc++.h>
#pragma GCC diagnostic error "-Wconversion"
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define all(vec) vec.begin(), vec.end()
#define mp(a, b) make_pair(a, b)
typedef long long ll;
const ll INF = 1LL << 60;
const ll MOD = (1e9 + 7);
using namespace std;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
ll dp[100010];
ll gcd(ll x, ll y){
  return y == 0 ? x : gcd(y, x % y);
}
ll lcg(ll x, ll y){
  return x * y / gcd(x, y);
}
ll digits(ll x){
  ll length = 0;
  while (x > 0){
    x /= 10;
    length++;
  }
  return length;
  if (x == 0) return 0;
}
map<ll, ll> factor(ll n){
  map<ll, ll> ans;
  ll a = 2;
  while (n >= a * a){
    if (n % a == 0){
      ans[a]++;
      n /= a;
    }
    else a++;
  }
  ans[n]++;
  return ans;
}
template<class T> inline bool chmin(T& a, T b){
  if (a > b){
    a = b;
    return true;
  }
  return false;
}
template<class T> inline bool chmax(T& a, T b){
  if (a < b){
    a = b;
    return true;
  }
  return false;
}

int main(){
  cout << fixed << setprecision(15);
  //int ans = 0;
  string ans = "No";

  int n; cin >> n;
  int odd = 0, four = 0;
  rep(i,n){
    int x; cin >> x;
    if (x % 4 == 0) four++;
    if (x % 2 == 1) odd++;
  }
  if (odd <= 2 && odd <= four) ans = "Yes";
  if (n <= 3) if (four >= 1) ans = "Yes";
  if (n == 2 && (one == 2 || one == 1 && four == 0)) ans = "No";

  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:71:18: error: 'one' was not declared in this scope
   71 |   if (n == 2 && (one == 2 || one == 1 && four == 0)) ans = "No";
      |                  ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll mxn= 5e4+5;
// check for forloop
// intialize variable
// overflow
// go for easy solution
#define mod 1000000007
ll INF = 1000000000000000005LL;
//#define endl '\n'
void rishabh(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
}
int main(){
    rishabh();
    int n;
    cin>>n;
    ll arr[n];
    for(int i=0;i<n;i++)cin>>arr[i];
    int none, four, two;
    none=two=four=0;
    for(int i=0;i<n;i++){
        if(arr[i]%4==0)four++;
        else if(arr[i]%2==0)two++;
        else none++;
    }
    if((four*2+(two/2)*2>=n-1)cout<<"Yes";
    else cout<<"No";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:31: error: expected ';' before 'cout'
   30 |     if((four*2+(two/2)*2>=n-1)cout<<"Yes";
      |                               ^~~~
      |                               ;
a.cc:31:5: error: expected primary-expression before 'else'
   31 |     else cout<<"No";
      |     ^~~~
a.cc:30:43: error: expected ')' before 'else'
   30 |     if((four*2+(two/2)*2>=n-1)cout<<"Yes";
      |       ~                                   ^
      |                                           )
   31 |     else cout<<"No";
      |     ~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int main() {
    int N = 0;
    cin >> N;
    vector<int> A(N,0);
    int d = 0, q = 0;
    for(int i = 0; i < N; i++) {
        cin >> A.at(i);
        d += (A.at(i)%2 == 0);
        q += (A.at(i)%4 == 0);
    }
    d -= q;
    int o = N - d - q;
    o += (d == 1);
    if(q + 1 >= o && (q && o) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }




    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:30: error: expected ';' before '{' token
   19 |     if(q + 1 >= o && (q && o) {
      |                              ^~
      |                              ;
a.cc:21:7: error: expected primary-expression before 'else'
   21 |     } else {
      |       ^~~~
a.cc:21:6: error: expected ')' before 'else'
   21 |     } else {
      |      ^~~~~
      |      )
a.cc:19:7: note: to match this '('
   19 |     if(q + 1 >= o && (q && o) {
      |       ^
Language: C++

#include <iostream>
using namespace std;
int n,kelipatan2=0,kelipatan4=0,a[100010],random=0,x,y;
int main() {
	cin>>n;
	for(int i=1;i<=n;i++) {
		cin>>a[i];
		if(a[i]%4==0) {
			kelipatan4++;
		}
		else if(a[i]%2==0) {
			kelipatan2++;
		} else {
			random++;
		}
	}
	if(kelipatan2)random++;
	if(random-1>kelipatan4) {
		cout<<"No"<<endl;
	} else {
		cout<<"Yes"<<endl;
	}
}
	

Compiler output:
a.cc:3:43: error: 'int random' redeclared as different kind of entity
    3 | int n,kelipatan2=0,kelipatan4=0,a[100010],random=0,x,y;
      |                                           ^~~~~~
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 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/stdlib.h:521:17: note: previous declaration 'long int random()'
  521 | extern long int random (void) __THROW;
      |                 ^~~~~~
a.cc: In function 'int main()':
a.cc:14:25: warning: ISO C++ forbids incrementing a pointer of type 'long int (*)() noexcept' [-Wpointer-arith]
   14 |                         random++;
      |                         ^~~~~~
a.cc:14:31: error: lvalue required as increment operand
   14 |                         random++;
      |                               ^~
a.cc:17:23: warning: ISO C++ forbids incrementing a pointer of type 'long int (*)() noexcept' [-Wpointer-arith]
   17 |         if(kelipatan2)random++;
      |                       ^~~~~~
a.cc:17:29: error: lvalue required as increment operand
   17 |         if(kelipatan2)random++;
      |                             ^~
a.cc:18:18: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   18 |         if(random-1>kelipatan4) {
      |            ~~~~~~^~
a.cc:18:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   18 |         if(random-1>kelipatan4) {
      |            ~~~~~~~~^~~~~~~~~~~
Language: C++

#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <algorithm>

using namespace std;

#define INF 1e9
#define MAXN 100005
#define MAXM 100005
#define MOD 1000000007
#define ll long long
#define vi vector<int>
#define vll vector<long long>
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define pii pair<int, int>

ll N;
vll A;
bool flag = false;
map<int, int> mp;

void solve(){
    rep(i,N){
        mp[A[i]]++;
    }

    if(2*mp[0] + 1 >= N) {
        flag = true;
    } else {
        N -= 2*mp[0];

        if(N % 2 == 1) N--;

        if(Xmp[2] == N) flag = true;
    }

    if(flag){
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

int main(){
    cin >> N;
    A.resize(N);

    rep(i, N) cin >> A[i];

    rep(i, N) A[i] %= 4;

    solve();
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:36:12: error: 'Xmp' was not declared in this scope; did you mean 'mp'?
   36 |         if(Xmp[2] == N) flag = true;
      |            ^~~
      |            mp
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
int main() {
  ll n;
  cin>>n;
  ll a[n+5];
  ll tuyoi=0;nomal=0,yowa=0;
  rep(i,n){
    cin>>a[i];
    if(a[i]%4==0){
      tuyoi++;
    }
    else if(a[i]%2==0){
      nomal++;
    }
    else{
      yowa++;
    }
  }
  if(nomal==0){
    if(yowa-1<=tuyoi){
      cout<<"Yes"<<endl;
    }
    else{
      cout<<"No"<<endl;
    }
  }
  else{
    if(yowa<=tuyoi){
       cout<<"Yes"<<endl;
    }
    else{
      cout<<"No"<<endl;
    }
  }
}
      


Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: 'nomal' was not declared in this scope
   10 |   ll tuyoi=0;nomal=0,yowa=0;
      |              ^~~~~
a.cc:10:22: error: 'yowa' was not declared in this scope
   10 |   ll tuyoi=0;nomal=0,yowa=0;
      |                      ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
int main() {
  ll n;
  cin>>n;
  ll a[n+5];
  ll tuyoi=0;nomal=0,yowa=0;
  rep(i,n){
    cin>>a[i];
    if(a[i]%4==0){
      tuyoi++;
    }
    else if(a[i]%2==0){
      nomal++;
    }
    else{
      yowa++;
    }
  }
  if(nomal==0){
    if(yowa-1<=tuyoi){
      cout<<"Yes"<<endl;
    }
    else{
      cout<<"No"<<endl;
    }
  }
  else{
    if(yowa<=tuyo){
       cout<<"Yes"<<endl;
    }
    else{
      cout<<"No"<<endl;
    }
  }
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: 'nomal' was not declared in this scope
   10 |   ll tuyoi=0;nomal=0,yowa=0;
      |              ^~~~~
a.cc:10:22: error: 'yowa' was not declared in this scope
   10 |   ll tuyoi=0;nomal=0,yowa=0;
      |                      ^~~~
a.cc:32:14: error: 'tuyo' was not declared in this scope; did you mean 'tuyoi'?
   32 |     if(yowa<=tuyo){
      |              ^~~~
      |              tuyoi
Language: C++

#include "bits/stdc++.h"

#define sp <<" "
#define el <<"\n"
#define S second
#define F first
#define mp make_pair
#define pb push_back
#define pf push_front
#define pob pop_back
#define obit __builtin_popcount
#define pof pop_front
#define For(i,a,n) for(i=a;i<n;i++)
#define all(ar) ar.begin(),ar.end() 
using namespace std;

typedef long long ll;
typedef unsigned long long ul;
typedef unsigned short int us;
typedef short int ss;
typedef long double ld;
const ll mod = 1000000007;



int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    /*
#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#endif
    //*/
    int n;
    cin>>n;
    int m4 = 0, nm4 = 0,i;
    For(i,0,n){
        int x;
        cin>>x;
        if(x != 2){
            if(x % 4 == 0) m4++;
            else nm4++;
        }
    }
    int si, a = m4.size(), b = nm4.size();
    si = (a + b)/2;
    if(a >= si) cout<<"Yes";
    else cout<<"No";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:20: error: request for member 'size' in 'm4', which is of non-class type 'int'
   46 |     int si, a = m4.size(), b = nm4.size();
      |                    ^~~~
a.cc:47:15: error: 'b' was not declared in this scope
   47 |     si = (a + b)/2;
      |               ^
Language: C++

#include "bits/stdc++.h"

#define sp <<" "
#define el <<"\n"
#define S second
#define F first
#define mp make_pair
#define pb push_back
#define pf push_front
#define pob pop_back
#define obit __builtin_popcount
#define pof pop_front
#define For(i,a,n) for(i=a;i<n;i++)
#define all(ar) ar.begin(),ar.end() 
using namespace std;

typedef long long ll;
typedef unsigned long long ul;
typedef unsigned short int us;
typedef short int ss;
typedef long double ld;
const ll mod = 1000000007;



int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    /*
#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#endif
    //*/
    int n;
    cin>>n;
    int m4 = 0, nm4 = 0,i;
    For(i,0,n){
        int x;
        cin>>x;
        if(x != 2){
            if(x % 4 == 0) m4++;
            else nm4++;
        }
    }
    int si = (m4.size() + nm4.size())/2;
    if(m4.size() >= si) cout<<"Yes";
    else cout<<"No";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:18: error: request for member 'size' in 'm4', which is of non-class type 'int'
   46 |     int si = (m4.size() + nm4.size())/2;
      |                  ^~~~
a.cc:46:31: error: request for member 'size' in 'nm4', which is of non-class type 'int'
   46 |     int si = (m4.size() + nm4.size())/2;
      |                               ^~~~
a.cc:47:11: error: request for member 'size' in 'm4', which is of non-class type 'int'
   47 |     if(m4.size() >= si) cout<<"Yes";
      |           ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)

int main(){
    ll N;
    cin >> N;
    ll zero = 0, two = 0, odd = 0;
    rep(i, 0, N){
        ll a;
        cin >> a;
        if(a % 4 == 0) zero++;
        if(a % 4 == 2) two++;
        if(a % 2 == 1) odd++;
    }
    two = min(1, two);
    if(two + odd > zero + 1){
        cout << "No" << endl;
    }else{
        cout << "Yes" << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:14: error: no matching function for call to 'min(int, ll&)'
   17 |     two = min(1, two);
      |           ~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:17:14: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   17 |     two = min(1, two);
      |           ~~~^~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:17:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   17 |     two = min(1, two);
      |           ~~~^~~~~~~~
Language: C++

#define _GLIBCXX_DEBUG
#include<algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<iostream>
#include<vector>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#include<string>
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define rep2(i,s,n) for(int i=s;i< (int)n; i++)
#define ll long long 
#define all(v) v.begin(),v.end()
using namespace std;
ll two(ll a){
  ll key=0;
  while(a%2==0) {
    a/=2;
    key++;
  }
  return min((ll)2,key);
}
int main(){
  ll n ; cin >>n;
  vector<ll> a(n);
  rep(i,n)  cin >>a[i];
  rep(i,n) a[i]=two(a[i]);
  map<ll,ll> mp;
  rep(i,n)mp[a[i]]++;
  if(mp[1]==0&&mp[0]<=mp[2]+1) cout <<"Yes"<<endl;
  else if(mp[1]>0&&mp[0]<=mp[2]) cout <<"Yes"<<endl;
  else cout <<"No"<<endl;
}#define _GLIBCXX_DEBUG
#include<algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<iostream>
#include<vector>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#include<string>
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define rep2(i,s,n) for(int i=s;i< (int)n; i++)
#define ll long long 
#define all(v) v.begin(),v.end()
using namespace std;
ll two(ll a){
  ll key=0;
  while(a%2==0) {
    a/=2;
    key++;
  }
  return min((ll)2,key);
}
int main(){
  ll n ; cin >>n;
  vector<ll> a(n);
  rep(i,n)  cin >>a[i];
  rep(i,n) a[i]=two(a[i]);
  map<ll,ll> mp;
  rep(i,n)mp[a[i]]++;
  if(mp[1]==0&&mp[0]<=mp[2]+1) cout <<"Yes"<<endl;
  else if(mp[1]>0&&mp[0]<=mp[2]) cout <<"Yes"<<endl;
  else cout <<"No"<<endl;
}

Compiler output:
a.cc:38:2: error: stray '#' in program
   38 | }#define _GLIBCXX_DEBUG
      |  ^
a.cc:38:3: error: 'define' does not name a type
   38 | }#define _GLIBCXX_DEBUG
      |   ^~~~~~
a.cc:57:4: error: redefinition of 'long long int two(long long int)'
   57 | ll two(ll a){
      |    ^~~
a.cc:20:4: note: 'long long int two(long long int)' previously defined here
   20 | ll two(ll a){
      |    ^~~
a.cc:65:5: error: redefinition of 'int main()'
   65 | int main(){
      |     ^~~~
a.cc:28:5: note: 'int main()' previously defined here
   28 | int main(){
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> PLL;
typedef vector<int> VI;
typedef vector<ll> VLL;
typedef vector<string> VS;
typedef vector<PLL> VP;
#define rep(i,n) for (ll i=0; i<(ll)(n); i++)
#define repd(i,n) for (ll i=n-1; i>=0; i--)
#define rept(i,m,n) for(ll i=m; i<n; i++)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define PF push_front
#define PB push_back
#define SORT(V) sort((V).begin(), (V).end())
#define RVERSE(V) reverse((V).begin(), (V).end())
#define paired make_pair
#define PRINT(V) for(auto v : (V)) cout << v << " "

int main()
{
    ll N; cin >> N;
    VLL a(N);
    ll four=0;
    ll two=0;
    rep(i,N){
        cin >> a.at(i);
        if(a.at(i)%4==0){
            four++;
        }
        if(a.at(i)%4!=0 && a.at(i)%2==0){
            two++;
        }
    }
    ll judge=N-four*2;
    if(judge<=0){
        cout << "Yes" << endl;
        return 0;
    }
    else{
        if(judge=<two){
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:18: error: expected primary-expression before '<' token
   43 |         if(judge=<two){
      |                  ^
Language: Java

import java.util.*;

public class Main {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int count4 = 0;
        int count2 = 0;

        for (int i = 0; i < n; i++) {
            int val = sc.nextInt();
            if (val % 4 == 0) {
                count4++;
            } else if (val % 2 ==0) {
                count2++;
            }
        }

        if (count4 * 3 >= n) {
            System.out.println("Yes");
        } else {
            int count = n - count4 * 3;
            if (count <= count2) {
                System.out.println("Yes");
            } else {
                System.out.println("No");
            }
        } else {
            System.out.println("No");
        }
        
    }
}

Compiler output:
Main.java:28: error: 'else' without 'if'
        } else {
          ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define PI 3.14159265358979323846
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr long long INFL = numeric_limits<long long>::max() / 2;
constexpr int MOD = 1000000007;
using Graph = vector<vector<int>>;



int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int N;
    cin >> N;
    int a[N];
    int b[N];
    rep(i,N) {
        cin >> a[i];
        b[i]=0;
        while(A[i]%2=0){
            a[i]/=2;
            b[i]++;
        }
    }
    string ans="Yes";
    rep(i,N-1){
        if(b[i]+b[i+1]<2){
            ans="No";
            break;
        }
    }
    cout << ans << endl;





}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:15: error: 'A' was not declared in this scope
   23 |         while(A[i]%2=0){
      |               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define PI 3.14159265358979323846
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr long long INFL = numeric_limits<long long>::max() / 2;
constexpr int MOD = 1000000007;
using Graph = vector<vector<int>>;



int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int N;
    cin >> N;
    int a[N];
    int b[N];
    rep(i,N) {
        cin >> A[i];
        b[i]=0;
        while(A[i]%2=0){
            A[i]/=2;
            b[i]++;
        }
    }
    string ans="Yes";
    rep(i,N-1){
        if(b[i]+b[i+1]<2){
            ans="No";
            break;
        }
    }
    cout << ans << endl;





}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:16: error: 'A' was not declared in this scope
   21 |         cin >> A[i];
      |                ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n, num2=0, num4=0;
  	cin >> n;
  	long long temp;
  	for(int i=0;i<n;i++){
    	cin >> temp;
      	if(temp&4==0)num4++;
      	else if(temp&2==0)num2++;
    }
  	cout << (num4*2+temp2+1>=n?"Yes":"No");
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:12:25: error: 'temp2' was not declared in this scope; did you mean 'temp'?
   12 |         cout << (num4*2+temp2+1>=n?"Yes":"No");
      |                         ^~~~~
      |                         temp
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=1000000007;
const double PI=3.14159265358979;
const ll INF= pow(10,18);
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";

int main() {
  ll n;
  cin >> n;
  vl a(n);
  rep(i,n){
    cin >> a[i];
  }
  ll cnt4=0,cnt2=0;
  rep(i,n){
    if(a[i]%4==0){
      cnt4++;
    }
    else if(a[i]%2==0){
      cnt2++;
    }
  }
  if(2*cnt4+cnt2>=n){
    cout << "Yes" << endl;
  }
  else
    cout << "No" << endl;
  }
}

Compiler output:
a.cc:37:1: error: expected declaration before '}' token
   37 | }
      | ^
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<iomanip>
#include<algorithm>
#include<queue>
#include<stack>
#include<list>
#include<map>
#include<deque>
#include<math.h>
using namespace std;
#define ll long long
int main(){
    ll N;
    cin >> N;
    ll i;
    ll a=0,b=0,t;
    for(i=0;i<N;i++){
        cin >> t;
        if(t%4==0)a++;
        else if(t%2==0)b++;
    }
    if(2*a+max(1,b)>=2*N-2)cout<<"Yes"<<endl;else cout << "No" <<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:15: error: no matching function for call to 'max(int, long long int&)'
   24 |     if(2*a+max(1,b)>=2*N-2)cout<<"Yes"<<endl;else cout << "No" <<endl;
      |            ~~~^~~~~
In file included from /usr/include/c++/14/string:51,
                 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/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:24:15: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   24 |     if(2*a+max(1,b)>=2*N-2)cout<<"Yes"<<endl;else cout << "No" <<endl;
      |            ~~~^~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:5:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:24:15: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   24 |     if(2*a+max(1,b)>=2*N-2)cout<<"Yes"<<endl;else cout << "No" <<endl;
      |            ~~~^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define REP(i,n) for(int(i)=0;(i)<(n);++(i));

int main () {
  int n;
    cin >> n;
  ll a[n];
  REP(i, n) {
    cin >> a[i];
  }
 
  
  int cnt = 0;
  int cnt4 = 0;
  REP(i ,n) {
    if (a[i] % 4 == 0) {
      cnt++;
      cnt4++;
    }
    else if (a[i] % 2 ==1) cnt--;
  }
  
  if (cnt >= 0) cout << "Yes";
  else if (cnt == -1 and cnt4 >= n/2) cout << "Yes";
  else cout << "No";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: 'i' was not declared in this scope
   12 |     cin >> a[i];
      |              ^
a.cc:19:11: error: 'i' was not declared in this scope
   19 |     if (a[i] % 4 == 0) {
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define rep(i, n) for (int (i) = 0; (i) < (n); ++(i));

int main () {
  int n;
    cin >> n;
  ll a[n];
  rep(i, n) cin >> a[i];
  
  int cnt = 0;
  int cnt4 = 0;
  rep(i ,n) {
    if (a[i] % 4 == 0) {
      cnt++;
      cnt4++;
    }
    else if (a[i] % 2 ==1) cnt--;
  }
  
  if (cnt >= 0) cout << "Yes";
  else if (cnt == -1 and cnt4 >= n/2) cout << "Yes";
  else cout << "No";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:22: error: 'i' was not declared in this scope
   11 |   rep(i, n) cin >> a[i];
      |                      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; ++i);

int main () {
  int n;
    cin >> n;
  ll a[n];
  rep(int i, n) cin >> a[i];
  
  int cnt = 0;
  int cnt4 = 0;
  rep(i ,n) {
    if (a[i] % 4 == 0) {
      cnt++;
      cnt4++;
    }
    else if (a[i] % 2 ==1) cnt--;
  }
  
  if (cnt >= 0) cout << "Yes";
  else if (cnt == -1 and cnt4 >= n/2) cout << "Yes";
  else cout << "No";
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:24: error: two or more data types in declaration of 'i'
    5 | #define rep(i, n) for (int i = 0; i < n; ++i);
      |                        ^~~
a.cc:11:3: note: in expansion of macro 'rep'
   11 |   rep(int i, n) cin >> a[i];
      |   ^~~
a.cc:5:37: error: expected initializer before '<' token
    5 | #define rep(i, n) for (int i = 0; i < n; ++i);
      |                                     ^
a.cc:11:3: note: in expansion of macro 'rep'
   11 |   rep(int i, n) cin >> a[i];
      |   ^~~
a.cc:5:37: error: expected ';' before '<' token
    5 | #define rep(i, n) for (int i = 0; i < n; ++i);
      |                                     ^
a.cc:11:3: note: in expansion of macro 'rep'
   11 |   rep(int i, n) cin >> a[i];
      |   ^~~
a.cc:5:37: error: expected primary-expression before '<' token
    5 | #define rep(i, n) for (int i = 0; i < n; ++i);
      |                                     ^
a.cc:11:3: note: in expansion of macro 'rep'
   11 |   rep(int i, n) cin >> a[i];
      |   ^~~
a.cc:5:40: error: expected ')' before ';' token
    5 | #define rep(i, n) for (int i = 0; i < n; ++i);
      |                       ~                ^
a.cc:11:3: note: in expansion of macro 'rep'
   11 |   rep(int i, n) cin >> a[i];
      |   ^~~
a.cc:11:7: error: expected primary-expression before 'int'
   11 |   rep(int i, n) cin >> a[i];
      |       ^~~
a.cc:5:44: note: in definition of macro 'rep'
    5 | #define rep(i, n) for (int i = 0; i < n; ++i);
      |                                            ^
a.cc:11:26: error: 'i' was not declared in this scope
   11 |   rep(int i, n) cin >> a[i];
      |                          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; ++i);

int main () {
  int n;
    cin >> n;
  ll a[n];
  rep(i, n) cin >> a[i];
  
  int cnt = 0;
  int cnt4 = 0;
  rep(int i ,n) {
    if (a[i] % 4 == 0) {
      cnt++;
      cnt4++;
    }
    else if (a[i] % 2 ==1) cnt--;
  }
  
  if (cnt >= 0) cout << "Yes";
  else if (cnt == -1 and cnt4 >= n/2) cout << "Yes";
  else cout << "No";
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:22: error: 'i' was not declared in this scope
   11 |   rep(i, n) cin >> a[i];
      |                      ^
a.cc:5:24: error: two or more data types in declaration of 'i'
    5 | #define rep(i, n) for (int i = 0; i < n; ++i);
      |                        ^~~
a.cc:15:3: note: in expansion of macro 'rep'
   15 |   rep(int i ,n) {
      |   ^~~
a.cc:5:37: error: expected initializer before '<' token
    5 | #define rep(i, n) for (int i = 0; i < n; ++i);
      |                                     ^
a.cc:15:3: note: in expansion of macro 'rep'
   15 |   rep(int i ,n) {
      |   ^~~
a.cc:5:37: error: expected ';' before '<' token
    5 | #define rep(i, n) for (int i = 0; i < n; ++i);
      |                                     ^
a.cc:15:3: note: in expansion of macro 'rep'
   15 |   rep(int i ,n) {
      |   ^~~
a.cc:5:37: error: expected primary-expression before '<' token
    5 | #define rep(i, n) for (int i = 0; i < n; ++i);
      |                                     ^
a.cc:15:3: note: in expansion of macro 'rep'
   15 |   rep(int i ,n) {
      |   ^~~
a.cc:5:40: error: expected ')' before ';' token
    5 | #define rep(i, n) for (int i = 0; i < n; ++i);
      |                       ~                ^
a.cc:15:3: note: in expansion of macro 'rep'
   15 |   rep(int i ,n) {
      |   ^~~
a.cc:15:7: error: expected primary-expression before 'int'
   15 |   rep(int i ,n) {
      |       ^~~
a.cc:5:44: note: in definition of macro 'rep'
    5 | #define rep(i, n) for (int i = 0; i < n; ++i);
      |                                            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; ++i);

int main () {
  int n;
    cin >> n;
  ll a[n];
  rep(i, n) cin >> a[i];
  
  int cnt = 0;
  int cnt4 = 0;
  rep(i ,n) {
    if (a[i] % 4 == 0) {
      cnt++;
      cnt4++;
    }
    else if (a[i] % 2 ==1) cnt--;
  }
  
  if (cnt >= 0) cout << "Yes";
  else if (cnt == -1 and cnt4 >= n/2) cout << "Yes";
  else cout << "No";
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:22: error: 'i' was not declared in this scope
   11 |   rep(i, n) cin >> a[i];
      |                      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

typedef ll long long;
#define rep(i, n) for (int i = 0; i < n; ++i);

int main () {
  int n;
    cin >> n;
  ll a[n];
  rep(i, n) cin >> a[i];
  
  int cnt = 0;
  int cnt4 = 0;
  rep(i ,n) {
    if (a[i] % 4 == 0) {
      cnt++;
      cnt4++;
    }
    else if (a[i] % 2 ==1) cnt--;
  }
  
  if (cnt >= 0) cout << "Yes";
  else if (cnt == -1 and cnt4 >= n/2) cout << "Yes";
  else cout << "No";
    
}


Compiler output:
a.cc:4:9: error: 'll' does not name a type
    4 | typedef ll long long;
      |         ^~
a.cc: In function 'int main()':
a.cc:10:3: error: 'll' was not declared in this scope
   10 |   ll a[n];
      |   ^~
a.cc:11:20: error: 'a' was not declared in this scope
   11 |   rep(i, n) cin >> a[i];
      |                    ^
a.cc:11:22: error: 'i' was not declared in this scope
   11 |   rep(i, n) cin >> a[i];
      |                      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

typedef ll long long;
#define rep(i, n) for (int i = 0; i < n; ++i);

int main () {
  int n;
  vector<ll> v;
  cin >> n;
  rep(i, n) cin >> a[i];
  
  int cnt = 0;
  int cnt4 = 0;
  rep(i ,n) {
    if (a[i] % 4 == 0) {
      cnt++;
      cnt4++;
    }
    else if (a[i] % 2 ==1) cnt--;
  }
  
  if (cnt >= 0) cout << "Yes";
  else if (cnt == -1 and cnt4 >= n/2) cout << "Yes";
  else cout << "No";
    
}

Compiler output:
a.cc:4:9: error: 'll' does not name a type
    4 | typedef ll long long;
      |         ^~
a.cc: In function 'int main()':
a.cc:9:10: error: 'll' was not declared in this scope
    9 |   vector<ll> v;
      |          ^~
a.cc:9:12: error: template argument 1 is invalid
    9 |   vector<ll> v;
      |            ^
a.cc:9:12: error: template argument 2 is invalid
a.cc:11:20: error: 'a' was not declared in this scope
   11 |   rep(i, n) cin >> a[i];
      |                    ^
a.cc:11:22: error: 'i' was not declared in this scope
   11 |   rep(i, n) cin >> a[i];
      |                      ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
using namespace std;

long longmain(void){
    long long n;
    cin >> n;
    vector<long long> a(n);
    for(auto &x : a){
        cin >> x;
    }
    long long c2,c4;
    c2=c4=0;
    for(auto x : a){
        if(x%4 == 0)
            c4++;
        if(x%2 == 0)
            c2++;
    }
    if(c4 * 2 >= n - c2 && (c4 *2 - (n - c2))>= (c2 - c4)%2 )
        cout << "Yes";
    else
    {
        cout << "No";
    }
    

    return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<queue>
#include<algorithm>
#include<map>
#include<set>
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;


int main() {
	int n;
	cin >> n;
	int a, b, c;
	rep(i, n) {
		ll k;
		cin >> k;
		if (k % 4 == 0) {
			c++;
		}
		else if (k % 2 == 0) {
			b++;
		}
		else a++;
	}
	if (c >= a) {
		cout << "Yes" << endl;
		return 0;
	}
	if (c == a - 1 && b == 0) {
		cout << "Yes" << endl;
		return;
	}
	cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:17: error: return-statement with no value, in function returning 'int' [-fpermissive]
   34 |                 return;
      |                 ^~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define MOD 1000000007
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)

signed main(){

	lli n;
	cin>>n;
	vector<lli> a(n);
    int c2 = 0;
    int c4 = 0;
    int c = 0;
 
    REP(i, 0, n) {
        if (a[i] % 4 == 0) c4++;
        else if (a[i] % 2 == 0) c2++;
        else c++;
    }
 
    if (c4 + 1 == c && N == (c4 + c)) cout<<"Yes"<<endl;
    else if (c4 < c) cout<<"No"<<endl;
 	else{ cout<<"Yes"<<endl;}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:24: error: 'N' was not declared in this scope
   30 |     if (c4 + 1 == c && N == (c4 + c)) cout<<"Yes"<<endl;
      |                        ^
Language: C++

#include<bits/stdc++.h>
#define all(v) v.begin(), v.end() 
using namespace std;

typedef long long ll;

inline int read(){
  int a=0;static char c;
  while((c=tc())<48||c>57);
  while(c>=48&&c<=57)a=a*10+c-48,c=tc();
  return a;
}

const int N = 1e5 + 5;

vector<int> cnt[4];
int res[N];

int main() {
   ios_base::sync_with_stdio(false);
   cin.tie(NULL);
   int n;
   n = read();
   for(int i=0; i<n; ++i) {
       int x = read();
       cnt[x%4].push_back(x);
   }
   int p = n-1;
   for(int i=n-1; i>=0; --i) {
       if(cnt[2].empty()) break;
       res[i] = cnt[2].back();
       cnt[2].pop_back();
       p = i;
   }
   for(int i=p-1; i>=0; i-=2) {
       if(cnt[0].empty()) break;
       res[i] = cnt[0].back();
       cnt[0].pop_back();
   }
   for(int i=0; i<n; ++i) {
       if(res[i] == 0) {
           if(cnt[0].empty()) break;
           res[i] = cnt[0].back();
           cnt[0].pop_back();
       }
   }
   for(int i=0; i<n; ++i) {
       if(res[i] == 0) {
           if(!cnt[1].empty()) {
               res[i] = cnt[1].back();
               cnt[1].pop_back();
           }
           else if(!cnt[3].empty()) {
               res[i] = cnt[3].back();
               cnt[3].pop_back();
           } else {
                puts("No");
             	return 0;
           }
       }
   }
   for(int i=0; i<n-1; ++i) {
        if((res[i] * res[i+1]) % 4 != 0) {
                puts("No");
            return 0;
        }
   }
   puts("Yes");
   return 0;
}



Compiler output:
a.cc: In function 'int read()':
a.cc:9:12: error: 'tc' was not declared in this scope; did you mean 'c'?
    9 |   while((c=tc())<48||c>57);
      |            ^~
      |            c
a.cc:10:36: error: 'tc' was not declared in this scope; did you mean 'c'?
   10 |   while(c>=48&&c<=57)a=a*10+c-48,c=tc();
      |                                    ^~
      |                                    c
Language: C++

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
ll MOD = 1000000007;

ll modpow(ll a,ll n,ll m){//modpow(a,n,m) := a ^ n (mod m)
  ll res = 1;
  while(n > 0){
    if(n & 1)res = res * a % m;
    a = a * a % m;
    n >>= 1;
  }
  return res;
}

ll modinv(ll a,ll p){//modinv(a,p) := pを法とするaの逆元(※pは素数でなければならない)
    ll res = modpow(a,p-2,p);
    return res;
}


int main(){
  ll N;
  cin >> N;
  vector<ll> A(N);
  ll cnt4 = 0,cnt2 = 0;
  for(ll i = 0;i < N;i++){
    cin >> A[i];
    A[i] %= 4;
    if(A[i] == 0){
      cnt4++;
    }
    if(A[i] == 2){
      cnt2++;
    }
  }
  if(cnt4 * 2 >= N-cnt4){
    cout << "Yes" << endl;
    return 0;
  }
  if(cnt4 * 2 > t){
    cnt2 -= cnt4 * 2 - t;
  }
  ll cnt27 = cnt2 / 2;
  if(cnt2 % 2 == 1){
    cnt2 = 1;
  }else{
    cnt2 = 0;
  }
  ll t = N - cnt4 - cnt2;
  if(cnt4 * 2>= t && cnt2 == 0){
    cout << "Yes" << endl;
    return 0;
  }
  if(cnt4 * 2 > t && cnt2 == 1){
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:17: error: 't' was not declared in this scope
   42 |   if(cnt4 * 2 > t){
      |                 ^
Language: Java

import java.util.*;
import java.lang.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		long[] a = new long[N];
		int count4 = 0,count2 = 0;
		for( int i=0; i<N; i++ ){
			a[i] = sc.nextLong();
			if( a[i]%4==0 ){
				count4++;
			}
			if( a[i]%4!=0 && a[i]%2==0 ){
				count2++;
			}
		}
		if( count4>=N/2 ){
			System.out.println("Yes");
		}else if( count2>=N-(count*2) ){
			System.out.println("Yes");
		}else{
			System.out.println("No");
		}
	}
}


Compiler output:
Main.java:21: error: cannot find symbol
		}else if( count2>=N-(count*2) ){
		                     ^
  symbol:   variable count
  location: class Main
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;

typedef long long int ll;

int main(){
  int N;
  cin >> N;
  vector<ll> A(N);
  int cnt4=0,cnt2=0;
  for(int i = 0;i < N;i++){
    cin >> A[i];
    if(A[i] % 4 == 0)cnt4++;
    if(A[i] % 4 == 2)cnt2++;
  }
  int B = N - cnt4 - cnt2;
  if(cnt4 * 2 >= B && (cnt2 > 1 || cnt2 == 0){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  /*cout << B << "/" << cnt4 << "/" << cnt2 << endl;*/

}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:46: error: expected ')' before '{' token
   17 |   if(cnt4 * 2 >= B && (cnt2 > 1 || cnt2 == 0){
      |     ~                                        ^
      |                                              )
a.cc:24:1: error: expected primary-expression before '}' token
   24 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

int main() {
    int n;
    cin >> n;
    int count[4] = {};
    for (int a; cin >> a; count[a % 4]++) {
    }
    if (count[0] == n || count[1] == count[3] && count[1] == n || count[2] == n) {
        cout << "Yes";
    } else {
        count << "No";
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:15: error: invalid operands of types 'int [4]' and 'const char [3]' to binary 'operator<<'
   13 |         count << "No";
      |         ~~~~~ ^~ ~~~~
      |         |        |
      |         int [4]  const char [3]
Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const ll mod = 1000000007;
const ll INF = mod * mod;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
typedef vector<int> vec;
typedef vector<string> svec;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
//#define int long long

void solve() {
    int N; cin >> N;
    int a[100100];
    rep(i, N) cin >> a[i];
    map<int, int> mp;
    rep(i, N) {
        if(a[i] % 2 = 1) mp[0] ++;
        else if(a[i] % 4 == 2) mp[1] ++;
        else mp[2] ++;
    }
    int A = mp[2], B = mp[0] + (mp[1] != 0 ? 1 : 0);
    if(B <= A + 1) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//init();
	solve();
	//cout << "finish" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:55:17: error: lvalue required as left operand of assignment
   55 |         if(a[i] % 2 = 1) mp[0] ++;
      |            ~~~~~^~~