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

#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define P pair<int,int>
#define Abs(a,b) max(a,b)-min(a,b)
#define YES(condition) if(condition){cout << "YES" << endl;}else{cout << "NO" << endl;}
#define Yes(condition) if(condition){cout << "Yes" << endl;}else{cout << "No" << endl;}
#define Cout(x) cout<<(x)<<endl

typedef long long ll;

using namespace std;

const int INF = 1e9,MOD = 1e9 + 7;
const ll LINF = 1e18;

//while(x!=0){
            //sum+=x%10;
           // x/=10;
        //}
        //各桁の和

//pair<int,int> p[100000];
//P r[100000];
//cin >> tmp;
//p[i]=make_pair(tmp,i);
//cout << p[i].second+1 << endl;//ペアの右側つまりiを出力

//s.find(w[i])==string::npos
//findの使い方

//for(int i=0;i<n;i++){
   // b[i]=x%2;
    //x/=2;
  //}二進数

long long int n=1,cnt=0,ans=0,a,b,c,cmp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;

string s,w;

vector<int> z;

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

       cin >> a >> b >> s;
       if(s.size()!=a+b+1){
           Cout("No");
       }
       else{
           if(s[a]!='-'){
               Cout("No");
               return 0;
           }
           else{
               rep(i,s.size()){
                   if(i!=a){
                       if(s[i]=='-'){
                           Cout("No");
                           return 0;
                       }
                   }
               }
           }
       }
       Cout("Yes");
return 0;
}


Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;

namespace AtCoderABC113
{
    class Program
    {
        public static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int X = int.Parse(s[0]);
            int Y = int.Parse(s[1]);
            Console.WriteLine(X + Y / 2);
        }
    }
}

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

int main() {
    string s;
    cin >> s;
    cout << s[0] << s.length() - 2 << s[s.length() - 1] << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
	int n;
	cin>>n;
	bool flag=0;
	for(int i=1;i<=9;i++)
	{
		if(n%i==0&&n/i<=9) flag=1;
	}
	if(flag) cout<<"Yes";
	else cout<<"No"; 
	return 0;
} 

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<math.h>
#include<algorithm>
#include<utility>
#include<functional>
#include<queue>
#include<string.h>
#include<string>
#include<set>
#include<map>
#include<vector>
using namespace std;
typedef long long LL;
typedef pair<int, int> P;
LL a,b,c;
int main(){
    cin>>a>>b>>c;
    set<LL> st;
    st.insert(a);
    st.insert(b);
    st.insert(c);

    cout<<st.size();
        
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cstring>

using namespace std;
// ascending order
#define vsort(v) sort(v.begin(), v.end())
// descending order
#define vsort_r(v) sort(v.begin(), v.end(), greater<int>())
#define vunique(v) unique(v.begin(), v.end())
#define mp make_pair
#define ts(x) to_string(x)
#define rep(i, a, b) for(int i = (int)a; i < (int)b; i++)
#define repm(i, a, b) for(int i = (int)a; i > (int)b; i--)
#define bit(a) bitset<8>(a)
#define des_priority_queue priority_queue<int, vector<int>, greater<int> >
typedef long long ll;
typedef pair<int, int> P;
const ll INF = 1e18;

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

	string s;
	cin >> s;
	string ans = "";
	rep(i, 0, s.size()) {
		if(s[i] == '0') ans = ans + '0';
		else if(s[i] == '1') ans = ans + '1';
		else if(s[i] == 'B') {
			string tmp = "";
			rep(j, 0, ans.size() - 1) {
				tmp += ans[j];
			}
			ans = tmp;
		}
	}

	cout << ans << endl;



}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define INF 1000000000
#define LINF 1000000000000000000
#define MOD 1000000007
#define mod 1000007
#define INF63 1061109567
#define INF127 9187201950435737471
#define UINF 18446744073709551615
#define F first
#define S second
#define ll long long
#define N 110 
using namespace std;
/*
Before Submitting, check:(Delete them before submitting)
*int or long long
*the range of every array(will it get an RE and is it bg enough?)
*special cases(0,1...)
*/
int h,w,dp[N][N],dx[2]={0,1},dy[2]={1,0};
char grid[N][N];
bool book[N][N]={};
priority_queue<pair<int,pair<int,int> > > q;
int main(){
	int i,j,x,y,tx,ty;
	cin>>h>>w;
	for(i=0;i<h;i++)
	{
		for(j=0;j<w;j++)
		{
			cin>>grid[i][j];
		}
	}
	memset(dp,63,sizeof(dp));
	if(grid[0][0]=='#')
	{
		dp[0][0]=1;
	}
	else
	{
		dp[0][0]=0;
	}
	q.push(make_pair(0,make_pair(0,0)));
	while(!q.empty())
	{
		x=q.top().S.F;
		y=q.top().S.S;
		book[x][y]=true;
		q.pop();
		for(i=0;i<2;i++)
		{
			tx=x+dx[i];
			ty=y+dy[i];
			if(tx<0||tx>=h||ty<0||ty>=w)
			{
				continue;
			}
			if(book[tx][ty])
			{
				continue;
			}
			if(grid[tx][ty]==grid[x][y]||grid[tx][ty]=='.')
			{
				if(dp[tx][ty]>dp[x][y])
				{
					dp[tx][ty]=dp[x][y];
					q.push(make_pair(-dp[tx][ty],make_pair(tx,ty)));
				}
			}
			else
			{
				if(dp[tx][ty]>dp[x][y]+1)
				{
					dp[tx][ty]=dp[x][y]+1;
					q.push(make_pair(-dp[tx][ty],make_pair(tx,ty)));
				}
			}
		}
	}
	cout<<dp[h-1][w-1]<<endl;
	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<vector>
#include<stdio.h>
#include<cstring>
#include<math.h>
#include<map>
#include<bitset>
#include<iomanip>
#include<queue>
#include<functional>
#include<stack>
#include<tuple>
#include<cassert>
using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
using P = pair<int, int>;

int main() {
  string N;
  int K;
  cin >> N >> K;
  int n[100];
  rep(i, N.size()) {
    n[i] = N[i] - '0';
  }
  int l = N.size();
  int dp[101][2][100] = {0};
  // cout << 1 << endl;
  dp[0][0][0] = 1;

  rep(i, l) {
    rep(smaller, 2) {
      rep(j, 10) {
        for(int x = 0; x <= (smaller ? 9 : n[i]); x++) {
          if(x == 0) {
            dp[i+1][smaller || x < n[i]][j] += dp[i][smaller][j];
          } else {
            dp[i+1][smaller || x < n[i]][j+1] += dp[i][smaller][j];
          }
        }
      }
    }
  }

  // cout << dp[0][1][0] << endl;
  cout << dp[l][0][K] + dp[l][1][K] << endl;
  return 0;
}

Measured memory_bytes: 3704
#include <bits/stdc++.h>
#define ALL(A) (A).begin(), (A).end()
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int dx[] = { 0, 1, -1, 0, 1, -1, 1, -1 };  // i<4:4way i<8:8way
int dy[] = { 1, 0, 0, -1, 1, -1, -1, 1 };

const ll mod = 1e9 + 7;
const ll INF = -1 * ((1LL << 63) + 1);
const int inf = -1 * ((1 << 31) + 1);
const int MAX = 5100000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}


