akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

#define NDEBUG
#ifdef DEBUG
#include "../cout11.h"
#undef NDEBUG
#endif
#include <cassert>

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> ii;
typedef pair<ll,ll> llll;
typedef pair<double,double> dd;

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ii> vii;
typedef vector<vector<ii>> vvii;
typedef vector<ll> vll;

#define sz(a)  int((a).size())
#define pb  push_back
#define FOR(var,from,to) for(int var=(from);var<=(to);++var)
#define rep(var,n)  for(int var=0;var<(n);++var)
#define rep1(var,n)  for(int var=1;var<=(n);++var)
#define repC2(vari,varj,n)  for(int vari=0;vari<(n)-1;++vari)for(int varj=vari+1;varj<(n);++varj)
#define ALL(c)  (c).begin(),(c).end()
#define RALL(c)  (c).rbegin(),(c).rend()
#define tr(i,c)  for(auto i=(c).begin(); i!=(c).end(); ++i)
#define found(s,e)  ((s).find(e)!=(s).end())
#define mset(arr,val)  memset(arr,val,sizeof(arr))
#define mid(x,y) ((x)+((y)-(x))/2)
#define IN(x,a,b) ((a)<=(x)&&(x)<=(b))

int solve(int N, vi& s) {
    int maxscore = 0;
    rep(i,N) maxscore += s[i];

    vi possible(1+maxscore, 0);
    possible[0] = 1;
    for (int si: s) { // 100
        for (int i=maxscore; i>=0; --i) {
            if (possible[i] && i+si <= maxscore) {
                possible[i+si] = 1;
            }
        }
    }
    // cerr << possible << endl;
    int best = 0;
    for (int score=maxscore; score>=0; --score) {
        if (!possible[score]) continue;
        if (score % 10 == 0) continue;
        return score;
    }
    return best;
}

int main() {
    int N; cin >> N;
    vi s(N);
    rep(i,N) cin >> s[i];
    cout << solve(N,s) << endl;
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <stdbool.h>
#define LL long long
#define INF 1<<31-1
#define MIN(x,y) ((x)<(y)?(x):(y))
#define MAX(x,y) ((x)<(y)?(y):(x))
#define FOR(i,a,n) for(i=a;i<n;i++)
#define MOD 1000000007
#define NUM 100001
void swap(int* a,int* b){
  int tmp=*a;*a=*b;*b=tmp;
}
int cmp(const void* a,const void* b){
  return *(int*)a-*(int*)b;
}

typedef struct{int s,e,c;}Edge;
int *par;
void UF(){
	par=calloc(NUM,4);
	for(int i=0;i<NUM;i++)par[i]=-1;
}
int Root(int x){
  if(par[x]<0)return x;
  else return par[x]=Root(par[x]);
}
int Size(int x){
  return -par[Root(x)];
}
bool Same(int x,int y){//x番目のノードとy番目のノードが同じ木に属しているか返す
  return Root(x)==Root(y);
}
void Unite(int x,int y){
  x=Root(x);y=Root(y);
  if(x!=y){
    if(Size(x)<Size(y))swap(&x,&y);
    par[x]+=par[y];par[y]=x;
  }
}
void Del(){
  free(par);
}
int cmpc(const void* a,const void* b){
	return ((Edge*)a)->c-((Edge*)b)->c;
};
int Kruscal(Edge* edge,int n){
  int i,ans=0;
  Edge e;
  qsort(edge,n,sizeof(Edge),cmpc);
  UF();
  FOR(i,0,n){
    e=edge[i];
    if(!Same(e.s,e.e)){
      Unite(e.s,e.e);
      ans+=e.c;
    }
  }
  Del();
  return ans;
}
Edge e[NUM*2];

typedef struct{int x,y,n;}P;
int cmpx(const void* a,const void* b){
  return ((P*)a)->x-((P*)b)->x;
}
int cmpy(const void *a,const void *b){
	return ((P*)a)->y-((P*)b)->y;
}
P p[NUM];

int main() {
  int N,i;
  scanf("%d",&N);
  FOR(i,0,N)scanf("%d%d",&p[i].x,&p[i].y);
  FOR(i,0,N)p[i].n=i;
  qsort(p,N,sizeof(P),cmpx);
  FOR(i,0,N-1)e[i].s=p[i].n,e[i].e=p[i+1].n,e[i].c=p[i+1].x-p[i].x;
  qsort(p,N,sizeof(P),cmpy);
  FOR(i,0,N-1)e[i+N-1].s=p[i].n,e[i+N-1].e=p[i+1].n,e[i+N-1].c=p[i+1].y-p[i].y;

  printf("%d\n",Kruscal(e,2*N-2));
	return 0;
}


Measured memory_bytes: 7144
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for (int i = 0; i < (n); ++i)

int main(){
  ll a;
  double b;
  cin >> a >> b ;
  ll ans=b*100+0.5;
  a *= ans;
  a /= 100;
  cout << a << endl;
  return 0;
}

Measured memory_bytes: 3620
#include<iostream>
int main(){
	int a,b,i,n;
	a=100000;
	std::cin>>n;
	for(i=0;i<n;i++){
		a=a*1.05;
		b=a;
		if(a%1000!=0){
			b=a-a%1000;
			a=b+1000;
			}
		}
	std::cout<<a<<std::endl;

    return 0;
}

Measured memory_bytes: 1160
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#define Rep(i, n) for(int i=0;i<n;++i)
#define rep(i, n) for(int i=1;i<=n;++i)
#define ll long long int
#define INF 1e9
#define LINF 1e18
#define MOD 1000000007
#define PI 3.14159265359
#define EPS 1e-10
#define All(a) (a).begin(), (a).end()

using namespace std;
using P = pair<ll, ll>;
 
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};

