akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i,n,m) for(int i=(n);i<(m);i++)
#define REP(i,n) for(int i=0;i<(n);i++)
#define REPR(i,n) for(int i=(n);i>=0;i--)
#define all(vec) vec.begin(),vec.end()
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using P=pair<ll,ll>;
using PP=pair<ll,P>;
using vp=vector<P>;
using vpp=vector<PP>;
using vs=vector<string>;
#define fi first
#define se second
#define pb push_back
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}
template<typename A,typename B>istream&operator>>(istream&is,pair<A,B> &p){is>>p.fi>>p.se;return is;}
template<typename A,typename B>ostream&operator<<(ostream&os,const pair<A,B> &p){os<<"("<<p.fi<<","<<p.se<<")";return os;}
template<typename T>istream&operator>>(istream&is,vector<T> &t){REP(i,t.size())is>>t[i];return is;}
template<typename T>ostream&operator<<(ostream&os,const vector<T>&t){os<<"{";REP(i,t.size()){if(i)os<<",";os<<t[i];}cout<<"}";return os;}
const ll MOD=1000000007LL;
const int INF=1<<30;
const ll LINF=1LL<<60;
int pct(int x){
    return __builtin_popcount(x);
}
int mbit(int x){
    int res=0;
    while(!(x&1)){
        res++;
        x>>=1;
    }
    return res;
}
int nbit(int x){
    int res=0;
    while(x&1){
        res++;
        x>>=1;
    }
    return res;
}
vi solve(int a,int b,int c,int d){
    if(a==1){
        return vi{b,c};
    }
    int k=1<<mbit((b^c)&(~d));
    d|=k;
    int x=1<<nbit(d);
    vi p(solve(a-1,b,b^x,d));
    vi q(solve(a-1,b^x^k,c,d));
    p.insert(p.end(),all(q));
    return p;
}
int main(){
    int a,b,c;
    cin>>a>>b>>c;
    if(abs(pct(b^c))%2==0){
        cout<<"NO"<<endl;
        return 0;
    }
    auto ans(solve(a,b,c,0));
    cout<<"YES"<<endl;
    REP(i,ans.size()){
        if(i)cout<<" ";cout<<ans[i];
    }cout<<endl;
    return 0;
}

Measured memory_bytes: 1648
//#include <bits/stdc++.h>
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
//#include "boost/multiprecision/cpp_int.hpp"
//typedef boost::multiprecision::cpp_int LL;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
typedef pair<dd,dd> d_d;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fi first
#define se second
#define endl "\n"
#define SORT(v) sort(v.begin(),v.end())
#define ERASE(v) v.erase(unique(v.begin(),v.end()),v.end())
#define POSL(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define POSU(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
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 main(){fastio
    
    ll n,m;cin>>n>>m;
    ll h[n+1];rep(i,1,n)cin>>h[i];
    vector<ll>v[n+1];
    rep(i,1,m){
        ll a,b;cin>>a>>b;
        v[a].pb(b);
        v[b].pb(a);
    }
    ll ans=0;
    rep(i,1,n){
        bool f=true;
        for(auto x:v[i]){
            if(h[i]<=h[x])f=false;
        }
        if(f)ans++;
    }
    cout<<ans<<endl;
    
    return 0;
}



Measured memory_bytes: 10240
#include<cstdio>
#include<queue>
#include<algorithm>
using namespace std;
#define int long long
const int mod=1000000007;
const int inv2=(mod+1)/2;
int head[400100],n,x,ans,cnt;
struct node{
	int x,y,z;
};
deque<node>f[400100];
int quickpow(int x,int y){
	if(y==0)return 1;
	if(y%2==0)return quickpow(x*x%mod,y/2);
	return quickpow(x*x%mod,y/2)*x%mod;
}
struct Edge{
	int to,nxt;
}edge[400100];
void addedge(int x,int y){
	edge[++cnt].to=y;
	edge[cnt].nxt=head[x];
	head[x]=cnt;
}
void dfs(int x){
	int maxf=0,maxs=0;
	for(int i=head[x];i;i=edge[i].nxt){
		int upup=edge[i].to;
		dfs(upup);
		if(f[upup].size()>maxf) maxs=maxf,maxf=f[upup].size();
			else maxs=max(maxs,(int)f[upup].size());
		if(f[upup].size()>f[x].size())swap(f[x],f[upup]);
		for(int j=0;j<f[upup].size();j++){
			node cur;
			cur.x=(f[x][j].x*f[upup][j].y+f[upup][j].x*f[x][j].y)%mod;
			cur.y=f[x][j].y*f[upup][j].y%mod;
			cur.z=(f[x][j].x*f[upup][j].x%mod+f[x][j].x*f[upup][j].z%mod+f[x][j].y*f[upup][j].z%mod+f[x][j].z*f[upup][j].x%mod+f[x][j].z*f[upup][j].y%mod+f[x][j].z*f[upup][j].z%mod)%mod;
			f[x][j]=cur;
		}
	}
	for(int i=0;i<maxs;i++){
		f[x][i].y=(f[x][i].y+f[x][i].z)%mod;
		f[x][i].z=0;
	}
	f[x].push_front((node){inv2,inv2,0});
}
signed main(){
	scanf("%lld",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&x);
		addedge(x,i);
	}
	dfs(0);
	for(int i=0;i<f[0].size();i++)
		ans=(ans+f[0][i].x)%mod;
	ans=ans*quickpow(2,n+1)%mod;
	printf("%lld\n",ans);
}

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

int main() {
  int m1, d1, m2, d2;
  cin >> m1 >> d1 >> m2 >> d2;

  bool e = false;
  if (m1 + 1 == m2 && d2 == 1)
    e = true;

  if (e)
    puts("1");
  else
    puts("0");
}

Measured memory_bytes: 256
use std::io::Read;

const MOD : u64 = 1_000_000_007;

fn main(){
  let mut buf = String::new();
  std::io::stdin().read_to_string(&mut buf).unwrap();
  let mut iter = buf.split_whitespace().map(|s| s.parse().unwrap());
  
  let _n : u64 = iter.next().unwrap();
  let A : Vec<_> = iter.collect();
  
  let ans = {
    let mut dp = [0_u64;3];
    A.iter().try_fold(1u64, move |ans, &a|{
      let c = dp.iter().filter(|&s| *s == a).count();
      if c == 0 {
        return None;
      }
  
      let i = dp.iter().position(|s| *s == a).unwrap();
      dp[i] += 1;
  
      Some(ans * (c as u64) % MOD)
    })
  };
  
  println!("{}", ans.unwrap_or(0));
}

