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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void solve() {
    ll N, K, R, S, P;
    cin >> N >> K >> R >> S >> P;
    string T;
    cin >> T;
    ll ans = 0;
    vector<char> X(N, 'a');

    map<ll, ll> points{{0, R},
                       {1, P},
                       {2, S}};
    map<char, ll> mp{{'r', 0},
                     {'p', 1},
                     {'s', 2}};
    rep(x, K) {
        vector<vector<ll>> dp(N / K + 10, vector<ll>(3, 0));
        ll i = 0;
        for (int z = x; z < N; z += K) {
            rep(j, 3) {
                rep(k, 3) {
                    if (j == k) {
                        continue;
                    } else {
                        dp[i + 1][k] = max(dp[i + 1][k], dp[i][j] + ((mp[T[z]] + 1) % 3 == k ? points[k] : 0));
                    }
                }
            }
            i++;
        }
        ll m = 0;
        rep(a, N / K + 10) {
            rep(b, 3) {
                m = max(m, dp[i][b]);
            }
        }
        ans += m;
    }
    cout << ans << '\n';
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    solve();
    return 0;
}


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

int main() {
  int H,W; cin>>H>>W;
  for(int i=0; i<W+2; i++) cout<<'#';
  cout<<endl;
  for(int i=0; i<H; i++){
    string s; cin>>s;
    cout<<'#'<<s<<'#'<<endl;
  }
  for(int i=0; i<W+2; i++) cout<<'#';
  cout<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
vector<int> a;
int main(void)
{
	cin>>n;
	int flag=0;
	int minv=101;
	int sum=0;
	for (int i = 0; i < n; i++) {
		int t;
		cin>>t;
		a.push_back(t);
		sum+=t;
		if(t%10!=0){
		flag=1;
		minv=min(minv,t);
		}
	}
	if(flag){
		if(sum%10==0)sum-=minv;
	}
	else {
		sum=0;
	}
	cout<<sum<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
#define chmin(a, b) ((a)=min((a), (b)))
#define chmax(a, b) ((a)=max((a), (b)))
#define fs first
#define sc second
#define eb emplace_back
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;

const ll MOD=1e9+7;
const ll INF=1e18;
const double pi=acos(-1);
const double eps=1e-10;

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

vector<vector<ll>> dist(110, vector<ll>(110, INF));
bool valid = true;

void warshall_floyd(int n){
    for(int k=0; k<n; k++){
        for(int i=0; i<n; i++){
            for(int j=0; j<n; j++){
                if(dist[i][k] != INF && dist[k][j] != INF){
                    dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
                }

                if(i == j && dist[i][j] < 0){
                    valid = false;
                }
            }
        }
    }
}

int main(){
    int v, e; cin>>v>>e;

    for(int i=0; i<v; i++){
        dist[i][i] = 0;
    }

    for(int i=0; i<e; i++){
        int s, t, d; cin>>s>>t>>d;
        dist[s][t] = d;
    }

    warshall_floyd(v);

    if(!valid){
        cout << "NEGATIVE CYCLE" << endl;
        return 0;
    }

    for(int i=0; i<v; i++){
        for(int j=0; j<v; j++){
            if(dist[i][j] == INF) cout << "INF" << " \n"[j == v-1]; 
            else cout << dist[i][j] << " \n"[j == v-1];
        }
    }
}


Measured memory_bytes: 3260
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <list>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <utility>
#include <complex>
#include <functional>
using namespace std;
const int MOD = 1000000007;
typedef long long ll;
typedef pair<int,int> p;
const int INF = (1 << 28);
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
int n, m, a, b;
vector<p> v;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n >>m;
    for(int i=0;i<m;i++){
        cin>>a>>b;
        v.push_back(make_pair(b,a));
    }
    sort(ALL(v));
    int ans=1;
    int max1=v[m-1].second;
    for(int i=m-1;i>=0;i--){
        if (max1>=v[i].first){
            ans++;
            max1=v[i].second;
        }
        if(max1<v[i].second){
            max1=v[i].second;
        }
    }
    cout << ans << "\n";
}

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

typedef long long ll;
typedef pair<ll,ll> pi;
typedef vector <ll> vi;
typedef vector <pi> vpi;
#define f first
#define s second
#define FOR(i,s,e) for(ll i=s;i<=ll(e);++i)
#define DEC(i,s,e) for(ll i=s;i>=ll(e);--i)
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define lbd(x, y) lower_bound(all(x), y)
#define ubd(x, y) upper_bound(all(x), y)
#define aFOR(i,x) for (auto i: x)
#define mem(x,i) memset(x,i,sizeof x)
#define fast ios_base::sync_with_stdio(false),cin.tie(0)
#define maxn 100001
#define INF 1e9
#define int ll
int N,X,B[maxn],L[maxn],U[maxn];
vpi vect;
int tar = 0;
bool vis[maxn];

bool qry(int x){
	int num = x % X;
	int num_complete = x / X;
	
	if (num_complete >= N) return 1;
	int ans = 0;
	
	vi firstK;
	int sm = 0;
	FOR(i,0,num_complete-1){
		firstK.pb(vect[i].s);
		sm += vect[i].f;
	}
	ans = max(ans,sm);
	mem(vis,0);
	FOR(i,0,firstK.size() - 1){
		vis[vect[i].s] = 1;

		int res = 0;
		res += sm - vect[i].f + vect[num_complete].f;
		
		int idx = vect[i].s;
		if (num > B[idx]) res += B[idx] * L[idx] + (num - B[idx]) * U[idx];
		else res += num * L[idx];
		ans = max(ans,res);
	}

	FOR(i,0,N-1){
		if (vis[i]) continue;
		int res = 0;
		
		res += sm;
			
		if (num > B[i]) res += B[i] * L[i] + (num - B[i]) * U[i];
		else res += num * L[i];
		ans = max(ans,res);
	}
	return (ans >= tar);
}
int32_t main(){
	fast;
	
	cin>>N>>X;
	FOR(i,0,N-1) cin>>B[i]>>L[i]>>U[i];
	
	
	FOR(i,0,N-1) vect.pb(pi(B[i] * L[i] + U[i] * (X - B[i]),i));
	
	sort(all(vect),greater<pi>());
	
	
	FOR(i,0,N-1) tar += B[i] * L[i];
	
	int num = 0;
	FOR(i,0,N-1) num += B[i];
	
	int l = -1, r = 1e10;
	
	while (l + 1 < r){
		int mid = (l+r)/2;
		
		
		if (qry(mid)) r = mid;
		else l = mid;
	}

	cout<<l + 1;
		
	
	
	
	
	
	
	
}



Measured memory_bytes: 6140
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;


namespace AtC
{
    class Program
    {
        static void Main(string[] args)
        {
            var S = Console.ReadLine();
            var strings = Regex.Split(S, "[^ACGT]");
            Console.WriteLine(strings.Max(val => val.Length));
        }
    }
}

Measured memory_bytes: 15960
import java.io.*;
import java.util.*;

class Dice{
	String face1;
	String face2;
	String face3;
	String face4;
	String face5;
	String face6;
	
	Dice(String a1,String a2,String a3,String a4,String a5,String a6){
		this.face1= a1;
		this.face2= a2;
		this.face3= a3;
		this.face4= a4;
		this.face5= a5;
		this.face6= a6;
	}
	
	void roll(char c){
		if( c=='N' ){
			String buf1= this.face1;
			String buf2= this.face2;
			String buf6= this.face6;
			String buf5= this.face5;
			
			this.face1= buf2;
			this.face2= buf6;
			this.face6= buf5;
			this.face5= buf1;
		}
		else if( c=='S' ){
			String buf1= this.face1;
			String buf2= this.face2;
			String buf6= this.face6;
			String buf5= this.face5;
			
			this.face1= buf5;
			this.face2= buf1;
			this.face6= buf2;
			this.face5= buf6;
		}
		else if( c=='E' ){
			String buf1= this.face1;
			String buf4= this.face4;
			String buf6= this.face6;
			String buf3= this.face3;
			
			this.face1= buf4;
			this.face4= buf6;
			this.face6= buf3;
			this.face3= buf1;
		}
		else if( c=='W' ){
			String buf1= this.face1;
			String buf4= this.face4;
			String buf6= this.face6;
			String buf3= this.face3;
			
			this.face1= buf3;
			this.face4= buf1;
			this.face6= buf4;
			this.face3= buf6;
		}
	}
}

public class Main{
	public static void main(String args[]) throws Exception{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		String[] pip = str.split(" ");
		Dice dice= new Dice(pip[0],pip[1],pip[2],pip[3],pip[4],pip[5]);
		
		str= br.readLine();
		int i;
		for(i=0;i<str.length();i++){
			dice.roll(str.charAt(i));
		}
		
		System.out.println(dice.face1);
	}
}

Measured memory_bytes: 16964
#include<iostream>
#include <vector>
#include<string.h>
using namespace std;

int main(){
   string S;
   cin>>S;
   if(S=="SUN"){
       cout<<7<<endl;
   }
    if(S=="MON"){
       cout<<6<<endl;
   }
     if(S=="TUE"){
       cout<<5<<endl;
   }
     if(S=="WED"){
       cout<<4<<endl;
   }
     if(S=="THU"){
       cout<<3<<endl;
   }
     if(S=="FRI"){
       cout<<2<<endl;
   }
     if(S=="SAT"){
       cout<<1<<endl;
   }
   return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    int i,a,n;
    long sum=0;
    int max,min;
    
    cin >> n;
    cin >> a;
    max=a;
    min=a;
    sum+=a;
    
    for (i=1;i<n;i++){
        cin >> a;
        if (a<min){
            min=a;
        }
        if (a>max){
            max=a;
        }
        sum+=a;
    }
    cout << min <<" " << max <<" " << sum <<endl;
}


Measured memory_bytes: 3076
#pragma GCC optimize("O3")

#define _GLIBCXX_DEBUG
#include <iostream>
#include <vector>
#include <string>
#include <string_view>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <cassert>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
using namespace std;

/*----------macros----------*/

//output================
#define endl '\n'
#define fcout(a) cout << fixed << setprecision((int)(a))

//typedef===============
typedef long long       ll;
typedef long double     ld;
typedef pair<int, int>  Pii;
typedef pair<ll, ll>    Pll;

//const number==========
constexpr ll INF9   = (ll)1e9 + 1;
constexpr ll INF18  = (ll)1e18 + 1;
constexpr ll MOD    = 1000000007;
constexpr ll MOD2   = 998244353;
constexpr ld PI     = 3.141592653589793L;

//member================
#define pb push_back
#define eb emplace_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second

//others================
#define all(x)          (x).begin(), (x).end()
#define rall(x)         (x).rbegin(), (x).rend()
#define rep(i, n)       for(int i = 0; (i) < (n); ++(i))
#define reps(i, n)      for(int i = 1; (i) <= (n); ++(i))
#define rrep(i, n)      for(int i = n - 1; (i) >= 0 ; --(i))
#define repbit(bit, n)  for(int bit = 0; (bit) < (1 << (n)); ++(bit))
#define ifbit(bit, i)   if((bit) & (1 << (i)))
#define CtoI(c)         int((c)) - int('0')
#define ItoC(c)         char((c) + '0')

//functions=============
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }

