akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
// statics
using namespace std;
using int64 = int_fast64_t;
using PAIR = pair<int, int>;
constexpr int INF = 1 << 30;
constexpr int64 LINF = 1LL << 60;
constexpr int MOD = 1e9 + 7;
constexpr int MAX_N = 1e5 + 1;

// init/input
#define int int64
#define INIT ios::sync_with_stdio(false);cin.tie(0);
#define VAR(type, ...) type __VA_ARGS__;MACRO_VAR_Scan(__VA_ARGS__);
template<typename T> void MACRO_VAR_Scan(T &t) {cin>>t;}
template<typename First, typename...Rest> void MACRO_VAR_Scan(First &first, Rest&...rest) {cin>>first;MACRO_VAR_Scan(rest...);}
#define VEC(type, c, n) vector<type> c(n);for(auto &&i:c)cin>>i;

// out
#define OUT(dist) cout<<(dist);
#define FOUT(n, dist) cout<<fixed<<setprecision(n)<<(dist);
#define SP cout<<" ";
#define BR cout<<"\n";
#define debug(x) cerr<<#x<<":"<< (x);BR;

// utility
#define ALL(a) (a).begin(), (a).end()
#define EACH(i, a) for(auto &&i:(a))
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define RFOR(i, a, b) for(int i=(b)-1;i>=0;--i)
#define REP(i, n) for(int i=0;i<(n);++i)
#define RREP(i, n) for(int i=(n)-1;i>=0;--i)

