akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rrep(i,n) for(int i=(int)(n-1);i>=0;i--)
#define FOR(i,n,m) for(int i=n;i<=(int)(m);i++)
#define RFOR(i,n,m) for(int i=(int)(n);i>=m;i--)
#define all(x) (x).begin(),(x).end()
#define sz(x) int(x.size())
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
using namespace std;
vector<int> dy={-1,0,1,0};
vector<int> dx={0,1,0,-1};
template<class T>
vector<T> make_vec(size_t a){
    return vector<T>(a);
}
template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

vector<vector<int>> g;
vector<int> color;
bool is_nibu=true;
void dfs(int now,int c) {
    if(color[now] != -1) {
        if(color[now] != c) is_nibu=false;
        return;
    }
    color[now] = c;
    for(int nxt:g[now]) dfs(nxt,c^1);
}

int main() {
    int n;
    cin>>n;
    g.resize(n);
    vector<vector<int>> d(n,vector<int>(n,INF));
    rep(i,n) d[i][i]=0;
    
    rep(i,n) rep(j,n) {
        char c;
        cin>>c;
        if(c=='1') {
            d[i][j]=1;
            g[i].push_back(j);
        }
    }

    color.resize(n);
    rep(i,n) color[i] = -1;
    dfs(0,0);
    if(!is_nibu) {
        cout<<-1<<endl;
        return 0;
    }
    
    rep(k,n) {
        rep(i,n) {
            rep(j,n) {
                d[i][j] = min(d[i][k]+d[k][j], d[i][j]);
            }
        }
    }
    
    int ans=0;
    rep(i,n) {
        rep(j,n) {
            ans=max(ans,d[i][j]);
        }
    }
    cout<<ans+1<<endl;
    
}



Measured memory_bytes: 640
import java.util.Stack;
import java.util.Scanner;

public class Main{
   public static void main(String[] wjy){
      Stack<String> s = new Stack<String>();
      Scanner in = new Scanner(System.in);
      String input = in.nextLine();
      in.close();
      Scanner amd = new Scanner(input);
      while (amd.hasNext()){
         String a = amd.next();
         if (a.equals("+")){
           int z = Integer.parseInt(s.pop())+Integer.parseInt(s.pop());
           s.push(z+"");
         }
         else if (a.equals("-")){
           int z = -Integer.parseInt(s.pop())+Integer.parseInt(s.pop());
           s.push(z+"");
         }
         else if (a.equals("*")){
           int z = Integer.parseInt(s.pop())*Integer.parseInt(s.pop());
           s.push(z+"");
         }
         else{
           s.push(a);
         }
    }
   amd.close();
   System.out.println(s.pop());    
  }
}


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

using namespace std;

int main(){
    vector<int> x(5);
    
    for(int i=0; i<5; i++){
        cin >> x[i];
        if(x[i]!=i+1){
            cout << i+1 << endl;
            return 0;
        }
    }
}

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

using namespace std;

