akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>

int main(void){
  int i,r,b,x;
  char s[100];
  r=0;
  b=0;
  scanf("%d",&x);
  scanf("%s",s);
  for(i=0;i<x;i++){
    if(s[i]=='R'){
      r++;
    }
    if(s[i]=='B'){
      b++;
    }
  }
  
  if(r>b){
    printf("Yes");
  }
  else{
    printf("No");
  }
  
  return 0;
}

Measured memory_bytes: 128
import java.util.Scanner;

public class Main {
	public static void main(String args[]){
		 Scanner sc = new Scanner(System.in);
		 
		 int a = sc.nextInt();
		 int b = sc.nextInt();
		 
		 if(a<b){
			 System.out.println("a < b");
		 }else if(a>b){
			 System.out.println("a > b" );
		 }else{
			 System.out.println("a == b");
		 }
		 
		 
		 
		 
	}
}

Measured memory_bytes: 26132
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,b,c;
  cin >>a >>b>>c;
  vector<int> vec={a,b,c};
  sort(vec.begin(),vec.end());
  if(vec.at(0) ==5 &&vec.at(1) ==5&&vec.at(2)==7){
    cout << "YES" <<endl;
  }
  else{
    cout << "NO" << endl;
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
 int a, b;
 cin >> a >> b;
 int d = a/b;
 int r = a%b;
 double f = a*1.0/b;
 cout << d << " " << r << " " << std::fixed << std::setprecision(5) << f << endl;
 return 0;
}

Measured memory_bytes: 3256
n, m = map(int, input().split())
p_s = list(input().split() for _ in range(m))

is_ac = [0] * n
ac_cnt = 0
wa_cnt_lst = [0] * n
for i in range(m):
    p_s[i][0] = int(p_s[i][0])
    if p_s[i][1] == 'AC' and is_ac[p_s[i][0] - 1] == 0:
        ac_cnt += 1
        is_ac[p_s[i][0] - 1] += 1
    if p_s[i][1] == 'WA' and is_ac[p_s[i][0] - 1] == 0:
        wa_cnt_lst[p_s[i][0] - 1] += 1

wa_cnt = 0
for i in range(n):
    if is_ac[i] > 0:
        wa_cnt += wa_cnt_lst[i]

print(ac_cnt, end = " ")
print(wa_cnt)


Measured memory_bytes: 36848
#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <queue>
#include <set>
#include <map>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <bitset>
using namespace std;
 
 
const double EPS = 1e-9;
 
int main(){
    map<char, string> enc;
    enc[' ']  = "101";
    enc['\''] = "000000";
    enc[',']  = "000011";
    enc['-']  = "10010001";
    enc['.']  = "010001";
    enc['?']  = "000001";
    enc['A']  = "100101";
    enc['B']  = "10011010";
    enc['C']  = "0101";
    enc['D']  = "0001";
    enc['E']  = "110";
    enc['F']  = "01001";
    enc['G']  = "10011011";
    enc['H']  = "010000";
    enc['I']  = "0111";
    enc['J']  = "10011000";
    enc['K']  = "0110";
    enc['L']  = "00100";
    enc['M']  = "10011001";
    enc['N']  = "10011110";
    enc['O']  = "00101";
    enc['P']  = "111";
    enc['Q']  = "10011111";
    enc['R']  = "1000";
    enc['S']  = "00110";
    enc['T']  = "00111";
    enc['U']  = "10011100";
    enc['V']  = "10011101";
    enc['W']  = "000010";
    enc['X']  = "10010010";
    enc['Y']  = "10010011";
    enc['Z']  = "10010000";

    string d = "ABCDEFGHIJKLMNOPQRSTUVWXYZ .,-'?";
    map<char, string> dec;
    for(int i = 0; i < 32; i++){
        dec[d[i]] = bitset<5>(i).to_string();
    }

    string s;
    while(getline(cin, s)){
        string e;
        for(int i = 0; i < s.size(); i++){
            e += dec[s[i]];
        }
        for(int i = 0; i < e.size();){
			map<char, string>::iterator it;
			for(it = enc.begin(); it != enc.end(); it++){
				int len = (*it).second.size();
				if(i+len <= e.size()){
					if((*it).second == e.substr(i, len)){
						cout << (*it).first;
						i+=len;
						break;
					}
				}
			}
			if(it == enc.end()){
				break;
			}
        }
        cout << endl;
    } 
 
    return 0;
}

Measured memory_bytes: 1204
fn main() {
    let s = getline();
    let k: usize = getline().trim().parse().unwrap();

    let mut result: Vec<&str> = Vec::new();

    for i in 0..s.len() {
        for size in 1..(k + 1) {
            if i + size < s.len() {
                //println!("{} {} {}", i, size, s[i..(i + size)].to_string());
                result = update_vec(result, s[i..(i + size)].as_ref(), k);
            }
        }
    }
    println!("{}", result[k - 1]);
}

fn update_vec<'a>(mut vec: Vec<&'a str>, string: &'a str, k: usize) -> Vec<&'a str> {
    if vec.len() == 0 {
        vec.push(string);
    } else if vec.contains(&string) {
        // do nothing
    } else {
        for i in 0..vec.len() {
            if string < vec[i] {
                vec.insert(i, string.clone().as_ref());
                break;
            }
        }
        if vec.len() < k {
            vec.push(string);
        } else if vec.len() > k {
            vec.remove(k);
        }
    }
    //println!("{:?}", vec);
    return vec;
}


fn getline() -> String {
    let mut __ret = String::new();
    std::io::stdin().read_line(&mut __ret).ok();
    return __ret;
}


Measured memory_bytes: 4352
#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<map>
#include<algorithm>
#include<functional>
#include<utility>
#include<cmath>
#include<ctime>
#include<complex>

using namespace std;

#define REP(i,s,e) for(int i=int(s);i<=int(e);i++)
#define rep(i,n) for(int i=0;i<int(n);i++)

int g(int a,int b){
	int c=max(a,b),d=min(a,b);
	if(c%d==0) return d;
	else return g(d,c%d);
}
int main(){

	int n,p,q,r;
	cin >> n;

	if(n==2){
		cin >> p >> q;

		REP(i,1,g(p,q))
		if(g(p,q)%i==0) cout << i << endl;

	}

	if(n==3){
		cin >> p >> q >> r;

		REP(i,1,g(g(p,q),r))
		if(g(g(p,q),r)%i==0) cout << i << endl;

	}

	return 0;
}

Measured memory_bytes: 1160
import java.util.*;

class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		double[] x = new double[n];
		String[] u = new String[n];
		double ans = 0;
		for(int i = 0; i < n; i++){
			x[i] = sc.nextDouble();
			u[i] = sc.next();
			if(u[i].equals("JPY")){
				ans+=x[i];
			}else{
				ans+=x[i]*380000;
			}
		}
		System.out.print(ans);
	}
}


