akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
//ios::sync_with_stdio(false);
//cin.tie(0);
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<pii,int> ppii;
typedef pair<int,pii> pipi;
typedef pair<ll,ll> pll;
typedef pair<pll,ll> ppll;
typedef pair<ll,pll> plpl;
typedef tuple<ll,ll,ll> tl;
ll mod=1000000007;
ll mod2=998244353;
ll mod3=1000003;
ll inf=1000000000000000000;
double pi=2*acos(0);
#define rep(i,m,n) for(int i=m;i<n;i++)
#define rrep(i,n,m) for(int i=n;i>=m;i--)
int dh[4]={1,-1,0,0};
int dw[4]={0,0,1,-1};
int ddh[8]={-1,-1,-1,0,0,1,1,1};
int ddw[8]={-1,0,1,-1,1,-1,0,1};
ll lmax(ll a,ll b){
    if(a<b)return b;
    else return a;
}
ll lmin(ll a,ll b){
    if(a<b)return a;
    else return b;
}
ll gcd(ll a,ll b){
    if(a<b)swap(a,b);
    if(a%b==0)return b;
    return gcd(b,a%b);
}
ll Pow(ll n,ll k){
    ll ret=1;
    ll now=n;
    while(k>0){
        if(k&1)ret*=now;
        now*=now;
        k/=2;
    }
    return ret;
}
int main(){
    int n;cin>>n;
    double a[n];
    double b[n];
    rep(i,0,n){
        cin>>a[i];
        b[i]=1/a[i];
    }
    double ans=0;
    rep(i,0,n)ans+=b[i];
    ans=1/ans;
    cout<<fixed<<setprecision(12)<<ans<<endl;
}


Measured memory_bytes: 256
// failed to generate code

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())

int main(){	
	ll H, W, K;
	cin >> H >> W >> K;
	vector<vector<char>> s(H, vector<char>(W));
	rep(i, H) {
		rep(j, W) {
			cin >> s[i][j];
		}
	}
	vector<vector<ll>> res(H, vector<ll>(W));
	ll fr = -1, now = 0;
	rep(i, H) {
		bool flg = false;
		rep(j, W) {
			if (s[i][j] == '#') {
				if (fr == -1) fr = i;
				flg = true;
			}
		}
		if (flg) {
			now++;
			ll flg2 = false;
			rep(j, W) {
				if (s[i][j] == '#' && !flg2) flg2 = true; else if (s[i][j] == '#' && flg2) now++;
				res[i][j] = now;
			}
		} else {
			rep(j, W) {
				if (i-1 >= 0) res[i][j] = res[i-1][j];
			}
		}
	}
	rep(i, fr) {
		rep(j, W) {
			res[i][j] = res[fr][j];
		}
	}

	rep(i, H) {
		rep(j, W) {
			cout << res[i][j];
			if (j != W-1) cout << " "; else cout << endl;
		}
	}
}


Measured memory_bytes: 1536
#include <cstdio>
#include <vector>
using namespace std;

using i64 = long long;

#define REP(i, stop) for (int i = 0, i##_len = stop; i < i##_len; ++i)

signed main() {
	i64 n;
	scanf("%lld", &n);
	vector<i64> A(n + 1), B(n);
	REP(i, n + 1) {
		scanf("%lld", &A[i]);
	}
	REP(i, n) {
		scanf("%lld", &B[i]);
	}
	i64 s = 0;
	REP(i, n) {
		i64 m = A[i] < B[i] ? A[i] : B[i];
		s += m;
		B[i] -= m;
		m = A[i + 1] < B[i] ? A[i + 1] : B[i];
		s += m;
		A[i + 1] -= m;
	}
	printf("%lld", s);
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define rer(i,l,n) for(int i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define pb(a) push_back(a)
#define mk(a,b) make_pair(a,b)
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

bool d[12][12]={};
char s[12][12]={};

void dfs(int y,int x){
	if(s[y][x]=='0'||d[y][x]==1||y<0||12<=y||x<0||12<=x) return;
	else{
		d[y][x]=1;
		dfs(y+1,x);
		dfs(y,x+1);
		dfs(y,x-1);
		dfs(y-1,x);
	}
}

int main(){
	while(1){
		rep(i,0,12){
			rep(j,0,12){
				cin>>s[i][j];
			}
		}
		if(cin.eof()) break;
		memset(d,0,sizeof(d));
		int ans=0;
		rep(i,0,12){
			rep(j,0,12){
				if(s[i][j]=='1' && d[i][j]==0){
					dfs(i,j); ans++; //o(" "<<i<<j);
				}
			}
		}
		o(ans);
	}
}

Measured memory_bytes: 1140
#include <stdio.h>
int main(){
  int b1,b2,b3;
  scanf("%d%d%d",&b1,&b2,&b3);


  if(b3 == 1)printf("Open\n");
  else if(b1+b2 < 2)printf("Close\n");
  else if(b1+b2 == 2)printf("Open\n");

  return 0;
}

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

using namespace std;

int main()
{
  char S[100001];
  scanf("%s", S);
  
  int ans = strlen(S);
  int N = ans;
  
  for (int i = 0; i < N - 1; i++) {
    if (S[i] != S[i + 1]) ans = min(ans, max(i + 1, N - i - 1));
  }
  
  printf("%d\n", ans);
  
  return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
signed main(){
  int a[10],k;
  for(int i=0;i<3;i++){
    cin>>a[i];
  }
  cin>>k;
  sort(a,a+3);
  for(int i=0;i<k;i++){
    a[2]*=2;
  }
  cout<<a[1]+a[0]+a[2]<<endl;
  return(0);
}
  

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

string S;

signed main() {
    cin.tie(0); ios::sync_with_stdio(false);
    cin >> S;
    int N = S.size();
    int K = N;
    rep(i, N-1) {
        if (S[i]=='0' && S[i+1]=='1') K = min(K, max(i+1, N-i-1));
        if (S[i]=='1' && S[i+1]=='0') K = min(K, max(i+1, N-i-1));
    }
    cout << K << endl;
}

Measured memory_bytes: 512
#include<stdio.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<bitset>
#include<cmath>
#include<cstdlib>
#include<ctime>
using namespace std;
typedef long long ll;
ll moder = 1000000007;
//Library!
ll pow_mod(ll a, ll b, ll n) {
	if (b == 0)return a % n;
	if (b % 2)return pow_mod(a, b - 1, n)*a%n;
	else return pow_mod(pow_mod(a, b / 2, n), 2, n) % n;
}
bool prime(ll n) {
	for (ll i = 2; i <= sqrt(n); i++)if (!(n%i))return false;
	return true;
}
ll comb(ll n, ll r) {
	if (n == r) return 1;
	else if (r == 0) return 1;
	else if (r == 1) return n % moder;
	else return (comb(n - 1, r - 1) + comb(n - 1, r)) % moder;
}
//ライブラリゾーン終了
int main() {
	int n, s[110], sum = 0, minus = 0;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> s[i];
		sum += s[i];
	}
	sort(s, s + n);
	for (int i = 0; i < n; i++) {
		if (s[i] % 10) {
			minus = s[i];
			break;
		}
	}
	if (!minus)cout << 0 << endl;
	else if(!(sum%10))cout << sum - minus << endl;
	else cout << sum << endl;
	return 0;
}

Measured memory_bytes: 256
(let ((k (read))
      (ans 0))
  (loop :for a :from 1 :to k
        :do (loop :for b :from 1 :to k
                  :do (loop :for c :from 1 :to k
                            :do (incf ans (gcd a b c)))))
  (format t "~A~%" ans))


Measured memory_bytes: 24436
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] r = new long[87];
        r[0] = 2;
        r[1] = 1;
        for(int i = 2; i <= 86; i++){
            r[i] = r[i-2] + r[i-1];
        }
        System.out.print(r[n]);
    }
}

