akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define gc getchar_unlocked()
#define pc(x) putchar_unlocked(x)
template<typename T> void scan(T &x){x = 0;bool _=0;T c=gc;_=c==45;c=_?gc:c;while(c<48||c>57)c=gc;for(;c<48||c>57;c=gc);for(;c>47&&c<58;c=gc)x=(x<<3)+(x<<1)+(c&15);x=_?-x:x;}
template<typename T> void printn(T n){bool _=0;_=n<0;n=_?-n:n;char snum[65];int i=0;do{snum[i++]=n%10+48;n/= 10;}while(n);--i;if (_)pc(45);while(i>=0)pc(snum[i--]);}
template<typename First, typename ... Ints> void scan(First &arg, Ints&... rest){scan(arg);scan(rest...);}
template<typename T> void print(T n){printn(n);pc(10);}
template<typename First, typename ... Ints> void print(First arg, Ints... rest){printn(arg);pc(32);print(rest...);}

using namespace std;
using ll = long long;
const int MM = 2e3+5;
int n, x, y, dis[MM], a[MM];
vector<int> adj[MM];

int main(){
    scan(n, x, y);
    adj[x].emplace_back(y);
    adj[y].emplace_back(x);
    for(int i = 2; i <= n; i++){
        adj[i].emplace_back(i-1);
        adj[i-1].emplace_back(i);
    }
    for(int i = 1; i <= n; i++){
        memset(dis, 0x3f, sizeof dis);
        dis[i] = 0;
        queue<int> q;
        q.push(i);
        while(!q.empty()){
            int cur = q.front(); q.pop();
            for(int u: adj[cur]){
                if(dis[cur] + 1 < dis[u]){
                    dis[u] = dis[cur]+1;
                    q.push(u);
                }
            }
        }
        for(int j = i+1; j <= n; j++){
            a[dis[j]]++;
        }
    }
    for(int i = 1; i < n; i++)
        print(a[i]);
    
    return 0;
}

Measured memory_bytes: 384
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<numeric>
using namespace std;
int main() {

	int a, b, c;
	cin >> a >> b >> c;

	if (3 - (a == b) - (b == c) - (c == a) == 0)
		cout << 1 << endl;
	else
		cout << 3 - (a == b) - (b == c) - (c == a) << endl;

	return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int n = sc.nextInt(), choo = sc.nextInt();
		int[] x=new int[n];
		for(int i=0;i<n;i++)
			x[i] = sc.nextInt();
		long sum = 0;
		Arrays.sort(x);
		for(int i=0;i<choo;i++)
			sum+=x[i];
		System.out.println(sum);
	}
}


Measured memory_bytes: 30016
N, M, C = gets.chomp.split(" ").map(&:to_i)
B = gets.chomp.split(" ").map(&:to_i)
ans = 0
N.times{
  a = gets.chomp.split(" ").map(&:to_i)
  ans += 1 if 0 < (B.zip(a).inject(0){|r, (b, a)| r + a * b} + C)
}

puts ans


Measured memory_bytes: 1788
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
      ll N,A,B;cin>>N>>A>>B;
      if(abs(A-B)%2==0){
            cout<<(abs(A-B))/2<<endl;
      }
      else{
            cout<<min(max(abs(A-1),abs(B-1))-(max(abs(A-1),abs(B-1))-min(abs(A-1),abs(B-1)))/2,
            max(abs(A-N),abs(B-N))-(max(abs(A-N),abs(B-N))-min(abs(A-N),abs(B-N)))/2)<<endl;
      }
      return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>
#include <algorithm>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define rep2(i,n) for(int i=1; i<=(n); i++)

int main() {
    int n,m,inf=1000000007;
    cin>>n>>m;
    vector<int>x(m),ans(n+1);
    rep(i,m)cin>>x[i];
    vector<bool>z(n,true);
    rep(i,m)z[x[i]]=false;
    if(z[1])ans[1]=1;
    ans[0]=1;
    for(int k=2;k<=n;k++){
        if(z[k]){
            ans[k]=ans[k-1]+ans[k-2];
            ans[k]%=inf;
            //cout<<ans[k]<<endl;
        }
    }
    cout<<ans[n];
    return 0;
}



Measured memory_bytes: 1024
#create date: 2020-06-30 22:48

import sys
stdin = sys.stdin
from itertools import product

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

def main():
    n = ni()
    t = [[-1] * n for _ in range(n)]
    for j in range(n):
        a = ni()
        for i in range(a):
            x, y = na()
            t[j][x-1] = y
    l = list(product([0, 1], repeat=n))
    ans = 0
    #print(t)
    for li in l:
        f = True
        for i in range(n):
            people = li[i]
            if people:
                for j in range(n):
                    if t[i][j] == 1 and li[j] == 0:
                        f = False
                    if t[i][j] == 0 and li[j] == 1:
                        f = False
        if f:
            #print(li, f)
            ans = max(ans, sum(li))
    print(ans)

if __name__ == "__main__":
    main()

Measured memory_bytes: 14432
import math
import sys
import os
from operator import mul
import bisect

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")

N = I()
S = list(_S())
ans = 0

r = []
g = []
b = []

for i,s in enumerate(S):
    if s == 'R':
        r.append(i)
    if s == 'G':
        g.append(i)
    if s == 'B':
        b.append(i)

# j = bisect.bisect_right(<list>,<value>)
# print(r)
# print(g)
# print(b)

# for i in r:
#     for j in g:
#         for k in b:
#             tmp = sorted([i,j,k])
#             if not tmp[1]-tmp[0]==tmp[2]-tmp[1]:
#                 ans += 1

ans = len(r)*len(g)*len(b)

for i in range(N):
    for j in range(i,N):
        k = j + (j-i)
        if k > N-1:
            break
        if S[i]==S[j]:
            continue
        if S[i]==S[k] or S[j]==S[k]:
            continue
        ans -= 1

print(ans)

# R G B
# R B G
# G B R
# G R B
# B G R
# B R G

# i   j   k
#  - != -

# RBRBGRBGGB
# 1122233333
# 0000111233
# 0112223334

# B*3
# G*4

# GB系: (2,4), (4,5)
# RB系: (1,3),