long long modpow(long long a, long long n) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    COMinit();
    int k;
    cin >> k;
    string s;
    cin >> s;
    int n = s.size();
    // n + k の長さの文字列について
    // n 回元の文字列の要素を含めばいい
    ll ans = 0;
    for(int i=0;i<=k;i++){
        // iはsの末尾以外に挿入する数
        ll t = 1;
        t *= modpow(25,i);t %= mod;
        t *= modpow(26,k-i);t %= mod;
        t *= COM(n-1+i,i);t %= mod;
        ans += t % mod;
        ans %= mod;
    }
    cout << ans << endl;
}

Measured memory_bytes: 123740
#include "bits/stdc++.h"
using namespace std;
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define N	    100001
#define rep(i,a,b)  for(int i=a;i<b;i++)
const int n = 4000;
int A[n][n];
int main() {
	string a, b;
	cin>>a>>b;
	a = '0' + a;
	b = '0' + b;
	int n1 = a.size() - 1, n2 = b.size() - 1;
	for(int i = 1; i <= n1; i++) {
		for(int j = 1; j <= n2; j++) {
			if(b[j] == a[i]) {
				A[i][j] = max(max(A[i - 1][j], A[i][j - 1]), A[i - 1][j - 1] + 1);
			}
			else {
				A[i][j] = max(A[i - 1][j], A[i][j - 1]);
			}
		}
	}
	int i = n1, j = n2;
	string ans = "";
	int pre = -1;
	for(int k = 1; k <= n1; k++) {
		while(j	>= 1 && A[i][j] == A[i][j - 1]) {
			j--;
		}
		if(j) {
			if(pre != A[i][j]) 
				ans += b[j];
		}
		pre = A[i][j];
		i--;
	}
	reverse(all(ans));
	cout<<ans<<endl;
}


Measured memory_bytes: 47360
//include
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath> 
#include <iomanip>
#include <math.h>
#include <utility>
#include <functional>
#include <cstdlib>
//using
using namespace std;
using vl = vector <long long>;
using vs = vector <string>;
using vc = vector <char>;
using ll= long long;
using vvl = vector<vector<ll> >;
//vector<vector<char> > hyou(N, vector<char>(N));
using vd = vector <double>;
//define
//#define int long long
#define rep(i,n) for(int i=0; i<n; i++)
#define print(n) cout<<n<<endl;
#define sortp(d) sort(d.begin(),d.end()) //1234
#define sortm(d) sort(d.rbegin(),d.rend()) //4321
//素数判定　O(√A) 
bool is_prime(int x){
 if(x<=1) return false;
 for(int i=2;i*i<=x;i++)
 if(x%i==0) return false;
 return true;
 }
/*順列生成
do {
  // 順列に対する処理
} while (next_permutation(配列変数.begin(), 配列変数.end()));*/

//絶対値　abs()

//グローバル変数宣言
 ll p=0,q=0,r=0;

int main(){
  string s;
  cin>>s;
  char t[26];
  rep(i,s.size()){
    t[i]=s[i];
    rep(j,i){if(t[i]==t[j]){p=1;break;}}
    if(p==1){print("no");break;}
  }
  if(p==0)print("yes");
}

Measured memory_bytes: 3624
A, B = map(int, input().rstrip().split())
counter = 0
for i in range(A,B+1):
    now = i
    number = 0
    for j in range(5):
        tmp = now % 10
        number += tmp * 10**(4-j)
        now //= 10
    if number == i:
        counter += 1
print(counter)

Measured memory_bytes: 3060
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        
        Scanner sc = new Scanner(System.in);
        
        int D = 1;
        while(D == 1){
            int a = sc.nextInt();
            String op = sc.next();
            int b = sc.nextInt();
            int value;
             

            switch(op){
            
            case "+":
                value = a + b;
                System.out.println(value);
                break;
            case "-":
                value = a - b;
                System.out.println(value);
                break;
            case "*":
                value = a * b;
                System.out.println(value);
                break;
            case "/":
                value = a / b;
                System.out.println(value);
                break;
            case "?":
                D = 0;    
                break;
            }    
           
        }
        sc.close();

    }
}


Measured memory_bytes: 26216
#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 solve() {
    ll N;
    cin >> N;
    vector<P> items(N);
    rep(i, N) cin >> items[i].first >> items[i].second;
    vector<ll> X1, X2, X3, X4;
    rep(i, N) {
        P p = items[i];
        ll x = p.first;
        ll y = p.second;
        X1.push_back(x + y);
        X2.push_back(abs(INF - x) + y);
        X3.push_back(x + abs(INF - y));
        X4.push_back(abs(INF-x) + abs(INF-y));
    }
    ll ans = 0;
    sort(X1.begin(), X1.end());
    sort(X2.begin(), X2.end());
    sort(X3.begin(), X3.end());
    sort(X4.begin(), X4.end());
    ans = max(ans, abs(X1[0] - X1[N-1]));
    ans = max(ans, abs(X2[0] - X2[N-1]));
    ans = max(ans, abs(X3[0] - X3[N-1]));
    ans = max(ans, abs(X4[0] - X4[N-1]));
    cout << ans << '\n';
}

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


