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

int main(){
	int m;
	cin>>m;
	for(int i = 0; i < m; i++){
		string str[1000] = {}, temp;
		int si, count = 0, f;
		cin>>temp;
		
		si = temp.size();
		for(int j = 1; j < si; j++){
			string temp2[2][2] = {}, temp3[20] = {};
			int count2 = 0;
			for(int k = 0; k < j; k++){
				temp2[0][0] += temp[k];
				temp2[0][1] += temp[j-k-1];
			}
			for(int k = j; k < si; k++){
				temp2[1][0] += temp[k];
				temp2[1][1] += temp[si-(k-j)-1];
			}
			/*
			cout<<temp2[0][0]<<endl;
			cout<<temp2[0][1]<<endl;
			cout<<temp2[1][0]<<endl;
			cout<<temp2[1][1]<<endl;*/
			for(int k = 0; k < 8; k++)temp3[k] = temp2[k/4][(k/2)%2] + temp2[(k/4 + 1)%2][k%2];//cout<<temp3[k]<<" "<<k/4<<(k/2)%2<<(k/4 + 1)%2<<k%2<<endl;
			//cin>>f;
			for(int k = 0; k < 8; k++){
				f = 0;
				for(int l = 0; l < count; l++){
					if(temp3[k] == str[l]) f = 1;
				}
				if(f == 0)str[count++] = temp3[k];
			}
		}
		
		cout<<count<<endl;
	}
	return 0;
}


Measured memory_bytes: 3176
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define int ll
#define double long double
#define YES cout<<"YES"<<'\n'
#define NO cout<<"NO"<<'\n'
#define Yes cout<<"Yes"<<'\n'
#define No cout<<"No"<<'\n'
#define yes cout<<"yes"<<'\n'
#define no cout<<"no"<<'\n'
void YN(bool flg) {cout<<(flg?"YES":"NO")<<'\n';}
void Yn(bool flg) {cout<<(flg?"Yes":"No")<<'\n';}
void yn(bool flg) {cout<<(flg?"yes":"no")<<'\n';}
#define SORT(a) sort(a.begin(),a.end())
#define REVERSE(a) reverse(a.begin(),a.end())
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define out(n) cout << n << '\n'
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<VI> VVI;
const int MOD = 1000000007;
const long long INF = 10e10;
const double PI = acos(-1.0);
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; }
template<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); }
template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); }
template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); }
template<class T, class U>U COUNT(const T& a, const U& v) { return count(a.begin(),a.end(), v); }
template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); }
template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); }
int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; }
int POW(int a, int n) { int r = 1; while (n > 0) { if (n & 1)r *= a; a *= a; n >>= 1; }return r; }
int isPrime(int n){if(n<2){return 0;}for(int i=2; i*i<=n; i++){if(n%i==0){return 0;}}return 1;}
/*素因数分解*/map< int, int >prime_factor(int n){map< int, int > ret;for(int i = 2; i * i <= n; i++) {while(n % i == 0) {ret[i]++;n /= i;}}if(n != 1) ret[n] = 1;return ret;}
/*約数列挙*/vector<int> divisor(int n){vector<int> v; for(int i=1; i*i<=n; i++){if(n%i==0){v.push_back(i);if(i!=n/i){v.push_back(n/i);}}}sort(v.begin(),v.end()); return v;}
//----------------ライブラリとか----------------

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout<<fixed<<setprecision(15);

    int x; cin >> x;
    while(!isPrime(x)) x++;
    out(x);

    return 0;
}

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

// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i,n) cin >> a[i];
  vector<int> c(n+1);
  c[0] = 3;
  mint ans = 1;
  rep(i,n) {
    ans *= c[a[i]];
    c[a[i]]--;
    c[a[i]+1]++;
  }
  cout<<ans.x<<endl;
  return 0;
}


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

int main() {
	int a, b;

	cin >> a >> b;


	if( ( (a*b) % 2) != 0 ) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}

	return 0;
}


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

#define int long long
#define rep(i,a,n) for(int i = a; i < n; i++)
#define pb push_back
#define eb emplace_back
#define dump(x) cout << #x << " = " << (x) << endl
#define chk() cout << "now" << endl;
#define ALL(x) (x).begin(),(x).end()
#define SORT(c) sort((c).begin(), (c).end())
#define SORTG(c) sort(ALL(c), greater<int>());
#define fi first
#define se second
#define INF (1e9)

typedef pair<int,int> P;
typedef vector<int> vi;

int n,m;
vi l,r;