Measured memory_bytes: 9308
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define all(x)  x.begin(),x.end()
#define vi vector<int>
#define vll vector<ll>
#define print(x) for(auto it=x.begin();it!=x.end();it++) cout<<*it<<' '; cout<<'\n';
#define debug(a,b,c) cout << a << " " << b << " " << c << endl;
#define in(x,n) for(int e=0;e<n;e++){int y;cin>>y;x.pb(y);}
#define inl(x,n) for(int e=0;e<n;e++){ll y;cin>>y;x.pb(y);}
#define lower(sl)  transform(sl.begin(), sl.end(), sl.begin(), ::tolower); 
#define endl "\n";
#define pi pair<int,int>
#define vpi vector<pair<int,int>>
#define vvi vector<vector<int>>
 

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	//code here
	string s;
	cin >> s;
	if(s[s.size()-1]=='s'){
		s.pb('e');
		s.pb('s');
	} else {
		s.pb('s');
	}
	cout << s << endl;
}

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

int X=0, Y=0, num=0;
char s;
int ints;

int main() {
  while(cin >> s){
    ints = s - '0';
    if((num & 1) == ints) {
      X++;
    }
    else{
      Y++;
    }
    num++;
  }
  cout << min(X,Y) << endl;
}

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

const ll mod = 1e9 + 7;

ll power(ll a, ll b) {
	if (b == 0) {
		return 1;
	}
	ll s = power(a, b / 2);
	s *= s;
	if (b & 1) return (s*a);
	return s;
}

int main() {

	ll n;
    cin>>n;
    ll x;
    cin>>x;
    string s[n];
    for(ll i=0;i<n;i++){
        cin>>s[i];
    }

    sort(s,s+n);
    for(ll i=0;i<n;i++){
        cout<<s[i];
    }
    cout<<endl;

}

Measured memory_bytes: 256
a = int(input())
b = int(input())

if (a == 1 or a == 2) and (b == 1 or b == 2):
    print(3)
elif (a == 2 or a == 3) and (b == 2 or b == 3):
    print(1)
elif (a == 1 or a == 3) and (b == 1 or b == 3):
    print(2)

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

long long n;

int main(){

	cin>>n;
	
	cout<<"0 0 1 1000000000 "<<((n+1000000000ll-1ll)/1000000000ll)<<" "<<(((n+1000000000ll-1ll)/1000000000ll)*1000000000ll-n)<<endl;

return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007;
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    int k;
    cin>>k;
    ll sum=0;
    for(int i=1;i<=k;i++){
    	for(int j=1;j<=k;j++){
    		int g=__gcd(i,j);
    		for(int x=1;x<=k;x++){
    			sum+=__gcd(g,x);
    		}
    	}
    }
    cout << sum <<endl;
    return 0;
}


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

using namespace std;

using ll=long long;

void solve() {
    int n; cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    vector<ll> res(n);
    res[0] = 0;
    for (int i = 1; i < n; i++) {
        res[i] = (ll)a[i-1] - res[i-1];
    }
    ll d = (ll)a[n-1] - res[0] - res[n-1];
    assert((d&1)==0);
    ll h = d/2;
    for (int i = 0; i < n; i++) {
        if (i&1) res[i] -= h;
        else res[i] += h;
    }
    for (auto& x: res) {
        cout << 2*x << ' ';
    }
}

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


Measured memory_bytes: 2560
N,A,B,C,D = map(int,input().split())
S = input()
A -= 1
B -= 1
C -= 1
D -= 1

if S[A:max(C,D)+1].count("##") == 0 :
    if C < D :
        print("Yes")
    else :
        if S[B-1:D+2].count("...") :
            print("Yes")
        else :
            print("No")
else :
    print("No")

Measured memory_bytes: 3572
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define gcd(a,b)   __gcd(a,b)
#define lcm(a,b)   (a*b)/gcd
#define rep(i,n)   for(int i=0;i<n;i++)
#define Rep(i,n)   for(int i=1;i<=n;i++)
#define REP(i,j,n) for(int i=j;i<=n;i++)
#define fast   ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)


int main()
{ 
	fast;
    
  int x,y;
cin>>x>>y;
string s;
std::vector<string>v;
rep(i,x){
	cin>>s;
	v.push_back(s);
}
sort(v.begin(),v.end());
rep(i,x){
	cout<<v[i];
}
cout<<endl;

	

}

Measured memory_bytes: 3628
#include<cstdio>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<queue>
#include<map> 
#include<bitset>
#include<vector>
using namespace std;
#define int __int128
#define re register int
inline int read(){
    int x=0,ff=1;char c=getchar();
    while(c<'0'||c>'9'){if(c=='-')ff=-1;c=getchar();}
    while(c>='0'&&c<='9'){x=(x<<1)+(x<<3)+(c^48);c=getchar();}
    return x*ff;
}
struct tt{
	int x,y;
	bool friend operator <(tt xx,tt yy){
		return xx.x<yy.x;
	}
}a[200005];
int n,d,k,f[200005],ans;
void write(__int128 x){
	if(x>9)write(x/10);
	short y=x%10;cout<<y;
}
signed main(){
	n=read();d=read();k=read();
	for(re i=1;i<=n;i++)a[i].x=read(),a[i].y=read();
	for(re i=1;i<=n;i++)a[i].y=(a[i].y+k-1)/k;
	sort(a+1,a+n+1);
	for(re i=1;i<=n;i++){
		f[i]=f[i-1]+f[i];
		if(f[i]+a[i].y<=0)continue;
		int u=a[i].x+2*d,l,r,mid;l=i+1,r=n;
		while(l<=r){
			mid=(l+r)>>1;
			if(a[mid].x<=u)l=mid+1;
			else r=mid-1;
		}
		f[l]+=f[i]+a[i].y;ans+=f[i]+a[i].y;f[i]-=a[i].y+f[i];
	}
	write(ans);puts("");
   	return 0;
}


Measured memory_bytes: 9600
def main():
    N = int(input())
    tasks = [tuple(map(int, input().split())) for _ in range(N)]
    tasks.sort(key=lambda x: x[1])
    time = 0
    for A, B in tasks:
        time += A
        if B < time:
            return 'No'
    return 'Yes'

print(main())


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