Measured memory_bytes: 12852
/*
	*#*#*#* Author GaryMr *#*#*#*
########################################################################
	是否可以简化问题：
	二分答案!
	抓住数据范围哪里小
	dfs or bfs
	是否可以化具体为抽象
	字符串问题是否可以用数学模拟递归过程（取c[i]或不取来算结果）
	二分？左闭右开？
	long long？
	逆向思维？
	dp？
	贪心？
	树的直径:随便找一点再走到它最远的点A，再从A最远的点走到最远B的点。AB就是树的直径
	匹配括号 左减右>=0
	字符串赋值字符加单引号
	double> printf("%lf")输出小数点6位，%.16lf输出后十六位
	多组数据清空？
	dp优化用g？
	线段树：大小为n的8倍
	线段树：左闭右开！
	线段树：find： if(l>=b||r<=a) return 0x3f3f3f3f; if(r<=b&&l>=a) return tree[k];
	线段树：满二叉树 
	循环跳出条件 
	代数设出每个值寻找关系？
	优先队列：priority_queue<类型> q;   
	priority_queue<类,vector<类>, less<类> > pq1; 　　　 // 使用递减	
	priority_queue<类，vector<类>, greater<类> > pq2; 　　// 使用递增
	判断括号，判断是否长度为偶数
	1<<int(ceil(log2(double(n))))
	分析样例：奇数or偶数
	偶数
	线段离散化
	make_pair 慢
	坐标离散化
*/
#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 II(a,b) make_pair(a,b)
#define FIR first
#define SEC second
using namespace std;
const int INF=0x3f3f3f3f;
typedef pair<int,int> mp;
typedef pair<mp,mp> superpair;
int a[100001];
int MMM[100005];
int Mmum=-INF;
map<int,int> MO;
int main(){
	int n,t;
	scanf("%d %d",&n,&t);
	rb(i,1,n) scanf("%d",&a[i]);
	MMM[n+1]=-INF;
	rl(i,n,1){
		MMM[i]=max(MMM[i+1],a[i]);
	}
//	int mbuy=(t)>>1;
	int maxcha=-INF;
	rb(i,1,n){
		maxcha=max(maxcha,MMM[i]-a[i]);
	}
	rb(i,1,n){
		if(MMM[i]-a[i]==maxcha){
			MO[MMM[i]]=1;
		}
	}
	int res=0;
	map<int,int> :: IT ite=MO.begin();
	for(ite;ite!=MO.end();ite++){
		res++;
	}
	printf("%d\n",res);
	return 0;
}

Measured memory_bytes: 3328
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
typedef pair<int, int> P;
const int D = 32;
#define REP(i, j) for(int i = 0; i < j; i++)
namespace std{
  bool operator < (const P& a, const P& b) {
    if(a.second != b.second) return a.second < b.second;
    return a.first < b.first;
  }
}

int N;

int solve(int d, vector<P> &v, vector<bool> &used){
  for(int i = 0; i < N; ++i){
    if(used[i]) continue;
    if(v[i].first <= d && v[i].second >= d) {
      used[i] = true;
      return 100;
    }
  }
  return 50;
}

int main(){
  cin >>N;
  vector<P> v(N);
  REP(i, N){
    int a, b; cin >>a >>b;
    v[i] = P(a, b);
  }
  sort(v.begin(), v.end());
  vector<bool> used(N, false);
  int ans = 0;
  for(int d = 1; d <= 31; d++) ans += solve(d, v, used);
  cout <<ans <<endl;
  return 0;
}

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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef vector<vpii> vvpii;

#define mt make_tuple
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sqr(x) ((ll)(x) * (x))

const ll MOD = 1e9 + 7;

ll dp[100100][13];

int main()
{
    memset(dp, 0, sizeof(dp));
    string s;
    cin >> s;
    const int n = (int)s.size();
    dp[0][0] = 1LL;

    for(int i = 0; i < n; ++i)
    {
        int c;
        if(s[i] == '?')
            c = -1;
        else
            c = s[i]-'0';

        for(int j = 0; j < 10; ++j)
        {
            if(c != -1 && c != j)
                continue;
            for(int k = 0; k < 13; ++k)
            {
                dp[i+1][(k*10+j)%13] =  (dp[i+1][(k*10+j)%13] + dp[i][k]) % MOD;
            }
        }
    }

    cout << dp[n][5] << '\n';

    return 0;
}


Measured memory_bytes: 10624
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <utility>
#include <iomanip>
using namespace std;
typedef long long ll;

const ll MOD = 1e9+7;