/**
 * Usage:
 * 
 * G[from].push_back(Edge(to, weight));
 * using Graph = vector<vector<Edge>>;
 * 
 */ 
struct Edge {
  int to;     
  ll weight; 
  Edge(int t, ll w) : to(t), weight(w) { }
};

/**
 * Usage:
 * 
 * chmin(old, new);
 * chmax(old, new);
 * 
 */ 
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;
}

template<typename T>
void printv(vector<T>& v) {
  if (v.size() == 0) {
    cout << "\n";
    return;
  }

  Rep(i, v.size()) {
    cout << v[i] << ((i + 1 < v.size()) ? ' ' : '\n');
  }
}




string s;

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

  int left = 0;
  int right = n-1;
  int added = 0;

  while (left <= right) {
    if (s[left] == s[right]) {
      left++; right--;
    } else if (s[left] == 'x') {
      added++;
      left++;
    } else if (s[right] == 'x') {
      added++;
      right--;
    } else {
      cout << -1 << "\n";
      return 0;
    }
  }

  cout << added << "\n";
}

Measured memory_bytes: 512
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder_20190707_1
{    class Program
    {
        static void Main(string[] args)
        {            
            string[] L1 = Console.ReadLine().Split(' ');
            int gameCount = int.Parse(L1[0]);
            int banhand = int.Parse(L1[1]);

            string[] L2 = Console.ReadLine().Split(' ');
            int rock = int.Parse(L2[0]);
            int scissors = int.Parse(L2[1]);
            int paper = int.Parse(L2[2]);

            string hand = Console.ReadLine();

            int count = 0;
            bool[] isLose = new bool[gameCount]; 

            for(int i = 0; i < hand.Length; i++)
            {
                if(i < banhand)
                {
                    if(hand[i] == 'r')
                    {
                        count += paper;
                    }
                    else if(hand[i] == 's')
                    {
                        count += rock;
                    }
                    else
                    {
                        count += scissors;
                    }
                }
                else
                {
                    if (hand[i] == hand[i - banhand] && !isLose[i - banhand])
                    {
                        isLose[i] = true;
                    }
                    else
                    {
                        if (hand[i] == 'r')
                        {
                            count += paper;
                        }
                        else if (hand[i] == 's')
                        {
                            count += rock;
                        }
                        else
                        {
                            count += scissors;
                        }
                    }                    
                }
            }

            Console.WriteLine(count);
        }
    }
}

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

typedef long long ll;

const int INF = 100000000;