using namespace std;
const int N=1e6+3;
int main()
{
    int n,x ;
    cin >> n;
    map<int,int>arr;
    vector<int>v;
    map<int,int>mp;
    for(int i = 0 ; i < n ; i++)
    {
        cin >> x;
        v.push_back(x);
        mp[x]++;
    }
    sort(v.begin(),v.end());
    int ans=0;
    for(int i = 0 ; i < n ; i++)
    {
        if(arr[v[i]]==0)
        {
            for(int j= v[i] ; j<N ; j+=v[i])
            {
                arr[j]++;
            }
            if(mp[v[i]]<=1)
                ans++;
        }
    }
    cout << ans;
    return 0;
}


Measured memory_bytes: 60080
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Console;
using Pair = System.Collections.Generic.KeyValuePair<int, int>;

namespace CF2016C_B
{
    class Program
    {
        static int N;
        static void Main(string[] args)
        {
            var t = scan;
            int K = t[0]; int T = t[1];
            var a = scan;
            if (T == 1)
            {
                Console.WriteLine(a[0] - 1);
                return;
            }
            
            var d = 0;
            var cnt = 0;
            var cntt = 0;
            int i = T - 1;

            while(a[T - 1] != 0)
            {
                i = T - 1;
                Array.Sort(a);
                cntt = 0;
                while (cntt != 2)
                {
                   //Console.WriteLine(a[i]+" "+cntt+" "+ i);
                    if (a[i] > 0)
                    {
                        a[i]--;
                        cntt++;
                    }
                   
                    i--;

                    if (cntt== 1 && i == -1)
                    {
                        Console.WriteLine(a[T - 1]);
                        return;
                    }
                }
            }
            Console.WriteLine(cnt);
        }

        static int[] scan { get { return Array.ConvertAll(Console.ReadLine().Split(), int.Parse); } }
    }
}


Measured memory_bytes: 2776
#include<iostream>
#include<cstdio>
#include<cstdlib>
using namespace std;

struct Node
{
	int key;
	Node *right, *left, *parent;
};

Node *root, *NIL;

void insert(int k)
{
	Node *y=NIL;
	Node *x=root;
	Node *z;
	
	z=(Node *)malloc(sizeof(Node));
	z->key=k;
	z->left=NIL;
	z->right=NIL;
	
	while(x!=NIL)
	{
		y=x;
		if(z->key < x->key) x=x->left;
		else x=x->right;
	}
	z->parent=y;
	if(y==NIL) root=z;
	else
	{
		if(z->key < y->key) y->left=z;
		else y->right=z;
	}
}

int find(int k)
{
	Node *x=root;
	
	while(x!= NIL)
	{
		if(x->key == k) return 1;
		else if(x->key < k) x=x->right;
		else x=x->left;
	}
	return 0;
}

void inorder(Node *u)
{
	if(u==NIL) return;
	inorder(u->left);
	printf(" %d", u->key);
	inorder(u->right);
}

void preorder(Node *u)
{
	if(u==NIL) return;
	printf(" %d", u->key);
	preorder(u->left);
	preorder(u->right);
}

int main()
{
	int i,n,x;
	string com;
	
	scanf("%d",&n);
	
	for(i=0;i<=n-1;i++)
	{
		cin >> com;
		if(com=="insert")
		{
			scanf("%d",&x);
			insert(x);
		}
		else if(com=="find")
		{
			scanf("%d",&x);
			if(find(x)==1) printf("yes");
			else printf("no");
			printf("\n");
		}
		else if(com=="print")
		{
			inorder(root);
			printf("\n");
			preorder(root);
			printf("\n");
		}
	}
	return 0;
}