int lr[2][100000];//そのマスがLのときはそのマスより左で最初にあるR
int ans[100000];
int main()
{
	string s;
	cin>>s;
	fill(lr[0],lr[2],-1);
	fill(ans,ans+100000,0);
	//Lの場合を調べる
	int last=0;
	for(int i=0;i<s.size();i++)
	{
		if(s[i]=='R')
			last=i;
		else
			lr[0][i]=last;
	}
	last=s.size()-1;
	//Rの場合を調べる
	for(int i=s.size()-1;i>-1;i--)
	{
		if(s[i]=='L')
			last=i;
		else
			lr[1][i]=last;
	}
	for(int i=0;i<s.size();i++)
	{
		if(lr[0][i]!=-1)
		{
			int tmp=i-lr[0][i];
			if(tmp&1)
				ans[lr[0][i]+1]++;
			else
				ans[lr[0][i]]++;
		}
		if(lr[1][i]!=-1)
		{
			int tmp=lr[1][i]-i;
			if(tmp&1)
				ans[lr[1][i]-1]++;
			else
				ans[lr[1][i]]++;
		}
	}
	for(int i=0;i<s.size();i++)
		cout<<ans[i]<<" ";
	cout<<endl;
	return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;


int dx[8] = {-1,0,1,-1,1,-1,0,1};
int dy[8] = {-1,-1,-1,0,0,1,1,1};
int ans;

int card_count(vector<string> c){
	int cnt=0;
	for(int y=0 ; y < 5 ; y++ ){
		for(int x=0 ; x < 4 ; x++ ){
			if( c[y][x] != '*' )
				cnt++;
		}
	}
	return cnt;
}

void shift(vector<string>& c){
	string s;
	for(int y=0 ; y < 5 ; y++ ){
		for(int x=0 ; x < 4 ; x++ ){
			if( c[y][x] != '*' ){
				s.push_back( c[y][x] );
			}
		}
	}
	for(int y=0 ; y < 5 ; y++ ){
		for(int x=0 ; x < 4 ; x++ ){
			if( y*4 + x < s.size() ){
				c[y][x] = s[y*4+x];
			}else{
				c[y][x] = '*';
			}
		}
	}
}

void solve(vector<string> c, map< vector<string> , bool >& m){
	if( m[c] == true ) return;
	m[c] = true;

	for(int y=0 ; y < 5 ; y++ ){
		for(int x=0 ; x < 4 ; x++ ){
			if( c[y][x] == '*' ) continue;

			char ch = c[y][x];
			for(int i=0 ; i < 8 ; i++ ){
				int mx = x + dx[i];
				int my = y + dy[i];
				if( mx < 0 || my < 0 || mx >= 4 || my >= 5 ) continue;
				
				if( ch == c[my][mx] ){
					vector<string> c2 = c;
					c2[y][x] = '*';
					c2[my][mx] = '*';
					shift( c2 );
					int cnt = card_count( c2 );
					ans = min( ans , cnt );
					solve( c2 , m );
				}
			}
		}
	}
}

int main(){
	int n;
	cin >> n;
	for(int i=0 ; i < n ; i++ ){
		vector<string> c;
		map< vector<string> , bool > m;
		for(int y=0 ; y < 5 ; y++ ){
			string s;
			for(int x=0 ; x < 4 ; x++ ){
				char ch;
				cin >> ch;
				s.push_back( ch );
			}
			c.push_back( s );
		}
		ans = 20;
		solve( c , m );
		cout << ans << endl;
	}
}

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

namespace ConsoleApplication5
{
    class Program
    {
        static void Main(string[] args)
        {
            var word = Console.ReadLine().Split(' ');
            string S = Console.ReadLine();
            int N = int.Parse(word[0]);
            int K = int.Parse(word[1]);

            char[] str = S.ToCharArray();

            str[K - 1] = Char.ToLower(str[K - 1]);

            Console.WriteLine(str);
        }
    }
}

Measured memory_bytes: 11092
#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#define ll long long
#define vl vector<ll>
#define vvl vector<vector<ll> >
#define vvvl vector<vector<vector<ll> > >
#define vd vector<double>
#define vvd vector<vector<double> >
#define vvvd vector<vector<vector<double> > >
#define mod 1000000007
using namespace std;


int main(void){
    ll n; cin>>n;
    vl p(n);
    for(int i=0;i<n;++i) cin>>p[i];
    bool flag = true;
    for(int i=0;i<n-1;++i) if(p[i] > p[i+1]) flag = false;
    if(flag){
        cout<<"YES"<<endl;
        return 0;
    }
    for(int i=0;i<n;++i){
        for(int j=i+1;j<n;++j){
            ll t = p[i];
            p[i] = p[j];
            p[j] = t;
            bool flag = true;
            for(int k=0;k<n-1;++k){
                if(p[k] > p[k+1]){
                    flag = false;
                    break;
                }
            }if(flag){
                cout<<"YES"<<endl;
                return 0;
            }
            t = p[i];
            p[i] = p[j];
            p[j] = t;
        }
    }
    cout<<"NO"<<endl;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
N = int(input())
Tn = []
for _ in range(N):
    Tn.append(int(input()))

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

def lcm(x, y):
    return (x * y) // gcd(x, y)

ans = 0
for T in Tn:
    if ans > 0:
        ans = lcm(ans,T)
    else:
        ans = T

print(ans)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#include <unistd.h>
 
using namespace std;
 
typedef long long ll;
typedef pair<ll,ll> P;
 
long long int INF = 3e18;
const ll fact_table = 5000000;
double Pi = 3.1415926535897932384626;
 
//vector<ll> G[550010];
vector<P> tree[500010];
priority_queue <ll> pql;
priority_queue <P> pqp;
//big priority queue
priority_queue <ll,vector<ll>,greater<ll> > pqls;
priority_queue <P,vector<P>,greater<P> > pqps;
//small priority queue
//top pop
 
int dx[8]={1,0,-1,0,1,1,-1,-1};
int dy[8]={0,1,0,-1,1,-1,-1,1};
char dir[] = "DRUL";
//ll bit[500005];
//↓,→,↑,←
 
 
#define p(x) cout<<x<<"\n";
#define el cout<<endl;
#define pe(x) cout<<(x)<<" ";
#define ps(x) cout<<fixed<<setprecision(25)<<x<<endl;
#define pu(x) cout<<(x);
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define CLEAR(a) a = decltype(a)(); 
 
 
//ll mod = 998244353;
ll mod = 1000000007;
 
ll rui(ll number1,ll number2){
 
    if(number2 == 0){
        return 1;
    }else{
        ll number3 = rui(number1,number2 / 2);
        number3 *= number3;
        number3 %= mod;
        if(number2%2==1){
            number3 *= number1;
            number3 %= mod;
        }
        return number3;
    }
}
ll gcd(ll number1,ll number2){
 
    if(number1 > number2){
        swap(number1,number2);
    }
    if(number1 == 0 || number1 == number2){
        return number2;
    }else{
        return gcd(number2 % number1,number1);
    }
}
void YES(bool condition){
 
    if(condition){
        p("YES");
    }else{
        p("NO");
    }
    return;
}
void Yes(bool condition){
 
    if(condition){
        p("Yes");
    }else{
        p("No");
    }
    return;
}
 

ll fact[fact_table + 5],rfact[fact_table + 5];
 
void c3_init(){
    fact[0] = rfact[0] = 1;
    for(ll i=1; i<=fact_table; i++){
        fact[i] = (fact[i-1]*i) % mod;
    }
    rfact[fact_table] = rui(fact[fact_table],mod - 2);
    for(ll i=fact_table; i>=1; i--){
       rfact[i-1] = rfact[i] * i;
       rfact[i-1] %= mod;
    }
    return;}
ll c3(ll n,ll r){
    return (((fact[n] * rfact[r]) % mod ) * rfact[n-r]) % mod;}
 
ll n,m,num,sum,a,b,c,d,e,g,h,w,i,j,q,r,l;
ll k,idx,ans;
ll x[500005],y[500005],z[500005];
bool used[500005];
char s[500005];

int main(){
    cin >> n >> m;
    if((n + m) % 3 != 0){
        p(0);
        return 0;
    }
    ll time = (n + m ) / 3;
    n -= time;
    m -= time;
    if(n < 0 || m < 0){
        p(0);
        return 0;
    }
    c3_init();
    ll ans = c3(time, n);
    p(ans);
    return 0;
}


















Measured memory_bytes: 90624
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    int n = Integer.parseInt(new Scanner(System.in).nextLine());
    switch (n % 10) {
      case 3:
        System.out.print("bon"); break;
      case 0:
      case 1:
      case 6:
      case 8:
        System.out.print("pon"); break;
      default:
        System.out.print("hon"); break;
    }
  }
}