template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

//vector<int> dx = {1, 0, -1, 0}, dy = {0, 1, 0, -1};
//vector<int> dx2 = { 1,1,0,-1,-1,-1,0,1 }, dy2 = { 0,1,1,1,0,-1,-1,-1 };

/*--------additional--------*/

int n, m, q;
vector<int> a(100), b(100), c(100), d(100);
ll ans = 0;

void dfs(vector<int> _v, int cnt, int las){
    if(cnt == n){
        int res = 0;
        rep(i, q){
            if(_v[b[i]] - _v[a[i]] == c[i]) res += d[i];
        }
        chmax(ans, res);
    }
    else{
        for(int i = las; i < m + 1; ++i){
            vector<int> nw = _v;
            nw.pb(i);
            dfs(nw, cnt + 1, i);
        }
    }
}

/*----------main------------*/

int main() {
/*----------fastio----------*/
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
    std::ios::sync_with_stdio(false);
/*----------solve-----------*/

    cin >> n >> m >> q;
    rep(i, q){
        cin >> a[i] >> b[i] >> c[i] >> d[i];
        --a[i], --b[i];
    }

    vector<int> v;

    dfs(v, 0, 1);

    cout << ans << endl;

return 0;
}

Measured memory_bytes: 3568
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
const int maxn=100000+10;
struct node
{
	int to,next,w;
}edge[maxn];
int k=1,head[maxn],ind[maxn],n,m,dp[maxn];
void add(int u,int v,int w)
{
	edge[++k].to=v;edge[k].next=head[u];head[u]=k;edge[k].w=w;
}
void Topsort()
{
	queue<int>q;
	for(int i=1;i<=n;i++)
		if(!ind[i])
			q.push(i);
	while(!q.empty())
	{
		int x=q.front();q.pop();
		for(int i=head[x];i;i=edge[i].next)
		{
			dp[edge[i].to]=max(dp[edge[i].to],dp[x]+edge[i].w);
			ind[edge[i].to]--;
			if(!ind[edge[i].to])
				q.push(edge[i].to);
		}
	}
}
int  main()
{
	cin>>n>>m;
	for(int i=1;i<=m;i++)
	{
		int u,v;
		cin>>u>>v;
		add(u,v,1);
		ind[v]++;
	}
	Topsort();
	int ans=0;
	for(int i=1;i<=n;i++)
		ans=max(ans,dp[i]);
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 5960
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi; 
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
const int mod = 1e9+7;
const int maxn = 2e5+10;
const int inf = 0x3f3f3f3f;
ll book[maxn],sum;
int main()
{
	ios::sync_with_stdio(false);cin.tie(0);
	ll n,m;
	cin>>n>>m;
	rep(i,1,n) {
		cin>>book[i];
		sum+=book[i];
	}
	sort(book+1,book+1+n);
	if(sum<=4*m*book[n-m+1]) cout<<"Yes"<<'\n';
	else cout<<"No"<<'\n';
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
using namespace std;
#define MOD 1000000007
#define INF 1<<30
#define LINF (ll)1<<62
#define rep(i,n) for(ll i=0; i<(n); i++)
#define REP(i,a,b) for(ll i=(a); i<(b); i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll, ll> P;
typedef vector<pair<ll, ll>> vpl;



int main(){
    string s; cin >> s;
    ll dp[s.size()+1][13] = {};
    if(s[0] == '?'){
        rep(i,10) dp[1][i]++;
    }else{
        dp[1][s[0]-'0']++;
    }
    for(ll i=1; i<s.size(); i++){
        if(s[i] == '?'){
            rep(j,13){
                rep(k,10){
                    dp[i+1][(10*j+k)%13] += dp[i][j] % MOD;
                    dp[i+1][(10*j+k)%13] %= MOD;
                }
            }
        }else{
            rep(j,13){
                dp[i+1][(10*j+s[i]-'0')%13] += dp[i][j] % MOD; 
                dp[i+1][(10*j+s[i]-'0')%13] %= MOD;
            }
        }
        
    }
    cout << dp[s.size()][5] % MOD << endl;
}


Measured memory_bytes: 10624
#include <bits/stdc++.h>
using namespace std;
#define ll long long  int
#define mod 1000000007
#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL)

void solve()
{
       ll a,b,c;
       cin>>a>>b>>c;
       ll k;
       cin>>k;
       while(k>0&&b<=a)
       {
       	 b=b*2;
       	 k--;
       }
    
 while(k>0&&c<=b)
       {
       	 c=c*2;
       	 k--;
       }
       if(a<b&&b<c)
       	cout<<"Yes";
       else
       	cout<<"No";
    }
int main()
{
    fast();
    {
      solve();
    }
    return 0;
}



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

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int h,w,cnt=0;
	cin>>h>>w;
	vector<vector<char>> data(h+1,vector<char>(w+1));
	vector<vector<string>> v(h+1,vector<string>(w+1));
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			cin>>data.at(i).at(j);
		}
	}
	rep(i,h){
		rep(j,w){
			if(i+2<=h){
				if(data.at(i+1).at(j)=='#'){
					cnt++;
				}
			}
			if(i+2<=h && j+2<=w){
				if(data.at(i+1).at(j+1)=='#'){
					cnt++;
				}
			}
			if(j+2<=w){
				if(data.at(i).at(j+1)=='#'){
					cnt++;
				}
			}
			if(i-1>=0 && j+2<=w){
				if(data.at(i-1).at(j+1)=='#'){
					cnt++;
				}
			}
			if(i-1>=0){
				if(data.at(i-1).at(j)=='#'){
					cnt++;
				}
			}
			if(i-1>=0 && j-1>=0){
				if(data.at(i-1).at(j-1)=='#'){
					cnt++;
				}
			}
			if(j-1>=0){
				if(data.at(i).at(j-1)=='#'){
					cnt++;
				}
			}
			if(i+2<=h && j-1>=0){
				if(data.at(i+1).at(j-1)=='#'){
					cnt++;
				}
			}
			if(data.at(i).at(j)=='#'){
				v.at(i).at(j)="#";
			}else{
				v.at(i).at(j)=to_string(cnt);
			}
			cnt=0;
		}
	}
	rep(i,h){
		rep(j,w){
			cout<<v.at(i).at(j);
		}
		cout<<endl;
	}
}


