akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <cmath>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <iostream>
#include <random>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include <fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;

using ll = long long;
using vll = vector<ll>;
using pll = pair<ll, ll>;
using qll = queue<ll>;
using vb = vector<bool>;
using mll = map<ll, ll>;
using sll = stack<ll>;
#define REP(i,n) for(ll i(0);(i)<(n);(i)++)
#define rep(i,n) for(ll i(0);(i)<(n);(i)++)
#define ALL(a) a.begin(), a.end()
#define enld endl //* missspell check
const ll INF = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }

void solve(long long N, std::vector<std::string> S){
    set<string> R;
    REP(i, N){
        R.insert(S[i]);
    }
    cout<<R.size()<<endl;
}

int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<std::string> S(N);
    for(int i = 0 ; i < N ; i++){
        std::cin >> S[i];
    }
    solve(N, std::move(S));
    return 0;
}


Measured memory_bytes: 20104
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n) - 1; i >= 0; --i)
#define fin(ans) cout << (ans) << endl
#define STI(s) atoi(s.c_str())
#define mp(p,q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int
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;}
struct io{io(){ios::sync_with_stdio(false);cin.tie(0);}};
const ll MOD = 1000000007;
const double EPS = 1e-9;
const int INF = INT_MAX;
const ll LLINF = 1LL<<60;


int main(void){

    
    int h,w;
    cin>>h>>w;
    int x=0,y=0;
    vs v(h);
    rep(i,h)cin>>v[i];
    while(x<w-1||y<h-1){
        bool ch=false;
        if(v[y][x]!='#'){
            fin("Impossible");
            return 0;
        }
        else if(x<w-1&&v[y][x+1]=='#'){
            v[y][x]='.';
            x++;
            ch=1;
        } else if(y<h-1&&v[y+1][x]=='#'){
            v[y][x]='.';
            y++;
            ch=1;
        }
        if((x==0&&y==0) || (x == w-1 && y == h-1)){
            v[y][x]='.';
            ch=1;
        }
        if(!ch){
            fin("Impossible");
            return 0;
        }
    }
    // rep(i,h){rep(j,w){
    //     cout<<v[i][j]<<" ";
    // }
    //     cout<<endl;
    // }
    rep(i,h)rep(j,w){
        if(v[i][j]=='#'){
            fin("Impossible");
            return 0;
        }
    }
    fin("Possible");

}

Measured memory_bytes: 256
using System;

namespace ABC055B
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            ulong res = 1;
            uint mod = 1000000007;
            for (uint i = 1; i <= N; i++)
            {
                res = (res * i) % mod;
            }

            Console.WriteLine(res);
        }
    }
}


Measured memory_bytes: 11092
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // int64_t

#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))

int get_int(void) {
  int num;
  scanf("%d", &num);
  return num;
}

// <arr[0]> <arr[1]> .. <arr[size-1]>
int fget_array(int *arr, int size) {
    int i;
    for(i = 0; i < size; i++) {
        scanf("%d", &arr[i]);
    }
    return 0;
}

#define NUM_MAX 500000
struct range {
    int start;
    int end;
};
#define INF ((1e+9)+1)

int64_t cnt = 0;
void merge(int *arr, int size, struct range left, struct range right) {
    static int tmp1[NUM_MAX+1];
    static int tmp2[NUM_MAX+1];
    int i;
    // copy
    for(i = left.start; i < left.end; i++) tmp1[i] = arr[i];
    tmp1[i] = INF;
    for(i = right.start; i < right.end; i++) tmp2[i] = arr[i];
    tmp2[i] = INF;
    // int idx = left.start;
    // int ai, bi = right.start;
    // cnt += (right.end - left.start);
    // for(ai = left.start; ai < left.end; ai++) {
    //     for(; bi < right.end; bi++) {
    //         if(tmp1[ai] < tmp2[bi]) break;
    //         arr[idx++] = tmp2[bi];
    //     }
    //     arr[idx++] = tmp1[ai];
    // }
    int k;
    int ai = left.start;
    int bi = right.start;
    for(k = left.start; k < right.end; k++) {
        cnt++;
        if(tmp1[ai] <= tmp2[bi]) {
            arr[k] = tmp1[ai++];
        } else {
            arr[k] = tmp2[bi++];
        }
    }
    return;
}

void merge_sort(int *arr, int size, struct range r) {
#ifdef DEBUG
    printf("merge_sort(%d, %d)\n", r.start, r.end);
#endif
    if(r.start + 1 < r.end) {
        struct range left = (struct range){
            r.start, (r.start+r.end)/2
        };
        struct range right = (struct range){
            (r.start + r.end)/2, r.end
        };
        merge_sort(arr, size, left);
        merge_sort(arr, size, right);
        merge(arr, size, left, right);
    }
}

int main(void) {
    int num = get_int();
    static int arr[NUM_MAX];
    fget_array(arr, num);
    struct range whole = {0, num};
    // in-place sort
    merge_sort(arr, num, whole);

    // presentation
    int i;
    for(i = 0; i < num; i++) {
        printf("%d%c", arr[i], i==(num-1) ? '\n' : ' ');
    }
    printf("%lld\n", cnt);
    return 0;
}


Measured memory_bytes: 7544
#include<iostream>
#include<string>
#include<algorithm>

int n,st,ed,res,c,count;

std::string s;

int dw[200000],db[200000];

int main(){

    std::cin>>n>>s;

    for(int i=0;i<n;i++){
        if(s[i]=='#'){
        st=i;
        break;
        }
    }

    for(int i=n-1;i>=0;i--){
        if(s[i]=='.'){
        ed=i;
        break;
        }
    }

    for(int i=st;i<=ed;i++){
        if(count%2==0)
        db[count/2]++;
        else
        dw[(count-1)/2]++;
        if(i!=n-1){
        if(s[i]!=s[i+1])
        count++;
        }
    }

    if(count%2==1)
    count++;

    count/=2;

    if(count==0){
    res=0;
    goto flag;
    }

    for(int i=0;i<count;i++){
            res+=dw[i];
        }

        c=res;

    for(int i=0;i<count;i++){
        c=c-dw[i]+db[i];
        
        res=std::min(res,c);

    }

    flag:

    std::cout<<res<<std::endl;

    return 0;

}

