akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

#include <fstream>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

typedef long long ll;
typedef long double ld;
using namespace std;
#define endl "\n"
#define FIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
using namespace __gnu_pbds;
const int N=2e5+5;
int mod=1e9+7;

int main()
{
    FIO
    int mod,n,arr[N];
    cin>>n>>mod;
    int sum=0;
    map<ll ,ll>mp;
    mp[0]++;
    for(int i=0; i<n; i++)
    {
        cin>>arr[i];
        sum+=arr[i];
        sum%=mod;
        mp[sum]++;
    }
    ll ans=0;
    for(auto i:mp)
    {
        ans+=i.second*(i.second-1)/2;

    }
    cout<<ans;


    return 0;

}


Measured memory_bytes: 4608
#if !defined(__clang__) && defined(__GNUC__)
#include <bits/stdc++.h>
#else
#include <cstdlib>
#include <climits>
#include <iostream>
#include <cstdint>
#include <vector>
#include <string>
#include <complex>
#include <bitset>
#include <queue>
#include <deque>
#include <stack>
#include <utility>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <regex>
#endif //  !defined(__clang__) && defined(__GNUG__)
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>
#include <boost/math/common_factor_rt.hpp>

using namespace std;


/**
   ceil(0, 2) == 0
   ceil(1, 2) == 1
   ceil(2, 2) == 1
   ceil(3, 2) == 2
   ceil(4, 2) == 2
*/
template<class T>
T ceil(T dividend, T divisor)
{
    return (dividend + (divisor - 1)) / divisor;
}
int main()
{
    int64_t A, B, C, D, E, F;
    std::cin >> A >> B >> C >> D >> E >> F;

    // 100 * S <= W * E
    // W + S <= F

    // W += 100*A
    // W += 100*B
    // S += C;
    // S += D;

    // F 以下となる水の組み合わせ

    std::unordered_set<int64_t> water;
    for (int64_t a = 0; a*100*A <= F; ++a) {
        for (int64_t b = 0; b*100*B <= F; ++b) {
            auto w = 100*a*A + 100*b*B;
            if (w <= 0 || w > F) {
                continue;
            }
            water.insert(w);
        }
    }

    std::unordered_set<int64_t> suger;
    for (int64_t c = 0; c*C <= F; ++c) {
        for (int64_t d = 0; d*D <= F; ++d) {
            auto s = c*C + d*D;
            if (/*s <= 0 ||*/ s > F) {
                continue;
            }
            suger.insert(s);
        }
    }


    double max = -1;
    int64_t maxW = 0;
    int64_t maxS = 0;

    for (auto w: water) {
        for (auto s: suger) {
            if (w + s > F) {
                continue;
            }
            if (100 * s > w * E) {
                continue;
            }

            double n = 100.0 * s / (w + s);
            if (max < n) {
                maxW = w;
                maxS = s;
                max = n;
            }
        }
    }

    std::cout << maxS + maxW << " " << maxS << std::endl;

    return 0;
}


Measured memory_bytes: 512
n = int(input())
dp = [i for i in range(n+1)]

dp[0] = 0
for i in range(n):
    j,l = 1,1
    while i + 6**j <= n:
        dp[i+6**j] = min(dp[i+6**j], dp[i]+1)
        j += 1
    while i + 9**l <= n:
        dp[i+9**l] = min(dp[i+9**l], dp[i]+1)
        l += 1
print(dp[n])

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

using namespace std;

typedef long long ll;

#define p(x) cout << x << endl
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define range(i, begin, end) for (int i = begin; i < (int)(end + 1); i++)
#define all(x) (x).begin(), (x).end()

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

  int count = 0;
  rep(i, m) {
    int t_m = i + 1;
    rep(j, d) {
      int t_d = j + 1;
      int d1 = t_d % 10;
      int d2 = t_d / 10;
      if (d1 < 2) {
        continue;
      }

      if (d2 < 2) {
        continue;
      }

      if (d1 * d2 == t_m) {
        count += 1;
      }
    }
  }

  p(count);

  return 0;
}


Measured memory_bytes: 256
/*
*/

//#pragma comment(linker, "/STACK:16777216")
#define _CRT_SECURE_NO_WARNINGS

#include <fstream>
#include <iostream>
#include <string>
#include <complex>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>
#include <list>
#include <ctime>
#include <memory.h>
#include <assert.h>
#include <unordered_map>

#define y0 sdkfaslhagaklsldk
#define y1 aasdfasdfasdf
#define yn askfhwqriuperikldjk
#define j1 assdgsdgasghsf
#define tm sdfjahlfasfh
#define lr asgasgash
#define norm asdfasdgasdgsd

#define eps 1e-9
#define M_PI 3.141592653589793
#define bs 1000000009
#define bsize 350

using namespace std;

const int INF = 1e9;
const int N = 551;

int n, m;
string st;
int board[N][N], board1[N][N], board2[N][N];

int main(){
	//freopen("fabro.in","r",stdin);
	//freopen("fabro.out","w",stdout);
	//freopen("F:/in.txt", "r", stdin);
	//freopen("F:/output.txt", "w", stdout);
	ios_base::sync_with_stdio(0);
	//cin.tie(0);

	cin >> n >> m;
	for (int i = 1; i <= n; i++)
	{
		cin >> st;
		for (int j = 1; j <= m; j++)
		{
			if (st[j - 1] == '#')
				board[i][j] = 1;
			else
				board[i][j] = 0;
		}
	}

	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= m; j++)
		{
			if (j == 1)
			{
				board1[i][j] = 1;
				continue;
			}
			if (j == m)
			{
				board2[i][j] = 1;
				continue;
			}
			if (i % 2 == 1)
			{
				board1[i][j] = 1;
				continue;
			}
			board2[i][j] = 1;
		}
	}

	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= m; j++)
		{
			if (board[i][j] == 1)
				board1[i][j] = board2[i][j] = 1;
		}
	}

	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= m; j++)
		{
			if (board1[i][j] == 1)
				cout << "#";
			else
				cout << ".";
		}
		cout << endl;
	}
	cout << endl;
	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= m; j++)
		{
			if (board2[i][j] == 1)
				cout << "#";
			else
				cout << ".";
		}
		cout << endl;
	}

	cin.get(); cin.get();
	return 0;
}

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

#define fa(x,v) for(auto x:v)
#define f(i,a,b) for(ll i=(ll)a;i<=(ll)b;i++)
#define rf(i,a,b) for(ll i=(ll)a;i>=(ll)b;i--)
#define spc " "
#define endl '\n'
#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define len(s) (ll)int(s.length())
#define sz(v) (ll)int(v.size())
#define MOD 1000000007