Measured memory_bytes: 384
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
#include <assert.h>
typedef int64_t ll;
typedef uint64_t ull;
int acs(const void *a, const void *b){return *(int*)a - *(int*)b;} /* 1,2,3,4.. */
int des(const void *a, const void *b){return *(int*)b - *(int*)a;} /* 8,7,6,5.. */
#define min(a,b) (a < b ? a: b)
#define max(a,b) (a > b ? a: b)

#define MAXN (8)
#define MOD (1000000007)

// べき乗余
int64_t modpow(int64_t b, int64_t e)
{
    int64_t result = 1;
    while(e>0)
    {
        if(e&1) result = (result * b) % MOD;
        e >>= 1;
        b = (b * b) % MOD;
    }
    return result;
}


// 組み合わせ数
// nCk % MOD
ll cf[MAXN+1]; // 1*2*3*...*i
ll ci[MAXN+1]; // 1/ 1*2*3*...*i
void CombInit(ll n)
{
    cf[0] = 1;
    for(int i=1;i<=n;i++) cf[i] = cf[i-1] * i %MOD;
    ci[n] = modpow(cf[n],MOD-2);
    for(int i=n-1;i>=0;i--) ci[i] = ci[i+1] * (i+1) %MOD;
}
ll Comb(ll a,ll b)
{
    return cf[a]*ci[b]%MOD*ci[a-b]%MOD;
}
// カタラン数 2nまで参照することに注意
ll Catalan(ll n)
{
    return cf[2*n]*ci[n+1]%MOD*ci[n]%MOD;
}