Measured memory_bytes: 1412
#include <bits/stdc++.h>
#define INF 1000000000
using namespace std;

//=============modpow============================
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;
}
//=================================================

int main()
{
  long long m, n;
  cin >> m >> n;
  long long mod = 1000000007;
  cout << modpow(m, n, mod) << endl;
}



Measured memory_bytes: 3112
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
map<long long int,int>visited;
long long int aa;
int fn(0);
for(int i=0; i<n; ++i)
{
cin>>aa;
if(visited[aa]==1)
fn=1;
visited[aa]=1;
}
if(fn)
cout<<"NO";
else
cout<<"YES";
}


Measured memory_bytes: 12800
/* بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ */
//codeforces
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define FASTIO ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define mp make_pair
#define pb push_back
#define sz(v) ((int)v.size())
#define all(v) v.begin(), v.end()
void parseArray(ll* A,ll n){ for ( ll K = 0; K < n; K++){ cin >> A[K]; } }
ll modInverse(ll a, ll b){ return 1<a ? b - modInverse(b%a, a)*b/a : 1; }
ll gcd(ll a, ll b){ return b?gcd(b, a % b):a; }
ll lcm(ll a, ll b){ return (a*b)/gcd(a, b); }
ld dist(ld x, ld y, ld a, ld b){ return sqrt((x-a)*(x-a) + (y-b)*(y-b)); }
void debug(ll* a, ll n) { for ( ll k = 0; k < n; k++ ){ cerr << a[k] << " ";} cout << "\n"; }
#define PI 3.14159265358979323846
ll modular_power(ll x, ull y, ll p) {  
	ll res = 1;
	x = x % p;
	if (x == 0) return 0;
	while (y > 0) {  
		if (y & 1)  
			res = (res * x) % p;  
		y = y >> 1;
		x = (x * x) % p;  
	}  
	return res;  
}
const ll mod = 1000000007;

int main(){
	FASTIO;
	ll n, m; cin >> n >> m;
	ll ans = modular_power(m, n, mod);
	ll dp[m + 1]; memset(dp, 0, sizeof dp);
	dp[1] = 1;
	for ( ll k = 2; k <= m; k++ ){
		ll div = dp[1];
		for ( ll j = 2; j * j <= k; j++ ){
			if (k % j == 0) {
				div += dp[j];
				if (j != k / j)
					div += dp[k / j];
			}
		}
		dp[k] = k - div;
		ans += ((k - div) * modular_power(m / k, n, mod) + mod) % mod;
		ans %= mod;
	}
	//debug(dp, m + 1);
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 4476
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
using namespace std;

#define rep(i,x) for(ll i=0;i<x;i++)
#define repn(i,x) for(ll i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 1000000007;
const ll MAX = 1000001;

ll max(ll a, ll b) {
	if (a > b) { return a; }
	return b;
}

ll min(ll a, ll b) {
	if (a > b) { return b; }
	return a;
}

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

ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}

struct edge {
	ll ind;
	ll fr;
	ll to;
	ll d;
};

class mint {
    long long x;
public:
    mint(long long x = 0) : x((x% MOD + MOD) % MOD) {}
    mint operator-() const {
        return mint(-x);
    }
    mint& operator+=(const mint& a) {
        if ((x += a.x) >= MOD) x -= MOD;
        return *this;
    }
    mint& operator-=(const mint& a) {
        if ((x += MOD - a.x) >= MOD) x -= MOD;
        return *this;
    }
    mint& operator*=(const  mint& a) {
        (x *= a.x) %= MOD;
        return *this;
    }
    mint operator+(const mint& a) const {
        mint res(*this);
        return res += a;
    }
    mint operator-(const mint& a) const {
        mint res(*this);
        return res -= a;
    }
    mint operator*(const mint& a) const {
        mint res(*this);
        return res *= a;
    }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }
    // for prime MOD
    mint inv() const {
        return pow(MOD - 2);
    }
    mint& operator/=(const mint& a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint& a) const {
        mint res(*this);
        return res /= a;
    }

    friend ostream& operator<<(ostream& os, const mint& m) {
        os << m.x;
        return os;
    }
};

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


int main() {
    ll N, L;
    cin >> N >> L;

    vector<ll> a(N + 1);
    repn(i, N) cin >> a[i];

    ll id = 0;
    repn(i, N - 1) {
        if (a[i] + a[i + 1] >= L) { id = i; break; }
    }

    if (id == 0) { cout << "Impossible"; }
    else {
        cout << "Possible" << endl;

        repn(i, id - 1) {
            cout << i << endl;
        }

        for (ll i = N - 1; i > id; i--) {
            cout << i << endl;
        }

        cout << id << endl;
    }

   
	
	system("PAUSE");
}


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

int main(){
 int c1, c5, c10, c50, c100, c500;
 cin>>c1>>c5>>c10>>c50>>c100>>c500;
 if(c1*1+c5*5+c10*10+c50*50+c100*100+c500*500>=1000){
  cout<<1<<endl;
 }else{
  cout<<0<<endl;
 }
 return 0;
}

Measured memory_bytes: 1164
// RAM RAM

#include <bits/stdc++.h>
#define int long long
#define pb push_back
#define ppb pop_back
#define vi vector<int>
#define mp make_pair
#define arrayin(a,n) for(int i=0;i<n;i++){cin>>a[i];}
#define N 55

using namespace std;

  
int pos(string a){
	int res=0;
    for(int i=0;i<a.length()-1;i++){
    	if(a[i]!=a[i+1])
    		res++;
    }
    return res;
}

int32_t main()
{
	ios_base::sync_with_stdio(false);cin.tie(0);

    string a;cin>>a;
    string b=a;
    reverse(b.begin(),b.end());
    cout<<min(pos(a),pos(b))<<endl;
	return 0;
}

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

