akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
	#include<vector>
	#include<string>
	#include<math.h>
	#define ll long long int 
	#define loop(a,b,i) for(int i=a;i<b;i++)
	#define loopr(a,b,i) for(int i=n-1;i>=0;i--)
	#define pb push_back
	#define db double
	#define mp make_pair
	#define endl "\n"
	#define f first
	#define se second
	#define all(x) x.begin(),x.end()
	#define MOD 1000000007
	#define N 8
	#define quick ios_base::sync_with_stdio(false);cin.tie(NULL)
	using namespace std;
	
//	bool isPrime(int n)
//	{
//    	if(n <= 1) return false;
//     	if(n == 2) return true;
//    	if(n % 2 == 0) return false;
//    	for(int j = 3; j <= sqrt(n); j++)
//		{
//    		if(n % j == 0) return false;
//    	}	
//    	return true;
//	}
	
	
	int main() 
	{ 
		string s,h;
		cin>>s>>h;
		int n=s.length();
		int i,cnt=0;
		for(i=0;i<n;i++)
		{
			if(s[i]!=h[i])
				cnt++;
		}
		cout<<cnt;
	return 0; 
	} 

Measured memory_bytes: 3860
#include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<(int)(n); i++)
#define all(v) v.begin(), v.end()
#define PRINT(v) for (auto x : (v)) cout <<x <<" " ; cout <<endl;
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using mat = vector<vector<ll>>;
const ll MOD = 1000000007;
const ll INF = 10000000000000000;
const int inf = 1001001001;
vector<int> x4 = {0, 1, 0, -1}, x8 = {0, 1, 1, 1, 0, -1, -1, -1};
vector<int> y4 = {1, 0, -1, 0}, y8 = {1, 1, 0, -1, -1, -1, 0, 1};
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> inline T powerM(T a,T b){if (b==0) return 1;
T tmp = powerM(a,b/2); if (b%2==0) return tmp*tmp%MOD; else return tmp*tmp%MOD*a%MOD; }
template<class T> inline T power(T a,T b,T m){ if (b==0) return 1;
  T tmp = power(a,b/2,m); if (b%2==0) return tmp*tmp%m; else return tmp*tmp%m*a%m; }
template<class T> inline T gcd(T a, T b){if (b==0) return a; return gcd(b, a%b);}
template<class T> inline T lcm(T a, T b){return a / gcd(a,b) * b;}
// ax+by=gcd(a,b)を解く
template<class T> inline T extgcd(T a,T b,T &x,T &y){if (b==0){x=1; y=0; return a;} T d=extgcd(b,a%b,y,x); y -= a/b*x; return d;}
void hey(){ cout <<"hey" <<endl; }

template<class T> struct edge { int to; T cost;};


int main() {
  int N,W; cin >>N >>W;
  vector<int> value(N), weight(N);
  rep(i, N) cin >>value[i] >>weight[i];
  vector<vector<int>> dp(N+1, vector<int>(W+1, 0));
  // dp[i][j] := i番目までの品物を用いて価値をjにしたときの価値の最大値
  for (int i=0; i<N; i++){
    for (int j=0; j<=W; j++){
      chmax(dp[i+1][j], dp[i][j]);
      if (j+weight[i] <= W) chmax(dp[i+1][j+weight[i]], dp[i][j] + value[i]);
    }
  }
  int res = 0;
  for (int j=0; j<=W; j++) chmax(res, dp[N][j]);
  cout <<res <<endl;
}



Measured memory_bytes: 6832
#include<iostream>
using namespace std;
char F[102][102];
void DFS(int Y, int X, char c){
    if(F[Y][X]!=c)
        return;

    F[Y][X]='.';

    DFS(Y-1,X,c);
    DFS(Y,X+1,c);
    DFS(Y+1,X,c);
    DFS(Y,X-1,c);
}
int main(){
    while(true){
        int H,W;
        cin>>H>>W;
        if(H==0&&W==0)break;
        int cnt=0;
        for(int y=1;y<=H;y++){
            for(int x=1;x<=W;x++){
                cin>>F[y][x];
            }
        }
        for(int y=1;y<=H;y++){
            for(int x=1;x<=W;x++){
                if(F[y][x]=='@'){
                    cnt++;
                    DFS(y,x,'@');
                }
                else if(F[y][x]=='*'){
                    cnt++;
                    DFS(y,x,'*');
                }
                else if(F[y][x]=='#'){
                    cnt++;
                    DFS(y,x,'#');
                }
            }
        }
        cout<<cnt<<endl;
    }
    return 0;
}


Measured memory_bytes: 3396
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> iint;
typedef pair<ll,ll> llll;
#define ALL(x) (x).begin(),(x).end()
const ll zero = 0;
const ll INF = 3000000000000000000; //10^18
const int inINF = 1000000000; //10^9
const ll MOD = 1000000007; //10^9+7
const ll MOD2 = 998244353;

int main(){
    int N;
    int AC, WA, TLE, RE;
    AC = 0; WA = 0; TLE = 0; RE = 0;
    cin >> N;
    string S;
    for (int i = 0; i < N; i++) {
        cin >> S;
        if(S == "AC"){
            AC++;
        }
        else if(S == "WA"){
            WA++;
        }
        else if(S == "TLE"){
            TLE++;
        }
        else{
            RE++;
        }
    }
    printf("AC x %d\n", AC);
    printf("WA x %d\n", WA);
    printf("TLE x %d\n", TLE);
    printf("RE x %d\n", RE);

}   

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

using namespace std;

int main()
{
	int H, W, N;
	string ans = "";
	cin >> H >> W >> N;

	int a;
	vector<int> colors;
	for (int i = 0; i < N; i++)
	{
		cin >> a;

		for (int j = 0; j < a; j++)
			colors.push_back(i + 1);
	}

	int count = 0;
	for (int i = 0; i < H; i++)
	{
		vector<string> buf;
		string subAns = "";
		for (int j = 0; j < W; j++)
		{
			if (j > 0)
				buf.push_back(" ");
			buf.push_back(to_string(colors[count]));
			count++;
		}
		
		if (i % 2 != 0)
			reverse(buf.begin(), buf.end());

		for (int j = 0; j < buf.size(); j++)
			subAns += buf[j];

		subAns += "\n";
		ans += subAns;
	}
	
	cout << ans;

	return 0;
}


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