Measured memory_bytes: 35608
#include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <functional>

using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> P;
typedef vector<P> vpl;
#define rep(i,n) for(ll i=0; i<(n); i++)
#define REP(i,a,b) for(ll i=(a); i<(b); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const int inf = 1<<30;
const ll linf = 1LL<<62;
const int mod = 1e9+7;
const int MAX = 510000;
const int V = 100005;
ll dy[8] = {1,0,-1,0,1,-1,1,-1};
ll dx[8] = {0,1,0,-1,1,-1,-1,1};
const double pi = acos(-1);
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
template<typename T1,typename T2> inline void print2(T1 a, T2 b){cout << a << " " << b << endl;}
#define INT_MAX 1e9+7

int main(){
    ll n; cin >> n;
    vvl G(n);
    map<P,ll> mp;
    rep(i,n-1){
        ll a,b; cin >> a >> b; a--; b--;
        G[a].push_back(b);
        G[b].push_back(a);
        mp[P(a,b)] = i;
        mp[P(b,a)] = i;
    }
    queue<ll> q;
    q.push(0);
    vl ans(n-1);
    vector<bool> visit(n,false);
    while(!q.empty()){
        ll u = q.front(); q.pop();
        visit[u] = true;
        ll color = 1;
        ll c = -1;
        for(auto v : G[u]){
            if(visit[v]){
                c = ans[mp[P(u,v)]];
                break;
            }
        }
        for(auto v : G[u]){
            if(visit[v]) continue;
            if(c==color) color++;
            ans[mp[P(u,v)]] = color;
            color++;
            q.push(v);
        }
    }
    cout << *max_element(all(ans)) << endl;
    for(auto i : ans) cout << i << endl;
}


Measured memory_bytes: 19968
#include<iostream>
using namespace std;
int main(){
  int num;
  cin >> num;
  for (int i = 1; i <= 9; i++)
  {
    for (int j = 1; j <= 9;j++){
      if(num==i*j){
        cout << "Yes" << endl;
        
        return 0;
      }
    }
  }
  cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <numeric>
#include <array>
#include <cmath>
using namespace std;
//変数デバッグ
#define DEB(variable) cout << #variable << '=' << variable << endl

//for簡易表記(引数ミス防止)
#define FOR(LoopVariable,numberOFbegin,numberOFend) for (int LoopVariable = (numberOFbegin); (LoopVariable) < (numberOFend); (LoopVariable)++)
#define DEFOR(LoopVariable,numberOFbegin,numberOFend) for (int LoopVariable = (numberOFbegin); (LoopVariable) > (numberOFend); (LoopVariable)--)
#define REP(LoopVariable,numberOFend) for(int LoopVariable = 0;(LoopVariable)<(numberOFend);LoopVariable++)

constexpr long long int linf = numeric_limits<long long int>::max()-5;
constexpr int inf= numeric_limits<int>::max()-5;
constexpr long long int mod = 1000000007;

int main(){

    int n, t;
    cin >> n >> t;

    int nowtime, nexttime, result = 0;

    cin >> nowtime;
    FOR(i,1,n){
        scanf("%d", &nexttime);
        result += min(t, nexttime - nowtime);
        nowtime = nexttime;
    }
    result += t;
    cout << result << endl;

    return 0;
}


Measured memory_bytes: 504
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <utility>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <cmath>

#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define itrep(i,x) for(auto i=(x).begin(); i!=(x).end();i++)
#define Sort(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define vec vector
#define INF (int)1e9
#define INFL 1e18
#define MOD 1000000007
#define pb push_back
#define MP make_pair
#define PI 3.1415926535
typedef long long int ll;
typedef std::pair<int,int> P;
int D=1;
int dx[4]={0,1,0,-1},dy[4]={-1,0,1,0};

using namespace std;

bool isPrime(int x){
    if(x==1)return false;
    if(x==2)return true;
    if(x%2==0)return false;
    for(int i=3;i*i<=x;i++)if(x%i==0)return false;
    return true;
}

int main(){
    vector<int> prime;
    rep(i,1,1001)if(isPrime(i))prime.pb(i);
    map<int,int> mp;
    int n;
    cin>>n;
    rep(i,1,n+1){
        int ii=i;
        while(ii!=1){
            rep(j,0,prime.size()){
                if(ii<prime[j])break;
                if(ii%prime[j]==0){
                    mp[prime[j]]++;
                    ii/=prime[j];
                }
            }
        }
    }

    ll ans=1;
    for(auto x:mp){
        //cout<<x.first<<" "<<x.second<<endl;
        ans*=x.second+1;
        ans%=MOD;
    }
    cout<<ans<<endl;
    
    
    /*
    2:2
    3:3
    4:2^2
    5:5
    6:2 3

    2:4
    3:2
    5:1
    */


    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner; 
public class Main {
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		String line = in.nextLine();
		String[] Array = line.split(" ");
		int a = Integer.parseInt(Array[0]);
		int b = Integer.parseInt(Array[1]);
		int c = Integer.parseInt(Array[2]);
		if(a<b&&b<c&&a<c){
			System.out.println("Yes");
		}else{
			System.out.println("No");
		}
	}
}

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

int main() {
    bool c = false;
    int n, q, ans = 0;
    cin >> n;
    vector<int> S(n);
    for(int i = 0; i < n; i++) {
        cin >> S.at(i);
    }
    cin >> q;
    vector<int> T(q);
    for(int i = 0; i < q; i++) {
        cin >> T.at(i);
    }
    for(int i = 0; i < q; i++) {
        int l  = 0, r = n; 
        while(l+1 < r){
          int m=(l+r)/2;
          if(T.at(i) >= S.at(m)) l = m;
          else r = m;
        }
    if(S.at(l)!= T.at(i)) continue;
    ans++;
    }
    cout << ans << endl;
}


Measured memory_bytes: 3264
// https://atcoder.jp/contests/abc068/tasks/abc068_c
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()

int memo[200010];
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, m;
    cin >> n >> m;
    REP(i, m) {
        int a, b;
        cin >> a >> b;
        if (a == 1)
            memo[b]++;
        if (b == n)
            memo[a]++;
    }
    bool flag = false;
    REP(i, 200002) {
        if (memo[i] >= 2) {
            flag = true;
            break;
        }
    }
    cout << (flag ? "POSSIBLE\n" : "IMPOSSIBLE\n");
    return 0;
}


