akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main(void) {
  int a, b, c, x;
  cin >> a >> b >> c >> x;

  int ans = 0;

  for (int i = 0; i <= a; i++) {
    for (int j = 0; j <= b; j++) {
      for (int k = 0; k <= c; k++) {
        int total = 500 * i + 100 * j + 50 * k;
        if (total == x) ans++;
      }
    }
  }

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

Measured memory_bytes: 256
#include<iostream>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<limits>
#include<sstream> 
#include<unordered_map>      

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;

const int inf = numeric_limits<int>::max() >> 2;
const ll linf = numeric_limits<ll>::max() >> 2;
const ull ulinf = numeric_limits<ull>::max() >> 2;
const double pi = acos(-1);
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const int dx8[8]={-1,0,1,-1,1,-1,0,1};
const int dy8[8]={-1,-1,-1,0,0,1,1,1};

#define p_queue(i) priority_queue<i> 
#define rp_queue(i) priority_queue<i, vector<i>, greater<i>> 
#define umap(i,j) unordered_map<i,j>
#define P(p) cout<<(p)<<endl
#define PS(p) cout<<(p)<< " "
#define PN cout << endl
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rrep(i,m,n) for(int i = (n-1); i >= (int)(m); i--)
#define inrep(n,a) for(int i = 0; i < (int)(n); i++)cin >> a[i];
#define mod(i) ((i)%(ll)(1e9 + 7))
#define divm(a,b) (mod(a * modpow((ll)b,(ll)(1e9+5))))
#define rsort(a,b,c) sort(a, b, greater<c>())
#define vsort(v) sort(v.begin(), v.end())
#define rvsort(v,c) sort(v.begin(), v.end(), greater<c>()) 
#define ft first
#define sd second
#define pb push_back
#define it insert
#define sz(x) ((int)(x).size())
#define lb(a,n,k) (lower_bound(a,a+n,k) - (a)) 
#define vlb(a,k)  (lower_bound(a.begin(),a.end(),k) - a.begin())
#define ub(a,n,k) (upper_bound(a,a+n,k) - (a)) 
#define vub(a,k)  (upper_bound(a.begin(),a.end(),k) - a.begin())
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define ret return

/*
ll modpow(ll i,ll j){ ll tmp=1; while(j){ if(j%2)tmp=mod(tmp*i);i=mod(i*i);j/=2;}return tmp;}
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; }
*/

/*
vector<string> split(const string &str, char sep){
    vector<string> v;
    stringstream ss(str);
    string buffer;
    while( getline(ss, buffer, sep) ) {
        v.push_back(buffer);
    }
    return v;
}
*/

/*
ll ncr[100][100];
ll nCr(int n, int r){if(n==r) ret ncr[n][r] = 1; if(r==0) ret ncr[n][r] = 1; if(r==1) ret ncr[n][r] = n;if(ncr[n][r]) ret ncr[n][r]; ret ncr[n][r] = nCr(n-1,r) + nCr(n-1,r-1);}

ll npr[100][100]={};
ll nPr(int n,int r){if(npr[n][r])ret npr[n][r];if(r==0)ret npr[n][r] = 1;if(r==1)ret npr[n][r] = n;ret npr[n][r] = n * nPr(n-1,r-1);}

ll nHr(int n,int r){ret nCr(n+r-1,r);}
*/

///////////////////////////////////////////////////////////////////////////



int main(){
    
    ll n;
    cin >> n;
    
    if(n&1){
	P(0);
   
    }else{
	ll ans = 0;
	n >>= 1;
	ll t = 5;
	
	while(n >= t){
	    ans += n/t;
	    t *= 5;
	}
	P(ans);
    }
    return  0;
}


Measured memory_bytes: 256
def getlist():
	return list(map(int, input().split()))

#受け取りなど
H, W, D = getlist()
a = []
mp = [0] * (H * W + 1)
for i in range(H):
	A = getlist()
	for j in range(W):
		a.append([A[j], i, j])

#前計算
a = sorted(a)
for i in range(D, H * W):
	mp[i] += mp[i - D] + abs(a[i][1] - a[i - D][1]) + abs(a[i][2] - a[i - D][2])

#計算
Q = int(input())
for i in range(Q):
	L, R = getlist()
	print(mp[R - 1] - mp[L - 1])

Measured memory_bytes: 20024
#include<bits/stdc++.h>
using namespace std;
 
const int N = 1e5 + 9;
 
unordered_set<int>r[N], b[N];
using pii = pair<int, int>;
queue<pii>Q;
int n, f[N];
int find (int x) { while (x != f[x]) x = f[x] = f[f[x]]; return x; }
 
int main () {
	scanf("%d", &n);
	for (int i = 1; i <= n; ++i) f[i] = i;
	for (int i = 1, u, v; i < n; ++i) scanf("%d%d", &u, &v), b[u].insert(v), b[v].insert(u);
	for (int i = 1, u, v; i < n; ++i) {
		scanf("%d%d", &u, &v), r[u].insert(v), r[v].insert(u);
		if (b[u].count(v)) Q.push(pii(u, v)); 
	} 
	for (int i = 1, x, y; i < n; ++i) {
		if (Q.empty()) return puts("NO"), 0;
		x = find(Q.front().first); y = find(Q.front().second); Q.pop();
		if (x == y) { --i; continue ; }
		r[x].erase(y); r[y].erase(x); b[x].erase(y); b[y].erase(x);
		if (r[x].size() > r[y].size()) x ^= y ^= x ^= y;
		f[x] = y;
		for (auto v : r[x]) if (b[y].count(v)) Q.push(pii(v, y));
		for (auto v : b[x]) if (r[y].count(v)) Q.push(pii(v, y));
		for (auto v : r[x]) r[y].insert(v), r[v].erase(x), r[v].insert(y);
		for (auto v : b[x]) b[y].insert(v), b[v].erase(x), b[v].insert(y);
	}
	return puts("YES"), 0;
}

Measured memory_bytes: 34048
import java.util.*;

// ABC 27-C
// http://abc027.contest.atcoder.jp/tasks/abc027_c
 
public class Main {
	
	static long count = 0;
	
	public static void main (String[] args) throws java.lang.Exception {
		Scanner in = new Scanner(System.in);
		
		int a = in.nextInt();
		int b = in.nextInt();
		int c = in.nextInt();
		
		solve(a, b, c);
		System.out.println(count);
	}
	
	public static void solve(int a, int b, int c) {
		if (a % 2 == 1 || b % 2 == 1 || c % 2 == 1) {
			return;
		}
		if (a == b && b == c && a == c) {
			count = -1;
		} else {
			count++;
			solve(b / 2 + c / 2, a / 2 + c / 2, a / 2 + b / 2);
		}
	}
}

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

#define FOR(i, min, max) for (int i = (min); i < (max); ++i) 
#define FORE(i, min, max) for (int i = (min); i <= (max); ++i) 
#define REP(i, n) for (int i = 0; i < (n); ++i) 
#define REPV(vec, i) for (int i = 0; i < (int)(vec.size()); ++i) 
#define FOR_EACH(vec, it) for (typeof((vec).begin()) it = (vec).begin(); it != (vec).end(); ++it)

using namespace std; 
static const double EPS = 1e-12; 
typedef long long ll; 

int main(void)
{
    int N;
    cin >> N;
    string S;
    cin >> S;
    int R = 0;
    int G = 0;
    int B = 0;
    REP(i, N) {
        if (S[i] == 'R') R++;
        else if (S[i] == 'G') G++;
        else B++;
    }

    ll ret = (ll)R * G * B;
    FORE(l, 1, N) {
        REP(i, N) {
            int j = i+l;
            int k = j+l;
            if (j < N && k < N) {
                if (S[i] != S[j] && S[i] != S[k] && S[j] != S[k])
                    --ret;
            }
        }
    }
    cout << ret << endl;
    
    return 0;
}


Measured memory_bytes: 3516
#include <bits/stdc++.h>
#define fi first
#define se second
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define space putchar(' ')
#define enter putchar('\n')
#define eps 1e-10
#define MAXN 200005
//#define ivorysi
using namespace std;
typedef long long int64;
typedef unsigned int u32;
typedef double db;
template<class T>
void read(T &res) {
    res = 0;T f = 1;char c = getchar();
    while(c < '0' || c > '9') {
        if(c == '-') f = -1;
        c = getchar();
    }
    while(c >= '0' && c <= '9') {
        res = res * 10 +c - '0';
        c = getchar();
    }
    res *= f;
}
template<class T>
void out(T x) {
    if(x < 0) {x = -x;putchar('-');}
    if(x >= 10) {
        out(x / 10);
    }
    putchar('0' + x % 10);
}
const int MOD = 1000000007;
int fac[MAXN],invfac[MAXN],N,X,Y;
int vp[MAXN],fa[MAXN],id[MAXN];
pii c[MAXN];
int inc(int a,int b) {
    return a + b >= MOD ? a + b - MOD : a + b;
}
int mul(int a,int b) {
    return 1LL * a * b % MOD;
}
void update(int &x,int y) {
    x = inc(x,y);
}
int fpow(int x,int c) {
    int res = 1,t = x;
    while(c) {
        if(c & 1) res = mul(res,t);
        t = mul(t,t);
        c >>= 1;
    }
    return res;
}
int getfa(int x) {
    return fa[x] == x ? x : fa[x] = getfa(fa[x]);
}
void Solve() {
    read(N);read(X);read(Y);
    for(int i = 1 ; i <= N ; ++i) {
        read(c[i].se);read(c[i].fi);
    }
    sort(c + 1,c + N + 1);
    int sec = 2;
    while(sec <= N && c[sec].se == c[1].se) ++sec;
    if(sec > N) {puts("1");return;}
    for(int i = N ; i >= 1 ; --i) {
        vp[c[i].se] = i;
        fa[i] = i;
    }
    for(int i = N ; i >= 1 ; --i) {
        if(i != vp[c[i].se] && c[i].fi + c[vp[c[i].se]].fi <= X) {
            fa[getfa(i)] = getfa(vp[c[i].se]);
        }
        else if(c[i].se != c[1].se && c[i].fi + c[1].fi <= Y) {
            fa[getfa(i)] = getfa(1);
        }
        else if(c[i].se != c[sec].se && c[i].fi + c[sec].fi <= Y) {
            fa[getfa(i)] = getfa(sec);
        }
    }
    fac[0] = 1;
    for(int i = 1 ; i <= N ; ++i) fac[i] = mul(fac[i - 1],i);
    invfac[N] = fpow(fac[N],MOD - 2);
    for(int i = N - 1 ; i >= 0 ; --i) invfac[i] = mul(invfac[i + 1],i + 1);
    int siz = 0;
    for(int i = 1 ; i <= N ; ++i) {
        if(getfa(i) == getfa(1)) {
            id[c[i].se]++;
            ++siz;
        }
    }
    int ans = fac[siz];
    for(int i = 1 ; i <= N; ++i) {
        ans = mul(ans,invfac[id[i]]);
    }
    out(ans);enter;
}
int main() {
#ifdef ivorysi
    freopen("f1.in","r",stdin);
#endif
    Solve();
}

Measured memory_bytes: 5760
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e16;
const ll mod = 1000000007;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

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 ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return 0;
}
ll factorial(ll n) {
  if (n == 1) {
    return 1;
  }
  ll ans = factorial(n-1);
  return ans*n;
}
ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a%b);
}
ll lcm(ll a, ll b) {
  return (a/gcd(a, b))*b;
}
bool is_prime(ll n) {
  for (ll i = 2; i*i <= n; i++) {
    if (n%i == 0) return false;
  }
  return n != 1;
}
ll mod_pow(ll x, ll n, ll mod) {
  if (n == 0) return 1;
  ll res = mod_pow(x*x%mod, n/2, mod);
  if (n & 1) res = res * x % mod;
  return res;
}

