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

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

int main(){
  int S;
  cin >> S;
  pair<char, int> p(S,1);
  
  for(int i = 0;i < S;i++){
    cin >> p.at(i).first;
  }
  
  for(int i = 0;i < S;i++){
    if(p.at(i).first == 'R'){
      if(p.at(i).second > 0){
        p.at(i).second--;
      }
      p.at(i + 1).second++;
    }
    
    if(p.at(i).first == 'L'){
      if(p.at(i).second > 0){
        p.at(i).second--;
      }
      p.at(i - 1).second++;
    }
  }
  
  for(int i = 0;i < S;i++){
    cout << p.at(i).second;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: 'struct std::pair<char, int>' has no member named 'at'
   10 |     cin >> p.at(i).first;
      |              ^~
a.cc:14:10: error: 'struct std::pair<char, int>' has no member named 'at'
   14 |     if(p.at(i).first == 'R'){
      |          ^~
a.cc:15:12: error: 'struct std::pair<char, int>' has no member named 'at'
   15 |       if(p.at(i).second > 0){
      |            ^~
a.cc:16:11: error: 'struct std::pair<char, int>' has no member named 'at'
   16 |         p.at(i).second--;
      |           ^~
a.cc:18:9: error: 'struct std::pair<char, int>' has no member named 'at'
   18 |       p.at(i + 1).second++;
      |         ^~
a.cc:21:10: error: 'struct std::pair<char, int>' has no member named 'at'
   21 |     if(p.at(i).first == 'L'){
      |          ^~
a.cc:22:12: error: 'struct std::pair<char, int>' has no member named 'at'
   22 |       if(p.at(i).second > 0){
      |            ^~
a.cc:23:11: error: 'struct std::pair<char, int>' has no member named 'at'
   23 |         p.at(i).second--;
      |           ^~
a.cc:25:9: error: 'struct std::pair<char, int>' has no member named 'at'
   25 |       p.at(i - 1).second++;
      |         ^~
a.cc:30:15: error: 'struct std::pair<char, int>' has no member named 'at'
   30 |     cout << p.at(i).second;
      |               ^~
Language: C++

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

int main(){
  int S;
  cin >> S;
  pair<char, int> p(S,1);
  
  for(int i = 0;i < S;i++){
    cin >> p.at(i);
  }
  
  for(int i = 0;i < S;i++){
    if(p.at(i).first == 'R'){
      if(p.at(i).second > 0){
        p.at(i).second--;
      }
      p.at(i + 1).second++;
    }
    
    if(p.at(i).first == 'L'){
      if(p.at(i).second > 0){
        p.at(i).second--;
      }
      p.at(i - 1).second++;
    }
  }
  
  for(int i = 0;i < S;i++){
    cout << p.at(i).second;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: 'struct std::pair<char, int>' has no member named 'at'
   10 |     cin >> p.at(i);
      |              ^~
a.cc:14:10: error: 'struct std::pair<char, int>' has no member named 'at'
   14 |     if(p.at(i).first == 'R'){
      |          ^~
a.cc:15:12: error: 'struct std::pair<char, int>' has no member named 'at'
   15 |       if(p.at(i).second > 0){
      |            ^~
a.cc:16:11: error: 'struct std::pair<char, int>' has no member named 'at'
   16 |         p.at(i).second--;
      |           ^~
a.cc:18:9: error: 'struct std::pair<char, int>' has no member named 'at'
   18 |       p.at(i + 1).second++;
      |         ^~
a.cc:21:10: error: 'struct std::pair<char, int>' has no member named 'at'
   21 |     if(p.at(i).first == 'L'){
      |          ^~
a.cc:22:12: error: 'struct std::pair<char, int>' has no member named 'at'
   22 |       if(p.at(i).second > 0){
      |            ^~
a.cc:23:11: error: 'struct std::pair<char, int>' has no member named 'at'
   23 |         p.at(i).second--;
      |           ^~
a.cc:25:9: error: 'struct std::pair<char, int>' has no member named 'at'
   25 |       p.at(i - 1).second++;
      |         ^~
a.cc:30:15: error: 'struct std::pair<char, int>' has no member named 'at'
   30 |     cout << p.at(i).second;
      |               ^~
Language: C++

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

#define  rep(i,n) for (int i = 0 ;i < n ; i++)

using namespace std;

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

	vector <int> ans(s.size());
	rep(ri,2){
		{
			int cnt = 0;
			rep(i, s.size()) {
				if (s[i] == 'R')  cnt++;
				else {
					ans[i] += cnt / 2;
					ans[i - 1] += (cnt + 1) / 2;
					cnt = 0;
				}
			}
		}
		reverse(ans.begin(), ans.end());
		reverse(s.begin(), s.end());
		rep(i, s.size()) {
			if (s[i] == 'R')  s[i] = 'L';
			else  s[i] = 'R';
		}
	}

	rep(i, s.size()) {
		if (i)  cout << ' ';
		cout << ans[i];
	}
	cout << endl;
}

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


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		
		int n = s.length();
		
		char lr[] = new char[n];
		
		lr[0] = 'R';
		for (int i = 1 ; i <n-1 ; i ++) {
			
			lr[i] = s.charAt(i);
		}
		
		lr[n-1] = 'L';
		
		int ch[] = new int [n];
		for(int i = 0 ; i < n ; i ++) {
			ch[i] = 0;
		}
		long num = 1;
		for (int i = 0; i < 100 ; i ++) {
			
			num = num * 10;
		}
		//int num = 99;
		//自分の乗っている文字がRの場合、直近のLまでの距離を出せば、そことその隣との往復になる。
		//自分の乗っている文字がLの場合、直近のRまでの距離を出せば、そことその人ます右との往復運動になる。
		for (int i = 0 ; i < n ; i ++) {
		
			if (lr[i] == 'R') {
				
				int count = 1;
				
				boolean same = true;
				
				while (same){
					if (lr[i+count] == 'R') {
						count++;
					}else {
						
						same = false;
					};
				};
				
				if ((num - (long)count)%2 == 0) {
					ch[i + count]++;
					
				}else {
					ch[i+ count -1]++ ;
				};
			}else {
				int count = 1;
				
				boolean same = true;
				
				while (same){
					if (lr[i-count] == 'L') {
						count++;
					}else {
						
						same = false;
					};
				};
				if ((num- (long)count)%2 == 0) {
					ch[i - count]++;
				}else {
					ch[i- count +1] ++ ;
				};
			}
		
		}
		
		String re = "";
		for (int i = 0 ; i < n ; i ++) {
			re  += ch[i]+" ";
		}
		
		System.out.println(re);
		
	}

Compiler output:
Main.java:87: error: reached end of file while parsing
	}
	 ^
1 error
Language: Java

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		
		int n = s.length();
		
		char lr[] = new char[n];
		
		lr[0] = 'R';
		for (int i = 1 ; i <n-1 ; i ++) {
			
			lr[i] = s.charAt(i);
		}
		
		lr[n-1] = 'L';
		
		int ch[] = new int [n];
		for(int i = 0 ; i < n ; i ++) {
			ch[i] = 0;
		}
		long num = 1;
		for (int i = 0; i < 100 ; i ++) {
			
			num = num * 10;
		}
		System.out.println(Math.pow(10,100));
		//int num = 99;
		//自分の乗っている文字がRの場合、直近のLまでの距離を出せば、そことその隣との往復になる。
		//自分の乗っている文字がLの場合、直近のRまでの距離を出せば、そことその人ます右との往復運動になる。
		for (int i = 0 ; i < n ; i ++) {
		
			if (lr[i] == 'R') {
				
				int count = 1;
				
				boolean same = true;
				
				while (same){
					if (lr[i+count] == 'R') {
						count++;
					}else {
						
						same = false;
					};
				};
				
				System.out.println(count+"R");
				System.out.println((Math.pow(10,100) - count)%2);
				if ((num - (long)count)%2 == 0) {
					ch[i + count]++;
					
				}else {
					ch[i+ count -1]++ ;
				};
				System.out.println("R"+i+" is " +(i+count));
			}else {
				int count = 1;
				
				boolean same = true;
				
				while (same){
					if (lr[i-count] == 'L') {
						count++;
					}else {
						
						same = false;
					};
				};
				System.out.println(count+"L");
				if ((num- (long)count)%2 == 0) {
					ch[i - count]++;
				}else {
					ch[i- count +1] ++ ;
				};
			}
		
		}
		
			
			
	
		String re = "";
		for (int i = 0 ; i < n ; i ++) {
			re  += ch[i]+" ";
		}
		
		System.out.println(re);
		
	}

Compiler output:
Main.java:94: error: reached end of file while parsing
	}
	 ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
main(){
  string s;
  cin>>s;
  vector<int> a(s.size());
  for(int i=0;i<s.size();i++){
    cin>>a[i];
  }
  vector<int> ans(s.size());
  int t=0;
  for(int j=0;j<2;j++){
  for(int i=0;i<s.size();i++){
    if(s[i]=='R'){
      t++;
    }
    else{
      ans[i]=t/2;
      ans[i-1]=(t+1)/2;
      t=0;
    }
  }
    if(j==1){
      break;
    }
        
        
    reverse(s.begin(),s.end());
    reverse(ans.begin(),ans.end());
    
    for(int y=0;y<s.size();y++){
      if(s[i]=='R'){
        s[i]='L';
      }
      else{
        s[i]='R';
      }
    }
  }
  for(int i=0;i<s.size();i++){
    cout<<ans[i]<<endl;
  }
}
      
      
      
      

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:32:12: error: 'i' was not declared in this scope
   32 |       if(s[i]=='R'){
      |            ^
Language: C++

#pragma GCC optimize("Ofast",3,"inline")
#include <bits/stdc++.h>
using namespace std;
int a[100000],b[100000],c[100000];
string s;
int main(){
	ios_base::sync_with_stdio(false);
	for(int i=0;i<100;i++) a[i]=1,b[i]=0;
	cin>>s;
	int len=s.size();
	for(int i=0;i<2000;i++){
		for(int j=0;j<len;j++){
			if(s[j]=='L') b[j-1]+=a[j];
			else b[j+1]+=a[j];
			//b[j]-=a[j];
		}
		bool ok=1;
		for(int j=0;j<len;j++){
			if(c[j]!=b[j]||i%2==0) ok=0;
			c[j]=a[j],a[j]=b[j]/*,cout<<a[j]<<"  ",*/b[j]=0;
			
		} 
		//cout<<'\n';	
		if(ok){
			for(int j=0;j<len;j++)cout<<a[j]<<" ";
			return 0;
		}	
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:44: error: expected ';' before 'b'
   20 |                         c[j]=a[j],a[j]=b[j]/*,cout<<a[j]<<"  ",*/b[j]=0;
      |                                            ^                     ~
      |                                            ;
Language: C++

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

int main(void)
{
	std::string S;
	std::cin >> S;

	int n = S.length();
	std::vector<int> ans(n);
	
	for (int i = 0; i < 2; i++) {
		int cnt = 0;
		for (int j = 0; j < n; j++) {
			if (S[j] == 'R') cnt++;
			else {
				ans[j - 1] += (cnt + 1) / 2;
				ans[j] += cnt / 2;
				cnt = 0;
			}
		}
		std::reverse(S.begin(), S.end());
		std::reverse(ans.begin(), ans.end());
		for (int j = 0; j < n; j++) {
			if (S[j] == 'R')	S[j] = 'L';
			else				S[j] = 'R';
		}

	}

	for (auto x : ans)
		std::cout << x << " ";
	std::cout << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:22: error: 'reverse' is not a member of 'std'
   23 |                 std::reverse(S.begin(), S.end());
      |                      ^~~~~~~
a.cc:24:22: error: 'reverse' is not a member of 'std'
   24 |                 std::reverse(ans.begin(), ans.end());
      |                      ^~~~~~~
Language: C++

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

int main(){
  char s[100000];
  scanf("%s\n",s);
  int sl = strlen(s);
  int a[sl]={}; int r=0; int l=0;

  for(int i=0; i<sl; i++){
      while(l==0 || r==0){
      if(s[i] == 'R'){
           r++;
      }else {
          l++;
      }
      }
      ii=i+(r*1-l*1);
          if(((r+l) % 2 == 0)) a[ii] += 1;
          else if(s[ii]=='R') a[ii+1] += 1;
          else a[ii-1] += 1;
          r=0; l=0;
  }

  for(int j=0; j<sl; j++) 
   printf("%d ",a[j]);
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:7: error: 'ii' was not declared in this scope; did you mean 'i'?
   18 |       ii=i+(r*1-l*1);
      |       ^~
      |       i
Language: C++

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

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

    string s;
    cin >> s;
    
    int n = s.size();
    
    int ans[n];
    rep(i,n) ans[i] = 0;
    
    rep(i,n-1){
        //'RL'の並びになってるところを探す
        if(s[i] == 'R' && s[i+1] == 'L'){
            //左に連続しているRの数
            int sumR = 0;
            int j = i;
            while(s[j] == 'R' && j >= 0){
                sumR++;
                j--;
            }
            
            //右に連続しているLの数
            int sumL = 0;
            j = i + 1;
            while(s[j] == 'L' && j < n){
                sumL++;
                j++;
            }
            
            //Rのところに居る人の数
            ans[i] = sumR / 2 + sumL / 2 + sumR % 2;
            ans[i+1] = sumR / 2 + sumL / 2 + sumL % 2;
            
            // cout << sumL << endl;
            // rep(i,n){
            //     cout << ans[i] << ' ';
            // }
            // cout << endl;
        }
    }
    
    rep(i,n){
        cout << ans[i] << ' ';
    }
    
    return 0;
}#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<n; i++)
typedef long long int ll;
typedef pair<int, int> P;
#define INF 1e9 + 7

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

    string s;
    cin >> s;
    
    int n = s.size();
    
    int ans[n];
    rep(i,n) ans[i] = 0;
    
    rep(i,n-1){
        //'RL'の並びになってるところを探す
        if(s[i] == 'R' && s[i+1] == 'L'){
            //左に連続しているRの数
            int sumR = 0;
            int j = i;
            while(s[j] == 'R' && j >= 0){
                sumR++;
                j--;
            }
            
            //右に連続しているLの数
            int sumL = 0;
            j = i + 1;
            while(s[j] == 'L' && j < n){
                sumL++;
                j++;
            }
            
            //Rのところに居る人の数
            ans[i] = sumR / 2 + sumL / 2 + sumR % 2;
            ans[i+1] = sumR / 2 + sumL / 2 + sumL % 2;
            
            // cout << sumL << endl;
            // rep(i,n){
            //     cout << ans[i] << ' ';
            // }
            // cout << endl;
        }
    }
    
    rep(i,n){
        cout << ans[i] << ' ';
    }
    
    return 0;
}

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

#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

int main() {

  string s;
  cin >> s;
  int n = s.length();
  vector<int> ans(n);

  for (int i = 0; i < 2; i++) {
    {//solve R
      //RRRR_ _ _RRR_ _
      int cnt = 0;
      for (int j = 0; j < n; j++) {
        if (s[j] == 'R') {
          cnt++;
        } else {
          ans[j] += cnt/2;
          ans[j-1] += (cnt+1)/2;
          cnt = 0;
        }
      }
    }
    reverse(ans.begin(), ans.end());
    reverse(s.begin(), s.end());
    for (int j = 0; j < n; j++) {
      //cout << ans[j] << " ";
      if (s[j] == 'L') {
        s[j] = 'R';
      } else {
        s[j] = 'L';
      }
    }
    //cout << endl;
  }

  for (int i = 0; i < n; i++) {
    cout << ans[i] << (i==n-1?'\n':' ');
  }

  return 0;
}

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

//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int int main() {
    int n;
    string s;
    n = s.size();
    VI ans(n);
    REP(i,2){
        {
            int cnt = 0;
            REP(i,n){
                if (s[i] == 'R') cnt++;
                else {
                    ans[i] += cnt/2;
                    ans[i-1] += (cnt+1)/2;
                    cnt =0;
                }
            }
        }
        reverse(ALL(ans));
        reverse(ALL(s));
        REP(i,n){
            if (s[i]=='L') s[i] = 'R';
            else s[i] = 'L';
        }
    }
    REP(i,n){
        cout << ans[i] << endl;
    }
    return 0;
}

Compiler output:
a.cc:72:1: error: two or more data types in declaration of 'main'
   72 | int int main() {
      | ^~~
Language: C++

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

/* #pragma */
/*
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
*/

/*alias*/
#define F first
#define S second

#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
#define itn int

/*template*/
template<class T>inline bool amax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>inline bool amin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }

/* func */
int GCD(int a,int b){return b?GCD(b,a%b):a;}
long long GCD(long long a, long long b){return b ? GCD(b, a%b) : a;}
int LCM(int a, int b){return a * b / GCD(a, b);}
long long LCM(long long a, long long b){return a * b / GCD(a, b);}

/*struct*/
struct aaa {
	aaa() {
		cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20);
	};
}aaaaaaa;

/* const */
const int INF = 1001001001;
const long long LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7; //10^9
const double EPS = 1e-9;
const int dx[] = { 1, 1, 0, -1, -1, -1, 0, 1 }, dy[] = { 0, 1, 1, 1, 0, -1, -1, -1 };
//const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
//Counterclockwise from the 6o'clock direction
//Take the x-axis downward and the y-axis right

//#define int long long

//g++ -std=c++14 -Wall --pedantic-errors -o template template.cpp
//g++ -std=c++14 -Wall --pedantic-errors template.cpp
//chcp 65001

/*global*/




signed main()
{
	string s; cin >> s;
	int n = s.size();

	vector<int> a(n, 0);
	
	for(int i = 0; i < n; ++i){
		int start = i;
		while(i+1 < n && s[i] == s[i+1]){
			i++;
		}
		int cnt = i - start + 1;
		if(s[i] == "R"){
			// R R R L L 
			// o e o e o    odd even
			// 1 2 3        cnt
			//     2 1      R distribution  (answer)
			//L = cnt/2 == 1, R = (cnt+1)/2 == 2
			a[i] += (cnt+1)/2;
			a[i+1] += cnt/2;
		}
		else if(s[i] == "L"){
			//R L L L R L
			//o e o e o e
			//  1 2 3
			//1 2
			//
			a[start] += (cnt+1)/2;
			a[start-1] += cnt/2;
		}
	}

	for (size_t i = 0; i < n; i++)
	{
		cout << a[i] << " ";
	}
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:73:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   73 |                 if(s[i] == "R"){
a.cc:82:30: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   82 |                 else if(s[i] == "L"){
Language: C++

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

/* #pragma */
/*
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
*/

/*alias*/
#define F first
#define S second

#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
#define itn int

/*template*/
template<class T>inline bool amax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>inline bool amin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }

/* func */
int GCD(int a,int b){return b?GCD(b,a%b):a;}
long long GCD(long long a, long long b){return b ? GCD(b, a%b) : a;}
int LCM(int a, int b){return a * b / GCD(a, b);}
long long LCM(long long a, long long b){return a * b / GCD(a, b);}

/*struct*/
struct aaa {
	aaa() {
		cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20);
	};
}aaaaaaa;

/* const */
const int INF = 1001001001;
const long long LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7; //10^9
const double EPS = 1e-9;
const int dx[] = { 1, 1, 0, -1, -1, -1, 0, 1 }, dy[] = { 0, 1, 1, 1, 0, -1, -1, -1 };
//const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
//Counterclockwise from the 6o'clock direction
//Take the x-axis downward and the y-axis right

//#define int long long

//g++ -std=c++14 -Wall --pedantic-errors -o template template.cpp
//g++ -std=c++14 -Wall --pedantic-errors template.cpp
//chcp 65001

/*global*/




signed main()
{
	string s; cin >> s;
	int n = s.size();

	vector<int> a(n, 0);
	
	for(int i = 0; i < n; ++i){
		int start = i;
		while(i+1 < n && s[i] == s[i+1]){
			i++;
		}
		int cnt = i - le + 1;
		if(s[i] == "R"){
			// R R R L L 
			// o e o e o    odd even
			// 1 2 3        cnt
			//     2 1      R distribution  (answer)
			//L = cnt/2 == 1, R = (cnt+1)/2 == 2
			a[i] += (cnt+1)/2;
			a[i+1] += len/2;
		}
		else if(s[i] == "L"){
			//R L L L R L
			//o e o e o e
			//  1 2 3
			//1 2
			//
			a[start] += (cnt+1)/2;
			a[start-1] += cnt/2;
		}
	}

	for (size_t i = 0; i < n; i++)
	{
		cout << ans[i] << " ";
	}
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:72:31: error: 'le' was not declared in this scope
   72 |                 int cnt = i - le + 1;
      |                               ^~
a.cc:73:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   73 |                 if(s[i] == "R"){
a.cc:80:35: error: 'len' was not declared in this scope
   80 |                         a[i+1] += len/2;
      |                                   ^~~
a.cc:82:30: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   82 |                 else if(s[i] == "L"){
a.cc:95:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   95 |                 cout << ans[i] << " ";
      |                         ^~~
      |                         abs
Language: C++

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

int main(){
	string RL;
	cin >> RL;
	int N = RL.size();
	vector<int> memo(N, 0);
	
	int cntR = 1, cntL = 1;
	
	for(int i = 1; i < N; i++){
		//think about R
		if(S.at(i) == 'R'){
			cntR++;
		} else {
			int chilR = cntR / 2;
			if(cntR % 2 == 0){
				memo.at(i) += chilR;
				memo.at(i - 1) += chilR;
			} else {
				memo.at(i) += (cntR - chilR);
				memo.at(i - 1) += chilR;
			}
			cntR = 0;
		}
		//think about L
		if(S.at(N - i) == 'L'){
			cntL++;
		} else {
			//連続Lの偶奇で場合分け
			int chilL = cntL / 2;
			if(cntL % 2 == 0){
				memo.at(N - i) += chilL;
				memo.at(N - i + 1) += chilL;
			} else {
				memo.at(N - i) += chilL;
				memo.at(N - i + 1) += (cntR - chilL);
			}
			cntL = 0;
		}
	}
	
	for(int i = 0; i < N; i++) cout << memo.at(i) << " ";
	cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:20: error: 'S' was not declared in this scope
   14 |                 if(S.at(i) == 'R'){
      |                    ^
a.cc:28:20: error: 'S' was not declared in this scope
   28 |                 if(S.at(N - i) == 'L'){
      |                    ^
Language: C++

s = gets.chomp
children = Array.new(s.size) { 0 }

s.size.times do |i|
  cnt = 0
  next_index = i

  loop do
    prev_index = next_index
    next_index = s[prev_index] == 'R' ? prev_index + 1 : prev_index - 1

    next cnt += 1 unless s[prev_index] != s[next_index]

    last_index = cnt % 2 == 0 ? prev_index : next_index
    children[last_index] += 1

    break
  end
end

puts children.join(' ')

Compiler output:
a.cc:1:1: error: 's' does not name a type
    1 | s = gets.chomp
      | ^
a.cc:4:1: error: 's' does not name a type
    4 | s.size.times do |i|
      | ^
Language: C++

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

int main()
{
    int N, i = 0;
    cin >> N;
    vector<char> S(N);
    vector<int> C(N);
    while (i < N)
    {
        cin >> S.at(i);
        C.at(i) = 1;
        i++;
    }

    int s = 0;
    for (int t = 0; t < pow(10, 100); t++)
    {
        while (s < N)
        {
            C.at(i) -= 1;
            if (S.at(i) == 'L')
            {
                C.at(i - 1) += 1;
            }
            else
            {
                C.at(i + 1) += 1;
            }
        }
    }

    int x = 0;
    while (x < N)
    {
        cout << C(x);
        x++;
    }
    cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:18: error: no match for call to '(std::vector<int>) (int&)'
   37 |         cout << C(x);
      |                 ~^~~
Language: C++

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

int main()
{
    int N, i = 0;
    cin >> N;
    vector<char> S(N);
    vector<int> C(N);
    while (i < N)
    {
        cin >> S.at(i);
        C.at(i) = 1;
        i++;
    }

    int s = 0;
    for (int t = 0; t < pow(10, 100); t++)
    {
        while (s < N)
        {
            C.at(i) -= 1;
            if (S.at(i) == 'L')
            {
                C.at(i - 1) += 1;
            }
            else
            {
                C.at(i + 1) += 1;
            }
        }
    }

    int x = 0;
    while (x < N)
    {
        cout << C(i);
        x++;
    }
    cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:18: error: no match for call to '(std::vector<int>) (int&)'
   37 |         cout << C(i);
      |                 ~^~~
Language: C++

#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string.>
using namespace std;
int x[100000 + 10];
int ans[100000 + 10];
int pos;
int find(int i)
{
    int ans = 0;
    int l = 0, r = pos - 1;
    while (l <= r)
    {
        int mid = (l + r) >> 1;
        if (x[mid] < i)
        {
            ans = mid;
            l = mid + 1;
        }
        else
        {
            r = mid - 1;
        }
    }
    return ans;
}
int main()
{
    string a;
    cin >> a;
    pos = 0;
    for (int i = 0; i < a.size(); i++)
    {
        if (a[i] == 'R' && a[i + 1] == 'L')
        {
            ans[i] = 1;
            ans[i + 1] = 1;
            x[pos++] = i;
            x[pos++] = i + 1;
        }
    }

    for (int i = 0; i < a.size(); i++)
    {
        if (a[i] == 'R' && a[i + 1] == 'R' && i + 1 < a.size())
        {
            int h = lower_bound(x, x + pos, i) - x;
            h = x[h];
            if ((h - i) % 2)
                ans[h + 1]++;
            else
                ans[h]++;
        }
        if (a[i] == 'L' && a[i - 1] == 'L')
        {
            int h = find(i);
            h = x[h];
            if ((i - h) % 2)
                ans[h - 1]++;
            else
                ans[h]++;
        }
    }
    for (int i = 0; i < a.size(); i++)
        cout << ans[i] << " ";
    return 0;
}

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

#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);++i)
#define ALL(v)   (v).begin(),(v).end()
#define P(s)     cout<<(s)<<endl
#define vi   vector<int>
#define vvi  vector<vi >
#define vvvi vector<vvi >
#define pii  pair<int,int>
#define INF  (int)1e9
#define MOD  (int)1e9+7
typedef long long llong;
using namespace std;

int main(){
	string s;
	cin>>s;
	
	int n=s.size();
	
	vi a(n,0);//ans.
	bool jud=false;//RLの区切りを発見.
	int p;//RLの区切りのポイント.
	vi cnt(2,0);
	REP(i,n){
		if(jud){
			if(s[i]=='R'){
				a[p-1]=cnt[(p-1)%2];
				a[P]=cnt[p%2];
				jud=false;
				fill(ALL(cnt),0);
				cnt[i%2]++;
			}else{
				cnt[i%2]++;
			}
		}else{
			if(s[i]=='R'){
				cnt[i%2]++;
			}else{
				jud=true;
				p=i;
				cnt[i%2]++;
			}
		}
	}
	
	REP(i,n) P(a[i]);
}//解説参考.

Compiler output:
a.cc: In function 'int main()':
a.cc:28:35: error: 'P' was not declared in this scope
   28 |                                 a[P]=cnt[p%2];
      |                                   ^
Language: C++

#include <iostream>
#include <string>
#include <cstring>
using namespace std;

int main()
{
  string s;
  cin>>s;
  int n =  s.length();
  int pre[n];
  int suff[n];
  int answer[n];
  memset(answer,0,sizeof(answer));
  pre[0]=0;
  suff[n-1]=0;
  for(int i=1;i<n;i++)
  {
    if(s[i-1]=='R')
      pre[i]=pre[i-1]+1;
    else
      pre[i]=0;
  }
  for(int i=n-2;i>=0;i--)
  {
    if(s[i+1]=='L')
      suff[i]=suff[i-1]+1;
    else
      suff[i]=0;
  }
  for(int i=1;i<n;i++)
  {
    if(s[i-1]=='R'&&s[i]=='L')
    {
      answer[i-1]=suff[i-1]/2+pre[i-1]/2;
      answer[i]=suff[i]/2+pre[i]/2;
    }
  }
  for(int i=0;i<n;i++)
    cout<<answer[i]<<" ";

Compiler output:
a.cc: In function 'int main()':
a.cc:40:26: error: expected '}' at end of input
   40 |     cout<<answer[i]<<" ";
      |                          ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
  string s;
  cin>>s;
  int n =  s.length();
  int pre[n];
  int suff[n];
  int answer[n];
  memset(answer,0,sizeof(answer));
  pre[0]=0;
  suff[n-1]=0;
  for(int i=1;i<n;i++)
  {
    if(s[i-1]=='R')
      pre[i]=pre[i-1]+1;
    else
      pre[i]=0;
  }
  for(int i=n-2;i>=0;i--)
  {
    if(s[i+1]=='L')
      suff[i]=suff[i-1]+1;
    else
      suff[i]=0;
  }
  for(int i=1;i<n;i++)
  {
    if(s[i-1]=='R'&&s[i]=='L')
    {
      answer[i-1]=suff[i-1]/2+pre[i-1]/2;
      answer[i]=suff[i]/2+pre[i]/2;
    }
  }
  for(int i=0;i<n;i++)
    cout<<answer[i]<<" ";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: 'memset' was not declared in this scope
   14 |   memset(answer,0,sizeof(answer));
      |   ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
  string s;
  cin>>s;
  int n =  s.length();
  int pre[n];
  int suff[n];
  int answer[n];
  memset(answer,0,sizeof(answer));
  pre[0]=0;
  suff[n-1]=0;
  for(int i=1;i<n;i++)
  {
    if(s[i-1]=='R')
      pre[i]=pre[i-1]+1;
    else
      pre[i]=0;
  }
  for(int i=n-2;i>=0;i--)
  {
    if(s[i+1]=='L')
      suff[i]=suff[i-1]+1;
    else
      suff[i]=0;
  }
  for(int i=1;i<n;i++)
  {
    if(s[i-1]=='R'&&s[i]=='L')
    {
      answer[i-1]=suff[i-1]/2+pre[i-1]/2;
      answer[i]=suff[i]/2+pre[i]/2;
    }
  }
  for(int i=0;i<n;i++)
    cout<<answer[i]<<" ";

Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: 'memset' was not declared in this scope
   14 |   memset(answer,0,sizeof(answer));
      |   ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
a.cc:40:26: error: expected '}' at end of input
   40 |     cout<<answer[i]<<" ";
      |                          ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){return b!=0?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}

int main(){
    string s;
    cin>>s;
    ll r=0,l=0,n=s.size();
    s+='R';
    vector<ll> v(n,0);
    for(ll i=0;i<s.size();i++){
        if(s[i]=='L') l++;
        if(s[i]=='R'){
            if(l==0) r++;
            else{
                if((l+r)%2==0) v[i-l-1]=v[i-l]=(l+r)/2;
                else{
                    if((r<l && l%2==0)||(r>l && r%2!=0)){
                            v[i-l-1]=(l+r)/2;
                            v[i-l]=(l+r)/2+1;
                        }else{
                            v[i-l-1]=(l+r)/2+1;
                            v[i-l]=(l+r)/2;
                        }
                    }
                }
                r=1;
                l=0;
            }
        }
    }
    for(ll i=0;i<n;i++){
        cout<<v[i];
        if(i!=n-1) cout<<' ';
    }
    cout<<endl;
    return 0;
}

Compiler output:
a.cc:35:5: error: expected unqualified-id before 'for'
   35 |     for(ll i=0;i<n;i++){
      |     ^~~
a.cc:35:16: error: 'i' does not name a type
   35 |     for(ll i=0;i<n;i++){
      |                ^
a.cc:35:20: error: 'i' does not name a type
   35 |     for(ll i=0;i<n;i++){
      |                    ^
a.cc:39:5: error: 'cout' does not name a type
   39 |     cout<<endl;
      |     ^~~~
a.cc:40:5: error: expected unqualified-id before 'return'
   40 |     return 0;
      |     ^~~~~~
a.cc:41:1: error: expected declaration before '}' token
   41 | }
      | ^
Language: C++

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<string>
using namespace std;


int main(){
	string s;
	cin >> s;
	int R_count = 0;
	int L_count = 0;
	int count[s.size()] = {};
	for(int i = 0;i < s.size();i++){
		R_count++;
		if(s[i+1]  == 'L'){
			count[i] += R_count-(R_count/2);
			count[i+1] += R_count/2;
			R_count = 0;
			for(int j = 1;j+i < s.size();j++){
				if(s[i+j] == 'L'){
					if(i+j = s.size()-1){
						count[i] += L_count/2;
						count[i+1] += L_count-L_count/2;
						i = i+j;
						break;
					}else{
						L_count++;
					}
				}else{
					count[i] += L_count/2;
					count[i+1] += L_count-L_count/2;
					i = i+j-1;
					L_count = 0;
					break;
				}
			}
		}
	}
	for(int i = 0;i < s.size();i++){
		cout << count[i] << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:45: error: lvalue required as left operand of assignment
   23 |                                         if(i+j = s.size()-1){
      |                                            ~^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int i,n,count;
    count=0;
    string s;
    cin >> s;
    n=s.size();
    vector<int> next(n);
    for(i=0;i<n;i++){
        if(s[i]=='R'){
            next[i]=i+1;
        }
            else next[i]=i-1;
        }
    }
    for(int t=0;t<100;t++){
        vector<int> nn(n);
        for(i=0;i<n;i++){
            nn[i]=next[next[i]];
        }
    nn.swap(next);
    }
    vector<int> ans(n);
    for(int i = 0;i<n;i++){
        ans[next[i]]++;
    }
    for(int i=0;i<n;i++){
        cout<<ans[i]<<" ";
    }
    return 0;


}

Compiler output:
a.cc:18:5: error: expected unqualified-id before 'for'
   18 |     for(int t=0;t<100;t++){
      |     ^~~
a.cc:18:17: error: 't' does not name a type; did you mean 'tm'?
   18 |     for(int t=0;t<100;t++){
      |                 ^
      |                 tm
a.cc:18:23: error: 't' does not name a type; did you mean 'tm'?
   18 |     for(int t=0;t<100;t++){
      |                       ^
      |                       tm
a.cc:25:21: error: 'n' was not declared in this scope; did you mean 'yn'?
   25 |     vector<int> ans(n);
      |                     ^
      |                     yn
a.cc:26:5: error: expected unqualified-id before 'for'
   26 |     for(int i = 0;i<n;i++){
      |     ^~~
a.cc:26:19: error: 'i' does not name a type
   26 |     for(int i = 0;i<n;i++){
      |                   ^
a.cc:26:23: error: 'i' does not name a type
   26 |     for(int i = 0;i<n;i++){
      |                       ^
a.cc:29:5: error: expected unqualified-id before 'for'
   29 |     for(int i=0;i<n;i++){
      |     ^~~
a.cc:29:17: error: 'i' does not name a type
   29 |     for(int i=0;i<n;i++){
      |                 ^
a.cc:29:21: error: 'i' does not name a type
   29 |     for(int i=0;i<n;i++){
      |                     ^
a.cc:32:5: error: expected unqualified-id before 'return'
   32 |     return 0;
      |     ^~~~~~
a.cc:35:1: error: expected declaration before '}' token
   35 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int i,n,count;
    count=0;
    string s;
    cin >> s;
    n=s.size();
    vector<int> next(n);
    for(i=0;i<n;i++){
        if(s[i]=='R'){
            next[i]=i+1;
            else next[i]=i-1;
        }
    }
    for(int t=0;t<100;t++){
        vector<int> nn(n);
        for(i=0;i<n;i++){
            nn[i]=next[next[i]];
        }
    nn.swap(next);
    }
    vector<int> ans(n);
    for(int i = 0;i<n;i++){
        ans[next[i]]++;
    }
    for(int i=0;i<n;i++){
        cout<<ans[i]<<" ";
    }
    return 0;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: expected '}' before 'else'
   14 |             else next[i]=i-1;
      |             ^~~~
a.cc:12:22: note: to match this '{'
   12 |         if(s[i]=='R'){
      |                      ^
a.cc: At global scope:
a.cc:17:5: error: expected unqualified-id before 'for'
   17 |     for(int t=0;t<100;t++){
      |     ^~~
a.cc:17:17: error: 't' does not name a type; did you mean 'tm'?
   17 |     for(int t=0;t<100;t++){
      |                 ^
      |                 tm
a.cc:17:23: error: 't' does not name a type; did you mean 'tm'?
   17 |     for(int t=0;t<100;t++){
      |                       ^
      |                       tm
a.cc:24:21: error: 'n' was not declared in this scope; did you mean 'yn'?
   24 |     vector<int> ans(n);
      |                     ^
      |                     yn
a.cc:25:5: error: expected unqualified-id before 'for'
   25 |     for(int i = 0;i<n;i++){
      |     ^~~
a.cc:25:19: error: 'i' does not name a type
   25 |     for(int i = 0;i<n;i++){
      |                   ^
a.cc:25:23: error: 'i' does not name a type
   25 |     for(int i = 0;i<n;i++){
      |                       ^
a.cc:28:5: error: expected unqualified-id before 'for'
   28 |     for(int i=0;i<n;i++){
      |     ^~~
a.cc:28:17: error: 'i' does not name a type
   28 |     for(int i=0;i<n;i++){
      |                 ^
a.cc:28:21: error: 'i' does not name a type
   28 |     for(int i=0;i<n;i++){
      |                     ^
a.cc:31:5: error: expected unqualified-id before 'return'
   31 |     return 0;
      |     ^~~~~~
a.cc:34:1: error: expected declaration before '}' token
   34 | }
      | ^
Language: C++

#include<iostream>
#include<sstream>

using namespace std;
int main()
{
    // 入力
    string S;
    cin >> S;
    int size_s = S.size();

    int position[size_s];
    for (int i = 0; i < size_s; i++) {
        position[i] = 1;
    }

    int itr = size_s % 2 == 1 ? size_s + 1 : size_s;
    for (int i = 0; i < itr; i++) {
        int new_position[size_s];
        for (int j = 0; j < size_s; j++) {
            new_position[j] = 0;
        }

        for (int j = 0; j < size_s; j++) {
            if (S[j] == 'L') {
                new_position[j - 1] += position[j];
            } else {
                new_position[j + 1] += position[j];
            }
        }

        memcpy(position, new_position, sizeof(new_position));
    }

    // 出力
    for (int i = 0; i < size_s; i++) {
        printf("%d ", position[i]);
    }
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:32:9: error: 'memcpy' was not declared in this scope
   32 |         memcpy(position, new_position, sizeof(new_position));
      |         ^~~~~~
a.cc:3:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<sstream>
  +++ |+#include <cstring>
    3 |
Language: C++

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

int main(){
    int r = 1, l = 1, mem;
    string s;
    cin >> s;
    int n = s.length();
    int count[n] = {};
    for(i=1; i<n; i++){
        if(s[i] == s[i-1]){
            if(s[i] == 'R') r++;
            else l++;
        }else{
            if(s[i] == 'L'){
                count[i] += r/2;
                count[i-1] += (r+1)/2; 
                l = 1;
                mem = i;
            }else{
                count[mem] += (l+1)/2;
                count[mem-1] += l/2;
                r = 1;
            }
        }
    }
    for(i=0; i<n; i++){
        cout << count[i] << ' ';
    }
    return 0;
}

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

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
const long long mod=1e9+7; //10^9+7

int main() {
    string ss;
    cin >> ss;
    int s[100002];
    int g[100002];

    // R = 0   L = 1

    int n = (int)ss.length();
    for(int i=0; i<n;i++){
        if(ss[i]=='R') s[i] = 0;
        else s[i] = 1;
        g[i]=0;
    }
    s[n] = 0;

    int start = 0;
    int point = 0;
    for(int i=0; i<n;i++){
        if(s[i]=0&&s[i+1]=1) point = i;
        else if(s[i]=1&&s[i]=0){
            int end = i;
            for(int j=start; j<=endl; j++){
                int dis = abs(point-j);
                if(dis%2 == 0) g[point]++;
                else g[point+1]++;
            }
            start = i+1;
        }
    }

    for(int i=0; i<n;i++){
        cout << g[i] << " ";
    }
    cout << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:18: error: lvalue required as left operand of assignment
   26 |         if(s[i]=0&&s[i+1]=1) point = i;
      |                 ~^~~~~~~~
a.cc:27:23: error: lvalue required as left operand of assignment
   27 |         else if(s[i]=1&&s[i]=0){
      |                      ~^~~~~~
a.cc:29:31: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<='
   29 |             for(int j=start; j<=endl; j++){
      |                              ~^~~~~~
Language: C

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

int 
main(){
	
	int N,i;
	scanf("%d",&N);
	char S[100010];
	int dp[100010][2];
	scanf("%s",&S);
	
	N=strlen(S);
	//printf("%d\n",N);
	for(i=0;i<N;i++){
		dp[i][0]=1;dp[i][1]=1;
	}
	//	for(i=0;i<N;i++){
	//	if(i<N-1)printf("%d ",dp[i][0]);
	//	else printf("%d\n",dp[i][0]);
	//}
	int j,k;
	for(k=0;k<10000;k++){
		for(j=0;j<10;j++){
			
			for(i=0;i<N;i++){
				
				if(i==0){
					// 0�Ȃ�� �E�ɍs��
					//if(dp[i][0]){
						dp[0][1]-=dp[i][0];
						dp[1][1]+=dp[0][0]; 
					//}
				}
				else if(i==N-1){
					//if(dp[i][0]){
						dp[i][1]-=dp[i][0];
						dp[i-1][1]+=dp[i][0];
					//}
				}
				else {
					if(S[i]=='L'){
						dp[i-1][1] +=dp[i][0];
						dp[i][1] -= dp[i][0];
					}
					else if(S[i]=='R'){
						dp[i+1][1] +=dp[i][0];
						dp[i][1] -= dp[i][0];
					}
				}
				
			}
			for(i=0;i<N;i++)dp[i][0]=dp[i][1];
			
		//for(i=0;i<N;i++){
		//if(i<N-1)printf("%d ",dp[i][0]);
		//else printf("%d\n",dp[i][0]);
	    //}
		}
		
	//}
	for(i=0;i<N;i++){
		if(i<N-1)printf("%d ",dp[i][0]);
		else printf("%d\n",dp[i][0]);
	}
 return 0;
}


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

import java.util.Scanner;
import java.util.HashMap;
import java.util.List;
import java.util.Arrays;
import java.util.ArrayList;
import java.lang.Math;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int n = s.length();
        int[] ans = new int[n];
        for (int i = 0; i < n; i++) {
            boolean flag = true;
            if (s.charAt(i) == 'R') {
                if (1000 <= n-1-i) {
                    for (int j = i+1; j <= i+1000; j++) {
                        if (s.charAt(j) == 'L') {
                            if ((j-i) % 2 == 0) {
                                ans[j]++;
                            } else {
                                ans[j-1]++;
                            }
                            flag=false;
                            break;
                        }
                    }
                    if (flag) ans[i+1000+1]++;
                } else {
                    for (int j = i+1; j < n; j++) {
                        if (s.charAt(j) == 'L') {
                            if ((j-i) % 2 == 0) {
                                ans[j]++;
                            } else {
                                ans[j-1]++;
                            }
                            break;
                        }
                    }
                }
            } else {
                if (1000 <= i) {
                    for (int j = i-1; j >= i-1000; j--) {
                        if (s.charAt(j) == 'R') {
                            if ((i-j) % 2 == 0) {
                                ans[j]++;
                            } else {
                                ans[j+1]++;
                            }
                            flag=false;
                            break;
                        }
                    }
                    if (flag) ans[i-1000-1]++;
                } else {
                    for (int j = i-1; j >= 0; j--) {
                        if (s.charAt(j) == 'R') {
                            if ((i-j) % 2 == 0) {
                                ans[j]++;
                            } else {
                                ans[j+1]++;
                            }
                            break;
                        }
                    }
                }
            }
        }
        for (int i = 0; i < n-1; i++) {
            System.out.print(ans[i] + " ");
        }
        System.out.println(ans[n-1]);

}


Compiler output:
Main.java:76: error: reached end of file while parsing
}
 ^
1 error