akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define repr(i,from,to) for(int (i)=(from);(i)<(to);(i)++)
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
// const bool debug=true;
const bool debug=false;
#define DEBUG if(debug==true)
#define all(x) begin((x)), end((x))
#define vprint(x) for(auto a:(x)) cout << x << endl;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll MOD = 1000000007;
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) { a = b; return true;}
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) { a = b; return true;}
    return false;
}


int main(void) {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,a,b,c;
    cin>>n>>a>>b>>c;
    vector<string> s(n);
    map<char, ll> cnt;
    cnt['A'] = a;
    cnt['B'] = b;
    cnt['C'] = c;
    rep(i,n) {
        cin>>s[i];
    }
    vector<char> res;
    rep(i,n) {
        char c1 = s[i][0],c2 = s[i][1];
        if (cnt[c1]<=0 && cnt[c2]<=0) {
            cout << "No" << endl;
            return 0;
        }
        if (cnt[c1]>cnt[c2]) {
            cnt[c1]--;cnt[c2]++;
            res.push_back(c2);
        }
        else if (i<n-1&&cnt[c1]==cnt[c2]) {
            if(s[i+1][0] == c1 || s[i+1][1] == c1) {
                cnt[c1]++;cnt[c2]--;
                res.push_back(c1);
            }
            else {
                cnt[c1]--;cnt[c2]++;
                res.push_back(c2);
            }
        }
        else {
            cnt[c1]++;cnt[c2]--;
            res.push_back(c1);
        }
    }
    cout << "Yes" << endl;
    for(auto x:res) {
        cout << x << endl;
    }
    return 0;
}


Measured memory_bytes: 6696
#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define p push_back
#define v vector

int main(){
    int n;
    cin>>n;
    if(n<=1999 && n>= 1800){
        cout<<1;
    }
    else if(n<=1799 && n>=1600 ){
        cout<<2;
    }
   else  if(n<=1599 && n>=1400 ){
        cout<<3;
    }
   else  if(n<=1399 && n>=1200 ){
        cout<<4;
    }
   else  if(n<=1199 && n>=1000 ){
        cout<<5;
    }
   else  if(n<=999 && n>=800 ){
        cout<<6;
    }
   else  if(n<=799 && n>=600 ){
        cout<<7;
    }
   else  if(n<=599 && n>=400 ){
        cout<<8;
    }
    return 0;
}

Measured memory_bytes: 3632
#include <stdio.h>
void swap(int *a,int *b){
    int temp;
    if(*a>*b){
        temp=*a;
        *a=*b;
        *b=temp;
    }
    
}




int main(){
    int x,y;
    while(1){
        scanf("%d%d",&x,&y);
        if(x==0&&y==0)
            break;
        swap(&x,&y);
        printf("%d %d\n",x,y);
    }
     
    
    return 0;
    
}



Measured memory_bytes: 2028
#include<iostream>
#include<vector>
#include<string>
#include<cstring>
#include<algorithm>
#include<map>
#include<set>
#include<cmath>
#include<cassert>
#include<queue>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;

int main() {
	ll A, B;
	char op;
	cin >> A >> op >> B;
	if (op == '+') cout << A+B << endl;
	else cout << A-B << endl;
	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    char str[100000];
    int i,sum=0,q,p;
    scanf("%d",&q);
    getchar();
    gets(str);
    for(i=0;i<q-1;i++){
      if(str[i]==str[i+1])
        sum++;
    }
    p=q-sum;
    printf("%d",p);

}


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

int p[100010];

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

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

    int ans=0;

    for(int i=0;i<n;i++)
    {
        if(p[i]==i){ans++;i++;}
    }

    cout<<ans<<"\n";

    return 0;
}


Measured memory_bytes: 4004
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define il inline
#define outy printf("Yes\n")
#define outn printf("No\n")
#define outf printf("First\n")
#define outs printf("Second\n")
#define FOR(a,b,c) for(int a=b;a<=c;a++)
#define FORD(a,b,c) for(int a=b;a>=c;a--)
#define FORL(a,b) for(int a=head[b];a;a=nxt[a])
#define in(a)  a=read()
#define in2(a,b)  a=read(),b=read()
#define in3(a,b,c)  a=read(),b=read(),c=read()
#define in4(a,b,c,d)  a=read(),b=read(),c=read(),d=read()
#define inl(a)  a=readl()
#define inl2(a,b)  a=readl(),b=readl()
#define inl3(a,b,c)  a=readl(),b=readl(),c=readl()
#define inl4(a,b,c,d)  a=readl(),b=readl(),c=readl(),d=readl()
#define out(a) printf("%d\n",a)
#define out2(a,b) printf("%d %d\n",a,b)
#define out3(a,b,c) printf("%d %d %d\n",a,b,c)
#define out4(a,b,c,d) printf("%d %d %d %d\n",a,b,c,d)
#define outl(a) printf("%lld\n",a)
#define outl2(a,b) printf("%lld %lld\n",a,b)
#define outl3(a,b,c) printf("%lld %lld %lld\n",a,b,c)
#define outl4(a,b,c,d) printf("%lld %lld %lld %lld\n",a,b,c,d)
#define clr(x,y) memset(x,y,sizeof(x))
inline int read(){
    char c;int s=0,t=1;
    while(!isdigit(c=getchar()))if(c=='-')t=-1;
    do{s=s*10+c-'0';}while(isdigit(c=getchar()));
    return s*t;
}
inline ll readl(){
    char c;ll s=0;int t=1;
    while(!isdigit(c=getchar()))if(c=='-')t=-1;
    do{s=s*10+c-'0';}while(isdigit(c=getchar()));
    return s*t;
}
/*------------------------------------------------------------*/
#define mod 1000000007
#define maxn 100010
#define inf 0x7fffffff
/*------------------------------------------------------------*/

int main(){
	string s;
	cin>>s;
	s[3]='8';
	cout<<s;
}

Measured memory_bytes: 256
n=int(input())

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

A=0

for i in range(1,n-1):
    if p[i-1]<p[i]<p[i+1] :
        A=A+1
    elif p[i-1]>p[i]>p[i+1]:
        A=A+1

print(A)


Measured memory_bytes: 3064
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
typedef long long int ll;

string S;