Measured memory_bytes: 21964
#include <bits/stdc++.h>
using namespace std;
int PREP = (cin.tie(nullptr), ios::sync_with_stdio(false), cout << fixed << setprecision(12), 0);
//int SEGV = getenv("D") || (exit(system("D= SEGFAULT_SIGNALS=all catchsegv ./prog.exe") >> 8), 0);
struct UnionFind {
    vector<int> A;
    UnionFind(int n) {
        A.resize(n, -1);
    }
    int find(int x) {
        if (A[x] < 0) return x;
        return A[x] = find(A[x]);
    }
    void unite(int x, int y) {
        x = find(x), y = find(y);
        if (x == y) return;
        if (A[x] > A[y]) swap(x, y);
        A[x] += A[y];
        A[y] = x;
    }
};
int main() {
    int N, Q; cin >> N >> Q;
    UnionFind uf(N);
    while (Q--) {
        int t, u, v; cin >> t >> u >> v;
        if (t == 0) {
            uf.unite(u, v);
        } else {
            cout << (uf.find(u) == uf.find(v)) << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 3920
#pragma GCC optimize ("Ofast")
#pragma GCC target ("avx2")
//#include<bits/stdc++.h>
#include<cstdio>
#include<cstring>

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

const int CM = 130000, CL = 12;
char cn[CM + CL], * ci = cn + CM + CL, * owa = cn + CM, ct;
const ll ma0 = 1157442765409226768;
const ll ma1 = 1085102592571150095;
const ll ma2 = 71777214294589695;
const ll ma3 = 281470681808895;
const ll ma4 = 4294967295;
inline int getint() {
	if (ci - owa > 0) {
		memcpy(cn, owa, CL);
		ci -= CM;
		fread(cn + CL, 1, CM, stdin);
	}
	ll tmp = *(ll*)ci;

	//うーん
	ll u_n = ((tmp & ma0) ^ ma0);
	if (!u_n) {
		ci += 8;
		while (*ci++ >= '0');
		return 1000000000;
	}
	int dig = 68 - __builtin_ctzll(u_n);
	tmp = tmp << dig & ma1;
	tmp = tmp * 10 + (tmp >> 8) & ma2;
	tmp = tmp * 100 + (tmp >> 16) & ma3;
	tmp = tmp * 10000 + (tmp >> 32) & ma4;
	ci += (72 - dig >> 3);
	return tmp;
}

int B[200000];
int main() {
	//cin.tie(0);
	//ios::sync_with_stdio(false);


	int N = getint();

	ll kotae = 0;
	rep(i, N) {
		int a = getint();
		if (i + a < N) B[i + a]++;
		if (i - a >= 0) kotae += B[i - a];
	}
	printf("%lld", kotae);

	Would you please return 0;
}

Measured memory_bytes: 2508
#include <iostream>
using namespace std;
int main() {
  int x,y;
  cin >> x >> y;
  if (x < y) {
    cout << "a < b" << endl;
  } else if (x > y) {
    cout << "a > b" << endl;
  } else {
    cout << "a == b" << endl;
  }
  return 0;
}

Measured memory_bytes: 1156
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_map>
#include<climits>
#include<cstdlib>
#include<cmath>
#include<string>
#include<iomanip>
#include<bitset>

using namespace std;

#define ll long long int

ll const MOD = 1000000007;
ll const INF = (long long int)1 << 61;

ll mypow(ll x,ll n){
    ll ret = 1;
    while(n > 0){
        if(n&1){
            ret = (ret*x)%MOD;
        }
        x = (x*x)%MOD;
        n >>= 1;
    }
    return ret;
}

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

    ll c = 0;
    for(int i = 0; i < str.size(); i++){
        if(str[i] == 'x'){
            c++;
        }
    }

    if(c >= 8){
        cout << "NO" << endl;
    }else{
        cout << "YES" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline
import math


def read():
    N, K = map(int, input().strip().split())
    A = list(map(int, input().strip().split()))
    return N, K, A


def solve(N, K, A):
    if N == 1:
        if K == 0:
            return A[0]
        else:
            return math.ceil(A[0] / (K+1))
    ng = 0
    ok = max(A)
    while abs(ok-ng) > 1:
        mid = (ok+ng) // 2
        k = sum([(a-1) // mid for a in A])
        if k <= K:
            ok = mid
        else:
            ng = mid
    return ok


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))


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

using namespace std;

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

  long long int d = __gcd(N, M);
  long long int n = N / d;
  long long int m = M / d;
  for(int i=0; i<d; i++) {
    if(S[i*n] != T[i*m]) {
      cout << -1 << endl;
      return 0;
    }
  }

  cout << n * m * d << endl;

  return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
using namespace std;
typedef long long ll;
#define rep(i,s,n)for(ll i = s;i<n;i++)
#define repe(i,s,n)for(ll i = s;i<=n;i++)

int main() {
	ll N, M, X; cin >> N >> M >> X;
	ll A[100] = {};
	rep(i, 0, M) {
		cin >> A[i];
	}
	sort(A, A + M);

	ll right = M - (upper_bound(A, A + M, X) - A);
	ll left = upper_bound(A, A + M, X) - A;

	cout << min(right, left) << endl;

	return 0;
}

Measured memory_bytes: 256
x, y = map(int, input().split())

ans = 0
if x == 1:
    ans += 300000
elif x == 2:
    ans += 200000
elif x == 3:
    ans += 100000

if y == 1:
    ans += 300000
elif y == 2:
    ans += 200000
elif y == 3:
    ans += 100000

if x == 1 and y == 1:
    ans += 400000

print(ans)

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

int main(){   
    int a, b, c;
    cin >> a >> b >> c;
    string ans = "NO";
    for (int i = 1; i <=b; i++){
        int num = i * a;
        int result = num % b;
        if (result == c){
            ans = "YES";
            break;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())
#define endl "\n"

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    ll a;
    string s;
    cin >> a >> s;
    ll b = 0;
    rep(i, len(s)) {
        if (s[i] != '.') b = b * 10 + (s[i] - '0');
    }
    cout << (a * b / 100) << endl;
    return 0;
}


Measured memory_bytes: 3604
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)*}
    };
}

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)*}
    };
}

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, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}
macro_rules! max {
    ($x: expr) => ($x);
    ($x: expr, $($z: expr),+) => {{
        let y = max!($($z),*);
        if $x > y {
            $x
        } else {
            y
        }
    }}
}
macro_rules! min {
    ($x: expr) => ($x);
    ($x: expr, $($z: expr),+) => {{
        let y = min!($($z),*);
        if $x < y {
            $x
        } else {
            y
        }
    }}
}
#[derive(Debug)]
pub struct Test {

}

impl Test {
    pub fn new(param: ()) -> Test {
        Test {
        }
    }

    fn solve(&mut self) -> usize {
        0
    }
}

fn main() {
    input! {
        N: u64,
        M: u64,
        A: [u64; N],
        BC: [(u64, u64); M],
    };
    
    let mut A = A.to_vec();
    A.sort();
    let mut BC = BC.to_vec();
    BC.sort_by(|a, b| a.1.cmp(&b.1));
    
    let mut change = BC.pop().unwrap();
    for i in (0..N as usize) {
        if A[i] < change.1 {
            A[i] = change.1;
            change.0 -= 1;
        }

        if change.0 == 0 {
            change = if let Some(v) = BC.pop() {
                v
            } else {
                (1, 0)
            };
        }
    }


    println!("{}", A.iter().fold(0, |sum, a| sum + a));
}


Measured memory_bytes: 10492
#include <bits/stdc++.h>
using namespace std;
using lint = int64_t;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define all(v)    begin(v), end(v)
#define in        []{lint n; cin>>n; return n;}()

int main(){ cin.tie(0); ios::sync_with_stdio(false);
    lint X = in, Y = in, Z = in, K = in;
    vector<lint> A(X), B(Y), C(Z);
    rep( i, X ) A[i] = in; sort( all(A), greater<lint>() );
    rep( i, Y ) B[i] = in; sort( all(B), greater<lint>() );
    rep( i, Z ) C[i] = in; sort( all(C), greater<lint>() );

    vector<lint> ans(0);
    rep( x, X ) rep( y, Y ) rep( z, Z ) {
        if( (x+1)*(y+1)*(z+1) <= K ) ans.push_back( A[x]+B[y]+C[z] );
    }

    sort( all(ans), greater<lint>() );
    rep( i, K ) cout << ans[i] << "\n";
}


