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

#include <stdio.h>
#include <string.h>

int main(){
  char title[50][101];
  char sleeptitle[101];
  int time[50];
  int n,i,j;
  int total=0;
  bool flag=0;
  
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%s %d",title[i],&time[i]);
  }
  scanf("%s",sleeptitle);
  
  for(i=0;i<n;i++){
    if(flag==1){
      total+=time[i];
    }
    if(strcmp(sleeptitle,title[i])==0){
      flag=1;
    }
  }
  printf("%d",total);
}


Compiler output:
main.c: In function 'main':
main.c:10:3: error: unknown type name 'bool'
   10 |   bool flag=0;
      |   ^~~~
main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    2 | #include <string.h>
  +++ |+#include <stdbool.h>
    3 |
Language: C

#include <stdio.h>
#include <string.h>

int main(){
  char **title;
  char sleeptitle[100];
  char *time;
  int n,i,j;
  int total=0;
  bool flag=0;
  
  scanf("%d",&n);
  *title=(char**)malloc(sizeof(char*)*n);
  time=(int*)malloc(sizeof(int)*n);
  for(i=0;i<n;i++){
    title[i]=(char*)malloc(sizeof(char)*100);
    scanf("%s %d",title[i],time[i]);
  }
  scanf("%s",sleeptitle);
  
  for(i=0;i<n;i++){
    if(flag==1){
      total+=time[i];
    }
    if(strcmp(sleeptitle,title[i])==0){
      flag=1;
    }
  }
  
  printf("%d",total);
  
  for(i=0;i<n;i++){
    free(title[i]);
  }
  free(title);
  free(time);
}

Compiler output:
main.c: In function 'main':
main.c:10:3: error: unknown type name 'bool'
   10 |   bool flag=0;
      |   ^~~~
main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    2 | #include <string.h>
  +++ |+#include <stdbool.h>
    3 | 
main.c:13:18: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
   13 |   *title=(char**)malloc(sizeof(char*)*n);
      |                  ^~~~~~
main.c:3:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    2 | #include <string.h>
  +++ |+#include <stdlib.h>
    3 | 
main.c:13:18: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
   13 |   *title=(char**)malloc(sizeof(char*)*n);
      |                  ^~~~~~
main.c:13:18: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:13:9: error: assignment to 'char *' from incompatible pointer type 'char **' [-Wincompatible-pointer-types]
   13 |   *title=(char**)malloc(sizeof(char*)*n);
      |         ^
main.c:14:7: error: assignment to 'char *' from incompatible pointer type 'int *' [-Wincompatible-pointer-types]
   14 |   time=(int*)malloc(sizeof(int)*n);
      |       ^
main.c:33:5: error: implicit declaration of function 'free' [-Wimplicit-function-declaration]
   33 |     free(title[i]);
      |     ^~~~
main.c:33:5: note: include '<stdlib.h>' or provide a declaration of 'free'
main.c:33:5: warning: incompatible implicit declaration of built-in function 'free' [-Wbuiltin-declaration-mismatch]
main.c:33:5: note: include '<stdlib.h>' or provide a declaration of 'free'
main.c:35:3: warning: incompatible implicit declaration of built-in function 'free' [-Wbuiltin-declaration-mismatch]
   35 |   free(title);
      |   ^~~~
main.c:35:3: note: include '<stdlib.h>' or provide a declaration of 'free'
Language: C++

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

int main(){
  int t;
  cin >> t;
  int ti[M], i=0;
  string na[M], X;
  while(t--){
  	cin >> na[i];
    cin >> ti[i];
    i++
  }
  cin >> X;
  int found = -1;
  for( int j = 0; j <= i; j++){
    if(na[j] == X) {found = j;break;}
  }
  
  int t = 0;
  for(int j = found; j <=i; j++){
    t += ti[j]
  }
  
  cout << t;
  
  
  return 0;
}

Compiler output:
a.cc:2:2: error: invalid preprocessing directive #def; did you mean #ifdef?
    2 | #def M 50
      |  ^~~
      |  ifdef
a.cc: In function 'int main()':
a.cc:8:10: error: 'M' was not declared in this scope
    8 |   int ti[M], i=0;
      |          ^
a.cc:11:16: error: 'na' was not declared in this scope; did you mean 'nan'?
   11 |         cin >> na[i];
      |                ^~
      |                nan
a.cc:12:12: error: 'ti' was not declared in this scope; did you mean 'i'?
   12 |     cin >> ti[i];
      |            ^~
      |            i
a.cc:13:8: error: expected ';' before '}' token
   13 |     i++
      |        ^
      |        ;
   14 |   }
      |   ~     
a.cc:18:8: error: 'na' was not declared in this scope; did you mean 'nan'?
   18 |     if(na[j] == X) {found = j;break;}
      |        ^~
      |        nan
a.cc:21:7: error: redeclaration of 'int t'
   21 |   int t = 0;
      |       ^
a.cc:6:7: note: 'int t' previously declared here
    6 |   int t;
      |       ^
a.cc:23:10: error: 'ti' was not declared in this scope; did you mean 'i'?
   23 |     t += ti[j]
      |          ^~
      |          i
Language: C++

#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 2000000001; //check the limits, dummy

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);

     int n,k,l,sum=0,res=0;
     cin>>n;
     string str;
    vector< pair<string,int>> vct;
     for (int i=0;i<n;i++)
     {  string s;
       ll p;
       cin>>s>>p;
       vct.pb(mp(s,p));
     }
     cin>>str;
    for (int i=n-1;i>=0; i--){
        sum+=vct[i].s;
        if (vct[i].f==str){
                sum-=vct[i].s;
                    break;
        }
    }
  cout<<sum;
	return 0;
}



Compiler output:
In file included from /usr/include/c++/14/string:43,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:4:
/usr/include/c++/14/bits/allocator.h: In destructor 'std::__cxx11::basic_string<char>::_Alloc_hider::~_Alloc_hider()':
/usr/include/c++/14/bits/allocator.h:182:7: error: inlining failed in call to 'always_inline' 'std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = char]': target specific option mismatch
  182 |       ~allocator() _GLIBCXX_NOTHROW { }
      |       ^