signed main() {
  cin>>n>>m;
  rep(i,0,m) {
    int L,R; cin>>L>>R;
    l.pb(L); r.pb(R);
  }

  SORTG(l);
  SORT(r);
  int ans;
  if(r[0]-l[0]<0) {
    ans=0;
  }else{
    ans=r[0]-l[0]+1;
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 2036
s = input() + 'R'

ans = [0 for _ in range(len(s)-1)]
cnt = 0
i = 0
while i < len(s)-1:
    cnt += 1
    if s[i] == 'R' and s[i+1] == 'L':
        ri = i
        li = i+1

    if s[i] == 'L' and s[i+1] == 'R':
        if cnt % 2 == 0:
            rval = cnt // 2
            lval = cnt //2
        
        else:
            if (i-ri) % 2 == 0:
                rval = cnt // 2 + 1
                lval = cnt // 2
            else:
                rval = cnt // 2
                lval = cnt // 2 + 1

        ans[ri] = rval
        ans[li] = lval
        cnt = 0

    i += 1

print(*ans)

Measured memory_bytes: 6408
import math

def main(x):
    if x == 2:
        return 2
    res = x
    while(1):
        if isSosuu(res):
            return res
        res += 1

def isSosuu(val):
    div = math.ceil(math.sqrt(val))
    for i in range(2,div+1):
        if val%i == 0:
            return False
    return True

x = int(input())
print(main(x))

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
const int dr[] = {-1, 0, 1, 0};
const int dc[] = {0, 1, 0, -1};

int dirs[300];
bool avils[4];

bool adira(int c) {
    if(c==0)
        return true;
    if(c < 0 && avils[1])
        return true;
    if(c > 0 && avils[3])
        return true;
    return false;
}

int main() {
    bool ans = false;
    dirs['N'] = 0;
    dirs['S'] = 2;
    dirs['E'] = 1;
    dirs['W'] = 3;
    string S ;
    cin >> S ;
    int r = 0, c = 0;
    for(char s : S) {
        int d = dirs[(int) s];
        r += dr[d];
        c += dc[d];
        avils[d] = true;
    }
    if(r==0 && c==0)
        ans |= true;
    else if(r==0)
        ans |= adira(c);
    else if(r < 0 && avils[2])
        ans |= adira(c);
    else if(r > 0 && avils[0])
        ans |= adira(c);
    printf("%s\n", ans? "Yes" : "No");  
}


Measured memory_bytes: 256
import java.util.Scanner;
import java.util.Arrays;

public class Main {

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

    void solve() {
        Scanner sc = new Scanner(System.in);
        String O = sc.next();
        String E = sc.next();
        char[] o = O.toCharArray();
        char[] e = E.toCharArray();
        int a = O.length() - E.length();
        for (int i = 0; i < E.length() + a; i++) {
            System.out.print(o[i]);
            if (i < E.length()) {
                System.out.print(e[i]);
            }
        }
        System.out.println();
    }
}

Measured memory_bytes: 23124
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
#define REP(var, a, b) for (int var = (a); var < (b); var++)
#define rep(var, n) for (int var = 0; var < (n); ++var)
#define ALL(c) (c).begin(), (c).end()
#define rALL(c) (c).rbegin(), (c).rend()
ll MOD = 1000000007;
ll INF = 1e18;
#define def 0

int main() {
  ll n;
  cin >> n;
  ll ans = 0;
  for (ll i = 1; i <= n; i++) {
    if (i * (i + 1) / 2 >= n) {
      ans = i;
      break;
    }
  }
  ll remove = ans * (ans + 1) / 2 - n;
  // cout << remove << endl;
  REP(i, 1, ans + 1) {
    if (i == remove) continue;
    cout << i << endl;
  }
  return 0;
}


Measured memory_bytes: 384
a = list(map(int,input().split()))
W = a[0] 
H = a[1] 
x = a[2]
y = a[3]
r = a[4]

if x-r < 0:
    print("No")
elif x + r > W:
    print("No")
elif y-r < 0:
    print("No")
elif y+r > H:
    print("No")
else:
    print("Yes")


Measured memory_bytes: 5596
#include<bits/stdc++.h>
     
    using namespace std;
     
    #define all(x) x.begin(), x.end()
    typedef vector<int> vi;
    typedef pair<int,int> ii;
    typedef long long ll;
     
    const ll inf = 3e18 + 5;
     
    const int MAXN = 1 << 19;
    int N = 400000;
    int seg[2 * MAXN], A[MAXN];
    typedef vector<vi> vvi;
     
    int main(){
        ios_base::sync_with_stdio(false);
        cin.tie(0);
     
        string a,b,c;
        cin >> a >> b >> c;
        cout << a[0] << b[0] << c[0];
    }

Measured memory_bytes: 256
import java.util.*;
public class Main {
	@SuppressWarnings("unchecked")
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int numNode = sc.nextInt();
		int numEdge = sc.nextInt();
		connect = new ArrayList[numNode];
		for(int i = 0; i < numNode; i ++) {
			connect[i] = new ArrayList<>();
		}
		for(int i = 0; i < numEdge; i ++) {
			int a = sc.nextInt() - 1;
			int b = sc.nextInt() - 1;
			connect[a].add(b);
			connect[b].add(a);
		}

		// System.err.println();
		// for(int i = 0; i < numNode; i ++) {
		// 	for(int j = 0; j < connect[i].size(); j ++) {
		// 		System.err.print(connect[i].get(j)+" ");
		// 	}
		// 	System.err.println();
		// }

		if(numEdge % 2 != 0) { System.out.println(-1); return; }

		visited = new int[numNode];
		odd = new boolean[numNode];
		print = new StringBuilder();
		dfs(0, -1);
		System.out.println(print);
	}

	static ArrayList<Integer> connect[];
	static int visited[];
	static boolean odd[];
	static StringBuilder print;
	static void dfs(int crt, int parent) {
		// System.err.println("crt:"+crt);
		visited[crt] = 1;
		ArrayList<Integer> crtConnect = connect[crt];
		for(int child : crtConnect) {
			// System.err.println("child:"+child);
			if(child == parent || visited[child] == 1) {
				continue;
			}else if(visited[child] == 2) {
				print.append((crt + 1)+" "+(child + 1)+"\n");
				odd[crt] = !odd[crt];
			}else {
				dfs(child, crt);
				if(odd[child]) {
					print.append((child + 1)+" "+(crt + 1)+"\n");
					odd[child] = !odd[child];
				}else {
					print.append((crt + 1)+" "+(child + 1)+"\n");
					odd[crt] = !odd[crt];
				}
			}
		}
		visited[crt] = 2;
	}
}

Measured memory_bytes: 133740
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scan = null;
	int[] num = new int[3];
	try {
	    scan = new Scanner(System.in);
	    for (int i = 0; i < num.length; i++) {
		num[i] = scan.nextInt();
	    }
	    Arrays.sort(num);
	    StringBuffer sortlist = new StringBuffer();
		for (int i = 0; i < num.length; i++) {
		    sortlist.append(num[i]);
		    if (i < num.length - 1) {
			sortlist.append(" ");
		    }
		}
	    System.out.println(sortlist);
	} catch (InputMismatchException e) {
	    System.out.println(e);
	} finally {
	    scan.close();
	}
    }
}

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