int main(){
	cin >> S;
	int cnt1 = 0, cnt2 = 0;
	string k = "keyence";
	for(int i = 0; i < 7; i++){
		if(S[i] != k[i]) break;
		cnt1++;
	}
	for(int i = S.length() - 1; i >= 0; i--){
		if(S[i] != k[i - (S.length() - 7)]) break;
		cnt2++;
	}
	if(cnt1 + cnt2 >= 7) printf("YES\n");
	else printf("NO\n");
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define LL long long
#define M 2000005
int n;
struct Node {
	LL a,b;
} A[M];
bool cmp(Node a,Node b) {
	return a.b<b.b;
}
int main() {
	scanf("%d",&n);
	for(int i=1; i<=n; i++)scanf("%lld%lld",&A[i].a,&A[i].b);
	sort(A+1,A+1+n,cmp);
	LL Now=0,flag=1;
	for(int i=1; i<=n; i++) {
		Now+=A[i].a;
		if(Now>A[i].b) {
			flag=0;
			break;
		}
	}
	printf(flag?"Yes":"No");
}

Measured memory_bytes: 4352
//***Little by little one travels far***
 
#include<bits/stdc++.h>
using namespace std;
 
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define ll long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i,n) for(i=0;i<n;i++)
#define forn(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define for1(i, n) for (ll i = 1; i <= (ll)(n); ++i)
#define ford(i, n) for (ll i = (ll)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define fora(it,x) for(auto it:x)
#define PI 3.14159265
#define sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define endl "\n"
 
typedef pair<ll, ll> pii;
typedef vector<ll> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef long double ld;
 
template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }

int main()
{
  string s;
  cin>>s;
  ll c=0;

  for(ll i=0;i<s.length();i++){
    if(s[i]!=s[s.length()-1-i])
    c++;
  }
  cout<<c/2;
}

Measured memory_bytes: 256
import java.util.*;
public class Main{
 
  public static void main(String[] args){
   Scanner scanner = new Scanner(System.in);
    String[] S = scanner.nextLine().split("");
    int mind = 0;
    for(String x : S){
      if(x.equals("+")){
      mind++;
      }else{
      mind--;
      }
    }
    System.out.println(mind);
  }
  
}

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

// https://qiita.com/EqualL2/items/b3c2530c458f8450d390
bool is_prime(const unsigned n){
    switch(n){
        case 0: // fall-through
        case 1: return false;
        case 2: // fall-through
        case 3: return true;
    } // n > 3 が保証された

    if(n%2 == 0) return false;
    if(n%3 == 0) return false;
    // 2と3の倍数でないので6の倍数ではないことが保証された

    if(n%6 != 1 && n%6 != 5) return false;
    // 6の倍数前後の数(素数かもしれない数)であることが保証された

    // 6の倍数前後の数を使って試し割りをする
    for(unsigned i=5;i*i<=n;i+=6){
        if(n%i     == 0) return false; // 6n-1
        if(n%(i+2) == 0) return false; // 6n+1
    }

    return true;
}

int main() {
    long long N;
    cin >> N;
    long long count=0;
    long long res[100];
    for (int i = 1; i*5+1 <= 55555; i++) {
        if(is_prime(i*5+1)){
            res[count]=i*5+1;
            count++;
        }
        if(count==N){
            break;
        }
        
    }
    for ( int i = 0; i < N; i++ ){
        cout << ( i ? " " : "" ) << res[i];
    }
    cout << endl;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define IO ios_base::sync_with_stdio(false)
#define  ll  long long
ll a[300000];
int main()
{
    IO;
    ll i, j=1, k = 0, mod = 1e9+7, m, n, n1, m1, l = 0, p, t, h, cnt=0; long  double b;
    cin>>n>>b; b*=n; n=b;

    cout<<n<<endl;
    return 0;
}


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

#define maxN 100005
#define oo 1000000007
#define fto(i, a, b) for (int i = a; i <= b; ++i)
#define fdto(i, a, b) for (int i = a; i >= b; --i)
#define sci(x) scanf("%d", &x)
#define scii(x, y) scanf("%d %d", &x, &y)
#define pri(a) printf("%d ", a)
#define pril(a) printf("%d\n", a)
#define pril2(a, b) printf("%d %d\n", a, b)
#define vi vector<int>
#define ii pair<int, int>
#define vii vector<ii>
#define iii pair<int, ii>
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define ll long long
#define bug(a) cout << #a << "=" << a << ";" << endl
#define bug2(a, b) cout << #a << "=" << a << ";  " << #b << "=" << b << ";" << endl
#define sz(a) (int)a.size()

using namespace std;

int n, m, p[maxN];
pair<ii, int> dinh1[maxN], dinh2[maxN];
vector<iii> canh;

void initSet(int n) {
    fto(i, 1, n) p[i] = i;
}

int findSet(int i) {
    return ((p[i] == i) ? i : (p[i] = findSet(p[i])));
}

void unionSet(int i, int j) {
    p[findSet(i)] = findSet(j);
}

bool issameSet(int i, int j) {
    return (findSet(i) == findSet(j));
}

int main() {
//    #ifndef ONLINE_JUDGE
//        freopen("tmp.inp", "r", stdin);
//        freopen("tmp.out", "w", stdout);
//    #endif // ONLINE_JUDGE

    sci(n);
    fto(i, 1, n) {
        int u, v; scii(u, v);
        dinh1[i] = mp(mp(u, v), i);
        dinh2[i] = mp(mp(v, u), i);
    }

    sort(dinh1+1, dinh1+n+1);
    sort(dinh2+1, dinh2+n+1);
    fto(i, 1, n) {
        if (i+1 <= n) canh.pb(mp(abs(dinh1[i].ff.ff-dinh1[i+1].ff.ff), mp(dinh1[i].ss, dinh1[i+1].ss)));
        if (i-1 >= 1) canh.pb(mp(abs(dinh1[i].ff.ff-dinh1[i-1].ff.ff), mp(dinh1[i].ss, dinh1[i-1].ss)));
    }
    fto(i, 1, n) {
        if (i+1 <= n) canh.pb(mp(abs(dinh2[i].ff.ff-dinh2[i+1].ff.ff), mp(dinh2[i].ss, dinh2[i+1].ss)));
        if (i-1 >= 1) canh.pb(mp(abs(dinh2[i].ff.ff-dinh2[i-1].ff.ff), mp(dinh2[i].ss, dinh2[i-1].ss)));
    }
    initSet(n);
    sort(canh.begin(), canh.end());
    ll ans = 0, cnt = 0;
    fto(i, 0, sz(canh)-1) {
        int w = canh[i].ff;
        int u = canh[i].ss.ff, v = canh[i].ss.ss;
        if (cnt == n-1) break;
        if (issameSet(u, v)) continue;
        ans += w;
        ++cnt;
        unionSet(u, v);
    }

    cout << ans << '\n';

    return 0;
}



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

#define forn(i,n) for(int i=0;i<int(n);i++)
#define forsn(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
#define dforsn(i,s,n) for(int i=(int)(n-1);i>=int(s);i--)
#define si(a) ((int)(a).size())
#define pb emplace_back
#define mp make_pair
#define endl '\n'
#define all(a) a.begin(),a.end()
#define fastio ios_base::sync_with_stdio(false); cin.tie(0)
#define filein(a) freopen(a,"r",stdin)
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long int tint;

int main() {
	fastio;

	tint n,a,b;
	cin >> n>>a>>b;
	if(a<=b&&(n>1||(n==1 && a==b)))cout << ((n-1)*b+a) - (((n-1)*a+b)-1) << endl;
	else cout << 0 << endl;



	return 0;
}



Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define MOD (1000000007l)
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)

