akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;

namespace AtCorder1
{
    class atcoder
    {
        static void Main(string[] args)
        {
            string[] all = Console.ReadLine().Split(' ');
            long N =    long.Parse(all[0]);
            long K = long.Parse(all[1]);

            long mod = N % K;
            long mod2 = K - mod;

            if (mod < mod2)
            {
                Console.WriteLine(mod); ;
            }
            else
            {
                Console.WriteLine(mod2);
            }
        }
    }
}

Measured memory_bytes: 11092
import std.stdio;
import std.algorithm;
import std.array;
import std.conv;
import std.datetime;
import std.numeric;
import std.math;
import std.string;

string my_readln() { return chomp(readln()); }

void main()
{
	auto tokens = my_readln().split();
	auto s = tokens[0].to!uint;
	
	auto used = new uint[](1000000);
	used[s] = 1;
	uint last = s, ans;
	foreach (i; 1..1000000)
	{
		if (last % 2 == 0)
		{
			last /= 2;
		}
		else
		{
			last = last * 3 + 1;
		}
		if (used[last] == 1)
		{
			ans = i + 1;
			break;
		}
		used[last] = 1;
	}

	writeln(ans);
	stdout.flush();
}

Measured memory_bytes: 6012
#!/usr/bin/env python3
import sys
input = sys.stdin.readline

n = input().rstrip()
a = [int(item) for item in input().split()]

max_height = 0
ans = 0
for item in a:
    ans += max(0, max_height - item)
    max_height = max(max_height, item)

print(ans)

Measured memory_bytes: 92052
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(),x.end()
#define rep(i,j,n) for (long long i = j; i < (long long)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 1000000007
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//name[i][j]-> vvl name(i,vl(j))
//map<int,int>mp
//余りを切り上げる =>  (a + b - 1) / b 

signed main(){
	int a,b,c; cin>>a>>b>>c;
	if(a+b+c>=22)cout<<"bust"<<endl;
	else cout<<"win"<<endl;
	
	return 0;
}

