akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<cmath>
#include<cstring>
#include<set>
#include<climits>
using namespace std;

#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define pb(b) push_back(b) 
#define all(a) a.begin(),a.end()
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define size(a,b) (a,vector<ll>(b))
const int mod=1e9+7;
/* 
UnionFind：素集合系管理の構造体(union by size)
isSame(x, y): x と y が同じ集合にいるか。 計算量はならし O(α(n))
unite(x, y): x と y を同じ集合にする。計算量はならし O(α(n))
treeSize(x): x を含む集合の要素数。
*/
struct UnionFind{
 vector<int>size,parents;
 UnionFind(){}
 UnionFind(int n){//make n trees.
  size.resize(n,0);
  parents.resize(n,0);
  for(int i=0;i<n;i++)makeTree(i);
 }
 void makeTree(int x){
   parents[x]=x;//the parent of x is x
   size[x]=1;
  }
 bool isSame(int x,int y){return findRoot(x)==findRoot(y);}
 bool unite(int x,int y){
  x = findRoot(x);
  y = findRoot(y);
  if(x==y)return false;
  if(size[x]>size[y]){
   parents[y]=x;
   size[x]+=size[y];
  } 
  else{
   parents[x]=y;
   size[y]+=size[x];
  }
  return true;
 }
 int findRoot(int x){//木の根を探す,計算量削減のため低く
  if(x!=parents[x])parents[x]=findRoot(parents[x]);
  return parents[x];
 }
 int treeSize(int x){return size[findRoot(x)];}
};
/*pi*/const double pi=acos(-1);
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*最小公倍数*/ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
/*n乗*/ll llpow(ll x,ll n){ll i,ans=1;rep(i,0,n)ans*=x;return ans;}
/*階乗*/ll fact(ll x){ll i,ans=1;rep(i,0,x)ans*=(x-i);return ans;}
/*nCr*/ll ncr(ll n,ll r){return fact(n)/fact(r)/fact(n-r);}
/*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);}
/*primejudge*/bool prime(ll a){if(a<=1)return false;ll i;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
/*Fibonacci数列*/ll fib(ll x){ll i,fibo[x+10];fibo[0]=1;fibo[1]=1;fibo[2]=1;rep(i,3,x+1)fibo[i]=fibo[i-1]+fibo[i-2];return fibo[x];}
/*桁数*/ll dig(ll n){ll d=0,tmp=n;while(tmp/10>0){tmp/=10;d++;}return d;}
/*迷路移動*/const int dx[4]={1,0,-1,0};const int dy[4]={0,1,0,-1};
llfor;////////////////////////////////////////////////////////////
int main(){
 string s;cin>>s;
  
 ll n=s.length();
 rep(i,0,n-1){
  if(s[i]=='A'&&s[i+1]=='C'){
   py;
   return 0;
  }
 }
 pn;
return 0;}

Measured memory_bytes: 3620
#include<stdio.h>
int main()
{
	long long int a,b,x;
	scanf("%lld %lld %lld",&a,&b,&x);
	long long int ans=b/x;
	ans-=a/x;
	if(a%x==0)
	  ans++;
	printf("%lld\n",ans);
	return 0;
}


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

int main(){
  int N;
  cin >> N;
  vector<int> vec(N);
  vector<int> vec_sort(N);
  for(int i=0; i<N; i++){
    cin >> vec.at(i);
    vec_sort.at(i) = vec.at(i);
  }
  sort(vec_sort.begin(),vec_sort.end());
  int x = vec_sort.at(N/2 -1);
  int y = vec_sort.at(N/2);
  
  for(int i=0; i<N; i++){
    if(vec.at(i) <= x){
      cout << y << endl;
    }
    else{
      cout << x << endl;
    }
  }
  
}

Measured memory_bytes: 3712
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int num = n % 10;
        if(num == 3){
            System.out.println("bon");
        }else if(num == 0 || num == 1 || num == 6 || num == 8){
            System.out.println("pon");
        }else{
            System.out.println("hon");
        }
    }
}

Measured memory_bytes: 35868
(function() {
    'use strict';

    var lines = [];
    require('readline').createInterface({
      input: process.stdin,
      output: process.stdout
    }).on('line', function(line) {
      lines.push(line);
    });
    process.stdin.on('end', function() {
      //lines.forEach(function(line) {
        //var tokens = line.split(' ').map(Number);
        //    console.log(tokens[0] + ' ' + tokens[1]);
      //}
      //)
      ;

    // ToDo start
      var inLines = lines[0]
      var flg = '0'
      for ( var i=0;i<inLines.length-2;i++){
        if(     inLines[i]   == inLines[i+1]
             && inLines[i+1] == inLines[i+2] ){
                 flg = '1'
                 break;
             }
      }

      if( flg == '1'){
          console.log("Yes")
      } else {
        console.log("No")
      }

      
//      console.log( Math.pow(parseInt(lines[0]),2) - parseInt(lines[1])  )
    // ToDo end

    });


})();



Measured memory_bytes: 7880
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[]A = new int[N];
		for(int i = 0; i < N; i++) {
			A[i] = sc.nextInt();
		}
		sc.close();
		boolean flag = true;
		int cnt = 0;
		while(flag) {
			for(int i = 0; i < N; i++) {
				if(A[i] % 2 == 0) {
					A[i] /= 2;
				}else {
					flag = false;
				}
			}
			if(flag) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
}