Measured memory_bytes: 21972
#include <bits/stdc++.h>
#define rep(i,n) for(int i=(0);i<(n);i++)

using namespace std;

typedef long long ll;

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

	ll MOD = 1e9+7;

	int N, X;
	cin >> N >> X;

	vector<ll> S(N, 0);
	rep(i, N) cin >> S[i];

	sort(S.begin(), S.end(), greater<ll>());

	vector<vector<ll>> dp(N+1, vector<ll>(X+1, 0));
	dp[0][X] = 1;

	for(int i = 1; i <= N; i++){
		for(int j = 0; j <= X; j++){
			dp[i][j % S[i-1]] += dp[i-1][j];
			dp[i][j % S[i-1]] %= MOD;
			dp[i][j] += dp[i-1][j] * (N - i);
			dp[i][j] %= MOD;
		}
	}

	ll ans = 0;
	for(int i = 0; i <= X; i++){
		ans += i * dp[N][i] % MOD;
		ans %= MOD;
	}

	cout << ans << endl;
}


Measured memory_bytes: 158592
#include "bits/stdc++.h"
using namespace std;

int main() {
	int N;
	cin >> N;
	int A, ANS = 0;
	for (int i = 0; i < N; i++) {
		cin >> A;
		if (i % 2 == 0 && A % 2 == 1) ANS++;
	}
	cout << ANS << endl;
}

Measured memory_bytes: 3620
/*~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
*$* WRITER:kakitamasziru/OxOmisosiru *$*
~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=*/
#ifdef LOCAL_JUDGE
#define _GLIBCXX_DEBUG
#endif
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <iomanip>
#include <limits>//setprecision
//#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
//#include <unordered_set> //unordered_set
#include <stack> // stack
#include <deque> // deque
#include <math.h>//pow,,,
#include <cmath>//abs,,,
#include <bitset> // bitset
#define endl "\n";
using namespace std;

const long long INF = 4000000000000000001;
const int inf = 1001001001;
const int MOD = 1000000007;
typedef pair<long long,long long> P;

//Solve N^M. This, mod_pow use Iterative Square Method.
long long mod_pow(long long N, long long M) {
    if (M == 0) return 1;
    long long res = mod_pow((N * N) % MOD, M / 2);
    //最下位ビット(*N)が1の時は単独でNをかける
    if (M & 1) res = (res * N) % MOD;

    return res %= MOD;
}