int main() {
  int N;
  cin >> N;
  long long ans[N];
  ans[0] = 2LL;
  ans[1] = 1LL;
  for(int i = 2;i <= N;i++){
    ans[i] = ans[i-1] + ans[i-2];
  }
  cout << ans[N] << endl;
}

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

int main(){
	vector<tuple<int,int,char,long long,string>> ve;
	tuple<int,int,char,long long,string> t;
	int n;
	
	cin>>n;
	
	for(int i = 0; i < n; i++){cin>>get<0>(t)>>get<1>(t)>>get<2>(t)>>get<3>(t)>>get<4>(t);ve.push_back(t);}
	
	sort(ve.begin(), ve.end());
	
	for(tuple<int,int,char,long long,string> y: ve) cout<<get<0>(y)<<" "<<get<1>(y)<<" "<<get<2>(y)<<" "<<get<3>(y)<<" "<<get<4>(y)<<endl;
	
	return 0;
}


Measured memory_bytes: 12208
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        while (n > 0) {
            if (n % 10 == 7) {
                System.out.println("Yes");
                return;
            } else {
                n /= 10;
            }
        }

        System.out.println("No");
    }

}

Measured memory_bytes: 27064
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <functional>
#include <ctime>
#include <cmath>
#include <limits>
#include <numeric>
#include <type_traits>
#include <iomanip>
#include <float.h>
#include <math.h>
using namespace std;
using ll = long long;


unsigned euclidean_gcd(unsigned a, unsigned b) {
    if (a < b) return euclidean_gcd(b, a);
    unsigned r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}

class UnionFind {
public:
    vector <ll> par;
    vector <ll> siz;
    UnionFind(ll sz_) : par(sz_), siz(sz_, 1LL) {
        for (ll i = 0; i < sz_; ++i) par[i] = i;
    }
    void init(ll sz_) {
        par.resize(sz_);
        siz.assign(sz_, 1LL);
        for (ll i = 0; i < sz_; ++i) par[i] = i;
    }
    ll root(ll x) {
        while (par[x] != x) {
            x = par[x] = par[par[x]];
        }
        return x;
    }
    bool merge(ll x, ll y) {
        x = root(x);
        y = root(y);
        if (x == y) return false;
        if (siz[x] < siz[y]) swap(x, y);
        siz[x] += siz[y];
        par[y] = x;
        return true;
    }

    bool issame(ll x, ll y) {
        return root(x) == root(y);
    }

    ll size(ll x) {
        return siz[root(x)];
    }
};

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

long long modinv(long long a, long long mod) {
    return modpow(a, mod - 2, mod);
}