int main(){
    int N,L;
         
    vector<string> S(101);
    cin >> N >> L;
    for(int i=0;i<N;i++){
        cin >> S.at(i);      
    }

    sort(S.begin(),S.end());
    for(auto S_dash : S){
        cout << S_dash;
    }
    cout << endl;
}

Measured memory_bytes: 256
#include <cstdlib>
#include <iostream>
#include <string>
#include <time.h>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <iomanip>
#include <vector>
#include <functional>
#include <numeric>
#include <cassert>
#include <algorithm>
#include <functional>
//#include "bits/stdc++.h"
using namespace std;
//using namespace std::vector;
#define rep(i,a,b) for(ll i=(a);i<(b);++i)

#define huge 1000000007
typedef long long int ll;
ll gcd(ll a, ll b);
ll bur(ll N, ll X);


int main(void) {

	ll N = 0;
	ll A = 0;
	ll B = 0;
	ll C = 0;
	ll D = 0;
	ll X = 0;
	//ll T = 0;
	//ll M = 0;
	ll h[1000] = {};
	ll b[100] = {};
	//ll c[100] = {};
	//ll d[100] = {};

	//ll v[3] = {};
	//ll *c, *s, *n;
	string S,T,U[52];
	ll count = 0;
	ll count2 = 0;
	float sum = 0;
	ll min = 1000000000000;
	ll max = 0;
	ll smax = 0;
	ll max2 = 0;
	ll smax2 = 0;
	int tmax = 0;
	int tmax2 = 0;
	//int flag = 0;
	char temp,head;
	//int is = 0;
	bool flag = false;
	
	//char p;

	ll all = 0;
	ll niku = 0;
	ll state = 2;
	bool down = true;
	

	//cin >> S;
	
	//b = (ll *)malloc(M * sizeof(ll));
	//vector<pair<int,int>> ch(50);
	
	cin >> S;

	rep(i, 0, S.length()) {

		if (S[i] == 'B') {
			max++;
		}
		else {
			count += max;
		}
		//cout << max << endl;

	}
	
	


	

	
		cout << count << endl;

	//x = (ll *)malloc((N+1) * sizeof(ll));
	//c = (ll *)malloc((N) * sizeof(ll));
	//cin >> D >> G;
	//vector<pair<int,int>> tr(M);
	//vector<pair<int,int>> qes(Q);
	//sort(c.begin(), c.end());
	
	//cout << c[2] - c[1] << endl;

	
	/*A = N / 1000;
	N %= 1000;
	B = N / 100;
	N %= 100;
	C = N / 10;
	N %= 10;
	D = N;*/
	


	//cin >> N >> M;

	//vector<pair<int,int>> c(M);
	////vector<pair<int, int>> e(M);
	//vector<ll> d(M);

	//rep(i, 0, M) {
	//	cin >> c[i].first >> c[i].second;
	//	//e[i].first = c[i].first;
	//	//e[i].second = c[i].second;

	//}
	////sort(c.begin(), c.end());

	//

	//rep(i, 0, M) {

	//	
	//	
	//	rep(j, 0, M) {
	//		if (c[i].first == c[j].first && c[j].second < c[i].second) {
	//			d[i]++;
	//			//cout << j << endl;
	//		}
	//	}
	//	cout << std::setfill('0') << std::right << std::setw(6) << c[i].first;
	//	cout << std::setfill('0') << std::right << std::setw(6) << d[i]+1 << endl;
	//}

	return 0;

}

ll bur(ll N,ll X) {
	ll pan = 1;
	ll pat = 1;
	ll burg = 0;



	if (X > burg) {
		if (N == 0)
			return pat;


		burg += pan;
		burg += bur(N - 1, X);
		burg += pat;
		burg += bur(N - 1, X);
		burg += pan;


	}

	return burg;

}

ll gcd(ll a, ll b) {
	
	/* 自然数 a > b を確認・入替 */
	if (a<b) {
		ll tmp = a;
		a = b;
		b = tmp;
	}
	ll x = b;
	ll y = a;
	/* ユークリッドの互除法 */
	ll r = a % b;
	while (r != 0) {
		a = b;
		b = r;
		r = a % b;
	}


	return y/b*x;
}



Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
int n,h,ans,c;
int main () {
	scanf("%d%d",&n,&h);
	for (int i=1;i<=n;i++) {
		scanf("%d",&c);
		ans+=(c>=h);
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii =  pair<int, int>;
using pll =  pair<long long, long long>;
constexpr char ln =  '\n';
constexpr long long INF = 1000000009LL;
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
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 main() {
    int n; cin >> n;
    ll res = 0;
    map<int, int> L,R;
    rep(i, n){
        int a; cin >> a;
        int l = i+a, r = i-a;
      res += L[r];
      res += R[l];
      L[l]++;
      R[r]++;
    }
    cout << res << ln;
}


Measured memory_bytes: 37692
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    while True:
        n = II()
        if not n:
            break
        a = IR(n)
        a.sort()
        print(sum(a[1:-1])//(n-2))
            
    return

#B
def B():
    move = [[1, 0], [-1, 0], [0, 1], [0, -1]]
    while True:
        w, h = LI()
        if w == h == 0:
            break
        field = SR(2 * h - 1)
        check = [[True] * (2 * w - 1) for i in range(2 * h - 1)]
        next = deque()
        next.append((0, 0))
        ans = 1
        flg = True
        
        while next and flg:
            now = next
            next = deque()
            while now:
                x, y = now.pop()
                for mx, my in move:
                    mmx, mmy = x + mx, y + my
                    if 0 <= mmx < 2 * w - 1 and 0 <= mmy < 2 * h - 1:
                        if field[mmy][mmx] == '0' and check[mmy+my][mmx+mx]:
                            next.append((mmx + mx, mmy + my))
                            check[mmy + my][mmx + mx] = False
                            if mmx+mx == 2 * w - 2 and mmy+my == 2 * h - 2:
                                print(ans+1)
                                flg = False
                                next = deque()
                                now = deque()
                                break
            ans += 1
        if flg:
            print(0)
    return

#C
def C():
    while 1:
        r, n = LI()
        if r == n == 0:
            break
        lis = [0 for i in range(2 * r)]
        ans = inf
        for _ in range(n):
            xl, xr, h = LI()
            for i in range(2 * r):
                if xl+r <= i < xr+r:
                    lis[i] = max(lis[i], h)
        for i in range(2 * r):
            if i < r:
                ans = min(ans, r - math.sqrt((r ** 2 - (r - i - 1)** 2)) + lis[i])
            else:
                ans = min(ans, r - math.sqrt((r ** 2 - (r - i)** 2)) + lis[i])
        print(ans)
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    C()



Measured memory_bytes: 8272
#include <stdio.h>
#define N 100

int main()
{
	int M[N][N];
	int n;
	scanf("%d", &n);

	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			M[i][j] = 0;
		}
	}

	int u, v, k;
	for (int i = 0; i < n; i++)
	{
		scanf("%d%d", &u, &k);
		u--; // 0オリジンへ変換
		
		for (int j = 0; j < k; j++)
		{
			scanf("%d", &v);
			v--; // 0オリジンへ変換
			M[u][v] = 1;
		}
	}

	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			if (j > 0)printf(" ");
			printf("%d", M[i][j]);
		}
		printf("\n");
	}
	return 0;
}