using namespace std;

void solve() {
  ll H, W, N;
  cin >> H >> W >> N;
  ll ans = 0;
  ll foo = max(H, W);
  ans += N / foo;
  N %= foo;
  if (N) ans ++;
  cout << ans << endl;
}

int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout.precision(12);
  cout << fixed;
  solve();
  return 0;
}


Measured memory_bytes: 256
//
// Created by Hideaki Imamura on 2019-07-04.
//

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

ll gcd(ll a, ll b) {
    if (a < b) {
        ll tmp = a;
        a = b;
        b = tmp;
    }

    while (b > 0) {
        ll tmp = a;
        a = b;
        b = tmp % b;
    }

    return a;
}

int main() {
    ll n, x, xs[100010], tmp, d;
    cin >> n >> x;
    for(int i = 0; i < n; ++i) {
        cin >> tmp;
        xs[i] = x - tmp;
        if (xs[i] < 0) xs[i] = - xs[i];
    }

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

    cout << d << endl;
    return 0;
}

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

const int[] type_small  = [0, 9, 10, 11, 20];
const int[] type_middle = [0, 1, 2, 10, 11, 12, 20, 21, 22];
const int[] type_big    = [0, 9, 10, 11, 18, 19, 20, 21, 22, 29, 30, 31, 40];
const int[] center = [10, 11, 20];
const int[] type_max = [20, 22, 40];

bool search_pos(int[] field, int start, ref int[][] pos, int drops) {
  foreach(i; start..100) {
    if (field[i] >= 1) {
      foreach(int index, type; [type_small, type_middle, type_big]) {
        // match
        if ((type_max[index] + i) < field.length && find!((x) => field[i + x] == 0)(type).array == []) {
          auto new_pos = pos ~ [index, center[index] + i];
          foreach(ref k; type) field[k + i] -= 1;
          bool result = search_pos(field, i, new_pos, drops);
          if (result && new_pos.length == drops) {
            pos = new_pos;
            return true;
          }
          foreach(ref k; type) field[k + i] += 1;
        }
      }
      return false;
    }
  }
  return true;
}

void main() {
  int drops = readln.chomp.to!(int);
  int[] field;
  foreach(i; 0..10) {
    field ~= readln.chomp.split(" ").map!(to!(int)).array;
  }
  int[][] pos;
  if (!search_pos(field, 0, pos, drops)) throw new Exception("illegal answer");
  foreach(p; pos) {
    writefln("%d %d %d", p[1] % 10, p[1] / 10, p[0] + 1);
  }
}

Measured memory_bytes: 2024
#include <iostream>
#include <stdio.h>
#include <cstring>
#include <cstdio>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <utility>
#include <fstream>
//#include <random>
#include <map>
#include <set>
//#include <unordered_map>
#include <cstdlib>
#include <functional>
#include <time.h>
//#include <chrono>
#include <sstream>
#include <iomanip>
#include <numeric>
#include <iostream>
#include <limits>
#include <numeric>
//#include <type_traits>
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define INF 1000000001
#define MOD 1000000007
#define SORT(s) sort(s.begin(), s.end());
#define REVERSE(s) reverse(s.begin(), s.end());
#define SUM(s) accumulate(s.begin(), s.end(), 0LL);
#define P pair<int,int>
#define mp make_pair
#define valid(x,y,h,w) (0<=x&&x<h&&0<=y&&y<w)
//#define int ll
int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };
int ndx[8] = { 0,1,0,-1, 1,1,-1,-1 };
int ndy[8] = { 1,0,-1,0, 1,-1,-1,1 };
double pi = 3.141592653589793;
using namespace std;
int POW(int x, int y) { return int(pow(double(x), double(y))); }
double log(double a, double b) { return log(b) / log(a); }


int main() {
	int n;
	cin >> n;
	vector<int> a(10005);
	FOR(x, 1, 102) {
		FOR(y, 1, 102) {
			FOR(z, 1, 102) {
				int s = x * x + y * y + z * z + x * y + y * z + z * x;
				if (s < 10005) {
					a[s]++;
				}
			}
		}
	}

	rep(i, n) {
		cout << a[i + 1] << endl;
	}
}








Measured memory_bytes: 3636
import java.util.*;
import java.lang.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int year = Integer.parseInt(s.substring(0, 4));
		int month = Integer.parseInt(s.substring(5, 7));
		int day = Integer.parseInt(s.substring(8, 10));
		if (year > 2019 || (year == 2019 && month > 4)) {
			System.out.println("TBD");;
		} else {
			System.out.println("Heisei");
		}
	}
}

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

int main(){
    int n, m, l; 
    long long A[100][100], B[100][100], C[100][100];
    
    cin >> n >> m >> l;
    
    
    for(int i=0; i<n; i++){
        for(int j=0; j<m ; j++){
            cin >> A[i][j];
        }
    }
    
    for(int i=0; i<m; i++){
        for(int j=0; j<l; j++){
             cin >> B[i][j];
        }
    }
    
    for(int i=0; i<n; i++){
        for(int j=0; j<l; j++){
           C[i][j] =0;
           
           for(int k=0; k<m; k++){
                C[i][j] += A[i][k] * B[k][j];
           }
        }
    }
    
    for(int i=0; i<n; i++){
        for(int j=0; j<l; j++){
            if(j) cout<<" ";
            cout << C[i][j];
        }
        cout << endl;
    }
    
    return 0;
}


Measured memory_bytes: 3300
#include<stdio.h>
#include<math.h>
#define MAX 100
#define iNFINITY 100000

int m[MAX][MAX];

int min(int i,int q){
  if(i>q) return q;
  else return i;
}

void matrix(int p[],int pl){
  int n=pl;
  int i,l,j,k;
  int q;
  for(i=1;i<=pl;i++) m[i][i] =0;
  for(l=2;l<=n;l++){
    for(i=1;i<=n-l+1;i++){
      j=i+l-1;
      m[i][j] = iNFINITY;
      // if(m[i][j]>15125) printf("a\n");
      for(k=i;k<=j-1;k++){
       q=m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
       //printf("%d %d\n",q,m[i][j]);
       if(m[i][j]>q) m[i][j] =q;
       //printf("%d\n",m[i][j]);
	}
      // printf("%d\n",m[i][j]);
    }
  }
}