int main() {
    ll n;
    cin >> n;
    ll ans = 0;
    ll a = 0;
    ll b = 24;
    vector<ll>z(n);
    for (int i = 0; i < n; i++) {
        cin >> z[i];
    }
    sort(z.begin(), z.end());
    for (int i = 1; i < 13; i++) {
        a = 0;
        b = 24;
        ll fl = true;
        for (int j = 0; j < n; j++) {
            ll aa = z[j]-a;
            ll bb = b-(24 - z[j]);
            if (max(aa, bb) < i) {
                fl = false;
                break;
            }
            if (aa >= i && bb < i) {
                a = z[j];
            }
            else if (aa < i && bb >= i) {
                b = 24 - z[j];
            }
            else if (aa > bb) {
                b = 24 - z[j];
            }
            else {
                a = z[j];
            }
        }
        if (b - a < i)break;
        if (fl == false)break;
        ans = i;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
#include <bitset>
#include <iomanip>
#include <stack>
#include <list>
#include <map>
#include <unordered_map>
#include <chrono>
#include <numeric>
using namespace std;
using ll = long long;
const ll INF = (ll)1e18+1;
const ll DIV = 1000000007;
//#define TEST
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
#ifdef TEST
    chrono::system_clock::time_point start, end;
    start = chrono::system_clock::now();
#endif
    long N;
    cin >> N;
    vector<long> H(N);
    for(size_t i=0;i<N; i++)
    {
        cin >> H[i];
    }
    for(long i=N-1;i>=1; i--)
    {
        if(H[i]<H[i-1]) H[i-1]--;
    }
    bool ok=true;
    for(size_t i=1;i<N; i++)
    {
        if(H[i]<H[i-1]) ok=false;
    }
    if(ok) cout << "Yes" << endl;
    else cout << "No" << endl;
#ifdef TEST
    end = chrono::system_clock::now();
    cerr << static_cast<double>(chrono::duration_cast<chrono::microseconds>(end - start).count() / 1000.0) << "[ms]" << endl;
#endif
    return 0;
}

Measured memory_bytes: 3972
import java.util.Scanner;

public class Main{
    
    int max;
    int min;
    int sa;
	int i=0;
     
    public void solve(){
        Scanner sc = new Scanner(System.in);
		while(i<7){
			max = sc.nextInt();
			min = sc.nextInt();
			sa = max-min;
			System.out.println(sa);
			i++;
		}
		
    }
    
    public static void main(String[]args){
        Main obj = new Main();
        obj.solve();
    }
}

Measured memory_bytes: 17180
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String {
            bytes
                .by_ref()
                .map(|r| r.unwrap() as char)
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

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

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

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

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

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

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

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

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

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

#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
    input!{
        x: usize
    }
    println!("{}", x / 500 * 1000 + x % 500 / 5 * 5);
}


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

public class Main {

	public static void main(String[] args) throws IOException {

		BufferedReader br =
				new BufferedReader(new InputStreamReader(System.in));

		while (true) {
			int x = Integer.parseInt(br.readLine());
			int h = Integer.parseInt(br.readLine());
			if (x == 0 && h == 0) break;
			double temp = 2 * Math.sqrt(((double)(x * x) / 4) + (h * h));
			System.out.println(x * (x + temp));
		}

	}

}

Measured memory_bytes: 16976
/**
 *    Coded by : lucky_21
 *               --------Lokesh Singh
**/

#include<bits/stdc++.h>
using namespace std;

#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
template<class T> using oset=tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;

#define     F           first
#define     S           second
#define     pb          push_back
#define     lb          lower_bound
#define     ub          upper_bound
#define     pii         pair<int,int>
#define     all(x)      x.begin(),x.end()
#define     fix         fixed<<setprecision(10)
#define     rep(i,a,b)  for(int i=int(a);i<=int(b);i++)
#define     repb(i,b,a) for(int i=int(b);i>=int(a);i--)
#define     FastIO      ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)

typedef double db;
typedef long long ll;

const int N=2e5+5;
const int mod=1e9+7;

vector<ll>v;
bool check(ll x){
    if(x<0) return 0;
    vector<int>u;
    while(x) u.pb(x%10),x/=10;
    rep(i,0,u.size()-2){
        if(abs(u[i+1]-u[i])>1) return 0;
    }
    return 1;
}
void rec(ll i){
    if(!check(i) or i>4e10) return;
    v.pb(i);
    rec(10*i+(i%10-1+10)%10);
    rec(10*i+i%10);
    rec(10*i+(i%10+1)%10);
}
signed main(){
    FastIO;
    int k;
    cin>>k;
    rep(i,1,9) rec(i);
    sort(all(v));
    cout<<v[k-1];
    return 0;
}


Measured memory_bytes: 6536
// inputに入力データ全体が入る
function Main(input) {
	input = input.split(" ");
	//文字列から10進数に変換するときはparseIntを使います
	var a = parseInt(input[0], 10);
	var b = parseInt(input[1], 10);
	var c = parseInt(input[2], 10);
    var total = a + b + c;
	//出力
  if (a > 4 && b > 4 && c > 4 && total === 17) {
	console.log('YES');
  }else {
	console.log('NO');
  }
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S; cin >> S;
    int ok=0;
    for (int i=0;i+1<S.size();++i)
        if (S[i]=='A'&&S[i+1]=='C') ok=1;
    cout << (ok?"Yes":"No") << '\n';
}

Measured memory_bytes: 256
def gcd(a,b):
    if a < b:
        a,b = b,a
    if b == 0:
        return a
    else:
        while True:
            r = a % b
            if r == 0:
                return b
            else:
                a,b = b,r

def GCD(A):
    if len(A) == 1:
        return A[0]
    elif len(A) == 2:
        g = gcd(A[0],A[1])
    else:
        g = gcd(A[0],A[1])
        for i in range(2,len(A)):
            g = gcd(g,A[i])
    return g

N,X = map(int,input().split())
x = list(map(int,input().split()))
x.append(X)

x.sort()
for i in reversed(range(N+1)):
    x[i] -= x[0]

ans = GCD(x)
print(ans)


Measured memory_bytes: 14480
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::*;

fn main() {
    input! {
        n: usize,
        a: [Usize1; n-1],
    }
    let mut res = vec![0; n];
    for x in a {
        res[x] += 1;
    }
    for x in res {
        println!("{}", x);
    }
}


Measured memory_bytes: 5592
#include<iostream>
#include<vector>
using namespace std;
int main(){
  vector<long long> v(5);
  long long n; cin >> n;
  for(int i=0;i<5;i++) cin >> v[i];
  long long minimum = v[0];
  for(int i=0;i<5;i++) minimum = min(minimum, v[i]);
  
  cout << 4 + (n + minimum - 1) / minimum << endl;
  return 0;
}

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

int main() {
  int N;
  cin >> N;
  vector<P> w;
  for (int i = 0; i < N; i++)
  {
    int A, B;
    cin >> A >> B;
    w.push_back(make_pair(B, A));
  }
  sort(w.begin(), w.end());

  int now = 0;
  for (int i = 0; i < N; i++)
  {
    now += w[i].second;
    if (now > w[i].first)
    {
      cout << "No" <<endl;
      return 0;
    }
    
  }
  cout << "Yes" << endl;
  return 0;
}


Measured memory_bytes: 5376
#include<bits/stdc++.h>
#define rep(i, n) for(int (i)=0 ;i <(n); ++(i))
#define REP(i,m,n) for(int (i) = (m); (i) <= (n); ++(i))
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)? "YES":"NO")
typedef long long ll;
using namespace std;

int main() {
  string x;
  cin >> x;
  cout << "ABC" + x << endl;
  return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>
#include <memory.h>
#include <iomanip>
#include <bitset>
#include <list>
#include <stack>
#include <deque>
#include <numeric>

using namespace std;

#define mod 1000000007

int main()
{
	int a, p;
	cin >> a >> p;
	cout << (a * 3 + p) / 2 << endl;
}

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

using namespace std;

typedef long long ll;
const ll INF = 1LL<<60;

ll gcd(ll a, ll b) {
  if(b == 0) return a;
  return gcd(b, a % b);
}

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

ll modpow(ll a, ll n, ll mod) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

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

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

    vector<ll> ans(n);

    if(n % 2 == 0){
        for(ll i = 0; i < n/2; i++){
            ans[n/2+i] = a[i*2];
        }
        for(ll i = 0; i < n/2; i++){
            ans[n/2-i-1] = a[i*2+1];
        }
    }else{
        for(ll i = 0; i < n/2; i++){
            ans[n/2+1+i] = a[i*2+1];
        }
        for(ll i = 0; i <= n/2; i++){
            ans[n/2-i]   = a[i*2];
        }
    }

    for(ll i = 0; i < n; i++){
        cout << ans[i] << " ";
    }
    cout << endl;

    return 0;
}



Measured memory_bytes: 5376
#include <functional>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
using namespace std;
const ll MOD = 1000000007LL;

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

    queue<string> q;
    q.push("a");

    while (!q.empty()) {
        auto s = q.front();
        q.pop();

        if (s.size() == n) {
            cout << s << endl;
        } else {
            map<char, int> mp;
            for (char c : s) mp[c]++;

            for (int i = 0; i <= mp.size(); i++) {
                string t = s;
                t.push_back('a' + i);
                q.push(t);
            }
        }
    }

    return 0;
}

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