Measured memory_bytes: 22356
#include <algorithm>
#include <bits/stdc++.h>
#include<iostream>
#include<string>
using namespace std;
#define rep(i, n) for (int i = 0; i <(int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define ll long long
const ll MOD=100000007;
const ll INF=1000000101001;
int main(){
    int n;cin >> n;
 string s,t;cin>>s>>t;
 string st=s+t;
 rep(i,2*n){
    if(i%2==0)st[i]=s[i/2];
    if(i%2!=0)st[i]=t[i/2];
 }
 cout << st << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define endl '\n'
#define pii pair<ll, ll>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
#define traceloop(x,a) {for(ll i=0;i<x;i++) cerr<<a[i]<<" "; cerr<<endl;}
ll ab(ll x) {return x>0LL?x:-x;}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    ll k,x;
    cin>>k>>x;
    for(int i= x-k+1; i<x+k; i++)
        if(i<-1000000 || i>1000000)
            continue;
        else
            cout<<i<<" ";
    return 0;
}
    

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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int N;
int A[202020];
int cnt[202020];
ll mo=1000000007;
ll D[202020];
ll Z[202020];

template<class V, int ME> class BIT {
public:
	V bit[1<<ME];
	V operator()(int e) {if(e<0) return 0;V s=0;e++;while(e) s+=bit[e-1],e-=e&-e; return s%mo;}
	void add(int e,V v) { e++; while(e<=1<<ME) bit[e-1]+=v,e+=e&-e;}
};
BIT<ll,20> num,ds,dr;


ll modpow(ll a, ll n = mo-2) {
	ll r=1;a%=mo;
	while(n) r=r*((n%2)?a:1)%mo,a=a*a%mo,n>>=1;
	return r;
}

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N;
	FOR(i,N) {
		cin>>A[i];
		cnt[A[i]]++;
	}
	for(i=N;i>=1;i--) cnt[i]+=cnt[i+1];
	D[0]=1;
	ll S=1;
	for(i=1;i<=N;i++) {
		cnt[i]-=N-i;
		if(cnt[i]<=0) return _P("0\n");
		S=S*cnt[i]%mo;
		if(cnt[i]==1) {
			D[i]=D[i-1];
			Z[i]=Z[i-1]+1;
		}
		else {
			D[i]=D[i-1]*(cnt[i]-1)%mo*modpow(cnt[i])%mo;
			Z[i]=Z[i-1];
		}
	}
	
	
	ll ret=0;
	FOR(x,N) {
		
		y=lower_bound(Z+1,Z+N+1,Z[A[x]])-Z;
		(ret+=S*D[A[x]]%mo*(dr(A[x])-dr(y)+mo)%mo*((mo+1)/2))%=mo;
		(ret+=S*(x-num(A[x])))%=mo;
		y=lower_bound(Z+1,Z+N+1,Z[A[x]]+1)-Z-1;
		if(y>A[x]) (ret-=S*(ds(y)-ds(A[x])+mo)%mo*modpow(D[A[x]])%mo*((mo+1)/2))%=mo;
		ret=(ret%mo+mo)%mo;
		
		num.add(A[x],1);
		ds.add(A[x],D[A[x]]);
		dr.add(A[x],modpow(D[A[x]]));
	}
	
	cout<<ret<<endl;
	
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}



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

using namespace std;

using ll = long long;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll n, K;
    cin >> n >> K;
    ll ans = n;
    for (int i = 0; i < 100000; ++i) {
        if (n == 0) break;
        if (n >= K) n %= K;
        else n = K - n;
        ans = min(ans, n);
    }
    cout << ans << "\n";
    return 0;
}

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

vector< queue<int> > A(1000);
set<int> q, q2;

int main() {
  int64_t N;
  cin >> N;
  int64_t ans = 0;
  for( int i=0; i<N; ++i) {
    for( int j=0; j<N-1; ++j) {
      int ain;
      cin >> ain;
      A[i].emplace( --ain );
    }
    q.emplace(i);
  }

  int d = 0;
  while(1) {
//    cout << d << endl;
    int hit = 0;
//    cout << "- "; for( auto i: q ) cout << i << " "; cout << endl;

    while( !q.empty() ) {
      int i = *( q.begin() );
//      cout << i << ":";
      q.erase(i);
//      cout << "-- "; for( auto i: q ) cout << i << " "; cout << endl;
      int tgt = A[i].front();
//      cout << tgt << " " <<  A[tgt].front() <<endl;
      if( !A[tgt].empty() && A[tgt].front() == i && (q2.count(tgt)==0)) {
//        cout <<  "  Hit" << endl;
        A[i].pop();
        A[tgt].pop();
        q.erase(tgt);
//        cout << "-- "; for( auto i: q ) cout << i << " "; cout << endl;
        if ( !A[i].empty() ) q2.emplace(i);
        if ( !A[tgt].empty() ) q2.emplace(tgt);
//        for( auto aa: q2 ) cout << aa << ":" << endl;
        hit = 1;
      }
    }
    if ( hit == 0 ) {
      for( int i=0; i<N; ++i) {
        if ( !A[i].empty() ) {
          cout << "-1" << endl;
          return 0;
        }
      }
      break;
    }
    d++;
    q.clear();
    swap(q,q2);
    q2.clear();
  }

  cout << d << endl;

}


Measured memory_bytes: 6784
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;

/*BigInteger
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/rational.hpp>
namespace xxx = boost::multiprecision;
using Bint = xxx::cpp_int;
using Real = xxx::number<xxx::cpp_dec_float<1024>>;
*/

#define int long long
#define pb(x) push_back(x)
#define m0(x) memset((x), 0LL, sizeof(x))
#define mm(x) memset((x), -1LL, sizeof(x))

