akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <set>
#include <map>

using namespace std;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#ifdef DEBUG
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define eprintf(...)
#endif
#define sz(x) ((int)(x).size())
#define forn(i, n) for (int i = 0; i < (n); i++)

#ifdef _WIN32
#define LLD "%I64d"
#else
#define LLD "%lld"
#endif

#ifdef DEBUG
struct Timestamper {
  string msg;
  clock_t start;

  Timestamper(const string &_msg) : msg(_msg), start(clock()) {}
  ~Timestamper() {
    eprintf("[ %s ] Time=%.3lfs\n", msg.c_str(), (clock() - start) * 1.0 / CLOCKS_PER_SEC);
  }
} __timestamper("end");
#else
struct Timestamper {};
#endif

typedef long long ll;
typedef long double ld;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<int, ll> pil;
typedef pair<ll, ll> pll;

const int inf = 1e9;

vi as;
vvi es;
vb was;
vi vals;

void dfs(int v) {
  if (was[v]) return;
  vals.pb(as[v]);
  was[v] = true;
  for (int b : es[v])
    dfs(b);
}

int main() {
  #ifdef DEBUG
  freopen(".in", "r", stdin);
  freopen(".out", "w", stdout);
  #endif

  int n, m;
  while (scanf("%d%d", &n, &m) >= 1) {
    as.resize(n);
    for (int &x : as)
      scanf("%d", &x);
    es = vvi(n);
    forn (i, m) {
      int a, b;
      scanf("%d%d", &a, &b);
      es[a].pb(b);
      es[b].pb(a);
    }
    was = vb(n, false);

    vi avals;
    int k = 0;
    ll ans = 0;
    forn (i, n)
      if (!was[i]) {
        k++;
        vals.clear();
        dfs(i);
        sort(vals.begin(), vals.end());
        ans += vals[0];
        vals.erase(vals.begin());
        avals.insert(avals.end(), vals.begin(), vals.end());
      }
    int need = 2 * (k - 1) - k;
//    eprintf("k=%d, need=%d\n", k, need);
    if (k == 1) {
      printf("0\n");
      continue;
    }
    if (sz(avals) < need) {
      printf("Impossible\n");
      continue;
    }
    sort(avals.begin(), avals.end());
    forn (i, need)
      ans += avals[i];
    printf(LLD "\n", ans);
  }
  return 0;
}


Measured memory_bytes: 7420
def gcd(x, y):
	if y == 0:
		return x
	else:
		return gcd(y, x % y)

n=int(input())
ans=0
for i in range(1,n+1):
	for j in range(i,n+1):
		for k in range(j,n+1):
			if i!=j!=k:
				ans+=6*gcd(gcd(i,j),k)
			elif i==j==k:
				ans+=i
			else:
				ans+=3*gcd(gcd(i,j),k)
print(ans)

Measured memory_bytes: 75588
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii =  pair<int, int>;
using pll =  pair<long long, long long>;
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007LL;
constexpr long long INF = 1000000009LL;
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }


int main(){
    deque<char> que; string s; cin >> s;
    for(char c: s)que.push_back(c);
    int q; cin >> q; int rev = 0;
    rep(i, q){
        int t; cin >> t;
        if(t==1) rev++;
        else{
            int f; char c; cin >> f >> c;
            if(rev%2==0 && f==1 || rev%2==1 && f==2) que.push_front(c);
            else que.push_back(c);
        }
    }
    if(rev%2==1) reverse(all(que));
    for(auto c: que) cout << c;
    cout << ln;
}


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

int w[110], v[110];
long long dp[100010];

