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

using namespace std;

#define ZFor(i,n) for(int i=0;i<n;i++)
#define WFor(i,n) for(int i=1;i<=n;i++)
#define ZWFor(i,n) for(int i=0;i<=n;i++)
#define WZFor(i,n) for(int i=1;i<n;i++)
#define Max -2100000000
#define Min 2100000000
#define F first
#define S second
#define F1 first.first
#define F2 first.second
#define F3 second

typedef pair<int,int> P;
typedef pair<pair<int,int>,int> PP;

int n,m,d,cant,t,s,hi,mi,ans=0;
int flg,xlist[1001][1001],ylist[1001][1001];
char h[1001][1001];
int main(void){


	
	scanf("%d %d %d",&n,&m,&d);
	ZFor(i,n) scanf("%s",h[i]);
	
	ZFor(i,n){
		ZFor(j,m){
			
			if(h[i][j]!='#'){
				//printf("%d %d %c\n",i,j,h[i][j]);
				flg=1;
				if(i+d<=n){
					for(int k=i;k<i+d;k++) if(h[k][j]=='#') flg=0;
				}
				else flg=0;
				if(flg==1){
				//	printf("1 %d %d\n",i,j);
					ans++;
				}
				flg=1;
				if(j+d<=m){
					for(int k=j;k<j+d;k++) if(h[i][k]=='#') flg=0;
				}
				else flg=0;
				if(flg==1){
				//	printf("2 %d %d\n",i,j);
					ans++;
				}
			}
		}
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 3232
#include<bits/stdc++.h>
using namespace std;
const int maxn=5e4+10;
#define PI 3.1415927
#define ll long long
int main()
{
	string s;
	cin>>s;
	if(s=="SUN")
	cout<<7<<endl;
	if(s=="MON")
	cout<<6<<endl;
	if(s=="TUE")
	cout<<5<<endl;
	if(s=="WED")
	cout<<4<<endl;
	if(s=="THU")
	cout<<3<<endl;
	if(s=="FRI")
	cout<<2<<endl;
	if(s=="SAT")
	cout<<1<<endl;
 } 

Measured memory_bytes: 256
////////////////////////////////////////////
///                                      ///
///        Template ver. 1.2. rapel      ///
/// Fear is Temporary, Regret is Forever ///
///          Must Try and Get AC         ///
///                                      ///
////////////////////////////////////////////
#include <stdio.h>
#include <iostream>
#include <sstream>
#include <iomanip>

#include <algorithm>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <utility>

#include <math.h>
#include <complex>

#include <assert.h>
#include <time.h>
//#include <chrono>
//#include <random>

#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <stack>
#include <list>
#include <bitset>

#define F first
#define S second
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define endl '\n'
using namespace std;

typedef long long ll;
typedef unsigned long long ull;

void desperate_optimization(int precision){
  	ios_base::sync_with_stdio(false);
  	cin.tie(0);
  	cout.tie(0);
  	cout.setf(ios::fixed);
  	cout.setf(ios::showpoint);
  	cout.precision(precision);
}

const int N = 500;
int field[N + 5][N + 5];

const int MULTI = 2300;

void hora(int tc) {
	int R, C, r, c;
	cin>>R>>C>>r>>c;
	ll total = 0;
	int p1 = -(r * c - 1) * MULTI - 1;
	for(int i = 1;i <= R;i++) {
		for(int j = 1;j <= C;j++) {
			if(i % r == 0 && j % c == 0) field[i][j] = p1;
			else field[i][j] = MULTI;
			total += field[i][j];
		}
	}
	if(total > 0) {
		cout<<"Yes"<<endl;
		for(int i = 1;i <= R;i++) {
			for(int j = 1;j <= C;j++) {
				if(j != 1) cout<<" ";
				cout<<field[i][j];
			}
			cout<<endl;
		}
	} else cout<<"No"<<endl;
}

int main(){
	desperate_optimization(10);
	int ntc = 1;
	//cin>>ntc;
	for(int tc = 1;tc <= ntc;tc++) hora(tc);
	return 0;
}


Measured memory_bytes: 2560
fun main(args : Array<String>) {
    val (x, y) = readLine()!!.split(" ").map{it.toLong()}
    val lcm = lcm(x, y)

    for (i in x..lcm) {
        if (i % x == 0L && i % y != 0L) {
            println(i)
            return
        }
    }

    println(-1)
}

fun gcd(a : Long, b : Long) : Long {
    return if (a % b == 0L) b else gcd(b, a % b)
}

fun lcm(a : Long, b : Long) : Long {
    return (a * b) / gcd(a, b)
}


Measured memory_bytes: 37880
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cctype>
#include <cstring>
#include <iostream>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
#define int long long
#define lowbit(x) (x &(-x))
#define me(ar) memset(ar, 0, sizeof ar)
#define mem(ar,num) memset(ar, num, sizeof ar)
#define rp(i, n) for(int i = 0, i < n; i ++)
#define rep(i, a, n) for(int i = a; i <= n; i ++)
#define pre(i, n, a) for(int i = n; i >= a; i --)
#define IOS ios::sync_with_stdio(0); cin.tie(0);cout.tie(0);
const int way[4][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
const int  INF = 0x3f3f3f3f3f3f3f3f;
const double PI = acos(-1.0);
const double EXP = 1e-8;
const ll   MOD = 1e9 + 7;
const int  N = 2e5 + 5;
int h, w;
char mp[105][105];
int dp[105][105];
signed main()
{
    IOS;
    cin >> h >> w;
    for(int i = 1; i <= h; i ++)
        for(int j = 1; j <= w; j ++)
            cin >> mp[i][j];
    if(mp[1][1] == '#') dp[1][1] = 1;
    for(int i = 1; i <= h; i ++){
        for(int j = 1; j <= w; j ++){
            if(i == 1 && j == 1) continue;
            dp[i][j] = INF;
            if(i > 1) dp[i][j] = min(dp[i][j], dp[i - 1][j] + (mp[i][j] == '#' && mp[i - 1][j] == '.'));
            if(j > 1) dp[i][j] = min(dp[i][j], dp[i][j - 1] + (mp[i][j] == '#' && mp[i][j - 1] == '.'));
        }
    }
    cout << dp[h][w] << endl;
    return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define int long long
#define ii pair < int , int >
#define fi first
#define se second

using namespace std;
const int N=1e3+55;
char g[N][N];
int dp[N][N];
int MOD=1e9+7;
main()
{
	ios::sync_with_stdio(false);
	int n,m;
	cin>>n>>m;
	for(int i=0;i<n;i++)
		for(int j=0;j<m;j++)
			cin>>g[i][j];
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<m;j++)
		{
			if(g[i][j]=='#')
				continue ;
			if(i==0&&j==0)
				dp[i][j]=1;
			else if(i==0)
				dp[i][j]=dp[i][j-1];
			else if(j==0)
				dp[i][j]=dp[i-1][j];
			else
				dp[i][j]=dp[i-1][j]+dp[i][j-1];
			dp[i][j]%=MOD;
		}
	}
			
			
	cout<<dp[n-1][m-1]<<endl;
	return 0;
}


Measured memory_bytes: 9600
t,x,y = 0, 0, 0
for i in range(int(input())):
    next_t,next_x,next_y = map(int, input().split())
    dist = abs(next_x - x) + abs(next_y - y)
    time = next_t - t
    if dist > time or (dist - time) % 2 == 1:
        print("No")
        exit(0)
    t,x,y = next_t,next_x,next_y
print("Yes")
    

Measured memory_bytes: 9044
#include<stdio.h>
#define MAX 100000

int parent_key(int i){
	return i/2;
}

int left_key(int i){
	return 2*i;
}

int right_key(int i){
	return 2*i+1;
}

int main(){
 int i;
 int n;
 int id[MAX];

 scanf("%d", &n);/*回数*/

 for(i=0; i<n; i++){
   scanf("%d", &id[i+1]);
}

 //出力 (output)
 for(i=1; i<=n; i++) {
 	printf("node %d: key = %d, ",i,id[i]);
 	if(i > 1) printf("parent key = %d, ",id[parent_key(i)]);
 	if(left_key(i) <= n) printf("left key = %d, ",id[left_key(i)]);
 	if(right_key(i) <= n) printf("right key = %d, ",id[right_key(i)]);
 	printf("\n");
 }
 return 0;
}


Measured memory_bytes: 2048
#include<iostream>
using namespace std;
int gcd(int a,int b) {
    if(a<b)return gcd(b,a);
    else if(b == 0)return a;
    else return gcd(b,a%b);
}
int main() {
    int W,H,C;
    cin >> W >> H >> C;
    int d = gcd(W,H);
    cout << (W/d)*(H/d)*C << endl;
}


Measured memory_bytes: 3112
#include <iostream>
#include <string>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  string S;
  cin >> S;
  if (S == "SUN") {
    cout << 7 << endl;
  } else if (S == "MON") {
    cout << 6 << endl;
  } else if (S == "TUE") {
    cout << 5 << endl;
  } else if (S == "WED") {
    cout << 4 << endl;
  } else if (S == "THU") {
    cout << 3 << endl;
  } else if (S == "FRI") {
    cout << 2 << endl;
  } else {
    cout << 1 << endl;
  }
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<map>
#include<set>
#include<tuple>
#include<cmath>
#include<iomanip>


#define MOD 1000000007
#define INF 1001001001
#define MIN -1001001001
#define rep(i,k,N) for(int i=k;i<N;i++)
#define MP make_pair
#define MT make_tuple //tie,make_tuple は別物
#define PB push_back
#define PF push_front
#define all(x) (x).begin(),(x).end()


using namespace std;
typedef long long ll;
typedef vector<ll> v;
typedef vector<vector<ll>> vv;

int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
void YN(bool ans){
    if(ans)cout<<"YES"<<endl;
    else cout <<"NO"<<endl;
    return;
}
int main(){
    ll a,b,x;
    cin>>a>>b>>x;
    YN(a+b>= x && x >=a);
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
	int n, k;
	unsigned long res = 1;
	scanf("%d %d", &n, &k);
	res = k;
	for(int i = 1; i < n; i++)
		res *= k - 1;
	printf("%ld\n", res);
	return 0;
}


Measured memory_bytes: 128
// Problem : B - Common Raccoon vs Monster
// Contest : AtCoder Beginner Contest 153
// URL : https://atcoder.jp/contests/abc153/tasks/abc153_b
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/coder3101/cp-editor)

#include<bits/stdc++.h>
using namespace std;
int main()
{
        int h,n;
        cin >> h >> n;
        long long int sum=0;
        for(int i=0;i<n;i++)
        {
                int temp;
                cin >> temp;
                sum+=temp;
        }
        if(sum>=h)
        cout << "Yes" << endl;
        else
        cout << "No " << endl;
	return 0;
}

Measured memory_bytes: 256
program disjoint_set_of_common_divisors
  implicit none
  integer(8) :: a, b, g, p
  integer :: n, i, j, m = 1
  logical, allocatable :: u(:)
  read(*,*) a, b
  g = gcd(a,b)
  n = ceiling(sqrt(real(g,8)+0.5d0))
  allocate(u(n))
  u = .false.
  u(1) = .true.
  do i = 1, n
    if (u(i)) cycle
    do j = i, n, i
      u(j) = .true.
    end do
    p = int(i,8)
    if (mod(g,p) /= 0_8) cycle
    m = m+1
    do while (mod(g,p) == 0_8)
      g = g/p
    end do
  end do
  if (g /= 1_8) m = m+1
  write(*,'(i0)') m
contains
  integer(8) function gcd(a,b)
    integer(8), intent(in) :: a, b
    integer(8) :: x, y
    x = max(a,b)
    y = min(a,b)
    do while (y > 0_8)
      gcd = y
      y = mod(x,y)
      x = gcd
    end do
  end
end program disjoint_set_of_common_divisors

Measured memory_bytes: 4096
#include <stdio.h>
int SelectionSort(int *a,int b);

int main(int argc, const char * argv[]) {
  int a[100],n,i;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
  }
  printf("%d\n",SelectionSort(&a,n));
}