Measured memory_bytes: 1404
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());

        List<List<Integer>> pointList = new ArrayList<>();
        List<Integer> firstPoint = new ArrayList<>();
        firstPoint.add(0);
        firstPoint.add(0);
        firstPoint.add(0);
        pointList.add(firstPoint);

        for (int i = 0; i < N; i++) {
            List<Integer> tmpPoint = new ArrayList<>();
            tmpPoint.add(Integer.parseInt(sc.next()));
            tmpPoint.add(Integer.parseInt(sc.next()));
            tmpPoint.add(Integer.parseInt(sc.next()));
            pointList.add(tmpPoint);
        }

        for (int i = 0; i < N; i++) {
            List<Integer> currentPoint = pointList.get(i);
            List<Integer> nextPoint = pointList.get(i + 1);
            int diff = Math.abs(currentPoint.get(1) - nextPoint.get(1) + currentPoint.get(2) - nextPoint.get(2));
            int diffTime = nextPoint.get(0) - currentPoint.get(0);

            if (!(diff <= diffTime && diff % 2 == diffTime % 2)) {
                System.out.print("No");
                return;
            }
        }
        System.out.print("Yes");
    }
}

Measured memory_bytes: 73064
def decide_H(Cx,Cy):
    for x,y,h in T:
        H=h+abs(x-Cx)+abs(y-Cy)
        if h>=1:
            return(H)

def check_H(Cx,Cy,H):
    for x,y,h in T:
        if h != max(H - abs(x - Cx) - abs(y - Cy), 0):
            return False
    return True

N=int(input())
T=[[int(i) for i in input().split()] for _ in range(N)]

for Cx in range(101):
    for Cy in range(101):
        H=decide_H(Cx,Cy)
        if check_H(Cx,Cy,H):
            print(Cx,Cy,H)
            exit(0)


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

#define gc( ) std::getchar( )
#define pc( i ) std::putchar( i )

template < typename T >
inline T read( )
{
	register T x = 0;
	register char ch = gc( );
	register bool f = 0;
	while( !std::isdigit( ch ) )
	{
		f = ( ch == '-' );
		ch = gc( );
	}
	while( std::isdigit( ch ) )
	{
		x = x * 10 + ( ch - '0' );
		ch = gc( );
	}
	return f ? -x : x;
}

template < typename T >
void print( T x )
{
	if( x < 0 )
	{
		x = -x;
		pc( '-' );
	}
	if( x < 10 )
	{
		pc( x + 48 );
		return;
	}
	print < T > ( x / 10 );
	pc( x % 10 + 48 );
	return ;
}

namespace Solution
{
#define IOS std::ios::sync_with_stdio( false ), std::cin.tie( 0 ), std::cout.tie( 0 )
#define Rep( i, j, k ) for( int i = j; i >= k; --i )
#define rdi( ) read < int > ( )
#define rdl( ) read < long long > ( )
#define pti( i ) print < int > ( i ), putchar( ' ' )
#define ptl( i ) print < long long > ( i ), putchar( ' ' )
#define For( i, j, k ) for( int i = j; i <= k; ++i )
	using std::cin;
	using std::cout;
	using std::endl;
	using std::vector;
	using std::map;
	using std::queue;
	using std::deque;
	using std::set;
	using std::pair;
	const int Maxn = 100001;
	int n, bol, L, Q, bl[ Maxn ], x[ Maxn ], to[ Maxn ], nxt[ Maxn ], out[ Maxn ];
	int find( int u )
	{
		int l = u + 1, r = n, ans = u;
		while( l <= r )
		{
			int mid = l + r >> 1;
			if( x[ mid ] - x[ u ] <= L )
				ans = mid, l = mid + 1;
			else
				r = mid - 1;
		}
		return ans;
	}
	int solve( int l, int r )
	{
		int res = 0;
		while( bl[ l ] < bl[ r ] )
		{
			res += nxt[ l ];
			l = out[ l ];
		}
		while( l < r )
		{
			res++;
			l = to[ l ];
		}
		return res;
	}
	void fakemain( )
	{
		IOS;
		cin >> n;
		bol = sqrt( n );
		For( i, 1, n )
			cin >> x[ i ],
			bl[ i ] = ( i - 1 ) / bol + 1;
		cin >> L;
		For( i, 1, n )
			to[ i ] = find( i );
		Rep( i, n - 1, 1 )
		{
			if( to[ i ] == n )
			{
				out[ i ] = n;
				nxt[ i ] = 1;
			}
			else
			{
				if( to[ i ] > bol * bl[ i ] )
				{
					out[ i ] = to[ i ];
					nxt[ i ] = 1;
				}
				else
				{
					out[ i ] = out[ to[ i ] ];
					nxt[ i ] = nxt[ to[ i ] ] + 1;
				}
			}
		}
		cin >> Q;
		int l, r;
		while( Q-- )
		{
			cin >> l >> r;
			if( l > r )
				std::swap( l, r );
			cout << solve( l, r ) << '\n';
		}
		return;
	}

} // namespace Solution

int main( int argc, char* argv[] )
{
	Solution::fakemain( );
	return 0;
}

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

typedef long long   signed int LL;
typedef long long unsigned int LU;

#define incID(i, l, r) for(int i = (l)    ; i <  (r); i++)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); i++)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); i--)
#define  inc(i, n) incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define  dec(i, n) decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)

#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))

#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define PQ priority_queue

#define  ALL(v)  v.begin(),  v.end()
#define RALL(v) v.rbegin(), v.rend()
#define  FOR(it, v) for(auto it =  v.begin(); it !=  v.end(); ++it)
#define RFOR(it, v) for(auto it = v.rbegin(); it != v.rend(); ++it)

template<typename T> bool   setmin(T & a, T b) { if(b <  a) { a = b; return true; } else { return false; } }
template<typename T> bool   setmax(T & a, T b) { if(b >  a) { a = b; return true; } else { return false; } }
template<typename T> bool setmineq(T & a, T b) { if(b <= a) { a = b; return true; } else { return false; } }
template<typename T> bool setmaxeq(T & a, T b) { if(b >= a) { a = b; return true; } else { return false; } }
template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }

// ---- ----

string s, t = "abc";

int main() {
	cin >> s;
	sort(ALL(s));
	
	cout << (s == t ? "Yes" : "No") << endl;
	
	return 0;
}


Measured memory_bytes: 256
// $ gcc -o B_Coins B_Coins.c

#include <stdio.h>

