akhauriyash/Code-Regression huggingface dataset:
def main():
    import os

    INF = 10 ** 9 + 10

    D = int(input())
    *C, = map(int, input().split())
    # C[type]
    # sum(ci*(d-last(d,i) for ci in C)だけ下がる
    S = [[int(x) for x in input().split()] for _ in range(D)]
    # S[day][type]:=happiness

    last = [-1] * 26

    def diff(d, t):
        ret = S[d][t]
        ret -= sum(ci * (d + 1 - last[i]) for i, ci in enumerate(C) if i != t)  # d+1にした(dが計算としては正しい
        return ret

    T = []
    score = 0
    for d in range(D):
        delta = -INF
        take_t = -1
        for t_ in range(26):
            buf = diff(d, t_)
            if delta < buf:
                delta = buf
                take_t = t_
            elif delta == buf and C[t_] > C[take_t]:
                delta = buf
                take_t = t_

        last[take_t] = d
        score += buf
        T.append(take_t + 1)
    print(*T, sep='\n')
    # print(os.path.join(os.path.dirname(__file__), 'output_file.txt'))
    # with open(file=os.path.join(os.path.dirname(__file__), 'output_file.txt'), mode='w', encoding='utf-8') as f:
    #     for t in map(str, T):
    #         f.write(t)
    #         f.write('\n')

    # print(score)


if __name__ == '__main__':
    main()


Measured memory_bytes: 74576
#include <bits/stdc++.h>

using namespace std;

int n,m,ans;
unordered_set<int>In[100010];
vector<int>Out[100010];
queue<int>que;
int f[100010];

int main(){
	scanf("%d%d",&n,&m);
	for(int i=1;i<=m;i++){
		int a,b;
		scanf("%d%d",&a,&b);
		In[b].insert(a);
		Out[a].push_back(b);
	}
	for(int i=1;i<=n;i++)
		if(In[i].size()==0)
			que.push(i);
	while(!que.empty()){
		int x=que.front();
		que.pop();

		for(auto i:Out[x]){
			ans=max(ans,f[i]=max(f[i],f[x]+1));
			In[i].erase(x);
			if(In[i].size()==0)
				que.push(i);
		}
	}
	printf("%d\n",ans);

	return 0;
}

Measured memory_bytes: 17792
#include <bits/stdc++.h>
#define forn(i, n) for(int i = 0; i < (int)(n); i++)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
using namespace std;

const int MAXN = 3000;
bool canW[MAXN + 1], canS[MAXN + 1];

int main() {
    //ios_base::sync_with_stdio(false);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    int a, b, c, d, e, f;
    cin >> a >> b >> c >> d >> e >> f;
    int mx = 0;
    for(int i = 0; i < MAXN; i++) {
        for(int j = 0; 100 * i * a + 100 * j * b <= f; j++) {
            mx = max(mx, 100 * i * a + 100 * j * b);
            canW[100 * i * a + 100 * j * b] = true;
        }
    }
    for(int i = 0; i < MAXN; i++) {
        for(int j = 0; i * c + j * d <= f; j++) {
            canS[i * c + j * d] = true;
        }
    }
    ld ans = 0;
    int A = 0, B = 0;
    for(int i = 0; i <= f; i += 100) {
        for(int j = 0; i + j <= f; j++) {
            if (!canW[i] || !canS[j])
                continue;
            if (i / 100 >= ((j + e - 1) / e)) {
                if (ans < 100.0 * j / (i + j)) {
                    ans = 100.0 * j / (i + j);
                    A = i, B = j;
                }
            }
        }
    }
    if (ans == 0) {
        cout << mx << " " << 0 << "\n";
    } else
        cout << A + B << " " << B << '\n';
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// order_of_key (val): returns the no. of values less than val
// find_by_order (k): returns the kth largest element.(0-based)

#define ll long long int
#define ff first
#define ss second
#define pb push_back
#define pi pair<ll,ll>
#define all(X) X.begin(),X.end()

// for pair comparison function(ascending order) use return (i1.ff < i2.ff);

/* string operations :
   str.substr (x,y) : returns a substring str[x],str[x+1],...str[x+y-1]
   str.substr (x) : returns a substring str[x],... end of string
   str.find(qtr) : returns the first occurenece of qtr in str */

const int M = (1<<20)+5;
const int md = 1e9+7;

ll pwr(ll a,ll n,ll m)
{
	ll p=1;
	while(n>0)
	{
		if(n%2==1)
			p=(p*a)%m;
		a=(a*a)%m;
		n=n/2;
	}
	return p;
}

vector<ll> adj[M];
ll sz[M],dp[M],f[M],ans[M];

void dfs1(ll u,ll p)
{
	dp[u] = 1;
	for(auto v:adj[u])
	{
		if(v == p)
			continue;
		dfs1(v,u);
		sz[u] += sz[v];
		dp[u] = 1ll*dp[u]*dp[v]%md;
		dp[u] = 1ll*dp[u]*pwr(f[sz[v]],md-2,md)%md;
	}
	dp[u] = 1ll*dp[u]*f[sz[u]]%md;
	sz[u] += 1;
	// cout << u << " " << dp[u] << " " << sz[u] << "\n";
}

void dfs2(ll u,ll p)
{
	ll td = dp[u],ts = sz[u];
	if(u != 1)
	{
		sz[u] = 0;
		dp[u] = 1;
		for(auto v:adj[u])
		{
			sz[u] += sz[v];
			dp[u] = 1ll*dp[u]*dp[v]%md;
			dp[u] = 1ll*dp[u]*pwr(f[sz[v]],md-2,md)%md;
		}
		dp[u] = 1ll*dp[u]*f[sz[u]]%md;
		sz[u] += 1;
	}

	ans[u] = dp[u];
	for(auto v:adj[u])
	{
		if(v == p)
			continue;
		ll ld = dp[u],ls = sz[u];
		dp[u] = 1ll*dp[u]*f[sz[v]]%md;
		dp[u] = 1ll*dp[u]*pwr(dp[v],md-2,md)%md;
		dp[u] = 1ll*dp[u]*f[sz[u]-1-sz[v]]%md;
		dp[u] = 1ll*dp[u]*pwr(f[sz[u]-1],md-2,md)%md;
		sz[u] -= sz[v];
		// cout << "fake : " << u << " " << v << " " << dp[u] << " " << sz[u] << "\n";
		dfs2(v,u);
		dp[u] = ld;
		sz[u] = ls;
	}

	dp[u] = td;
	sz[u] = ts;
}

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

	ll n,i,u,v;

	cin >> n;

	f[0] = 1;
	for(i=1;i<=n;++i)
		f[i] = 1ll*f[i-1]*i%md;

	for(i=1;i<n;++i)
	{
		cin >> u >> v;
		adj[u].pb(v);
		adj[v].pb(u);
	}

	dfs1(1,0);
	dfs2(1,0);

	for(i=1;i<=n;++i)
		cout << ans[i] << "\n";

	return 0;
}

	