Measured memory_bytes: 3624
#include <algorithm>
#include <bitset>
#include <cmath>
#include <ctime>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define all(a) begin(a),end(a)
typedef long long ll;
typedef pair<int,int> P;
const int inf=1e+9;
const ll mod=1000000007;
const double PI=3.14159265358979323846;
int dx[] = {1,-1,0,0};
int dy[] = {0,0,1,-1};
ll gcd(ll a, ll b){
  if (b==0) return a;
  else return gcd(b,a%b);
}
int cans(bool f){
  if(f) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


int fac(int num) {
  if(num==1) return 1;
  else return num*fac(num-1);
}

int a[400000];
int b[400000];

int main() {
  int N;cin >> N;
  string s;cin >> s;
  for(int i=1; i<N; i++) {
    a[i] = a[i-1] + (s[i-1]=='W' ? 1 : 0);
  }
  for(int i=N-2; i>=0; i--) {
    b[i] = b[i+1] + (s[i+1]=='E' ? 1 : 0);
  }
  int ans = inf;
  rep(i,N) {
    ans = min(a[i] + b[i],ans);
  }
  cout << ans << endl;

  // rep(i,N) cout << a[i];
  // cout << endl;
  // rep(i,N) cout << b[i];
  // cout << endl;
  return 0;
}


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

typedef long long ll;
typedef long double ld;
typedef vector<ll> vi;
typedef pair<ll, ll> pii;
typedef vector<pii> vii;
typedef vector<vi> vvi;
const int MOD = 1e9 + 7;

#define fastIO \
ios_base::sync_with_stdio(false); cin.tie(nullptr);
#define endl '\n'
#define pb push_back
#define ff first
#define ss second
#define mp make_pair 

int main() {
    fastIO;
    int n;
    cin >> n;
    string s;
    cin >> s;
    
    vvi dp(n, vi(n)), psum(n, vi(n));
    dp[0][0] = 1;
    psum[0][0] = 1;
    for (int i = 1; i < n; i++) {
        for (int j = 0; j <= i; j++) {
            if (s[i - 1] == '<') {
                dp[i][j] = j > 0 ? psum[i - 1][j - 1] : 0;
                psum[i][j] = j > 0 ? (psum[i][j - 1] + dp[i][j]) % MOD : 0;
            } else {
                dp[i][j] = psum[i - 1][i - 1] - (j > 0 ? psum[i - 1][j - 1] : 0);
                psum[i][j] = j > 0 ? (psum[i][j - 1] + dp[i][j]) % MOD : dp[i][j];
            }
        }
    }
    ll ans = psum[n - 1][n - 1] % MOD;
    if (ans < 0)    ans += MOD;
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 141184
#include<bits/stdc++.h>
using namespace std;
#define For(i,n) for(long i=0;i<(n);i++)
long gcd(long a,long b){
    return b?gcd(b,a%b):a;
}
long n,m,ans=0;
int main(){
    cin>>n;
    vector<string> ato(n);
    vector<string> mae(n);
    For(i,n){
      string s;
      int t;
      cin>>s>>t;
      mae.at(i)=s+to_string(9999-t);
      ato.at(i)=s+to_string(9999-t);
      
    }
  sort(ato.begin(),ato.end());
  For(i,n){
    For(j,n){
      if(mae.at(j)==ato.at(i)){
        cout<<j+1<<endl;
        break;
      }
    }
  }
  

}


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

int main() {
  ll x,y;
  cin >> x >> y;
  ll cnt=0;
  while(x <= y){
    cnt++;
    x *= 2;
  }

  cout << cnt << endl;
  
  return(0);
}

Measured memory_bytes: 3584
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main{
  public static void main(String args[]) throws IOException{
   BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

   int n = Integer.parseInt( br.readLine() );

   int answer = 0;

   for(int i = 0 ; i < n; i++){
      int x = Integer.parseInt( br.readLine() );
      int flag = 0;

      if(x == 2){
    	flag = 0;

      }else if( x%2 == 0 || x < 2){
    	flag = 1;

       }else{

       double sqrt = Math.sqrt(x);
       for(int j = 3; j <= sqrt; j = j+2){
    	 if(x % j ==0){
    		flag = 1;

    		break;
    	 }
        }

       }


    	if(flag == 0){

    		answer++;

    	}

   }



   System.out.println(answer);
 }
}

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

#define rep(i,n) for(ll i=0;i<(n);++i)
using ll = long long;
using pll = pair<ll,ll>;
constexpr ll INF = (1LL<<60);
constexpr ll MOD = (1e9+7);
//constexpr ll MOD = (998244353);
template<class T> bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T> bool chmin(T &a,const T &b){if(a>b){a=b;return 1;}return 0;}
void dump(){cerr<<endl;}
template<class T,class... Ts> void dump(T&& h, Ts&&... t){cerr<<h<<", ";dump(forward<Ts>(t)...);}
template<class T> istream &operator>>(istream&is,vector<T>&v){for(auto &elemnt:v)is>>elemnt;return is;}
template<class T,class U> istream &operator>>(istream&is,pair<T,U>&p){is>>p.first>>p.second;return is;}
template<class T>vector<T> vec(size_t a){return vector<T>(a);}
template<class T, class... Ts>auto vec(size_t a, Ts... ts){return vector<decltype(vec<T>(ts...))>(a, vec<T>(ts...));}
template<class T>vector<T> _vec(size_t a,T v){return vector<T>(a,v);}
template<class T, class... Ts>auto _vec(size_t a, Ts... ts){return vector<decltype(_vec<T>(ts...))>(a, _vec<T>(ts...));}

signed main(){

  int n;
  cin>>n;
  for(double i=0.0;i<=50000.0;++i){
    if(int(i*1.08)==n){
      cout<<i<<endl;
      return 0;
    }
  }
  cout<<":("<<endl;

}

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

int main(int argc, char const *argv[])
{
	int n;
	string s;
	cin>>n>>s;
	int left=1,right=n;
	if (n<30)
	{
		string ss=s;
		sort(ss.begin(), ss.end());
		int ff=0;
		for (int i = 0; i < ss.size()-1; ++i)
		{
			if(ss.at(i)==ss.at(i+1))
			{
				ff=1;
			}
		}
		if (ff==0)
		{
			cout<<"0\n";
			return 0;
		}
	}
	while (right-left>1)
	{
		//cout<<" "<<left<<" "<<right<<endl;
		int mid=left+(right-left)/2,f=0;
		for (int i = 0; i < n-mid; ++i)
		{
			string ser=s.substr(i,mid);
			//cout<<i<<" "<<i+mid<<ser<<endl;
			int fnd=s.rfind(ser);
			if (fnd>=i+mid)
			{
				f=1;
				break;
			}
		}
		if (f==1)
		{
			left=mid;
		}
		else
		{
			right=mid;
		}
	}
	cout<<left<<endl;
	return 0;
}


Measured memory_bytes: 384
#include<stdio.h>

int main(){
	
	int a,b;
	
	int temp1,temp2;
	
	scanf("%d %d",&a,&b);
	
	if(a==1 && b!=1){
		printf("Alice\n");
	}

	else if(a!=1 && b==1){
		printf("Bob\n");
	}
	
	else if(a>b){
		printf("Alice\n");
	}	
	
	else if(a<b){
		printf("Bob\n");
	}
	
	else{
		printf("Draw\n");
	}
	
	return 0;
}

Measured memory_bytes: 128
#include<iostream>
using namespace std;
#include<vector>
#include<functional>
template<typename T>
struct lazysegtree{
	function<T(T,T)>calcfn,lazycalcfn;
	function<T(T,T,unsigned int)>updatefn;
	int n;
	T defvalue,lazydefvalue;
	vector<T>dat,lazy;
	vector<bool>lazyflag;
	lazysegtree(int n_=0,T defvalue_=0,
		function<T(T,T)>calcfn_=[](T a,T b){return a+b;},
		function<T(T,T)>lazycalcfn_=[](T a,T b){return a+b;},
		function<T(T,T,unsigned int)>updatefn_=[](T a,T b,unsigned int width){return a+b*width;},
		T lazydefvalue_=0
	):defvalue(defvalue_),lazydefvalue(lazydefvalue_),
		calcfn(calcfn_),lazycalcfn(lazycalcfn_),updatefn(updatefn_)
	{
		n=1;
		while(n<n_)n<<=1;
		dat.assign(2*n-1,defvalue);
		lazy.assign(2*n-1,lazydefvalue);
		lazyflag.assign(2*n-1,false);
	}
	void copy(vector<T>v)
	{
		for(int i=0;i<v.size();i++)dat[i+n-1]=v[i];
		for(int i=n-2;i>=0;i--)dat[i]=calcfn(dat[2*i+1],dat[2*i+2]);
	}
	void eval(int i,int l,int r)
	{
		if(lazyflag[i])
		{
			dat[i]=updatefn(dat[i],lazy[i],r-l);
			if(r-l>1)
			{
				lazy[2*i+1]=lazycalcfn(lazy[2*i+1],lazy[i]);
				lazy[2*i+2]=lazycalcfn(lazy[2*i+2],lazy[i]);
				lazyflag[2*i+1]=lazyflag[2*i+2]=true;
			}
			lazy[i]=lazydefvalue;
			lazyflag[i]=false;
		}
	}
	void update(int a,int b,T x,int k=0,int l=0,int r=-1)
	{
		if(r<0)r=n;
		eval(k,l,r);
		if(b<=l||r<=a)return;
		else if(a<=l&&r<=b)
		{
			lazy[k]=lazycalcfn(lazy[k],x);
			lazyflag[k]=true;
			eval(k,l,r);
		}
		else
		{
			update(a,b,x,2*k+1,l,(l+r)/2);
			update(a,b,x,2*k+2,(l+r)/2,r);
			dat[k]=calcfn(dat[2*k+1],dat[2*k+2]);
		}
	}
	T query(int a,int b,int k=0,int l=0,int r=-1)
	{
		if(r<0)r=n;
		eval(k,l,r);
		if(b<=l||r<=a)return defvalue;
		else if(a<=l&&r<=b)return dat[k];
		else return calcfn(
			query(a,b,2*k+1,l,(l+r)/2),
			query(a,b,2*k+2,(l+r)/2,r)
		);
	}
};
int n,q;
main()
{
	cin>>n>>q;
	lazysegtree<int>P(n,(1LL<<31)-1,[](int a,int b){return a<b?a:b;},[](int a,int b){return a+b;},[](int a,int b,int width){return a+b;});
	vector<int>a(n,0);
	P.copy(a);
	for(int i=0;i<q;i++)
	{
		int c;cin>>c;
		if(c)
		{
			int s,t;cin>>s>>t;
			cout<<P.query(s,t+1)<<endl;
		}
		else
		{
			int s,t,x;cin>>s>>t>>x;
			P.update(s,t+1,x);
		}
	}
}


Measured memory_bytes: 5776
n = int(input())
ans = 0
powers_2 = [2,4,8,16,32,64]
for i in range(len(powers_2)):
    if n == 0:
        ans = n
        break
    elif n == 1:
        ans = n
        break
    elif powers_2[i] <= n:
        ans = powers_2[i]
        continue
    elif powers_2[i] > n:
        ans = powers_2[i - 1]
        break
print(ans)


Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define PI acos(-1.0)
#define mem(a,b) memset((a),b,sizeof(a))
#define TS printf("!!!\n")
#define pb push_back
//std::ios::sync_with_stdio(false);
using namespace std;
//priority_queue<int,vector<int>,greater<int>> que;
const double EPS = 1.0e-8;
typedef pair<int, int> pairint;
typedef long long ll;
typedef unsigned long long ull;
const int  maxn = 2e5 + 100;
const int  maxm = 300;
char s[maxn];
int ans[30][maxn];
int main()
{
        while(~scanf("%s",s))
        {
        //scanf("%s",s);
        int len=strlen(s);
        ll anser=1;
        for(int i=len-1;i>=1;i--)
        {
        for(int j=0;j<=25;j++)
        ans[j][i]=ans[j][i+1];
        ans[s[i]-'a'][i]++;
        }
        for(int i=0;i<len-1;i++)
                for(int j=0;j<=25;j++)
                if(j!=s[i]-'a')
        anser+=ans[j][i+1];
        cout<<anser<<endl;
        }
}

Measured memory_bytes: 20864
a, b, h, m = map(int, input().split())

h = float(h)
m = float(m)
ra = 30*h+0.5*m
rb = 6*m
diff = ra - rb

if diff > 180:
   diff = 360 - diff

import math

c2 = a**2 + b**2 - 2*a*b*math.cos(math.radians(diff))
print(c2**0.5)


Measured memory_bytes: 9504
#include<bits/stdc++.h>
using namespace std;
#define LOCAL 0
#define lli long long int
const lli mod=1e9+7;
const lli pINF=LLONG_MAX;
const lli nINF=-LLONG_MAX;
void fast() {std::ios::sync_with_stdio(false);cin.tie(NULL);}
lli power(lli a,lli b){lli ans=1;while(b!=0){ if(b%2==1){ans*=a;ans%=mod;}b/=2;a*=a;a%=mod;} return ans;}
lli invmod(lli a) {return pow(a,mod-2);}
#define vi vector<int>
#define vlli vector<lli>
#define pb push_back
#define mp make_pair
#define F first
#define S second
const int INF=0x3f3f3f3f;
#define Pa pair<int,int>
#define si(n) scanf("%d",&n)
#define sli(n) scanf("%lld",&n)
#define printi(n) printf("%d\n",n)
#define ld long double
#define printli(n) printf("%lld\n",n)
#define all(v) v.begin(),v.end()
#define forn(i,n) for(int i=0;i<n;i++)
void print(int a[],int n){for(int i=0;i<n;i++) cout<<a[i]<<" ";}

int main() {
	int a,b,c,x;
	si(a);si(b);si(c);si(x);
	int ans=0;
	
	for(int i=0;i<=a;i++){
	    for(int j=0;j<=b;j++){
	        for(int k=0;k<=c;k++){
	            if(((500*i)+(100*j)+(50*k))==x) ans++;
	        }
	    }
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
//コンテスト終了後、解説聞きながら
#include <bits/stdc++.h>
using namespace std;

int main(void)
{
    long l, i, j, k, tmp;
    cin >> l;
    vector<long> a(l);
    for (i = 0; i < l; i++) {
        cin >> a.at(i);
    }
    vector<vector <long> > dp(l + 1, vector<long>(5, 0));

    for (i = 0; i < l; i++) {
        for (j = 0; j <= 4; j++) {
            tmp = dp.at(i).at(0);
            for (k = 1; k <= j; k++) {
                if (dp.at(i).at(k) < tmp) tmp = dp.at(i).at(k);
            }
            
            if (j == 0 || j == 4) {
                dp.at(i + 1).at(j) = tmp + a.at(i);
            }else if (j == 1 || j == 3) {
                if (a.at(i) < 1) {
                    dp.at(i + 1).at(j) = tmp + 2;
                }else if(a.at(i) % 2 == 0) {
                    dp.at(i + 1).at(j) = tmp;
                }else {
                    dp.at(i + 1).at(j) = tmp + 1;
                }
            }else if (j == 2) {
                if(a.at(i)%2 == 0) {
                    dp.at(i + 1).at(j) = tmp + 1;
                }else {
                    dp.at(i + 1).at(j) = tmp;
                }
            }
        }
    }
    cout << *min_element(dp.at(l).begin(), dp.at(l).end()) << endl;

    return 0;
}


Measured memory_bytes: 16000
#include <algorithm>
#include <iostream>
#include <numeric>
#include <unordered_map>
#include <vector>

std::vector<long long> solve(int H, int W, const std::vector<std::pair<int, int>> &points)
{
	std::unordered_map<long long, int> map;
	for (const auto &p : points)
	{
		int i1 = std::max(p.first - 2, 0);
		int i2 = std::min(p.first, H - 3);
		int j1 = std::max(p.second - 2, 0);
		int j2 = std::min(p.second, W - 3);
		for (int i = i1; i <= i2; ++i)
		{
			for (int j = j1; j <= j2; ++j)
			{
				long long key = (long long)i << 32 | j;
				if (map.count(key) == 0) { map[key] = 0; }
				++map[key];
			}
		}
	}
	std::vector<long long> counts(10);
	for (const auto &pair : map) { ++counts[pair.second]; }
	int sum = std::accumulate(counts.begin(), counts.end(), 0);
	counts[0] = (long long)(H - 2) * (long long)(W - 2) - sum;
	return counts;
}

int main()
{
	int H, W, N;
	std::cin >> H >> W >> N;
	std::vector<std::pair<int, int>> points(N);
	for (int i = 0; i < N; ++i)
	{
		int a, b;
		std::cin >> a >> b;
		points[i] = std::make_pair(a - 1, b - 1);
	}
	for (long long n : solve(H, W, points)) { std::cout << n << std::endl; }
}


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

int main() {
    int n,sum=0;
    cin>>n;
    vector<int> d(n);
    rep(i,n) {
        cin>>d[i];
    }
    rep(i,n) {
        for (int j=1; j<n; j++) {
            if (j <= i) continue;
            sum += d[i]*d[j];
        }
    }
    cout<<sum<<endl;
}


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

vector<int> a;

void print_a() {
    for (int i = 0; i < a.size(); i++) {
        cout << a[i];
        if (i != a.size() - 1) cout << " ";
    }
}
int main() {
#ifdef LOCAL
    // 以降 cin の入力元が 'xxx.txt' になる
    std::ifstream in("aizu_code.txt");
    std::cin.rdbuf(in.rdbuf());
#endif

    int n;
    cin >> n;

    a.resize(n);

    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }

    int num = 0;

    bool flag = true;
    while (flag) {
        flag = false;
        for (int j = n - 1; j > 0; j--) {
            if (a[j] < a[j - 1]) {
                swap(a[j], a[j - 1]);
                flag = true;
                num++;
            }
        }
    }

    print_a();
    cout << endl << num << endl;

    return 0;
}



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

#define int long long
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i < b; i++)
#define out(x) cout << x << endl
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<bool> > vvb;
typedef vector<vector<double> > vvd;
typedef vector<vector<string> > vvs;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

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> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
//以降 cin の入力元が 'input.txt' になる
//std::ifstream in("input.txt");
//std::cin.rdbuf(in.rdbuf());

signed main()
{   
    gearup;
    string s; cin >> s;
    int n = s.size();
    if(n == 2){
        if(s[0] == s[1])cout << 1 << " " << 2 << endl;
        else cout << -1 << " " << -1 << endl;
        return 0;
    }
    for(int i=0;i<n-2;i++){
        string ss = s.substr(i,3);
        if(ss[0] == ss[1] || ss[1] == ss[2] || ss[2] == ss[0]){
            cout << i + 1 << " " << i + 3  << endl;
            return 0;
        }
    }
    cout << -1 << " " << -1 << endl;
}

Measured memory_bytes: 3776
<?php
error_reporting(0);
$stdin = file_get_contents('php://stdin');
$line = explode("\n",$stdin);
$fi = 0;
$cnt = 0;
$list = array();
$key = new stdclass();
foreach($line as $l) {
  if (strlen($l)==0) continue;
  if ($fi == 0) {
    $a = explode(" ",$l);
    $key->A = $a;
    $fi++;
    continue;
  }
  if ($fi > 0) {
    $a = explode(" ",$l);
    $key->X[] = $a;
  }
}
$A = $key->A[0];
$B = $key->A[1];

$C = $A + $B;
if ($C>=24) {
  $C = $C - 24;
}
printf("%d\n",$C);


Measured memory_bytes: 3828
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
typedef pair<ll,int> P;
#define fi first
#define se second
#define all(v) (v).begin(),v.end()
const ll mod=1000000007;
const ll mod2=998244353;
const ll inf=100000000000000000;
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
vector<int> dy={-1,0,1,0},dx={0,-1,0,1};
map<char,int> mp;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
   string s;
   cin >>s;
   for(int i=0;i<s.size();i++)mp[s[i]]++;
   for(char c='a';c<='z';c++){
       if(mp[c]%2==1){
           cout<<"No"<<endl;
           return 0;
       }
   }
    cout<<"Yes"<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
struct edge {
    int to;     // 辺の行き先
    int weight; // 辺の重み
    edge(int t, int w) : to(t), weight(w) { }
};
using Graph = vector<vector<int>>;
using dou =long double;
string Yes="Yes";
string YES="YES";
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(int i = m; i < (int)(n); i++)
#define reprep(i,j,h,w) rep(i,h)rep(j,w)
#define all(x) (x).begin(),(x).end()
#define aall(x,n) (x).begin(),(x).begin()+(n)
#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 lb lower_bound
#define ub upper_bound
#define res resize
#define as assign
#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 vvector(name,typ,m,n,a)vector<vector<typ> > name(m,vector<typ> (n,a))
#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<<": "
 
typedef long long ll;
//typedef long long T;
const int INF = 2000000000;
const ll INF64 = 922337203685477580ll;
//const int mod = 1000000007ll;
const ll  MOD = 1000000007LL;
vector< ll > divisor(ll n) {  //約数の列挙
  vector< ll > ret;
  for(ll i = 1; i * i <= n; i++) {
    if(n % i == 0) {
      ret.push_back(i);
      if(i * i != n) ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}
int main(){
    ll n,m;
    std::cin >> n>>m ;
    std::vector<ll> d=divisor(m);
    ll ans=1;
    erep(i,d){
        //std::cout << i << std::endl;
        if(i>=n)ans=max(ans,m/i);
    }
    std::cout << ans << std::endl;
}

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

using namespace std;

typedef long long int ll;
typedef pair<ll, ll> P;
#define INF 10000000000000
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep1(i, n) for(ll i = 1; i < (ll)(n); i++)
#define repN_1(i, n) for(ll i = 0; i < (ll)(n - 1); i++)
#define repM(i, n) for(ll i = (ll)(n - 1); i >= 0; i--)
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }

int main()
{
	cout << fixed << setprecision(18);

	ll k, t;
	cin >> k >> t;

	vector<P> a(t);
	rep(i, t) {
		ll tmp;
		cin >> tmp;
		a[i] = P(tmp, i);
	}

	sort(a.begin(), a.end(), greater<>());

	ll b = INF;
	ll ans = 0;
	rep(i, k) {
		if (b == a[0].second){
			if (a.size() > 1) {
				a[1].first--;
				b = a[1].second;
				if (a[1].first == 0)
					a.erase(a.begin() + 1);
			}
			else {
				a[0].first--;
				ans++;
			}
		}
		else {
			a[0].first--;
			b = a[0].second;
			if (a[0].first == 0)
				a.erase(a.begin());
		}
		sort(a.begin(), a.end(), greater<>());
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define MAX_N 1002
#define i197 1000000007

using namespace std;

typedef long long ll;
typedef pair<ll,ll> P1;
typedef pair<int,int> Pi;
typedef pair<double,Pi> Pdi;
typedef pair<ll,int>Pli;
typedef pair<P1,ll> P2;
const ll INF=1000000000000000001;
struct edge{int to,cost;};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
struct Road{double cost;int a,b;};

int main(){

	int a;
	cin>>a;
	cout<<a*a<<endl;

 	return 0;

}


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

int main() {
  int n,m;
  cin >> n >> m;
  vector<int>data(n,-1);
  for(int i = 0;i < m;i++){
    int c,s;
    cin >> s >> c;
    s--;
    if(data[s] != -1 && data[s] != c){
      cout << -1 << endl;
      return 0;
    }
    if(n != 1 && s == 0 && c == 0){
      cout << -1 << endl;
      return 0;
    }
    data[s] = c;
  }
  int ans = 0,ten = 1;
  for(int i = n-1;i >= 0;i--){
    if(data[i] == -1){
      if(i == 0){
        if(n == 1){
          cout << 0 << endl;
          return 0;
        }
        ans += ten;
        continue;
      }
      else{
        ten *= 10;
        continue;
      }
    }
    ans += data[i]*ten;
    ten *= 10;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
N = gets.to_i

L = N.to_s.size

dpA = Array.new(L + 1, 0)
dpB = Array.new(L + 1, 0)

nums = N.to_s.chars.map(&:to_i)

nums.reverse.each_with_index do |n, i|
  m = (n + 1) % 10

  if i == 0
    dpA[i + 1] = n

    if i == L - 1
      dpB[i + 1] = 10 - n + 1
    else
      dpB[i + 1] = 10 - n
    end
    next
  end

  pa = dpA[i] + n
  pb = dpB[i] + m

  if m == 0
    pb = dpB[i] + n
  end

  if pa < pb
    dpA[i + 1] = pa
  else
    dpA[i + 1] = pb
  end

  pa = dpA[i] + 10 - n
  pc = dpB[i] + 10 - m

  if i == L - 1
    pa += 1
    pc += 1
  end

  if m == 0
    if i == L - 1
      dpB[i + 1] = [pa, dpB[i] + 1].min
    else
      dpB[i + 1] = [pa, dpB[i]].min
    end
  elsif pa < pc
    dpB[i + 1] = pa
  else
    dpB[i + 1] = pc
  end
  # p [:m, m, pa, pb]
end

# p dpA
# p dpB

puts [dpA[L], dpB[L]].min



Measured memory_bytes: 124136
#include <iostream>
#include <vector>
#include <map>
#include <queue>
#include <string>
#include <algorithm>
#include <cmath>
#include <climits>
#include <fstream>
#include <cstdlib>
#include <cstdio>
#define REP(i, n) for(long long int i=0; i<(n); i++)
#define FOR(i, a, n) for(long long int i=(a); i<(n); i++)
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<char> vc;

int main(){
    int N;cin>>N;
    vi a(N+1), x(N+1);
    FOR(i, 1, N+1){
        cin >> a[i];
        if(i > N/2){
            x[i] = a[i];
        }
    }

    for(int i=N/2; i>=1; i--){
        int wa = 0;
        int j=1;
        while(i*j <= N){
            wa += x[i*j];
            j++;
        }
        x[i] = (wa + a[i]) % 2;
    }

    int M = 0;
    FOR(i, 1, N+1){
        M += x[i];
    }
    cout << M << endl;
    FOR(i, 1, N+1){
        if(x[i] == 1){
            cout << i << " ";
        }
    }
    return 0;
}

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

using namespace std;

//  Binary Indexed Tree
class BIT
{
    int n;
    vector<long long> v;
public:
    BIT(int n_) {
        n = 1;
        while (n < n_)
            n <<= 1;
        v = vector<long long>(n);
    }
    //  a[i] += x
    void add(int i, long long x) {
        for (; i<n; i|=i+1)
            v[i] += x;
    }
    //  return a[0]+a[1]+…+a[i-1]
    long long sum(int i) {
        long long s = 0;
        for (i--; i>=0; i=(i&(i+1))-1)
            s += v[i];
        return s;
    }
};

int main()
{
    int N;
    long long X;
    cin>>N>>X;
    vector<unsigned long long> x(N);
    for (unsigned long long &t: x)
        cin>>t;

    BIT bit(N);
    for (int i=0; i<N; i++)
        bit.add(i, x[i]);

    long long ans = 0x7fffffffffffffffLL;
    for (int k=1; k<=N; k++)
    {
        long long a = (N + k)*X;
        bool ok = true;
        for (int i=0; N-i*k>=0; i++)
        {
            long long s;
            if (N-i*k-k >= 0)
                s = bit.sum(N-i*k) - bit.sum(N-i*k-k);
            else
                s = bit.sum(N-i*k);
            a += (i==0 ? 5 : i*2+3) * s;
            if (a < 0)
                ok = false;
        }
        if (ok)
            ans = min(ans, a);
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 3840
#include <cstdio>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>

int n;

int main(void) {
    std::scanf("%d", &n);
    int x = 1, y = 1;
    while (n-- > 0) {
        int a;
        std::scanf("%d", &a);
        x *= 3;
        y *= 2 - a % 2;
    }
    std::printf("%d\n", x - y);
    return 0;
}

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

using namespace std;

#define REP(i, n)   for(int i = 0; i < (n); i++)
#define REPS(i, n)  for(int i = 1; i <= (n); i++)
#define RREP(i, n)  for(int i = (n)-1; i >= 0; i--)
#define RREPS(i, n) for(int i = (n); i > 0; i--)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
#define mp make_pair
#define mt make_tuple
#define pb push_back

using ll  = long long;
using pi  = pair<int, int>;
using pl  = pair<ll, ll>;
using vi  = vector<int>;
using vl  = vector<ll>;
using vs  = vector<string>;
using vb  = vector<bool>;
using vvi = vector<vi>;
using vvl = vector<vl>;

const int MOD = 1e9 + 7;
const int INF = 1e9 + 7;
const ll  INFL = 1e18;
const double PI = 3.141592653589793;
const double EPS = 1e-9;

template<class T> bool chmax(T &a, const T &b) { if(a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if(a > b) { a = b; return true; } return false; }


signed main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    int H, W, M; cin >> H >> W >> M;
    vector<pi> p(M);
    vi ch(H, 0), cw(W, 0);
    REP(i, M)
    {
        int h, w; cin >> h >> w;
        h--; w--;
        p[i] = mp(h, w);
        ch[h]++;
        cw[w]++;
    }

    sort(ALL(p));

    int ans = 0;
    int j = 0;
    REP(i, H) if(ch[j] < ch[i]) j = i;
    REP(i, W)
    {
        int tmp;
        if(binary_search(ALL(p), mp(j, i))) tmp = ch[j] + cw[i] - 1;
        else tmp = ch[j] + cw[i];
        chmax(ans, tmp);
    }

    j = 0;
    REP(i, W) if(cw[j] < cw[i]) j = i;
    REP(i, H)
    {
        int tmp;
        if(binary_search(ALL(p), mp(i, j))) tmp = ch[i] + cw[j] - 1;
        else tmp = ch[i] + cw[j];
        chmax(ans, tmp);
    }
    
    cout << ans << endl;
}

Measured memory_bytes: 7924
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include<algorithm>
#include<sstream>
#include<iomanip>


using namespace std;

typedef long long ll;

const ll MOD_CONST = 1000000007;

int main() {

	ll h, w;
	cin >> h >> w;
	
	vector<ll> s(3);
	
	if (h < w) {
		swap(h, w);
	}

	ll ans;
	if (h % 3 == 0 || w % 3 == 0) {
		ans = 0;
	}
	else {
		ll h1 = h / 3;
		if (h % 3 == 2) {
			h1++;
		}

		s[0] = h1 * w;
		ll h2 = h - h1;

		ll w2 = w;
		if (h2 < w2) {
			swap(h2, w2);
		}

		if (h2 % 2 == 0 || w2 % 2 == 0) {
			s[1] = s[2] = h2 * w2 / 2;
		}
		else {
			s[1] = h2 / 2 * w2;
			s[2] = (h2 / 2 + 1)*w2;
		}

		sort(s.begin(), s.end());
		ans = s[2] - s[0];

		if (ans > h / 2 && h%2 == 0) {
			ans = h / 2;
		}
	}

	cout << ans << endl;
}

Measured memory_bytes: 256
import sys
from io import StringIO
import unittest


def resolve():
    t = list(input())

    if t[0] == '?':
        t[0] = 'D'

    for i in range(1, len(t) - 1):
        if t[i] == '?':
            if t[i - 1] == 'P':
                t[i] = 'D'
            else:
                if t[i + 1] == '?':
                    t[i] = 'P'
                    t[i + 1] = 'D'
                elif t[i + 1] == 'D':
                    t[i] = 'P'
                else:
                    t[i] = 'D'

    if t[-1] == '?':
        t[-1] = 'D'

    print(''.join(t))



class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """PD?D??P"""
        output = """PDPDPDP"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """P?P?"""
        output = """PDPD"""
        self.assertIO(input, output)


if __name__ == "__main__":
    # unittest.main()
    resolve()


Measured memory_bytes: 76808
#include <algorithm>
#include <iostream>
#include <string>
#include <random>
#include <cassert>
#include <cstring>
#include <chrono>
#include <set>
#include <map>

using namespace std;

typedef long long ll;

const double pi = 2 * asin(1.0);

double sqr(double x) {
  return x * x;
}

int main()
{
  double a, b, h, m;
  cin >> a >> b >> h >> m;
  h += m / 60.0;
  double minAgnle = 2 * pi * h;
  double hourAngle = 2 * pi * h / 12;
  double xHour = a * cos(hourAngle);
  double yHour = a * sin(hourAngle);
  double xMin = b * cos(minAgnle);
  double yMin = b * sin(minAgnle);
  double dist = sqrt(sqr(xHour - xMin) + sqr(yHour -yMin));
  printf("%.10lf\n", dist);
  return 0;
}


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

char s[101];
int k;

int main(){
  scanf("%d",&k);
  scanf("%s",s);
 
  int ln = strlen(s);

  if(ln<=k){
    printf("%s\n",s);}
  else{
    for(int i=0;i<k;i++){
      printf("%c",s[i]);}
    printf("...\n");}
  
  return 0;
}


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

using namespace std;

int N;
char S[200001];
int A, B, ans;

int main()
{
    scanf("%s", S);
    N=strlen(S);
    ans=N;
    vector<char> stk;
    for(int i=0; i<N; i++)
    {
        if(S[i]=='S')
            stk.push_back('S');
        else if(!stk.empty() && stk.back()=='S')
        {
            stk.pop_back();
            ans-=2;
        }
        else
            stk.push_back('T');
    }
    printf("%d\n", ans);
    return 0;
}


Measured memory_bytes: 768
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
  int N,M,K;
  cin>>N>>M>>K;
  vector<vector<int>> A(N,vector<int>(0));
  for(int i=0;i<M;i++){
    int a,b;
    cin>>a>>b;
    A[a-1].push_back(b-1);
    A[b-1].push_back(a-1);
  }
  int k=0;
  vector<int> B(N,-1),D(N);
  for(int i=0;i<N;i++){
    if(B[i]!=-1)
      continue;
    queue<int> C;
    C.push(i);
    B[i]=k;
    while(!C.empty()){
      int I=C.front();
      C.pop();
      for(int j:A[I])
        if(B[j]==-1){
          B[j]=k;
          C.push(j);
        }
    }
    k++;
  }
  vector<int> E(k,0);
  for(int i:B)
    E[i]++;
  for(int i=0;i<N;i++)
    D[i]=E[B[i]]-(1+(int)A[i].size());
  for(int i=0;i<K;i++){
    int a,b;
    cin>>a>>b;
    if(B[a-1]==B[b-1])
      D[a-1]--,D[b-1]--;
  }
  for(int i=0;i<N;i++){
    cout<<D[i];
    if(i==N-1)
      cout<<endl;
    else
      cout<<' ';
  }
}

Measured memory_bytes: 11964
#include "bits/stdc++.h"
#include<unordered_map>
#pragma warning(disable:4996)
using namespace std;

int len;

int dp[20][20];
int memo[1 << 16][16];

int getans(bitset<16>bs,const int now) {
	if (memo[bs.to_ulong()][now] != -1) {
		return memo[bs.to_ulong()][now];
	}
	if (bs.count() == len)return memo[bs.to_ulong()][now] = 0;
	int ans = 0;
	for (int i = 0; i < len; ++i) {
		if (!bs[i]) {
			bs[i] = true;
			ans = max(ans,getans(bs, i) + dp[now][i]);
			bs[i] = false;
		}
	}
	return memo[bs.to_ulong()][now]=ans;
}


int main() {
	while (1) {
		int N; cin >> N;
		for (int i = 0; i < (1 << 16); ++i) {
			for (int j = 0; j < 16; ++j) {
				memo[i][j] = -1;
			}
		}
		if (!N)break;
		vector<string>sts;
		for (int i = 0; i < N; ++i) {
			string st; cin >> st;
			sts.push_back(st);
		}
		vector<bool>oks(N,true);
		for (int i = 0; i < N; ++i) {
			for (int j = 0; j < N; ++j) {
				if (i != j) {
					if (sts[i].find(sts[j])!=string::npos) {
						oks[j] = false;
					}
				}
			}
		}
		vector<string>nsts;
		for (int i = 0; i < N; ++i) {
			if (oks[i])nsts.push_back(sts[i]);
		}
		sts = nsts;


		int sum = 0;
		for (auto s : sts) {
			sum += s.size();
		}
		len = sts.size();
		for (int i = 0; i < len; ++i) {
			for (int j = 0; j < len; ++j) {
				if (i != j) {
					int llen = sts[i].size();
					int rlen = sts[j].size();
					int kaburi = 0;
					for (int k = min(llen, rlen); k >=1;--k) {
						if (sts[i].substr(llen - k, k) == sts[j].substr(0, k)) {
							kaburi = k;
							break;
						}
					}
					dp[i][j] = kaburi;
				}
			}
		}
		bitset<16>bs(0);
		int ans = 0;
		for (int i = 0; i < len; ++i) {
			bs[i] = true;
			ans = max(getans(bs, i),ans);
			bs[i] = false;

		}
		int finans = sum - ans;
		cout << finans << endl;
	}
	
	return 0;
}

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

int main() {
    int k;
    cin >> k;
    vector<int> a(k);
    for (int i = 1; i <= k; i++) {
        if (i == 1) a[i] = 7;
        else a[i] = 10 * a[i-1] + 7;
        a[i] %= k;
        if (a[i] == 0) {
            cout << i << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    return 0;
}

Measured memory_bytes: 7124
N = int(input())
t = [0] * (N+1)
x = [0] * (N+1)
y = [0] * (N+1)
for i in range(N):
    t[i+1], x[i+1], y[i+1] = map(int, input().split())
    
f = True
for i in range(N):
    dt = t[i+1] - t[i]
    dist = abs(x[i+1]-x[i]) + abs(y[i+1]-y[i])
    if dt < dist:
        f = False
    if dist%2 != dt%2:
        f = False

if f:
    print('Yes')
else:
    print('No')    

Measured memory_bytes: 11636
X, K, D = map(int, input().split())
if 0 <= X:
    ans = X-D*K
    if 0 < ans:
        print(ans)
        exit(0)
if X < 0:
    ans = X+D*K
    if ans < 0:
        print(abs(ans))
        exit(0)

for i in range(K):
    if 0 <= X:
      absX = abs(X - D*i)
      if absX <= D:
         if (K-i)%2==0:
              ans = absX
              print(ans)
              exit(0)
         if (K-i)%2==1:
              ans = abs(X - D*(i+1))
              print(ans)
              exit(0)
    if X < 0:
      absX = abs(X + D*i)
      if absX <= D:
         if (K-i)%2==0:
              ans = absX
              print(ans)
              exit(0)
         if (K-i)%2==1:
              ans = abs(X + D*(i+1))
              print(ans)
              exit(0)

Measured memory_bytes: 63056
using System;
using System.Collections.Generic;
class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string[] input = Console.ReadLine().Split(' ');
            int[] h = new int[n];
            for (int i=0; i<n; i++) h[i] = int.Parse(input[i]);
            int h_max = 0;
            int ans = 0;
            for (int i=0; i<n; i++)
            {
                if (h[i] >= h_max)
                {
                    h_max = h[i];
                    ans++;
                }
            }
            Console.WriteLine(ans);
        }
    }
    //mcs Main.cs
    //mono Main.exe

Measured memory_bytes: 11092
#include <bits/stdc++.h>
using namespace std;
// type alias
typedef long long LL;
typedef pair<int,int> II;
typedef tuple<int,int,int> III;
typedef vector<int> VI;
typedef vector<string> VS;
typedef unordered_map<int,int> MAPII;
typedef unordered_set<int> SETI;
template<class T> using VV=vector<vector<T>>;
// minmax
template<class T> inline T SMIN(T& a, const T b) { return a=(a>b)?b:a; }
template<class T> inline T SMAX(T& a, const T b) { return a=(a<b)?b:a; }
// repetition
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define REPE(i,n)  for(int i=0;i<=(n);++i)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  for(int i=0;i<(n);++i)
#define FORR(x,arr) for(auto& x:arr)
#define SZ(a) int((a).size())
// collection
#define ALL(c) (c).begin(),(c).end()
// DP
#define MINUS(dp) memset(dp, -1, sizeof(dp))
#define ZERO(dp) memset(dp, 0, sizeof(dp))
// stdout
#define println(args...) fprintf(stdout, ##args),putchar('\n');
// debug cerr
template<class Iter> void __kumaerrc(Iter begin, Iter end) { for(; begin!=end; ++begin) { cerr<<*begin<<','; } cerr<<endl; }
void __kumaerr(istream_iterator<string> it) { (void)it; cerr<<endl; }
template<typename T, typename... Args> void __kumaerr(istream_iterator<string> it, T a, Args... args) { cerr<<*it<<"="<<a<<", ",__kumaerr(++it, args...); }
template<typename S, typename T> std::ostream& operator<<(std::ostream& _os, const std::pair<S,T>& _p) { return _os<<"{"<<_p.first<<','<<_p.second<<"}"; }
#define __KUMATRACE__ true
#ifdef __KUMATRACE__
#define dump(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); __kumaerr(_it, args); }
#define dumpc(ar) { cerr<<#ar<<": "; FORR(x,(ar)) { cerr << x << ','; } cerr << endl; }
#define dumpC(beg,end) { cerr<<"~"<<#end<<": "; __kumaerrc(beg,end); }
#else
#define dump(args...)
#define dumpc(ar)
#define dumpC(beg,end)
#endif

// $ cp-batch OneClue | diff OneClue.out -
// $ g++ -std=c++14 -Wall -O2 -D_GLIBCXX_DEBUG -fsanitize=address OneClue.cpp && ./a.out

/*
 
 8/15/2019
 
 14:11-
 
 */

int K,X;

void solve() {
  FORE(p,X-(K-1),X+(K-1)) printf("%d ", p);
  println("");
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout<<setprecision(12)<<fixed;
  
  cin>>K>>X;
  solve();
  
  return 0;
}


Measured memory_bytes: 256
def factorization(n):
    L=[]
    temp=n
    print(n,end="")
    print(":",end="")
    for i in range(2, int(n**(1/2)//1)+1):
        if temp%i==0:
            c=0
            while temp%i==0:
                c+=1
                temp//=i
            L.append([i, c])
            for j in range(c):
                print("",i,end="")
    if temp!=1:
        print("",temp, end="")
    print()
n=int(input()) 
factorization(n)


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

int main() {
    long t, ans;
    cin >> t;
    if(t % 1000 == 0){
        ans = 0;
    }else{
        ans = (1 + t / 1000) * 1000 - t;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3620
#[doc = " https://github.com/hatoo/competitive-rust-snippets"]
#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::io::{stdin, stdout, BufWriter, Write};
#[allow(unused_imports)]
use std::iter::FromIterator;
mod util {
    use std::fmt::Debug;
    use std::io::{stdin, stdout, BufWriter, StdoutLock};
    use std::str::FromStr;
    #[allow(dead_code)]
    pub fn line() -> String {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.trim().to_string()
    }
    #[allow(dead_code)]
    pub fn chars() -> Vec<char> {
        line().chars().collect()
    }
    #[allow(dead_code)]
    pub fn gets<T: FromStr>() -> Vec<T>
    where
        <T as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.split_whitespace()
            .map(|t| t.parse().unwrap())
            .collect()
    }
    #[allow(dead_code)]
    pub fn with_bufwriter<F: FnOnce(BufWriter<StdoutLock>) -> ()>(f: F) {
        let out = stdout();
        let writer = BufWriter::new(out.lock());
        f(writer)
    }
}
#[allow(unused_macros)]
macro_rules ! get { ( [ $ t : ty ] ) => { { let mut line : String = String :: new ( ) ; stdin ( ) . read_line ( & mut line ) . unwrap ( ) ; line . split_whitespace ( ) . map ( | t | t . parse ::<$ t > ( ) . unwrap ( ) ) . collect ::< Vec < _ >> ( ) } } ; ( [ $ t : ty ] ; $ n : expr ) => { ( 0 ..$ n ) . map ( | _ | get ! ( [ $ t ] ) ) . collect ::< Vec < _ >> ( ) } ; ( $ t : ty ) => { { let mut line : String = String :: new ( ) ; stdin ( ) . read_line ( & mut line ) . unwrap ( ) ; line . trim ( ) . parse ::<$ t > ( ) . unwrap ( ) } } ; ( $ ( $ t : ty ) ,* ) => { { let mut line : String = String :: new ( ) ; stdin ( ) . read_line ( & mut line ) . unwrap ( ) ; let mut iter = line . split_whitespace ( ) ; ( $ ( iter . next ( ) . unwrap ( ) . parse ::<$ t > ( ) . unwrap ( ) , ) * ) } } ; ( $ t : ty ; $ n : expr ) => { ( 0 ..$ n ) . map ( | _ | get ! ( $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ ( $ t : ty ) ,*; $ n : expr ) => { ( 0 ..$ n ) . map ( | _ | get ! ( $ ( $ t ) ,* ) ) . collect ::< Vec < _ >> ( ) } ; }
#[allow(unused_macros)]
macro_rules ! debug { ( $ ( $ a : expr ) ,* ) => { eprintln ! ( concat ! ( $ ( stringify ! ( $ a ) , " = {:?}, " ) ,* ) , $ ( $ a ) ,* ) ; } }
const BIG_STACK_SIZE: bool = true;
#[allow(dead_code)]
fn main() {
    use std::thread;
    if BIG_STACK_SIZE {
        thread::Builder::new()
            .stack_size(32 * 1024 * 1024)
            .name("solve".into())
            .spawn(solve)
            .unwrap()
            .join()
            .unwrap();
    } else {
        solve();
    }
}
fn solve() {
    let mut v = get!([usize]);
    v.sort();
    println!("{}", v[0] * v[1] / 2);
}


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

using namespace std;

#define OnlineJudge1

#define loop(x,a,n) for(int x = a;x < n;x++)
#define NumofDigits(n) ((int)log10(n)+1)
#define CountofNumber(array,n,x)  (upper_bound(array, array+n, x)-lower_bound(array, array+n, x))
#define readline(s) getline(cin,s)
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define EPS 1e-7
#define modulo ll (1e9 + 7)
const long double PI = 3.141592653589793238L;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<int,ll> pill;
typedef pair<ll,ll> pll;

#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)

#define time__(d) \
    for ( \
        auto blockTime = make_pair(chrono::high_resolution_clock::now(), true); \
        blockTime.second; \
        debug("%s: %lld ms\n", d, chrono::duration_cast<chrono::milliseconds>(chrono::high_resolution_clock::now() - blockTime.first).count()), blockTime.second = false \
    )


void init(){
    cin.tie(0);
    ios::sync_with_stdio(0);
#ifdef OnlineJudge
    freopen("in.txt","r",stdin);
    freopen("out.txt","w",stdout);
#endif
}


const int N = 1e5 + 5, M = 1e6 + 6, OO = 0x3f3f3f3f;


int main(){
    init();

    int n, k, ans = 0;   cin >> n >> k;
    for(int i = 0;i < n;i++){
        int h;  cin >> h;
        if(h >= k)  ans++;
    }

    cout << ans;
}


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

int main()
{
    string s;
    int a = 0, out = 0;
    bool jud = false;
    cin >> s;
    for (int i = 0; i <= 3; ++i) {
        if (jud) {
            if (s[i] == 'R')++a;
            else {
                a = 0;
                jud = false;
            }
        }
        else {
            if (s[i] == 'R') {
                ++a;
                jud = true;
            }
        }
        if (out < a) {
            out = a;
        }
    }

    cout << out << endl;
    return 0;
}

Measured memory_bytes: 3620
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<n;++i)
#define mod (ll)(1e9+7)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N;
    cin >> N;
    ll ans = 0;
    for(ll i=1;i*i<=N;i++){
        if(N%i==0){
            ans = N/i;
        }
    }
    cout << to_string(ans).length() << endl;
    return 0;
}

Measured memory_bytes: 256