void Fast_IO() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    #ifdef rsd511
    freopen("input.in","r",stdin);
    freopen("output.out","w",stdout);
    #endif
    #ifndef rsd511
    #define trace(...) {}
    #define cotra(...) {}
    #endif
} 

// Code Here

int main()
{
    Fast_IO();
    ll d,t,s; cin >> d >> t >> s;
    if(s * t >= d) cout << "Yes";
    else cout << "No";
    return 0;
}

Measured memory_bytes: 3644
//                          VIVEK UPADHYAY
//                         MANIT, BHOPAL(M.P)
/**********************************************************************************************/
/**********************************************************************************************/
//                        $$ JAB-TAK TODEGA NHI,
//                           TAB -TAK CHODEGA NHI :D
#include<iostream>
#include<algorithm>
#include<vector>
#include<list>
#include<cstdlib>
#include<unistd.h>
#include<string>
#include<cstring>
#include<stack>
#include<queue>
#include<utility>
#include<cmath>
#include<set>
#include<unordered_map>
#include<cstdio>
#include<map>
#include<numeric>
using namespace std;
#define F first
#define S second
#define mk(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define LINE cout<<"\n" ;
#define ok cout<<"ok\n" ;
#define dbg(x) cout<<#x<<" = "<<(x)<<"\n";
typedef long long ll;
const int MAXN = 500510;
const int MAX = 1e7 + 1 ;
double pi = 3.1415926535897932384626433832795;
const ll inf=1e18 ;
ll mod = 500500507;
ll powr(ll a , ll b){ if(b==0) return 1LL ; ll x = powr(a,b/2) ; x = (x*x)%mod ; if(b%2) return ((a%mod)*x)%mod ; return x ;}
ll gcd(ll a , ll b){if(a==0) return b ; return gcd(b%a,a);}
int N = 1e5 + 10 ;

int main () {
    
    string s;
    cin >> s ;
    int cnt =0 ;
    for(int  i=0 ; i <s.length() ;i++) if(s[i]=='2') cnt++ ;
    cout<<cnt<<endl;
    return 0 ;
}


Measured memory_bytes: 256
n, x = (int(x) for x in input().split())
if x == 1 or x == 2 * n - 1:
    print("No")
    exit()

if n == 2:
    print("Yes")
    print(1)
    print(2)
    print(3)
    exit()

if x == 2:
    y = [3, 1, 2, 4]
else:
    y = [x - 1, x + 1, x, x - 2]

ANS = []
i = 1
while i < 2 * n:
    if len(ANS) == 2 * n - 1:
        break
    if i in y:
        i += 4
    if len(ANS) == n - 3:
        ANS += y
        if len(ANS) == 2 * n - 1:
            break
    ANS.append(i)
    i += 1

print("Yes")
for ans in ANS:
    print(ans)


Measured memory_bytes: 87448
#include <bits/stdc++.h>
/**  I'm Klaus, NicKlaus :v **/
using namespace std;
#define ms(a,v) memset(a,v,sizeof a)
#define ll long long
#define LOG2(X) ((unsigned) (8*sizeof(int) - __builtin_clz((X)) - 1))
ll gcd(ll x, ll y){return (y ? gcd(y, x%y) : x); }
ll lcm(ll x, ll y){return x*(y/gcd(x,y));}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