Measured memory_bytes: 42352
#include <iostream>

using namespace std;

int main(){
  string S;
  cin >> S;
  if(S[6] >= '5') cout << "TBD" << endl;
  else if(S[5] == '1' && S[6] == '0') cout << "TBD" << endl;
  else if(S[5] == '1' && S[6] == '1') cout << "TBD" << endl;
  else if(S[5] == '1' && S[6] == '2') cout << "TBD" << endl;
  else cout << "Heisei" << endl;
  return 0;
}


Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author amotoma3
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int[] a = in.nextIntArray(n);

            boolean pflg = false;
            boolean nflg = false;
            for (int i = 0; i < n; i++) {
                if (a[i] >= 0) pflg = true;
                if (a[i] <= 0) nflg = true;
            }

            int positive = 0;
            int negative = 0;
            for (int i = 0; i < n; i++) {
                if (a[i] > a[positive]) positive = i;
                if (a[i] < a[negative]) negative = i;
            }

            if (!pflg || -a[negative] > a[positive]) {
                out.println(2 * (n - 1));
                for (int i = 0; i < n; i++) {
                    if (i == negative) continue;
                    out.println((negative + 1) + " " + (i + 1));
                }
                for (int i = 0; i < n - 1; i++) {
                    out.println((n - i) + " " + (n - 1 - i));
                }
            } else {
                out.println(2 * (n - 1));
                for (int i = 0; i < n; i++) {
                    if (i == positive) continue;
                    out.println((positive + 1) + " " + (i + 1));
                }
                for (int i = 0; i < n - 1; i++) {
                    out.println((i + 1) + " " + (i + 2));
                }
            }
        }

    }

    static class InputReader {
        BufferedReader in;
        StringTokenizer tok;

        public String nextString() {
            while (!tok.hasMoreTokens()) {
                try {
                    tok = new StringTokenizer(in.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return tok.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextString());
        }

        public int[] nextIntArray(int n) {
            int[] res = new int[n];
            for (int i = 0; i < n; i++) {
                res[i] = nextInt();
            }
            return res;
        }

        public InputReader(InputStream inputStream) {
            in = new BufferedReader(new InputStreamReader(inputStream));
            tok = new StringTokenizer("");
        }

    }
}



Measured memory_bytes: 23380
package main

import "fmt"

func main() {
	// Code for A - Shiritori
	var A, B, C string
	fmt.Scanf("%s %s %s", &A, &B, &C)

	if A[len(A)-1] == B[0] && B[len(B)-1] == C[0] {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


Measured memory_bytes: 1832
#include <iostream>
#include <string>

using namespace std;

int main(){
  int S;
  string syuturyoku;
  cin >> S;
  int a=S/100;
  int b=S%100;
  if(a>0 && a<12){
    if(b>0 && b<=12){
      syuturyoku="AMBIGUOUS";
    }
    else{
      syuturyoku="MMYY";
    }
  }
  else{
    if(b>0 && b<=12){
      syuturyoku="YYMM";
    }
    else{
      syuturyoku="NA";
    }
  }
  cout << syuturyoku << endl;
  return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <map>
#include <string>
#include <vector>
#include <algorithm>
#include <chrono>

#define ll long long

// 2つの値の最大公約数を求める
int gcd(int a, int b) {
    if(b == 0) {
        return a;
    }
    return gcd(b, a % b);
}

// 3つの最大公約数を求める
int GCD(int a, int b, int c) {
    int tmp = gcd(a, b);
    return gcd(tmp, c);
}

int main()
{
    int K;
    std::cin >> K;

    ll sum = 0;
    
    for(int i=1; i <= K; i++) {
        for(int j=1; j <= K; j++) {
            for(int k = 1; k <= K; k++) {
                sum += GCD(i, j, k);
            }
        }
    }

    std::cout << sum << std::endl;
}

Measured memory_bytes: 3644
if __name__ == '__main__':
    n = int(input())
    aa = list(map(int, input().split()))
    bb = list(map(int, input().split()))
    minus = 0
    num_minus = 0
    plus = []
    for i, (a, b) in enumerate(zip(aa,bb)):
        judge = b-a
        if judge>0:
            minus+=judge
            num_minus += 1
        else:
            plus.append(-judge)
    if minus==0:
        print(0)
        exit()
    plus.sort(reverse=True)
    for i, num in enumerate(plus,1):
        minus-=num
        if minus<=0:
            print(i+num_minus)
            exit()
    print(-1)


Measured memory_bytes: 19068
#include <bits/stdc++.h>

using namespace std;

typedef unsigned long long ull;

bool check_primes[10000000];
map<ull,ull> fact_div;
set<ull> primes;

int sieve(ull n) {
    n++;
    for(ull i = 2; i <= n; i++) {
        if( i*i > n)
            break;
        if (!check_primes[i]){
            for(ull j = i; i*j <= n; j++){
                check_primes[i*j] = true;
            }

        }
    }
    for(ull i = 2; i <= n; i++)
        if (!check_primes[i]) {
            primes.insert(i);
            //cout << i << endl;
        }
    return 0;
}

int div(ull n){

    for(ull num : primes){
        while(n%num==0){
            fact_div[num]++;
            n/=num;
            //cout << num << ' ' << n <<' ' << fact_div[num] << endl;
        }
    }
    /*
    for(ull i =1;i*i<=n;){
        if(n%i==0){
            if(!check_primes[i]) {
                fact_div[i]++;
                n/=i;
            }

        }
        else i++;
    }*/
    return 0;
}
int main() {
    ull n, ans=1;
    const ull m = 1000000007;
    cin >> n;
    sieve(n);
    for(ull i = n; i > 0; i--){
        div(i);
    }

    for(auto num : fact_div){
        if(num.first!=1) {
            ans=(ans*(num.second+1))%m;
        }
        //cout << num.first << ' ' << num.second << ' ' << ans << endl;
    }

    cout << ans;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;

#define rep(i, n) rep2(i, 0, n)
#define rep2(i, m, n) for (ll i = m; i < (n); i++)

using ll = long long;
using pii = pair<int, int>;
using Vi = vector<int>;



  
int main() {
  string a,b,c;
  cin >>a>>b>>c;
  if(a[a.size()-1]==b[0]&&b[b.size()-1]==c[0]){
    cout << "YES" << endl;
  }
  else{
    cout << "NO" << endl;
  }
}
      
       



Measured memory_bytes: 3620
using System;
using System.Collections.Generic;
using System.Linq;
using static Atcoder;
using System.Threading.Tasks;
using System.ComponentModel;

public class Hello
{
    public static void Main()
    {
        int N = IntRead();
        int A = IntRead();
        Console.WriteLine(Math.Pow(N,2)-A);
    }
}

public class Atcoder
{
    static void Swap<T>(ref T a, ref T b)
    {
        var t = a;
        a = b;
        b = t;
    }
    public static long LCM(long a, long b)
    {
        long c = a * b;
        if (a < b) Swap(ref a, ref b);
        long d = a % b;
        while (d != 0)
        {
            a = b;
            b = d;
            d = a % b;
        }
        return c / b;
    }
    public static string StrReverce(string s)
    {
        return new string(s.Reverse().ToArray());
    }
    public static int IntRead()
    {
        return int.Parse(Console.ReadLine());
    }
    public static bool IsPrime(int n)
    {
        if (n < 2) return false;
        if (n == 2) return true;
        if (n % 2 == 0) return false;

        //double sqrtNum = Math.Sqrt(n);
        for (int i = 3; i < n; i += 2)
        {
            if (n % i == 0) return false;
        }
        return true;
    }
    public static string[] SpRead(char c)
    {
        return Console.ReadLine().Split(c);
    }
    public static int[] SpIntRead(char c)
    {
        return Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
    }
    public static string ToConvertBit(int N, int e)
    {
        string ret = "";
        int r = 0;
        while (N != 0)
        {
            r = N % e;
            ret += r.ToString();
            N -= r;
            N /= e;
        }
        ret = StrReverce(ret);
        return ret;
    }
}


Measured memory_bytes: 11092
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
int main(){
	cin>>n;
	int flag=0;
	for(int i=0;i<n;i++){
		int x; cin>>x;
		if(!(x&1)){
			if(x%3==0||x%5==0){
				if(flag==0) flag=1;
			} else flag=-1;
		}
	}
	if(flag!=-1){
		cout<<"APPROVED"<<endl;
	} else{
		cout<<"DENIED"<<endl;
	}
	
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>

using namespace std;

vector<int> g[100005];
int N, u, v;

vector<int> ret(100005);

void dfs(int now, int d, int par){
    ret[now] = d;
    for(auto next : g[now]){
        if(next == par) continue;
        dfs(next, d+1, now);
    }
}

vector<int> dist(int s){
    dfs(s, 0, -1);
    return ret;
}

int main(){
    cin >> N >> u >> v;

    for(int i=0; i<N-1; i++){
        int a, b;
        cin >> a >> b;
        a--; b--;
        g[a].push_back(b);
        g[b].push_back(a);
    }

    u--; v--;

    vector<int> td = dist(u);
    vector<int> ad = dist(v);

    int ans = 0;
    for(int i=0; i<N; i++){
        if(td[i] >= ad[i]) continue;
        ans = max(ans, ad[i]);
    }

    cout << ans-1 << endl;

    return 0;
}

Measured memory_bytes: 10752
n = int(input())
a = list(map(int,input().split()))
ar = list(reversed(a))
b = []
c = []

if len(a)%2 == 0:
    for i in range(len(a)//2):
        b.append(ar[i*2])
        c.append(a[i*2])
else:
    for i in range(-(-(len(a))//2)):
        if i == len(a)//2:
            b.append(ar[(i*2)])
        else:
            b.append(ar[i*2])
            c.append(a[(i*2)+1])

print(' '.join(map(str, b+c)))


Measured memory_bytes: 33296
#include <bits/stdc++.h>

using namespace std;

struct expand_type {
    template <typename... T>
    expand_type (T&&...) {}
};
template <typename... ArgTypes>
void print (ArgTypes... args) {
    expand_type {0, (cerr << args << ", ", 0)...};
    cerr << "\b\b \n";
}
#define printv(x) cerr << "["; for(auto i : (x)) cerr << i << ", "; cerr << "\b\b]\n";

typedef unsigned long long ull;
typedef long double ld;

int main () {
    std::ios::sync_with_stdio (false);
    cin.tie (nullptr);
    cout.tie (nullptr);
    int h1, s1, h2, s2;
    cin >> h1 >> s1 >> h2 >> s2;
    bool win = true;
    while (h1 > 0 && h2 > 0) {
        if (win) {
            h2 -= s1;
        } else {
            h1 -= s2;
        }
        win = !win;
    }
    if (!win) {
        puts ("Yes");
    } else {
        puts ("No");
    }
    return 0;
}


Measured memory_bytes: 3672
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <bitset>
#include <stack>
#include <set>
using namespace std;

typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P2;
const int inf=1000000000;

int main() {
	ll h,w;
	cin>>h>>w;
	ll t=w;
	if(h%3==0||w%3==0)t=0;
	t=min(t,h);
	t=min(t,max(max((h-h/3)*(w-w/2),w*(h/3)),(h-h/3)*(w/2))-min(min((h-h/3)*(w-w/2),w*(h/3)),(h-h/3)*(w/2)));
	t=min(t,max(max((h-h/3-1)*(w-w/2),w*(h/3+1)),(h-h/3-1)*(w/2))-min(min((h-h/3-1)*(w-w/2),w*(h/3+1)),(h-h/3-1)*(w/2)));
	t=min(t,max(max((h-h/3-2)*(w-w/2),w*(h/3+2)),(h-h/3-2)*(w/2))-min(min((h-h/3-2)*(w-w/2),w*(h/3+2)),(h-h/3-2)*(w/2)));
	t=min(t,max(max((w-w/3)*(h-h/2),h*(w/3)),(w-w/3)*(h/2))-min(min((w-w/3)*(h-h/2),h*(w/3)),(w-w/3)*(h/2)));
	t=min(t,max(max((w-w/3-1)*(h-h/2),h*(w/3+1)),(w-w/3-1)*(h/2))-min(min((w-w/3-1)*(h-h/2),h*(w/3+1)),(w-w/3-1)*(h/2)));
	t=min(t,max(max((w-w/3-2)*(h-h/2),h*(w/3+2)),(w-w/3-2)*(h/2))-min(min((w-w/3-2)*(h-h/2),h*(w/3+2)),(w-w/3-2)*(h/2)));
	cout<<t<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <functional>
#include <cassert>
#include <utility>
#include <stack>
#include <queue>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,n1,n2) for(int i=n1;i<n2;i++)
typedef long long ll;
typedef pair<int,int> Pii;
const int INF=(1<<30)-1;
const int MAX=310;
const int MOD=1000000007;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a, b)*b;}
int main(){
	int n,k;
	cin>>n;
	cin>>k;
	int a[n];
	int aa[n];
	ll sum[n];
	cin>>a[0];
	if(a[0]>0){
		aa[0]=a[0];
	}else{
		aa[0]=0;
	}
	ll asum[n];
	ll aasum[n];
	asum[0]=a[0];
	aasum[0]=aa[0];
	for(int i=1;i<n;i++){
		cin>>a[i];
		if(a[i]>0){
			aa[i]=a[i];
		}else{
			aa[i]=0;
		}
		asum[i]=asum[i-1]+a[i];
		aasum[i]=aasum[i-1]+aa[i];
	}
	ll max=max(aasum[n-1]-aasum[k-1]+asum[k-1],aasum[n-1]-aasum[k-1]);
	for(int i=1;i<n-k+1;i++){
		ll t=aasum[i+k-1]-aasum[i-1];
		ll s=asum[i+k-1]-asum[i-1];
		ll tm=aasum[n-1]-t+s;
		ll sm=aasum[n-1]-t;
		tm=max(tm,sm);
		max=max(max,tm);
	}
	cout<<max<<endl;
}

Measured memory_bytes: 2688
#include <bits/stdc++.h>
using namespace std;
int main(){
  string s,t,u;
  int n,m;
  cin>>s>>t;
  n = t.length();
  m=0;
  int l[1000];
  for (int j=0; j<1001; j++){
  l[j]=0;
    }
  for (int i=0; i<s.length()-n+1; i++){
   u=s.substr(i, n);
    for (int k=0; k<n; k++){
     if(u[k]-t[k]==0){
       l[i]=l[i]+1;
     }
    }
      if(l[i]>m){
      m=l[i];
      }
  }
  cout<<n-m<<endl;
  return 0;
}


Measured memory_bytes: 3612
#include<stdio.h>

int main(){

  int n,i,cnt;

  scanf("%d",&n);

  int a[20];
  i = 0;

  while(i < n){
     scanf("%d",&a[i]);
     i++;
  }

  cnt = 1;
  i = 1;

  int max = a[0];

  while(i < n){
    if(max <= a[i]){
      max = a[i];
      cnt++;
      i++;
    }else{
      i++;
    }
  }


  printf("%d\n",cnt);

  return 0;

}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;

#define for_(i,a,b) for(int i=a;i<b;++i)
#define allof(a) a.begin(),a.end()

typedef pair< int, int > pii;

int n, m, X[5050], Y[5050], X1[500050], X2[500050], Y1[500050], Y2[500050];

int compress(int *x) {
	vector< int > xs;
	
	for_(i,0,n) xs.push_back(x[i]);
	
	sort(allof(xs));
	xs.erase(unique(allof(xs)), xs.end());
	
	for_(i,0,n) x[i] = find(allof(xs), x[i]) - xs.begin();
	
	return xs.size();
}

int main() {
	cin >> n >> m;
	
	vector< pii > vpx, vpy;
	
	for_(i,0,n) {
		scanf("%d %d", &X[i], &Y[i]);
		vpx.push_back(pii(X[i], i));
		vpy.push_back(pii(Y[i], i));
	}
	
	sort(allof(vpx)); sort(allof(vpy));
	
	vector< int > vx, vy;
	for_(i,0,n) {
		vx.push_back(vpx[i].first);
		vy.push_back(vpy[i].first);
	}
	
	for_(i,0,m) {
		int x1, x2, y1, y2; scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
		
		int ind = lower_bound(allof(vx), x1) - vx.begin();
		X1[i] = ind < n ? vpx[ind].second : n;
		
		ind = upper_bound(allof(vx), x2) - vx.begin() - 1;
		X2[i] = ind >= 0 ? vpx[ind].second : -1;
		
		ind = lower_bound(allof(vy), y1) - vy.begin();
		Y1[i] = ind < n ? vpy[ind].second : n;
		
		ind = upper_bound(allof(vy), y2) - vy.begin() - 1;
		Y2[i] = ind >= 0 ? vpy[ind].second : -1;		
	}
	
	int W = compress(X), H = compress(Y);
	vector< vector< int > > grid(H+1, vector< int >(W+1, 0));
	
	for_(i,0,n) ++grid[Y[i]][X[i]];
	
	for_(y,0,H+1) for_(x,0,W+1) {
		if (y > 0) grid[y][x] += grid[y-1][x];
		if (x > 0) grid[y][x] += grid[y][x-1];
		if (y > 0 && x > 0) grid[y][x] -= grid[y-1][x-1];
	}
	
	for_(i,0,m) {
		int ans = 0;
		
		if (X1[i] < n && X2[i] >= 0 && Y1[i] < n && Y2[i] >= 0) {
			int x1 = X[X1[i]], x2 = X[X2[i]], y1 = Y[Y1[i]], y2 = Y[Y2[i]];
			ans += grid[y2][x2];
			if (x1-1 >= 0) ans -= grid[y2][x1-1];
			if (y1-1 >= 0) ans -= grid[y1-1][x2];
			if (x1-1 >= 0 && y1-1 >= 0) ans += grid[y1-1][x1-1];
		}
		
		printf("%d\n", ans);
	}
	
	return 0;
}

Measured memory_bytes: 106996
#include <iostream>
#include <vector>
#include <algorithm> // sort
#include <map> // pair
#include <numeric> // accumulate(begin,end,初期値)
#include <string>
#include <cstdio>
#include <queue>
#include <stack>
#include <set>
#include <cmath>

typedef long long ll;
using namespace std;

#define FALSE printf("false\n");
#define TRUE printf("true\n");
#define all(x) (x).begin(),(x).end()
#define print(x) cout<<x<<endl
#define rep(i,n) for(int i = 0;i < ((int)(n));++i)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define SUM(vec) accumulate(all(vec),0)
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define test(a) cout<<#a<<':'<<a<<endl

const ll INF = 1e9+7;

// 各桁の和
template<typename T>inline T digit(T num){T sum = 0;while(num){sum+=num%10;num/=10;}return sum;}
template<typename T>inline T gcd(T a,T b){if(b == 0)return a;return gcd(b,a%b);}
template<typename T>inline T lcm(T a, T b){T g = gcd(a,b);return a/g*b;}
template<typename T>inline T power(T a,T b){T tmp=1;rep(i,b){tmp*=a;}return tmp;}

int main() {
  cin.tie(0); ios::sync_with_stdio(0);
  ll n,m;cin>>n>>m;
  priority_queue<int> que;
  rep(i,n){
    int a;
    cin>>a;
    que.push(a);
  }
  
  rep(i,m){
    if(que.top() == 0)break;
    int tmp = que.top();
    que.pop();
    
    if(tmp != 0)que.push(tmp / 2);
  }
  
  // a[now] /= waru;
  
  ll ans = 0;

  while(true){
    ans += que.top();
    que.pop();
    if(que.size() == 0)break;
  }
  print(ans);
  return 0;
} 

Measured memory_bytes: 892
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
int main(){
   string s;
   cin >> s;
   string target = "keyence";
   int n = s.size();
    rep(i,n){
      for(int j=0; j<n; j++){
          string a = s;
          a.erase(i,j);
          if(a == target){
              cout << "YES" <<endl;
              return 0;
          }
      }
  }
   cout << "NO" <<endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main()
{
  int input_n;
  char input_c[100];
  char ch;
  int counter_i, counter_j;

  for( ; ; )
  {
    int hyou_counter[26] = {0};
    int winner = 0;

    for(counter_i = 0 ; counter_i <= 25 ; counter_i++)
      hyou_counter[counter_i] = 0;

    scanf("%d", &input_n);
    if(input_n == 0)
      break;

    for(counter_i = 0 ; counter_i < input_n ; counter_i++)
    {
      scanf("%c", &ch);
      scanf("%c", &input_c[counter_i]);
    }

    for(counter_i = 0 ; counter_i < input_n ; counter_i++)
    {
      int hyou_nokori = input_n - counter_i - 1;
      int max_hyou = 0, second_max_hyou = 0, max_index = 0;

      hyou_counter[input_c[counter_i] - 'A'] += 1;

      for(counter_j = 0 ; counter_j <= 25 ; counter_j++)
      {
        if(hyou_counter[counter_j] >= max_hyou)
        {
          second_max_hyou = max_hyou;
          max_hyou = hyou_counter[counter_j];
          max_index = counter_j;
        }
        else if(hyou_counter[counter_j] >= second_max_hyou)
        {
          second_max_hyou = hyou_counter[counter_j];
        }
      }

      if(max_hyou > second_max_hyou + hyou_nokori)
      {
        printf("%c %d\n", 'A' + max_index, counter_i + 1);
        winner = 1;
        break;
      }
    }

    if(!winner)
    {
      printf("TIE\n");
    }
  }
  return 0;
}



Measured memory_bytes: 2108
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<(n);++i)
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 gcd(int a,int b) { return b ? gcd(b,a%b) : a;}
int lcm(int a,int b) { return a/gcd(a,b)*b;}
void printb(unsigned int v) {
  unsigned int mask = (int)1 << (sizeof(v) * CHAR_BIT - 1);
  do putchar(mask & v ? '1' : '0');
  while (mask >>= 1);
}
void putb(unsigned int v) {putchar('0'), putchar('b'), printb(v), putchar('\n');}
#define ALL(W) (W).begin(),(W).end()

signed main(){
  pair<int,int> P[200000+10];
  int N,X[200000]={};
  cin >> N;
  rep(i,N){
    cin >> P[i].first;
    P[i].second=i;
  }
  sort(P,P+N);
  rep(i,N){
    if(i<N/2) X[P[i].second]=P[N/2].first;
    else X[P[i].second]=P[N/2-1].first;
  }
  rep(i,N) cout << X[i] << endl;
  return 0;
}


Measured memory_bytes: 6912
#include<bits/stdc++.h>
using namespace std;

long long INF = 1LL << 60;
int N_MAX = 1e5, K_MAX = 100;
vector<long long int> dp(N_MAX+K_MAX, INF);
vector<int> h(N_MAX, 0);

int main(){
  int N, K; cin >> N >> K;
  for(int i = 0; i < N; i++){
    cin >> h[i];
  }
  dp[0]=0;
  
  for(int i = 0; i < N; i++){
    for(int j = 1; j <= K; j++){
      
      dp[i+j] = min(dp[i+j], dp[i] + abs(h[i] - h[i+j]));
      
    }
  }
  
  cout << dp[N-1] << endl;
}

Measured memory_bytes: 1408
#include "bits/stdc++.h"
#include <fstream>

using namespace std;

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define replrev(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define reprev(i,n) replrev(i,0,n)
#define repi(itr,ds) for(auto itr = ds.begin(); itr != ds.end(); ++itr)
#define mp make_pair
#define INF 2000000000
#define INFL 2000000000000000000LL
#define EPS 1e-9
#define MOD 1000000007
#define PI 3.1415926536
#define RMAX 4294967295
typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<P> vP;
typedef vector<vector<int> > vvi;
typedef vector<vector<ll> > vvll;
typedef vector<vector<char> > vvc;
typedef vector<vector<double> > vvd;
typedef vector<vector<P> > vvP;
typedef priority_queue<int, vector<int>, greater<int> > pqli;
typedef priority_queue<ll, vector<ll>, greater<ll> > pqlll;
typedef priority_queue<P, vector<P>, greater<P> > pqlP;
typedef pair<int, pair<int, int> > Edge;
typedef vector<Edge> vE;

int N, M;
vi l, r, bit;

void add(int a, int w) {
	for (int x = a; x <= M; x += x & -x)bit[x] += w;
}

int sum(int a) {
	int ret = 0;
	for (int x = a; x > 0; x -= x & -x)ret += bit[x];
	return ret;
}

int main() {
	cin >> N >> M;
	vvP range(M);
	vi num(M, 0);
	rep(i, N) {
		int l, r;
		cin >> l >> r;
		range[r - l].push_back(mp(l, r));
		num[r - l]++;
	}

	reprev(i, M - 1) {
		num[i] += num[i + 1];
	}

	bit = vi(M + 1, 0);
	vi ans(M + 1, 0);
	repl(d, 1, M + 1) {
		ans[d] = num[d - 1];
		if (d == 1)continue;
		rep(i, range[d - 2].size()) {
			add(range[d - 2][i].first, 1);
			if(range[d - 2][i].second + 1 <= M)add(range[d - 2][i].second + 1, -1);
		}
		repl(i, 1, M / d + 1) {
			ans[d] += sum(d*i);
		}
	}

	repl(i, 1, M + 1) {
		cout << ans[i] << endl;
	}

	return 0;
}

Measured memory_bytes: 10496
#include <iostream>
#include <string>
#include <cstdio>
#include <map>
#include <algorithm>
using namespace std;

int main() {
	int N, S[100];
	int sum = 0, Min = 100000;
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> S[i];
		sum += S[i];
		if (S[i] % 10 != 0 && S[i] < Min)Min = S[i];
	}
    if (Min == 100000)cout << "0\n";
	else if (sum % 10 == 0) {
		cout << sum - Min << "\n";
	}
	

	else {
		cout << sum << "\n";
	}
	

	}
	

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define mod 998244353
using namespace std;
struct node 
{
	int x,d,id;
}robot[200010];
priority_queue<node> q;
queue<node> q1;
int cnt,to[200010],nxt[200010],head[200010],n,ans,fa[200010];
long long tot[200010];
bool operator < (node a,node b)
{
	return a.x>b.x;
}
void adde(int x,int y)
{
	to[++cnt]=y;
	nxt[cnt]=head[x];
	head[x]=cnt;
}
void work(int u)
{
	tot[u]=1;
	long long sum=1;
	for(int i=head[u];i;i=nxt[i])
	{
		int v=to[i];
		if(!v)
		{
			continue;
		}
		work(v);
		sum=(sum*tot[v])%mod;
	}
	tot[u]+=sum;
}
bool cmp(node a,node b)
{
	return a.x==b.x?a.d<b.d:a.x<b.x;
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d%d",&robot[i].x,&robot[i].d);
		robot[i].id=i;
	}
	sort(robot+1,robot+n+1,cmp);
	for(int i=n;i>=1;i--)
	{
	    while(!q.empty())
		{
			node u=q.top();
			if(u.x<robot[i].x+robot[i].d)//看样例，这里不能取等 
			{
				adde(robot[i].id,u.id);
				fa[u.id]=robot[i].id;
				q.pop();
			}else{
				break;
			}
		} 
		q.push(robot[i]);
	}
	while(!q.empty())
	{
		node u=q.top();
		work(u.id);
		q.pop();
		q1.push(u);
	}
	ans=1;
	while(!q1.empty())
	{
		ans=(1ll*ans*tot[q1.front().id])%mod;
		q1.pop();
	}
	printf("%d\n",ans);
	return 0;
} 

Measured memory_bytes: 16640
#define _USE_MATH_DEFINES
#include<string.h>
#include<bits/stdc++.h>
using namespace std;
#define ll long long

#define vec     vector<int>
#define vecll   vector<ll>
#define vec2    vector<vector<int>>
#define vec2ll  vector<vector<ll>>
#define vpair   vector<pair<int, int>>
#define vpairll vector<pair<ll, ll>>
#define rep(i,n)         for(ll i=(ll)0; i<(ll)n; i++)
#define REP(i,m,n)       for(ll i=(ll)m; i<(ll)n; i++)
#define arr(var, n)      vec var(n); rep(i,n){cin >> var[i];}
#define arrll(var, n)    vecll var(n); rep(i,n){cin >> var[i];}
#define all(var)         (var).begin(), (var).end()
#define sortall(var)     sort(all(var))
#define mpair(v1, v2)    make_pair(v1, v2)
#define pb(var)          push_back(var)
#define prt(var)         cout << var << "\n"
#define scn(var)         cin >> var;
#define pYes()           prt("Yes")
#define pNo()            prt("No")
#define prtd(n, var)     cout << fixed << setprecision(n) << var << "\n"
#define prt2(v1, v2)     cout << v1 << " " << v2 << "\n"
#define prt3(v1, v2, v3) cout << v1 << " " << v2 << " " << v3 << "\n"
#define prtall(var)      rep(i,var.size()){cout << var[i] << " ";} cout << "\n"

//----------------------------------------------------

int main(){
    int a, b, c;
    cin >> a >> b >> c;
    int tmp = b / a;
    if(tmp > c) cout << c << endl;
    else cout << tmp << endl;
}

Measured memory_bytes: 256
while True:
	cards=list(input())
	n=len(cards)
	if cards[0] == "-":
		break
	work=[0 for i in range(n)]
	for h in (int(input()) for i in range(int(input()))):
		for i in range(h,n):
			work[i-h]=cards[i]
		for i in range(h):
			work[n-h+i]=cards[i]
		for i in range(n):
			cards[i] = work[i]
	print("".join(cards))


Measured memory_bytes: 5604
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res

def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    a,b,c = LI()
    c -= a-b
    print(max(0,c))
    return

#B
def B():
    n = I()
    ans = 0
    for i in range(1,n+1):
        s = str(i)
        if len(s)%2:
            ans += 1
    print(ans)
    return

#C
def C():
    n = I()
    h = LI()
    h[0] -= 1
    for i in range(n-1):
        if h[i+1] < h[i]:
            print("No")
            return
        if h[i+1] > h[i]:
            h[i+1] -= 1
    print("Yes")
    return

#D
def D():
    s = S()
    n = len(s)
    ans = [0]*n
    l = 0
    i = 0
    while i < n:
        if s[i] == "L":
            j = i
            while i < n and s[i] == "L":
                i += 1
                l += 1
            if l:
                if (l+j-i)%2:
                    ans[j-1] = l-l//2
                    ans[j] = l//2
                else:
                    ans[j-1] = l//2
                    ans[j] = l-l//2
            l = 0
        else:
            l += 1
            i += 1
    print(*ans)
    return

#E
def E():

    return

#F
def F():

    return

#Solve
if __name__ == "__main__":
    D()


Measured memory_bytes: 51816
import java.util.Scanner;

class Main {
	Scanner sc = new Scanner(System.in);

	public void run() {
		int count=sc.nextInt();
		long money=100000;
		while(count--!=0){
			money*=1.05;
			if(money%1000!=0)money+=1000;
			money-=money%1000;
		}
		ln(money);
	}

	public static void main(String[] args) {
		new Main().run();
	}

	public static void pr(Object o) {
		System.out.print(o);
	}

	public static void ln(Object o) {
		System.out.println(o);
	}

	public static void ln() {
		System.out.println();
	}
}

Measured memory_bytes: 12000
#include <iostream>
using namespace std;
long long gcd(long long a, long long b)
{
    return (b == 0 ? a : gcd(b, a%b));
}
int main()
{
    long long a, b, ans = 0, k, i = 2;
    cin >> a >> b;

    k = (a > b ? gcd(a, b) : gcd(b, a));
    while(k > 1){
        if(i*i > k){
            ans++;
            break;
        }
        if(k % i == 0){
            ans++;
            while(k % i == 0) k /= i;
        }
        i++;
    }

    cout << ans + 1 << endl;
    return 0;
}

Measured memory_bytes: 256
//* AuThOr GaRyMr *//
#include<bits/stdc++.h>
#define rb(a,b,c) for(int a=b;a<=c;++a)
#define rl(a,b,c) for(int a=b;a>=c;--a)
#define niv vector<int>
#define LL long long
#define IT iterator
#define PB(a) push_back(a)
#define II(a,b) make_pair(a,b)
#define FIR first
#define SEC second
#define FREO freopen("check.out","w",stdout)
#define rep(a,b) for(int a=0;a<b;++a)
#define KEEP while(1)
#define SRAND mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define random(a) rng()%a
using namespace std;
const int INF=0x3f3f3f3f;
typedef pair<int,int> mp;
typedef pair<mp,mp> superpair;
int b[101];
int a[101];
int main(){
	int n;
	int res=0;
	cin>>n;
	rb(i,1,n-1){
		cin>>b[i];
	} 
	a[1]=b[1];res=b[1];
	rb(i,1,n-1){
		if(i==n-1) a[i+1]=b[i];
		else a[i+1]=min(b[i],b[i+1]);
	res+=a[i+1];
	}
	cout<<res<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <cmath>
#include <iostream>
#include <map>
#include <string>
#include <utility>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
  map<char, int> m; 
  string S;
  cin >> S;
  for (auto c: S)
  {
    m[c]++;
  }

  if (m.size() == 2) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 256
import math

S = int(input())
#print(S)

YYMM_flag = 0
MMYY_flag = 0

former = math.floor(S / 1000) * 10
S = S % 1000
former += math.floor(S / 100)
#print(former)
S = S % 100
latter = S
#print(latter)

if(1 <= former and former <= 12):
    MMYY_flag = 1

if(1 <= latter and latter <= 12):
    YYMM_flag = 1

if(YYMM_flag == 1):
    if(MMYY_flag == 1):
        print('AMBIGUOUS')
    else:
        print('YYMM')
else:
    if(MMYY_flag == 1):
        print('MMYY')
    else:
        print('NA')

Measured memory_bytes: 3064
mod = 10**9+7
def I(): return int(input())
def LI(): return list(map(int,input().split()))
def MI(): return map(int,input().split())
def LLI(n): return [list(map(int, input().split())) for _ in range(n)]

S = input()
count = 0
max = 0

for i in range(3):
  if(S[i]=="R"):
    count += 1
    if(count > max):
      max = count 
  else:
    if(count > max):
      max = count 
    count = 0
print(max)

Measured memory_bytes: 9008
#include <stdio.h>

char s[10010];
int i;
void f()
{
	s[i]++;
	if(s[i] > 'Z') s[i] = 'A';
}

int main()
{
	int n;
	scanf("%d", &n);
	scanf(" ");
	gets(s);
	int len = strlen(s);
	for(i = 0; i < len; i++)
	{
		for(int j = 0; j < n; j++)
		{
			f();
		}
	}
	puts(s);
}


Measured memory_bytes: 128
import java.util.Scanner;
import java.util.Queue;
import java.util.ArrayDeque;
import java.util.Deque;

 
class Main {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int K = sc.nextInt();
        
        Deque<Long> queue = new ArrayDeque<>();
        for(int i = 1; i < 10; i++) {
        	queue.add((long)i);
        }
        	
        long x = 0;
        for(int i = 0; i < K; i++) {
        	x = queue.poll();
        	
        	if(x % 10 != 0) {
        		queue.add(10*x + x%10 -1);
        	}
        	
        	queue.add(10*x + x%10);
        	
        	if(x % 10 != 9) {
        		queue.add(10*x + x%10 +1);
        	}
        	
        }
        
        System.out.println(x);
  
        
	}
}

 

Measured memory_bytes: 45556
#include <bits/stdc++.h>

using namespace std;

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

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

#endif

void warshall_floyd(Graph &graph) {
    int V = graph.size();
    for (int k = 0; k < V; ++k) {
        for (int i = 0; i < V; ++i) {
            for (int j = 0; j < V; ++j) {
                graph[i][j] = min(graph[i][j], graph[i][k] + graph[k][j]);
            }
        }
    }
}

void Main() {
    ll N, M;
    cin >> N >> M;
    Graph graph(N);
    vector<P> query(M);
    rep(i, M) cin >> query[i].first >> query[i].second;

    rep2(i, 1, N) {
        graph[0].push_back(i);
        graph[i].push_back(0);
    }
    vector<ll> dist(N, 0);
    rep(i, M) {
        P q = query[i];
        if (q.first == 1) {
            dist[q.second - 1]++;
        } else if (q.second == 1) {
            dist[q.first - 1]++;
        } else {
            dist[q.first - 1]++;
            dist[q.second - 1]++;
        }
    }
    bool ok = true;
    rep2(i, 1, N) {
        if (dist[i] % 2 == 1) ok = false;
    }
    cout << (ok ? "YES" : "NO") << '\n';
}

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


Measured memory_bytes: 8820
import sys
stdin = sys.stdin

sys.setrecursionlimit(10 ** 7)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x) - 1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())


s = ns()
t = ns()

ans = 0
for si, ti in zip(s, t):
    if si == ti:
        ans += 1

print(ans)

Measured memory_bytes: 3064
n = int(input())
s = [input() for i in range(n)]
ac = []
wa =[]
tle = []
re = []
for i in range(n):
    if s[i] == 'AC':
        ac.append(s[i])
    elif s[i] == 'WA':
        wa.append(s[i])
    elif s[i] == 'TLE':
        tle.append(s[i])
    else:
        re.append(s[i])
print(f'AC x {len(ac)}')
print(f'WA x {len(wa)}')
print(f'TLE x {len(tle)}')
print(f'RE x {len(re)}')

Measured memory_bytes: 84720
#include <iostream>
#include <cstring>
#include <cassert>
using namespace std;

const int mod = 1000000007;

using ll = long long;
int N,C;
int a[410], b[410];
ll dp[410][410];
ll power[410][410];

ll modpow(ll x, ll y){
    if(y == 0) return 1;
    ll a = modpow(x, y/2);
    a *= a;
    a %= mod;
    if(y&1){
        a *= x;
        a %= mod;
    }
    return a;
}

ll rec(int p, int rc){
    ll &res = dp[p][rc];
    if(res != -1) return res;
    if(p == N){
        res = rc == 0 ? 1 : 0;
    } else {
        res = 0;
        for(int c = 0; c <= rc; ++c){
            ll x = power[b[p]+1][c] - power[a[p]][c] + mod;
            x *= rec(p+1, rc-c);
            x %= mod;
            res += x;
        }
        res %= mod;
    }
    return res;
}

int main(){
    while(cin >> N >> C){
        for(int i = 0; i <= 400; ++i){
            power[0][i] = 0;
            for(int j = 0; j <= 400; ++j){
                power[j+1][i] = power[j][i] + modpow(j,i);
                power[j+1][i] %= mod;
            }
        }
        for(int i = 0; i < N; ++i) cin >> a[i];
        for(int i = 0; i < N; ++i) cin >> b[i];
        memset(dp, -1, sizeof dp);
        cout << rec(0,C) << endl;
    }
}



Measured memory_bytes: 2944
Imports System.Collections.Generic
Imports System.Console

Module Program
    Sub Main()
        Dim N As Integer = NextInt()
        Dim K As Integer = NextInt()

        Dim ans As Integer = 1

        For i As Integer = 0 To N - 1
            ans = Math.Min(ans * 2, ans + K)
        Next

        WriteLine(ans)
    End Sub

    Function NextInt() As Integer
        Return CInt(NextString())
    End Function

    Function NextString() As String
        Dim result As New List(Of Char)
        Do
            Dim tmp As Integer = Read()
            If tmp < 0 Then Exit Do
            Dim nextChar As Char = Chr(tmp)

            If Not Char.IsWhiteSpace(nextChar) Then
                result.Add(nextChar)
            ElseIf nextChar <> vbCr Then
                Exit Do
            End If
        Loop
        Return New String(result.ToArray())
    End Function

End Module


Measured memory_bytes: 19920
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define PI 3.14159265359

int main() {
    int n;
    cin >> n;
    n %= 10;
    if(n == 3) cout << "bon" << endl;
    else if(n == 0 || n==1 || n==6||n==8)cout << "pon" << endl;
    else cout << "hon" << endl;
    return 0;
}

Measured memory_bytes: 3636
import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

#################

N = I()
A = LI()

s = [0]*N
for i in range(N-1):
    s[A[i]-1] += 1

for i in range(N):
    print(s[i])

Measured memory_bytes: 90992
#include<bits/stdc++.h>
using ll=long long;
using namespace std;
#define rep(i, n) for(ll i=0; i<n; i++)
#define Rep(i, j, n) for(ll i=j; i<n; i++)
#define all(vec) vec.begin(), vec.end()
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 dh[4] = {-1, 0, 0, 1};
int dw[4] = {0, -1, 1, 0}; 
using P = pair<int, int>;
const double pi = acos(-1.0);

int main(){
  int n,q;
  string s;
  cin>>n>>q>>s;
  int l,r;
  
  vector<int>a(n);
  int tmp=0;
  Rep(i,1,n){
    if(s[i]=='C'&&s[i-1]=='A')tmp++;
    a[i]=tmp;
  }
  
  rep(i,q){
    cin>>l>>r;
    cout<<a[r-1]-a[l-1]<<endl;
  }
    
    
  return 0;
}


Measured memory_bytes: 3792
//AnkitCode99 here....
#include<bits/stdc++.h>
#define endl "\n"
typedef long long int ll;
#define MOD 1000000007
#define mp make_pair
#define pll pair<ll,ll>
#define pb push_back
//max xor btw range of two numbers..
#define max_XOR(a,b) (1 << int(log2(a ^ b) + 1)) - 1
#define vl vector<ll>
#define inf ll(1e18)
#define all(v) v.begin(),v.end()
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define rep(i,a,b) for(long long int i=a;i<b;i++)
#define nrep(i,a,b) for(long long int i=a;i>=b;i--)
#define ceil(a,b) a/b+((a%b ==0 )?0:1)
using namespace std;

const ll sz=100005;
const ll szz=1000006;

int main()
{
    fast;
    // #ifndef ONLINE_JUDGE
    // freopen("input.txt","r",stdin);
    // freopen("op.txt","w",stdout);
    // #endif

ll r;
cin>>r;
cout<<2*3.14*r;
    
}//Goodbye...

Measured memory_bytes: 3804
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e5+3;
int n,a[N];
int main(){
	cin>>n;
	for(int i=1;i<=n;i++)cin>>a[i];
	sort(a+1,a+n+1,greater<int>());
	for(int i=1;i<=n;i++){
		if(i+1>a[i+1]){
			int j=0;
			for(;a[j+i+1]==i;++j);
			if((a[i]-i)&1||(j&1))puts("First");
			else puts("Second");
			break;
		}
	}
}

Measured memory_bytes: 3984
a=list(map(int,input().split()))
while a[0]>0 and a[2]>0:
    a[2]=a[2]-a[1]
    if a[2]<=0:
        print('Yes')
        break
    a[0]=a[0]-a[3]
    if a[0]<=0:
        print('No')
        break

Measured memory_bytes: 9184
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "iomanip"
#include "random"

using namespace std;

const long long int MOD = 1000000007;
const long double EPS = 0.00000001;
const long double PI = 3.1415926535897932384626433;

long long int N, M, K, H, W, L, R;



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

	cin >> N >> M >> K;
	vector<bool>can(K, true);
	for (int i = 0; i < N; i++) {
		cin >> H;
		L = max(H - M, (long long int)0);
		R = min(H + M, K);
		for (int j = L; j < R; j++) {
			can[j] = false;
		}
	}
	for (int i = 0; i < K; i++) {
		if (can[i]) {
			W++;
		}
	}
	cout << W << endl;
	return 0;
}

Measured memory_bytes: 3216
#include <iostream>
#include <cmath>

using namespace std;

const double EPS = 1e-10;
const double PI = 3.14159265358979323;

int main()
{
    int m,n;
    while(cin >> m && m) {
        
        double s1, s2, theta;
        s1 = 0.0;
        int a,sum = 0;
        for(int i = 0; i < m - 1; i++) {
            cin >> a;
            theta = (PI * a) / 180.0;
            s1 += cos(theta / 2.0) * sin(theta / 2.0);
            sum += a;
        }
        theta = (PI * (360 - sum)) / 180.0;
        s1 += cos(theta / 2.0) * sin(theta / 2.0);

        cin >> n;
        s2 = 0.0;
        sum = 0;
        for(int i = 0; i < n - 1; i++) {
            cin >> a;
            theta = (PI * a) / 180.0;
            s2 += cos(theta / 2.0) * sin(theta / 2.0);
            sum += a;
        }
        theta = (PI * (360 - sum)) / 180.0;
        s2 += cos(theta / 2.0) * sin(theta / 2.0);

        if(s1 - EPS > s2) {
            cout << "1" << endl;
        } else if(fabs(s1 - s2) < EPS) {
            cout << "0" << endl;
        } else {
            cout << "2" << endl;
        }
    }
}

Measured memory_bytes: 0