int main() {
    int A, B, C, X, Y;
    ll ans = 0;
    cin >> A >> B >> C >> X >> Y;

    int m = min(X, Y); 
    
    if ((A+B) * m < 2 * C * m) {
        ans += (A+B) * m;
    } else {
        ans += 2 * C * m;
    }

    X -= m;
    Y -= m;
    
    if (X > 0) {
        if (A*X < 2 * C * X) {
            ans += A*X;
        } else {
            ans += 2 * C * X;
        }
    }

    if (Y > 0) {
        if (B*Y < 2 * C * Y) {
            ans += B*Y;
        } else {
            ans += 2 * C * Y;
        }
    }

    cout << ans << endl;
}


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

typedef long long ll;

int N, M;
string S;

ll P1 = 1007;
ll P2 = 1009;
ll MOD = 1e9 + 7;

vector<ll> imos(ll P){
    ll x = 1;
    vector<ll> vec(N+1);
    vec[0] = 0;
    
    for(int i=0; i<N; i++){
        ll d = (S[i]-'a') + 1;
        vec[i+1] = (vec[i] + d*x) % MOD;
        x = (x * P) % MOD;
    }
    return vec;
}
ll mod_pow(ll a, ll b, ll mod) {
    return b <= 0? 1: (b % 2? a: 1) * mod_pow(a * a % mod, b / 2, mod) % mod;
}
ll inv(ll x, ll mod){
    return mod_pow(x, mod-2, mod);
}
ll query(vector<ll> &vec, int l, int r, ll P){
    return ((vec[r]-vec[l-1]+MOD) * mod_pow(P, (l-1)*(MOD-2), MOD)) % MOD;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
            
    cin >> N >> M;
    cin >> S;
    
    auto vec1 = imos(P1);
    auto vec2 = imos(P2);
    
    
    set<pair<ll, ll>> sets;
    int l = 1;
    int r = 1;
    for(int k=1; k<=M; k++){
        string q; cin >> q;
        
        if(q == "L++"){
            l++;
        }
        if(q == "L--"){
            l--;
        }
        if(q == "R++"){
            r++;
        }
        if(q == "R--"){
            r--;
        }
        ll x1 = query(vec1, l, r, P1);
        ll x2 = query(vec2, l, r, P2);
        
        //cout << x << endl;
        sets.insert({x1, x2});
    }
    cout << sets.size() << endl;
    
    return 0;
}

Measured memory_bytes: 26356
from collections import Counter
import sys
n = int(input())
a = list(map(int, input().split()))
count_a = list(Counter(a).items())
count_a = sorted(count_a, reverse=True)
result = 1
c = 0
for x, y in count_a:
    if y>=2:
        result *= x
        c += 1
        if y>=4 and c == 1:
            result *= x
            c += 1
    if c == 2:
        print(result)
        sys.exit()
print(0)

Measured memory_bytes: 21412
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using ll = long long;
using namespace std;

struct Edge {
    int from, to, cap, rev;
    Edge(int f, int t, int c, int r) : from(f), to(t), cap(c), rev(r) {} // 初期化
};
 
struct Graph {
    vector<vector<Edge>> G;
    Graph(int n = 0) : G(n) {} // 初期化
 
    vector<Edge>& operator[](int i) { return G[i]; }
    int size() { return G.size(); }
    void add_edge(int from, int to, int cap) {
        G[from].push_back(Edge(from, to, cap, (int)G[to].size()));
        G[to].push_back(Edge(to, from, 0, (int)G[from].size() - 1));
    } // 有向辺を加える
};
 
struct Dinic {
    const int INF = 1e9;
    vector<int> level, iter; 
    Dinic(){}; // 初期化
 
    void bfs(Graph &G, int s){
        level.assign(G.size(), -1);
        queue<int> que;
        level[s] = 0;
        que.push(s);
        while(!que.empty()){
            int v = que.front(); que.pop();
            for(int i=0; i<G[v].size(); i++){
                Edge &e = G[v][i];
                if(e.cap > 0 && level[e.to] < 0){
                    level[e.to] = level[v]+1;
                    que.push(e.to);
                }
            }
        }
    }
 
    int dfs(Graph &G,int s, int g, int f){
        if(s == g) return f;
        for(int &i = iter[s]; i < G[s].size(); i++){
            Edge &e = G[s][i];
            if(e.cap > 0 && level[s] < level[e.to]){
                int d = dfs(G, e.to, g, min(e.cap, f));
                if(d > 0){
                    e.cap -= d;
                    G[e.to][e.rev].cap += d;
                    return d;
                }
            }
        }
        return 0;
    }
 