int main(){
  int n;
  int i;
  int retu[MAX];
  int gyou[MAX];
  int p[MAX+100];
  scanf("%d",&n);

  for(i=0;i<n;i++){
    scanf("%d %d",&retu[i],&gyou[i]);
    }
  for(i=0;i<n+1;i++){
    if(i==0) p[i]=retu[0];
    else if(i==n) p[i]=gyou[n-1];
    else p[i]=retu[i];
    //printf("%d ",p[i]);
  }
   matrix(p,n);
  printf("%d\n",m[1][n]);
}





Measured memory_bytes: 2104
#include <iostream>
#include <set>
#include <map>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <deque>
#include <stack>
#include <climits>
#include <math.h>
using namespace std;
#pragma warning(disable : 4996)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;





int main() {
#ifdef _DEBUG
	freopen("input1.txt", "r", stdin);
	freopen("output2.txt", "w", stdout);
#endif
	ll a, b, c;
	cin >> a >> b >> c;
	ll d = (c - a - b);
	if (d < 0) {
		cout << "No";
		return 0;
	}
	if (4 * a * b < d * d) {
		cout << "Yes";
	}
	else {
		cout << "No";
	}
} 

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pii  pair<int,int>
#define vpii vector<pii>
#define vll  vector<ll>
#define vi  vector<int>
#define pb push_back
#define f  first
#define s  second
 
  int binaryExponentiation(int x,int n)
{
    if(n==0)
        return 1;
    else if(n%2 == 0)       
        return binaryExponentiation(x*x,n/2);
    else                            
        return x*binaryExponentiation(x*x,(n-1)/2);
}  

int main() {

   int a,b,c,k;
   cin>>a>>b>>c>>k;
   
   int arr[3] = {a,b,c};
   
   sort(arr,arr+3);
   //cout<<arr[0]+arr[1]+(binaryExponentiation(arr[2],k)*binaryExponentiation(2,k-1));
   for(int i=0;i<k;++i){
       arr[2]*=2;
   }
   cout<<arr[0]+arr[1]+arr[2];
	return 0;
}

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

#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define mp make_pair
#define pb push_back
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define dbg(x) cerr<<__LINE__<<": "<<#x<<" = "<<(x)<<endl

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
const int inf = (int)1e9;
const double INF = 1e12, EPS = 1e-9;

int n, d[1000];
unordered_set<int> s;

int main(){
	cin >> n;
	rep(i, n) cin >> d[i];
	rep(i, n){
		int x = 0;
		for(int j = i; j < n; j++){
			x *= 10;
			x += d[j];
			if(x > 100000) break;
			s.insert(x);
		}
	}
	for(int i = 0; ; i++) if(!s.count(i)){
		cout << i << endl;
		break;
	}
	
	return 0;
}

Measured memory_bytes: 3204
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int H = sc.nextInt();
			int W = sc.nextInt();
			if (H == 0 && W == 0) {
				break;
			}
			for (int i = 0; i < H; i++) {
				for (int j = 0; j < W; j++) {
					System.out.printf("#");
				}
				System.out.printf("\n");
			}
			System.out.printf("\n");
		}
	}
}



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

using namespace std;

int main() {
    int x;
    cin >> x;
    if(x >= 400 && x <= 599) cout << 8;
    else if(x >= 600 && x <= 799) cout << 7;
    else if(x >= 800 && x <= 999) cout << 6;
    else if(x >= 1000 && x <= 1199) cout << 5;
    else if(x >= 1200 && x <= 1399) cout << 4;
    else if(x >= 1400 && x <= 1599) cout << 3;
    else if(x >= 1600 && x <= 1799) cout << 2;
    else if(x >= 1800 && x <= 1999) cout << 1;
    return 0;
}


Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
int convert(string s)
{
  int g=2;
  int ans=0;
  for(auto i:s)
  {ans+=int(i-'0')*pow(10,g);g--;}
 // cout<<ans<<"\n";
  return ans;
}
int main()
{
 string s;
  cin>>s;
  int ans=int(1e9);
  for(int i=0;i<s.length()-2;i++)
  {
  	//cout<<s.substr(i,3)<<"\n";
    int diff = abs(convert(s.substr(i,3))-753);
    //cout<<diff<<"\n";
    if(diff<ans)
      ans=diff;
  }
  cout<<ans<<"\n";
  
  return 0;
}


Measured memory_bytes: 384
// #include "h_grid.h"
#include <iostream>
#include <string>
#include <vector>

using Grid = std::vector<std::string>;

namespace {

constexpr int modulo{1'000'000'007};

} // namespace

int num_paths(const Grid& grid)
{
    std::vector<long long> prev(grid.front().size() + 1);
    std::vector<long long> current = prev;
    prev[1] = 1;

    for (size_t row = 0; row < grid.size(); ++row) {
        for (size_t col = 0; col < grid.front().size(); ++col) {
            if (grid[row][col] == '#')
                current[col + 1] = 0;
            else
                current[col + 1] = (prev[col + 1] + current[col]) % modulo;
        }
        std::swap(prev, current);
    }
    return prev.back();
}

int main(int argc, char* argv[])
{
    size_t num_rows, num_cols;
    std::cin >> num_rows >> num_cols;
    Grid grid;
    grid.reserve(num_rows);
    for (size_t i = 0; i < num_rows; ++i) {
        std::string row;
        std::cin >> row;
        grid.push_back(row);
    }
    std::cout << num_paths(grid) << std::endl;
    return 0;
}


Measured memory_bytes: 1280
#include <stdio.h>

int main(){
    int list[100];
    int data;
    int i;
    int max = 0;
    for(i=0;i<100;i++){
        list[i] = 0;
    }
    while(scanf("%d",&data)!=EOF){
        list[data-1] += 1;
        if(list[data-1]>max)max = list[data-1];
    }
    for(i=0;i<100;i++){
        if(list[i]==max){
            printf("%d\n",i+1);
        }
    }
}

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

int main() {
    int t;
    //cin>>t;
    t=1;
    while(t--){
        int x;
        //x=t;
        cin>>x;
        int angle = 0;
        int res = 0;
        while (angle != 360) {
            angle += x;
            if (angle > 360) {
                angle -= 360;
            }
            res++;
        }
     
        cout << res << endl;
    }
}



Measured memory_bytes: 3580
#include <iostream>
#include <vector>
#include <functional>
using namespace std;
using ll = long long;
template<class T> using vec = vector<T>;
template<class T> using vvec = vector<vec<T>>;

struct edge{
    int to,id;
};

int main(){
    int N;
    cin >> N;
    vvec<edge> g(N);
    for(int i=0;i<N-1;i++){
        int a,b;
        cin >> a >> b;
        a--; b--;
        g[a].push_back({b,i});
        g[b].push_back({a,i});
    }
    vec<int> col(N,0);
    int K = 0;
    for(int i=0;i<N;i++) K = max(K,(int) g[i].size());
    
    function<void(int,int,int)> dfs = [&](int cur,int par,int c){
        int cid = 1;
        for(auto& e:g[cur]) if(e.to!=par){
            if(cid==c) cid++;
            col[e.id] = cid;
            dfs(e.to,cur,cid);
            cid++;
        }
    };

    dfs(0,-1,-1);
    cout << K << endl;
    for(int i=0;i<N-1;i++) cout << col[i] << endl;
}

Measured memory_bytes: 9216
#include <bits/stdc++.h>
#define int long long
#define f first
#define s second
using namespace std;
const int mod=1e9+7;
int32_t main(){
    if(fopen("input.txt", "r"))
    freopen("input.txt", "r", stdin),
    freopen("output.txt", "w", stdout);
    ios::sync_with_stdio(0),cin.tie(0);
    int n,k;
    cin >> n >> k;
    int sum=0;
    for(int i=k;i<=n+1;i++){
        sum+=(i*n%mod+(mod-i*(i-1)%mod)%mod+1)%mod;
        sum%=mod;
    }
    cout << sum;
}

Measured memory_bytes: 3656
#include <iostream>
using namespace std;
typedef long long ll;
ll N,A[100010],B[100010];
int main(){
	cin >> N;
	for(int i=1;i<=N;i++){
		cin >> A[i] >> B[i];
	}
	ll ans = 0,add = 0;
	for(int i=N;i>=1;i--){
		A[i] += add;
		if(A[i]%B[i]==0) continue;
		ans += B[i]-A[i]%B[i];
		add += B[i]-A[i]%B[i];
	}
	cout << ans << endl;
}

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

using namespace std;

int N;
string S;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	
	cin >> S;
	N = (int)S.size();
	