int main() {
  int N, max, prs;
  cin >> N;
  max = 1000;
  
  for (int i=0; i<N; i++){
    int a;
    cin >> a;
    prs = 0;
    
    while (a%2 == 0){
      prs++;
      a /= 2;
    }
    
    if (max >= prs){
      max = prs;
    }
  }
  
  cout << max << endl;
} 

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cassert>
#include<vector>
#include<fstream>
#include<string>
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include<queue>
#include<map>
#include<set>
#include<bitset>
#include<cmath>
 
using namespace std;
#define REP(i,m,n) for(int i=m;i<n;++i)
#define REPll(i,m,n) for(ll i=m;i<n;++i)
#define INF 10000000000000000
#define MOD 1000000007
#define ll long long
#define mp make_pair
#define all(v) v.begin(),v.end()
 
vector<int>a, b, v;
map<int, int>ma, mb;
 
int main() {
	int n;
	cin >> n;
	REP(i, 0, n) {
		int tmp;
		cin >> tmp;
		v.push_back(tmp);
		if (i % 2 == 0) {
			ma[tmp]++;
		}
		else {
			mb[tmp]++;
		}
	}
	pair<int, int>pa, pb;
	pa = mp(0, 0);
	pb = mp(0, 0);
	REP(i, 0, n) {
		if (i % 2 == 0) {
			if (ma[v[i]] != 0) {
				if (ma[v[i]] > pa.second) {
					pa = mp(v[i], ma[v[i]]);
				}
				a.push_back(ma[v[i]]);
				ma[v[i]] = 0;
			}
		}
		else {
			if (mb[v[i]] != 0) {
				if (mb[v[i]] > pb.second) {
					pb = mp(v[i], mb[v[i]]);
				}
				b.push_back(mb[v[i]]);
				mb[v[i]] = 0;
			}
		}
	}
	sort(all(a));
	sort(all(b));
	int ans;
	if (pa.first == pb.first) {
		if (a.size() == 1 && b.size() == 1) {
			ans = n / 2;
		}
		else if (a.size() == 1) {
			ans = n - a[a.size() - 1] - b[b.size() - 2];
		}
		else if (b.size() == 1) {
			ans = n - a[a.size() - 2] - b[b.size() - 1];
		}
		else {
			ans = n - max(a[a.size() - 1] + b[b.size() - 2], a[a.size() - 2] + b[b.size() - 1]);
		}
	}
	else {
		ans = n - a[a.size() - 1] - b[b.size() - 1];
	}
	cout << ans << endl;
	return 0;
}



Measured memory_bytes: 6136
let readIntArray _ =
    stdin.ReadLine().Split(" ") |> Array.map int

()
|> readIntArray
|> fun [| r; c |] ->
    String.replicate (c + 2) "#" |> printfn "%s"
    [ 1 .. r ]
    |> List.map (fun _ -> "#" + stdin.ReadLine() + "#")
    |> String.concat "\n"
    |> printfn "%s"
    String.replicate (c + 2) "#" |> printfn "%s"


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

#define int long long
#define pb push_back
#define FOR(i,a,b) for (int (i) = (a); (i) < (b);(i)++)
#define rep(i,n) FOR (i,0,n)
#define vi vector<int>
#define P pair<int,int>

using ll = long long;

auto pick = [] (P a, P b) {
    if (a.first) b.second *= -1;
    return make_pair(a.first ^ b.first, a.second + b.second);
};

class SegTree {
public:
    int p = 2;
    vector<P> node;

    SegTree(vector<P> A) {
        while (A.size() > p) p *= 2;
        node = vector<P>(2*p-1, {0, 0});

        for (int i = 0; i < A.size(); i++) {
            node[p-1+i] = A[i];
        }

        for (int i = p - 2; i >= 0; i--) {
            node[i] = pick(node[i*2+1], node[i*2+2]);
        }
    }

    void update(int i, P v) {
        for (node[(i+=p)-1] = v; i >>= 1;) {
            node[i-1] = pick(node[i*2-1], node[i*2]);
        }
    }

    P getval(int start, int end, int k = 0, int l = 0, int r = -1) {
        if (r < 0) r = p;
        if (r <= start || end <= l) {return {0, 0};}
        if (start <= l && r <= end) {return node[k];}
        P L, R;
        L = getval(start, end, k*2+1, l, (l+r) / 2);
        R = getval(start, end, k*2+2, (l+r) / 2, r);
        return pick(L, R);
    }

    inline P operator [] (int i) {
        return node[i+p-1];
    }

    void debug() {
        rep (i, 2*p-1) {
            cout << node[i].first << "+" << node[i].second << " ";
        } cout << endl;
    }
};

signed main() {
    int k, n, q; cin >> k >> n >> q;
    vector<P> A(n);
    rep (i, n) {
        int a; cin >> a;
        if (a == 0) {
            A[i] = {1, 0};
        } else {
            A[i] = {0, a};
        }
    }
    vector<P> Q(q); rep (i, q) cin >> Q[i].first >> Q[i].second;

    SegTree seg(A);
    rep (i, q) {
        int l = Q[i].first - 1, r = Q[i].second - 1;
        seg.update(l, A[r]);
        seg.update(r, A[l]);
        swap(A[l], A[r]);
        P res = seg.getval(0, n);
        // rep (i, n) {
        //     cout << seg[i].second << " ";
        // } cout << endl;
        int ret = 1;

        if (res.second < 0) {
            ret -= res.second;
            ret %= k;
            if (ret == 0) ret += k;
        } else {
            ret -= res.second % k;
            ret += 2 * k; ret %= k;
            if (ret == 0) ret += k;
        }
        if (res.first == 1) ret *= -1;
        // seg.debug();
        // cout << res.second << " ";
        cout << ret << endl;
    }
}


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

const int N = 2e3+5;
const int mod = 1e9 + 7;
const int inf = 2e9;