Measured memory_bytes: 3460
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp> //required
//#include <ext/pb_ds/tree_policy.hpp> 
#define ll long long
#define lb long double
#define pb push_back
#define loop(i,start,n) for(ll i=start;i<n;i++)
#define rloop(i,n,start)for(ll i=n;i>=start;i--)
#define mod  998244353
#define endl "\n"
#define INF     1e15
#define NEG_INF -1e15
#define pll pair<ll,ll>
#define x first
#define y second
#define all(x) x.begin(),x.end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
 
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
//#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
//using namespace __gnu_pbds;
ll power(ll x, ll y) { 
    ll temp, f; 
    if( y == 0) 
        return 1; 
    temp = power(x, y/2)%mod; 
    if (y%2 == 0) 
        return (temp * temp) % mod; 
    else{   
        f = (x * temp) % mod;
        f = (f * temp) % mod;
        return f; 
    }
}  
ll gcdExtended(ll a, ll b, ll *x, ll *y) { 
    // Base Case 
    if (a == 0) { 
        *x = 0, *y = 1; 
        return b; 
    } 
  
    ll x1, y1; // To store results of recursive call 
    ll gcd = gcdExtended(b%a, a, &x1, &y1); 
  
    // Update x and y using results of recursive 
    // call 
    *x = y1 - (b/a) * x1; 
    *y = x1; 
    return gcd; 
} 
ll fact[200010];
ll modInverse(ll a, ll m) { 
    ll x, y; 
    ll g = gcdExtended(a, m, &x, &y); 
    if (g != 1) 
        assert(0);
    else{ 
         
        ll res = (x%m + m) % m; 
        return res; 
    } 
}
ll nCr(ll x,ll y){
	ll temp = fact[x];
	temp = (temp * modInverse(fact[y], mod)) % mod;
	temp = (temp * modInverse(fact[x -y], mod)) % mod;
	return temp;
}
int main(){
	IOS;
	fact[0] = 1;
	loop(i, 1, 200010)
		fact[i] = (fact[i - 1] * i) % mod;
	ll n, m, k;
	cin >> n >> m >> k;
	ll ans = 0;
	loop(i, 0, k + 1){
		ll term = (m * power(m - 1, n - 1 - i))%mod; 
		debug(term);
		ans = (ans + (nCr(n-1, i) * term ) % mod ) %mod;
	}

	cout << ans << endl;
}

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

using ll = long long;
constexpr ll inf = static_cast<ll>(1e17);
constexpr ll mod = static_cast<ll>(1e9 + 7);

ll x, y;
int main() {
	std::cin >> x >> y;

	if (std::abs(x - y) <= 1)
		std::cout << "Brown" << std::endl;
	else
		std::cout << "Alice" << std::endl;

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <map>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
ll ret[10];
int main( void )
{
  ios::sync_with_stdio(false);
  int H, W, N, a, b;
  map<P,int> m;
  cin >> H >> W >> N;
  for( int i=0; i<N; i++ ){
    cin >> a >> b;
    for( int j=0; j<3; j++ ){
      if( a - j > 0 && a - j <= H - 2 ){
        for( int k=0; k<3; k++ ){
          if( b - k > 0 && b - k <= W - 2 ){
            m[P(a-j,b-k)]++;
          }
        }
      }
    }
  }
  for( map<P,int>::iterator it=m.begin(); it!=m.end(); ++it ){
    //cout << it->first.first << ' ' << it->first.second << ' ' << it->second << endl;
    ret[it->second]++;
  }
  ret[0] = ((ll)H-2)*(W-2);
  for( int i=1; i<10; i++ ) ret[0] -= ret[i];
  for( int i=0; i<10; i++ ) cout << ret[i] << endl;
}

Measured memory_bytes: 56576
#include <iostream>
using namespace std;
int main(){
    int n; cin >> n;
    int sum = 0,ans = 0;
    for (int i=0; 4*i<=n; i++){
        sum = 0;
        for (int j=0; sum<=n; j++){
            sum = 0;
            sum += (4*i + 7*j);
            if (sum==n) ans=1;
        }
    }
    cout << (ans ? "Yes" : "No") << endl;
}

Measured memory_bytes: 256
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <complex>
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
#if defined(_MSC_VER) || __cplusplus > 199711L
#define aut(r,v) auto r = (v)
#else
#define aut(r,v) __typeof(v) r = (v)
#endif
#define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it)
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset(m,v,sizeof(m))
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL-1
double EPS=1e-9;
using namespace std;
typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
typedef complex<double> P;
template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }
long long int MOD=1000000007;
ll n,s;
bool check(ll b){
	ll sum=0;
	ll hoge=n;
	while(hoge>0){
		sum=sum+(hoge%b);
		hoge/=b;
	}
	//cout<<sum<<endl
	if(sum==s)return true;
	else return false;
}
int main(){
	cin>>n>>s;
	ll m=sqrt(n)+1;
	if(n<s){
		cout<<"-1"<<endl;
	}else if(n==s){
		cout<<n+1<<endl;
	}else{
		
		for(ll i=2;i<=m;i++){
			if(check(i)){
				cout<<i<<endl;
				return 0;
			}
		}
		for(ll k=min(m,s);k>0;k--){
			if((n+k-s)%k==0){
				if( check((n+k-s)/k) ){
					cout<<(n+k-s)/k<<endl;
					return 0;
				}
			}
		}
		cout<<"-1"<<endl;
	}
}


Measured memory_bytes: 256
// #define _GLIBCXX_DEBUG
// #pragma GCC optimize ("trapv") // kills the program on integer overﬂows (but is really slow).
#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;

#define ll long long
#define ull unsigned long long
#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define ff first
#define ss second
#define vt vector
#define vll vt<ll>
#define pll pair<ll,ll>
#define vpll vt<pll>
#define vvll vt<vll>
#define all(v) v.begin(),v.end()
#define FOR(i,n) for(ll i=0;i<n;i++)
#define ffo(i,a,b) for(ll i=a;i<=b;i++)
#define rfo(i,a,b) for(ll i=a;i>=b;i--)
#define space cout<<"\n\n";
#define endl "\n"
#define pqmx priority_queue<ll>
#define pqmn priority_queue<ll,vll,greater<ll>>
#define fps(x,y) fixed<<setprecision(y)<<x
#define merg(a,b,c) set_union(a.begin(),a.end(),b.begin(),b.end(),inserter(c,c.begin()))
#define set_ar(arr,v) memset(arr,v,sizeof(arr))
#define go_t int testcases; cin>>testcases; ffo(caseno,1,testcases)

#define ctime auto start = high_resolution_clock::now()
#define etime auto stop = high_resolution_clock::now()
#define ptime auto z1z = duration_cast<microseconds>(stop-start); cout<<"Time elapsed : "<<z1z.count()<<" microseconds\n"

#define dbg1(x)             cout <<#x<<": "<<x<<'\n';
#define dbg2(x, y)          cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<'\n';
#define dbg3(x, y, z)       cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<'\n';
#define dbg4(a, b, c, d)    cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<'\n';
#define dbg5(a, b, c, d, e) cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<<": "<<e<<'\n';