int main() {
  int n;
  cin >> n;
  long long ans = 1;
  for(int i = 1; i <= n; i++) {
    ans *= i;
    ans %= 1000000000 + 7;
  }
  cout << ans << endl;
  return 0;
}


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

RunRun = [i for i in range(1, 10)]

while True:
    if k <= len(RunRun):
        print(RunRun[k-1])
        exit()
        
    k -= len(RunRun)
    
    now = []
    now, RunRun = RunRun, now

    for r in now:
        for i in range(-1, 2):
            tmp = r % 10 + i
            if tmp < 0 or 9 < tmp: continue
            tmp = (r * 10) + tmp
            RunRun.append(tmp)
        #print(RunRun)


Measured memory_bytes: 17972
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int cb[2][100007];
char ca[100007];
bool s[100007];
int main(){
	int n,m,q;
	int i,j,k;
	int a,b,c,d;
	for(i=0;i<2;i++){
		scanf("%s",ca);
		a=strlen(ca);
		for(j=0;j<a;j++){
			cb[i][j+1]=cb[i][j];
			if(ca[j]=='A')cb[i][j+1]++;
			else cb[i][j+1]+=2;
		}
	}
	cin>>q;
	for(i=0;i<q;i++){
		scanf("%d%d%d%d",&a,&b,&c,&d);
		a--,c--;
		a=(cb[0][b]-cb[0][a])%3;
		b=(cb[1][d]-cb[1][c])%3;
		if(a==b)s[i]=true;
		else s[i]=false;
	}
	for(i=0;i<q;i++){
		if(s[i])printf("YES\n");
		else printf("NO\n");
	}
	return 0;
}
	


Measured memory_bytes: 1536
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ul unsigned long int
#define ld long double
#define f(t) for(ll i =0;i<t;i++)
#define vi vector<int>
#define vl vector<ll>
#define pri pair<int,int>
#define mpi map<int,int>
#define prl pair<ll,ll>
#define mp make_pair
#define mpl map<ll,ll>
#define umpl unordered_map<ll,ll>
#define pb push_back
#define ff first
#define ss second
#define MOD 1000000007
#define inf 2e18
#define EPS 1e-3
#define PI 3.1415926535897932385
const double h = 1e-6;
const int MAX_  = 100005;
#define display(v) f(v.size())cout << v[i] << " "
#define all(v) v.begin(),v.end()

inline ll mul(ll a, ll b){ return (a * 1ll * b) % MOD; }
inline ll sub(ll a, ll b){ ll c = a - b; if(c < 0) c += MOD; return c; }
inline ll add(ll a, ll b){ ll c = a + b; if(c > MOD) c -= MOD; return c; }
 //////////////////////*********CODE***********/////////////////////
 //////////////////////////////////////////////////////////////////

int main()
{
   ios_base::sync_with_stdio(false);
   cin.tie(NULL);
   cout.tie(NULL);
   int arr[3][3];
   for(int i =0;i<3;i++)
   {
      for(int j =0;j<3;j++)cin>>arr[i][j];
   }
   int n;   cin>>n;  bool vis[3][3];
   memset(vis,false,sizeof(vis));
   while(n--)
   {
      int val ; cin>>val;
      for(int i =0;i<3;i++)
      {
         for(int j = 0;j<3;j++)
         {
            if(arr[i][j] == val)vis[i][j] = true;
         }
      }
   }
   bool f = false;
   for(int i =0;i<3;i++)
   {
      if(vis[i][0] && vis[i][1] && vis[i][2]){f = 1;break;}
      if(vis[0][i] && vis[1][i] && vis[2][i]){f = 1; break;}

   }
   if(vis[0][0] && vis[1][1] && vis[2][2]){f =1;}
   if(vis[0][2] && vis[1][1] && vis[2][0]){f = 1;}
   if(f)cout << "Yes";
   else cout << "No";



   return 0;
}     

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main() {
  string S;
  cin >> S;
  
  if (S.at(5)=='1'){
    cout << "TBD" << endl;
  }else{
    if (S.at(6)=='1' || S.at(6)=='2' || S.at(6)=='3' || S.at(6)=='4'){
      cout << "Heisei" << endl;
    } else {
      cout << "TBD" << endl;
    }
  }
}

Measured memory_bytes: 256
# https://atcoder.jp/contests/abc138/tasks/abc138_c

input_list = [input() for i in range(2)]

maxNum = int(input_list[0])

nums = [int(i) for i in input_list[1].split(' ')]

nums.sort()

value = 0
is_first_item = True
index = maxNum - 1
for num in nums:
    if is_first_item:
        value = value + num / (2 ** index)
        is_first_item = False
    else:
        value = value + num / (2 ** index)
        index = index - 1

print(value)



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

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

#define p_ary(ary,a,b) do { cout << "["; for (int count = (a);count < (b);++count) cout << ary[count] << ((b)-1 == count ? "" : ", "); cout << "]\n"; } while(0)
#define p_map(map,it) do {cout << "{";for (auto (it) = map.begin();;++(it)) {if ((it) == map.end()) {cout << "}\n";break;}else cout << "" << (it)->first << "=>" << (it)->second << ", ";}}while(0)

template<typename T1,typename T2>ostream& operator<<(ostream& os,const pair<T1,T2>& a) {os << "(" << a.first << ", " << a.second << ")";return os;}

const char newl = '\n';

int main() {
    int k;
    cin >> k;
    for (int i = 0;i < k;++i) cout << "ACL";
    cout << newl;
}

Measured memory_bytes: 3636
while 1:
    find = False
    r_pos = [10,10]
    n = int(raw_input())
    if n == 0: break
    planet = [[0 for j in xrange(21)] for i in xrange(21)]
    for i in xrange(n):
        x,y = map(int, raw_input().split())
        planet[y][x] = 1
    m = int(raw_input())
    for i in xrange(m):
        d,l = raw_input().split()
        l = int(l)
        if d == 'N':
            for j in xrange(r_pos[0], r_pos[0]+l+1):
                planet[j][r_pos[1]] = 0
            r_pos[0] += l
            #print r_pos
        elif d == 'S':
            for j in xrange(r_pos[0], r_pos[0]-l-1, -1):
                planet[j][r_pos[1]] = 0
            r_pos[0] -= l
            #print r_pos
        elif d == 'E':
            for j in xrange(r_pos[1], r_pos[1]+l+1):
                planet[r_pos[0]][j] = 0
            r_pos[1] += l
            #print r_pos
        elif d == 'W':
            for j in xrange(r_pos[1], r_pos[1]-l-1, -1):
                planet[r_pos[0]][j] = 0
            r_pos[1] -= l
            #print r_pos
    for i in xrange(21):
        for j in xrange(21):
            if planet[j][i] == 1:
                find = True
    if find is True: print 'No'
    else: print 'Yes'