int a[N],b[N];
long long dp[N][N];

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int n,m;
	cin >> n >> m;
	for(int i = 1; i <= n; ++i) cin >> a[i];
	for(int i = 1; i <= m; ++i) cin >> b[i];
	for(int i = 1; i <= n; ++i)
	{
		for(int j = 1; j <= m; ++j)
		{
			dp[i][j] = (dp[i-1][j] + dp[i][j-1])%mod;
			dp[i][j] = (dp[i][j] - dp[i-1][j-1] + mod)%mod;
			if(a[i] == b[j])
			{
				dp[i][j] = (dp[i][j] + 1 + dp[i-1][j-1])%mod;
			}
		}
	}
	
	cout << (dp[n][m] + 1)%mod << '\n';
	return 0;
}


Measured memory_bytes: 31616
using System;
using System.Collections.Generic;
using System.Linq;
 
public class Solution
{
    public static void Main()
    {
      string str = Console.ReadLine();
      string[] arr = str.Split(' ');
      var N = double.Parse(arr[0]);
      var D = double.Parse(arr[1]);
      // 1人が確認できる木の本数は、(i+D) - (i-D) + 1 = 2D+1のため、
      // 求まる人数をa人とすると、a(2D+1)>=Nとなる
      // 2D+1>0のため、a>=N/(2D+1)を満たす最小の整数をもとめればよい
      double cal = N / (2 * D + 1);
      var result = Math.Ceiling(cal);

      Console.WriteLine($"{result}");
    }
}

Measured memory_bytes: 13140
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#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>
#include <array>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
using namespace std;
int main(void)
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int a;
	cin >> a;
	cout << (48 - a) << "\n";
}

/*
	1011
	0101

*/

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#include <ctype.h>

int main() {
    char W[10], T[5];
    int count = 0, i;
    scanf("%s", W);
    while (scanf("%s", T) && strcmp(T, "END_OF_TEXT")) {
        for (i = 0; T[i]; i++) {
            T[i] = tolower(T[i]);
        }
        if (!strcmp(W, T)) {
            count++;
        }
    }
    printf("%d\n", count);
    return 0;
}

Measured memory_bytes: 552
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<map>
#include<vector>
#include<queue>
#include<stack>
#include<climits>
#include<set>
#include<utility>
#include<typeinfo>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef set<int> S;
#define rep(i, n) for(int i=0; i<n; i++)
const ll MOD=1e9+7;

int main(){

	int N, cnt_A = 0, cnt_Un = 0;
	string s;
	cin >> N;
	if(N % 2 != 0){
		cout << "NO" << endl;
		return 0;
	}
	for(int i = 0; i < N; i++){
		cin >> s;
		if(s == "A"){
			cnt_A++;
		} else {
			cnt_Un++;
		}
		if(cnt_A < cnt_Un){
			cout << "NO" << endl;
			return 0;
		}
	}
	if(cnt_A == cnt_Un){
		cout << "YES" << endl;
	} else {
		cout << "NO" << endl;
	}

	return 0;
}


Measured memory_bytes: 3156
n = int(input())
w = list(map(int,input().split()))
ans = abs(sum(w[0:1]) - sum(w[1:n+1]))
for i in range(1,n-1):
  a = abs(sum(w[0:i+1]) - sum(w[i+1:n+1]))
  if a <= ans:
    ans = a
print(ans)

Measured memory_bytes: 9104
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
#include<stdio.h>
#include<string.h>

using namespace std;
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000
#define DEBUG_OUT true
#define ALL(x) (x).begin(),(x).end()

// int DP[MEM_SIZE][MEM_SIZE] = {0};
// int GMEM[MEM_SIZE][MEM_SIZE] = {0};
template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return; std::cout << e <<" ";}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){std::cout<< e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class... Ts> void DEBUG(T d, Ts... e){if(DEBUG_OUT == false)return;DEBUG(d);DEBUG(e...);cout<<"\n";};
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
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); }
template<typename T> vector<T> make_v(size_t a){return vector<T>(a);}
template<typename T,typename... Ts> auto make_v(size_t a,Ts... ts){   return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...)); }
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type fill_v(T &t,const V &v){t=v;}
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type fill_v(T &t,const V &v){ for(auto &e:t) fill_v(e,v); }
template<typename T,typename U,typename... V> typename enable_if<is_same<T, U>::value!=0>::type fill_v(U &u,const V... v){u=U(v...);}
template<typename T,typename U,typename... V> typename enable_if<is_same<T, U>::value==0>::type fill_v(U &u,const V... v){ for(auto &e:u) fill_v<T>(e,v...);}
//FUNCTION

int COMB(int N,int R)
{
  int res = 1;
  for (int i = 1; i <= R; i++)
  {
    res *= (N-i);
    res /=R;
  }
  return res;
}

//BELOW
void solve(void)
{ 

  int N;
  cin>>N;
  vector<int> vec(N);
  for (int i = 0; i < N; i++)
  {
    cin>>vec[i];
  }

  sort(ALL(vec));
  int M = vec[N-1];
  int R;
  int MIN = INF;
  for (int i = 0; i < N-1; i++)
  {
    if(chmin(MIN,abs(M - 2*vec[i])))
    {
      R = vec[i];
    }
  }

  cout<<M<<" "<<R<<endl;

  
  
  
  return;
}
  
int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();

  return 0;
}


Measured memory_bytes: 1024
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
typedef int64_t int64;
typedef uint32_t uint;
typedef uint64_t uint64;
using namespace std;

//---

template <typename T>
inline void print(const T& rhs){ std::cout<<" = "<<rhs<<std::endl; }
template <typename T>
inline void print(const std::vector<T>& rhs){
    std::cout<<" = [ ";
    for(uint i=0; i<rhs.size(); ++i){ std::cout<<rhs[i]<<' '; }
    std::cout<<"]"<<std::endl;
}
template <typename T>
inline void print(const std::vector<std::vector<T>>& rhs){
    std::cout<<" = "<<std::endl;
    std::cout<<"[[ ";
    for(uint p=0; p<rhs.size(); ++p){
        if(p!=0){ std::cout<<" [ "; }
        for(uint q=0; q<rhs[p].size(); ++q){
            std::cout<<rhs[p][q]<<' ';
        }
        if(p!=rhs.size()-1){ std::cout<<"]"<<std::endl; }
    }
    std::cout<<"]]"<<std::endl;
}
template <typename TL, typename TR>
inline void print(const std::vector<std::pair<TR,TL>>& rhs){
    std::cout<<" = [";
    uint i=0;
    for(; i<rhs.size()-1; ++i){ std::cout<<"[f: "<<rhs[i].first<<", s: "<<rhs[i].second<<"], "; }
    std::cout<<"[f: "<<rhs[i].first<<", s: "<<rhs[i].second<<"]]" << endl;
}
#define printn(var) {printf("%s", #var);print(var);}
#define printn_all(var) {printf("%s(%d): ", __func__, __LINE__);printf("%s", #var);print(var);}