	if (S[N - 1] == 's') {
		S += "es";
	} else S += "s";
	
	cout << S << "\n";
	
	return 0;
}


Measured memory_bytes: 3660
#include <bits/stdc++.h>
using namespace std;
#define rep(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(v) v.begin(), v.end()
using ll = long long;
const ll MOD = 1e9+7; ll LLINF = 1LL << 60; int INF = INT_MAX;

//

int main(){
    int n; cin>>n;
    string s; cin>>s;
    vector<int> box(n,0);
    vector<int> cum(n,0); //右を数える
    rep(i,0,n){
        if(s[i]=='E') box[i]++;
    }
    cum[0]=box[0];
    rep(i,1,n){
        cum[i]=cum[i-1]+box[i];
    }
    int ans=INF;
    rep(i,0,n){
        if(i==0){
            ans=min(ans,cum[n-1]-cum[i]);
            continue;
        }
        ans=min(ans,i-cum[i-1]+cum[n-1]-cum[i]);
    }
    cout<<ans<<endl;

}

Measured memory_bytes: 3076
#include <iostream>
using namespace std;
int N;
int A[100005];
int cnt[2];
void Read()
{
    cin >> N;
    for(int i = 1; i <= N; i++)
    {
        int val;
        cin >> val;
        cnt[val % 2]++;
    }
}

void Solve()
{
    if(N == 1)
    {
        cout << "YES\n";
        return;
    }
    if(cnt[1] == 2 && cnt[0] == 0)
    {
        cout << "YES\n";
        return;
    }
    if(cnt[1] % 2 == 0)
    {
        cout << "YES\n";
        return;
    }
    cout << "NO\n";
}
int main()
{
    Read();
    Solve();
    return 0;
}


Measured memory_bytes: 256
#coding: utf-8

N = int(input())
array = list(map(int, input().split()))
currentMinI = 30 # log_2 pow(10, 9) = 9 log_2 10 ≒ 9/0.3010 = 29.9
for n in array:
    i = 0
    while (n & (1 << i)) == 0:
        i += 1
    currentMinI = min(currentMinI, i)
print(currentMinI)


Measured memory_bytes: 2940
def readinput():
    n=int(input())
    a=list(map(int,input().split()))
    return n,a

def main(n,a):
    tgt=1
    count=0
    for i in range(n):
        if a[i]==tgt:
            tgt+=1
        else:
            count+=1
    if count==n:
        return -1
    else: 
        return count

if __name__=='__main__':
    n,a=readinput()
    ans=main(n,a)
    print(ans)


Measured memory_bytes: 32380
package main

import (
	"fmt"
	"strings"
)

func main() {
	var n int
	var s string

	fmt.Scan(&n)
	fmt.Scan(&s)
	sSlice := strings.Split(s, "")
	result := 0

	for i := 0; i < n-2; i++ {
		if strings.Join(sSlice[i:i+3], "") == "ABC" {
			result = result + 1
		}
	}
	fmt.Println(result)
}


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