const ll mod = 1e9 + 7;
const ll N = 3e3 + 6;
const ll maxN = 1e4 + 5;
const ll MAX_SIZE = 2e6 + 6;
const ll INF = 0x3f3f3f3f3f3f3f3fll;
const double PI = 3.14159265359;

ll powerM(ll x, ll y, ll M = mod) { // default argument
	ll v = 1; x = x % M; while (y > 0) {if (y & 1)v = (v * x) % M; y = y >> 1; x = (x * x) % M;} return v;
}

ll power(ll x, ll y) {
	ll v = 1; while (y > 0) {if (y & 1)v = v * x; y = y >> 1; x = x * x;} return v;
}

int main()
{
#ifndef ONLINE_JUDGE
	freopen("in4.txt", "r", stdin);
	freopen("out3.txt", "w", stdout);
#endif
	FIO
	string s;
	cin >> s;
	ll ans = 0;
	for (int i = 0; i < s.length(); ++i) {
		ll v = 0;
		ll flg = 0;
		while (s[i] == 'R' && i < s.length()) {
			i++;
			v++;
			flg = 1;
		}
		if (flg == 1) {
			ans = max(ans, v);
		}
	}
	cout << ans;
	return 0;
}


Measured memory_bytes: 3612
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <utility>
#include <algorithm>
#include <cstdio>
#include <iomanip>
#include <queue>
#include <deque>
#include <stack>
#include <fstream>
#include <cmath>
#include <random>
#include <complex>
#include <functional>
#include <bitset>
#include <sstream>
#include <cassert>
#include <time.h>

#define ll int64_t
#define Rep(i, n) for (ll i = 0; i < n; i++)
using namespace std;
typedef vector<ll> vec;
typedef vector<vec> mat;

const ll inf = 1LL << 60;

template<class T> inline void chmin(T& a, T b) {
    if (a > b) {
        a = b;
    }
}
template<class T> inline void chmax(T& a, T b) {
    if (a < b) {
        a = b;
    }
}
void printvec (vec &v) {
    Rep (i, (ll)v.size()) {
        cout << v[i] << " \n"[i+1 == (ll)v.size()];
    }
}

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

    ll H, W, Ch, Cw, Dh, Dw, C, D;
    cin >> H >> W >> Ch >> Cw >> Dh >> Dw;
    Ch--; Cw--; Dh--; Dw--;
    C = Ch * W + Cw;
    D = Dh * W + Dw;
    string S;
    Rep (i, H) {
        string sin;
        cin >> sin;
        S += sin;
    }

    deque<ll> dq;
    vec dist(H*W, inf);
    dist[C] = 0;
    dq.push_back(C);

    vec da = {-W, -1, 1, W};
    vec db;
    for (ll i = 2*W-2; i <= 2*W+2; i++) {
        db.push_back(i);
        db.push_back(-i);
    }
    for (ll i = W-2; i <= W+2; i++) {
        db.push_back(i);
        db.push_back(-i);
    }
    for (ll i = -2; i <= 2; i++) {
        db.push_back(i);
    }
    sort(db.begin(), db.end());

    while (dq.size()) {
        ll v = dq.front();
        dq.pop_front();
        ll h = v / W, c = v % W;
        for (ll dv : da) {
            ll nv = v + dv;
            ll nh = nv / W, nc = nv % W;
            if (abs(nh-h) + abs(nc-c) > 1) continue;
            if (nv < 0 or H*W <= nv) continue;
            if (S[nv] == '#') continue;
            if (dist[nv] > dist[v]) {
                dist[nv] = dist[v];
                dq.push_front(nv);
            }
        }

        for (ll dv : db) {
            ll nv = v + dv;
            if (nv < 0 or H*W <= nv) continue;
            ll nh = nv / W, nc = nv % W;
            if (abs(nh-h) > 2 or abs(nc-c) > 2) continue;
            if (S[nv] == '#') continue;
            if (dist[nv] > dist[v] + 1) {
                dist[nv] = dist[v] + 1;
                dq.push_back(nv);
            }
        }
    }

    // Rep (i, H*W) {
    //     cout << dist[i] << " \n"[(i+1)%W == 0];
    // }

    if (dist[D] == inf) dist[D] = -1;
    cout << dist[D] << endl;

}

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

using namespace std;

int h,w;
char grid[21][21];
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};

int dfs(int x,int y){
  if(grid[y][x]=='#')return 0;
  grid[y][x]='#';
  int sum=1;
  for(int i=0;i<4;i++){
    int nx=x+dx[i],ny=y+dy[i];
    if(0<=nx && nx<w && 0<=ny && ny<h)sum+=dfs(nx,ny);
  }
  return sum;
}

int main(void){

  while(cin >> w >> h,w|h){
    for(int i=0;i<h;i++)cin >> grid[i];
    
    for(int y=0;y<h;y++)
      for(int x=0;x<w;x++)
	if(grid[y][x]=='@')cout << dfs(x,y) << endl;
  }

  return 0;
}

Measured memory_bytes: 1176
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		ArrayList<Integer> listA = new ArrayList<>();
		ArrayList<Integer> listB = new ArrayList<>();
		ArrayList<Integer> listC = new ArrayList<>();
		ArrayList<Integer> listD = new ArrayList<>();

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();
		for (int i = 0; i < n; i++) {
			listA.add(scan.nextInt());
			listB.add(scan.nextInt());
		}
		for (int i = 0; i < m; i++) {
			listC.add(scan.nextInt());
			listD.add(scan.nextInt());
		}
		for (int i = 0; i < n; i++) {
			int min = Integer.MAX_VALUE;
			int ans = 0;
			int a = listA.get(i);
			int b = listB.get(i);
			for (int j = 0; j < m; j++) {
				int temp = Math.abs(a - listC.get(j)) + Math.abs(b - listD.get(j));
				if (temp < min) {
					min = temp;
					ans = j + 1;
				}
			}
			System.out.println(ans);
		}
	}
}

Measured memory_bytes: 21844
// at coder beginner
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#define  boost ios_base::sync_with_stdio(false);cin.tie(NULL);
#define ull unsigned long long
#define deb(x) cout<<#x<<" "<<x<<endl;
#define deb2(x,y) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<endl;
#define deb2l(x,y,i) cout<<#x<<i<<" "<<x<<" "<<#y<<i<<" "<<y<<endl;

#define fr(i,l,r) for(ll i=l;i<r;i++)
#define mems(a,x) memset(a,x,sizeof(a))
#define mod 1000000007
#define ff first
#define ss second
#define pb(x) push_back(x)
#define vll vector<ll>
#define pbp(x,y) push_back(make_pair(x,y))
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const ll  maxx=1e10+5;
void solve(){
    string str1,str2;
    ll n;cin>>n;
    cin>>str1>>str2;
    string str3;
    ll i=0;
    while(i<str1.size()){
        str3.pb(str1[i]);
        str3.pb(str2[i]);
        i++;
    }
    cout<<str3<<endl;
    
}
int main(){
    ll t=1;
//cin>>t;
ll k=1;
    while(k<=t){

     solve();
     k++;
    }
    return 0;
}


