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

/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
*/

#include <stdio.h>
#include <stdlib.h>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>
#include <functional>
#include <complex>
#include <list>
#include <cassert>
#include <iomanip>
#include <set>
#include <stack>
#include <bitset>

////多倍長整数, cpp_intで宣言
//#include <boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision;

#pragma gcc target ("avx2")
#pragma gcc optimization ("Ofast")
#pragma gcc optimization ("unroll-loops")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printim(a) printf(a ? "possible\n" : "imposible\n")
#define printdb(a) printf("%.50lf\n", a) //少数出力
#define printLdb(a) printf("%.50Lf\n", a) //少数出力
#define printdbd(a) printf("%.16lf\n", a) //少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str()) //string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2LL) //等差数列の和、初項,末項,項数
#define pb push_back
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0L)*2.0L*PI)
#define rad_to_deg(rad) (((rad)/2.0L/PI)*360.0L)
#define Please return
#define AC 0
#define manhattan_dist(a, b, c, d) (abs(a - c) + abs(b - d)) /*(a, b) から (c, d) のマンハッタン距離 */
#define inf numeric_limits<double>::infinity();
#define linf numeric_limits<long double>::infinity()

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1e9 + 7;
constexpr long double eps = 1e-6;
const long double PI = acosl(-1.0L);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);
	while (c != '\n' && c != -1 && c != ' ') {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

ll LSB(ll n) { return (n & (-n)); }

/*-----------------------------------------ここからコード-----------------------------------------*/



int main() {

	ll n;
	scanf("%lld", &n);
	char str[100000];
	itoa(n, str, 26);
	string s = str;
	for (auto& aa : s)aa = (int)'a' + (int)(aa >= 'a' ? aa - 'a' + 9 + 1 : aa - '0') - 1;
	prints(s);

	Please AC;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:115:9: error: 'itoa' was not declared in this scope
  115 |         itoa(n, str, 26);
      |         ^~~~
Language: C++

#include<bits/stdc++.h>
#define MAX 1e15
#define int long long
using namespace std;
 
signed main()
{
  int n;
  cin>>n;
  char str[(int)MAX+1];
  int i=0,rem=0;
  while(n>0)
  {
    rem=n%26;
    if(rem==0)
    {
      str[i++]='Z';
      n=(n/26)-1;
    }
    else
    {
      str[i++]=(rem-1)-'A';
      n/=26;
    }
  }
    cout<<str<<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:16: error: expected primary-expression before '<' token
   26 |     cout<<str<<<endl;
      |                ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
	long long n;
	cin>>n;
	string s="";
	while(n)
	{
		s+='a'+n%26-1;
		n/=26;
	}
	reverse(s.begin(),e.end());
	cout<<s;    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:27: error: 'e' was not declared in this scope
   13 |         reverse(s.begin(),e.end());
      |                           ^
Language: Java

import java.util.*;
class Main()
{
  public static void main(String args[])
  {
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    String s="";
    while(n!=0)
    {
      int p=n%26 + 96;
      String str =new Character((char)p).toString();
      s=str+s;
      n=n/26;
    }
    System.out.println(s);
  }
}
      

Compiler output:
Main.java:2: error: '{' expected
class Main()
          ^
1 error
Language: C++

/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
*/

#include <cstdio>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>
#include <functional>
#include <complex>
#include <list>
#include <cassert>
#include <iomanip>
#include <set>
#include <stack>
#include <bitset>

////多倍長整数, cpp_intで宣言
//#include <boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision;

#pragma gcc target ("avx2")
#pragma gcc optimization ("Ofast")
#pragma gcc optimization ("unroll-loops")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printim(a) printf(a ? "possible\n" : "imposible\n")
#define printdb(a) printf("%.50lf\n", a) //少数出力
#define printLdb(a) printf("%.50Lf\n", a) //少数出力
#define printdbd(a) printf("%.16lf\n", a) //少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str()) //string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2LL) //等差数列の和、初項,末項,項数
#define pb push_back
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0L)*2.0L*PI)
#define rad_to_deg(rad) (((rad)/2.0L/PI)*360.0L)
#define Please return
#define AC 0
#define manhattan_dist(a, b, c, d) (abs(a - c) + abs(b - d)) /*(a, b) から (c, d) のマンハッタン距離 */
#define inf numeric_limits<double>::infinity();
#define linf numeric_limits<long double>::infinity()

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1e9 + 7;
constexpr long double eps = 1e-6;
const long double PI = acosl(-1.0L);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);
	while (c != '\n' && c != -1 && c != ' ') {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

ll LSB(ll n) { return (n & (-n)); }

/*-----------------------------------------ここからコード-----------------------------------------*/



int main() {

	ll n;
	scanf("%lld", &n);
	ll x, y = 13;
	char str[100000];
	itoa(n, str, 26);
	string s = str;
	for (auto& aa : s)aa = (int)'a' + (int)(aa >= 'a' ? aa - 'a' + 9 + 1 : aa - '0') - 1;
	prints(s);

	Please AC;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:114:9: error: 'itoa' was not declared in this scope
  114 |         itoa(n, str, 26);
      |         ^~~~
Language: C++

#include<bits/stdc++.h>
#define MAX 1e15
using namespace std;

int main()
{
  int n;
  cin>>n;
  char str[(int)MAX+1];
  int i=0;
  while(n>0)
  {
    rem=n%26;
    if(rem==0)
    {
      str[i++]='Z';
      n=(n/26)-1;
    }
    else
    {
      str[i++]=(rem-1)-'A';
      n/=26;
    }
  }
    cout<<str<<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: size '-2147483648' of array 'str' is negative
    9 |   char str[(int)MAX+1];
      |            ~~~~~~~~^~
a.cc:13:5: error: 'rem' was not declared in this scope; did you mean 'drem'?
   13 |     rem=n%26;
      |     ^~~
      |     drem
a.cc:25:16: error: expected primary-expression before '<' token
   25 |     cout<<str<<<endl;
      |                ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define IOS ios_base::sync_with_stdio(0); cin.tie(); cout.tie();
#define ff first
#define ss second
#define pb push_back
#define debug(val) cerr << "The value of " << #val << " is = " << val << '\n';
typedef long long ll;
typedef unsigned long long ull;
const ll mod = 1e9 + 7;
const ll inf = 922337203685477;
const ll mininf = -922337203685477;
const ll nax = 1e5 + 5;
deque<char>arr;
ll n;
char huruf[]={'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h,', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};

int main(){
	IOS
	cin >> n;
	while(n){
		arr.push_front(huruf[n%26-1]);
		n/=26;
	}
	for(int i=0;i<arr.size();i++){
		cout << arr[i];
	}
	cout << '\n';
}


Compiler output:
a.cc:16:50: warning: multi-character character constant [-Wmultichar]
   16 | char huruf[]={'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h,', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
      |                                                  ^~~~
a.cc:16:50: error: narrowing conversion of '26668' from 'int' to 'char' [-Wnarrowing]
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define  ft  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define  ll  long long
#define  pi  pair<int,int>
#define  pb  push_back
#define  F   first
#define  S   second
#define  B   begin()
#define  E   end()
const int N=2e5+3;
//string s,p;
//vector<int>v;
//map<int,int>mp;
void go(int t){if(t){g((t-1)/26);putchar(97+(t-1)%26);}}
int main()
{
    ft
    int t,i,j,n,m,l,r;
    cin>>n;
    go(n);
    return 0;
}



Compiler output:
a.cc: In function 'void go(int)':
a.cc:15:22: error: 'g' was not declared in this scope
   15 | void go(int t){if(t){g((t-1)/26);putchar(97+(t-1)%26);}}
      |                      ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define MAX 1e15+1
int main()
{
  int n;
  cin>>n;
  char str[(int)MAX];
  int i=0;
  while(n>0)
  {
    rem=n%26;
    if(rem==0)
    {
      str[i++]='Z';
      n=(n/26)-1;
    }
    else
    {
      str[i++]=(rem-1)-'A';
      n/=26;
    }
  }
    cout<<str<<<endl;
  return 0;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:3:17: error: size '-2147483648' of array 'str' is negative
    3 | #define MAX 1e15+1
      |                 ^
a.cc:8:17: note: in expansion of macro 'MAX'
    8 |   char str[(int)MAX];
      |                 ^~~
a.cc:12:5: error: 'rem' was not declared in this scope; did you mean 'drem'?
   12 |     rem=n%26;
      |     ^~~
      |     drem
a.cc:24:16: error: expected primary-expression before '<' token
   24 |     cout<<str<<<endl;
      |                ^
Language: Java

public class Main {
	public static void main(String[] args) {
		var sc = new java.util.Scanner(System.in);
		var n = sc.nextBigInteger();
		var output = "";
		for(;n.compareTo(BigInteger.valueOf(26))>0;) {
			var mod = (n.intValue()-1)%26;
			output = Character.toString(mod + 'a') + output;
			n = n.subtract(BigInteger.ONE).divide(BigInteger.valueOf(26));
		}
		output = Character.toString(n.intValue() + 'a' - 1) + output;

		System.out.println(output);
	}
}

Compiler output:
Main.java:6: error: cannot find symbol
		for(;n.compareTo(BigInteger.valueOf(26))>0;) {
		                 ^
  symbol:   variable BigInteger
  location: class Main
Main.java:9: error: cannot find symbol
			n = n.subtract(BigInteger.ONE).divide(BigInteger.valueOf(26));
			               ^
  symbol:   variable BigInteger
  location: class Main
Main.java:9: error: cannot find symbol
			n = n.subtract(BigInteger.ONE).divide(BigInteger.valueOf(26));
			                                      ^
  symbol:   variable BigInteger
  location: class Main
3 errors
Language: C++

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

using namespace std;

int main() {
	long long n;
	vector<char> v;

	cin >> n;
	for (int i = 10;i >= 0;i--) {
		if (n >= pow(26, i)) v.emplace_back(n / pow(26,i) + 96);
		n = n % (long long)pow(26, i);
	}
	for (int i = 0;i <v.size();i++) {
		cout << v[i];
	}
	cout << "\n";

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:26: error: 'pow' was not declared in this scope
   13 |                 if (n >= pow(26, i)) v.emplace_back(n / pow(26,i) + 96);
      |                          ^~~
a.cc:14:36: error: 'pow' was not declared in this scope
   14 |                 n = n % (long long)pow(26, i);
      |                                    ^~~
Language: Java

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

        long n=sc.nextLong();
        char a[]=new char[27];
        for(int i=1;i<=26;++i)
            a[i]=(char)(i-1+'a');
        StringBuffer sb=new StringBuffer();
        while(n>0) {
            long p=n%26;
            sb.append(a[(int)p]);
            n/=26;
        }
        System.out.println(sb.reverse().toString());
    }
}


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

#include <stdio.h>
#include<string.h>
using namespace std;

string s;

int main()
{
  long long n;
  scanf("%d",&n);
  while(n>0){
    s+=n%26+'a';
    n/=26;
  }
  for(int i=s.size()-1;i>=0;i--){
    printf("%c",s[i]);
  }
  return 0;
}


Compiler output:
a.cc:5:1: error: 'string' does not name a type; did you mean 'stdin'?
    5 | string s;
      | ^~~~~~
      | stdin
a.cc: In function 'int main()':
a.cc:12:5: error: 's' was not declared in this scope
   12 |     s+=n%26+'a';
      |     ^
a.cc:15:13: error: 's' was not declared in this scope
   15 |   for(int i=s.size()-1;i>=0;i--){
      |             ^
Language: C++

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

#ifdef LOCAL
 #include <bits/debugger.hpp>
 #define __int64 __int64_t
#else 
 #define debug(a...) //
#endif

string s = "abcdefghijklmnopqrstuvwxyz";

int main()
{
 ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
 __int64 n;
 cin >> n;
 string ans = "";
 while(n) {
  ans += s[n% 26 - 1];
  n /= 26;
 }
 reverse(ans.begin() , ans.end());
 cout << ans << '\n';
 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:2: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
   16 |  __int64 n;
      |  ^~~~~~~
      |  __ynf64
a.cc:17:9: error: 'n' was not declared in this scope; did you mean 'yn'?
   17 |  cin >> n;
      |         ^
      |         yn
Language: Java

//package com.company;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class AC_171_C {
    public static void main(String args[]) throws IOException {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

        long n=Long.parseLong(br.readLine());
        char a[]=new char[27];
        for(int i=1;i<=26;++i)
            a[i]=(char)(i-1+'a');
        StringBuffer sb=new StringBuffer();
        while(n>0) {
            long p=n%26;
            sb.append(a[(int)p]);
            n/=26;
        }
        System.out.println(sb.reverse().toString());
    }
}


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

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

using namespace std;
char apla[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};

int main(){
    long long N ;
    cin >> N;

    int divisor = 26;

    string ans;
    while(N >=1){
        int a = N%26;
        N /=26;
        ans += apla[a-1];
    }
    reverse(ans.begin(), ans.end());

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: 'reverse' was not declared in this scope
   20 |     reverse(ans.begin(), ans.end());
      |     ^~~~~~~
Language: Java

public class AC_171_C {
    public static void main(String args[]) throws IOException {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        
        long n=Long.parseLong(br.readLine());
        char a[]=new char[27];
        for(int i=1;i<=26;++i)
            a[i]=(char)(i-1+'a');
        StringBuffer sb=new StringBuffer();
        while(n>0) {
            long p=n%26;
            sb.append(a[(int)p]);
            n/=26;
        }
        System.out.println(sb.reverse().toString());
    }
}

Compiler output:
Main.java:1: error: class AC_171_C is public, should be declared in a file named AC_171_C.java
public class AC_171_C {
       ^
Main.java:2: error: cannot find symbol
    public static void main(String args[]) throws IOException {
                                                  ^
  symbol:   class IOException
  location: class AC_171_C
Main.java:3: error: cannot find symbol
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        ^
  symbol:   class BufferedReader
  location: class AC_171_C
Main.java:3: error: cannot find symbol
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
                              ^
  symbol:   class BufferedReader
  location: class AC_171_C
Main.java:3: error: cannot find symbol
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
                                                 ^
  symbol:   class InputStreamReader
  location: class AC_171_C
5 errors
Language: C++

#include <iostream>
#include <cstring>
using namespace std;
typedef long long int ll;
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	ll n; cin >> n;
	string ans = "";
	while(n > 0){
		x = n%26;
		if(x == 0) x = 26;
		ans = string(1, x + 'a' - 1) + ans;
		n/= 26;
	}
	cout << ans << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'x' was not declared in this scope
   11 |                 x = n%26;
      |                 ^
Language: C++

import sys
from collections import defaultdict

input = sys.stdin.readline


def print_result(l): return print(' '.join(map(str, l)))


def timer(function):
	import time

	def wrapper(*args, **kwargs):
		t1 = time.time()
		val = function()
		t2 = time.time()
		print("Executed \{}\ in {:.2f} seconds.".format(function.__name__, t2-t1))
		return val
	return wrapper


# @timer
def solve():
	n = int(input())
	s = ''
	while n != 0:
		# print(n)
		s += chr(97+(n % 26)-1)
		n = n//26
	print(s[::-1])
		


if __name__ == '__main__':
	t = 1
	for _ in range(t):
		solve()


Compiler output:
a.cc:22:3: error: invalid preprocessing directive #@
   22 | # @timer
      |   ^
a.cc:25:13: error: empty character constant
   25 |         s = ''
      |             ^~
a.cc:27:19: error: invalid preprocessing directive #print
   27 |                 # print(n)
      |                   ^~~~~
a.cc:34:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   34 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
ll n;
  cin>>n;
  ll r;
  string s="";
  while(n!=0)
  {
    r=n%26
      s=s+(char)('a'+(r-1));
    n=n/26;
    

    
  }
  reverse(s.begin(),s.end());
  cout<<s<<endl;
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:11: error: expected ';' before 's'
   12 |     r=n%26
      |           ^
      |           ;
   13 |       s=s+(char)('a'+(r-1));
      |       ~
Language: C++

def pokryj(plansza,x,y):
	koszt=0
	if 2*x>=y:
		for i in range(len(plansza)-1):
			if plansza[i]=="." and plansza[i+1]==".":
				plansza[i]=="x" 
				plansza[i+1]=="x"
				koszt+=y
			elif plansza[i]==".":
				plansza[i]=="x"
				koszt+=x
	else:
		for i in range(len(plansza)-1):
			if plansza[i]==".":
				plansza[i]=="x"
				koszt+=x
	return koszt
print(pokryj("x.x.x.x..",1,2))

Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def pokryj(plansza,x,y):
      | ^~~
Language: C++

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

int main() {
    long long N;
    vector<char> S;
    cin >> N;

    while (N!=0){

        long long A = N%26;//Nのあまりを求める
        N/=26;//商も求める
        if (A==0) {//割り切れた場合はあまりを26とみなす
            A=26;
            N-=1;
        }

        A-=1;//0-indexに変換

        char alpha = 'a' + A;//文字コードの加算、'A'から何個先かで'Z'まで表記可能
        S.push_back(alpha);//S末尾に追加
        
    }

    for (int i=S.size()-1; i>=0; i--){//push_backしたので降順に表示
        cout << S[i];
    }
    cout << endl;
}#include <bits/stdc++.h>
using namespace std;

int main() {
    long long N;
    vector<char> S;
    cin >> N;

    while (N!=0){

        long long A = N%26;//Nのあまりを求める
        N/=26;//商も求める
        if (A==0) {//割り切れた場合はあまりを26とみなす
            A=26;
            N-=1;
        }

        A-=1;//0-indexに変換

        char alpha = 'a' + A;//文字コードの加算、'A'から何個先かで'Z'まで表記可能
        S.push_back(alpha);//S末尾に追加
        
    }

    for (int i=S.size()-1; i>=0; i--){//push_backしたので降順に表示
        cout << S[i];
    }
    cout << endl;
}

Compiler output:
a.cc:29:2: error: stray '#' in program
   29 | }#include <bits/stdc++.h>
      |  ^
a.cc:29:3: error: 'include' does not name a type
   29 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:32:5: error: redefinition of 'int main()'
   32 | int main() {
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main() {
      |     ^~~~
Language: C++

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

int main()
{
    ll n;
    cin >> n;
    string ans;
    while(n){
        n--;
        ans += char('a' + n % 26);
        n /= 26;
    }
    reverse(ans.begin(), ans.end());
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'reverse' was not declared in this scope
   15 |     reverse(ans.begin(), ans.end());
      |     ^~~~~~~
Language: C++

  //shan61916
#include <bits/stdc++.h>
  using namespace std;
typedef   long long ll;
typedef   unsigned long long ull ;
typedef   double dll ;

#define   mp make_pair
#define   pb push_back
#define   ff first 
#define   ss second
#define   IOS ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define   endl "\n" 
#define   pll pair<ll, ll>
#define   all(x) x.begin(), x.end()
#define   vll vector<ll> 

const ll inf = (ll)(1e17 + 17);
const ll mod = (ll)(1e9 + 7);


ll recurse(ll n) {
	if(n == 1) return 0;
	ll ans = 0;
 	for(ll i = 3; i <= n; i++) {
 		if(i%2 == 0) continue;
 		if(n%i == 0) {
 			ans = ans | !(recurse(n/i));
 			if(ans == 1) {
 				if(n == 84) cout << n << " " << i << endl;
 				break;
 			}
 		}
 	}
 	ans = ans | (!recurse(n-1));
 	return ans;
}

int main(){
 IOS
#ifdef SHAN
    freopen("input.txt" , "r" , stdin);  
#endif
  ll t, n;
  cin >> t >> n;
  cout << recurse(12\) << endl;
  // for(ll i = 1;  i <= 100; i++) {
  // 	if(i%2 == 0 and recurse(i)) cout << i << endl;
  // }
  return 0;
} //good night.

Compiler output:
a.cc:46:21: error: stray '\' in program
   46 |   cout << recurse(12\) << endl;
      |                     ^
Language: C++

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

char s[1010];

void c2s(long long c) {    // 将数值c转换成字符串s
    int i;
    long long t = 1;
    for (i = 0; t <= c; i++, t *= 26) {
        s[i] = 'a';
        c -= t;
    }
    s[i] = '\0';
    for (int i = 0; c > 0; i ++) {
        s[i] += c % 26;
        c /= 26;
    }
    strrev(s);
}

int main() {
    long long c;
    cin >> c;
    c2s(c);
    cout << s << endl;

    return 0;
}


Compiler output:
a.cc: In function 'void c2s(long long int)':
a.cc:18:5: error: 'strrev' was not declared in this scope; did you mean 'strsep'?
   18 |     strrev(s);
      |     ^~~~~~
      |     strsep
Language: C++

#include<bits/stdc++.h>
using namespace std;
main(){
    ll n;
    cin >> n;
    n--;
    if(n == 0){
        cout<<'a';
        return 0;
    }
    vector<char> v;
    while(n > 0){
        v.push_back(n % 26);
        n /= 26;
        n--;
        if(n == 0) v.push_back(0);
    }
    reverse(v.begin(),v.end());
    for(ll i = 0; i < v.size(); i++)
        cout<<(char)('a'+v[i]);
    cout<<endl;
}


Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:4:5: error: 'll' was not declared in this scope
    4 |     ll n;
      |     ^~
a.cc:5:12: error: 'n' was not declared in this scope; did you mean 'yn'?
    5 |     cin >> n;
      |            ^
      |            yn
a.cc:19:11: error: expected ';' before 'i'
   19 |     for(ll i = 0; i < v.size(); i++)
      |           ^~
      |           ;
a.cc:19:19: error: 'i' was not declared in this scope
   19 |     for(ll i = 0; i < v.size(); i++)
      |                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define END '\n'
#define int long long
#define pb push_back
#define pii pair<int, int>
#define ff first
#define ss second
#define trace(x) cerr<<x<<END;
#define loop(i, a, b) for(int i = (a); i < (b); i++)
#define loopb(i, b, a) for(int i = (b); i > (a); --i) 
const int mod = 1e9+7;
const int mod1 = 998244353;
const int inf = 9223372036854775807ll;

void solve()
  {
   int n;
   cin>>n;
   string ans;
   while(n>0){
    char c = 'a' + n%26 - 1;
    n/=26;
    ans += c;
   }
     reverse(ans.begin(), ans.end());

   cout<<ans;
  } 
signed main()
 {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0); 
  #ifndef ONLINE_JUDGE
 
     solve();
  //cerr<<END<<1.0*clock();
  return 0;
} 

Compiler output:
a.cc:35: error: unterminated #ifndef
   35 |   #ifndef ONLINE_JUDGE
Language: C++

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

using namespace std;
typedef long long ll;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    ll n;
    cin >> n;
    ll p=26;
    int x=1;
    while(n>p)
    {
        n-=p;
        p*=26;
        x++;
    }
    n--;
    string res;
    while(x--)
    {
        res+=(n%26+'a');
        n/=26;
    }
    reverse(res.begin(),res.end());
    cout << res << "\n";
    return 0;
}


Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | v#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'v' does not name a type
    1 | v#include <bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:8:5: error: 'ios' has not been declared
    8 |     ios::sync_with_stdio(0);
      |     ^~~
a.cc:9:5: error: 'cin' was not declared in this scope
    9 |     cin.tie(0);
      |     ^~~
a.cc:21:5: error: 'string' was not declared in this scope
   21 |     string res;
      |     ^~~~~~
a.cc:24:9: error: 'res' was not declared in this scope
   24 |         res+=(n%26+'a');
      |         ^~~
a.cc:27:13: error: 'res' was not declared in this scope
   27 |     reverse(res.begin(),res.end());
      |             ^~~
a.cc:27:5: error: 'reverse' was not declared in this scope
   27 |     reverse(res.begin(),res.end());
      |     ^~~~~~~
a.cc:28:5: error: 'cout' was not declared in this scope
   28 |     cout << res << "\n";
      |     ^~~~
Language: C++

from collections import Counter
cnt=Counter()
n=int(input())
ar=list(map(int,input().split()))

sum=0
for i in ar:
    cnt[i]+=cnt[i]+1;
    sum+=i;
q=int(input())
for i in range(0,q):
    a,b=map(int,input().split(' '))
    sum-=cnt[a]*a
    sum+=cnt[a]*b
    cnt[b]+=cnt[a]
    cnt[a]=0
    print(sum)


Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from collections import Counter
      | ^~~~
a.cc:9:5: error: 'sum' does not name a type
    9 |     sum+=i;
      |     ^~~
a.cc:10:1: error: 'q' does not name a type
   10 | q=int(input())
      | ^
Language: C

#include<stdio.h>
int main()
{
long long int n,i,q;
  scanf("%lld",&n);
long long int a[n],sw[100000],sum;
  
  sum=0;
  
  for(i=0;i<100000;++i)
  {
   sw[i]=0;
  }
  
  for(i=0;i<n;++i)
  {
  scanf("%lld",&a[i]);
    sum=sum+a[i];
    sw[a[i]-1]++;
  }
  scanf("%lld",&q);
  long long int b[q],c[q];
  
  for(i=0;i<q;++i)
  {
  scanf("%lld %lld",&b[i],&c[i]);
    printf("%lld\n",sum+(c[i]-b[i])*sw[b[i]-1]);
    sw[c[i]-1]=sw[c[i]-1]+sw[b[i]-1];
    sw[b[i]-1]=0;
    sum=sum+(c[i]-b[i])*sw[b[i]-1]);
  }

return 0;}

Compiler output:
main.c: In function 'main':
main.c:30:35: error: expected ';' before ')' token
   30 |     sum=sum+(c[i]-b[i])*sw[b[i]-1]);
      |                                   ^
      |                                   ;
main.c:30:35: error: expected statement before ')' token
Language: C++

#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int main()
{
    ll n,i,j,k,c=1,x=1,t;
   cin>>n;
   ll a[n+1];
   for(i=0;i<n;i++)
   ll q,x,y;
   cin>>q;
   for(i=0;i<q;i++)
   {
             ll s=0;
             cin>>x>>y;
             for(j=0;j<n;j++)
                    if(a[j]==x)
                    a[j]=y;
             for(k=0;k<n;k++)
                    s+=a[k];
             cout<<k<<endl;
   }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'q' was not declared in this scope
   11 |    cin>>q;
      |         ^
a.cc:15:22: error: 'y' was not declared in this scope
   15 |              cin>>x>>y;
      |                      ^
Language: C++

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

#define int long long

signed main(){
  int n;cin>>n;
  map<int,int> m;
  int ans=0;
  while(n--){
    int a;cin>>a;ans+=a;
    m[a]++;
  }
  while(q--){
    int b,c;cin>>b>>c;
    ans+=(c-b)*m[b];
    m[c]+=m[b];
    m[b]=0;
    cout<<ans<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'q' was not declared in this scope
   14 |   while(q--){
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i< (n); i++)
using ll = long long;
using P = pair<int, int>;
int main()
{
int n;
const ll t = 200000;
cin >> n;
ll sum = 0;
vector<ll> a(t);
rep(i,n){
    ll l;
    cin >> l;
    a[l]++;
    sum += l;

}

cout << endl;
int q;
cin >> q;
rep(i,q){
    ll b,c;
    io.read(b);
    io.read(c);
    sum += (c-b)*a[b];
    a[c] += a[b];
    a[b] = 0;
    cout << sum << endl;

}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:5: error: 'io' was not declared in this scope; did you mean 'i'?
   26 |     io.read(b);
      |     ^~
      |     i
Language: C++

 #include<bits/stdc++.h>
typedef long long int ll;
using namespace std;

void solve()
{
    int n;
    cin >> n;
    int a[100001] = {}, ll = 0;
    for(int i = 0; i<n; i++)
    {
        ll c;
        cin >> c;
        sum += c;
        a[c]++;
    }

    int m;
    cin >> m;

    for(int i=0; i<m; i++)
    {
        ll b, c;
        cin >> b >> c;
        sum += (c-b)*a[b];
        a[c] += a[b];
        a[b] = 0;
        cout << sum << endl;
    }



}


int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll t;
    solve();
    return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:12:11: error: expected ';' before 'c'
   12 |         ll c;
      |           ^~
      |           ;
a.cc:13:16: error: 'c' was not declared in this scope
   13 |         cin >> c;
      |                ^
a.cc:14:9: error: 'sum' was not declared in this scope
   14 |         sum += c;
      |         ^~~
a.cc:23:11: error: expected ';' before 'b'
   23 |         ll b, c;
      |           ^~
      |           ;
a.cc:24:16: error: 'b' was not declared in this scope
   24 |         cin >> b >> c;
      |                ^
a.cc:24:21: error: 'c' was not declared in this scope
   24 |         cin >> b >> c;
      |                     ^
a.cc:25:9: error: 'sum' was not declared in this scope
   25 |         sum += (c-b)*a[b];
      |         ^~~
Language: C++

#include<bits/stdc++.h>
#define MAXN 100001
int n,q,times[MAXN];
long long ans;
int main()
{
	cin>>n;
	for(int i=1,x;i<=n;++i)
	{
		cin>>x;
		ans+=x;
		++times[x];
	}
	cin>>q;
	for(int i=1,b,c;i<=q;++i)
	{
		cin>>b>>c;
		ans-=1ll*times[b]*b;
		ans+=1ll*times[b]*c;
		cout<<ans;
		times[c]+=times[b];
		times[b]=0;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |         cin>>n;
      |         ^~~
      |         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:20:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 |                 cout<<ans;
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include<bits/stdc++.h>
#define MAXN 100001
int n,q,times[MAXN];
long long ans;
int main()
{
	cin>>n;
	for(int i=1,x;i<=n;++i)
	{
		cin>>x;
		ans+=x;
		++times[x];
	}
	cin>>q;
	for(int i=1,b,c;i<=q;++i)
	{
		cin>>b>>c;0
		ans-=1ll*times[b]*b;
		ans+=1ll*times[b]*c;
		cout<<ans;
		times[c]+=times[b];
		times[b]=0;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |         cin>>n;
      |         ^~~
      |         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:17:28: error: expected ';' before 'ans'
   17 |                 cin>>b>>c;0
      |                            ^
      |                            ;
   18 |                 ans-=1ll*times[b]*b;
      |                 ~~~         
a.cc:20:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 |                 cout<<ans;
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
    long long int a[100001];
    long long int sum=0,temp=0,n,q;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>temp;
        a[temp]++;
        sum+=temp;
    }
    cin>>q;
    for(int i=0;i<q;i++){
        long long int b,c;
        cin>>b>>c;
        sum=sum + a[b]*(c-b);
        a[c]+=a[b];
        a[b]=0;
        cout<<sum<<"\n";
    }
    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:21:14: error: expected '}' at end of input
   21 |     return 0;
      |              ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int a[n];
    int r[100001]={0};
    for(int i=0;i<n;i++)
       {
        cin>>a[i];
        r[a[i]]++;
       }
    long long int sum=accumulate(a,a+n,0);
    int q;
    cin>>q;
    for(int i=0;i<q;i++)
    {
        int a,b;
        cin>>a>>b;

            sum=sum-(long long int)(a*r[a]);
            sum+=(long longint)(r[a]*b);
            r[b]+=r[a];
            r[a]=0;
            cout<<sum<<"\n";


    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:24:19: error: expected primary-expression before 'long'
   24 |             sum+=(long longint)(r[a]*b);
      |                   ^~~~
a.cc:24:19: error: expected ')' before 'long'
   24 |             sum+=(long longint)(r[a]*b);
      |                  ~^~~~
      |                   )
Language: C++

#include<iostream>
using namespace std;
int main(){
int N ;
  int N1[N]={};
  int i;
  int j;
  long long sum;
  for(i=0;i<=N-1;i++){
  cin>>N1[1];
  }
  int Q;
  cin>>Q;
  int B[Q];
  int C[Q];
  for(i=0;i<=Q-1;i++){
  cin>>B[i]>>C[i];
  }
  if(i=0;i<=Q-1;i++){
  for(j=0;j<=N-1;j++){
  if(N1[j]==B[i]){
  N1[j]=C[i];
  }
  }
  }
  for(i=0;i<=N-1;i++){
  sum+=N1[i];
  }
  cout<<sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:16: error: expected ')' before ';' token
   19 |   if(i=0;i<=Q-1;i++){
      |     ~          ^
      |                )
a.cc:19:20: error: expected ';' before ')' token
   19 |   if(i=0;i<=Q-1;i++){
      |                    ^
      |                    ;
Language: C++

#include<iostream>
using namespace std;
int main(){
int N ;
  int N1[N]={};
  int i;
  int j;
  long long sum;
  for(i=0;i<=N-1;i++){
  cin>>N1[1]
  }
  int Q;
  cin>>Q
  int B[Q];
  int C[Q];
  for(i=0;i<=Q-1;i++){
  cin>>B[i]>>C[i];
  }
  if(i=0;i<=Q-1;i++){
  for(j=0;j<=N-1;j++){
  if(N1[j]==B[i]){
  N1[j]=C[i];
  }
  }
  }
  for(i=0;i<=N-1;i++){
  sum+=N1[i];
  }
  cout<<sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: expected ';' before '}' token
   10 |   cin>>N1[1]
      |             ^
      |             ;
   11 |   }
      |   ~          
a.cc:13:9: error: expected ';' before 'int'
   13 |   cin>>Q
      |         ^
      |         ;
   14 |   int B[Q];
      |   ~~~    
a.cc:17:8: error: 'B' was not declared in this scope
   17 |   cin>>B[i]>>C[i];
      |        ^
a.cc:19:16: error: expected ')' before ';' token
   19 |   if(i=0;i<=Q-1;i++){
      |     ~          ^
      |                )
a.cc:19:20: error: expected ';' before ')' token
   19 |   if(i=0;i<=Q-1;i++){
      |                    ^
      |                    ;
Language: C++

#include<iostream>
#include<vector>
#include <bits/stdc++.h> 
using namespace std;
int main(){
  long long N,val,sum=0;
  cin >> N;
  vector<long long> cnt(1e5+10,0);
  
  for(int i = 0; i < N ; i++){
    cin >> val;
    cnt[val]++;
    sum += val;
  }
  
  long long Q,b,c;
  cin >> Q;
  
  for(int i = 0; i < Q ; i++){
    cin >> b;
    cin >> c;
    if(cnt[b] > 0){
      sum += cnt[b](b-c);
      cnt[c] += cnt[b];
      cnt[b] = 0;
    }
    //vector<long long>::iterator it;
    //it = find (ival.begin(), ival.end(), b);
    
    //while(it != ival.end()){
      //*it = c;
      //it = find (ival.begin(), ival.end(), b);
    //}
    //cout<<accumulate(ival.begin(),ival.end(),0)<<'\n';
    cout<<sum<<'\n';
  }
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:20: error: expression cannot be used as a function
   23 |       sum += cnt[b](b-c);
      |              ~~~~~~^~~~~
Language: C++

#include<iostream>
#include<vector>
#include <bits/stdc++.h> 
using namespace std;
int main(){
  long long N,val,sum=0;
  cin >> N;
  vector<long long> cnt(1e5+10,0);
  
  for(int i = 0; i < N ; i++){
    cin >> val;
    cnt[val]++;
    sum += val
  }
  
  long long Q,b,c;
  cin >> Q;
  
  for(int i = 0; i < Q ; i++){
    cin >> b;
    cin >> c;
    if(cnt[b] > 0){
      cnt[c] += cnt[b];
      cnt[b] = 0;
    }
    //vector<long long>::iterator it;
    //it = find (ival.begin(), ival.end(), b);
    
    //while(it != ival.end()){
      //*it = c;
      //it = find (ival.begin(), ival.end(), b);
    //}
    //cout<<accumulate(ival.begin(),ival.end(),0)<<'\n';
    cout<<sum<<'\n';
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:15: error: expected ';' before '}' token
   13 |     sum += val
      |               ^
      |               ;
   14 |   }
      |   ~
Language: C++

#include<iostream>
//#include<vector>
#include <bits/stdc++.h> 

using namespace std;

int main(){
  long long N,val,sum = 0;
  cin >> N;
  //vector<long long> ival;
  multiset<long long> ival
  for(int i = 0; i < N ; i++){
    cin >> val;
    //ival.push_back(val);
    ival.insert(val);
    sum += val; 
  }
  
  long long Q,b,c;
  cin >> Q;
  
  for(int i = 0; i < Q ; i++){
    cin >> b;
    cin >> c;
    //vector<long long>::iterator it;
    //it = find (ival.begin(), ival.end(), b);
    if(ival.find(b) != ival.end()){
      int count = ival.count(b);
      ival.erase(b);
      for(int i= 0; i < count ; i++){
        ival.insert(c);
      }
      sum = sum -count*b + count*c;
    }
    
    cout<<sum<<'\n';
    
    //while(it != ival.end()){
    //  *it = c;
    //  it = find (ival.begin(), ival.end(), b);
    //}
    //cout<<accumulate(ival.begin(),ival.end(),0)<<'\n';
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: expected initializer before 'for'
   12 |   for(int i = 0; i < N ; i++){
      |   ^~~
a.cc:12:18: error: 'i' was not declared in this scope
   12 |   for(int i = 0; i < N ; i++){
      |                  ^
a.cc:27:8: error: 'ival' was not declared in this scope; did you mean 'val'?
   27 |     if(ival.find(b) != ival.end()){
      |        ^~~~
      |        val
Language: C++


#include <bits/stdc++.h>
#include <string.h>
#include <vector>
//s#define rep(i, n) for (int i = 0; i < (n); i++)
#define MAX 10000

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define rep(i,a,n) for(int i=a; i<n; i++)
#define r0 return 0
#define INF (int)1e15
#define MOD 1000000007

#define access(i) a[i/3][i%3]
int gcd(int x, int y)
{
    if(y==0)
        return x;
    return gcd(y, x%y);
}

 long long numbers[500005];

//int a[100005];

 int main(){

 long long n,Q; cin>>n;
 int a[n];

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

   long long b[100001] = {0};
    for (long long i = 0; i < n; i++)
    {
        b[a[i]]++;
    }

 cin>>Q;

 while(Q--){

  long long x,y;
  cin>>x>>y;

  sum = sum-b[x]*x+b[x]*y;
  b[y]  += b[x];
  b[x] = 0;

   if(Q!=0)
    cout<<sum<<endl;
   else
    cout<<sum<<endl;

 }

 return 0;
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:52:3: error: 'sum' was not declared in this scope
   52 |   sum = sum-b[x]*x+b[x]*y;
      |   ^~~
Language: C++

#include<iostream>
#include<vector>
#include <bits/stdc++.h> 
using namespace std;
int main(){
  long long N;
  long long val;
  cin >> N;
  vector<long long> ival;
  
  for(int i = 0; i < N ; i++){
    cin >> val;
    ival.push_back(val);
  }
  
  long long Q,b,c;
  cin >> Q;
  vector<long long>::iterator it;
  
  for(int i = 0; i < Q ; i++){
    cin >> b;
    cin >> c;
    
    it = find (ival.begin(), ival.end(), b);
    
    while(it != ival.end()){
      *it = c;
      it = find (ival.begin(), ival.end(), b);
    }
    //cout<<accumulate(ival.begin(),ival.end(),0)<<'\n';
    long long sum = 0;
    for(int i = 0; i < ival.size() ; i++){
      sum += ival[i]
    }
    cout<<sum<<'\n';
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:21: error: expected ';' before '}' token
   33 |       sum += ival[i]
      |                     ^
      |                     ;
   34 |     }
      |     ~
Language: C++

#pragma GCC optimize("O3")
#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<ll(b);i++)
#define FORD(i,a,b) for(ll i=a;i>ll(b);i--)
#define ALL(x) x.begin(),x.end() 
#define SIZE(x) ll(x.size()) 
#define INF 1000000000000 
#define MOD 1000000007 
#define MAXR 100000 
#define PB push_back 
#define MP make_pair 
#define F first 
#define S second 
#define Umap unordered_map
#define Uset unordered_set


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

    ll N, Q;
    cin >> N;
    vector<ll> A(N);
    REP(i, N) cin >> A[i];
    cin >> Q;

    vector<ll> kosu(2 + 10e+5, 0);
    FOR(i, 0, N) {
        kosu[A[i]]++;
    }
    ll sum = accumulate(A.begin(), A.end(), 0);

    REP(i, Q) {
        cin >> B >> C;
        sum += (C-B) * kosu[B];
        cout << sum << endl;
        kosu[C] += kosu[B];
        kosu[B] = 0;
        
    }



    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:16: error: 'B' was not declared in this scope
   41 |         cin >> B >> C;
      |                ^
a.cc:41:21: error: 'C' was not declared in this scope
   41 |         cin >> B >> C;
      |                     ^
Language: Java

import java.util.*;
import java.io.*;
import java.util.Scanner;

public class Main{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] arr = new int[n];
		int sum = 0;
		HashMap<Integer, Integer> = new HashMap<>();
		for(int i=0;i<n;i++)
		{
			arr[i] = sc.nextInt();
			if(map.containsKey(arr[i]))
			{
				int a = map.get(arr[i]);
				a++;
				map.replace(arr[i],a);
			}
			else
			{
				map.put(arr[i],1);
			}
			sum = sum + arr[i];
		}
		int q = sc.nextInt();
		int[] b = new int[q];
		int[] c = new int[q];
		for(int i=0;i<q;i++)
		{
			b[i] = sc.nextInt();
			c[i] = sc.nextInt();
			int s = map.get(b[i]);
			sum = sum+s*(c[i]-b[i]);
			System.out.println(sum);
			if(map.containsKey(c[i]))
			{
				int a = map.get(c[i]);
				a = a+s;
				map.replace(c[i],a);
			}
			else
			{
				map.put(c[i],s);
			}
			map.remove(b[i]);
		}
	}
}

Compiler output:
Main.java:12: error: not a statement
		HashMap<Integer, Integer> = new HashMap<>();
		       ^
Main.java:12: error: ';' expected
		HashMap<Integer, Integer> = new HashMap<>();
		                         ^
2 errors
Language: C++


#include <bits/stdc++.h>
using namespace std;
void print() {
    cout << endl;
}
template <class Head, class... Tail>
void print(Head &&head, Tail &&... tail) {
    cout << head;
#include <bits/stdc++.h>
using namespace std;
void print() {
    cout << endl;
}
template <class Head, class... Tail>
void print(Head &&head, Tail &&... tail) {
    cout << head;
    if (sizeof...(tail) != 0)
        cout << " ";
    print(forward<Tail>(tail)...);
}
template <class T>
void print(vector<T> &vec) {
    for (auto &a : vec) {
        cout << a;
        if (&a != &vec.back())
            cout << " ";
    }
    cout << endl;
}
template <class T>
void print(vector<vector<T>> &df) {
    for (auto &vec : df) {
        print(vec);
    }
}
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define xrep(i, a, b) for (int i = int(a); i < int(b); ++i)
using ll = long long;
const int INF = 100100100;

int main() {
    int N, Q;
    cin >> N;
    vector<int> A(N);
    rep(i, N) cin >> A[i];
    cin >> Q;
    vector<int> B(Q), C(Q);
    rep(i, Q) {
        cin >> B[i];
        cin >> C[i];
    }
    int sum = 0 ;   
    vector<int> cntA(100000, 0);
    for(auto a: A) {
        sum += a;
        cntA[a]++;
    }

    rep(i, Q) {
        int inc = (C[i]-B[i])*cntA[B[i]];
        cntA[C[i]] += cntA[B[i]];
        sum += inc;
        print(sum);
    }

    return 0;
}

Compiler output:
a.cc: In function 'void print(Head&&, Tail&& ...)':
a.cc:12:14: error: a function-definition is not allowed here before '{' token
   12 | void print() {
      |              ^
a.cc:15:1: error: a template declaration cannot appear at block scope
   15 | template <class Head, class... Tail>
      | ^~~~~~~~
a.cc:31:1: error: a template declaration cannot appear at block scope
   31 | template <class T>
      | ^~~~~~~~
a.cc:42:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   42 | int main() {
      |         ^~
a.cc:42:9: note: remove parentheses to default-initialize a variable
   42 | int main() {
      |         ^~
      |         --
a.cc:42:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:42:12: error: a function-definition is not allowed here before '{' token
   42 | int main() {
      |            ^
a.cc:68:2: error: expected '}' at end of input
   68 | }
      |  ^
a.cc:8:42: note: to match this '{'
    8 | void print(Head &&head, Tail &&... tail) {
      |                                          ^
Language: C

#include<bits/stdc++.h> 
using namespace std;
int n,a[100005],b[100005],c[100005],q;
long long s=0;
int main(){
    scanf("%d", &n);
	for(int i=0;i<n;i++){
		scanf("%d", &a[i]);
	}
	scanf("%d", &q);
	for(int i=0;i<q;i++){
		scanf("%d%d",&b[i],&c[i]);
	}
	for(int i=0;i<q;i++){
		for(int j=0;j<n;j++){
			if(a[j]==b[i]){
				a[j]=c[i];
			}
			s+=a[j];
		}
		printf("%d\n",s);
		s=0;
	}
	return 0;
}

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