akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#define REP(i, m, n) for(int i=int(m);i<int(n);i++)
#define EACH(i, c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s, e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

//#define LOCAL 1
#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR
#endif


//改造
typedef long long int ll;
using namespace std;




//ここから編集する



int main() {
    int N,M;
    cin >> N >> M;
    vector<vector<int> > e(N+1,vector<int>(N+1,0));
    REP(i,0,M){
        int a,b;
        cin >> a >> b;
        e[a][b] = 1;
        e[b][a] = 1;
    }
    vector<int> v(N);
    iota(v.begin(),v.end(),1);
    int ans = 0;
    do{
        int flag = true;
        REP(i,0,v.size() - 1){
            if(e[v[i]][v[i+1]] == 0){
                flag = false;
            }
        }
        if(flag) ans++;
    }while(next_permutation(v.begin()+1,v.end()));
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
// https://atcoder.jp/contests/abc178/tasks/abc178_a
#include <bits/stdc++.h>
using namespace std;
#define int long long
#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()
#define CEIL(a, b) ((a - 1) / b + 1)

void solve() {
    int N;
    cin >> N;
    cout << 1 - N << endl;
}

signed main() {
    cin.tie(nullptr)->sync_with_stdio(false);
    solve();
}


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

int main() {
  int n, m;
  cin >> n >> m;
  int a, b;
  for (int i = 0; i < n; ++i) {
	for (int j = 0; j < m; ++j) {
	  string str; cin >> str;
	  if (str == "snuke") a = i, b = j;
	}
  }
  cout << (char)('A'+b) << a+1 << endl;
}


Measured memory_bytes: 256
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math;

int[10^^5] PXS, MXS;

void main()
{
    auto nk = readln.split.to!(int[]);
    auto N = nk[0];
    auto K = nk[1];

    int i, j;
    foreach (x; readln.split.to!(int[])) {
        if (x > 0) {
            PXS[i++] = x;
        } else if (x < 0) {
            MXS[j++] = -x;
        } else {
            --K;
        }
    }
    reverse(MXS[0..j]);

    int l, r;
    if (j > K) {
        l = K - 1;
        r = -1;
    } else {
        l = j - 1;
        r = K - j - 1;
    }

    auto min_ret = int.max;
    while (r < K && r < i && l >= -1) {
        auto ld = l == -1 ? 0 : MXS[l];
        auto rd = r == -1 ? 0 : PXS[r];
        auto ret = ld > rd ? ld + rd * 2 : rd + ld * 2;
        min_ret = min(min_ret, ret);
        --l;
        ++r;
    }
    writeln(min_ret);
}

Measured memory_bytes: 5220
#include <iostream>
using namespace std;
const int MAX = 10000;
int main(){
	int prime[MAX+1],n,a,c;
	for(int i = 1;i <= MAX;++i){
		prime[i] = 1;
	}
	prime[1] = 0;
	for(int i = 1;i <= 100;++i){
		if(prime[i] == 1){
			for(int j = 2;j <= (MAX/i);++j){
				prime[i*j] = 0;
			}
		}
	}
	while(cin >> n){
		a = 1 + n;
		c = 0;
		for(int i = 1;i < n;++i){
			if(prime[i] == 1 && prime[a - i] == 1) ++c;
		}
		cout << c << endl;
	}
	return 0;
}

Measured memory_bytes: 0
/*
* Author. Silviase(@silviasetitech)
* For AtCoder
*/

import java.util.*;
import java.lang.*;
import java.math.*;


public class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int k = sc.nextInt();

        if (k <= (n+1)/2) {
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }

        sc.close();


    }
}

Measured memory_bytes: 23380
import numpy as np

N=int(input())
P=np.array(input().split(),dtype=np.int32)


if (np.sort(P) == P).all():
    print("YES")
else:
    sort_P=np.sort(P)
    count=0
    for i in range(N):
        if sort_P[i]!=P[i]:
            count+=1
    if count==2:
        print("YES")
    else:
        print("NO")