//---

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

    string s;
    
    int A, B, K; cin >> A >> B >> K;
    for(int i=A; i<=B; ++i){
        if(i<A+K){ s += to_string(i) + '\n'; continue; }
        if(i>B-K){ s += to_string(i) + '\n'; continue; }
    }
    
    cout << s << endl;
    
    return 0;
}

Measured memory_bytes: 256
class SegmentTree
  def initialize(size, default:, value: nil, update: -> (nv, _) { nv }, &merge)
    n = 1
    while n < size
      n *= 2
    end
    @size = n
    @default = default
    @update_proc = update
    @merge_proc = merge
    @data = Array.new(n * 2 - 1, default)
    init_by_value(value) if value
  end

  # 0-origin
  def update(k, a)
    k += @size - 1
    @data[k] = @update_proc.call(a, @data[k])
    while k > 0
      k = (k - 1) / 2
      @data[k] = @merge_proc.call(@data[k * 2 + 1], @data[k * 2 + 2])
    end
    nil
  end

  # [a, b)
  # 0-origin
  def query(a, b)
    execute_query(a, b, 0, 0, @size)
  end

  private

  def execute_query(a, b, k, l, r)
    return @default if r <= a || b <= l
    return @data[k] if a <= l && r <= b
    vl = execute_query(a, b, k * 2 + 1, l, (l + r) / 2)
    vr = execute_query(a, b, k * 2 + 2, (l + r) / 2, r)
    @merge_proc.call(vl, vr)
  end

  def init_by_value(value)
    value.each.with_index do |v, i|
      @data[i + @size - 1] = v
    end
    (@size - 2).downto(0) do |i|
      @data[i] = @merge_proc.call(@data[i * 2 + 1], @data[i * 2 + 2])
    end
  end
end

N = gets.to_i
S = gets.chomp.chars.map { |ch| ch.ord - 97 }
st_value = Array.new(N, 0)
S.each.with_index do |o, i|
  st_value[i] = 1 << o
end
st = SegmentTree.new(N, default: 0, value: st_value) do |a, b|
  a | b
end
Q = gets.to_i
Q.times do
  k, a, b = gets.chomp.split
  a = a.to_i - 1
  k = k.to_i
  if k == 1
    b = b.ord - 97
    st.update(a, 1 << b)
  else
    b = b.to_i
    x = st.query(a, b)
    ans = 0
    26.times do |i|
      ans += 1 if x[i] == 1
    end
    puts ans
  end
end

Measured memory_bytes: 49180
s = input()
n = int(input())
k = 0
for i in s:
    if i == "1":
        k += 1
    else:
        break
for i in s:
    if n <= k:
        print(i)
        exit()
    else:
        if i == "1":
            continue
        else:
            print(i)
            exit()

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

int n,a,b,c,x,cnt;
int num[105]={0};
bool ch [10005]={0};

int main(){
  int i,j;
  while(1){
    cin >> n >> a >> b >> c >> x;
    if(n+a+b+c+x==0)break;
    cnt=0;
    for(i=1;i<=10000;i++){
      ch[i]=0;
    }
    for(i=0;i<n;i++){
      cin >> num[i];
    }
    for(i=0;i<=10000;i++){
      if(x==num[cnt])cnt++;
      if(cnt==n){
	cout << i << endl;
	break;
      }
      x = (a*x+b)%c;
    }
    if(cnt!=n)cout << -1 << endl;
  }
  return 0;
}



Measured memory_bytes: 2992
#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;

long long powe(long long a, long long b)
{
  if(b == 0) return 1;
  long long temp = powe(a, b/2);
  temp = (temp * temp) % mod;
  if(b&1)  temp = (temp * a) % mod;
  return temp;
}
 
const long long MAXM = 200005;
 
long long fact[MAXM];
long long invfact[MAXM];
 
long long comb(long long n, long long r)
{
   if(n == r || r == 0) return 1;
 
   if(r > n) return 0;
 
   long long A = fact[n];
   A *= invfact[r];
   A %= mod;
   A *= invfact[n - r];
   A %= mod;
   return A;
}
 
void pre()
{
   fact[0] = 1;
   invfact[0] = 1;
 
   for (long long i = 1; i < MAXM; ++i)
   {
     fact[i] = (fact[i-1] * i) % mod;
     invfact[i] = powe(fact[i], mod - 2);
   }
}
 
bool comp(pair<long long, long long> p1, pair<long long, long long> p2)
{
   if(p1.second != p2.second)
   {
     return p1.second < p2.second;
   }
   else
   {
     return p1.first < p2.first;
   }
}
 
long long num_ways(long long x1, long long y1, long long x2, long long y2)
{
  long long n = y2 - y1;
  long long m = x2 - x1;
 
  if(n < 0 || m < 0) return 0;
 
  long long T_ways = fact[n + m];
  T_ways *= invfact[n];
  T_ways %= mod;
  T_ways *= invfact[m];
  T_ways %= mod;
 
  return T_ways;
 
}
 
