akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;

public class Main {
    public static void debug(String str) {
        System.out.println(str);
    }

    public static void main(String[] args) {

        int N;
        int M;
        int[] am;
        int[] bm;
        int[][] cibi;

        try (Scanner sc = new Scanner(System.in)) {
            N = sc.nextInt();
            M = sc.nextInt();
            am = new int[M];
            bm = new int[M];
            cibi = new int[M][];
            for(int i =0;i < M;i++){
                am[i] = sc.nextInt();
                bm[i] = sc.nextInt();
                cibi[i] = new int[bm[i]];
                int v = 0;
                for(int temp :cibi[i]){
                    cibi[i][v] = sc.nextInt();
                    v++;
                }

            }
        }
        long dp[] = new long[1 << N];
        for (int i = 0; i < dp.length; i++) {
            dp[i] = 1000000009;
        }
        dp[0] =0;
        //鍵 1→Mまで
        for(int i=1;i<=M;i++){
            //i番目を使って移動する集合
            int set = 0;
            for(int j = 0;j < cibi[i-1].length;j++){
                set = set | (1 << (cibi[i-1][j] -1));
            }
            for(int s = 0;s < (1<<N);s++){
                if(dp[s|set] > dp[s]+am[i-1]){
                    dp[s|set] =dp[s]+am[i-1];
                }
            }

        }
        if(dp[(1 << N)-1] == 1000000009){
            dp[(1 << N)-1] = -1;
        }

        System.out.println(dp[(1 << N)-1]);

    }

}


Measured memory_bytes: 32840
#include <iostream>
using namespace std;
int N;
int A[210];
int main() {
    cin >> N;
    for (int i = 0; i < N; i++) cin >> A[i];
    int res = 0;
    while (true) {
        bool exist_odd = false;
        for (int i = 0; i < N; ++i) {
            if (A[i] % 2 != 0) exist_odd = true;
        }
        if (exist_odd) break;
        for (int i = 0; i < N; ++i) {
            A[i] /= 2;
        }
        ++res;
    }
    cout << res << endl;
}

Measured memory_bytes: 256
/**
   _           _
  / /         \ \
 / /  _   _  _ \ \
< < (_) (_) (_) > >
 \ \           / /
  \_\         /_/

Nerede Gitsen Çukur Orda
**/

#include<bits/stdc++.h>
#include<fstream>
///#include "windows.h"
#define ll long long
#define ld long double
#define pb push_back
#define pf push_front
#define fr first
#define sc second
#define Zohiri_dzd cout.tie(NULL);
#define Belafz cin.tie(NULL);
#define CODER ios_base::sync_with_stdio(0)  ;
#define p_b pop_back
#define p_f pop_front
#define quluq return 0;
using namespace std ;

    const ll N = 1e4 + 0.000001 ;

int main ()
{
    Zohiri_dzd
    Belafz
    CODER
    ///freopen("input.txt" , "r" , stdin );
    ///freopen("output.txt", "w" , stdout );
    ///Author of the greatest code :: Murtazoev Alijon
    ///4294967295
    ll n , k ;
    cin >> n >> k ;
    deque < ll > v ;
    for (ll i = 0 ; i < n ; i ++ )
    {
        ll a ;
        cin >> a ;
        v.pb(a) ;
    }
    sort(v.begin() , v.end()) ;
    ll cnt = 0 ;
    for (ll i = 0 ; i < k ; i ++ )
        cnt += v[i] ;
    cout << cnt << endl ;
}
///Mavl studios
///Eco students


Measured memory_bytes: 3660
#include <bits/stdc++.h>
using namespace std;
map<int,int>freq1, freq2;

typedef pair<int,int>pii;

void init(){
	freq1.clear();
	freq2.clear();
}

int main() {
	// your code goes here
	int n,m, val;
	while(scanf("%d",&n)==1){
		init();
		for(int i=0;i<n;i++){
			scanf("%d",&val);
			freq1[val]++;
		}
		
		scanf("%d",&m);
		for(int i=0;i<m;i++){
			scanf("%d",&val);
			freq2[val]++;
		}
		
		bool can = true;
		for(pii p : freq2){
			int val = p.first, cnt2 = p.second;
			int cnt1 = freq1[val];
			if(cnt1 < cnt2){
				can = false; break;
			}
		}
		
		printf("%s\n", can ? "YES" : "NO");
	}
	
	return 0;
}

Measured memory_bytes: 22452
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, x, n) for(int i = x; i <= n; i++)
#define rep3(i, x, n) for(int i = x; i >= n; i--)
#define elif else if
#define sp setprecision
#define pb(x) push_back(x)
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, ll> pil;
typedef pair<ll, int> pli;
typedef pair<ld, ld> pdd;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const int inf = 1e8;
const ll INF = 1e16;
const string alpha = "abcdefghijklmnopqrstuvwxyz";

int main(){
    int N, Q;
    cin >> N >> Q;
    ll A[N];
    rep3(i, N-1, 0) cin >> A[i];
    //sum[i]:=左からi+1個ずつ取って残りを交互にとった場合の和
    ll sum[(N+1)/2];
    sum[0] = 0;
    rep(i, N){
        if(i%2 == 0) sum[0] += A[i];
    }
    rep2(i, 1, (N-1)/2){
        sum[i] = sum[i-1]+A[i]-A[2*i];
    }
    //rep(i, (N+1)/2) cout << sum[i] << endl;
    rep(i, Q){
        int x, l = 0, r = (N+1)/2;
        cin >> x;
        while(r-l > 1){
            int n = (l+r)/2;
            //A[n]とA[2n]でどっちが早いか
            if(abs(A[n]-x) >= abs(A[2*n]-x)) l = n;
            else r = n;
        }
        cout << sum[l] << endl;
    }
}

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

// 構文解析
using State = string::const_iterator;
class ParseError{};

int P, Q, R;

int number(State &begin);
int term(State &begin);
int factor(State &begin);
int expression(State &begin);

// 数字の列をパースして，その数を返す
int number(State &begin) {
    int ret = 0;

    while (isdigit(*begin)) {
        ret *= 10;
        ret += *begin - '0';
        begin++;
    }

    if (*begin == 'P') {
        ret = P;
        ++begin;
    }
    else if (*begin == 'Q') {
        ret = Q;
        ++begin;
    }
    else if (*begin == 'R') {
        ret = R;
        ++begin;
    }

    return ret;
}


// 乗算除算の式をパースして，その評価結果を返す
int term(State &begin) {
    if (*begin == '-') {
        begin++;
        return abs(2-term(begin));
    }
    else {
        return factor(begin);
    }
}

int factor(State &begin) {
    if (*begin == '(') {
        begin++; // '('を飛ばす
        int ret = expression(begin);
        begin++;
        return ret;
    }
    else {
        return number(begin);
    }
}