int n_many(int* inputs) {
  int A = inputs[0];
  int B = inputs[1];
  int C = inputs[2];
  int X = inputs[3];

  int n_many = 0;

  for (int a_num=0; a_num<=A; a_num++) {
    for (int b_num=0; b_num<=B; b_num++) {
      for (int c_num=0; c_num<=C; c_num++) {
        if (500*a_num + 100*b_num + 50*c_num == X) n_many++;
      }
    }
  }

  return n_many;
}

int main(void) {
  int inputs[4] = {0,0,0,0};
  for (int i=0; i<4; i++) {
    scanf("%d", inputs+i);
  }

  printf("%d\n", n_many(inputs));

  return 0;
}

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

using namespace std;
#define X first
#define Y second
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;

#define debug(x) cerr << #x << " = " << (x) << endl;
template<typename T>
ostream& operator<<(ostream& o, vector<T>& v) {
    for (auto& x : v) o << x << ' ';
    return o;
}

int main(){
    std::ios_base::sync_with_stdio(false); cin.tie(0);
    const int BASE = 40000;
    int n; cin >> n;
    vi P(n);
    for (int i = 0; i < n; i++){
        cin >> P[i];
        P[i]--;
    }
    vi arr(n), brr(n);
    for (int i = 0; i < n; i++){
        arr[i] = brr[n-1-i] = (i+1) * BASE;
    }
    for (int i = 0; i < n; i++){
        arr[P[i]] += i;
    }
    cout << arr << endl;
    cout << brr << endl;
}


Measured memory_bytes: 896
#include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define mp make_pair
using namespace std;
int main()
{
    int n,k,a[100],i,j,l,r,q,d,c=0,f=0,fo=0,found=0;
    map<int,int>p;
    vector<int>v;
    vector<int>x;
    cin>>n>>k;q=n;
    for(i=0;i<k;i++){
        cin>>a[i];
        p[a[i]]=1;}
    while(q!=0)
    {
        c++;
        r=q%10;
        v.pb(r);
        q=q/10;
    }j=v.size()-1;d=c;
    while(p[v[j]]==0&&j>=0)
    { x.pb(v[j]);found=1;
    j--;
    }
    if(j>=0){
    for(i=v[j]+1;i<=9;i++)
    {
        if(p[i]==0)
        {
            x.pb(i);f=1;
            break;
        }
    }
    if(f==0)
    {
        if(found==1)
            x.clear();
        for(i=1;i<v[j];i++)
        {
            if(p[i]==0)
            {
            x.pb(i);fo=1;
            break;
            }
        }
    }
    for(i=0;i<=9;i++)
    {
        if(p[i]==0)
        {
            l=i;break;
        }
    }
    for(i=0;i<x.size();i++)
        cout<<x[i];
    if(f==1)
    {
        d=d-x.size();
       while(d--)
            cout<<l;
    }
    if(fo==1)
    {
        while(d--)
            cout<<l;
    }
    }
    if(found==1&&f==0&&fo==0)
    {
        for(i=0;i<x.size();i++)
        cout<<x[i];
    }
}


Measured memory_bytes: 3628
// #define _CRT_SECURE_NO_WARNINGS
// #define _USE_MATH_DEFINES
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <locale>
#include <cctype>
#include <sstream>
#include <iomanip>	// 10桁出力 cout << setprecision(10) << double;
#include <queue>
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef map<int, int> MAPII;
typedef multimap<int, char, greater<int> > MuMAPIC;
typedef vector<pair<int, int> > VPII;
typedef multimap<int, string, greater<int> > MuMIS;
typedef pair<int, int> P;
typedef pair<int, pair<P, P> > PP;

#define MP make_pair
#define FAST_IO  cin.tie(0); ios::sync_with_stdio(false);
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
//for gcc (未test)
// #define FOREACH_IT(it,c) for(typeof(c)::iterator it=(c).begin(); it!=(c).end(); ++it)
//for Visual Studio
#define foreach_it(type,it,c) for(type::iterator it=c.begin(),c_end=c.end();it!=c_end;++it)
// for Debug.
#define DUMP_VVI(b) FOR(i,0,b.size()){FOR(j,0,b[i].size())printf("%d ",b[i][j]);puts("");}
#define D_OUT(str,value) if(dbgF){cout<<str<<" : "<<value<<endl;}
// 入力をpush_back(d)やarray[d]に使う時に1行で書ける
// int INPUT_INT() {int d;cin>>d;return d;}
template<class T>T IN() { T d; cin >> d; return d; }
// 最大公約数（Greatest Common Divisor）
LL gcd(LL a, LL b) { return (b > 0) ? gcd(b, a%b) : a; }
// 最小公倍数（Least Common Multiple）
LL lcm(LL a, LL b) { return a / gcd(a, b) * b; }
// Y年はうるう年か否か
bool uruu(LL Y) { return (((Y % 4 == 0 && Y % 100 != 0) || Y % 400 == 0) ? true : false); }

// vector注意
// vec[i][j]の形に入力を入れるとき、vecは初期化してある必要がある.

// ------------------- include, typedef, define END. -------------------

int main() {
	FAST_IO;
	// for D_OUT(str, value)  ... cout<< str <<" : "<< value <<endl;
	bool dbgF = true;

	//コードはここから書く.

	string s;
	cin >> s;

	FOR(i, 0, s.length()) {
		cout << s[i];
		if (i == 3) {
			cout << " ";
		}
	}
	cout << endl;


	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll INF=1001001001;
const ll LINF=1001001001001001001;
#define overload4(_1,_2,_3,_4,name,...) name
#define rep1(n) for(ll i=0;i<(n);++i)
#define rep2(i,n) for(ll i=0;i<(n);++i)
#define rep3(i,a,b) for(ll i=(a);i<(b);++i)
#define rep4(i,a,b,c) for(ll i=(a);i<(b);i+=(c))
#define rep(...) overload4(__VA_ARGS__,rep4,rep3,rep2,rep1)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define vec vector<ll>
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;}