int main(){
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	#ifdef LOCAL_JUDGE
		//freopen("in_out/in.txt", "rt", stdin);
		//freopen("int_out/out.txt", "wt", stdout);
	#endif
	int n;
	cin>>n;
	vector<int> a(n);
	vector<int> r(n);
	vector<int> l(n);
	for(int i=0; i<n; i++) cin>>a[i];
	r[0] = a[0];
	for(int i=1; i<n;i++){
		r[i] = gcd(a[i],r[i-1]);
	}
	l[n-1] = a[n-1];
	for(int i=n-2; i>=0; i--){
		l[i] = gcd(a[i],l[i+1]);
	}
	int ans = r[n-1];
	for(int i=0; i<n; i++){
		if(i==0){
			ans = max(ans,l[i+1]);
		}else if(i==n-1){
			ans = max(ans,r[i-1]);
		}else{
			ans = max(ans, (int)gcd(r[i-1],l[i+1]));
		}	
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 1408
#include <stdio.h>
 
using namespace std;
 
struct Node{
    Node(){
        left_child = right_child = parent = -1;
    };
    int left_child,right_child,parent;
};
 
void preORDER(Node order[],int id){
    printf(" %d",id);
    if(order[id].left_child != -1) preORDER(order,order[id].left_child );
    if(order[id].right_child != -1) preORDER(order,order[id].right_child );
}
 
void inORDER(Node order[],int id){
    if(order[id].left_child != -1) inORDER(order,order[id].left_child );
    printf(" %d",id);
    if(order[id].right_child != -1) inORDER(order,order[id].right_child );
}
 
void postORDER(Node order[],int id){
    if(order[id].left_child != -1) postORDER(order,order[id].left_child );
    if(order[id].right_child != -1) postORDER(order,order[id].right_child );
    printf(" %d",id);
}
 
int main(){
    int n,id,left,right,root_id;
    scanf("%d",&n);
    Node order[n];
    for(int i = 0; i < n; i++){
        scanf("%d %d %d",&id,&left,&right);
        if(left != -1){
            order[id].left_child = left;
            order[left].parent = id;
        }
        if(right != -1){
            order[id].right_child = right;
            order[right].parent = id;
        }
    }
 
    for(root_id = 0; root_id < n; root_id++){
        if(order[root_id].parent == -1) break;
    }
 



    printf("Preorder\n");
    preORDER(order,root_id);
    printf("\n");
 
    printf("Inorder\n");
    inORDER(order,root_id);
    printf("\n");
 
    printf("Postorder\n");
    postORDER(order,root_id);
    printf("\n");
}


Measured memory_bytes: 2724
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
typedef pair<int, int> P;
typedef pair<int, P> E;
#define MOD (1000000007ll)
#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	b += MOD;
	a += b;
	a %= MOD;
}

ll order(vector<ll> v, int k){
	int n,i,l,r,p=0,q=0;
	ll pivot;
	n = v.l_ength();
	if(n<5){
		sort(v.begin(),v.end());
		return v[k];
	}
	vector<ll> u;
	u.reserve(n);
	for(i=0; i<n; i+=5){
		l = i; r = min(i+5,n);
		sort(&v[l],&v[r]);
		u.push_back(v[(l+r)/2]);
	}
	pivot = order(u,n/10);
	u.clear();
	for(i=0; i<n; ++i){
		if(v[i]<pivot){
			++p;
		}else if(v[i]==pivot){
			++q;
		}
	}
	if(k<p){
		for(i=0; i<n; ++i){
			if(v[i]<pivot){
				u.push_back(v[i]);
			}
		}
		return order(u,k);
	}else if(k>=p+q){
		for(i=0; i<n; ++i){
			if(v[i]>pivot){
				u.push_back(v[i]);
			}
		}
		return order(u,k-p-q);
	}else{
		return pivot;
	}
}

ll a[1111][3];

int main(void){
	int n,m,i,j,k,cnt=0;
	ll pivot,tmp,ans=-INFLL;
	cin >> n >> m;
	vector<ll> v(n);
	if(!m){
		cout << 0ll << endl;
		return 0;
	}
	for(i=0; i<n; ++i){
		for(k=0; k<3; ++k){
			cin >> a[i][k];
		}
	}
	for(j=0; j<8; ++j){
		tmp = 0ll; cnt = 0;
		fill(v.begin(),v.end(),0ll);
		for(i=0; i<n; ++i){
			for(k=0; k<3; ++k){
				if(j&(1<<k)){
					v[i] += a[i][k];
				}else{
					v[i] -= a[i][k];
				}
			}
		}
		pivot = order(v,n-m);
		for(i=0; i<n; ++i){
			if(v[i]>pivot){
				++cnt;
				tmp += v[i];
			}
		}
		tmp += pivot*(m-cnt);
		ans = max(ans,tmp);
	}
	cout << ans << endl;
	return 0;
}


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

using namespace std;

#define LIMIT 100
#define MOD 1000000007ll
#define INF 1e9
typedef long long ll;
typedef pair<ll, ll> ii;
int gcd(ll a, ll b) { return (b==0)?a:gcd(b, a%b); }
int lcm(ll a, ll b) { ll i=(a/gcd(a,b))*b; assert(i>0); return i; }

//  ***** MAIN *****
int main(){

  //ios::sync_with_stdio(false);
  cin.tie(NULL);

  int n; cin>> n;
  std::cout << n/3 << std::endl;

  return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <utility>
#include <string>
#include <cmath>
#include <cstdlib>
#include <cstring>

using namespace std;

typedef uint64_t u64;
typedef int64_t s64;
typedef uint32_t u32;
typedef int32_t s32;
typedef vector<s32> vs32;
typedef vector<u32> vu32;
typedef vector<s64> vs64;
typedef vector<u64> vu64;

const double PI=3.14159265358979323846;

#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) > (y) ? (y) : (x))

#define rep(i, N) for(int i = 0; i < N; ++i)

#define CEIL(x, y) (((x) + (y) - 1) / (y))
#define MOD 1000000007ULL

const int lim = 200000;
s64 fac[lim + 1], finv[lim + 1];

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

void init(int n)
{
    if (n > lim) n = lim;
    fac[0] = 1;
    rep (i, n)
    {
        fac[i + 1] = (fac[i] * (i + 1)) % MOD;
    }
    finv[n] = mypow(fac[n], MOD - 2);
    for (int i = n; i >= 1; --i)
    {
        finv[i - 1] = (finv[i] * i) % MOD;
    }
}

s64 com(int n, int k)
{
    if (n < k || n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

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

    s64 N;
    cin >> N;
    vs64 c(N);
    rep (i, N)
    {
        cin >> c[i];
    }
    sort(c.begin(), c.end());

    s64 ans = 0;
    s64 x = mypow(2, N);
    s64 y = mypow(2, N - 1);
    s64 z = mypow(2, N - 2);
    for (s64 i = 1; i <= N; ++i)
    {
        ans += c[i - 1] * ((y + (N - i) * z % MOD) % MOD) % MOD;
        ans %= MOD;
    }

    cout << x * ans % MOD << "\n";
    return 0;
}



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

#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
#define vpii vector<pair<int,int>>
#define vpll vector<pair<ll,ll>>
#define fr(i,k,n) for (int i = k; i < n; ++i)
#define fri(i,k,n) for (int i = k; i >= n; --i)
#define INF (int)1e9
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define all(arr) arr.begin(),arr.end()

void boost(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
}

const int N=2e5+10;
ll n,k;
ll arr[N];

bool poss(ll val){
	ll req=0;
	fr(i,0,n){
		if(arr[i]<=val)
			continue;
		ll cnt=(arr[i]/val) + (arr[i]%val!=0);
		cnt--;
		req+=cnt;
		if(req>k)
			return false;
	}
	if(req>k)
		return false;
	return true;
}

void solve(){
	cin>>n>>k;
	ll mx=0;
	fr(i,0,n){
		cin>>arr[i];
		mx=max(mx,arr[i]);
	}
	if(k==0){
		cout<<mx<<endl;
		return;
	}
	ll l=1,r=1000000002;
	ll ans=mx;
	while(l<=r){
		ll mid=(l+r)/2LL;
		if(poss(mid)){
			r=mid-1;
			ans=mid;
		}
		else{
			l=mid+1;
		}
	}
	cout<<ans<<endl;
	return;
}

int main()
{
	boost();
	
	int tc=1;
	//cin>>tc;
	while(tc--)
		solve();
	return 0;
}

Measured memory_bytes: 5180
import sys
from collections import deque
input = sys.stdin.readline

class Node:
    def __init__(self, num):
        self.link = []
        self.costs = [num, num]
        self.check = False

def clear_nodes(nodes):
    for node in nodes:
        node.check = False

def main():
    N, u, v = map(int, input().split())

    nodes = [Node(N+1) for i in range(N+1)]

    for i in range(N-1):
        a, b = map(int, input().split())
        nodes[a].link.append(nodes[b])
        nodes[b].link.append(nodes[a])
    
    starts = [u, v]
    for i in range(2):
        clear_nodes(nodes)
        q = deque()
        q.append((nodes[starts[i]], 0))
        while len(q) > 0:
            node, cost = q.popleft()
            node.costs[i] = cost
            for next_node in node.link:
                if not next_node.check:
                    q.append((next_node, cost + 1))
                    next_node.check = True

    if nodes[u].costs[1] == 1:
        print(0)
        return

    clear_nodes(nodes)
    q = deque()
    ans = 0
    q.append(nodes[u])
    while len(q) > 0:
        node = q.popleft()
        ans = max(ans, node.costs[1])
        for next_node in node.link:
            if (not next_node.check) and next_node.costs[0] < next_node.costs[1]:
                q.append(next_node)
                next_node.check = True
    print(ans - 1)

    


if __name__ == "__main__":
    main()

Measured memory_bytes: 47468
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

class Main{
    public static void main(String[] a) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str;
		int sum=0;
		while((str=br.readLine()) != null) {
			if(!str.isEmpty()) {
				StringTokenizer tkn = new StringTokenizer(str, " ");
				sum = Integer.parseInt(tkn.nextToken())+Integer.parseInt(tkn.nextToken());
				System.out.println((String.valueOf(sum)).length());
			}
		}
    }
}

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


#define fo(i, n) for(i=0; i<n; i++)
#define Fo(i, k, n) for(i=k; i<n; i++)
#define w(x)  int x; cin>>x; while(x--)
#define watch(x) cout << (#x) << " is " << (x) << "\n"
#define watch2(x,y) cout <<(#x)<<" is "<<(x)<<" and "<<(#y)<<" is "<<(y)<<"\n"

#define ll  long long
#define all(c) (c).begin(),(c).end()
#define endl "\n"

typedef vector<int> vl;
typedef vector< vl > vvl;
typedef pair< int, int> pll;
typedef map< int, int> mll;
void c_p_c()
{
#ifndef ONLINE_JUDGE
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}
void parray(int a[],int n){
    for(int i=0;i<n;i++){
    cout<<a[i]<<" ";
    }
    cout<<endl;
}

int main() {
    int i,n,k;
    c_p_c();
    // cout<<"djsafa"<<endl;
  	cin>>n;
  	n=n%10;
  	if(n==3)
  		cout<<"bon"<<endl;
  	else if( n==0 or n==1 or n==6 or n==8)
  		cout<<"pon"<<endl;
  	else
  		cout<<"hon"<<endl;

    return 0;
}


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


int main()
{
    int a[]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51
    };
   int n;
   cin>>n;
   cout<<a[n-1];
   return 0;
}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
#include<math.h>
#include<algorithm> 
#define rep(i,n) for (int i = 0; i < (n) ; ++i)
using namespace std;
using ll = long long ;
using P = pair<int, int> ;
#define PI 3.14159265358979323846264338327950
#define INF 1e18

int main () {
    int n ;
    cin >> n ;
    vector<int> h (n) ;
    rep(i, n) cin >> h[i] ;
    vector<int> c (n) ;
    for(int i = n - 2; i >= 0; i--){
        if(h[i] >= h[i + 1]) c[i] = c[i + 1] + 1 ;
    }
    sort(c.begin(), c.end()) ;
    cout << c[n-1] << endl ;

}

Measured memory_bytes: 4056
N,M,K = map(int, input().split())
MOD = 998244353

MAXN = N+5
fac = [1,1] + [0]*MAXN
finv = [1,1] + [0]*MAXN
inv = [0,1] + [0]*MAXN
for i in range(2,MAXN+2):
    fac[i] = fac[i-1] * i % MOD
    inv[i] = -inv[MOD%i] * (MOD // i) % MOD
    finv[i] = finv[i-1] * inv[i] % MOD
 
def nCr(n,r):
    if n < r: return 0
    if n < 0 or r < 0: return 0
    return fac[n] * (finv[r] * finv[n-r] % MOD) % MOD

"""
・思いついた
隣り合うブロックの組であって同じ色で塗られている組の個数を、0~Kまでそれぞれ数え上げて足し合わせる

・思いつかなかった
組みの個数の場合の数を数える方法
-> 11232333 みたいな並びだと、同じ色の組は3つになっている
 これらの組みの選び方は、ブロックN個には間がN-1個あるから、ここからk個選べば良い
 （組の数なので、111だと左の11で1組、右の11で1組になる（111で三つ同じ色じゃん！とか思ってた））
  すると、選んだ間の両側にあるブロックを一つの塊とみなせるので、これはM個の色を選べる。
  残りはM-1個から選べる。
  なので、M * nCr(N-1, k) * (M-1)**(N-1-k)
  (M色取りうる奴の色の選び方 x どの位置で組を作るか x 隣り合うブロックの色が被らないものの選び方)
"""
ans = 0
for k in range(K+1):
    if k == 0:
        ans += M * pow(M-1, N-1, MOD)
        
    else:
        ans += M * nCr(N-1, k) * pow(M-1, N-k-1, MOD) 

    ans %= MOD

print(ans)

Measured memory_bytes: 34080
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
using namespace std;
char a[3][3];
int main() {
	for (int i = 0; i < 3; ++i) {
		cin >> a[i];
	}
	cout << a[0][0] << a[1][1] << a[2][2] << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll                  long long
#define ld                  long double
#define pb                  push_back
#define mkp                 make_pair
#define f(i,l,h)            for(ll i=l;i<h;i++)
#define fr(i,h,l)           for(ll i=h;i>=l;i--)
#define mem(a,val)          memset(a,val,sizeof(a))
#define all(v)              (v).begin(),(v).end()
#define ff                  first
#define ss                  second
#define fastio              ios_base::sync_with_stdio(false);cin.tie(NULL)
const ld pi=3.14159265359;
const ll mod=998244353;
const ll INF=(ll)(1e9+7);
typedef pair<ll,ll> pll;
typedef vector<ll> vll;

ll power(ll a,ll b){
    ll res=1;
	while(b){
	    if(b&1) res=(res*a);
	    a=(a*a);
	    b>>=1;
	}
	return res;
}

int main()
{
    //cout << "Hello world!" << endl;
    ll a;
    cin>>a;
    ll m=a+a*a + a*a*a;
    cout<<m<<endl;
    return 0;
}


Measured memory_bytes: 3608
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iomanip>
using namespace std;
long long int n,x,dp[101][100001],c,d,d1;
 
int main()
{
    cin>>n>>x;
    int val[n+1],wei[n+1];
    for(int i=0;i<n;i++)cin>>wei[i]>>val[i];
    for(int i=1;i<=n;i++)dp[i][0]=0;
    for(int i=0;i<=x;i++)dp[0][i]=0;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=x;j++){
            if(wei[i-1]<=j){
              d1=val[i-1],c=dp[i-1][j],d=dp[i-1][j-wei[i-1]];
                dp[i][j]=
                max(c,d+d1);
            }
            else dp[i][j]=dp[i-1][j];
            //cout<<dp[i][j]<<" ";
        }
        //cout<<"\n";
    }
    cout<<dp[n][x];
}


Measured memory_bytes: 82468
N,M = [int(i) for i in input().split()]
wars = [[int(i) for i in input().split()] for _ in range(M)]

wars.sort(key=lambda x:x[1],reverse=False)
r = set()
for war in wars:
    for i in r:
        if war[0] <= i and i <= war[1]:
            break
    else:
        r.add(war[1]-1)
    

print(len(r))

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

using namespace std;

int main() {
    
    int a,b,c;
    cin >> a >> b >> c;
    set<int> s;
    s.insert(a);
    s.insert(b);
    s.insert(c);

    if((int)s.size() != 2) cout << "No\n";
    else cout << "Yes\n";
    return 0;
}


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

int main(){
    cin.tie(0)->sync_with_stdio(false);

    string s;
    cin >> s;
    int n = (int) s.length();

	ll res = 0;
	ll tmp = 0;
	REP(bit, 1 << (n - 1)) {
		REP(i, n) {
			tmp += s[i] - '0';
			if(bit >> i & 1 || i == n - 1) {
				res += tmp;
				tmp = 0;
			}
			else tmp *= 10;
		}
	}

	cout << res << '\n';
    return 0;
}


Measured memory_bytes: 3676
#include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<cmath>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<set>
#include<map>
#include<utility>
#include<queue>
#include<vector>
#include<stack>
#include<sstream>
#include<algorithm>
/************************************************/
#define rep(i,n) for(int i=0;i<n;i++)
#define m_p make_pair
#define pb push_back
#define fr first
#define se second
#define forn(i,a,n) for(int i=a;i<n;i++)
#define foreach(i,c) for(__typeof(c.begin())i=(c.begin());i!=(c).end();i++)
#define pii pair<int,int>
#define vi vector<int>
#define ll long long
#define sz(s) s.size()
#define all(s) s.begin(),s.end()
#define zero(x) memset(x,0,sizeof(x))
#define vii vector<pair<int,int> >
#define mpis map<int,string>
#define mpii map<int,int>
#define mpsi map<string,int>
#define re return
#define mod 1000000007
/************************************************/
using namespace std;

long long get(){
	char c=getchar();
	long long x=0LL;
	while(c<'0'||c>'9')
	c=getchar();
	while(c>='0'&&c<='9'){
		x*=10LL;
		x+=(c-'0');
		c=getchar();
	}
	return x;
}
int n;
ll mx[4],mn[4];
int main(){
	ios::sync_with_stdio(0);
	cin>>n;
	rep(i,4){
		mn[i]=3e9;
		mx[i]=-3e9;
	}
	
	rep(i,n){
		ll x,y;
		cin>>x>>y;
		mx[0]=max(mx[0],x+y);
		mx[1]=max(mx[1],-x+y);
		mx[2]=max(mx[2],x+-y);
		mx[3]=max(mx[3],-x+-y);
		mn[0]=min(mn[0],x+y);
		mn[1]=min(mn[1],-x+y);
		mn[2]=min(mn[2],x+-y);
		mn[3]=min(mn[3],-x+-y);
	}
	ll ans=0;
	rep(i,4)
	ans=max(ans,mx[i]-mn[i]);
	cout<<ans;
	re 0;
}


Measured memory_bytes: 3636
#include<bits/stdc++.h>
#define FL "a"
using namespace std;
const int mod=998244353;
typedef long long ll;
inline ll read(){
  ll data=0,w=1;char ch=getchar();
  while(ch!='-'&&(ch<'0'||ch>'9'))ch=getchar();
  if(ch=='-')w=-1,ch=getchar();
  while(ch<='9'&&ch>='0')data=data*10+ch-48,ch=getchar();
  return data*w;
}
inline void file(){
  freopen(FL".in","r",stdin);
  freopen(FL".out","w",stdout);
}

int cnt[4005],c[4005][4005];
int main()
{
  int k=read(),n=read();
  for(int i=0;i<=4000;i++)
    for(int j=c[i][0]=1;j<=i;j++)
      c[i][j]=(c[i-1][j]+c[i-1][j-1])%mod;
  for(int i=1;i<=k;i++)
    for(int j=1;j<=i;j++)cnt[i+j]++;
  for(int i=2,ans;i<=2*k;i++){
    ans=0;
    for(int j=0;j<=cnt[i]&&2*j<=n;j++)
      if(j&1)ans=(ans-1ll*c[cnt[i]][j]*c[n-2*j+k-1][k-1]%mod+mod)%mod;
      else ans=(ans+1ll*c[cnt[i]][j]*c[n-2*j+k-1][k-1]%mod)%mod;
    printf("%d\n",ans);
  }
  return 0;
}


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

typedef long long ll;
typedef pair<int, int> ii;

const int N = 2e5 + 5;
int n, b;
int s[N];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> n;
    for (int i = 0; i < n - 1; ++i) {
      cin >> b;
      ++s[b - 1];
    }
    for (int i = 0; i < n; ++i) {
      cout << s[i] << endl;
    }

    return 0;
}