int x[MAXN];
int y[MAXN];

int main(void)
{
    ll n;
    scanf("%ld",&n);
    CombInit(n);
    for(int i=0;i<n;i++) scanf("%d %d",&x[i],&y[i]);


    double ans = 0;
    for(int i=0;i<n;i++) for(int j=i+1;j<n;j++)
    {
        double dis;
        dis = sqrt((double)((x[i]-x[j])*(x[i]-x[j]) +(y[i]-y[j])*(y[i]-y[j])));
        ans += dis*cf[n-1]*2;
    }
    printf("%.10lf\n", ans/cf[n]);
    return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string stdd="2019/04/30";
    string a;
    cin>>a;
    if(a<=stdd)
    {
        cout<<"Heisei"<<endl;
    }
    else
    {
        cout<<"TBD"<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
const int INF=1145141919,MOD=1e9+7;
const long long LINF=8931145141919364364,LMOD=998244353;
// const int dx[]={1,0,-1,0,1,1,-1,-1},dy[]={0,-1,0,1,1,-1,-1,1};

int main(){
    int R,G,B,N; cin>>R>>G>>B>>N;
    int ans=0;
    for(int r=0;r<3300;r++){
        for(int g=0;g<3300;g++){
            if((N-(r*R+G*g))>=0 && (N-(r*R+G*g))%B==0) ans++;
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <string>
#include <tuple>
#include <vector>

using namespace std;
typedef long long int ll;
typedef vector<int> vi;
typedef vector<vi> vvi;

#define INF (1e9)

int N;

int main() {
    cin >> N;

    vi X(N), Y(N);
    for (int i = 0; i < N; i++) {
        cin >> X[i] >> Y[i];
    }

    double ans;
    for (int i = 0; i < N; i++) {
        for (int j = i + 1; j < N; j++) {
            ans += sqrt((X[i] - X[j]) * (X[i] - X[j]) + (Y[i] - Y[j]) * (Y[i] - Y[j]));
        }
    }

    ans /= double(N) / double(2);

    cout << fixed << setprecision(10);
    cout << ans << endl;
    return 0;
}


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

int compare_int(const void *a, const void *b) {
	return *(int *)b - *(int *)a;
}

#if 1
//解説
typedef pair<int, int> i_i;
int H, W, M;
set<i_i> st;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

void input() {
	cin >> H >> W >> M;
	for(int i = 0; i < M; i++) {
		int a, b;
		cin >> a >> b;
		st.insert({a, b});
	}
}

void solve() {
	map<int, int> mph, mpw;
	int hmaxval = 0;
	int wmaxval = 0;
	vector<int> hmax, wmax;
	for(auto tmp: st) {
		chmax(hmaxval, ++mph[tmp.first]);
		chmax(wmaxval, ++mpw[tmp.second]);
	}
	for(auto tmp : mph) {
		if(hmaxval == tmp.second) hmax.push_back(tmp.first);
	}
	for(auto tmp : mpw) {
		if(wmaxval == tmp.second) wmax.push_back(tmp.first);
	}
	int ANS = hmaxval + wmaxval - 1;
	
	for(auto h : hmax) {
		for(auto w : wmax) {
			if(st.find({h, w}) == st.end()) {
				ANS++;
				cout << ANS << endl;
				return;
			}		
		}
	}
	cout << ANS << endl;
}

#endif

int main()
{
#if 0
	// 本番回答
	// 1余計に加算されることは気づいたが、それを探索する方法がわからなかった.
    int H, W, M;
	cin >> H >> W >> M;
	static int hi[300001];
	static int wi[300001];
	static int hval[300001];
	static int wval[300001];
	
	int hmax = 0;
	int wmax = 0;
	
	for(int i = 1; i <= M; i++) {
		int tmpH, tmpW;
		cin >> tmpH >> tmpW;
		hi[i] = tmpH;
		wi[i] = tmpW;
		
		// 各列、行のsum
		hval[tmpH]++;
		if(hval[tmpH] > hmax) hmax = hval[tmpH];
		wval[tmpW]++;
		if(wval[tmpW] > wmax) wmax = wval[tmpH];
	}
	
	int max = hmax + wmax;
	int cntA = 0;
	int cntB = 0;
	for(int i = 1; i <= M; i++) {
		if(hval[i] != hmax) continue;
		for(int j = 1; j <= M; j++) {
			if(wval[j] != wmax) continue;
			cntA++;
			
			for(int ii = 1; ii <= M; ii++) {
				if(hi[ii] != i) continue;
				for(int jj = 1; jj <= M; jj++) {
					if(wi[jj] == j) {
						cntB++;
					}
				}
			}
		}
	}
	if(cntA == cntB) {
		max--;
	}
	/*
	for(int i = 1; i <= M; i++) {
		for(int j = 1; j <= M; j++) {
			
			int sum = 0;
			for(int h = 1; h <= M; h++) {
				if(hi[h] == i) {
					sum++;
				}
			}
			for(int w = 1; w <= M; w++) {
				if(wi[w] == j) sum++;
			}
			if(hi[i] == i && wi[j] == j) sum--;
			if(sum > max) max = sum;
		}
	}
	*/
	printf("%d\n", max);
	
    return 0;
	
#else
	input();
	solve();
	return 0;
#endif
}

//1000000000000001

Measured memory_bytes: 49464
import java.util.*;

public class Main {
    public static void main(String[] args){
        
        Scanner cin = new Scanner(System.in);
        
        int N = cin.nextInt();
        int list[] = new int[N];
        for(int i=0;i<N;i++){
            list[i] = cin.nextInt();
        }
        cin.close();
        int result = -1;
        int tmp = 0;
        for(int j=0;j<(int)Math.pow(10,7);j++){
            tmp = list[tmp]-1;
            if(tmp==1){
                result = j+1;
                break;
            }
        }
        System.out.println(result);
        
    }
}

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

typedef long long ll;
using namespace std;
int main(){
    cin.tie(0);
   	ios::sync_with_stdio(false);
    int a, p;
    cin >> a >> p;
    cout << (3*a+p)/2 << "\n";
    return 0;
}

Measured memory_bytes: 256
x, y = map(int, input().split())

tsuru = 1
kame = 1
flag = False

for tsuru in range(100):
    for kame in range(100):
        if tsuru + kame == x:
            if (tsuru*2 + kame*4) == y:
                flag = True
                break
    else:
        continue
    break


if flag is True:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 9120
#include<iostream>
#define rep(i,n) for(int=0; i<(n); i++)
typedef long long ll;
using namespace std;

int main(){
    string s, t;
    cin >> s >> t;
    if(s[0]==t[2] && s[2]==t[0] && s[1]==t[1]){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }
    
    return 0;
}

Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

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

    static class APassword {
        public void solve(int testNumber, FastReader s, PrintWriter out) {
            int n = s.nextInt();
            out.println(n * n * n);
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}



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

int main()
{
  int a, b;
  while (cin >> a >> b) {
    int c = a + b;
    int i;
    for (i = 1; c > 0; i++) {
      c /= 10;
    }
    cout << i - 1 << endl;
  }
  return 0;
}

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

using namespace std;

const int NMAX = 100000 + 5;
const int MMAX = 200000 + 5;

int M;
int L[MMAX];
int R[MMAX];
int D[MMAX];

int x[NMAX];
vector <pair <int, int> > graph[NMAX];

vector <int> topSort;

bool vis[NMAX];
void dfs(int node) {
    vis[node] = true;
    for (auto it: graph[node])
        if (!vis[it.first])
            dfs(it.first);
    topSort.push_back(node);
}

int where[NMAX];

void dfs2(int node) {
    vis[node] = true;
    for (auto it: graph[node])
        if (!vis[it.first]) {
            x[it.first] = it.second + x[node];
            dfs2(it.first);
        }
}

int main()
{
    int N;
    cin >> N >> M;

    for (int i = 1; i <= M; ++ i) {
        cin >> L[i] >> R[i] >> D[i];
        graph[L[i]].push_back({R[i], D[i]});
    }

    for (int i = 1; i <= N; ++ i)
        if (!vis[i])
            dfs(i);

    reverse(topSort.begin(), topSort.end());
    for (int i = 0; i < topSort.size(); ++ i)
        where[topSort[i]] = i;

    bool fail = false;
    for (int i = 1; i <= M; ++ i)
        if (where[L[i]] > where[R[i]]) {
            fail = true;
            break;
        }

    if (fail) {
        cout << "No\n";
        return 0;
    }

    for (int i = 1; i <= M; ++ i)
        graph[R[i]].push_back({L[i], -D[i]});
    for (int i = 1; i <= N; ++ i)
        vis[i] = false;

    for (int i = 1; i <= N; ++ i)
        if (!vis[i])
            dfs2(i);

    for (int i = 1; i <= M; ++ i)
        if (x[L[i]] + D[i] != x[R[i]]) {
            fail = true;
            break;
        }

    if (fail) {
        cout << "No\n";
        return 0;
    }
    cout << "Yes\n";
    return 0;
}


Measured memory_bytes: 14204
while True:
    a=int(input())
    if a==0:
        break
    n=1
    i=1
    while i<=a:
        n*=i
        i+=1
    m=0
    while True:
        if int(n)%10!=0:
            break
        n=int(n)//10
        m+=1
    print(m)



Measured memory_bytes: 5628
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    int a[n];
    int sum=0,min=INT_MAX;
    for(int i=0;i<n;i++)
    cin>>a[i];
    for(int i=1;i<=100;i++){
        sum=0;
        for(int j=0;j<n;j++){
            sum+=pow((a[j]-i),2);
        }
        if(sum<min)
        min=sum;
    }
    cout<<min;
    
    return 0;
}


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

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

class Cube{
private:
  string tmp;
public:
  string d[6];
 
  void rollN(){
    tmp = d[0];
    d[0] = d[1];
    d[1] = d[5];
    d[5] = d[4];
    d[4] = tmp;
  }
 
  void rollW(){
    tmp = d[0];
    d[0] = d[2];
    d[2] = d[5];
    d[5] = d[3];
    d[3] = tmp;
  }

  void rotation(){
    tmp = d[1];
    d[1] = d[3];
    d[3] = d[4];
    d[4] = d[2];
    d[2] = tmp;
  }

  bool judge(Cube &C){
    rep(i,6){
      if(d[i] != C.d[i]){
        return false;
      }
    }
    return true;
  }

  bool equals(Cube &C){
    rep(i,3){
      rollN();
      if(d[0] == C.d[0]){
        break;
      }
      rollW();
      if(d[0] == C.d[0]){
        break;
      }
    }
    rep(i,4){
      if(judge(C)){
        return true;
      }
      rotation();
    }
    return false;
  }
};
 
int main(){
  int N;

  while(cin >> N, N){
    Cube cube[N];
    rep(i,N){
      rep(j,6){
        cin >> cube[i].d[j];
      }
    }   

    int ans = 0;
    bool used[N];
    memset(used, false, sizeof(used));
    rep(i,N-1){
      for(int j = i+1 ; j < N ; j++){
        if(cube[i].equals(cube[j]) && !used[j]){
          used[j] = true;
          ans++;
        }
      }
    }
    cout << ans << endl;
  }

  return 0;
}

Measured memory_bytes: 1232
#include <stdio.h>
#include <stdlib.h>
typedef long long ll;

int cmp(const ll *x, const ll *y);
_Bool is_valid(ll p);

ll n;
ll scale[100005];

int main()
{

    scanf("%lld", &n);
    for (ll i = 0; i < n; i++) {
        scanf("%lld", scale + i);
    }

    qsort(scale, n, sizeof(ll), (int (*)(const void *, const void *))cmp);

    ll valid = n - 1;
    ll invalid = -1;

    while (valid - invalid > 1) {
        ll mid = (valid + invalid) / 2;

        if (is_valid(mid)) {
            valid = mid;
        }
        else {
            invalid = mid;
        }
    }

    printf("%lld\n", n - valid);
}

int cmp(const ll *x, const ll *y)
{
    if (*x > *y) return 1;
    if (*x == *y) return 0;
    else return -1;
}

_Bool is_valid(ll p)
{
    ll s = scale[p];

    for (int i = 0; i < n; i++) {
        if (i == p) continue;

        if (scale[i] <= s * 2) {
            s += scale[i];
        }
        else {
            return 0;
        }
    }

    return 1;
}


Measured memory_bytes: 1788
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<map>
#include<queue>
#include<deque>
#include<iomanip>
#include<tuple>
using namespace std;
typedef long long int LL;
typedef pair<int,int> P;
typedef pair<LL,int> LP;
const int INF=1<<30;
const LL MAX=1e9+7;

void array_show(int *array,int array_n,char middle=' '){
	for(int i=0;i<array_n;i++)printf("%d%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(LL *array,int array_n,char middle=' '){
	for(int i=0;i<array_n;i++)printf("%lld%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(vector<int> &vec_s,int vec_n=-1,char middle=' '){
	if(vec_n==-1)vec_n=vec_s.size();
	for(int i=0;i<vec_n;i++)printf("%d%c",vec_s[i],(i!=vec_n-1?middle:'\n'));
}
void array_show(vector<LL> &vec_s,int vec_n=-1,char middle=' '){
	if(vec_n==-1)vec_n=vec_s.size();
	for(int i=0;i<vec_n;i++)printf("%lld%c",vec_s[i],(i!=vec_n-1?middle:'\n'));
}

vector<P> v1;
vector<int> v2;
priority_queue<int,vector<int>,greater<int> > q1;

int main(){
	int n,m;
	int i,j,k;
	int a,b,c;
	int p,q;
	int s=0;
	cin>>n>>m;
	for(i=0;i<n;i++){
		cin>>a>>b;
		v1.push_back(make_pair(a,b));
	}
	sort(v1.begin(),v1.end());
	p=0;
	for(auto node:v1){
		a=node.first;
		q1.push(node.second);
		if(p>=a){
			v2.push_back(q1.top()),q1.pop();
		}else{
			p++;
		}
	}
	sort(v2.rbegin(),v2.rend());
	p=m;
	for(auto node:v2){
		if(node>p)s++;
		else p--;
	}
	s=max(n-m,s);
	cout<<s<<endl;
}

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



using namespace std;

typedef vector<int> VI;
typedef vector<string> VS;


//container util
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)



int main(void){

	int X; cin >> X;

	int i;
	for(i=1;;i++){
		int sum = (i*(i+1))/2;
		if(sum >= X) break;
	}


	cout << i << endl;


	return 0;

}


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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF 1e16
#define mod 1000000007

int lcm(int a,int b){
  return (a/__gcd(a,b))*b;
}

int N;
int A[25][25];
int ps[]={13,17,19,23};

int main(){
  while(1){
    scanf("%d",&N);
    if(N==0)break;
    memset(A,0,sizeof(A));
    int sz=1;
    rep(i,N){
      int D,T;
      scanf("%d%d",&D,&T);
      bool ok=true;
      rep(j,4)if(ps[j]==D)ok=false;
      if(ok)sz=lcm(sz,D);
      rep(j,D){
        int B;
        scanf("%d",&B);
        A[D][(j-T+D)%D]+=B;
      }
    }
    vector<int> sum(sz,0);
    int res=0;
    rep(i,4)res+=*max_element(A[ps[i]],A[ps[i]]+25);
    repl(i,1,25){
      bool ok=true;
      rep(j,4)if(ps[j]==i)ok=false;
      if(!ok)continue;
      rep(j,sz)sum[j]+=A[i][j%i];
    }
    res+=*max_element(all(sum));
    printf("%d\n",res);
  }
  return 0;
}



Measured memory_bytes: 3352
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 172_D
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		Long H = sc.nextLong();
		Long[] A = new Long[N];
		Long[] B = new Long[N];

		int i = 0;

		for (i=0; i<N; i++) {
			A[i] = sc.nextLong();
			B[i] = sc.nextLong();
		}
		// Scannerクラスのインスタンスをクローズ
		sc.close();

		// Aを降順ソート
		Arrays.sort(A, Collections.reverseOrder());
		// Bを降順ソート
		Arrays.sort(B, Collections.reverseOrder());

		int attack = 0;

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

			if(B[i]<=A[0]) {
				break;
			}

			attack++;
			H -= B[i];
			if(H <= 0) {
				break;
			}
		}

		if(H > 0) {
			attack += H/A[0];
			if(H%A[0] != 0) {
				attack++;
			}
		}

		System.out.println(attack);

	}

}


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

int main(){
    ll ans = 0;
    int n; cin >> n;
    vector<int> a(n*3); rep(i,n*3) cin >> a.at(i);

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

    for(int i = n*3-2; i >= n; i-=2){
        ans += a.at(i);
    }

    cout << ans << endl;
}

Measured memory_bytes: 1408
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#define REP(i, n) for (int i = 0; i < (n); i++)

using namespace std;

const int MOD = 1000000007;

struct mint {
  int n;
  mint(int n_ = 0) : n(n_) {}
};

mint operator+(mint a, mint b) { a.n += b.n; if (a.n >= MOD) a.n -= MOD; return a; }
mint operator-(mint a, mint b) { a.n -= b.n; if (a.n < 0) a.n += MOD; return a; }
mint operator*(mint a, mint b) { return a.n == 0 || b.n == 0 ? 0 : (long long)a.n * b.n % MOD; }
mint &operator+=(mint &a, mint b) { return a = a + b; }
mint &operator-=(mint &a, mint b) { return a = a - b; }
mint &operator*=(mint &a, mint b) { return a = a * b; }
ostream &operator<<(ostream &o, mint a) { return o << a.n; }

mint modinv(mint n) {
  int a = n.n;
  int b = MOD;
  int s = 1;
  int t = 0;
  while (b != 0) {
    int q = a / b;
    a -= q * b;
    s -= q * t;
    swap(a, b);
    swap(s, t);
  }
  if (s < 0) s += MOD;
  return s;
}
mint operator/(mint a, mint b) { return a * modinv(b); }

mint f(mint n) {
  return n * (n + 1) / 2;
}

vector<mint> F_{1, 1}, R_{1, 1}, I_{0, 1};

void check_fact(int n) {
  for (int i = I_.size(); i <= n; i++) {
    I_.push_back(I_[MOD % i] * (MOD - MOD / i));
    F_.push_back(F_[i - 1] * i);
    R_.push_back(R_[i - 1] * I_[i]);
  }
}

mint I(int n) { check_fact(n); return I_[n]; }
mint F(int n) { check_fact(n); return n < 0 ? 0 : F_[n]; }
mint R(int n) { check_fact(n); return n < 0 ? 0 : R_[n]; }
mint C(int n, int r) { return F(n) * R(n - r) * R(r); }
mint P(int n, int r) { return F(n) * R(n - r); }
mint H(int n, int r) { return n == 0 ? (r == 0) : C(n + r - 1, r); }

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  long long H, W, K;
  cin >> H >> W >> K;
  mint p = 0;
  mint q = 0;
  for (int i = 0; i < H; i++) {
    p += f(i) * W * W;
  }
  for (int i = 0; i < W; i++) {
    q += f(i) * H * H;
  }
  mint ans;
  ans += C(H*W-2,K-2)*p;
  ans += C(H*W-2,K-2)*q;
  cout << ans.n << '\n';
}


Measured memory_bytes: 2912
#![allow(non_snake_case, unused)]
use std::cmp::*;
use std::collections::*;
use std::f64::consts::*;

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        mut pqr: [usize; 3],
    }
    pqr.sort();
    println!("{}", pqr[0] + pqr[1]);
}