long long gcd(long long a, long long b) {
    if (b == 0) return a;
    else return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
    return a / gcd(a, b) * b ;
}



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

    int N,X,T;cin >> N >> X >> T;
    int now = 0;
    int ans = 0;
    for(int i = 0;i<5000;i++){
        now += X;
        ans += T;
        if(now >= N){
            break;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 3644
#include<cstdio>
using namespace std;
int n,x,cnt,i,tot;
bool ans[8];
int main()
{
	scanf("%d",&n);
	for (i=1;i<=n;i++)
	{
		scanf("%d",&x);
		x/=400;
		if (x<8) ans[x]=1;
		else cnt++;
	}
	for (i=0;i<8;i++) 
	  if (ans[i])
	    tot++;
	if (tot==0) printf("1 %d\n",cnt);
	else printf("%d %d\n",tot,tot+cnt);
}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <string>
#include <cassert>
#include <algorithm>
#include <functional>
using namespace std;
//C - Five Transportations
int main(void){
    int x,y,z,k;
    
    std::cin >> x >> y >> z >>k;
    std::vector<long long> A(x),B(y),C(z);
    for (int i = 0; i < x; i++)std::cin >> A[i];
    for (int i = 0; i < x; i++)std::cin >> B[i];
    for (int i = 0; i < x; i++)std::cin >> C[i];
    std::vector<long long> AB;
    for (int i = 0; i < x; i++) {
        for (int j = 0; j < y; j++) {
            AB.push_back(A[i]+B[j]);
        }
    }
    sort(AB.begin(),AB.end());
    reverse(AB.begin(),AB.end());
    
    std::vector<long long> ABC;
    for (int i = 0; i < std::min(k,(int)AB.size()); i++) {
        for (int j = 0; j < z; j++) {
            ABC.push_back(AB[i]+C[j]);
        }
    }
    sort(ABC.begin(),ABC.end());
    reverse(ABC.begin(),ABC.end());
    
    for (int i = 0; i < k; i++) {
        std::cout << ABC[i] << std::endl;
    }
}


Measured memory_bytes: 43368
#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<ULL> VULL;

ULL s2ull(string s) {
	int i;
	ULL res = 0;
	for(i = 0; i < (int)s.length(); i++) {
		res *= 10;
		res += s[i]-'0';
	}
	return res;
}

VI ull2v(ULL n, int l) {
	VI res;
	int i;
	for(i = 0; i < l; i++) {
		res.push_back(n%10);
		n /= 10;
	}
	return res;
}

ULL v2ull(VI v) {
	ULL res = 0;
	int i;
	for(i = 0; i < (int)v.size(); i++) {
		res *= 10;
		res += v[i];
	}
	return res;
}

int main(void) {
	VI vmax, vmin;
	VULL vres;
	ULL a, res;
	int n;
	int i;

	while(true) {
		cin >> a >> n;
		if((a == 0 && n == 0) || cin.eof()) { break; }
		res = 0;
		vres.clear();
		while(true) {
			vres.push_back(a);
			res++;
			vmax = ull2v(a, n);
			vmin = vmax;
			sort(vmax.rbegin(), vmax.rend());
			sort(vmin.begin(), vmin.end());
			a = v2ull(vmax) - v2ull(vmin);
			for(i = 0; i < (int)vres.size(); i++) {
				if(vres[i] == a) { break; }
			}
			if(i < (int)vres.size()) { break; }
		}
		cout << i << " " << vres[i] << " " << res - i << endl;
	}

	return 0;
}

Measured memory_bytes: 0
while True:
    a,b,c=input().split()
    a,c=map(int,[a,c])
    if b=='?':
        break
    elif b=='/':
        print(a//c)
    elif b=='+':
        print(a+c)
    elif b=='-':
        print(a-c)
    else:
        print(a*c)
        


Measured memory_bytes: 5600
/*
    Author:zeke
    
    pass System Test!
    GET AC!!
*/
#include <iostream>
#include <queue>
#include <vector>
#include <iostream>
#include <vector>
#include <string>
#include <cassert>
#include <algorithm>
#include <functional>
#include <cmath>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <map>
#include <iomanip>
#include <utility>
#include <stack>
#include <bitset>
using ll = long long;
using ld = long double;
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define rep3(var, min, max) for (ll(var) = (min); (var) < (max); ++(var))
#define repi3(var, min, max) for (ll(var) = (max)-1; (var) + 1 > (min); --(var))
#define Mp(a, b) make_pair((a), (b))
#define F first
#define S second
#define Icin(s) \
    ll(s);      \
    cin >> (s);
#define Scin(s) \
    ll(s);      \
    cin >> (s);
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;
}
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef vector<V> VV;
typedef vector<P> VP;
ll mod = 1e9 + 7;
ll MOD = 1e9 + 7;
ll INF = 1e18;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin>>n;
    map<ll,ll> mp;
    rep(i,n){
        ll x;
        cin>>x;
        if(mp[x]==1){
            cout<<"NO"<<endl;
            return 0;
        }
        mp[x]=1;
    }
    cout<<"YES"<<endl;
    
}


Measured memory_bytes: 12800
import sys
stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))

n, x = na()
l = na()
d = 0
cnt = 1
for li in l:
    d += li
    if d <= x:
        cnt += 1
print(cnt)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
using namespace std;
 
int main()
{
    long long x;
    cin >> x;
    long long a = x/500 * 1000;
    int b = (x%500)/5 * 5;
    cout<<a+b<<endl;
}

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

namespace atcoder.abc167.c
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] inputArray = getIntParams();
            int N = inputArray[0];
            int M = inputArray[1];
            int X = inputArray[2];

            int[,] paramArray = new int[N, M + 1];
            for (int i = 0; i < N; i++)
            {
                int[] rawData = getIntParams();
                for (int j = 0; j < M + 1; j++)
                {
                    paramArray[i, j] = rawData[j];
                }
            }

            int price = 0;
            for (int x = 1; x < 1 << N; x++)
            {
                int[] retArray = new int[M + 1];
                for (int y = 0; y < N; y++)
                {
                    int flag = (x >> y) & 1;
                    if (flag == 0)
                    {
                        continue;
                    }
                    for (int z = 0; z <= M; z++)
                    {
                        retArray[z] += paramArray[y, z];
                    }
                }

                if (checkX(retArray, X))
                {
                    if (price == 0 || price > retArray[0])
                    {
                        price = retArray[0];
                    }
                }
            }
            if (price == 0)
            {
                Console.WriteLine(-1);
                return;
            }
            Console.WriteLine(price);
        }
        static Boolean checkX(int[] item, int x)
        {
            for (int i = 1; i < item.Length; i++)
            {
                if (item[i] < x)
                {
                    return false;
                }
            }
            return true;
        }
        static int getIntParam()
        {
            return int.Parse(Console.ReadLine());
        }
        static int[] getIntParams()
        {
            return Console.ReadLine().Split(' ').Select(i => int.Parse(i)).ToArray();
        }
        static long getLongParam()
        {
            return long.Parse(Console.ReadLine());
        }
        static long[] getLongParams()
        {
            return Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray();
        }
        static string getStringParam()
        {
            return Console.ReadLine();
        }
        static string[] getStringParams()
        {
            return Console.ReadLine().Split(' ');
        }
        static decimal getDecimalParam()
        {
            return decimal.Parse(Console.ReadLine());
        }
        static decimal[] getDecimalParams()
        {
            return Console.ReadLine().Split(' ').Select(i => decimal.Parse(i)).ToArray();
        }
    }
}


Measured memory_bytes: 28428
#include <stdio.h>

int main(void)
{
	double x, y, a, b, c, d, e, f;
	while( fscanf(stdin,"%lf %lf %lf %lf %lf %lf\n",&a,&b,&c,&d,&e,&f) >= 0 )
	{
		x = (f - e * c/b) / (d - e * a/b);
		y = (f - d * c/a) / (e - d * b/a);
		x = (x == -0.0)? 0.0 : x;	//-0.0??????
		y = (y == -0.0)? 0.0 : y;
		printf( "%.3f %.3f\n", x, y );
	}
	
	return 0;
}