void solve(){
    int n,d,a;
    cin>>n>>d>>a;
    vector<pair<ll,ll>> vp(n);
    rep(i,n){
        ll x,h;cin>>x>>h;
        vp[i]=make_pair(x,h);
    }
    sort(all(vp));
    vec xx(n);
    rep(i,n)xx[i]=vp[i].first;

    ll sum=0;
    ll ans=0;
    vec sb(n);
    rep(i,n){
        sum-=sb[i];
        vp[i].second-=sum;
        if(vp[i].second<=0)continue;
        ll cnt=(vp[i].second+a-1)/a;
        ans+=cnt;
        sum+=cnt*a;
        ll idx=upper_bound(all(xx),vp[i].first+2*d)-xx.begin();
        if(idx<n)sb[idx]+=cnt*a;
    }
    cout<<ans<<endl;
}

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


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

using namespace std;

int main(){
    int T = 1;
    //cin >> T;
    while (T--){
        int k;
        string s;
        cin >> k >> s;
        if (s.size() > k){
            cout << s.substr(0,k) << "..." << endl;
        } else {
            cout << s << endl;
        }
    }
}

Measured memory_bytes: 3592
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n",(x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define isYes(x) printf("%s\n",(x) ? "Yes" : "No")
#define isIn(x,y,h,w) (x >= 0 && x < h && y >= 0 && y < w)

#define int long long
//using ll = long long;
using P = pair<int,int>;

ostream &operator<<(ostream &os,const P &p){ return os << "(" << p.first << "," << p.second << ")"; }
template<class T>
ostream &operator<<(ostream &os,const vector<T> &v){
	for(int i = 0;i < v.size();i++) os << (i ? "," : "[") << v[i];
	os << "]";
	return os;
}

template<class T> T &chmin(T &a,const T &b){ return a = min(a,b); }
template<class T> T &chmax(T &a,const T &b){ return a = max(a,b); }

const int INF=1e+18;
const double EPS=1e-9;
const int MOD=1000000007;

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

signed main(){
	int n,a[200010],cnt[200010] = {},ans = 0;
	cin >> n;
	for(int i = 0;i < n;i++){
		cin >> a[i]; a[i]--;
		cnt[a[i]]++;
	}
	for(int i = 0;i < n;i++) ans += cnt[i] * (cnt[i] - 1) / 2;
	for(int i = 0;i < n;i++) cout << ans - cnt[a[i]] + 1 << endl;
}

Measured memory_bytes: 5760
#include "bits/stdc++.h"
using namespace std;
// #define endl '\n'
#define int long long

int c(int a) {
	return a * (a-1) / 2;
}

signed main() {

	int n;
	cin >> n;
	int arr[n];
	
	map<int, int> oc, con;
	
	for (int i=0; i<n; i++) {
		cin >> arr[i];
		oc[arr[i]]++;
	}
	
	int ans = 0;
	
	for (map<int, int>::iterator x=oc.begin(); x!=oc.end(); x++) {
		int f = x->first;
		int s = x->second;
		con[f] = c(s);
		ans += c(s);
	}
	
	for (int i=0; i<n; i++) {
		int t = con[arr[i]];
		cout << ans - t + c(oc[arr[i]]-1) << endl;
	}
	
	
	
}




Measured memory_bytes: 18944
using System;

namespace ProblemB
{
    class Program
    {
        static void Main(string[] args)
        {
            string S = Console.ReadLine();
            string T = Console.ReadLine();

            int count = 0;
            for(int i = 0; i < S.Length; i++)
            {
                if(S[i] != T[i])
                {
                    count++;
                }
            }

            Console.WriteLine(count);
        }
    }
}


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

bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2){
        if (num % i == 0){
            // 素数ではない
            return false;
        }
    }

    // 素数である
    return true;
}

int main(){
    int X;
    cin >> X;
    while (IsPrime(X) == false){
        X = X + 1;
    }
    cout << X << endl;
}

Measured memory_bytes: 764
#include <math.h>
#include <algorithm>
#include <set>
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <string>
#include <cstring>
#include <functional>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <chrono>
#include <climits>
using namespace std ;
#define ld long double
#define _ ios_base::sync_with_stdio(false) ;cin.tie(NULL);cout.tie(NULL);
#define inp(a) for(auto& i : a) cin >> i;
#define out(a) for(auto i : a){cout << i << ' ';}cout << endl;
#define dbg(x) cerr << #x << " is " << x << endl;
#define ms(x,a) memset(x,(int)(a),sizeof(x))
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define pii pair<int,int>
#define vi vector<int >
#define pb push_back
#define endl '\n'
#define ff first
#define ss second
#define LOCAL
const int N = 2e5+7 ;
const int INF = 1e9 ;
const int MOD = INF + 7 ;
string s ;
//#define int long long

int32_t main(){_
	int n,k ;
	set<char> st ;
	cin >> s ;
	for(auto i : s){
		st.insert(i) ;
	}
	if(sz(st) == 2)
		cout << "Yes\n" ;
	else cout << "No\n" ;
}





Measured memory_bytes: 256
import numpy as np


H, W = map(int, input().split())

A = []

for h in range(H):
    a = list(input())
    if '#' in a:
        A.append(a)

A = np.rot90(np.array(A)).tolist()
B = []

for w in range(len(A)):
    if '#' in A[w]:
        B.append(A[w])


B = np.rot90(np.array(B), 3).tolist()

for b in B:
    print(str.join('', b))


Measured memory_bytes: 21652
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
#define MAX 2000000
#define INFTY (1<<30)

int H, A[MAX+1];

void maxHeapify(int i){
	int l, r, largest;
	l = 2 * i;
	r = 2 * i + 1;

	if(l <= H && A[l] > A[i]) largest = l;
	else largest = i;
	if(r <= H && A[r] > A[largest]) largest = r;

	if(largest != i){
		swap(A[i], A[largest]);
		maxHeapify(largest);
	}
}

int extract(){
	int maxv;
	if(H<1) return -INFTY;
	maxv = A[1];
	A[1] = A[H--];
	maxHeapify(1);
	return maxv;
}

void increaseKey(int i, int key){
	if(key < A[i]) return;
	A[i] = key;
	while(i>1 && A[i/2] < A[i]){
		swap(A[i], A[i/2]);
		i = i/2;
	}
}

void insert(int key){
	H++;
	A[H] = -INFTY;
	increaseKey(H, key);
}