Measured memory_bytes: 5596
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
 
using namespace __gnu_pbds;
using namespace std;

#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")

#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define ull unsigned long long
#define ld long double

#define mod 1000000007
#define EULER 2.7182818284
#define INF 1000000000

#define pb push_back
#define ins insert
#define IT iterator
#define PQ priority_queue
#define    nl           "\n"
#define fi first
#define se second
#define maxe max_element
#define mine min_element
#define er erase
#define lb lower_bound
#define ub upper_bound

#define vi vector<int>
#define vll vector<ll>
#define vb vector<bool>
#define pi pair<int,int>
#define pll pair<ll,ll>
#define all(v) v.begin(),v.end()

#define mem(v,i) memset(v,i,sizeof(v)) // v is array. To set all elements to 0 or -1 only. mem(arr,0);


#define repab(i,a,b) for(int i=(a);i<=(b);i++)
#define reprab(i,a,b) for(int i=(a);i>=(b);i--)
#define repll(i,a,b) for(ll i=(a);i<=(b);i++)
#define rep(i,n) for(int i=(0);i<(n);i++)
#define repr(i,n) for(int i=(n);i>=0;i--)
#define bs bitset
#define bpc(a) __builtin_popcount(a)
#define tc int t;cin>>t;while(t--)
template<typename T> void TIME(T start, T end)
{
#ifndef ONLINE_JUDGE
    double time_taken =  chrono::duration_cast<chrono::nanoseconds>(end - start).count();
    time_taken *= 1e-9;
    cout << "\nExecuted in: " << fixed
         << time_taken << setprecision(9);
    cout << " sec";
#endif
}

int dx[]={1,-1,0,0};
int dy[]={0,0,1,-1};

ll max(ll a,ll b)
{
    if(a>b)return a;return b;
}
ll min(ll a,ll b)
{
    if(a<b)return a;return b;
}

ll mypow(ll a, ll b) {
    ll res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}
ll gcd(ll a,ll b)
{
    if(b==0)
    return a;
    return gcd(b,a%b);
}
//..............................!!!!!!Get ready to fight!!!!!!............................
ll prime[10000006]; 
void SieveOfEratosthenes(ll n) 
{ 
   
   prime[1]=1;
   for(ll i=2;i<=n;i++)
   prime[i]=2;
  
    for (ll p=2; p<=n/2; p++) 
    { 
        // If prime[p] is not changed, then it is a prime 
        
            for (ll i=2*p; i<=n; i += p) 
                prime[i]++;
         
    } 
  
    
} 
  

int main()
{   
     auto start = chrono::high_resolution_clock::now();
    fast
    ll n;
    cin>>n;
    SieveOfEratosthenes(n);
    /*repab(i,1,n)cout<<prime[i];
    cout<<nl;*/
    ll ans=0,i;
    for(i=1;i<=n;i++){
        ans+=i*prime[i];
    }
    cout<<ans<<nl;
    auto end = chrono::high_resolution_clock::now();
    TIME(start, end);
    return 0;
}

Measured memory_bytes: 81748
N = int(input())
W_list = list(map(int, input().split()))

minDiff = 10000000000
 

for T in range(0,N):
  TlessSum = sum(W_list[0:(T+1)])
  TupSum   = sum(W_list[(T+1):])
  
  diff = abs(TlessSum-TupSum)
  
  if diff<minDiff:
    minDiff = diff 
    
print(minDiff)

Measured memory_bytes: 3064
program main
implicit None
	integer(8)::n,m,i,x,p,q,c
	integer(8),allocatable::a(:,:)
	character(len = 100)::s
	
	read*,n,m
	allocate(a(n,m))
	a = 0
	
	do i = 1,n
		read"(a)",s
		x = len_trim(s)
		p = 1
		do while(s(p:p) /= " ")
			p = p+1
		enddo
		
		p = p+1
		q = p
		
		do
			q = p
			if(p /= x)then
				if(s(p+1:p+1) /= " ") q = q+1
			endif
			read(s(p:q),*) c
			a(i,c) = 1
			
			if(p == x .or.q == x) exit
			p = q+2
		enddo
	enddo
	
	p = 0
	do i =1,m
	x = sum(a(:,i))
	if(x ==n) p = p+1
	enddo
	
	print "(i0)",p
end program main

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define res register int
#define ll long long
//#define cccgift
//#define getchar()(p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
//char buf[1<<21],*p1=buf,*p2=buf;
template<typename T>
inline void read(T &x)
{
    static char ch;bool f=1;
    for(x=0,ch=getchar();!isdigit(ch);ch=getchar()) if(ch=='-') f=0;
    for(;isdigit(ch);x=(x<<1)+(x<<3)+(ch^48),ch=getchar());x=f?x:-x;
}
template<typename T>
void print(T x)
{
    if (x<0) x=-x,putchar('-');
    if (x>9) print(x/10);
    putchar(x%10+48);
}
template<typename T>
inline void print(T x,char ap) {print(x);if (ap) putchar(ap);}
template<typename T>
inline void chkmax(T &x,const T &y) {x=x<y?y:x;}
template<typename T>
inline void chkmin(T &x,const T &y) {x=x<y?x:y;}
int n,m,q[100010],l,r,f[100010];
char s[100010];
int main()
{
	ios::sync_with_stdio(false);
	cin>>n>>m>>s,l=1,q[++r]=n,f[n]=0;
	for(res i=n-1;~i;--i) {
		if(s[i]=='1') {f[i]=1e9;continue;}
		while(l<=r&&q[l]>i+m) ++l;
		if(l<=r) f[i]=f[q[l]]+1;else f[i]=1e9;
		while(l<=r&&f[q[r]]>=f[i]) --r;
		q[++r]=i;
	}
//	for(res i=0;i<n;++i) cerr<<f[i]<<' ';cerr<<'\n';
	if(f[0]>=1e9) return cout<<-1<<'\n',0;
	int now=0,tot=0;
	while(now<n) {
		++tot;
		for(res i=1;i<=m;++i) {
			if(s[now+i]=='1') continue;
			if(now+i==n) return cout<<i<<'\n',0;
			if(f[now+i]+tot>f[0]) continue;
			cout<<i<<' ',now+=i;break;
		}
	}
	cout<<flush;
	return 0;
}
/*
6 3
0001110
*/
/* stuff you should look for
    * int overflow, array bounds
    * special cases (n=1?), set tle
    * do something instead of nothing and stay organized
*/ 