Measured memory_bytes: 660
using namespace std;
#include<bits/stdc++.h>
#define BEGIN ios_base::sync_with_stdio(0);cin.tie(0);
#define END return EXIT_SUCCESS;
#define FOR(I,A,B) for((I)=(A);(I)<(B);(I)++)
#define REP(I,N) FOR((I),0,(N))
#define UP(I,A,B) for((I)=(A);(I)<=(B);(I)++)
#define DW(I,A,B) for((I)=(A);(I)>=(B);(I)--)
#define IN(P) cin>>(P)
#define IN2(P1,P2) cin>>(P1)>>(P2)
#define IN3(P1,P2,P3) cin>>(P1)>>(P2)>>(P3)
#define INS(I,N,V) REP((I),(N)) cin>>(V[I])
#define INS2(I,N,V1,V2) REP((I),(N)) cin>>(V1[I])>>(V2[I]);
#define INS3(I,N,V1,V2,V3) REP((I),(N)) cin>>(V1[I])>>(V2[I])>>(V3[I]);
#define OUT(P) cout<<(P)<<endl
#define OUT2(P1,P2) cout<<(P1)<<" "<<(P2)<<endl
#define OUT3(P1,P2,P3) cout<<(P1)<<" "<<(P2)<<" "<<(P3)<<endl
#define OUTS(I,N,V) REP((I),(N)) cout<<(V[i])<<endl
#define ALL(C) (C).begin(),(C).end()
#define RALL(C) (C).rbegin(),(C).rend()
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}

int A,B;
inline void solve(){
  IN2(A,B);
  if(A+B>9)OUT("error");
  else OUT(A+B);
}

int main(int argc,char**argv){
  BEGIN
  solve();
  END
}


Measured memory_bytes: 256
#include<stdio.h>

int main(void){

int i,n;

int number;

long long int sum=0;

int min=0;

int max=0;

scanf("%d",&n);

for(i=0;i<n;i++){

scanf("%d",&number);

if(i==0){

min=number;

max=number;

}

if(number<min)min=number;

if(number>max)max=number;

sum+=number;

}

printf("%d %d %lld\n",min,max,sum);

return 0;

}

Measured memory_bytes: 600
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(input())
def inpl(): return list(map(int, input().split()))
def inpl_s(): return list(input().split())
atoz = [chr(i) for i in range(97,97+26)]

A,B = inpl()
if A<=8 and B<=8:
	print('Yay!')
else:
	print(':(')


Measured memory_bytes: 4212
/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public final class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner s = new Scanner(System.in);
		int n= s.nextInt();
		HashMap<Integer,Integer> map = new HashMap<>();
		for(int i=1;i<=n;i++){
		    int idx = s.nextInt();
		    map.put(idx,i);
		}
		for(int i=1;i<=n;i++){
		    System.out.print(map.get(i)+" ");
		}
	}

}

Measured memory_bytes: 69064
#include <stdio.h>
int main(){
  int H, W;
  scanf("%d%d", &H, &W);
  char field[H+2][W+2];
  char count;
  for (int i=1; i<H+1 ;i++){
    for (int j=0; j<W+1; j++){
      scanf("%c", &field[i][j]);
    }
  }
  for (int i=1; i<H+1; i++){
    for (int j=1; j<W+1; j++){
      count='0';
      if (field[i][j]=='.'){
        for (int k=0; k<3; k++){
          for (int l=0; l<3; l++){
            if (field[i+k-1][j+l-1]=='#'){
              count=count + 1;
            }
          }
      	}
        field[i][j]=count;
      }
      printf("%c", field[i][j]);
    }
    printf("\n");
  }
  return 0;
}

Measured memory_bytes: 128
#include <stdio.h>

int main(){
	double x1, y1, x2, y2, x3, y3, x4, y4;
	double s;
	int n, i;

	scanf("%d", &n);
	for( i=0; i<n; i++ ){
		scanf("%lf %lf %lf %lf %lf %lf %lf %lf",
				&x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4);
		s = (x2-x1)*(y4-y3)-(y2-y1)*(x4-x3);
		( -1e-8<s&&s<1e-8 )? puts("YES"):puts("NO");
	}

	return 0;
}
	

Measured memory_bytes: 620
def main():
    s = list(input())
    cnt = 0
    max_cnt = 0
    for i in s:
        if i == "A" or i == "T" or i == "C" or i == "G":
            cnt += 1
            max_cnt = max(max_cnt,cnt)
        else:
            cnt = 0
    print(max_cnt)



if __name__ == "__main__":
    main()


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

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

int a[15],cost;
int inf = 1100000000;
int ans = inf;

int v[15][15];

rep(i,n){
  rep(j,m+1) cin >> v[i][j];
}


rep(bit,1<<n){
  int cost =0;
  vector<int> d(m);
  rep(i,n){
    if(bit&1<<i){
      cost +=v[i][0];
      rep(j,m) d[j]+=v[i][j+1];
    }
  }
  bool ok = true;
  rep(i,m){
    if(d[i]<x) ok = false;
  }
  if(ok) ans = min(cost,ans);
 

}

if(ans == inf) cout << -1 <<endl;
else cout << ans << endl;
return 0;
}

Measured memory_bytes: 3624
#include<stdio.h>
 
typedef struct{
    int num;
    int depth;
}node;
 
int head=0;
int tail=0;
node queue[100];
 
int graph[100][100]={0};
 
int isEmpty(void){
    if(head==tail){
        return 1;
    }else{
        return 0;
    }
}
 
void e(node n){
    queue[(head++)%100]=n;
}
 
node de(void){
    return queue[(tail++)%100];
     
}
 
void init(int d[],int n){
    int i;
    d[0]=0;
    for(i=1;i<n;i++){
        d[i]=-1;
    }
}
 