In file included from /usr/include/c++/14/string:54:
/usr/include/c++/14/bits/basic_string.h:186:14: note: called from here
  186 |       struct _Alloc_hider : allocator_type // TODO check __is_final
      |              ^~~~~~~~~~~~
Language: C++

int main(int argc, char **argv)
{
    int n;
    string s;
    int l;
    vector<string> songs;
    vector<int> mins;

    cin >> n;

    rep(i, n)
    {
        cin >> s >> l;
        songs.push_back(s);
        mins.push_back(l);
    }
    cin >> s;

    vector<string>::iterator it = find(songs.begin(), songs.end(), s);
    int idx = (it - songs.begin());

    ll sum = 0;
    for (int i = idx + 1; i < mins.size(); i++)
    {
        sum += mins[i];
    }
    cout << sum << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:4:5: error: 'string' was not declared in this scope
    4 |     string s;
      |     ^~~~~~
a.cc:6:5: error: 'vector' was not declared in this scope
    6 |     vector<string> songs;
      |     ^~~~~~
a.cc:6:20: error: 'songs' was not declared in this scope
    6 |     vector<string> songs;
      |                    ^~~~~
a.cc:7:12: error: expected primary-expression before 'int'
    7 |     vector<int> mins;
      |            ^~~
a.cc:9:5: error: 'cin' was not declared in this scope
    9 |     cin >> n;
      |     ^~~
a.cc:11:9: error: 'i' was not declared in this scope
   11 |     rep(i, n)
      |         ^
a.cc:11:5: error: 'rep' was not declared in this scope
   11 |     rep(i, n)
      |     ^~~
a.cc:17:12: error: 's' was not declared in this scope
   17 |     cin >> s;
      |            ^
a.cc:19:21: error: '::iterator' has not been declared
   19 |     vector<string>::iterator it = find(songs.begin(), songs.end(), s);
      |                     ^~~~~~~~
a.cc:20:16: error: 'it' was not declared in this scope; did you mean 'int'?
   20 |     int idx = (it - songs.begin());
      |                ^~
      |                int
a.cc:22:5: error: 'll' was not declared in this scope; did you mean 'l'?
   22 |     ll sum = 0;
      |     ^~
      |     l
a.cc:23:31: error: 'mins' was not declared in this scope
   23 |     for (int i = idx + 1; i < mins.size(); i++)
      |                               ^~~~
a.cc:25:9: error: 'sum' was not declared in this scope
   25 |         sum += mins[i];
      |         ^~~
a.cc:27:5: error: 'cout' was not declared in this scope
   27 |     cout << sum << endl;
      |     ^~~~
a.cc:27:13: error: 'sum' was not declared in this scope
   27 |     cout << sum << endl;
      |             ^~~
a.cc:27:20: error: 'endl' was not declared in this scope
   27 |     cout << sum << endl;
      |                    ^~~~
Language: C++

入力 = input
出力 = print
ぜろ = 0
いち = 1
曲の数 = 入力()
整数化 = int
浮動小数点化 = float
曲の数 = 整数化(曲の数)
曲名 = [ぜろ]
時間 = [ぜろ]
曲名.remove(ぜろ)
時間.remove(ぜろ)
範囲 = range
for 制御変数 in 範囲(ぜろ,曲の数):
    入力された値 = 入力()
    曲名.append(入力された値)
    入力された値 = 入力()
    時間.append(入力された値)
    時間[制御変数] = 整数化(浮動小数点化(時間[制御変数]))
寝た時の曲名 = 入力()
まだわからん = ぜろ
寝たタイミング = まだわからん
for 制御変数 in 範囲(ぜろ,曲の数):
    if(曲名[制御変数] == 寝た時の曲名):
        寝たタイミング = 制御変数
        break
寝ていたときに流れていた曲の時間 = まだわからん
for 制御変数 in 範囲(寝たタイミング + いち,曲の数):
    寝ていたときに流れていた曲の時間 += 時間[制御変数]
出力(寝ていたときに流れていた曲の時間)

Compiler output:
a.cc:1:1: error: '\U00005165\U0000529b' does not name a type
    1 | 入力 = input
      | ^~~~
Language: C++

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

int main(){
    int n; cin >> n;
    vector<string> s(n);
    vector<int> t(n);
    for(int i=0;i<n;++i){
       con >> s[i] >> t[i];
    }
    string x; cin >> x;
    int ans =0;
    bool elf=false;
    for(int i=0;i<n;++i){
      if(s[i]==x) elf=true;
      if(elf) ans+=t[i];
    }
    cout << ans <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: 'con' was not declared in this scope; did you mean 'cos'?
    9 |        con >> s[i] >> t[i];
      |        ^~~
      |        cos
Language: C++

#include <bits/stdc++.h>

using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
typedef long long ll;


int main(){
  int n,t[55];
  int ans = 0;
  string x,s[55];
  cin >> n;
  rep(i,n){
    cin >> s[i] >> t[i];
  }
  cin >> x;
  for(i=n-1;i>=0;i--){
    if(x==s[i])break;
    ans += t[i];
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:7: error: 'i' was not declared in this scope
   18 |   for(i=n-1;i>=0;i--){
      |       ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main(){
    int N;
    int time = 0;
    string X;
    int num;
   vector<string> s(55);
   vector<int> t(55);

   cin >> N;
   for(int i=0;i<N;i++){
      cin >> s[i] >> t[i];
      
   }
   cin >> X;

   for(int i=0;i<N;i++){
     
       if(s[i] == X){
           num = i;
           break;
   }
       }

   }

   for(int i=num+1;i<N;i++){
       time += t[i];
   }

    cout << time;
    return 0;
}

Compiler output:
a.cc:29:4: error: expected unqualified-id before 'for'
   29 |    for(int i=num+1;i<N;i++){
      |    ^~~
a.cc:29:20: error: 'i' does not name a type
   29 |    for(int i=num+1;i<N;i++){
      |                    ^
a.cc:29:24: error: 'i' does not name a type
   29 |    for(int i=num+1;i<N;i++){
      |                        ^
a.cc:33:5: error: 'cout' does not name a type
   33 |     cout << time;
      |     ^~~~
a.cc:34:5: error: expected unqualified-id before 'return'
   34 |     return 0;
      |     ^~~~~~
a.cc:35:1: error: expected declaration before '}' token
   35 | }
      | ^
Language: C++



#include<bits/stdc++.h>
using namespace std;
#define inf INT_MAX
#define INF LLONG_MAX
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define int ll
#define vi vector<int>
#define IP pair<int,P>
#define PI pair<P,int>
#define PP pair<P,P>
#define Yes(f){cout<<(f?"Yes":"No")<<endl;}
#define YES(f){cout<<(f?"YES":"NO")<<endl;}


signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(20);

  int n;
  cin>>n;
  vector<string> s(n);
  vi v(n);

  rep(i,n){
    cin>>s[i]>>v[i];
  }

  string t;
  cin>>t;
  revesre(all(s));
  reverse(all(v));

  int ans=0;
  rep(i,n){
    if(s[i]==t) break;
    ans+=v[i];
  }

  cout<<ans<<endl;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:3: error: 'revesre' was not declared in this scope
   47 |   revesre(all(s));
      |   ^~~~~~~
Language: C++

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

int main() {
  int N, X;
  string s = [N];
  int t = [N];

  cin >> N;

  for (int i = 0; i < N; i++) {
    cin >> s[i] >> t[i];
  }

  cin >> X;

  int loopStart;
  for (int i = 0; i < N; i++) {
    if (s[i] == X) {
      loopStart = i;
      break;
    }
  }

  int ans = 0;
  for (int i = (loopStart + 1); i < N; i++) {
    ans = ans + t[i];
  }

  cout << ans << endl;
}

Compiler output:
a.cc: In lambda function:
a.cc:6:17: error: expected '{' before ';' token
    6 |   string s = [N];
      |                 ^
a.cc: In function 'int main()':
a.cc:6:14: error: conversion from 'main()::<lambda()>' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    6 |   string s = [N];
      |              ^~~
a.cc: In lambda function:
a.cc:7:14: error: expected '{' before ';' token
    7 |   int t = [N];
      |              ^
a.cc: In function 'int main()':
a.cc:7:11: error: cannot convert 'main()::<lambda()>' to 'int' in initialization
    7 |   int t = [N];
      |           ^~~
      |           |
      |           main()::<lambda()>
a.cc:12:21: error: invalid types 'int[int]' for array subscript
   12 |     cin >> s[i] >> t[i];
      |                     ^
a.cc:27:18: error: invalid types 'int[int]' for array subscript
   27 |     ans = ans + t[i];
      |                  ^
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;
    s = new String[N];

    int [] t;
    t = new int[N];

    for(int i=0; i<N; i++){
       s[i] = sc.next();
       t[i] = sc.nextInt();
    }

    String X =sc.next();

    int All = 0; 

    for(int i=s.indexOf(X); i<N; i++){
       All += t[j];
    }
      
    System.out.println(All);
   
  }
}

Compiler output:
Main.java:25: error: cannot find symbol
    for(int i=s.indexOf(X); i<N; i++){
               ^
  symbol:   method indexOf(String)
  location: variable s of type String[]
Main.java:26: error: cannot find symbol
       All += t[j];
                ^
  symbol:   variable j
  location: class Main
2 errors
Language: C++

#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cfloat>
#include <complex>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
#define ll long long
using namespace std;



int main(){

    int n;
    string x;
    int z;

    vector<string> vec(n);
    vector <int> vec1(n);


    for(int i = 0;i <= n;i ++){

        cin >> vec.at(i)  >> vec1.at(i);
        
    }

    cin >> x;

    for(int i = 0;i <= n;i ++){

        if(vec.at(n) == x){

            cout << "0" << endl;
            break;
        }else if(vec.at(i) == x){

            for(int j = 0;j >= vec.size(i);j ++){

                z += vec1.at(i);
            }else {

                cout << "0" <<endl;
                break;
            }
        }
    }

    cout << z << endl;
    return 0;
    
}

    

                


            

Compiler output:
a.cc: In function 'int main()':
a.cc:58:40: error: no matching function for call to 'std::vector<std::__cxx11::basic_string<char> >::size(int&)'
   58 |             for(int j = 0;j >= vec.size(i);j ++){
      |                                ~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from a.cc:8:
/usr/include/c++/14/bits/stl_vector.h:992:7: note: candidate: 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; size_type = long unsigned int]'
  992 |       size() const _GLIBCXX_NOEXCEPT
      |       ^~~~
/usr/include/c++/14/bits/stl_vector.h:992:7: note:   candidate expects 0 arguments, 1 provided
a.cc:61:14: error: expected '}' before 'else'
   61 |             }else {
      |              ^~~~
a.cc:56:33: note: to match this '{'
   56 |         }else if(vec.at(i) == x){
      |                                 ^
a.cc: At global scope:
a.cc:69:5: error: 'cout' does not name a type
   69 |     cout << z << endl;
      |     ^~~~
a.cc:70:5: error: expected unqualified-id before 'return'
   70 |     return 0;
      |     ^~~~~~
a.cc:72:1: error: expected declaration before '}' token
   72 | }
      | ^
Language: C++

#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cfloat>
#include <complex>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
#define ll long long
using namespace std;



int main(){

    int n;
    string x;
    int z;

    vector<string> vec(n);
    vector <int> vec1(n);


    for(int i = 0;i <= n;i ++){

        cin >> vec.at(i)  >> vec1.at(i);
        
    }

    cin >> x;

    for(int i = 0;i <= n;i ++){

        if(vec.at(n) == x){

            cout "0" <<endl;
            break;
        }else if(vec.at(i) == x){

            for(int j = 0;j >= vec.size(i);j ++){

                z += vec1.at(i);
            }else {

                cout << "0" <<endl;
                break;
            }
        }
    }

    cout << z << endl;
    return 0;
    
}

    

                


                


    

Compiler output:
a.cc: In function 'int main()':
a.cc:54:17: error: expected ';' before string constant
   54 |             cout "0" <<endl;
      |                 ^~~~
      |                 ;
a.cc:58:40: error: no matching function for call to 'std::vector<std::__cxx11::basic_string<char> >::size(int&)'
   58 |             for(int j = 0;j >= vec.size(i);j ++){
      |                                ~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from a.cc:8:
/usr/include/c++/14/bits/stl_vector.h:992:7: note: candidate: 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; size_type = long unsigned int]'
  992 |       size() const _GLIBCXX_NOEXCEPT
      |       ^~~~
/usr/include/c++/14/bits/stl_vector.h:992:7: note:   candidate expects 0 arguments, 1 provided
a.cc:61:14: error: expected '}' before 'else'
   61 |             }else {
      |              ^~~~
a.cc:56:33: note: to match this '{'
   56 |         }else if(vec.at(i) == x){
      |                                 ^
a.cc: At global scope:
a.cc:69:5: error: 'cout' does not name a type
   69 |     cout << z << endl;
      |     ^~~~
a.cc:70:5: error: expected unqualified-id before 'return'
   70 |     return 0;
      |     ^~~~~~
a.cc:72:1: error: expected declaration before '}' token
   72 | }
      | ^
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;
    s = new String[N];

    int [] t;
    t = new int[N];

    for(int i=0; i<N; i++){
       s[i] = sc.next();
       t[i] = sc.nextInt();
    }

    String X =sc.next();

    int All = 0; 

    for(int i=0; i<N; i++){
       if(s[i] == X){
         for(int j=i+1; j<N; j++){
            All += t[j];
         }
       }
       else{
        continue
       }
    }
    System.out.println(All);
   
  }
}

Compiler output:
Main.java:32: error: ';' expected
        continue
                ^
1 error
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;
    s = new String[N];

    int [] t;
    t = new int[N];

    for(int i=0; i<N; i++){
       s[i] = sc.next();
       t[i] = sc.nextInt();
    }

    String X =sc.next();

    int All = 0; 

    for(int i=0; i<N; i++){
       if(s[i] == X){
         for(int j=i+1; j<N; j++){
            All += t[j];
         }
       }
       break;
       else{
         All = 0;
       }
    }
    System.out.println(All);
  }
}

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