signed main() {
  INIT;
	VAR(int, x, y);
	OUT((abs(x - y) < 2) ? "Brown" : "Alice")BR;
  
  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <assert.h>

using namespace std;

typedef long long ll;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;

#define MOD 1000000007

int main(){
  string s;
  cin>>s;
  if(s[0]>='a'){
    cout << "a" << endl;
  }
  else{
    cout << "A" << endl;
  }
  return 0;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using mti = vector<vector<int>>;
using vl = vector<ll>;
using mtl = vector<vector<ll>>;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
#define all(x) x.begin(),x.end()
#define rep(i,j,n) for (int i = j; i < (int)(n); i++)
#define _GLIBCXX_DEBUG
#define n_p(v) next_permutation(v.begin(),v.end())
#define print(a) cout<<(a)<<endl;
#define to_ll(b) stoll(b)
#define MOD 1000000007

int main(){
	ll N,ans; cin>>N;
	string s_N=to_string(N);
	ans=s_N.size();
	long double x=sqrt(N);
	rep(i,1,x+1){
		if(N%i==0){
			ll j=N/i;
			string s_i=to_string(i);
			string s_j=to_string(j);
			ll sum=max(s_i.size(),s_j.size());
			ans=min(ans,sum);
		}
	}
	print(ans)
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for ((i)=1;(i)<=(n);(i)++)
using namespace std;
int n,i,j,ans=0x3f3f3f3f;
string s,t;
vector<int> a,b;
int main(){
	cin>>n>>s>>t;
//	s=" "+s;t=" "+t;
	rep(i,n-1){
		if(s[i]!=s[i-1]) a.push_back(i);
	}
	rep(i,n-1){
		if(t[i]!=t[i-1]) b.push_back(i);
	}
//	for(i=0;i<a.size();i++)cerr<<a[i]<<' ';cerr<<endl;
//	for(i=0;i<b.size();i++)cerr<<b[i]<<' ';cerr<<endl;
//	cerr<<a.size()<<' '<<b.size()<<endl;
//	cerr<<-max((int)a.size(),(int)b.size())-1<<' '<<max(a.size(),b.size())+1<<endl;
	for(i=-max((int)a.size(),(int)b.size())-1;;i++){
		if(!(i<=max((int)a.size(),(int)b.size())+1)) break;
		if((i&1)^(s[0]==t[0])){
			int res=0;
			for(j=min(0,-i);j<max((int)a.size(),((int)b.size())-i);j++){
				int k=i+j,px,py;
				px=(j<0?0:(j>=a.size()?n:a[j]));
				py=(k<0?0:(k>=b.size()?n:b[k]));
				res+=abs(px-py);
			}
			ans=min(ans,res);
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 3724
n=int(input())
a=[i*30000+1 for i in range(n)]
b=[30000**2-i for i in a]
p=list(map(int,input().split()))
for i in range(n):
  a[p[i]-1]+=i
  b[p[i]-1]+=i
print(*a)
print(*b)


Measured memory_bytes: 7104
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
//using Graph = vector<vector<edge>>;
using dou =long double;
string yes="yes";
string Yes="Yes";
string YES="YES";
string no="no";
string No="No";
string NO="NO";

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; }

#define rep(i, n)         for(int i = 0; i < (int)(n); i++)
#define brep(n)           for(int bit=0;bit<(1<<n);bit++)
#define erep(i,container) for (auto i : container)
#define irep(i, n)        for(int i = n-1; i >= (int)0; i--)
#define rrep(i,m,n) for(ll i = m; i < (ll)(n); i++)
#define reprep(i,j,h,w) rep(i,h)rep(j,w)
#define all(x) (x).begin(),(x).end()
#define VEC(type,name,n) std::vector<type> name(n);rep(i,n)std::cin >> name[i];
#define pb push_back
#define pf push_front
#define query int qq;std::cin >> qq;rep(qqq,qq)
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define itn int
#define mp make_pair
#define sum(a) accumulate(all(a),0ll)
#define keta fixed<<setprecision
#define vout(a) erep(qxqxqx,a)std::cout << qxqxqx << ' ';std::cout  << std::endl;
#define vvector(name,typ,m,n,a)vector<vector<typ> > name(m,vector<typ> (n,a))
//#define vvector(name,typ,m,n)vector<vector<typ> > name(m,vector<typ> (n))
#define vvvector(name,t,l,m,n,a) vector<vector<vector<t> > > name(l, vector<vector<t> >(m, vector<t>(n,a)));
#define vvvvector(name,t,k,l,m,n,a) vector<vector<vector<vector<t> > > > name(k,vector<vector<vector<t> > >(l, vector<vector<t> >(m, vector<t>(n,a)) ));
#define case std::cout <<"Case #" <<qqq+1<<": "
#define res resize
#define as assign
#define ffor for(;;)
#define ppri(a,b) std::cout << a<<" "<<b << std::endl
#define pppri(a,b,c) std::cout << a<<" "<<b <<" "<< c<<std::endl
#define aall(x,n) (x).begin(),(x).begin()+(n)
#define ssum(a) accumulate(a,0ll) 

typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
//typedef long long T;
ll ceil(ll a,ll b){
    return ((a+b-1)/b);
}
const int INF = 2000000000;
const ll INF64 = 9223372036854775807ll;
//const ll INF64 = 9223372036854775ll;
const ll MOD = 1000000007ll;
const dou pi=3.141592653589793;
//mapは、if関数などで覗いただけで構成されるので注意しよう！
//std::vector<vector<int>> g;
namespace mp = boost::multiprecision;
int main(){
    ll a;
    std::cin >> a;
    string s;
    std::cin >> s;
    string d;
    d.pb(s[0]);
    d.pb(s[2]);
    d.pb(s[3]);
    ll dd=stoi(d);
    mp::cpp_int ans=0;
    ans+=a;
    ans*=dd;
    ans/=100;
    std::cout << ans << std::endl;
}


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

#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define read()          freopen("fibsubseq.in","r",stdin)
#define write()         freopen("fibsubseq.out","w",stdout)
#define sf(n)           scanf("%d",&n)
#define sfd(n)          scanf("%lf",&n)
#define sl(x)           scanf("%I64d",&x)
#define sfl(n)          scanf("%lld", &n)
#define sfc(n)          scanf(" %c",&n)
#define sful(n)         scanf("%llu",&n)
#define ull             unsigned long long int
#define endll           printf("\n")
#define pf              printf
#define pi              acos(-1.0)
#define eps             1e-10
#define mem(a,b)        memset(a,b,sizeof(a))
#define pb              push_back
#define xx              first
#define yy              second
#define pii             pair<int, int>
#define pll             pair<ll, ll>
#define MP make_pair
#define ll              long long
#define uniq(a)      a.erase(unique(a.begin(), a.end()), a.end())

bool Check(unsigned int  N,int pos){return (bool)(N & (1LL<<pos));}
ll  Set(unsigned int N,int pos){    return N=N | (1LL<<pos);}
#define cnd tree[idx]
#define lnd tree[idx<<1]
#define rnd tree[(idx<<1)+1]
#define lndp (idx<<1),(b),((b+e)>>1)
#define rndp ((idx<<1)+1),(((b+e)>>1)+1),(e)
#define inf 1999999999
#define MX 100005
#define mod  1000000007
#define mod1 1000000009
#define var    int ii,i,j,k,z=0,c=0,t,x,y,l,r,mid,n,m
//int dx[8]={0,0,1,1,-1,-1,1,-1};  //8 direction
//int dy[8]={1,-1,1,-1,1,-1,0,0};

ll a[1005][1005],b[1005][1005];

int main()
{
    ll var;
    sfl(n);sfl(m);
    for(i=1;i<=n;i++)
    {
        for(j=1;j<=m;j++)
        {
            char ch;
            cin>>ch;
            b[i][j]=ch=='#';
        }
    }
    a[1][1]=1;
    if(b[1][1]==1)a[1][1]=0;
    for(i=1;i<=n;i++)
    {
        for(j=1;j<=m;j++)
        {
            if(b[i][j]!=1)a[i][j]+=a[i-1][j]+a[i][j-1],a[i][j]%=mod;
        }
    }
    cout<<a[n][m]<<endl;
}


Measured memory_bytes: 16000
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1000000001;

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

	ll total = 0;
	int min_b = INF;
	for(int i=0;i<N;i++) {
		int a, b;
		cin >> a >> b;
		total += a;
		if(a > b) {
			min_b = min(min_b, b);
		}
	}
	if(min_b == INF) {
		cout << 0 << endl;
	}else {
		cout << total - min_b << endl;
	}

	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
#include <stdlib.h>


int main() {
    int a, b;
    scanf("%d %d", &a, &b);

    //int x = (a+b+1)/2;
    int x = (int)ceil((double)(a+b)/2);
    printf("%d\n", x);
}



Measured memory_bytes: 128
#include <stdio.h>
#include <stdlib.h>

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

int main () {
	char buff[1024];
	int heights[10];

	for (int i = 0; i < 10; i++) {
		if (fgets (buff, 1024, stdin)) {
			sscanf (buff, "%d", heights + i);
		}
	}

	qsort (heights, 10, sizeof(heights[0]), height_comp);
	for (int i = 0; i < 3; i++) {
		printf("%d\n", heights[i]);
	}
	
	return 0;
}



Measured memory_bytes: 2028
#include <bits/stdc++.h>
using namespace std;
#define ll                      long long
#define pb                      push_back
#define rep(i,a,b,c)            for(ll i=(a);i<=(b);i+=(c))
#define repb(i,a,b,c)           for(ll i=(a);i>=(b);i-=(c))
#define MOD                     1000000007
#define inf                     3e18
#define ld                      long double
#define mp                      make_pair
#define vpll                    vector<pair<ll,ll> >
#define vll                     vector<ll>
#define vld                     vector<ld>
#define vvll                    vector<vector<ll>>
#define vvld                    vector<vector<ld>>
#define pll                     pair<ll,ll>
#define vvpll                   vector<vector<pair<ll,ll>>>
#define pqll                    priority_queue<ll>
#define mll                     map<ll,ll>
#define mlc                     map<ll,char>
#define um                      unordered_map
#define umll                    um<ll,ll>
#define umlc                    um<ll,char>
#define all(x)                  x.begin(),x.end()
#define fi                      first
#define se                      second
#define ln                      cout<<"\n";
#define endl                    "\n"
#define test                    ll T;cin>>T;while(T--)
#define isvowel(a)              (a == 'a' || a == 'e' || a == 'i' || a == 'o' || a == 'u')
#define fastIO                  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define show(w,size)            for(ll i=0;i<size;i++) cout<<w[i]<<" ";
#define prll(a)                 cout<<a<<"\n";
#define mset(dp,no)             memset(dp,no,sizeof(dp))
#define input(a,n)              rep(i,0,n-1,1) cin>>a[i];
#define countbit                __builtin_popcount                                           //Number of setbits in decimal notation
#define lb(v,cur)               lower_bound(all(v),cur)-v.begin()
#define ub(v,cur)               upper_bound(all(v),cur)-v.begin()
#define db(...)                 __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cerr << name << " : " << arg1 <<'\n'; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ',');
    cout.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}
long long pows(long long a, long long b) {
  long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}
ll powm(ll x,ll y,ll m=MOD){x=x%m;ll res=1;while(y){if(y&1)res=res*x;res%=m;y=y>>1;x=x*x;x%=m;}return res;}
ll modInverse(ll a, ll m=MOD){if(m == 1)return 0;ll m0=m,y=0,x=1;while(a>1){ll q=a/m,t=m;m=a%m,a=t;t=y;y=x-q*y;x=t;}if(x<0) x+=m0;return x;}
int main()
{
fastIO
ll n,m,i,j,k,x,y,z,t,e,f,p,q,g,l,r,w,h,count1=0,prod=1,a,b,c,d,index,x1,x2,y1,y2,diff,ans=0,sum=0,sum1=0,sum2=0,flag=0,flag1=0,flag2=0;
string s,s1,s2;
cin>>s;
p=count(all(s),'7');
if(p>0)
{
  cout<<"Yes\n";
}
else
{
  cout<<"No\n";
}
}


Measured memory_bytes: 3652
///exit(0)으로 할 것, 코딩적 습관 보다는 내 머리를 믿을 것 , 아는 문제는 빨리 풀 수 있도록 노력 할 것


#include<bits/stdc++.h>
#define INF 987654321
#define N 1000050
using namespace std;
struct A{
    int num,lef,rig;
} s[N];
vector<int> V[N];
int n,m,ai[N],bi[N],visit[N],visit2[N];
void dfs(int from)
{
    int to,i,st,ed;
    st=-INF;
    ed=INF;
    visit[from]=1;
    for(i=0;i<V[from].size();i++){
        to=V[from][i];
        if(visit[to]==1)
            continue;
        dfs(to);
        if(s[to].rig!=INF){
            if(ed!=INF && (st-s[to].rig)%2==0){
                printf("No");exit(0);
            }
            if((ed<s[to].lef-1 || s[to].rig+1<st)){
                printf("No");exit(0);
            }
            st=max(st,s[to].lef-1);
            ed=min(ed,s[to].rig+1);
        }
    }
    if(s[from].num!=INF){
        if(st<=s[from].num && s[from].num<=ed){
            s[from].lef=s[from].rig=s[from].num;
        }
        else{
            printf("No");exit(0);
        }
    }
    else{
        s[from].lef=st;
        s[from].rig=ed;
    }
}
void dfs2(int from,int num)
{
    int i,to;
    visit2[from]=1;
    if(s[from].lef<=num-1 && num-1<=s[from].rig) s[from].num=num-1;
    else s[from].num=num+1;
    for(i=0;i<V[from].size();i++){
        to=V[from][i];
        if(visit2[to]==0) dfs2(to,s[from].num);
    }
}
int main(){
  //  freopen("input.txt","r",stdin);
    scanf("%d",&n);
    int i,v,p;
    for(i=1;i<n;i++){
        scanf("%d%d",&ai[i],&bi[i]);
        s[i].lef=-INF;
        s[i].rig=s[i].num=INF;
        V[ai[i]].push_back(bi[i]);
        V[bi[i]].push_back(ai[i]);
    }
    s[n].lef=-INF;
    s[n].rig=s[n].num=INF;
    scanf("%d",&m);
    for(i=1;i<=m;i++){
        scanf("%d%d",&v,&p);
        s[v].lef=s[v].rig=s[v].num=p;
    }
    dfs(1);
    dfs2(1,s[1].rig==INF ? 0: s[1].rig+1);
    printf("Yes\n");
    for(i=1;i<=n;i++) printf("%d\n",s[i].num);
}


Measured memory_bytes: 38016
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std; using ll = long long;
using ull = unsigned long long; using P = pair<int, int>;
const int INF = 1e9; const int MOD = 1000000007;
const int dx[] = {-1,0,1,0}; const int dy[] = {0,-1,0,1};
//const int dx[] = {-1,-1,-1, 0, 0, 1, 1, 1}; const int dy[] = {-1, 0, 1,-1, 1,-1, 0, 1};
#define PI 3.14159265358979323846264338327950L //setprecision(15)

int main() {
	int N; cin >> N;
	vector<int> v(N);
	int sum = 0;
	rep(i, N) {
		cin >> v[i];
		sum += v[i];
	}
	if (sum % 10 != 0) {
		cout << sum << endl;
		return 0;
	}
	int mi = INF;
	rep(i, N) {
		if (v[i] % 10 == 0) continue;
		mi = min(mi, v[i]);
	}
	if (mi == INF) {
		cout << "0" << endl;
	} else {
		cout << sum - mi << endl;
	}
}

Measured memory_bytes: 3628
/* in the name of Anton */

/*
  Compete against Yourself.
  Author - Aryan Choudhary (@aryanc403)
*/

#pragma GCC optimize ("Ofast")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize ("-ffloat-store")

#include<iostream>
#include<bits/stdc++.h>
using namespace std;
#define fo(i,n)   for(i=0;i<(n);++i)
#define repA(i,j,n)   for(i=(j);i<=(n);++i)
#define repD(i,j,n)   for(i=(j);i>=(n);--i)
#define all(x) begin(x), end(x)
#define sz(x) ((lli)(x).size())
#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define endl "\n"

typedef long long int lli;
typedef long double mytype;
typedef pair<lli,lli> ii;
typedef vector<ii> vii;
typedef vector<lli> vi;


const auto start_time = std::chrono::high_resolution_clock::now();
void aryanc403()
{
#ifdef ARYANC403
auto end_time = std::chrono::high_resolution_clock::now();
std::chrono::duration<double> diff = end_time-start_time;
    cerr<<"Time Taken : "<<diff.count()<<"\n";
#endif
}

#ifdef ARYANC403
#include "/home/aryan/codes/PastCodes/header.h"
#else
    #define dbg(args...)
#endif

const lli INF = 0xFFFFFFFFFFFFFFFL;

lli seed;
mt19937 rng(seed=chrono::steady_clock::now().time_since_epoch().count());
inline lli rnd(lli l=0,lli r=INF)
{return uniform_int_distribution<lli>(l,r)(rng);}

class CMP
{public:
bool operator()(ii a , ii b) //For min priority_queue .
{    return ! ( a.X < b.X || ( a.X==b.X && a.Y <= b.Y ));   }};

void add( map<lli,lli> &m, lli x,lli cnt=1)
{
    auto jt=m.find(x);
    if(jt==m.end())         m.insert({x,cnt});
    else                    jt->Y+=cnt;
}

void del( map<lli,lli> &m, lli x,lli cnt=1)
{
    auto jt=m.find(x);
    if(jt->Y<=cnt)            m.erase(jt);
    else                      jt->Y-=cnt;
}

bool cmp(const ii &a,const ii &b)
{
    return a.X<b.X||(a.X==b.X&&a.Y<b.Y);
}

const lli mod = 1000000007L;
// const lli maxN = 1000000007L;

    lli T,n,i,j,k,in,cnt,l,r,u,v,x,y;
    lli m;
    string s;
    vi a;
    //priority_queue < ii , vector < ii > , CMP > pq;// min priority_queue .

vi gt(vi a)
{
    vi mx;
    map<lli,lli> m;
    lli sum=0,cnt=0;
    for(auto x:a)
    {
        sum+=x;
        cnt++;
        m[x]++;
        if(cnt>n)
        {
            x=m.begin()->X;
            del(m,x);
            cnt--;
            sum-=x;
        }
        if(cnt==n)
            mx.pb(sum);
        else
            mx.pb(-INF);
    }
    return mx;
}

int main(void) {
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    // freopen("txt.in", "r", stdin);
    // freopen("txt.out", "w", stdout);
// cout<<std::fixed<<std::setprecision(35);
// cin>>T;while(T--)
{

    cin>>n;
    a.clear();a.reserve(n);

    fo(i,3*n)
    {
        cin>>in;
        a.pb(in);
    }
    dbg(a)
    auto mx=gt(a);
    for(auto &x:a)
        x*=-1;
    reverse(all(a));
    auto mn=gt(a);
    reverse(all(mn));
    lli ans=-INF;
    fo(i,3*n-1)
    {
        ans=max(ans,mx[i]+mn[i+1]);
        dbg(mx[i],mn[i+1])
    }
    dbg(mx)
    dbg(mn)
    cout<<ans<<endl;
}   aryanc403();
    return 0;
}


Measured memory_bytes: 21956
#include <list>
#include <map>
#include <set>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <memory.h>
#include <ctime>
#include <bitset>
#include <vector>
#include <string>

using namespace std;

void solution() {
    int n, ans = 0;
    string s;
    cin >> n >> s;
    for (int i = 2; i < s.size(); i++) {
        if (s[i] == 'C' && s[i - 1] == 'B' && s[i - 2] == 'A') {
            ans++;
        }
    }
    cout << ans << endl;
}

/*-------------------*/

int main()
{
#ifdef Files
    freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    /*Test*/
    //freopen("input.txt", "w", stdout);

    double OcZ2X = clock();
#else
    //freopen("joke.in", "r", stdin);
    //freopen("joke.out", "w", stdout);
#endif

    solution();

#ifdef Time
    double P2HxQ = clock();
    printf("\n*** Total time = %.3f sec ***\n", (P2HxQ - OcZ2X) / CLOCKS_PER_SEC);
#endif
}

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

void solve(long long N, long long K, std::string S)
{
    S[K - 1] += ('a' - 'A');
    cout << S << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main()
{
    long long N;
    scanf("%lld", &N);
    long long K;
    scanf("%lld", &K);
    std::string S;
    std::cin >> S;
    solve(N, K, S);
    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<string>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;

char c[110];
int cnt[27];

int main()
{
	//fuck
	scanf("%s",c);
	int n=strlen(c);
	for(int i=0;i<n;i++)
	{
		cnt[c[i]-'a']++;
	}
	for(int i=0;i<26;i++)
	{
		if(cnt[i]&1)
		{
			puts("No");
			return 0;
		}
	}
	puts("Yes");
}

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

typedef long long ll;
const int MOD= 998244353;

struct modint {
    int val;
    modint inv() const{
        int tmp,a=val,b=MOD,x=1,y=0;
        while(b)tmp=a/b,a-=tmp*b,swap(a,b),x-=tmp*y,swap(x,y);
        return modint(x);
    }
public:
    modint():val(0){}
    modint(ll x){if((val=x%MOD)<0)val+=MOD;}
    modint pow(ll t){modint res=1,b=*this; while(t){if(t&1)res*=b;b*=b;t>>=1;}return res;}
    modint& operator+=(const modint& x){if((val+=x.val)>=MOD)val-=MOD;return *this;}
    modint& operator-=(const modint& x){if((val+=MOD-x.val)>=MOD)val-=MOD; return *this;}
    modint& operator*=(const modint& x){val=(ll)val*x.val%MOD; return *this;}
    modint& operator/=(const modint& x){return *this*=x.inv();}
    bool operator==(const modint& x) const{return val==x.val;}
    bool operator!=(const modint& x) const{return val!=x.val;}
    bool operator<(const modint& x) const{return val<x.val;}
    bool operator<=(const modint& x) const{return val<=x.val;}
    bool operator>(const modint& x) const{return val>x.val;}
    bool operator>=(const modint& x) const{return val>=x.val;}
    modint operator+(const modint& x) const{return modint(*this)+=x;}
    modint operator-(const modint& x) const{return modint(*this)-=x;}
    modint operator*(const modint& x) const{return modint(*this)*=x;}
    modint operator/(const modint& x) const{return modint(*this)/=x;}
};

struct factorial {
    vector<modint> Fact, Finv;
public:
    factorial(int _n): Fact(_n+1), Finv(_n+1) {
        Fact[0]=modint(1); for (int i = 0; i < _n; ++i) Fact[i+1]=Fact[i]*(i+1);
        Finv[_n]=modint(1)/Fact[_n]; for (int i = _n; i > 0; --i) Finv[i-1]=Finv[i]*i;
    }
    modint fact(int n,bool inv=0) { if (inv) return Finv[n]; else return Fact[n]; }
    modint nPr(int n,int r){ if (n<0||n<r||r<0) return modint(0); else return Fact[n]*Finv[n-r]; }
    modint nCr(int n,int r){ if (n<0||n<r||r<0) return modint(0); else return Fact[n]*Finv[r]*Finv[n-r]; }
};

int main() {
  ll n, a, b, k;
  cin >> n >> a >> b >> k;
  factorial fact(1000010);
  modint ans(0);
  for (ll i = 0; i <= n; ++i) { 
    if (i*a > k) continue;
    if ((k-i*a) % b > 0) continue;
    ll j = (k-i*a)/b;
    // cout << i << " " << a << " " << j << " " << b << endl;
    ans += fact.nCr(n, i)*fact.nCr(n, j);
  }
  cout << ans.val << endl;
  // // 6C3 % (1e9+7) = 20
  // cout << "6C3: " << fact.nCr(6,3).val << endl;
  // // 666C390 % (1e9+7) = 9951876
  // cout << "666C390: " << fact.nCr(666,390).val << endl;
}

Measured memory_bytes: 8192
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int r;
int main()
{
	scanf("%d",&r);
	if(r<1200)
		printf("ABC\n");
	if(1200<=r&&r<2800)
		printf("ARC\n");
	if(2800<=r)
		printf("AGC\n");
	return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <climits>
#include <cmath>
#include <iostream>
#include <unordered_map>
#include <vector>

const int mod = 1e9 + 7;

int main()
{
    int n;
    std::cin >> n;

    std::unordered_map<int, int> having;
    for (int i = 0; i < n; i++) {
        int temp;
        std::cin >> temp;

        having[temp]++;
    }

    int m;
    std::cin >> m;

    std::unordered_map<int, int> needed;
    for (int i = 0; i < m; i++) {
        int temp;
        std::cin >> temp;

        needed[temp]++;
    }

    for (auto i = needed.begin(); i != needed.end(); i++) {
        if (having[i->first] < i->second) {
            std::cout << "NO" << std::endl;
            return 0;
        }
    }
    std::cout << "YES" << std::endl;
}


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

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    int ans = a[n-1];
    rep(i,n-1){
        ans = __gcd(ans,a[i]);
    }
    cout << ans << endl;
}


Measured memory_bytes: 640
'use strict';
console.log(function(args){
  const tmp = args.trim().split('\n').map( r=>r.split(' ').map(v=>v|0) );
  const N = tmp[0][0];
  const A = tmp[1].sort((a,b)=>a-b);
  const B = tmp[2];
  const C = tmp[3].sort((a,b)=>a-b);
  let count = 0;
  for ( let i = 0; i < N; i++ ) {
    let a = -1, a_ = N;
    while ( a_ - a > 1 ) {
      const m = parseInt( a + ( a_ - a ) / 2, 10);
      if ( A[m] >= B[i] ) a_ = m;
      else a = m;
    }
    let c_ = -1, c = N;
    while ( c - c_ > 1 ) {
      const m = parseInt( c_ + ( c - c_ ) / 2, 10);
      if ( C[m] > B[i] ) c = m;
      else c_ = m;
    }
    count += (a+1)*(N-c);
  }
  return count.toString();
}(require('fs').readFileSync('/dev/stdin', 'utf8')));


Measured memory_bytes: 59768
c = [list(map(int, input().split())) for _ in range(3)]
row = []
col = []

for i in range(3):
    row.append(sum(c[i])%3)

for i in range(3):
    tmp = 0
    for j in range(3):
        tmp += c[j][i]
    col.append(tmp%3)

if len(set(row)) == 1 and len(set(col)) == 1:
    print("Yes")
else:
    print("No")



Measured memory_bytes: 3064
#include <iostream>
using namespace std;
const string a[]={"","MON","TUE","WED","THU","FRI","SAT"};
int main()
{
    string s;
    int t;
    cin>>s;
    if(s=="SUN")
    {
    	cout<<7;
    	return 0;
	} 
    for(int i=1;;++i)
    {
    	if(a[i]==s)
    	{
    		cout<<7-i;
    		return 0;
		}
	}
}

Measured memory_bytes: 256
def d_rectangles(MOD=10**9 + 7):
    N, M = [int(i) for i in input().split()]
    X = [int(i) for i in input().split()]
    Y = [int(i) for i in input().split()]

    ans1 = sum([x * (2 * k - N - 1) for k, x in enumerate(X, 1)])
    ans2 = sum([y * (2 * k - M - 1) for k, y in enumerate(Y, 1)])
    return (ans1 * ans2) % MOD

print(d_rectangles())

Measured memory_bytes: 19648
import sys
def LI(): return [int(x) for x in sys.stdin.readline().split()]
 
N,K = LI()
p = []
for i in range(N):
    a,b = LI()
    p.append((a,b))
sx = sorted(p)
ans = 10**50
for x,y in sx:
    for x2,y2 in sx:
        if x2 <= x:
            continue
        points = sx.index((x2,y2)) - sx.index((x,y)) + 1
        if points < K:
            continue
        sy = sorted(sx[sx.index((x,y)):sx.index((x2,y2))+1],key=lambda coor: coor[1])
        for j in range(len(sy)-K, -1, -1):
            if sy[j][1] <= y and y2 <= sy[j+K-1][1]:
                ans = min(ans, (x2 - x) * (sy[j+K-1][1]-sy[j][1])) 
print(ans)

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

#define ll          long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define rep(i,a,b)  for(int i=a;i<b;i++)
using namespace std;

int main(){
	cin.tie(NULL);
	ios::sync_with_stdio(false);
	//insert code
	int n;
	cin>>n;
	vector<double>p(n+1);
	p[0]=0;
	rep(i,1,n+1)cin>>p[i];
	double dp[n+1][n+1];
	memset(dp,0.0,sizeof(dp));
	dp[0][0]=1;
	for (int i=1;i<=n;i++){
		for (int j=0;j<=i;j++){
			if (j==0)dp[i][j]=dp[i-1][j]*(1-p[i]);
			else dp[i][j]=dp[i-1][j-1]*p[i]+dp[i-1][j]*(1-p[i]);
		}
	}
	double ans=0.0;
	for (int i=(n+1)/2;i<=n;i++)ans+=dp[n][i];
	cout<<setprecision(9)<<ans<<endl;
	return 0;
}

Measured memory_bytes: 70656
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            sb.append("x");
        }
        System.out.println(sb);
        sc.close();
    }
}


Measured memory_bytes: 35760
// Solid <candgenesis>
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define fs first
#define sc second
using namespace std;
const ll N = 1e6 + 4;
const ll inf = 1e9 + 7;
const ll inc = 3e5;
typedef pair<ll,ll> LL;

ll n,a[N],i,bit[N],d[N],total,maxx;
void upd(ll p,ll val){
    for (ll i = p;i < N;i += i & -i) bit[i] += val;
}
ll Get(ll p){
    ll res = 0;
    for (ll i = p;i > 0;i -= i & -i) res += bit[i];
    return res;
}
ll cal(ll m){
    ll cnt = 0;
    memset(bit,0,sizeof(bit)); memset(d,0,sizeof(d));
    upd(inc,1);
    for (i = 1;i <= n;i++){
        d[i] = d[i - 1];
        if (a[i] >= m) d[i]++;
        ll p = 2*d[i] - i + inc;
        cnt += Get(p); upd(p,1);
    }
    return cnt;
}
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    #define task "tst"
    if (fopen(task".inp", "r")){
        freopen(task".inp", "r", stdin);
        //freopen(task".out", "w", stdout);
    }
    cin>>n; total = n*(n + 1)/2; total = ceil((ld)total/2);
    for (i = 1;i <= n;i++) cin>>a[i],maxx = max(a[i],maxx);
    ll l,m,h;
    l = 1; h = maxx;
    //cout<<cal(10); return 0;
    while(l <= h){
        m = (l + h)/2;
        if (cal(m) < total) h = m - 1;
        else l = m + 1;
    }
    cout<<h;
}


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

int main(int argc, const char * argv[]) {
  long long int Q, H, S, D;
  long long int N;
  long long int result = 0;
  cin>>Q>>H>>S>>D;
  cin>>N;
  bool qf,hf,sf,df;
  qf = true;
  hf = true;
  sf = true;
  df = true;

  H = min(Q * 2, H);
  S = min(H * 2, S);
  D = min(S * 2, D);
  if (N % 2 == 0) {
    result = result + N / 2 * D;
  }
  else {
    result = result + N / 2 * D + N % 2 * S;
  
  }
  cout<< result<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using P = pair<int, int>;
using vec = vector<int>;
using mat = vector<vector<int>>;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define endl "\n"

constexpr int MOD = 1000000007;
const int INF = 1 << 30;

int main() {
    int n;
    cin >> n;
    vec a(n);
    rep(i, n) cin >> a[i];

    lint s = accumulate(all(a), 0LL);

    lint s_odd = 0, s_even = 0;
    rep(i, (n+1)/2) {
        s_even += 2 * a[(2 * i) % n];
        s_odd += 2 * a[(1 + 2 * i) % n];
    }

    vec b(n);

    rep(i, n) {
        lint s2 = 0;

        if (i >= 2) {
            if (i % 2 == 0) {
                s_even -= 2 * a[i-2];
                s_even += 2 * a[i-1];
            }
            else {
                s_odd -= 2 * a[i-2];
                s_odd += 2 * a[i-1];
            }
        }

        if (i % 2 == 0) s2 = s_even;
        else s2 = s_odd;

        s2 -= s;
        b[i] = s2;
    }

    rep(i, n) {
        if (i != 0) cout << " ";
        cout << b[i];
    }    
    cout << endl;
    return 0;
}

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

using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  int n;
  vector<int> a(3);
  cin >> n;
  vector<int> dp(3);
  cin >> dp[0] >> dp[1] >> dp[2];


  for (int i = 0; i < n - 1; ++i) {
    vector<int> newdp(3);
    cin >> a[0] >> a[1] >> a[2];

    for (int j = 0; j < 3; ++j) {
      for (int k = 0; k < 3; ++k) {
        if (j != k) {
          newdp[k] = max(newdp[k], dp[j] + a[k]);
        }
      }
    }

    swap(newdp, dp);
  }

  cout << *max_element(dp.begin(), dp.end());

  return 0;
}


Measured memory_bytes: 256
/**
 *   Author: Praveen Ojha
 *   Created: 27 January 2019
 *   Time: 01:54:31
**/
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define PI 3.141592653589793238510
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pii;
ll dp[101][100005];
int main(){
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
    ll n,W;
    cin>>n>>W;
    ll val[n],wei[n];
    for(ll i=0;i<n;i++)
    	cin>>wei[i]>>val[i];
    for(ll i=0;i<n;i++){
    	for(ll w=0;w<=W;w++){
    		if(i==0 && w>=wei[i]){
    			dp[i][w]=val[i];
    		}
    		else{
    			if(i>0){
    			if(w-wei[i]>=0){
    				//cout<<val[i]+dp[i-1][w-wei[i]]<<" "<<i-1<<" "<<w-wei[i]<<"\n";
    				dp[i][w]=max(dp[i-1][w],val[i]+dp[i-1][w-wei[i]]);
    			}
    			else{
    				dp[i][w]=dp[i-1][w];
    			}
    		}
    		}
    	}
    }
    cout<<dp[n-1][W]<<"\n";
return 0;
}

Measured memory_bytes: 78336
#include<bits/stdc++.h>
using namespace std;
const int N=12,INF=0x3f3f3f3f;
int n,m,q,step[N],ans,w[N][N][N],a,b,c,d;
void dfs(int x,int v,int sum){
    if(x==n+1){
        ans=max(ans,sum);
        return;
    }
    int now;
    for(int i=v;i<=m;++i){
        step[x+1]=i;
        now=sum;
        for(int j=1;j<=x;++j){
            now+=w[j][x+1][step[x+1]-step[j]];
        }
        dfs(x+1,i,now);
    }
}
int main(){
    scanf("%d%d%d",&n,&m,&q);
    for(int i=1;i<=q;++i){
        scanf("%d%d%d%d",&a,&b,&c,&d);
        w[a][b][c]=d;
    }
    dfs(0,1,0);
    printf("%d\n",ans);
    return 0;
}


Measured memory_bytes: 3776
N, K = list(map(int, input().split()))
h = list(map(int, input().split()))

dp = [0 for i in range(N)]
nextdp = [[0 for i in range(K)] for j in range(N)]

for i in range(N - 1):
    if 0 < i < K:
        dp[i] = min(nextdp[i][0:i])
    else:
        dp[i] = min(nextdp[i])
    for j in range(K):
        if i + j + 1 < N:
            nextdp[i + j + 1][j] = dp[i] + abs(h[i + j + 1] - h[i])
if N - 1 < K:
    dp[N - 1] = min(nextdp[N - 1][0:N - 1])
else:
    dp[N - 1] = min(nextdp[N - 1])
print(dp[N - 1])


Measured memory_bytes: 131340
#include <stdio.h>

int main(void)
{
	int train;
	int a[10];
	int i;

	for (i = 0; i < 10; i++){
		a[i] = 0;
	}

	while (scanf("%d", &train) != EOF){
		if (train){
			for (i = 0; i < 10; i++){
				if (a[i] == 0){
					a[i] = train;
					break;
				}
			}
		}
		else {
			for (i = 9; i >= 0; i--){
				if (a[i] != 0){
					printf("%d\n", a[i]);
					a[i] = 0;
					break;
				}
			}
		}
	}

	return (0);
}

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

int main(){
    long long sx, sy, tx, ty;
    cin >> sx >> sy >> tx >> ty;

    for(long long i = 0; i < ty-sy; i++){
        printf("U");
    }
    for(long long i = 0; i < tx-sx; i++){
        printf("R");
    }
    for(long long i = 0; i < ty-sy; i++){
        printf("D");
    }
    for(long long i = 0; i < tx-sx+1; i++){
        printf("L");
    }
    for(long long i = 0; i < ty-sy+1; i++){
        printf("U");
    }
    for(long long i = 0; i < tx-sx+1; i++){
        printf("R");
    }
    printf("D");
    printf("R");
    for(long long i = 0; i < ty-sy+1; i++){
        printf("D");
    }
    for(long long i = 0; i < tx-sx+1; i++){
        printf("L");
    }
    printf("U\n");


    return 0;

}

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

using ll = long long;
using vll = vector<ll>;
using pl4 = pair<ll,ll>;
using str = string;
using vpl4 = vector<pair<ll,ll>>;

#define sz size()
#define be begin()
#define en end()
#define fi first
#define se second
#define pb push_back
#define mp make_pair

#define llin(x) ll (x);cin >>(x);
#define stin(x) str (x);cin >>(x);
#define FOR(i,a,b) for(ll i = a ; i <= b ; i++)
#define rFOR(i,b,a) for(ll i = a; i >= b ; i--)
#define SORT(x) sort(x.be, x.en)
#define rSORT(x) sort(x.rbegin(), x.rend())
#define say(x) cout<<(x);
#define sal(x) cout<<(x)<<endl;
#define yn(a) cout <<((a)?"yes":"no")<<endl;
#define Yn(a) cout <<((a)?"Yes":"No")<<endl;
#define YN(a) cout <<((a)?"YES":"NO")<<endl;
#define Imp(a) cout <<((a)?"Possible":"Impossible")<<endl;
#define IMP(a) cout <<((a)?"POSSIBLE":"IMPOSSIBLE")<<endl;
#define pow(a,b) ll(pow(a,b))

ll MOD=1000000007;

signed main(){
    llin(n);
    vll a(n);
    vll b(n);
    vll c(n);
    FOR(i,0,n-1){
        cin >>a[i];
    }
    FOR(i,0,n-1){
        cin >>b[i];
    }
    FOR(i,0,n-2){
        cin >>c[i];
    }
    ll k=b[a[0]-1];
    FOR(i,1,n-1){
        k+=b[a[i]-1];
        if(a[i]==a[i-1]+1){
            k+=c[a[i-1]-1];
        }
    }
    sal(k)
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define MAXN 100005
using namespace std;
int x,y;
int gcd(int a,int b)
{
	if(b==0) return a;
	return gcd(b,a%b);
}
int main()
{
	scanf("%d%d",&x,&y);
	if(gcd(x,y)==y)
	{
		printf("-1\n");
		return 0;
	}
	printf("%d\n",x);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;typedef long long ll;typedef string str;
typedef vector<str> vst;
typedef vector<ll> vll;
int main(){
  ll n,a1,a2,a3;
  cin>>n;
  for (ll a=1;a<=3500;a++) {
    for (ll b=1;b<=3500;b++) {
      ll Y=4*a*b-n*(a+b);
      if (Y==0) continue;
      if ((n*a*b)%Y==0 && 0<(n*a*b)/Y && (n*a*b)/Y<=3500) {
        a1=a;
        a2=b;
        a3=(n*a*b)/Y;
        break;
      }
    }
  }
  cout<<a1<<' '<<a2<<' '<<a3<<endl;
}

Measured memory_bytes: 256
function Main(input) {
  input=input.split("\n");
  const D=input[0].split(' ')[1]-0;
  var ans=0;
  for(var i=1;i<input.length;i++){
    if(input[i].split(' ')[0]**2+input[i].split(' ')[1]**2<=D**2){
      ans++;
    }
  }
  console.log(ans);
}


//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
  



  


Measured memory_bytes: 62344
import java.util.Scanner;

public class Main implements Runnable {

    private static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Thread(null, new Main(), "", 128 * 1024 * 1024).start();
    }

    public void run() {
        long n = sc.nextInt(), k = sc.nextInt();
        long count = 0L;
        if (k == 0) {
            count = n * n;
        } else {
            for (long b = k + 1; b <= n; b++) {
                long rep = n / b;
                long repK = rep * Math.max(b - k, 0);
                long mod = n % b;
                long modK = Math.max(mod - k + 1, 0);
                count += repK + modK;
            }
        }
        System.out.println(count);
    }
}

Measured memory_bytes: 23892
r, c = map(int, input().split())
m = [list(map(int, input().split())) for _ in range(r)]

for i in range(r):
    l = m[i]
    l.append(sum(l))
    print(' '.join(map(str, l)))

ll = []
for k in range(c+1):
    s = 0
    for j in range(r):
        s += m[j][k]
    ll.append(s)
print(' '.join(map(str, ll)))


Measured memory_bytes: 5700
import sys
input = sys.stdin.readline

h,w =map(int,input().split())
a = [tuple(map(int,input().split())) for _ in [0]*h]
b = [tuple(map(int,input().split())) for _ in [0]*h]


mid = 1<<(80*160)
dp = [[0]*w for _ in [0]*h]

for i in range(h):
    for j in range(w):
        diff = abs(a[i][j]-b[i][j])
        new = 0
        if i > 0:
            new |= dp[i-1][j]
        if j > 0:
            new |= dp[i][j-1]
        if (i,j) == (0,0):
            new = mid
        dp[i][j] = (new<<diff)|(new>>diff)


res = 10**9
p = dp[-1][-1]
for i in range(80*321):
    if p&1 == 1:
        res = min(res,abs(80*160-i))
    p = p>> 1
print(res)

Measured memory_bytes: 58844
#include <stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
    long n,m;
    scanf("%ld %ld", &n, &m);
    vector<long> vvippp(n);
    vector<long> vvipmp(n);
    vector<long> vvimpp(n);
    vector<long> vvimmp(n);
    for(long i = 0; i < n; i++){
        long x,y,z;
        scanf("%ld %ld %ld", &x, &y, &z);
        vvippp[i] = x + y + z;
        vvipmp[i] = x - y + z;
        vvimpp[i] = -x + y + z;
        vvimmp[i] = -x - y + z;        
    }
    
    sort(vvippp.begin(), vvippp.end());
    sort(vvipmp.begin(), vvipmp.end());
    sort(vvimpp.begin(), vvimpp.end());
    sort(vvimmp.begin(), vvimmp.end());
  
    long nAns = 0;
    long iSum = 0;
    for(long i = 0; i < m; i++){
        iSum += vvippp[i];
    }
    nAns = max(nAns, -iSum);
    iSum = 0;
    for(long i = 0; i < m; i++){
        iSum += vvippp[n - 1 - i];
    }
    nAns = max(nAns, iSum);
    iSum = 0;
    for(long i = 0; i < m; i++){
        iSum += vvipmp[i];
    }
    nAns = max(nAns, -iSum);
    iSum = 0;
    for(long i = 0; i < m; i++){
        iSum += vvipmp[n - 1 - i];
    }
    nAns = max(nAns, iSum);
    iSum = 0;
    for(long i = 0; i < m; i++){
        iSum += vvimpp[i];
    }
    nAns = max(nAns, -iSum);
    iSum = 0;
    for(long i = 0; i < m; i++){
        iSum += vvimpp[n - 1 - i];
    }
    nAns = max(nAns, iSum);
    iSum = 0;
    for(long i = 0; i < m; i++){
        iSum += vvimmp[i];
    }
    nAns = max(nAns, -iSum);
    iSum = 0;
    for(long i = 0; i < m; i++){
        iSum += vvimmp[n - 1 - i];
    }
    nAns = max(nAns, iSum);
    iSum = 0;
  
    printf("%ld", nAns);
    return 0;
}


Measured memory_bytes: 3224
import sys

sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():
    def main():
        N = int(input())
        L=[list(map(int,input().split())) for i in range(N)]

        L=sorted(L,key=lambda x: x[1])

        time=0
        for i in range(N):
            time+=L[i][0]
            if time > L[i][1]:
                return 'No'

        return 'Yes'

    print(main())


resolve()

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

int main(){
  int N, K , n;
  cin >> N >> K;
  n = 1;
  for(int i =0; i < N; i++){
    if(n > K){
      n += K;
    }
    else {
      n *= 2;
    }
 
  }
     cout << n << endl;
}
       
           

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>
#include <random>
#include <ctime>

using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 29;
const int MOD = 1e9 + 7;

int main() {
  int64 n;
  cin >> n;
  int64 k = 1;
  while (k * k <= n) ++k;
  --k;
  cout << k * k << endl;
  return 0;
}


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

int main(void){
  int m, nmin, nmax;
  int gap, ans, lower, p, i;
  while(1){
    cin >> m >> nmin >> nmax;
    if(m == 0) break;

    for(i=0;i<nmin - 1;i++) cin >> p;
    cin >> lower;
  
    ans = nmin;
    gap = 0;
    for(i=0;i<nmax - nmin + 1;i++){
      cin >> p;
      if(gap <= lower - p){
        gap = lower - p;
        ans = nmin + i;
      }
      lower = p;
    }
  
    for(i=0;i<m - nmax - 1;i++) cin >> p;

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


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

using namespace std;

bool comp(const string &a,const string &b){
	int i = 0;
	while(a[i] == b[i]){
		i++;
	}
	if(i == a.length()) return 0;
	return a[i] < b[i];
}
bool isvalidnum(const int money, vector<bool> hatenum){
	int m = money;
	int nownum;
	while(m>0){
		nownum = m%10;
		if (hatenum[nownum]) return false;
		m = (m-nownum)/10;
	}
	return true;
}

int main () {
	char X, Y;
	cin >> X >> Y;
	if((X-'A') > (Y-'A')) cout<< ">";
	else if((X-'A') < (Y-'A')) cout << "<";
	else cout << "=";


	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<math.h>
#include<stdlib.h>
#include<string>
using namespace std;
#define Fi(a,b) for(int i=a;i<b;i++)
#define Fj(a,b) for(int j=a;j<b;j++)
int main(){
    int n;
    cin>>n;
    string w[101];
    bool ans=true;
    Fi(0,n){
        cin>>w[i];
        Fj(0,i){
            if(w[i]==w[j]) ans=false;
        }
        if(i!=0&&w[i][0]!=w[i-1][w[i-1].length()-1]) ans=false;

    }
    if(ans)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}


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

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 

using namespace std;
using namespace __gnu_pbds; 

typedef long long int           ll;
typedef unsigned long long int  ull;
typedef long double             ld;

typedef pair<int, int>          pii;
typedef pair<ll,ll>             pll;
typedef vector<int>             vi;
typedef vector<ll>              vll;
typedef vector<pii>             vpii;
typedef vector<pll>             vpll;

#define test(t)		        int t; cin >> t; while(t--)
#define f(i, a, b)	        for(int (i) = (a); (i) < (b); ++(i))
#define all(a)		        (a).begin(), (a).end()
#define endl 		        "\n"
#define deb(x)		        cout << #x << ": " << x << endl;
#define deb2(x,y)	        cout << #x << ": " << x << " ~ " <<  #y << ": " << y << endl;
#define deba(arr)	        cout << #arr << " ~ [ "; for(auto n: arr) cout << n << " "; cout << "]" << endl;
#define debap(arr)	        cout << #arr << " ~ [ "; for(auto n: arr) cout << n.first << "-" << n.second << " "; cout << "]" << endl;
#define fast 		        ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

#define mx9		1000000007
#define mx7		10000007
#define mx6		1000006
#define mx5		200005
#define inf		1<<30                                 
#define eps		1e-9
#define mod		1000000007
#define PI		3.141592653589793238462643383279502884L

void solve()
{
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    // if(b > 0 && d > 0)
    // {
    //     cout << b * d << endl;
    // }
    // else if(b <= 0 && d <= 0)
    // {
    //     cout << a * c << endl;
    // }
    // else if(c < 0 && d < 0 && a > 0 && b > 0)
    // {
    //     cout << a * d << endl;
    // }
    // else if(a < 0 && b < 0 && c > 0 && d > 0)
    // {
    //     cout << b * c << endl;
    // }
    // else if(a < 0 && b > 0 && )
    // else
    // {
    //     cout << 0 << endl;
    // }
    if((a < 0 && b > 0) || (c < 0 && d > 0))
        cout << max({a * c, a * d, b * c, b * d, 0ll}) << endl;
    else
        cout << max({a * c, a * d, b * c, b * d}) << endl;
}

int main()
{
    fast;
    // test(t)
        solve();
    return 0;
}

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

long long int gcd(long long int a, long long int b){
    return b ? gcd(b,a%b) : a;
}

ll ngcd(VLL a){
    ll res;
    res = a[0];
    for(int i=1; i< a.size() && res != 1; i++){
        res = gcd(a[i],res);
    }
    return res;
}

int main(){
    ll n, x;
    cin >> n >> x;
    VLL a;
    a.push_back(x);
    rep(i,n){
        ll t;
        cin >> t;
        a.push_back(t); 
    }

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

    VLL d(n);

    for(int i=1; i<n+1; ++i){
        d.push_back(a[i] - a[i-1]);
    }

    ll ans = ngcd(d);

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

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

int main() {

    long long K;
    cin >> K;


    int N = 50, r = K % N;
    long long a[50];
    for(int i = 0; i < N; i++) {
        if(i < r) a[i] = K / N + N * 2 - r;
        else a[i] = K / N + N - r - 1;
    }

    cout << N << endl;
    for(int i = 0; i < N - 1; i++) {
        cout << a[i] << " ";
    }
    cout << a[N - 1] << endl;
}


Measured memory_bytes: 256