Measured memory_bytes: 1280
using System;
using System.Collections.Generic;
using System.Text;
using System.Numerics;
using System.IO;

namespace SolutionCS
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            for (int i = 0; i < 3; i++)
            {
                if ( s[i] == s[i+1])
                {
                    Console.WriteLine("Bad");
                    return;
                }
            }

            Console.WriteLine("Good");

        }
    }
}


Measured memory_bytes: 13140
#include<cstdio>
#include<algorithm>
#include<cstring>

using namespace std;

int main()
{
    int n,k,a=1;
    int i;
    scanf("%d%d",&n,&k);
    while(n--)
    {
        if(a<k)
            a*=2;
        else
            a+=k;
    }
    printf("%d",a);
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define all(x) (x).begin(),(x).end()
#define V vector
typedef V<int> vi;
typedef V<vi> vvi;
typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
constexpr int INF = INT_MAX >> 1;
constexpr ll LINF = 5000000000000000LL;
constexpr int MOD = 1000000007;

int main() {
	
	int x, n;
	cin >> x >> n;
	vi p(n);
	rep(i, n)cin >> p[i];

	queue<int> q;
	q.push(x);
	while (true) {
		
		int c = q.front();q.pop();
		bool find = false;
		rep(i, n)if (p[i] == c)find = true;
		if (!find) {
			cout << c << endl;
			return 0;
		}
		if (c <= x)q.push(c - 1);
		if (c >= x)q.push(c + 1);
	}
}

Measured memory_bytes: 3628
#include<iostream>
#include<string>
#include<cstdlib>
#include<math.h>
using namespace std;
int main(void){
    int a,b,ans=0,temp,index;
    cin >> a >> b;
    
    for(int i=a;i<=b;i++){
            temp=0;
            index=i;
        while(index){
            temp+=index%10;
            index=index/10;
            if(index!=0){
                temp=temp*10;
            }
        }
        if(i-temp==0){
            ans++;
        }
    }
    printf("%d",ans);
    return 0;
}


Measured memory_bytes: 256
import Control.Applicative
import Control.Monad
import Data.List
strToInt s = (read :: String -> Int) s

main :: IO ()
main = do
    -- スペース区切り整数の入力
    [a, b, c] <- map strToInt . words <$> getLine
    -- 出力
    putStrLn . show $ min (a * b) c


Measured memory_bytes: 508
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i <= (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define printa(x,m,n) for(ll i = (m); i <= n; i++){cout << (x[i]) << " ";} cout<<endl;

ll n, k, a[200008], f[200008];
string s;

int nibutan(ll x){
	ll y = 0;
	rep(i, 0, n-1){
		if(a[i]*f[n-1-i] > x){
			y += a[i]-x/f[n-1-i];	
		}	
	}
	if(y <= k){
		return true;
	}
	else{
		return false;
	}
}

int main(){
	cin.tie(0); ios::sync_with_stdio(false);
	
	cin >> n >> k;
	rep(i, 0, n-1){cin >> a[i];}
	rep(i, 0, n-1){cin >> f[i];}
	sort(a, a+n);
	sort(f, f+n);
	
	ll ok = 1e12;
	ll ng = -1;
	while(ok-ng > 1){
		ll mid = (ok+ng)/2;
		if(nibutan(mid)){
			ok = mid;
		}
		else{
			ng = mid;
		}
	}
	print(ok)
	return 0;
}

Measured memory_bytes: 3328
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i,n) for (ll i = 0; i < (n); ++i)
#define vcout(v) rep(i,v.size()) cout << v[i] << " "; cout << endl
#define mcout(m) rep(j,m.size()){vcout(m[j]);}
const ll MOD = 1e9 + 7;

int mainsolve(){

	ll k;
	cin >> k;

	if(k <= 9){
		cout << k << endl;
		return 0;
	}

	// 解は2桁以上
	k -= 9;
	queue<ll> nowq, oldq;
	rep(i,9) oldq.push(i+1);

	while(true){

		while(!oldq.empty()){
			ll old = oldq.front(); oldq.pop();
			ll tmp = old % 10;

			if(tmp - 1 >= 0) nowq.push(old*10 + tmp - 1);
			nowq.push(old*10 + tmp);
			if(tmp + 1 <= 9) nowq.push(old*10 + tmp + 1);				
		}
		
		if(k <= nowq.size()) break;
		k -= nowq.size();
		swap(oldq, nowq);
	}

	ll res = 0;
	rep(i,k){
		res = nowq.front(); nowq.pop();
	}

	cout << res << endl;

	return 0;
}

int main(){

	return mainsolve();
}

Measured memory_bytes: 1280
#pragma region template
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
/*
const long long MOD = 1e9 + 7, MAX = 1e18, larg = 1e5, INF = -1e9;
long long max_value = INF, max_index = -1;
long long min_value = MAX, min_index = -1;*/
long long A, B, C, D, E, F, G, H, I, J, K, L, N, M, O, P, Q, R, S, T, U, V, W, x, y, z;
typedef long long ll;
typedef pair<ll, ll> Pa;

/*
template <std::int_fast64_t Modulus> class modint {
	using u64 = std::int_fast64_t;
public:
	u64 a;
	constexpr modint(const u64 x = 0) noexcept : a(x% Modulus) {}
	constexpr u64& value() noexcept { return a; }
	constexpr const u64& value() const noexcept { return a; }
	constexpr modint operator+(const modint rhs) const noexcept {
		return modint(*this) += rhs;
	}
	constexpr modint operator-(const modint rhs) const noexcept {
		return modint(*this) -= rhs;
	}
	constexpr modint operator*(const modint rhs) const noexcept {
		return modint(*this) *= rhs;
	}
	constexpr modint operator/(const modint rhs) const noexcept {
		return modint(*this) /= rhs;
	}
	constexpr modint& operator+=(const modint rhs) noexcept {
		a += rhs.a;
		if (a >= Modulus) {
			a -= Modulus;
		}
		return *this;
	}
	constexpr modint& operator-=(const modint rhs) noexcept {
		if (a < rhs.a) {
			a += Modulus;
		}
		a -= rhs.a;
		return *this;
	}
	constexpr modint& operator*=(const modint rhs) noexcept {
		a = a * rhs.a % Modulus;
		return *this;
	}
	constexpr modint& operator/=(modint rhs) noexcept {
		u64 exp = Modulus - 2;
		while (exp) {
			if (exp % 2) {
				*this *= rhs;
			}
			rhs *= rhs;
			exp /= 2;
		}
		return *this;
	}
};
#pragma endregion

typedef modint<MOD> m;
m func[400001];
void funcinit(int N)
{
	func[0] = 1;
	for (int i = 1; i <= N; i++)
	{
		func[i] = func[i - 1] * i;
	}
}
m comb(m n, m r)
{
	if (n.a <= 0 || n.a < r.a)
	{
		return 0;
	}
	return func[n.a] / (func[r.a] * func[(n - r).a]);
}*/

int main() {
	string s;
	cin >> s;
	if (s.size() % 2 == 1) {
		cout << "No";
		return 0;
	}
	rep(i, s.size() / 2) {
		if (s[i * 2] != 'h' || s[i * 2 + 1] != 'i') {
			cout << "No";
			return 0;
		}
	}
	cout << "Yes";
}


Measured memory_bytes: 256
#include <iostream>
#include <math.h> 
#include <string> 
#include <algorithm>
#include <numeric>
#include <cmath>
using namespace std;

int main() {

	long res = 0;

	long N, M; cin >> N >> M;
	long buc[100]; for (int i = 1; i <= M; i++) buc[i] = 0; // i番目の食べ物が好きな人の数。

	for (int i = 1; i <= N; i++) {

		long K; cin >> K;
		for (int j = 1; j <= K; j++) {
			long A; cin >> A;
			buc[A]++;
		}

	}

	for (int i = 1; i <= M; i++) if (buc[i] == N) res++;

	cout << res << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
using namespace std;
const int MOD = 1000000007;
const int INF = 1010000000;
const double EPS = 1e-10;

int h,w,x;
char s[1000][1000];
bool visited [1000][1000];
pair<int,int> start,goal;
queue<pair<int,pair<int,int>>> q;
vector<pair<int,int>> ino;

int main(){
  //string a,b,c,d;cin>>a>>b>>c>>d;
  string o,a;cin>>o>>a;
  cout << 'A'<<a[0]<<'C';
}


Measured memory_bytes: 256
#include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<map>
#include<cstdio>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define mp make_pair
#define pb push_back
#define P pair<int,int>
#define ll __int64

int a;
int main(){
cin>>a;
  if(a>=1000)cout<<"ABD"<<endl;
  	else cout<<"ABC"<<endl;

	return 0;
}

Measured memory_bytes: 764
import java.util.*;
public class Main {

  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);

    long x = sc.nextLong();

    double money = 100;
    long count = 0;
    while (money < x) {
      count++;
      money = Math.floor(money * 1.01);
    }

    System.out.println(count);

    sc.close();

  }
}