int SelectionSort(int *a,int n){
  int i,j,tmp,minj,count=0;

  for(int i=0;i<n;i++){
    minj=i;
    for(j=i;j<n;j++){

      if(a[j]<a[minj]){
        minj=j;
      }

    }
    if(a[i]>a[minj]){
      tmp=a[minj];
      a[minj]=a[i];
      a[i]=tmp;
      count++;
    }
  }

  for(i=0;i<n-1;i++){
    printf("%d ",a[i]);
  }
  printf("%d\n",a[i]);
  return count;
}



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

using namespace std;
using ll = long long;
 
#define rep(i, n)      for (int i = 0; i < (n); i++)
#define repr(i, n)     for (int i = (n) - 1; i >= 0; i--)
#define repe(i, l, r)  for (int i = (l); i < (r); i++)
#define reper(i, l, r) for (int i = (r) - 1; i >= (l); i--)
#define repi(i, l, r)  for (int i = (l); i <= (r); i++)
#define repir(i, l, r) for (int i = (r); i >= (l); i--)
#define range(a) a.begin(), a.end()
void initio() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }

int main() { initio();
  string s[] = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
  string t; cin >> t;
  int k = find(s, s + 7, t) - s;
  cout << (k == 0 ? 7 : 7 - k) << endl;
}


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

