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

//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
//#pragma GCC target("avx,avx2")
//#pragma GCC target("avx2")
//#pragma GCC optimize("O3")

//# include <x86intrin.h>
# include <bits/stdc++.h>

# include <ext/pb_ds/assoc_container.hpp>
# include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;
 
template<typename T> using ordered_set = tree <T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define _USE_MATH_DEFINES_
#define ll long long
#define ld long double
#define Accepted 0
#define pb push_back
#define mp make_pair
#define sz(x) (int)(x.size())
#define every(x) x.begin(),x.end()
#define F first
#define S second
#define lb lower_bound
#define ub upper_bound
#define For(i,x,y)  for (ll i = x; i <= y; i ++) 
#define FOr(i,x,y)  for (ll i = x; i >= y; i --)
#define SpeedForce ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
// ROAD to...                                                                                                                                                                                                                Red

inline void Input_Output () {
	//freopen(".in", "r", stdin);
   //freopen(".out", "w", stdout);
}

const double eps = 0.000001;
const ld pi = acos(-1);
const int maxn = 1e7 + 9;
const int mod = 998244353;
const ll MOD = 1e18 + 9;
const ll INF = 1e18 + 123;
const int inf = 2e9 + 11;
const int mxn = 1e6 + 9;
const int N = 6e5 + 123;                                          
const int M = 22;
const int pri = 997;
const int Magic = 2101;

const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
mt19937 gen(chrono::steady_clock::now().time_since_epoch().count());
 
int rnd (int l, int r) {
	return uniform_int_distribution<int> (l, r)(gen);
}
 
int n, m, k;
int a[3030];
ll dp[3030][3030];
int pw[3030];
ll ans = 0;

int main () {
	SpeedForce;
	
	cin >> n >> m;
	pw[0] = 1;
	For (i, 1, n) pw[i]= (pw[i-1]*2) % mod;
	dp[0][0] = 1;
	For (i, 1, n) {
		cin >> a[i];
		for (int j = m; j >= a[i]; --j) {
			(dp[i][j] += dp[i-1][j-a[i]]) %= mod;
		}
		for (int j = m; j >= 0; --j) {
			dp[i][j] = (dp[i][j] + (dp[i-1][j] * 2)) % mod;
		}
		
		//cout << "now: " << i << ' ' << dp[i][m] << '\n';
		ans += dp[i][m] * (ll) pw[n-i];
		ans %= mod;

	}
	cout << dp[i][m] << '\n';

	return Accepted;
}

// B...a

Compiler output:
a.cc: In function 'int main()':
a.cc:87:20: error: 'i' was not declared in this scope; did you mean 'pi'?
   87 |         cout << dp[i][m] << '\n';
      |                    ^
      |                    pi
Language: C++

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define ll long long
#define ld long double
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,(n)-1,0)
#define all(v) v.begin(), v.end()
#define endk '\n'
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;
const ld eps = 1e-10;
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b){if(a>b) a=b;}
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b){if(a<b) a=b;}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int h1, m1, h2, m2, k;
  cin >> h1 >> m1 >> h2 >> m2 >> k;
  cout << h2*60+m2-(h1*60+m1)-k << endk;
  return 0;
}


Compiler output:
a.cc:2:10: fatal error: atcoder/all: No such file or directory
    2 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

ude <stdio.h>
int main (){
	int h1, m1, h2, m2, k;
	scanf ("%d %d %d %d %d", &h1, &m1, &h2, &m2, &k);
	int n = ((h2-h1)*60)+(m2-m1)-k;
	printf ("%d\n", n);
	return 0;
}

Compiler output:
a.cc:1:1: error: 'ude' does not name a type
    1 | ude <stdio.h>
      | ^~~
Language: C++