Measured memory_bytes: 23252
#include <iostream>

using namespace std;

int main()
{
	
	const int MAX = 100000;
	
	int n;
	long long int k;
	cin >> n >> k;
	
	long long int buckets[MAX];
	int a,b;
	
	for(int i=0; i<MAX; i++){
		buckets[i] = 0;
	}
	
	for (int i=0; i<n; i++){
		cin >> a >> b;
		buckets[a-1] += b;
	}
	
	long long int count = 0;
	
	for (int i=0; i<MAX; i++){
		count += buckets[i];
		if (count >= k){
			cout << i+1 << "\n";
			break;
		}
	}
}

Measured memory_bytes: 1024
#pragma GCC optimize ("O3")

#include <bits/stdc++.h>
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define bcnt __builtin_popcountll

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<ll,ll> Pll;
typedef pair<int,int> Pin;

ll INF = 1e16;
int inf = 1e9;
ll MOD = 1e9+7;

template<typename T>
ostream& operator << (ostream& os, const vector<T>& vec) {
    os << "{ ";
    REP(i, vec.size()) {
        os << vec[i] << " ";
    }
    os << "}";

    return os;
}

ll pow_mod(ll a, ll p) {
    ll res = 1;
    while(p) {
        if (p & 1) res = (res * a) % MOD;
        a = (a * a) % MOD;
        p >>= 1;
    }

    return res;
}


ll mod_inv(ll a, ll m) {
    ll b = m, u = 0, v = 1;
    while(a) {
        ll t = b / a;
        swap(b -= t * a, a);
        swap(u -= t * v, v);
    }

    return (u % m + m) % m;
}

ll gcd(ll a, ll b) {
    if(b == 0) return a;
    return gcd(b, a%b);
}

void d_err() {
    cerr << endl;
}

template <typename H, typename... T>
void d_err(H h, T... t) {
    cerr << h << " ";
    d_err(t...);
}

#ifdef LOCAL
#define debug(...)  cerr << "[" << #__VA_ARGS__ << "]: ", d_err(__VA_ARGS__);
#else
#define debug(...) 83;
#endif

int bs(int l, int r, int a, const vector<ll> &v) {
    if (r - l < 2) return l;
    int mid = l + (r - l) / 2;

    if (v[mid] > a) {
        return bs(l, mid, a, v);
    } else {
        return bs(mid, r, a, v);
    }
}

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    
    int Q;
    cin >> Q;

    // init
    vector<ll> v;
    v.pb(-INF); v.pb(INF);
    int odd = 0;

    int x = 0;
    ll ans = 0;
    REP(i, Q) {
        int t;
        cin >> t;
        if (t == 1) {
            ll a, b;
            cin >> a >> b;
            ans += b;

            int s = v.size();
            ll prev = v[x];

            int l = bs(0, s, a, v);
            v.insert(v.begin() + l + 1, a);

            odd ^= 1;
            int mid = s / 2;

            if (!odd) {
                if (prev != mid) ans += abs(a - prev);
                else ans += abs(a - v[mid]);
            } else {
                if (prev != mid) ans += abs(a - v[mid]);
            }

            debug(prev, mid, l+1, v[mid]);
            debug(v);

            x = mid;

        } else if (t == 2) {
            cout << v[x] << " " << ans << endl;
        }
    }
}


Measured memory_bytes: 3828
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main()
{
	int x;
	cin>>x;
	for(int i=1;i<=1000;i++)
		for(int j=-1000;j<=i;j++)
		{
			if(pow(i,5)+pow(j,5)==x)
			{
				printf("%d %d",i,-j);
				return 0;
			}
		}
}

Measured memory_bytes: 4164
#include<bits/stdc++.h>
using namespace std;
const int INF=0x3f3f3f3f;
int H,W;
char str[102];
int Sx,Sy,Tx,Ty;
int fk[101][101];
int h[100001],nxt[100001],to[100001],w[100001],tot=-1;
void ins(int x,int y,int z){nxt[++tot]=h[x];to[tot]=y;w[tot]=z;h[x]=tot;}
void insw(int x,int y,int z1,int z2){ins(x,y,z1);ins(y,x,z2);}

int lv[100001],que[100001],l,r;

bool lvl(){
	memset(lv,0,sizeof lv);
	lv[que[l=r=1]=0]=1;
	while(l<=r){
		int u=que[l++];
		for(int i=h[u];~i;i=nxt[i]) if(w[i])
			if(!lv[to[i]]) lv[to[i]]=lv[u]+1, que[++r]=to[i];
	}
	return lv[2*H*W+H+W+1]!=0;
}

int flow(int u,int f){
//	if(u==0) printf("u=S ");
//	else if(u==2*H*W+H+W+1) printf("u=T ");
//	else if(u<=2*H*W) printf("u=%d,%d,%d ",((u+1)/2-1)/W+1,((u+1)/2-1)%W+1,u%2==0);
//	else if(u<=2*H*W+H) printf("u=Row#%d ",u-2*H*W);
//	else printf("u=Col#%d ",u-2*H*W-H);
//	printf("%d\n",f);
	if(u==2*H*W+H+W+1) return f;
	int sum=0,d;
	for(int i=h[u];~i;i=nxt[i]) if(lv[to[i]]>lv[u]&&w[i]){
		d=flow(to[i],min(f,w[i]));
		sum+=d, f-=d;
		w[i]-=d, w[i^1]+=d;
		if(!f) break;
	} return sum;
}

int Dinic(){
	int ans=0;
	while(lvl())
		ans+=flow(0,INF);
	return ans;
}

int main(){
	memset(h,-1,sizeof h);
	scanf("%d%d",&H,&W);
	for(int i=1;i<=H;++i){
		scanf("%s",str+1);
		for(int j=1;j<=W;++j){
			if(str[j]=='o') fk[i][j]=1;
			if(str[j]=='S') Sx=i, Sy=j;
			if(str[j]=='T') Tx=i, Ty=j;
		}
	}
	if(Sx==Tx||Sy==Ty) return 0*puts("-1");
	for(int i=1;i<=H;++i)
		for(int j=1;j<=W;++j)
			if(fk[i][j]){
				int id = 2*((i-1)*W+j);
				int Rid = 2*H*W+i;
				int Cid = 2*H*W+H+j;
				insw(id-1,id,1,0);
				insw(Rid,id-1,INF,0);
				insw(Cid,id-1,INF,0);
				insw(id,Rid,INF,0);
				insw(id,Cid,INF,0);
			}
	int RidS = 2*H*W+Sx;
	int CidS = 2*H*W+H+Sy;
	int RidT = 2*H*W+Tx;
	int CidT = 2*H*W+H+Ty;
	insw(0,RidS,INF,INF);
	insw(0,CidS,INF,INF);
	insw(RidT,2*H*W+H+W+1,INF,INF);
	insw(CidT,2*H*W+H+W+1,INF, INF);
	printf("%d",Dinic());
	return 0;
}

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