Measured memory_bytes: 256
// aribon2-3-2_a
#include <bits/stdc++.h>
#ifdef LOCAL
#include "../cxx-prettyprint/prettyprint.hpp"
#endif
using namespace std;

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

#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define REP_REV(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (int (i) = (int)(n) - 1 ; (i) >= m ; --(i))
#define ALL(x) x.begin(), x.end()

#define INF ((1 << 29)-1)
#define MOD (1000000007)

#define print2D(h, w, arr) REP(i, h) { REP(j, w) cout << arr[i][j] << " "; cout << endl; }
template<class T> void print(const T& x){cout << x << endl;}
template<class T, class... A> void print(const T& first, const A&... rest) { cout << first << " "; print(rest...); }
struct PreMain {PreMain(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(20);}} premain;

int main() {
#ifdef LOCAL
    ifstream in("../arg.txt");
    cin.rdbuf(in.rdbuf());
#endif

    int N;
    cin >> N;
    string A,B;
    REP(n, N){
        cin >> A >> B;
        int dp[A.size()+1][B.size()+1] = {};

        REP(i, A.size()){
            REP(j, B.size()){
                if (A[i] == B[j]){
                    dp[i+1][j+1] = dp[i][j]+1;
                } else {
                    dp[i+1][j+1] = max(dp[i+1][j], dp[i][j+1]);
                }

            }
        }
        print(dp[A.size()][B.size()]);
    }

    return 0;
}



Measured memory_bytes: 7100
#include<iostream>
#define D(x) cout<<"D:"<<#x<<'='<<x<<endl;
using namespace std;
typedef long long ll;
int main(void)
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll a, b, c;
	cin>>a>>b>>c;
	if (((a == b) + (a == c) + (b == c)) == 1) puts("Yes");
	else puts("No");
	return 0;
}
























































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

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n;
  cin >> n;
  vector<ll> vec(3 * n);
  for (ll i = 0; i < 3 * n; ++i) {
    cin >> vec[i];
  }
//  sort(vec, vec+3*n);
  sort(vec.begin(), vec.end(), greater<int>());
  ll ans = 0;
  for (ll i = 1; i < 2 * n; i+=2) {
    ans += vec[i];
  }
//  debug(ans);
  cout << ans << '\n';
}


Measured memory_bytes: 2560
str_N = input().split()
N = int(str_N[0])
K = int(str_N[1])
str_p = input().split()
p = [float(str_p[i]) for i in range(N)]

ans = 0
e_sum = 0

for j in range(K):
  e_sum = e_sum + (p[j]+1)/2

ans = e_sum
for i in range(K,N):
  e_sum = e_sum + (p[i]+1)/2
  e_sum = e_sum - (p[i-K]+1)/2
  if ans<e_sum:
    ans=e_sum

print(ans)


Measured memory_bytes: 23524
#include<iostream>
#include<queue>
#include<vector>
#include<cstdio>

using namespace std;

struct P{int c,r;};
struct State{
  int t;
  short pos, remain;
  bool operator < (const State& st) const {
    return t > st.t;
  }
};

const int MAX = 5005;
const int INF = (1<<25);
int T[MAX][MAX];
vector<short> Edge[MAX];
P price[MAX];
int N,K;

void input(){
  scanf("%d %d",&N,&K);
  for(int i = 0; i < N; i++) scanf("%d %d",&price[i].c, &price[i].r);
  for(int i = 0; i < K; i++){
    int a,b;
    scanf("%d %d",&a, &b);
    a--;b--;
    Edge[a].push_back(b);
    Edge[b].push_back(a);
  }
}

void solve(){
  fill(T[0], T[0]+MAX*MAX, INF);
  
  T[0][0] = 0;
  priority_queue<State> Q;
  Q.push((State){0,0,0});
  while(!Q.empty()){
    const State now = Q.top();
    Q.pop();
    
    if(now.t > T[now.pos][now.remain]) continue;
    
    if(now.remain > 0){
      for(int i = 0; i < (int)Edge[now.pos].size(); i++){
	State nex = now;
	nex.pos = Edge[now.pos][i];
	nex.remain--;
	
	if(T[nex.pos][nex.remain] > nex.t){
	  T[nex.pos][nex.remain] = nex.t;
	  Q.push(nex);
	}
      }
    }
    
    State nex = now;
    nex.t += price[now.pos].c; 
    nex.remain = price[now.pos].r;
    if(T[nex.pos][nex.remain] > nex.t){
      T[nex.pos][nex.remain] = nex.t;
      Q.push(nex);
    }
  }
  
  int ans = INF;
  for(int i = 0; i < MAX; i++) ans = min(ans,T[N-1][i]);
  printf("%d\n",ans);
}

int main(){
  input();
  solve();
  return 0;
}

Measured memory_bytes: 99500
n = int(input())
p = input().split(' ')
p = [int(i) for i in p]
result = 0
for i in range(1,n-1):
  if (p[i-1] < p[i] and p[i] < p[i+1]) or (p[i+1] < p[i] and p[i] < p[i-1]):
    result += 1
print(result)


Measured memory_bytes: 3060
object Main extends App {

  val n = io.StdIn.readLine()
  println(convert(n.toInt))

  def convert(n: Int): String = {
    val num = n / 100
    val a = (num.toString * 3).toInt

    if (n > a) {
      return (num + 1).toString * 3
    } else {
      return a.toString
    }
  }

}


Measured memory_bytes: 25412
#include <stdio.h>
#include <iostream>
#include <string.h>
using namespace std;

int n,m;
int a[305][305];
int num[305],b[305];
bool used[305];

int main()
{
    scanf ("%d %d",&n,&m);
    for (int i=1;i<=n;i++)
        for (int j=1;j<=m;j++)
            scanf ("%d",&a[i][j]);
    for (int i=1;i<=n;i++)
        num[a[i][1]]++;
    int maxn=0,ans=1999999999;
    for (int i=1;i<=m;i++)
        used[i]=1;
    for (int i=1;i<=m;i++)
        {
        memset(num,0,sizeof(num));
        for (int i=1;i<=n;i++)
            for (int j=1;j<=m;j++)
        if (used[a[i][j]]==1) {num[a[i][j]]++; break;}
        int maxn=0,ii;
        for (int i=1;i<=m;i++)
            if (num[i]>maxn) {maxn=num[i];ii=i;}
        used[ii]=0;
        ans=min(ans,maxn);
        //printf ("%d",ans);
        }
    printf ("%d",ans);
}