    int max_flow(Graph &G, int s, int g){
        int flow = 0;
        while(true){
            bfs(G,s);
            if(level[g] < 0) return flow;
            iter.assign(G.size(), 0);
            int f;
            while((f = dfs(G, s, g, INF)) > 0) flow += f;
        }
    }
};

int main(){
    int h, w; cin >> h >> w;
  
  int sx, sy, tx,ty;

    Graph data(202);
    rep(i,h) rep(j,w) {
        char c; cin >> c;
        if (c == 'S') {
            data.add_edge(200,i,100100);
            data.add_edge(200,j+100,100100);
          sx = i; sy = j;
        }
        else if (c == 'T') {
            data.add_edge(i,201,100100);
            data.add_edge(j+100,201,100100);
          tx = i; ty = j;
        }
        else if (c == 'o') {
            data.add_edge(i,j+100,1);
            data.add_edge(j+100,i,1);
        }
    }
  if (sx == tx || sy == ty) { cout << -1 << endl; return  0; }

    Dinic ans;
    cout << ans.max_flow(data, 200, 201) << endl;
    return 0;
}

Measured memory_bytes: 4472
#include <bits/stdc++.h>
#include <algorithm>
#define rep(i, n) for (int i=0; i<n; ++i)
#define all(obj) (obj).begin(),(obj).end()
using namespace std;
typedef long long ll;
long long GCD(long long x, long long y) { return y ? GCD(y, x%y) : x; }

int main(){
    ll N;
    cin >> N;
    vector<ll> n(10000001, 1);
    for( int i = 2; i <= N; i++ ){
        if(n[i]){
            for( int j = 2 * i; j <= 10000001; j += i ) n[j]++;
        }
    }
    ll ans = 0;
    for(int i=1; i<=N; ++i){
        ans+=i*(n[i]+1);
    }
    cout << ans-1 << endl;
    return 0;
}


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

using namespace std;

#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

typedef long long ll; typedef vector<int> VI; typedef pair<ll,int> pii;
const ll mod = 1e9+7;


struct UF {
	vector<int> par, rank; //root, tree
	UF() {}
	UF(int n){ init(n); }
	void init(int n) {
		par.assign(n+4,0); rank.assign(n+4,0);
		for(int i = 0; i<n; i++) par[i] = i;
	}
	int find(int x){if(par[x] == x) return x; else return par[x] =find(par[x]);}
	void unite(int x, int y) { //unite, (add)
		x = find(x); y = find(y);
		if(x == y) return;
		if(rank[x] < rank[y]){ par[x] = y; }
		else{ par[y] = x; if(rank[x] == rank[y]) rank[x]++;}
	}
	bool same(int x, int y) { return find(x) == find(y); }
};


int main()
{
	
	//cin.tie(0); ios_base::sync_with_stdio(false);
	int n;
	cin >>n;
	vector<array<int ,3>> xy(n);
	rep(i,n){
		cin >>xy[i][0]>>xy[i][1];
		xy[i][2] =i;
	}
	sort(all(xy));
	auto xy2 =xy;
	sort(all(xy),[](array<int ,3> l, array<int ,3> r){
		return l[1] < r[1];
	}); 
	
	UF ufa(n+4);
	vector<array<int ,3>> cnd;
	
	rep(i,n-1){
		if(xy2[i][0] == xy2[i+1][0]){ ufa.unite(xy2[i][2],xy2[i+1][2]); continue;}
		cnd.push_back(array<int,3>{
			 abs(xy2[i+1][0]-xy2[i][0]),xy2[i][2],xy2[i+1][2]});
		
	}
	rep(i,n-1){
		if(xy[i][0] == xy[i+1][0]){ ufa.unite(xy[i][2],xy[i+1][2]); continue;}
		cnd.push_back(array<int,3>{
			abs(xy[i+1][1]-xy[i][1]),xy[i][2],xy[i+1][2] });
	}	
	
	sort(all(cnd));
	
	//for(auto x :cnd) printf("%d:%d:%d \n ",x[0],x[1],x[2]); puts("");
	ll ans = 0;
	for(auto z: cnd){
	
		if( !ufa.same(z[1],z[2])){
			ans += z[0];
			ufa.unite(z[1],z[2]);
		}
	}
	//rep(i,n) cout << ufa.find(i) <<"  "; puts("");
	cout << ans <<endl;
	return 0;
}


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

typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<P,ll> PLL;
typedef pair<P,P> PP;
typedef vector<ll> VECLL;
typedef vector<P> VECP;
typedef priority_queue<P,VECP,greater<P> > PQP;
typedef priority_queue<ll, VECLL, greater<ll> > PQll;

#define rep(i,a,n) for(ll i = a;i < n;i++)   
#define rrep(i,a,n) for(ll i = n; i >= a;i--)
#define index_check(i,n) if(i > n-1 || i < 0) continue; 
#define LINF (ll)1e18
#define INF (int)1e9
#define fs first
#define sc second

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

int main(){
    ll a,b,c;
    cin >> a >> b >> c;
    cout << min(c,b/a) << endl;
    return 0;
}


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

#define ull unsigned long long int
#define ll long long int
#define pb push_back
#define eb emplace_back
#define MOD (ull)(double)(1e9 + 7)
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pull pair<ull, ull>
#define m_p make_pair
#define debug(x) cout << #x << " " << x << endl;

const double pi = 3.14159;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	int n, m;
	cin >> n >> m;
	
	ll a[m];
	ll s=0;
	for(int i=0 ; i<m ; ++i){
		cin >> a[i];
		s += a[i];
	}
	
	if(s > n)cout << "-1";
	else cout << n - s;
}


Measured memory_bytes: 3688
def solve():
    a, b = map(int, input().split())
    import numpy as np

    unit22 = np.array([[1,1,1,1,1,1],
                       [1,1,0,0,0,1],
                       [1,0,1,0,0,1],
                       [1,0,0,1,0,1],
                       [1,0,0,0,1,1],
                       [1,1,1,1,1,1]])

    unit21 = np.array([[1,1,1,1,1,1],
                       [1,0,0,0,0,1],
                       [1,1,0,0,0,1],
                       [1,0,1,0,1,1],
                       [1,0,0,1,1,1],
                       [1,1,1,1,1,1]])

    unit20 = np.array([[1,1,1,1,1,1],
                       [1,0,1,0,0,1],
                       [1,0,1,0,0,1],
                       [1,0,1,0,0,1],
                       [1,0,1,0,0,1],
                       [1,1,1,1,1,1]])

    unit11 = np.array([[1,1,1,1,1,1],
                       [1,0,0,0,0,1],
                       [1,0,1,1,0,1],
                       [1,0,1,1,0,1],
                       [1,0,0,0,0,1],
                       [1,1,1,1,1,1]])

    unit10 = np.array([[1,1,1,1,1,1],
                       [1,0,0,0,0,1],
                       [1,0,0,0,0,1],
                       [1,0,0,0,0,1],
                       [1,0,0,0,0,1],
                       [1,1,1,1,1,1]])

    unit00 = np.array([[1,1,1,1,1,1],
                       [1,1,1,1,1,1],
                       [1,1,1,1,1,1],
                       [1,1,1,1,1,1],
                       [1,1,1,1,1,1],
                       [1,1,1,1,1,1]])

    str_a = '.'
    str_b = '#'

    if a > b:
        int_a = 0
        int_b = 1
        sup = a
        inf = b - 1
    else:
        int_a = 1
        int_b = 0
        sup = b
        inf = a - 1

    n = 16*16
    n22=0
    n21=0
    n20=0
    n10=0
    n11=0
    n00=0

    if sup % 2 == 0:
        n22 = inf//2
        n21 = inf%2
        n20 = sup//2 - n22 - n21
        n00 = n - n22 - n21 - n20
    else:
        if inf % 2 == 0:
            n22 = inf//2
            n20 = sup//2 - n22
            n10 = 1
            n00 = n - n22 - n20 - n10
        else:
            n22 = inf//2
            n20 = sup//2 - n22
            n11 = 1
            n00 = n - n22 - n20 - n11

    #print(n, a, b, sup, inf, n22, n21, n20, n11, n10, n00)


    unit_array = []
    for i in range(n22):
        unit_array.append(unit22)
    for i in range(n21):
        unit_array.append(unit21)
    for i in range(n20):
        unit_array.append(unit20)
    for i in range(n11):
        unit_array.append(unit11)
    for i in range(n10):
        unit_array.append(unit10)
    for i in range(n00):
        unit_array.append(unit00)

    res = np.zeros(shape=(96, 96), dtype=object)
    for i in range(16):
        for j in range(16):
            unit = unit_array[i*16+j]
            x = 6*j
            y = 6*i
            res[x:x+6,y:y+6] = unit

    res[res==int_a] = str_a
    res[res==int_b] = str_b

    print('96 96')
    for row in res:
        for col in row:
            print(col, end='')
        print("\n")