Measured memory_bytes: 4352
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

public class Main {
    static final int MAX = 100100;
    InputStream in = System.in;
    PrintStream out = System.out;
    // static int dp[][] = new int[MAX][MAX];

    public void _main(String[] args) {
        Scanner sc = new Scanner(in);
        int L = sc.nextInt();
        int R = sc.nextInt();
        int M = Math.min(R,L+6000);
        long res = 1001000;
        for (long i=L;i<=M;i++) {
            for (long j=i+1;j<=M;j++) {
                res = Math.min(res, (i*j)%2019);
            }
        }
        out.println(res);
    }

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


Measured memory_bytes: 23764
#include<iostream>
#include<map>
#include<set>
#include<list>
#include<queue>
#include<cmath>
#include<string>
#include<string.h>
#include<iomanip>
#include<stdlib.h>
#include<algorithm>
typedef long long ll;
using namespace std;

int main()
{
	string s;
	char ch;
	int flag = 1;
	cin >> s;
	for(int i = 0;i < s.length() ;i++)
	{
		ch = s[i];
		for(int j = i+1;j < s.length() ;j++)
		{
			if(ch == s[j])
			{
				flag = 0;
				break;
			}
		}
	}
	if(flag == 0)
		cout << "no" << endl;
	else
		cout << "yes" << endl;
	return 0;
} 

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<n; ++i)
#define rep1(i, n) for (int i=1; i<=n; ++i)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
using namespace std;
typedef long long ll;
constexpr ll  MOD = (1e9+7);
constexpr int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
constexpr int lcm(int a, int b) { return a / gcd(a, b) * b; }

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;
}
ll factorial(ll n, ll m=2) {
    // calculate n!
    m = max(2LL, m);
    ll rtn = 1;
    for (ll i=m; i<=n; i++) {
        rtn = (rtn * i) % MOD;
    }
    return rtn;
}
ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b;
        swap(a, b);
        u -= t * v;
        swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
