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

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

int eratos(ll n,vector<bool>s){
    s ={true};
    s[0]=false;
    s[1]=false;
    for(int i=2;i<=n;i++){
        for(int j=i+i;j<n;j+=i){
            s[j]=false;
        }
    }
}

int main(){
    ll x;
    cin>>x;
    vector<bool>s[x+100];
    ll temx=0;
    ll ans;
    eratos((x+100),s);
    for(int i=x;i*i<=n;i++){
        if(x%i==0){
            temx=0;
        }else{
            temx = x;
            ans = termx;
            break;
        }
    }
    if(temx==0){
        bool can =true;
        while(can){
            termx++;
            if(s[termx])ans=termx;can=false;
        }
    }
    cout<<ans<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int eratos(long long int, std::vector<bool>)':
a.cc:14:1: warning: no return statement in function returning non-void [-Wreturn-type]
   14 | }
      | ^
a.cc: In function 'int main()':
a.cc:22:20: error: could not convert '(std::vector<bool>*)(& s)' from 'std::vector<bool>*' to 'std::vector<bool>'
   22 |     eratos((x+100),s);
      |                    ^
      |                    |
      |                    std::vector<bool>*
a.cc:23:22: error: 'n' was not declared in this scope
   23 |     for(int i=x;i*i<=n;i++){
      |                      ^
a.cc:28:19: error: 'termx' was not declared in this scope; did you mean 'temx'?
   28 |             ans = termx;
      |                   ^~~~~
      |                   temx
a.cc:35:13: error: 'termx' was not declared in this scope; did you mean 'temx'?
   35 |             termx++;
      |             ^~~~~
      |             temx
Language: C++

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
using namespace std;
typedef long long ll;
//max=({});


int main() {
	ll x;
	cin >> x;
	for (int i = x;i <= 100010;++i) {
		int cnt = 0;
		for (int j = 2;j < x;++j) {
			if (i % j == 0) {
				cnt++:
			}
			if (cnt > 0) {
				break;
			}
		}
		if (cnt == 0) {
			cout << i << endl;
			break;
		}
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:38: error: expected ';' before ':' token
   16 |                                 cnt++:
      |                                      ^
      |                                      ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
   
  int X;
  
  cin >> X;
  
  prime X<n;
  
  cout << X+n << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'prime' was not declared in this scope
   10 |   prime X<n;
      |   ^~~~~
a.cc:12:13: error: 'n' was not declared in this scope
   12 |   cout << X+n << endl;
      |             ^
Language: C

// CPP program to print the Kth prime greater than N 
#include <bits/stdc++.h> 
using namespace std; 

// set the MAX_SIZE of the array to 10^6 
const int MAX_SIZE = 1e6; 

// initialize the prime array 
bool prime[MAX_SIZE + 1]; 

void sieve() 
{ 

  // set all numbers as prime for time being 
  memset(prime, true, sizeof(prime)); 

  for (int p = 2; p * p <= MAX_SIZE; p++) { 

    // if prime[p] is not changed, then it is a prime 
    if (prime[p] == true) { 

      // update all multiples of p 
      for (int i = p * p; i <= MAX_SIZE; i += p) 
        prime[i] = false; 
    } 
  } 
} 
// Function to find the kth prime greater than n 
int kthPrimeGreaterThanN(int n, int k) 
{ 

  int res = -1; 
  // looping through the numbers greater than n 
  for (int i = n + 1; i < MAX_SIZE; i++) { 

    // decrement k if i is prime 
    if (prime[i] == true) 
      k--; 

    // store the kth prime greater than n 
    if (k == 0) { 
      res = i; 
      break; 
    } 
  } 

  return res; 
} 
bool isPrime(int n) 
{ 
    // Corner cases 
    if (n <= 1)  return false; 
    if (n <= 3)  return true; 
  
    // This is checked so that we can skip  
    // middle five numbers in below loop 
    if (n%2 == 0 || n%3 == 0) return false; 
  
    for (int i=5; i*i<=n; i=i+6) 
        if (n%i == 0 || n%(i+2) == 0) 
           return false; 
  
    return true; 
} 

// Driver code 
int main() 
{ 

  sieve(); 
  int n , k = 1; 
  cin>>n;
  if(isPrime(n)) cout<<n;
  else
  cout << kthPrimeGreaterThanN(n, k); 
  return 0; 
} 


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

#include <bits/stdc++.h>

using namespace std;

bool IsPrime(int num)
{
    for (int i = 3; i*i <= n; i+=2){
      if(n%i == 0) return false;
    }

    return true;
}

int main() {
#ifdef  DEBUG
  ifstream in("input.txt");
  cin.rdbuf(in.rdbuf());
#endif  // for local.
  int x; cin >> x;
  if (x == 2) {
    cout << 2 << endl;
    return 0;
  }
  
  if (x & 1 == 0) x++;
  for (int i = x; ; i += 2) {
    if (IsPrime(i)) {
      cout << i << endl;
      return 0;
    } 
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'bool IsPrime(int)':
a.cc:7:28: error: 'n' was not declared in this scope
    7 |     for (int i = 3; i*i <= n; i+=2){
      |                            ^
Language: C++

#include <bits/stdc++.h> 
using namespace std; 
  
// set the MAX_SIZE of the array to 10^6 
const int MAX_SIZE = 1e6; 
  
// initialize the prime array 
bool prime[MAX_SIZE + 1]; 
  
void sieve() 
{ 
  
    // set all numbers as prime for time being 
    memset(prime, true, sizeof(prime)); 
  
    for (int p = 2; p * p <= MAX_SIZE; p++) { 
  
        // if prime[p] is not changed, then it is a prime 
        if (prime[p] == true) { 
  
            // update all multiples of p 
            for (int i = p * p; i <= MAX_SIZE; i += p) 
                prime[i] = false; 
        } 
    } 
} 
// Function to find the kth prime greater than n 
int kthPrimeGreaterThanN(int n, int k) 
{ 
  
    int res = -1; 
    // looping through the numbers greater than n 
    for (int i = n + 1; i < MAX_SIZE; i++) { 
  
        // decrement k if i is prime 
        if (prime[i] == true) 
            k--; 
  
        // store the kth prime greater than n 
        if (k == 0) { 
            res = i; 
            break; 
        } 
    } 
  
    return res; 
} 
  
// Driver code 
int main() 
{ 
  int n,k,f=0;
  cin>>n;
    if(n%2!=0)
    {  for(i=3;i<=n/2;++i)
          { if(n%i==0)
               {f=1;
                 break;
                }
           }
    }
  if(f==0)
  {
    cout<<n<<endl;
  }
  else
  {
  
    sieve(); 
    
  
    // Print the kth prime number greater than n 
    cout << kthPrimeGreaterThanN(n, 1); 
  }
    return 0; 
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:55:12: error: 'i' was not declared in this scope
   55 |     {  for(i=3;i<=n/2;++i)
      |            ^
Language: C++

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

using namespace std;

int main()
{
	int x;
	cin >> x;
	int ans;
	for (int i = x; i<2147483647; i++) {
		bool f = true;
		for (int k = 2; k<=int(sqrt(x)); k++) {
			if (i%k == 0) {
				f = false;
				break;
			}
		}
		if (f == true) {
			ans = i;
			break;
		}
		
	}
	cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:40: error: 'sqrt' was not declared in this scope
   14 |                 for (int k = 2; k<=int(sqrt(x)); k++) {
      |                                        ^~~~
Language: Java

public static void main(String[] args) {
　　　　　　Scanner sc = new Scanner(System.in);
           int n = sc.nextInt();
           while(!isprime(n)){
               n++;
           }
           System.out.println(n);
      }

Compiler output:
Main.java:2: error: illegal character: '\u3000'
??????Scanner sc = new Scanner(System.in);
^
Main.java:2: error: illegal character: '\u3000'
??????Scanner sc = new Scanner(System.in);
 ^
Main.java:2: error: illegal character: '\u3000'
??????Scanner sc = new Scanner(System.in);
  ^
Main.java:2: error: illegal character: '\u3000'
??????Scanner sc = new Scanner(System.in);
   ^
Main.java:2: error: illegal character: '\u3000'
??????Scanner sc = new Scanner(System.in);
    ^
Main.java:2: error: illegal character: '\u3000'
??????Scanner sc = new Scanner(System.in);
     ^
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) {
              ^
  (use --enable-preview to enable unnamed classes)
7 errors
Language: C++

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

int main()
{
  int N;
  cin>>N;
  int ans=2;
  while(true){
    for(int i=1;i<N;i++){
      if(N%i=0)ans--;
    }
    if(ans=0){
      cout<<N<<endl;
      break;
    }
    ans=2;
    N++;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: lvalue required as left operand of assignment
   11 |       if(N%i=0)ans--;
      |          ~^~
Language: C++

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

int main(){
int x; cin >> x;
int lim=(int)sqrt(x);
if(x==2) cout << 2 << endl;
if(x%2==0) x++;
int ch=0;


else{
    for(int i=x; i>0; i=i+2){
        for(int j=3; j<=lim; j=j+2){
            if(i%j==0){
                ch++;
                break;
            }
        }
    if(!ch){ 
    cout << i << endl;
    break;
    }
    ch=0;
    }
}
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:1: error: 'else' without a previous 'if'
   15 | else{
      | ^~~~
Language: C++

// CPP program to find the Smallest Special Prime 
// which is greater than or equal to a given number 
#include <bits/stdc++.h> 
using namespace std; 
  
// Function to check whether the number 
// is a special prime or not 
bool checkSpecialPrime(bool* sieve, int num) 
{ 
    // While number is not equal to zero 
    while (num) { 
        // If the number is not prime 
        // return false. 
        if (!sieve[num]) { 
            return false; 
        } 
  
        // Else remove the last digit 
        // by dividing the number by 10. 
        num /= 10; 
    } 
  
    // If the number has become zero 
    // then the number is special prime, 
    // hence return true 
    return true; 
} 
  
// Function to find the Smallest Special Prime 
// which is greater than or equal to a given number 
void findSpecialPrime(int N) 
{ 
    bool sieve[N*10]; 
  
    // Initially all numbers are considered Primes. 
    memset(sieve, true, sizeof(sieve)); 
    sieve[0] = sieve[1] = false; 
    for (long long i = 2; i <= N*10; i++) { 
        if (sieve[i]) { 
  
            for (long long j = i * i; j <= N*10; j += i) { 
                sieve[j] = false; 
            } 
        } 
    } 
  
    // There is always an answer possible 
    while (true) { 
        // Checking if the number is a 
        // special prime or not 
        if (checkSpecialPrime(sieve, N)) { 
            // If yes print the number 
            // and break the loop. 
            cout << N << '\n'; 
            break; 
        } 
        // Else increment the number. 
        else
            N++; 
    } 
} 
  
// Driver code 
int main() 
{ 
    int N;
  	cin >> N;
  
    findSpecialPrime(n); 
 
  
    return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:69:22: error: 'n' was not declared in this scope
   69 |     findSpecialPrime(n);
      |                      ^
Language: C++

// CPP program to find the Smallest Special Prime 
// which is greater than or equal to a given number 
#include <bits/stdc++.h> 
using namespace std; 
  
// Function to check whether the number 
// is a special prime or not 
bool checkSpecialPrime(bool* sieve, int num) 
{ 
    // While number is not equal to zero 
    while (num) { 
        // If the number is not prime 
        // return false. 
        if (!sieve[num]) { 
            return false; 
        } 
  
        // Else remove the last digit 
        // by dividing the number by 10. 
        num /= 10; 
    } 
  
    // If the number has become zero 
    // then the number is special prime, 
    // hence return true 
    return true; 
} 
  
// Function to find the Smallest Special Prime 
// which is greater than or equal to a given number 
void findSpecialPrime(int N) 
{ 
    bool sieve[N*10]; 
  
    // Initially all numbers are considered Primes. 
    memset(sieve, true, sizeof(sieve)); 
    sieve[0] = sieve[1] = false; 
    for (long long i = 2; i <= N*10; i++) { 
        if (sieve[i]) { 
  
            for (long long j = i * i; j <= N*10; j += i) { 
                sieve[j] = false; 
            } 
        } 
    } 
  
    // There is always an answer possible 
    while (true) { 
        // Checking if the number is a 
        // special prime or not 
        if (checkSpecialPrime(sieve, N)) { 
            // If yes print the number 
            // and break the loop. 
            cout << N << '\n'; 
            break; 
        } 
        // Else increment the number. 
        else
            N++; 
    } 
} 
  
// Driver code 
int main() 
{ 
    int n|
  	cin >> n;
  
    findSpecialPrime(n); 

  
    return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:66:10: error: expected initializer before '|' token
   66 |     int n|
      |          ^
a.cc:69:22: error: 'n' was not declared in this scope; did you mean 'yn'?
   69 |     findSpecialPrime(n);
      |                      ^
      |                      yn
Language: C++


#include<iostream>
using namespace std;
int main(){
int a,ans=0;
  cin>>a;
  for(int i=a;;i++){
    int s=0;
    for(int j=2;j<=i-1;j++){
  if(i%j==0)s++;
 }
    if(s==0)ans=i,break;
}
  
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: expected primary-expression before 'break'
   12 |     if(s==0)ans=i,break;
      |                   ^~~~~
Language: C++

#include<iostream>
#include<sstream>
#include<ios>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<list>
#include<queue>
#include<cstdlib>
#include<cmath>
#include<queue>
#include<deque>
#include<map>
#include<string>
#include<numeric>
#include<set>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep2(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep_inv(i, n, m) for(int i = (int)(n); i > (int)(m); i--)
using namespace std;
using vi = vector<int>;
using vl = vector<long>;
using vc = vector<char>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<long>>;
using vvc = vector<vector<char>>;
using pii = pair<int, int>;
using pll = pair<long, long>;
using vpii = vector<pii>;
using vpll = vector<pll>;

int maxi = 100005;

int main(){
  int X;
  cin >> X;

  int ans = 0;
  vi arr(maxi, 1);
  arr[0] = arr[1] = 0;

  rep2(n, 2, maxi){
    if(arr[n] == 0){
      continue;
    }
    if(n >= X){
      ans = n;
      break;
    }

    int m = 2*n;

    while(m < maxi){
      arr[m] = 0;
      m += n;
    }
  }

  cout << ans << endl;

  return 0;


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

 private static int GetNumber(int beginNum)
        {
            beginNum++;
            for (int i = beginNum - 1; i > 1; i--)
            {
                if (beginNum %
                    i == 0)
                {
                    return GetNumber(beginNum);
                }
            }
            return beginNum;
        }


Compiler output:
a.cc:1:2: error: expected unqualified-id before 'private'
    1 |  private static int GetNumber(int beginNum)
      |  ^~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main (){
 
  long x, rx;
  cin >> x;
  rx = sqrt(x);
  
  int ans;
  bool exist =0;
    for(int i=0; i<=10000-x; i++){
      exist =0;
    	for(int j=2; j<=rx; j++){
       		if((x+i)%j == 0){
          		exist =1;
              	break;
            }
        }
      if(exist==0){
        ans = x+i
      	break;
      }
    }
  
  if(exist==0) cout << ans << endl;
  else cout << 100003 << endl;
  
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:18: error: expected ';' before 'break'
   21 |         ans = x+i
      |                  ^
      |                  ;
   22 |         break;
      |         ~~~~~
Language: C

#include <bits/stdc++.h>

int isPrime(int n) // assuming n > 1
{
    int i,root;

    if (n%2 == 0 || n%3 == 0)
        return 0;

    root = (int)sqrt(n);

    for (i=5; i<=root; i+=6)
    {
        if (n%i == 0)
           return 0;
    }

    for (i=7; i<=root; i+=6)
    {
        if (n%i == 0)
           return 0;
    }

    return 1;
}

int fun(unsigned int n)
{
    int i=n+1;
    while(1)
    {
        if(isPrime(i))
            break;
        i++;
    }
    return i;
}

int main(int argc, char **argv)
{
    printf("%d\n", fun(99992));
    return 0;
}

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

#include<iostream>
using namespace std;
int main(){
int a,ans=0;
  cin>>a;
  for(int i=a;;i++){
    for(int j=2;j<=i-1;j++){
  if(i%j==0)ans=i,break;
 }
    if(ans!=0)break;
}
  
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: expected primary-expression before 'break'
    8 |   if(i%j==0)ans=i,break;
      |                   ^~~~~
Language: C++

int isPrime(int n) // assuming n > 1
{
    int i,root;

    if (n%2 == 0 || n%3 == 0)
        return 0;

    root = (int)sqrt(n);

    for (i=5; i<=root; i+=6)
    {
        if (n%i == 0)
           return 0;
    }

    for (i=7; i<=root; i+=6)
    {
        if (n%i == 0)
           return 0;
    }

    return 1;
}
int fun( int n)
{
    int i=n+1;
    while(1)
    {
        if(isPrime(i))
            break;
        i++;
    }
    return i;
}

int main(int argc, char **argv)
{   int n;
 cin>>n;
    printf("%d\n", fun(n));
    return 0;
}

Compiler output:
a.cc: In function 'int isPrime(int)':
a.cc:8:17: error: 'sqrt' was not declared in this scope
    8 |     root = (int)sqrt(n);
      |                 ^~~~
a.cc: In function 'int main(int, char**)':
a.cc:38:2: error: 'cin' was not declared in this scope
   38 |  cin>>n;
      |  ^~~
a.cc:39:5: error: 'printf' was not declared in this scope
   39 |     printf("%d\n", fun(n));
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int isPrime(int n) // assuming n > 1
Language: C++

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

int main (){

  long x, rx;
  cin >> x;
  rx = sqrt(x);
  
  int ans;
  
    for(int i=0; i<=10000-x; i++){
      bool exist =0;
    	for(int j=2; j<=rx; j++){
       		if((x+i)%j == 0){
          		exist =1;
              	break;
            }
        }
      if(exist==0){
        ans = x+i
      	break;
      }
    }
  
  if(exist==0) cout << ans << endl;
  else cout << 100003 << endl;
  

}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:18: error: expected ';' before 'break'
   21 |         ans = x+i
      |                  ^
      |                  ;
   22 |         break;
      |         ~~~~~     
a.cc:26:6: error: 'exist' was not declared in this scope; did you mean 'exit'?
   26 |   if(exist==0) cout << ans << endl;
      |      ^~~~~
      |      exit
Language: C++

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

int main() {
  int X;
  cin>>X;
  int ans=0;
  int prime=X;
  while(ans==0){
    for(int i=2;i<=sqrt(X);i++){
      if(prime%i==0){
        prime++;
        break;
      }
      else(i==sqrt(X)){
        ans=prime;
      }
    }
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:23: error: expected ';' before '{' token
   15 |       else(i==sqrt(X)){
      |                       ^
      |                       ;
Language: C++

#include <iostream>

std::vector <int> prime;
bool is_composite[MAXN];

void sieve (int n) {
	std::fill (is_composite, is_composite + n, false);
	for (int i = 2; i < n; ++i) {
		if (!is_composite[i]) prime.push_back (i);
		for (int j = 0; j < prime.size () && i * prime[j] < n; ++j) {
			is_composite[i * prime[j]] = true;
			if (i % prime[j] == 0) break;
		}
	}
}

int main(void) {
	sieve(100005);
	int n;
	cin >> n;
	int next = 0;
	int nextprime;
	for (int i = n; i < 100005; i++) {
		if (!is_composite[i]) {
			nextprime = i;
			break;
		} 
	}
	cout << nextprime;
}

Compiler output:
a.cc:3:6: error: 'vector' in namespace 'std' does not name a template type
    3 | std::vector <int> prime;
      |      ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | 
a.cc:4:19: error: 'MAXN' was not declared in this scope
    4 | bool is_composite[MAXN];
      |                   ^~~~
a.cc: In function 'void sieve(int)':
a.cc:7:20: error: 'is_composite' was not declared in this scope
    7 |         std::fill (is_composite, is_composite + n, false);
      |                    ^~~~~~~~~~~~
a.cc:9:39: error: 'prime' was not declared in this scope
    9 |                 if (!is_composite[i]) prime.push_back (i);
      |                                       ^~~~~
a.cc:10:37: error: 'prime' was not declared in this scope
   10 |                 for (int j = 0; j < prime.size () && i * prime[j] < n; ++j) {
      |                                     ^~~~~
a.cc: In function 'int main()':
a.cc:20:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   20 |         cin >> n;
      |         ^~~
      |         std::cin
In file included 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:24:22: error: 'is_composite' was not declared in this scope
   24 |                 if (!is_composite[i]) {
      |                      ^~~~~~~~~~~~
a.cc:29:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   29 |         cout << nextprime;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: Java

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] prime = new int[101000];
		boolean[] isp = new boolean[101000];
		int x = sc.nextInt();
		for (int i = 0; i < isp.length; i++) {
			isp[i] = true;
		}
		int p = 0;
		isp[0] = false; isp[1] = false;
		for (int i = 2; i < 101000; i++) {
			if(isp[i]) {
				prime[p] = i;
				p++;
				for(int j = 2*i;j < 101000; j += i) {
					isp[j] = false;
				}
			}
		}
		int i = 0;
		while(true) {
			if(prime[i] > x) {
				System.out.println(prime[i]);
				break;
			}
			i++;
		}
		sc.close();
	

Compiler output:
Main.java:32: error: reached end of file while parsing
		sc.close();
		           ^
1 error
Language: C++

    #include<iostream>
    #include<stdio.h>
    //#include <bits/stdc++.h>
    #include<vector>
    #include<algorithm>
    #include<string>
    #include<math.h>
    #include<sstream>
    #include<set>
    #include<map>
    using namespace std;
    #define INF 10000000;
    #define rep(i,n)for(int i=0;(i)<(int)(n);i++)
    #define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
    #define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
    #define vec(type,n) vector<type>(n)
    #define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))

  
  
    int main(){
      long x;
      cin >>x;
      
      while(1){
        bool g = true;
        REP(i,1,x-1){
          if(x%i == 0){
            f = false;
            x++;
            break;
        }
        if(g)break;

        }

      }
      cout << x;
    }
      


    


Compiler output:
a.cc: In function 'int main()':
a.cc:29:13: error: 'f' was not declared in this scope
   29 |             f = false;
      |             ^
Language: C++

#inculde <bits/stdc++.h>
using namespace std;
bool isprime(int x){
 bool flg = true;
 int y = 2;
 while(y*y<x){
  if (x%y==0){
   flg = false;
   break;
  }
  y++;
 }
 return flg;
}
int main(void){
 int X;
 cin >> X;
 while(1){
  if (isprime(X)){
   cout << X;
   break;
  }
  X++;
 }
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inculde; did you mean #include?
    1 | #inculde <bits/stdc++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:17:2: error: 'cin' was not declared in this scope
   17 |  cin >> X;
      |  ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inculde <bits/stdc++.h>
a.cc:20:4: error: 'cout' was not declared in this scope
   20 |    cout << X;
      |    ^~~~
a.cc:20:4: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  for(int i=2; i<=N/2; i++){
    if(N%==0){
      i=1;
      N++;
      continue;
    }
  }  
  cout<<N<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: expected primary-expression before '=' token
    7 |     if(N%==0){
      |           ^
Language: C++

//Nihal Mittal - nihal_47
//Strike First , Strike Hard , No Mercy !!

/**⠀⠀⠀⠀⠀⠀⣀⣤⣤⣄⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⣰⣿⣿⣿⣿⠿⠿⣿⣿⣿⣿⣿⣿⣿⣧⢀⠀⠀⠀⠀
⠀⠀⠀⣿⣿⣿⠋⠀⠀⠀⠀⠀⠙⠀⠙⣿⣿⣿⣷⢳⢀⠀⠀⠀
⠀⠀⣠⣿⣿⣿⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⢀
⠀⠀⣸⣿⣿⣿⠸⠀⠀⠀⠒⠒⠒⠐⠀⠀⢿⣿⣿⣿⣿⣿⠀⠀
⠀⣴⣿⣿⣿⡿⠀⠒⣋⣙⡒⢰⠀⠤⣖⠒⢾⣿⣿⣿⣿⣧⠀⠀
⢺⣿⣿⣿⣿⢀⠀⠀⠉⠉⠉⠸⠀⡇⠉⠉⠀⢿⣿⣿⣿⣄⠀⠀
⠀⠙⣿⣿⣧⢻⠀⠀⠀⠀⠀⠠⠀⠰⠀⠀⠀⣸⠸⣿⣿⠿⠰⠀
⠀⠀⠀⠹⣿⣿⣿⣷⠀⡠⠙⣲⣔⣅⢡⣰⣷⣿⣿⣿⣧⠀⠀⠀
⠀⠀⠀⣼⣿⣿⣿⣿⠀⡿⠭⠭⠭⠭⢿⠀⣿⢻⣿⣿⠃⠀⠀⠀
⠀⠀⠀⠙⠛⣿⢻⠹⣿⠐⠙⠛⠟⠉⢀⣴⡟⢿⣿⡏⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⡟⠀⠀⠻⣦⣤⣶⠾⠋⠀⠀⠁⡦⢄⢀⠀⠀⠀
⠀⠀⠀⠀⡠⠁⡇⠑⢄⠀⠀⠀⠀⠀⠀⠔⠀⠀⠁⠀⠀⠀⠉⠁
⠀⠔⠊⠁⠀⠀⣇⠀⠀⠀⠑⡤⠤⢎⠁⠀⠀⡘⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢢⠠⠀⡠⢆⠀⠀⡠⠙⢄⠀⡸⠀
**/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define l long
#define mk make_pair
#define pb push_back
#define in insert
#define se second
#define fi first
#define mod 1000000007
#define watch(x) cout << (#x) << " is " << (x) << "\n"
#define all(v) (v).begin(),(v).end()
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(0);
#define pii pair<int,int>
#define maxn 100005
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 
using namespace std;
using namespace __gnu_pbds;
bool isprime(ll n) 
{ 
    if (n <= 1)  return false; 
    if (n <= 3)  return true; 
    if (n%2 == 0 || n%3 == 0) return false; 
    for (ll i=5; i*i <=n; i=i+6) 
        if (n%i == 0 || n%(i+2) == 0) 
           return false; 
  
    return true; 
}
signed main()
{
    fast;
   
    #endif
    ll n,i,j;
    cin>>n;
    for(i=n;;i++)
    {
        if(isprime(i))
        {
            cout<<i;
            return 0;
        }
    }
}

Compiler output:
a.cc:55:6: error: #endif without #if
   55 |     #endif
      |      ^~~~~
Language: C++

#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <algorithm> // sort
#include <map>

#define REP(i, n) for (long long i = 0; i < (n); i++) 
typedef long long ll;
static const ll MOD = 1000000007;
static const ll INF = 1000000000000000000LL;
using namespace std;


template<typename T>
// return true:素数
bool isPrime(T num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (T i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }
    return true;
}


int main(){
    ll X;
    cin >> X;

    while(true)
    {
      if(isPrime(X))break;
      ++X;
    }

    cout << X << endl;

    return 0;    
}



Compiler output:
a.cc: In instantiation of 'bool isPrime(T) [with T = long long int]':
a.cc:42:17:   required from here
   42 |       if(isPrime(X))break;
      |          ~~~~~~~^~~
a.cc:23:26: error: 'sqrt' was not declared in this scope
   23 |     double sqrtNum = sqrt(num);
      |                      ~~~~^~~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main(){
    int n=1000000;
    //cout<<"enter n";
    //cin>>n;
    bool prime[n+1];
    for(int i=2;i<=n;i++)
        prime[i]=true;
    for(int i=2;i*i<=n;i++){
        if(prime[i]==1){
            for(int j=i*i;j<=n;j+=i){
                prime[j]=false;
            }
        }
    }
    vector<ll>arr;
    for(int i=2;i<=n;i++){
        if(prime[i]==1){
            arr.push_back(i);
        }
    }
    ll x;
    cin>>x;
    for(int i=0;i<arr.size();i++){
        if(arr[i]>=x)
        {
            
            cout<<arr[i];
            break;
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:12: error: 'll' was not declared in this scope
   19 |     vector<ll>arr;
      |            ^~
a.cc:19:14: error: template argument 1 is invalid
   19 |     vector<ll>arr;
      |              ^
a.cc:19:14: error: template argument 2 is invalid
a.cc:22:17: error: request for member 'push_back' in 'arr', which is of non-class type 'int'
   22 |             arr.push_back(i);
      |                 ^~~~~~~~~
a.cc:25:7: error: expected ';' before 'x'
   25 |     ll x;
      |       ^~
      |       ;
a.cc:26:10: error: 'x' was not declared in this scope
   26 |     cin>>x;
      |          ^
a.cc:27:23: error: request for member 'size' in 'arr', which is of non-class type 'int'
   27 |     for(int i=0;i<arr.size();i++){
      |                       ^~~~
a.cc:28:15: error: invalid types 'int[int]' for array subscript
   28 |         if(arr[i]>=x)
      |               ^
a.cc:31:22: error: invalid types 'int[int]' for array subscript
   31 |             cout<<arr[i];
      |                      ^
Language: C++

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

const int MAXN = 2e6 + 21;

bool mark[MAXN];
vector <int> p;

void f() {
 	for (int i = 2; i < 2e6; i++) {
     	if (mark[i]) 
      		continue;
      	p.push_back(i)
      	for (int j = i * i; j < 2e6; j += i) {
         mark[i] = true; 
        }
    }
  
}

int main() {
  	long long n;
  cin >> n;
  cout << *lower_bound(p.begin(), p.end(), n) << '\n';
  
 	return 0; 
}

Compiler output:
a.cc: In function 'void f()':
a.cc:13:23: error: expected ';' before 'for'
   13 |         p.push_back(i)
      |                       ^
      |                       ;
   14 |         for (int j = i * i; j < 2e6; j += i) {
      |         ~~~            
a.cc:14:29: error: 'j' was not declared in this scope
   14 |         for (int j = i * i; j < 2e6; j += i) {
      |                             ^
Language: C++

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

using ll = long long;

using namespace std;

// 素数判定 2からfor分で回して行く limitはどこまでやるか エラトステネスの篩
bool isPrime[100101];
void computePrimes(int limit = 100100) {
    assert(limit < 100101);                    // #include <cassert>
    fill(isPrime, isPrime + limit + 1, true);  //最初全部trueにしておく
    isPrime[0] = isPrime[1] = false;
    for (int i = 2; i <= limit; i++)
        if (isPrime[i])
            for (int j = 2 * i; j <= limit; j += i) isPrime[j] = false;
}

int main() {
    int n;
    cin >> n;
    computePrimes();
    for (int i=n; ; i++) {
        if (isPrime[i]) {
            cout << i << '\n';
            return 0;
        }
    }
}

Compiler output:
a.cc: In function 'void computePrimes(int)':
a.cc:14:5: error: 'assert' was not declared in this scope
   14 |     assert(limit < 100101);                    // #include <cassert>
      |     ^~~~~~
a.cc:5:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    4 | #include <queue>
  +++ |+#include <cassert>
    5 | #include <string>
Language: C++

#include <bits/stdc++.h>
#include <atcoder/all>

using namespace std;
using namespace atcoder;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#else
#define print(...)
#endif


void solve() {
    ll N, K, R, S, P;
    cin >> N >> K >> R >> S >> P;
    string T;
    cin >> T;
    ll ans = 0;
    vector<bool> win(T.size(), false);
    rep(i, T.size()) {
        if (i - K >= 0 && T[i - K] == T[i] && win[i-K]) continue;
        if (T[i] == 'r') {
            ans += P;
        }
        if (T[i] == 's') {
            ans += R;
        }
        if (T[i] == 'p') {
            ans += S;
        }
        win[i] =true;
    }
    cout << ans << '\n';
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    solve();
    return 0;
}


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

readInt() = parse.(Int,split(readline()))

function solve()
    N,K = readInt()
    R,S,P = readInt()
    T = readline()
    win = ones(Bool,N)
    for i in K+1:N
        T[i]==T[i-K] && win[i-K]==true && (win[i]=false)
    end
    ans = 0
    for i in 1:N
        win[i]==false && continue
        ans += (T[i]=='r' ? P : T[i]=='s' ? R : S)
    end
    println(ans)
end
solve()

Compiler output:
a.cc:1:11: error: expected constructor, destructor, or type conversion before '=' token
    1 | readInt() = parse.(Int,split(readline()))
      |           ^
Language: C++

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


#define li          long long int
#define uli         unsigned long long int
#define rep(i,to)   for(li i=0;i<((li)(to));i++)
#define repp(i,start,to)    for(li i=(li)(start);i<((li)(to));i++)
#define pb          push_back
#define sz(v)       ((li)(v).size())
#define bgn(v)      ((v).begin())
#define eend(v)     ((v).end())
#define allof(v)    (v).begin(), (v).end()
#define dodp(v,n)       memset(v,(li)n,sizeof(v))
#define bit(n)      (1ll<<(li)(n))
#define mp(a,b)     make_pair(a,b)
#define rin rep(i,n)
#define EPS 1e-12
#define ETOL 1e-8
#define MOD 1000000007
typedef pair<li, li> PI;

#define INF bit(60)

#define DBGP 1


#define idp if(DBGP)
#define F first
#define S second
#define p2(a,b)     idp cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)       idp cout<<a<<"\t"<<b<<"\t"<<c<<endl
#define p4(a,b,c,d)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<endl
#define p5(a,b,c,d,e)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<endl
#define p6(a,b,c,d,e,f)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<endl
#define p7(a,b,c,d,e,f,g)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<endl
#define p8(a,b,c,d,e,f,g,h)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<endl
#define p9(a,b,c,d,e,f,g,h,i)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<endl
#define p10(a,b,c,d,e,f,g,h,i,j)        idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<"\t"<<j<<endl
#define foreach(it,v)   for(__typeof((v).begin()) it=(v).begin(); it!=(v).end(); ++it)
#define p2p(x)      idp p2((x).F, (x).S)
#define dump(x,n)   idp{rep(i,n){cout<<x[i]<<" ";}puts("");}
#define dump2(x,n)  idp{rep(i,n){cout<<"["<<x[i].F<<" , "<<x[i].S<<"] ";}puts("");}
#define dumpi(x)    idp{foreach(it, x){cout<<(*it)<<" ";}puts("");}
#define dumpi2(x)   idp{foreach(it, x){cout<<"["<<(it)->F<<" , "<<(it)->S<<"] ";}puts("");}

#define read2d(a,w,h)   rep(i,h)rep(j,w)cin>>a[i][j]
#define dump2d(a,w,h)   rep(i,h){rep(j,w)cout<<a[i][j]<<" ";puts("");}

typedef pair<li, li> PI;

li n,k;
li r,s,p;
string t;

int main() {
    cin>>n>>k;
    cin>>r>>q>>p;
    cin>>t;
    li res=0;
    rin{
        if (i>=k && t[i]==t[i-k]){
            // gaman
            t[i]='a';
        } else {
            if(t[i]=='r'){
                res+=p;
            }else if(t[i]=='s'){
                res+=r;
            }else{
                res+=s;
            }
        }
    }
    cout<<res<<endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:58:13: error: 'q' was not declared in this scope
   58 |     cin>>r>>q>>p;
      |             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n,k,r,s,p,a,b,g=(n+k-1)/k+1,t[1001][1001];
int main(){
	cin>>n>>k>>r>>s>>p;
	g=(n+k-1)/k+1
	char h;
	for(int i=0;i<n;i++){
		cin>>h;
		if(h=='r'){
			t[a][b]=3;
		}else if(h=='s'){
			t[a][b]=1;
		}else{
			t[a][b]=2;
		}
		if(a>=k-1){
			b++;
			a=0;
		}else{
			a++;
		}
		
	}
	int ans=0;
	for(int i=0;i<k;i++){
		int c=0,e=0;
		while(t[i][c]!=0){
			if(e!=t[i][c]){
				if(t[i][c]==1){
					ans+=r;
				}else if(t[i][c]==2){
					ans+=s;
				}
				if(t[i][c]==3){
					ans+=p;
				}
				e=t[i][c];
			}else{
				e=0;
			}
			c++;
		}


	}
	cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:22: error: expected ';' before 'char'
    6 |         g=(n+k-1)/k+1
      |                      ^
      |                      ;
    7 |         char h;
      |         ~~~~          
a.cc:9:22: error: 'h' was not declared in this scope
    9 |                 cin>>h;
      |                      ^
Language: C

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <bitset>
#include <string>
#include <cmath>
#include <complex>
#include <numeric>
#include <cassert>

#include <vector>
#include <array>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <utility>

#define int64 long long
#define uint64 unsigned long long
using namespace std;

int main()
{
	int64 nn, kk, rr, ss, pp, ans = 0;
	cin >> nn >> kk >> rr >> ss >> pp;
	string tt, memo;
	cin >> tt;
	for(int64 ii = 0;ii < kk;ii++)
	{
		if(tt[ii] == 'r')
		{
			ans += pp;
			memo += 'p';
		}
		else if(tt[ii] == 's')
		{
			ans += rr;
			memo += 'r';
		}
		else if(tt[ii] == 'p')
		{
			ans += ss;
			memo += 's';
		}
	}
	for(int64 ii = kk;ii < nn;ii++)
	{
		if(tt[ii] == tt[ii - kk])
		{
			if(memo[ii - kk] != 'o')
			{
				memo += 'o';
				continue;
			}
		}
		if(tt[ii] == 'r')
		{
			ans += pp;
			memo += 'p';
		}
		else if(tt[ii] == 's')
		{
			ans += rr;
			memo += 'r';
		}
		else if(tt[ii] == 'p')
		{
			ans += ss;
			memo += 's';
		}
	}
	cout << ans << endl;
	return 0;
}


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

#include <vector>
#include <iostream>

using namespace std;
struct _ { ios_base::Init i; _() { ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); } } _;

int main() {

	int n, k; cin >> n >> k;
	int r, s, p; cin >> r >> s >> p;
	string t; cin >> t;

	vector<vector<int>> dp(n, vector<int>(3, 0)); //dp[i][0=r], dp[i][1=s], dp[i][2=p]

	for (int i = 0; i <= n - 1; i++) {
		if (i < k) {
			if (t[i] == 'r') dp[i] = {0, 0, p};
			else if (t[i] == 's') dp[i] = {r, 0, 0};
			else dp[i] = {0, s, 0};
		}
		else {
			if (t[i] == 'r') {
				dp[i][0] = max(dp[i - k][1], dp[i - k][2]);
				dp[i][1] = max(dp[i - k][0], dp[i - k][2]);
				dp[i][2] = p + max(dp[i - k][0], dp[i - k][1]);
			}

			else if (t[i] == 's') {
				dp[i][0] = r + max(dp[i - k][1], dp[i - k][2]);
				dp[i][1] = max(dp[i - k][0], dp[i - k][2]);
				dp[i][2] = max(dp[i - k][0], dp[i - k][1]);
			}

			else {
				dp[i][0] = max(dp[i - k][1], dp[i - k][2]);
				dp[i][1] = s + max(dp[i - k][0], dp[i - k][2]);
				dp[i][2] = max(dp[i - k][0], dp[i - k][1]);
			}
		}
	}

	int ans = 0;
	for (int i = n - 1, cnt = 0; i >= 0 and cnt < k; i--, cnt++) ans += *max_element(dp[i].begin(), dp[i].end());
	cout << ans;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:78: error: 'max_element' was not declared in this scope
   43 |         for (int i = n - 1, cnt = 0; i >= 0 and cnt < k; i--, cnt++) ans += *max_element(dp[i].begin(), dp[i].end());
      |                                                                              ^~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll mod=1000000007;
const int MAX_N = 1000;         // n の最大値

// nCk を取得
double nCk(int n, int k) {
double res=1.0;
for(int i=0; i<n; i++){
res*=0.5;}
for(int i=0; i<k; i++){
res*=(double)(n-i);
res/=(double)(k-i);
}
return res;}
int main(){
ll n,k,r,s,p;
string t;
cin>>n>>k>>r>>s>>p>>t;
dp[n][3]={{}};
ll counter=0;
ll ca=0;
for(ll i=0; i<k; i++){
if(t.at(i)=='r'){
dp[i][0]=r;}
else if(t.at(i)=='s'){
dp[i][1]=s;}
else{
dp[i][2]=p;}}
for(ll i=0; i<k; i++){
for(ll m=0; m<n; m=m+k){
if(t.at(i+m)=='r'){
dp[i+m][0]=max(dp[i+m-k][1]+r,dp[i+m-k][2]+r);}
else if(t.at(i+m)=='s'){
dp[i+m][1]=max(dp[i+m-k][0]+s,dp[i+m-k][2]+s);}
else{
dp[i+m][2]=max(dp[i+m-k][1]+p,dp[i+m-k][0]+p);}
}}
for(ll i=n-1; i>n-k;i--){
ca=max(dp[i][0],dp[i][1]);
ca=max(dp[i][2],ca);
counter+=ca;
ca=0;}
cout<<counter<<endl;}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:1: error: 'dp' was not declared in this scope; did you mean 'p'?
   22 | dp[n][3]={{}};
      | ^~
      | p
Language: C++

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

int main() {
  int n,k,r,s,p;
  string t;
  cin>>n>>k>>r>>s>>p>>t;
  vector<char>hand(k);
  int ans=0;
  for(int i=0;i<k;i++) hand[i]='a';
  for(int i=0;i<n;i++){
    if(s[i]=='r'){
      if(hand[i%k]=='r') hand[i%k]='a';
      else{
        ans+=p;
        hand[i%k]='p';
      }
    }
    if(s[i]=='s'){
      if(hand[i%k]=='s') hand[i%k]='a';
      else{
        ans+=r;
        hand[i%k]='r';
      }
    }
    if(s[i]=='p'){
      if(hand[i%k]=='p') hand[i%k]='a';
      else{
        ans+=s;
        hand[i%k]='s';
      }
    }
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: invalid types 'int[int]' for array subscript
   12 |     if(s[i]=='r'){
      |         ^
a.cc:19:9: error: invalid types 'int[int]' for array subscript
   19 |     if(s[i]=='s'){
      |         ^
a.cc:26:9: error: invalid types 'int[int]' for array subscript
   26 |     if(s[i]=='p'){
      |         ^
Language: C++

#include <bits/stdc++.h>

using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define ll long long int
#define INF 1000000007
// cin.eof() 入力個数の問題
int main() {
   int n,k,r,s,p;
   cin>>n>>k>>r>>s>>p;
   string t;
   cin>>t;
  bool flag[n];
  rep(i,n) flag[i]=true;
  int ans=0;
  rep(i,k){
    if(t[i]=='r') ans+=p;
    else if(t[i]=='s') ans+=r;
    else if(t[i]=='p') ans+=s;
  }
  for(int i=k;i<n;i++){
    if(t[i]==t[i-k]){
      flag[i]=!flag[i-k];
if(flag[i-k]) continue;
    }
    if(t[i]=='r') ans+=p;
    else if(t[i]=='s') ans+=r;
    else if(t[i]=='p') ans+=s;
  }
  cout<<ans<<endl;
    return 0;
}
#include <bits/stdc++.h>

using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define ll long long int
#define INF 1000000007
// cin.eof() 入力個数の問題
int main() {
   int n,k,r,s,p;
   cin>>n>>k>>r>>s>>p;
   string t;
   cin>>t;
  bool flag[n];
  rep(i,n) flag[i]=true;
  int ans=0;
  rep(i,k){
    if(t[i]=='r') ans+=p;
    else if(t[i]=='s') ans+=r;
    else if(t[i]=='p') ans+=s;
  }
  for(int i=k;i<n;i++){
    if(t[i]==t[i-k]){
      flag[i]=!flag[i-k];
if(flag[i-k]) continue;
    }
    if(t[i]=='r') ans+=p;
    else if(t[i]=='s') ans+=r;
    else if(t[i]=='p') ans+=s;
  }
  cout<<ans<<endl;
    return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define F first
#define S second
#define _READ freopen("input.txt", "r", stdin);
#define _FAST                         \
    ios_base::sync_with_stdio(false); \
    cin.tie(0);                       \
    cout.tie(0);
void solve()
{
    int n, k, r, s, p;
    cin >> n >> k >> r >> s >> p;
    string t;
    cin >> t;
    int ans = 0;
    vector<int> R(n), S(n), P(n);

    for (int i = 1; i < =k; i++)
    {
        if (t[i] == 'r')
        {
            S[i] = 0;
            R[i] = 0;
            P[i] = p;
            //ans+=p+s;
        }
        if (t[i] == 'p')
        {
            S[i] = s;
            R[i] = 0;
            P[i] = 0;
            // ans+=r+s;
        }
        if (t[i] == 's')
        {
            S[i] = 0;
            R[i] = r;
            P[i] = 0;
            //ans+=p+r;
        }
        int pos = 0;
        for (int j = i + k; j < n; j += k)
        {
            if (t[j] == 'r')
            {
                S[j] += max(R[j - k], P[j - k]);
                R[j] += max(P[j - k], S[j - k]);
                P[j] += max(S[j - k], R[j - k]) + p;
                //ans+=p+s;
            }
            if (t[j] == 's')
            {
                S[j] += max(R[j - k], P[j - k]);
                R[j] += max(P[j - k], S[j - k]) + r;
                P[j] += max(S[j - k], R[j - k]); //+p;
                //ans+=r+p;
            }
            if (t[j] == 'p')
            {
                S[j] += max(R[j - k], P[j - k]) + s;
                R[j] += max(P[j - k], S[j - k]);
                P[j] += max(S[j - k], R[j - k]); //+p;
                //ans+=r+s;
            }
            pos = j;
        }
        ans += max({R[pos], P[pos], S[pos]});
    }
    // for(int i=0;i<n;i++)
    //     cout<<R[i]<<" ";
    // cout<<"\n";
    // for(int i=0;i<n;i++)
    //     cout<<S[i]<<" ";
    // cout<<"\n";
    // for(int i=0;i<n;i++)
    //     cout<<P[i]<<" ";
    // cout<<"\n";
    cout << ans;
}
int32_t main()
{

   // _READ
     _FAST
    int t;
    t = 1;
    while (t--)
        solve();

    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:20:25: error: expected primary-expression before '=' token
   20 |     for (int i = 1; i < =k; i++)
      |                         ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int R, S, P;

int tokuten(char t){
  if(t == 'r') return R;
  if(t == 's') return S;
  if(t == 'p') return P;
}

char kachite(char t){
  if(t == 'r') return 'p';
  if(t == 's') return 'r';
  if(t == 'p') return 's';
}

int main(void){

  int N, K;
  int x = 0;
  string T;
  string te, l;

  cin >> N >> K;
  cin >> R >> S >> P;
  cin >> T;

  l = {"rsp"};

  for(int i=0; i<N; i++){
    if(i<K || kachite(T[i])!=te[i-K]){
      te+=kachite(T[i]);
      x+=tokuten(te[i]);
    }
    else
      for(int j=0; j<3; j++){
        if(l[j]!=te[i-K] && l[j]!=kachite(T[i+K])){
          te+=l[j];
          break;
        }
  }
  cout << x << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:2: error: expected '}' at end of input
   48 | }
      |  ^
a.cc:20:15: note: to match this '{'
   20 | int main(void){
      |               ^
a.cc: In function 'int tokuten(char)':
a.cc:12:1: warning: control reaches end of non-void function [-Wreturn-type]
   12 | }
      | ^
a.cc: In function 'char kachite(char)':
a.cc:18:1: warning: control reaches end of non-void function [-Wreturn-type]
   18 | }
      | ^
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long int ll;
typedef pair<ll, ll> pll;
 
#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(10)
 
const ll MOD = 1000000007;
const ll INF = (ll) 1e15;
 
bool U[100005];
 
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N, K;
    ll R, S, P;
    cin >> N >> K >> R >> S >> P;
    string T;
    cin >> T;
    ll ans = 0;
    REP(i, N) {
        if (i >= K) {
            if (T[i] == T[i - K] && U[i-k])
                continue;
        }
        if (T[i] == 'r')
            ans += P;
        else if (T[i] == 's')
            ans += R;
        else
            ans += S;
        U[i] = true;
 
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:41: error: 'k' was not declared in this scope
   28 |             if (T[i] == T[i - K] && U[i-k])
      |                                         ^