int main() {
  ll n;
  cin >> n;
  ll tmp = 1;
  while ((ll)pow(2, tmp) <= n) tmp++;
  cout << (ll)pow(2, tmp-1) << endl;
}


Measured memory_bytes: 3280
#include <stdio.h>
#include<string.h>



int main(){
  int a=0,b=0,c=0,d=0;

  char line[8];
  int n;
  fgets(line,8,stdin);
  sscanf(line,"%d",&n);
  char input[256];
  for(int i=0;i<n;i++){
    scanf("%s",input);

    if(strcmp(input,"AC") == 0){
      a++;
    }else if(strcmp(input,"WA") == 0){
      b++;
    }else if(strcmp(input,"TLE") == 0){
      c++;
    }else if(strcmp(input,"RE")==0){
      d++;
    }
  }

    printf("AC x %d\n",a );
    printf("WA x %d\n",b );
    printf("TLE x %d\n",c );
    printf("RE x %d\n",d );

    return 0;
  }


Measured memory_bytes: 1736
n=int(input())
ans=[]
b=["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"]
num=0
keta=0
for i in range(100):
    if num >= n:
        keta = i
        break
    num = 26**(i+1)+num
num  = num - 26**keta
n = n - num -1 
for i in range(keta):
    ans.append(b[n%26])
    n=n//26