int main(){
	int key;
	char com[10];

	while(1){
		scanf("%s",com);
		if(com[0] == 'e' && com[1] == 'n') break;
		if(com[0] == 'i'){
			scanf("%d",&key);
			insert(key);
		}else{
			printf("%d\n",extract());
		}
	}

	return 0;
}

Measured memory_bytes: 6476
#include <stdio.h>

int main(void)
{
    int res =0, n, p, max = 1;

    scanf("%d", &n);
    for (int i = 0; i<n; i++){
        scanf("%d", &p);
        res += p;
        if (max<p) max = p;
    }
    res -= max/2;
    printf("%d", res);
}

Measured memory_bytes: 128
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define INF 0x3f3f3f3f

char s[100];
typedef long long ll;

void step(int x, int y)
{
    for (int i = 0; i < y; ++i)
    {
        printf("U");
    }
    for (int i = 0; i < x; ++i)
    {
        printf("R");
    }
    for (int i = 0; i < y; ++i)
    {
        printf("D");
    }
    for (int i = 0; i < x; ++i)
    {
        printf("L");
    }
}

int main()
{
    //freopen("C:\\Users\\tiger\\Desktop\\a.txt","r",stdin);
	int x1,y1;
    int x2,y2;
    while ( ~scanf("%d %d %d %d", &x1, &y1, &x2, &y2) )
    {
        int x = x2 - x1;
        int y = y2 - y1;
        step(x,y);
        printf("L");
        for (int i = 0; i <= y; ++i)
        {
            printf("U");
        }
        for (int i = 0; i <= x; ++i)
        {
            printf("R");
        }
        printf("D");
        printf("R");
        for (int i = 0; i <= y; ++i)
        {
            printf("D");
        }
        for (int i = 0; i <= x; ++i)
        {
            printf("L");
        }
        printf("U\n");
    }
	return 0;
}

Measured memory_bytes: 128
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

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

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

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

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

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

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

fn main() {
    input! {
        a1: usize,
        a2: usize,
        a3: usize,
    }

    println!("{}", if a1 + a2 + a3 > 21 { "bust" } else { "win" })
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
typedef complex<double> Point;
typedef pair<Point, Point> Line;
const double EPS = 1e-10;

// 内積 |a||b|cosθ
double dot(Point a, Point b){
	// return a.real() * b.real() + a.imag() * b.imag();
	return (conj(a) * b).real();
}
// 外積、符号付面積の２倍　|a||b|sinθ
double cross(Point a, Point b){
	// return a.real() * b.imag() - a.imag() * b.real();
	return (conj(a) * b).imag();
}
// 点の位置関係　2点a,bから見た点cの位置関係
int ccw(Point a, Point b, Point c){
    // COUNTER_CLOCKWISE
    if(cross(b - a, c - a) > EPS) return 1;
    // CLOCKWISE
    if(cross(b - a, c - a) < -EPS) return -1;
    // ONLINE_BACK
    if(dot(b - a, c - a) < -EPS) return 2;
    // ONLINE_FRONT
    if(abs(b - a) + EPS < abs(c - a)) return -2;
    // ON_SEGMENT
    return 0;
}
// 線分の交差判定
bool is_cross(Line a, Line b){
    if(ccw(a.first, a.second, b.first) * ccw(a.first, a.second, b.second) <= 0 && ccw(b.first, b.second, a.first) * ccw(b.first, b.second, a.second) <= 0){
        return true;
    }
    return false;
}

int main(){
    int q;
    cin >> q;
    for(int i = 0; i < q; i++){
        double x, y;
        Point p[4];
        for(int j = 0; j < 4; j++){
            cin >> x >> y;
            p[j] = {x, y};
        }
        Line s1 = {p[0], p[1]};
        Line s2 = {p[2], p[3]};
        cout << is_cross(s1, s2) << endl;
    }
}


Measured memory_bytes: 3276
// AtCoder Beginners Contest 165
// A - We Love Golf

#include <iostream>

using namespace std;

int main()
{
    int K, K_Multiple, s, A, B, i;
    string flag;

    cin >> K;
    s = 1000 / K;
    cin >> A >> B;

    if (K < 1 || 1000 < K)  {
        cout << "Kは条件を満たしていません!\n";
        return 0;
    }

    if (A < 1 || 1000 < A)  {
        cout << "Aは条件を満たしていません!\n";
        return 0;
    }
    
    if (B < 1 ) {
	if (1000 < B)  {
	    if (B < A) {
                cout << "Bは条件を満たしていません!\n";
                return 0;
	    }
	}
    }
    
    flag = "NG";
    for (i = 1; i <= s; i++) {
        K_Multiple = K * i;
        if (A <= K_Multiple && K_Multiple <= B) {
	    flag = "OK";
        }
    }
    cout << flag << '\n';
}


Measured memory_bytes: 3628
#include<bits/stdc++.h>
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define MOD 1000000007
#define INF 2000000000
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
typedef unsigned long long int ull;
using namespace std;
int main(void){
  int a,b;
  char c;
  cin >> a >> c >> b;
  if(c=='+') cout << a+b << endl;
  else cout << a-b << endl;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i<(n);++i)
const int INF =1001001001;
using ll=long long;
using Edge = pair<ll,ll>;
using Graph =vector<vector<Edge>>;
vector<int> color;
Graph G;
ll N;
void dfs(ll v,ll o=-1){
for(auto u:G[v]){
  if(u.first==o)continue;
  if(u.second%2==0)color[u.first]=color[v];
  else color[u.first]=1-color[v];
  dfs(u.first,v);
}
}
int main() {
cin>>N;
G.resize(N);
rep(i,N-1){
  ll a,d,c;
  cin>>a>>d>>c;
  --a;
  --d;
  G[a].push_back(Edge(d,c));
  G[d].push_back(Edge(a,c));
}
color.resize(N,-1);
color[0]=0;
dfs(0);
rep(i,N)cout<<color[i]<<endl;
return 0;
}


Measured memory_bytes: 10496
#include<iostream>
#include<cstdio>
#include<string>
#include<cmath>
using namespace std;

int main() {
	double x,y,z;
	cin >> x>>y>>z;

	x=x-z;
	z=z+y;
	cout << floor(x/z) << endl;
	return 0;
}



Measured memory_bytes: 256