int main(void){
    int n;
    int u,k,v;
    int i,j;
    int d[100];
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d %d",&u,&k);
        for(j=0;j<k;j++){
            scanf("%d",&v);
            graph[u-1][v-1]=1;
        }
    }
    init(d,n);
    node tmp;
    node next;
    tmp.num=0;
    tmp.depth=0;
    e(tmp);
    while(!isEmpty()){
        tmp=de();
        for(i=0;i<n;i++){
            if(graph[tmp.num][i]&&d[i]==-1){
                d[i]=tmp.depth+1;
                next.num=i;
                next.depth=d[i];
                e(next);
            }
        }
    }
    for(i=0;i<n;i++){
        printf("%d %d\n",i+1,d[i]);
    }
    return 0;
}

Measured memory_bytes: 636
open System
open System.Collections.Generic

[<AutoOpen>]
module Cin =
    let read f = stdin.ReadLine() |> f
    let reada f = stdin.ReadLine().Split() |> Array.map f
    let readChars() = read string |> Seq.toArray
    let readInts() = readChars() |> Array.map (fun x -> Convert.ToInt32(x.ToString()))

[<AutoOpen>]
module Cout =
    let writer = new IO.StreamWriter(new IO.BufferedStream(Console.OpenStandardOutput()))
    let print (s: string) = writer.Write s
    let println (s: string) = writer.WriteLine s
    let inline puts (s: ^a) = string s |> println

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

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

let isok c = c = 'A' || c = 'G' || c = 'C' || c = 'T'

let main() =
    let s = readChars()
    let len = Array.length s
    let mutable ans = 0
    for i in 0 .. len - 1 do
        for j in i .. len - 1 do
            let a = s.[i..j]
            if Array.forall isok a then ans <- max ans (j - i + 1)

    puts ans
    ()

// -----------------------------------------------------------------------------------------------------
main()
writer.Dispose()


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

Measured memory_bytes: 580
#include<bits/stdc++.h>                
using namespace std;
int N, h, memo,  answer;
int main(void){
	cin >> N >> h;
	answer = memo = h;
	for(int i = 1; i < N; i++){
		cin >> h;
    if(memo < h) answer += h - memo, memo = h;
		if(memo > h) memo = h;
	}
	cout << answer << endl;
	return 0;
}