ans.reverse()
print(''.join(ans))


Measured memory_bytes: 61964
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <stack>
#include <cassert>
#include <map>
#include <numeric>
#include <cstring>
#include <set>
#include <ctime>
#include <queue>
#include <cmath>
#include <iomanip>
#include <iterator>

using namespace std;

clock_t timeStart, timeFinish;

void timeBegin() {
    timeStart = clock();
}

void timeEnd() {
    timeFinish = clock();
}

void timeDuration() {
    double time_taken = double(timeFinish - timeStart) / double(CLOCKS_PER_SEC);
    cout << "Time taken by program is : " << fixed << time_taken << setprecision(5);
    cout << " sec " << endl;
}

class InputReader {
public:
    InputReader() {
        input_file = stdin;
        cursor = 0;
        fread(buffer, SIZE, 1, input_file);
    }
    InputReader(const char *file_name) {
        input_file = fopen(file_name, "r");
        cursor = 0;
        fread(buffer, SIZE, 1, input_file);
    }
    inline InputReader &operator >>(int &n) {
        while((buffer[cursor] < '0' || buffer[cursor] > '9') && buffer[cursor] != '-') {
            advance();
        }
        int sign = 1;
        if (buffer[cursor] == '-') {
            sign = -1;
            advance();
        }
        n = 0;
        while('0' <= buffer[cursor] && buffer[cursor] <= '9') {
            n = n * 10 + buffer[cursor] - '0';
            advance();
        }
        n *= sign;
        return *this;
    }
private:
    FILE *input_file;
    static const int SIZE = 1 << 17;
    int cursor;
    char buffer[SIZE];
    inline void advance() {
        ++ cursor;
        if(cursor == SIZE) {
            cursor = 0;
            fread(buffer, SIZE, 1, input_file);
        }
    }
};

const int MAXN = 100000;
const long long INF = 1000000000000000000;

long long v[1 + MAXN], limit[1 + MAXN];

int main() {
    timeBegin();
    //ifstream cin("input.in");
    //ofstream cout("papagali.out");
    int n;
    cin >> n;
    for (int i = 0; i <= n; i++) {
        cin >> v[i];
    }
    if (n == 0) {
        if (v[0] == 1) {
            cout << "1\n";
        } else {
            cout << "-1\n";
        }
    } else {
        if (v[0] != 0) {
            cout << "-1\n";
        } else {
            limit[0] = 1;
            for (int i = 1; i <= n; i++) {
                limit[i] = min(INF, 2 * (limit[i - 1] - v[i - 1]));
                if (v[i] > limit[i]) {
                    cout << "-1\n";
                    return 0;
                }
            }
            long long answer = 0, internal = 0;
            for (int i = n; i >= 0; i--) {
                answer += v[i] + internal;
                internal = min(internal + v[i], limit[i - 1] - v[i - 1]);
            }
            cout << answer << "\n";
        }
    }
    //timeDuration();
    return 0;
}

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

using ll = long long;
#define rep(n, i) for(ll i = 0; i < n; ++i)

const ll limit = 1e18;
void solve(void){
  ll n; cin >> n;
  vector<ll> a(n, 0);
  rep(n, i) cin >> a[i];

  if (*min_element(a.begin(), a.end()) <= 0) {
    cout << 0 << endl;
    return;
  }

  ll res = 1;
  rep(n, i) {
    if (a[i] <= limit / res) res *= a[i];
    else {
      cout << -1 << endl;
      return;
    }
  }
  cout << res << endl;
}

int main(void) {
  solve();
  return 0;
}


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

int main()
{
ll x , y ;
cin >> x >> y ;
ll a , b , c ;
cin >> a >> b >> c ;
vector<ll> p(a);
rep(i, a){
  cin >> p[i];
}
vector<ll> q(b);
rep(i, b){
  cin >> q[i];
}
vector<ll> r(c);
rep(i, c){
  cin >> r[i];
}
sort(p.begin(),p.end(), greater<ll>());
sort(q.begin(),q.end(), greater<ll>());
sort(r.begin(),r.end(), greater<ll>());
ll an=0;
ll xitr=x-1;
ll yitr=y-1;
rep(i,x){
  an+=p[i];
}
rep(i,y){
  an+=q[i];
}
ans=an;
rep(i,c){
  an+=r[i];
  if(xitr==-1){
    an-=q[yitr];
    yitr--;
  }
  else if(yitr==-1){
    an-=p[xitr];
    xitr--;
  }
  else{
    if(p[xitr]>q[yitr]){
      an-=q[yitr];
      yitr--;
    }
    else{
      an-=p[xitr];
      xitr--;
    }
  }
  ans=max(ans,an);
  if(xitr==-1&&yitr==-1)break;
}

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

Measured memory_bytes: 2560
#include<bits/stdc++.h>
#define rep(i,x,y) for(int i=x;i<=y;i++)
using namespace std;
void cmax(int&x,const int&y){x=x>y?x:y;}
void cmin(int&x,const int&y){x=x<y?x:y;}
const int N=1e6+1;
vector<int>d[N];
int cnt[N];
int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	rep(i,1,N-1)for(int j=i;j<N;j+=i)d[j].push_back(i);
	int n;
	cin>>n;
	vector<int>a(n);
	for(auto&i:a)cin>>i;
	for(auto i:a)for(auto x:d[i])++cnt[x];
	bool flag=false;
	int gc=a[0];
	for(auto i:a)gc=__gcd(gc,i);
	rep(i,2,N-1)flag|=cnt[i]>1;
	if(gc==1&&flag==true){
		cout<<"setwise coprime";
		return 0;
	}
	if(gc>1&&flag==true){
		cout<<"not coprime";
		return 0;
	}
	cout<<"pairwise coprime";
	return 0;
}


Measured memory_bytes: 125376
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int top, S[1000];