Measured memory_bytes: 2752
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
	    
	    int result[] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
		int K = scanner.nextInt();
	    System.out.println(result[K-1]);
	}
}

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

using namespace std;

int solve() {
  int N;
  cin >> N;

  vector<pair<int, int>> R(N);
  for (int i = 0; i < N; i++) {
    int X, L;
    cin >> X >> L;

    R[i] = make_pair(X - L, X + L);
  }

  sort(R.begin(), R.end());

//  for (int i = 0; i < N; i++) {
//    cout << R[i].first << " " << R[i].second << endl;
//  }

  int c = 0;
  for (int i = 0; i < N - 1; i++) {
    if (R[i].second > R[i+1].first) {
      c++;

      if (R[i].second < R[i+1].second) {
        swap(R[i], R[i+1]);
      }
    }
  }

  return N - c;
}

int main() {
  cout << solve() << endl;

  return 0;
}


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

#define EPS (1e-10)
#define rep(i, a, b) for (int i = a; i < (int)(b); ++i)
#define rrep(i, a, b) for (int i = b - 1; i >= (int)(a); --i)
#define all(a) a.begin(), a.end()

using namespace std;
using ll = long long;
using vi = vector<int>;
using vb = vector<bool>;
using vll = vector<ll>;
using vd = vector<double>;
using vvi = vector<vi>;
using vvb = vector<vb>;

constexpr int MOD = 1000000007;

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

    int n, k, q;
    cin >> n >> k >> q;

    vi point(n, 0);
    rep(_, 0, q) {
        int a;
        cin >> a;
        ++point[a - 1];
    }

    rep(i, 0, n) { cout << (point[i] > q - k ? "Yes" : "No") << endl; }

    return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#include<bitset>
#include<string>
using namespace std;
#include <numeric> 
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using pi=pair<long long,long long>;
#define pii 3.1415926536
#define binary
#define mod 1000000007
typedef long long ll;
typedef long double ld;
bool sortbysec(const pair<long long,long long> &a, 
              const pair<long long,long long> &b) 
{ 
    return (a.first < b.first); 
}
bool compare(const pair<pair<ll,ll>,ll> &a,const pair<pair<ll,ll>,ll>&b)
{
    if(a.first.first==b.first.first)return (a.first.second<b.first.second);
    return (a.first.first < b.first.first); 
}
 int lcm(int a, int b)  
 {  
    return (a*b)/__gcd(a, b);  
 }  
 int Kad(ll dp[],ll n)
{
  ll curr_max=0,maxx=INT_MIN;
  for(int i=0;i<n;i++)
  {
    curr_max=curr_max+dp[i];
    if(curr_max>maxx)
      maxx=curr_max;

    if(curr_max<0)
      curr_max=0;
   
  }

  return maxx;
}

/*void dfs(int u)
{
    vis[u]=true;
    //cout<<u<<" ";
    std::vector<ll> ::iterator i;
     for (i = g[u].begin(); i != g[u].end(); ++i) 
        if (!vis[*i]) 
            dfs(*i); 
    for(int i=1;i<g[u].size();i++)
    {
        if(!vis[g[u][i]])
        {
            dfs(i);
        }
    }
}*/


int main(){
    IOS;
     #ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  freopen("error.txt", "w", stderr);
  #endif  
  ll n;
  cin>>n;
  ll ans=0;
  ll x=7;
  if(n%2==0)
  {
    cout<<-1<<endl;
    return 0;
  }
  for(int i=1;i<=1000005;i++)
  {
    ans++;
    if((x)%n==0)
    {
        cout<<ans<<endl;
        return 0;
    }
    x=(x*10+7)%n;
    
  }
    cout<<-1<<endl; 
  }

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

int main() {
int N;

cin >> N;

 vector<int> A(N);
 vector<int> B(N);
  for (int h = 0; h < N; h++) {
    cin >> A.at(h);
  }

  for (int h = 0; h < N; h++) {
B.at(A.at(h) - 1) = h + 1;
}

for (int h = 0; h < N; h++) {
cout << B.at(h) << " "  ;
}
cout << endl;
}


Measured memory_bytes: 1664
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = (s); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) for(int i = (n); i >= 0; i--)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << '\n';
#define CFYN(n) cout << ( (n) ? "YES":"NO") << '\n';
#define OUT(n) cout << (n) << '\n';
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