Measured memory_bytes: 256
# include "bits/stdc++.h"
using namespace std;
using LL = long long;
using ULL = unsigned long long;
const double PI = acos(-1);
template<class T>constexpr T INF() { return ::std::numeric_limits<T>::max(); }
template<class T>constexpr T HINF() { return INF<T>() / 2; }
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++)if ((n >> i) & 1)cnt++; return cnt; }
int d_sum(LL n) { int ret = 0; while (n > 0) { ret += n % 10; n /= 10; }return ret; }
int d_cnt(LL n) { int ret = 0; while (n > 0) { ret++; n /= 10; }return ret; }
LL gcd(LL a, LL b) { if (b == 0)return a; return gcd(b, a%b); };
LL lcm(LL a, LL b) { LL g = gcd(a, b); return a / g*b; };
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define UNIQUE(wpwpw)        sort(ALL((wpwpw)));(wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define REP(i,upupu)         FOR(i,0,upupu)

struct INIT{
    INIT(){
        std::ios::sync_with_stdio(false);
        std::cin.tie(0);
        cout << fixed << setprecision(13);
    }
}INIT;

LL n, m;
LL a[101010];

bool cond(LL x){
    LL cnt = 0;
    REP(i, n){
        auto num = lower_bound(a, a + n, x - a[i]);
        cnt += (a + n) - num;
    }
    return cnt >= m;
}

LL rui[101010];

int main(){
    cin >> n >> m;
    REP(i, n)cin >> a[i];
    sort(a, a + n);
    LL l = 0, r = HINF<LL>();
    while(r - l > 1){
        LL mid = (l + r)/2;
        if(cond(mid)){
            l = mid;
        }else{
            r = mid;
        }
    }

    REP(i, n)rui[i + 1] = rui[i] + a[i];

    LL rest = m;
    LL ans = 0;
    int th = l;
    REP(i, n){
        int it = upper_bound(a, a + n, th - a[i]) - a;
        ans += rui[n] - rui[it];
        ans += a[i] * (n - it);
        rest -= n - it;
    }
    ans += rest * th;
    cout << ans << endl;
}

Measured memory_bytes: 1792
a1,b1=(int(x) for x in input().split())
a2,b2=(int(x) for x in input().split())
a3,b3=(int(x) for x in input().split())

l=[a1,a2,a3,b1,b2,b3]

A=l.count(1)
B=l.count(2)
C=l.count(3)
D=l.count(4)

if A==3 or B==3 or C==3 or D==3:
  print("NO")
  
else:
  print("YES")

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9+7;
int dp[1000005][4];
int main(){
    int n;
    cin >> n;
    dp[0][0] = 1;
    for(int i=1;i<=n;i++){
        for(int j=0;j<4;j++){
            dp[i][j] = (dp[i][j] + dp[i-1][j]*1ll*8)%mod;
            dp[i][j|1] = (dp[i][j|1] + dp[i-1][j])%mod;
            dp[i][j|2] = (dp[i][j|2] + dp[i-1][j])%mod;
        }
    }
    printf("%d\n", dp[n][3]);
}

Measured memory_bytes: 19272
#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
using namespace std;
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(c) (c).rbegin(),(c).rend()
#define mp make_pair
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll inf=1e9+7;
const ll mod=998244353;
int main(){
    ll a,b;cin>>a>>b;
    if(a>b)swap(a,b);
    rep(i,b)cout<<a;
    cout<<endl;
}

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


int main(){

    int N;
    cin >> N;


    vector<int> prime = { 2 };
    int sum = 0;
    
    for( int i = 3; i < 55555; i += 2 ){
        bool condition = true;
        for( int j = 3; j*j <= i; j += 2 ){
            if( i % j == 0 ){
                condition = false;
                break;
            }
        }
        if( condition ) prime.push_back( i );
    }

    for( int i = 0; i < prime.size(); i++ ){
        if( prime[i] % 5 == 1 && sum < N ){
            cout << prime[i] << " ";
            sum++;
        }
    }
    cout << endl;
    
    return 0;

}

Measured memory_bytes: 256
#include <stdio.h>
 
int main(void){
  int price=0;
  char topping[4];
  
  scanf("%s",topping);
  
  if(topping[0] == 'o') price += 100;
  if(topping[1] == 'o') price += 100;
  if(topping[2] == 'o') price += 100;
  
  printf("%d\n",price+700);
  return 0;
}

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

using ll = long long int;

const int MAX = (int)(1e5 + 5);
const ll INF = (ll)(1e10 + 5);

const int MAX_N = (int)(1e5 + 5);
const int MAX_LOG = (int)(335 + 5);

string s;

int n;
int doubling[MAX_LOG][MAX_N];

unordered_map<int, vector<int>> mp;

string binexp = "100100100100110101101001001011001010011000011011111010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";

void make_doubling() {
  int dp[2][MAX_N];

  for (int i = 0; i < n; ++i) {
    if (s[i] == 'R') {
      dp[0][i] = i + 1;
    } else {
      dp[0][i] = i - 1;
    }
  }

  for (int i = 0; i < n; ++i) {
    mp[0].push_back(dp[0][i]);
  }

  for (int i = 1; i < binexp.size(); ++i) {
    int cur = i % 2;
    int last = (i - 1) % 2;

    for (int j = 0; j < n; ++j) {
      int fst = dp[last][j];
      int snd = dp[last][fst];
      dp[cur][j] = snd;
    }

    if (binexp[i] == '1') {
      for (int j = 0; j < n; ++j) {
        mp[i].push_back(dp[cur][j]);
      }
    }
  }
}

int after[MAX_N];

int ans[MAX_N];

int main(void) {
  // Here your code !
  cin >> s;

  n = s.size();

  reverse(binexp.begin(), binexp.end());

  make_doubling();

  for (int i = 0; i < n; ++i) {
    after[i] = i;
  }

  for (int i = 0; i < binexp.size(); ++i) {
    if (binexp[i] == '0') continue;

    for (int j = 0; j < n; ++j) {
      after[j] = mp[i][j];
    }
  }

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

  for (int i = 0; i < n; ++i) {
    printf("%d ", ans[i]);
  }
  printf("\n");

  return 0;
}


Measured memory_bytes: 12920
#include <bits/stdc++.h>
using namespace std;
int main () {
int h,n,a;
cin>>h>>n;
for (int i=0;i<n;i++)
{
    cin>>a;
    h=h-a;
}
if (h>0)cout<<"No";
else
    cout<<"Yes";
return 0;
}


Measured memory_bytes: 256
#include <cstdio>
 
const int MN = 21;
 
int N, K, s[1 << MN], tr[1 << MN][2];
int f[MN][1 << MN], Ans;
 
int main() {
	scanf("%d%d", &N, &K);
	for (int i = 0; i <= N; ++i)
		for (int x = 0; x < 1 << i; ++x)
			scanf("%1d", &f[i][1 << i ^ x]);
	s[0] = -1;
	for (int A = 1; A < 2 << N; ++A) s[A] = s[A >> 1] + 1;
	for (int A = 2; A < 2 << N; ++A)
		if (A >> (s[A] - 1) & 1) {
			tr[A][1] = A ^ 1 << s[A];
			tr[A][0] = tr[tr[A][1]][0];
		} else {
			tr[A][0] = A ^ 3 << (s[A] - 1);
			tr[A][1] = tr[tr[A][0]][1];
		}
	for (int i = N; i >= 1; --i) {
		for (int A = 1 << i; A < 2 << N; ++A) {
			if (!f[i][A]) continue;
			int _ = A >> i, B = (A & ((1 << i) - 1)) | 1 << i;
			if (tr[B][0]) f[s[tr[B][0]]][(_ << 1 ^ 1) << s[tr[B][0]] ^ tr[B][0]] += f[i][A];
			if (tr[B][1]) f[s[tr[B][1]]][(_ << 1 ^ 0) << s[tr[B][1]] ^ tr[B][1]] += f[i][A];
			f[0][_] += f[i][A];
		}
	}
	Ans = 1;
	for (int A = 2; A < 2 << N; ++A) if (f[0][A] >= K && s[A] > s[Ans]) Ans = A;
	int j = N;
	while (~Ans >> j & 1) --j;
	while (j--) printf("%d", Ans >> j & 1);
	puts("");
	return 0;
}

Measured memory_bytes: 194816
S = input()

slist = "abcdefghijklmnopqrstuvwxyz"

tmp = 0
tmps = []
ans = len(S)
for char in set(S):
    for s in S:
        if s != char:
            tmp += 1
        else:
            tmps.append(tmp)
            tmp = 0
    tmps.append(tmp)
    ans = min(ans,max(tmps))
    tmps = []
    tmp = 0

print(ans)


Measured memory_bytes: 3060
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
// #define USE_LLONG_AS_INT
#ifdef USE_LLONG_AS_INT
#define int long long
#define inf (1ll<<60)
#else
#define inf (1<<30)
#endif
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define rev(i,n) for(int i=(n)-1;i>=0;i--)
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define Yes(f) cout<<(f?"Yes":"No")<<endl
#define yes(f) cout<<(f?"yes":"no")<<endl
#define YES(f) cout<<(f?"YES":"NO")<<endl
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v), greater<int>())

using namespace std;

const int mod=1e9+7;
const string sp=" ";

void run();

void init() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(12);
}

signed main(){
    init();
    run();
    return 0;
}

int f[100010];