void push(int x) {
    S[++top] = x;
}

int pop() {
    top--;
    return S[top+1];
}

int main()
{
    int a, b;
    top = 0;
    char s[100];

    while (scanf("%s", &s) != EOF) {
        if (s[0] == '+') {
            b = pop();
            a = pop();
            push(a+b);
        }
        else if (s[0] == '-') {
            b = pop();
            a = pop();
            push(a-b);
        }
        else if (s[0] == '*') {
            b = pop();
            a = pop();
            push(a*b);
        }
        else {
            push(atoi(s));
        }
    }
    printf("%d\n", pop());

    return 0;
}

Measured memory_bytes: 1852
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for(int i=0; i<n; i++) {
    cin >> a[i];
  }
  int ans=0;
  for(int i=0; i<n; i++) {
    if(i%2==0&&a[i]%2==1) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3604
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <unordered_map>
#include <utility>
#include <vector>

using namespace std;

#define ll long long
#define forn(i, n) for (ll i = 0; i < (ll) n; ++i)
#define sz(a) static_cast<int>(a.size())

char buff[(int) 2e6 + 17];
const ll inf = (ll) 1e9 + 7ll;

const int maxn = (int) 2e5 + 17;

int n;
string s;
int ps[maxn];

bool read() {
    if (scanf("%s", buff) != 1)
        return false;

    return true;
}

void solve() {
    s = buff;
    n = sz(s);

    for (int i = 0; i < n - 1; ++i)
        if (s.substr(i, 2) == "AC") {
            printf("Yes\n");
            return ;
        }

    printf("No\n");
}

int main() {
#if SEREZHKA
    freopen("file.in", "r", stdin);
#endif

    while (read())
        solve();

    return 0;
}


Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Scanner;

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

    	int n = Integer.parseInt(sc.next());

    	ArrayList<Integer> a1 = new ArrayList<>();
    	ArrayList<Integer> a2 = new ArrayList<>();

    	for (int i=0; i<n; i++){
    		a1.add(Integer.parseInt(sc.next()));
    	}

    	for (int i=0; i<n; i++){
    		a2.add(Integer.parseInt(sc.next()));
    	}

    	int max_sum = 0;

    	for (int i=0; i<n; i++){
    		int sum = 0;
    		for (int j = 0; j <= i; j++) {
				sum += a1.get(j);
			}
    		for (int j = i; j < n; j++) {
				sum += a2.get(j);
			}
    		if (max_sum < sum){
    			max_sum = sum;
    		}
    	}
    	System.out.println(max_sum);
    }
}

Measured memory_bytes: 23636
#include<iostream>
#include<stdio.h>
//#include <bits/stdc++.h>
#include<vector>
#include<float.h>
#include<iomanip>
#include<algorithm>
#include<string>
#include<cstring>
#include<math.h>
#include<cmath>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include <cassert>
#include <cmath>
#include<cstdint>

#define INF 1e9
#define rep(i,n)for(int i=0;(i)<(int)(n);i++)
#define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
#define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
#define vec(type,n) vector<type>(n)
#define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))
#define ALL(a)  (a).begin(),(a).end()

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using P = pair<int,int>;

vector<int>bitSearch(int bit,int n){
    vector<int>S;
    rep(i,n)if(bit&(1<<i))S.push_back(i);
    return S;
}


int d[3] = {-1,0,1};
int main(){
    string s;cin>>s;
    int n = s.size();
    rep(i,n){
        
        if(s[i]==','){cout<<" ";continue;}
        cout<<s[i];
    }
}



Measured memory_bytes: 256
MOD = 998244353
n, m, k = map(int, input().split())

memo = [0]*n


def com(n, r):
    if n < r or r < 0:
        return 0
    if n-r < r:
        r = n-r
    if r == 0:
        memo[r] = 1
        return memo[r]
    if memo[r] != 0:
        return memo[r]
    X = Y = 1
    for i in range(1, r+1):
        Y = Y*i % MOD
        X = X*(n-i+1) % MOD
        memo[i] = X*pow(Y, MOD-2, MOD)
    return memo[r]


com(n-1, n//2)

ans = 0
for i in range(k+1):
    ans += com(n-1, i)*m*pow(m-1, n-1-i, MOD)
    ans %= MOD
print(ans)


Measured memory_bytes: 13548
dic={}
N=int(input())
for x in map(int,input().split()):
    if dic.get(x,'a')=='a':
        dic[x]=-x+1
    else:
        dic[x]+=1
ans=0
for k,v in dic.items():
    if v<0:
        ans+=k+v
    else:
        ans+=v
print(ans)

Measured memory_bytes: 26104
package main

import (
	"bufio"
	"fmt"
	"os"
)

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	var inning int

	fmt.Scanf("%d", &inning)

	score := make([]int, inning)

	for i := 0; i < inning; i++ {
		var outCount, runnerCount int

		for scanner.Scan() {
			event := scanner.Text()

			// HIT, HOMERUN, OUT
			switch event {
			case "HIT":
				runnerCount++
				if runnerCount > 3 {
					runnerCount--
					score[i]++
				}
			case "HOMERUN":
				score[i] += runnerCount + 1
				runnerCount = 0
			case "OUT":
				outCount++
			}

			if outCount == 3 {
				break
			}
		}
	}

	for _, v := range score {
		fmt.Println(v)
	}
}



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

#define int long long
const int N = 1000005;
const int a[40] = {0,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};

signed main() {
    int n;
    cin>>n;
    cout<<a[n];
}


Measured memory_bytes: 256
import bisect
    
N = int(input())
L = sorted(list(map(int, input().split())))
    
ans = 0
for i in range(N):
    for j in range(i+1, N):
        index = bisect.bisect_left(L, L[i]+L[j])
        ans += index - 1 - j
print(ans)

Measured memory_bytes: 42972
#include <bits/stdc++.h>
using namespace std;
// #define cerr if(false)cerr
#define watch(x) cerr << "\n" << (#x) << " is " << (x) << endl;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll, ll> ii;
typedef vector<vector<ll>> vvll;
typedef vector<pair<ll, ll>> vii;
typedef long double ld;
typedef vector<ld> vld;
typedef vector<vector<ld>> vvld;
typedef vector<bool> vbl;
typedef vector<vbl> mbl;
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define all(s) (s).begin(), (s).end()
const ll MOD = 1e9 + 7;