Measured memory_bytes: 4372
#![allow(non_snake_case)]
#![allow(unused_variables)]
#![allow(dead_code)]

fn main() {
    let (N, X): (usize, i64) = {
        let mut line: String = String::new();
        std::io::stdin().read_line(&mut line).unwrap();
        let mut iter = line.split_whitespace();
        (
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap()
        )
    };
    let L: Vec<i64> = {
        let mut line: String = String::new();
        std::io::stdin().read_line(&mut line).unwrap();
        line.split_whitespace()
            .map(|x| x.parse().unwrap())
            .collect()
    };

    let (ans, _) = L.iter().fold((1, 0), |(res, d), &l| if d + l <= X { (res + 1, d + l) } else { (res, d + l) });

    println!("{}", ans);
}

Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i<(n);++i)
using namespace std;
int main(){
	int n;
	cin>>n;
	vector<int>h(n);
	for(int i=0;i<n;i++){
		cin>>h[i];
	}
	int ans=0;
	for(int i=0;i<n;i++){
		bool flag=true;
		for(int j=0;j<i;j++){
			if(h[j]>h[i])flag=false;
		}
		if(flag)ans++;
	}
	cout<<ans<<endl;
}

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

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

    vector<int> a(n);
    int max = 0;
    for (int i = 0; i < n; i++) {
        cin >> a.at(i);
        if (i == 0) continue;
        if (max < a.at(i) - a.at(i-1)) max = a.at(i) - a.at(i-1);
    }
    if (max < a.at(0) + k - a.at(n-1)) max = a.at(0) + k - a.at(n-1);

    cout << k - max << endl;

    return 0;
}