ll modpow(ll a, ll n) {
    ll res = 1;
    while (n > 0) {
        if (n & 1)
            res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    int x; cin >> x;
    if (x < 1200) puts("ABC");
    else puts("ARC");
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
#include <vector>

using namespace std;
using duo = pair<int,int>;

int Size[100100];
duo Par[100100];
int N,M;

bool Connect(int L,int R,int D);

int main() {
    scanf("%d %d",&N,&M);
    
    int i;

    for(i = 1;i <= N;i++){
        Size[i] = 1;
        Par[i] = duo(i,0);
    }

    for(i = 1;i <= M;i++){
        int l,r,d;
        scanf("%d %d %d",&l,&r,&d);
        if(Connect(l,r,d) == false) {
            puts("No");
            return 0;
        }
    }
    
    puts("Yes");
    
    return 0;
}
bool Connect(int L,int R,int D) {
    int S1 = 0;
    int p1 = L;
    vector<int> L1;
    L1.push_back(L);

    while(p1 != Par[p1].first) {
        S1 += Par[p1].second;
        p1 = Par[p1].first;
        L1.push_back(p1);
    }

    int S = S1;
    for(auto l : L1) {
        Par[l].first = p1;
        int delta = Par[l].second;
        Par[l].second = S;

        S -= delta;
    }

    int S2 = 0;
    int p2 = R;
    vector<int> L2;
    L2.push_back(R);

    while(p2 != Par[p2].first) {
        S2 += Par[p2].second;
        p2 = Par[p2].first;
        L2.push_back(p2);
    }
    S = S2;
    for(auto l : L2) {
        Par[l].first = p2;
        int delta = Par[l].second;
        Par[l].second = S;

        S -= delta;
    }

    if(p1 == p2) {
        return D == S2 - S1;
    } else {
        if(Size[p1] > Size[p2]) {
            Par[p2].first = p1;
            Par[p2].second = D + S1 - S2;
            
            Size[p1] += Size[p2];
        } else {
            Par[p1].first = p2;
            Par[p1].second = S2 - D - S1;

            Size[p2] += Size[p1];
        }

        return true;
    }
}

Measured memory_bytes: 1408
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <vector>
#include <string>
#include <math.h>
#include <algorithm>
#include <map>
#include <set>

#define sz(x) ((int)x.size())
#define all(x) (x).begin(), (x).end()
#define pb(x) push_back(x)
#define mp(x, y) make_pair(x, y)

typedef long long int64;

using namespace std;

int main() {
	ios_base::sync_with_stdio(0);
    int a;
	int b;
	cin >> a >> b;
	if (a > 9 || b > 9) {
	    cout << -1 << endl;
		return 0;
	}
	cout << a * b << endl;
    return 0;
}


Measured memory_bytes: 256
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function(input){
    var line = input.trim().split("\n");
    var i = 0;
    for(i=0;i<line.length;)
    {
        var N = parseInt(line[i++].trim());
        if( N === 0 ){
            break;
        }
        else{
            var found, len, k, res, uid;
            var qualified = [], amount = [];
            for(var j=0;j<N;++j){
                var dataset = line[i++].trim().split(" ");
                res = parseInt(dataset[1]) * parseInt(dataset[2]);
                len = qualified.length;
                
                found = 0;
                len = qualified.length;
                uid = parseInt(dataset[0]);
                for(k=0;k<len;++k){
                    if(qualified[k] === uid){
                        found = 1;
                        amount[k] = amount[k] + res;
                        break;
                    }
                }
                
                if( found === 0 ){
                    qualified.push(uid);
                    amount.push(res);
                }
            }
            
            found = 0;
            len = qualified.length;
            for(k=0;k<len;++k){
                if( amount[k] >= 1000000 ){
                    console.log(qualified[k]);
                    found = 1;
                }
            }
            if( found === 0 ){
                console.log("NA");
            }
        }
    }
});

Measured memory_bytes: 18092
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  string num = "Three";
  cin >> N;
 
  for (int i = 0; i < N; i++) {
    string S;
    cin >> S;
    if(S == "Y") 
      num = "Four";
  }
     
  cout << num << endl;
}

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

using namespace std;

template <class T>
T Vec(T v) { return v; }

template <class T, class... Ts>
auto Vec(size_t l, Ts... ts) {
    return vector<decltype(Vec<T>(ts...))>(l, Vec<T>(ts...));
}

int main() {
    int N;
    cin >> N;
    auto mat = Vec<int>(N, N, 0);
    for (int i = 0; i < N; ++i) {
        int v, k;
        cin >> v >> k;
        --v;
        for (int j = 0; j < k; ++j) {
            int sv;
            cin >> sv;
            mat[v][--sv] = 1;
        }
    }

    for (const auto& v : mat) {
        for (int i = 0; i < v.size(); ++i) {
            cout << v[i] << " \n"[i == v.size() - 1];
        }
    }
    return 0;
}



Measured memory_bytes: 3136