// 四則演算の式をパースして，その評価結果を返す
int expression(State &begin) {
    int ret = term(begin);

    for (;;) {
        if (*begin == '+') {
            begin++;
            ret = max(ret, term(begin));
        }
        else if (*begin == '*') {
            begin++;
            ret = min(ret, term(begin));
        }
        else {
            break;
        }
    }

    return ret;
}

void consume(State &begin, char expected) {
    if (*begin == expected) {
        begin++;
    }
    else {
        cerr << "Expected " << expected << " but got " << *begin << endl;
        cerr << "Rest string is ";
        while (*begin) {
            cerr << *begin++;
        }
        cerr << endl;
        throw ParseError();
    }
}

int main() {
    while (true) {
        string s;
        getline(cin, s);

        if (s == ".") break;

        int ans = 0;
        rep(p, 3) rep(q, 3) rep(r, 3) {
            P = p; Q = q; R = r;
            State begin = s.begin();
            int tmp = expression(begin);
            if (tmp == 2) ans++;
        }

        cout << ans << endl;
    }
    return 0;
}



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

#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define SORT_INV(c) sort((c).begin(), (c).end(), greater<int>())

#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false
#define LL long long
#define Dev 1000000007

//cout << (c)?"Yay!":":(" << endl;

// sort(a.begin(), a.end(), std::greater<int>());
using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<long double> v(n);
    rep(i, n)
    {
        cin >> v[i];
    }
    SORT(v);
    rep(i, n - 1)
    {
        v[i + 1] = (v[i] + v[i + 1]) / 2;
    }
    cout << v[n - 1] << endl;
    return 0;
}


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

#define ll long long
#define vvi vector<vector<int>>
#define vec vector
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define uniqueV(x) sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end());
#define rep(i, n) for (int (i) = (0); (i) < (n); ++(i))
#define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))
#define debug(x) cerr << #x << ": " << x << endl;
#define debug2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;
#define debug3(x, y, z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = "<<"("<<x<<", "<<y<<", "<<z<<")"<<endl;
#define debugB(x, y) cerr<<#x<<": "<<bitset<y>(x) << endl;
#define line() cerr << "---------------" << endl;

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

template<typename T>
void printA(vector<T> &printArray, char between = ' ') {
   int paSize = printArray.size();
   for (int i = 0; i < paSize; i++) { cerr << printArray[i] << between;}
   if (between != '\n') {cerr << endl;}
}

// ------------------------------------------------------------------------------------------

int main() {
   int n;
   cin >> n;
   vector<string> v1(n);
   map<string, int> m1;
   set<string> S;
   rep (i, n) {
      cin >> v1[i];
      m1[v1[i]]++;
      S.insert(v1[i]);
   }
   int m;
   int ans = 0;
   cin >> m;
   map<string, int> m2;
   rep (i, m) {
      string s;
      cin >> s;
      m2[s]++;
      S.insert(s);
   }

   for (string s : S) {
      int t = 0;
      t += m1[s];
      t -= m2[s];
      ans = max(ans, t);
   }
   cout << ans << endl;

   return 0;
}

Measured memory_bytes: 256
#include <cstdio>
const int S=203,mod=1000000007;
int n,m,k,h[S],nx[S],v[S],eg=1;
int _=0,dfn[S],low[S],st[S],is[S],cl[S],cnt=0,su,ans,res=1,b[S];
bool vis[S],mk[S];
inline void egadd(int uu,int vv)
{
	nx[++eg]=h[uu];h[uu]=eg;
	v[eg]=vv;
}
int ot=0,fact[100000];
inline int ksm(int a,int x)
{
	int s=1;
	while (x)
	{
		if (x&1) s=1ll*s*a%mod;
		x>>=1;a=1ll*a*a%mod;
	}
	return s;
}
inline int mi(int a,int b){return a<b?a:b;}
inline int gcd(int a,int b){return !b?a:gcd(b,a%b);}
void dfs(int x)
{
	dfn[x]=low[x]=++_;
	st[++st[0]]=x;is[x]=st[0];
	for (int i=h[x];i;i=nx[i])
		if (!dfn[v[i]])
		{
			dfs(v[i]);
			low[x]=mi(low[v[i]],low[x]);
			if (low[v[i]]>=dfn[x])
			{
				int bk=is[v[i]],o=st[0]-bk+2;
				++cnt;
				for (int i=bk;i<=st[0];++i) mk[st[i]]=true;mk[x]=true;
				for (int p=bk,xx;p<=st[0];++p)
				{
					xx=st[p];//printf("%d ",xx);
					for (int j=h[xx];j;j=nx[j])
						if (mk[v[j]])
							++b[cnt];
				}
				int xx=x;//printf("%d\n",x);
				for (int j=h[xx];j;j=nx[j])
					if (mk[v[j]])
						++b[cnt];
				b[cnt]>>=1;
				if (b[cnt]==o)
				{
					int ss=0;
					for (int p=1;p<=o;++p)
						ss=(ss+ksm(k,gcd(p,o)))%mod;
					ss=1ll*ss*ksm(o,mod-2)%mod;
				//	printf("%d\n",ss);
					res=1ll*ss*res%mod;
				}
				else if (b[cnt]>o)
					res=1ll*res*fact[b[cnt]+k-1]%mod*ksm(fact[k-1],mod-2)%mod*ksm(fact[b[cnt]],mod-2)%mod;
				else ot+=b[cnt];
				for (int i=bk;i<=st[0];++i) mk[st[i]]=false;mk[x]=false;
				for (int i=bk+1;i<=st[0];++i)
				{
					is[st[i]]=0;
					cl[st[i]]=cnt;
					st[i]=0;
				}
				st[0]=bk-1;
			}
		}
		else if (is[v[i]])
			low[x]=mi(low[x],dfn[v[i]]);
/*	if (dfn[x]==low[x])
	{
		int bk=is[x],o=st[0]-bk+1;
		++su;
		for (int i=bk;i<=st[0];++i)
		{
			is[st[i]]=0;
			st[i]=0;
		}
		st[0]=bk-1;
	}*/
}
int main()
{
	//freopen("4131.out","w",stdout);
	scanf("%d%d%d",&n,&m,&k);
	fact[0]=1;for (int i=1;i<100000;++i) fact[i]=1ll*fact[i-1]*i%mod;
	for (int i=1;i<=m;++i)
	{
		int uu,vv;
		scanf("%d%d",&uu,&vv);
		egadd(uu,vv);egadd(vv,uu);
	}
	for (int i=1;i<=n;++i)
		if (!dfn[i]) dfs(i);
//	for (int i=1;i<=cnt;++i) printf("%d ",b[i]);puts("s");
	res=1ll*res*ksm(k,ot)%mod;
	printf("%d\n",res);
	return 0;
}


Measured memory_bytes: 512
N = int(input())
A = tuple(map(int, input().split()))
if len(A) == 1:
  print(1)
  exit()
r = 1
cnt = 1
T = A[0]
t = 1
flg = False
for l in range(N):
  while True:
    if T ^ A[r] == T + A[r]:
      t += 1
      cnt += t
      T += A[r]
      r += 1
    else:
      T -= A[l]
      t -= 1
      break
    if r == N:
      flg = True
      break
  if flg:
    break