int main(void)
{
    IOS
    ll n, k;
    cin >> n >> k;
    ll x = n % k;
    x = min(x,k-x);
    ll ans = min(abs(n-k),x);

    cout << ans << '\n';

    return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    int k = sc.nextInt();    
    
    int ans = 0;
    
    while(n>0){
      n = n/k;
      ans++;
    }

    System.out.println(ans);
    
  }
}

Measured memory_bytes: 35680
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
 


public class Main {
	private static Scanner sc = new Scanner(System.in);
	//result = Math.pow(num1, num3)
	//StringBuffer str = new StringBuffer(hoge1);
	//String hoge2 = str.reverse().toString();
	//map.containsKey(A)

	//Map<String, Integer> map = new HashMap<String, Integer>(n);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> qq=new ArrayDeque<>();//push,pop,peek
	//ArrayList<String> cc = new ArrayList<>(n);
	//Collections.sort(list);
	//Array.sort(list);   cc.contains(tmp)
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");//1 1 2 3 5
	//static long mod =1000000007;
	//static 	ArrayList<Integer> cc = new ArrayList<>(100);
	
	
	
	public static void main(String[] args) {
		//int N=sc.nextInt();for(int i=0;i<N;i++) {}
		//M 77 || //A 65 || //R 82 || //C 67 || //H 72 || 
		
		long N=sc.nextInt();
		long M=sc.nextInt();
		String S=sc.next();
		String T=sc.next();
		
		
		
		if(S.charAt(0)!=T.charAt(0))p(-1);
		else {
			boolean x=true;
			long L=lcm(N,M);
			
			Map<Long, Integer> map = new HashMap<Long, Integer>((int) N);
			
			
			
			for(int i=1;i<N;i++) {
				map.put(i*(L/N)+1, i);
				
			}
			
			for(int i=1;i<M;i++) {
					if(map.containsKey(i*(L/M)+1)) {
						if(S.charAt(map.get(i*(L/M)+1))!=T.charAt(i)) {
							x=false;
							break;
						}
					}
				}
			if(x) p(L);
			else p(-1);
		}
		
		
	}

	

	public static long gcd(long a, long b) {
        return b == 0 ? a: gcd(b, a % b);
	}
	public static long lcm(long n, long m) {
        return n / gcd(n, m) * m;
}
	
	

	


	
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p() {System.out.println();};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
	
}
	


Measured memory_bytes: 33852
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void){

    int N;
    int num[101];
    int max=0;
    int count=0;
    scanf("%d",&N);
    
    for(int i=0;i<N;i++)
    {
        scanf("%d",&num[i]);
    }
    
    for(int i=0;i<N;i++)
    {
        if(max<num[i])
        {
            max=num[i];
        }
    }
    for(int i=0;i<N;i++)
    {
        count=count+num[i];    
    }
    
    count=count-max;
    
    if(max>=count)
    {
        printf("No\n");
    }
    else
    {
        printf("Yes\n");
    }

    
    return 0;
}


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

using namespace std;

#define INF 1000000000
#define pb(a) push_back(a)
#define vi vector<int>
#define vvi vector<vi>
#define P pair<int,int>
#define all(vec) (vec.begin()),(vec.end())
#define ll long long
#define sz(x) ((int)(x).size())
#define in(x) int x;cin>>x;
#define bit(n) (1<<(n))

#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i, n) for(int i = n;i >= 0;--i)
#define REP3(i, m, n) for(int i = m, i##_len=(n);i < i##_len;++i)
#define FORVEC(i, v) for(int i = 0;i < sz(v);++i)

#define fil0(i,n) cout<<swet(n)<<setfill('0')<<i<<resetiosflags(ios_base::floatfield)


int a,b;

int main(){
    cin>>a>>b;
    if(a>8||b>8)cout<<":("<<endl;
    else cout<<"Yay!"<<endl;

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;


int main(){
  int a, b, c, x = 0;
  cin >> a >> b >> c;

  for(int i = a; i <=b; i++){
    if( c%i == 0){
      x += 1;
     }
   }
    cout << x << endl;
  
  return 0;

}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define ll long long
using namespace std;
//typedef vector<unsigned int>vec;
//typedef vector<ll>vec;
//typedef vector<vec> mat;
typedef pair<int, int> P;
typedef pair<ll,ll> LP;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int INF = 1000000000;
const ll LINF = 1000000000000000000;//1e18
const ll  MOD = 1000000007;
const double PI = acos(-1.0);
const double EPS = 1e-10;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
//template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S, T;
    string U;
    int A, B;
    cin >> S >> T >> A >> B >> U;
    if(S == U) A--;
    else B--;
    cout << A << " " << B << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
//prototype
int main(void);
double height_cal(double, double);
double width_cal(double, double);
double distance_cal(double, double);

int main(void){
  double P_x, P_y, Q_x, Q_y;
  double height, width;
  double distance;

  scanf("%lf %lf %lf %lf", &P_x, &P_y, &Q_x, &Q_y);

  width = width_cal(P_x, Q_x);
  height = height_cal(P_y, Q_y);

  distance = distance_cal(height, width);

  printf("%lf\n", distance);

  return 0;
}

double width_cal(double P, double Q){
  double w;
  if(P >= Q){
    w = P - Q;
  }
  else{
    w = Q - P;
  }
  return w;
}

double height_cal(double P, double Q){
  double h;
  if(P >= Q){
    h = P - Q;
  }
  else{
    h = Q - P;
  }
  return h;
}

double distance_cal(double h, double w){
  double ans;
  if(h == 0 || w == 0){
    if (h >= w) {
      ans = h;
    }
    else{
      ans = w;
    }
  }
  else{
    ans = sqrt(pow(h, 2.0) + pow(w, 2.0));
  }

  return ans;
}



Measured memory_bytes: 2024
#include "bits/stdc++.h"
using namespace std;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	
	int n;
	cin >> n;
	cout << (n%1000 == 0 ? 0 : (1 + n/1000)*1000 - n);
}

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