void run(){
    int n;
    cin>>n;
    rep(i,n){
        int a,b;
        cin>>a>>b;
        f[a]++,f[b+1]--;
    }
    int ans=0;
    Rep(i,1,100010){
        f[i]+=f[i-1];
        if(f[i]>=i-1)ans=i-1;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 3608
#include <bits/stdc++.h>
using namespace std;
template<class C>constexpr int sz(const C&c){return int(c.size());}
using ll=long long;constexpr const char nl='\n',sp=' ';

int main() {
  // freopen("in.txt", "r", stdin);
  // freopen("out.txt", "w", stdout);
  // freopen("err.txt", "w", stderr);
  ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  vector<ll> a(3), b(3);
  cin >> a[0] >> a[1] >> b[0] >> b[1];
  a[2] = clamp(0LL, a[0], a[1]);
  b[2] = clamp(0LL, b[0], b[1]);
  ll ans = LLONG_MIN;
  for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) ans = max(ans, a[i] * b[j]);
  cout << ans << nl;
  return 0;
}


Measured memory_bytes: 3612
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main {

	public static void main(String[] args) throws IOException {
		new Main().solve();
	}

	private void solve() throws IOException {
		try {
			solveA();
			//			 solveB();
			//			 solveC();
			//			 solveD();
			//			 solveE();
			//			 solveF();
		} finally {
			if (in != null) {
				in.close();
			}
			if (out != null) {
				out.flush();
				out.close();
			}
		}

	}

	private void solveA() {
		int numA = nextInt();
		int numB = nextInt();
		int numC = nextInt();

		if (numA == numB && numB == numC) {
			out.println("Yes");
		} else {
			out.println("No");
		}

	}

	private void solveB() {
		int numN = nextInt();

		out.println("");
	}

	private void solveC() {
		int numN = nextInt();

		out.println("");
	}

	private void solveD() {
		int numN = nextInt();

		out.println("");
	}

	private void solveE() {
		int numN = nextInt();

		out.println("");
	}

	private void solveF() {
		int numN = nextInt();

		out.println("");
	}

	private final PrintWriter out = new PrintWriter(System.out);
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	}

	private int readByte() {
		if (hasNextByte())
			return buffer[ptr++];
		else
			return -1;
	}

	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}

	private void skipUnprintable() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr]))
			ptr++;
	}

	public boolean hasNext() {
		skipUnprintable();
		return hasNextByte();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	public long nextLong() {
		if (!hasNext())
			throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}
}

Measured memory_bytes: 23252
#include<bits/stdc++.h>
using namespace std;
const int M=1e9+7,N=1<<20;
int n,i,ans,x,f[N],g[N],now,la[N];
inline char gc(){
	static char buf[100000],*p1=buf,*p2=buf;
	return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
inline int rd(){
	int x=0,fl=1;char ch=gc();
	for(;ch<48||ch>57;ch=gc())if(ch=='-')fl=-1;
	for(;48<=ch&&ch<=57;ch=gc())x=(x<<3)+(x<<1)+(ch^48);
	return x*fl;
}
void inc(int &x,int y){x+=y;if(x>=M)x-=M;}
int main(){
    //freopen("inp","r",stdin);
	n=rd();
	for (i=1;i<N;i++) f[i]=1;
	for (i=ans=1;i<=n;i++){
		x^=rd();
		if (x) inc(f[x],1ll*(now-la[x])*g[x]%M),inc(g[x],f[x]),la[x]=now;
		else inc(ans,ans),now++;
	}
	if (x) return printf("%d",f[x]),0;
	ans=1ll*ans*(M+1>>1)%M;
	for (i=1;i<N;i++) inc(ans,g[i]);
	printf("%d",ans);
}


Measured memory_bytes: 12672
#include <iostream>
using namespace std;
 
int main()
{
	int m, n;
	
	cin >> n >> m;
	
	int *a = new int[n * m];
	int *b = new int[m];
	int *c = new int[n];
	
	for (int i = 0; i < n; i++)
		for (int j = 0; j < m; j++)
			cin >> a[i * m + j];
	
	for (int j = 0; j < m; j++)
		cin >> b[j];

	for (int i = 0; i < n; i++) {
		c[i] = 0;
		for (int j = 0; j < m; j++)
			c[i] += a[i * m + j ] * b[j];
		cout << c[i] << endl;
	}
	
	delete [] a;
	delete [] b;
	delete [] c;
	
	return 0;
}

Measured memory_bytes: 3156
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int a = s.nextInt();
		int b = s.nextInt();
		int c = s.nextInt();
		int d = s.nextInt();
		int aa=a*b;
		int bb=c*d;
		int answer = 0;

		if(aa>bb) {
			answer = aa;
		}else if(aa<=bb) {
			answer = bb;
		}
		System.out.println(answer);

	}

}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll MOD = 1000000007;
const ll INF = 1061109567;
const double EPS = 1e-10;