#define RREP(i,a) for(long i=(a);i>=0;--i)

std::string X;
int main() {
    std::cin >> X;

    int len = X.length();
    int t = 0, cnt = 0;
    RREP(i, len - 1) {
        if(X[i] == 'T') {
            t++;
        }
        if(X[i] == 'S') {
            if(t == 0) continue;
            t--, cnt++;
        }
    }
    std::cout << len - 2*cnt << std::endl;
}

Measured memory_bytes: 640
import java.util.*;

public class Main {
    public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
 
      if(A<=8 && B<=8){
    System.out.println("Yay!");
      }else{
	System.out.println(":(");
      }
      }
}

Measured memory_bytes: 23764
# include <bits/stdc++.h>
# define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
# define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
# define rrep(i, n) for(int i=((int)(n)-1); i>=0; --i)
# define rreps(i, n) for(int i=((int)(n)); i>0; --i)
# define ALL(x) (x).begin(), (x).end()
# define RALL(x) (x).rbegin(), (x).rend()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define optimize_cin() cin.tie(0); ios::sync_with_stdio(false)
# define debug(x) std::cerr<<#x<<": "<<(x)<<endl;
using namespace std;
using lint = long long;
template<class T> using grid = vector<vector<T>>;
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; }
static const lint MOD = (lint)1e9+7;

int main()
{
    int N, D;
    cin >> N >> D;

    int ans = (N + 2*D) / (2*D + 1);
    cout << ans << endl;

    return 0;
}


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

using ll = long long;
constexpr ll inf = 1e18;

int main() {
    int n; cin >> n;
    vector<ll> v(n), sum(n + 1);
    for(int i = 0; i < n; ++i) {
        cin >> v[i];
        sum[i + 1] = sum[i] + v[i];
    }

    ll ans = inf;
    for(int i = 1; i < n; ++i) {
        const ll l = sum[i], r = sum.back() - l;
        ans = min(ans, abs(l - r));
    }
    cout << ans << endl;
}


Measured memory_bytes: 3328
#!/usr/bin/env python
import collections


def main():
    n = int(input())
    xs = [int(a) for a in input().split()]

    xa = [xs[i] for i in range(0, n, 2)]
    xb = [xs[i] for i in range(1, n, 2)]

    ca = collections.Counter(xa)
    cb = collections.Counter(xb)

    ma, mb = ca.most_common(2), cb.most_common(2)
    val_a, count_a = ma[0]
    val_b, count_b = mb[0]

    if val_a != val_b:
        p = len(xa) - count_a + len(xb) - count_b
        print(p)
        return
    if len(ma) == 1:
        if len(mb) == 1:
            print(len(xa))
            return
        val_b, count_b = mb[1]
        print(len(xb) - count_b)
        return
    if len(mb) == 1:
        val_b, count_b = ma[1]
        print(len(xb) - count_b)
        return
    val_a2, count_a2 = ma[1]
    val_b2, count_b2 = mb[1]
    p1 = len(xb) - count_b + len(xa) - count_a2
    p2 = len(xb) - count_b2 + len(xa) - count_a
    print(min(p1, p2))
    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 19040
#include<stdio.h>
#include<stdlib.h>

int cmp(const void *a,const void *b)
{
   return *(long*)a-*(long*)b;
}



int main(void)
{
   int n, i;
   long k, a[100000][2];

   scanf("%d%ld",&n,&k);
   for(i=0;i<n;i++)
      scanf("%ld%ld",&a[i][0],&a[i][1]);

   qsort(a,n,sizeof(long)*2,cmp);

   for(i=0;i<n;i++){
      k-=a[i][1];
      if(k<=0){
         printf("%ld\n",a[i][0]);
         return 0;
      }
   }
}


Measured memory_bytes: 4684
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define Z class
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1e9+7,MAXL=1LL<<61,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<ll,ll> P;

void Main() {
  ll n,m;
  cin >> n >> m;
  string s[n];
  rep(i,n) R s[i];
  ll d[n][m],c[n][m];
  mem(d),mem(c);
  rep(i,n) {
    rep(j,m) {
      if(!d[i][j]) {
        int x=0;
        REP(k,i,n) {
          if(s[k][j]=='#') break;
          x++;
        }
        REP(k,i,n) {
          if(s[k][j]=='#') break;
          d[k][j]=x;
        }
      }
      if(!c[i][j]) {
        int x=0;
        REP(k,j,m) {
          if(s[i][k]=='#') break;
          x++;
        }
        REP(k,j,m) {
          if(s[i][k]=='#') break;
          c[i][k]=x;
        }
      }
    }
  }
  ll ans=0;
  rep(i,n) {
    rep(j,m) ans=max(ans,d[i][j]+c[i][j]-1);
  }
  pr(ans);
}

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


Measured memory_bytes: 67072
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int N=2e5+10,mod=998244353;
struct rec {
	int x,y;
	bool operator <(rec b) const {
		return x<b.x;
	}
}a[N];
int n,pos[N],f[N],c[N];
//f[i]表示前i-1个robot的状态数
void upd(int &x) {x+=x>>31&mod;}

void add(int x,int y) {
	for(	;x<=n&&c[x]<y;x+=x&-x)
		c[x]=y;
}
int ask(int x) {
	int y=0;
	for(  ;c[x]&&x;x&=x-1) y=max(y,c[x]);
	return y;
}

int main() {
	scanf("%d",&n);
	for(int i=1;i<=n;i++) scanf("%d %d",&a[i].x,&a[i].y);
	sort(a+1,a+n+1);
	for(int i=n;i>=1;i--) {
		int l=i,r=n,mid,s=a[i].x+a[i].y-1;
		while(l<r) {
			mid=(l+r+1)>>1;
			if(a[mid].x<=s) l=mid;
			else r=mid-1;
		}
		pos[i]=max(i,ask(l));
		add(i,pos[i]);
	}
	f[1]=1;
	for(int i=1;i<=n;i++) {
		upd(f[i+1]+=f[i]-mod);
		upd(f[pos[i]+1]+=f[i]-mod);
	}
	printf("%d\n",f[n+1]);return 0;
}


Measured memory_bytes: 4096
#include <cstdio>


int W, H;
char Maps[120][120];
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};
void dfs(int x, int y);
int ans;

int main(void) {
    while (scanf("%d %d", &H, &W)!=EOF && W||H) {
        
        for (int i = 0; i<H; i++)
            scanf("%s", Maps[i]);
        
        for (int i = 0; i<H; i++)
            for (int j = 0; j<W; j++)
                if (Maps[i][j]!=' ') {
                    dfs(i, j);
                    ans++;
                }
        
        printf("%d\n", ans);
        ans = 0;
    }
    return 0;
}