Measured memory_bytes: 4052
///******* In the name of Allah *******///

#include <bits/stdc++.h>
using namespace std;

//long int ar[90013],br[100013];
//long int gcd(long int a, long int b)
//{
//    if(b==0)
//        return a;
//    return gcd(b,a%b);
//}
//long int sieve(long long int a)
//{
//    //long long int i,j,k = 0;
//    memset(ar,0,sizeof(ar));
//    ar[1] = 1;
//    for(i=2; i<=90013; i++)
//    {
//        if(ar[i]==0)
//        {
//            k++;
//            br[k] = i;
//            for(j=i+i; j<=90013; j+=i)
//            {
//                ar[j] = 1;
//            }
//        }
//    }
//    return br[a];
//}

void Ok()
{
    long int a[113],b[113],c,d,h,t,i,j,k,l,m,n;
    long int ans_1,ans_2,ans_3,ans_4,cnt = 0,Max,Min,flag,temp,sum;
    double aa,bb,cc,dd,ee,ff,gg;
    //char aaa[10013],bbb[10013],ccc[113],ddd;
    string spc,in;

    cin>>c>>d;
    if(c<=d)
        cout<<"unsafe"<<endl;
    else
        cout<<"safe"<<endl;


    return;
}

int main()
{
    Ok();

    return 0;
}