int main(){
    int N;
    cin>>N;
    int C[N],S[N],F[N];
    int time[N];
    for(int i=0;i<N-1;i++){
        cin>>C[i]>>S[i]>>F[i];
        time[i]=0;
    }
  time[N-1]=0;
    for(int i=0;i<N-1;i++){
        time[i]+=S[i]+C[i];
        for(int j=i+1;j<N-1;j++){
            if(time[i]<S[j]){
                time[i]=S[j];
            }
            while(!((time[i]%F[j])==0)){
                time[i]++;
            }
            time[i]+=C[j];
        }
    }

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

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

typedef long long ll;
const ll INF = 1e18;

int main(int argc, char* argv[])
{
  ll N;
  ll T = 0;
  std::cin >> N;

  std::vector< ll > vt_s(N+1, 0);
  std::vector< ll > vt_e(N+1, 0);
  std::vector< double > vv(N, 0.0);

  for (ll i = 0; i < N; i++) {
    ll t;
    std::cin >> t;
    vt_s[i] = T;
    T += t;
    vt_e[i] = T;
  }
  for (ll i = 0; i < N; i++) {
    std::cin >> vv[i];
  }  

  double ans   = 0.0;
  double pre_v = 0.0;
  for (double t = 0.5; t <= T; t += 0.5) {
    double min_v = 100.0;
    min_v = std::min(min_v, t);
    min_v = std::min(min_v, T - t);

    for (ll i = 0; i < N; i++) {
      if (vt_s[i] <= t && t <= vt_e[i]) {
	min_v = std::min(min_v, vv[i]);
      }

      if (t < vt_s[i]) {
	min_v = std::min(min_v, vv[i] + (vt_s[i] - t));
      }
      
      if (vt_e[i] < t) {
	min_v = std::min(min_v, vv[i] + (t - vt_e[i]));
      }
    }

    ans += (pre_v + min_v) * 0.25;
    pre_v = min_v;
  }

  printf("%.15f\n", ans);
  
  return 0;
}


Measured memory_bytes: 256
import math

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

b = 0
c = 0

for i in range(N):
    if A[i]%2==1:
        b = b+1
    else:
        c = c+1

if P==1:
    k=1
else:
    k=0
  
def P(n, r):
    return math.factorial(n)//math.factorial(n-r)   
 
def C(n, r):
    return P(n, r)//math.factorial(r)
    
ans = 0
tmp = 2**c

while k<=b:
    ans = ans + tmp*C(b, k)
    k = k+2

print(ans)



Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std ;
struct fuck{
       int val , id ;
}f[200010] ;
bool cmp( fuck a , fuck b ) { return a.val < b.val ; }
int x[200010] ;
int main(){
    int n ;
    cin >> n ;
    for( int i = 1 ; i <= n ; i++ ){
        f[i].id = i ;
        scanf( "%d" , &f[i].val ) ;
    }
    sort( f + 1 , f + 1 + n , cmp ) ;
    for( int i = 1 ; i <= n ; i++ )
        x[f[i].id] = i ;
    int A = f[n / 2].val ;
    int B = f[n / 2 + 1].val ;
    for( int i = 1 ; i <= n ; i++ ){
        if ( x[i] <= n / 2 ) printf( "%d\n" , B ) ;
        else printf( "%d\n" , A ) ;
    }
    return 0 ;
}

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

Measured memory_bytes: 128
p,q,r,s=map(int,input().split())
x=r-p
y=s-q
uy='U'*y
print(uy+'R'*x+'D'*y+'L'*x+'L'+uy+'U'+'R'*(x+1)+'D'+'R'+'D'*(y+1)+'L'*(x+1)+'U')

Measured memory_bytes: 9096
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1e9+7;
const int INF = 2e9;

int par[200000];

void init(int n){
    for(int i=0; i<n; i++){
        par[i] = i;
    }
}

int root(int x){
    if(par[x] == x){
        return x;
    }
    else{
        return par[x] = root(par[x]);
    }
}

bool same(int x, int y){
    return root(x) == root(y);
}

void unite(int x, int y){
    x = root(x);
    y = root(y);
    if(x==y) return;
    par[x] = y;
}

int main(){
    int n, m, x, y, z, ans=0;
    cin >> n >> m;
    init(n);
    for(int i=0; i<m; i++){
        cin >> x >> y >> z;
        unite(x-1,y-1);
    }
    for(int i=0; i<n; i++){
        if(root(i)==i) ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 1152
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int N, K;
    vector<int> A;

    cin >> N >> K;
    A.resize(N);
    for(int i = 0; i < N; ++i)
    {
        cin >> A[i];    
    }

    for(int k = 0; (k < K) && (k < 45); ++k)
    {
        vector<int> B(N, 0);

        // B[i] に i+1 を照らす電球の数をカウント
        for(int i = 0; i < N; ++i)
        {
            int first = (i >= A[i]) ? (i - A[i]) : 0;
            B[first]++;

            int last  = (i + A[i] + 1);
            if( (i + A[i] + 1) < N )
            {
                B[last]--;
            }
        }

        for(int i = 1; i < N; ++i)
        {
            B[i] += B[i-1];
        }

        A = B;        
    }

    // 結果の出力
    for(size_t i = 0; i < N; ++i)
    {
        cout << A[i] << " ";
    }
    cout << endl;


    //cout << 

    return 0;    
}

Measured memory_bytes: 4840
#include <iostream>
#include <string>
#include <map>
#include <cstdint>
#include <vector>

using namespace std;

const uint64_t N = 2019;

int main()
{
    uint64_t L, R;
    cin >> L >> R;

//    L %= N;
//    R %= N;
    if(L >= R){
        cout << 0 << endl;
        return 0;
    }

    uint64_t m = 2019, k;
    for(uint64_t i = L; i <= R - 1; i++){
        for(uint64_t j = i + 1; j <= R; j++){
            k = (i * j) % N;
            if(m > k){
                m = k;
                if(k == 0){
                    cout << 0 << endl;
                    return 0;
                }
            }
        }
    }
    cout << m << endl;
    return 0;
}


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

#define DEF_ELEM_MAX 1046527

#define M DEF_ELEM_MAX
#define L 14

char H[M][L];

/////////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////////
int h1(int key)
{
	return (key%M);
}

/////////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////////
int h2(int key)
{
	return (1 + (key%(M-1)));
}

int h(int key, int i)
{
	return ((h1(key)+i*h2(key))%M);
}

/////////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////////
int Char2No(char ch)
{
	int ret;
	switch (ch) {
	case 'A':
		ret = 1;
		break;
	case 'C':
		ret = 2;
		break;
	case 'G':
		ret = 3;
		break;
	case 'T':
		ret = 4;
		break;
	}
	return ret;
}
/////////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////////
int getkey(char *str)
{
	int i;
	int key = 0;
	int p = 1;
	for ( i = 0 ; i < (int)strlen(str) ; i++ ) {
		key += p*(Char2No(str[i]));
		p *= 5;
	}
	return key;
}
/////////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////////
int insert(char *str)
{
	int key = getkey(str);
	int j;
	int i = 0;
	for ( i = 0 ; ;i++ ) {
		j = h(key, i);
		if (strlen(H[j]) == 0) {
			strcpy(H[j], str);
			return 0;
		} else if (strcmp(H[j], str) == 0) {
			return 1;
		}
	}
}

/////////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////////
int find(char *str)
{
	int j;
	int key = getkey(str);
	int i = 0;
	for ( i = 0 ; ;i++ ) {
		j = h(key, i);
		if (strcmp(H[j], str) == 0) {
			return 1;
		} else if (strlen(H[j]) == 0) {
			return 0;
		}
	}
}

/////////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////////
int main(void)
{
	int i;
	char cmd[16] = {0};
	char str[14] = {0};
	char *pMsg;
	int N;

//
	scanf("%d", &N);
	for ( i = 0 ; i < N ; i++ ) {
		scanf("%s %s", cmd, str);
		if ( cmd[0] == 'i') {
			insert(str);
		} else {
			if (find(str)) {
				pMsg = "yes";
			} else {
				pMsg = "no";
			}
			printf("%s\n", pMsg);
		}
	}
	return 0;
}

Measured memory_bytes: 14912