inline void solve()
{
    string s, t;
    cin >> s >> t;
    ll ans = 0;
    for (int i = 0; i < s.size(); i++)
    {
        if (s[i] != t[i])
            ans++;
    }
    cout << ans << endl;
}

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

    int t = 1;
    // cin >> t;
    while (t--)
        solve();
    return 0;
}

Measured memory_bytes: 3724
# -*- coding:utf-8 -*-

def solve():
    A, B, M = list(map(int, input().split()))
    As = list(map(int, input().split()))
    Bs = list(map(int, input().split()))

    ans = float("inf")
    for i in range(M):
        x, y, c = list(map(int, input().split()))
        tmp = As[x-1] + Bs[y-1] - c
        ans = min(ans, tmp)

    ans = min(ans, min(As)+min(Bs))

    print(ans)


if __name__ == "__main__":
    solve()


Measured memory_bytes: 18736
#include <iostream>
#include <string>
using namespace std;
#define ll long long

int n, a[1000009];
string s;

ll ps(int k)
{
	ll s1 = 0, s2 = 0, rs = 0, ans = 0;
	for (int i = 0; i < s.length(); i++) {
		if (i - k >= 0) {
			if (a[i - k] == 1) {
				rs -= s2;
				s1--;
			}
			else if (a[i - k] == 2) {
				s2--;
			}
		}
		if (a[i] == 1)
			s1++;
		else if (a[i] == 2) {
			s2++; rs += s1;
		}
		else if (a[i] == 3)
			ans += rs;
	}
	return ans;
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	cin >> n >> s;
	for (int i = 0; i < s.length(); i++) {
		if (s[i] == 'D') a[i] = 1;
		else if (s[i] == 'M') a[i] = 2;
		else if (s[i] == 'C') a[i] = 3;
		else a[i] = 0;
	}
	int q;
	cin >> q;
	for (int i = 0; i < q; i++) {
		int k; cin >> k;
		cout << ps(k) << '\n';
	}
	return 0;
}

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

using namespace std ;

int main()
{
// fast input output
    ios_base::sync_with_stdio( false ) ;
    cin.tie( NULL ) ;
    cout.tie( NULL ) ;

    int n ;
    cin >> n ;
    int answer ;

    if( n % 1000 != 0 )
    {
        answer = abs( ( n % 1000 ) - 1000 ) ;
    }
    else
    {
        answer = 0 ;
    }

    cout << answer << endl ;

    return 0 ;
}


Measured memory_bytes: 3636
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.List;
import java.util.Queue;

public class Main {

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

		String str[] = br.readLine().split(" ");
		int n = Integer.parseInt(str[0]);
		int k = Integer.parseInt(str[1]);

		int x[] = new int[n];
		str = br.readLine().split(" ");

		for (int i = 0; i < n; i++) {
			x[i] = Integer.parseInt(str[i]);
		}

		int ans = Integer.MAX_VALUE;
		for (int i = 0; i + k - 1 < n; i++) {
			int left = x[i];
			int right = x[i + k - 1];

			ans = Math.min(ans, Math.min(Math.abs(left), Math.abs(right)) + right - left);
		}

		System.out.println(ans);
	}
}


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

int main() {
	int n, m;
	cin >> n >> m;
	vector<int> a(2 * m), t(n + 1, 0);
	for (int i = 0; i < 2 * m; i++) {
		cin >> a[i];
		t[a[i]]++;
	}
	for (int i = 1; i <= n; i++)
		cout << t[i] << endl;
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#define _USE_MATH_DEFINES
#include <cmath>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <iomanip>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;

#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007; // 998244353;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};

struct IOSetup {
  IOSetup() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    cerr << fixed << setprecision(10);
  }
} iosetup;
/*-------------------------------------------------*/
int main() {
  int n; cin >> n;
  vector<int> a(n), b(n);
  vector<pair<int, int> > sorted_a(n), sorted_b(n);
  REP(i, n) {
    cin >> a[i];
    sorted_a[i] = {a[i], i};
  }
  REP(i, n) {
    cin >> b[i];
    sorted_b[i] = {b[i], i};
  }
  sort(ALL(sorted_a));
  sort(ALL(sorted_b));
  REP(i, n) {
    if (sorted_a[i].first > sorted_b[i].first) {
      cout << "No\n";
      return 0;
    }
  }
  vector<int> pos(n);
  REP(i, n) pos[sorted_a[i].second] = sorted_b[i].second;
  vector<bool> visited(n, false);
  int now = 0;
  visited[now] = true;
  while (true) {
    now = pos[now];
    if (visited[now]) break;
    visited[now] = true;
  }
  REP(i, n) {
    if (!visited[i]) {
      cout << "Yes\n";
      return 0;
    }
  }
  FOR(i, 1, n) {
    if (sorted_a[i].first <= sorted_b[i - 1].first) {
      cout << "Yes\n";
      return 0;
    }
  }
  cout << "No\n";
  return 0;
}


Measured memory_bytes: 3072
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>
#include <sstream>
#include <cstdio>

using namespace std;

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

#define all(v) v.begin(),v.end()
#define INF 1<<30
#define mp
#define pb push_back

#define fi first
#define se second

#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)

typedef vector<int> vi;
typedef vector<vi> vii;
typedef pair<int,int> pii;
typedef vector<pair<int, int> > vp;
typedef vector<string> vs;

typedef long long ll;

int main(){
  while(1){
    int n,m; cin>>n>>m;
    if(n==0) break;
    vii dp(n+1,vi(256,INF));
    vi c(m); rep(i,m) cin>>c[i];
    vi x(n); rep(i,n) cin>>x[i];
    dp[0][128] = 0;
    rep(i,n){
      rep(j,256){
        if(dp[i][j]==INF) continue;
        rep(k,m){
          int y = max(0,min(255,j+c[k]));
          dp[i+1][y] = min(dp[i+1][y],dp[i][j]+(x[i]-y)*(x[i]-y));
        }
      }
    }
    int ans = INF;
    rep(i,256) ans = min(ans,dp[n][i]);
    cout<<ans<<endl;;
  }
  return 0;
}