void dfs(int x, int y) {
    char tmp = Maps[x][y];
    Maps[x][y] = ' ';
    for (int i = 0; i<4; i++) {
        int nx = x+dx[i], ny = y+dy[i];
        if (nx>=0 && nx<H && ny>=0 && ny<W && Maps[nx][ny]==tmp) dfs(nx, ny);
    }
}

Measured memory_bytes: 1508
#include <algorithm>
#include <cstdlib>
#include<iostream>
#include<vector>
#include<map>
#include<cmath>
using namespace std;
int A,B,C,D;
int main(int argc, char const *argv[])
{
cin>>A>>B>>C>>D;
if(A+B>C+D){
    cout<<"Left"<<endl;
}else if(A+B<C+D){
    cout<<"Right"<<endl;
}else{
    cout<<"Balanced"<<endl;
}
    return 0;
}


Measured memory_bytes: 256
#ABC108B
x1,y1,x2,y2 = map(int,input().split())
a = x2-x1
b = y2-y1
x3 = x2-b
y3 = y2+a
x4 = x3-a
y4 = y3-b
print(x3,y3,x4,y4)

Measured memory_bytes: 2940
#include <iostream>
using namespace std ;
int main() {
	
	
	string a ;	
	cin >> a ;	
	int sum = 0;
	
	while ( a != "0") {
		for (int i=0 ; i <a.size() ; i++){
			sum = sum + a[i] - 48;	
		}	
		cout << sum << endl;
		sum=0;   
		cin >> a;
	}	
}


Measured memory_bytes: 3196
A, B, C = map(int, input().split())
ans = 0
if A == B and B == C and A % 2 == 0:
    ans = -1
else:
    while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
        ans += 1
        AA, BB, CC = A // 2, B // 2, C // 2
        A = BB + CC
        B = CC + AA
        C = AA + BB
print(ans)


Measured memory_bytes: 2940
//#include <tourist>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = 1e9;
const ll LINF = ll(1e18) + 1;
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define debug(v)          \
    cout << #v << ":";    \
    for (auto x : v)      \
    {                     \
        cout << x << ' '; \
    }                     \
    cout << endl;
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;
}
//cout<<fixed<<setprecision(15);有効数字15桁
//-std=c++14
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
int n, m;
vector<ll> a,b,c;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        ll temp;
        cin >> temp;
        a.push_back(temp);
    }
    ll ans=0;
    ll sum=0;
    for (int i = 0; i < n; i++)
    {
        ll temp;
        cin >> temp;
        b.push_back(temp);
        if(a[i]-temp<0){
            ans++;
            sum+=a[i]-temp;
        }
        else if(a[i]-temp>0){
            c.push_back(a[i]-temp);
        }
    }
    sort(ALL(c),greater<ll>());
    for(int i=0;i<c.size();i++){
        if(sum>=0){
            return cout<<ans<<"\n",0;
        }
        ans++;
        sum+=c[i];
        if(sum>=0){
            return cout<<ans<<"\n",0;
        }
    }
    cout << -1 << "\n";
}


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

using namespace std;

int cnt = 0;

int rec(int n, int i) {
  if(i <= n * (n + 1) / 2) {
    return n;
  }
  return rec(n + 1, i);
}

int main(void) {
  int x;
  cin >> x;

  cout << rec(1, x) << endl; 
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int two(int x,int y){
  for(int i=y;i>0;i--)
    if(x%i==0&&y%i==0)
      return i;
}

int three(int x,int y,int z){
  for(int i=z;i>0;i--)
    if(x%i==0&&y%i==0&&z%i==0)
      return i;
}

int main() {
  int N;
  cin>>N;
  int64_t count=0;
  if(N>1)
  for(int i=1;i<N;i++)
    for(int j=i+1;j<N+1;j++)
      count+=two(i,j)*6;
  if(N>2)
    for(int i=1;i<N-1;i++)
      for(int j=i+1;j<N;j++)
        for(int k=j+1;k<N+1;k++)
          count+=three(i,j,k)*6;
  count+=N*(N+1)/2;
  cout<<count<<endl;
}

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

namespace AtCoder
{
    class Program
    {
        public static void Main(string[] args)
        {
            string[] S = Console.ReadLine().Split(' ');
            int N = int.Parse(S[0]);
            int M = int.Parse(S[1]);
            int C = int.Parse(S[2]);
            int[] B = new int[M];
            int[,] A = new int[N, M];

            string[] S2 = Console.ReadLine().Split(' ');
            for (int i = 0; i < M; i++)
            {
                B[i] = int.Parse(S2[i]);
            }

            int res = 0;
            C = -C;

            for (int i = 0; i < N; i++)
            {
                string[] S3 = Console.ReadLine().Split(' ');
                int tmp = 0;
                for (int j = 0; j < M; j++)
                {
                    A[i, j] = int.Parse(S3[j]);
                    tmp += A[i, j] * B[j];
                }
                if (tmp > C) res++;
            }
            
            Console.WriteLine("{0}", res);
        }
    }
}

Measured memory_bytes: 13268
import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n[] = new int[5];
		for(int i=0; i<5; i++)
			n[i]=sc.nextInt();
		int ans=0, last=10;
		for(int ni: n) {
			ans+=(int)Math.ceil(ni/10.0)*10;
			if(ni%10!=0)
				last=Math.min(last, ni%10);
		}
		if(last!=10)
			ans-=10-last;
		System.out.println(ans);
	}
}

Measured memory_bytes: 21844
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int ans=0;
    map<char,int>m;
    string s;cin>>s;
    for(int i=0;i<s.size();i++)
    {
        m[s[i]]++;
        if(m[s[i]]==2)ans++;
    }
    if(ans==2)cout<<"Yes";
    else cout<<"No";
    return 0;
}


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

#define int long long
#define INF 1e18+5

struct node{

    node *l, *r;
    int lazy, val;

    void push(){
        if(lazy){

            if(l) l->lazy += lazy;
            if(r) r->lazy += lazy;
            val += lazy;
            lazy = 0;

        }
    }

    void add(int x){

        lazy += x;

    }

    void Merge(){

        val = INF;
        if(l) val = min(val, l->val);
        if(r) val = min(val, r->val);

    }
};


int n, m;


void Build(node *root, int l, int r){

    if(l == r){

        return;

    }

    int mid = (l+r)/2;
    root->l = new node{NULL,NULL,0,0};
    root->r = new node{NULL,NULL,0,0};

    Build(root->l, l, mid);
    Build(root->r, mid+1, r);
}

void add(node* root, int l, int r, int ql, int qr, int val){

    root->push();

    if(l > qr || r < ql) return;

    if(l >= ql && r <= qr){

        root->add(val);
        root->push();
        return;

    }

    int mid = (l+r)/2;

    add(root->l, l, mid, ql, qr, val);
    add(root->r, mid+1, r, ql, qr, val);

    root->Merge();
}