//container
#define ALL(x) (x).begin(), (x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define UNIQUE(v) (v).erase(unique((v).begin(), (v).end()), (v).end());
#define PERM(c) \
  sort(ALL(c)); \
  for (bool c##p = 1; c##p; c##p = next_permutation(ALL(c)))

// debug
#define GET_VAR_NAME(variable) #variable
#define test(x) cout << GET_VAR_NAME(x) << " = " << x << endl;

// bit_macro
#define Bit(n) (1LL << (n))
#define Bitset(a, b) (a) |= (1LL << (b))
#define Bitunset(a, b) (a) &= ~(1LL << (b))
#define Bitcheck(a, b) ((((a) >> (b)) & 1LL) == 1LL)
#define Bitcount(a) __builtin_popcountll((a))

//typedef
typedef long long lint;
typedef unsigned long long ull;
typedef complex<long double> Complex;
typedef pair<int, int> P;
typedef tuple<int, int, int> TP;
typedef vector<int> vec;
typedef vector<vec> mat;

//constant
constexpr int INF = (int)1e18;
constexpr int MOD = (int)1e9 + 7;
constexpr double PI = (double)acos(-1);
constexpr double EPS = (double)1e-10;
constexpr int dx[] = {-1, 0, 0, 1, 0, -1, -1, 1, 1};
constexpr int dy[] = {0, -1, 1, 0, 0, 1, -1, 1, -1};

//
template <typename T>
void chmax(T &a, T b) { a = max(a, b); }
template <typename T>
void chmin(T &a, T b) { a = min(a, b); }
//
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}

//
struct Accelerate_Cin {
  Accelerate_Cin() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(20);
  };
} Accelerate_Cin;

signed main() {
  string s;
  cin >> s;
  cout << s.substr(0, s.size() - 8) << endl;
  return 0;
}


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

using namespace std;
int main() {
    int A, B;
    cin >> A >> B;

    if((A + B) % 2 == 0) {
        cout << (A + B) / 2 << endl;
        ;
    } else {
        cout << "IMPOSSIBLE" << endl;
    }
}

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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pll;


const ll LongINF=1e13+7;
const int INF=1e9+7;
const int dx[]={0,1,0,-1};
const int dy[]={1,0,-1,0};

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template <class T, class Y>T GCD(T a, Y b){if(a<b){int c=a;a=b;b=c;}if (a % b == 0){return b;}return GCD(b, a % b);}
void clear(queue<pair<int, int>> &q){queue<pair<int, int>> empty;swap(q, empty);} //queueの中身の型は適時変更を忘れない

#define REP(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define rv reverse
#define ALL(a) (a).begin(),(a).end()


int main(){
    string A;
    cin>>A;
    string B=A;
    rv(B.begin(),B.end());
    int L=A.length()/2;

    int Co=0;
    rep(i,L){
        if(A[i]!=B[i])Co++;
    }
    cout<<Co<<endl;

    return 0;
}

//a=97,z=122

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

int main(){
    ll a, b;
    cin >> a >> b;
    if(a <= 0 && b >= 0){
        cout << "Zero" << endl;
    }
    else if(a > 0 && b > 0){
        cout << "Positive" << endl;
    }
    else{
        ll d = b-a;
        if(d%2==1){
            cout << "Positive" << endl;
        }
        else{
            cout << "Negative" << endl;
        }
    }
}

Measured memory_bytes: 256
main :: IO()
main = do
  x <- read <$> getLine
  putStrLn . solve $ x

solve :: Int -> String
solve x = if x > 25 || x < 22 then error "range out" else inSolve x []
  where
    inSolve :: Int -> [String] -> String
    inSolve 25 str = unwords $ "Christmas" : str
    inSolve x str = inSolve (x + 1) ("Eve" : str)


Measured memory_bytes: 508
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define ld long double
#define MOD 1000000007
#define endl "\n"
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(var) (var).begin(), (var).end()
#define MAXX 9000000000000000000
#define pii pair<int,int>
#define vi vector<int>
#define vvi vector<vector<int> >
#define vpi vector<pair<int,int> > 
#define vvpi vector<vector<pair<int,int> > >


int power(int x, int y, int p)  
{  
    int res = 1;   
    if (x == 0) 
    {
    	return 0; 
    }
  
    while (y > 0)  
    {  
        if (y & 1)
        {
            res = (res*x) % p;  
        }  
  
        y = y >> 1;
        x = (x*x) % p;  
    }  
    return res % p;  
}
int cnt[200005];

int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif

	int n,i,j,k,x,y;

	cnt[0] = 0;
	cnt[1] = 1;
	cnt[2] = 1;
	for(i=3;i<=200002;i++)
	{	
		x = i;
		y = 0;
		while(x)
		{
			if(x & 1)
			{
				y++;
			}
			x /= 2;
		}
		cnt[i] = 1 + cnt[i % y];
	}
		
	cin >> n;
	string s;
	cin >> s;
	x = 0;
	for(i=0;i<n;i++)
	{
		if(s[i] == '1')
		{
			x++;
		}
	}	

	int ca1= 0, ca2=0;
	for(i=n-1,j=1,k=1;i>=0;i--)
	{
		if(s[i] == '1')
		{
			ca1 += j;
			ca2 += k;
			ca1 %= max(1LL, (x-1));
			ca2 %= (x+1);
		}
		j *= 2;
		k *= 2;
		j %= max(1LL, (x-1));
		k %= (x+1);
	}

	// cout << x << endl;

	for(i=0;i<n;i++)
	{
		if(s[i] == '0')
		{
			int te = ca2;
			te += power(2, n-1-i, (x+1));
			// cout << 'a' << power(2, n-1-i, (x+1)) << endl;
			te %= (x+1);
			cout << 1 + cnt[te] << endl;
		}
		else
		{
			if(x-1 == 0)
			{
				cout << 0 << endl;
				continue;
			}
			int te = ca1;
			te -= power(2, n-1-i, (x-1));
			te += 100*(x-1);
			te %= (x-1);
			cout << 1 + cnt[te] << endl;
		}
	}


	return 0;
}