print(cnt) 


Measured memory_bytes: 23816
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc= new Scanner(System.in);
int x = sc.nextInt();
int y = sc.nextInt();
if(x>y) {
System.out.println("a > b");}
if(x<y) {
System.out.println("a < b");}
if(x==y) {
System.out.println("a == b");}
}
}

Measured memory_bytes: 26048
import math
def dist_is_int(x, y):
  d2 = 0
  for i in range(len(x)):
    diff = x[i] - y[i]
    d2 += diff * diff
  
  cand = int(math.sqrt(d2))
  return cand * cand == d2

n, d = [int(v) for v in input().split()]
x_s = [[int(v) for v in input().split()] for _ in range(n)]

ans = 0
for i in range(n):
  for j in range(i + 1, n):
    if dist_is_int(x_s[i], x_s[j]):
      ans += 1
print(ans)

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

struct V {
	int id;
	vector<V*> next;
	V(){}

	V(int i) {
		id = i;
	}
};

struct Path {
	bool completed=false;
	vector<int> visitedVs;
	V* current;

	Path(V* start) {
		current = start;
		visitedVs.push_back(start->id);
	}
	Path(Path* hist, V* cur) {
		current = cur;
		visitedVs = hist->visitedVs;
		visitedVs.push_back(cur->id);
	}

	//未到達の頂点へのパスを返す
	vector<Path*> getNext() {
		vector<Path*> pnext;
		for (V* v : current->next) {
			if (find(visitedVs.begin(), visitedVs.end(), v->id) != visitedVs.end()) {
				continue;
			}
			Path* pn=new Path(this, v);
			pnext.push_back(pn);
		}

		return pnext;
	}
	
};

int main() {
	int N, M;
	cin >> N >> M;
	
	map<int,V*> vertexes;
	for (int i = 0;i < M;i++) {
		int a, b; cin >> a >> b;
		V* vertexA;
		V* vertexB;
		if (vertexes.count(a) == 0) {
			vertexA = new V(a); 
			vertexes[a] = vertexA;
		}
		else {
			vertexA = vertexes[a];
		}
		if (vertexes.count(b) == 0) {
			vertexB = new V(b);
			vertexes[b] = vertexB;
		}
		else {
			vertexB = vertexes[b];
		}

		vertexes[a]->next.push_back(vertexB);
		vertexes[b]->next.push_back(vertexA);
	}

	vector<Path> paths;
	V* vertex = vertexes[1];
	Path path(vertex);
	paths.push_back(path);

	for (int i = 0;i < N - 1;i++) {

		vector<Path> nextPaths;
		for (Path p : paths) {
			auto next = p.getNext();
			for (Path* np : next) {
				nextPaths.push_back(*np);
			}
		}
		paths = nextPaths;
	}

	cout << paths.size() << endl;

	return 0;
}

Measured memory_bytes: 2644
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep_range(i, s, e) for (int i = (s); i < (int)(e); i++)
#define rep_rev(i, s, e) for (int i = (s)-1; i >= (int)(e); i--)
#define sort_vec(v) sort((v).begin(),(v).end())
typedef int64_t lint;
// lint mod = 998244353;
// lint mod = 1000000007;
template< typename T1, typename T2 >
inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 >
inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

int app() {
  int n=5;

  rep(i,n){
    int x;
    cin>>x;
    if(x!=i+1) return i+1;
  }

  return 0;
}

int main(){cout<<app()<<endl;return 0;}


Measured memory_bytes: 3588
#include<stdio.h>
#include<stdlib.h>
   
struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};
typedef node* Node;
#define NIL NULL
  
node array[500000];
int size=0;
  
Node root = NIL;
   
Node treeMinimum(Node x){
  while(x->left!=NIL)x=x->left;
  return x;
}
   
Node treeSearch(Node u, int k){
  Node i=u;
  while(i!=NIL){
    if(i->key==k)return i;
    else if(i->key<k)i=i->right;
    else i=i->left;     
  }
  return NIL;
}
   
Node treeSuccessor(Node x){
  if(x->right!=NIL)return treeMinimum(x->right);
  Node y=x->parent;
  while(y!=NIL&&x==y->right){
    x=y;
    y=y->parent;
  }
  return y;
}
   
void treeDelete(Node z){
  Node y; // node to be deleted
  Node x; // child of y
  if(z->left==NIL||z->right==NIL)y=z;
  else y=treeSuccessor(z);
     
  if(y->left!=NIL)x=y->left;
  else x=y->right;
   
  if(x!=NIL)x->parent=y->parent;
     
  if(y->parent==NIL)root=x;
  else if(y==y->parent->left)y->parent->left=x;
  else y->parent->right=x;
   
  if(y!=z)z->key=y->key;
     
  //free(y);
}
   
void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;
   
  z = &array[size++];
  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;   
}
  
  
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 n,x;
  char str[20];
  scanf("%d",&n);
  for(int i=0;i<n;i++){
    scanf("%s", str);
    if(str[0]=='f'){
      scanf("%d",&x);
      Node t=treeSearch(root,x);
      if (t!=NIL) printf("yes\n");
      else printf("no\n");
    }else if(str[0]=='i'){
      scanf("%d",&x);
      insert(x);
    }else if(str[0]=='p'){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    }else if(str[0]=='d'){
      scanf("%d",&x);
      treeDelete(treeSearch(root,x));
    }
  }
  
  return 0;
}