Measured memory_bytes: 1024
#include <algorithm>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
using ll = long long;
using P = pair<int, int>;

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

  ll ans = 0;
  ll b = 0;
  for (ll i = 0; i < n; i++) {
    if (s[i] == 'B') {
      b++;
    } else if(s[i]=='W') {
      ans += b;
    }
  }
  cout << ans;
  return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <string>
using namespace std;
int main()
{
	int n, a, b;
	cin >> n >> a >> b;
	string s;
	cin >> s;
	int suma = 0, sumb = 0;
	int len = s.length();
	for (int i = 0; i < len; i++)
	{
		if ('a' == s[i])
		{
			if (suma + sumb < a + b)
			{
				cout << "Yes" << endl;
				suma++;
			}
			else 
			{
				cout << "No" << endl;
			}
		}
		else if ('b' == s[i])
		{
			if (suma + sumb < a + b && sumb < b)
			{
				cout << "Yes" << endl;
				sumb++;
			}
			else
			{
				cout << "No" << endl;
			}
		}
		else
		{
			cout << "No" << endl;
		}
	}
	return 0;
}


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

int main(){
    ll n,k,q; cin>>n>>k>>q;
    vector<ll> a(q);
    rep(i,q) cin>>a[i];
    vector<ll> pa(n);
    rep(i,n) pa[i]=k-q;
    rep(i,q){
        pa[a[i]-1]++;
    }
    rep(i,n){
        if(pa[i]>0) cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
    return 0;
}


Measured memory_bytes: 2176
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mod 1000000007

int p[100010];
int cst[100010];

int find(int u){
    if(u==p[u]) return u;
    return p[u]=find(p[u]);
}

void merge(int u,int v){
    u=find(u),v=find(v);
    p[u]=v;
}

int main(){
   int n,m;
   cin>>n>>m;
   for(int i=1;i<=n;i++){
       cin>>cst[i];
       p[i]=i;
   }
   for(int i=0;i<m;i++){
       int q,w;
       cin>>q>>w;
       merge(q,w);
   }
   int dap=0;
   for(int i=1;i<=n;i++){
       if(find(i)==find(cst[i])) dap++;
   }
   cout<<dap<<endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
  string S, T;
  cin >> S >> T;

  vector<int> S_alpha(26), T_alpha(26);
  for (int i = 0; i < S.size(); i++)
    S_alpha[S[i] - 97]++;
  for (int i = 0; i < T.size(); i++)
    T_alpha[T[i] - 97]++;

  sort(S_alpha.begin(), S_alpha.end());
  sort(T_alpha.begin(), T_alpha.end());

  if (S_alpha == T_alpha) cout << "Yes" << endl;
  else cout << "No" << endl;

  return 0;
}

Measured memory_bytes: 776
#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
const int MAX =1e5 + 10;
typedef pair<int,int> pii;
int ans=1e9;
queue<pii>Q;
void solve(int N)
{
    int Map[N+5];
    for(int i=0;i<N;i++)Map[i]=1e9;

    Q.push({1,1});
    //int xx=0;
    while(!Q.empty())
    {
        /*xx++;
        if(xx>5000000)return;*/
        auto P = Q.front();

        Q.pop();

        for(int i=0;i<10;i++)
        {
            int rem = ((P.ff*10)%N + i%N)%N;
            int sod = P.ss + i;

            if(Map[rem]>sod)
            {
                //cout<<rem<<" "<<sod<<endl;
                Map[rem]=sod;
                Q.push({rem,sod});
                if(rem==0)ans = min(ans,sod);
            }
        }
    }
}
int main ()
{
    int N;
    cin >> N;
    solve(N);
    cout<<ans<<endl;
    return 0;
}


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

int main(){
    int a, b, c, tmp;
    cin >> a >> b >> c;
    
    if (a > b){
        tmp = a;
        a = b;
        b = tmp;
    }
    if (b > c){
        tmp = b;
        b = c;
        c = tmp;
    }
    if (c > a){
        tmp = c;
        c = a;
        a = tmp;
    }
    cout << a*10 + b + c << endl;
}

Measured memory_bytes: 256
a = list(input())
 
while len(a) >= 5:
    if a[-5:] == list('dream'):
        del a[-5:]
        continue
    if a[-7:] == list('dreamer'):
        del a[-7:]
        continue
    if a[-5:] == list('erase'):
        del a[-5:]
        continue
    if a[-6:] == list('eraser'):
        del a[-6:]
        continue
    break
 
if a == []:
    print('YES')
else:
    print('NO')

Measured memory_bytes: 50544
#pragma GCC optimize("Ofast")
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<string.h>
#include<math.h>
#include<map>
#include<iomanip>
#include<queue>

const long long INF = 1e17+7;
const long long MOD = 1e9+7;
const int SIZE=1e6+10;
const double PI=acos(-1);

using namespace std;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n,k;
	cin >> n >> k;
	vector<int> a(n);
	for(int i=0;i<n;i++){
		cin >> a[i];
	}
	sort(a.begin(),a.end());
	int sum=0;
	for(int i=0;i<k;i++){
		sum+=a[i];
	}
	cout << sum << endl;
	return 0;
}