int main(){
	int n, W, all = 0;
	scanf("%d%d", &n, &W);
	for (int i = 0; i < n; i++){
		scanf("%d%d", &w[i], &v[i]);
		all += v[i];
	}
	memset(dp, 0x3f3f3f3f, sizeof(dp));
	dp[0] = 0;
	for (int i = 0; i < n; i++){
		for (int j = all; j >= v[i]; j--){
			dp[j] = min(dp[j], dp[j - v[i]] + w[i]);
		}
	}
	for (int i = all; i >= 0; i--){
		if (dp[i] <= W){
			printf("%d\n", i);
			return 0;
		}
	}
	return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#pragma GCC optimize("Ofast")
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 irep(it, stl) for(auto it = stl.begin(); it != stl.end(); it++)
#define drep(i,n) for(int i = (n) - 1; i >= 0; --i)
#define fin(ans) cout << (ans) << '\n'
#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;
int dx[8] = { 1, 0, -1, 0, 1, -1, -1, 1 };
int dy[8] = { 0, 1, 0, -1, 1, 1, -1, -1 };
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 int INF = INT_MAX;
const ll LLINF = 1LL << 60;
const ll MOD = 1000000007;
const double EPS = 1e-9;

int main(void) {
	int n;

	cin >> n;

	switch (n % 10) {
	case 2:
	case 4:
	case 5:
	case 7:
	case 9:
		cout << "hon" << endl;
		break;
	case 0:
	case 1:
	case 6:
	case 8:
		cout << "pon" << endl;
		break;
	case 3:
		cout << "bon" << endl;
		break;
	}



	return 0;
}

Measured memory_bytes: 3620
//  RAKSHIT KADAM
//ALWAYS USE &IT FOR ITERATING USING AUTO ...
//USE COUNT(STARTING ADDRESS, ENDING ADRESS ,VALUE) FOR FINDING THE COUNT IN THE RESPECTIVE DATA STRUCTURE
//NOTE THAT MEMSET CANT FILL THE DOUBLE VALUES;
//ACCUMULATE DOES NOT WORK PROPERLY IF VALUES START SUMMING BEYOND 1E9...
 #include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// #define ordered_set tree< int ,  null_type ,  less<int> ,  rb_tree_tag ,  tree_order_statistics_node_update>
#warning !!!check the size of arrayss!!!

// NUMERIC DEFINITIONS :
    #define INF 100000000000000005
    #define inf 1000000000
    #define MOD  1000000007
    #define newMOD  998244353
    #define MAX 300006
    #define pi 3.1415926535897932384626433832795
#define ld long double
 #define ll long long
 #define int long long

 #define P(gg) for(auto rax:gg){cout<<rax<<" ";}cout<<endl;
 #define Need_for_speed(activated) ios_base :: sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
 #define satisfy ll t; cin>> t; while(t--)
 #define inp(n) int n;cin >> n
 #define mp make_pair
 #define pb push_back
 #define endl "\n"
 #define x first
 #define y second
 #define fore(i,a,b) for(ll i=a;i<b;i++)
 #define forci(i,n) for(ll i=0;i<n;i++)
 #define vi vector<ll>
 #define Endl endl
 #define lb lower_bound
 #define ub upper_bound
#define pii pair<ll,ll>

 #define input freopen("input.txt", "r", stdin),freopen("output.txt", "w", stdout)
 #define time        cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
using namespace std;

ll gcd(ll a, ll b){if (b == 0)return a;return gcd(b, a % b);}
int power(int x, unsigned int y, unsigned int m){ if (y == 0) return 1;int p = power(x, y/2, m) % m;  p = (p * p) % m;return (y%2 == 0)? p : (x * p) % m;}
ll modInverse(int a, int m){{ return power(a, m-2, m);}}
const int maxn = 500003;
void solve()
{
    ll f[maxn]={0};;
    ll n,x;cin>>x>>n;
    ll a[n];for(ll i=0;i<n;i++)cin>>a[i],f[a[i]]=1;
    ll i=x;
    while(f[i])i++;
    ll j=x;
    while(f[j]){j--;if(j==-1)break;}
    if(abs(i-x)<abs(j-x))cout<<i<<endl;
    else cout<<j<<endl;
    
}

signed main()
{
   Need_for_speed(activated);

//satisfy
//    {
//  solve();
//   }

    solve();
    
    return 0;
}


Measured memory_bytes: 7560
get_number(Number) :-
    get_string(String),
    number_string(Number, String).

get_number(A, B) :-
    get_number(A),
    get_number(B).

get_number(A, B, C) :-
    get_number(A, B),
    get_number(C).

get_string(String) :-
    current_input(Input),
    read_string(Input, ' \n', '', _, String).

/* memo
    code(int)
    string_code(1, S, C), (C: code)
    char_code(X, Y) (X: char, Y: code)
    string_chars(S, S2) (S: string, S2: [char])
    to_lower(C, C2) (C: char? C2: code?)
    sub_string

    f(0, [], []).
    f(Z, [X|Xs], [Y|Ys]) :- X = Y, f(Z1, Xs, Ys), Z is Z1 + 1.
    f(Z, [_|Xs], [_|Ys]) :- f(Z, Xs, Ys).

    match: =, \=

    numeric: <,=<, >, >= (eval)
    lexicographically: @<. @=<, @>, @>=
    value?: =:=, =\= (eval)
    identical: ==, \==
*/

main :-
    get_number(X),
    write("ABC"),
    writeln(X).


Measured memory_bytes: 8132
#include <iostream>
#include <string>
// MISS

int main(int argc, char const *argv[])
{
    std::string S;
    int N,count = 0;
    std::cin>> S;
    N = S.size();
    for(int i = 0; i < N; i++)
        if(S[i] == '0') count++;
    
    count = (N - count < count ? N - count: count)*2;
    std::cout<<count<<std::endl;

    return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef double D;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
typedef long double ld;

#define rd(x) scanf("%d",&x)
#define rd2(x,y) scanf("%d %d",&x,&y)
#define rd3(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define rl(x) scanf("%lld",&x)
#define rl2(x,y) scanf("%lld %lld",&x,&y)
#define rl3(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define wd(x) printf("%d" ,x)
#define wd2(x,y) printf("%d %d",x,y)
#define wl(x) printf("%lld",x)
#define wl2(x,y) printf("%lld %lld",x,y)
#define PC(x) putchar(x)
#define GC() getchar()
#define NL printf("\n")
#define SP printf(" ")
 
#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++)
#define FILL(a,value) memset(a, value, sizeof(a))

#define F first
#define S second
#define MP make_pair
#define PB push_back


#define L_B lower_bound
#define U_B upper_bound

#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL)
#define fr(i,s,e) for(int i=s;i<e;i++)
#define frl(i,s,e) for(ll i=s;i<e;i++)
#define frr(i,s,e) for(int i=s-1;i>=e;i--)
#define frv(i,a) for(int i = 0;i<(int)a.size();i++)
#define frvr(i,a) for(int i = a.size()-1;i>=0;i--)
#define tr(i,a) for(typeof(a.begin()) i = a.begin(); i != a.end();i++)

#define inf (1000*1000*1000+5)
#define mod 1000000007
#define maxn 100009
#define maxr 100009

void solve()
{
	ll n,k;
	rl2(n,k);
	priority_queue<ll> q;
	fr(i,0,n)
	{
		ll x;
		rl(x);
		q.push(x);
	}
	while(k!=0&&!q.empty())
	{
		q.pop();
		k--;
	}
	ll ans=0;
	while(!q.empty())
	{
		ans+=q.top();
		q.pop();
	}
	wl(ans);
	NL;
}
int main(){
	//sstd::ios::sync_with_stdio(false); cin.tie(NULL);
	solve();
	return 0;
}

Measured memory_bytes: 2420
N, M, C = map(int, input().split())
B = list(map(int, input().split()))
A = []
for _ in range(N):
    a = list(map(int, input().split()))
    A.append(a)

ans = 0
for i in range(N):
    correct = 0
    for j in range(M):
        correct += A[i][j]*B[j]
    if correct+C > 0:
        ans += 1

print(ans)

Measured memory_bytes: 3064
//
// Created by kashi on 27-07-2020.
//
#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define ll long long
#define ff first
#define ss second
#define Endl endl
#define int long long
int gcd(int a,int b){
    return b?gcd(b,a%b):a;
}
bool cmps(pair<int,int>p1,pair<int,int>p2) {
    return p1.ss<p2.ss;
}
int lcm(int a, int b){
    return (a*b)/gcd(a, b);
}
int32_t main() {
    int n;
    cin>>n;
    string str;
    cin>>str;
    int p1=0,p2=2;
    int count=0;
    while(p2>p1){
        string s=str.substr(p1,3);
        if(s=="ABC")
            count++;
        p1++;
        if(p2!=str.size()-1)
            p2++;
    }
    cout<<count<<endl;
    return 0;
}



Measured memory_bytes: 3624
#include<iostream>

using namespace std;
void maxHeapify(int A[], int n, int i ) {
	int L = i * 2;
	int R = i * 2 + 1;

	int largest=i;
	if( L <= n && A[largest] < A[L] ) largest = L;
	if( R <= n && A[largest] < A[R] ) largest = R;
    
    if( largest != i ) {
    	swap( A[i], A[largest] );
        maxHeapify( A, n, largest );
    }
}
void buildMaxHeap(int A[], int n) {
    for ( int i = n/2; i > 0; i-- ) {
         maxHeapify( A, n, i);
    }
}

int main() {
	int n;
	cin>>n;
	int *A = new int[n+1];
	for ( int i = 1; i < n+1; ++i ) cin >> A[i];

    buildMaxHeap(A,n);
    
    for ( int i = 1; i < n+1; ++i ) cout << " " << A[i];
    cout<<endl;

	return 0;
}


Measured memory_bytes: 4992
import sys

def saiki(l,r,lst):
  if (l - 1) not in lst:
      return (l - 1)
  
  if (r + 1) not in lst:
      return (r + 1)
  
  return saiki(l - 1, r + 1, lst)

def main():
  # Xはもっとも近い整数，Nは与えられるP
  X,N = map(int, input().split())

  arr = list(map(int, input().split()))

  if N == 0:
    print(X)
    sys.exit()

  if X not in arr:
    print(X)
    sys.exit()

  print(saiki(X,X,arr))

if __name__ == '__main__':
    main()

Measured memory_bytes: 9212
#include <bits/stdc++.h>
using namespace std;
 
#define REP(i,s,n) for(int i=s; i<n; ++i)
#define rep(i,n) REP(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false
 
typedef long long ll;
typedef pair<int, int> ii;

int main() {
	
	int n;
	cin>> n;
	
	cout << (n >= 1200 ? "ARC" : "ABC") << endl;
	
	
	return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
////////////////////////////////???????????????CHECK THIS OUT???????????????//////////////////////////////
typedef long long ll;
////////////////////////////////???????????????CHECK THIS OUT???????????????//////////////////////////////
#define pii pair<int,int>
#define endl "\n"
const int N=16+1;
const int M=1e9+7;
const ll inf=1e18;
int n,id1,id2,ind,c,p1[N],p2[N],p[N],x[N],y[N];
ll ans[N],s;
signed main()
{
    cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(0);
    cin>>n;
    int g=1;
    for(int i=0;i<n;i++){
        cin>>x[i]>>y[i]>>p[i];
        ans[i]=inf;g*=3;
    }ans[n]=inf;
    for(int mask=0;mask<g;mask++){
        id1=id2=ind=s=0;c=mask;
        while(c>0 && (id1+id2)<n){
            if(c%3==1) p1[id1++]=x[ind];
            else if(c%3==2) p2[id2++]=y[ind];
            ind++;c/=3;
        }
        for(int i=0;i<n;i++){
            int mn=min(abs(x[i]),abs(y[i]));
            for(int k=0;k<id1;k++) mn=min(mn,abs(x[i]-p1[k]));
            for(int k=0;k<id2;k++) mn=min(mn,abs(y[i]-p2[k]));
            s+=1ll*mn*p[i];
        }
        ans[id1+id2]=min(ans[id1+id2],s);
    }
    for(int i=0;i<=n;i++) cout<<ans[i]<<"\n";
    return 0;
}
/*

/
*/


Measured memory_bytes: 3656
#include<stdio.h>
int main(void)
{
	long long a,b,c,d;
	scanf("%lld %lld",&a,&b);
	c=a%b;
	d=c-b;
	if(c<=-d) printf("%lld\n",c);
	else printf("%lld\n",-d);
	return 0;
}

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

ll gcd(ll a, ll b){return b!=0 ? gcd(b, a%b) : a;}
ll lcm(ll a, ll b){return a / gcd(a, b) * b;}

int main(){
	int n;
	cin >> n;
	vector<int> w(n);
	rep(i, n) cin >> w[i];
	
	vector<int> cumsum(n + 1, 0);
	rep(i, n){
		cumsum[i+1] = cumsum[i] + w[i];
	}
	
	int ans = INF;
	for(int i = 0; i < n; ++i){
		int left = cumsum[i + 1] - cumsum[0];
		int right = cumsum[n] - cumsum[i + 1];
		ans = min(ans, abs(left - right));
	}
	
	cout << ans << endl;
	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
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;
}
typedef long long int ll;

#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define endl "\n"
const double EPS = 1e-7;
const int INF = 1 << 30;
const ll LLINF = 1LL << 60;
const double PI = acos(-1);
const int MOD = 1000003;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

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

const int MAX = 5000000;

ll fac[MAX], finv[MAX], inv[MAX];

void COMinit() // 二項係数を求める時は前処理としてCOMinit()をする
{
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++)
    {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k)
{
    if (n < k)
        return 0;
    if (n < 0 || k < 0)
        return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

ll pow_mod(ll n, ll k, ll mod)
{
    if (k == 0)
    {
        return 1;
    }
    else if (k % 2 == 1)
    {
        return pow_mod(n, k - 1, mod) * n % mod;
    }
    else
    {
        ll t = pow_mod(n, k / 2, mod);
        return t * t % mod;
    }
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    COMinit();
    ll q;
    cin >> q;
    for (ll i = 0; i < q; i++)
    {
        ll x, d, n;
        cin >> x >> d >> n;
        if (d == 0)
        {
            cout << pow_mod(x, n, MOD) << endl;
            continue;
        }
        if (n >= MOD)
        {
            cout << 0 << endl;
            continue;
        }
        ll a = x * inv[d] % MOD;
        ll ans = pow_mod(d, n, MOD);
        (ans *= fac[a + n - 1] * finv[a - 1] % MOD) %= MOD;
        cout << ans << endl;
    }
}

Measured memory_bytes: 118144
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		new Main().run();
	}

	private void run() {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int q = scanner.nextInt();
		int[] num = new int[300001];
		for (int i = 0; i < n; i++) {
			int x = scanner.nextInt();
			num[x] = x;
		}
		for (int i = 0; i < 300000; i++) {
			num[i + 1] = Math.max(num[i], num[i + 1]);
		}
		int ans = 0;
		for (int i = 0; i < q; i++) {
			int x = scanner.nextInt();
			ans = 0;
			for (int j = x; j <= 300000; j += x) {
				ans = Math.max(ans, num[j - 1] % x);
			}
			ans = Math.max(ans, num[300000] % x);
			System.out.println(ans);
		}

	}
}

Measured memory_bytes: 144092
#include<iostream>
using namespace std;
int main()
{
	int w,h,x,y,r;
	cin>>w>>h>>x>>y>>r;
	int Px=x-r,Py=y-r;
	int Ax=x+r,Ay=y+r;
	if((Px>=0 && Py >=0) && (Ax<=w && Ay<=h))cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}


Measured memory_bytes: 3104
#include<iostream>
#include<math.h>
#include<stdio.h>
using namespace std;

int stringers_number(int a)
{
	return int(log10(a) + 1);
}

int extract_the_number(char *n1,char *n2)
{
	int data_size1=0;
	int data_size2=0;
	for (data_size1=0;!(*(n1+data_size1)=='\0');data_size1++){}
	for (data_size2=0;!(*(n2+data_size2)=='\0');data_size2++){}
	/*int data_size1 = sizeof(n1) / sizeof(n1[0]);
	int data_size2 = sizeof(n2) / sizeof(n2[0]);*/
	/*for (i=0;i<=data_size-1;i++)
		if (a[i] == ' ')
			break; */
	int a1=0;
	int j=0;
	for (j=0;j<=data_size1 - 1;j++){
		int j_keta = int(*(n1+(sizeof n1[0])*j)) - 48;
		a1 = a1 + (pow(10,(data_size1 - j - 1))) * j_keta;
	}
	int a2=0;
	int k=0;
	for (k=0;k<=data_size2 - 1;k++){
		int k_keta = int(*(n2+(sizeof n2[0])*k)) - 48;
		a2 = a2 + (pow(10,(data_size2 - k - 1)))*k_keta;
	}
	return a1+a2;
}

int main()	
{
	char n1[100];
	char n2[100];
	while(cin >> n1 && cin >> n2){
		/*cin >> n1;
		cin >> n2;*/
		cout << stringers_number(extract_the_number(n1,n2)) << endl;
	}
	return 0;
}

Measured memory_bytes: 1204
function Main(input) {
    var C = 1e+9 + 7;
    var C2 = 1e+5;
    input = input.trim().split("\n").map(function(x) { return x.split(" ")});
    var N = parseInt(input[0][0], 10);
    var K = parseInt(input[0][1], 10);
    var vec_A = input[1].map(e => parseInt(e, 10));
    vec_A.sort((a, b) => Math.abs(b) - Math.abs(a));

    var ans = calc(vec_A, N, K, C, C2);
    console.log(mod(ans, C));

}

function calc(vec_A, N, K, C, C2){
    var ans = 1;
    var minusCount = 0;
    var minPlus;
    var minMinus;
    for (var i = 0; i < K; i++){
        ans = kakeruR(ans, vec_A[i], C, C2);
        if (ans === 0) return 0
        if (vec_A[i] > 0) minPlus = i;
        if (vec_A[i] < 0) {
            minMinus = i;
            minusCount ++;
        }
    }
    if (K === N) return ans;
    if (minusCount % 2 === 0) return ans;

    if (minusCount < K) {
        // console.log("here", minMinus, minPlus);
        var tmp01 = [0, 0, -1];
        var tmp02 = [0, 0, -1];
        for (var i = K; i < N; i++){
            if (vec_A[i] < 0){
                tmp01 = [vec_A[i], vec_A[minPlus], i];
                break;
            }
        }
        for (var i = K; i < N; i++){
            if (vec_A[i] > 0){
                tmp02 = [vec_A[i], vec_A[minMinus], i];
                break;
            }
        }
        if (tmp02[2] === -1){
            vec_A.splice(K, tmp01[2] - K);
            vec_A.splice(minPlus, 1);
        } else if (tmp01[2] === -1){
            vec_A.splice(K, tmp02[2] - K);
            vec_A.splice(minMinus, 1);
        } else if (BigInt(tmp01[0]) * BigInt(tmp02[1]) >= BigInt(tmp02[0]) * BigInt(tmp01[1])){
            vec_A.splice(K, tmp01[2] - K);
            vec_A.splice(minPlus, 1);
        } else {
            vec_A.splice(K, tmp02[2] - K);
            vec_A.splice(minMinus, 1);
        }
        // console.log(vec_A);
        
        ans = 1;
        for (var i = 0; i < K; i++){
            ans = kakeruR(ans, vec_A[i], C, C2);
            if (ans === 0) return 0
        }
        return ans;
    } else {
        // console.log("there");
        for (var i = K; i < N; i++){
            if (vec_A[i] >= 0){
                vec_A.splice(K, i - K);
                vec_A.splice(minMinus, 1);
                ans = 1;
                for (var i = 0; i < K; i++){
                    ans = kakeruR(ans, vec_A[i], C, C2);
                    if (ans === 0) return 0
                }   
                return ans;
            }
        }
        // console.log("reached?");
        ans = 1;
        for (var i = N - 1; i >= (N - K); i--){
            ans = kakeruR(ans, vec_A[i], C, C2);
        }
        return ans;
    }
}

function kakeruR(a, b, C, C2){
	var tmpQ, tmpR, ans;
  	tmpQ =  (b / C2 | 0);
    tmpR =  b - (tmpQ * C2);
    ans = (a * tmpQ % C) * C2 % C + (a * tmpR);
  	ans %= C;
  return ans;
}

function mod(i, j) {
    return (i % j) < 0 ? (i % j) + 0 + (j < 0 ? -j : j) : (i % j + 0);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8")); 

Measured memory_bytes: 52860
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
tt=0
tt_1=0
tt_2=0
b=0
c=0

t_list=[]
t_list_2=[]
for val in h:
	tt=t-(val*0.006)
	t_list.append(tt)

for val in t_list:
	tt=abs(a-val)
	t_list_2.append(tt)

t_list_2=sorted(t_list_2)
tt=t_list_2[0]
tt_1=a+tt
tt_2=a-tt

def my_index(t_list,x,default=False):
	if x in t_list:
		return t_list.index(x)
	else:
		return -1
b=my_index(t_list,tt_1)
c=my_index(t_list,tt_2)
if my_index(t_list,tt_1) == -1:
	print(c+1)
else :
	print(b+1)

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

int main(){
    int a,b,c,d;
    cin >> a >> b >> c >> d;
    while(a > 0 || c > 0){

        c = c - b;
        if(c <= 0){
            break;
        }
        a = a - d;
        if(a <= 0){
            break;
        }
    }
    if(c <= 0){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 3672
inputString = gets.chomp()
inputStringLength = inputString.length

answeredFlag = 0

("a".."z").each do |i|
  flag = 0
  answerString = ""
  inputStringLength.times do | j |
    if inputString[j] == i
      flag = 1
    end
  end
  if flag == 0
    print i
    answeredFlag = 1
    break
  end
end

if answeredFlag == 0
  print "None"
end

Measured memory_bytes: 1916
#include<stdio.h>
int A, B, C, i;
int main(){
  scanf("%d%d%d", &A, &B, &C);
  for(i=0; i<B; i++){
    if((A*i)%B == C){
      printf("YES\n");
      return 0;
    }
  }
  printf("NO\n");
}


Measured memory_bytes: 128
base = input("")
term = base.split(' ')
W = int(term[0])
H = int(term[1])
x = int(term[2])
y = int(term[3])
r = int(term[4])

if((x - r >= 0 and W >= (x + r))
    and (y - r >= 0 and H >= (y + r))):
    print("Yes")
else:
    print("No")



Measured memory_bytes: 5596
import java.util.*;
import java.io.*;
import static java.lang.Math.*;

class Main {

    public static void main( final String[] args ) {

	final Scanner stdin = new Scanner( System.in );

	while ( true ) {

	    final int n = stdin.nextInt();
	    final int m = stdin.nextInt();

	    if ( n == 0 && m == 0 ) {
		break;
	    }

	    final ArrayList<Integer> list = new ArrayList<Integer>();
	    for ( int i = 1; i <= n; i++ ) {
		list.add( i );
	    }
	    
	    int index = n - 1;
	    while ( list.size() > 1 ) {
		index = ( index + m ) % list.size();
		//System.err.println( index + " " + list.get( index ) );
		list.remove( index );
		index--;
	    }
	    System.out.println( list.get( 0 ) );
	    //System.err.println(  );
	}	
    }    
}

Measured memory_bytes: 17336
import std.stdio,
    std.array,
    std.conv,
    std.string,
    std.algorithm;

void main(){
  int kane = 100000;
  string s;
  for(;;){
    s=readln();
    if(stdin.eof()) break;
    int weeks = to!int(chomp(s));
    for(int i = 0;i < weeks; ++i){
      kane = kane + cast(int)(kane/100)*5;
      if(kane > cast(int)(kane/1000)*1000){
        kane = cast(int)(kane/1000)*1000 + 1000;
      }
    }
    writeln(kane);
  }
}

Measured memory_bytes: 2408
#include <cstdio>
#include <iostream>
#include <cmath>
using namespace std;

typedef long long LL;

const int N = 105;

int n, K, cnt[N];
int main() {
	scanf("%d%d", &n, &K);
	for (int i = 1; i <= K; i++) {
		int x = 0;
		scanf("%d", &x);
		while (x--) {
			int c; scanf("%d", &c);
			cnt[c]++;
		}
	}
	int ans = 0;
	for (int i = 1; i <= n; i++) if (!cnt[i]) ans++;
		printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 3200
#include<iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>
#include<cstdlib>

using namespace std;

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


int main(){
    int k, n;
    cin >> k >> n;
    int a[n];
    rep(i, n) cin >> a[i];
    int d[n];
    rep(i, n - 1){
        d[i] = a[i+1] - a[i];
    }
    d[n-1] = k - a[n-1] + a[0];
    // rep(i, n) cout << d[i] << endl;

    sort(d, d + n);
    cout << k - d[n-1] << endl;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define debug(num) cerr << #num << " " << num << endl;
#define F0(itr, limit) for(int itr=0;itr<limit;itr++) 
#define F(itr, init, limit) for(int itr=init;itr<limit;itr++) 
#define FR(itr, init, limit) for(int itr=init;itr>limit;itr--) 
#define Fll(itr,limit) for(long long itr=0;itr<limit;itr++) 
#define coutarr(list_name) for(auto it: list_name) cout << it << " ";
#define cinarr(list_name) for(auto &it: list_name) cin >> it;
#define sz(list_name) (int)((list_name).size())
#define all(list_name) (list_name).begin(), (list_name).end()
#define ll long long
#define pb push_back
#define vi vector<int>
#define vll vector<ll>
#define vvi vector<vector<int>>
#define vvll vector<vector<ll>>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define umap unordered_map
#define endl "\n"
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
using namespace std;
// "If I die here, then I'm a man that could only make it this far."



int main()
{
    IOS;
    int n;
    cin >> n;
    vll a(10050, 0);
    F(i, 1, 105)
    {
        F(j, 1, 105)
        {
            F(k, 1,105)
            {
                ll ans = i*i + j*j + k*k + i*k + k*j + j*i;
                if(ans < 10050) a[ans]++;
            }
        }
    }
    F0(i, n)
    {
        cout << a[i+1] << endl;
    }
	return 0;
}


Measured memory_bytes: 3668
#include <stdio.h>

int main(){

    long N=0;
    long temp=0;
    long count=0;
    int leng=0;

    scanf("%ld",&N);


    while(N>0){
    temp=N;

    leng=0;
    while(temp!=0){
        temp=temp/10;
        leng++;
    }

    if(leng%2==1){
        count++;
    }else{

    }

    N--;

    }

    printf("%ld\n",count);




    return 0;
}

Measured memory_bytes: 128
#include "bits/stdc++.h"
#define ALL(obj) (obj).begin(),(obj).end()
#define RALL(obj) (obj).rbegin(),(obj).rend()
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define REPR(i, n) for(int i = (int)(n); i >= 0; i--)
#define FOR(i,n,m) for(int i = (int)(n); i < int(m); i++)
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;
const int INF = 1e9 + 6;
const ll LLINF = 4e18;

int main() {
    int n; cin >> n;
    vector<int> v(n);
    REP(i, n) {
        cin >> v[i];
    }
    sort(ALL(v));
    double ans = v[0];
    REP(i, n) {
        ans = (ans + v[i]) / 2;
    }
    cout << ans << endl;
    getchar(); getchar();
}

Measured memory_bytes: 256
n = int(input())
b = list(map(int, input().split()))
s=0
if n==2:
  print(b[0]*2)
else:
  if(b[0]<b[1]):
  	s = b[0]*2+b[-1]
  else:
  	s = b[0]+b[1]+b[-1]
  for i in range(1,n-2):
  	s+=min(b[i],b[i+1])
    
  print(s)

Measured memory_bytes: 3064
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int k = sc.nextInt();
        int n = 0;
        int ans = 0;
        for(int i=100; i>=0; i--){
            if(a%i==0 && b%i==0){
                n = n + 1;
                if(n==k){
                    ans = i;
                    break;
                }
            }
        }
        System.out.println(ans);
    }
}

Measured memory_bytes: 22736
n, x, y = map(int, input().split())
ans = [0] * (n)
dist = [[-1] * (n + 1) for _ in range(n + 1)]


def dist(a, b):
    if b < a:
        a, b = b, a
    p = b - a
    q = abs(b - y) + abs(a - x) + 1
    return min(p, q)


for i in range(1, n + 1):
    for j in range(i + 1, n + 1):
        ans[dist(i, j)] += 1
print(*ans[1:], sep="\n")


Measured memory_bytes: 78684
#!/usr/bin/env ruby

require 'set'

class Hash
  def push(key, value)
    self[key] = [] if self[key] == nil
    self[key].push(value)
  end
end

class Array
  def lower_bound(value)
    left = -1;
    right = self.length;
    while left + 1 < right
      mid = left + (right - left) / 2;
      if self[mid] >= value
        right = mid
      else
        left = mid
      end
    end
    right
  end

  def unique
    res = [self.first]
    each_cons(2) do |a, b|
      if a != b
        res.push(b)
      end
    end
    res
  end
end

def get_ints
  gets.chomp.split.map(&:to_i)
end

def get_ints_minus_one
  get_ints.map { |x| x - 1 }
end

def get_int
  gets.chomp.to_i
end

H, W, K = get_ints
C = Array.new(H) { [] }
H.times do |i|
  C[i] = gets.chomp.split('')
end

def bit_search(bit_num)
  for x in [*0...2**bit_num]
    # true, falseの配列がyieldされる
    yield x.to_s(2).rjust(bit_num, '0').split('').map { |s| s == '1' }
  end
end

ans = 0

bit_search(H) do |h_arr|
  bit_search(W) do |w_arr|
    count = 0
    C.each.with_index do |row, h_index|
      next if h_arr[h_index]

      row.each.with_index do |cell, w_index|
        count += 1 if cell == '#' && !w_arr[w_index]
      end
    end
    ans += 1 if count == K
  end
end

puts ans


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

int main(void){
    int a,b,c,d,e,k;
    cin>>a>>b>>c>>d>>e>>k;
    if(e-a>k)
        cout<<":("<<endl;
    else
        cout<<"Yay!"<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define show(x)  cerr << #x << " = " << (x) << endl;
using namespace std;

template<typename T>
ostream& operator << (ostream& os, vector<T>& v){
	rep(i,v.size()){ os << v[i] << (i == v.size() - 1 ? "" : " "); } return os;
}
template<typename T>
istream& operator >> (istream& is, vector<T>& v){
	for(T& x: v){ is >> x; } return is;
}

int main(){
	string s;
	long long k;
	cin >> s >> k;

	rep(i,s.size()){
		if(s[i] == '1' and k == i + 1){
			cout << 1 << endl;
			return 0;
		}else if(s[i] != '1'){
			cout << s[i] << endl;
			return 0;
		}
	}
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define si(a) scanf("%d", &a)
#define fore(i,a,b) for(int i = a; i < b; ++i)
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
typedef vector<int> vi;
vector<vector<int> > gr;
vi out;
vi ans;
vector<bool> visited;
vi aux;
void dfs(int u){
	visited[u] = true;
	//ans[u] = max(ans[u], val);
	fore(j,0,gr[u].size()){
		if(!visited[ gr[u][j] ])
			dfs(gr[u][j]);
		//ans[u] = max(ans[u], ans[ gr[u][j] ] + 1);
	}
	aux.push_back(u);
}
void solve(){
	int n,m;
	si(n); si(m);
	int x,y;
	gr.assign(n+1,vector<int>());
	out.assign(n+1,0);
	ans.assign(n+1,0);
	vector<pi> inv(m);
	aux.reserve(n);
	vi in(n+1);
	visited.assign(n+1,false);
	fore(i,0,m){
		si(x);si(y);
		inv[i] = pi(x,y);
		out[x]++;
		in[y]++;
	}
	fore(i,1,n+1)
		gr[i].reserve( in[i] );
	fore(i,0,m){
		x = inv[i].first;
		y = inv[i].second;
		gr[x].push_back(y);
	}
		
	fore(i,1,n+1)
		if(!visited[i])
			dfs(i);
	vi dp(n+1);
	//printf("aux: ");for(int i:aux) printf("%d ", i);printf("\n");
	for(int v: aux){
		if(gr[v].size() == 0)
			dp[v] = 0;
		else{
			int k = 0;
			for(int u: gr[v])
				k = max(k, dp[u]);
			dp[v] = k+1;
		}
	}
	int anss = 0;
	//printf("dp: ");for(int i:dp) printf("%d ", i);printf("\n");
	
	for(int i: dp)
		anss = max(anss, i);
	
	printf("%d\n", anss);
}
int main(){
	solve();
	return 0;
}

Measured memory_bytes: 13452
N, M, X = map(int, input().split())

CA = []
for i in range(N):
    CA.append(list(map(int, input().split())))
    
ans = 10**10
flag = False
for i in range(2 ** N):
    purchase = [0] * N
    for j in range(N):
        if ((i >> j) & 1):
            purchase[N - 1 - j] = 1
    money = 0
    skill = [0] * M
    for j in range(N):
        if purchase[j] == 1:
            money += CA[j][0]
            for k in range(1, M+1):
                skill[k-1] += CA[j][k]
    if min(skill) >= X:
        ans = min(ans, money)
        flag = True

if flag:
    print(ans)
else:
    print(-1)

Measured memory_bytes: 9224
use proconio::input;

fn main() {
    input! {
        n: usize,
        mut p: [(i32, i32, i32); n],
    };
    p.reverse();
    let mut p0 = (0, 0, 0);
    let mut p1 = if let Some(p1) = p.pop() {
        p1
    } else {
        println!("Yes");
        return;
    };
    let mut res = true;
    loop {
        let t = p1.0 - p0.0;
        let xd = p1.1 - p0.1;
        let yd = p1.2 - p0.2;
        if (t % 2 != (xd + yd).abs() % 2) || (xd.abs() + yd.abs() > t) {
            res = false;
            break;
        }
        p0 = p1;
        p1 = if let Some(p1) = p.pop() {
            p1
        } else {
            break;
        };
    };
    if res {
        println!("Yes");
    } else {
        println!("No");
    }
}


Measured memory_bytes: 4548
#include<bits/stdc++.h>
#define ll long long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
static const ll MAX = 1000000000000000;
static const int NIL = -1;
using namespace std;
const long double EPS = 0.0000000001;
const long double PI = (acos(-1));
const int MOD = 1000000007;

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

vector<ll> m(1001,0);

void prime_factorize(long long N) {

    for (long long a = 2; a * a <= N; ++a) {
        if (N % a != 0) continue;
        long long ex = 0; // exponential

        // divide as much as you can
        while (N % a == 0) {
            ++ex;
            N /= a;
        }

        // push the result
        m[a] += ex;
    }

    // last num (if the lasting n is prime number and not 1)
    if (N != 1) m[N] += 1;
}


int main(){
    ll n; cin >> n;
    vector<ll> tmp;
    ll ans = 1;

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

    for(int i = 2; i <= 1000; i ++){
        ans *= (m[i]+1);
        ans %= MOD;
    }

    cout << ans;

    return 0;
}

Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;

#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define range(i,a,n) for(int i=(a);i<(n);i++)

#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI 3.1415926535897932384

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};

template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S acm(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
void YN(bool b){cout<<(b?"YES":"NO")<<"\n";}
void Yn(bool b){cout<<(b?"Yes":"No")<<"\n";}
void yn(bool b){cout<<(b?"yes":"no")<<"\n";}
int sgn(const double&r){return (r>EPS)-(r<-EPS);} // a>0  : sgn(a)>0
int sgn(const double&a,const double&b){return sgn(a-b);} // b<=c : sgn(b,c)<=0

ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s;a=0;} return os;}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll x;
	ll ans=0;
	cin>>x;
	rep(i,1000000*6){
		ll sum=i*100;
		if((x-i*100)>=0&&(x-i*100)<=i*5)ans=1;
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int n;
    cin>>n;
    std::map<int, int> map;
    for (int i=1;i<=n;i++) {
        map.emplace(i,0);
    }
    int a;
    for (int j=0;j<n-1;j++) {
        cin>>a;
        map.at(a)++;
    }
    for (auto itr=map.begin();itr!=map.end();itr++) {
        cout<<itr->second<<endl;
    }
}

Measured memory_bytes: 12976
#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
const long long mod = 1e9+7;
//////////////////////////////////

int main() {
  int x; cin >> x;
  x /= 200;
  cout << 10 - x << endl;

  return 0;
}

// EOF

Measured memory_bytes: 3612
from collections import Counter, defaultdict

a2z = 'abcdefghijklmnopqrstuvwxyz'

n = int(input())
ss = [input() for _ in range(n)]

ans = Counter(ss[0])

for ctr in map(Counter, ss):
    ans = {c: min(x, ctr[c]) for c, x in ans.items()}

ans = defaultdict(int, ans)
print(''.join(map(lambda x:x*ans[x], a2z)))

Measured memory_bytes: 3436
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int H = sc.nextInt();
		int W = sc.nextInt();
		char[][] S = new char[H + 2][W + 2];
		for (int i = 1; i <= H; i++) {
			String str = sc.next();
			for (int j = 1; j <= W; j++) {
				S[i][j] = str.charAt(j - 1);
			}
		}
		String[] result = search(S,H,W);
		for(String str: result) {
			System.out.println(str);
		}
	}

	private static String[] search(char[][] S, int H, int W) {
		String[] result = new String[H];
		//8方向探索用の配列。上から時計回りに値を格納
		int[] x = { 0, 1, 1, 1, 0, -1, -1, -1 };
		int[] y = { 1, 1, 0, -1, -1, -1, 0, 1 };
		for (int i = 1; i <= H; i++) {
			result[i-1] = "";
			for (int j = 1; j <= W; j++) {
				if (!"#".equals(String.valueOf(S[i][j]))) {
					int count = 0;
					for (int k = 0; k < 8; k++) {
						int dx = j + x[k];
						int dy = i + y[k];
						if ("#".equals(String.valueOf(S[dy][dx]))) {
							count++;
						}
					}
					result[i-1] += String.valueOf(count);
				}else {
					result[i-1] += "#";
				}
			}
		}
		return result;
	}
}


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

int main(void)
{
  int n, x = 0;
  bool a[100] = {0};
  cin >> n;
  int d[n];
  for (int i = 0; i < n; i++) {
    cin >> d[i];
    if (a[d[i]]) continue;
    a[d[i]] = true;
    x++;
  }
  cout << x << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <numeric>
#include <cstring>
#include <cmath>
#include <set>
#include <queue>
#include <stack>

const int MOD = 1e9 + 7;
const int iINF = 1000000000;
const long long int llINF = 1000000000000000000;
#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;
using ll = long long int;
using P = pair<int, int>;
using edge = struct
{
    int to;
    int cost;
};

int dp[110][10010];
int N, W, v[1010], w[1010];

int main()
{
    cin >> N >> W;
    rep(i, N) cin >> v[i] >> w[i];

    rep(i, W) dp[0][i] = 0;

    rep(i, N)
    {
        for (int j = 0; j <= W; j++)
        {
            if (j < w[i])
                dp[i + 1][j] = dp[i][j];
            else 
                dp[i + 1][j] = max(dp[i][j], dp[i][j - w[i]] + v[i]);
        }
    }

    cout << dp[N][W] << endl;
    return 0;
}


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

int main(void){
    // Your code here!
    
    char s[20];
    scanf("%s",s);
    int len,count=0,cnt=0;
    
    len = strlen(s);
    
    int i;
    if(s[0] == 'A'){
        for(i=2; i<len-1; ++i){
            if(s[i] == 'C'){
                count++;
            }
        }
        for(i=0; i<len; ++i){
            if( islower(s[i]) == 0 ) cnt++;
        }
        if( count == 1 && cnt == 2 ){
            printf("AC");
            return 0;
        }
        
    }
    
    printf("WA");
    return 0;
}


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

char table[8][8] ;

void f(){
	char tmp[8][8] ;
	for( int y=0 ; y<8 ; y++ ){
		for( int x=0 ; x<8 ; x++ ){
			tmp[y][x] = table[7-x][y] ;
		}
	}
	swap( table , tmp ) ;
}

main(){
	
	for( int i=0 ; i<8 ; i++ )
		for( int j=0 ; j<8 ; j++ )
			cin >> table[i][j] ;
	
	for( int i=90 ; i<360 ; i+=90 ){
		cout << i << endl ;
		f() ;
		for( int j=0 ; j<8 ; j++ ){
			for( int k=0 ; k<8 ; k++ ) cout << table[j][k] ;
			cout << endl ;
		}
	}
}

Measured memory_bytes: 1140
#include <bits/stdc++.h>
using namespace std;
const long long INF = 123456789;
const long long MOD = 1000000007;
const long double PI = 3.1415926;
#define FOR(i, r, n) for (ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i, r, n) for (ll i = (ll)(n - 1); i >= r; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define RALL(x) x.rbegin(), x.rend()
typedef long long int ll;
typedef vector<ll> vi;
typedef vector<pair<ll, ll>> vp;
typedef vector<string> vs;
typedef vector<char> vc;
typedef list<ll> lst;
typedef pair<ll, ll> P;

ll n, m, k, ans = 0, sum = 0, cnt = 0;
string s;
char c;

#define Endl endl

/*--------------------template--------------------*/

class UF
{
  public:
    vi rank, p;
    UF() {}
    UF(ll size)
    {
        rank.resize(size, 0);
        p.resize(size, 0);
        REP(i, size)
        {
            makeSet(i);
        }
    }

    void makeSet(ll x)
    {
        p[x] = x;
        rank[x] = 0;
    }

    bool same(ll x, ll y)
    {
        return findSet(x) == findSet(y);
    }

    void unite(ll x, ll y)
    {
        link(findSet(x), findSet(y));
    }

    void link(ll x, ll y)
    {
        if (rank[x] > rank[y])
        {
            p[y] = x;
        }
        else
        {
            p[x] = y;
            if (rank[x] == rank[y])
            {
                rank[y]++;
            }
        }
    }

    ll findSet(ll x)
    {
        if (x != p[x])
        {
            p[x] = findSet(p[x]);
        }
        return p[x];
    }
};

int main()
{
    ll n, a, b, q, t;
    cin >> n >> q;
    UF ds = UF(n);

    REP(i, q)
    {
        cin >> t >> a >> b;
        if (t == 0)
        {
            ds.unite(a, b);
        }
        else if (t == 1)
        {
            if (ds.same(a, b))
            {
                cout << 1 << endl;
            }
            else
            {
                cout << 0 << endl;
            }
        }
    }
}

Measured memory_bytes: 3284
#include "bits/stdc++.h"

typedef long long ll;
typedef long long int lli;
const int MOD = 1000000007;
#define rep(i,n) for (int i = 0; i < (n); i++)

using namespace std;

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

	int N, D; cin >> N >> D;
	vector< vector<int> > ver(N, vector<int>(D));
	rep(i, N) {
		rep(j, D) { cin >> ver[i][j]; }
	}

	int res = 0;
	rep(x, N) {
		for (int y = x + 1; y < N; y++) {
			double sum = 0;
			rep(z, D) {
				sum += pow(ver[x][z] - ver[y][z], 2);
			}
			sum = sqrt(sum);
			if (sum == (int)sum) {
				res++;
			}
		}
	}
	cout << res << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <complex>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

typedef complex<double> Vector;

const double EPS = 1e-9;

bool inRange(int a, int x, int b) {
    return a <= x && x < b;
}

char get(const vector<string> &f, int r, int c) {
    if(!inRange(0, r, f.size()) || !inRange(0, c, f[0].size())) return 0;
    return f[r][c] == '#';;
}

bool eqv(double a, double b) {
    return fabs(a-b) < EPS;
}

struct Point {
    double angle;
    bool inc;

    Point() {}
    Point(double a, bool i) : angle(a), inc(i) {}

    bool operator < (const Point &other) const {
        return angle < other.angle;
    }
};

int main() {
    int R, C;
    cin >> R >> C;

    vector<string> f(R);
    for(int i = 0; i < R; ++i) {
        cin >> f[i];
    }

    vector<Point> v;
    for(int r = -1; r < R; ++r) {
        for(int c = -1; c < C; ++c) {
            int pat = 0;
            pat |= get(f, r, c) << 3;
            pat |= get(f, r, c+1) << 2;
            pat |= get(f, r+1, c) << 1;
            pat |= get(f, r+1, c+1) << 0;

            if(pat == 0x1 || pat == 0xe) {
                double angle = atan2(R-r-1, c+1);
                v.push_back(Point(angle, false));
                //cout << r << ' ' << c << '(' << angle << ')' << " false" << endl;
            }
            else if(pat == 0x8 || pat == 0x7) {
                double angle = atan2(R-r-1, c+1);
                v.push_back(Point(angle, true));
                //cout << r << ' ' << c << '(' << angle << ')' << " true" << endl;
            }
        }
    }

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

    int cnt = 1;
    int ans = 1;
    for(int i = 0; i < v.size(); ++i) {
        if(v[i].inc) ++cnt;
        else --cnt;
        if(i+1 < v.size() && eqv(v[i].angle, v[i+1].angle)) continue;

        //cout << "i=" << i << ' ' << cnt << endl;
        ans = max(ans, cnt);
    }

    cout << ans << endl;

    return 0;
}

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

class main
{
    public static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        long[] a = new long[n];
        string[] e = Console.ReadLine().Split(' ');
        for (int i = 0; i < n; i++)
            a[i] = long.Parse(e[i]);

        Console.WriteLine("{0} {1} {2}",a.Min(),a.Max(),a.Sum());
    }
}

Measured memory_bytes: 10244