Measured memory_bytes: 5328
import java.io.PrintWriter
import java.util.*

val pw = PrintWriter(System.out)

fun main(args: Array<String>) {
    val x = readInt()
    val r = listOf(7,5,3)
    println(if(r.contains(x)) "YES" else "NO")
    pw.flush()
}

fun inputList() = 
    readLine()!!.split(" ").map(String::toInt)

fun sum_digits(num_: Long): Long {
    var num = num_
    var rtn: Long = 0
    while(num != 0.toLong()) {
        val tmp = num % 10
        rtn += tmp
        num /= 10
    }
    return rtn
}

/****** Decrared Functions ******/

// IO
fun read() = readLine()!!
fun readInt() = read().toInt()
fun readLong() = read().toLong()
fun readDouble() = read().toDouble()
fun readListOfString() = read().split(" ")
fun readListOfInt() = readListOfString().map { it.toInt() }
fun readListOfLong() = readListOfString().map { it.toLong() }
fun readListOfDouble() = readListOfString().map { it.toDouble() }


fun println(value : Any) {
    pw.println(value)
}

fun gcd(a: Long, b: Long): Long = 
    if(b != 0L) a else gcd(b, a % b)

fun lcm(a: Long, b: Long) = 
    if(b==0L) a else gcd(b, a % b)


Measured memory_bytes: 35828
#[allow(unused_imports)]
use std::cmp;
use std::io::Write;

// Input macro from https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
  (source = $s:expr, $($r:tt)*) => {
    let mut iter = $s.split_whitespace();
    input_inner!{iter, $($r)*}
  };
  ($($r:tt)*) => {
    let s = {
      use std::io::Read;
      let mut s = String::new();
      std::io::stdin().read_to_string(&mut s).unwrap();
      s
    };
    let mut iter = s.split_whitespace();
    input_inner!{iter, $($r)*}
  };
}

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

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

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

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

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

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

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

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

fn main() {
  let out = std::io::stdout();
  let mut out = std::io::BufWriter::new(out.lock());
  macro_rules! puts {
    ($($format:tt)*) => (write!(out,$($format)*).unwrap());
  }
  input! {
    n: i32,
  }
  let mut x = 0;
  while x < n {
    if x * 108 / 100 == n {
      break;
    }
    x += 1;
  }
  if x * 108 / 100 == n {
    puts!("{}\n", x);
  } else {
    puts!(":(\n");
  }
}


Measured memory_bytes: 4352
import scala.io.{StdIn => in}

object Main extends App {
  val Array(n, l) = in.readLine.split(" ").map(_.toInt)
  val total = (1 to n).map(i => l+i-1).sum

  val ans = (1 to n).map { i =>
      val v = (1 to n).filter(_ != i)./:(0)((acc, i) => acc + l+i-1)
      ((total - v).abs, v)
    }.minBy(_._1)._2

  println(ans)
}

Measured memory_bytes: 27332
#include<iostream>
#include<string>
#include<math.h>
#include<algorithm>
using namespace std;
int main(){
    int n,card[2000]={0},a,b,inc=0,inc1=0;
    int team1[1000],team2[1000],team3[1000];
    cin>>n;
    for(int i=1;i<=2*n;++i){
        card[i]=i;
    }
    cin>>b;
    for(int j=0;j<b;++j){
        cin>>a;
        switch(a){
        case 0: 
			inc=0;
			inc1=0;
			for(int i=1;i<=2*n;++i){
				team2[i]=card[i];
			}
			for(int i=1;i<=2*n;++i){
				if(i%2==0){
					++inc;
					card[i]=team2[n+inc];
				}
				else{
					++inc1;
					card[i]=team2[i-inc1+1];
				}
			}
			break;
        default:
			inc=0;
			inc1=0;
			for(int i=1;i<=2*n;++i){
				team2[i]=card[i];
			}
			for(int i=1;i<=2*n;++i){
				if(i<=a){
					++inc1;
				card[2*n-a+i]=team2[i];
				}
				else{
					++inc;
					card[inc]=team2[i];
				}
			}
			break;
        }
    }
	for(int i=1;i<=2*n;++i){
		cout<<card[i]<<endl;
	}
    return 0;
}

Measured memory_bytes: 3112
#include<bits/stdc++.h>
using namespace std;
#define inf 100000000000000000
#define ll long long int
#define pb push_back
#define f first
#define s second
#define mod 1000000007
#define fast ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
void mahakal(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	freopen("error.txt","w",stderr);
	#endif
}

int main(){
	//mahakal();fast;

	ll n , k , s;
	cin>>n>>k>>s;
	for(ll i=0;i<k;i++)cout<<s<<" ";
	for(ll i=k;i<n;i++){
		if(s==1000000000)cout<<1<<" ";
		else cout<<s+1<<" ";
	}
	return 0;
}

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