Measured memory_bytes: 3600
N = input()
W = list(map(int, input().split()))
S1 = 0
T =100
S = sum(W)

for i in range(int(N)):
    
    S1 = W[i] + S1
    S2 = S - S1
    if T > abs(S2 - S1):
        T = abs(S2 - S1)

print(T)

Measured memory_bytes: 3060
let () = Scanf.scanf "%d %d %d\n" @@ fun n k q ->
  let ppoint = Array.make n 0 in
  for i = 1 to q do
    Scanf.scanf "%d\n" @@ fun a -> ppoint.(a-1) <- ppoint.(a-1) + 1
  done;
  for i = 0 to n - 1 do
    if k - q + ppoint.(i) > 0 then Printf.printf "Yes\n"
    else Printf.printf "No\n"
  done;

Measured memory_bytes: 6628
use proconio::input;

#[allow(unused_assignments)]
#[allow(non_snake_case)]
fn main() {
    input! {
        A: i64,
        B: i64,
        _: i64,
        K: i64,
    }

    if K < A {
        println!("{}", K);
    } else if K < A + B {
        println!("{}", A);
    } else {
        println!("{}", A - (K - A - B));
    }
}


Measured memory_bytes: 2124
#include <iostream>
using namespace std;
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <algorithm>
#include <functional>
#include <queue>
#include <stack>
#include <vector>

#define INF 10 << 10

int n, m;
char flag[1002][1002];
char coa[3][3]; //?´???? Coat of arms
int over[1002][1002]; // ?????????

bool check(char y0x0, char y0x1, char y1x0, char y1x1) {
	if (y0x0 == coa[0][0]) {
		if (y0x1 != coa[0][1]) {
			return false;
		}
		if (y1x0 != coa[1][0]) {
			return false;
		}
		if (y1x1 != coa[1][1]) {
			return false;
		}
		return true;
	}
	return false;
}

void Over(int y, int x) {
	for (int i = y; i <= y + 1; ++i) {
		for (int i2 = x; i2 <= x + 1; ++i2) {
			++over[i][i2];
		}
	}
}

int main() {
	memset(over, 0, sizeof(over));
	memset(flag, '0', sizeof(flag));

	cin >> n >> m;
	for (int i = 1; i <= n; ++i) {
		for (int i2 = 1; i2 <= m; ++i2) {
			cin >> flag[i][i2];
		}
	}
	for (int i = 0; i < 2; ++i) {
		for (int i2 = 0; i2 < 2; ++i2) {
			cin >> coa[i][i2];
		}
	}

	int cnt = 0;
	//???????????§?????¢?´¢
	for (int i = 1; i <= n - 1; ++i) {
		for (int i2 = 1; i2 <= m - 1; ++i2) {
			if (check(flag[i][i2], flag[i][i2 + 1], flag[i + 1][i2], flag[i + 1][i2 + 1])) {
				++cnt;
				Over(i, i2);
			}
		}
	}

	//???????????????J,O,I,????????´????????????
	//(i, i2)????????????(i - 1, i2 - 1)???(i + 1, i2 + 1)??????????????°??????
	//??????????¢????????????????		???	??????(i, i2)?????????????´??????¨???????????£??????????????????????????????????????°???
	int cnt_add = 0;
	char JOI[] = { "JOI" };
	for (int i = 1; i <= n; ++i) {
		for (int i2 = 1; i2 <= m; ++i2) {
			for (int j = 0; j < 3; ++j) {
				int add = 0;
				if (check(flag[i - 1][i2 - 1], flag[i - 1][i2], flag[i][i2 - 1], JOI[j])) {
					++add;
				}
				if (check(flag[i - 1][i2], flag[i - 1][i2 + 1], JOI[j], flag[i][i2 + 1])) {
					++add;
				}
				if (check(flag[i][i2 - 1], JOI[j], flag[i + 1][i2 - 1], flag[i + 1][i2])) {
					++add;
				}
				if (check(JOI[j], flag[i][i2 + 1], flag[i + 1][i2], flag[i + 1][i2 + 1])) {
					++add;
				}
				cnt_add = max(cnt_add, add - over[i][i2]);
			}
		}
	}

	cout << max(cnt, cnt + cnt_add) << endl;

	return 0;
}

Measured memory_bytes: 7996
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long ll;
int INF = (1LL << 30) - 1;
int MOD = 1e9+7;
main(){
    string A,B;
    cin >> A >> B;
    if(A.size() > B.size()){
        cout << "GREATER" << endl;
    }else if(A.size() < B.size()){
        cout << "LESS" << endl;
    }else{
        rep(i,0,A.size()){
            if(A[i] > B[i]){
                 cout << "GREATER" << endl;
                 return 0;
            }else if(A[i] < B[i]){
                cout << "LESS" << endl;
                return 0;
            }
        }
        cout << "EQUAL" << endl;
    }
}

Measured memory_bytes: 256
import numpy as np
n,k=map(int,input().split())
exp=list(map(lambda x: (int(x)+1)/2,input().split()))
l=np.cumsum(exp)
 
ans=l[k-1]
for i in range(0,n-k):
  x=l[i+k]-l[i]
  ans=max(ans,x)
print(ans)

Measured memory_bytes: 32228
def gcd(a, b):
    tmp = a%b
    if tmp == 0:
        return b
    return gcd(b, tmp)

N = int(input())
A = list(map(int, input().split()))

g_l = [1 for i in range(N)]
g_r = [1 for i in range(N)]

g_l[0] = A[0]
g_r[-1] = A[-1]

for i in range(1, N):
    g_l[i] = gcd(A[i], g_l[i-1])
    g_r[-i-1] = gcd(A[-i-1], g_r[-i])

ans = max(g_r[1], g_l[-2])
for i in range(1, N-1):
    ans = max(ans, gcd(g_l[i-1], g_r[i+1]))

print(ans)


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

int main()
{
    int s, hh, mm, ss;
    cin >> s;

    hh = s / 3600;
    mm = (s % 3600) / 60;
    ss = s % 60;

    printf("%d:%d:%d\n", hh, mm, ss);

}

Measured memory_bytes: 3160
#include <iostream>
#include <cmath>
#include <map>
#include <vector>

using namespace std;