Measured memory_bytes: 23824
d,g=map(int, input().split())
p=[list(map(int, input().split())) for i in range(d)]
x=[]
for i in range(2**d):
    t=0
    u=0
    v=[]
    for k in range(d):
        v.append(k)
    for j in range(d):
        if ((i>>j)&1):
            t+=p[j][0]*100*(j+1)+p[j][1]
            u+=p[j][0]
            v[j]=0
    if i==0:
        for j in range(d):
            for k in range(p[j][0]):
                if (j+1)*k<g<=(j+1)*(k+1):
                    x.append(j+1)
    if t>=g:
        x.append(u)
    else:
        for l in range(p[max(v)][0]):
            if t+(max(v)+1)* 100*l<g<=t+(max(v)+1)* 100*(l+1):
                x.append(u+l+1)
print(min(x))


Measured memory_bytes: 3064
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<functional>
#include<vector>
#include<queue>
#include<stack>
#include<set>
using namespace std;
#define MOD ((1<<31)-1)
#define f(i,n) for(int i=0;i<int(n);i++)
#define N (300000)
#define M (1000000000)
long long a[N];
long long laz[N];
int sl[N];
int sr[N];
int l[N];
int r[N];
int nx;

//初期化
void init(void){
	f(i, N){
		a[i] = 0;
		laz[i] = 0;
		sl[i] = -1;
		sr[i] = -1;
	}
	l[0] = 0;
	r[0] = M;
	nx = 1;
	return;
}




long long ranchange(int ll, int rr, int k, long long x){
	long long vl, vr;
	if (rr <= l[k] || r[k] <= ll)return 0;
	else if (ll <= l[k] && r[k] <= rr){
		laz[k] += x;
		return (x*(r[k]-l[k]));
	}
	else{
		int mm = (l[k] + r[k]) / 2;
		if (l[k] < rr&&ll < mm){
			if (sl[k] == -1){
				l[nx] = l[k];
				r[nx] = mm;
				sl[k] = nx;
				nx++;
			}
			vl=ranchange(ll, rr, sl[k], x);
		}
		else vl = 0;

		if (mm < rr&&ll < r[k]){
			if (sr[k] == -1){
				l[nx] = mm;
				r[nx] = r[k];
				sr[k] = nx;
				nx++;
			}
			vr=ranchange(ll, rr, sr[k], x);
		}
		else vr = 0;
		a[k] += (vl + vr);
		return (vl + vr);
	}
}


//探索(0<=l<r<=n)範囲は(l<=x<r)初期は(l,r,0)
long long sum_search(int ll, int rr, int k){
	if (laz[k] > 0){
		a[k] += laz[k]*(r[k]-l[k]);
		int mm = (l[k] + r[k]) / 2;
		if (sl[k] == -1){
			l[nx] = l[k];
			r[nx] = mm;
			sl[k] = nx;
			nx++;
		}
		laz[sl[k]] += laz[k];
		if (sr[k] == -1){
			l[nx] = mm;
			r[nx] = r[k];
			sr[k] = nx;
			nx++;
		}
		laz[sr[k]] += laz[k];
		laz[k] = 0;
	}
	
	long long vl, vr;
	if (rr <= l[k] || r[k] <= ll)return 0;
	else if (ll <= l[k] && r[k] <= rr) return a[k];
	else{
		if (sl[k] != -1)vl = sum_search(ll, rr, sl[k]);
		else vl = 0;
		if (sr[k] != -1)vr = sum_search(ll, rr, sr[k]);
		else vr = 0;
		if (sl[k] == -1){
			if (sr[k] == -1){
				a[k] = 0;
			}
			else{
				a[k] = a[sr[k]];
			}
		}
		else{
			if (sr[k] == -1){
				a[k] = a[sl[k]];
			}
			else{
				a[k] = a[sl[k]] + a[sr[k]];
			}
		}
		return (vl+vr);
	}
}


int main(void){
	int q;
	int c, x, y;
	long long k;
	init();
	scanf("%d %d", &c, &q);
	f(qq, q){
		scanf("%d", &c);
		if (c == 0){
			scanf("%d %lld", &x, &k);
			ranchange(x - 1, x, 0, k);
		}
		else if (c == 1){
			scanf("%d %d", &x, &y);
			k = sum_search(x - 1, y, 0);
			printf("%lld\n", k);
		}
	}

	return 0;
}


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

using namespace std;


#define PI 3.14159265
#define int long long



main(){


	int n; cin >> n;

	vector <int> cnt(n);

	int a;

	for(int i = 0; i < n - 1; i++){
		cin >> a; cnt[a - 1]++;
	}

	for(int i = 0; i < n; i++){
		cout << cnt[i] << endl;
	}
	
	
	return 0;
}

Measured memory_bytes: 4764
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <cmath>

using namespace std;

int main()

{
	int n, x, t;
	cin >> n >> x >> t;
	cout << (int) ceil ((float)n / (float)x)*t;
}


Measured memory_bytes: 3620
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
using ll = long long;

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

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

  sort(x.begin(),x.end());

  vector<ll> d(n);
  for(int i=0;i<n;i++){
    d[i] = x[i+1]-x[i];
  }

  ll ans = d[0];
  for(int i=1;i<n;i++){
    ans = gcd(ans,d[i]);
  }

  cout << ans << endl;
}

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

            
int main(int argc, char** argv) {
    int n1, n2;
    scanf("%d", &n1);
    int A[n1+1];
    for(int i=0; i<n1; i++){
        scanf("%d", &A[i]);
    }
    
    scanf("%d", &n2);
    int B[n2];
    for(int i=0; i<n2; i++){
        scanf("%d", &B[i]);
    }
    
    int counter = 0;
    for(int i=0; i<n2; i++){
        A[n1+1] = B[i]; 
        for(int j=0; j<n1; j++)
            if(A[j]==A[n1+1]){ 
                counter++;
                break;
            }
    }
    printf("%d\n", counter);
    return 0;
}


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

using namespace std;
typedef long long ll;
using Pll = pair<ll,ll>;

const ll INF = 1LL<<60;
const ll MOD = 1000000007;

//cout << fixed << setprecision(10);