// main
int main(){
    int K, S; cin >> K >> S;
    int count = 0;
    for (int x = 0; x <= (K); ++x){
        for (int y = 0; y <= (K); ++y){
            int z = S - x - y;
            if(z >= 0 && z <= K){
                ++count;
            }
        }
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 256
import copy
class SegmentTree:
    def __init__(self, N, func, I):
        self.sz = N
        self.func = copy.deepcopy(func)
        self.I = I
        self.seg = [I for i in range(self.sz * 2)]
 
    def assign(self, k, x):
        self.seg[k + self.sz] = x
 
    def build(self):
        for i in range(self.sz - 1, 0, -1):
            self.seg[i] = self.func(self.seg[2 * i], self.seg[2 * i + 1])
 
    def update(self, k, x):
        k += self.sz
        self.seg[k] = x
        while k > 1:
            k //= 2
            self.seg[k] = self.func(self.seg[2 * k], self.seg[2 * k + 1])
 
    def query(self, a, b):
        L = self.I
        R = self.I
        a += self.sz
        b += self.sz
        while a < b:
            if a % 2 == 1:
                L = self.func(L, self.seg[a])
                a += 1
            if b % 2 == 1:
                b -= 1
                R = self.func(self.seg[b], R)
            a //= 2
            b //= 2
        return self.func(L, R)

def main():
    import sys
    read = sys.stdin.buffer.read
    readline = sys.stdin.buffer.readline
    from fractions import gcd
    N = int(readline())
    a = tuple(map(int,input().split()))
    seg = SegmentTree(N , gcd , 0)
    for i in range(N):
        seg.assign(i , a[i])
    seg.build()
    
    ans = 1
    for i in range(N):
        ans = max(ans,gcd(seg.query(0,i) , seg.query(i+1,N)))
    print(ans)

if __name__ == '__main__':
    main()

Measured memory_bytes: 98784
from itertools import accumulate
N = int(input())
S = input()

B, H = [0], [0]
for i, s in enumerate(S):
    if s == '.':
        H.append(1)
        B.append(0)
    else:
        H.append(0)
        B.append(1)

B, H = list(accumulate(B)), list(accumulate(H))
ans = float('inf')
for i in range(N + 1):
    ans = min(ans, B[i] + H[-1] - H[i])
print(ans)


Measured memory_bytes: 22544
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int x,y;
  cin>>x>>y;
  long long ans=0;
  if(abs(x)==abs(y))ans=0+(x==-y && x!=0)*1;
  else if(x>y)
  {
    ans+=abs(abs(x)-abs(y))-(x>=0 && y<=0) +2 ;
  }
  else if(x<y)
  {
    ans+=abs(abs(y)-abs(x))+(x<0 && y>0);
  }
  cout<<ans<<endl;
  return 0;
}
    

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

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

int main(){
  int n;
  int i;
  scanf("%d",&n);
  int a[n+100];
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
  }

  qsort(a,n,sizeof(int),cmp);
  printf("%d",a[n-1]-a[0]);

  return 0;
}


Measured memory_bytes: 128
import collections
n,s,m = map(int, raw_input().split(' '))
cc = collections.Counter()
cumul = 0
for _ in range(m):
	cc[int(raw_input()) - 1] += 1
	cumul += 1
for u in range(n):
	q = s
	q += cc[u] - cumul
	if q > 0:
		print 'Yes'	
	else:
		print 'No'


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

using namespace std;

const int MOD=1e9+7;

//const int MOD=998244353;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    
    int n,m;
    
    cin>>n>>m;
    vector<pair<long long,long long>> vp(n);
    for(auto&p:vp){
        long long x,y;
        cin>>x>>y;
        p.first=x;
        p.second=y;
    }
    sort(vp.begin(),vp.end());
    long long ans=0;
    int rem=m;
    for(int i=0; rem; i++){
        if(rem<=vp[i].second){
            ans+=rem*vp[i].first;
            rem=0;
        }
        else{
            ans+=vp[i].first*vp[i].second;
            rem-=vp[i].second;
        }
    }
    cout<<ans;
}

Measured memory_bytes: 1792
N = int(input())
L = list(map(int,input().split()))
M =sum(L)
a = 0
for i in range(N):
    a += L[i]
    if a >= M/2:
        print(min(abs(sum(L[i:])-sum(L[:i])),abs(sum(L[i-1:])-sum(L[:i-1])),abs(sum(L[i+1:])-sum(L[:i+1]))))
        break
    else:
        None

Measured memory_bytes: 3064
#include <stdio.h>

int main(int argc, const char * argv[]) {
    // insert code here...
    int W,H,i,j;
    
    while(1){
        scanf("%d %d",&H ,&W);
        if(W==0 && H==0){
            break;
        }
        for(i=1; i<=H; i++){
            for(j=1; j<=W; j++){
                if(j<W && i<H && j>1 && i>1){
                    printf(".");
                }else{
                    printf("#");
                }
            }
            printf("\n");
        }
        printf("\n");
    }
    return 0;
}


Measured memory_bytes: 2044
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	B
# CreatedDate:  2020-09-26 23:51:48 +0900
# LastModified: 2020-09-26 23:59:21 +0900
#


import os
import sys
# import numpy as np
# import pandas as pd


def main():
    N = int(input())
    A = list(map(int, input().split()))
    odd = 1
    for a in A:
        if a % 2 == 0:
            odd *= 2
        else:
            odd *= 1
    print(3**N-odd)

    



if __name__ == "__main__":
    main()


Measured memory_bytes: 9052
#include <stdio.h>

int d[101];