Measured memory_bytes: 640
N,K = [ int(it) for it in input().split() ]
K2 = 2*K
li = [ (lambda x,y,z:[int(x)%K2,int(y)%K2,0 if z=="W" else 1] )(*(input().split())) for i in range(N)]

bm = [[0]*(K2+1) for i in range(K2+1)]
wm = [[0]*(K2+1) for i in range(K2+1)]
for x,y,z in li:
  if (z==0):
    wm[x+1][y+1] += 1
  else:
    bm[x+1][y+1] += 1

for i in range(1,2*K+1):
  for j in range(1,2*K+1):
    bm[i][j]=bm[i-1][j]+bm[i][j-1]-bm[i-1][j-1]+bm[i][j]
    wm[i][j]=wm[i-1][j]+wm[i][j-1]-wm[i-1][j-1]+wm[i][j]
sumb=bm
sumw=wm

ans=0
for i in range(K):
    for j in range(K):
        for _ in range(2):
            s=0
            s+=sumb[i][j]-sumb[i][0]-sumb[0][j]+sumb[0][0]#
            s+=sumb[i+K][j+K]-sumb[i][j+K]-sumb[i+K][j]+sumb[i][j]
            s+=sumb[i][2*K]-sumb[0][2*K]-sumb[i][j+K]+sumb[0][j+K]#
            s+=sumb[2*K][j]-sumb[i+K][j]-sumb[2*K][0]+sumb[i+K][0]#
            s+=sumb[2*K][2*K]-sumb[i+K][2*K]-sumb[2*K][j+K]+sumb[i+K][j+K]#

            s+=sumw[i][j+K]-sumw[0][j+K]-sumw[i][j]+sumw[0][j]#
            s+=sumw[i+K][j]-sumw[i][j]-sumw[i+K][0]+sumw[i][0]#
            s+=sumw[2*K][j+K]-sumw[i+K][j+K]-sumw[2*K][j]+sumw[i+K][j]#
            s+=sumw[i+K][2*K]-sumw[i+K][j+K]-sumw[i][2*K]+sumw[i][j+K]#

            ans=max(ans,s)
            sumb,sumw=sumw,sumb

print(ans)


Measured memory_bytes: 123480
#include <cstdio>
#include <algorithm>
#include <bitset>
#include <utility>

using namespace std;

int n, m;
pair<int, int> arm[200005];
int accept[200005][3];  // higher, self, lower
bitset<200005> trans;

int main() {
    scanf("%d%d", &n, &m);
    for (int i = 1; i <= n; ++i) accept[i][1] = 1;
    for (int i = 0; i != m; ++i)
        scanf("%d%d", &arm[i].first, &arm[i].second);
    sort(arm, arm + m);
    for (int i = 0; i != m; ++i) {
        int l = arm[i].second, h = l + 1;
        if (!trans.test(l)) {
            accept[l][2] = accept[h][1];
            accept[h][0] = accept[l][1];
            trans.set(l);
        }
        accept[l][2] += accept[h][2]; accept[h][1] += accept[h][2]; accept[h][2] = 0;
        accept[h][0] += accept[l][0]; accept[l][1] += accept[l][0]; accept[l][0] = 0;
    }
    for (int i = 1; i != n; ++i)
        printf("%d ", accept[i][0] + accept[i][1] + accept[i][2]);
    printf("%d\n", accept[n][0] + accept[n][1] + accept[n][2]);
    return 0;
}

Measured memory_bytes: 5884
#include<bits/stdc++.h>
//g++ -std=c++11 

using namespace std;
typedef long long ll;

#define rep(i,n) for (long long i = 0; i < (n); ++i)
#define DIV 1000000007 //10^9+7

int main(){
	ll N, D;
	cin >> N >> D;
	D = D * 2 + 1;
	cout << (N + D - 1) / D << endl;

}



Measured memory_bytes: 3568
#include <bits/stdc++.h>
#define all(x) (x).begin, (x).end()
using namespace std;
typedef long long int64;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<29;
const long long  INFL = 1e18;
const int MOD = 1000000007;
const int MAX = 210000;
const int MAX_NUM = 999999999;
void solve() {
	double A, B, N; cin >> A >> B >> N;
	int64 x = (N < (B - 1) ? N : B - 1);
	int64 ans = 0;
	int p = floor((A * x) / B);
	int q = A * floor(x / B);
	int64 tmp = p - q;
	ans = max(ans, tmp);
	cout << ans << endl;
	return;
}
int main() {
	solve();
	return 0;
}

Measured memory_bytes: 3740
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <iomanip>
#include <stack>
#include <queue>
#include <numeric>
#include <map>
#include <unordered_map>
#include <set>
#include <fstream>
#include <chrono>
#include <random>
#include <bitset>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) ((int)(x).size())
#define pb push_back
#define mod 1000000007
using ll = long long;
using namespace std;
ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}

vector<vector<int>> wcnt;

int whites(int w1, int w2, int y1, int y2){
  return wcnt[y2][w2]-wcnt[y2][w1]-wcnt[y1][w2]+wcnt[y1][w1];
}

int main(){
  int H,W,K; cin >> H >> W >> K;
  wcnt.resize(H+1, vector<int>(W+1,0));
  vector<string> S(H);
  rep(i,H) cin >> S[i];
  rep(y,H){
    rep(x,W){
      if(S[y][x] == '1') wcnt[y+1][x+1]=1;
    }
  }
  rep(y,H+1){
    rep(x,W){
      wcnt[y][x+1] += wcnt[y][x];
    }
  }
  rep(x,W+1){
    rep(y,H){
      wcnt[y+1][x] += wcnt[y][x];
    }
  }
  ll loop = pow(2,H);
  int ans = (H-1)*(W-1);
  rep(i,loop){
    //cout << 'a' << endl;
    int preans;
    vector<int> cutline;
    cutline.pb(0);
    int now = i;
    rep(x,10){
      if(now%2) cutline.pb(x+1);
      now >>= 1;
    }
    cutline.pb(H);
    int cuts = sz(cutline);
    //rep(j,cuts) cout << cutline[j] << " ";
    preans = cuts-2;
    int cut1 = 0;
    int cut2 = 0;
    while(true){
      bool ok = true;
      rep(j,cuts-1){
        int count = whites(cut1, cut2+1, cutline[j], cutline[j+1]);
        if(count>K) ok = false;
      }
      //cout << "a";
      if(!ok){
        if(cut1==cut2){
          preans += 10000;
          break;
        }
        cut1 = cut2;
        if(cut2!=W)preans++;
      }
      else{
        if(cut2+1 == W)break;
        cut2++;
      }
    }
    ans = min(preans, ans);
  }

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


Measured memory_bytes: 256
console.log(function(args){
  const [[A,V],[B,W],[T]] = args.trim().split('\n').map( r=>r.split(' ').map(BigInt) );
  if ( A < B ) return ( T*V+A >= T*W+B ) ? 'YES' : 'NO';
  else return ( A-T*V <= B-T*W ) ? 'YES' : 'NO';
}(require('fs').readFileSync('/dev/stdin', 'utf8')));


Measured memory_bytes: 29628
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();
    StringBuilder ans =  new StringBuilder();
    while(N > 0){
      N--;
      ans.append((char) (N % 26 + 'a'));
      N /= 26;
    }
    System.out.println(ans.reverse());
  }
}