using namespace std;
using ll =long long;
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define debug(x)  cerr << #x << " = " << (x) << endl;
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; }
static const ll INF = 1LL << 60;
//Write From this Line

const int limit = 50;

int n, m;
int a[limit], b[limit];

bool graph[limit][limit];
bool visited[limit];

void dfs(int v){
	visited[v] = true;
	for (int v2 = 0; v2 < n; v2++) {
		if (graph[v][v2] == false) continue; // vとv2をつなぐ辺が無いよ
		if (visited[v2] == true) continue;
		dfs(v2);
	}
}
int main()
{
	cin >> n >> m;

	rep(i,m){
		cin >> a[i] >> b[i];
		a[i]--,b[i]--;
		graph[a[i]][b[i]] = graph[b[i]][a[i]] = true;
	}

	int ans = 0;
	for (int i = 0; i < m; ++i) {
		graph[a[i]][b[i]] = graph[b[i]][a[i]] = false;
		for (int j = 0; j < n; j++) visited[j] = false;

		dfs(0);

		bool bridge = false;
		for (int j = 0; j < n; j++) if (visited[j] == false) bridge = true;
		if(bridge) ans ++ ;

		graph[a[i]][b[i]] = graph[b[i]][a[i]] = true;
	}
	cout << ans << endl;
}


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

void solve() 
{
    int n;cin>>n;
    int h[n];REP(i,n)cin>>h[i];
    vector<int>ans(n,0);ans[0]=0;
    rep(i,1,n){
        if(h[i-1]>=h[i])ans[i]=ans[i-1]+1;
        else ans[i]=0;
    }
    int a=0;
    REP(i,n)a=max(a,ans[i]);
    cout<<a<<endl;
}

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

Measured memory_bytes: 1024
macro_rules! scan_sub {
    ( $itr:ident, $t:ty ) => {
        let mut buf = String::new();
        let $itr = {
            while buf.trim().len() == 0 {
                buf = String::new();
                std::io::stdin().read_line(&mut buf).unwrap();
            }
            buf.split_whitespace().map(|n| n.parse::<$t>().unwrap())
        };
    };
}

macro_rules! scan {
    ( $x:ident; Vec<$t:ty> ) => {
        scan_sub!(itr, $t);
        let $x = itr.collect::<Vec<_>>();
    };
    ( $( $x:ident ),*; $t:ty ) => {
        scan_sub!(itr, $t);
        let mut itr = itr;
        $(
            let $x = itr.next().unwrap();
        )*
    };
}

fn gcd(a: u64, b: u64) -> u64 {
    let (mut a, mut b) = if a < b { (a, b) } else { (b, a) };

    while a > 0 {
        let (t, u) = (b % a, a);
        a = t;
        b = u;
    }

    return b;
}

fn lcm(a: u64, b: u64) -> u64 {
    let g = gcd(a, b);
    return a * b / g;
}

fn main() {
    scan!(n, m; usize);
    let m = m as u64;
    scan!(array; Vec<u64>);
    let mut max_two_num = std::u64::MAX;
    let mut array = array.into_iter()
        .map(|i| {
            let mut c = i;
            let mut num = 0;
            while c % 2 == 0 {
                c /= 2;
                num += 1;
            }
            if num < max_two_num {
                max_two_num = num;
            }
            i / 2
        }).collect::<Vec<_>>();
    max_two_num -= 1;
    array.sort();
    let array = array;

    let mut l = array[0];
    for i in 1..n {
        l = lcm(l, array[i]);
    }
    let l = l;

    let mut t = 1;
    let mut u;
    let mut ans = 0;
    loop {
        u = l * t;
        if u > m { break; }
        t += 2;
        let mut c = u;
        let mut num = 0;
        while c % 2 == 0 {
            c /= 2;
            num += 1;
        }
        if num <= max_two_num {
            ans += 1;
        }
    }

    println!("{}", ans);
}


Measured memory_bytes: 8444
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> iint;
typedef pair<ll,ll> llll;
#define ALL(x) (x).begin(),(x).end()
const ll zero = 0;
const ll INF = 3000000000000000000; //10^18
const int inINF = 1000000000; //10^9
const ll MOD = 1000000007; //10^9+7
const ll MOD2 = 998244353;

int main(){
    int N;
    cin >> N;
    string S;
    cin >> S;
    vector<int> cnt(26, 0);
    for (int i = 0; i < N; i++) {
        cnt[ S[i] - 'a' ]++;
    }
    ll ans = 1;
    for (int i = 0; i < 26; i++) {
        ans = ans * (cnt[i] + 1) % MOD;
    }
    ans--;
    printf("%lld\n", ans);
}

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

int main () {
  int x, y;
  cin >> x >> y;
  
  if (x == 2) cout << "No" << endl;
  else if (x == 4 || x == 6 || x == 9 || x == 11) {
    if (y == 4 || y == 6 || y == 9 || y == 11) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
  else {
    if (y == 2 || y == 4 || y == 6 || y == 9 || y == 11) cout << "No" << endl;
    else cout << "Yes" << endl;
  }
}

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

using namespace std;
using namespace __gnu_pbds;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef long double ld; 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;

struct DSU
{
	int S;
	
	struct node
	{
		int p; ll sum;
	};
	vector<node> dsu;
	
	DSU(int n)
	{
		S = n;
		for(int i = 0; i < n; i++)
		{
			node tmp;
			tmp.p = i; tmp.sum = 1;
			dsu.pb(tmp);
		}
	}
	
	void reset(int n)
	{
		dsu.clear();
		S = n;
		for(int i = 0; i < n; i++)
		{
			node tmp;
			tmp.p = i; tmp.sum = 1;
			dsu.pb(tmp);
		}
	}
	
	int rt(int u)
	{
		if(dsu[u].p == u) return u;
		dsu[u].p = rt(dsu[u].p);
		return dsu[u].p;
	}
	
	void merge(int u, int v)
	{
		u = rt(u); v = rt(v);
		if(u == v) return ;
		if(rand()&1) swap(u, v);
		dsu[v].p = u;
		dsu[u].sum += dsu[v].sum;
	}
	
	bool sameset(int u, int v)
	{
		if(rt(u) == rt(v)) return true;
		return false;
	}
	
	ll getstat(int u)
	{
		return dsu[rt(u)].sum;
	}
};

DSU dsu(100001);
vi vec[100001];
int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	int n, m;
	cin>>n>>m;
	for(int i = 0;i<n;i++)
	{
		int x;cin>>x;
		for(int j=0;j<x;j++)
		{
			int y;cin>>y;
			y--;
			vec[y].pb(i);
		}	
	}
	for(int i =0;i<m;i++)
	{
		for(int j =1;j<vec[i].size();j++)
		{
			//cerr<<i<<' '<<vec[i][j]<<' '<<vec[i][j-1]<<'\n';
			dsu.merge(vec[i][j],vec[i][j-1]);
		}
	}
	//cerr<<dsu.dsu[rt].sum<<'\n';
	if(dsu.getstat(0)==n)
	{
		cout<<"YES\n";
	}
	else
	{
		cout<<"NO\n";
	}
}


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