int main(int argc, char const *argv[]) {
    int n;
    string s;
    cin >> n >> s;

    int ans = 1;
    char pre = s[0];
    for (size_t i = 1; i < n; i++) {
        if (s[i] != pre) {
            ans++;
            pre = s[i];
        }
    }

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


Measured memory_bytes: 3760
import collections

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

x = dict(collections.Counter(A))
ans = sum(k * v for k, v in x.items())
for _ in range(Q):
    B, C = map(int, input().split())
    b = x.get(B, 0)
    c = x.get(C, 0)

    ans -= b * B
    ans += b * C

    x[C] = c + b
    x[B] = 0

    print(ans)

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

#define int long long

const int LLINF = 1LL << 60;

struct Edge {
  int from, to, cost;
};

main()
{
  int N, M;
  Edge E[2005];
  int mc[2005];
  bool negative[2005] = {};
  
  cin >> N >> M;

  for(int i = 0; i < M; i++) {
    int a, b, c;
    cin >> a >> b >> c; --a, --b;
    E[i] = (Edge) { a, b, -c };
  }
  
  fill_n(mc, 1005, LLINF);
  mc[0] = 0;
  
  for(int i = 0; i < N; i++) {
    bool update = false;

    for(int j = 0; j < M; j++) {
      Edge e = E[j];
      if(mc[e.from] != LLINF && mc[e.to] > mc[e.from] + e.cost) {
	mc[e.to] = mc[e.from] + e.cost;
	update = true;
	if(i == N - 1) {
	  negative[e.to] = true;
	}
      }
    }
    if(!update) break;
  }
  
  for(int i = 0; i < N; i++) {
    for(int j = 0; j < M; j++) {
      negative[E[j].to] |= negative[E[j].from];
    }
  }

  if(negative[N - 1]) cout << "inf" << endl;
  else cout << -mc[N - 1] << endl;

  return (0);
}


Measured memory_bytes: 256
#include<iostream>
using namespace::std;
int main(){
int a[3];
int max = 0;
int min = 100;
for(int i=0;i<3;i++){
  cin>>a[i];

  if(max<a[i]){
    max=a[i];
  }
  if(min>a[i]){
    min=a[i];
  }
}
cout<<max-min;
}

Measured memory_bytes: 256
import sys
read = sys.stdin.buffer.read
input = sys.stdin.readline
input = sys.stdin.buffer.readline


#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode()


def main():
	n=II()

	pf={}
	for i in range(2,int(n**0.5)+1):
		while n%i==0:
			pf[i]=pf.get(i,0)+1
			n//=i
	if n>1:pf[n]=1
	#print(pf)

	li={}
	for k in pf:
		li[pf[k]]=li.get(pf[k],0)+1
	#print(li)

	p=[]
	for i in range(10):
		p+=[i]*(i+1)
	#print(p)

	ans=0
	for i in li:
		ans+=li[i]*p[i]
	print(ans)







if __name__ == "__main__":
	main()


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

using namespace std;
typedef long long LL;


int main() {

  string s;
  cin >> s;
  vector<int> vals =  {0};
  string ns;

  for(int i=0; i<s.size(); i++) {
    if(s[i] == 'x') {
      vals.back()++;
      continue;
    }
    vals.push_back(0);
    ns += " ";
    ns.back() = s[i];
  }

  for(int i=0; i<ns.size(); i++) {
    if(ns[i] != ns[ns.size()-1-i]){
      cout << -1 << endl;
      return 0;
    }

  }
  int ans = 0;
  for(int i=0; i<vals.size()/2; i++) {
    ans += abs(vals[i] - vals[vals.size()-1-i]);

  }
  cout << ans << endl;


  return 0;
}


Measured memory_bytes: 1148
#include <cstdio>
#include <algorithm>
std::pair < int, int > p[200001];
int N, M, O, S[524288], T[524288];
inline void up(int p)
{
	S[p] = S[p << 1] + S[p << 1 | 1];
	T[p] = std::min(T[p << 1], S[p << 1] + T[p << 1 | 1]);
}
void build(int p, int l, int r)
{
	if (l == r)
	{
		S[p] = l == 0 ? 0 : 1;
		T[p] = 0;
		return;
	}
	int m = l + r >> 1;
	build(p << 1, l, m);
	build(p << 1 | 1, m + 1, r);
	up(p);
}
void P(int x, int w)
{
	int p = 1, l = 0, r = M;
	while (l < r)
	{
		int m = l + r >> 1;
		if (x <= m)
			p <<= 1, r = m;
		else
			p = p << 1 | 1, l = m + 1;
	}
	T[p] = std::min(0, S[p] += w);
	while (p >>= 1)
		up(p);
}
int main()
{
	scanf("%d%d", &N, &M);
	for (int i = 1; i <= N; i++)
	{
		scanf("%d%d", &p[i].first, &p[i].second);
		p[i].second = M + 1 - p[i].second;
	}
	std::sort(p + 1, p + N + 1);
	build(1, 0, M);
	for (int i = 1; i <= N; i++)
	{
		P(p[i].second, -1);
		O = std::min(O, T[1] + p[i].first);
	}
	printf("%d\n", std::max(-O, N - M));
	return 0;
}

Measured memory_bytes: 5760
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.List;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author hakamada
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ABC109_2 solver = new ABC109_2();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC109_2 {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            String[] W = new String[N];

            for (int i = 0; i < N; i++) {
                W[i] = in.next();
            }
            boolean dup = false;

            for (int i = 0; i < W.length; i++) {
                String val = W[i];
                W[i] = "_" + W[i];
                if (Arrays.asList(W).contains(val)) {
                    out.println("No");
                    return;
                }
                if (i > 0) {
                    if (W[i - 1].substring(W[i - 1].length() - 1).compareTo(val.substring(0, 1)) != 0) {
                        out.println("No");
                        return;
                    }
                }
            }
            out.println("Yes");

        }

    }
}



Measured memory_bytes: 22100
#include<stdio.h>
int f(int fa,int fb,int fc,int fd){
    if(fc>=5&&fd>=2)return (fa*fc+fb*fd)*0.8;
    return fa*fc+fb*fd;
}
int main(void){
    int i,j,k,N,x,y,b,p,ans,ANS;
    scanf("%d",&N);
    for(i=0;i<N;i++){
        scanf("%d %d %d %d",&x,&y,&b,&p);
        ANS=f(x,y,b,p);
        for(j=b;j<=b+5;j++){
            for(k=p;k<=p+2;k++){
                ans=f(x,y,j,k);
                if(ans<ANS)ANS=ans;
            }
        }
        printf("%d\n",ANS);
    }
    return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
using namespace std;
template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}
#ifdef __LOCAL
#define debug(x) cerr << __LINE__ << ": " << #x << " = " << x << endl
#define debugArray(x, n)                           \
  cerr << __LINE__ << ": " << #x << " = {";        \
  for (long long hoge = 0; (hoge) < (n); ++(hoge)) \
    cerr << ((hoge) ? "," : "") << x[hoge];        \
  cerr << "}" << endl
#else
#define debug(x) (void(0))
#define debugArray(x, n) (void(0))
#endif

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  int ans = 0, cnt[N + 1];
  fill(cnt, cnt + N + 1, 0);
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    if (a > N) ans++;
    if (a <= N) cnt[a]++;
  }
  for (int i = 0; i <= N; i++) ans += cnt[i] >= i ? cnt[i] - i : cnt[i];
  cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 3988
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a; i< (int)(b); ++i)
#define ALL(x) (x).begin(),(x).end()
#define rALL(x) (x).rbegin(),(x).rend()
typedef long double ld;
using ll=long long;
using namespace std;
const int mod=1e9+7;
const ll inf = 1LL << 60;
const ld pi = (acos(-1));
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }




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

  
  int n; cin >> n;
  int ans=0;
  for(int i=1;i<=n;i+=2){
    int g=0;
    rep(j,1,i+1){
      if(i%j==0) g++;
    }
    if(g==8) ans++;
  }
  cout << ans << endl;
}

Measured memory_bytes: 3608
n,d=map(int, input().split())
x=[list(map(int, input().split())) for _ in range(n)]

count=0
for i in range(n):
    for j in range(i+1,n):
        dis=0
        for k in range(d):
            dis += (x[i][k] - x[j][k])**2 
        if (dis**.5).is_integer():
            count+=1