Measured memory_bytes: 3624
import Control.Monad

import Data.Ord
import Data.List
import Data.Function
import Data.Maybe

import qualified Data.ByteString.Char8 as BS

import Debug.Trace

tuplify2 :: [a] -> (a, a)
tuplify2 (x:y:_) = (x, y)
tuplify2 _ = undefined

--readInt = fst . fromJust . BS.readInteger
--readIntTuple = tuplify2 . map readInt . BS.words
--readIntList = map readInt . BS.words
--
--getInt = readInt <$> BS.getLine
--getIntList = readIntList <$> BS.getLine
--getIntMatrix = map readIntList . BS.lines <$> BS.getContents
--getIntTuple = readIntTuple <$> BS.getLine
--getIntTuples = map readIntTuple . BS.lines <$> BS.getContents

readInt = read :: String -> Integer
readIntTuple = tuplify2 . map readInt . words
readIntList = map readInt . words

getInt = readInt <$> getLine
getIntList = readIntList <$> getLine
getIntMatrix = map readIntList . lines <$> getContents
getIntTuple = readIntTuple <$> getLine
getIntTuples = map readIntTuple . lines <$> getContents

main = do
  [n,m] <- getIntList
  as <- getIntList
  bcs <- getIntTuples
  let as' = sortBy (comparing Down) as
  let bcs' = sortBy (comparing Down `on` snd) bcs
  print $ f as' bcs' n

f _ _ 0 = 0
f as [] n = sum $ take (fromIntegral n) as
f as@(a:xs) bcs@((b,c):ys) n
  | n < 0 = undefined
  | a > c =
--      trace ("a = "++show(a)++show(as))
      a + f xs bcs (n-1)
  | b > n = n*c
  | otherwise =
--      trace ("(b,c) = "++show(b,c)++show(bcs))
      b*c + f as ys (n-b)

Measured memory_bytes: 116092
// Aizu 0269: East Wind
// 2017.9.12 bal4u@uu

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

#define PI  3.1415926535897932384626433832795

typedef struct { int x, y; } POS;
POS tree[3][13]; int u[3], d[3];

typedef struct { int x, y, c; } HOME;
HOME home[103]; int h;

typedef struct { int w, a; } WIND;
WIND wind[102]; int r;

int reach(int x, int y, int x0, int y0, int w, int a, int d)
{
	double xx, yy, r, angle, ww1, ww2;
	if (x == x0 && y == y0) return 1; 
	xx = x - x0, yy = y - y0, r = sqrt(xx*xx + yy*yy), angle = atan2(yy, xx);
	ww1 = PI*(w - 0.5*d)/180.0, ww2 = PI*(w + 0.5*d)/180.0;
	if (r <= a) {
		if (ww1 <= angle && angle <= ww2) return 1; 
		angle += 2*PI;
		if (ww1 <= angle && angle <= ww2) return 1; 
	}
	return 0;
}

int main()
{
	int i, j, k, m, max;

	while (scanf("%d%d", &h, &r) && h) {
		for (i = 0; i < h; i++) scanf("%d%d", &home[i].x, &home[i].y), home[i].c = 0;
		for (i = 0; i < 3; i++) scanf("%d", u+i);
		for (i = 0; i < 3; i++) scanf("%d", d+i);
		for (j = 0; j < 3; j++) for (i = 0; i < u[j]; i++)
			scanf("%d%d", &tree[j][i].x, &tree[j][i].y);
		for (i = 0; i < r; i++) scanf("%d%d", &wind[i].w, &wind[i].a);

		for (k = 0; k < r; k++) for (i = 0; i < h; i++) {
			for (j = 0; j < 3; j++) for (m = 0; m < u[j]; m++) {
				if (reach(home[i].x, home[i].y, tree[j][m].x, tree[j][m].y, wind[k].w, wind[k].a, d[j])) goto Next;
			}
			if (reach(home[i].x, home[i].y, 0, 0, wind[k].w, wind[k].a, d[0])) home[i].c++;
			Next:;
		}
		for (max = 0, i = 0; i < h; i++) if (home[i].c > max) max = home[i].c; 
		if (max == 0) puts("NA");
		else {
			for (k = 1, i = 0; i < h; i++) {
				if (home[i].c != max) continue;
				if (k) k = 0; else putchar(' ');
				printf("%d", i+1);
			}
			putchar('\n');
		}
	}
	return 0;
}

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

int main(){
	
	string s1;
	string s2;
	cin >> s1;
	cin >> s2;
	
	int i = 0;
	int j = 0;
	int count = 0;
	
	while(i < s1.size() && j < s2.size()){
		if(s1[i] != s2[j]){
			count++;
		}
		i++;
		j++;
	}
	
	cout << count << endl;
	return 0;
}

Measured memory_bytes: 3920
#include <iostream>
#include <cstdint>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <algorithm>

int main(void)
{
    int64_t num[3] = {9, 1000-100, 100000-10000};

    int64_t N;
    std::cin >> N;

    std::string str = std::to_string(N);

    int64_t ans = 0;
    switch (str.size()) {
    case 1:
        ans = N;
        break;
    case 2:
        ans = num[0];
        break;
    case 3:
        ans = num[0] + N - 100 + 1;
        break;
    case 4:
        ans = num[0] + num[1];
        break;
    case 5:
        ans = num[0] + num[1] + N - 10000 + 1;
        break;
    case 6:
        ans = num[0] + num[1] + num[2];
        break;
    }

    std::cout << ans << std::endl;

    return 0;
}

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