#define F first
#define S second 
#define mp make_pair
#define pb push_back
#define pf push_front
#define speed_up ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define sz(x) (int)x.size()
#define szc(x) (int)strlen(x)
#define all(x) x.begin(), x.end()
#define debug cerr << "OK\n";
#define ub upper_bound
#define lb lower_bound 
#define y1 y_1
#define x1 y_2
 
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vpii;
typedef set <int> si;
typedef set <ll> sll;
typedef multiset <int> msi;
typedef multiset <ll> msll;
typedef map <int, int> mi;
typedef map <ll, int> mll;
 
const int N = 200 + 20;
const int M = 1e6 + 2;
const int mod = 998244353;
const int inf = 2e9 + 3;
const ll INF = 1e16;

void data() {
	#ifdef PC
		freopen("main.in", "r", stdin);
		freopen("main.out", "w", stdout);
	#endif
}

/*
	BIN POISK EBANA V ROT
	DP EBANA V ROT
	DO EBANA V ROT
*/

ll d, t, s;

int main() {
	data();
	cin >> d >> t >> s;
	ld T = d / s;
	if (t * s >= d)
		cout << "Yes\n";
	else
		cout << "No\n";	
}

Measured memory_bytes: 3600
#include <iostream>
#include <fstream>
#include <vector>
#include <utility>
#include <map>
#include <set>
#include <list>
#include <deque>
#include <queue>
#include <stack>
#include <forward_list>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <string>
#include <bitset>
#include <memory>
#include <chrono>
#include <cmath>
#include <cstdio>
#include <ctime>
#include <cstring>
#include <cstdlib>
#include <cstdint>

using namespace std;

set<int> prime;

void calc_prime(int mm) {
    int cur = 2;
    while(cur <= mm) {
        for(auto itr = prime.begin();itr != prime.end();itr++) {
            if(cur % *itr == 0)
                goto not_prime;
        }
        prime.insert(cur);
    not_prime:
        cur++;
    }
}
/*
int main(void) {
    int n,res = 0;
    cin >> n;
    if(n % 2 == 0)
        res = n;
    else
        res = 2 * n;
    cout << res << endl;
    return 0;
}
 */
/*
int main(void ) {
    int n;
    int maxn = 0,minn = 1000000001;
    cin >> n;
    for(int i = 0;i < n;i++) {
        int t;
        cin >> t;
        maxn = max(maxn,t);
        minn = min(minn,t);
    }
    cout << maxn - minn << endl;
}
 */

int n;
long long int a[200000],sum = 0;

long long int abs_(long long int n) {
    if(n < 0)
        return n * -1;
    else
        return n;
}

long long int calcn(long long int avg) {
    long long int ret = 0;
    for(int i = 0;i < n;i++) {
        ret = ret + abs_(avg - a[i]);
    }
    return ret;
}

int main(void ) {
    cin >> n;
    for(int i = 0;i < n;i++) {
        cin >> a[i];
        a[i] = a[i] - (i+1);
    }
    sort(a,a+n);
    long long int avg = a[n/2];
    long long int ret = min(min(calcn(avg+1),calcn(avg-1)),calcn(avg));
    cout << ret << endl;
}


Measured memory_bytes: 1792
#include <iostream>
using namespace std;
int main(void){
    int a, b;
    cin >> a >> b;
    if (a < b) {
        cout << "a < b" << endl;
    }
    else if (a > b) {
        cout << "a > b" << endl;
    }
    else {
        cout << "a == b" << endl;
    }
}



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

using namespace std;
typedef long long ll;

//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=ll(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=ll(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) x.begin(),x.end() //sortなどの引数を省略したい
#define SIZE(x) ll(x.size()) //sizeをsize_tからllに直しておく
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define Umap unordered_map
#define Uset unordered_set

int main(){
    ll n;
    cin >> n;
    ll ans = n * (n - 1);
    ans /= 2;
    cout << ans;
    return 0;
}

Measured memory_bytes: 3616
#include <stdio.h>
#include <string.h>
void cpy(int src[],int dst[],int n){
	for(int i=0;i<n;i++) dst[i]=src[i];
}
void OFA(int S[],int n){
	int num[100];
	memset(num,0,sizeof(num));
	for(int i=0;i<n;i++) num[S[i]]++;
	for(int i=0;i<n;i++) S[i]=num[S[i]];
}

bool check(int S[],int tmp[],int n){
	for(int i=0;i<n;i++) if(S[i]!=tmp[i]) return false;
	return true;
}

int main(){
	int S[12],tmp[12],n,count;
	while(1){
		scanf("%d",&n);
		if(!n) break;
		count=-1;
		for(int i=0;i<n;i++) scanf("%d",&S[i]);
		cpy(S,tmp,n);
		do{
			cpy(tmp,S,n);
			OFA(tmp,n);
			//for(int i=0;i<n;i++) printf("%d ",tmp[i]);
			count++;
		}while(!check(S,tmp,n));
		printf("%d\n",count);
		for(int i=0;i<n-1;i++) printf("%d ",S[i]);
		printf("%d\n",S[n-1]);
	}
	return 0;
}