int main()
{
  pre();
 
  long long n, m, num_b;
  cin >> n >> m >> num_b;
 
  long long T_ways = fact[n + m - 2];
  T_ways *= invfact[n-1];
  T_ways %= mod;
  T_ways *= invfact[m-1];
  T_ways %= mod;
 
//  cout << T_ways << "\n";
 
  pair<long long, long long> P[num_b];
  for (long long i = 0; i < num_b; ++i)
  {
     cin >> P[i].first >> P[i].second;
  }
 
  long long res[num_b];
 
  sort(P, P + num_b, comp);
 
 
 
 
  for (long long i = 0; i < num_b; ++i)
  {
     long long A = num_ways(P[i].first, P[i].second, n , m);
     //if(i == 1) cout << A << endl;
 
     long long B = num_ways(1, 1, P[i].first, P[i].second);
     long long C = 0;
     for (long long j = 0; j <= i - 1; ++j)
     {
        //if(i == 1) cout << "sfefe " << res[j] << endl;
        C += (res[j] * num_ways(P[j].first, P[j].second, P[i].first, P[i].second)) % mod;
        C %= mod;
     }
 
    // if(i == 1) cout << C << endl;
 
     B -= C;
     B = (B + mod) % mod;
     res[i] = B;
 
     //if(i == 1) cout << B << endl;
 
     long long D = A * B;
     D %= mod;
     T_ways -= D;
     T_ways = (T_ways + mod) % mod;
 
    // if(i == 1) cout << T_ways << endl;
  }
 
  cout << T_ways;
 
 
 
 
  
  return 0;
}
 
 
 
 
 
 
 
 
 
 
 

Measured memory_bytes: 3456
N = int(input())
a = list(map(int, input().split()))

op = []
maxa = -10**7
argmaxa = -1
for i in range(N):
    if a[i] > maxa:
        maxa = a[i]
        argmaxa = i

mina = 10**7
argmina = -1
for i in range(N):
    if a[i] < mina:
        mina = a[i]
        argmina = i

if mina >= 0:
    pass
elif maxa <= 0:
    pass
elif abs(maxa) > abs(mina):
    for i in range(N):
        a[i] += maxa
        op.append((argmaxa, i))
else:
    for i in range(N):
        a[i] += mina
        op.append((argmina, i))
if abs(maxa) > abs(mina):
    for i in range(N-1):
        a[i+1] += a[i]
        op.append((i, i+1))
else:
    for i in reversed(range(1, N)):
        a[i-1] += a[i]
        op.append((i, i-1))

print(len(op))
for elem in op:
    print(' '.join(map(lambda x: str(x+1), elem)))


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

int main(){
    int m, d, ans;

    cin >> m >> d;

    string s;

    for(int month=1; month<=m; month++){
        for(int day = 1; day <= d; day++){
            if(day>=10){
                s = to_string(day);
                int d1 = s[s.length()-1] - 48;
                int d10 = s[s.length()-2] - 48;
                if(d1>=2&&d10>=2&&d1*d10==month){ans++;
             //   cout << month << ' ' << day << endl;
                }
            }
        }
    }

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


Measured memory_bytes: 256
import java.util.Scanner;


public class Main{
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int n = sc.nextInt();
			if(n == 0) break;
			
			Game g = new Game(n);
			for(int i = 0; i < n; i++) g.addCards(sc.nextInt(), sc.nextInt());
			
			g.show();
		}
		sc.close();
	}
	
}

class Player{
	int[] cards;
	int point;
	private int cursor;
	
	
	public Player(int n){
		cards = new int[n];
		point = 0;
		cursor = 0;
	}
	
	public void addCard(int card){
		cards[cursor++] = card;
	}
	
	public void addPoint(int point){
		this.point += point;
	}

}

class Game{
	Player player1;
	Player player2;
	
	public Game(int n){
		player1 = new Player(n);
		player2 = new Player(n);
	}
	
	public void addCards(int c1, int c2){
		player1.addCard(c1);
		player2.addCard(c2);
		if(c1 > c2) player1.addPoint(c1 + c2);
		else if(c1 < c2) player2.addPoint(c1 + c2);
		else{
			player1.addPoint(c1);
			player2.addPoint(c2);
		}
	}
	
	public void show(){
		System.out.println(player1.point + " " + player2.point);
	}
}

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

using namespace std;
long long modinv(long long a, long long m) {
	long long b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}

long long  gcd(long long  a, long long b) {
	if (a < b) return gcd(b, a);
	long long  r;
	while ((r = a % b)) {
		a = b;
		b = r;
	}
	return b;
}

int main() {
	double N,M;
	cin >> N>>M;
	cout << ceil(N / M);
}

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

using namespace std;