Measured memory_bytes: 21404
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define LI list<int>
#define D(a) (double)(a)
#define vct vector
#define vi vct<int>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vvi vct<vi>
#define vll vct<ll>
#define vvll vct<vll>
#define vpii vct<pii>
#define vpll vct<pll>
#define vb vct<bool>
#define vs vector<string>
#define all(a) a.begin(),a.end()
#define allr(a) a.rbegin(),a.rend()
#define mp(a,b) make_pair(a,b)
#define pb push_back
#define ff first
#define ss second
#define bg begin()
#define UNIQUE(X) (X).erase(unique(all(X)),(X).end())
#define ft cout<<"for test"<<endl;
#define read(v,a,n) for(int i=a; i<n; i++)cin>>v[i];
#define For(a,n,in) for(int i=a; i<n; i+=in)
#define print(v) for(auto it:v)cout<<it<<' ';cout<<endl;
#define PI acos(-1)
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define t_c int test,cs=1;cin>>test;while(test--)
///................function.....................///
#define siz(s) (int)(s.size())
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define mod 999999937
int main()
{
    ///freopen("in.txt","r",stdin);
    ///freopen("output.txt","w",stdout);
    ll k;
    cin>>k;
    int res=0,cnt=0;
    if(k%2==0||k%5==0)
    {
        cout<<-1<<endl;
        return 0;
    }
    while(1)
    {
        res = res*10+7;
        cnt++;
        if(res%k==0)break;
        res%=k;
    }
    cout<<cnt<<endl;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
#include <math.h>
#define _GLIBCXX_DEBUG
#define _LIBCPP_DEBUG 0

using namespace std;
#define ll long long
#define rep(i,n) for (int i = 0; i < n; i++)
#define MOD (1000000007)
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()

ll gcd(ll a, ll b){
  return (b ? gcd(b,a%b) : a);
}

int main(){
  ll a,b; cin >> a >> b;
  ll g = gcd(a, b);

  ll n = g;
  int ans = 1;
  for (ll i = 2; i*i <= n; i++) {
    if(g%i == 0){
      ans++;
      while (g%i == 0) g /= i;
    }
  }
  if(g != 1) ans++;

  std::cout << ans << '\n';
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline
INF = 10**10
h, w = map(int, input().split())
C = [input().rstrip() for _ in range(h)]
def solve(b):
  cost = [[0]*(h+1) for _ in range(h+1)]
  dp = [[INF]*(h+1) for _ in range(h+1)]
  dp[0][0] = 0
  for i in range(h+1):
    for j in range(h+1):
      if i and j:
        cost[i][j] = cost[i-1][j-1] - (C[h-i][b] == C[h-j][b+1])
      else:
        for r in range(min(h-i, h-j)):
          cost[i][j] += C[j+r][b] == C[i+r][b+1]
      if i:
        dp[i][j] = min(dp[i][j], dp[i-1][j]+cost[i-1][j])
      if j:
        dp[i][j] = min(dp[i][j], dp[i][j-1]+cost[i][j-1])
  return dp[h][h]
ans = 0
for b in range(w-1):
  ans += solve(b)
print(ans)

Measured memory_bytes: 113500
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <deque>

#define dump(x) cerr << #x << "=" << (x) << endl;
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 FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define IN(x) int (x); cin >> x
#define INS(x) string (s); cin >> s
#define INL(x) ll (x); cin >> x
#define VINT(a,n) vector<int> a(n)
#define VIN(a,n) VINT(a,n); REP(i,n){cin >> a[i];}
#define ALL(x) (x).begin(),(x).end()

int main () {
  IN(n);
  IN(l);
  if(l<=0&&n+l-1>=0){
    cout<<(n)*(l+l+n-1)/2;
  }
  else if(n+l-1>=0)
    cout<<(n-1)*(l+1+l+n-1)/2;
  else
    cout<<(n-1)*(l+l+n-2)/2;
}


Measured memory_bytes: 256
use proconio::input;

fn main() {
    input! {
        n: usize,
        d: [(i32, i32); n],
    }

    if d.iter().zip(d.iter().skip(1)).zip(d.iter().skip(2)).any(
        |(((x1, y1), (x2, y2)), (x3, y3))| x1 == y1 && x2 == y2 && x3 == y3,
    ) {
        println!("Yes");
    } else {
        println!("No");
    }
}


Measured memory_bytes: 2152
N = int(input())
A = list(map(int,input().split()))
MOD = 10**9 + 7
t = A[0]

def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)
def lcm(a,b):
    return a*b//gcd(a,b)
for e in A:
    t = lcm(e,t)

ans = 0
for e in A:
    ans += t//e

print(ans%MOD)


Measured memory_bytes: 4084
MOD = pow(10, 9) + 7

def main():
  n, k = map(int, input().split())
  dyaku = set([1, n])
  i = 2
  while i*i<=n:
    if n // i not in dyaku:
      dyaku.add(i)
      dyaku.add(n//i)
    i += 1
  reyaku = [0] + list(sorted(dyaku))
  ddyaku = {s: i+1 for i, s in enumerate(sorted(dyaku))}
  dp = [[0 for _ in range(k)] for _ in range(len(dyaku) + 1)]
  for i in range(1, len(dyaku)+1):
    dp[i][1] = (((reyaku[i] - reyaku[i-1]) * (n // reyaku[i])) % MOD + dp[i-1][1]) % MOD
  for i in range(2, k):
    for j in range(1, len(dyaku)+1):
      dp[j][i] = (((reyaku[j] - reyaku[j-1]) * dp[ddyaku[n//reyaku[j]]][i-1]) % MOD + dp[j-1][i]) % MOD
  print(dp[-1][-1])


if __name__ == '__main__':
  main()

Measured memory_bytes: 111764
#include<stdio.h>  
#include<string.h>  
#include <iostream>  
#include<algorithm>  
using namespace std;  
  
typedef long long LL;  
  
const int INF = 0x3f3f3f3f;  
const int maxn = 100 + 10;  
LL F[maxn][maxn];  
LL P[maxn][maxn];  
LL D[maxn];  
  
int main()  
{  
    LL n;  
    while(scanf("%lld",&n) == 1)  
    {  
        for(int i = 1; i <= n; i++)  
            for(int j = 1; j <= 10; j++)  
                scanf("%lld",&F[i][j]);  
  
        for(int i = 1; i <= n; i++)  
            for(int j = 0; j <= 10; j++)  
                scanf("%lld",&P[i][j]);  
  
        LL Max = -1 * INF;  
        for(int s = 1; s < (1 << 10); s++)  
        {  
            for(int i = 1; i <= n; i++)  
            {  
                D[i] = 0;  
                for(int j = 1; j <= 10; j++)  
                {  
                    if((F[i][j] << (j - 1)) & s) D[i]++;  
                }  
            }  
  
            LL ans = 0;  
            for(int i = 1; i <= n; i++)  
                ans += P[i][D[i]];  
  
            Max = max(Max,ans);  
        }  
        cout<< Max <<endl;  
    }  
}  

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> PA;
typedef priority_queue<int, vector<int>, greater<int> > PQG;
#define REP(i, a, n) for(ll i = (ll) a;i < (ll) n;i++)
#define fi first
#define se second
#define pb push_back
#define INF 1000000009
#define MOD 1000000007
#define MAXN 200005
#define MAXC 100000000000014
#define MAXV 1000000009

int n, x[MAXN], y[MAXN], mid1, mid2;

int main()
{
    cin >> n;
    REP(i, 0, n){
        cin >> x[i];
        y[i] = x[i];
    }
    sort(y, y + n);
    mid1 = y[n / 2];
    mid2 = y[n / 2 - 1];

    REP(i, 0, n){
        if(x[i] >= mid1){
            cout << mid2 << endl;
        }
        else{
            cout << mid1 << endl;
        }
    }




    return 0;
}
















Measured memory_bytes: 3712
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author Kishan Sairam Adapa
 */

#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#define ll long long int
#define MOD ((int)(1e9) + 7)

using namespace std;

class CColoringColorfully {
public:
    void solve(istream& cin, ostream& cout) {
        string s;
        cin >> s;
        int o0 = 0, o1 = 0, e0 = 0, e1 = 0;
        int n = s.length();
        int o = n/2, e = n/2;
        if(n % 2 == 1) o++;
        for(int i=0; i<n; i++) {
            if(i%2)
                (s[i] == '0') ? o0++ : o1++;
            else
                (s[i] == '0') ? e0++ : e1++;
        }
        cout << min(o1+e0, o0+e1) << '\n';
    }
};


int main() {
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);
    CColoringColorfully solver;
    std::istream& in(std::cin);
    std::ostream& out(std::cout);
    solver.solve(in, out);
    return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
using namespace std;
#define int long long
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(c) (c).rbegin(),(c).rend()
#define mp make_pair
#define endl '\n'
typedef long long ll;
typedef pair<ll,ll> pll;
typedef long double ld;
const ll inf=1e9+7;
const ll mod=1e9+7;
signed main(){
    ll n;cin>>n;
    string s;cin>>s;
    string t;cin>>t;
    ll ans=2*n;
    rep(i,n){
        bool f=1;
        rep(j,n-i){
            if(s[i+j]!=t[j])f=0;
        }
        if(f){
            ans=n+i;
            break;
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
k = int(input())

if k % 2 == 0 or k % 5 == 0:
    print(-1)
    exit()
r = 0
for i in range(1, k+1):
    r = (r * 10 + 7) % k
    if r == 0:
        print(i)
        break
else:
    print(-1)

Measured memory_bytes: 9068
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
	"strings"
)

func main() {
	var a, b, c int
	fmt.Scan(&a, &b, &c)
	if a^b == 0 {
		yesOrNo((a ^ c) != 0)
		return
	}
	if c^b == 0 {
		yesOrNo((a ^ b) != 0)
		return
	}
	if a^c == 0 {
		yesOrNo((b ^ c) != 0)
		return
	}
	yesOrNo(false)
}

func mid(a []int) int {
	sort.Ints(a)
	return a[len(a)/2]
}

func ave(a []int) (ave int) {
	for i := 0; i < len(a); i++ {
		ave += a[i]
	}
	ave /= len(a)
	return
}
func eq(a []string, b []string) bool {
	for i := 0; i < len(a); i++ {
		if a[i] != b[i] {
			return false
		}
	}
	return true
}

// IO---------------------------------------------------

func readi() (n int) {
	fmt.Scan(&n)
	return
}

func readf() (n float64) {
	fmt.Scan(&n)
	return
}

func reads() (n string) {
	fmt.Scan(&n)
	return
}

var rdr = bufio.NewReaderSize(os.Stdin, 1000000)

func readLine() string {
	buf := make([]byte, 0, 1000000)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func readSlice() []string {
	return strings.Split(readLine(), " ")
}

func atoi(a []string) (b []int) {
	b = make([]int, len(a))
	for i := range a {
		b[i], _ = strconv.Atoi(a[i])
	}
	return
}

func atof(a []string) (b []float64) {
	b = make([]float64, len(a))
	for i := range a {
		b[i], _ = strconv.ParseFloat(a[i], 64)
	}
	return
}

func readSlice2(n int) (a []int, b []int) {
	a = make([]int, n)
	b = make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&a[i], &b[i])
	}
	return
}

func readFloatSlice2(n int) (a []float64, b []float64) {
	a = make([]float64, n)
	b = make([]float64, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&a[i], &b[i])
	}
	return
}

func yesOrNo(b bool) {
	if b {
		fmt.Println("Yes")
		return
	}
	fmt.Println("No")
}

func yesorNO(b bool) {
	if b {
		fmt.Println("YES")
		return
	}
	fmt.Println("NO")
}

func yesorno(b bool) {
	if b {
		fmt.Println("yes")
		return
	}
	fmt.Println("no")
}

// calc---------------------------------------------------

func abs(a int) int {
	if a > 0 {
		return a
	}
	return -a
}

func gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}

func min(a ...int) int {
	min := a[0]
	for i := 1; i < len(a); i++ {
		if min > a[i] {
			min = a[i]
		}
	}
	return min
}

func max(a ...int) int {
	max := a[0]
	for i := 1; i < len(a); i++ {
		if max < a[i] {
			max = a[i]
		}
	}
	return max
}

func sum(a []int) (ans int) {
	for i := range a {
		ans += a[i]
	}
	return
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0; i<n; ++i)
#define rep1(i,n) for(ll i=1; i<=n; ++i)
#define revrep(i,n) for(ll i=n-1; n>=0; --i)
inline constexpr ll Inf = (1ULL << 62) -1;
#define fastio cin.tie(nullptr); ios_base::sync_with_stdio(false);
#define endl '\n'
template <class T> bool updmax(T& a, T b) { if (b > a) { a = b; return true;} return false;}
template <class T> bool updmin(T& a, T b) { if (b < a) { a = b; return true;} return false;}

template <class T> T permutation(ll n, ll k) { T f(1); for (ll i=0; i<k; ++i, --n) f *= n; return f; }
template <class T> T factorial(ll n) { return permutation<T>(n,n); }
template <class T> T binomial(ll n, ll k) { return permutation<T>(n,k) /= factorial<T>(k); }

template <ll Mod>
class modint {
    public:
    ll n=0;
    modint(){}
    modint(ll n):n(n){ clamp(); }
    modint& operator = (modint const& a) = default;
    modint& operator = (int a) { n = a; clamp(); return *this; }
    modint operator - () { modint t = *this; t.n = -t.n; t.clamp(); return t; }
    modint& operator *= (modint const& a) { n *= a.n; clamp(); return *this; }
    modint& operator *= (ll a) { n *= a; clamp(); return *this; }
    modint& operator /= (modint const& a) { *this *= a.inv(); return *this; }
    modint& operator += (modint const& a) { n += a.n; if (n >= Mod) n -= Mod; return *this; }
    modint& operator -= (modint const& a) { n -= a.n; if (n < 0) n += Mod; return *this; }
    modint& operator %= (modint const& a) { n %= a.n; clamp(); return *this; }
    friend modint operator * (modint a, modint b) { modint t(a); t.n *= b.n; t.clamp(); return t; }
    friend modint operator + (modint a, modint b) { modint t(a); t.n += b.n; t.clamp(); return t; }
    friend modint operator - (modint a, modint b) { modint t(a); t.n -= b.n; t.clamp(); return t; }
    friend ostream& operator << (ostream& os, modint const& a) { os << a.n; return os; }
    friend bool operator == (modint const& a, int b) { return a.n == b; }
    void clamp() { n %= Mod; if (n < 0) n += Mod; }
    modint inv() const { return this->pow(Mod-2); }
    ll get() { return n; }
    modint pow(ll p) const {
        ll a=1, e=n;
        while (p > 0) {
            if (p&1) { a *= e; a %= Mod; }
            e *= e; e %= Mod; p >>= 1;
        }
        return modint(a);
    }
};

const ll Mod = (ll)1e9+7;
using mint = modint<Mod>;

mint dp[1000005][2][2] = {1};

int main() {
    fastio;
    ll N;
    cin >> N;

    rep(i,N) rep(j,2) rep(k,2) {
        dp[i+1][1][k] += dp[i][j][k];
        dp[i+1][j][1] += dp[i][j][k];
        dp[i+1][j][k] += dp[i][j][k] * 8;
    }
    cout << dp[N][1][1] << endl;
}


Measured memory_bytes: 34908
#include<bits/stdc++.h>
using namespace std;
///Welcome to Nasif's Code
#define bug printf("bug\n");
#define bug2(var) cout<<#var<<" "<<var<<endl;
#define co(q) cout<<q<<endl;
#define all(q) (q).begin(),(q).end()
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9+7;
const int MAX = 1e6;
#define pi acos(-1)
#define inf 1000000000000000LL
#define FastRead    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
    FastRead
    //freopen("output.txt", "w", stdout);
    int n,cnt=0;
    map<int,int>mp;
    set<int>s;
    cin>>n;
    for(int i=0; i<n; i++)
    {
        int a;
        cin>>a;
        s.insert(a);
        mp[a]++;
    }
    for(auto i:s){
        int cur=mp[i];
        if(mp[i]==i)
            continue;
        else if(mp[i]<i)
            cnt+=mp[i];
        else
            cnt+=mp[i]-i;
    }
    cout<<cnt<<endl;


    return 0;
}


Measured memory_bytes: 12660
#include <stdio.h>
#include <math.h>
 
#define PI 3.141592653589
 
int main(void) {
    double x,y;
    int angle;
    int a,b;
    x=0;y=0;
    angle=90;
    do {
        scanf("%d,%d",&a,&b);
        x+=cos(angle*PI/180)*a;
        y+=sin(angle*PI/180)*a;
        angle-=b;
    } while(a!=0 && b!=0);
    printf("%d\n",(int)x);
    printf("%d\n",(int)y);
    return 0;
}

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

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

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

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

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

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

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

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

//#define int long long

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

/*global*/

signed main()
{
//	v.resize(n);
string s;cin >> s;
if(s[0] == s[1] && s[2] == s[3] && s[1] != s[2]){
	cout << "Yes" << endl;
	
}
else if(s[0] == s[2] && s[1] == s[3] && s[2] != s[1]){
	cout << "Yes" << endl;
}
else if(s[0] == s[3] && s[1] == s[2] && s[3] != s[1]){
	cout << "Yes" << endl;
}
else{
	cout << "No" << endl;
}
    return 0;
}


Measured memory_bytes: 256
n, m, q = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(q)]


def combinations_with_replacement(iterable, r):
    pool = tuple(iterable)
    n = len(pool)
    if not n and r:
        return

    indices = [0] * r
    yield tuple(pool[i] for i in indices)
    while True:
        for i in reversed(range(r)):
            if indices[i] != n - 1:
                break
        else:
            return
        indices[i:] = [indices[i] + 1] * (r - i)
        yield tuple(pool[i] for i in indices)


ans, tempAns = 0, 0
for tempA in combinations_with_replacement(range(1, m + 1), n):
    tempAns = 0
    for a in A:
        if tempA[a[1] - 1] - tempA[a[0] - 1] == a[2]:
            tempAns += a[3]
    ans = max(ans, tempAns)
print(ans)

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

#define int long long

using namespace std;

typedef pair <int, int> ii;
typedef pair <ii, ii> iiii;

map <iiii, int> mm;
int h, w, n, ans[10];
vector <ii> v;

bool inside (int x, int y) {
    return (x >= 1 && x <= h && y >= 1 && y <= w);
}

signed main(){
    scanf("%lld %lld %lld", &h, &w, &n);
    for (int i = 1; i <= n; i++) {
        int x, y;
        scanf("%lld %lld", &x, &y);
        v.push_back(make_pair(x, y));
    }

    memset(ans, 0, sizeof(ans));
    for (int i = 0; i < v.size(); i++) {
        for (int dx = -2; dx <= 0; dx++) {
            for (int dy = -2; dy <= 0; dy++) {
                int start_x = v[i].first + dx;
                int start_y = v[i].second + dy;
                int end_x = start_x + 2;
                int end_y = start_y + 2;

                if (!inside(start_x, start_y) || !inside(end_x, end_y)) continue;
                mm[make_pair(make_pair(start_x, start_y), make_pair(end_x, end_y))]++;
            }
        }
    }

    for (map <iiii, int>::iterator it = mm.begin(); it != mm.end(); it++) ans[it->second]++;
    int sum = 0;
    for (int i = 1; i <= 9; i++) sum += ans[i];
    ans[0] = (h - 2) * (w - 2) - sum;
    for (int i = 0; i < 10; i++) printf("%lld\n", ans[i]);
    return 0;
}


Measured memory_bytes: 72176
while True:
    s = input()
    if s == '#':
        break
    rows = s.split('/')

    a, b, c, d = map(int, input().split())
    a -= 1
    b -= 1
    c -= 1
    d -= 1
    grid = ['' for _ in rows]
    for i, row in enumerate(rows):
        for kk in row:
            if kk == 'b':
                grid[i] += 'b'
            else:
                grid[i] += '.' * int(kk)
    
    grid[a] = grid[a][:b] + '.' + grid[a][b + 1:]
    grid[c] = grid[c][:d] + 'b' + grid[c][d + 1:]

    ans = []

    # for row in grid:
    #     print(row)
    for row in grid:
        s = ''
        tmp = 0
        for kk in row:
            if kk == 'b':
                if tmp != 0:
                    s += str(tmp)
                    tmp = 0
                s += 'b'
            else:
                tmp += 1
        if tmp != 0:
            s += str(tmp)
            tmp = 0
        ans.append(s)
    print('/'.join(ans))



Measured memory_bytes: 5604
#include <iostream>
#include <iomanip>
#include <cmath>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
    int n;
    cin >> n;

    for (int a = 1; a <= n; ++a) {
        int x = a;
        if(x % 3 == 0){
            cout << " " << a;
        }else{

            while(1){
                if( x % 10 == 3){
                    cout << " " << a;
                    break;
                }
                x /= 10;
                if(!x){
                    break;
                }
            }
        }
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 3084
import numpy as np

N, D = map(int,input().split(' '))
Xs = []
for i in range(N):
    Xs.append(np.array(list(map(int,input().split()))))

int_cnt = 0
for i in range(len(Xs)-1):
    for j in range(i+1,len(Xs)):
        X = Xs[i]-Xs[j]
        s = 0
        for k in range(D):
            s += X[k]**2
        if (s**(1/2)).is_integer() == True:
            int_cnt += 1
print('{}'.format(int_cnt))

Measured memory_bytes: 13056
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPP(i, n) for(int i = 1; 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 ALL(v) v.begin(), v.end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const ll MOD = 1000000007;

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

int main() {
    int n; cin >> n;
    vector<p> ab(n);
    REP(i,n) cin >> ab[i].first >> ab[i].second;
    sort(ab.begin(), ab.end(), compare_by_b);
    bool ans = true;
    int time = 0;
    REP(i,n) {
        time += ab[i].first;
        if(time>ab[i].second) {
            ans = false;
            break;
        }
    }
    cout << (ans ? "Yes" : "No") << endl;
    return 0;
}

Measured memory_bytes: 3328
import numpy as np,sys
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
N,M,X = LI()
CA = np.array([LI() for _ in range(N)],dtype=int)
ans = float('INF')
for i in range(2**N):
    bit = np.array([[i>>j&1 for j in range(N)]]).T
    t = np.sum(CA*bit,axis=0)
    if np.all(t[1:]>=X):
        ans = min(ans,t[0])
print(ans if ans !=float('INF') else -1)

Measured memory_bytes: 27100
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
#include<cstdio>
#include<cstring>

using namespace std;

typedef long long ll;
typedef double db;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef vector<char> vc;
typedef string S;
typedef queue<int> qi;
typedef pair<ll,ll> P;
typedef vector<P> vp;
struct edge{ ll to, cost; };//　一つ目は結んでいるノード,二つ目はその辺の重みを指す
#define sort(a) sort(a.begin(),a.end())
using Graph = vector<vector<edge>>;  //隣接リスト
#define reverse(a) reverse(a.begin(),a.end())
#define pb push_back
#define elif else if
#define unique(a) a.erase(unique(a.begin(),a.end()),a.end())
#define mp make_pair
#define fr(i,n)for(ll i=0;i<(n);i++)
#define ifr(i,n)for(ll i=(n)-1;i>=0;i--)
#define ALL(a) (a).begin(),(a).end()
const int MOD = 1e9+7;
const ll INF =1e18;
ll dp[10010][1010];
ll A[1010],B[1010];
int main(){  
    cin.tie(0);
    ios::sync_with_stdio(false);  
    ll H,N;cin>>H>>N;
    fr(i,N)cin>>A[i]>>B[i];
    fr(i,H+1){
        fr(j,N+1)dp[i][j] = INF;
    }
    //cout << dp[H][N] << endl;
    fr(h,H+1){
        fr(i,N+1){
            if(i > 0 && h-A[i-1] > 0){
                dp[h][i] = min(dp[h][i-1],dp[h-A[i-1]][i] + B[i-1]);
            }else if (i > 0){
                dp[h][i] = min(dp[h][i-1],B[i-1]);
            }
            //cout << h << ' ' << i << ' ' << dp[h][i] << endl;
        }
    }
    cout << dp[H][N] << endl;
}

Measured memory_bytes: 79232
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n,W;
    cin>>n>>W;
    vector<pair<long long int,long long int> > vec(n);
    for(int i=0;i<n;i++)
    {
        long long int w,val;
        cin>>w>>val;
        vec[i].first = w;
        vec[i].second = val;
    }
    sort(vec.begin(),vec.end());
    vector<long long int> dp(W+1,0);
    long long int ans = 0;
    for(int i=0;i<n;i++)
    {
        for(int j=W;j>=0;j--)
        {
            if(j>=vec[i].first)
            {
                 dp[j] = max(dp[j],vec[i].second + dp[j - vec[i].first]);
                 ans = max(ans,dp[j]);
            }
            //cout<<dp[j]<<" ";
        }
        //cout<<endl;
    }
    cout<<dp[W]<<endl;
    return 0;
}

Measured memory_bytes: 1024
#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;
using Graph = vector<vector<int>>;
namespace adaptor = boost::adaptors;

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define cy cout << "Yes" << endl
#define cn cout << "No" << endl

typedef long long ll;

bool IsAdjacent(int n, int m, Graph G){
	if(n==m) {return false;}
	// v[m] の中に n がいれば true
	rep(i,G[m].size()){
  		if(G[m][i] == n) return true;
    }
  	return false;
}

void Main(){
   int N, M;
   cin >> N >> M;
  
  	// 頂点数 N, 辺数 M, 無向グラフ
  	// 
  	Graph G(N);
   	rep(i,M) {
        int a, b;
        cin >> a >> b;
     	a--, b--;
        G[a].push_back(b);
        G[b].push_back(a);
   	}
  	
  	int count = 0;
  	vector<int> v(N);
	iota(v.begin(), v.end(), 0);
	// 頂点 0 から N-1 までの全ての順列を探索
  	do{
		if(v[0] != 0){;}
      	else{
          int flag = 1;
          rep(i,N-1){
            if(!IsAdjacent(v[i], v[i+1], G)){flag = 0;}
          }
          if(flag){count++;}
        }
    }while(next_permutation(v.begin(), v.end()));

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


Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))

flg = True
ans = 0

while flg:
    flg = False
    for i in range(N-1):
        if A[i] > A[i+1]:
            A[i], A[i+1] = A[i+1], A[i]
            flg = True
            ans += 1
    
print(' '.join(list(map(str, A))))
print(ans)


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

int main() {
	int n, a;
	cin >> n;
	vector<int> b;
	for (int i = 0; i < n; i++) {
		cin >> a;
		vector<int>::iterator c = lower_bound(b.begin(), b.end(), a);
		if (c == b.end()) b.push_back(a);
		else *c = a;
	}
	cout << b.size() << endl;
}


Measured memory_bytes: 3336
#include <iostream>
#include <cstdio>
#include <map>
#include <string>


using namespace std;
int main() {
    map <string,int> cnt;
    string temp;
    int n;
    cin>>n;
    int mm=0;
    while (n--){
        cin>>temp;
        cnt[temp]++;
        mm=max(cnt[temp],mm);
    }
    for (auto i:cnt) {
        if(i.second==mm){
            cout<<i.first<<'\n';
        }
    }

    return 0;
}




Measured memory_bytes: 25260
#include <cmath>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <iomanip>
#include <map>
#include <stack>
#include <queue>

using namespace std;

typedef long long ll;

queue<pair<int,int>> que;
ll d[1010][1010];
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
int h,w;
ll inf=1e7;
char a[1010][1010];

void bfs(pair<int,int> pos){
    int x=pos.first,y=pos.second;
    for(int i=0;i<4;i++){
        int nx=x+dx[i],ny=y+dy[i];
        if(0<=nx && nx<h && 0<=ny && ny<w && d[nx][ny]==inf){
            que.push(make_pair(nx,ny));
            d[nx][ny]=d[x][y]+1;
        }
    }
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    cin>>h>>w;
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++) {
            cin>>a[i][j];
            d[i][j]=inf;
            if (a[i][j] == '#') {
                que.push(make_pair(i,j));
                d[i][j]=0;
            }
        }
    }
    ll ans=0;
    while(que.size()) {
        pair<int,int> pos = que.front();
        que.pop();
        bfs(pos);
    }
    
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++) {
            if(d[i][j]>ans) ans=d[i][j];
        }
    }
    
    cout<<ans<<endl;
}

Measured memory_bytes: 17296
#include <cstring>
#include <map>
#include <unordered_map>
#include <string>
#include <list>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <cstdio>
#include <iostream>
#include <set>
#include <unordered_set>
using namespace std;

#define MAX(a,b) (a>b?a:b)
#define MIN(a,b) (a<b?a:b)
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int, int> pii;

int gi() {
    int a;
    scanf("%d", &a);
    return a;
}

ll gli() {
    ll a;
    scanf("%lld", &a);
    return a;
}

char a[100000];
char b[100000];
int s[256];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n = gi();
    int k = gi();
    s['r'] = gi();
    s['s'] = gi();
    s['p'] = gi();
    scanf("%s", a);

    int res = 0;
    for (int i = 0; i < k; i++) {
        int m = 0;
        for (int j = i; j < n; j+=k)
            b[m++] = (a[j] == 'r' ? 'p' : (a[j] == 's' ? 'r' : 's'));
        for (int j = 0; j < m; j++)
            if (j && b[j] == b[j-1]) {
                b[j] = 'a';
            } else {
                res += s[b[j]];
            }
    }

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

    return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
int min(int a,int b){
  if(a <= b)return a;
  else return b;
}

int main(){
  int n,k;
  cin >> n >> k;
  int h[n];
  int dp[n];
  for(int i = 0;i < n;i++){
    cin >> h[i];
    dp[i] = 1000000000;
  }
  for(int i = 0;i < n;i++){
    if(i < k)dp[i] = abs(h[i]-h[0]);
    else{
      for(int j = 1;j <= k;j++){
        dp[i] = min(dp[i],dp[i-j]+abs(h[i]-h[i-j]));
      }
    }
  }
  cout << dp[n-1] << endl;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
//mt19937 mrand(random_device{}()); 
const ll mod=1000000007;
//int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head

int main() {
	int a;
	while(~scanf("%d",&a)){
		printf("%d\n",a+a*a+a*a*a);
	} 
} 

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

int main() {
  int L, R, mod = 2018;
  cin >> L >> R;
  if(R - L >= 673) mod = 0;
  else {
    for(long i = L; i < R; i++) {
      for(long j = i + 1; j <= R; j++) {
        if((i * j) % 2019 < mod) mod = (i * j) % 2019;
      }
    }
  }
  cout << mod;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
using namespace std;
int a[1001];
int main()
{
    bool f;
    int n,q;
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>a[i];
    cin>>q;
    for(int i=0;i<q;i++)
    {
        int b,m,e;
        cin>>b;cin>>m;cin>>e;
        rotate(&a[b],&a[m],&a[e]);
    }
        f=false;
        for(int j=0;j<n;j++)
        {
            if(f==true)
                cout<<" "<<a[j];
            else
            {
                f=true;
                cout<<a[j];
            }
        }
        cout<<"\n";
}



Measured memory_bytes: 3156
'''input
3 5
1 2 1
2 3 0
'''
# connected components
from sys import stdin, setrecursionlimit
from bisect import bisect_left
import sys, threading
from collections import defaultdict

# main starts
string = stdin.readline().strip()
i = 0
j = len(string) - 1
count = 0
while i < j:
    if string[i] != string[j]:
        count += 1
    i += 1
    j -= 1
print(count)

Measured memory_bytes: 3952
#include<stdio.h>
#include<stdint.h>

#define min(a,b) ((a)<(b)?(a):(b))

int main(void){
    int h,w,k,ans = 20000,up,lef,tc,fl;
    scanf("%d %d %d",&h,&w,&k);
    int grid[h][w];
    for(int i = 0;i < h;i++)for(int j = 0;j < w;j++)scanf("%1d",&grid[i][j]);
    int cg[h+1][w+1];
    for(int i = 0;i <= h;i++)cg[i][0] = 0;
    for(int i = 0;i <= w;i++)cg[0][i] = 0;
    for(int i = 1;i <= h;i++)for(int j = 1;j <= w;j++)cg[i][j] = cg[i-1][j] + cg[i][j-1] - cg[i-1][j-1] + grid[i-1][j-1];
    uint16_t bits = 0,lbits = 0,mask[h];
    mask[0] = 1;
    for(int i = 1;i < h-1;i++)mask[i] = mask[i-1]<<1;
    for(int i = 0;i < h-1;i++)lbits += mask[i];
    for(;bits <= lbits;bits++){
        fl = 0;
        tc = 0;
        lef = 0;
        for(int y = 0;y < w;y++){
            up = 0;
            for(int mi = 0;mi < h && !fl;mi++)if(mi == h-1 || (bits & mask[mi])){
                if(cg[mi+1][y+1] + cg[up][lef] - cg[up][y+1] - cg[mi+1][lef] > k){
                    tc++;
                    y--;
                    if(lef == y+1)fl = 1;    
                    lef = y+1;
                }
                up = mi +1;
            }
        }
        for(int mi = 0;mi < h-1;mi++)tc += (bits & mask[mi]?1:0);
        if(!fl)ans = min(ans,tc);
    } 
    printf("%d",ans);
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     @hamayanhamayan
　　　　／　　　＼　 　  |　|
　　　 /　　 /￣￣￣￣/　　|
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿
　 　　　＼/＿＿＿＿/　（u　⊃
---------------------------------------------------------------------------------------------------*/














int N; string S;
//---------------------------------------------------------------------------------------------------
void _main() {
	cin >> N >> S;
	fore(c, S) {
		int x = c - 'A';
		x = (x + N) % 26;
		printf("%c", char(x + 'A'));
	}
	printf("\n");
}







Measured memory_bytes: 256
/*
数据不清空，爆零两行泪。
多测不读完，爆零两行泪。
边界不特判，爆零两行泪。
贪心不证明，爆零两行泪。
动规顺序错，爆零两行泪。
大于少等号，爆零两行泪。
变量不统一，爆零两行泪。
越界不判断，爆零两行泪。
调试不注释，爆零两行泪。
溢出不 l l，爆零两行泪。
*/
#include<bits/stdc++.h>
using namespace std;
int main(){
	string a,b;
	cin>>a>>b;
	cout<<(a[0]==b[0])+(a[1]==b[1])+(a[2]==b[2]);
	return 0;
}

Measured memory_bytes: 256
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repf(i,a,n) for(int i = (int)(a); i < (int)(n); i++)

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

int main(){
    vector<long long int> v;
    long long int n,p;
    cin >> n >> p;
    long long int ans = 1;
    
    while(p!=1){
        long long int sqp = (int)sqrt((p));
        for(long long int i = 2; i <= sqp; i++){
            if( p%i == 0){
                p/=i;
                v.push_back(i);
                break;
            }
            if(i == sqp){
                v.push_back(p);
                p=1;
                break;
            }
        }
        if(p<=3){
            v.push_back(p);
            p=1;
        }
    }
    sort(v.begin(),v.end());
    v.push_back(1);

    long long int m = 1;
    long long int count = 1;

    // for(auto w:v){
    //     cout << w << endl;
    // }
    // cout << "-----" << endl;

    for(auto w:v){
        if(m==w){
            count ++;
        }else{
            rep(i,count/n){
                ans *=(long long int)m;
            }
            count = 1;
            m = w;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repr(i, a, b) for(int i = a; i >= b; i--)
#define int long long
#define all(a) a.begin(), a.end()
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef pair<int, int> P;
const int INF = 1e15;

int c[51][51];
void build(){
    rep(i, 0, 51) c[i][0] = 1;
    rep(i, 1, 51){
        rep(j, 1, 51){
            c[i][j] = c[i - 1][j - 1] + c[i - 1][j];
        }
    }
}

signed main(){
    int n, a, b;
    cin >> n >> a >> b;
    vector<int> v(n);
    rep(i, 0, n) cin >> v[i];
    sort(v.rbegin(), v.rend());
    int sum = 0;
    rep(i, 0, a) sum += v[i];
    int idx = a, num = v[a - 1];
    rep(i, a, a + b){
        if(sum * (i + 1) == (sum + v[i]) * i){
            sum += v[i];
            num = v[i];
            idx++;
        }else{
            break;
        }
    }
    int cnt1 = 0, cnt2 = 0;
    rep(i, 0, n){
        if(v[i] == num){
            cnt1++;
            if(i < idx) cnt2++;
        }
    }
    build();
    int ans = c[cnt1][cnt2];
    if(sum == num * idx){
        ans = 0;
        rep(i, a, min(cnt1, b) + 1){
            ans += c[cnt1][i];
        }
    }
    double ave = (double)sum / (double)idx;
    printf("%.12f\n", ave);
    cout << ans << endl;
}

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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

const int INF=1001001001;
const int INFLL=1001001001001001001ll;
const int mod=1000000007;
inline void add(int &a,int b){
    a+=b;
    if(a>=mod)a-=mod;
}

int N,M,R;
int A[55],B[55];
vint X[66];
int Y[66];

int dpA[55][55];
int dpB[55][55];

void calc(int n,int a[55],int dp[55][55]){
    fill_n(*dp,55*55,0);
    n*=2;
    for(int i=0;i<n;i++)dp[i][i+1]|=1<<a[i];

    bool tmp[55];

    for(int len=2;len<=n;len++){
        for(int i=0;i+len<=n;i++){
            int j=i+len;

            for(int r=0;r<R;r++){
                memset(tmp,0,sizeof(tmp));
                tmp[i]=true;
                for(int k=0;k<X[r].size();k++){
                    for(int l=j;l>=i;l--){
                        tmp[l]=false;
                        for(int w=i;w<l;w++){
                            tmp[l]|=tmp[w]&(dp[w][l]>>X[r][k]&1);
                        }
                    }
                }
                if(tmp[j])dp[i][j]|=1<<Y[r];
            }
        }
    }
}

int dp[33][33];

void solve(){
    rep(i,N){
        cin>>A[i];
        A[i+N]=A[i];
    }
    rep(i,M){
        cin>>B[i];
        B[i+M]=B[i];
    }

    rep(i,R){
        X[i].clear();
        int k;cin>>k;
        X[i].resize(k);
        rep(j,k)cin>>X[i][j];
        cin>>Y[i];
    }

    calc(N,A,dpA);
    calc(M,B,dpB);

    int ans=INT_MIN;
    for(int x=0;x<N;x++){
        for(int y=0;y<M;y++){
            fill_n(*dp,33*33,INT_MIN);
            dp[0][0]=0;
            for(int i=0;i<N;i++){
                for(int j=0;j<M;j++){
                    for(int ii=1;i+ii<=N;ii++){
                        for(int jj=1;j+jj<=M;jj++){
                            if(dpA[x+i][x+i+ii]&dpB[y+j][y+j+jj]){
                                chmax(dp[i+ii][j+jj],dp[i][j]+1);
                            }
                        }
                    }
                }
            }
            chmax(ans,dp[N][M]);
        }
    }
    if(ans<0)puts("-1");
    else printf("%lld\n",ans);
}

signed main(){
    while(cin>>N>>M>>R,N||M||R)solve();
    return 0;
}

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

using namespace std;

#define sz(v)           ((int)((v).size()))
#define clr(v, d)       memset(v, d, sizeof(v))
#define rep(i, v)       for(int i=0; i<sz(v); ++i)
#define lp(i, n)        for(int i=0; i<(int)(n); ++i)
#define lpi(i, j, n)    for(int i=(j); i<(int)(n); ++i)
#define lpd(i, j, n)    for(int i=(j); i>=(int)(n); --i)
#define INF             1000000000

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;

void init(){
	std::ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
}

int main()
{
	init();
	long long h, ans = 0, monst_num = 1;
	cin >> h;
	while(h > 0){
		ans += monst_num;
		monst_num *= 2;
		h /= 2;
	}
	cout << ans;
	return 0;
}



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

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

    static class B {
        public void solve(int testNumber, MyScanner in, PrintWriter out) {
            String S = in.next();
            String T = in.next();
            int cnt = 0;
            for (int i = 0; i < S.length(); i++) {
                if (S.charAt(i) != T.charAt(i)) cnt++;
            }
            out.println(cnt);
        }

    }

    static class MyScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public MyScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    return null;
                }
            }
            return st.nextToken();
        }

    }
}



Measured memory_bytes: 37280