Measured memory_bytes: 35860
def no_dislike_number(num, D):
    for digit in num:
        if digit in D:
            return False
    return True
    # for dislike in D:
    #     if dislike in num:
    #         return False
    # return True

MAX = 10000
N, K = map(int, input().split())
D = input().split()
num = N
while(True):
    if no_dislike_number(str(num), D):
        print(num)
        break
    num += 1

Measured memory_bytes: 3064
import math
import heapq
from bisect import bisect_right, bisect_left
from collections import defaultdict, Counter
import itertools
import sys
sys.setrecursionlimit(10**7)
MOD = 10**9 + 7
INF = float("inf")


def main():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    aa = []
    for i in range(n):
        aa.append(-a[i])
    heapq.heapify(aa)
    ans = 0
    for i in range(m):
        t = heapq.heappop(aa)
        t = math.ceil(t / 2)
        heapq.heappush(aa, t)
    print(-sum(aa))


if __name__ == '__main__':
    main()


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

typedef complex <double> com;
const int P = 200003, len = 1 << 19;
int n;
com c[len];
int p[P], seq[len];
void fft(com a[], const char &flag);

int main() {
	for (int i = 2, j = 1; i != 1; i = i << 1 >= P ? (i << 1) - P : i << 1, ++j)
		p[i] = j;
	for (int i = 1; i < len; ++i)
		seq[i] = seq[i >> 1] >> 1 | (i & 1) << 18;
	scanf("%d", &n);
	long long ans = 0;
	for (int i = 0; i < n; ++i) {
		int a; scanf("%d", &a);
		if (a != 0)
			c[p[a]] += 1, ans -= 1ll * a * a % P;
	}
	fft(c, 1);
	for (int i = 0; i < len; ++i)
		c[i] = c[i] * c[i] / double(len);
	fft(c, -1);
	for (int i = 0, j = 1; i < len; ++i, j <<= 1) {
		if (j >= P)
			j -= P;
		ans += j * (long long)(c[i].real() + 0.5);
	}
	printf("%lld\n", ans >> 1);
	return 0;
}

void fft(com a[], const char &flag) {
	for (int i = 0; i < len; ++i)
		if (i < seq[i])
			swap(a[i], a[seq[i]]);
	for (int i = 0; 1 << i < len; ++i) {
		const com wn(cos(M_PI / (1 << i)), flag * sin(M_PI / (1 << i)));
		for (int j = 0; j < len; j += 1 << i + 1) {
			com w(1, 0);
			for (int k = 0; k < 1 << i; ++k, w *= wn) {
				com x = a[j + k], y = w * a[j + k + (1 << i)];
				a[j + k] = x + y;
				a[j + k + (1 << i)] = x - y;
			}
		}
	}
	return;
}



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

const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;
const int MOD=1000000007;