int main(){
    int n;
    cin >> n;
    pair<int,int> p[n];
    for(int i = 0; i < n; i++){
        cin >> p[i].first;
        p[i].second = i;
    }
    sort(p,p+n);
    reverse(p,p+n);
    multiset<int> memo = {-1,-1,n,n};
    long long ans = 0LL;
    for(int i = 0; i < n; i++){
        auto itr = memo.insert(p[i].second);
        --itr;
        int l1 = *itr;
        --itr;
        int l2 = *itr;
        itr++;itr++;itr++;
        int r1 = *itr;
        ++itr;
        int r2 = *itr;
        int cnt = (l1-l2)*(r1-p[i].second)+(p[i].second-l1)*(r2-r1);
        ans +=(long long)p[i].first*cnt;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 5760
#include  <iostream>
#include  <stdio.h>
#include <algorithm>
#include <map>
#include <math.h>

using namespace std;
#include <vector>
#define rep(i,n) for (ll i = 0; i < (n) ; i++)
#define INF 1e9
#define llINF 1e18
#define base10_4 10000      //1e4
#define base10_5 100000     //1e5
#define base10_6 1000000    //1e6
#define base10_7 10000000   //1e7
#define base10_8 100000000  //1e8
#define base10_9 1000000000 //1e9

#define MOD 1000000007
#define pb push_back
#define ll long long
#define ull unsigned long long
#define vint vector<int>
#define vll vector<ll>

//#include <stack>
//#include <queue>

string ans_Yes = "Yes"; 
string ans_No = "No"; 
string ans_yes = "yes"; 
string ans_no = "no"; 

ll A;
ll B;
ll C;
ll N;
ll M;
ll K;

ll flagAC[base10_5+10]={};
ll cntWA[base10_5+10]={};
ll cntAC;

ll ltmp;
string stmp;
double dtmp;

int main(){

    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    cin >> N;
    cin >> M;

    rep(mi,M){
        ll qnum;
        string res;
        cin >> qnum;
        cin >> res;
        if(res=="AC"){
            cntAC = cntAC + (1-flagAC[qnum]);
            flagAC[qnum]=1;
        }else{
            cntWA[qnum] = cntWA[qnum] + (1-flagAC[qnum]);
        }
    }
    ll cntWAtotal=0;
    for( ll ni = 1 ; ni <=N ; ni++ ){
        cntWAtotal += cntWA[ni] * flagAC[ni];
    }
    cout << cntAC << " " << cntWAtotal;

}


Measured memory_bytes: 5020
from collections import deque
N,M=map(int,input().split())
links = {}
linkList = []
for i in range(M):
    a,b=map(int,input().split())
    linkList.append((a,b))
    if a not in links:
        links[a] = [b]
    else:
        links[a].append(b)
    if b not in links:
        links[b] = [a]
    else:
        links[b].append(a)
ans = 0
for a,b in linkList:
    links[a].remove(b)
    links[b].remove(a)
    visited = set()
    queue = deque()
    queue.appendleft(1)
    while queue:
        v = queue.pop()
        for w in links[v]:
            if w not in visited:
                queue.appendleft(w)
                visited.add(w)
    if len(visited) != N:
        ans += 1
    links[a].append(b)
    links[b].append(a)
print(ans)

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

int main(){
  int H, W;
  cin >> H >> W;
  
  vector<string> S(H + 2, ".");
  
  for (int i = 0; i < W + 1; i++){
    S.at(0) += ".";
    S.at(H + 1) += ".";
  }

  
  for (int i = 1; i <= H; i++){
    string s;
    cin >> s;
    S.at(i) += s;
    S.at(i) += ".";
  }
  
  for (int i = 1; i <= H; i++){
    for (int j = 1; j <= W; j++){
      int num = 0;
      if (S.at(i).at(j) == '#'){
        continue;
      }
      
      if (S.at(i - 1).at(j - 1) == '#'){
        num++;
      }
      if (S.at(i - 1).at(j) == '#'){
        num++;
      }
      if (S.at(i - 1).at(j + 1) == '#'){
        num++;
      }
      if (S.at(i).at(j - 1) == '#'){
        num++;
      }
      if (S.at(i).at(j + 1) == '#'){
        num++;
      }
      if (S.at(i + 1).at(j - 1) == '#'){
        num++;
      }
      if (S.at(i + 1).at(j) == '#'){
        num++;
      }
      if (S.at(i + 1).at(j + 1) == '#'){
        num++;
      }
      
      S.at(i).at(j) = num + 48;
    }
  }
  
  for (int i = 1; i <= H; i++){
    for (int j = 1; j <= W; j++){
      cout << S.at(i).at(j);
    }
    cout << endl;
  }

}

Measured memory_bytes: 3576
from functools import lru_cache
import numpy as np

N = int(input())
A = np.array(list(map(int, input().split(' '))))
i = np.arange(1, N + 1)

left = -(10 ** 10)
right = (10 ** 10)


@lru_cache(maxsize=None)
def cost(b):
    return np.sum(np.abs(A - (i + b)))


while True:
    mid = (left + right) // 2
    c_left = cost(left)
    c_right = cost(right)
    if left == mid or right == mid:
        print(min(c_left, c_right))
        break
    elif c_left < c_right:
        right = mid
    else:
        left = mid


Measured memory_bytes: 49376
a,b=map(int,input().split())
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a
def prime_factorize(n):
    c = []
    while n % 2 == 0:
        c.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            c.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        c.append(n)
    return c
d=prime_factorize(gcd(a,b))
e = len(set(d))
print(e+1)

Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <cmath>
#include <stdio.h>
using namespace std;
int main(void){
    int a,b,c;
    cin >> a >> b >> c;
    double S, L, h, PI = acos(-1);
    S = 0.5 * a * b * sin(c * PI / 180);
    L = a + b + sqrt(b*b+a*a-2*a*b*cos(c * PI / 180));
    h = b * sin(c * PI / 180);
    printf("%f\n%f\n%f\n",S,L,h);
    return 0;
}


Measured memory_bytes: 3456
n = int(input())
ac_cnt, wa_cnt, tle_cnt, re_cnt = 0, 0, 0, 0
for _ in range(n):
    s = input()
    if s == 'AC':
        ac_cnt += 1
    elif s == 'WA':
        wa_cnt += 1
    elif s == 'TLE':
        tle_cnt += 1
    elif s == 'RE':
        re_cnt += 1

print(f'AC x {ac_cnt}') 
print(f'WA x {wa_cnt}') 
print(f'TLE x {tle_cnt}') 
print(f'RE x {re_cnt}') 

Measured memory_bytes: 9196
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<iomanip>
using namespace std;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
#define MOD 1000000007
#define LINF (long long)4e18

using ll = long long;



int main(){
    string S; cin >> S;
    bool ok = true;
    rep(i,3){
      if(S[i] == S[i+1]) ok = false;
    }
    if(ok) cout << "Good" << endl;
    else cout << "Bad" << endl;
}


Measured memory_bytes: 256
use std::io::stdin;
use std::time::SystemTime;

fn main() {
    let n: u64 = read().parse().unwrap();
    let s = read();
    let k: usize = read().parse().unwrap();
    
    let s: Vec<char> = s.chars().collect();
    let t = s[k - 1];
    for v in s {
        if v == t {
            print!("{}", v)
        } else {
            print!("*")
        }
    }
    println!("")
}

fn read() -> String {
    let mut s = String::new();
    stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

Measured memory_bytes: 4352
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
#define rep(i, begin, n) for (int i = begin; i < n; i++)
#define repe(i, begin, n) for (int i = begin; i <= n; i++)
#define repr(i, begin, n) for (int i = begin; i > begin - n; i--)
#define repre(i, begin, end) for (int i = begin; i >= end; 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;
}

const int inf = 1000000007;
const int MOD = 1000000007;
const long long INF = 1000000000000000007;

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

string N;
ll dp[1010101][2];

int main()
{
    cin >> N;
    N = '0' + N;
    dp[0][0] = 0;
    dp[0][1] = 1;
    int ns = N.size();
    for (int i = 1; i < ns; i++)
    {
        int n = N[i] - '0';
        dp[i][0] = min(dp[i - 1][0] + n, dp[i - 1][1] + (10 - n));
        dp[i][1] = min(dp[i - 1][0] + n + 1, dp[i - 1][1] + (9 - n));
    }
    cout << dp[ns - 1][0] << endl;
}

Measured memory_bytes: 16944
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <functional>
#include <numeric>
#include <list>
#include <set>
#include <map>
#include <cstring>
#include <cmath>

#define v_exists(elem, v) find(v.begin(),v.end(),elem)!=v.end()
#define s_exists(elem, s) s.find(elem)!=s.end()

using namespace std;
const int MOD = 1000000007;

long gcd(long a, long b) {
    return b == 0 ? a : gcd(b, a % b);
}

long lcm( long m, long n ){
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;

	return ((m / gcd(m, n)) * n);
}


long kake(long x, long y){
	return x * y % MOD;
}

long fact_mod(long x){
	long ans = x;
	x-=1;
	while(x>1){
		ans = ans * x % MOD;
		x-=1;
	}
	return ans;
}

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

	if(x <= 6){
		cout << 1 << endl;
		return 0;
	} else if (x <= 11){
		cout << 2 << endl;
		return 0;
	} else {
		if(x%11 == 0){
			cout << 2*(x/11) << endl;
		} else if(x%11 <= 6){
			cout << 2*(x/11) + 1 << endl;
		} else {
			cout << 2*(x/11+1) << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <list>
#include <cmath>
#include <stack>
#include <string>
#include <cstring>
#include <numeric>
#include <iomanip>
#include <fstream>
using namespace std;
double pie=3.14159265358979;
long long mod=998244353;
//
int main(){
	string s,t;
	cin>>s>>t;
	int ans=0;
	for(int i=0;i<s.size();i++){
		if(s[i]!=t[i]){
			ans++;
		}
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 3920
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n=Integer.parseInt(sc.next());
int d=Integer.parseInt(sc.next());
int x=Integer.parseInt(sc.next());
int[] a=new int[n];
for(int i=0;i<n;i++){a[i]=Integer.parseInt(sc.next());}
int sum=x;
for(int i=0;i<n;i++){
    for(int j=0;j*a[i]+1<=d;j++){
    sum++;
    }
}
System.out.println(sum);
}}

Measured memory_bytes: 21844
#include <stdio.h>
int main(void){
  int n,m,i;
  int a[50],b[50],road[50]={0};
  scanf("%d%d",&n,&m);
  for(i=1;i<=m;i++){
    scanf("%d %d",&a[i],&b[i]);
    road[a[i]]++;
    road[b[i]]++;
  }
  for(i=1;i<=n;i++){
    printf("%d\n",road[i]);
  }
  return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define rep(i,n) for(int i=0; i<(n); ++i)
#define per(i,n) for(int i=n-1;i>=0;++i)
#define rep1(i,n) for(int i=1; i<=n; ++i)
#define per1(i,n) for(int i=n; i>=1; ++i)
#define debug cout << "line : " << __LINE__ << " debug" << endl
#define Dcout(N) cout << setprecision(20) << N << endl
#define Unique(v) v.erase( unique(v.begin(), v.end()), v.end() ) //被り削除
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define INF 1e9
#define MOD 1000000007
typedef long long ll;
//------------------------------------------------------------------------

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

  int n; cin >> n;
  vector<int> a(n);
  map<ll,ll> mp;
  rep(i,n){
     cin >> a[i];
     mp[a[i]]++;
   }

  ll sum = 0;
   for(auto x : mp){
     if((x.S*(x.S-1))/2>0) sum += (x.S*(x.S-1))/2;
   }



  rep(i,n){
    ll ans = sum;
    ans -= mp[a[i]]*(mp[a[i]]-1)/2;
    ans += (mp[a[i]]-1)*(mp[a[i]]-2)/2;
    if(ans>0) cout << ans << endl;
    else cout << 0 << endl;
  }

  return 0;

}


Measured memory_bytes: 10368
from collections import defaultdict

memo = {}
def dfs(i, w, l, W):
    if i >= len(l):
        return 0

    if (i, w) in memo:
        return memo[(i, w)]

    # not use
    ans = dfs(i + 1, w, l, W)

    # use
    if w + l[i][0] <= W:
        ans = max(ans, dfs(i + 1, w + l[i][0], l, W) + l[i][1])

    memo[(i, w)] = ans
    return ans


def main():
    N, W = map(int, input().split())
    l = []
    for _ in range(N):
        w, v = map(int, input().split())
        l.append((w, v))
    print(dfs(0, 0, l, W))


if __name__ == '__main__':
    main()


Measured memory_bytes: 21120
#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1000000000000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

void print(const std::vector<int> &v) {
    std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
    std::cout << std::endl;
}

int main() {
    int X, A, B;
    cin >> X >> A >> B;
    X -= A;
    X -= (X / B) * B;
    cout << X << endl;
    return 0;
}

Measured memory_bytes: 256
// C - Subarray Sum
#include <bits/stdc++.h>

using namespace std;

int main(int argc, char *argv[])
{
	long long n, k, s;
	cin >> n >> k >> s;
	vector<long long> ans(n);
	for (int i = 0; i < k; i++) ans[i] = s;
	for (int i = k; i < n; i++) ans[i] = s < 1000000000 ? s + 1 : s - 1;

	for (int i = 0; i < n; i++) cout << (i ? " " : "") << ans[i];
	cout << endl;

	return 0;
}


Measured memory_bytes: 2048
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
  int D;
  cin>>D;
  if(D==25)
  cout<<"Christmas"<<endl;
  else if(D==24)
  cout<<"Christmas Eve"<<endl;
  else if(D==23)
  cout<<"Christmas Eve Eve"<<endl;
  else if(D==22)
  cout<<"Christmas Eve Eve Eve"<<endl;
    }

   
  
   


Measured memory_bytes: 256