int main(void)
{
    int n;

    scanf("%d", &n);
    int i;
    for (i = 0;i < n;i++) {
        int index;
        scanf("%d", &index);
        d[index] = 1;
    }
    int ans = 0;
    for (i = 0;i < (sizeof(d) / sizeof(int));++i) {
        ans += d[i];
    }
    printf("%d\n", ans);
    return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<iomanip>
using namespace std;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
#define MOD 1000000007
#define LINF (long long)4e18
#define PI 3.1415926535

using ll = long long;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;



int main(){
  int N; cin >> N;
  vector<int> A(N+1);
  rep(i,N) cin >> A[i];
  A[N] = 0;
  vector<int> nums(N+2);
  rep(i,N+1){
    if(i == 0) nums[i+1] = nums[i] + abs(A[i]);
    else nums[i+1] = nums[i] + abs(A[i]-A[i-1]);
  }
  rep(i,N){
    int ans = 0;
    if(i == 0) ans = nums[N+1] - nums[i+2] - nums[i] + abs(A[i+1]);
    else ans = nums[N+1] - (nums[i+2] -nums[i]) + abs(A[i+1] - A[i-1]);
    cout << ans << endl;
  }
  

}
   

Measured memory_bytes: 2048
#include<bits/stdc++.h>
using namespace std;
 
int main(){
  string a = "";
  int j = 0;
  cin >> a;
  for(int i = 0; i < 3; i++){
    if(a[i] == '1')j++;
  }
  cout << j << endl;
  return 0;
}

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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

template<class A,class B>
ostream& operator<<(ostream& ost,const pair<A,B>&p){
	ost<<"{"<<p.first<<","<<p.second<<"}";
	return ost;
}

template<class T>
ostream& operator<<(ostream& ost,const vector<T>&v){
	ost<<"{";
	for(int i=0;i<v.size();i++){
		if(i)ost<<",";
		ost<<v[i];
	}
	ost<<"}";
	return ost;
}

const int INF=1001001001001001ll;

int N,M,L;

int D[333][333];
int U[333][333];

signed main(){
    cin>>N>>M>>L;
    fill_n(*D,333*333,INF);
    rep(i,N)D[i][i]=0;
    rep(i,M){
        int a,b,c;
        cin>>a>>b>>c;
        a--;b--;
        chmin(D[a][b],c);
        chmin(D[b][a],c);
    }
    rep(k,N)rep(i,N)rep(j,N)chmin(D[i][j],D[i][k]+D[k][j]);

    fill_n(*U,333*333,INF);
    rep(i,N)U[i][i]=0;
    rep(i,N)rep(j,N)if(D[i][j]<=L)chmin(U[i][j],1);
    rep(k,N)rep(i,N)rep(j,N)chmin(U[i][j],U[i][k]+U[k][j]);

    int Q;scanf("%lld",&Q);
    while(Q--){
        int s,t;
        scanf("%lld%lld",&s,&t);
        s--;t--;
        if(U[s][t]==INF)puts("-1");
        else printf("%lld\n",U[s][t]-1);
    }
    return 0;
}

Measured memory_bytes: 2304
#include<bits/stdc++.h>
#define ll                 long long int
#define mod                998244353
#define pi                 3.14159265358979323846264338327950288419716939937510
#define setbit(x)          __builtin_popcountll(x)
#define db                 long double
#define pp(x)              pair<x,x>
#define ff                 first
#define ss                 second
#define FIO                ios_base::sync_with_stdio(false); cin.tie(NULL);
#define tc                 ll tc; cin>>tc; for(ll number = 1 ; number <= tc ; number ++ )
#define vv(x)              vector<x>
#define pb                 push_back
#define pob                pop_back
#define pf                 push_front
#define pof                pop_front
#define endl               "\n"
#define pq                 priority_queue
#define dbg(x)             { cout<< #x << ": " << (x) << endl; }
#define dbg2(x,y)          { cout<< #x << ": " << (x) << " , " << #y << ": " << (y) << endl; }
#define bp                 ll kkk; cin >>kkk;
#define dbgArr(a,n)        cout<<"Array "<<#a<<endl; for(ll i=0 ; i<n ; i++) cout<<a[i]<<" "; cout<<endl;
#define maxE(a,n)          *max_element(a,a+n);
#define minE(a,n)          *min_element(a,a+n);
#define forn(i,s,n)        for(ll i=s ; i<n ; i++)
#define fornr(i,e,s)       for(ll i=e-1 ; i>=s ; i--)
#define arr1(a,n)          for(ll i=1;i<=n;i++){ cin>>a[i]; }
#define file freopen("input.txt","r",stdin); freopen("output.txt","w",stdout)
#define print cout<<"Case #"<<number<<": "
#define all(x) x.begin(), x.end()
ll power(ll x, ll b) {ll p = 1;while (b > 0) {if(b&1) {p = p * x; p %= mod;} b >>= 1; x *= x; x %= mod;} return p % mod;}
using namespace std;
# define INF 1e15

struct ppp{
    ll a,b,c;
};

struct lex_compare {
    bool operator() (ppp p1, ppp p2){
        if(p1.a == p2.a){
            if(p1.b == p2.b) return p1.c < p2.c;
            else return p1.b < p2.b;
        }else{
            return p1.a < p2.a;
        }
    }
};

ll arr[1000005] ;

int main(){
    FIO;
    ll n; cin >> n;
    memset(arr, 0, sizeof(arr));
    ll ans = 0;
    for(int i = 1;i<n;i++){
        ans += ((n-1)/i);
    }

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


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

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

    string S;
    vector<int> counter(26, INT_MAX);
    for (int i = 0; i < n; i++)
    {
        cin >> S;
        for (int j = 0; j < 26; j++)
        {
            counter[j] = min(counter[j], (int)count(S.begin(), S.end(), 'a' + j));
        }
    }

    string ans = "";
    for (int i = 0; i < 26; i++)
    {
        for (int j = 0; j < counter[i]; j++)
        {
            ans.push_back('a' + i);
        }
    }
    cout << ans << endl;
}


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

signed main(){
    int n, m;
    cin>>n>>m;
    
    int arr[m], s=0;
    
    for(int i=0; i<m; i++){
        cin>>arr[i];
        s+=arr[i];
    }
    
    int d=n-s;
    
    if(d<0) cout<<-1;
    else cout<<d;
    return 0; 
}

Measured memory_bytes: 3712
function Main(input) {
    lines=input.split("\n").slice(1);
    for(var i in lines){
	if(lines[i]=="")break;
	len=lines[i].split(" ").map(function(x){return x-0;});
	len.sort(function(a,b){return a-b;});
	console.log(len[0]*len[0]+len[1]*len[1]==len[2]*len[2] ? "YES":"NO");
    }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 10728
#include <stdio.h>
  
int abs(int n)
{
    if (n > 0) return (n);
      
    return (n * -1);
}
  
int max(int a, int b)
{
    a = abs(a);
    b = abs(b);
      
    if (a > b) return (a);
      
    return (b);
}
  
int main(void)
{
    int i;
    int n;
    int x[3], y[3];
    int t[2];
    int sum;
      
    scanf("%d %d %d", &t[0], &t[1], &n);
      
    x[0] = y[0] = 1;
    sum = 0;
    scanf("%d %d", &x[0], &y[0]);
    for (i = 0; i < n - 1; i++){
        scanf("%d %d", &x[1], &y[1]);
          
        x[2] = x[1] - x[0];
        y[2] = y[1] - y[0];
          
        if ((x[2] > 0 && y[2] > 0) || x[2] < 0 && y[2] < 0){
            sum += max(x[2], y[2]);
        }
        else {
            sum += abs(x[2]) + abs(y[2]);
        }
          
        x[0] = x[1];
        y[0] = y[1];
    }
      
    printf("%d\n", sum);
      
    return 0;
}


Measured memory_bytes: 2104
#include <iostream>
#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <functional>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <deque>
#include <stack>
#include <complex>
#include <cassert>
#include <random>
#include <cstring>
#include <numeric>
#define ll long long
#define ld long double
#define null NULL
#define all(a) a.begin(), a.end()
#define forn(i, n) for (int i = 0; i < n; ++i)
#define sz(a) (int)a.size()
#define lson l , m , rt << 1
#define rson m + 1 , r , rt << 1 | 1
template<class T> int gmax(T &a, T b) { if (b > a) { a = b; return 1; } return 0; }
template<class T> int gmin(T &a, T b) { if (b < a) { a = b; return 1; } return 0; }
using namespace std;
string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string) s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B>
string to_string(pair<A, B> p) { return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; }
template <typename A>
string to_string(A v) { bool first = true; string res = "{"; for (const auto &x : v) { if (!first) { res += ", "; } first = false; res += to_string(x); } res += "}"; return res; }
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) { cerr << " " << to_string(H); debug_out(T...); }
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