using namespace std;

int gcd(int x, int y){
  if(x < y) gcd(y,x);
  if(y == 0)return x;
  return gcd(y, x % y);
}

int main(){
  int n;cin >> n;
  vector<int>vec(n);
  vector<int>v1(n, 0);
  vector<int>v2(n, 0);
  for(auto && e : vec)cin >> e;
  for(int i = 1; i < n; ++i){
    v1[i] = gcd(v1[i - 1], vec[i - 1]);
    v2[n - i - 1] = gcd(v2[n - i], vec[n - i]);
  }
  int ans = 0;
  for(int i = 0; i < n; ++i){
    int x = gcd(v1[i], v2[i]);
    ans = ans < x ? x : ans;
  }
  cout << ans << endl;
}


Measured memory_bytes: 1408
#include <algorithm>
#include <iostream>
#include <limits.h>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string>
#include <vector>
#include <cstdio>
#include <iomanip>
#define ll long long
#define rep2(i,a,b) for(int i=a;i<=b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define rep3(i,a,b) for(int i=a;i>=b;i--)
#define REP(e,v) for(auto e:v)
#define queint queue<int>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pq priority_queue<int>//大きい順
#define pqg priority_queue<int,vec,greater<int>>//小さい順
#define pb push_back
#define vec vector<int>
#define vecvec vector<vector<int>>
#define vecll vector<ll>
#define vecvecll vector<vector<ll>>
#define bs binary_search
#define All(c) (c).begin(),(c).end()
#define mp make_pair
using namespace std;
int in(){int x;scanf("%d",&x);return x;}
ll lin() {ll x;scanf("%lld",&x);return x;}
char charin() {char c; cin>>c; return c;}
string strin() {string s; cin>>s; return s;}
int main(){
    int m=in(),d=in();
    ll ans=0;
    rep2(i,2,m)rep2(j,10,d){
        if((j%10)<=1)continue;
        if(j/10<=1)continue;
        if((j%10)*(j/10)==i)ans++;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
	// AtCoder Beginner Contest 122
	// https://atcoder.jp/contests/abc122/tasks
	public static void main(String[] args) {
		FastReader sc = new FastReader();
		String str = sc.next();
		
		switch (str) {
			case "A":
				System.out.println("T");
				break;
			case "C":
				System.out.println("G");
				break;
			case "G":
				System.out.println("C");
				break;
			case "T":
				System.out.println("A");
				break;
		}
	}
	
	static class FastReader { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() { 
            br = new BufferedReader(new InputStreamReader(System.in)); 
        } 
  
        String next() { 
            while (st == null || !st.hasMoreElements()) { 
                try { 
                    st = new StringTokenizer(br.readLine()); 
                } catch (IOException  e) { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() { 
            String str = ""; 
            try{ 
                str = br.readLine(); 
            } catch (IOException e) { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    } 
}


Measured memory_bytes: 19412
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <stack>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;

#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}

bool ans[100001];
vector<ll> op;
ll N;


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    cin >> N;
    
    ll times = 0;
    while(1){
        ll a = pow(6, times);
        ll b = pow(9, times);
        if(a > N) break;
        op.pb(a);
        if(b <= N) op.pb(b);
        times++;
    }
    
    rmsame(op);

    
    ans[0] = true;
    rep(res, N){
        for(ll i = N-1; i >=0; i--){
            if(ans[i]){
                rep(j, op.size()){
                    if(i + op[j] > N) break;
                    ans[i+op[j]] = true;
                }
            }
        }
        if(ans[N]) {
            cout << res+1 << endl;
            return 0;
        }
    }

    
    
    
    //cout << fixed << setprecision(16) << ans << endl;
    return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define G           \
    if (++ip == ie) \
        if (fread(ip = buf, 1, SZ, stdin))
using namespace std;
const int SZ = 1 << 19, N = 1e5 + 9, M = 2 * N;
char buf[SZ], *ie = buf + SZ, *ip = ie - 1;
inline int in()
{
    G;
    while (*ip < '-')
        G;
    int x = *ip & 15;
    G;
    while (*ip > '-')
    {
        x *= 10;
        x += *ip & 15;
        G;
    }
    return x;
}
int h[N], w[M], q[M], f[N], c[N], v[N];
int Getf(int x)
{
    return x == f[x] ? x : f[x] = Getf(f[x]);
}
void Dfs(int x, int op)
{
    c[x] = op;
    for (int y, i = h[x]; i; i = w[i])
        if ((y = q[i]) != f[x])
            f[y] = x, Dfs(y, -op), c[x] += c[y];
}
int main()
{
    int n = in(), m = in(), rt = 1, re = 1, p = 0, ans = 0;
    for (int i = 1; i <= n; ++i)
        f[i] = i;
    for (int p = 0, i = 1; i <= m; ++i)
    {
        int x = in(), y = in();
        if (Getf(x) != Getf(y))
            f[f[x]] = f[y];
        else
        {
            rt = x, re = y;
            continue;
        }
        w[++p] = h[x];
        q[h[x] = p] = y;
        w[++p] = h[y];
        q[h[y] = p] = x;
    }
    f[rt] = 0;
    Dfs(rt, 1);
    if (n == m)
    {

        p = 0;
        for (int i = re; i; i = f[i])
            v[++p] = c[i];
        if (p % 2)
        {
            if (c[rt] % 2)
                return puts("-1"), 0;
            for (int i = re; i; i = f[i])
                c[i] -= c[rt] / 2;
        }
        else
        {
            if (c[rt])
                return puts("-1"), 0;
            sort(v + 1, v + p + 1);
            for (int i = re; i; i = f[i])
                c[i] -= v[p / 2];
        }
    }
    else if (c[rt])
        return puts("-1"), 0;
    for (int i = 1; i <= n; ++i)
        ans += abs(c[i]);
    return cout << ans, 0;
}

Measured memory_bytes: 15004