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

#include<stdio.h>
int main(){
  int r,s,a,b,c,w;
  scanf("%s",w);
  if(w==RRR){
    printf("3");
  }
  if(w==RRS){
    printf("2");
  }
  if(w==RSS){
    printf("1");
  }
  if(w==RSR){
    printf("1");
  }
  if(w==SSS){
    printf("0");
  }
  if(w==SSR){
    printf("1");
  }
  if(w==SRR){
    printf("2");
  }
  if(w==SRS){
    printf("1");
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:9: error: 'RRR' undeclared (first use in this function)
    5 |   if(w==RRR){
      |         ^~~
main.c:5:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:9: error: 'RRS' undeclared (first use in this function)
    8 |   if(w==RRS){
      |         ^~~
main.c:11:9: error: 'RSS' undeclared (first use in this function)
   11 |   if(w==RSS){
      |         ^~~
main.c:14:9: error: 'RSR' undeclared (first use in this function)
   14 |   if(w==RSR){
      |         ^~~
main.c:17:9: error: 'SSS' undeclared (first use in this function)
   17 |   if(w==SSS){
      |         ^~~
main.c:20:9: error: 'SSR' undeclared (first use in this function)
   20 |   if(w==SSR){
      |         ^~~
main.c:23:9: error: 'SRR' undeclared (first use in this function)
   23 |   if(w==SRR){
      |         ^~~
main.c:26:9: error: 'SRS' undeclared (first use in this function)
   26 |   if(w==SRS){
      |         ^~~
Language: C++

    #include<bits/stdc++.h>
    using namespace std;
    int main(){
        string s;
        cin >> s;
        if((s[0] == s[1] && s[1] == 'R') || (s[1] == s[2] && s[2] == 'R') || (s[0) == s[1] && s[1] == s[2] && s[2] == 'R'))
            cout << 2 << endl;
        else if(s[0] == 'R' || s[1] == 'R' || s[2] == 'R')
            cout << 1 << endl;
        else
            cout << 0 << endl;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:6:82: error: expected ']' before ')' token
    6 |         if((s[0] == s[1] && s[1] == 'R') || (s[1] == s[2] && s[2] == 'R') || (s[0) == s[1] && s[1] == s[2] && s[2] == 'R'))
      |                                                                                  ^
      |                                                                                  ]
a.cc:6:123: error: expected primary-expression before ')' token
    6 |         if((s[0] == s[1] && s[1] == 'R') || (s[1] == s[2] && s[2] == 'R') || (s[0) == s[1] && s[1] == s[2] && s[2] == 'R'))
      |                                                                                                                           ^
Language: Java

import java.util.Scanner;

public class emne {
    public static Scanner Scan = new Scanner(System.in);
    public static void main(String[] args) {
        String s;
        s = Scan.next();

        int cnt = 0, ans = 0;
        for(int i=0; i<s.length(); i++) {
            if(s.charAt(i) == 'R') cnt++;
            else cnt = 0;
            ans = Math.max(ans, cnt);
        }

        System.out.println(ans);
    }
}

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

#inlcude<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin >> s;
  if((s[0] == s[1] && s[1] == 'R') || (s[1] == s[2] && s[2] == 'R'))
    	cout << 2 << endl;
  else if(s[0] == 'R' || s[1] == 'R' || s[2] == 'R')
    	cout << 1 << endl;
  else
    	cout << 0 << endl;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    1 | #inlcude<bits/stdc++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:4:3: error: 'string' was not declared in this scope
    4 |   string s;
      |   ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | #inlcude<bits/stdc++.h>
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> s;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inlcude<bits/stdc++.h>
a.cc:5:10: error: 's' was not declared in this scope
    5 |   cin >> s;
      |          ^
a.cc:7:9: error: 'cout' was not declared in this scope
    7 |         cout << 2 << endl;
      |         ^~~~
a.cc:7:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:7:22: error: 'endl' was not declared in this scope
    7 |         cout << 2 << endl;
      |                      ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #inlcude<bits/stdc++.h>
a.cc:9:9: error: 'cout' was not declared in this scope
    9 |         cout << 1 << endl;
      |         ^~~~
a.cc:9:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:9:22: error: 'endl' was not declared in this scope
    9 |         cout << 1 << endl;
      |                      ^~~~
a.cc:9:22: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:11:9: error: 'cout' was not declared in this scope
   11 |         cout << 0 << endl;
      |         ^~~~
a.cc:11:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:11:22: error: 'endl' was not declared in this scope
   11 |         cout << 0 << endl;
      |                      ^~~~
a.cc:11:22: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C

#inlcude<bits/stdc++.h>
using namespace std;
int main(){
 	string s;
  	cin >> s;
  	if((s[0] == s[1] && s[1] == 'R') || (s[1] == s[2] && s[2] == 'R'))
      cout << 2 << endl;
  	else if(s[0] == 'R' || s[1] == 'R' || s[2] == 'R')
      cout << 1 << endl;
  	else
      cout << 0 << endl;
}

Compiler output:
main.c:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    1 | #inlcude<bits/stdc++.h>
      |  ^~~~~~~
      |  include
main.c:2:1: error: unknown type name 'using'
    2 | using namespace std;
      | ^~~~~
main.c:2:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    2 | using namespace std;
      |                 ^~~
main.c: In function 'main':
main.c:4:9: error: unknown type name 'string'
    4 |         string s;
      |         ^~~~~~
main.c:5:9: error: 'cin' undeclared (first use in this function)
    5 |         cin >> s;
      |         ^~~
main.c:5:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:14: error: subscripted value is neither array nor pointer nor vector
    6 |         if((s[0] == s[1] && s[1] == 'R') || (s[1] == s[2] && s[2] == 'R'))
      |              ^
main.c:6:22: error: subscripted value is neither array nor pointer nor vector
    6 |         if((s[0] == s[1] && s[1] == 'R') || (s[1] == s[2] && s[2] == 'R'))
      |                      ^
main.c:6:30: error: subscripted value is neither array nor pointer nor vector
    6 |         if((s[0] == s[1] && s[1] == 'R') || (s[1] == s[2] && s[2] == 'R'))
      |                              ^
main.c:6:47: error: subscripted value is neither array nor pointer nor vector
    6 |         if((s[0] == s[1] && s[1] == 'R') || (s[1] == s[2] && s[2] == 'R'))
      |                                               ^
main.c:6:55: error: subscripted value is neither array nor pointer nor vector
    6 |         if((s[0] == s[1] && s[1] == 'R') || (s[1] == s[2] && s[2] == 'R'))
      |                                                       ^
main.c:6:63: error: subscripted value is neither array nor pointer nor vector
    6 |         if((s[0] == s[1] && s[1] == 'R') || (s[1] == s[2] && s[2] == 'R'))
      |                                                               ^
main.c:7:7: error: 'cout' undeclared (first use in this function)
    7 |       cout << 2 << endl;
      |       ^~~~
main.c:7:20: error: 'endl' undeclared (first use in this function)
    7 |       cout << 2 << endl;
      |                    ^~~~
main.c:8:18: error: subscripted value is neither array nor pointer nor vector
    8 |         else if(s[0] == 'R' || s[1] == 'R' || s[2] == 'R')
      |                  ^
main.c:8:33: error: subscripted value is neither array nor pointer nor vector
    8 |         else if(s[0] == 'R' || s[1] == 'R' || s[2] == 'R')
      |                                 ^
main.c:8:48: error: subscripted value is neither array nor pointer nor vector
    8 |         else if(s[0] == 'R' || s[1] == 'R' || s[2] == 'R')
      |                                                ^
Language: C

#include<stdio.h>
int main(void){
  char S[3];
  int i,r=0;
  printf("%c\n",S);
  for(i=0;i<4;i++){
    if(S[i]==R)r++;
  }
  printf("%d",r);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:7:14: error: 'R' undeclared (first use in this function)
    7 |     if(S[i]==R)r++;
      |              ^
main.c:7:14: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(void){
  char S[];
  int i,r=0;
  printf("%c\n",S);
  for(i=0;i<4;i++){
    if(S[i]==R)r++;
  }
  printf("%d",r);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:3:8: error: array size missing in 'S'
    3 |   char S[];
      |        ^
main.c:7:14: error: 'R' undeclared (first use in this function)
    7 |     if(S[i]==R)r++;
      |              ^
main.c:7:14: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
void main(){
  string S;
  int i,r=0;
  printf("%f",S);
  for(i=0;i<=3;i++){
    if(s[i]==R)r++;
  }
  printf("%d",r);
}

Compiler output:
main.c: In function 'main':
main.c:3:3: error: unknown type name 'string'; did you mean 'stdin'?
    3 |   string S;
      |   ^~~~~~
      |   stdin
main.c:7:8: error: 's' undeclared (first use in this function)
    7 |     if(s[i]==R)r++;
      |        ^
main.c:7:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:14: error: 'R' undeclared (first use in this function)
    7 |     if(s[i]==R)r++;
      |              ^
Language: C

#include<stdio.h>
 
int main(){
  int i,j,k;
  
  int N;
  scanf("%d",&N);
  
  int L[N];
  for(i=0;i<N;i++){
    scanf("%d ",&L[i]);
  }
  
  int c=0;
  
  for(i=0;i<N;i++){
    for(j=i+1;j<N;j++){
      for(k=j+1;k<N;k++){
        if(L[i]+L[j]>L[k]&&L[i]+L[K]>L[j]&&L[j]+L[k]>L[i]){
          c++;
        }
      }
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:35: error: 'K' undeclared (first use in this function)
   19 |         if(L[i]+L[j]>L[k]&&L[i]+L[K]>L[j]&&L[j]+L[k]>L[i]){
      |                                   ^
main.c:19:35: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main ()
{
	string s;
	cin >> s;
	int cnt = 0;
	int res;
	for (int i = 0 ; i < s.size(); ++i){
		if (s[i] == 'R')
			++cnt;
		else 
			cnt = 0;
		ans = max(ans, cnt);
	}
	cout << res;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |                 ans = max(ans, cnt);
      |                 ^~~
      |                 abs
Language: C++


#include <bits/stdc++.h>

int main(){
strings s; cin >> s;
  if(s == "RRR"){
    return 3; 
  }
  else if(s == "RRS" || s == "SRR"){
    return 2;
  }
  else if(s == "RSS" || s == "SRS" || s == "SSR"){
    return 1;
  }
  return 0;
}

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

#include<stdio.h>
 
int main(){
  char S[3];
  
  scanf("%c%c%c",&S[0],&S[1],&S[2]);
  
  if(S[0]=='R'){
    if(S[1]=='R'){
      if(S[2]=='R'){
        printf("3\n");
      }else{
        printf("2\n");
      }
    }else{
      printf("1\n");
  }else{
    if(S[1]=='R'){
      if(S[2]=='R'){
        printf("2\n");
      }else{
        printf("1\n");
      }
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:4: error: expected '}' before 'else'
   17 |   }else{
      |    ^~~~
Language: C

#include<stdio.h>
 
int main(){
  char S[3];
  
  scanf("%c%c%c",&S[0],&S[1],&S[2]);
  
  if(S[0]=='R'){
    if(S[1]=='R'){
      if(S[2]=='R'){
        printf("3\n");
      }else{
        printf("2\n");
      }
    }else{
      printf("1\n");
    }else{
      if(S[1]=='R'){
        if(S[2]=='R'){
          printf("2\n");
        }else{
          printf("1\n");
        }
      }
    }

Compiler output:
main.c: In function 'main':
main.c:17:6: error: expected '}' before 'else'
   17 |     }else{
      |      ^~~~
main.c:25:5: error: expected declaration or statement at end of input
   25 |     }
      |     ^
Language: C

#include<stdio.h>
 
int main(){
  char S[3];
  
  scanf("%c%c%c",&S[0],&S[1],&S[2]);
  
  if(S[0]=="R"){
    if(S[1]=="R"){
      if(S[2]=="R"){
        printf("3\n");
      }else{
        printf("2\n");
      }
    }else{
      printf("1\n");
    }else{
      if(S[1]=="R"){
        if(S[2]=="R"){
          printf("2\n");
        }else{
          printf("1\n");
        }
      }
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:10: warning: comparison between pointer and integer
    8 |   if(S[0]=="R"){
      |          ^~
main.c:9:12: warning: comparison between pointer and integer
    9 |     if(S[1]=="R"){
      |            ^~
main.c:10:14: warning: comparison between pointer and integer
   10 |       if(S[2]=="R"){
      |              ^~
main.c:17:6: error: expected '}' before 'else'
   17 |     }else{
      |      ^~~~
main.c:18:14: warning: comparison between pointer and integer
   18 |       if(S[1]=="R"){
      |              ^~
main.c:19:16: warning: comparison between pointer and integer
   19 |         if(S[2]=="R"){
      |                ^~
main.c: At top level:
main.c:27:3: error: expected identifier or '(' before 'return'
   27 |   return 0;
      |   ^~~~~~
main.c:28:1: error: expected identifier or '(' before '}' token
   28 | }
      | ^
Language: C

#include<stdio.h>

int main(){
  char S[3];
  
  scanf("%c%c%c",S[0],S[1],S[2]);
  
  if(S[0]=="R"){
    if(S[1]=="R"){
      if(S[2]=="R"){
        printf("3\n");
      }else{
        printf("2\n");
      }
    }else{
      printf("1\n");
    }else{
      if(S[1]=="R"){
        if(S[2]=="R"){
          printf("2\n");
        }else{
          printf("1\n");
        }
      }
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:10: warning: comparison between pointer and integer
    8 |   if(S[0]=="R"){
      |          ^~
main.c:9:12: warning: comparison between pointer and integer
    9 |     if(S[1]=="R"){
      |            ^~
main.c:10:14: warning: comparison between pointer and integer
   10 |       if(S[2]=="R"){
      |              ^~
main.c:17:6: error: expected '}' before 'else'
   17 |     }else{
      |      ^~~~
main.c:18:14: warning: comparison between pointer and integer
   18 |       if(S[1]=="R"){
      |              ^~
main.c:19:16: warning: comparison between pointer and integer
   19 |         if(S[2]=="R"){
      |                ^~
main.c: At top level:
main.c:27:3: error: expected identifier or '(' before 'return'
   27 |   return 0;
      |   ^~~~~~
main.c:28:1: error: expected identifier or '(' before '}' token
   28 | }
      | ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
     string S;
     cin >> S;
     if (S[0]=='S' and S[1]=='S' S[2]=='S')cout << "0" <<endl;
     if (S[1] == 'R'){
          if (S[0]=='R' or S[2]=='R'){
               if(S[0]=='R' and S[2]=='R'){
                    cout <<"3"<<endl;
               }else{
                    cout << "2" <<endl;
               }
          }else{
               cout << "1" <<endl;
          }
     }else{
          if(S[0]=='R' or S[2]=='R')cout << "1" <<endl;
     }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:33: error: expected ')' before 'S'
    9 |      if (S[0]=='S' and S[1]=='S' S[2]=='S')cout << "0" <<endl;
      |         ~                       ^~
      |                                 )
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
     string S;
     cin >> S;
     if (S(0)=='S' and S(1)=='S' S(2)=='S')cout << "0" <<endl;
     if (S(1) == 'R'){
          if (S(0)=='R' or S(2)=='R'){
               if(S(0)=='R' and S(2)=='R'){
                    cout <<"3"<<endl;
               }else{
                    cout << "2" <<endl;
               }
          }else{
               cout << "1" <<endl;
          }
     }else{
          if(S(0)=='R' or S(2)=='R')cout << "1" <<endl;
     }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int)'
    9 |      if (S(0)=='S' and S(1)=='S' S(2)=='S')cout << "0" <<endl;
      |          ~^~~
a.cc:9:25: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int)'
    9 |      if (S(0)=='S' and S(1)=='S' S(2)=='S')cout << "0" <<endl;
      |                        ~^~~
a.cc:9:33: error: expected ')' before 'S'
    9 |      if (S(0)=='S' and S(1)=='S' S(2)=='S')cout << "0" <<endl;
      |         ~                       ^~
      |                                 )
a.cc:10:11: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int)'
   10 |      if (S(1) == 'R'){
      |          ~^~~
a.cc:11:16: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int)'
   11 |           if (S(0)=='R' or S(2)=='R'){
      |               ~^~~
a.cc:11:29: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int)'
   11 |           if (S(0)=='R' or S(2)=='R'){
      |                            ~^~~
a.cc:12:20: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int)'
   12 |                if(S(0)=='R' and S(2)=='R'){
      |                   ~^~~
a.cc:12:34: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int)'
   12 |                if(S(0)=='R' and S(2)=='R'){
      |                                 ~^~~
a.cc:21:15: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int)'
   21 |           if(S(0)=='R' or S(2)=='R')cout << "1" <<endl;
      |              ~^~~
a.cc:21:28: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int)'
   21 |           if(S(0)=='R' or S(2)=='R')cout << "1" <<endl;
      |                           ~^~~
Language: C++

#include <iostream>
#include <String>

using namespace std;

int main(){
     string S;
     cin >> S;
     if (S(0)=='S' and S(1)=='S' S(2)=='S')cout << "0" <<endl;
     if (S(1) == 'R'){
          if (S(0)=='R' or S(2)=='R'){
               if(S(0)=='R' and S(2)=='R'){
                    cout <<"3"<<endl;
               }else{
                    cout << "2" <<endl;
               }
          }else{
               cout << "1" <<endl;
          }
     }else{
          if(S(0)=='R' or S(2)=='R')cout << "1" <<endl;
     }
}


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

#include <stdio.h>

int main()
{
  char s[10];
  
  scanf("%s", s);
  if(s[1] == 'S')
  {
    if((s[0] == 'R') || (s[2] == 'R'))
      printf("1\n");
    else
      printf("0\n");
  }
  else
  {
    if((s[0] == 'R') && (s[2] == 'R'))
      printf("3\n");
    else if((s[0] == 'R') || (s[2] == 'R'))
      printf("2\n");
    else
      printf("1\n");
  return(0);
}


Compiler output:
main.c: In function 'main':
main.c:24:1: error: expected declaration or statement at end of input
   24 | }
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
	string str;
	cin>>str;
    int cur = 0,m = 0;
    for(int i = 0;i < (int)str.length;i++)
    {
    	if(str[i] == 'R')
        cur++;
        else{
        	m = max(m,cur);
          	cur++;
        }
    }
  	m = max(m,cur);
  	cout<<m<<endl;
	return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:32: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    9 |     for(int i = 0;i < (int)str.length;i++)
      |                            ~~~~^~~~~~
      |                                      ()
Language: C++

#include <iostream>
using namespace std;
int main(){
string tenki;
int x=0;
cin>>tenki;
for(int i=0;i<3;i++){
if(tenki[i]=="R")
x++;
}
cout<<x;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 | if(tenki[i]=="R")
Language: C++

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

map<string,int>mp;


int main(){
  mp[RRR] = 3;
mp[RRS] = 2;
mp[RSR] = 1;
mp[SRR] = 2;
mp[SSR] = 1;
mp[SRS] = 1;
mp[RSS] = 1;
mp[SSS] = 0;

  string s;
  cin >> s;
  cout<<mp[s];
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:6: error: 'RRR' was not declared in this scope
    8 |   mp[RRR] = 3;
      |      ^~~
a.cc:9:4: error: 'RRS' was not declared in this scope
    9 | mp[RRS] = 2;
      |    ^~~
a.cc:10:4: error: 'RSR' was not declared in this scope
   10 | mp[RSR] = 1;
      |    ^~~
a.cc:11:4: error: 'SRR' was not declared in this scope
   11 | mp[SRR] = 2;
      |    ^~~
a.cc:12:4: error: 'SSR' was not declared in this scope
   12 | mp[SSR] = 1;
      |    ^~~
a.cc:13:4: error: 'SRS' was not declared in this scope
   13 | mp[SRS] = 1;
      |    ^~~
a.cc:14:4: error: 'RSS' was not declared in this scope
   14 | mp[RSS] = 1;
      |    ^~~
a.cc:15:4: error: 'SSS' was not declared in this scope
   15 | mp[SSS] = 0;
      |    ^~~
Language: C++

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

map<string,int>mp;
mp[RRR] = 3;
mp[RRS] = 2;
mp[RSR] = 1;
mp[SRR] = 2;
mp[SSR] = 1;
mp[SRS] = 1;
mp[RSS] = 1;
mp[SSS] = 0;


int main(){
  string s;
  cin >> s;
  cout<<mp[s];
}

Compiler output:
a.cc:5:1: error: 'mp' does not name a type
    5 | mp[RRR] = 3;
      | ^~
a.cc:6:1: error: 'mp' does not name a type
    6 | mp[RRS] = 2;
      | ^~
a.cc:7:1: error: 'mp' does not name a type
    7 | mp[RSR] = 1;
      | ^~
a.cc:8:1: error: 'mp' does not name a type
    8 | mp[SRR] = 2;
      | ^~
a.cc:9:1: error: 'mp' does not name a type
    9 | mp[SSR] = 1;
      | ^~
a.cc:10:1: error: 'mp' does not name a type
   10 | mp[SRS] = 1;
      | ^~
a.cc:11:1: error: 'mp' does not name a type
   11 | mp[RSS] = 1;
      | ^~
a.cc:12:1: error: 'mp' does not name a type
   12 | mp[SSS] = 0;
      | ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,m,n) for(ll (i)=(ll)(m);i<(ll)(n);i++)
#define REP(i,n) rep(i,0,n)
#define all(hoge) (hoge).begin(),(hoge).end()
constexpr ll INF = 1LL << 61;
typedef vector<ll> Array;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; }return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; }return false; }

int main() {
	ios::sync_with_stdio(false);
	std::cin.tie(0);
	std::cout.tie(0);

	ll n;
	cin >> n;
	vector s(2, vector<string>(n));//元の文字列と反転した文字列
	Array cost(n);
	REP(i, n)cin >> s[0][i] >> cost[i];
	REP(i, n)s[1][i] = s[0][i], reverse(all(s[1][i]));

	//ダイクストラ
	using T = tuple<ll, string, bool>;//コスト、文字列、反転しているかどうか
	map<pair<string, ll>, ll> mp;
	priority_queue<T, vector<T>, greater<T>> que;
	auto push = [&](ll c, string v, ll f) {
		if (mp.count({ v,f }) == 0 || mp[{v, f}] > c)que.push({ c,v,f }), mp[{v, f}] = c;
	};
	ll ans = INF;
	auto pcheck = [&](string& s) {
		REP(i, s.size() / 2)if (s[i] != s[s.size() - 1 - i])return false;
		return true;
	};
	REP(i, n) push(cost[i], s[0][i], 1);
	while (que.size()) {
		auto [c, v, flip] = que.top();
		que.pop();
		if (mp[{v, flip}] < c || ans <= c)continue;
		if (pcheck(v) == true) {
			chmin(ans, c);
			continue;
		}
		REP(i, n) {
			auto check = [&](string a, string b)->string {
				if (a.size() < b.size())swap(a, b);
				REP(i, b.size())if (a[i] != b[i])return "!";
				return a.substr(b.size());
			};
			auto ret = check(v, s[flip][i]);
			if (ret == "!")continue;
			push(c + cost[i], ret, flip ^ (v.size() <= s[flip[i].size()));
		}
	}
	if (ans == INF)cout << -1 << "\n";
	else cout << ans << "\n";

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:74: error: invalid types 'std::tuple_element<2, std::tuple<long long int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool> >::type {aka bool}[long long int]' for array subscript
   53 |                         push(c + cost[i], ret, flip ^ (v.size() <= s[flip[i].size()));
      |                                                                          ^
a.cc:53:84: error: expected ']' before ')' token
   53 |                         push(c + cost[i], ret, flip ^ (v.size() <= s[flip[i].size()));
      |                                                                                    ^
      |                                                                                    ]
Language: C++

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

//const int INF = 1001001001;
//const ll INF18 = 1000000000000000000;
const ll INF15 = 1000000000000000;

int main() {
	ll X, K, D;
    cin >> X >> K >> D;
    X = abs(X);

    ll straight = min(K, X / D);
    K -= straight;
    X -= straight * D;

    if (K % 2 == 0) {
        cout << X << endl;
    } else {
        cout << D - X << endl;
    }

    return 0
}


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

include<stdio.h>

int main()
{
  int n;
  int count;
  int value;
  char weather[2];
  char num[];
  scanf("%s",weather);
  printf("%s\n",weather);
  
  for(int n=1;n<=2;n++){
    if (weather[n]==R && weather[n-1]==R){
     count++;
      value=count;
    }
    if (weather[n]==S){
    }
      
  }
  
  
  int max = num[0];
  for(n=0;n<3;n++)
    if(num[i]>max)
      max=num[i];
   return max;
}

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

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

int main(){
  string s; int count = 0; int ans =0;
  cin >> s;
  for(char c:s) {
    if(c=="R") count++;
    else count = 0;
    ans = max(ans, count);
  }
  
  cout << ans ;
  
    return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |     if(c=="R") count++;
      |        ~^~~~~
Language: C++

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

int main(){
  int R,C,K;
  cin>>R>>C>>K;
  vector<vector<int64_t>> p(R,vector<int64_t>(C));
  for(int i=0;i<K;i++){
    int a,b;
    int64_t c;
    cin>>a>>b>>c;
    a--,b--;
    p[a][b]=c;
  }
  vector<vector<vector<int64_t>>> dp(R,vector<vector<int64_t>>(C,vector<int64_t>(4)));
  dp[0][0][1]=p[0][0];
  for(int a=0;a<R+C-2;a++){
    for(int b=0,b<C;b++){
      int i=a-b,j=b;
      if(i<0||R<=i){
        continue;
      }
      for(int k=0;k<4;k++){
        if(j+1<C){
          dp[i][j+1][k]=max(dp[i][j+1][k],dp[i][j][k]);
          if(k<3){
            dp[i][j+1][k+1]=max(dp[i][j+1][k+1],dp[i][j][k]+p[i][j+1]);
          }
        }
        if(i+1<R){
          dp[i+1][j][1]=max(dp[i+1][j][1],dp[i][j][k]+p[i+1][j]);
          dp[i+1][j][0]=max(dp[i+1][j][0],dp[i][j][k]);
        }
      }
    }
  }
  int64_t Z=0;
  for(int k=0;k<4;k++){
    Z=max(Z,dp[R-1][C-1][k]);
  }
  cout<<Z<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:18:18: error: expected ';' before '<' token
   18 |     for(int b=0,b<C;b++){
      |                  ^
      |                  ;
a.cc:18:18: error: expected primary-expression before '<' token
Language: C++

#include<iostream>
using namespace std;
 
int main(){
 
string a;
char b,c,d;
cin>>a;
 
a[0]=b;
a[1]=c;
a[2]=d;
 
if(b==R&&c==R&&d==R){
  cout<<3;
}
else if((b==R&&c==R&&d!=R)||(b!=R&&c==R&&d==R)){
  cout<<2;
}
else if((b==R&&c!=R&&d!=R)||(b!=R&&c==R&&d!=R)||(b!=R&&c!=R&&d==R)){
  cout<<1;
}
else[
  cout<<0;
  }
 
 
 
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:7: error: 'R' was not declared in this scope
   14 | if(b==R&&c==R&&d==R){
      |       ^
a.cc:24:3: warning: capture of variable 'std::cout' with non-automatic storage duration
   24 |   cout<<0;
      |   ^~~~
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::ostream std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:24:7: error: expected ',' before '<<' token
   24 |   cout<<0;
      |       ^~
      |       ,
a.cc:24:7: error: expected identifier before '<<' token
   24 |   cout<<0;
      |       ^~
a.cc:24:10: error: expected ']' before ';' token
   24 |   cout<<0;
      |          ^
      |          ]
a.cc: In lambda function:
a.cc:24:10: error: expected '{' before ';' token
a.cc: At global scope:
a.cc:29:1: error: expected unqualified-id before 'return'
   29 | return 0;
      | ^~~~~~
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C++

#include<iostream>
using namespace std;

int main(){

string a;
char b,c,d;
cin>>a;

a[0]=b;
a[1]=c;
a[2]=d;

if(b==R&&c==R&&d==R)cout<<"3";
else if((b==R&&c==R&&d!=R)||(b!=R&&c==R&&d==R))cout<<"2";
else if((b==R&&c!=R&&d!=R)||(b!=R&&c==R&&d!=R)||(b!=R&&c!=R&&d==R))cout<<"1";
else cout<<"0";



return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:7: error: 'R' was not declared in this scope
   14 | if(b==R&&c==R&&d==R)cout<<"3";
      |       ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
char s[3];
int i,count=0;
cin>>s;
for(i=0;i<1;i++)
{
if(s[0]=='R' && s[1]=='R' && s[2]='R')
{
count+=3;
break;
}
else if(s[0]=='R' && s[1]=='R'&& s[2]=='S')
{
count+=2;
}
else if(s[0]=='R' && s[1]=='S' && s[2]=='R')
{
count+=1;
}
else if(s[0]=='S' && s[1]=="R' && s[2]=='R')
{
count+=1;
}
else
{
count+=0;
}
}
cout<<count;
}

Compiler output:
a.cc:23:28: warning: missing terminating " character
   23 | else if(s[0]=='S' && s[1]=="R' && s[2]=='R')
      |                            ^
a.cc:23:28: error: missing terminating " character
   23 | else if(s[0]=='S' && s[1]=="R' && s[2]=='R')
      |                            ^~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:10:27: error: lvalue required as left operand of assignment
   10 | if(s[0]=='R' && s[1]=='R' && s[2]='R')
      |    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:24:1: error: expected primary-expression before '{' token
   24 | {
      | ^
a.cc:23:28: error: expected ')' before '{' token
   23 | else if(s[0]=='S' && s[1]=="R' && s[2]=='R')
      |        ~                   ^
      |                            )
   24 | {
      | ~                           
a.cc:31:1: error: expected primary-expression before '}' token
   31 | }
      | ^
Language: Java

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.Vector;

public class NewClass {

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

		String s1=ob.next();
		char s[]=s1.toCharArray();
		Vector v=new Vector();
		for (int i=0; i<s1.length();) {
			if (s1.charAt(i)=='R') {
				int count=0;
				while (i<s1.length()&&s1.charAt(i)=='R') {
					i++;
					count++;
				}
				v.add(count);
			}
			else {
				while (i<s1.length()&&s1.charAt(i)=='S') {
					i++;
				}
			}
		}
		if (v.isEmpty()) {
			System.out.println(0);
		}
		else {
			System.out.println(Collections.max(v));
		}
	}

}


Compiler output:
Main.java:12: error: class NewClass is public, should be declared in a file named NewClass.java
public class NewClass {
       ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: C++

#include<iostream>
using namespace std;
int main()
{
  string s;
  cin>>s;
  int count=0;
  int i=0;
  int maxm=0;
  int n=3;
  while(i<n)
  {
    while(s[i]=='R')
    {
      count++;
      i++;
    }
    else
    {
     i++; 
    }
    maxm=max(maxm,count);
    count=0;
  }
cout<<maxm;
}


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

#include<iostream>
using namespace std;
int main()
{
  string s;
  cin>>s;
  int count=0;
  int i=0;
  int maxm=0;
  while(i<n)
  {
    while(s[i]=='R')
    {
      count++;
      i++;
    }
    else
    {
     i++; 
    }
    maxm=max(maxm,count);
    count=0;
  }
cout<<maxm;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: 'n' was not declared in this scope
   10 |   while(i<n)
      |           ^
a.cc:17:5: error: 'else' without a previous 'if'
   17 |     else
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  string s;
  cin>>s;
  int count=0;
  int i=0;
  int maxm=0;
  while(i<n)
  {
    while(s[i]=='R')
    {
      count++;
      i++;
    }
    else
    {
     i++; 
    }
    maxm=max(maxm,count);
    count=0;
  }
cout<<maxm;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: 'n' was not declared in this scope
   10 |   while(i<n)
      |           ^
a.cc:17:5: error: 'else' without a previous 'if'
   17 |     else
      |     ^~~~
Language: C++

#include <unordered_map>
#include <functional>
#include <algorithm>
#include <iostream>
#include <climits>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
using namespace std;
#define LL long long int
int main() 
{
   //  freopen("input1.txt","r",stdin);
    // freopen("output1.txt","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //cout.tie(NULL);
    string s;
    cin>>s;
    LL cnt=0;
    LL ans=-1;
    for(int i=0;i<s.size();i++)
    {
    	if(s[i]=='R') cnt++;
    	else cnt=0;
    	ans=max(cnt,ans);
    }
    cout<<maxi<<endl;
}

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

#include <unordered_map>
#include <functional>
#include <algorithm>
#include <iostream>
#include <climits>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
using namespace std;
#define LL long long int
int main() 
{
    // freopen("input1.txt","r",stdin);
    // freopen("output1.txt","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    string s;
    cin>>s;
    LL cnt=0;
    LL ans=-1;
   	sort(s.begin(),s.end());
    for(int i=0;i<s.size();i++)
    {
    	if(s[i]=='R') cnt++;
    	else cnt=0;
    	ans=max(cnt,ans);
    }
    cout<<maxi<<endl;
}

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

#include <bits/stdc++.h>
using namespace std;
 
int main(){
    string A;
    cin >> A;
 
    if(A == RRR){
      cout << 3 << endl;
    }else if(A == RRS||A == SRR){
      cout << 2 << endl;
    }else if(A == SSS){
      cout << 0 << endl;
    }else{cout << 1 << endl;}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'RRR' was not declared in this scope
    8 |     if(A == RRR){
      |             ^~~
a.cc:10:19: error: 'RRS' was not declared in this scope
   10 |     }else if(A == RRS||A == SRR){
      |                   ^~~
a.cc:10:29: error: 'SRR' was not declared in this scope
   10 |     }else if(A == RRS||A == SRR){
      |                             ^~~
a.cc:12:19: error: 'SSS' was not declared in this scope
   12 |     }else if(A == SSS){
      |                   ^~~
Language: C++

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

int main(){
    string A;
    cin >> A;

    if(A == RRR){
      cout << 3 << endl;
    }else if(A == RRS||A == SRR){
      cout << 2 << endl;
    }else if(A == SSS){
      cout << 0 << endl;
    }else cout << 1 << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'RRR' was not declared in this scope
    8 |     if(A == RRR){
      |             ^~~
a.cc:10:19: error: 'RRS' was not declared in this scope
   10 |     }else if(A == RRS||A == SRR){
      |                   ^~~
a.cc:10:29: error: 'SRR' was not declared in this scope
   10 |     }else if(A == RRS||A == SRR){
      |                             ^~~
a.cc:12:19: error: 'SSS' was not declared in this scope
   12 |     }else if(A == SSS){
      |                   ^~~
Language: C++

#include <cstdio>
#include <iostream>
#include <cassert>
#include <string>
#include <algorithm>
#include <cstring>
#include <utility>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <deque>
#include <unordered_map>
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)

using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
typedef pair<LL, LL> pll;

const LL MOD = (LL)1e9 + 7;

int main() {
    int T;
    scanf("%d", &T);
    for (int t = 1; t <= T; t++) {
        int N, K, W;
        scanf("%d %d %d", &N, &L, &W);
        vector<LL> L(N, 0), H(N, 0);
        for (int i = 0; i < K; i++)
            scanf("%lld", &L[i]);
        vector<LL> cL(4), cH[i];
        for (int i = 0; i < 4; i++)
            scanf("%lld", &cL[i]);
        for (int i = 0; i < K; i++)
            scanf("%lld", &H[i]);
        for (int i = 0; i < 4; i++)
            scanf("%lld", &cL[i]);
        for (int i = K; i < N; i++) {
            L[i] = ((cL[0] * L[i - 2] + cL[1] * L[i - 1] + cL[2]) % cL[3]) + 1;
            H[i] = ((cH[0] * H[i - 2] + cH[1] * H[i - 1] + cH[2]) % cH[3]) + 1;
        }
        vector<pLL> cand;
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < 20; j++) {

            }


        }
        printf("Case #%d:")


    }
    return 0;
}
/* stuff you should look for
	* int overflow, array bounds
	* special cases (n=1?)
	* do smth instead of nothing and stay organized
	* WRITE STUFF DOWN
by Benq;
*/


Compiler output:
a.cc: In function 'int main()':
a.cc:30:32: error: 'L' was not declared in this scope
   30 |         scanf("%d %d %d", &N, &L, &W);
      |                                ^
a.cc:34:30: error: 'i' was not declared in this scope
   34 |         vector<LL> cL(4), cH[i];
      |                              ^
a.cc:43:22: error: 'cH' was not declared in this scope; did you mean 'cL'?
   43 |             H[i] = ((cH[0] * H[i - 2] + cH[1] * H[i - 1] + cH[2]) % cH[3]) + 1;
      |                      ^~
      |                      cL
a.cc:45:16: error: 'pLL' was not declared in this scope; did you mean 'pll'?
   45 |         vector<pLL> cand;
      |                ^~~
      |                pll
a.cc:45:19: error: template argument 1 is invalid
   45 |         vector<pLL> cand;
      |                   ^
a.cc:45:19: error: template argument 2 is invalid
a.cc:53:28: error: expected ';' before '}' token
   53 |         printf("Case #%d:")
      |                            ^
      |                            ;
......
   56 |     }
      |     ~
Language: C

#include<stdio.h>
int main()
{
  int max=0,c;
  char a[4];
  scanf("%s",a);
  for(i=0;i<3;i++)
  {
  if(a[i]=='S')
    c=0;
  else
    c++;
  if(c>max)
  max=c;
  }
  printf("%d\n",max);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:7: error: 'i' undeclared (first use in this function)
    7 |   for(i=0;i<3;i++)
      |       ^
main.c:7:7: note: each undeclared identifier is reported only once for each function it appears in
Language: Java

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

public class X {

	
	public static void main(String[] args) {
		FastScanner in=new FastScanner();
		PrintWriter out=new PrintWriter(System.out);
	//	int t=in.nextInt();
	//	while(t-->0)
		solve(in,out);
		out.close();
	}

    static void solve(FastScanner in,PrintWriter out){
      String s=in.next();
      int count=0,max=0;
      for(int i=0;i<s.length();i++){
          if(s.charAt(i)=='R') count++;
          else { max=Math.max(count,max); count=0; }
      }
      out.println(max);
    }    
	



	static void sort(int[] a) {
		ArrayList<Integer> l=new ArrayList<>();
		for (int i:a) l.add(i);
		Collections.sort(l);
		for (int i=0; i<a.length; i++) a[i]=l.get(i);
	}
	
	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		
		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
	}

	
}


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

/*
Created by Rishu Sahu
*/
/*
*****************************************************************
*/

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

#define IOS cin.sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long int
#define pai pair<int,int>
#define f first
#define s second
#define sz(x) (int)x.size()
#define vi vector<nt>

const int mod = 1e9+7;
const int INF = INT_MAX;



void solve(){
   ll x,k,d;
   cin>>x>>k>>d;
  if(x<0)
    x=-x;
   int req=x/d;
   if(req>=k){
        cout<<""<(x-d*k)<<endl;
   }
   
   else{
        k=k-req;
        //x=abs(x)-req*abs(d);
        if(k%2==0){
            cout<<""<<x%d<<endl;
        }
        else{
            cout<<""<<abs(d-x%d)<<endl;
        }
   }


}


int main(){
    /*int t;
    cin>>t;
    while(t--){*/
        solve();
    //}
}
/*
1000000000000000
1000000000000000
1000000000000000
*/


Compiler output:
a.cc: In function 'void solve()':
a.cc:31:25: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   31 |         cout<<""<(x-d*k)<<endl;
      |                  ~~~~~~~^~~~~~
Language: C++

/*
Created by Rishu Sahu
*/
/*
*****************************************************************
*/

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

#define IOS cin.sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long int
#define pai pair<int,int>
#define f first
#define s second
#define sz(x) (int)x.size()
#define vi vector<nt>

const int mod = 1e9+7;
const int INF = INT_MAX;



void solve(){
   ll x,k,d;
   cin>>x>>k>>d;
  if(x<0)
    x=-x;
   int req=x/d;
   if(req>=k){
        cout<<""<x-d*k<<endl;
   }
   
   else{
        k=k-req;
        //x=abs(x)-req*abs(d);
        if(k%2==0){
            cout<<""<<x%d<<endl;
        }
        else{
            cout<<""<<d-x%d<<endl;
        }
   }


}


int main(){
    /*int t;
    cin>>t;
    while(t--){*/
        solve();
    //}
}
/*
1000000000000000
1000000000000000
1000000000000000
*/


Compiler output:
a.cc: In function 'void solve()':
a.cc:31:23: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   31 |         cout<<""<x-d*k<<endl;
      |                  ~~~~~^~~~~~
Language: C++

#include <iostream>
using namespace std;
int main(){
  string s;
  int c;
  cin >> s;
  if(s[0]=='R'){
    if(s[1]=='R'){
      if(s[2]=='R'){
        c=3;
      }else{
        c=2;
      }
    }else{
      c=1;
    }
  }else{
    if(s[1]=='R'){
      if(s[2]=='R'){
        c=2;
      }else{
        c=1;
      }
    }else{
      if(s[2]=='R'){
        c=1;
      }else{
        c=0;
      }
    }
  }
  cout << c;
    

Compiler output:
a.cc: In function 'int main()':
a.cc:32:13: error: expected '}' at end of input
   32 |   cout << c;
      |             ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C

#include <stdio.h>

int main(void) {
  char s[4];
  fscanf(stdin, "%s", s);
  
  int sum = 0;
  bool isRainy = false;
  for(int i = 0; i < 3; i++) {
    if (s[i] == 'R' && isRainy == true) {
      sum++;
    } else if (s[i] == 'R' && isRainy == false) {
      isRainy = true;
      sum++;
    } else if (s[i] == 'S' && isRainy == true) {
      isRainy = false;
      sum = 0;
    } else {
      sum = 0;
    }
  }
  printf("%d\n", sum);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:3: error: unknown type name 'bool'
    8 |   bool isRainy = false;
      |   ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include <stdio.h>
  +++ |+#include <stdbool.h>
    2 | 
main.c:8:18: error: 'false' undeclared (first use in this function)
    8 |   bool isRainy = false;
      |                  ^~~~~
main.c:8:18: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:8:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:35: error: 'true' undeclared (first use in this function)
   10 |     if (s[i] == 'R' && isRainy == true) {
      |                                   ^~~~
main.c:10:35: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C

#include<stdio.h>
int main()
{ char S[3];
 int i=0;count=0;
 scanf("%s",&S);
 while (i<3)
 { 
   {
    if (S[i]=='R')
    count = count +1;
    i = i+1;
   }
   if (i==0) 
   { 
     if (S[0]=='S')
       i = i+1;
       continue;
   }
   else 
   {
     if (S[i]=='S')
     break;
   }
 }
 printf(count);
 return 0;
}
     
   


Compiler output:
main.c: In function 'main':
main.c:4:10: error: 'count' undeclared (first use in this function)
    4 |  int i=0;count=0;
      |          ^~~~~
main.c:4:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

int main() {
  string S;
  cin >> S;
  if (S == "SSS") {
    cout << 0;
  }
  else if (S == "RRR") {
    cout << 3:
  }
  else if (S == "SSR" || "SRS" || "RSS") {
    cout << 1;
  }
  else {
    cout << 2;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: expected ';' before ':' token
   11 |     cout << 3:
      |              ^
      |              ;