signed main(){

    cin >> n >> m;

    vector< pair<int, int> > intervals[n+1];

    node *root = new node{NULL, NULL, 0,0};

    Build(root, 0, n);

    int sum = 0;

    for(int i = 0; i < m; i++){

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

        intervals[b].push_back({a,c});
        sum += c;

    }

    int ans = 0;

    for(int i = 1; i <= n+1; i++){

        for(auto a : intervals[i-1]){

            add(root, 0, n, 0, a.first-1, a.second);

        }

        root->push();
        int best = root->val;
        if(i == n+1) ans = best;

        add(root, 0, n, i, i, best);

    }

    cout << sum - ans << endl;
}


Measured memory_bytes: 29952
#include <bits/stdc++.h>
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define SORTR(v,n) sort(v, v+n, greater<int>());
#define SORTPairSecond(v, n) sort(v, v+n, pairCompareSecond);
#define int long long    // %d=>%lld, 1<<n  => 1LL<<n
#define pb push_back

using namespace std;
typedef long long ll;

typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> piii;
typedef pair<ll, pll> plll;
bool pairCompareSecond(const pii& firstEl, const pii& secondEl) {
    return firstEl.second > secondEl.second;
}

const ll MOD = 1000000007;
const int INF = 1000000007;
// const int INF = 0x3f3f3f3f;
const ll LLINF = 0x3f3f3f3f3f3f3f3f;
// const ll LLINF = 1LL << 50;
const double PI = acos(-1);
const double EPS = 0.000000001;



string s;

signed main(){

    cin >> s;

    for (char c: s){
        if(c == '9'){
            cout<< "Yes"<< endl;
            return 0;
        }
    }

    cout<< "No"<< endl;

    return 0;
}