solve()

Measured memory_bytes: 13964
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
#include<cassert>
#include<numeric>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
const int INF = 1001001001;
const long long LINF = 1001002003004005006ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
typedef long long ll;
typedef pair<int,int> P;

int main(){
  string s,t;
  int a,b;
  string u;
  cin >> s >> t >> a >> b >> u;
  if(u==s)cout << a-1 << " " << b << endl;
  else cout << a << " " << b-1 << endl;
}

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

using namespace std;

int main(void){

    string s,t;
    cin>>s;
    cin>>t;
    int count = 0;

for(int i=0;i<3;i++){
    //cout<<s<<t<<endl;
     if(s[i] == t[i]){
        count++;
        //cout<<s[i]<<t[i]<<endl; 
     }
    }
    cout<<count<<endl;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;

int main() {
    ll n, x;
    cin >> n >> x;
    vector<ll> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }

    vector<vector<ll>> b(n, vector<ll>(n, 1LL << 60));
    for (int i = 0; i < n; ++i) {
        b[i][0] = a[i];
        for (int j = 1; j < n; ++j) {
            int c = (i - j + n) % n;
            b[i][j] = min(b[i][j - 1], a[c]);
        }
    }

    ll ans = 1LL << 60;
    for (int i = 0; i < n; ++i) {
        ll sum = x * i;
        for (int j = 0; j < n; ++j) {
            sum += b[j][i];
        }

        ans = min(ans, sum);
    }
    cout << ans << endl;
}

Measured memory_bytes: 31616
#[allow(unused_imports)]
use std::cmp::{min,max};
#[allow(unused_imports)]
use std::collections::BTreeMap;
#[allow(unused_imports)]
use std::ops::*;
#[allow(unused_imports)]
use std::collections::BinaryHeap;

fn ccw(x: (i64,i64), y: (i64,i64), z: (i64,i64)) -> i64 {
    ((y.0-x.0)*(z.1-x.1) - ((y.1-x.1)*(z.0-x.0))).signum()
}

fn norm(x: (i64,i64)) -> f64 {
    ((x.0*x.0 + x.1*x.1) as f64).sqrt()
}

fn dot(x: (i64,i64), y: (i64,i64)) -> i64 {
    x.0*y.0 + x.1*y.1
}

fn arg(x: (i64,i64), y: (i64,i64)) -> f64 {
    (dot(x,y) as f64 / norm(x) / norm(y)).acos()
}

fn main() {
    let n = read_i64() as usize;
    let ps = {
        let mut ps = vec![];
        for _ in 0..n {
            let xs = read_vec_i64();
            ps.push((xs[0], xs[1]));
        }
        ps
    };
    let qs = {
        let mut qs = ps.clone();
        qs.sort();
        qs
    };
    let mut u = vec![];
    let mut l = vec![];
    u.push(qs[0]);
    u.push(qs[1]);
    l.push(qs[n-1]);
    l.push(qs[n-2]);
    for i in 2..n {
        while u.len() >= 2 && ccw(u[u.len()-2], u[u.len()-1], qs[i]) > 0 {
            u.pop();
        }
        u.push(qs[i]);
    }
    for i in (0..n-2).rev() {
        while l.len() >= 2 && ccw(l[l.len()-2], l[l.len()-1], qs[i]) > 0 {
            l.pop();
        }
        l.push(qs[i]);
    }
    for i in 1..u.len()-1 {
        l.push(u[i]);
    }
    let mut map = BTreeMap::new();
    use std::f64;
    for j in 0..l.len() {
        let i = (j + l.len() - 1) % l.len();
        let k = (j + 1) % l.len();
        let a = (f64::consts::PI - arg((l[i].0-l[j].0, l[i].1-l[j].1), (l[k].0-l[j].0,l[k].1-l[j].1))) / f64::consts::PI / 2.0;
        map.insert(l[j], a);
    }
    for i in 0..n {
        match map.get(&ps[i]) {
            Some(res) => {
                println!("{}", res);
            }
            None => {
                println!("0");
            }
        }
    }
}