Measured memory_bytes: 35792
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stdlib.h>
#include <map>
#include <cmath>
#define MOD_P 1000000007
#define MOD_Q 998244353
#define PI 3.14159265358979
#define ll long long
using namespace std;

void swap(int& a, int& b)
{
	int tmp;
	tmp = a;
	a = b;
	b = tmp;
}

struct UnionFind {
	vector<int> d;
	UnionFind(int n) :d(n, -1) {};

	int root(int x)
	{
		if (d[x] < 0)return x;
		return d[x] = root(d[x]);
	}

	bool Union(int x, int y)
	{
		x = root(x);
		y = root(y);
		if (x == y)return false;
		if (d[x] > d[y]) swap(x, y);
		d[x] += d[y];
		d[y] = x;
		return true;
	}
	bool same(int x, int y)
	{
		return root(x) == root(y);
	}
	int size(int x)
	{
		return -d[root(x)];
	}
};

int main()
{
	int n, m;
	cin >> n >> m;
	UnionFind dp(n);
	vector<bool> flags(n, false);
	int x, y;
	int ans = 0;

	for (int i = 0; i < m; i++) {
		cin >> x >> y;
		x--;
		y--;
		dp.Union(x, y);
	}

	for (int i = 0; i < n; i++) {
		flags[dp.root(i)] = true;
	}

	for (int i = 0; i < n; i++) {
		if (flags[i])ans++;
	}

	printf("%d", ans - 1);

	return 0;
}

Measured memory_bytes: 3832
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String t = sc.next();
        sc.close();
        StringBuilder sb = new StringBuilder();
        sb.append(t);
        sb.append(s);
        System.out.println(sb);
    }
}


Measured memory_bytes: 21716
// in the name if Allah
#include <bits/stdc++.h>
using namespace std;
typedef long long ll ;
const ll INF = 1<<30 ;
const ll N= 1e6 ;
#define f first
#define s second
ll n ;
vector<char> v ;
int main()
{
std::ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
for(int i = 1 ; i <= 4 ;i ++){
    char c ;
    cin >> c ;
    v.push_back(c) ;
}
sort(v.begin() , v.end()) ;
if(v[0] == v[1] && v[2]==v[3] && v[1] != v[2])cout << "Yes" ;
else cout << "No" ;
    return 0;
}
 /*
              _     _   __
        /_\  (_    (_)  __)
       /   \  _) . (_) (__
 */


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