Measured memory_bytes: 256
#ABC092-D Grid Components
"""
問題：
100*100以下のグリッドを作成し、
白・黒に色を塗る時、白の連結成分の個数をwに、
黒の連結成分をbとしたものを出力せよ
解法：
まずグリッドは100*100としてよい。
上50行を黒、下50行を白で塗る(w,b>=1)
上50行100列のうち、w-1個だけ斜めに配置する
同じように下50行100列もb-1個だけ斜めに配置
"""
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0
w,b = map(int,readline().split())
H,W = 100,100
print(H,W)
ans = [["."]*W for _ in range(H//2)]
ans += [["#"]*W for _ in range(H//2)]

i,j = 0,0
res = b-1
while True:
    if res == 0:
        break
    if j+2 >= W:
        i += 2
        j = 0 if even(i) else 1
        ans[i][j] = "#"
        res -= 1
    else:
        j += 2
        ans[i][j] = "#"
        res -= 1
i,j = 51,0
res = w-1      
while True:
    if res == 0:
        break
    if j+2 >= W:
        i += 2
        j = 0 if even(i) else 1
        ans[i][j] = "."
        res -= 1
    else:
        j += 2
        ans[i][j] = "."
        res -= 1
for i in ans:
    print("".join(i))

Measured memory_bytes: 38384
#include "bits/stdc++.h"
using namespace std;
const int maxn = 300300;
int c[maxn], s[maxn], f[maxn];
int u(int v){
    if(v%2==0) return 0;
    return s[v] == 0 && s[(v+1)/2] == 0;
}
int main(){
    s[0] = 1;
    s[1] = 1;
    for(int e = 2; e < maxn; e++){
        for(int f = 2*e; f < maxn; f += e) s[f] = 1;
    }
    for(int e = 1; e < maxn; e++)
        c[e] = c[e-1] + u(e);
    int q;
    scanf("%d", &q);
    while(q--){
        int l, r;
        scanf("%d %d", &l, &r);
        printf("%d\n", c[r] - c[l-1]);
    }
    return 0;
}


Measured memory_bytes: 2944
#include <iostream>
#define rep(i, n) for(int i = 0; i < (n); i++)
using namespace std;
using ll = long long;

int main(){
	int n, a;
	scanf("%d", &n);
	ll tmp = 0, sum[n];
	rep(i, n){
		scanf("%d", &a);
		sum[i] = a + tmp;
		tmp += a;
	}
	ll minv = 1e+14;
	rep(i, n-1){
		minv = min(minv, abs(sum[n-1] - sum[i] * 2));
	}
	printf("%lld\n", minv);
	return 0;
}

Measured memory_bytes: 1792
#include <iostream>
using namespace std;
int main(){
  string s;
  cin >> s;
  int head, tail;
  bool c = true;
  for (int i = 0; i < s.size(); i++){
    if (c){
      if (s.at(i) == 'A') {
        head = i;
        c = false;
      }
    } else if (s.at(i) == 'Z') tail = i;
  }
  cout << tail - head + 1 << endl;
}

Measured memory_bytes: 640
"use strict"
function Main(input) {
  input = input.trim();
  const arr = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
  let ret = 0;
  arr.map((val, index) => {
    if(val === input){
      ret = index + 1;
    }
  })

  console.log(arr[ret]);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7372
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>

using namespace std;

int a, b, c, d;

int main(){
	int e;
	cin >> a >> b >> c >> d;
	e = min(b, d) - max(a,c);
	if(e < 0)
		e = 0;
	cout << e << endl;
	
	return 0;
}

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

int main() {
  int n;
  cin >> n;
  vector<tuple<string, int ,int>> arr;
  rep(i, n) {
    string s;
    int p;
    cin >> s >> p;
    arr.emplace_back(s, -p, i + 1);
  }
  sort(arr.begin(), arr.end());
  for (auto & tup : arr) {
    cout << get<2>(tup) << endl;
  }
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string.h>
using namespace std;
int n,tmp,best,t;
int g[100005];
int main()
{
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>tmp;
		g[tmp]++,g[tmp+1]++,g[tmp-1]++;
	}
	for(int i=0;i<100005;i++)
	{
		if(best<g[i])best=g[i];
	}
	cout << best<<'\n';
}

Measured memory_bytes: 640
N,K = map(int,input().split())
A = list(map(int,input().split()))
firstA = set(A)

if len(firstA)<=K:
    print(0)
    exit()
count = [0 for i in range(max(firstA)+1)]
for i in range(N):
    count[A[i]] += 1
count.sort()
for i,x in enumerate(count):
    if x > 0:
        count = count[i:]
        break
print(sum(count[:len(count)-K]))

Measured memory_bytes: 25644
import java.util.*;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		int[] A = new int[N];
		int[] B = new int[N];
		for(int i=0; i<N; i++) {
			A[i] = sc.nextInt();
			B[i] = sc.nextInt();
		}
		
		Arrays.sort(A);
		Arrays.sort(B);
		
		if(N%2==0) {
			System.out.println(B[N/2-1]+B[N/2]-A[N/2-1]-A[N/2]+1);
		} else {
			System.out.println(B[N/2]-A[N/2]+1);
		}
		
		sc.close();
	}
	
}



Measured memory_bytes: 51572
#define _USE_MATH_DEFINES
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<functional>
#include<cmath>
#include<iomanip>
using namespace std;
int main() {
    double a, b, c, C, S, L, h,pi;
    pi = M_PI;
    cin >> a; cin >> b; cin >> C;
    double X = C*pi / double(180);
    S = (0.5)*a*b*sin(X);
    c = sqrt(pow(a, 2) + pow(b, 2) - 2 * a*b*cos(X));
    L = a + b + c;
    h = 2 * S / a;
    cout << fixed<<setprecision(6)<< S << endl;
    cout << fixed << setprecision(6) << L << endl;
    cout << fixed << setprecision(6) << h << endl;
    return 0;
}


Measured memory_bytes: 3652
using System;
using System.Linq;

namespace ABC143_B
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var d = Console.ReadLine().Split().Select(int.Parse).ToArray();

            var ans = 0;
            for (int i = 0; i < N; i++)
            {
                for (int j = i + 1; j < N; j++)
                {
                    if (i == j) continue;
                    ans += d[i] * d[j];
                }
            }

            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 13268
def agc_002_a
    a,b = gets.chomp.split(/\s/).map{|x| x.to_i}

    if ((a == 0) or (b == 0) or (a < 0 and 0 < b))
        puts 'Zero'
        exit
    end

    if ((a > 0) and (b > 0))
        puts 'Positive'
        exit
    end

    puts (((a.abs - b.abs) + 1) % 2 == 0) ? 'Positive' : 'Negative'
end

agc_002_a

Measured memory_bytes: 1916
import sys
import resource

def root(x):
  if par[x] == x:
    return x
  par[x] = root(par[x])
  return par[x]

def union(x, y):
  rx = root(x)
  ry = root(y)
  if rx != ry:
    par[rx] = ry
  return 0

sys.setrecursionlimit(10 ** 6)
n, m=map(int, input().split(" "))
par = list(range(n + 1))
for i in range(m):
  a, b = map(int, input().split(" "))
  union(a, b)
#print(par)
maxi = 0
count = 1
#print(par)
countpar = [0 for i in range(n + 1)]
#print(len(countpar), len(par))
for i in range(1, n + 1):
  countpar[root(par[i])] += 1
print(max(countpar))
#print(countpar, par)


Measured memory_bytes: 176024
#include<stdio.h>
int main(){
int x1,y1,x2,y2,x3,y3,x4,y4,len;
scanf("%d%d%d%d",&x1,&y1,&x2,&y2);

x3 = x2 - (y2 - y1);
y3 = y2 + (x2 - x1);
x4 = x3 - (y3 - y2);
y4 = y3 + (x3 - x2);


printf("%d %d %d %d",x3,y3,x4,y4);
return 0;
}

Measured memory_bytes: 128
# atcoderのテスト用
# ./iunput/input.txt に入力を書き込む


# ここを書き換える
def main():
    n = int(input())
    h = list(map(int, input().split()))

    ans = 'Yes'
    # 右から見ていく
    for i in reversed(range(1,n)):
        if h[i-1] <= h[i]: continue
        if h[i-1]-1 == h[i]:
          h[i-1] = h[i-1] - 1
          continue
        ans = 'No'
        break
    print(ans)
    
if __name__ == '__main__':
    main()

Measured memory_bytes: 14252
#include <bits/stdc++.h>
using namespace std;
int main() {
//	int a,b,c,x,cnt=0;
  	int i;
  	int cnt[26]={0};
	string w;
	cin>>w;
	for(i=0;i<w.size();i++){
      cnt[w.at(i)-'a']++;
	}
	for(i=0;i<26;i++){
      if(cnt[i]%2==1) break;
	}
	cout<<(i==26?"Yes":"No")<<endl;
}


Measured memory_bytes: 256
n = int(input())
T = [0] + [None] * n
X = [0] + [None] * n
Y = [0] + [None] * n
for i in range(1, n + 1):
  T[i], X[i], Y[i] = map(int, input().split())

for i in range(len(T) - 1):
  dt = T[i + 1] - T[i]
  dx = abs(X[i + 1] - X[i])
  dy = abs(Y[i + 1] - Y[i])
  if (dt % 2 != (dx + dy) % 2 or (dx + dy) > dt):
    print('No')
    exit()

print('Yes')


Measured memory_bytes: 12388
#include <iostream>
#include <iomanip>
#include <cstdio>

using namespace std;

int main()
{
    int a, b;
    cin >> a >> b;

    cout << a / b << " " << a % b << " ";
    double a1, b1;
    a1 = a;
    b1 = b;
    printf("%.5lf\n", a1 / b1);
    //setprecision(7) <<
}


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

#ifdef DEBUG
    #define IFD if(true)
#else
    #define IFD if(false)
#endif

int main()
{
    int H, W, h, w;

    cin >> H >> W;
    cin >> h >> w;
    cout << (H - h) * (W - w) << endl;

    return 0;
}


Measured memory_bytes: 256
//by OIerC
//Forca Barcelona!
#include<cstdio>
#include<algorithm>
using namespace std;

inline int read()
{
	int x = 0, f = 1; char ch = getchar();
	for (; ch < '0' || ch > '9'; ch = getchar()) if (ch == '-') f = -1;
	for (; ch >= '0' && ch <= '9'; ch = getchar()) x = (x << 1) + (x << 3) + ch - '0';
	return x * f;
}

int main()
{
	int k = read();
	int x = read();
	for (int i = x - k + 1; i < x + k; ++i) printf("%d ", i);
	puts("");
	return 0;
}


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

using namespace std;
using ll = long long;

#define int ll

#define rep(i, a) for (int i = 0; (i) < (int) (a); (i)++)
#define reps(i, a, b) for (int i = (int) (a); (i) < (int) (b); (i)++)
#define rrep(i, a) for (int i = (int) a-1; (i) >= 0; (i)--)
#define rreps(i, a, b) for (int i = (int) (a)-1; (i) >= (int) (b); (i)--)
#define MP(a, b) make_pair((a), (b))
#define PB(a) push_back((a))
#define all(v) (v).begin(), (v).end()
#define PERM(v) next_permutation(all(v))
#define UNIQUE(v) sort(all(v));(v).erase(unique(all(v)), v.end())
#define CIN(type, x) type x;cin >> x
#define TRUE__  "Yes"
#define FALSE__ "No"
#define PRINT(f) if((f)){cout << (TRUE__) << endl;}else{cout << FALSE__ << endl;}
#define YES(f) if((f)){cout << "YES" << endl;}else{cout << "NO" << endl;}
#define Yes(f) if((f)){cout << "Yes" << endl;}else{cout << "No" << endl;}
#define MINV(v) min_element(all(v))
#define MAXV(v) max_element(all(v))
#define MIN3(a, b, c) min(min(a, b), c)
#define MIN4(a, b, c, d) min(MIN3(a, b, c), d)
#define MIN5(a, b, c, d, e) min(MIN4(a, b, c, d), e)
#define MIN6(a, b, c, d, e, f) min(MIN5(a, b, c, d, e), f)
#define MAX3(a, b, c) max(max(a, b), c)
#define MAX4(a, b, c, d) max(MAX3(a, b, c), d)
#define MAX5(a, b, c, d, e) max(MAX4(a, b, c, d), e)
#define MAX6(a, b, c, d, e, f) max(MAX5(a, b, c, d, e), f)
#define RANGE(a, b, c) ((a) <= (b) && (b) < (c))
#define RANGE2D(a, b, c, d, e, f) (RANGE((a), (c), (e)) && RANGE((b), (d), (f)))
#define chmin(a, b) a = min(a, (b))
#define chmin3(a, b, c) a = MIN3(a, (b), (c))
#define chmin4(a, b, c, d) a = MIN4(a, (b), (c), (d))
#define chmin5(a, b, c, d, e) a = MIN5(a, (b), (c), (d), (e))
#define chmin6(a, b, c, d, e, f) a = MIN6(a, (b), (c), (d), (e), (f))
#define chmax(a, b) a = max(a, (b))
#define chmax3(a, b, c) a = MAX3(a, (b), (c))
#define chmax4(a, b, c, d) a = MAX4(a, (b), (c), (d))
#define chmax5(a, b, c, d, e) a = MAX5(a, (b), (c), (d), (e))
#define chmax6(a, b, c, d, e, f) a = MAX6(a, (b), (c), (d), (e), (f))

#define RS resize
#define CINV(v, N) do {\
	v.RS(N);\
	rep(i, N) cin >> v[i];\
} while (0);
#define RCINV(v, N) do {\
	v.RS(N);\
	rrep(i, N) cin >> v[i];\
} while (0);

#define MOD 1000000007

template<class T>
inline T GET() {
	T x;
	cin >> x;
	return x;
}

void init();
void solve();

signed main()
{
	init();
	solve();
}

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

void init()
{
	int N;
	cin >> N;
	int res;
	cin >> res;
	rep(i, N-1) {
		int t;
		cin >> t;
		res = mgcd(res, t);
	}
	cout << res << endl;
}


void solve()
{
}





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

#define REP(i, x) REPI(i, 0, x)
#define REPI(i, a, b) for (int i = int(a); i < int(b); ++i)
#define ALL(x) (x).begin(), (x).end()

typedef long long ll;
using namespace std;

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

  string S;
  cin >> S;
  vector<int> count(26, 0);
  int l = S.length();
  REP(i, l) {
    int index = S.at(i) - 'a';
    if (count.at(index) > 0) {
      cout << "no" << endl;
      return 0;
    }
    ++count.at(index);
  }

  cout << "yes" << endl;

  return 0;
}


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