int main() {
    int n;
    while(~scanf("%d", &n)) {
        ll ans = 0;
        int tmp = n;
        for(int i = 1; i <= n - 1; ++i) {
            ans += i;
            // tmp --;
        }
        printf("%lld\n", ans);

    }
    return 0;
}

/*

3
3
*/

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <string>
#include <cmath>
#include <array>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <utility>
#include <iomanip>
#include <numeric>
#include <climits>
#include <algorithm>
#include <cstdint>
using namespace std;

int main()
{
    string str;
    cin >> str;

    for (int i = 0; i < str.length() - 1; i++)
        if (str[i] == str[i + 1])
        {
            cout << "Bad";
            return 0;
        }
    cout << "Good";
}

Measured memory_bytes: 3604
// ABC144D.cpp
//#include "pch.h"
#include <iostream>
#define _USE_MATH_DEFINES // M_PIを使う
#include <math.h> // M_PIを使う
//#include <cmath>
using namespace std;
int main()
{
	double a, b, x;
	cin >> a >> b >> x;
	double r;
	if (x<=a*a*b/2)
	{
		double wa = x / b / a *2;
		r = atan2(b, wa);
		r = r * (180 / M_PI);
	}
	else
	{
		double wb = 2 * (a*a*b - x) / (a*a);
		r = atan2(wb, a);
		r = r * (180 / M_PI);
	}
		printf("%.10f", r);
}

Measured memory_bytes: 256
import itertools
import numpy as np
n, m, x = map(int, input().split())
temp = [list(map(int, input().split())) for _ in range(n)]
ans = []
for li in itertools.product([0,1], repeat=n):
    cnt = 0
    check = np.zeros(m, np.int)
    for i in range(n):
        if li[i] == 1:
            check += np.array(temp[i][1:])
            cnt += temp[i][0]
    if min(check) >= x:
        ans.append(cnt)
print(min(ans) if len(ans) !=0 else -1)


Measured memory_bytes: 27228
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text.RegularExpressions;
using System.Diagnostics;
using static System.Math;

//var input = Console.ReadLine().Split().Select(int.Parse).ToArray();
namespace AtCoderSolve
{

    class Solve
    {
        const int mod = 1000000007;
        const int INF = 2147483647;
        const long SINF = 9223372036854775807;

        static int A,B,C,D,E,F;
       

        public static void Input()
        {
            var cin = new Solve();
            var input = cin.SplitReader();
            A = input[0];
            B = input[1];
            C = input[2];
            D = input[3];
            E = input[4];
            F = input[5];
        }

        static void Main(string[] args)
        {
            Input();
            //var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            //Console.SetOut(sw);

            int ans1 = 0;
            int ans2 = 0;
            double max = 0;
            List<int> mizu = new List<int>();
            List<int> sato = new List<int>();
            for (var i = 0; i <= F / (100 * A); i++) 
            {
                for (var j = 0; j <= F / 100 * B; j++) 
                {
                    if (i == 0 && j == 0) { continue; }
                    if (100 * i * A + 100 * j * B <= F) 
                    {
                        mizu.Add(100 * i * A + 100 * j * B);
                    }
                }
            }

            for (var i = 0; i <= F / C; i++) 
            {
                for (var j = 0; j <= F / D; j++) 
                {
                    
                    if (i * C + j * D <= F)
                    {
                        sato.Add(i * C + j * D);
                    }
                }
            }

            foreach(var x in mizu)
            {
                foreach(var y in sato)
                {
                    if (x + y <= F && y <= (x / 100) * E)
                    {
                        double c = (double)y / (x + y);
                        if (c >= max)
                        {
                            max = c;
                            ans1 = x + y;
                            ans2 = y;
                        }
                    }
                }
            }


            Console.WriteLine($"{ans1} {ans2}");

            //Console.Out.Flush();
        }