int main(){
	ll n;cin>>n;
	ll Min=LLONG_MAX;
	for(ll i=1;i*i<=n;i++){
		if(n%i==0){
			ll x=i,y=n/i;
			Min=min(Min,(x-1)+(y-1));
		}
	}
	cout<<Min<<endl;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int cut(int h,int w){
    int p1,p2,p3;
    if(h%2==0 && w%3==1)p1=w/3*h,p2=h/2*(w-w/3),p3=p2;
    if(h%2==0 && w%3==2)p1=(w/3+1)*h,p2=h/2*(w-w/3-1),p3=p2;
    if(h%2==1 && w%3==1)p1=w/3*h,p2=h/2*(w-w/3),p3=p2+w-w/3;
    if(h%2==1 && w%3==2)p1=(w/3+1)*h,p2=h/2*(w-w/3-1),p3=p2+w-w/3-1;
    return max({p1,p2,p3})-min({p1,p2,p3});
}
int main(){
    int h,w;
    cin>>h>>w;
    if(h%3==0 || w%3==0)cout<<"0"<<endl;
    else cout<<min({h,w,cut(h,w),cut(w,h)})<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream> // cin, cout, cerr
#include <algorithm> // minmax, sort, swap
#include <numeric> // iota
#include <cstdio> // printf, scanf
#include <string> // string, stoi, to_string
#include <vector> // vector
#include <queue> // queue, priority_queue
#include <deque> // deque
#include <map> // key-value pairs sorted by keys
#include <set> // set
#include <iomanip> // cout<<setprecision(n)
#include <functional> // function<void(int)>
#include <cmath>

#ifdef DEBUG
#include "debug.hpp"
#else
#define debug(...)
#endif

#define int long long // at least int64 > 9*10^18
#define ENDL '\n'
#define rep(i,n) for(int i = 0; i < (n); i++)
#define print(i) std::cout << (i) << '\n'
#define all(v) (v).begin(), (v).end()
/* libraries */

signed main() {
	int n;
	std::cin >> n;
	std::vector<int> p(n);
	rep(i,n) std::cin >> p[i];
	int mn = n+4;
	int count = 0;
	rep(i,n) {
		if(p[i]<=mn) {
			mn=p[i];
			count++;
			debug(p[i]);
		}
	}
	print(count);

	return 0;
}


Measured memory_bytes: 1792
# import math
# import statistics
# a=input()
#b,c=int(input()),int(input())
# c=[]
# for i in a:
#     c.append(i)
e1,e2,e3 = map(int,input().split())
#f = list(map(int,input().split()))
#g = [input() for _ in range(a)]
# h = []
# for i in range(e1):
#     h.append(list(map(int,input().split())))

if e1<=e3<=e2 or e2<=e3<=e1:
    print("Yes")
else:
    print("No")

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

int main(){

    vector<int> x(3);
    cin >> x[0] >> x[1] >> x[2];

    sort(x.rbegin(), x.rend());

    cout << 10 * x[0] + x[1] + x[2] << endl;

    return 0;
}

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

int main(){
    int n;
    cin >> n;
    string s;
    cin >> s;
    size_t L = s.size();
    int rcount=0;
    int l_r=0,l_w=0,r_r=0,r_w=0;
    int ans;
    rep(i,L){
        if(s[i]=='R') rcount++;
    }
    int wcount = L - rcount;
    rep(i,rcount){
        if(s[i]=='R') l_r++;
        else l_w++;
    }
    rep(i,wcount){
        if(s[i+rcount]=='W') r_w;
        else r_r++;
    }
    int pos = min(l_w,r_r);
    int col = min(l_w-pos, 0) + min(r_r-pos, 0); 
    cout << pos+col << endl;
    return 0;
}

Measured memory_bytes: 3724
#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

// 内部定数
#define D_MOVE_CNT		5										// 移動数

// 内部変数
static FILE *szpFpI;											// 入力

// 内部変数 - テスト用
#ifdef D_TEST
	static int siRes;
	static FILE *szpFpA;
	static int siTNo;
#endif

// 出力
int
fOut(
	char *pcpLine				// <I> １行
)
{
	char lc1Buf[1024];

#ifdef D_TEST
	fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
	if (strcmp(lc1Buf, pcpLine)) {
		siRes = -1;
	}
#else
	printf("%s", pcpLine);
#endif

	return 0;
}

// 実行メイン
long long
fMain(
)
{
	int i;
	char lc1Buf[1024];

	// 人数 - 取得
	long long llCnt;
	fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
	sscanf(lc1Buf, "%lld", &llCnt);

	// 移動人数 - 取得
	long long ll1Move[D_MOVE_CNT];
	for (i = 0; i < D_MOVE_CNT; i++) {
		fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
		sscanf(lc1Buf, "%lld", &ll1Move[i]);
	}

	// 最大時間 - 取得
	long long llMax = 0;
	for (i = 0; i < D_MOVE_CNT; i++) {
		long long llTime = (llCnt + ll1Move[i] - 1) / ll1Move[i];
		if (llMax < llTime) {
			llMax = llTime;
		}
	}

	return llMax + D_MOVE_CNT - 1;
}

// １回実行
int
fOne(
)
{
	long long llRet;
	char lc1Buf[1024];

	// 入力 - セット
#ifdef D_TEST
	sprintf(lc1Buf, ".\\Test\\T%d.txt", siTNo);
	szpFpI = fopen(lc1Buf, "r");
	sprintf(lc1Buf, ".\\Test\\A%d.txt", siTNo);
	szpFpA = fopen(lc1Buf, "r");
	siRes = 0;
#else
	szpFpI = stdin;
#endif

	// 実行メイン
	llRet = fMain();

	// 結果 - セット
	sprintf(lc1Buf, "%lld\n", llRet);

	// 結果 - 出力
	fOut(lc1Buf);

	// 残データ有無
#ifdef D_TEST
	lc1Buf[0] = '\0';
	fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
	if (strcmp(lc1Buf, "")) {
		siRes = -1;
	}
#endif

	// テストファイルクローズ
#ifdef D_TEST
	fclose(szpFpI);
	fclose(szpFpA);
#endif

	// テスト結果
#ifdef D_TEST
	if (siRes == 0) {
		printf("OK %d\n", siTNo);
	}
	else {
		printf("NG %d\n", siTNo);
	}
#endif

	return 0;
}

// プログラム開始
int
main()
{

#ifdef D_TEST
	int i;
	for (i = D_TEST_SNO; i <= D_TEST_ENO; i++) {
		siTNo = i;
		fOne();
	}
#else
	fOne();
#endif

	return 0;
}



Measured memory_bytes: 384
import java.util.*

fun main(args: Array<String>) {
	val cin = Scanner(System.`in`)
	val ans = mutableListOf<String>()

	while (true) {
		val H = cin.nextInt()
		val W = cin.nextInt()
		if (H + W == 0) break

		for (h in 0 until H) {
			if (h !in 1 until H - 1) {
				ans.add("#".repeat(W))
			} else {
				ans.add('#' + ".".repeat(W - 2) + '#')
			}
		}
		ans.add("")
	}
	println(ans.joinToString("\n"))
}




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

int main(void){
    int n;
    cin >> n;
    long double sum = 0;
    long int sum2 = 0;
    for(int i = 0;i < n;i++){
        long double a;
        string s;
        cin >> a >> s;
        if(s == "BTC")sum += 380000.0*a;
        else sum2 += a;
    }
    cout << (double)(sum2+sum) << setprecision(5) << endl;
}

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

using namespace std;

// input
int n;
int x[101];

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  cin >> n;
  rep(i,n) cin >> x[i];


  int ans = 1e9,cost;
  rep(p,101) {

    rep(i,n) {
      cost += pow(x[i]-p,2);
    }
    ans = min(cost,ans);
    cost = 0;
  }
  cout << ans << endl;
}

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

using namespace std;

int main(void)
{

  ios_base::sync_with_stdio(0);

  cin.tie(0);
  cout.tie(0);

  int n;
  cin >> n;

  int x = (double) n / 1.08;

  if( (int) ( (double) x * 1.08 ) == n )
  {

    cout << x;

  }
  else
  {

    if( (int) ( ( (double) x + 1 ) * 1.08 ) == n )
    {

      cout << x+1;

    }
    else
    {

      if( (int) ( ( (double) x - 1 ) * 1.08 ) == n )
      {

        cout << x-1;

      }
      else
      {

        cout << ":(";

      }

    }

  }

  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 INF 1e9
typedef long long LL;
const LL mod = 1e9+7;

int main() {
  string S;
  cin >> S;
  
  int count = 0;
  for (int i = 0; i < 3; i++) {
    if(S[i] == 'o') count++;
  }
  
  cout << 700 + 100*count << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main (int argc, char * argv[])
{
    int a[4][13]={0};
    int i, j, k, x, n;
    char m;

    scanf("%d", &n);

    for(k = 0; k < n; k++){
        scanf("%c",&m);
        scanf("%c %d",&m, &x);
        if(m == 'S')
        a[0][x - 1] = 1;
        else if(m == 'H')
        a[1][x - 1] = 1;
        else if(m == 'C')
        a[2][x - 1] = 1;
        else if(m == 'D')
        a[3][x - 1] = 1;
    }
//    printf("\n");

    for(i = 0; i < 4; i++){
        for(j = 0; j < 13; j++){
            if(a[i][j] == 0){
            if(i == 0)
            printf("S %d\n", j + 1);
            else if(i == 1)
            printf("H %d\n", j + 1);
            else if(i == 2)
            printf("C %d\n", j + 1);
            else if(i == 3)
            printf("D %d\n", j + 1);
    }
    }
    }
    return 0;
}


Measured memory_bytes: 2028
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using static System.Console;
using static System.Math;
using static MyIO;
using static MyUtil;

public class A
{
	public static void Main() => (new Solver()).Solve();
}

public class Solver
{
	public void Solve()
	{
		int H = GetInt();
		int W = GetInt();
		int N = GetInt();
		int max = Max(H, W);
		WriteLine((N + max - 1) / max);
	}
}

public static class MyIO
{
	private static string[] args = null;
	private static int num = -1;
	private static int used = -1;

	private static string getArg()
	{
		if(used == num)
		{
			args = Console.ReadLine().Split(' ');
			num = args.Length;
			used = 0;
		}
		return args[used++];
	}

	public static int GetInt() => int.Parse(getArg());
	public static long GetLong() => long.Parse(getArg());
	public static double GetDouble() => double.Parse(getArg());
	public static decimal GetDecimal() => decimal.Parse(getArg());
	public static string GetString() => getArg();
	public static char GetChar() => getArg()[0];
	public static int[] GetInts(long N) => Enumerable.Range(0, (int)N).Select(_ => GetInt()).ToArray();
	public static long[] GetLongs(long N) => Enumerable.Range(0, (int)N).Select(_ => GetLong()).ToArray();
	public static double[] GetDoubles(long N) => Enumerable.Range(0, (int)N).Select(_ => GetDouble()).ToArray();
	public static decimal[] GetDecimals(long N) => Enumerable.Range(0, (int)N).Select(_ => GetDecimal()).ToArray();
	public static string[] GetStrings(long N) => Enumerable.Range(0, (int)N).Select(_ => GetString()).ToArray();
}

public static class MyUtil
{
	public static void chmax<T>(ref T x, T y) where T : IComparable<T>
	{
		if(x.CompareTo(y) < 0)
			x = y;
	}

	public static void chmin<T>(ref T x, T y) where T : IComparable<T>
	{
		if(x.CompareTo(y) > 0)
			x = y;
	}

	public static void swap<T>(ref T x, ref T y)
	{
		T tmp = x;
		x = y;
		y = tmp;
	}
}

Measured memory_bytes: 11092
n, k = gets.split.map(&:to_i)
a = gets.split.map(&:to_i)
memo = []
flg = true
rest = k
current_index = 0
next_index = a[current_index] - 1
loop do
  if memo[current_index] && flg
    flg = false
    loop_count = memo[current_index] - rest
    rest %= loop_count
    break if rest.zero?
    rest -= 1
    current_index = next_index
    next_index = a[current_index] - 1
  else
    memo[current_index] = rest
    rest -= 1
    current_index = next_index
    next_index = a[current_index] - 1
  end
  break if rest.zero?
end
puts current_index + 1

Measured memory_bytes: 29008
d,m=1e9+7,dp[10001][200];i,j,k,x,I;
char s[11111];
main(L)
{
	scanf("%s%d",s,&d);
	**dp=1;
	for(;i<strlen(s);i++)
	{
		for(j=0;j<2;j++)
		{
			L=j?9:s[i]-48;
			for(x=0;x<=L;x++)for(k=0;k<d;k++)dp[i+1][I=(j|x<L)*d+(k+x)%d]+=dp[i][j*d+k],dp[i+1][I]%=m;
		}
	}
	printf("%d",(*dp[i]+dp[i][d]-1+m)%m);
}

Measured memory_bytes: 7936
#!/usr/bin/env python
# coding: utf-8

# In[8]:


A,B,C,X,Y = map(int, input().split())


# In[10]:


ans1 = A*X + B*Y
ans2 = C*min(X,Y)*2 + A*(X-min(X,Y)) + B*(Y-min(X,Y))
ans3 = C*max(X,Y)*2
print(min(ans1, ans2, ans3))


# In[ ]:






Measured memory_bytes: 8976
#include <bits/stdc++.h>
#define ROOP(i, N) for(int i=0; i++; i<N)
#define RVROOP(i, N) for(int i=N; i--; i>=0)
#define ALL(v) v.begin(), v.end()
const int INF = 1e9;
const int MAX = 510000;
const int MOD = 1000000007;
using namespace std;
typedef long long ll;

/*DP使ったほうがよくない？？WOWWOW*/

int main(){
  string N; cin>>N;
  bool ans=false;
  for(int i=0; i<3; i++){
    if(N.at(i)=='7'){
      ans=true;
      break;
    }
  }
  if(ans==true){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}

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

#define ll long long
#define pb push_back
#define mod 1000000007
#define rep(i,a,n) for(int i=a;i<n;i++)
#define dbg(x) cout<<#x<<" = "<<x<<'\n';

ll isPrime(ll x) {ll i, flag = 1; if(x == 0 || x == 1) flag = 0; for(i = 2; i<=sqrt(x); i++) { if(x%i == 0) {flag = 0; break;}} return flag;}
ll power(ll x, ll y){ll res=1;x=x%mod;while(y>0){if(y&1)res=(res*x)%mod;y=y>>1;x=(x*x)%mod;}return res;}

void solve()
{
    float d,t;
    float s;
    cin>>d>>t>>s;
    //cout<<float(d/t);
    if(((float)d/(float)t) <= s)
        cout<<"Yes";
    else
        cout<<"No";
}

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);cout.tie(NULL);
  int tc=1;
  //cin>>tc;
  while(tc--)
  {
    solve();
  }
  return 0;
}


Measured memory_bytes: 3756
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<map>
#include<set>
#include<queue>
#include<vector>
using namespace std;
typedef long long ll;
#define mit map<int,int>::iterator
#define sit set<int>::iterator
#define itrm(g,x) for(mit g=x.begin();g!=x.end();g++)
#define itrs(g,x) for(sit g=x.begin();g!=x.end();g++) 
#define ltype int
#define rep(i,j,k) for(ltype (i)=(j);(i)<=(k);(i)++)
#define pii pair<int,int>
#define fi first
#define se second
#define mpr make_pair
#define pb push_back
const int inf=0x3f3f3f3f,
mod=1000000007;
const double pi=3.1415926535897932,
eps=1e-6;
int n,ans,p1,p2;
pii s[100005];
priority_queue<pii > a,b;bool tk[100005];
ll work(bool lft){
    while(!a.empty()) a.pop();while(!b.empty()) b.pop();
    rep(i,1,n){
        a.push(mpr(-s[i].se,i));
        b.push(mpr(s[i].fi,i));
        tk[i]=0;
    }
    ll res=0;int cur=0;
    while(1){
        if(lft){
            while(!a.empty()&&tk[a.top().se]) a.pop();
            if(a.empty()) break;
            int nxt=-a.top().fi;
            if(nxt<=cur) res+=cur-nxt,cur=nxt,tk[a.top().se]=1;
            else break;
        }
        else {
            while(!b.empty()&&tk[b.top().se]) b.pop();
            if(b.empty()) break;
            int nxt=b.top().fi;
            if(cur<=nxt) res+=nxt-cur,cur=nxt,tk[b.top().se]=1;
            else break;
        }
        lft^=1;
    }
    res+=abs(cur);
    return res;
}
int main()
{
    scanf("%d",&n);
    rep(i,1,n) scanf("%d%d",&s[i].fi,&s[i].se);
    int cur=0;
    ll ans=max(work(0),work(1));
    printf("%lld",ans);
    return 0;
}

Measured memory_bytes: 2924