def calc_xor(n): #nは0以上
  if n%2==0:
    p=n//2
    if p%2==0:
      q=0
    else:
      q=1
    return q^n
  else:
    p=(n+1)//2
    if p%2==0:
      q=0
    else:
      q=1
    return q

#print(calc_xor(A-1))
#print(calc_xor(B))
print(calc_xor(A-1)^calc_xor(B))


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

using namespace std;

#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define pii pair<int, int>
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define vp vector< pii >
#define all(a) (a).begin(), (a).end()
#define Int(x) int x; cin >> x;
#define int2(x, y) Int(x); Int(y);
#define int3(x, y, z) Int(x); int2(y, z);
#define in(x, a, b) ((a) <= (x) && (x) < (b))
#define fir first
#define sec second
#define ffir first.first
#define fsec first.second
#define sfir second.first
#define ssec second.second
#define Decimal fixed << setprecision(10)

//int dxy[5] = {0, 1, 0, -1, 0};
// cmd

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

    Int(n);
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    vector<int> b(n);
    for (int i = 0; i < n; i++) {
        cin >> b[i];
    }
    
    int ans = 0, x = 1;
    rep(i, 29) {
        vi aa(n), bb(n);
        int keta = 1ll << (i+1);
        rep(j, n) {
            aa[j] = a[j] % keta;
            bb[j] = b[j] % keta;
        }
        sort(all(bb));
        //std::cout << "keta : " << keta << std::endl;
        //rep(j, n) cout << aa[j] << " "; cout << endl;
        //rep(j, n) cout << bb[j] << " "; cout << endl;
        int s = 0;
        rep(j, n) {
            //std::cout << "a:" << aa[j] << std::endl;
            if (aa[j] < x) {
                int le = lower_bound(all(bb), x-aa[j]) - bb.begin();
                int ri = lower_bound(all(bb), x*2-aa[j]) - bb.begin();
                //std::cout << le << " " << ri << " " << ri - le << std::endl;
                s += (ri - le);
            } else {
                auto ri = upper_bound(all(bb), x*2-aa[j]-1) - bb.begin();
                s += ri;
                auto le = bb.end() - lower_bound(all(bb), x*3-aa[j]);
                s += le;
                //std::cout << ri << " " << le << std::endl;
            }
        }
        ans += (1ll << i) * (s % 2);
        //std::cout << "s : " << s  << " " << ans << std::endl;
        x *= 2ll;
    }

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

    return 0;
}







Measured memory_bytes: 6572
s,t,_,*z=open(0)
v,w=[0],[0]
for c in s:v+=v[-1]+(c<'B'or 2),
for c in t:w+=w[-1]+(c<'B'or 2),
for x in z:
  a,b,c,d=map(int,x.split())
  print('YNEOS'[(v[b]-v[a-1])%3!=(w[d]-w[c-1])%3::2])

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

int main(){
  int n; cin >> n;
  vector<int> v(n); for(int i=0;i<n;i++) cin >> v[i];
  for(int i=0;i<n;i++) v[i]--;
  
  int ans = -1;
  int c = 0;
  int t = 0;
  for(int i=0;i<100005;i++){
  	if(c==1){ans = t; break;}
    t++;
    c = v[c];
  }
  
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  
  cin >> N;
  int ans = 3; 
  
  for (int i=0;i<N;i++){
    string color;
    cin >> color;
   
    if (color=="Y"){
    	ans = 4;
    } 
  }
  if(ans == 4){
    cout << "Four" <<endl;
  }else{
    cout << "Three" <<endl;
  }
  return 0;
}