        public int[] SplitReader()
        {
            int[] array = Console.ReadLine().Split().Select(int.Parse).ToArray();
            return array;
        }
        public long[] SplitReaderL()
        {
            long[] array = Console.ReadLine().Split().Select(long.Parse).ToArray();
            return array;
        }

    }
}

    



Measured memory_bytes: 15200
#include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<(n); ++i)
#define repr(i, a, b) for (int i=a; i<(b); ++i)
#define reprev(i, n) for (int i=n-1; i>=0; --i)
#define reprrev(i, a, b) for (int i=b-1; i>=(a); --i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
    cout << fixed << setprecision(10);
    
    int h1, m1, h2, m2, k; cin >> h1 >> m1 >> h2 >> m2 >> k;
    cout << h2 * 60 + m2 - h1 * 60 - m1 - k << endl;
    return 0;
}

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

int main(){
	int a,b,c,x,d=0;
	cin>>a>>b>>c;
	
	for(x=a;x<=b;x++){
		if(c%x==0){
			d++;
		}
	}
	cout<<d<<endl;
	
	return 0;
}

Measured memory_bytes: 3104
#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <ctime>
#include <map>
#include <boost/multiprecision/cpp_int.hpp>

using namespace std;
using ll = long long;
namespace mp = boost::multiprecision;

struct Point{
    vector<ll> x;
};

int main()
{
    // 整数の入力
    long long N,D;
    vector<Point> points;
    set<ll> squares;
    cin >> N >> D;
    for(int i = 0;i<N;i++){
        Point p;
        for(int j = 0;j<D;j++){
            ll xj;
            cin >> xj;
            p.x.push_back(xj);
        }
        points.push_back(p);
    }

    for (int i = 0;i< 1000;i++){
        squares.insert(i*i);
    }

    ll counter = 0;
    for(int i = 0;i<N;i++){
        for(int j = i+1;j<N;j++){
            ll d = 0;
            for (int k = 0;k<D;k++){
                ll dd = (points[i].x[k] - points[j].x[k]);
                d += dd*dd;
            }
            if (squares.find(d) != squares.end()){
                counter++;
            }
        }
    }
    cout << counter << endl;

    return 0;
}

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

def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)

def main():
    num = num2alpha(n)
    print(num.lower())
    return
main()

Measured memory_bytes: 9188
N = int(input())
H = list(map(int, input().split()))
 
count = 0
for i, h in enumerate(H):
    if i == 0:
        count += 1
    elif i == 1:
        count += 1 if  H[1] >= H[0] else 0
    else:
        count += 1 if h >= max(H[:i]) else 0
print(count)

Measured memory_bytes: 3064
# -*- coding: utf-8 -*-
# 標準入力の取得
K = int(input())
A, B = list(map(int, input().split()))


def main() -> None:
    """Entry point
    """
    # 求解処理
    # A以上の最小のKの倍数とBを比較
    min_multiple = K * ((A // K) + (A % K != 0))
    result = ""
    if min_multiple <= B:
        result = "OK"
    else:
        result = "NG"

    # 結果出力
    print(result)


if __name__ == "__main__":
    main()


Measured memory_bytes: 9036
using System;
using System.Linq;
using static System.Console;

class P
{
    public static void Main()
    {
        long n = long.Parse(ReadLine());
        int i = 0;
        while (Math.Pow(2, i) <= n) { i++; }
        WriteLine(Math.Pow(2, i) - 1);
    }
}

Measured memory_bytes: 13140
// Original: https://github.com/tanakh/competitive-rs
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

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

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

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

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

#[allow(dead_code)]
fn chmin<T>(x: &mut T, y: T) -> bool
where
    T: PartialOrd + Copy,
{
    *x > y && {
        *x = y;
        true
    }
}

#[allow(dead_code)]
fn chmax<T>(x: &mut T, y: T) -> bool
where
    T: PartialOrd + Copy,
{
    *x < y && {
        *x = y;
        true
    }
}

#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, VecDeque};

fn main() {
    input!(n: usize, a: usize, b: usize);
    let ans = min(n * a, b);
    println!("{}", ans);
}


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

typedef long long ll;

int main()
{
    int n;
    cin>>n;
    getchar();
    string N[110];

    map<string,int>mp1;
    map<string,int>mp2;

    for(int i=1;i<=n;i++)
    {
        string s;
        cin>>s;
        N[i]=s;
        mp1[s]++;

    }
    int m;
    cin>>m;
    while(m--)
    {
        string s;
        cin>>s;
        mp1[s]--;
    }
    int res=0;
    for(int i=1;i<=n;i++)
    {
        string c=N[i];
        //cout<<mp1[c]<<" ";
        if(mp1[c]>res) res = mp1[c];
    }
    cout<<res<<endl;

}



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

S = input().strip()
n = len(S)


def check(S, n):
    if n % 2:
        for i in range((n - 1) // 2):
            if S[i] == S[n - 1 - i]:
                continue
            else:
                print('No')
                sys.exit()
    else:
        for i in range(n // 2):
            if S[i] == S[n - 1 - i]:
                continue
            else:
                print('No')
                sys.exit()


check(S, n)
check(S[:(n - 1) // 2], (n - 1) // 2)
check(S[(n + 3) // 2 - 1:], len(S[(n + 3) // 2 - 1:]))

print('Yes')


Measured memory_bytes: 3064