int main() {

    int n;

    cin >> n;

    int a[n];

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

    sort(a,a+n);

    int ans = 0;

    for(int i=0; i<n-1; i++){
        ans += a[i+1] - a[i];
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include<fstream>
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<string.h>
#include<cstring>
#include<iostream>
#include<stack>
#include<string>
#include<map>
#include<set>

typedef long long ll;
typedef unsigned long long ull;
typedef std::pair<int, int> pin;
typedef std::pair<int,std::pair<int, int> > ppin;

using namespace std;


int main(){
    
    while(true){
        int n;
        cin>>n;
        if(n==0){
            break;
        }
        else{
            int tot=0;
            for(int i=1;i*i<=n;i++){
                if(n%i==0){
                    if(i!=n)
                        tot+=i;
                    if(i!=n/i&&n!=n/i){
                        tot+=n/i;
                    }
                }
            }
            if(n>tot){
                cout<<"deficient number"<<endl;
            }
            else if(n==tot){
                cout<<"perfect number"<<endl;
            }
            else{
                cout<<"abundant number"<<endl;
            }
        }
    }
    return 0;
}

Measured memory_bytes: 1152
#include<string>
#include<iostream>
#include<stdio.h>
#include<map>
using namespace std;
int main(){
    long long int i,n,k,a[200010],s[200010],max=0,x,y;
    double ans=0,z,v;
    scanf("%lld %lld\n",&n,&k);
    for(i=0;i<n;i++){
        scanf("%lld",&a[i]);
    }
    s[0]=0;
    for(i=0;i<n;i++){
        s[i+1]=s[i]+a[i];
    }
    for(i=k;i<=n;i++){
        if(s[i]-s[i-k]>max){
            max=s[i]-s[i-k];
            x=i,y=i-k;
        }
    }
    for(i=y;i<x;i++){
        v=a[i];
        z=v*(v+1)/2;
        ans=ans+z/v;
    }
    printf("%.8lf\n",ans);
  return 0;
}

Measured memory_bytes: 3328
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    while(1)
    {
        c=c-b;

        if(c<=0)
        {
            cout<<"Yes"<<endl;
            return 0;
        }
        a=a-d;

        if(a<=0)
        {
            cout<<"No"<<endl;
            return 0;
        }
    }

    return 0;

}


Measured memory_bytes: 3576
<?php

    // 末尾に改行をつけて出力
    function output($str) {
        echo $str . PHP_EOL;
    }

    $s = trim(fgets(STDIN));
    fgets(STDIN);

    $reverse = false;
    $p = '';
    while ($query = trim(fgets(STDIN))) {
        $param = explode(' ', $query);
        if (count($param) == '1') {
            // type1
            $reverse = !$reverse;
        } else {
            // type2
            if ( ! $reverse) {
                if ($param[1] == '1') {
                    $p .= $param[2];
                } else {
                    $s .= $param[2];
                }
            } else {
                if ($param[1] == '2') {
                    $p .= $param[2];
                } else {
                    $s .= $param[2];
                }
            }
        }
    }
    if ( ! $reverse) {
        output(strrev($p) . $s);
    } else {
        output(strrev($s) . $p);
    }

Measured memory_bytes: 4856
#include <stdio.h>

int main(void)
{
    int dice[6][5] = {{1, 5, 4, 2, 3}, {2, 1, 4, 6, 3},{3, 1, 2, 6, 5}, {4, 1, 5, 6, 2}, {5, 1, 3, 6, 4}, {6, 2, 4, 5, 3}};
    int dice2[6][5] = {{1, 5, 4, 2, 3}, {2, 1, 4, 6, 3},{3, 1, 2, 6, 5}, {4, 1, 5, 6, 2}, {5, 1, 3, 6, 4}, {6, 2, 4, 5, 3}};
    int buffer[6];
    int check, flag;
    int i, j, k, l;

    for(i = 0; i < 6; i++){
        scanf("%d", &dice[i][0]);
    }
    for(i = 0; i < 6; i++){
        scanf("%d", &dice2[i]);
    }
  
    flag = 0;
    for(i = 0; i < 6; i++){
        for(j = 0; j < 6; j++){
        //printf("compare1 %d and %d\n", dice[i][0], dice2[j][0]);
            if(dice[i][0] == dice2[j][0]){
                for(k = 1; k < 5; k++){
                    //printf("compare2 %d and %d\n", dice[(dice[i][1]) - 1][0], dice2[(dice2[j][k] - 1)][0]);
                    if(dice[(dice[i][1]) - 1][0] == dice2[(dice2[j][k]) - 1][0]){
                        //printf("found3 %d and %d\n", dice[(dice[i][1]) - 1][0], dice2[(dice2[j][k] - 1)][0]);
                        for(l = 1;l < 5; l++){
                            //printf("compare3 %d and %d\n", dice[(dice[i][l]) - 1][0], dice2[(dice2[j][k] - 1)][0]);
                            if(dice[(dice[i][l]) - 1][0] != dice2[(dice2[j][k]) - 1][0]){
                                
                                flag++;
                                break;
                            }  
                            if(k == 4) {
                                k = 1;
                            }
                            else k++;          
                        }
                        break;
                    }
                    else if(k == 4){
                       
                        flag++;
                    }
                }
                break;
            }
            else if(j == 6){
                flag++;
            }
        }
    }
    if(i == 6 && l == 5)    printf("Yes\n");
    else if (flag > 3)printf("No\n");
    
    return (0);
}


Measured memory_bytes: 2100
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n
 
    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
 
    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x
 
    def size(self, x):
        return -self.parents[self.find(x)]
 
    def same(self, x, y):
        return self.find(x) == self.find(y)
 
    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]
 
    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]
 
    def group_count(self):
        return len(self.roots())
 
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
 
 
 
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
 
n,m=map(int,input().split())
u=UnionFind(n)
for i in range(m):
    a,b=map(int,input().split())
    a-=1
    b-=1
    u.unite(a,b)

print(u.group_count()-1)


Measured memory_bytes: 73536