#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")

#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cout << name << ": " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<"| ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

#define boost ios::sync_with_stdio(0); cin.tie(0);
#define int long long

const int N = 2e5 + 10;
const int mod = 1e9 + 7;

int n;
pair<int,int> a[N];

bool cmp( pair<int,int> &a , pair<int,int> &b){
	
	if(a.second == b.second){
		return a.first < b.first;
	}

	return a.second < b.second;
}

int32_t main(){
    boost;
    
    //code
    cin >> n;

    for(int i = 0 ; i < n ; ++i){
    	cin >> a[i].first >> a[i].second;
    }

    sort(a,a+n,cmp);

    int t = 0;
    for(int i = 0 ; i < n ; ++i){
    	t += a[i].first;

    	if(t > a[i].second){
    		cout << "No";
    		return 0;
    	}
    }

    cout << "Yes";
    return 0;
}

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

int main(){
int n;
cin >> n;
vector<int> a(n);
for(int i=0;i<n;i++){
  cin >> a.at(i);
}
sort(a.begin(),a.end());
int check =1;
for(int i=0;i<n-1;i++){
  if(a.at(i)!=a.at(i+1)){
    check++;
  }
}
cout << check << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define MOD 1000000007
int main(){
  ll n;
  cin>>n;
  ll a[n],b[n];
  vector<ll> p(n),pp(n);
  for(int i=0;i<n;i++){
    cin>>p[i];
    pp[p[i]-1]=i;
  }
  for(int i=0;i<n;i++){
    a[i]=30000*(i+1);
    b[i]=30000*(n-i+1)+pp[i];
  }
  for(int i=0;i<n;i++) cout<<a[i]<<" ";
  cout<<endl;
  for(int i=0;i<n;i++) cout<<b[i]<<" ";
}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
//---------------------------
using namespace std;
//---------------------------
#define REP(i,n) for(int i = 0; i < (n); i++)
#define P(x) cout << (x) << "\n"
#define fcout cout << fixed << setprecision(18)

#define MOD 1000000007 // 1e9+7
#define PI 3.1415926535
/*
3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679
*/
#define ll long long int // 10^18
#define INF 1000000001 // 1e9+1
#define LINF 1000000000000000001 // 1e18+1

int dx[4]={1,-1,0,0};
int dy[4]={0,0,1,-1};
//---------------------------

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

  // ifstream in("input.txt");
  // cin.rdbuf(in.rdbuf());

  int n;string a,b,c;
  cin>>n>>a>>b>>c;
  ll sm=0;
  REP(i,n){
    set<char> s;
    s.insert(a[i]);
    s.insert(b[i]);
    s.insert(c[i]);
    if(s.size()==1){
      sm+=0;
    }else if(s.size()==2){
      sm+=1;
    }else{
      sm+=2;
    }
  }
  P(sm);
  return 0;
}


Measured memory_bytes: 256
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
#![macro_use]

use std::cmp::*;
use std::collections::*;
use std::io::*;
use std::mem::*;
use std::num::*;
use std::slice::*;
fn main() {
    let mut io = IO::new(stdin(), stdout(), stderr());
    // ===================================== //
    let n: isize = io.read();
    let mut x: isize = io.read();
    let mut a = io.readn::<isize>(n as usize);
    a.sort();
    let mut ans = 0;
    for &i in a.iter() {
        if x >= i {
            ans += 1;
            x -= i;
        } else {
            break;
        }
    }
    if ans == n && x > 0 {
        ans -= 1;
    }
    io.writeln(ans);
}

// IO
struct IO<R: Read, W: Write, E: Write> {
    Read: R,
    Write: BufWriter<W>,
    Error: BufWriter<E>,
}
impl<R: Read, W: Write, E: Write> IO<R, W, E> {
    fn new(r: R, w: W, e: E) -> IO<R, W, E> {
        IO {
            Read: r,
            Write: BufWriter::new(w),
            Error: BufWriter::new(e),
        }
    }
    fn read<T>(&mut self) -> T
    where
        T: std::str::FromStr,
    {
        let next: String = self
            .Read
            .by_ref()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect();
        next.parse().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
    fn readn<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read::<T>()).collect::<Vec<_>>()
    }
    fn readmat<T: std::str::FromStr>(&mut self, n: usize, m: usize) -> Vec<Vec<T>> {
        (0..n).map(|_| self.readn(m)).collect()
    }
    fn write<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
    }
    fn writeln<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
        self.Write.write(b"\n");
    }
    fn debug<S: std::fmt::Debug>(&mut self, val: S) {
        writeln!(self.Error, "(debug) {:?}", &val);
    }
}


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