int main()
{
	int a, b, c;
	cin >> a >> b >> c;
	if (max({a, b, c}) == a + b + c - max({a, b, c}))
		cout << "Yes" << endl;
	else
		cout << "No" << endl;

	return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip
else:
    _str = str
    str = lambda x=b"": x if type(x) is bytes else _str(x).encode()


def main():
    n = int(input())
    v = readlist()
    c = readlist()

    res = 0
    for i in range(n):
        res += max(v[i] - c[i], 0)
    print(res)



# region template

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._buffer = BytesIO()
        self._fd = file.fileno()
        self._writable = "x" in file.mode or "r" not in file.mode
        self.write = self._buffer.write if self._writable else None

    def read(self):
        if self._buffer.tell():
            return self._buffer.read()
        return os.read(self._fd, os.fstat(self._fd).st_size)

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self._buffer.tell()
            self._buffer.seek(0, 2), self._buffer.write(b), self._buffer.seek(ptr)
        self.newlines -= 1
        return self._buffer.readline()

    def flush(self):
        if self._writable:
            os.write(self._fd, self._buffer.getvalue())
            self._buffer.truncate(0), self._buffer.seek(0)


class ostream:
    def __lshift__(self, a):
        if a is endl:
            sys.stdout.write(b"\n")
            sys.stdout.flush()
        else:
            sys.stdout.write(str(a))
        return self


def print(*args, **kwargs):
    sep, file = kwargs.pop("sep", b" "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", b"\n"))
    if kwargs.pop("flush", False):
        file.flush()


sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
cout, endl = ostream(), object()

readline = sys.stdin.readline
readlist = lambda var=int: [var(n) for n in readline().split()]
input = lambda: readline().rstrip(b"\r\n")

# endregion

if __name__ == "__main__":
    main()


Measured memory_bytes: 29036
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int N = 110;
pii v[N], pos{0, 0};
int n;
double norm(pii p) {return sqrt((ll)p.first*p.first+(ll)p.second*p.second);}
 
signed main() {
	srand(time(NULL));
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    cin >> n;
  
    for(int i=0;i<n;i++) cin >> v[i].first >> v[i].second;
    const int trials = 1e4;
    double best = 0;
    for(int t=0;t<trials;t++) {
    	random_shuffle(v, v+n);
    	pos = {0, 0};
    	for(int i=0;i<n;i++) {
    		if(norm({pos.first+v[i].first, pos.second+v[i].second}) > norm(pos)) {
    			pos.first += v[i].first;
    			pos.second += v[i].second;
    		}
    	}
    	best = max(best, norm(pos));
    }
    cout << best << endl;
 
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <string>
#include <vector>
using namespace std;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
typedef unsigned long long ll;
typedef vector<int> vint;
typedef vector<string> vstr;
typedef pair<int, int> pint;
ll inf = 1000000000 + 7;



string inp;

int main() {
	int N;
	ll a;
	ll ans = 0;
	cin >> N;

	rep(i, N) {
		cin >> a;
		ans += a - 1;
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#include <unordered_map>
#define inputarr(a,n) for(ll i=0;i<n;i++) cin>>a[i];
#define prllarr(a,n) for(ll i=0;i<n;i++) cout<<a[i]<<" ";
#define pb push_back
#define ll long long
#define mod 1000000007
#define foi ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(0);
#define in(n) scanf("%lld",&n);
#define in2(x,y) scanf("%lld %lld",&(x),&(y));
#define in3(x,y,z) scanf("%lld %lld %lld",&(x),&(y),&(z));
#define out(n) printf("%lld\n",n);
#define out2(x,y) printf("%lld %lld\n",x,y);
#define test(t)  ll t; in(t);while(t--)
#define set(arr,n,s) for(ll i=0;i<n;i++){arr[i]=s;}


/*error-----
convert every int to long long eg-1LL
create array with proper analysis of problem constrain
check mod also
*/
ll power(ll x,ll y,ll p){ll res=1;x=x%p;while(y>0){if(y&1){res=(res*x)%p;} y=y>>1;x=(x*x)%p;}return res;}
ll modInverse(ll a,ll p){return power(a,p-2,p);}//used with feemat little

ll gcd(ll x,ll y){if(x==0 || y==0){return max(y,x);}return gcd(y%x,x);}
ll gcdExtended(ll a,ll b,ll &x,ll &y){if(a==0){x=0;y=1;return b;}ll x1,y1;ll gcd = gcdExtended(b%a,a,x1,y1);x=y1-(b/a)*x1;y=x1;return gcd;}//o(log(b))
;
double dp[305][305][305];
ll cnt[4];
int main()
{
	ll n;
	in(n)
	for(ll i=0;i<n;i++){
		ll x;
		in(x);
		cnt[x]++;
	}
	//cout<<cnt[1]<<cnt[2]<<cnt[3]<<endl;
	
	for(ll sum=1;sum<=n;sum++){
		for(ll k=0;k<=sum;k++){
			for(ll j=0;j<=sum-k;j++){
				ll i=sum-j-k;
				dp[i][j][k]=n;
				if(k>0){
					dp[i][j][k]+=k*(dp[i][j+1][k-1]);
				}
				if(j>0){
					dp[i][j][k]+=j*(dp[i+1][j-1][k]);
				}
				if(i>0){
					dp[i][j][k]+=i*(dp[i-1][j][k]);
				}
				dp[i][j][k]/=(i+j+k);
			}
		}
	}	
	cout<<setprecision(10) <<dp[cnt[1]][cnt[2]][cnt[3]];


}






Measured memory_bytes: 219392
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int GCD(const int& a, const int& b){
   const int& _a = max(a,b);
   const int& _b = min(a,b);
   if(_a % _b == 0){
      return _b;
   }
   else{
      return GCD(_b, _a % _b);
   }
}

int LCM(const int& a, const int& b){
   const int& _a = max(a,b);
   const int& _b = min(a,b);
   return (_a*_b)/(GCD(_a, _b));
}

int main(){
   int N;
   cin >> N;
   set<char> S;
   for(int i = 0; i < N; i++){
      char s_tmp;
      cin >> s_tmp;
      S.insert(s_tmp);
   }

   if(S.size() == 4){
      cout << "Four" << endl;
   }
   else{
      cout << "Three" << endl;
   }

   return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define IO_OP std::ios::sync_with_stdio(0); std::cin.tie(0);
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define EB emplace_back
#define ALL(v) (v).begin(), (v).end()
#define endl '\n'

using namespace std;

typedef long long ll;
typedef pair<int, int> pi;
typedef vector<int> vi;

const int INF = 1e9 + 7;

int a[100005][3], dp[100005][3];

int main()
{
	IO_OP;
	
	int n;
	cin >> n;
	for(int i=0;i<n;i++)
		for(int j=0;j<3;j++)
			cin >> a[i][j];
	for(int i=0;i<3;i++)
		dp[0][i] = a[0][i];
	for(int i=1;i<n;i++) {
		for(int j=0;j<3;j++) {
			for(int k=0;k<3;k++)
				if(j != k)
					dp[i][j] = max(dp[i][j], dp[i-1][k] + a[i][j]);
		}
	}
	int mx = 0;
	for(int i=0;i<3;i++)
		mx = max(mx, dp[n-1][i]);
	cout << mx << endl;

}



Measured memory_bytes: 2560
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        #[allow(unused_mut)]
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        n: usize,
        r: usize,
    }
    let ans = if n >= 10 { r } else { r + 100 * (10 - n) };
    println!("{}", ans);
}


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

int main() {
	int N,ans=0;
  	string S;
  	cin >> N >> S;
  	for(int i=0;i+1<S.size();i++) {
      if(S[i]!=S[i+1]) ans++;
    }
  	cout << ans+1 << endl;
  	return 0;
}


Measured memory_bytes: 512
#input of int(split by space)
def get_i()
  return gets.chomp.split(" ").map(&:to_i)
end
#input of float(split by space)
def get_f()
  return gets.chomp.split(" ").map(&:to_f)
end
#input of string(split by space)
def get()
  return gets.chomp.split(" ")
end
#input of string(split per one character)
def get_nsp()
  return gets.chomp.split("")
end
#yes or no decision
def yn_judge(bool,y="Yes",n="No")
  return bool ? y : n 
end
#create of array
def array(size1,init=nil,size2=-1)
  if size2==-1
      return Array.new(size1){init}
  else
      return Array.new(size2){Array.new(size1){init}}
  end
end

def max(a,b)
    return a>b ? a : b
end

def min(a,b)
    return a>b ? b : a
end

INF=Float::INFINITY

N,M=get_i
ab=array(N)
N.times do|i|
  ab[i]=get_i
end
ab.sort!{|x,y| x[0]<=>y[0]}
m=M
ans=0
N.times do|i|
  break if m.zero?
  buy=min(m,ab[i][1])
  m-=buy
  ans+=ab[i][0]*buy
end
puts ans

Measured memory_bytes: 21840
#include <iostream>
#include <string>
#include <math.h>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <map>
using namespace std;

int main() {
	int n;
    long long int count = 0;
	map<string, int> check;
	cin >> n;
	for(int i = 0; i<n; i++){
		string s;
		cin >> s;
		sort(s.begin(), s.end());
		count += check[s]++;
	}
	cout << count << endl;

}

Measured memory_bytes: 11136
#include <cstdio>
#include <algorithm>
#include <vector>

using namespace std;

#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define all(c) begin(c),end(c)

typedef vector<int> vi;
typedef vector<vi> vvi;

int ans;

int solve(const vvi& a,vi& perm,vi& pos,int cur)
{
	int n=a.size();
	if(cur==a.size())
		return ans=min(ans,*max_element(all(pos)));
	
	int res=1<<29,right=0;
	rep(i,cur)
		right=max(right,pos[perm[i]]);
	repi(i,cur,n){
		swap(perm[cur],perm[i]);
		int mx=0;
		rep(j,cur){
			int x=perm[cur],y=perm[j];
			mx=max(mx,pos[y]+a[x][y]);
		}
		if(mx<ans){
			pos[perm[cur]]=mx;
			res=min(res,solve(a,perm,pos,cur+1));
		}
		swap(perm[cur],perm[i]);
	}
	return res;
}

int main()
{
	for(int n;scanf("%d",&n),n;){
		vvi a(n,vi(n));
		rep(i,n) rep(j,n)
			scanf("%d",&a[i][j]);
		rep(i,n) rep(j,n)
			a[i][j]=max(a[i][j],a[j][i]);
		
		vi perm(n),pos(n); iota(all(perm),0);
		ans=1<<29;
		printf("%d\n",solve(a,perm,pos,0));
	}
	
	return 0;
}

Measured memory_bytes: 1052
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
//絶対値
long long int change_plus(long long int a) {
	if (a < 0) { return -a; }
	if (a >= 0) { return a; }
}
//大小比較(大)
long long int big(long long int a, long long int b) {
	if (a >= b) {
		return a;
	}
	else {
		return b;
	}
}

//大小比較(小)
long long int small(long long int a, long long int b) {
	if (a >= b) {
		return b;
	}
	else {
		return a;
	}
}

int main() {
	long long int n,s,t,w, m, k,p,q,r=0;
	char str[60],str2[60],str3[15];
	int num[1200];
	scanf("%s", str);
	if (str[0] == 'Y') { r++; }

	if (str[1] == 'A') { r++; }
	if (str[2] == 'K') { r++; }
	if (str[3] == 'I') { r++; }
	
	if (r == 4) { printf("Yes"); }
	else { printf("No"); }
}

Measured memory_bytes: 128
#include <cstdio>
#include <iostream>
#include <string>
#include <cstring>

using namespace std;

int main(){
	string s;
	int count[4];
	int step=0;

	memset(count,0,sizeof(count));

	while(cin >> s){
		if(s[2] == ',')step=1;

		if(s[2+step] == 'A'){
			if(s[3+step] == 'B'){
				count[2]++;
			}else{
				count[0]++;
			}
		}else if(s[2+step] == 'B'){
			count[1]++;
		}else if(s[2+step] == 'O'){
			count[3]++;
		}

		step = 0;
	}

	for(int i=0;i<4;i++){
		cout << count[i] << endl;
	}

}

Measured memory_bytes: 3068
#pragma GCC optimize(2)
#include<iostream>
#include <algorithm>
#include <cmath>
#include <iterator>
#include <cstring>
#include <utility>
#include <cstdio>
#include <iomanip>
#include <sstream>
#include <map>
#include <unordered_map>
#include <vector> 
#include <bitset>
#include <cctype>
#include <set>
#include <stack>
#include <queue>
#include <fstream>
#include <numeric>
#include <random>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int MAXN = 1000005;
const int MAXM = 20500;
const ll MOD = 1e9+7;

#define MP make_pair
#define INF 0x3f3f3f3f
#define closeSync ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
template <typename T> inline T min(T a, T b, T c,T d) { return min(min(a, b), min(c,d)); }
template <typename T, typename T1> inline T qpower(T x, T p, T1 mod) { T re = 1; x %= mod; while (p) { if (p & 1)re = (re * x) % mod; x = (x * x) % mod; p >>= 1; }return re; }
#define mst(X,Y) memset(X,Y,sizeof(X)) 
#define rep(i, a, n) for (int i=(a); i<=(n); i++)
#define per(i, a, n) for (int i=(a); i>=(n); i--)
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>void debug_out(Head H, Tail... T) { cerr << " " << to_string(H);    debug_out(T...);}

const int LIM = 1000000;
int prime[MAXN];
int arr[MAXN];
int a[MAXN];
int fac[MAXN];
int cnt = 0;
void init(int n)
{
	for (int i=2;i<=n;i++)
	{
		if (!arr[i]) prime[++cnt]=i;			 
		for (int j=1;j<=cnt && prime[j]*i<=n;j++)			
		{
			arr[i*prime[j]]=1;
			if (i%prime[j]==0)			 
				break;					
		}
	}
}

bool pfc(int n)
{
	for (int i = 2; i * i <= n;i++)
	{
		// if (!arr[n])
		// {
		// 	if (fac[n])
		// 		return false;
		// 	else 
		// 	{
		// 		fac[n] = 1;
		// 		return true;
		// 	}
		// }
		if (n%i == 0)
		{
			if (fac[i])
				return false;
			else 
				fac[i] = 1;
			while (n%i == 0)
				n/=i;
		}
	}
	if (n != 1)
	{
		if (fac[n])
			return false;
		else 
			fac[n] = 1;
	}
	return true;
}


int main()
{closeSync;
#ifdef DEBUG
	//freopen("C:/Users/86159/Desktop/input.txt", "r", stdin);
	//freopen("C:/Users/86159/Desktop/output.txt", "w", stdout);
#endif
	//clock_t c1 = clock();
	init(1000002);
	int n;
	cin>>n;
	rep (i,1,n)
		cin>>a[i];
	bool pc = true;
	rep (i,1,n)
	{
		//debug(a[i],pfc(a[i]));
		if (!pfc(a[i]))
		{
			pc = false;
			break;
		}
	}
	if (pc)
		cout<<"pairwise coprime\n";
	else
	{
		int cd = a[1];
		rep (i,2,n)
			cd = __gcd(cd,a[i]);
		if (cd == 1)
			cout<<"setwise coprime\n";
		else 
			cout<<"not coprime\n";
	} 


	//cerr << "Time:" << clock() - c1 << "ms" <<endl;
    return 0;
}

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

#define F first
#define S second
#define PB push_back
#define MP make_pair
#define mod 1000000007;

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

// Print fn to print array

int main(){
	ll n;
	cin >> n;
	ll res;
	for(int i=1;i<=sqrtl(n);i++){
		if(n%i==0) res = i;
	}
	cout << res+(n/res)-2 << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

void trace(int A[], int N) {
	for (int i = 0; i < N; i++) {
		if (i > 0) cout << " ";
		cout << A[i];
	}
	cout << endl;
}

int selectionSort(int A[], int N) {
	int minj;
	int tmp;
	int count = 0;

	for (int i = 0; i < N; i++) {
		minj = i;
		for (int j = i; j < N; j++) {
			if (A[j] < A[minj]) {
				minj = j;	
			}
		}
		
		if (minj != i) {
			tmp = A[i];
			A[i] = A[minj];
			A[minj] = tmp;

			count++;
		}
	}

	trace(A, N);

	return count;
}

int main() {
	int N;
	int A[100];
	int count;
	
	cin >> N;
	for (int i = 0; i < N; i++) cin >> A[i];
	
	count = selectionSort(A, N);			

	cout << count << endl;

	return 0;
}

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

public class Main {

    private static BufferedReader br;
    private static StringTokenizer tokenizer;

    private static void solve() throws IOException {
        int n = nextInt();
        int m = nextInt();
        System.out.println(n == m ? "Yes" : "No");
    }




    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        solve();
    }

    public static String next() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            String line = br.readLine();
            if (line == null)
                throw new IOException();
            tokenizer = new StringTokenizer(line);
        }
        return tokenizer.nextToken();
    }

    public static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    public static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    public static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

}

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

ll keta_sum(ll a){
    ll ret = 0;
    while(a > 0){
        ret += a%10;
        a /= 10;
    }
    return ret;
}

int main(){
    ll N, A, B;
    cin >> N >> A >> B;
    ll ans = 0;
    rep(i, 1, N+1){
        if(A <= keta_sum(i) && keta_sum(i) <= B) ans += i;
    }
    cout << ans << endl;
    return 0;
}

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

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

  int n, a, b;
  cin >> n >> a >> b;
  string s;
  cin >> s;
  int counta = 0;
  int countb = 0;
  for (int i = 0; i < n; i++) {
    if (counta < a+b && s[i] == 'a') {
      puts("Yes");
      counta++;
    }
    else if (counta < a+b && countb < b && s[i] == 'b') {
      puts("Yes");
      counta++;
      countb++;
    }
    else puts("No");
  }
}

Measured memory_bytes: 848
#include <bits/stdc++.h>
#include <cmath>
#include <string>
#include <algorithm>
#include <queue>
#include <vector>
#include <functional>
#include <stack>
#include <map>
#include <utility>
#define REP(i,n) for(int i=0;i<n;++i)
using namespace std;

int main() {
  int n;
  cin >> n;
  if (n >= 30) {
    cout << "Yes";
  } else {
    cout << "No";
  }
  cout << endl;
}


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

using ll = long long;

template<typename T>
T gcd(T a, T b)
{
	if (a < b)	return gcd(b, a);
	T r;
	while ((r = a % b))
	{
		a = b;
		b = r;
	}
	return b;
}

template<typename T>
T lcm(T a, T b)
{
	return a * b / gcd(a, b);
}

template<typename T>
T ext_gcd(T a, T b, T& x, T& y)
{
	x = 1;
	y = 0;
	T x0 = 0, y0 = 1;
	while (b != 0)
	{
		T q = a / b;
		a -= q * b;
		swap(a, b);
		x -= q * x0;
		swap(x, x0);
		y -= q * y0;
		swap(y, y0);
	}
	return a;
}

template<typename T>
T inv_mod(T a, T mod)
{
	T t1, t2;
	ext_gcd(a, mod, t1, t2);
	t1 %= mod;
	if (t1 < 0)		t1 += mod;
	return t1;
}

template<typename T>
T combination_large(T n, T k, T mod)
{
	if (n < k || n < 0 || k < 0)	return 0;
	vector<T> inv(n + 1, 1), fact(n + 1, 1), fact_inv(n + 1, 1);
	for (T i = 2; i <= n; ++i)
	{
		inv[i] = mod - inv[mod % i] * (mod / i) % mod;
		fact[i] = (fact[i - 1] * i) % mod;
		fact_inv[i] = fact_inv[i - 1] * inv[i] % mod;
	}
	return fact[n] * (fact_inv[k] * fact_inv[n - k] % mod) % mod;
}

template<typename T>
T combination(T n, T k, T mod = 1)
{
	vector<vector<T>> table(n + 1, vector<T>(k + 1, 1));
	for (T i = 1; i <= n; ++i)
	{
		table[i][0] = 1;
		for (T j = 1; j <= n; ++j)
		{
			table[i][j] = (table[i - 1][j - 1] + table[i - 1][j]) % mod;
		}
	}
}

int main(int, char**)
{
	int N;
	cin >> N;
	vector<vector<int>> xs(N), ys(N);
	for (int i = 0; i < N; ++i)
	{
		int a;
		cin >> a;
		xs[i] = vector<int>(a);
		ys[i] = vector<int>(a);
		for (int j = 0; j < a; ++j)
		{
			cin >> xs[i][j] >> ys[i][j];
			--xs[i][j];
		}
	}

	size_t count = 0;
	for (int i = 0; i < (1 << N); ++i)
	{
		vector<int> truth(N, 0);
		bool ok = true;
		for (int j = 0; j < N; ++j)
		{
			if (((i >> j) & 1) != 0)
			{
				truth[j] = 1;
				for (size_t k = 0; k < xs[j].size(); ++k)
				{
					truth[xs[j][k]] = ys[j][k] == 1 ? 1 : -1;
				}
			}
		}
		for (int j = 0; j < N; ++j)
		{
			if (truth[j] <= 0) continue;
			for (size_t k = 0; k < xs[j].size(); ++k)
			{
				if ((truth[xs[j][k]] > 0 && ys[j][k] == 0) || (truth[xs[j][k]] < 0 && ys[j][k] == 1))
				{
					ok = false;
					break;
				}
				else if (truth[xs[j][k]] == 0)
				{
					truth[xs[j][k]] = ys[j][k] == 1 ? 1 : -1;
					j = -1;
					break;
				}
			}
		}

		if (ok)
		{
			size_t tmp = 0;
			for (const auto e : truth)
			{
				if (e > 0)
				{
					++tmp;
				}
			}
			count = max(count, tmp);
		}
	}

	cout << count << endl;
	return 0;
}


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

int main(void){
    int n;
    cin>>n;
    vector<vector<int> > ind(10010,vector<int>(4));
    vector<vector<vector<int> > > num(4,vector<vector<int> >(3,vector<int>(10)));
    
    for(int i=0;i<n;i++){
        for(int j=0;j<4;j++){
            cin>>ind.at(i).at(j);
        }
    }
    
    for(int i=0;i<n;i++){
        num.at(ind.at(i).at(0)-1).at(ind.at(i).at(1)-1).at(ind.at(i).at(2)-1)+=ind.at(i).at(3);
    }    
    for(int i=0;i<4;i++){
        for(int j=0;j<3;j++){
            for(int k=0;k<10;k++){
                cout<<" "<<num.at(i).at(j).at(k);

            }
            cout<<endl;
        }
        if(i!=3)cout<<"####################"<<endl;
    }
}



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

int main() {
    int N, M, ans = 0;
    cin >> N >> M;
    vector<vector<int>> S(N, vector<int>(M, 0));
    for (int i = 0; i < N; i++) {
        int K;
        cin >> K;
        for (int j = 0; j < K; j++) {
            int a;
            cin >> a;
            S.at(i).at(a - 1) = 1;
        }
    }
    for (int i = 0; i < M; i++) {
        for (int j = 0; j < N; j++) {
            if (S.at(j).at(i) != 1) {
                break;
            }
            if (j == N - 1) {
                ans++;
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
l=[list(map(int,input().split())) for _ in range(3)]
flag = "No"
if l[0][1]-l[0][0] == l[1][1]-l[1][0] == l[2][1]-l[2][0]:
    if l[0][2]-l[0][1] == l[1][2]-l[1][1] == l[2][2]-l[2][1]:
        flag = "Yes"
print(flag)

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

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);
class packet {
public:
	int t, s, d;
	bool operator<(const packet &other) {
		return this->t < other.t;
	}
};
signed main() {
	int n, m;
	while (cin >> n >> m, n||m) {
		vector<bool>v(n, false); v[0] = true;
		vector<packet>p(m);
		rep(i, 0, m) {
			cin >> p[i].t >> p[i].s >> p[i].d;
			p[i].s--; p[i].d--;
		}
		sort(p.begin(), p.end());
		rep(i, 0, m) {
			if (v[p[i].s] == true)v[p[i].d] = true;
		}
		cout << accumulate(v.begin(), v.end(), 0) << endl;
	}
	return 0;
}

Measured memory_bytes: 3336
S = input()
ans = 0

if S[0]=="A":
  S = S[1:]
  if 1<=S.find("C")<=len(S)-2:
    S = S[:S.find("C")]+S[S.find("C")+1:]
    for s in S:
      if 97<=ord(s)<=122:
        ans+=1
    if ans == len(S):
      print("AC")
      exit()
        
print("WA")

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

using namespace std;


void solve() {
    int n,k;
    cin >> n >> k;
    vector<pair<int, int>> a(n);
    vector<int> X(n), Y(n);
    for (int i = 0; i < n; i++) {
        cin >> X[i] >> Y[i];
        a[i] = {X[i], Y[i]};
    }
    sort(X.begin(), X.end());
    sort(Y.begin(), Y.end());
    long long res = 1ll<<62;
    for (int i = 0; i < n; i++) {
        for (int j = i; j < n; j++) {
            for (int s = 0; s < n; s++) {
                for (int t = s; t < n; t++) {
                    int x[2] = {X[i], X[j]};
                    int y[2] = {Y[s], Y[t]};
                    int cnt = 0;
                    for (auto& p: a) {
                        if (x[0]<=p.first&&p.first<=x[1] && y[0]<=p.second&&p.second<=y[1])cnt++;
                    }
                    if (cnt>=k) res = min(res, 1ll*(x[1]-x[0])*(y[1]-y[0]));
                }
            }
        }
    }
    cout << res;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    solve();
    cout << endl;
}


Measured memory_bytes: 256
from math import sqrt

def n_based(n:int, base:int) -> int:
    if n == 0:
        return 0
    
    ans = 0
    res = n
    
    while abs(res) > 0:
        q = res%base
        if q>=0:
            ans = q + ans
            res //= base
        else:
            q += abs(base)
            ans = q + ans
            res //= base
            res += 1
        
    return ans


n = int(input())
s = int(input())

def judge(n:int, s:int) -> int:
    if n < s:
        return -1
    elif n==1 and s==1:
        return 2
    elif n == s:
        return n+1
    else:
        for i in range(2,int(sqrt(n))+2):
            #print(i)
            if n_based(n,i) == s:
                return i
            
        for p in range(int(sqrt(n)), 0, -1):
            if (n-s+p) % p == 0:
                b = (n-s+p) // p
                #print(p,b)
                if n_based(n,b) == s:
                    return b
                
                
        return -1
    
print(int(judge(n,s)))

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

namespace AtCorder
{
	public class Program
	{
		const long MOD = 998244353;
		static void Main(string[] args)
		{
			var cin = new Scanner2();
			int n = cin.Int();
			int m = cin.Int();
			var lrc = new LRC[m];
			for (int i = 0; i < m; i++) {
				int l = cin.Int() - 1;
				int r = cin.Int() - 1;
				long c = cin.Long();
				lrc[i] = new LRC(l, r, c);
			}

			Array.Sort(lrc, (x, y) => {
				if (x.L == y.L) {
					return x.C.CompareTo(y.C);
				} else {
					return x.L.CompareTo(y.L);
				}
			});

			if (lrc[0].L != 0) {
				Console.WriteLine(-1);
				return;
			}

			long[] ds = new long[n];
			for (int i = 0; i < n; i++) {
				ds[i] = -1;
			}

			ds[0] = 0;
			for (int i = 0; i < m; i++) {
				var next = lrc[i];
				long nextD = ds[next.L] + next.C;
				if (ds[next.L] != -1 && (ds[next.R] == -1 || ds[next.R] > nextD)) {
					for (int j = next.R; j >= next.L; j--) {
						if (ds[j] != -1 && ds[j] <= nextD) {
							break;
						}

						ds[j] = nextD;
					}
				}
			}

			Console.WriteLine(ds[n - 1]);
		}
	}

	struct LRC
	{
		public int L;
		public int R;
		public long C;
		public LRC(int l, int r, long c)
		{
			L = l;
			R = r;
			C = c;
		}
	}


	public class Scanner2
	{
		private readonly char[] delimiter_ = new char[] { ' ' };
		private readonly string filePath_;
		private string[] buf_;
		private int index_;
		Func<string> reader_;

		public Scanner2(string file = "")
		{
			if (string.IsNullOrWhiteSpace(file)) {
				reader_ = Console.ReadLine;
			} else {
				filePath_ = file;
				var fs = new StreamReader(file);
				reader_ = fs.ReadLine;
			}
			buf_ = new string[0];
			index_ = 0;
		}

		public string Next()
		{
			if (index_ < buf_.Length) {
				return buf_[index_++];
			}

			string st = reader_();
			while (st == "") {
				st = reader_();
			}

			buf_ = st.Split(delimiter_, StringSplitOptions.RemoveEmptyEntries);
			if (buf_.Length == 0) {
				return Next();
			}

			index_ = 0;
			return buf_[index_++];
		}

		public int Int() => int.Parse(Next());
		public long Long() => long.Parse(Next());
		public double Double() => double.Parse(Next());

		public int[] ArrayInt(int N, int add = 0)
		{
			int[] Array = new int[N];
			for (int i = 0; i < N; i++) {
				Array[i] = Int() + add;
			}
			return Array;
		}

		public long[] ArrayLong(int N, long add = 0)
		{
			long[] Array = new long[N];
			for (int i = 0; i < N; i++) {
				Array[i] = Long() + add;
			}
			return Array;
		}

		public double[] ArrayDouble(int N, double add = 0)
		{
			double[] Array = new double[N];
			for (int i = 0; i < N; i++) {
				Array[i] = Double() + add;
			}
			return Array;
		}

		public void Save(string text)
		{
			if (string.IsNullOrWhiteSpace(filePath_)) {
				return;
			}

			File.WriteAllText(filePath_ + "_output.txt", text);
		}
	}
}

Measured memory_bytes: 17492
import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int H = sc.nextInt();
		int A = sc.nextInt();
		int ans = 0;
		while(H > 0){
			H -= A;
			ans++;
		}
		System.out.println(ans);
	}
}

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

int main() {
	int n, h;
	cin >> h >> n;
	vector<int> a(n);
	int sum = 0;
	for (int i = 0; i < n; ++i) cin >> a[i], sum += a[i];
	cout << (sum>=h?"Yes":"No") << endl;
	return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
char a[100005];
int x=0,y=0,ans=0;
int main()
{
    cin>>a;
    for (int i=0;i<sizeof(a);i++)
     if (x==y){x++; if(a[i]=='p') ans--;}    //只能出石头 
     else{y++; if(a[i]=='g') ans++;}         //能出布就一定出
    printf("%d\n",ans);                      //AT题记得\n
    return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define forn(i, n) for(int i = 0; i < int(n); i++)
#define fore(i, l, r) for(int i = int(l); i < int(r); i++)
#define pb push_back
#define deb(x) cout<<#x<<" "<<x<<endl;
#define deb2(x, y) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<endl;
#define deb3(x, y, z) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<" "<<#z<<" "<<z<<endl;
#define all(x) x.begin(), x.end()
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef pair<int, int> pii;
const int mod = 1e9 + 7;
template<class T, class U> inline void add_self(T &a, U b){a += b;if (a >= mod) a -= mod;if (a < 0) a += mod;}
template<class T, class U> inline void min_self(T &x, U y) { if (y < x) x = y; }
template<class T, class U> inline void max_self(T &x, U y) { if (y > x) x = y; }

template <typename T>void print(T v, bool show_index = false){int w = 2;if(show_index){for(int i=0; i<v.size(); i++)cout<<setw(w)<<i<<" ";cout<<endl;}for(auto i= v.begin(); i!=v.end(); i++)cout<<setw(w)<<*i<<" ";cout<<endl;}
template <typename T>void print_vv(T v){if(v.size()==0) {cout<<"Empty"<<endl; return;} int w = 3;cout<<setw(w)<<" ";for(int j=0; j<v[0].size(); j++)cout<<setw(w)<<j<<" ";cout<<endl;for(auto i= 0; i<v.size(); i++){cout<<i<<" {";for(auto j = 0; j!=v[i].size(); j++){cout<<setw(w)<<v[i][j]<<",";}cout<<"},"<<endl;}cout<<endl;}
template <class T, class U> void print_m(map<T,U> m, int w=3){if(m.empty()){cout<<"Empty"<<endl; return;}for(auto x: m)cout<<"("<<x.first<<": "<<x.second<<"),"<<endl;cout<<endl;}

int main(){
    int n,m; char c;
    while(cin>>n>>m){
        vvi grid(n, vi(m));
        // . :  1, # : 0
        forn(i,n){
            forn(j,m){
                cin>>c;
                grid[i][j] = c=='.';
            }
        }
        vvi dp(n+1, vi(m+1));
        dp[0][0] = 1;
        forn(i,n){
            forn(j,m){
                if(grid[i][j]){
                    add_self(dp[i+1][j], dp[i][j]);
                    add_self(dp[i][j+1], dp[i][j]);
                }
            }
        }

        cout<<dp[n-1][m-1]<<endl;
        // print_vv(dp);
        // deb(dp[n-1][m-1]);
    }

    return 0;
}

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

int main()
{
	int n,k;

	cin>>n>>k;
	int arr[n];
	for(int i=0;i<n;i++)
	{
		cin>>arr[i];
	}
	sort(arr,arr+n);
	int sum=0;
	for(int i=0;i<k;i++)
	{
		sum+=arr[i];
	}
	cout<<sum<<endl;
	return 0;
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1e9
#define PI 3.14159265359
#define MOD 1000000007
#define ALL(v) v.begin(),v.end()
typedef long long ll;

int main() {
  int n,k;
  cin >> n >> k;
  int count=0;
  while(n!=0){
    n=n/k;
    count++;
  }
  cout << count << endl;
}

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

using namespace std;

int main() {
    int N, K;
    cin >> N >> K;
    string S;
    cin >> S;
    
    vector<int> Nums;
    int now = 1; //今見ている数
    int cnt = 0; //nowがいくつ並んでいるか
    for(int i=0 ;i < N; i++) {
        if(S[i] == (char)('0' + now)) cnt++;
        else {
            Nums.push_back(cnt);
            now = 1 - now; //0と1を切り替える時の計算
            cnt = 1; //新しいのをカウントし始める
        }
    }
    if (cnt != 0) Nums.push_back(cnt);

    //1-0-1-0-1-0-1 って漢字の配列がほしい 
    //1-0-1-0-1-0みたいに0で終わってたら，適当に1つ足す
    if (Nums.size() % 2 == 0) Nums.push_back(0);

    int Add = 2 * K + 1;
    int ans = 0;

    int left = 0;
    int right = 0;
    int tmp = 0; // [left, right) のsum
    for(int i = 0;i < Nums.size(); i += 2) {

        int nextleft = i;
        int nextright = min((int)Nums.size(), i + Add);
        // 左端を移動する
        while(nextleft > left) {
            tmp -= Nums[left];
            left++;
        }

        //右端を移動する
        while(nextright > right) {
            tmp += Nums[right];
            right++;
        }
        ans = max(tmp, ans);
    }

    cout << ans << endl;
}

Measured memory_bytes: 1020
#include <stdio.h>
 
int main(){
    int n,x,count;
    while(true){
        scanf("%d %d",&n,&x);
        if(n == 0 && x == 0) break;
        count = 0;
        for(int min = 1; min < x/3 && min <= n-2;min++){
            for(int middle = min+1;middle < x - (min+middle) && middle <= n-1; middle++){
                if(x-(min+middle) <= n) count++;
            }
        }
        printf("%d\n",count);
    }
 
}


Measured memory_bytes: 2736
#include<iostream>
#include<vector>
#include<algorithm>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>
#include<climits>
#include<set>


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

#define ARRAY_MAX 100005

const ll INF = 1e9 + 7;
const ll MOD = 1e9 + 7;

bool used[1005];

int main() {

	int n, d;
	string x;
	cin >> n >> x >> d;

	string ans = x;

	int cnt = 0;
	
	for (int i = 0; i < n; i++)
	{
		if (ans[i] == ans[i] && cnt < d)
		{
			if (ans[i] == '0')
			{
				used[i] = true;
				ans[i] = '1';
				cnt++;
			}
			if (cnt == d)
			{
				break;
			}
		}
	}

	if (cnt < d)
	{
		for (int i = n - 1; i >= 0; i--)
		{
			if (ans[i] == x[i] && cnt < d && used[i] == false)
			{
				if (ans[i] == '0')
				{
					ans[i] = '1';
				}
				else
				{
					ans[i] = '0';
				}
				used[i] = true;
				cnt++;
			}
			if (cnt == d)
			{
				break;
			}
		}
	}

	cout << ans << endl;

}


Measured memory_bytes: 3196
import bisect
n=int(input())
X=list(map(int,input().split()))
sortX = sorted(X)
ansl = sortX[n//2-1]
ansu = sortX[n//2]
for x in X:
  if bisect.bisect(sortX,x) > n//2:
    print(ansl)
  else:
    print(ansu)

Measured memory_bytes: 94172
import java.util.*;
 
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String s = "No";

		while(N > 0){
			if(N % 10 == 7){
			s = "Yes";
			break;
			}
			N = N / 10;
			
		}
		System.out.println(s);
		
	}
}

Measured memory_bytes: 35856
# -*- coding: utf-8 -*-
# 
import math
import sys
import itertools
#import numpy as np

n =int(input())

# 空白区切りの数列をリストに代入
k = list(input())
for i in range(n):
    k[i]= int(k[i])
answer = 0
for i in range(1000):
    a=i//100
    b=(i%100)//10
    c=i%10
    p=0
#    print(a,b,c,p,n)
    for j in range(p,n):
        if k[j] == a:
            p = j+1
            break
    else:
        continue
    for j in range(p,n):
        if k[j] == b:
            p = j+1
            break
    else:
        continue
    for j in range(p,n):
        if k[j] == c:
#            p = j+1
            answer += 1
#            print(i)
            break

print(answer)





Measured memory_bytes: 45404
S = input()

if S[0] != "A":
    print("WA")
    exit()

index = 0
cnt = 0
for i in range(2,len(S)-1):
    if S[i] == "C":
        cnt += 1
        index = i
if cnt != 1:
    print("WA")
    exit()

for i in range(1,len(S)):
    if i == index:
        pass
    elif S[i].islower() != True:
        print("WA")
        exit()

print("AC")


Measured memory_bytes: 3064
#define N 105
#include <stdio.h>

void showArray(int a[], int n) {
    for (int i = 0; i < n; i++) {
        if (i > 0) {
            printf(" ");
        }
        printf("%d", a[i]);
    }
    printf("\n");
}

int SelectionSort(int a[], int n) {
    int sw = 0;
    for (int i = 0; i < n; i++) {
        int minj = i;  //这里记录的是最小值的下标
        for (int j = i; j < n; j++) {
            if (a[j] < a[minj]) {
                minj = j;
            }
        }
        if (minj != i) {
            int tmp = a[i];
            a[i] = a[minj];
            a[minj] = tmp;
            sw++;
        }
    }
    return sw;
}

int main() {
    int a[N];
    int n = 0;
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
        scanf("%d", &a[i]);
    }
    int sw = SelectionSort(a, n);
    showArray(a, n);
    printf("%d\n", sw);
    return 0;
}


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

int main() {
  int64_t X;
  cin >> X;
  int64_t a = 100;//預金額
  int t = 0;//年数
  
  while(a < X){
    a += a / 100;
    t++;
  }
  
  cout << t << endl;
}


Measured memory_bytes: 3636
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <time.h>
#define int long long
#define endl '\n'
#define INF 1000000000000000009
#define all(a) a.begin(),a.end()
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<ll, P> PP;
template<class T, class S> bool chmax(T &a, const S &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T, class S> bool chmin(T &a, const S &b) { if (a > b) { a = b; return 1; } return 0; }
ll gcd(ll n, ll m) { return (m ? gcd(m, n%m) : n); }
ll lcm(ll n, ll m) { return n / gcd(n, m)*m; }
ll mod = 1000000007;
ll modsize;

ll modinv(ll a) {
	ll b = mod, u = 1, v = 0;
	while (b) {
		ll t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= mod;
	if (u < 0) u += mod;
	return u;
}

ll modpow(ll a, ll b) {
	ll ans = 1;
	a %= mod;
	while (b) {
		if (b & 1) ans = ans * a%mod;
		a = a * a%mod;
		b >>= 1;
	}
	return ans;
}

vector<ll> fac(modsize + 5);
vector<ll> inv(modsize + 5);
vector<ll> facinv(modsize + 5);

void modcalc() {
	fac[0] = fac[1] = 1; inv[1] = 1;
	facinv[0] = facinv[1] = 1;
	for (int i = 2; i < modsize; i++) {
		fac[i] = fac[i - 1] * i % mod;
		inv[i] = mod - inv[mod%i] * (mod / i) % mod;
		facinv[i] = facinv[i - 1] * inv[i] % mod;
	}
}

ll modcomb(ll n, ll k) {
	if (n < 0 || k < 0 || n < k) return 0;
	return fac[n] * facinv[k] % mod * facinv[n - k] % mod;
}

ll modperm(ll n, ll k) {
	if (n < 0 || k < 0 || n < k) return 0;
	return fac[n] * facinv[n - k] % mod;
}

ll modhom(ll n, ll k) {
	if (n < 0 || k < 0) return 0;
	if (n == 0 && k == 0) return 1;
	return modcomb(n + k - 1, k);
}

template<class T>
class segtree {
	int n;
	vector<T> data;
	T def;
	function<T(T, T)> operation;
	function<T(T, T)> update;
	T _query(int a, int b, int k, int l, int r) {
		if (r <= a || b <= l) return def;
		if (a <= l && r <= b) return data[k];
		T c1 = _query(a, b, 2 * k + 1, l, (l + r) / 2);
		T c2 = _query(a, b, 2 * k + 2, (l + r) / 2, r);
		return operation(c1, c2);
	}
public:
	segtree(size_t _n, T _def, function<T(T, T)> _operation, function<T(T, T)> _update)
		:def(_def), operation(_operation), update(_update) {
		n = 1;
		while (n < _n) {
			n *= 2;
		}
		data = vector<T>(2 * n - 1, def);
	}
	void change(int i, T x) {
		i += n - 1;
		data[i] = update(data[i], x);
		while (i > 0) {
			i = (i - 1) / 2;
			data[i] = operation(data[i * 2 + 1], data[i * 2 + 2]);
		}
	}
	T query(int a, int b) {
		return _query(a, b, 0, 0, n);
	}
	T operator[](int i) {
		return data[i + n - 1];
	}
};

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

	int n, a;
	cin >> n;
	set<int> st;
	rep(i, n) {
		cin >> a;
		st.insert(a);
	}
	cout << (st.size() == n ? "YES" : "NO") << endl;
}

Measured memory_bytes: 9600
#include <iostream>

using namespace std;

int main()
{
    int a,b,c;
    cin >>a>>b>>c;
    if ((a==b)&&(a==c))
        cout << "1";
    else if ((a!=b)&&(a==c))
        cout << "2";
    else if ((a==b)&&(a!=c))
        cout << "2";
    else if ((c==b)&&(a!=b))
        cout << "2";
     else
        cout << "3";
    return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"

#define REP(i,num) for(int i=0;i<(num);++i)
#define LOOP(i) while(i--)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto pitr=c.begin();pitr!=c.end();++pitr){cout<<*pitr;if(next(pitr,1)!=c.end())cout<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);

	ll N=in();
	ll S=0,R=0,A=0;
	REP(i,N){
		S += (ll)(i+1);
		if(S>=N){
			R = S-N;
			A=i+1;
			break;
		}
	}

	REP(i,A){
		if((ll)(i+1LL)==R) continue;
		else out(i+1);
	}
	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(void)
{
   int A, B, C, D;

   scanf("%d",&A);
   scanf("%d",&B);
   scanf("%d",&C);
   scanf("%d",&D);

   if(A >= B)
      A = B;
   if(C >= D)
      C = D;
   printf("%d\n", A+C);
   return 0;
}

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

using namespace std;

int a[200005];

main() {
#ifdef HOME
    freopen("input.txt", "r", stdin);
#endif // HOME
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    multiset < int > Q;
    for (int i = 1; i <= n; ++i) {
        cin >> a[i];
        Q.insert(a[i]);
    }
    for (int i = 1; i <= n; ++i) {
        Q.erase(Q.find(a[i]));
        cout << (*Q.rbegin()) << '\n';
        Q.insert(a[i]);
    }
    return 0;
}



Measured memory_bytes: 11904
a,b,m = map(int,input().split())
lia = list(map(int,input().split()))
lib = list(map(int,input().split()))
xyc = [list(map(int,input().split())) for _ in range(m)]

ans = min(lia) + min(lib)

for x,y,c in xyc:
    ans = min(ans, lia[x-1] + lib[y-1] - c)

print(ans)


Measured memory_bytes: 80324