int main(){
    int D, N;
    cin >> D >> N;
    int out = (N == 100) ? N + 1 : N;

    switch(D)
    {
        case 0:
            cout << out << endl;
            break;
        case 1:
            cout << out * 100 << endl;
            break;
        case 2:
            cout << out * 100 * 100 << endl;
            break;
    }
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException {
		System.out.println((new Main()).fact(Integer.parseInt((new BufferedReader(new InputStreamReader(System.in))).readLine())));
	}
	private long fact(long n){return (n==0)?1:n*fact(n-1);}
}

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

#define PI 3.1415926535897932
#define MOD 1000000007
#define INF 1e9

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

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;


void solve()
{
    int A, B, K; cin >> A >> B >> K;
    if(B - A + 1 <= 2 * K)
    {
        for(int i = A; i <= B; i++) cout << i << endl;
        return;
    }
    REP(i, K) cout << A + i << endl;
    REP1(i, K) cout << B - K + i << endl;
}

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

    solve();

    return 0;
}

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

using namespace std;
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); ++i)
double const PI = 3.1415926535897932384626433;

int main() {
    int k, l;
    cin >> k;
    int g = k / 2;
    if (k % 2 == 1)
        l = g + 1;
    else
        l = g;

    cout << g * l << endl;

    return 0;
}

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

using namespace std;
#define fast	ios::sync_with_stdio(0);cin.tie(0);
#define ll 		long long int
#define INF     1e18L
#define precision(x)	fixed << setprecision(x)
const ll mod = 1e9 + 7;

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


ll powm(ll a, ll b) {
	ll res = 1;
	while (b) {
		if (b & 1)
			res = (res * 1LL * a) % mod;
		b >>= 1LL;
		a = (a * 1LL * a) % mod;
	}
	return res;
}
const int N = 1e5 + 5;

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

void solve() {
	string s;
	cin >> s;
	if (s.back() != 's') {
		s.push_back('s');
	} else {
		s.push_back('e');
		s.push_back('s');
	}
	cout << s << endl;
}

int main() {
	fast
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	int tc = 1;
	// cin >> tc;

	int _ = 0;
	while (_++ < tc) {
		solve();
	}

	return 0;
}






Measured memory_bytes: 3636
#include <string>
#include <vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<functional>
#include<list>
#include<deque>
#include<bitset>
#include<set>
#include<map>
#include<unordered_map>
#include<cstring>
#include<sstream>
#include<complex>
#include<iomanip>
#include<numeric>
#include<cassert>
#define X first
#define Y second
#define pb push_back
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define reps(X,S,Y) for (int (X) = S;(X) < (Y);++(X))
#define rrep(X,Y) for (int (X) = (Y)-1;(X) >=0;--(X))
#define repe(X,Y) for ((X) = 0;(X) < (Y);++(X))
#define peat(X,Y) for (;(X) < (Y);++(X))
#define all(X) (X).begin(),(X).end()
#define rall(X) (X).rbegin(),(X).rend()
#define eb emplace_back
#define UNIQUE(X) (X).erase(unique(all(X)),(X).end())

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<class T> using vv=vector<vector<T>>;
template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {
os<<"{"; rep(i,t.size()) {os<<t[i]<<",";} os<<"}"<<endl; return os;}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}
template<class T> inline bool MX(T &l,const T &r){return l<r?l=r,1:0;}
template<class T> inline bool MN(T &l,const T &r){return l>r?l=r,1:0;}
const ll MOD=1e9+7;

ll dp[55][1<<17];
ll modpow(ll r,ll n,ll m=MOD){
  ll re=1,d=r%m;
  if(n<0)(n%=m-1)+=m-1;
  for(;n;n/=2){
    if(n&1)(re*=d)%=m;
    (d*=d)%=m;
  }
  return re;
}

int main(){
  ios_base::sync_with_stdio(false);
  cout<<fixed<<setprecision(0);
  int n,x,y,z;
  cin>>n>>x>>y>>z;
  dp[0][1]=1;
  int s=x+y+z;
  rep(i,n)rep(j,1<<s)if(dp[i][j]){
    reps(d,1,11){
      int nxt=1;
      rep(k,s) if(j>>k&1){
	if(k<x){
	  if(k+d>x) nxt|=1;
	  else nxt|=1<<(k+d);
	}else if(k-x<y){
	  if(k-x+d>y) nxt|=1;
	  else nxt|=1<<(k+d);
	}else{
	  if(k-x-y+d>z) nxt|=1;
	  else nxt|=1<<(k+d);
	}
      }
      if(nxt>=(1<<s)) continue;
      //if(dp[i][j]) cout<<pii(i,j)<<d<<","<<nxt<<endl;
      (dp[i+1][nxt]+=dp[i][j])%=MOD;
    }
  }
  //rep(i,n+1){rep(j,1<<s) cout<<dp[i][j]<<",";cout<<endl;}
  ll re=modpow(10,n);
  rep(i,1<<s) (re-=dp[n][i])%=MOD;
  (re+=MOD)%=MOD;
  cout<<re<<endl;
  return 0;
}


Measured memory_bytes: 32128
import java.util.Scanner;
 
class Main{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int a = 0;
 
        for(int i = 1; i <= n; i++ ){
            if(i % 3 == 0){
                System.out.print(" " + i);
            }else{
                a = i;
 
            while(a > 0){
                if (a % 10 == 3){
                    System.out.print(" " + i);
                    break;
                }else{
                    a /= 10;
                }
            }
            }
        }
        System.out.println();
    }
}

Measured memory_bytes: 28364
#include <cstdio>
#include <iostream>
using namespace std;
const int MAXN = 2e5+5;
long long b[MAXN];