int main() {
    ll N;
    cin >> N;
    vector<ll> A(N+1);
    for(int i=0;i<N;i++) {
        ll a;
        cin >> a;
        A[a]=i+1;
    }
    ll ans=0;
    set<ll> se = {0,N+1};
    for(int i=1;i<=N;i++){
        ll r,l;
        auto itr = se.lower_bound(A[i]);
        l = *(itr);
        r = *(--itr);
        ans += i*(r-A[i])*(A[i]-l);
        se.insert(A[i]);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 11136
#include <bits/stdc++.h>
#define INF 1e9
#define endl '\n'
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); --i)
#define FORE(i, a, b) for (int i = (a), e = (b); i < e; ++i)
#define RFORE(i, a, b) for (int i = (b)-1, e = (a); i >= e; --i)
#define ALL(x) (x).begin(), (x).end()
#define SORT(c) sort((c).begin(), (c).end())
#define SORTR(c) sort((c).begin(), (c).end(), greater<int>())
using namespace std;
typedef long long ll;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int N;
    cin >> N;
    vector<int> a(N);
    for (int i = 0; i < N; i++) {
        cin >> a.at(i);
    }
    vector<int> c(1e5 + 1, 0);
    for (auto& X : a) {
        if (X - 1 > 0) { ++c.at(X - 1); }
        ++c.at(X);
        ++c.at(X + 1);
    }
    cout << *max_element(ALL(c)) << endl;
}


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