print(count)

Measured memory_bytes: 3064
import java.io.*;

public class Main{
	public static void main(String args[]){
		try{
			new Main();
		}catch(IOException e){
			e.printStackTrace();
		}
	}
	
	public Main() throws IOException{
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String line;
		
		while((line = in.readLine()) != null){
			int n = Integer.parseInt(line);
			if(n==0) break;
			
			int c=0;
			while(n!=1){
				if(n%2==0){
					n = n/2;
				}
				else{
					n = n*3 + 1;
				}
				c++;
			}
			System.out.println(c);
		}
	}
}

Measured memory_bytes: 9360
#include<bits/stdc++.h>
using namespace std;
#define int long long

#ifdef LOCAL_DEBUG
  #include "LOCAL_DEBUG.hpp"
#endif

int V = 101010;
vector<int> graph[101010*2];

signed main(){

  int n; cin >> n;
  for(int i = 0; i < n; i++){
    int x,y; cin >> x >> y;
    y += V;
    graph[x].push_back(y);
    graph[y].push_back(x);
  }

  vector<int> used(V * 2,false);
  vector<int> cnt(2,0);
  function< void(int) > dfs =
  [&](int u){
    if(used[u]) return;
    used[u] = true;
    cnt[u/V]++;
    for(int v : graph[u]){
      dfs(v);
    }
  };

  int ans = 0;
  for(int i = 0; i < V*2; i++){
    cnt = vector<int>(3,0);
    dfs(i);
    ans += cnt[0] * cnt[1];
  }
  cout << ans - n << endl;

  return 0;
}


Measured memory_bytes: 12544
#include<stdio.h>
struct Card{
  char suit;
  int value;
int key;
};
struct Card A[100001];
 
int Partition(int p,int r){
  int i,j;
  struct Card key,x;
   
  x=A[r];
  i=p-1;
   
  for(j=p;j<r;j++){
    if(A[j].value<=x.value){
      i=i+1;
      key=A[i];
      A[i]=A[j];
      A[j]=key;
    }
  }
   
  key=A[i+1];
  A[i+1]=A[r];
  A[r]=key;
   
  return i+1;
}
void Quicksort(int p,int r){
  int q;
  if(p<r){
    q = Partition(p, r);
    Quicksort(p,q-1);
    Quicksort(q+1,r);
  }
}
 
int main(){
  int n,i,j,count=0;
  char ch,ch2;
  struct Card A2[100001],key;
   
  scanf("%d%c",&n,&ch);
  for(i=1;i<=n;i++){    
    scanf("%c%c%d%c",&A[i].suit,&ch2,&A[i].value,&ch);
    A[i].key=i;   
  }
  
  
  Quicksort(1,n);
	
 for(i=1;i<n;i++){
 	if(A[i].value==A[i+1].value && A[i].key>A[i+1].key){
 		count=1;
 break;}
}
  if(count!=1) printf("Stable\n");
  else printf("Not stable\n");
   
  for(i=1;i<=n;i++) printf("%c %d\n",A[i].suit,A[i].value);
   
  return 0;
}

Measured memory_bytes: 1780
#include <stdio.h>

int main(void){
	while(1){
		long n, i;
		long a[7] = {0};
		int age;
		
		scanf(" %ld", &n);
		if(n==0) break;
		
		for(i=0; i<n; i++){
			scanf(" %d", &age);
			if(age>60) age=60;
			
			a[age/10]++;
		}
	
		for(i=0; i<7; i++)
			printf("%ld\n", a[i]);

	}

	return 0;
}

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