#include<iostream>
using namespace std;
#include<string.h>
int main()
{int t[]={2,5,25};
 int sum=0,i,n;
 string str[]={"dewang","sixth","prelims"; string x[]={"prelims"};
 cin>>n;
 for(i=0;i<n;i++)
 {cout<<str[i]<<" "<<t[i];
 }
 for(i=0;i<n;i++)
 {if(x[20]==str[i])
 { i=n-1;
   while(i>0)
   {sum+=t[i+1];
    i--;}break;}}
 cout<<"/n"<<sum;
 return 0;}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:7:42: error: expected '}' before ';' token
    7 |  string str[]={"dewang","sixth","prelims"; string x[]={"prelims"};
      |               ~                          ^
Language: C

#include <stdio.h>
#include <string.h>
#include "algorithm.h"

int main()
{
	int i,l=0,time_count=0;
	int n;
	scanf("%d",&n);
	char s[n][101],x[101];
	int t[n];
	for(i=1;i<=n;i++)	scanf("%s %d",s[i],&t[i]);
	scanf("%s",x);
	i=1;
	while(strcmp(s[i],x)!=0)	i++;
	l = i+1;
	while(l<=n)
	{
		time_count += t[l];
		l++;
	}
	printf("%d",time_count);
	return 0;
}

Compiler output:
main.c:3:10: fatal error: algorithm.h: No such file or directory
    3 | #include "algorithm.h"
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

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

int main() {

    int n;
    cin >> n;

    vector<int> vec_int();
    vector<string> vec_string();

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < 2; j++) {
            // cin >> vec.at(i).at(j);
            string s;
            cin >> s;
            int time;
            cin >> time;
            vec_string().push_back(s);
            vec_int().push_back(time);
        }
    }
    string sleep;
    cin >> sleep;

    bool isnotsleep = false;
    int cnt = 0;
    for (int k = 0; k < n; k++) {
        if (isnotsleep)
            cnt += vec_int().at(k);
        if ( vec_string().at(k) == sleep) {
            isnotsleep = true;
        }
    }

    cout << cnt;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:24: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   12 |     vector<int> vec_int();
      |                        ^~
a.cc:13:30: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   13 |     vector<string> vec_string();
      |                              ^~
/usr/bin/ld: /tmp/ccou506f.o: in function `main':
a.cc:(.text+0x89): undefined reference to `vec_string[abi:cxx11]()'
/usr/bin/ld: a.cc:(.text+0xbd): undefined reference to `vec_int()'
/usr/bin/ld: a.cc:(.text+0x160): undefined reference to `vec_int()'
/usr/bin/ld: a.cc:(.text+0x192): undefined reference to `vec_string[abi:cxx11]()'
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
using namespace std;
#incluse<string.h>
int main()
{int t[]={2,5,25};
 int sum=0,i,n;
 string str[]={"dewang","sixth","prelims"; string x[]={"prelims"};
 cin>>n;
 for(i=0;i<n;i++)
 {cout<<str[i]<<" "<<t[i];
 }
 for(i=0;i<n;i++)
 {if(x[20]==str[i])
 { i=n-1;
   while(i>0)
   {sum+=t[i+1];
    i--;}break;}}
 cout<<"/n"<<sum;
 return 0;}
    

Compiler output:
a.cc:3:2: error: invalid preprocessing directive #incluse; did you mean #include?
    3 | #incluse<string.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:7:42: error: expected '}' before ';' token
    7 |  string str[]={"dewang","sixth","prelims"; string x[]={"prelims"};
      |               ~                          ^
Language: C++

#include <iostream>
using namespace std;
int main(int argc, char* argv[]) {
	int n;
	sscanf( argv[1] , "%d" , &n);
	char* x = argv[ n * 2 + 1 + 1 ];
	int f = 0;
	int z;
	for ( int i = 2; i < n * 2 + 1 + 1; i = i + 2 ) {
		if ( f == 1){
			int t;
			sscanf( argv[ i + 1 ] , "%d" , &t);
			z = z + t;
		}
		if(!strcmp( argv[ i ], x )){
			f = 1;
		}
	}
	cout << z << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:15:21: error: 'strcmp' was not declared in this scope
   15 |                 if(!strcmp( argv[ i ], x )){
      |                     ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C

#include<stdio.h>
#include<conio.h>
#include<string.h>
int main(){
int n,i,j,k,sum=0,result,a;
char s1[30];
int t[50];
char s[50][30];
printf("Enter number of song:");
scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%s",&s[i]);
  	scanf("%d",&t[i]);
  }
  for(a=0;a<n;a++){
  printf("%s %d",s[a],t[a]);  }
  
  printf("Enter tittle of song:");
  scanf("%s",&s1);
  for(j=0;j<n;j++){
  	result = strcmp(s1, s[j]);
    if(result==0){
    for(k=j+1;k<n;k++){
    sum = sum+t[k];
    }
    printf("%d",sum);
    }
  }
  return 0;
}

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

#include<iostream>
using namespace std;
int main()
{int t[]={2,5,25};
 int sum=0,i,n;
 char str[]={"dwango","sixth","prelims"};char x[20];
 cin>>n;
 for(i=0;i<n;i++)
 {cout<<str[i]<<" "<<t[i];
 }
 for(i=0;i<n;i++)
 {if(x[20]==str[i])
 { i=n-1;
   while(i>0)
   {sum+=t[i+1];
    i--;}break;}}
 cout<<sum;
 return 0;}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:6:40: error: too many initializers for 'char []'
    6 |  char str[]={"dwango","sixth","prelims"};char x[20];
      |                                        ^
Language: C++

#include<iostream>
using namespace std;
int main()
{int t[]={2,5,25};
 int sum=0,i,n;
 char str[]{"dwango","sixth","prelims"};char x[20];
 cin>>n;
 for(i=0;i<n;i++)
 {cout<<str[i]<<" "<<t[i];
 }
 for(i=0;i<n;i++)
 {if(x[20]==str[i])
 { i=n-1;
   while(i>0)
   {sum+=t[i+1];
    i--;}break;}}
 cout<<sum;
 return 0;}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:6:39: error: too many initializers for 'char []'
    6 |  char str[]{"dwango","sixth","prelims"};char x[20];
      |                                       ^
Language: C

#include <stdio.h>//魔法
int main(void){
 int tanaka= 0;
  scanf("5d
      
}

Compiler output:
main.c: In function 'main':
main.c:4:9: warning: missing terminating " character
    4 |   scanf("5d
      |         ^
main.c:4:9: error: missing terminating " character
    4 |   scanf("5d
      |         ^~~
main.c:6:1: error: expected expression before '}' token
    6 | }
      | ^
main.c:4:9: error: expected ';' before '}' token
    4 |   scanf("5d
      |         ^
      |         ;
    5 | 
    6 | }
      | ~
Language: C++

#include<iostream>
using namespace std;
int main()
{int t[]={2,5,25};
 int sum=0,i,n;
 char s[]{"dwango","sixth","prelims"},x[20];
 cin>>n;
 for(i=0;i<n;i++)
 {cout<<s[i]<<" "<<t[i];
 }
 for(i=0;i<n;i++)
 {if(x[20]==s[i])
 { i=n-1;
   while(i>0)
   {sum+=t[i+1];
    i--;}break;}}
 cout<<sum;
 return 0;}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:6:37: error: too many initializers for 'char []'
    6 |  char s[]{"dwango","sixth","prelims"},x[20];
      |                                     ^
Language: C++

// ConsoleApplication4.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//



#include "pch.h"
#include <iostream>
#include <string>
#include <math.h>
using namespace std;


int main()
{
	std::string song_name[50],X;
	int N, t[50],j=0,total_t=0;
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> song_name[i];
		cin >> t[i];
	}
	cin >> X;


	while(X.compare(song_name[j])!=0) {
		j++;
	}

	for (int k = j + 1; k < N; k++) {
		
		total_t += t[k];
	}

	cout << total_t << endl;
}


// プログラムの実行: Ctrl + F5 または [デバッグ] > [デバッグなしで開始] メニュー
// プログラムのデバッグ: F5 または [デバッグ] > [デバッグの開始] メニュー

// 作業を開始するためのヒント: 
//    1. ソリューション エクスプローラー ウィンドウを使用してファイルを追加/管理します 
//   2. チーム エクスプローラー ウィンドウを使用してソース管理に接続します
//   3. 出力ウィンドウを使用して、ビルド出力とその他のメッセージを表示します
//   4. エラー一覧ウィンドウを使用してエラーを表示します
//   5. [プロジェクト] > [新しい項目の追加] と移動して新しいコード ファイルを作成するか、[プロジェクト] > [既存の項目の追加] と移動して既存のコード ファイルをプロジェクトに追加します
//   6. 後ほどこのプロジェクトを再び開く場合、[ファイル] > [開く] > [プロジェクト] と移動して .sln ファイルを選択します


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

#include<iostream>
using namespace std;
int main()
{int t[]={2,5,25};
 int sum=0,i,n;
 char s[]{"dwango","sixth","prelims"},x[]={"dwango"};
 cin>>n;
 for(i=0;i<n;i++)
 {cout<<s[i]<<" "<<t[i];
 }
 for(i=0;i<n;i++)
 {if(x[20]==s[i])
 { i=n-1;
   while(i>0)
   {sum+=t[i+1];
    i--;}break;}}
 cout<<sum;
 return 0;}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:6:37: error: too many initializers for 'char []'
    6 |  char s[]{"dwango","sixth","prelims"},x[]={"dwango"};
      |                                     ^
Language: C++

#include <bits/stdc++.h>

using namespace std;
int a[1000],n;
long sum;
string s[1000],x;
int main()
{cin>>n;
for(int i=0;i<n;i++){
    cin>>s[i];
    cin>>a[i];}
    cin>>x;
    for(int i=0;i<n;i++)
        if(s[i]==x){int b=i;
    break;}
    for(int i=b;i<n;i++)
        sum+=a[i+1];
    cout<<sum;
    return 0;
}


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

#include <bits/stdc++.h>

using namespace std;
int a[1000],n;
long sum;
string s[1000],x;
int main()
{cin>>n;
for(int i=0;i<n;i++){
    cin>>s[i];
    cin>>a[i];}
    cin>>x;
    for(int i=0;i<n;i++)
        if(s[i]==x){int b=i;
    break;}
    for(int i=b;i<n;i++)
        sum+=a[i];
    cout<<sum;
    return 0;
}


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

#include<iostream>

using namespace std;

struct d{
  string s;
  int t;
}

int main(){
  int n;
  cin>>n;
  d r[n];
  for(int i=0;i<n;i++){
    cin>>r[i].s>>r[i].t;
  }
  string l;
  cin>>l;
  bool y=false;
  long long ans=0;
  for(int i=0;i<n;i++){
  	if(y){
      ans+=r[i].t;
    }
    if(r[i].s==l){
      true;
    }
  }
  cout<<ans;
  return 0;
}


Compiler output:
a.cc:8:2: error: expected ';' after struct definition
    8 | }
      |  ^
      |  ;
Language: C++

#include<iostream>

using namespace std;

struct r{
  string s;
  int t;
}

int main(){
  int n;
  cin>>n;
  r[n];
  for(int i=0;i<n;i++){
    cin>>r[i].s>>r[i].t;
  }
  string l;
  cin>>l;
  bool y=false;
  long long ans=0;
  for(int i=0;i<n;i++){
  	if(y){
      ans+=r[i].t;
    }
    if(r[i].s==l){
      true;
    }
  }
  cout<<ans;
  return 0;
}

Compiler output:
a.cc:8:2: error: expected ';' after struct definition
    8 | }
      |  ^
      |  ;
a.cc: In function 'int main()':
a.cc:13:4: error: structured binding declaration cannot have type 'r'
   13 |   r[n];
      |    ^~~
a.cc:13:4: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:13:5: error: conflicting declaration 'auto n'
   13 |   r[n];
      |     ^
a.cc:11:7: note: previous declaration as 'int n'
   11 |   int n;
      |       ^
a.cc:13:7: error: expected initializer before ';' token
   13 |   r[n];
      |       ^
a.cc:15:11: error: expected primary-expression before '[' token
   15 |     cin>>r[i].s>>r[i].t;
      |           ^
a.cc:15:19: error: expected primary-expression before '[' token
   15 |     cin>>r[i].s>>r[i].t;
      |                   ^
a.cc:23:13: error: expected primary-expression before '[' token
   23 |       ans+=r[i].t;
      |             ^
a.cc:25:9: error: expected unqualified-id before '[' token
   25 |     if(r[i].s==l){
      |         ^
Language: C++

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

//Compiler version g++ 6.3.0

int main()
{
  int N;
  cin>>N;
  vector<vector<int>> vec(2,vector<int>(N) )
  for(int i=0;i<2;i++){
    for(int j=0;j<N;j++){
      cin>>vec.at(i).at(j);
    }
  }
  int X;
  cin>>X;
  int sum=0;
  for(int i=X+1;i<N;i++){
    sum+=vec.at(2).at(i)\
  }
  cout<<sum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: expected ',' or ';' before 'for'
   11 |   for(int i=0;i<2;i++){
      |   ^~~
a.cc:11:15: error: 'i' was not declared in this scope
   11 |   for(int i=0;i<2;i++){
      |               ^
a.cc:21:1: error: expected ';' before '}' token
   21 |   }
      | ^ ~
      | ;
Language: C++

#include <bits/stdc++.h>
#include <string>
#include <math.h>
using namespace std;
int main()
{
  int a=0,b=0,c=0,d=0,e=0,f=0,i=0,j=0,k=0;
  int sum=0,num=0,count=0,ans=0,min=0,max=0;
  double d1=0,d2=0,d3=0,d4=0,d5=0,d6=0;
  int a1[999999],a2[999999],a3[999999];
  string s1,s2,s3;
  cin>>a;
  for(i=0;i<a;i++){
    cin>>s1>>a1[i];
    sum+=a1[i];
    s2+=s1;
    a2[i]=s1.size();
  }
  cin>>s3;
  b=s2.find(s3)+s3.size();
  while(1){
    if(b>c){
      c+=a2[i];
      i++;
      d+=a1[i];
    }else{
      brake;
    }
  }
  cout<<sum-d<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:7: error: 'brake' was not declared in this scope; did you mean 'brk'?
   27 |       brake;
      |       ^~~~~
      |       brk
Language: C++

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

//Compiler version g++ 6.3.0

int main()
{
  int N;
  cin>>N;
  vector<vector<int>> vec(2,vector<int>(N) )
  for(int i=0;i<2;i++){
    for(int j=0;j<N;j++){
      cin>>vec.at(i).at(j);
    }
  }
  int X;
  cin>>X;
  int sum=0;
  for(int i=X;i<N;i++){
    sum+=vec.at(2).at(i)\
  }
  cout<<sum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: expected ',' or ';' before 'for'
   11 |   for(int i=0;i<2;i++){
      |   ^~~
a.cc:11:15: error: 'i' was not declared in this scope
   11 |   for(int i=0;i<2;i++){
      |               ^
a.cc:21:1: error: expected ';' before '}' token
   21 |   }
      | ^ ~
      | ;
Language: C++

#include<iostream>
using namespace std;
int main()
{int t[10],sum=0,i;
 char s[100],x[20];
 cin>>n;
 for(int i=0;i<n;i++)
 {cin>>s[i];
   cin>>t[i];}
 for(i=0;i<n;i++)
 {cout<<s[i]<<" "<<t[i];
 }cin >>x[20];
 for(i=0;i<n;i++)
 {if(x[20]==s[i])
 { i=n-1;
   while(i>0)
   {sum+=t[i+1];
    i--;}break;}}
 cout<<sum;
 return 0;}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: 'n' was not declared in this scope
    6 |  cin>>n;
      |       ^
Language: C

#include<stdio.h>
#include<string.h>
main(){
int n,i,j,k,sum=0,result,a;
char s1[];
  printf("Enter number of song:");
  scanf("%d",&n);
  int t[50];
  char s[50][30];
  for(i=0;i<n;i++){
  	scanf("%s",&s[i]);
  	scanf("%d",&t[i]);
  }
  for(a=0;a<n;a++){
  printf("%s %d",s[a],t[a]);  }
  
  printf("Enter tittle of song:");
  scanf("%s",&s1);
  for(j=0;j<n;j++){
  	result = strcmp(s1, s[j]);
    if(result==0){
    for(k=j+1;k<n;k++){
    sum = sum+t[k];
    }
    printf("%d",sum);
    }
  }
}

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:5:6: error: array size missing in 's1'
    5 | char s1[];
      |      ^~
Language: C

#include<stdio.h>
#include<string.h>
int main(){
int n,i,j,k,sum=0,result,a;
char s1[];
  printf("Enter number of song:");
  scanf("%d",&n);
  int t[50];
  char s[][];
  for(i=0;i<n;i++){
  	scanf("%s",&s[i]);
  	scanf("%d",&t[i]);
  }
  for(a=0;a<n;a++){
  printf("%s %d",s[a],t[a]);  }
  
  printf("Enter tittle of song:");
  scanf("%s",&s1);
  for(j=0;j<n;j++){
  	result = strcmp(s1, s[j]);
    if(result==0){
    for(k=j+1;k<n;k++){
    sum = sum+t[k];
    }
    printf("%d",sum);
    }
  }
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:6: error: array size missing in 's1'
    5 | char s1[];
      |      ^~
main.c:9:8: error: array type has incomplete element type 'char[]'
    9 |   char s[][];
      |        ^
main.c:9:8: note: declaration of 's' as multidimensional array must have bounds for all dimensions except the first
Language: C++

#include<iostream>
using namespace std;
int main()
{int t[10],sum=0;
 char s[100],x[20];
 cin>>n;
 for(int i=0;i<n;i++)
 {gets(s[i]);
   cin>>t[i];}
 for(i=0;i<n;i++)
 {cout<<s[i]<<" "<<t[i];
 }cin >>x[20];
 for(i=0;i<n;i++)
 {if(x[20]==s[i])
 { i=n-1;
   while(i>0)
   {sum+=t[i+1];
    i--;}break;}}
 cout<<sum;
 return 0}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: 'n' was not declared in this scope
    6 |  cin>>n;
      |       ^
a.cc:8:3: error: 'gets' was not declared in this scope; did you mean 'getw'?
    8 |  {gets(s[i]);
      |   ^~~~
      |   getw
a.cc:10:6: error: 'i' was not declared in this scope
   10 |  for(i=0;i<n;i++)
      |      ^
a.cc:13:6: error: 'i' was not declared in this scope
   13 |  for(i=0;i<n;i++)
      |      ^
a.cc:20:10: error: expected ';' before '}' token
   20 |  return 0}
      |          ^
      |          ;
Language: C++

#include<iostream>
using namespace std;
int main()
{int t[10],sum=0;
 char s[100],x[20];
 cin>>n;
 for(int i=0;i<n;i++)
 {gets(s[i]);
   cin>>t[i];}
 for(i=0;i<n;i++)
 {cout<<s[i]<<" "<<t[i];
 }cin >>x[20];
 for(i=0;i<n;i++)
 {if(x[20]==s[i])
 { i=n-1;
   while(i>0)
   {sum+=t[i+1];
    i--;}}}
 cout<<sum;
 return 
    

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: 'n' was not declared in this scope
    6 |  cin>>n;
      |       ^
a.cc:8:3: error: 'gets' was not declared in this scope; did you mean 'getw'?
    8 |  {gets(s[i]);
      |   ^~~~
      |   getw
a.cc:10:6: error: 'i' was not declared in this scope
   10 |  for(i=0;i<n;i++)
      |      ^
a.cc:13:6: error: 'i' was not declared in this scope
   13 |  for(i=0;i<n;i++)
      |      ^
a.cc:20:8: error: expected primary-expression at end of input
   20 |  return
      |        ^
a.cc:20:8: error: expected ';' at end of input
   20 |  return
      |        ^
      |        ;
a.cc:20:8: error: expected '}' at end of input
a.cc:4:1: note: to match this '{'
    4 | {int t[10],sum=0;
      | ^
Language: C++

#!/usr/bin/python3

sl = []
nl = []

n = int(input())

for i in range(n):
    s,t= input().split()
    sl.append(s)
    nl.append(int(t))

index = sl.index(input())

cnt = 0

for i in nl[index+1:]:
    cnt += i

print(cnt)

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #!
    1 | #!/usr/bin/python3
      |  ^
a.cc:3:1: error: 'sl' does not name a type
    3 | sl = []
      | ^~
Language: C++

// / #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")
 
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <cassert>
#include <unordered_set>
#include <unordered_map>
#include <set>
#include <map>
#include <queue>
#include <random>
#include <bitset>
#include <time.h>
#include <stack>
#include <sstream>
#include <regex>
 
#define prev asasddlsa
#define rank aljds
 
using namespace std;
 
typedef long long ll;
typedef long double dbl;

mt19937 mrand(random_device{} ());
int rnd(int x = INT_MAX) {
    return mrand() % x;
}

template<typename T>
void print(const vector<T>& s){
    for (auto x : s)
        cout << x << ' ';
    cout << endl;
}
 
template<class T>
void print(const T* s, int n){
    for (int i = 0; i < n; i++){
        cout << s[i] + 1 << ' ';
    }
    cout << endl;
}
 
template<class T>
void print(vector<vector<T>> s){
    for (int i = 0; i < s.size(); i++)
        print(s[i]);
}

int main(){
    srand(time(0));
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    vector<pair<string, int>> s(n);
    for (int i = 0; i < n; i++)
        cin >> s[i].first >> s[i].second;
    string x;
    cin >> x;
    for (int i = 0; i < n; i++){
        if (s[i].first == x){
            ll res = 0;
            for (int j = i + 1; j < n; j++){
                res += s[j].second;
            }
            cout << res << endl;
        }
    }
    return 0;
}


Compiler output:
a.cc:31:17: error: 'INT_MAX' was not declared in this scope
   31 | int rnd(int x = INT_MAX) {
      |                 ^~~~~~~
a.cc:21:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   20 | #include <regex>
  +++ |+#include <climits>
   21 |
Language: C++

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <stdlib.h>
#include <vector>
#include <map>
#include <unordered_map>
#include <algorithm>
using namespace std;

int main()
{
	int num;
	cin >> num;
	
	char tytle[50][1000];
	int time[50];
	for (int i = 0; i < num;i++) {
	
		cin >> tytle[i] >> time[i];
	}

	char sleep[1000];
	cin >> sleep;

	int a;
	for (int i = 0; i < num;i++) {
		if (strcmp(tytle[i],sleep)==0) {
			a = i;
		}
	}

	int ans = 0;
	for (int i = a+1; i < num;i++) {
		ans += time[i];
	}

	cout << ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:21: error: 'strcmp' was not declared in this scope
   28 |                 if (strcmp(tytle[i],sleep)==0) {
      |                     ^~~~~~
a.cc:9:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include <algorithm>
  +++ |+#include <cstring>
    9 | using namespace std;
Language: C++

#include <bits/stdc++.h>
#define rep(i,m,n) for(int i=m; i<n; i++)
#define ci(n) cin << n
#define co(n) cout << n << endl
using namespace std;

int main(){
  int n, x;
  cin >> n;
  int a[n]
  string s[n];
  rep(i,0,n) cin >> s[i] >> a[i];
  cin >> x;
  int c=0, d=0;
  rep(i,0,n){
    if(s[i]!=x) c++;
    else break;
  }
  
  rep(i,c,n) d+=a[i];
  
  co(d);

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: expected initializer before 'string'
   11 |   string s[n];
      |   ^~~~~~
a.cc:12:21: error: 's' was not declared in this scope
   12 |   rep(i,0,n) cin >> s[i] >> a[i];
      |                     ^
a.cc:12:29: error: 'a' was not declared in this scope
   12 |   rep(i,0,n) cin >> s[i] >> a[i];
      |                             ^
a.cc:16:8: error: 's' was not declared in this scope
   16 |     if(s[i]!=x) c++;
      |        ^
a.cc:20:17: error: 'a' was not declared in this scope
   20 |   rep(i,c,n) d+=a[i];
      |                 ^
Language: C

#include<stdio.h>

int t;
int n <= 50;
char s[100];
int sum = 0;

int main(void){
	scanf("%d", &n);
  
	while ( i = 0; i < n; i++){
    scanf( "%s %d",&s, &t);
    printf("%s %d\n",s, t);
    return sum += t;
    }
  
  printf( "%d\n",sum);
  
  return 0;
}


Compiler output:
main.c:4:7: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
    4 | int n <= 50;
      |       ^~
main.c: In function 'main':
main.c:9:22: error: 'n' undeclared (first use in this function)
    9 |         scanf("%d", &n);
      |                      ^
main.c:9:22: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:17: error: 'i' undeclared (first use in this function)
   11 |         while ( i = 0; i < n; i++){
      |                 ^
main.c:11:22: error: expected ')' before ';' token
   11 |         while ( i = 0; i < n; i++){
      |               ~      ^
      |                      )
Language: C++

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

int main() {
  string text;
  int N;
  int j=1,k=0,time=0,timeall=0;
  cin >> N;
  string s[N];
  int t[N];
  string name;
  
for(int i=0;i<N;i++) {
 cin >> s[i]>>t[i];
 timeall+=t[i];
}

cin>> name;
while(j){
k++;
if(name==s[k-1]) j=0;
}

for(i=0;i<k;i++) timeall-t[i];

 cout <<timeall;}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:5: error: 'i' was not declared in this scope
   24 | for(i=0;i<k;i++) timeall-t[i];
      |     ^
Language: C

#include<stdio.h>

int n,t;
char s[100];
int sum = 0;

int main(void){
	n <= 50;
  
	while ( i = 0; i < n; i++){
    scanf( "%s %d",&s, &t);
    printf("%s %d\n",s, t);
    return sum += t;
    }
  
  printf( "%d\n",sum);
  
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:17: error: 'i' undeclared (first use in this function)
   10 |         while ( i = 0; i < n; i++){
      |                 ^
main.c:10:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:22: error: expected ')' before ';' token
   10 |         while ( i = 0; i < n; i++){
      |               ~      ^
      |                      )
Language: C++

#include <bits/stdc++.h> 
using namespace std;
int main(void){
  int n; cin >> n;
  string s[n]; 
  int t[n];
  for(int i = 0; i< n; i++{
    cin >> s[i] >> t[i];
  }
  string x; cin >> x;
  int time;
  for(int i = 0; i<n; i++){
    if(s[i] == x) time = i;
  }
  int ans = 0;
  for(int i = time + 1; i < n; i++){
    ans += t[i];
  }
  cout << ans << endl;
}

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

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <stdlib.h>
#include <vector>
#include <map>
#include <unordered_map>
#include <algorithm>
using namespace std;

int main()
{
	int num;
	cin >> num;
	
	char tytle[50][1000];
	int time[50];
	for (int i = 0; i < num;i++) {
	
		cin >> tytle[i] >> time[i];
	}

	char sleep[1000];
	cin >> sleep;

	int a;
	for (int i = 0; i < num;i++) {
		if (!strcmp(tytle[i],sleep)) {
			a = i;
		}
	}

	int ans = 0;
	for (int i = a+1; i < num;i++) {
		ans += time[i];
	}

	cout << ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:22: error: 'strcmp' was not declared in this scope
   28 |                 if (!strcmp(tytle[i],sleep)) {
      |                      ^~~~~~
a.cc:9:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include <algorithm>
  +++ |+#include <cstring>
    9 | using namespace std;
Language: C++

N = int(input())
s = []
t = []
for i in range(N):
    sp, tp = input().split(" ")
    s.append(sp)
    t.append(int(tp))

X = input()

cnt = 0
ans = 0

for i in range(N):
    if cnt == 1:
        ans += t[i]
    if s[i] == X:
        cnt = 1

print(ans)


Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N = int(input())
      | ^