#define reg register
#define pr std::pair<int, int>
#define fi first
#define se second
#define FIN(s) freopen(s, "r", stdin)
#define FOUT(s) freopen(s, "w", stdout)
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define rep(i, l, r) for (int i = l; i <= r; ++i)
#define lep(i, l, r) for (int i = l; i < r; ++i)
#define irep(i, r, l) for (int i = r; i >= l; --i)
#define ilep(i, r, l) for (int i = r; i > l; --i)
#define Rep(i, n) rep(i, 1, n)
#define Lep(i, n) lep(i, 1, n)
#define IRep(i, n) irep(i, n, 1)
#define ILep(i, n) ilep(i, n, 1)
typedef long long ll;
typedef long double ld;

namespace modular {
    const int MOD = 998244353;
    inline int add(int x, int y) { return (x += y) >= MOD ? x -= MOD : x; }
    inline void inc(int &x, int y) { (x += y) >= MOD ? x -= MOD : 0; }
    inline int mul(int x, int y) { return 1LL * x * y % MOD; }
    inline int qpow(int x, int y) {
        int ans = 1;
        for (; y; y >>= 1, x = mul(x, x))
            if (y & 1) ans = mul(ans, x);
        return ans;
    }
};  // namespace modular
using namespace modular;

namespace Base {
    template <typename Tp>
    inline Tp input() {
        Tp x = 0, y = 1;
        char c = getchar();
        while ((c < '0' || '9' < c) && c != EOF) {
            if (c == '-') y = -1;
            c = getchar();
        }
        if (c == EOF) return 0;
        while ('0' <= c && c <= '9') x = x * 10 + c - '0', c = getchar();
        return x *= y;
    }
    template <typename Tp>
    inline void read(Tp &x) {
        x = input<Tp>();
    }
    template <typename Tp>
    inline void chmax(Tp &x, Tp y) {
        x < y ? x = y : 0;
    }
    template <typename Tp>
    inline void chmin(Tp &x, Tp y) {
        x > y ? x = y : 0;
    }
};  // namespace Base
using namespace Base;
/*----------------------------------------------------------------------------*/

#define MAX_N 1000007

int N, M;
int fac[MAX_N], ifac[MAX_N], pwn[MAX_N], pwm[MAX_N];

void init() {
    int MX = 1000000;
    fac[0] = ifac[0] = pwn[0] = pwm[0] = 1;
    Rep(i, MX) {
        fac[i] = mul(fac[i - 1], i);
        pwn[i] = mul(pwn[i - 1], N + 1);
        pwm[i] = mul(pwm[i - 1], M + 1);
    }
    ifac[MX] = qpow(fac[MX], MOD - 2);
    irep(i, MX, 2) ifac[i - 1] = mul(ifac[i], i);
}

inline int C(int x, int y) {
    if (y < 0 || x < y) return 0;
    return mul(fac[x], mul(ifac[x - y], ifac[y]));
}

void solve() {
    int res = 0, ed = std::min(N, M);
    rep(r, 0, ed) {
        int tmp = mul(C(N, r), C(M, r));
        tmp = mul(tmp, mul(fac[r], mul(pwn[M - r], pwm[N - r])));
        inc(res, (r & 1) ? MOD - tmp : tmp);
    }
    printf("%d\n", res);
}

int main() {
    read(N), read(M);
    init();
    solve();
    return 0;
}


Measured memory_bytes: 15872
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>

using namespace std;
typedef long long ll;

int main(){
  ll N;
  cin >> N;
  ll A[N+10];
  ll  ans = 1;
  
  for(ll i=0;i<N;i++){
    ll a;
    cin >> A[i];
  }
  for(int i=0;i<N;i++){
    if(A[i]==0){
      cout << 0 << endl;
      return 0;
    }
  }
  for(ll i=0;i<N;i++){ 
    if(A[i] <= 1000000000000000000/ans){
      ans *= A[i];
    }else{
      ans = -1;
      cout << ans << endl;
      return 0;
    }
  }

  cout << ans<< endl;
}


Measured memory_bytes: 3940
#include <climits>
#include <iostream>

using namespace std;

#define ROUNDUP(p, b) (((p + b - 1) / b) * b)

int main(int argc, char* argv[])
{
  unsigned long long N; cin >> N;

  unsigned long long total_time = 0;
  unsigned long long min_person = ULLONG_MAX;
  for (int i = 0; i < 5; i++) {
    unsigned long long person; cin >> person;
    min_person = min(min_person, person);
    total_time++;
  }

  cout << total_time + ROUNDUP(N, min_person) / min_person - 1 << endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
 #include<cmath>
 #include<cstdio>
 #include<cstring>
 #include<string>
 #include<algorithm>
 using namespace std;
 const int maxn = 105;
 char a[maxn],b[maxn];
 int x[maxn],y[maxn];
 int main()
 {
     cin>>a>>b;
     int n1 = strlen(a);
     int n2 = strlen(b);
     int t1 = 1;
     int t2 = 1;
     for(int i=0;i<n1;i++)
     {
         int x1 = a[i]-'0';
         x[t1++]=x1;;
     }
     for(int i=0;i<n2;i++)
     {
         int x1 = b[i]-'0';
         y[t2++]=x1;
     }
     string g,h;
     sort(x+1,x+t1);
     sort(y+1,y+t2);
     for(int i=1;i<t1;i++)
     {
         char xx = x[i]+'0';
         g+=xx;
     }
     for(int i=t2-1;i>0;i--)
     {
         char ss = y[i]+'0';
         h+=ss;
     }
     int ok = 0;
     int nm = max(t1,t2);
     for(int i=0;i<nm-1;i++)
     {
         if(g[i]>h[i])
         {
              ok = 1;
              break;
         }
         else if(g[i]<h[i])
         {
             break;
         }
         if(t1==t2&&i==nm-2)ok=1;
     }
     //cout<<g<<" "<<h<<endl;
     if(!ok)cout<<"Yes"<<endl;
     else cout<<"No"<<endl;
 }


Measured memory_bytes: 256