int main(){
    int a, b;
    cin >> a >> b;
    int add = a + b, sub = a - b, mul = a * b;
    if (add >= sub && add >= mul) {
        cout << add << '\n';
    } else if (sub >= add && sub >= mul) {
        cout << sub << endl;
    } else {
        cout << mul << '\n';
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
int maxtime(int x)
{
	return (x + 9) / 10 * 10;
}

int remtime(int x)
{
	return maxtime(x) - x;
}

int main()
{
	int A, B, C, D, E;
	cin >> A >> B >> C >> D >> E;
	int sum = maxtime(A) + maxtime(B) + maxtime(C) + maxtime(D) +maxtime(E);
	sum -= max(remtime(A), max(remtime(B), max(remtime(C), max(remtime(D), remtime(E)))));
	cout << sum << endl;
	return 0;
}



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

#define all(n) n.begin(),n.end()
#define ll long long
#define ld long double
#define pb push_back
#define eb emplace_back
#define endl "\n"
#define pll pair<ll,ll>
#define YES cout <<"YES"<<endl;
#define NO cout <<"NO"<<endl;
#define ff first
#define ss second
//#define ((x|y)-y) (x&(~y))
//#define gcd(fibo(x),fibo(y)) = fibo(gcd(x,y))
using namespace std;
const ll maxn=3e3+10;
const ll maxx=1e13;
const ll mod=1e9+7;
const ll mod1=998244353;

vector <pll> adj[maxn];
set<ll> adj1[maxn];
//vector<ll> ans;
//bool kt[maxn];
ll a[maxn];
ll b[maxn] ;
pll p[maxn];

ll dp[maxn][maxn]  ;
ll f[maxn];
int main()
{
    // freopen("test.txt","r",stdin);
    // freopen("CHEMIST.OUT","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll n;
    string s;
    cin>>n;
    cin>>s;
    for (int i=1;i<=n;i++)
    {
        dp[1][i]=1;

    }
     f[0]=0;

     for (int j=1;j<=n;j++)
        {
            f[j]=(f[j-1]+dp[1][j])%mod ;
        }
    for (int i=2;i<=n;i++)
    {
       for (int j=1;j<=i;j++)
       {
           if (s[i-2]=='<')
           {
               dp[i][j]=f[j-1];
           }
           else
           {
               dp[i][j]=(f[i-1]-f[j-1]+mod*mod )%mod ;
           }
       }
       f[0]=0;
       for (int j=1;j<=n;j++)
        {
            f[j]=(f[j-1]+dp[i][j])%mod ;
        }
    }
    ll ans=0;
    for (int i=1;i<=n;i++)
    {
        ans=(ans+dp[n][i])%mod ;
    }
    cout <<ans;
    return 0;

}


Measured memory_bytes: 69504
#include <iostream>
#include <cmath>

using namespace std;

const static double g = 9.8;
int main() {
  // Energy conservation law
  // mgh = (1/2)mv^2
  double v;
  while(cin >> v) {
    double h = (1./2.) * v * v / g;
    int N = 1;
    while(true) {
      if((double)(N*5 - 5) > h) {
        break;
      }
      N++;
    }
    cout << N << endl;
  }
}

Measured memory_bytes: 1224
N = gets.to_i
players = N.times.map { gets.split.map{|i| i.to_i - 1} }

counter = 0
break_counter = N * (N - 1) / 2
lock = Array.new(N, 0)
next_chekcable = (0..(N-1)).to_a
while true
  checkable = Marshal.load(Marshal.dump(next_chekcable))
  next_chekcable = []

  counter += 1
  flag = false

  checkable.each do |player_id|
    opponent_id = players[player_id].first
    next if opponent_id.nil?

    if players[opponent_id].first == player_id && lock[player_id] != counter && lock[opponent_id] != counter
      flag = true
      players[player_id].shift
      players[opponent_id].shift
      lock[player_id] = counter
      lock[opponent_id] = counter
      next_chekcable.push(player_id)
      next_chekcable.push(opponent_id)
      break_counter -= 1
    end
  end

  if !flag
    puts '-1'
    exit
  end

  break if break_counter.zero?
end

puts counter

Measured memory_bytes: 32124
#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define dunk(a) cout << (a) << endl
#define rall(a) (a).rbegin(),(a).rend()
const int INF = 2e9;
using namespace std;
using Graph = vector<vector<int>>;
typedef pair<int,int> P;
typedef long long ll;

int main(){
    string s1, s2, s3; cin >> s1 >> s2 >> s3;

    cout << s1[0] << s2[1] << s3[2] << endl;
}

Measured memory_bytes: 256
def resolve():
    N=int(input())
    A=list(map(int,input().split()))
    B=list(map(int,input().split()))
    C=list(map(int,input().split()))
    ans=0
    np=-199
    for i in range(N):
        n=A[i]
        ans+=B[n-1]
        if np+1==n:
            ans+=C[np-1]
        np=n
    print(ans)
resolve()

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

#define I inline
#define LL long long
#define reg register int
#define pii pair<int,int>
using namespace std;
const int inf = 2147483647;
const int N = 101;
int mod;

I int _max(reg x, reg y) {return x > y ? x : y;}
I int _min(reg x, reg y) {return x < y ? x : y;}
I int read() {
	reg x = 0, f = 1; char ch = getchar();
	while(ch < '0' || ch > '9') {if(ch == '-') f = -1; ch = getchar();}
	while(ch >= '0' && ch <= '9') x = (x << 3) + (x << 1) + (ch ^ 48), ch = getchar();
	return x * f;
}
I void put(reg x) {
	if(x < 0) putchar('-'), x = -x;
	if(x >= 10) put(x / 10);
	putchar(x % 10 + '0');
}

I int add(const reg &x, const reg &y) {return x + y >= mod ? x + y - mod : x + y;}
I int dec(const reg &x, const reg &y) {return x - y < 0 ? x - y + mod : x - y;}

int f[2][2][N][N], pp[N][N], C[N][N];

int main() {
	reg n = read(), m = read(), K = read(); mod = read();
	if(n < m) swap(n, m);
	for(reg i = 0; i <= n; i++) {
		C[i][0] = 1;
		for(int j = 1; j <= i; j++) C[i][j] = add(C[i - 1][j - 1], C[i - 1][j]);
	} pp[0][0] = 1; for(reg i = 1; i <= K; i++) {
		pp[i][0] = 1;
		for(reg j = 1; j <= n; j++) pp[i][j] = (LL)pp[i][j - 1] * i % mod;
	} reg now = 0; f[0][0][0][0] = 1;
	for(reg k = 1; k <= K; k++) {
		now ^= 1; memset(f[now], 0, sizeof(f[now]));
		for(reg i = 0; i <= n; i++) for(reg j = 0; j <= m; j++) if(f[now ^ 1][0][i][j]){
			reg c = (LL)pp[K - k + 1][j] * (pp[k][m - j] - pp[k - 1][m - j] + mod) % mod;
			for(reg t = 0, z = 1; t <= n - i; t++, z = (LL)z * c % mod) f[now][1][i + t][j] = (f[now][1][i + t][j] + (LL)f[now ^ 1][0][i][j] * z % mod * C[n - i][t]) % mod;
		} for(reg i = 0; i <= n; i++) for(reg j = 0; j <= m; j++) if(f[now][1][i][j]){
			reg c = (LL)pp[k][n - i] * (pp[K - k + 1][i] - pp[K - k][i] + mod) % mod;
			for(reg t = 0, z = 1; t <= m - j; t++, z = (LL)z * c % mod) f[now][0][i][j + t] = (f[now][0][i][j + t] + (LL)f[now][1][i][j] * z % mod * C[m - j][t]) % mod;
		}
	} put(f[now][0][n][m]);
	return 0;
}



Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <vector>


using namespace std;


class Dice{
	private:
		int dice1[6];
		int dice2[6];

	public:
		// コンストラクタ
		Dice();
		// 全面一致するか調べる
		bool serch();
		// サイコロころころシュミレート
		bool corocoro();
};


// コンストラクタ
Dice::Dice()
{
	for(int i = 0; i < 6; i++)
		cin >> dice1[i];

	for(int i = 0; i < 6; i++)
		cin >> dice2[i];
}
// 全面一致するか調べる
bool Dice::serch()
{
	for(int i = 0; i < 6; i++)
		if(dice1[i] != dice2[i])
			return false;

	return true;
}
// サイコロころころシュミレート
bool Dice::corocoro()
{
	int mem, tmp;
	string code[6] = {"W", "W", "W", "N", "NN", ""};

	int i = 0;
	do{
		// 正面を固定してサイコロをくるくる回す
		for(int j = 0; j < 4 && dice1[0] == dice2[0]; j++){
			tmp = dice2[4];
			dice2[4] = dice2[2];
			dice2[2] = dice2[1];
			dice2[1] = dice2[3];
			dice2[3] = tmp;

			// 全面一致するか調べる
			if(dice1[4] == dice2[4])
				if(serch())
					return true;
		}

		// 調べる箇所を変更
		for(int j = 0; j < code[i].length(); j++){
			switch(code[i][j]){
				case 'N':
					tmp = dice2[5];
					dice2[5] = dice2[4];
					dice2[4] = dice2[0];
					dice2[0] = dice2[1];
					dice2[1] = tmp;
					break;
				case 'W':
					tmp = dice2[5];
					dice2[5] = dice2[3];
					dice2[3] = dice2[0];
					dice2[0] = dice2[2];
					dice2[2] = tmp;
					break;
			}
		}
	}while(++i < 6);

	return false;
}


int main()
{
	Dice *x = new Dice();

	if(x->corocoro())
		cout << "Yes" << endl;
	else
		cout << "No" << endl;

	return 0;
}


Measured memory_bytes: 3220