Measured memory_bytes: 256
A,B,C,X,Y=map(int, input().split())
cnta=0
cntb=0
cntc=0
if X>Y:
  if A+B>2*C:
    cntc+=2*Y
  else:
    cnta+=Y
    cntb+=Y
  if A>2*C:
    cntc+=2*(X-Y)
  else:
    cnta+=(X-Y)
else:
  if A+B>2*C:
    cntc+=2*X
  else:
    cnta+=X
    cntb+=X
  if B>2*C:
    cntc+=2*(Y-X)
  else:
    cntb+=(Y-X)

print(cnta*A+cntb*B+cntc*C)

Measured memory_bytes: 3064
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<unordered_map>
#include<array>
#include<map>
#include<bitset>
#include<iomanip>
#include<list>
#include <numeric>
using namespace std;
typedef unsigned long long int ulint;
typedef long long int llint;
typedef long double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
#define RE return 0
//ios::sync_with_stdio(false);
//std::cin.tie(0);
//<< setprecision(20)
const int mod=(int)1e9+7;
const llint big=(llint)44e12;//ごめん
const long double pai=3.141592653589793238462643383279502884197;
const long double ena=2.71828182845904523536;
const long double eps=1e-7;
template <class T,class U>void mineq(T& a,U b){if(a>b){a=b;}}
template <class T,class U>void maxeq(T& a,U b){if(a<b){a=b;}}
template <class T> void soun(T& ar)
{sort(ar.begin(),ar.end());ar.erase(unique(ar.begin(),ar.end()),ar.end());}
llint gcd(llint a,llint b){if(a%b==0){return b;}else{return gcd(b,a%b);}}
llint lcm(llint a,llint b){return a/gcd(a,b) *b;}
template<class T,class U> auto LB(T& ve,U in){return lower_bound(ve.begin(),ve.end(),in);}
template<class T,class U> auto UB(T& ve,U in){return upper_bound(ve.begin(),ve.end(),in);}
template<class T,class U> auto LBI(T& ve,U in){return LB(ve,in)-ve.begin();}
template<class T,class U> auto UBI(T& ve,U in){return UB(ve,in)-ve.begin();}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
int main(void){
	int n,i,X,Y;cin>>n>>X>>Y;
	vector<llint>fla(n+1);fla[0]=1;
	for(i=1;i<=n;i++){fla[i]=fla[i-1]*i%mod;}
	llint bgen=fla[n];
	vector<llint>gya(n+1);gya[n]=1;
	for(int h=0;h<30;h++){
		if(((mod-2)&(1<<h))!=0){gya[n]*=bgen;gya[n]%=mod;}
		bgen*=bgen;bgen%=mod;
	}
	for(i=n;i>0;i--){gya[i-1]=gya[i]*i%mod;}
	llint ans=1,all=0;
	vector<vector<int>>ball(n);
	for(i=0;i<n;i++){
		int c,w;cin>>c>>w;c--;
		ball[c].pub(w);
	}
	vector<int>karu(n,mod);//各色の中で一番軽いボール
	vector<int>can(n);//その色がほかの色と動かせるのが存在するか?
	
	int firW=mod,secW=mod,firC=0;//一番の重さ,二番の重さ,一番の色
	for(i=0;i<n;i++){for(auto it:ball[i]){mineq(karu[i],it);}}
	for(i=0;i<n;i++){if(firW>karu[i]){firW=karu[i];firC=i;}}
	for(i=0;i<n;i++){if(i!=firC){mineq(secW,karu[i]);}}
	for(i=0;i<n;i++){
		if(i!=firC){can[i]=(karu[i]+firW<=Y);}
		else{can[i]=(karu[i]+secW<=Y);}
	}
	for(i=0;i<n;i++){
		if(!can[i]){continue;}
		llint gen=0;
		for(auto it:ball[i]){
			if(i!=firC){if(karu[i]+it<=X || it+firW<=Y){gen++;}}
			else{if(karu[i]+it<=X || it+secW<=Y){gen++;}}
		}
		all+=gen;ans*=gya[gen];ans%=mod;
	}
	ans*=fla[all];ans%=mod;
	cout<<ans<<endl;RE;
	RE;
}


Measured memory_bytes: 13952
#include <iostream>
#include <algorithm>
#include <string>
#include <queue>
#include <cmath>
#include <map>

using namespace std;
using ll = long long;


int main() {
	ll ans = 0;
	map<ll, ll> paper;
	ll N;
	cin >> N;
	vector<ll> a(N);
	for (ll i = 0; i < N; i++)
	{
		cin >> a[i];
		if (paper[a[i]] == 0) {
			paper[a[i]] = 1;
			ans++;
		}
		else {
			paper[a[i]] = 0;
			ans--;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 7296
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MOD 1000000007
#define INF 1e9
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }


int main(void){
    int N;
    vector<ll> x,y;
    cin>>N;
    x.resize(N);
    y.resize(N);
    for(int i=0;i<N;i++) cin>>x[i]>>y[i];
    if(N==1){
        cout<<1<<endl;
        return 0;
    }
    int res=N;
    for(int i=0;i<N;i++){
        for(int j=0;j<N;j++){
            if(i==j) continue;
            ll dx=x[j]-x[i];
            ll dy=y[j]-y[i];
            
            int sub=0;
            for(int i2=0;i2<N;i2++){
                for(int j2=0;j2<N;j2++){
                    if(j2==i2) continue;
                    if(dx==x[j2]-x[i2] && dy==y[j2]-y[i2]) sub++;
                }
            }
            res=min(res,N-sub);
        }
    }
    cout<<res<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
long long A[100005];
pair<long long, long long> R[100005];
int main() {
    int n;
    scanf("%d", &n);
    for (int i = 0; i < n + 1; ++i) scanf("%lld", A + i);

    for (int i = n; i >= 0; --i) {
        if (i == n) R[i] = {A[i], A[i]};
        else R[i] = {A[i] + (R[i + 1].first + 1) / 2, A[i] + R[i + 1].second};
    }

    long long m = 1;
    bool ok = true;
    long long ans = 0;

    for (int i = 0; i < n + 1; ++i) {
        if (i == 0) m = 1;
        else if(m > 10e15) ;
        else {
            m -= A[i - 1];
            m *= 2;
        }
        if (m < R[i].first) {
            ok = false;
            break;
        }
        if (m > R[i].second) ans += R[i].second;

        else ans += m;
    }

    if (!ok) printf("-1\n");
    else printf("%lld\n", ans);

    return 0;
}


Measured memory_bytes: 6128
#include <iostream>
#include<string>
#include<time.h>
#include<math.h>
#include<stdlib.h>
#include<map>
using namespace std;

int main() {
	int N, K;
	int a=100, count = 0;
	cin >> N >> K;
	a = N / K;
	count++;
	while (a != 0) {
		a = a / K;
		count++;
	}
	cout << count << endl;
	
	return 0;
}

Measured memory_bytes: 256