int main(void){
	int a,b;
	int i;

	while(cin >> a >> b){
		i=0;
		a+=b;
		while(a>0){
			a/=10;
			i++;
		}
		cout << i << endl;
	}
	return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
typedef long long ll;
#define M 1000000007

ll power(ll a,ll n){
    ll ans=1;
    while(0<n){
        if(n%2==0){
            a*=a;
            n>>=1;
        }else{
            ans*=a;
            n--;
        }
    }
    return ans;
}

int main(void){
	ll n,p,ans=1;cin>>n>>p;
	if(n==1){cout<<p<<endl;return 0;}
    if(n>=40){cout<<1<<endl;return 0;}
	
	for(int i=2;power(i,n)<=p;i++){
	    while(p%power(i,n)==0){
	        ans*=i;
	        p/=power(i,n);
	    }
	}
	cout<<ans<<endl;
	
	return 0;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline
def main():
    A, B, C, D =map(int, input().split())
    while True:
        C -= B
        if C<=0:
            print("Yes")
            break
        A -= D
        if A <= 0:
            print("No")
            break

if __name__ == '__main__':
    main()

Measured memory_bytes: 9176
#include<bits/stdc++.h>
#define rep(i,n,m) for(int i = (n); i <(m); i++)
#define rrep(i,n,m) for(int i = (n) - 1; i >=(m); i--)
using namespace std;
using ll = long long;

struct edge{int to, from;};

struct UnionFind
{
    vector<int> rank;
    vector<int> parent;
    const int n;
    UnionFind(int _n) :n(_n)
    {
        rank.assign(n, 1);
        parent.assign(n, -1);
    }

    int find(int node)
    {
        assert (node < n);

        if (parent[node] == -1)
            return node;
        else
            return parent[node] = find(parent[node]);
    }

    void unite(int i, int j)
    {
        i = find(i);
        j = find(j);

        if (i == j)
            return;

        if (rank[i] == rank[j])
        {
            parent[j] = i;
            rank[i]++;
        }
        else
        {
            if (rank[i] > rank[j]) swap(i, j);
            parent[j] = i;
        }
    }

    bool is_same(int i, int j)
    {
        return find(i) == find(j);
    }
};

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

    vector<edge> E;
    rep(i, 0, n)
    {
        int k;
        cin >> k;
        rep(j, 0, k)
        {
            int lang;
            cin >> lang;
            --lang;
            edge ee = {i, n+lang};
            E.push_back(ee);
        }
    }

    UnionFind uf(n+m);
    for (edge e: E)
        uf.unite(e.to, e.from);

    bool ans = true;
    rep(i, 0, n)
        ans &= uf.is_same(0, i);

    if (ans)
        cout << "YES" << endl;
    else
        cout << "NO" << endl;
    return 0;
}

Measured memory_bytes: 3700
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

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

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


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


//ここから編集する

int main() {
    int n;
    cin >> n;
    if(n % 10 == 9 || n / 10 == 9){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}


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

long long a, b, c, k;

int main(){
    
    cin >> a >> b >> c >> k;

    long long sum = 0;

    if (k <= a){
        sum = k;
    }
    else if (k <= a+b){
        sum = a;
    }
    else{
        sum = a - (k-(a+b));
    }

    cout << sum << endl;
    return 0;
}

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

int main() {
	int N;
	int K;
	cin >> N;
	cin >> K;
	int x[N];
	int L = N; //初めて0以上
	int J = -1; //初めて0以下

	for (int i = 0; i < N; i++) {
		cin >> x[i];
	}
	for (int i = 0; i < N; i++) {
    		if (x[i] >= 0) {
    		    L = i;
    		    break;
    		}
    }
    for (int i = N-1; i >= 0; i--) {
        if (x[i] <= 0) {
            J = i;
            break;
        }
    }

	int right;
	if (L + K - 1 < N)
	    right = L + K - 1;
	else
	    right = N - 1;

	int min = 2147483640;
	//右端から動かしていく
	for (int i = J; i < right + 1; i++) {
	    //左端が届かない場合
	    if (i - K + 1 < 0) {
	        continue;
	    }
	    int z;
	    if (i == J) {
	        //左端の場合
	        z = -x[i - K + 1];
	    } else if (i == L + K - 1) {
	        //右端の場合
	        z = x[i];
	    } else {
	        int a = 2 * x[i] - x[i - K + 1];
	        int b = -2 * x[i - K + 1] + x[i];
	        if (a > b)
	            z = b;
	        else
	            z = a;
	    }
	    if (z < min)
	        min = z;
	}
	cout << min << endl;
	return 0;
}




Measured memory_bytes: 640
/*
	Solved!
	Time: 05:23:26 PM
	Date: 05-04-2020
*/
#include <bits/stdc++.h>
using namespace std;
 
typedef unsigned long long  ll;
typedef vector<int>         vi;
typedef vector<ll>          vll;

#define ff                  first
#define sf                  scanf
#define pf                  printf
#define ss                  second
#define ppb                 pop_back
#define pb                  push_back
#define MP                  make_pair
#define MAXN                5000005
#define MOD                 100000007
#define inf                 0x3f3f3f3f
#define PI                  (2.0*acos(0.0))
#define INF                 0x3f3f3f3f3f3f3f3f
#define rev(v)              reverse(all(v))
#define all(v)              v.begin(), v.end()
#define __lcm(x, y)         (x * y) / __gcd(x, y)
#define FOR(i, x, y)        for(int i = x; i < y; i++)
#define RFOR(i, x, y)       for(int i = x; i >= y; i--)
#define MEM(arr, val)       memset(arr, val, sizeof(arr));
#define unq(v)              (v).resize(unique(all(v)) - v.begin())
#define READ()              freopen("input.txt", "r", stdin)
#define WRITE()             freopen("output.txt", "w", stdout)
#define si(n)               scanf("%d", &n)
#define sl(n)               scanf("%lld", &n)
#define sii(a, b)           scanf("%d %d", &a, &b)
#define sll(a, b)           scanf("%lld %lld", &a, &b)
#define siii(a, b, c)       scanf("%d %d %d", &a, &b, &c)
#define slll(a, b, c)       scanf("%lld %lld %lld", &a, &b, &c)
#define siiii(a, b, c, d)   scanf("%d %d %d %d", &a, &b, &c, &d)
#define sllll(a, b, c, d)   scanf("%lld %lld %lld %lld", &a, &b, &c, &d)
#define vout(v)             for(int i = 0; i < v.size(); i++) {cout << v[i]; if(i < v.size() - 1) cout << ' '; else cout << endl;}

int main(){
    /*#ifndef ONLINE_JUDGE
        double start = clock(); READ(); WRITE();
    #endif*/
        int n, k; sii(n, k);
        int ans;
        if(n >= 10) ans = k;
        else {
        	ans = 100 * (10 - n) + k;
        }
        cout << ans << endl;


   /* #ifndef ONLINE_JUDGE
        printf("\n>>Runtime: %.10fs\n", (double)(clock() - start) / CLOCKS_PER_SEC);
    #endif*/

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
const ll MOD=1000000007;
const long double PI=3.14159265358979;
const ll MAX=0;

int main() {
  ll n;
  cin>>n;
  ll L[n];
  rep(i,n){
    cin>>L[i];
  }
  ll ans=0;
  rep(i,n){
    for(int j=i+1;j<n;j++){
      for(int k=j+1;k<n;k++){
        if(abs(L[i]-L[j])<L[k]&&L[k]<L[i]+L[j]&&L[i]!=L[j]&&L[j]!=L[k]&&L[k]!=L[i]){
          ans++;
        }
      }
    }
  }
  cout<<ans;
}

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

using namespace std;

using ll = long long;
using Vi = vector<int>;
using Vl = vector<ll>;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

constexpr int I_INF = (1 << 30);
constexpr ll L_INF = (1ll << 62);

//==================================

double dp[305][305][305] = {};

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

    int N;
    cin >> N;
    int nk[3] = {};
    for (int i = 0; i < N; ++i) {
        int ni;
        cin >> ni;
        ++nk[ni - 1];
    }

    dp[0][0][0] = 0.0;

    int k1, k2, k3;
    k1 = 1;
    k2 = k3 = 0;
    while (true) {
        int h = k1 + k2 + k3;
        if (k3 - 1 >= 0) {
            dp[k3][k2][k1] += dp[k3 - 1][k2 + 1][k1] * k3 / h;
        }
        if (k2 - 1 >= 0) {
            dp[k3][k2][k1] += dp[k3][k2 - 1][k1 + 1] * k2 / h;
        }
        if (k1 - 1 >= 0) {
            dp[k3][k2][k1] += dp[k3][k2][k1 - 1] * k1 / h;
        }

        dp[k3][k2][k1] += (double)N / h;

        if (k1 == nk[0] and k2 == nk[1] and k3 == nk[2]) {
            break;
        }

        if (k1 < N - k2 - k3) {
            ++k1;
        }
        else {
            k1 = 0;
            if (k2 < N - k3) {
                ++k2;
            }
            else {
                k2 = 0;
                ++k3;
            }
        }
    }

    cout << setprecision(16) << dp[nk[2]][nk[1]][nk[0]] << endl;

    return 0;
}

Measured memory_bytes: 219392
#include <stdio.h>
#include <algorithm>
using namespace std;

int N,A[100100]; long long S;

int main()
{
	scanf ("%d",&N);
	for (int i=1;i<=N;i++) scanf ("%d",&A[i]);
	for (int i=1;i<=N+1;i++) S += abs(A[i]-A[i-1]);

	for (int i=1;i<=N;i++){
		printf ("%lld\n",S-abs(A[i-1]-A[i])-abs(A[i]-A[i+1])+abs(A[i-1]-A[i+1]));
	}

	return 0;
}

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

int main(){

    int N;
    string S;
    int K;
    cin >> N;
    cin >> S;
    cin >> K;

    for(int i = 0; i < N; i++){
        if(S[i] != S[K-1]){
            S[i] = '*';
        }
    }
    cout << S << endl;
}

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

#define REP(i, x) for (int i = 0; i < (int)(x); 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);

  int N;
  int L[2000];

  cin >> N;
  REP(i, N) { cin >> L[i]; }

  ll result = 0;
  sort(L, L + N);

  for (int i = 0; i < N - 2; ++i) {
    for (int j = i + 1; j < N - 1; ++j) {
      for (int k = j + 1; k < N; ++k) {
        if ((L[i] < L[j] + L[k]) && (L[j] < L[k] + L[i])) {
          if (L[k] < L[i] + L[j]) {
            ++result;
          } else {
            continue;
          }
        }
      }
    }
  }

  cout << result;

  return 0;
}


Measured memory_bytes: 256
while True:
    h,w = map(int, input().split())
    if h == 0 and w == 0:
        break
    div, mod = divmod(w,2)
    p1 = div*'#.' + mod*'#'
    p2 = div*'.#' + mod*'.'
    for i in range(h):
        if i%2 == 0:
            print(p1)
        else:
            print(p2)
    print('')



Measured memory_bytes: 5612
#include<iostream>
using namespace std;
int main(){
	int a, b, c = -1000000, d = 1000000;
	long int e = 0;
	cin >> a;
	for (int i = 0; i < a; i++){
		cin >> b;
		if (c < b)c = b;
		if (d>b)d = b;
		e = e + b;
	}
	cout << d << " " << c<<" " << e<<endl;

		return 0;
}

Measured memory_bytes: 3088
using System;

namespace B
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int r = 0;
            var str = Console.ReadLine();

            foreach(char c in str)
            {
                if(c == 'R')
                {
                    r++;
                }
            }
            if(r > n / 2)
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
        }
    }
}


Measured memory_bytes: 11092