Measured memory_bytes: 1028
#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  /* code */
  string s ;
  string answer = "Yes";
  cin >> s;
  
  for (int i = 0; i < s.length(); i++) {
    /* code */
    if (i%2 == 0) {
      /* code */
      if (s[i]=='L') {
        /* code */
        answer = "No";
      }
    }else{
      if (s[i]=='R') {
        /* code */
        answer="No";
      }
    }
  }


  cout << answer << "\n";
  
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define REP(i, n) rep(i, 0, n)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e12;

int n;
vector<P> es;
vector<int> G[110];  
int cnt[110];

void dfs(int now, int pre, int level){
    chmax(cnt[level], (int)(G[now].size() - 1));
    rep(i, 0, G[now].size()){
        int nxt = G[now][i];
        if(nxt == pre) continue;
        dfs(nxt, now, level + 1);
    }
    return;
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> n;
    rep(i, 0, n - 1){
        int a, b;
        cin >> a >> b;
        a--; b--;
        es.push_back(P(a, b));
        G[a].push_back(b);
        G[b].push_back(a);
    }
    int color, leaf, ans = -1, MINcolor = n;
    rep(i, 0, n - 1){
        memset(cnt, 0, sizeof(cnt));
        dfs(es[i].first, es[i].second, 0);
        dfs(es[i].second, es[i].first, 0);
        leaf = 2;
        rep(j, 0, n){
            if(cnt[j] == 0){
                color = j + 1; break;
            }
            // cout << cnt[j] << ' ';
            leaf *= cnt[j];
        }
        if(MINcolor > color){
            MINcolor = color;
            ans = leaf;
        }else if(MINcolor == color){
            chmin(ans, leaf);
        }
        // cout << endl;
        // cout << " " << i << " " << color << ' ' << leaf << endl;    
    }
    rep(i, 0, n){
        memset(cnt, 0, sizeof(cnt));
        dfs(i, -1, 0);
        leaf = 1;
        cnt[0]++;
        rep(j, 0, n){
            if(cnt[j] == 0){
                color = j + 1; break;
            }
            // cout << cnt[j] << ' ';
            leaf *= cnt[j];
        }
        if(MINcolor > color){
            MINcolor = color;
            ans = leaf;
        }else if(MINcolor == color){
            chmin(ans, leaf);
        }
        // cout << endl;
        // cout << " " << i << " " << color << ' ' << leaf << endl;   
    }
    cout << MINcolor << ' ' << ans << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(int argc, char const *argv[])
{
	int n;
	int int_a[100];
	int i;


	scanf("%d", &n);
	for (i = 0; i < n; i++){
		scanf("%d ", &int_a[i]);
	}
	for (i = 0; i < n; i++)
	{
		if(i)printf(" ");	//i が１以上のとき、つまり最初の要素でないとき、空白を入力
		printf("%d", int_a[n-i-1]);	
	}
		
		printf("\n");
	return 0;
}


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

main() {
    int n;
    cin >> n;
    vector <int> a(n, 0);
    rep(i, 0, n) {
        scanf("%d", &a[i]);
    }
    sort(a.begin(), a.end());
    if (n % 3) {
        if (a[0] != a[n - 1]) {
            puts("No");
        } else {
            puts("Yes");
        }
    } else {
        int f = 1;
        if ((a[0] ^ a[n / 3] ^ a[(n/3) * 2]) != 0) {
            f = 0;
        }
        rep(i, 0, n / 3) {
            rep(j, 0, 3) {
                if (a[j * (n/3)] != a[j * (n/3) + i]) {
                    f = 0;
                }
            }
        }
        puts(f ? "Yes" : "No");
    }
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,(n)-1,0)
#define all(v) v.begin(), v.end()
#define endk '\n'
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;
const ld eps = 1e-10;
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b){if(a>b) a=b;}
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b){if(a<b) a=b;}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n, k; cin >> n >> k;
  vector<ll> A(n), B(n);
  map<ll, ll> cnt;
  rep(i, n) {
    cin >> A[i] >> B[i];
    cnt[A[i]] += B[i];
  }
  for(auto ele: cnt) {
    if(k <= ele.second) {
      cout << ele.first << endk;
      break;
    } else {
      k -= ele.second;
    }
  }
  return 0;
}


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

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

long long int ans = 0;
    int prev = -1;
	for(int n = 0; n < N - 1; ++n) {
		int b;
		cin >> b;
		if (n == 0) {
			ans += b;
		} else {
			ans += min(b, prev);
		}
		prev = b;
	}
	ans += prev;
	cout << ans << endl;
	
	return 0;
}

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

int f(const void *a,const void *b){
  return strcmp((char*)a,(char*)b);
}

int main(){
  int N;
  scanf("%d\n",&N);
  char S[200002][12];
  for(int i=0;i<N;i++)
    scanf("%s\n",S[i]);
  qsort((void*)S,N,sizeof(S[0]),f);
  int max=1;
  int c=1;
  for(int i=0;i<N-1;i++){
    if(strcmp(S[i],S[i+1])==0) c++;
    else c=1;
    if(max<c) max=c;
  }
  for(int i=0;i<N-max+1;i++){
    if(strcmp(S[i],S[i+max-1])==0)
      printf("%s\n",S[i]);
  }
  return 0;
}

Measured memory_bytes: 6252
import sys

Data = []
Status = [[0]*3 for _ in range(3)]
for i in range(3):
    Data.append(list(map(int,input().split())))
N = int(input())
for i in range(N):
    b = int(input())
    
    for y in range(3):
        for x in range(3):
            if b == Data[y][x]:
                Status[y][x] = 1

for y in range(3):
    if Status[y][0] == 1 and Status[y][1] == 1 and Status[y][2] == 1:
        print('Yes')
        sys.exit()
for x in range(3):
    if Status[0][x] == 1 and Status[1][x] == 1 and Status[2][x] == 1:
        print('Yes')
        sys.exit()
if Status[0][0] == 1 and Status[1][1] == 1 and Status[2][2] == 1:
    print('Yes')
    sys.exit()
if Status[0][2] == 1 and Status[1][1] == 1 and Status[2][0] == 1:
    print('Yes')
    sys.exit()