Measured memory_bytes: 15060
#include<bits/stdc++.h>
typedef long long int ll;
using namespace std;
#define sz 200009
ll arr[sz],n,i;
int main()
{
    scanf("%lld",&n);
    ll ans=0;
    if(n==2)
    {
        printf("1\n");
        return 0;
    }
    for(i=2;i*i<=n;i++)
    {
        if(n%i==0)
        {
           // printf("%lld\n",i);
            ll m=n/i;
            while(m>1 && m%i==0)
                m/=i;
            if(m==1)
                ans++;
           else{
            m--;
            if(m>1 && m%i==0)
                ans++;
           }
        }
    }
 //   printf("%lld\n",ans);
    n--;
    for(i=2;i*i<=n;i++)
    {
        if(n%i==0)
        {
            ans+=1;
            ll m=n/i;
            if(m>1 && m!=i)
                ans++;
        }
    }
    printf("%lld\n",ans+2);
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
 
using namespace std;
inline void prep ()
{
  cin.tie (0);
  cin.sync_with_stdio (0);
};
const double pi = acos(-1.);
//printf(%.12lf\n,mid);
// __builtin_popcount(int) count 1's in binary
// get decimal part of number
/*
double intpart;
double thiss = modf((double)(n*m)/(double)k, &intpart);
*/
// round = (int)(num+.5)
long long mod = 1000000007;
 
long long mymod(long long num){
  if (num< 0 && !(num%mod == 0)){
    if (mod == 1){
      return 0;
    }
    return mod-abs(num)%mod;
  }else{
    return num%mod;
  }
}
 
/*string sentence = And I feel fine...;
    istringstream iss(sentence);
*/  
 
double eps = .000000001;

int main(){
  prep();
  int n;
  cin >> n;
  int arr[n];
  int maxx = 0;
  int minn = 1000000000;
  for (int i=0; i<n; i++){
      cin >> arr[i];
      maxx = max(maxx, arr[i]);
      minn = min(arr[i], minn);
  }
  if (maxx-minn > 1){
      cout << "No";
      return 0;
  }
  if (maxx == minn){
      if (n/2 < maxx && !(maxx == n-1)){
          cout << "No";
      }else{
          cout << "Yes";
      }
      return 0;
  }
  int distinct = 0;
  for (int i=0; i<n; i++){
      if (arr[i] == minn){
          distinct++;
      }
  }
  if (n-distinct == 1){
      cout << "No";
      return 0;
  }
  int more = (n-distinct)/2;
  if (more+distinct >= maxx && distinct+1 <= maxx){
      cout << "Yes";
  }else{
      cout << "No";
  }
  return 0; 
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < int(n); i++)
#define rep1(i,n) for (int i = 1; i <= int(n); i++)
#define repR(i,n) for (int i = int(n)-1; i >= 0; i--)
#define rep1R(i,n) for (int i = int(n); i >= 1; i--)
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fst first
#define snd second
#define cauto const auto
#ifdef LOCAL
#define dump(...) cerr << "[" << __LINE__ << ":" << __FUNCTION__ << "] ", _dmp_(#__VA_ARGS__, __VA_ARGS__);
void _dmp_(const char*) { cerr << endl; }
template <class T, class... U>
void _dmp_(const char *s, T const& x, U const& ...y) { const char *o = "({[", *e = "]})"; for (int i = 0; *s != '\0'; cerr << *s++) { if (count(o,o+3,*s)) i++; if (count(e,e+3,*s)) i--; if (!i && *s == ',') break; } cerr << " = " << x; if (*s == ',') cerr << ", ", s++; _dmp_(s, y...); }
#else
#define dump(...)
#endif
using ll = long long;
#define int ll
template <class T> using pque_max = priority_queue<T>;
template <class T> using pque_min = priority_queue<T, vector<T>, greater<T> >;
#define CONAINER_OUTPUT os << "{"; for (auto const& x : v) os << " " << x; return os << " }";
template <class T> ostream& operator<<(ostream& os, vector<T> const& v) { CONAINER_OUTPUT }
template <class T> ostream& operator<<(ostream& os, deque<T> const& v) { CONAINER_OUTPUT }
template <class T> ostream& operator<<(ostream& os, set<T> const& v) { CONAINER_OUTPUT }
template <class T, class U> ostream& operator<<(ostream& os, map<T,U> const& v) { CONAINER_OUTPUT }
#undef CONAINER_OUTPUT
template <class T> istream& operator>>(istream& is, vector<T>& v) { for (auto& x : v) is >> x; return is; }
template <class T, class S> ostream& operator<<(ostream& os, pair<T,S> const& p) { return os << "(" << p.first << ", " << p.second << ")"; }
template <class T, class S> istream& operator>>(istream& is, pair<T,S> const& p) { return is >> p.first >> p.second; }
struct _Init_ { _Init_() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); } } _init_;

template <class T> void quit(T const& x) { cout << x << endl; exit(0); }
template <class T> bool chmin(T& x, T const& y) { if (x > y) { x = y; return true; } return false; }
template <class T> bool chmax(T& x, T const& y) { if (x < y) { x = y; return true; } return false; }
#define YesNo(c) ((c) ? "Yes" : "No")
////////////////////////////////

const int NN = 205;
const int inf = 1e9;
int d[NN][NN];

int32_t main() {
    int n,m,r; cin >> n >> m >> r;
    vector<int> v(r); cin >> v;

    rep (i,NN) rep (j,NN) d[i][j] = inf;
    rep (i,NN) d[i][i] = 0;
    rep (i,m) {
        int a,b,c; cin >> a >> b >> c;
        d[a][b] = d[b][a] = c;
    }

    rep1 (k,n) rep1 (i,n) rep1 (j,n) chmin(d[i][j], d[i][k] + d[k][j]);
    
    int ans = inf;
    sort(all(v));
    do {
        int sum = 0;
        rep (i,r-1) sum += d[v[i]][v[i+1]];
        chmin(ans, sum);
    } while (next_permutation(all(v)));
    cout << ans << endl;
}


Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <string>
using namespace std;
//変数デバッグ
#define DEB(variable) cout << #variable << '=' << variable << endl

//for簡易表記(引数ミス防止)
#define FOR(LoopVariable,numberOFbegin,numberOFend) for (int LoopVariable = (numberOFbegin); (LoopVariable) < (numberOFend); (LoopVariable)++)
#define REP(LoopVariable,numberOFend) for(int LoopVariable = 0;(LoopVariable)<(numberOFend);LoopVariable++)

int main(){

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

    cout << 0+((n % k)>0) << endl;

    return 0;
}

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

long long lcm(long long m, long long n)
{
	return (n==0?m:lcm(n,m%n));
}

int main()
{
	long long c,x,y,z,ax,mx,ay,my,az,mz;
	while(cin >> ax >> mx >> ay >> my >> az >> mz, ax||mx||ay||my||az||mz)
	{
		x=0; c=1;
		do { x++; c=(c*ax)%mx; } while(c!=1);
		y=0; c=1;
		do { y++; c=(c*ay)%my; } while(c!=1);
		z=0; c=1;
		do { z++; c=(c*az)%mz; } while(c!=1);

		x=x/lcm(x,y)*y;
		x=x/lcm(x,z)*z;
		cout << x << endl;
	}
}

Measured memory_bytes: 0
#!python3.4.3


import itertools

n = int(input())
p = list(map(int, input().split(' ')))
q = list(map(int, input().split(' ')))
a = 0
b = 0

data = [_ for _ in range(1, n+1)]

result = list(map(list, itertools.permutations(data, n)))


for i, row in enumerate(result):
    # print(row)
    if row == p:
        a = i + 1
    if row == q:
        b = i + 1

    if a > 0 and  b > 0:
        break

print(abs(a - b))



Measured memory_bytes: 10228
#include<bits/stdc++.h>
#define all(x) (x).begin() , (x).end()
#define ll long long 
#define pb push_back
#define mp make_pair