int main()
{
	int a;
	scanf("%d",&a);
	long long ans = 0;
	for(int i = 1;i <= a;i++)
	{
		scanf("%lld",&b[i]);
		if(b[i-1] <= b[i])
		{
			continue;
		}
		else
		{
			ans += b[i-1] - b[i];
			b[i] += b[i-1] - b[i];
		}
	}
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 5300
#include <iostream>
#include <vector>
#include <cstring>
#include <algorithm> // sort

#define REP(i, n) for (long long i = 0; i < (n); i++) 
typedef long long ll;
static const ll MOD = 1000000007;
static const ll INF = 1000000000000000000LL;
using namespace std;

char mark[4] = {'S', 'H', 'C', 'D'};
//
int main(){
    int N;
    cin >> N;

    char tmp_mark;
    int num;

    bool ari[4][13] = {};

    REP(i,N)
    {
        cin >> tmp_mark >> num;
        --num;
        REP(j,4)
        {
            if(tmp_mark == mark[j])
            {
                ari[j][num] = true;
            }
        }
    }

    REP(i,4)
    {
        REP(j,13)
        {
            if(!ari[i][j])
            {
                cout << mark[i] << " " << j+1 << endl;
            }
        }
    }

    return 0;    

}




Measured memory_bytes: 3088
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long A = sc.nextLong();
		long V = sc.nextLong();
		long B = sc.nextLong();
		long W = sc.nextLong();
		long T = sc.nextLong();

		boolean catched = false;

		long dist = Math.abs(A - B);
		long dv = V - W;

		if (dv <= 0) {
			catched = false;
		} else if (dv * T >= dist) {
			catched = true;
		}

		if (catched) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}

		sc.close();
	}
}


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

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

	vector<pii> p(n);
	map<pii,int> mp;
	for(int i=0;i<n;i++) cin>>p[i].first>>p[i].second;

	for(int i=0;i<n;i++){
		for(int j=i+1;j<n;j++) {
			mp[make_pair(p[i].first-p[j].first,p[i].second-p[j].second)]++;
			mp[make_pair(p[j].first-p[i].first,p[j].second-p[i].second)]++;
		}
	}
	int ans=0;
	for(auto t:mp) {
		ans = max(ans,t.second);
	}

	cout<<n-ans;	
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
using Graph=vector<vector<int>>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
typedef long long ll;
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;
}
int main(){
    string S,T;
    cin>>S>>T;
    int ans=1000;
    int n=S.size();
    int m=T.size();
    int l=n-m;
    rep(i,l+1){
        int cnt=0;
        rep(j,m){
            if(T[j]!=S[i+j]){
                cnt++;
            }
        }
        ans=min(ans,cnt);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 3620
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <string.h>
#include <string>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <math.h>
#include <algorithm>
#include <numeric>

using namespace std;

// マクロ&定数 ============================================================
typedef unsigned int uint;
typedef long long ll;
//typedef pair<int, int> P;

typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<double> vdouble;
typedef vector<bool> vbool;
typedef vector<string> vstring;
typedef vector<char> vchar;

typedef vector<pair<int, int>> vpint;
typedef vector<pair<ll, ll>> vpll;
typedef vector<pair<double, double>> vpdouble;

typedef vector<vector<int>> vvint;
typedef vector<vector<ll>> vvll;
typedef vector<vector<double>> vvdouble;
typedef vector<vector<bool>> vvbool;

typedef vector<vector<string>> vvstring;

const int c_YET = -1;
const int INF = 1e9 + 1;
const ll LLINF = 1e17 + 1;
const int DX[9] = { 0,0,1,-1, 1, 1, -1, -1, 0 }; // 4;４近傍
const int DY[9] = { 1,-1,0,0, 1, -1, 1, -1, 0 }; // 8:８近傍 9:(0,0)を含む
const ll MOD = 1e9 + 7; //10^9 + 7
const ll MAX = 1e9;
const double PI = 3.14159265358979323846264338327950288;
//========================================================================




int main() {

	//==================================
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(30);
	//==================================



	ll H, N;
	cin >> H >> N;

	vll A(N), B(N);
	for (ll i = 0; i < N; i++)
	{
		cin >> A[i] >> B[i];
	}



	vvll dp(N); // i番目までの魔法を使ってjだけ体力を減らすのに必要な最小の魔力


	for (ll i = 0; i < N; i++)
	{
		for (ll j = 0; j <= H; j++)
		{
			dp[i].emplace_back(LLINF);
		}
	}

	for (int h = 0; h <= H; h++)
	{
		dp[0][h] = ((h + A[0] - 1) / A[0]) * B[0];
	}


	for (ll i = 1; i < N; i++)
	{
		for (ll h = 0; h <= H; h++)
		{


			dp[i][h] = min(dp[i - 1][h], min(dp[i - 1][max(h - A[i], (ll)0)] + B[i], dp[i][max(h - A[i], (ll)0)] + B[i]));


		}
	}


	cout << dp[N - 1][H];

}



Measured memory_bytes: 80384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
#define all(x) (x).begin(), (x).end()
ll inf = LLONG_MAX;
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}

void bfs(ll n, vector<vll> &next, vll &cnt, ll start) {
  queue<ll> task;
  task.push(start);
  vll seen(n, 0);
  seen[start] = 1;
  ll depth = 0;
  while (task.size() > 0) {
    ll width = task.size();
    for (ll i = 0; i < width; i++) {
      for (ll j = 0; j < next[task.front()].size(); j++) {
        if (seen[next[task.front()][j]] == 0) {
          cnt[next[task.front()][j]] += cnt[task.front()];
          task.push(next[task.front()][j]);
          seen[next[task.front()][j]] = 1;
        }
      }
      task.pop();
    }
    depth++;
  }
  return;
}

int main() {
  ll n, q;
  cin >> n >> q;
  vll a(n - 1), b(n - 1);
  for (ll i = 0; i < n - 1; i++) cin >> a[i] >> b[i];
  vll p(q), x(q);
  for (ll i = 0; i < q; i++) cin >> p[i] >> x[i];
  vector<vll> next(n, vll(0));
  for (ll i = 0; i < n - 1; i++) {
    next[a[i] - 1].push_back(b[i] - 1);
    next[b[i] - 1].push_back(a[i] - 1);
  }
  vll cnt(n, 0);
  for (ll i = 0; i < q; i++) {
    cnt[p[i] - 1] += x[i];
  }
  bfs(n, next, cnt, 0);
  for (ll i = 0; i < n - 1; i++) cout << cnt[i] << " ";
  cout << cnt[n - 1] << endl;
}

Measured memory_bytes: 24148
#include <iostream>
#include <array>
#include <algorithm>
#include <vector>
#include <set>
#include <cmath>
#include <complex>
#include <deque>
#include <iterator>
#include <numeric>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define rep(i, k, n) for (ll i=k; i<(ll)n; ++i)
#define REP(i, n) rep(i, 0, n)
template<class T> inline bool chmax(T& a, T b) {if (a<b) {a=b; return true;} return false;}
template<class T> inline bool chmin(T& a, T b) {if (a>b) {a=b; return true;} return false;}

const ll MOD = 1000000007;
const ll HIGHINF = (ll)1e18;

ll n;
vll a;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    a.resize(n); REP(i, n) cin >> a[i];
    if (a[0] != 0) cout << -1 << '\n';
    else {
        ll ans = 0;
        rep(i, 1, n) {
            if (a[i]-a[i-1] > 1) {
                cout << -1 << '\n'; return 0;
            }
            if (a[i]-a[i-1] == 1) ans++;
            else {
                ans += a[i];
            }
        }
        cout << ans << '\n';
    }
    return 0;
}


Measured memory_bytes: 1792