print('No')


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

int main()
{
    ios::sync_with_stdio(false);
    int n, total = 0;

    cin >> n;
    string ans, s = to_string(n);

    for (auto i : s)
    {
        total += i-'0';
    }
    
    ans = (n % total==0) ? "Yes" : "No";

    cout << ans << endl;

    return 0;
}

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

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 = """6 3 4
3
1
3
2"""
        output = """No
No
Yes
No
No
No"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """6 5 4
3
1
3
2"""
        output = """Yes
Yes
Yes
Yes
Yes
Yes"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """10 13 15
3
1
4
1
5
9
2
6
5
3
5
8
9
7
9"""
        output = """No
No
No
No
Yes
No
No
No
Yes
No"""
        self.assertIO(input, output)

def resolve():
    (N,K,Q)=(int(i) for i in input().split())
    A=[K-Q for i in range(N)]
    for i in range(Q):
        A[int(input())-1]+=1
    count=0
    for i in A:
        print("Yes" if i>0 else 'No')




if __name__ == "__main__":
    resolve()

Measured memory_bytes: 62876
#include <iostream>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>

#define _GLIBCXX_DEBUG
#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
using namespace std;
using vi = vector<int64_t>;
using vvi = vector<vi>;

int main(int argc, const char * argv[]) {
    // fasten cin
    cin.tie(0);
    ios::sync_with_stdio(false);
    // implement
    string s;
    cin >> s;
    if(s.find('a')!=-1 && s.find('b')!=-1 && s.find('c')!=-1){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}


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

int main(){
  string s,t;
  cin >> s >> t;
  bool flag = false;
  for(int i=0;i<s.size();i++){
      if(s==t){
          flag = true;
          break;
      }
      else s = s.back()+s.substr(0,s.size()-1);
  }
  if(flag) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 384
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<iostream>
#include<algorithm>
#include<map>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<string>
using namespace std;

int main() {
	char str;
	while (cin >> str) {
		if (str == 'A') {
			cout << "T" << endl;
		}
		else if (str == 'T') {
			cout << "A" << endl;
		}
		else if (str == 'C') {
			cout << "G" << endl;
		}
		else {
			cout << "C" << endl;
		}
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(void) {
    int n,x,count=0,tmp=100000;
    cin>>n;
    for (int i=0;i<n;i++) {
        cin>>x;
        while (x%2==0) {
            x=x/2;
            count++;
        }
        if (tmp>count) {
            tmp=count;
        }
        count=0;
    }
    cout<<tmp<<endl;
}


Measured memory_bytes: 256
from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
    return int(input())

def rl():
    return list(map(int, input().split()))

def egcd(a, b):
    if a == 0:
        return (b, 0, 1)
    else:
        g, y, x = egcd(b % a, a)
        return (g, x - (b // a) * y, y)

def modinv(a, m):
    g, x, y = egcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m

def solve():
    n, m, k = rl()
    mod = 998244353
    ans = 0
    C = 1
    for d in range(k + 1):
        # print (d)
        ans += m * pow(m - 1, n - 1 - d, mod) * C
        ans %= mod
        C = (C * (n - 1 - d) * modinv(d + 1, mod)) % mod
    print (ans)





mode = 's'

if mode == 'T':
    t = ri()
    for i in range(t):
        solve()
else:
    solve()


Measured memory_bytes: 75636
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor, atan2
from operator import mul
from functools import reduce
sys.setrecursionlimit(10 ** 9)



INF = 10 ** 20
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 10 ** 9 + 7


n = I()
xy = []
for x, y in LIR(n):
    xy += [(atan2(y, x), x, y)]


xy.sort()
xy += xy

cs = [(0, 0)]
for _, x, y in xy:
    cs += [(cs[-1][0] + x, cs[-1][1] + y)]


ans = 0
for i in range(n):
    for j in range(i + 1, i + n + 1):
        x1, x2 = cs[i][0], cs[j][0]
        y1, y2 = cs[i][1], cs[j][1]
        ans = max(ans, (x2 - x1) ** 2 + (y2 - y1) ** 2)


print(ans ** 0.5)




Measured memory_bytes: 39280
#include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<set>
#include<string>
#include<map>
#include<string.h>
#include<complex>
#include<math.h>
#include<queue>
#include<time.h>
using namespace std;
typedef long long int llint;
typedef pair<int, int> pint;
typedef vector<bool> vbool;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<llint> vllint;
typedef vector<vllint> vvllint;
typedef vector<pair<int, int>> vpint;
typedef vector<pair<llint, llint>> vpllint;
#define rep(i,n) for(int i=0;i<n;i++)
#define drep(i,n) for(int i=n-1;0<=i;i--)
#define yes(ans) if(ans)cout<<"yes"<<endl;else cout<<"no"<<endl;
#define Yes(ans) if(ans)cout<<"Yes"<<endl;else cout<<"No"<<endl;
#define YES(ans) if(ans)cout<<"YES"<<endl;else cout<<"NO"<<endl;
#define POSSIBLE(ans) if(ans)cout<<"POSSIBLE"<<endl;else cout<<"IMPOSSIBLE"<<endl;
#define Pi 3.1415926535897932384626
#define coutans rep(i, ans.size())cout << ans[i] << endl;

class UnionFind {
public:
	//親の番号を格納する。親だった場合は-(その集合のサイズ)
	vector<int> Parent;

	//作るときはParentの値を全て-1にする
	//こうすると全てバラバラになる
	UnionFind(int N) {
		Parent = vector<int>(N, -1);
	}

	//Aがどのグループに属しているか調べる
	int root(int A) {
		if (Parent[A] < 0) return A;
		return Parent[A] = root(Parent[A]);
	}

	//自分のいるグループの頂点数を調べる
	int size(int A) {
		return -Parent[root(A)];//親をとってきたい
	}

	//AとBをくっ付ける
	bool connect(int A, int B) {
		//AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
		A = root(A);
		B = root(B);
		if (A == B) {
			//すでにくっついてるからくっ付けない
			return false;
		}

		//大きい方(A)に小さいほう(B)をくっ付けたい
		//大小が逆だったらひっくり返しちゃう。
		if (size(A) < size(B)) swap(A, B);

		//Aのサイズを更新する
		Parent[A] += Parent[B];
		//Bの親をAに変更する
		Parent[B] = A;

		return true;
	}
};

//aとbの最大公約数を求めるよ
long long GCD(long long a, long long b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}

// 返り値: a と b の最大公約数
// ax + by = gcd(a, b) を満たす (x, y) が格納される
long long extGCD(long long a, long long b, long long& x, long long& y) {
	if (b == 0) {
		x = 1;
		y = 0;
		return a;
	}
	long long d = extGCD(b, a % b, y, x);
	y -= a / b * x;
	return d;
}

bool check(int a, int b) {
	return a > b;
}

// mod. m での a の逆元 a^{-1} を計算する
long long modinv(long long a, long long m) {
	long long b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}

//aCbを1000000007で割った余りを求める
llint convination(llint a, llint b) {
	llint ans = 1;
	for (llint i = 0; i < b; i++) {
		ans *= a - i;
		ans %= 1000000007;
	}
	for (llint i = 1; i <= b; i++) {
		ans *= modinv(i, 1000000007);
		ans %= 1000000007;
	}
	return ans;
}

int main() {
	string s;
	getline(cin, s);
	rep(i, s.size()) {
		if ('a' <= s[i] && s[i] <= 'z') {
			s[i] = (char)s[i] - 32;
		}
		else if ('A' <= s[i] && s[i] <= 'Z') {
			s[i] = (char)s[i] + 32;
		}
	}
	cout << s << endl;
	return 0;
}


Measured memory_bytes: 3152
#include <bits/stdc++.h>
using namespace std;
int sum(vector<int> v,int l){
  int s=0;
  for(int i=0;i<l;i++){
    s += v[i];
  }
  return s;
}
  
int main() {
  int N,K;
  cin >>N>>K;
  vector<int> l(N);
  for(int i =0;i<N;i++){
    cin >> l[i];
  }
  sort(l.begin(),l.end());
  reverse(l.begin(),l.end());
  cout << sum(l,K) <<endl;
}



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

using namespace std;

#define int long long
#define all(v) (v).begin(), (v).end()
#define resz(v, ...) (v).clear(), (v).resize(__VA_ARGS__)
#define reps(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep(i, n) reps(i, 0, n)

template<class T1, class T2> void chmin(T1 &a, T2 b){if(a>b)a=b;}
template<class T1, class T2> void chmax(T1 &a, T2 b){if(a<b)a=b;}

typedef pair<int, int> Pi;
typedef tuple<int, int, int> Ti;
typedef vector<int> vint;

const int inf = 1LL << 55;
const int mod = 1e9 + 7;

signed main()
{
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  int N;
  cin >> N;
  vint l(N), r(N);
  int ans = 0;
  rep(i, N) {
    cin >> l[i] >> r[i];
    ans += r[i]-l[i]+1;
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <numeric>
#include <cmath>
#include <cstdlib>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)
#define ALL(x) x.begin(), x.end()
#define INF (1001000000)
#define SZ(a) int((a).size())
#define EACH(i,c) for(auto i:c)
#define EXIST(cs,v) (find(ALL(cs),(v))!=cs.end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define UNIQ(c) (c).erase(unique((c).begin(),(c).end()), (c).end());
#define P(p) cout<<(p)<<endl;

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

    int a, b;
    cin >> a >> b;

    if (a * b  %2 == 1 || a * b * 3 %2 == 1) {
        P("Yes");
    }
    else {
        P("No");
    }

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<tuple>
#include<vector>
#include<algorithm>
#include<iterator>
#include<cmath>
#include<functional>
using namespace std;

int main(){
    int N, K;
    cin >> N >> K;
    vector<long long> A(N);
    for(int i=0; i<N; i++){
        cin >> A.at(i);
    }
    vector<long long> B;
    for(int i=0; i<N; i++){
        long long r = A.at(i);
        B.push_back(r);
        for(int j=i+1; j<N; j++){
            r += A.at(j);
            B.push_back(r);
        }
    }
    vector<int> a;
    for(int i=41; i>-1; i--){
        long long x = 1LL << i;
        vector<long long> n;
        for(auto it=B.begin(); it != B.end(); ++it){
            if((*it & x) == x){
                n.push_back(*it);
            }
        }
        if(n.size() >= K){
            a.push_back(i);
            B = n;
            break;
        }
    }
    if(a.empty()){
        cout << 0 << endl;
        return 0;
    }
    for(int i=a.at(0)-1; i>-1; i--){
        vector<long long> n;
        long long x = 1LL << i;
        for(auto it=B.begin(); it != B.end(); ++it){
            if((*it & x) == x){
                n.push_back(*it);
            }
        }
        if(n.size() >= K){
            a.push_back(i);
            B = n;
        }
    }
    long long r = 0;
    for(auto it=a.begin(); it != a.end(); ++it){
        r += (1LL << *it);
    }
    cout << r << endl;
}



Measured memory_bytes: 9004
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(),(x).end()
#define LL long long
#define pii pair<int,int>

using namespace std;

int N;
vector<int> edge[100001];
pair<int,int> range[100001];
bool used[100001];
int num[100001];

int lower = -1000000000;
int upper =  1000000000;

pii DFS(int v,bool isodd){
    used[v]=true;
    pii r = range[v];

    //自身のノードが設定されていて
    //偶奇条件を満たさない
    if(r != make_pair(lower,upper)) if(isodd&&r.second%2==0||!isodd&&r.second%2==1)return {upper,lower};

    REP(i,edge[v].size()){
        if(!used[edge[v][i]]){
            pii rec = DFS(edge[v][i],!isodd);
            r.first = max(r.first,rec.first-1);
            r.second= min(r.second,rec.second+1);
        }
    }
    if(r.first>r.second)return {upper,lower};
    return range[v] = r;
}

void write(int v,int pare){
    used[v]=true;
    num[v] = (pare+1 >=range[v].first && pare+1 <= range[v].second ? pare+1 : pare-1);
    REP(i,edge[v].size())if(!used[edge[v][i]])write(edge[v][i],num[v]);
}

int main(){

    cin>>N;
    REP(i,N-1){
        int a,b;cin>>a>>b;
        edge[--a].push_back(--b);
        edge[b].push_back(a);
    }
    int K;cin>>K;

    REP(i,N)range[i]={lower,upper};
    fill_n(used,N,false);

    int root;
    REP(i,K){
        int v,p;cin>>v>>p;
        range[--v]={p,p};
        root = v;
    }

    pii res = DFS(root,range[root].second%2==1);
    if(res.first>res.second){
        cout<<"No"<<endl;
        return 0;
    }
    cout<<"Yes"<<endl;
    fill_n(used,N,false);
    write(root,range[root].first-1);

    REP(i,N)cout<<num[i]<<endl;
    return 0;
}

Measured memory_bytes: 15488
N, A, B, C, D = map(int, input().split())
if D == 0:
    if A == B:
        print('YES')
    else:
        print('NO')
    exit()

else:
    for i in range(N):
        if C * (N - 1 - i) - D * i <= B - A <= -C * i + (N - 1 - i) * D:
            print('YES')
            exit()
    print('NO')


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

int main() {
    int N, M; cin >> N >> M;
    vector<int> X(M);
    for (auto& xi : X) cin >> xi;
    sort(X.begin(), X.end());
    vector<int> diff(M - 1);
    for (int i = 0; i < M - 1; i++) {
        diff[i] = abs(X[i] - X[i + 1]);
    }
    sort(diff.begin(), diff.end());
    int res = 0;
    for (int i = 0; i < (M - 1) - (N - 1); i++) {
        res += diff[i];
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 1024
D = [[-1, 0], [1, 0], [0, -1], [0, 1]]

def puyo_rensa(cnt, fld)
  check = 14.times.map{ [false] * 8 }
  res = 0
  (1..12).each do |i|
    (1..6).each do |j|
      if !check[i][j] && fld[i][j] =~ /[^O.]/
        puyo_connector(i, j,fld){ |arr|
          if arr.size >= 4
            arr.each do |s, t|
              D.each do |x, y|
                p, q = s + x, t + y
                check[p][q] = true if fld[p][q] == 'O'
              end
              check[s][t] = true
            end
            res = 1
          end
        }
      end
    end
  end
  fld = fld.transpose
  check = check.transpose
  (1..6).each do |i|
    fld[i].map!.with_index{ |c, j| c unless check[i][j] }.compact!
    (14 - fld[i].size).times{ fld[i].unshift('.') }
  end
  fld = fld.transpose
  if res == 1 then puyo_rensa(cnt + 1, fld)
  else cnt
  end
end

def puyo_connector(i, j, fld)
  check = 14.times.map{ [false] * 8 }
  arr = [[i, j]]
  ret = [[i, j]]
  check[i][j] = true
  until arr.empty?
    i, j = arr.shift
    D.each do |x, y|
      p, q = i + x,  j + y
      if !check[p][q] && fld[i][j] == fld[p][q]
        check[p][q] = true
        arr << [p, q]
        ret << [p, q]
      end
    end
  end
  yield(ret)
end

gets.to_i.times do
  fld = 14.times.map{ ['.'] * 8 }
  12.times do |i|
    gets.chomp.split('').each_with_index do |c, j|
      fld[i+1][j+1] = c
    end
  end
  p puyo_rensa(0, fld)
end

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

// {{{
#[allow(unused)]
macro_rules! debug {
    ($($format:tt)*) => (write!(std::io::stderr(), $($format)*).unwrap());
}
#[allow(unused)]
macro_rules! debugln {
    ($($format:tt)*) => (writeln!(std::io::stderr(), $($format)*).unwrap());
}


macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut 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:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
// }}}

fn main() {
    input! {
        n: usize,
        s: chars,
        t: chars,
    }

    let mut ans = String::new();
    for i in 0..n {
        ans.push(s[i]);
        ans.push(t[i]);
    }

    println!("{}", ans);
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
#define all(v) (v).begin(), (v).end()
#define lp(i, n) for (int i = 0; i < (n) ; ++i)
#define sz(v) (int)(v).size()
#define int long long
#define mod 1000000007

int32_t main(){
ios::sync_with_stdio(0), cin.tie(NULL), cout.tie(NULL);
        int n,k, q; cin >> n>> k>> q;
        vector<int> v(n, k-q);
        lp(i, q) {
                int a; cin >> a;
                a--;
                v[a]++;
        }
        lp(i, n) cout << (v[i] > 0? "Yes\n": "No\n");
return 0;
}



Measured memory_bytes: 1408
a = list(map(int,input().split()))
b = a[0] - a[2]
if b <= 0:
  ans = a[1] + b
  if ans < 0:
    print('0 0')
  else:
    print('0 {}'.format(ans))
elif b == 0:
  print('0 {}'.format(a[1]))

elif b > 0:
  print('{} {}'.format(b, a[1]))

Measured memory_bytes: 3060
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <bitset>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <time.h>
#include <random>
#include <string>
#include <cassert>
#include <vector>
#include <ostream>
#include <istream>
#include <stack>
#include <deque>
#include <queue>
#include <functional>
#include <chrono>
#include <stack>

using namespace std;

#define int long long
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define pii pair<int, int>
#define ld long double

ostream& operator<< (ostream &out, const vector<int> &b) {
    for (auto k : b) out << k << " ";
    return out;
}

istream& operator>> (istream& in, pii& b) {
    in >> b.first >> b.second;
    return in;
}

ostream& operator<< (ostream& out, const pii& b) {
    out << "{" << b.first << ", " << b.second << "}";
    return out;
}

template <typename T1, typename T2> inline bool chkmin(T1 &x, const T2 &y) {if (x > y) {x = y; return 1;} return 0;}
template <typename T1, typename T2> inline bool chkmax(T1 &x, const T2 &y) {if (x < y) {x = y; return 1;} return 0;}


#ifdef LOCAL
    #define dbg(x) cout << #x << " : " << (x) << "\n";
    const int INF = 1e15;
    // const int mod = 2600000069;
    // const int p = 10;
#else
    #define dbg(x) 57
    const int INF = 1e15;
    // const int mod = 2600000069;
    // const int p = 179;
#endif

const ld PI = acos(-1);

#define time clock() / (double) CLOCKS_PER_SEC

// #pragma GCC optimize("Ofast,no-stack-protector")
// #pragma GCC target("sse,sse2,sse3,sse3,sse4")
// #pragma GCC optimize("unroll-loops")
// #pragma GCC optimize("fast-math")
// #pragma GCC target("avx2")  
// #pragma GCC optimize("section-anchors")
// #pragma GCC optimize("profile-values,profile-reorder-functions,tracer")
// #pragma GCC optimize("vpt")
// #pragma GCC optimize("rename-registers")
// #pragma GCC optimize("move-loop-invariants")
// #pragma GCC optimize("unswitch-loops")
// #pragma GCC optimize("function-sections")
// #pragma GCC optimize("data-sections")

mt19937 gen(chrono::high_resolution_clock::now().time_since_epoch().count());

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, k;
    cin >> n >> k;
    int s = sqrt(n) + 1;
    for (int b = 2; b <= s; b++) {
        int sum = 0;
        int x = n;
        while (x) {
            sum += x % b;
            x /= b;
        }
        if (sum == k) {
            cout << b << "\n";
            return 0;
        }
    }
    int ans = INF;
    if (n == k) {
        ans = n + 1;
    }
    for (int d1 = 1; d1 <= s; d1++) {
        int d2 = k - d1;
        if (d2 < 0) break;
        if ((n - d2) % d1) continue;
        int b = (n - d2) / d1;
        if (d2 >= b || b < 2) continue;
        chkmin(ans, b);
    }
    if (ans == INF) cout << "-1\n";
    else cout << ans << "\n";
}
/*

*/

Measured memory_bytes: 3712
#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include<algorithm>
#include<string>
#include <map>
#include <queue>
#include <stack>
#include <set>

#define DIV 1000000007
using namespace std;
using ll = long long;

int main() {
    int a, b, c;
    cin >> a >> b >> c;

    cout << c << " " << a << " " << b << endl;

    


}


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

int main ()
{
  int a,b;
  cin >> a >> b;
 
  if (a>b){
   cout << "a > b" << endl;
  }else if (a<b){
   cout << "a < b" << endl;
  }else{
   cout << "a == b" << endl;
  }
  return 0;
}

Measured memory_bytes: 1156
using System;
using System.Linq;

namespace WA055A
{
    class Program
    {
        static void Main(string[] args)
        {
            var line = Console.ReadLine().ToArray();

            int counter = 0;
            
            for(var i = 0; i < line.Length; i++)
            {
                if (line[i] == 'o') counter++;
            }

            Console.WriteLine(700 + 100 * counter);
        }
    }
}


Measured memory_bytes: 13268
#include<bits/stdc++.h>
#define speed ios::sync_with_stdio(false), cin.tie(0);
using namespace std;

int main()
{
  speed;
  int n,i;
  cin>>n;
  long long int p,ans=0;
  for (i=0;i<n;i++)
  {
    cin>>p;
    ans^=p;
  }
  if (ans)
  	cout<<"No"<<endl;
  else
    cout<<"Yes"<<endl;
}

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

using ll=long long;

using vi=vector<int>;
using vl=vector<ll>;
using vvi=vector<vi>;

int main() {
  string S,T; cin >>S >>T;
  int ans=T.size();
  rep(start,0,(int)(S.size()-T.size())+1) {
    int diff=0;
    rep(i,0,(int)T.size()) {
      if (T[i]!=S[start+i]) {
        diff++;
      }
    }
    ans=min(ans,diff);
  }
  cout <<ans <<endl;
  return 0;
}


Measured memory_bytes: 3612
MAX_D = 10**9
def solve():
    N,M = map(int, input().split())
    d = [[MAX_D]*N for _ in range(N)]
    edges = [[False]*N for _ in range(N)]
    base_edge = {}
    for _ in range(M):
        a,b,c = map(int, input().split())
        edges[a-1][b-1] = True
        edges[b-1][a-1] = True
        d[a-1][b-1] = c
        d[b-1][a-1] = c
        base_edge[(a-1,b-1)] = c
        base_edge[(b-1,a-1)] = c
        
    # ワーシャルフロイド法
    for k in range(N):
        for i in range(N):
            for j in range(N):
                if i != j and d[i][j] > d[i][k]+d[k][j]:
                    # print(i+1,k+1,j+1, d[i][j], d[i][k], d[k][j])
                    edges[i][j] = False
                    if (i,k) in base_edge and base_edge[(i,k)] == d[i][k]: edges[i][k] = True
                    if (k,j) in base_edge and base_edge[(k,j)] == d[k][j]: edges[k][j] = True
                    d[i][j] = d[i][k]+d[k][j]
                    
    # print(edges)
    print(M - sum(map(sum, edges))//2)
    
solve()

Measured memory_bytes: 3696
#include<bits/stdc++.h>
using namespace std;
#define M 1e9 + 5
#define C 998244353
#define pi 3.14159265359
#define loop(i,a,b) for(ll i = ll(a); i < ll(b); ++i)
#define rloop(i,a,b) for(ll i = ll(a); i >= ll(b); --i)
#define sloop(i,a) for (std::set<ll>::iterator i = a.begin(); i != a.end(); ++i)
#define pb push_back
typedef long long int ll;
typedef unsigned long long int ull;

int solve(){
    ll n,p,k=0,r,ans=0;
    char c;
    cin >> c;
    if(c>='a'&&c<='z')
        cout << 'a' << "\n";
    else
        cout << "A" << "\n";
    return 0;

}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t = 1;
    // cin >> t;
    loop(f,0,t){    
        solve();
    }   
}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int K;
    string S;
    cin >> K >> S;
    int len = S.size();
    if(K >= len){
    	cout << S;
    }
    else{
    	cout << S.erase(K)+"...";
    }
}

Measured memory_bytes: 3628
# coding: utf-8
# Your code here!

INPUT=input().split()

A_point = int(INPUT[0])
B_point = int(INPUT[1])
C_point = int(INPUT[2])
d       = int(INPUT[3])

A_B_between = abs(A_point - B_point)
A_C_between = abs(A_point - C_point)
B_C_between = abs(C_point - B_point)

if A_C_between <= d:
    print("Yes")
elif A_B_between <=d and B_C_between <= d:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3060