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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;

int T[105000];
int N;
int M, sum;
int main() {
    //cout.precision(10);
  cin >> N;
  for(int i = 1; i <= N; i++) {
    cin >> T[i];
    sum += T[i];
  }
  cin >> M;
  while(M--) {
    int x, p:
    cin >> p >> x;
    cout << sum - T[p] + x << endl;
  }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:13: error: found ':' in nested-name-specifier, expected '::'
   41 |     int x, p:
      |             ^
      |             ::
a.cc:41:12: error: 'p' has not been declared
   41 |     int x, p:
      |            ^
a.cc:42:9: error: qualified-id in declaration before '>>' token
   42 |     cin >> p >> x;
      |         ^~
a.cc:43:21: error: 'p' was not declared in this scope
   43 |     cout << sum - T[p] + x << endl;
      |                     ^
Language: C++

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <cassert>
#include <functional>
#include <string>
#include <sstream>
#include <cctype>
using namespace std;

int main(){
  int N; cin >> N;
  vector<int> T(N);
  for(int i = 0; i < N; i++) cin >> T[i];
  int M; cin> >> M;
  vector<pair<int, int>> PX(M);
  for(int i = 0; i < M; i++) cin >> PX[i].first >> PX[i].second;
  
  int sum = 0;
  for(int i = 0; i < N; i++) sum += T[i];
  for(int i = 0; i < M; i++) cout << sum - T[PX[i].first] + PX[i].second << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:15: error: expected primary-expression before '>>' token
   18 |   int M; cin> >> M;
      |               ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

int main(){
	int N, M;
	cin >> N;
	vector<int> T(N);
	int sum = 0;
	rep(i, N){
		cin >> T.at(i);
		sum += T,at(i);
	}
	cin >> M;
	rep(i, M){
		int Num, time;
		cin >> Num >> time;
		int ans = sum - T.at(Num - 1) + time;
		cout << ans << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: no match for 'operator+=' (operand types are 'int' and 'std::vector<int>')
   12 |                 sum += T,at(i);
      |                 ~~~~^~~~
a.cc:12:26: error: 'at' was not declared in this scope
   12 |                 sum += T,at(i);
      |                          ^~
Language: C++

#include "stdafx.h"
#include<math.h>
#include<map>
#include<iostream>
#include <algorithm>
#include <string>
#include<vector>
#include<array>
#include<tuple>
#include<queue>
#include<stack>
#include<iomanip>
#include<bitset>
#include <list>
#include<numeric>
//AtCoderC++.cpp

using namespace std;

inline int ceiling(int n, int d) {
	return n % d == 0 ? n / d : n / d + 1;
}

int main() {
	int N; cin >> N;
	auto ts = vector<int>(N);
	long long sum = 0;
	for (size_t i = 0; i < N; i++) { cin >> ts[i]; sum += ts[i]; }
	int M; cin >> M;
	auto drink = vector<pair<int, int>>(M);
	for (size_t i = 0; i < M; i++) cin >> drink[i].first >> drink[i].second;
	for (size_t i = 0; i < M; i++) {
		auto sub = (ts[drink[i].first - 1] - drink[i].second);
		sum -= sub;
		cout << sum << endl;
		sum += sub;
	}
}


Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
#include<bitset>
#define ll long long
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,0,n)
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define INF ((1LL<<62)-(1LL<<31))
#define MOD 1000000007
using namespace std;

int main(){
  int N,M,ans=0;
  cin>>N;
  int T[N+1];
  for(int i=1; i<=N; ++i){
    cin>>T[i];
    ans+=T[i];
  }
  cin>>M;
  int P[M+1],X[M+1];
  for(int i=1; i<=M; ++i) cin>>P[i]>>X[i];
  
  for(int i=1; i<=M; ++i) cout<<ans-T[P[i]]+X[i];<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:50: error: expected primary-expression before '<<' token
   31 |   for(int i=1; i<=M; ++i) cout<<ans-T[P[i]]+X[i];<<endl;
      |                                                  ^~
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++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))


int main(){
  int n,m;
  vector<int> t(n),p(m),x(m);
  cin>>n;
  rep(i,n)cin>>t[i];
  cin>>m;
  rep(i,m)cin>>p[i]>>x[i];
  long long sum=0;
  rep(i,n){
    sum+=t[i];
  }
  rep(i,m){
    
   cout<<sum-t[p[i]-1]+x[i];<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:29: error: expected primary-expression before '<<' token
   27 |    cout<<sum-t[p[i]-1]+x[i];<<endl;
      |                             ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n,v[105],m,sum;
int main(){
    scanf("%d",&n);
    for(register int i=1;i<=n;i++) scanf("%d,&v[i]),sum+=v[i];
    scanf("%d",&m);
    while(m--){
        int x,p;
        scanf("%d%d",&x,&p);
        printf("%d\n",sum-v[x]+p);
    }
    return 0;
}

Compiler output:
a.cc:6:42: warning: missing terminating " character
    6 |     for(register int i=1;i<=n;i++) scanf("%d,&v[i]),sum+=v[i];
      |                                          ^
a.cc:6:42: error: missing terminating " character
    6 |     for(register int i=1;i<=n;i++) scanf("%d,&v[i]),sum+=v[i];
      |                                          ^~~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    6 |     for(register int i=1;i<=n;i++) scanf("%d,&v[i]),sum+=v[i];
      |                      ^
a.cc:7:19: error: expected ')' before ';' token
    7 |     scanf("%d",&m);
      |                   ^
      |                   )
a.cc:6:41: note: to match this '('
    6 |     for(register int i=1;i<=n;i++) scanf("%d,&v[i]),sum+=v[i];
      |                                         ^
Language: C++


#include<stdio.h>
using namespace std;
int a[103];
int main(){
	int n,m,p,x;
	int sum=0;
	cin>>n;
	for(int i=0;i<n;++i){
		scanf("%d",&a[i]);
		sum+=a[i];
	}
	cin>>m;
	for(int i=0;i<m;++i){
		scanf("%d %d",&p,&x);
		if(x<a[p-1])
			printf("%d\n",sum-(a[p-1]-x));
		else
			printf("%d\n",sum+(x-a[p-1]));}}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'cin' was not declared in this scope
    8 |         cin>>n;
      |         ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include<stdio.h>
  +++ |+#include <iostream>
    3 | using namespace std;
Language: C++

#include <bits/stdc++.h>
using namespace std;
const long long N = 1e4;
 
char arr[N][N];
char arr1[N][N];
int main()
{
    int n,m;
    scanf("%d %d",&n,&m);
    for(int i=0; i<n; i++)
        scanf("%s",arr[i]);
 
    for(int i=0; i<m; i++)
        scanf("%s",arr1[i]);
 
 
    for(int i=0; i<n; i++)
    {
        for(int j=0; j<n; j++)
        {
            int cnt=0;
            for(int a=0; a<m; a++)
            {
                for(int b=0; b<m; b++)
                {
                    if(arr1[a][b]==arr[i+a][j+b])
                        cnt++;
                }
 
            }
            if(cnt==(m*m))
            {
                printf("Yes\n");
                return 0;
            }
 
        }
    }
    printf("No\n");

Compiler output:
a.cc: In function 'int main()':
a.cc:40:20: error: expected '}' at end of input
   40 |     printf("No\n");
      |                    ^
a.cc:8:1: note: to match this '{'
    8 | {
      | ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
    int s,arr[100],m,a,b;
    int sum=0;
    cin>>s;
    for(int i=0; i<s; ++i)
    {
        cin>>arr[i];
    }
    cin>>m;
    while(m--)
    {
        sum=0;
        cin>>a>>b;
        for(int i=0; i<n; ++i)
        {
            if(i==a-1)
                sum+=b;
            else
            sum+=arr[i];
        }
        cout<<sum<<endl;
    }



}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:24: error: 'n' was not declared in this scope
   17 |         for(int i=0; i<n; ++i)
      |                        ^
Language: C++

#include <bits
using namespace std;
long long n, m;
long long t[100010] ;
long long t;
struct t {
long long x, y;
} He[100010];
int main () {
cin>>n;
for(int i=1;i<=n;i++)
cin>>t[i] ;
cin>>m;
for(int i=1;i<=m;i++)
cin>>He[i].x>>He[i]. y;
for(int i=1;i<=n;i++){
long long sum=0;
for(int j=1;j<=He[i].x;j++)
sum+=t[i] ;
sum+=He[i].y;
for(int z=He[i].x+1;z<=n;z++)
sum+=t[z] ;
cout<<sum<<endl;
}}

Compiler output:
a.cc:1:15: error: missing terminating > character
    1 | #include <bits
      |               ^
a.cc:1:10: fatal error: bits: No such file or directory
    1 | #include <bits
      |          ^
compilation terminated.
Language: C++

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

int main()
{
 int n,m;
    cin>>n;
     int t[n];
     int s[n];
        for(int a=0;a<n;a++)
        {
            cin>>t[a];

            s[a]=t[a];
        }
        cin>>m;
        int p[m]={0};
        int x[m]={0};
        int sum[m]={0};
        for(int a=0;a<m;a++)
        {
           cin>>p[a]>>x[a];
        }
        for (int z=0;z<m;z++)
        {
            for(int j=0;j<n;j++)
            {
                if(p[z]==(j+1))
                {
                    t[j]=x[z];
                }
                    sum[z]+=t[j];
                    t[i]=s[j];
            }
        }
        for(int z=0;z<m;z++)
        {
            printf("%d \n",sum[z]);
        }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:23: error: 'i' was not declared in this scope
   33 |                     t[i]=s[j];
      |                       ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int  w,s,c=0,z;
	scanf("%d%d",&k,&s);
		for(int x=0;x<=w;x++)
		{
            for(int y=0;y<=w;y++)
            {
                int z=s-(x+y);
                if(z>=0&&z<=w)
                    c++;
            }
	   }
	   printf("%d",c);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:23: error: 'k' was not declared in this scope
    6 |         scanf("%d%d",&k,&s);
      |                       ^
Language: C++


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int t[100100];
    int n;
    cin >> n;
    int m = 1;
    while(n --)
    {
        cin >> t[m];
        i ++;
    }
    int m;
    cin >> m;
    while(m --)
    {
        int p, x;
        cin >> p >> x;
        int c;
        c = t[p];
        t[p] = x;
        int sum = 0;
        for(int j = 1; j < i; j ++)
        {
            sum += t[j];
        }
        cout << sum <<endl;
        t[p] = c;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'i' was not declared in this scope
   13 |         i ++;
      |         ^
a.cc:15:9: error: redeclaration of 'int m'
   15 |     int m;
      |         ^
a.cc:9:9: note: 'int m' previously declared here
    9 |     int m = 1;
      |         ^
a.cc:25:28: error: 'i' was not declared in this scope
   25 |         for(int j = 1; j < i; j ++)
      |                            ^
Language: C++

#include<iostream>
using namespace std;
int main()
{ 
int n,m,u;
cout<<"please enter the number of times \n";
cin>>n;
int time[n];
for (int i=0;i<n;i++)
	cin>>time[i];
cin>>m;
int drink[m][2];

for(int j=0;j<m;j++)
{
	for(int i=0;i<2;i++)
		cin>>drink[j][i];
}
for(int j=0;j<m;j++)
{
	u=0;
	for(int i=0;i<n;i++)
	{
		u+=time[i];
		if(drink[j][0]-1==i)
		{
			u=u-time[i];
			u=u+drink[j][1];
		}
	}
	cout<<s<<endl;
}			
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:15: error: 's' was not declared in this scope
   31 |         cout<<s<<endl;
      |               ^
Language: C++

#include<iostream>
using namespace std;
#define h 100100
int t[h];
	int main(){
	int n;
	cin>>n;
	int i=1;
	while(n --){
		cin>>t[i];
		i++;
	}
	int m;
	cin>>m;
	while(m--){
		int p,x;
		cin>>p>>x;
		int c;
		c=t[p];
		t[p]=x;
		int sum=0;
		for(int j=1;j<i;j++){
			sum+=t[j];
		}
		cout<<sum<<endl;
		t[p]=c;
	}
	return 0
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:17: error: expected ';' before '}' token
   28 |         return 0
      |                 ^
      |                 ;
   29 | }
      | ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
int N,i=0,j=0,t=0,M;
cin>>N;
int T[N];
for(i=1;i<=N;i++)
{
cin>>T[i];
t+=T[i];
}
cin>>M;
int p[M],x[M];
for(j=1;j<=M;j++)
{
cin>>p[j]>>x[j];
cout<<t-T[p[j]]+x[j];
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:2: error: expected '}' at end of input
   19 | }
      |  ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++


#include <bits/stdc++.h>
using namespace std;
int main()
{
int N,i=0,j=0,t=0,M;
cin>>N;
int T[N];
for(i=1;i<=N;i++)
{
cin>>T[i];
t+=T[i];
}
cin M;
int p[M],x[M];
for(j=1;j<=M;j++)
{
cin>>p[j]>>x[j];
cout<<t-T[p[j]]+x[j];
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:4: error: expected ';' before 'M'
   14 | cin M;
      |    ^~
      |    ;
a.cc:20:2: error: expected '}' at end of input
   20 | }
      |  ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
int N,I=0,j=0,t=0,M;
cin>>N;
int T[N];
for(i=1;i<=N;i++)
{
cin>>T[i];
t+=T[i];
}
cin M;
int p[M],x[M];
for(j=1;j<=M;j++)
{
cin>>p[j]>>x[j];
cout<<t-T[p[j]]+x[j];
}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'i' was not declared in this scope
    8 | for(i=1;i<=N;i++)
      |     ^
a.cc:13:4: error: expected ';' before 'M'
   13 | cin M;
      |    ^~
      |    ;
Language: C++

 #include <bits/stdc++.h>
using namespace std;
int main()
{
int N,i=0,j=0,T[N],t=0,M,p[M],x[M];
cin>>N;
for(i=1;i<=N;i++)
{
cin>>T[i];
t+=T[i];
}
cin>>M;
for(j=1;i<=M;j++)
{
cin>>p[j]>>x[j];
cout<<t-T[p[j]]+x[j];
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:2: error: expected '}' at end of input
   17 | }
      |  ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

 #include <bits/stdc++.h>
using namespace std;
int main()
{
int i=0,j=0,T[N],t=0,M,p[M],x[M];
cin>>N;
for(i=1;i<=N;i++)
{
cin>>T[i];
t+=T[i];
}
cin>>M;
for(j=1;i<=M;j++)
{
cin>>p[j]>>x[j];
cout<<t-T[p[j]]+x[j];
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:15: error: 'N' was not declared in this scope
    5 | int i=0,j=0,T[N],t=0,M,p[M],x[M];
      |               ^
a.cc:9:6: error: 'T' was not declared in this scope
    9 | cin>>T[i];
      |      ^
a.cc:16:9: error: 'T' was not declared in this scope
   16 | cout<<t-T[p[j]]+x[j];
      |         ^
a.cc:17:2: error: expected '}' at end of input
   17 | }
      |  ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

using namespace std;
int main()
{
int a,b,x,count=0;
cin>>a>>b>>x;
if(a>=0&&b>=0&&x>0)
{
for(int i=a; I<=b; i++)
{
if(i%x==0){
count ++;
}
}}
count <<count;
return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope
    5 | cin>>a>>b>>x;
      | ^~~
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:8:14: error: 'I' was not declared in this scope
    8 | for(int i=a; I<=b; i++)
      |              ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int arr[100000];
    int n;
    scanf("%d",&n);
    int i = 1;
    while(n --)
    {
        cin >> arr[i];
        i ++;
    }
    int m;
    cin >> m;
    while(m --)
    {
        int p, x;
        cin >> p >> x;
        int c;
        c = arr[p];
        arr[p] = x;
        int sum = 0;
        for(int j = 1; j < i; j ++)
        {
            sum += arr[j];
        }
        cout << sum <<endl;
        arr[p] = c;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:30:6: error: expected '}' at end of input
   30 |     }
      |      ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C

#include<stdio.h>
#include<iostream>
#include<math.h>
#include<stdlib.h>
using namespace std;


int main(){
    int n,i;
    cin>>n;
    int a[n];

    for(i=0;i<n;i++){
        cin>>a[i];
    }

    int m;
    cin>>m;
    int x[m],y[m],d,z=0,p=0;


    for(i=0;i<m;i++){
        cin>>x[i]>>y[i];
    }

    for(i=0;i<m;i++){
        z=0;
        d=x[i]-1;
        p=a[d];
        a[d]=y[i];
        for(int j=0;j<n;j++){
            z=z+a[j];
            //cout<<a[j]<<" ";
        }

        cout<<z<<endl;
        a[d]=p;
    }
    return 0;

}


Compiler output:
main.c:2:9: fatal error: iostream: No such file or directory
    2 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int N  = keyboard.nextInt();
		int[] T = new int[N]
		int sum = 0;
        
        for(int i = 0; i < N; i++){
          T[i]  = keyboard.nextInt();
          sum += T[i]
        }
        
		int M  = keyboard.nextInt();
		
		int[] P = new int[M]
		int[] X = new int[M]
		int[] ans = new int[M]
		
		for(int j = 0; j < M; j++){
          P[j]  = keyboard.nextInt();
          X[j]  = keyboard.nextInt();
          ans[j] = sum - T[P[j]] +X[j] ;
        }
        
        for(int k = 0; k < M; k++){
		System.out.println(ans[k]);
		}
		keyboard.close();	
	}
}


Compiler output:
Main.java:10: error: ';' expected
		int[] T = new int[N]
		                    ^
Main.java:15: error: ';' expected
          sum += T[i]
                     ^
Main.java:20: error: ';' expected
		int[] P = new int[M]
		                    ^
Main.java:21: error: ';' expected
		int[] X = new int[M]
		                    ^
Main.java:22: error: ';' expected
		int[] ans = new int[M]
		                      ^
5 errors
Language: C++

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

#define REP(i, n) for(int i=0; i<n;i++)
#define REPR(i, n) for(int i=n-1 ; i>=0; i--)
#define FOR(i, m, n) for(int i=m; i<n; i++)

#define INF 2e9
#define ll long long

int main(){
    int n;
    cin>>n;
    int t[n];
    int i, j;
    int ans = 0;
    REP(i, n){
        cin>>t[i];
        ans += t[i];
    }

    int m;
    cin>>m;
    int p[m], x[m];

    for(i=0; i<m; i++){
        cin>>p[i]>>x[i];
    }

    for(i=0; i<m; i++){
        cout<<gokei-t[p[i]+1]+x[i]<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:15: error: 'gokei' was not declared in this scope
   31 |         cout<<gokei-t[p[i]+1]+x[i]<<endl;
      |               ^~~~~
Language: C++

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

#define REP(i, n) for(int i=0; i<n;i++)
#define REPR(i, n) for(int i=n-1 ; i>=0; i--)
#define FOR(i, m, n) for(int i=m; i<n; i++)

#define INF 2e9
#define ll long long

int main(){
    int n;
    cin>>n;
    int t[n];
    int i, j;
    int ans = 0;
    REP(i, n){
        cin>>t[i];
        ans += t[i];
    }

    int m;
    cin>>m;
    int p[m], x[m];

    for(i=0; i<m; i++){
        cin>>p[i]>>x[i];
    }

    max = -1*INF;

    for(i=0; i<m; i++){
        cout<<gokei-t[p[i]+1]+x[i]<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: overloaded function with no contextual type information
    8 | #define INF 2e9
      |             ^~~
a.cc:30:14: note: in expansion of macro 'INF'
   30 |     max = -1*INF;
      |              ^~~
a.cc:33:15: error: 'gokei' was not declared in this scope
   33 |         cout<<gokei-t[p[i]+1]+x[i]<<endl;
      |               ^~~~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(void){
  int N;
  cin >> N;
  
  vector<int>time(N,0);
  for(int i=0;i<N;i++){
    cin >> time[i];
  }
  
  int M;
  cin >> M;
  
  vector<vector<int>>drink(M,vector<int>(2,0));
  for(int i=0;i<M;i++){
    for(int j=0;j<2;j++){
      cin >> drink[i][j];
    }
  }
  
  for(int i=0;i<M;i++){
    int ans = 0;
    for(int j= 0;j<N;j++){
      ans += time[j];
    }
    ans += drink[i][1] - time[drink[i][1] -1];
    
    cout << ans << endl;
  }
  
  return 0;
}
#include <iostream>
#include <vector>
using namespace std;
int main(void){
  int N;
  cin >> N;
  
  vector<int>time(N,0);
  for(int i=0;i<N;i++){
    cin >> time[i];
  }
  
  int M;
  cin >> M;
  
  vector<vector<int>>drink(M,vector<int>(2,0));
  for(int i=0;i<M;i++){
    for(int j=0;j<2;j++){
      cin >> drink[i][j];
    }
  }
  
  for(int i=0;i<M;i++){
    int ans = 0;
    for(int j= 0;j<N;j++){
      ans += time[j];
    }
    ans += drink[i][1] - time[drink[i][1]];
    
    cout << ans << endl;
  }
  
  return 0;
}
#include <iostream>
#include <vector>
using namespace std;
int main(void){
  int N;
  cin >> N;
  
  vector<int>time(N,0);
  for(int i=0;i<N;i++){
    cin >> time[i];
  }
  
  int M;
  cin >> M;
  
  vector<vector<int>>drink(M,vector<int>(2,0));
  for(int i=0;i<M;i++){
    for(int j=0;j<2;j++){
      cin >> drink[i][j];
    }
  }
  
  for(int i=0;i<M;i++){
    int ans = 0;
    for(int j= 0;j<N;j++){
      ans += time[j];
    }
    ans += drink[i][1] - time[drink[i][1] -1];
    
    cout << ans << endl;
  }
  
  return 0;
}

Compiler output:
a.cc:38:5: error: redefinition of 'int main()'
   38 | int main(void){
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main(void){
      |     ^~~~
a.cc:72:5: error: redefinition of 'int main()'
   72 | int main(void){
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main(void){
      |     ^~~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(void){
  int N;
  cin >> N;
  
  vector<int>time(N,0);
  for(int i=0;i<N;i++){
    cin >> time[i];
  }
  
  int M;
  cin >> M;
  
  vector<vector<int>>drink(M,vector<int>(2,0));
  for(int i=0;i<M;i++){
    for(int j=0;j<2;j++){
      cin >> drink[i][j];
    }
  }
  
  for(int i=0;i<M;i++){
    int ans = 0;
    for(int j= 0;j<N;j++){
      ans += time[j];
    }
    ans += drink[i][1] - time[drink[i][1]];
    
    cout << ans << endl;
  }
  
  return 0;
}
#include <iostream>
#include <vector>
using namespace std;
int main(void){
  int N;
  cin >> N;
  
  vector<int>time(N,0);
  for(int i=0;i<N;i++){
    cin >> time[i];
  }
  
  int M;
  cin >> M;
  
  vector<vector<int>>drink(M,vector<int>(2,0));
  for(int i=0;i<M;i++){
    for(int j=0;j<2;j++){
      cin >> drink[i][j];
    }
  }
  
  for(int i=0;i<M;i++){
    int ans = 0;
    for(int j= 0;j<N;j++){
      ans += time[j];
    }
    ans += drink[i][1] - time[drink[i][1] -1];
    
    cout << ans << endl;
  }
  
  return 0;
}


Compiler output:
a.cc:38:5: error: redefinition of 'int main()'
   38 | int main(void){
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main(void){
      |     ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

int main(){
	int N;
	cin >> N;
	int T[N];
	for(int i = 0; i < N; i++){
		cint >> T[i];
	}
	int sum = 0;
	for(int i = 0; i < N; i++){
		sum += T[i];
	}
	int M = 0;
	cin >> M;
	for(int i = 0; i < M; i++){
		int P, X;
		cin >> P >> X;
		cout << sum-T[P]+X << "\n";
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'cint' was not declared in this scope; did you mean 'uint'?
   13 |                 cint >> T[i];
      |                 ^~~~
      |                 uint
Language: C++

import java.util.*;

public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int timeArray = new int[n];
        int sum = 0;
        for (int i=0;i<n;i++){
            timeArray[i] = sc.nextInt();
            sum += timeArray[i];
        }
        int m = sc.nextInt();
        for (int j=0;j<m;j++){
            int index = sc.nextInt()-1;
            int x = sc.nextInt();
            System.out.println(sum-(timeArray[index]-x));
        }
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
int main(){
  ll n,m,sumt=0;
  cin >> n;
  vll t(n);
  for (ll i=0;i<n;i++) {
    cin>>t[i];
    sumt += t[i];
  }
  cin>>m;
  for (ll i=0;i<m;i++) {
    cin>>p[i]>>x[i];
    cout<<sumt-t[p[i]-1]+x[i]<<endl;
  }
}

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

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
long long inf=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;
bool prime(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd(b,a%b);
  }
}
 
long long lcm(long long x, long long y){
  return (x/gcd(x,y))*y;
}
 
class UnionFind {
    public:
    //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
    vector<int> Parent;
    
    //クラスを作るときは、Parentの値を全て-1にする。
    //以下のようにすると全てバラバラの頂点として解釈できる。
    UnionFind(int N) {
        Parent = vector<int>(N, -1);
    }
    
    //Aがどのグループに属しているか調べる
    int root(int A) {
        if (Parent[A] < 0) return A;
        return Parent[A] = root(Parent[A]);
    }
    
    //自分のいるグループの頂点数を調べる
    int size(int A) {
        return -Parent[root(A)];//先祖をrootで取っておきたい。
    }
    
    //AとBをくっ付ける
    bool connect(int A, int B) {
        //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
        A = root(A);
        B = root(B);
        if (A == B) {
            //すでにくっついてるからくっ付けない
            return false;
        }
        
        //大きい方(A)に小さいほう(B)をくっ付けたい
        //大小が逆だったらAとBをひっくり返す。
        if (size(A) < size(B)) swap(A, B);
        
        //Aのサイズを更新する
        Parent[A] += Parent[B];
        //Bの親をAに変更する
        Parent[B] = A;
        
        return true;
    }
};

int main(){
  int n;
  cin>>n;
  int t[n];
  REP(i,n){
    cin>>t[i];
  }
  int m;
  cin>>m;
  int p[m],x[m];
  REP(i,m){
    cin>>p[i]>>x[i];
  }
  
  int ans=0;
  REP(i,m){
    REP(j,n){
      if(j==p[i]){
        ans += x[i];
      }else{
        ans += t[j]
      }
    }
    cout<<ans<<endl;
    ans = 0;
  }
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:106:20: error: expected ';' before '}' token
  106 |         ans += t[j]
      |                    ^
      |                    ;
  107 |       }
      |       ~
Language: C++

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

int main(void){
    int N,M,sum=0;
    cin>>N;
    int T[N];
    for(int i=0;i<N;i++){
        cin>>T[i];
        sum+=T[i];
    }
    cin>>M;
    int P[N],X[M],sum[M];
    for(int i=0;i<M;i++){
        cin>>P[i]>>X[i];
        cout<<sum+X[i]-T[P[i]-1]<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: conflicting declaration 'int sum [M]'
   13 |     int P[N],X[M],sum[M];
      |                   ^~~
a.cc:5:13: note: previous declaration as 'int sum'
    5 |     int N,M,sum=0;
      |             ^~~
Language: C++

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

int main(){
    int n, m, i, p, x, sum = 0;
    cin >> n;
    int t[n];
    for(i=0; i<n; i++){
        cin >> t[i];
        sum += t[i];
    }
    cin >> m;
    for(i=0; i<m; i++){
        cin >> p >> x;
        cout << sum + x - t[p-1] << '\n';
    }
    return 0;
}


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

#include<iostream>
using namespace std;

int main(){
	int N,M,T[100],P,X;
  	int sum=0;
  	cin>>N;
  	for(int i=0;i<N;++i){
      cin>>T[i];
      sum+=T[i];
      ]
  	cin>>M;
  	for(int i=0;i<M;++i){
      cin>>P>>X;
      sum+=P-T[X-1];
      cout<<sum<<endl;
    }
      return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: expected primary-expression before ']' token
   11 |       ]
      |       ^
a.cc:19:2: error: expected '}' at end of input
   19 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <iostream>
using namespace std;

int main() {
  int N;
  int T[100] = {0};
  int M;
  int P[100] = {0};
  int X[100] = {0};
  int sum = 0;

  cin >> N;

  for (int i = 0; i <= N; i++) {
    cin >> T[i]:
    sum += T[i];
  }

  cin >> M;
  for (int i = 0; i <= M; i++) {
    cin >> P[i] >> X[i];
  }

  for (int i = 0; i <= M; i++) {
    cout << (sum - T[P[i]] + X[i]) << endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: expected ';' before ':' token
   15 |     cin >> T[i]:
      |                ^
      |                ;
Language: C++

#include <iostream>
using namespace std;

int main() {
  int N;
  int T[100] = {0};
  int M;
  int P[100] = {0};
  int X[100] = {0};
  int sum = 0;

  cin >> N;

  for (int i == 0; i <= N; i++) {
    cin >> T[i]:
    sum += T[i];
  }

  cin >> M;
  for (int i == 0; i <= M; i++) {
    cin >> P[i] >> X[i];
  }

  for (int i == 0; i <= M; i++) {
    cout << (sum - T[P[i]] + X[i]) << endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: expected ';' before '==' token
   14 |   for (int i == 0; i <= N; i++) {
      |             ^~~
      |             ;
a.cc:14:14: error: expected primary-expression before '==' token
   14 |   for (int i == 0; i <= N; i++) {
      |              ^~
a.cc:14:26: error: expected ')' before ';' token
   14 |   for (int i == 0; i <= N; i++) {
      |       ~                  ^
      |                          )
a.cc:14:28: error: 'i' was not declared in this scope
   14 |   for (int i == 0; i <= N; i++) {
      |                            ^
a.cc:20:13: error: expected ';' before '==' token
   20 |   for (int i == 0; i <= M; i++) {
      |             ^~~
      |             ;
a.cc:20:14: error: expected primary-expression before '==' token
   20 |   for (int i == 0; i <= M; i++) {
      |              ^~
a.cc:20:26: error: expected ')' before ';' token
   20 |   for (int i == 0; i <= M; i++) {
      |       ~                  ^
      |                          )
a.cc:24:13: error: expected ';' before '==' token
   24 |   for (int i == 0; i <= M; i++) {
      |             ^~~
      |             ;
a.cc:24:14: error: expected primary-expression before '==' token
   24 |   for (int i == 0; i <= M; i++) {
      |              ^~
a.cc:24:26: error: expected ')' before ';' token
   24 |   for (int i == 0; i <= M; i++) {
      |       ~                  ^
      |                          )
Language: C++

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

int main()
{
    int n, m, sum = 0;
    cin >> n;
    vector<int> t(n);
    for (int i = 0; i < n; i++)
    {
        cin >> t[i];
        sum += t[i];
    }
    cin >> m;
    vector<int> p(m), x(m);
    for (i = 0; i < m; ++i)
        cin >> p[i] >> x[i];
    for (i = 0; i < m; ++i)
    {
        j = p[i] - 1;
        cout << sum - t[j] + x[i] << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:10: error: 'i' was not declared in this scope
   16 |     for (i = 0; i < m; ++i)
      |          ^
a.cc:18:10: error: 'i' was not declared in this scope
   18 |     for (i = 0; i < m; ++i)
      |          ^
a.cc:20:9: error: 'j' was not declared in this scope
   20 |         j = p[i] - 1;
      |         ^
Language: C++

#include <iostream>
using namespace std;

int main(){

  int N, M, ans;
  cin >> N;
  int T[N];
  for(int i=0; i<N, i++){
    cin >> T[i];
  }
  cin >> M;
  int P[M], X[M];
  for(int j=0; j<M; j++){
    cin >> P[j] >> X[j];
  }

  for(int i=0; i<M; i++){
    ans = 0;
    for(int j=0; j<N; j++){
      ans += i==j ? X[j] : T[i] ;
    }
    cout << ans << endl;
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:24: error: expected ';' before ')' token
    9 |   for(int i=0; i<N, i++){
      |                        ^
      |                        ;
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main()
{
	int n, m;
	cin >> n;
	vector<int> t(n);
	for (int a = 0; a < n; a++) {
		cin >> t[a];
	}
	cin >> m;
	for (int a = 0; a < m; a++) {
		int p, x;
		cin >> p >> x;
		cout << accumulate(t.begin(), t.end(), 0) + x - t[p-1] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:25: error: 'accumulate' was not declared in this scope
   18 |                 cout << accumulate(t.begin(), t.end(), 0) + x - t[p-1] << endl;
      |                         ^~~~~~~~~~
Language: C++

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

int t[110];
int p[110];
int x[110];
int n, m, time;

int main() {
  cin >> n;
  rep(i, n) cin >> t[i];
  cin >> m;
  rep(i, m) cin >> p[i] >> x[i];

  rep(i, m) {
    time = 0;
    rep(j, n) {
      if(j+1 == p[i]) {
        time += x[i];
      }else {
        time += t[j];
      }
    }
    cout << time << endl;
  }

  return 0;
}


Compiler output:
a.cc:11:11: error: 'int time' redeclared as different kind of entity
   11 | int n, m, time;
      |           ^~~~
In file included from /usr/include/pthread.h:23,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
                 from /usr/include/c++/14/ext/atomicity.h:35,
                 from /usr/include/c++/14/bits/ios_base.h:39,
                 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/time.h:76:15: note: previous declaration 'time_t time(time_t*)'
   76 | extern time_t time (time_t *__timer) __THROW;
      |               ^~~~
a.cc: In function 'int main()':
a.cc:20:10: error: assignment of function 'time_t time(time_t*)'
   20 |     time = 0;
      |     ~~~~~^~~
a.cc:23:14: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   23 |         time += x[i];
      |         ~~~~~^~~~~~~
a.cc:23:14: error: assignment of read-only location 'time'
a.cc:25:14: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   25 |         time += t[j];
      |         ~~~~~^~~~~~~
a.cc:25:14: error: assignment of read-only location 'time'
Language: Java

import java.util.*

class Main{
  
  public static void main (String args[]){
    
    Scanner sc = new Scanner(System.in);
    
    int n = sc.nextInt();
    
    int t[] = new int[n];
    
    int sum = 0;
      
    for(int i=0;i<n;i++){
      t[i] = sc.nextInt();
      sum += t[i];
    }
    
    int m = sc.nextInt();
    
    int sumdri;
    
    for(int i=0;i<m;i++){
      int p = sc.nextInt();
      
      int x = sc.nextInt();
      
      System.out.println(sum - t[p-1]+x);

    }
   
    
  }
  
}

Compiler output:
Main.java:1: error: ';' expected
import java.util.*
                  ^
1 error
Language: Java

class Main{
  
  public static void main (String args[]){
    
    Scanner sc = new Scanner(System.in);
    
    int n = sc.nextInt();
    
    int t[] = new int[n];
    
    int sum = 0;
      
    for(int i=0;i<n;i++){
      t[i] = sc.nextInt();
      sum += t[i];
    }
    
    int m = sc.nextInt();
    
    int sumdri;
    
    for(int i=0;i<m;i++){
      int p = sc.nextInt();
      
      int x = sc.nextInt();
      
      System.out.println(sum - t[p-1]+x);

    }
   
    
  }
  
}

Compiler output:
Main.java:5: error: cannot find symbol
    Scanner sc = new Scanner(System.in);
    ^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
    Scanner sc = new Scanner(System.in);
                     ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using lli = long long int;
ll MM = 1000000000;
ll mod = MM + 7;
#define INF (ll)1e18
#define pi acos(-1.0)

int main(){
    int n; cin >> n;
    ll t[n];
    ll all_time = 0;
    for(int i = 0; i < n; i++){
        cin >> t[i];
        all_time += t[i];
    }
    ll ans = all_time;
    int m; cin >> m;
    int p[m], x[m];
    for(int i = 0; i < m; i++){
        cin >> p[i] >> x[i];
    }
    for(int i = 0; i < m; i++){
        ans -= t[p[i]];
        ans += x[i]
        cout << ans << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:20: error: expected ';' before 'cout'
   26 |         ans += x[i]
      |                    ^
      |                    ;
   27 |         cout << ans << endl;
      |         ~~~~
Language: C

#include<stdio.h>
int N, M, T[100], P, X, sum, max, i, j;
int main(){
  scanf("%d\n", &N);
  for(i=0; i<N; i++){
    scanf("%d", &T[i]);
    sum+=T[i];
  }
  scanf("%d\n", &M);
  for(i=0; i<M; i++){
    scanf("%d%d", &P, &X);
    if(T[P]>max+X){max=T[P]-X}
  }
  printf("%d\n", sum-max;);
}


Compiler output:
main.c: In function 'main':
main.c:12:30: error: expected ';' before '}' token
   12 |     if(T[P]>max+X){max=T[P]-X}
      |                              ^
      |                              ;
main.c:14:25: error: expected ')' before ';' token
   14 |   printf("%d\n", sum-max;);
      |         ~               ^
      |                         )
Language: C++

#include <iostream>
using namespace std;

int main(){
  int n, m, sum = 0;
  int t[101] = {0}, p[101] = {0}, x[101] = {0};
  cin >> n;
  for ( int i = 1; i <= n; i++ ){
    cin >> t[i];
    sum += t[i];
  }
  
  cin >> m;
  for ( int i = 0; i < m, i++ ){
    cin >> p[i] >> x[i];
  }
  
  for( int i = 0; i < m; i++ ){
    cout << sum - t[ p[i] ] + x[i] << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:30: error: expected ';' before ')' token
   14 |   for ( int i = 0; i < m, i++ ){
      |                              ^~
      |                              ;
Language: C++

#include <pch.h>
#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>


using namespace std;

int A, B;
char op;
int N, M;

int main(){
	cin >> N;
	vector <int> T(N);

	for (int i = 0; i < N; i++) {
		cin >> T[i];
	}
	cin >> M;
	vector <int> PX[100];
	vector <int> P(N),X(N);
	//int P, X;

	for (int i = 0; i < M; i++) {
		cin >> P[i] >> X[i];
//		PX[P[i]].push_back(X[i]);

	}
	int res = 0;
	
	for (int i = 0; i < M; i++) {
		for (int j = 0; j < N;j++) {
			if (j+1 == P[i]) {
				res += X[i];
			}
			else res += T[j];
				}

	cout << res << endl;
	res = 0;

	}
	
}

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

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

int main() {
  int n, m;
  cin >> n;
  int t[n];
  for (int i = 0; i < n; i++) { cin >> t[i]; }
  cin >> m;
  int p[m][m];
  for (int i = 0; i < m; i++) { cin >> p[i][i]; }
  
  int sum = accumulate(t[0],t[n-1], 0);
  for (int i = 0; i < m; i++) {
    sum += p[i][1] - m[i];
    cout << res << endl;
  }
  return 0;
}
  
    

Compiler output:
a.cc: In function 'int main()':
a.cc:16:23: error: invalid types 'int[int]' for array subscript
   16 |     sum += p[i][1] - m[i];
      |                       ^
a.cc:17:13: error: 'res' was not declared in this scope
   17 |     cout << res << endl;
      |             ^~~
In file included from /usr/include/c++/14/numeric:62,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_numeric.h: In instantiation of '_Tp std::accumulate(_InputIterator, _InputIterator, _Tp) [with _InputIterator = int; _Tp = int]':
a.cc:14:23:   required from here
   14 |   int sum = accumulate(t[0],t[n-1], 0);
      |             ~~~~~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:141:48: error: invalid type argument of unary '*' (have 'int')
  141 |         __init = _GLIBCXX_MOVE_IF_20(__init) + *__first;
      |                                                ^~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std,
int main(){
  int n;cin>>n;
  int sum=0;
  int t[n];for(int i=0;i<n;i++){
    cin>>t[i];
    sum+=t[i];
  }
  int m;cin>>m;
  int p[m],x[m];
  for(int i=0;i<m;i++)cin>>p[i]>>x[i];
  int ans[m];
  for(int i=0;i<m;i++){
    cout<<sum-t[p[i]]+x[i]<<endl;
  }
}
  

Compiler output:
a.cc:2:20: error: expected ';' before ',' token
    2 | using namespace std,
      |                    ^
      |                    ;
a.cc:2:20: error: expected unqualified-id before ',' token
a.cc:3:1: error: expected unqualified-id before 'int'
    3 | int main(){
      | ^~~
Language: C++

#include<bots/stdc++.h>
using namespace std,
int main(){
  int n;cin>>n;
  int sum=0;
  int t[n];for(int i=0;i<n;i++){
    cin>>t[i];
    sum+=t[i];
  }
  int m;cin>>m;
  int p[m],x[m];
  for(int i=0;i<m;i++)cin>>p[i]>>x[i];
  int ans[m];
  for(int i=0;i<m;i++){
    cout<<sum-t[p[i]]+x[i]<<endl;
  }
}
  

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

#include<bit/stdc++.h>
using namespace std;
int main() {
	int N;
	cin >> N;
	int T[N];
	for(int i=0;i<N;i++){
		cin >> T[i];

	}
	int M;
	cin >> M;
	int P[M], X[M];
	for (int i = 0; i < M; i++) {
		cin >> P[i] >> X[i];
	}
	int sum = 0;
	for(int i = 0; i < N; i++) {
		sum += T[i];
	}
	for (int i = 0; i < M; i++) {
		int ans = sum;
		ans -= T[P[i] - 1] - X[i];
		cout << ans << endl;
	}
}

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

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

int sum(vector<int> n){
  int l = n.size();
  int s = 0;
  for(int i = 0;i<l;i++){
    s += n[i];
  }
  return s;
}
  

int main() {
  int N;
  cin >> N;
  vector<int> t(N);
  for(int i=0;i<N;i++){
    cin >> t[i];
  }
  int M;
  cin >> M;
  for(int i=0;i<M;i++){
    int p,x;
    cin >> p >> x;
    t[p-1] = x;
    cout << sum(s) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:17: error: 's' was not declared in this scope
   27 |     cout << sum(s) << endl;
      |                 ^
Language: Java

import java.util.Scanner;

public class Mani {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int mondaisuu = sc.nextInt();
		int[]mondai = new int [mondaisuu];
		for (int i = 0; i < mondaisuu;i ++){
			mondai[i] = sc.nextInt();
		}
		int nomimonosuu = sc.nextInt();
for(int i = 0; i < nomimonosuu; i++){
		int int1 = 0;
		for(int j = 0; j<nomimonosuu; j++){
			int1 += sc.nextInt();
		}
		int a = mondaisuu - nomimonosuu;
		for(int k = 0; k < a;k++){
			int1 += mondai[k + nomimonosuu];
		}
		System.out.println(int1);
		}
	}
}


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

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

int main(){
  int i,N,array[101],M,array2[101],array3[101],array4[101]={},array5[101],j;
  cin>>N;
  for(i=0;i<N;i++){
    cin>>array[i];
    array5[i]=array[i];
  }
  cin>>M;
  for(i=0;i<M;i++){
    cin>>array2[i]>>array3[i];
  }
  for(i=0;i<M;i++){
    array[array2[i]-1]=array3[i];
    for(int j=0;j<N;j++){
      array4[i]+=array[j];
    }
    cout<<array4[i]<<endl;
    array[array2[i]-1]=arrayarray[array2[i]-1];
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:24: error: 'arrayarray' was not declared in this scope
   21 |     array[array2[i]-1]=arrayarray[array2[i]-1];
      |                        ^~~~~~~~~~
Language: C

#include<stdio.h>
#dfine MAX 100000

int main(void)
{
  int i,j;
  int N,M;
  int res[M]={};
  int T[MAX],P[N],X[MAX];

  printf("N : ");
  scanf("%d",&N);

  printf("Time : \n");
  for(i=0;i<N;i++){
    scanf("%d",&T[i]);
  }

  printf("M : ");
  scacnf("%d",&M);

  printf("P_i , X_i :");
  for(i=0;i<M;i++){
    scanf("%d",P[i]);
    scanf("%d",X[i]);
  }

  for(i=0;i<M;i++){
    for(j=0;j<N;j++){
      if(j == i){
        res[i] += T[j];
      }
      else{
        res[i] += X[j];
      }
    }
  }

  for(i=0;i<M;i++){
    printf("%d\n",res[i]);
  }

  return 0;
}

Compiler output:
main.c:2:2: error: invalid preprocessing directive #dfine; did you mean #define?
    2 | #dfine MAX 100000
      |  ^~~~~
      |  define
main.c: In function 'main':
main.c:9:9: error: 'MAX' undeclared (first use in this function)
    9 |   int T[MAX],P[N],X[MAX];
      |         ^~~
main.c:9:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:3: error: implicit declaration of function 'scacnf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   20 |   scacnf("%d",&M);
      |   ^~~~~~
      |   scanf
Language: C++

#include<iostream>
using namespace std;

int main(){
int N;
cin>>N;
int 
for(int i=0;i<N;i++)cin>>PP[i];
int M;
for(int y=0;y<M;y++)cin>>M[y];
for(int p=0;p<N;p++)cin>>pp[p];
y=p;
	int x;
	cin>>x;
	pp[p]=x;
	for(int g=0;g<N;g++){
		int z;
		z=z+pp[g];
		cout<<z<<endl;
	}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:1: error: expected unqualified-id before 'for'
    8 | for(int i=0;i<N;i++)cin>>PP[i];
      | ^~~
a.cc:8:13: error: 'i' was not declared in this scope
    8 | for(int i=0;i<N;i++)cin>>PP[i];
      |             ^
a.cc:10:27: error: invalid types 'int[int]' for array subscript
   10 | for(int y=0;y<M;y++)cin>>M[y];
      |                           ^
a.cc:11:26: error: 'pp' was not declared in this scope; did you mean 'p'?
   11 | for(int p=0;p<N;p++)cin>>pp[p];
      |                          ^~
      |                          p
a.cc:12:1: error: 'y' was not declared in this scope
   12 | y=p;
      | ^
a.cc:12:3: error: 'p' was not declared in this scope
   12 | y=p;
      |   ^
a.cc:15:9: error: 'pp' was not declared in this scope
   15 |         pp[p]=x;
      |         ^~
Language: C++

#include <bits/stdc++h>
using namespace std;
int main()
{
    int n,m,a,b=0;
    cin>>n;
    int t[n];
    for(int i=0;i<n;i++) cin>>t[i];
    cin>>m;
    int p[m],x[m];
    for(int i=0;i<m;i++) { cin>>p[i]; cin>>x[i];}
    for(int i=0;i<m;i++) {
        a=t[p[i]];
        for(int j=0;j<n;j++){
            b+=t[j];
        }
        cout<<b-a+x[i];
    }
  return 0;
}

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

#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
int main(){
	int n/*quiz*/;
	cin>>n;
	int c=0;
	int t[100];
	for(int i=0;i<n;i++)cin>>t[i];c+=t[i];
	int m/*drink*/;
	cin>>m;
	int p[100],x[100];
	for(int i=0;i<m;i++)cin>>p[i]>>x[i];
	for(int i=0;i<m;i++){
		cout<<c-t[p[i]-1]+x[i]<<endl;
	}
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:44: error: 'i' was not declared in this scope
   11 |         for(int i=0;i<n;i++)cin>>t[i];c+=t[i];
      |                                            ^