using namespace std;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n ; cin>>n;
    string s ; cin>>s;
    int k ; cin>>k;
    char c = s[k - 1];
    for(int i = 0  ; i < n ; ++i){
      if(s[i] != c)s[i] = '*';
    }
    cout<<s<<endl;

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
inline int read(){
	int x=0,f=1;
	char c=getchar();
	while(c<'0'||c>'9'){
		if(c=='-') f=-1;
		c=getchar();
	}
	while(c>='0'&&c<='9'){
		x=x*10+c-'0';
		c=getchar();
	}
	return x*f;
}
int a,b;
int main(){
	a=read();b=read();
	int ans=0;
	ans=max(ans,2*a-1);
	ans=max(ans,2*b-1);
	ans=max(ans,a+b);
	printf("%d",ans);
	
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(void){
  int n;
  scanf("%d", &n);

  int count = 0;
  for(int i=0; i<4; i++){
    if(n % 10 == 2){
      count++;
    }
    n /= 10;
  }

  printf("%d\n", count);
}


Measured memory_bytes: 128
s = input()
n = int(input())
for i in range(n):
    order = input().split()
    a = int(order[1])
    b = int(order[2])
    if order[0] == "print":
        print(s[a:b+1])
    elif order[0] == "reverse":
        s = s[0:a] + "".join(list(reversed(s[a:b+1]))) + s[b+1:len(s)]
    elif order[0] == "replace":
        q = order[3]
        s = s[0:a] + q + s[b+1:len(s)]


Measured memory_bytes: 5612
# coding: utf-8

import math
import re
import numpy as np
import copy

#読み込む
S = input().split(' ')
D = int(S[0])
T = int(S[1])
S = int(S[2])

time = D / S

ans = "No"

if time <= T:
    ans = "Yes"

print(ans)


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

using namespace std;

int pw (int a, int n){
	int ans = 1;
	while (n > 0){
		if (n & 1)
			ans *= a;
			a *= a;
			n >>= 1;
	}
	return ans;
}

int main(){
	int n, k;
	scanf("%d %d", &n, &k);
	printf("%d\n", pw(k - 1, n - 1) * k);
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#define ll long long
using namespace std;
int main(){
    int n;
    cin>>n;
    vector<int> h(n);
    for(int i=0;i<n;i++){
        cin>>h[i];
    }
    vector<int> max(n,0);
    int cnt=0;
    for(int i=0;i<n;i++){
        if(0==i){
            max[i]=h[i];
            cnt++;
            
        }else{
            if(max[i-1]<=h[i]){
                cnt++;
                max[i]=h[i];
            }else{
                max[i]=max[i-1];
            }
        }
    }
    
    cout<<cnt<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <algorithm>
#include <queue>
using namespace std;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define REP(i,n) for(ll i=0;i<n;i++)
#define REPR(i,n) for(ll i=n-1;i>=0;i--)

typedef long long ll;
#define INF 1e18

int main(){
	ll a; cin>>a;
	ll b; cin>>b;
	ll c; cin>>c;
	ll tmp1=c-a-b;
	ll tmp2=a*b;
	if(tmp1<0){
		cout<<"No"<<endl;
		return 0;
	}
	if(tmp1*tmp1>4*tmp2){
		cout<<"Yes"<<endl;
	}else{
		cout<<"No"<<endl;
	}
	return 0;
}


Measured memory_bytes: 256
function main(input){
  input = input.trim();
  var dai = ["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"];
  // var syou = ["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"];
  var answer = "";
  if(dai.includes(input)>0){
    answer = "A";
  }else{
    answer = "a";
  }
  console.log(answer);
}
main(require("fs").readFileSync("/dev/stdin","utf8"));

Measured memory_bytes: 29676
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int min = Integer.MAX_VALUE;
        int[][] p = new int[n][2];
        for (int i = 0; i < n; i++) {
            p[i][0] = sc.nextInt();
            p[i][1] = sc.nextInt();
        }

        for (int i = 0; i < 2; i++) {
            sort(p,i);
            for (int j = 1; j < n; j++) {
                min = Math.min(min, (p[j][0] - p[j - 1][0]) * (p[j][0] - p[j - 1][0]) + (p[j][1] - p[j - 1][1]) * (p[j][1] - p[j - 1][1]));
            }
        }
        System.out.println(min);
    }

    static void sort(int[][] p, int n) {
        if (n == 0) {
            Arrays.sort(p, new Comparator<int[]>() {
                public int compare(int[] a, int[] b) {
                    return a[0] - b[0];
                }
            });
        } else {
            Arrays.sort(p, new Comparator<int[]>() {
                public int compare(int[] a, int[] b) {
                    return a[1] - b[1];
                }
            });
        }
    }
}


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

using namespace std;

const int maxn = 2e5 + 10;

int N, H, W;
int par[maxn], used[maxn];
vector < tuple <int, int, int> > a;

int anc(int p) { return par[p] == p ? p : par[p] = anc(par[p]);  }
bool join(int p, int q) {
	p = anc(p); q = anc(q);
	if (p == q) {
		if (used[q]) return false;
		return used[q] = true;
	}
	if (used[p] && used[q]) return false;
	used[q] |= used[p];
	par[p] = q;
	return true;
}

int main() {
	cin >> N >> H >> W;
	for (int i = 0; i < N; ++i) {
		int x, y, v; cin >> x >> y >> v;
		a.emplace_back(v, x, y + H);
	}
	sort(a.begin(), a.end()); reverse(a.begin(), a.end());
	for (int i = 1; i <= H + W; ++i) par[i] = i;
	
	long long ans = 0;
	for (auto it : a) {
		int v = get<0>(it), x = get<1>(it), y = get<2>(it);
		if (join(x, y)) ans += v;
	}

	cout << ans << "\n";
	return 0;
}


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


void solve(long long S, long long W){
    if (S <= W) {
        cout << "unsafe" << endl;
    } else {
        cout << "safe" << endl;
    }
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long S;
    scanf("%lld",&S);
    long long W;
    scanf("%lld",&W);
    solve(S, W);
    return 0;
}


Measured memory_bytes: 3684
bool debug=false;
#include <stdio.h>
#include <utility>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
#define F first
#define S second
#define PB push_back
const int N=1e5+10;
const int INF=1e9+10;
int V(int n){return n>=0?n:0;}
int max(int a,int b){return a>b?a:b;}
int min(int a,int b){return a>b?b:a;}
int main(){
	int n,nl,nr,ans=0,x=0,y=0;
	pair<int,int> p[N];
	priority_queue<pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>>>pq;
	scanf("%d",&n);
	for(int i=0;i<n;i++)scanf("%d%d",&p[i].F,&p[i].S);
	for(int i=1;i<n;i++)if(p[i].F>p[x].F)x=i;
	for(int i=1;i<n;i++)if(p[i].S<p[y].S)y=i;
	for(int i=0;i<n;i++)if(i!=x&&i!=y)ans=max(ans,p[i].S-p[i].F);
	for(int i=0;i<n;i++)if(i!=x&&i!=y)pq.push({-p[i].F,-p[i].S});
	ans+=V(p[y].S-p[x].F+1)+1;
	if(debug)printf("ori ans=%d\n",ans);
	if(debug)printf("X=%d Y=%d\n",p[x].F,p[y].S);
	nl=max(pq.empty()?p[y].F:-pq.top().F,p[y].F);
	nr=p[x].S;
	ans=max(ans,V(nr-p[x].F+1)+V(p[y].S-nl+1));
	if(debug)printf("nl=%d nr=%d ans=%d\n",nl,nr,ans);
	while(!pq.empty()){
		nr=min(nr,-pq.top().S);
		pq.pop();
		nl=max(pq.empty()?p[y].F:-pq.top().F,p[y].F);
		ans=max(ans,V(nr-p[x].F+1)+V(p[y].S-nl+1));
		if(debug)printf("nl=%d nr=%d ans=%d\n",nl,nr,ans);
	}
	printf("%d\n",ans);
}


Measured memory_bytes: 2168
import sys,math,copy,queue,itertools
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
def LI(): return [int(x) for x in input().split()]
INF = 10**18
MOD = 10**9 + 7
DD = ((1,0),(0,1),(-1,0),(0,-1))
L = int(input())
ans = (L/3) ** 3
print (ans)

Measured memory_bytes: 40556
#require 'prime'
#require 'openssl'
MOD=10**9+7;  cnt=0; sum=0; prev=nil; can=true; h=Hash.new(0)
def gs() gets.chomp end
def gi() gets.chomp.to_i end
def gsmi() gets.chomp.split.map(&:to_i) end

def ar2(s1,s2,de=nil) Array.new(s1){Array.new(s2,de)} end
def ar3(s1,s2,s3,de=nil) Array.new(s1){Array.new(s2){Array.new(s3,de)}} end

def desc(ar) ar.sort!{|x,y| y<=>x} end
def min(a,b) a<=b ? a : b end
def max(a,b) a>=b ? a : b end
def sum(ar) ar.inject(:+).to_i end
def ceil(a,b) (a.to_f/b).ceil end

def C(a,b) b==0||a==b ? 1 : (b=a-b if a/2<b;(a-b+1..a).inject(:*)/(1..b).inject(:*)) end
def rui(ar) s=[0]; ar.size.times{|i| s<<s[-1]+ar[i]}; s end
def rev_rui(ar) s=[0]; ar.size.times.reverse_each{|i| s<<s[-1]+ar[i]}; s end

def puts_yesno(b) puts(b ? 'Yes' : 'No') end
def putsend(s) puts s; exit end
def pu(h) begin; require './../../abc/nemi_lib/debug.rb'; puts_val(h); rescue LoadError; end; end
########### ( ˘ω˘ )ｽﾔｧ… ###########
n=gi
ans=[]

sq=Math.sqrt(n).to_i
cnt=0
1.upto sq do |x|
  ax=x**2
  1.upto sq do |y|
    ay=y**2
    break if ax+ay>=n
    1.upto sq do |z|
      aa=x**2+y**2+z**2+x*y+y*z+z*x
      if aa>n
        break
      else
        h[aa]+=1
      end
    end
  end
end

1.upto n do |i|
  puts h[i]
end

Measured memory_bytes: 14760
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>

using namespace std;

int cal(long long x){
    int ret = 0;
    while(x){
        ret++;
        x /= 10;
    }
    return ret;
}

int main(){
    long long n;
    cin >> n;
    int ans = max(1,cal(n));
    for(int i = 2; 1LL * i * i <= n;i++){
        if(n % i == 0){
            ans = min(ans,max(cal(i),cal(n / i)));
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
package main

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

const (
	maxBufsize = 1000000
)

func inputs(lines int, rdr *bufio.Reader) []string {
	var strSlice []string

	//rdr := bufio.NewReaderSize(os.Stdin, maxBufsize)

	for i := 0; i < lines; i++ {

		line := ReadLine(rdr)
		strSlice = append(strSlice, line)

	}

	return strSlice
}

// ReadLine is to read long line
func ReadLine(rdr *bufio.Reader) string {
	buf := make([]byte, 0, maxBufsize)
	for {
		l, p, e := rdr.ReadLine()

		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}

	return string(buf)
}

//DivideConvertInt is to divide and convert
func DivideConvertInt(line string, num int) []int {
	tmp := strings.Split(line, " ")

	intSlice := make([]int, num)

	for i := 0; i < num; i++ {
		intTmp, _ := strconv.Atoi(tmp[i])
		intSlice[i] = intTmp
	}

	return intSlice
}

func main() {
	rdr := bufio.NewReaderSize(os.Stdin, maxBufsize)
	line0 := inputs(1, rdr)

	line0Int := DivideConvertInt(line0[0], 3)

	N := line0Int[0]
	M := line0Int[1]
	X := line0Int[2]

	A := make([][]int, N)
	C := make([]int, N)
	for i := 0; i < N; i++ {
		A[i] = make([]int, M)

		line := inputs(1, rdr)

		lineInt := DivideConvertInt(line[0], M+1)

		C[i] = lineInt[0]

		for j := 1; j < M+1; j++ {
			A[i][j-1] = lineInt[j]
		}

	}

	ans := -1
	for bits := 0; bits < (1 << uint(N)); bits++ {
		score := make([]int, M)

		counts := 0
		for i := 0; i < N; i++ {
			if (bits>>uint(i))&1 == 1 {
				for j := 0; j < M; j++ {
					score[j] += A[i][j]
				}
				counts += C[i]
			}
		}

		flag := true

		for j := 0; j < M; j++ {
			if score[j] < X {
				flag = false
			}
		}

		if flag {
			if ans == -1 || ans > counts {
				ans = counts
			}
		}
	}

	fmt.Println(ans)
}


Measured memory_bytes: 6132
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll md = 1e9+7;
const ll mx = 1e6;
vector<ll> fact(2*mx+1);
vector<ll> invfact(mx+1);

ll mul(ll a, ll b)
{
	return (((a * b) % md) + md) %md;
}

ll pow(ll a, ll b)
{
	if (b == 0)
	{
		return 1LL;
	}
	ll ans = pow(a,b/2);
	ans = mul(ans, ans);
	if (b % 2 == 1)
	{
		ans = mul(ans, a);
	}
	return ans;
}

ll lad(ll a, ll b)
{
	return (((a+b) % md) + md)%md;
}

ll choose(ll a, ll b)
{
	return mul(mul(fact[a], invfact[b]), invfact[a-b]);
}

int main()
{
	fact[0] = 1;
	invfact[0] = 1;
	for (ll q = 1; q <= 2*mx; q++)
	{
		fact[q] = mul(fact[q-1], q);
	}
	for (ll q = 1; q <= mx; q++)
	{
		invfact[q] = pow(fact[q], md-2);
	}
	ll inv25 = pow(25LL, md-2);
	ll k;
	string s;
	cin >> k >> s;
	ll t = s.length();
	ll ss = pow(25LL, (ll)k);
	ll s26 = 1;
	ll ans = 0;
	for (ll q = 0; q <= k; q++)
	{
		ans = lad(ans, mul(choose(k+t-q-1, t-1), mul(ss, s26)));
		ss = mul(ss, inv25);
		s26 = mul(s26, 26);
	}
	cout << ans << "\n";
	return 0;
}



Measured memory_bytes: 28764
#include <iostream>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#include <climits>
#include <set>
using namespace std;
#define repn(i,s,n) for (int i=int(s); i < int(n); i++)
#define rep(i,n) repn(i,0,n)
#define repd(i,n) for (int i=int(n)-1; i >= 0; i--)
#define all(c) (c).begin(), (c).end()


int main() {
  int n;
  cin >> n;
  struct Friend {
    int a, b;
  };
  vector<Friend> fs(n);
  rep(i, n) cin >> fs[i].a >> fs[i].b;

  auto fs_a = fs;
  auto fs_b = fs;
  sort(all(fs_a), [](const Friend& a, const Friend& b) { return a.a < b.a; });
  sort(all(fs_b), [](const Friend& a, const Friend& b) { return a.b < b.b; });

  int num_can_take = 0;
  const int MAX_N = 100000;
  int fs_a_idx = 0;
  int fs_b_idx = 0;
  int ans = 0;

  rep(num_take, MAX_N+1) {
    while (fs_a_idx < n && fs_a[fs_a_idx].a-1 <= num_take) {
      fs_a_idx++;
      num_can_take++;
    }
    while (fs_b_idx < n && fs_b[fs_b_idx].b-1 < num_take) {
      fs_b_idx++;
      num_can_take--;
    }
    if (num_can_take >= num_take) ans = num_take;
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 3372
from sys import stdin, stdout
rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()

def main():
	n = int(rl())
	ans = 0
	for i in range(1, n + 1):
		if i % 3 != 0 and i % 5 != 0:
			ans += i 
	stdout.write(str(ans));stdout.write("\n")
	stdout.close()

if __name__ == "__main__":
	main()

Measured memory_bytes: 72612
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
// #define endl "\n"
#define MOD 1000000007
#define _(a, n) ((((a) % (n)) + (n)) % (n))

ll recurse(ll i, ll rem, bool restrict, const string& num, ll d, vector<vector<vector<ll>>>& dp) {
    ll n = num.length();
    if (dp[i][rem][restrict] != -1) {
        return dp[i][rem][restrict];
    }
    ll count = 0;
    ll up = (restrict ? num[i] - '0' : 9);
    if (i == n-1) {

        for (ll j = 0; j <= up; j++) {
            count += (_(j, d) == rem);
        }
        return dp[i][rem][restrict] = count;
    }

    for (ll j = 0; j <= up; j++) {
        ll newrem = _(rem -j, d);
        count = (count + recurse(i+1, newrem, restrict && j == up, num, d, dp)) % MOD;
    }
    return dp[i][rem][restrict] = count;



}

int main(void) {
    // ios_base::sync_with_stdio(false);
    // cin.tie(NULL);
    // cout.tie(NULL);
    string k;
    ll d;
    cin >> k >> d;
    vector<vector<vector<ll>>> dp (k.length(), vector<vector<ll>> (d, vector<ll> (2, -1)));
    cout << _(recurse(0, 0, true, k, d, dp) - 1, MOD) << endl;




    
    return 0;
}

Measured memory_bytes: 59548
#include <iostream>
#include <algorithm>
#include <vector>
#include <list>
#include <string>
#include <cstdlib>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstring>
#include <climits>

using namespace std;

typedef long long ll;
typedef vector<int> veci;

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


Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<vector>
#include<queue>
using namespace std;
int gi(){
	int x=0,w=1;char ch=getchar();
	while((ch<'0'||ch>'9')&&ch!='-')ch=getchar();
	if(ch=='-')w=0,ch=getchar();
	while(ch>='0'&&ch<='9')x=(x<<3)+(x<<1)+ch-'0',ch=getchar();
	return w?x:-x;
}
#define mk make_pair
int n,m,q,dis[8][8],inf;char s[100005],t[100005];
vector<int>vec[4];queue<pair<int,int> >Q;
void add(int i,int x,vector<int>&v){
	int sz=vec[i].size(),p=lower_bound(vec[i].begin(),vec[i].end(),x)-vec[i].begin();
	if(p)v.push_back(vec[i][p-1]);if(p<sz)v.push_back(vec[i][p]);
}
void upt(int x,int y,int z){
	if(dis[x][y]>z)dis[x][y]=z,Q.push(mk(x,y));
}
int main(){
	n=gi();m=gi();q=gi();scanf("%s%s",s+1,t+1);
	for(int i=1;i<=n;++i)vec[s[i]=='W'?0:1].push_back(i);
	for(int i=1;i<=m;++i)vec[t[i]=='N'?2:3].push_back(i);
	while(q--){
		int a=gi(),b=gi(),c=gi(),d=gi();vector<int>X,Y;
		for(int i=0;i<2;++i)add(i,a,X),add(i,c,X);
		for(int i=2;i<4;++i)add(i,b,Y),add(i,d,Y);
		sort(X.begin(),X.end());X.erase(unique(X.begin(),X.end()),X.end());
		sort(Y.begin(),Y.end());Y.erase(unique(Y.begin(),Y.end()),Y.end());
		int lx=X.size(),ly=Y.size();
		int sx=lower_bound(X.begin(),X.end(),a)-X.begin();
		int sy=lower_bound(Y.begin(),Y.end(),b)-Y.begin();
		int tx=lower_bound(X.begin(),X.end(),c)-X.begin();
		int ty=lower_bound(Y.begin(),Y.end(),d)-Y.begin();
		memset(dis,63,sizeof(dis));inf=dis[0][0];dis[sx][sy]=0;Q.push(mk(sx,sy));
		while(!Q.empty()){
			int x=Q.front().first,y=Q.front().second;Q.pop();
			if(s[X[x]]=='W')for(int z=y-1;z>=0;--z)upt(x,z,dis[x][y]+Y[y]-Y[z]);
			else for(int z=y+1;z<ly;++z)upt(x,z,dis[x][y]+Y[z]-Y[y]);
			if(t[Y[y]]=='N')for(int z=x-1;z>=0;--z)upt(z,y,dis[x][y]+X[x]-X[z]);
			else for(int z=x+1;z<lx;++z)upt(z,y,dis[x][y]+X[z]-X[x]);
		}
		printf("%d\n",dis[tx][ty]==inf?-1:dis[tx][ty]);
	}
	return 0;
}


Measured memory_bytes: 2768
h,w = gets.split.map {|n| n.to_i}
until h == 0 && w == 0
  for i in 1..h
    for j in 1..w
      print "#"
    end
    print "\n"
  end
  print "\n"
  h,w = gets.split.map {|n| n.to_i}
end

Measured memory_bytes: 6104
let abk = stdin.ReadLine().Split() |> Array.map int64
let (a, b, k) = (abk.[0], abk.[1], abk.[2])
let (afterA, afterB) = if a < k then (0L, max 0L (b + a - k)) else (a - k, b)
printf "%d %d" afterA afterB


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

int main(void) {
  char s[5];
  fgets(s, 5, stdin);
  int ans = 0;
  for (int i = 0; i < 4; i++) {
    if (s[i] == '\0') {
      break;
    }
    if (s[i] == '+') {
      ans += 1;
    } else {
      ans -= 1;
    }
  }
  printf("%d",ans);
}


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

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(),v.end()
#define _GLIBCXX_DEBUG
int main() {
    int d,g;
    cin>>d>>g;
    pair<int,int> v[1+d];
    rep(i,d){
        int p,c;
        cin>>p>>c;
        v[i+1]=make_pair(p,c);
    }
    int ans=100000;
    for (int i=0;i<(1<<d);i++){
        int ans1=0;
        bitset<10> s(i);
        int g1=g;
        for (int j=0;j<d;j++){
            if (s.test(j)){
                g1-=(j+1)*100*v[j+1].first+v[j+1].second;
                ans1+=v[j+1].first;
            }
        }
        if (g1<=0){
            ans=min(ans,ans1);
        }
        else{
            for (int j=d-1;j>=0;j--){
                if (s.test(j)==0){
                    if (g1>=(j+1)*100*v[j+1].first){
                        break;
                    }
                    else{
                        if (g1%((j+1)*100)==0){
                            ans1+=g1/((j+1)*100);
                        }
                        else{
                            ans1+=g1/((j+1)*100)+1;
                        }
                        ans=min(ans,ans1);
                        break;
                    }

                }
            }
            
        }



    }
    cout<<ans<<endl;


    return 0;
}

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

#define repeat(i, x) for (int64_t i = 0; (i) < (int64_t)(x); (i)++)

const int64_t mod = 1e9 + 7;

int64_t dp[100005][4];

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

    string s;
    cin >> s;

    const string abc = "ABC";
    dp[0][0] = 1;
    repeat (i, s.size()) {
        repeat (j, 4) {
            if (dp[i][j] == 0) continue;

            for (char c : {'A', 'B', 'C'}) {
                if (s[i] != '?' and s[i] != c) continue;

                if (j < 3 and c == abc[j]) (dp[i + 1][j + 1] += dp[i][j]) %= mod;
                (dp[i + 1][j] += dp[i][j]) %= mod;
            }
        }
    }
    cout << dp[s.size()][3] << endl;

    return 0;
}


Measured memory_bytes: 3664
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repp(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define repm(i,n) for(int (i)=(n-1);(i)>=0;(i)--)
#define INF (1ll<<60)
#define all(x) (x).begin(),(x).end()
typedef long long lint;
const lint MOD =1000000007;
const lint MAX = 10000000;
using Graph =vector<vector<lint>>;
typedef pair<lint,lint> P;
 
 
lint fac[MAX], finv[MAX], inv[MAX];
 
void COMinit() 
{
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (lint i = 2; i < MAX; i++)
    {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
 
long long COM(lint n, lint k)
{
    if (n < k)
        return 0;
    if (n < 0 || k < 0)
        return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
 
lint primary(lint num)
{
    if (num < 2) return 0;
    else if (num == 2) return 1;
    else if (num % 2 == 0) return 0;
 
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return 0;
        }
    }
 
    return 1;
}
   long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
    lint lcm(lint a,lint b){
        return a/__gcd(a,b)*b;
    }

        
  int main(){
      lint n,q;
      string s;
      lint a[]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
      cin>>n;

      cout<<a[n-1];
  }

  
     
  

Measured memory_bytes: 764
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#define R register
typedef long long ll;
namespace IO{
	char buf[1<<15],*S,*T;
	inline char gc(){
		if (S==T){
			T=(S=buf)+fread(buf,1,1<<15,stdin);
			if (S==T) return EOF;
		}return *S++;
	}
	inline int read(){
		R int x; R bool f; R char c;
		for (f=0; (c=gc())<'0'||c>'9'; f=c=='-');
		for (x=c^'0'; (c=gc())>='0'&&c<='9'; x=(x<<1)+(x<<3)+(c^'0'));
		return f?-x:x;
	}
}
int n,a[100005],L;
int main(){
	n=IO::read(),L=IO::read();for (R int i=1; i<=n; ++i) a[i]=IO::read();
	for (R int i=1; i<n; ++i)
		if (a[i]+a[i+1]>=L){
			puts("Possible");
			for (R int j=1; j<i; ++j) 
				printf("%d\n",j);
			for (R int j=n; --j>i; )
				printf("%d\n",j);
			printf("%d\n",i);
			return 0;
		}puts("Impossible");return 0;
}

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

int main(){
    int n; cin >> n;
    vector<ll> lis(n);
    ll sum = 0, count = 0, ans = 1000000000000;
    for(int i = 0; i < n; i++){
        cin >> lis[i];
        sum += lis[i];
    }
    for(int i = 0; i < n-1; i++){
        count += lis[i];
        ans = min(abs(sum - 2*count), ans);
    }
    cout << ans << endl;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define meow(args...) fprintf(stderr, args)
template<class T1, class T2> inline bool cmin(T1 &a, const T2 &b) {return b<a?(a=b, true):false;}
template<class T1, class T2> inline bool cmax(T1 &a, const T2 &b) {return a<b?(a=b, true):false;}
template<class Type> Type read() {
	Type a;
	bool b;
	unsigned char c;
	while(c=getchar()-48, (c>9)&(c!=253));
	for(a=(b=c==253)?0:c; (c=getchar()-48)<=9; a=a*10+c);
	return b?-a:a;
}
auto rd=read<int>;

const int N=2000;
int n, m, src, arg, par[N][N], mark[N][N], ans;
std::vector<int> tr[N];
std::vector<std::pair<int, int>> list;
void predfs(int u) {
	for(int v: tr[u])
		if(v!=par[src][u]) {
			par[src][v]=u;
			predfs(v);
		}
}
void dfs(int u) {
	mark[src][u]=arg;
	for(int v: tr[u])
		if(v!=par[src][u])
			if(~mark[src][v]) list.emplace_back(arg, v); else dfs(v);
}
void sol(int u, int p, int b) {
	if(mark[b][u]==u) ++ans, b=u;
	for(int v: tr[u]) if(v!=p) sol(v, u, b);
}
int main() {
	n=rd(), m=rd();
	for(int i=1; i<n; ++i) {
		int u=rd()-1, v=rd()-1;
		tr[u].push_back(v);
		tr[v].push_back(u);
	}
	for(src=0; src<n; ++src) par[src][src]=-1, predfs(src);
	for(int i=0; i<n; ++i) memset(mark[i], -1, n*sizeof(int));
	while(m--) {
		int u=rd()-1, v=rd()-1;
		list.emplace_back(u, v);
		while(!list.empty()) {
			u=list.back().first, v=list.back().second;
			list.pop_back();
			while(u!=v&&~mark[u][v]) u=mark[u][v];
			while(u!=v&&~mark[v][u]) v=mark[v][u];
			if(u==v) continue;
			src=u, dfs(arg=v);
			src=v, dfs(arg=u);
		}
	}
	for(int i=0; i<n; ++i) for(int j: tr[i]) sol(j, i, i);
	printf("%d\n", ans/2);
	return 0;
}


Measured memory_bytes: 31744