#[allow(dead_code)]
fn read_line() -> String {
    let mut ret = String::new();
    std::io::stdin().read_line(&mut ret).ok();
    ret.pop();
    return ret;
}

#[allow(dead_code)]
fn read_i64() -> i64 {
    let ss = read_line();
    return ss.parse::<i64>().unwrap();
}

#[allow(dead_code)]
fn read_vec_i64() -> Vec<i64> {
    let mut res = vec![];
    let ss = read_line();
    for ts in ss.split_whitespace() {
        let x = ts.parse::<i64>().unwrap();
        res.push(x);
    }
    return res;
}

use std::fmt::Display;
#[allow(dead_code)]
fn write_vec<T: Display>(xs: &Vec<T>) {
    if xs.len() == 0 {
        println!("");
        return;
    }
    print!("{}", xs[0]);
    for i in 1..xs.len() {
        print!(" {}", xs[i]);
    }
    println!("");
}


Measured memory_bytes: 4604
#include <bits/stdc++.h>
using namespace std;
#define ld long double
#define ld long double
int main(){
	ld  w, h, x, y; scanf("%Lf %Lf %Lf %Lf", &w, &h, &x, &y);
	printf("%.9Lf %d", w*h/2,  x==w/2.0 && y == h/2.0 ? 1 : 0);
	return 0;
}


Measured memory_bytes: 384
# include <bits/stdc++.h>
# define ll int64_t
# define rep(i,n) for(ll i=0;i<n;i++)
# define rrep(i,n) for(ll i=1;i<=n;i++)
# define ALL(x) (x).begin(), (x).end()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define mod 1000000007

using namespace std;

bool compare_by_b(pair<string,ll> a,pair<string,ll> b){
    if(a.second != b.second) return a.second<b.second;
    else return a.first<b.first;
}

bool my_compare(pair<string,ll> a,pair<string,ll> b){
    
    if(a.first != b.first) return a.first<b.first;
    if(a.second != b.second) return a.second>b.second;
    else return true;
}

ll factorial(ll n){
    ll x=1;
    rrep(i,n) x *= i;
    return x;
}

ll gcd(ll a, ll b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a%b));
   }
}

ll lcm(ll a, ll b)
{
   return a * b / gcd(a, b);
}

int main(){
    ll n,x;
    cin>>n>>x;
    vector<ll> a(n);
    rep(i,n) cin>>a[i];
    ll d=abs(x-a[0]);
    if(n==1) {
        cout<<abs(a[0]-x)<<endl;
        return 0;
    }
    rrep(i,n-1){
        d=gcd(d,abs(a[i-1]-a[i]));
    }
    cout<<d<<endl;
    return 0;
}

Measured memory_bytes: 1024
<?php
// 入力
$s = trim(fgets(STDIN));

$n = strlen($s);
// 答え出力用配列に0格納
$result = array_fill(0, $n, 0);

getResult($s, $result, 0);
echo implode(' ', $result).PHP_EOL;

function getResult($s, &$result, $r_top) {
    $n = strlen($s);
    $l_top = strpos($s, 'L', $r_top);
    $r_last = $l_top - 1;
    if (strpos($s, 'R', $l_top)) { // 次の'R'が見つかった場合
        $l_last = strpos($s, 'R', $l_top) - 1;
    } else { // 次の'R'が見つからない場合
        $l_last = $n - 1;
    }
    $r_cnt = $r_last - $r_top + 1; // 'R'の個数
    $l_cnt = $l_last - $l_top + 1; // 'L'の個数

    // 'RL'の'R'に移動するのは'R'までの距離が偶数の'R'と'L'
    $result[$r_last] = ceil($r_cnt / 2) + floor($l_cnt / 2);
    // 'RL'の'L'に移動するのは'L'までの距離が偶数の'R'と'L'
    $result[$l_top] = floor($r_cnt / 2) + ceil($l_cnt / 2);

    if ($l_last === $n - 1) {
        return;
    } else {
        return getResult($s, $result, $l_last + 1);
    }
}

Measured memory_bytes: 51704