#include<stdio.h>
int main(){
	int H1;
	int M1;
	int H2;
	int M2;
	int K;
	scanf("%d %d %d %d %d", &H1,&M1,&H2,&M2,&K);
	if(M1==0){
		M1 = M1*10;
		if(M2==0){
			M2 = M2*10;
		}
	}
	total = M2-M1+100-K;
	printf("%d", &total);
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'total' was not declared in this scope
   15 |         total = M2-M1+100-K;
      |         ^~~~~
Language: C++

#include <stdio.h>

int main(){
int H1, M1, H2, M2, K;
scanf("%d %d %d %d %d", &H1, &M1, &H2, &M2, &K);
int jam= H2-H1;
if(jam==-jam){
    jam *= -1;
}
int mnt = M2-M1;
if(mnt==-mnt){
    mnt *= -1;
}
int per = jam + mnt;
int total = per * 60 - k;
printf("%d\n", total); 


    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:24: error: 'k' was not declared in this scope
   15 | int total = per * 60 - k;
      |                        ^
Language: C++

#include <stdio.h>

int main(){
int H1, M1, H2, M2, K;
scanf("%d %d %d %d %d", &H1, &M1, &H2, &M2, &K);
int jam= h2-h1;
if(jam==-jam){
    jam *= -1;
}
int mnt = m2-m1;
if(mnt==-mnt){
    mnt *= -1;
}
int per = jam + mnt;
int total = per * 60 - k;
printf("%d\n", total); 


    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: 'h2' was not declared in this scope; did you mean 'H2'?
    6 | int jam= h2-h1;
      |          ^~
      |          H2
a.cc:6:13: error: 'h1' was not declared in this scope; did you mean 'H1'?
    6 | int jam= h2-h1;
      |             ^~
      |             H1
a.cc:10:11: error: 'm2' was not declared in this scope; did you mean 'M2'?
   10 | int mnt = m2-m1;
      |           ^~
      |           M2
a.cc:10:14: error: 'm1' was not declared in this scope; did you mean 'M1'?
   10 | int mnt = m2-m1;
      |              ^~
      |              M1
a.cc:15:24: error: 'k' was not declared in this scope
   15 | int total = per * 60 - k;
      |                        ^
Language: C++

#include <stdio.h>

int main(){
int h1, m1, h2, m2, k;
scanf("%d %d %d %d %d", &h1, &m1, &h2, &m2, %k);


int jam= h2-h1;
if(jam==-jam){
    jam *= -1;
}
int mnt = m2-m1;
if(mnt==-mnt){
    mnt *= -1;
}
int per = jam + mnt;
int total = per * 60 - k;
printf("%d\n", total); 


    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:45: error: expected primary-expression before '%' token
    5 | scanf("%d %d %d %d %d", &h1, &m1, &h2, &m2, %k);
      |                                             ^
Language: C

#include <stdio.h>
int main(){
    
    int H1, M1, H2, M2, K;
    int output1, output2;
    int ans;
    
    scanf("%d %d %d %d %d", &H1, &M1, &H2, &M2, &K);
    output1 = H1*60+M1;
    output2 = H2*60+M2;
    ans = output2 - output1 - K;
    if(ans = k){
    	printf("0\n");
	}
	printf("%d\n", ans);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:14: error: 'k' undeclared (first use in this function)
   12 |     if(ans = k){
      |              ^
main.c:12:14: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(){
    
    int H1, M1, H2, M2, K;
    int output;
    
    scanf("%d %d %d %d %d", &H1, &M1, &H2, &M2, &K);
    output = ((H2 - H1)*60) + M1 + M2) - K;
    if(output == K){
    	printf("0\n");
	}
	    printf("%d\n", output);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:38: error: expected ';' before ')' token
    9 |     output = ((H2 - H1)*60) + M1 + M2) - K;
      |                                      ^
      |                                      ;
main.c:9:38: error: expected statement before ')' token
Language: C

#include <stdio.h>
int main (){
	int h1,m1;
	int h2,m2;
	int k,time;
	scanf("%d%d%d%d%d", &h1, &m1 ,&h2, &m2, &k);
	if(m1==0)
	{
		m1=0
	}
	else
	{
		m1=60-m1
	}
	if(m2==0)
	{
		m2=0
	}
	else
	{
		m2=60-m2;
	}
	time= ((h2-h1)*60+m1+m2)-k;
	printf("%d", time);
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:9:21: error: expected ';' before '}' token
    9 |                 m1=0
      |                     ^
      |                     ;
   10 |         }
      |         ~            
main.c:13:25: error: expected ';' before '}' token
   13 |                 m1=60-m1
      |                         ^
      |                         ;
   14 |         }
      |         ~                
main.c:17:21: error: expected ';' before '}' token
   17 |                 m2=0
      |                     ^
      |                     ;
   18 |         }
      |         ~
Language: C

#include<stdio.h>
int main(){
	int h1,m1,h2,m2,k;
	scanf("%d %d %d %d %d",&h1,&m2,&h2,&m2,&k);
		printf("%d",h2*60+m2-(h1*60+m1-k);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:50: error: expected ')' before ';' token
    5 |                 printf("%d",h2*60+m2-(h1*60+m1-k);
      |                       ~                          ^
      |                                                  )
main.c:6:18: error: expected ';' before '}' token
    6 |         return 0;
      |                  ^
      |                  ;
    7 | }
      | ~
Language: C

#include <stdio.h>

int main(){
    
    int H1, M1, H2, M2, K;

    scanf("%d %d %d %d %d", &H1, &M1, &H2, &M2, &K);
    int output = ((H2 - H1)*60) + M1 + M2) - K;
    if(output == K){
    	printf("0\n");
	}
	    printf("%d\n", output);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:42: error: expected ',' or ';' before ')' token
    8 |     int output = ((H2 - H1)*60) + M1 + M2) - K;
      |                                          ^
Language: C

#include<stdio.h>
int main(){
	int h1,m1,h2,m2,k;
	scanf("%d %d %d %d %d",&h1,&m2,&h2,&m2,&k);
		printf("%d",((h2*60+m2-h1*60+m1-k);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:51: error: expected ')' before ';' token
    5 |                 printf("%d",((h2*60+m2-h1*60+m1-k);
      |                             ~                     ^
      |                                                   )
main.c:6:18: error: expected ')' before '}' token
    6 |         return 0;
      |                  ^
      |                  )
    7 | }
      | ~                 
main.c:5:23: note: to match this '('
    5 |                 printf("%d",((h2*60+m2-h1*60+m1-k);
      |                       ^
main.c:6:18: error: expected ';' before '}' token
    6 |         return 0;
      |                  ^
      |                  ;
    7 | }
      | ~
Language: C

#include<stdio.h>
int main(){
	int h1,m1,h2,m2,k;
	scanf("%d %d %d %d %d",&h1,&m2,&h2,&m2,&k);
	int awal=h1*60;
	int akhir=h2*60;
		printf("%d",((akhir+m2)-((awal+m1)-k));
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:7:55: error: expected ')' before ';' token
    7 |                 printf("%d",((akhir+m2)-((awal+m1)-k));
      |                       ~                               ^
      |                                                       )
main.c:8:18: error: expected ';' before '}' token
    8 |         return 0;
      |                  ^
      |                  ;
    9 | }
      | ~
Language: C++

#include <stdio.h>

int main()
{
    int h1, m1, h2, m2, k;
    scanf("%d %d %d %d %d", &h1, &m1, &h2, &m2, &k);

    int period = ((h2*60) + m2) - (h1*60) + m1)) - k;
    printf("%d\n", period);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:47: error: expected ',' or ';' before ')' token
    8 |     int period = ((h2*60) + m2) - (h1*60) + m1)) - k;
      |                                               ^
Language: C++

#include <stdio.h>

int main()
{
    int h1, m1, h2, m2, k;
    scanf("%d %d %d %d %d", &h1, &m1, &h2, &m2, &k);

    int period = ((h2*60) + m2) - (h1*60) + m1)) - k;
    printf("%d", period);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:47: error: expected ',' or ';' before ')' token
    8 |     int period = ((h2*60) + m2) - (h1*60) + m1)) - k;
      |                                               ^
Language: C++

#include <stdio.h>

int main(){
int h1, m1, h2, m2, k;
int mnt;
scanf("%d %d %d %d %d "&h1, &m1, &h2, &m2, &k);
int jam= h2-h1;
if(jam==-per){
    jam *= -1;
}
mnt = m2-m1;
if(mnt==-mnt){
    mnt *= -1;
}
int per = (jam + mnt) - k;
int total = per * 60;
printf("%d", total); 


    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:24: error: invalid operands of types 'const char [16]' and 'int' to binary 'operator&'
    6 | scanf("%d %d %d %d %d "&h1, &m1, &h2, &m2, &k);
      |       ~~~~~~~~~~~~~~~~~^~~
      |       |                 |
      |       const char [16]   int
a.cc:8:10: error: 'per' was not declared in this scope
    8 | if(jam==-per){
      |          ^~~
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++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
int main() {
  int A, B, C, D, E;
  cin >> A >> B >> C >> D >> E;
  int T1, T2, TS;
  T1 = A * 60 + B;
  T2 = C * 60 + D;
  T3 = T2 - T1;
  cout << T3 - E << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'T3' was not declared in this scope; did you mean 'TS'?
   12 |   T3 = T2 - T1;
      |   ^~
      |   TS
Language: C++

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

int main()
{ 
    int h1,m1,h2,m2,k;
    cin>>h1>>m1>>h2>>m2>>k;
    int tot = (h2-h1)*60 + (m2-m1);
    tot -= k;
    cout<<tot<<nl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: 'nl' was not declared in this scope; did you mean 'ynl'?
   10 |     cout<<tot<<nl;
      |                ^~
      |                ynl
Language: C++

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

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

int main() {
    int a[5];
    rep(i,n)cin>>a[i];
    cout<<(a[2]-a[0])*60 - (a[3]-a[1])-a[4]<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: 'n' was not declared in this scope
    9 |     rep(i,n)cin>>a[i];
      |           ^
a.cc:5:39: note: in definition of macro 'rep'
    5 | #define rep(i,n) for(int i=0;i < (int)n;++i)
      |                                       ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int h,n,h1,n1,k
  cin >> h >> n >> h1 >> n1 >>k;
  int sum=0 ,sum2=0;
  sum=h*60+n;
  sum2=h1*60+n1;
  int g=sum2-sum;
  cout << g-k << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: expected initializer before 'cin'
    5 |   cin >> h >> n >> h1 >> n1 >>k;
      |   ^~~
a.cc:10:13: error: 'k' was not declared in this scope
   10 |   cout << g-k << endl;
      |             ^
Language: C++

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

void main() {
	int h1, h2, m1, m2, k;
	cin >> h1 >> m1 >> h2 >> m2 >> k;
    if h2 < h1
      h2 += 24;
	int ans = (h2 - h1) * 60 + (m2 - m1) - k;
	cout << ans << endl;
}

Compiler output:
a.cc:4:1: error: '::main' must return 'int'
    4 | void main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:7:8: error: expected '(' before 'h2'
    7 |     if h2 < h1
      |        ^~
      |        (
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int A; int B; int C; int D; int K;
  cin>>A>>B>>C>>D>>K:
  int S=60*A+B; int T=60*C+D;
   if(A>C)
  T+=60*24;
  cout<<T-S-K<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:21: error: expected ';' before ':' token
    5 |   cin>>A>>B>>C>>D>>K:
      |                     ^
      |                     ;
a.cc:9:11: error: 'S' was not declared in this scope
    9 |   cout<<T-S-K<<endl;
      |           ^
Language: Java

import java.util.Scanner;

public class Main1 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int h1 = sc.nextInt();
        int m1 = sc.nextInt();
        int h2 = sc.nextInt();
        int m2 = sc.nextInt();
        int k = sc.nextInt();

        int h = h2 - h1;
        int m = (h * 60 + m2) - m1;
        int ret = m - k;
        System.out.printf(String.valueOf(ret));
    }
}


Compiler output:
Main.java:3: error: class Main1 is public, should be declared in a file named Main1.java
public class Main1 {
       ^
1 error
Language: Java

public static void main(String[] args) {
      
  Scanner scan=new Scanner(System.in);
        int h1,m1,h2,m2,k;
        h1=scan.nextInt();
        m1=scan.nextInt();
        h2=scan.nextInt();
        m2=scan.nextInt();
        k=scan.nextInt();
        
        int time1=(h2*60+m2)-k;
        int period=time1-(h1*60+m1);
        System.out.println(period);
    }

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) {
              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: Java

import java.util.Scanner;
public class problem3 {
    public static void main(String[] args) {
      
  Scanner scan=new Scanner(System.in);
        int h1,m1,h2,m2,k;
        h1=scan.nextInt();
        m1=scan.nextInt();
        h2=scan.nextInt();
        m2=scan.nextInt();
        k=scan.nextInt();
        
        int time1=(h2*60+m2)-k;
        int period=time1-(h1*60+m1);
        System.out.println(period);
    }}

Compiler output:
Main.java:2: error: class problem3 is public, should be declared in a file named problem3.java
public class problem3 {
       ^
1 error
Language: Java

import java.util.Scanner;

public class Contest2 {

    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        int h1,m1,h2,m2,k;
        h1=scan.nextInt();
        m1=scan.nextInt();
        h2=scan.nextInt();
        m2=scan.nextInt();
        k=scan.nextInt();
        
        int time1=(h2*60+m2)-k;
        int period=time1-(h1*60+m1);
        System.out.println(period);
    }
    
}

Compiler output:
Main.java:3: error: class Contest2 is public, should be declared in a file named Contest2.java
public class Contest2 {
       ^
1 error
Language: C++

#include<bits/stdc+.h>

using namespace std;

int main(){
 	int h1,h2,m1,m2,k;
 	cin>>h1>>m1>>h2>>m2>>k;
  	int minutes;
  	if(m2>m1){
     	minutes = m1+60-m2;
      	minutes += (h1-1-h2)*60;
    }else{
      minutes = m1-m2;
      minutes += (h1-h2)*60;
    }
  cout<<minutes-k<<endl;
  return 0;
  
}

Compiler output:
a.cc:1:9: fatal error: bits/stdc+.h: No such file or directory
    1 | #include<bits/stdc+.h>
      |         ^~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

#ifdef LOCAL
#define debug(var) cerr << (#var) << " = " << (var) << endl;
#else
#define debug(var)
#endif

void init() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
}

void solve() {
  int h1, m1, h2, m2, k; scanf("%d%d%d%d%d", &h1, &m1, &h2, &m2, &k);
  h1 = h1*60+m1;
  h2 = h2*60+m2;
  h2 -= k;
  printf("%d", max(h2-h1, 0);
}

int main() {
  init();
  int t = 1; //scanf("%d", &t);
  while (t--) {
    solve();
  }
  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:20:29: error: expected ')' before ';' token
   20 |   printf("%d", max(h2-h1, 0);
      |         ~                   ^
      |                             )
Language: C++

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

int main(){
  int h1,m1,h2,m2,k;
  cin>>h1>>m1>>h2>>m2>>k;
  int x=h1*60+m1;
  int y=h2*60+m2;
  cout<<y-x-k;
}

Compiler output:
a.cc:1:9: fatal error: bits/stdc++h: No such file or directory
    1 | #include<bits/stdc++h>
      |         ^~~~~~~~~~~~~~
compilation terminated.
Language: C++

using namespace std;

#define rep(i, n) for(int i=0; i<n; ++i)
#define repit(it, li) for(auto it=li.begin(); it!=li.end(); it++)
#define ll long long int

int main(){
    int h1, m1, h2, m2, k;
    cin>>h1>>m1>>h2>>m2>>k;
    int st, en;
    st=h1*60+m1;
    en=h2*60+m2;
    int ans=en-st-k;
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'cin' was not declared in this scope
    9 |     cin>>h1>>m1>>h2>>m2>>k;
      |     ^~~
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:5: error: 'cout' was not declared in this scope
   14 |     cout << ans << endl;
      |     ^~~~
a.cc:14:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:20: error: 'endl' was not declared in this scope
   14 |     cout << ans << 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;
Language: C++

 #include<bits/stdc++.h>
 #include <ext/pb_ds/tree_policy.hpp>
 #include <ext/pb_ds/assoc_container.hpp>
 #include<chrono>
 using namespace std;
 using namespace std::chrono;      
 using namespace __gnu_pbds; 
 #define fastio     ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
 #define fi         first
 #define se         second
#define int         long long 
 #define pb         push_back
 #define emp        emplace_back
 #define vv(x)      vector<x>
 #define mp(x,y)    map<x,y>
 #define dq(x)      deque<x>
 #define pql(x)     priority_queue<x>
 #define pqs(x)     priority_queue<x,vv(x),greater<x> >
 #define M          1000000007
 #define forf(i,a,b) for(int i=a;i<b;i++)
 #define it(x)      x::iterator
 #define ll         long long 
 #define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
 #define time__(d)  for(long blockTime = 0; (blockTime == 0 ? (blockTime=clock()) != 0 : false); debug("%s time : %.4fs", d, (double)(clock() - blockTime) / CLOCKS_PER_SEC))
 #define vii        vector<int>
 #define big        3e18
 #define sm         -2e9
 #define mkr        make_pair
 #define vpi        vector<pair<int,int> >
 #define pii        pair<int,int>
 #define rng        500005
 #define sz(x)      (int)x.size()
 #define rv(x)      reverse(x.begin(),x.end())
 #define out(x)     cout<<x.fi<<" "<<x.se<<endl;

//#define ordered_set tree<pii, null_type,less<pii>, rb_tree_tag,tree_order_statistics_node_update> 
  
void pr_init()
{
   
    #ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
   
    #endif
}

int dp[200005][2];
void solve()
{
  
  string s;
  cin >> s;
  
  forf(j,0,sz(s))
  {
    if(s[i]=='?') s[i]='D';
  }
  
  cout<<s<<endl;
}

int32_t main()
{
  pr_init();
  fastio;
  solve();

 }
      

Compiler output:
a.cc: In function 'void solve()':
a.cc:57:10: error: 'i' was not declared in this scope
   57 |     if(s[i]=='?') s[i]='D';
      |          ^
Language: C++

#include <iostream>
using namespace std;

int main(int argc, char const *argv[]) {
        int H1, M1, H2, M2, K;
        cin >> H1 >> M1 >> H2 >> M2 >> K;
        int time = 60 * (h2 - h1) + m2 - m1 - k;

        cout << time << endl;
        return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:7:26: error: 'h2' was not declared in this scope; did you mean 'H2'?
    7 |         int time = 60 * (h2 - h1) + m2 - m1 - k;
      |                          ^~
      |                          H2
a.cc:7:31: error: 'h1' was not declared in this scope; did you mean 'H1'?
    7 |         int time = 60 * (h2 - h1) + m2 - m1 - k;
      |                               ^~
      |                               H1
a.cc:7:37: error: 'm2' was not declared in this scope; did you mean 'M2'?
    7 |         int time = 60 * (h2 - h1) + m2 - m1 - k;
      |                                     ^~
      |                                     M2
a.cc:7:42: error: 'm1' was not declared in this scope; did you mean 'M1'?
    7 |         int time = 60 * (h2 - h1) + m2 - m1 - k;
      |                                          ^~
      |                                          M1
a.cc:7:47: error: 'k' was not declared in this scope
    7 |         int time = 60 * (h2 - h1) + m2 - m1 - k;
      |                                               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ff(i,n) for(i=0;i<n;i++)
ll bg=1000000000000000000;
int main()
{ 
		ll n,i,vertex = 0;
		cin>>n;
		ll a[n+1],b[n+1];
		ff(i,n+1)
		   cin>>a[i];
		b[0] = 1-a[0];
		if(b[0]<0)
			cout<<"-1",return 0; 
		for(i=1;i<=n;i++)
		{
			b[i] = min(bg,2*b[i-1]-a[i]);
			if(b[i]<0)
				cout<<"-1",return 0;
		}
		b[n] = 0;
		for(i=n-1;i>=0;i--)
			b[i]=min(b[i],a[i+1]+b[i+1]);
		for(i=0;i<=n;i++)
			vertex+=(a[i]+b[i]);
		cout<<vertex; 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:36: error: expected primary-expression before 'return'
   15 |                         cout<<"-1",return 0;
      |                                    ^~~~~~
a.cc:20:44: error: expected primary-expression before 'return'
   20 |                                 cout<<"-1",return 0;
      |                                            ^~~~~~
Language: C++

# include <cstdio> 
# include <iostream> 
using namespace std ; 

int main()
{
  int H1, M1, H2, M2, K ; 
  cin >> H1 >> M1 >> H2 >> M2 >> K ; 
  
  cout << ((H2*60+M2) - (H1*60+M1) - K << endl ; 
  
	return 0 ; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:40: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   10 |   cout << ((H2*60+M2) - (H1*60+M1) - K << endl ;
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:10:47: error: expected ')' before ';' token
   10 |   cout << ((H2*60+M2) - (H1*60+M1) - K << endl ;
      |           ~                                   ^~
      |                                               )
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string t;
  int count =0;
  cin >> t;
for(int i = 0; i < t.size()+1;i++){
    if(t.at(i)=='P'){
        if(t.at(i)== 'D' || '?' ){
            count++;
        }
        }else{
            count++;
        }
    }
}
 
  cout << count << endl;
} 

Compiler output:
a.cc:19:3: error: 'cout' does not name a type
   19 |   cout << count << endl;
      |   ^~~~
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
Language: Java

import java.util.Map.Entry;
import java.util.*;
import java.math.*;
import org.w3c.dom.css.Counter;
  
public class main{
    public static void main(String[] args){
 
        Scanner sc = new Scanner(System.in);
        int H1 = sc.nextInt();
        int M1 = sc.nextInt();
        int H2 = sc.nextInt();
        int M2 = sc.nextInt();
        int K = sc.nextInt();

        int BigH2 = H2-H1;
        int BigH2M2 = BigH2*60+M2;
        int clearTime = BigH2M2-M1;
        int answer = clearTime - K ;
        System.out.println(answer);

/**
        int n = sc.nextInt();
        long k = sc.nextLong();
        int[] a = new int[n];
 
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }
 
        // 通った街を記録する配列
        ArrayList<Integer> list = new ArrayList<Integer>();
        list.add(1);    // 一つ目の町
 
        // ループの先頭の町がリストの何番目にあるかを格納する変数
        int check = -1;
 
        // 転送先を格納する変数。
        int temp = 1;   // 計算のため初期値１
 
        for (long i = 0; i < k; i++) {
            temp = a[temp-1];   //　転送先設定
            // 訪れた町かチェック
            // 訪れていた場合、ループ前のイントロ部分の長さを求める
            if (list.contains(temp)) {
                check = list.indexOf(temp);
            	break;
            }
            list.add(temp);
        }
        if(check == -1){
            System.out.println(temp);
        }else{
 
        // 合計移動回数をループ長で割った余りを求める
        int std = (int)(k-check) % (list.size() - check);
 
        System.out.println(list.get((int)(std + check)));
        }
        **/
    }
}

Compiler output:
Main.java:6: error: class main is public, should be declared in a file named main.java
public class main{
       ^
1 error
Language: Java

import java.util.Map.Entry;
import java.util.*;
import java.math.*;
import org.w3c.dom.css.Counter;
  
public class D{
    public static void main(String[] args){
 
        Scanner sc = new Scanner(System.in);
        int H1 = sc.nextInt();
        int M1 = sc.nextInt();
        int H2 = sc.nextInt();
        int M2 = sc.nextInt();
        int K = sc.nextInt();

        int BigH2 = H2-H1;
        int BigH2M2 = BigH2*60+M2;
        int clearTime = BigH2M2-M1;
        int answer = clearTime - K ;
        System.out.println(answer);

/**
        int n = sc.nextInt();
        long k = sc.nextLong();
        int[] a = new int[n];
 
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }
 
        // 通った街を記録する配列
        ArrayList<Integer> list = new ArrayList<Integer>();
        list.add(1);    // 一つ目の町
 
        // ループの先頭の町がリストの何番目にあるかを格納する変数
        int check = -1;
 
        // 転送先を格納する変数。
        int temp = 1;   // 計算のため初期値１
 
        for (long i = 0; i < k; i++) {
            temp = a[temp-1];   //　転送先設定
            // 訪れた町かチェック
            // 訪れていた場合、ループ前のイントロ部分の長さを求める
            if (list.contains(temp)) {
                check = list.indexOf(temp);
            	break;
            }
            list.add(temp);
        }
        if(check == -1){
            System.out.println(temp);
        }else{
 
        // 合計移動回数をループ長で割った余りを求める
        int std = (int)(k-check) % (list.size() - check);
 
        System.out.println(list.get((int)(std + check)));
        }
        **/
    }
}

Compiler output:
Main.java:6: error: class D is public, should be declared in a file named D.java
public class D{
       ^
1 error
Language: Java

package app;
import java.util.Map.Entry;
import java.util.*;
import java.math.*;
import org.w3c.dom.css.Counter;
  
public class main{
    public static void main(String[] args){
 
        Scanner sc = new Scanner(System.in);
        int H1 = sc.nextInt();
        int M1 = sc.nextInt();
        int H2 = sc.nextInt();
        int M2 = sc.nextInt();
        int K = sc.nextInt();

        int BigH2 = H2-H1;
        int BigH2M2 = BigH2*60+M2;
        int clearTime = BigH2M2-M1;
        int answer = clearTime - K ;
        System.out.println(answer);

/**
        int n = sc.nextInt();
        long k = sc.nextLong();
        int[] a = new int[n];
 
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }
 
        // 通った街を記録する配列
        ArrayList<Integer> list = new ArrayList<Integer>();
        list.add(1);    // 一つ目の町
 
        // ループの先頭の町がリストの何番目にあるかを格納する変数
        int check = -1;
 
        // 転送先を格納する変数。
        int temp = 1;   // 計算のため初期値１
 
        for (long i = 0; i < k; i++) {
            temp = a[temp-1];   //　転送先設定
            // 訪れた町かチェック
            // 訪れていた場合、ループ前のイントロ部分の長さを求める
            if (list.contains(temp)) {
                check = list.indexOf(temp);
            	break;
            }
            list.add(temp);
        }
        if(check == -1){
            System.out.println(temp);
        }else{
 
        // 合計移動回数をループ長で割った余りを求める
        int std = (int)(k-check) % (list.size() - check);
 
        System.out.println(list.get((int)(std + check)));
        }
        **/
    }
}

Compiler output:
Main.java:7: error: class main is public, should be declared in a file named main.java
public class main{
       ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a_1,b_1,a_2,b_2,c,ab;
	cin>>a_1>>b_1>>a_2>>b_2>>c;
	ab_12=((a_1-b_1)*60)+(a_2-b_2)
	cout<<ab-c;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'ab_12' was not declared in this scope; did you mean 'b_2'?
    7 |         ab_12=((a_1-b_1)*60)+(a_2-b_2)
      |         ^~~~~
      |         b_2
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
	int h1, m1, h2, m2, k;
  	cin >> h1 >> m1 >>. h2 >> m2;
  	int t1 = h1 * 60 + m1, t2 = h2 * 60 + m2;
  	int ans = 0;
  	for (int i = t1; i < t2; i++) {
    	if (i + k < t2) ans++;
      	else break;
    }
  	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:27: error: expected primary-expression before '.' token
    5 |         cin >> h1 >> m1 >>. h2 >> m2;
      |                           ^
Language: C++

# include <iostream>
# include <algorithm>
using  namespace  std ;
typedef  long  long ll;

int a [ 100050 ];

void  solve ()
{
    int n;
    ll ans = 1 , m = 1 , sum = 0 ;
    cin >> n;
    for ( int i = 0 ; i <= n; i ++)
    {
        cin >> a [i];
        sum + = a [i];
    }
    if (n> 0 && a [ 0 ]> 0 || n == 0 && a [ 0 ]> 1 ) // Special judgment
    {
        cout << -1<<endl;
        return ;
    }
    for ( int i = 1 ; i <= n; i ++)
    {
        m = min (m << 1 , sum); // Maximum number of nodes in layer i
        ans + = m;
        if (a [i]> m)
        {
            cout << -1<<endl;
            return ;
        }
        m- = a [i]; // Number of non-leaf nodes in layer i
        sum- = a [i]; // Number of leaf nodes after layer i + 1
    }
    cout << ans << endl ;
}
int  main ()
{
    ios :: sync_with_stdio ( 0 );
    cin .tie ( 0 ); cout .tie ( 0 );
    solve ();
    return  0 ;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:16:15: error: expected primary-expression before '=' token
   16 |         sum + = a [i];
      |               ^
a.cc:26:15: error: expected primary-expression before '=' token
   26 |         ans + = m;
      |               ^
a.cc:32:12: error: expected primary-expression before '=' token
   32 |         m- = a [i]; // Number of non-leaf nodes in layer i
      |            ^
a.cc:33:14: error: expected primary-expression before '=' token
   33 |         sum- = a [i]; // Number of leaf nodes after layer i + 1
      |              ^
Language: Java

public class study {
    public static void main(String[] args) {
      int H1=sc.nextInt();
      int M1=sc.nextInt();
      int H2=sc.nextInt();
      int M2=sc.nextInt();
      int K=sc.nextInt();
      int a=60*(H2-H1), b=M2-M1+a;
      int l=b-K;
      System.out.println(l);

      
    }
}

Compiler output:
Main.java:1: error: class study is public, should be declared in a file named study.java
public class study {
       ^
Main.java:3: error: cannot find symbol
      int H1=sc.nextInt();
             ^
  symbol:   variable sc
  location: class study
Main.java:4: error: cannot find symbol
      int M1=sc.nextInt();
             ^
  symbol:   variable sc
  location: class study
Main.java:5: error: cannot find symbol
      int H2=sc.nextInt();
             ^
  symbol:   variable sc
  location: class study
Main.java:6: error: cannot find symbol
      int M2=sc.nextInt();
             ^
  symbol:   variable sc
  location: class study
Main.java:7: error: cannot find symbol
      int K=sc.nextInt();
            ^
  symbol:   variable sc
  location: class study
6 errors
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
 
#define N 1000000
 
int main (void)
{
    long long a[N], node2[N] = {0}, node0[N] = {0};
    long long n, i, ans = 0;
 
    scanf("%lld", &n);
 
    for (i = 0; i < n + 1; i++) {
        scanf("%lld", &(a[i]));
    }
 
    if (n == 0 && a[0] == 1) {
        puts("1");
        return 0;
    } else if (n == 0 && a[0] != 1) {
        puts("-1");
        return 0;
    }
 
    if (a[0] != 0 || a[n] == 0) {
        puts("-1");
        return 0;
    }
 
    node2[0] = (long long)1;
    for (i = 1; i < n + 1; i++) {
        node2[i] = node2[i - 1] * (long long)2 - a[i];
        if (node2[i] > LLONG_MAX/2) node2[i] = LLONG_MAX/2
 
        if (i != n && node2[i] <= 0) {
            puts("-1");
            return 0;
        }
 
        node0[i] = a[i];
    }
 
    for (i = n; i > 0; i--) {
        ans += node0[i];
        if (node0[i] < node2[i - 1]) {
            node0[i - 1] += node0[i];
        } else {
            node0[i - 1] += node2[i - 1];
        }
    }
 
    ans += 1;
 
    printf("%lld", ans);
 
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:36:59: error: expected ';' before 'if'
   36 |         if (node2[i] > LLONG_MAX/2) node2[i] = LLONG_MAX/2
      |                                                           ^
      |                                                           ;
   37 | 
   38 |         if (i != n && node2[i] <= 0) {
      |         ~~
Language: C

#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(n);i++)
#define all(x) (x).begin(), (x).end()
using ll = long long;
using namespace std;
template <typename T>
using vec = std::vector<T>;

int main() {
    int H1,M1,H2,M2,K;
    cin >> H1 >> M1 >> H2 >> M2 >> K;
    H1*=60;
    H2*=60;
    int ans = H2+M2-(H1+M1)-K;

    cout << ans << endl;
}


Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<bits/stdc++.h>
#define mod 1000000007
#define int long long
#define pb(x) push_back(x)
#define gcd(a,b) __gcd(a,b)
#define all(v) v.begin(),v.end()
#define lcm(a,b) (a*b)/gcd(a,b)
#define bits(x) __builtin_popcountll(x)
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
int32_t main()
{
   fast;
   #ifndef ONLINE_JUDGE
   freopen("goodluckin.txt","r",stdin);
   freopen("goodluckout.txt","w",stdout);
   #endif
   int h1,h2,m1,m2,k;
   cin >> h1 >> m1 >> h2 >> m2 >> k;
   int t1 = (h1*60)+m1;
   int t2 = (h2*60)+m2;
   int ans = (t2-k)-t1;
   cout << max(0,ans);
}






Compiler output:
a.cc: In function 'int32_t main()':
a.cc:24:15: error: no matching function for call to 'max(int, long long int&)'
   24 |    cout << max(0,ans);
      |            ~~~^~~~~~~
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 |    cout << max(0,ans);
      |            ~~~^~~~~~~
/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 /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:2:
/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 |    cout << max(0,ans);
      |            ~~~^~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std; int main() {string t; cin >> t; for(int i = 0; i < t.length(); i++) if(t[i] == ’?’) t[i] = ’D’; cout << t << endl; return 0;
}

Compiler output:
a.cc:2:101: error: extended character ’ is not valid in an identifier
    2 | using namespace std; int main() {string t; cin >> t; for(int i = 0; i < t.length(); i++) if(t[i] == ’?’) t[i] = ’D’; cout << t << endl; return 0;
      |                                                                                                     ^
a.cc:2:103: error: extended character ’ is not valid in an identifier
    2 | using namespace std; int main() {string t; cin >> t; for(int i = 0; i < t.length(); i++) if(t[i] == ’?’) t[i] = ’D’; cout << t << endl; return 0;
      |                                                                                                       ^
a.cc:2:113: error: extended character ’ is not valid in an identifier
    2 | using namespace std; int main() {string t; cin >> t; for(int i = 0; i < t.length(); i++) if(t[i] == ’?’) t[i] = ’D’; cout << t << endl; return 0;
      |                                                                                                                 ^
a.cc:2:113: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:2:101: error: '\U00002019' was not declared in this scope
    2 | using namespace std; int main() {string t; cin >> t; for(int i = 0; i < t.length(); i++) if(t[i] == ’?’) t[i] = ’D’; cout << t << endl; return 0;
      |                                                                                                     ^
a.cc:2:104: error: expected ':' before ')' token
    2 | using namespace std; int main() {string t; cin >> t; for(int i = 0; i < t.length(); i++) if(t[i] == ’?’) t[i] = ’D’; cout << t << endl; return 0;
      |                                                                                                        ^
      |                                                                                                        :
a.cc:2:104: error: expected primary-expression before ')' token
a.cc:2:113: error: '\U00002019D\U00002019' was not declared in this scope
    2 | using namespace std; int main() {string t; cin >> t; for(int i = 0; i < t.length(); i++) if(t[i] == ’?’) t[i] = ’D’; cout << t << endl; return 0;
      |                                                                                                                 ^~~
Language: C

#include <stdio.h>
 
void main()
{
  int a,b,c,d,e;
  scanf("%d %d %d %d %d", &a, &b, &c, &d, &e);
  printf("%d", (c*60+d-a*60-b-e))
}

Compiler output:
main.c: In function 'main':
main.c:7:34: error: expected ';' before '}' token
    7 |   printf("%d", (c*60+d-a*60-b-e))
      |                                  ^
      |                                  ;
    8 | }
      | ~
Language: C

#include <stdio.h>

void main()
{
  int a,b,c,d,e;
  scanf("%d %d %d %d %d", &a, &b, &c, &d, &f);
  printf("%d", (c*60+d-a*60-b-e))
}

Compiler output:
main.c: In function 'main':
main.c:6:44: error: 'f' undeclared (first use in this function)
    6 |   scanf("%d %d %d %d %d", &a, &b, &c, &d, &f);
      |                                            ^
main.c:6:44: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:34: error: expected ';' before '}' token
    7 |   printf("%d", (c*60+d-a*60-b-e))
      |                                  ^
      |                                  ;
    8 | }
      | ~
Language: C++

#include <iostream>
#include <string>
#include <math.h>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
     int a[n+1];
     int maxi[n+1];
     maxi[0] = 1;
     for (int i=0;i<n+1;i++)
        {
            cin>>a[i];
            if(i != 0)
              maxi[i] = maxi[i-1]*2 - a[i-1]*2;
        }
    int par = a[n];
    int sum =0;
     for(int i=n;i>0;i--)
     {
         if(a[i] >pow(2,i)|| maxi[i]<par || maxi<a[i])
         {
             printf("-1");
              return 0;
         }
         else
         {
             sum = sum+par;
             if(par+a[i-1]< maxi[i-1])
                par = par+a[i-1];
             else
                 {
                     par = maxi[i-1];
                 }

         }
     }
   printf("%d",sum+1);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:49: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   24 |          if(a[i] >pow(2,i)|| maxi[i]<par || maxi<a[i])
      |                                             ~~~~^~~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
	int h1,h2,m1,m2,k; cin >> h1 >> m1 >> h2 >> m2 >> k;
    int d1 = h1*60 + m1;
    int d2 = h2*60 + m2;
    cout << (d2-k-d1 <= 0) ? 0 : d2-k-d1 << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:8:42: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
    8 |     cout << (d2-k-d1 <= 0) ? 0 : d2-k-d1 << endl;
      |                                  ~~~~~~~~^~~~~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
	int h1,h2,m1,m2,k; cin >> h1 >> m1 >> h2 >> m2 >> k;
    int d1 = h1*60 + m1;
    int d2 = h2*60 + m2;
    cout << (d2-k-d1 <= 0) ? 0 ! d2-k-d1 << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:8:31: error: expected ':' before '!' token
    8 |     cout << (d2-k-d1 <= 0) ? 0 ! d2-k-d1 << endl;
      |                               ^~
      |                               :
a.cc:8:42: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
    8 |     cout << (d2-k-d1 <= 0) ? 0 ! d2-k-d1 << endl;
      |                                ~~~~~~~~~~^~~~~~~
Language: C++

#include<iostream>
#include <cstring>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;



int main(){
  ll N; cin >> N; N++; ll a[N];
  rep(i, N){
    cin >> a[i];
  }
  ll tmp=0, ans=0;
  ll need[N] = {}; need[0] = 1;
  if(a[0]!=0){
    if(N==1&&a[0]==1){cout << 1 << endl, return 0;}
    {cout << -1 << endl; return 0;}
  }
  rep(i, N-1){
    need[i+1] = (need[i]-a[i])*2;
    if(need[i+1]<=0){
      cout << -1 << endl; return 0;
    }
  }
  ll v[N];
  for(int i=N-1; i>=0; i--){
    tmp+=a[i];
    v[i] = min(need[i], tmp);
    tmp=v[i];
  }
  rep(i, N){
    ans+=v[i];
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:42: error: expected primary-expression before 'return'
   38 |     if(N==1&&a[0]==1){cout << 1 << endl, return 0;}
      |                                          ^~~~~~
Language: C++

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

int main() {
string t;
cin >> t;
for(int i = 0; i < t.length(); i++) if(t[i] == ’?’) t[i] = ’D’;
cout << t << endl;
return 0;
}

Compiler output:
a.cc:7:48: error: extended character ’ is not valid in an identifier
    7 | for(int i = 0; i < t.length(); i++) if(t[i] == ’?’) t[i] = ’D’;
      |                                                ^
a.cc:7:50: error: extended character ’ is not valid in an identifier
    7 | for(int i = 0; i < t.length(); i++) if(t[i] == ’?’) t[i] = ’D’;
      |                                                  ^
a.cc:7:60: error: extended character ’ is not valid in an identifier
    7 | for(int i = 0; i < t.length(); i++) if(t[i] == ’?’) t[i] = ’D’;
      |                                                            ^
a.cc:7:60: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:7:48: error: '\U00002019' was not declared in this scope
    7 | for(int i = 0; i < t.length(); i++) if(t[i] == ’?’) t[i] = ’D’;
      |                                                ^
a.cc:7:51: error: expected ':' before ')' token
    7 | for(int i = 0; i < t.length(); i++) if(t[i] == ’?’) t[i] = ’D’;
      |                                                   ^
      |                                                   :
a.cc:7:51: error: expected primary-expression before ')' token
a.cc:7:60: error: '\U00002019D\U00002019' was not declared in this scope
    7 | for(int i = 0; i < t.length(); i++) if(t[i] == ’?’) t[i] = ’D’;
      |                                                            ^~~