akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define mod 1000000007ll
#define mod1 998244353ll
#define endl '\n'
#define inf ((ll)1e18+1)
#include<chrono>
using namespace chrono;
mt19937_64 rng(high_resolution_clock::now().time_since_epoch().count());
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<ll,null_type,less_equal<ll>,rb_tree_tag,tree_order_statistics_node_update>
#define debr(x,y) {cout<<"-->  "<<#x<<" to "<<#y<<" :  "; auto itr=x; while(itr!=y) cout<<(*itr++)<<' '; cout<<endl; }
#define deba(x) {cout<<"-->  "<<#x<<" :  "; for(auto ele:(x)) cout<<ele<<"  "; cout<<endl; }
#define deb(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s);istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {cout<<endl;}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a <<"  ,  ";
    err(++it, args...);
}


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    ll t=1;
    // cin>>t;
    while(t--){
        string s;
        cin>>s;
        int ans=0;
        int n=s.length();
        int c=0;
        for(int x=0;x<n;x++){
            if(s[x]=='R')c++;
            else{
                ans=max(ans,c);
                c=0;
            }
        }
        ans=max(ans,c);
        cout<<ans<<endl;
    }
    return 0;

}


Measured memory_bytes: 3672
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
ll INF = 1e10;
int gcd(int a, int b)
{
    if(b == 0) return a;
    return gcd(b, a % b);
}
int main()
{
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    for(int i = 0; i < n; i++) cin >> a[i];
    sort(a.begin(), a.end());
    int x = a[0];
    for(int i = 1; i < n; i++)
    {
        x = gcd(x, a[i]);
    }

    for(int i = n-1; a[i] >= k; i--)
    {
        int diff = a[i] - k;
        if(diff % x == 0)
        {
            cout << "POSSIBLE" << endl;
            return 0;
        }
    }
    cout << "IMPOSSIBLE" << endl;
}


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

int main() {
  string a,b,c,d,e;
  int f;
  cin>>a;
  for(int i=0;i<4;i++){
    if(a.at(i)=='+'){
      f++;
    }
    else{
      f--;
    }
  }
  cout<<f<<endl;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String A = sc.next();
		String B = sc.next();
		String C = sc.next();
		
		String al =A.substring(A.length()-1,A.length());
		String bl =B.substring(B.length()-1,B.length());
		
		String bs =B.substring(0,1);
		String cs =C.substring(0,1);
		
		
		if(al.equals(bs) && bl.equals(cs)){
		    System.out.println("YES");
		}else{
		    System.out.println("NO");
		}
		
		
		
	}
}


Measured memory_bytes: 35556
#include <stdio.h>
int main(void)
{
    int i,j,k,n,m,l;
    int a[101][101],b[101][101];
    long long c[101][101],s;
    
    scanf("%d%d%d",&n,&m,&l);
    
    for(i=0;i<n;i++){
        for(j=0;j<m;j++) scanf("%d",&a[i][j]);
    }
    
    for(i=0;i<m;i++){
        for(j=0;j<l;j++) scanf("%d",&b[i][j]);
    }
    
    for(i=0;i<n;i++){
        for(j=0;j<l;j++){
            s=0;
            for(k=0;k<m;k++){
                s += a[i][k]*b[k][j];
            }
            c[i][j]=s;
        }
    }
    
    for(i=0;i<n;i++){
        printf("%lld",c[i][0]);
        for(j=1;j<l;j++) printf(" %lld",c[i][j]);
        putchar('\n');
    }
    
    return 0;
    
}



Measured memory_bytes: 2144
#include <bits/stdc++.h>
#include <map>
#include <set>
#include <vector>
#include <algorithm>
#include <iostream>
#include <bitset>
#include <cassert>
#include <queue>
#include <stack>
#include <iomanip>
#include <math.h>
#include <time.h>
#include <chrono>
#include <random>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define repf(i, a, b) for (int i = (int)a; i < (int)b; i++)
#define repr(i, a, b) for (int i = (int)a; i > (int)b; i--)
#define all(v) (v).begin(), (v).end()
#define mp(a, b) make_pair(a, b)
#define eb(x) emplace_back(x)
#define F first
#define S second
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<int> vii;
typedef vector<vii> vvii;
const ll mod = 1e9 + 7;
const int infi = 1147483600;
const ll infl = 4e18 + 5;
const char ENDL = '\n';
//cout << fixed << setprecision(17) << res << endl;
const ll MOD = 998244353;

bool debug = false;

random_device rnd;
mt19937_64 mt(rnd());

ll c[26], s[370][26], D, last[26];

void input(){
    cin >> D;
    rep(i, 26) cin >> c[i];
    rep(i, D) rep(j, 26) cin >> s[i][j];
}

void make_input(){
    rep(i, 365) c[i] = mt() % 101;
    rep(i, 365) rep(j, 26) s[i][j] = mt() % 20001;
}

ll calc_v(vll t){
    vll v(D, 0);
    rep(i, 26) last[i] = -1;
    rep(i,D){
        if (i>0)
            v[i] = v[i - 1];
        v[i] += s[i][t[i]];
        last[t[i]] = i;
        rep(j, 26) v[i] -= c[j] * (i - last[j]);
    }
    return v[D-1];
}



//note:ランダム

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    clock_t start = clock();
    D = 365;
    if(debug)
        make_input();
    else
        input();
    rep(i, 26) last[i] = -1;

    ll mx = -infl;
    vll ans(D, 0);

    //ans:答えをＤ日分入力
    //last[i]:i番目のコンテストを最後に行ったのはlast[i]日
    rep(i, D) ans[i] = (mt() % 26);
    ll v;
    v = calc_v(ans);
    if (debug)
        cout << "start value:" << v << ENDL;
    ll q = 50000;
    rep(i,q){
        ll d, x1, x2;
        d = (mt() % D);
        x1 = ans[d];
        x2 = (mt() % 26);
        ans[d] = x2;
        ll v2 = calc_v(ans);
        if (v<v2)
            v = v2;
        else
            ans[d] = x1;
    }

    clock_t end = clock();
    if (debug){
        cout << "end value :" << v << ENDL;
        cout << "check :" << ((*min_element(all(ans)) >= 0) && (*max_element(all(ans)) <= 25)) << ENDL;
        ld time = static_cast<ld>(end - start) / CLOCKS_PER_SEC * 1000.0;

        cout << "time :" << fixed << setprecision(3) << time << "ms" << ENDL;
        }
    else 
        rep(i, D) cout << ans[i] + 1 << ENDL;
}


Measured memory_bytes: 3748
#![allow(non_snake_case)]
#![allow(unused_imports)]

use proconio::{input, fastout};
use proconio::marker::*;
use whiteread::parse_line;
use std::collections::*;
use num::*;

use itertools::Itertools;
use itertools_num::ItertoolsNum;

#[fastout]
fn main() {
    input!{
        n: usize,
        mut a_vec: [usize; n],
    }

    const M: usize = 10000005;
    
    let mut cnt = vec![0; M];
    a_vec.sort();
    for a in a_vec.iter() {
        if cnt[*a] != 0 {
            cnt[*a] = 2;
            continue;
        }
        for i in (*a..M).step_by(*a) {
            cnt[i] += 1;
        }
    }
    let mut ans = 0;

    for a in a_vec.iter() {
        if cnt[*a] == 1 { ans += 1 }
    }
    println!("{}", ans);
}


Measured memory_bytes: 43936
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <numeric>
#include <bitset>
#include <vector>
#include <queue>

using namespace std;

typedef long long ll;
#define FOR(i,a,b)   for(ll i = (a); i < (b); i++ )
#define REP(i, n)    FOR(i,0,n)
typedef pair< ll, ll >   cp2;
typedef pair< ll, cp2 >   cp3;
#define fi first
#define se second
#define sec  se.fi
#define thr  se.se
const ll mod = 1000000007;
//              123456789

 
///////////////////////////////////////////////
//
//
///////////////////////////////////////////////

////////////////////////////////////////////////
////////////////////////////////////////////////

bool jdg = true;
int ans = 0;

string S;
int l, r;

int main(){
	
	cin>>S;
	
	l = 0;
	r = S.size()-1;
	
	while( l <= r ){
		int num = 0;
		while( S[l] == 'x' ){
			num++;
			l++;
		}
		while( S[r] == 'x' ){
			num--;
			r--;
		}
		if( S[l] != S[r] ) jdg = false;
		ans += abs( num );
		l++;
		r--;
	}
	
	if( jdg ) cout<<ans<<endl;
	else{
		puts("-1");
	}
	
	return 0;

}

Measured memory_bytes: 512
#include<bits/stdc++.h>
#include<string.h>
 
typedef long long int ll;
#define all(x) (x).begin(), (x).end()
 
using namespace std;

int nxt() {
    int x;
    cin >> x;
    return x;
}

ll nxtl(){
    ll x;
    cin>>x;
    return x;
}
 
void SieveOfEratosthenes(int n,vector <int> &primes) 
{ 
    // Create a boolean array "prime[0..n]" and initialize 
    // all entries it as true. A value in prime[i] will 
    // finally be false if i is Not a prime, else true. 
    bool prime[n+1]; 
    memset(prime, true, sizeof(prime)); 
  
    for (int p=2; p*p<=n; p++) 
    { 
        // If prime[p] is not changed, then it is a prime 
        if (prime[p] == true) 
        { 
            // Update all multiples of p greater than or  
            // equal to the square of it 
            // numbers which are multiple of p and are 
            // less than p^2 are already been marked.  
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
  
    // Print all prime numbers 
    for (int p=2; p<=n; p++) 
       if (prime[p]) 
          primes.push_back(p);
} 
 
ll max(ll a,ll b)
{
    if(a>b)
        return a;
    return b;
}
 
ll power(ll x, ll y,ll mod) 
{ 
    ll temp; 
    if( y == 0) 
        return 1; 
    temp = power(x, y/2,mod); 
    if (y%2 == 0) 
        return (temp*temp)%mod; 
    else
        return (((x*temp)%mod)*temp)%mod; 
}

vector <vector <int>  >g(10,vector <int> (10));
vector <int> dist(10);
void dji(void);

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int h=nxt(),w=nxt();
    for(int i=0;i<10;i++)
        generate(all(g[i]),nxt);

    int ans=0;
    dji();
    //for(auto i:dist)
        //cout<<i<<" ";
    //cout<<endl;
    for(int i=0;i<h;i++)
        for(int j=0;j<w;j++)
        {
            int x=nxt();
            if(x!=-1)
                ans+=dist[x];
        }
    cout<<ans<<endl;



    return 0;   
}

void dji(void)
{
    for(int i=0;i<10;i++)
        dist[i]=1e9;
    dist[1]=0;
    multimap <int,int> m2;
    for(int i=0;i<10;i++)
        m2.insert({dist[i],i});
    vector <bool> done(10,0);
    while(m2.size())
    {
        auto it=m2.begin();
        int val=it->second;
        int x=it->first;
       // cout<<val<<" "<<x<<endl;
        done[val]=1;
        for(int i=0;i<10;i++)
            if(x+g[i][val]<dist[i]){
                dist[i]=x+g[i][val];
            }

        m2.clear();
        for(int i=0;i<10;i++)
            if(!done[i])
                m2.insert({dist[i],i});
    }
}




 
 


Measured memory_bytes: 256
package main

import(
    "fmt"
)



func main() {
    var n int
    fmt.Scan(&n)
    var h = make([]int,n)
    for i:=0; i<n; i++{
        fmt.Scan(&h[i])
    }
    ans := 0
    ma := 0
    for i:=0; i<n; i++{
        if ma<=h[i]{
            ans++
        }
        ma = max32(ma,h[i])
    }
    fmt.Println(ans)
}





func abs32(a int) int {
    if a<0{
        return -a
    }
    return a
}

func abs64(a int64) int64 {
    if a<0{
        return -a
    }
    return a
}

func min32(a, b int) int {
    if a >= b {
        return b
    }
    return a
}

func max32(a, b int) int {
    if a >= b {
        return a
    }
    return b
}

func min64(a, b int64) int64 {
    if a >= b {
        return b
    }
    return a
}

func max64(a, b int64) int64 {
    if a >= b {
        return a
    }
    return b
}

func gcd(a, b int64) int64 {
    if a % b == 0 {
        return b
    } else {
        return gcd(b, a%b)
    }
}

func lcm(a, b int64) int64 {
    return a / gcd(a, b) * b
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define endl '\n'
#define pb push_back
#define mod 1000000007
#define all(v) v.begin(),v.end()
#define mm memset
#define PI 3.14159265358979323846264338327950288419716939937510
#define M 998244353 
#define MAXN   20000001 
#define ll long long int

void solve(){

  ll n;
  cin>>n;
  ll arr[n];
  ll xo=0;
  for(int i=0;i<n;i++){
    cin>>arr[i];
    xo^=arr[i];
  }
  for(int i=0;i<n;i++){
    cout<<(xo^arr[i])<<" ";
  }
  cout<<endl;
}

int main() {

  #ifndef ONLINE_JUDGE
    freopen("./input.txt", "r", stdin  );
  #endif   
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll t=1;
    //cin>>t;
    for(ll i=0;i<t;i++){
      solve();
    }
    return 0;
}

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


struct  res
{
	string s1;
	int p;
	int cnt;
}r[1000];

bool cmp(const res a, const res b)
	{
		if(a.s1!=b.s1)
			return a.s1<b.s1;
		if(a.p!=b.p)
			return a.p>b.p;
		return a.cnt<b.cnt;
	}

int main()
	{
		int n;
		cin>>n;
		for (int i=0;i<n;i++)
			{
				cin>>r[i].s1>>r[i].p;
				r[i].cnt=i+1;
			}
		sort(r,r+n,cmp);
		for (int i=0;i<n;i++)
			{
			
				//cout<<r[i].s1<<endl;
				cout<<r[i].cnt<<endl;
			

			}

	}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define chmin(a, b) ((a)=min((a), (b)))
#define chmax(a, b) ((a)=max((a), (b)))
#define fs first
#define sc second
#define eb emplace_back
using namespace std;
 
typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
 
const ll MOD=1e9+7;
const ll INF=1e18;
 
int dx[]={1, -1, 0, 0};
int dy[]={0, 0, 1, -1};


bool ch[7][15];
int flag,ans;
int mini[6];
int fil[7][7] = {
    {0,1,1,1,1,1},
    {0,1,1,1,1,0},
    {0,0,1,1,1,1},
    {0,1,1,1,0,0},
    {0,0,1,1,1,0},
    {0,0,0,1,1,1},
};
int fil2[] = {5,4,4,3,3,3};

int main(){
    int h;
    while(true){
        cin >> h;
        if(h == 0) break;
        vector<int> v[500];
        for(int i = 0;i < h;i++){
            for(int j = 1;j <= 5;j++){
                int tmp;
                cin >> tmp;
                v[j].insert(v[j].begin(), tmp);
            }
        }

        ans = 0;
        for(int num = 0;true;num++){
            int tmpans = ans;
            for(int i = 0;i <= h;i++){
                for(int j = 1;j <= 5;j++){
                    ch[j][i] = false;
                }
            }
            for(int i = 0;i < 6;i++){
                mini[i] = v[num*5+3].size();
                for(int j = 1;j <= 5;j++){
                    if(fil[i][j] == 0)continue;
                    if(mini[i] > v[num*5+j].size()) mini[i] =v[num*5+j].size();
            //        mini[i] = min(mini[i],v[num*5+j].size());
                }
            }

            for(int i = 0;i < h;i++){
                for(int k = 0;k < 6;k++){
                    if(i > mini[k]-1) continue;
                    int same = v[num*5+3][i];
                    int flag = 1;
                    for(int j = 1;j <= 5;j++){
                        if(fil[k][j] == 0)continue;
                        if(same != v[num*5+j][i]){
                            flag = 0;
                            break;
                        }
                    }
                    if(flag == 1){
                        ans += same*fil2[k];
                        for(int j = 1;j <= 5;j++){
                            if(fil[k][j] == 1)ch[j][i] = true;
                        }
                        break;
                    }
                }
            }
            for(int i = 1;i <= 5;i++){
                for(int j = 0;j < v[num*5+i].size();j++){
                    if(ch[i][j] == false) v[num*5+5+i].push_back(v[num*5+i][j]);
                }
            }
            if(tmpans == ans)break;
        }
        cout << ans << endl;

    }

}


Measured memory_bytes: 3164
use std::cmp::max;
use std::io::prelude::*;
use std::io::stdin;
use std::str::FromStr;

fn main() {
    let n: u64 = read();
    let m: u64 = read();

    let mut ans = 0;

    for d in (1..m.isqrt() + 1).rev() {
        if m % d == 0 {
            if d >= n {
                ans = max(ans, m / d);
            }
            if m / d >= n {
                ans = max(ans, d);
            }
        }
    }

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

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|b| b.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}

// https://en.wikipedia.org/wiki/integer_square_root
trait IntegerSqrt {
    fn isqrt(&self) -> Self;
}

impl IntegerSqrt for u64 {
    fn isqrt(&self) -> Self {
        if *self < 2 {
            *self
        } else {
            let s = (*self >> 2).isqrt() << 1;
            let l = s + 1;
            if l * l > *self {
                s
            } else {
                l
            }
        }
    }
}


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

int main(){
int n,t;
int mi = 1e5;
cin >> n;
vector<int> w(n);
for(int i=0;i < n;++i)
cin >> w[i];

for(int i=1;i< n;++i){
  int s1=0;
  int s2=0;

for(int j =0;j<i;++j)
s1 += w[j];
for(int k=i;k < n;++k)
s2 += w[k];

mi = min(mi,abs(s1-s2));

}
cout << mi << endl; 

}

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

void code()
{
    ll n;
    cin>>n;
    ll A[n];ll val=0;
    for(ll i=0;i<n;i++)
    {
        cin>>A[i];
        val+=A[i];
    }
    val=val/n;ll val2=val+1;
    // cout<<val;
    // val++;
    ll ans=0;ll ans2=0;
    for(ll i=0;i<n;i++)
    {
        ans+=(A[i]-val)*(A[i]-val);
        ans2+=(A[i]-val2)*(A[i]-val2);

    }
    cout<<min(ans,ans2)<<endl;


}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    ll t=1;
    // cin>>t;
    while(t--)
    {
        code();
    }
}


Measured memory_bytes: 256
n=int(input())
if n%2!=0:
  print(0)
  exit(0)
n//=10

def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = X_dumy//n
    return out

n=Base_10_to_n(n,5)
n=reversed(list(n))
tmp=1
ans=0

for i in n:
  ans+=int(i)*tmp
  tmp=tmp*5+1
print(ans)


Measured memory_bytes: 9144
n=int(input())
 
H=[int(i) for i in input().split()]
old=H[0]
danger=False
first=True

M=H[0]

for w in H:
    if w < M-1:
        print("No")
        break
    else:
        M=max(M,w)
else:
    print("Yes")

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

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
#define CLR(t,v) memset(t,(v),sizeof(t))
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<<endl;}
template<class T>void chmin(T&a,const T&b){if(a>b)a=b;}
template<class T>void chmax(T&a,const T&b){if(a<b)a=b;}


int nextInt() { int x; scanf("%d", &x); return x;}

void naive(ll N, ll K) {
  ll res = 0;
  for (int a = 1; a <= N; a++) {
    for (int b = 1; b <= N; b++) {
      if (a % b >= K) { 
        res++;
      }
    }
  }
  cout << res << endl;
}

int main2() {
  ll N, K; cin >> N >> K;
  // if (N <= 1000) {
    // naive(N, K);
    // return 0;
  // }

  if (K == 0) {
    cout << N * N << endl;
    return 0;
  }
  ll ans = 0;
  for (ll b = K+1; b <= N; b++) {
    ans += (N+1)-(((N+1)/b*K) + min(K,(N+1)%b));
    // cout << b << " " << ans << endl;
  }
  cout << ans << endl;
  return 0;
}

int main() {
  for (;!cin.eof();cin>>ws)
    main2();
  return 0;
}


Measured memory_bytes: 256
x=input()
a=0
b=0
c=0
if len(x)<6:
    print("INVALID")
else:
    for i in range(len(x)):
        X=ord(x[i])
        if 48<=X and X<=57:
            a+=1
        if 97<=X and X<=122:
            b+=1
        if 65<=X and X<=90:
            c+=1
    if a==0 or b==0 or c==0:
        print("INVALID")
    else:
        print("VALID")


Measured memory_bytes: 5560
#include<bits/stdc++.h>
#define fu(i,r,t) for(int i=r;i<=t;i++)
#define fd(i,r,t) for(int i=r;i>=t;i--)
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define int long long
#define INF 1e10
using namespace std;
const int maxn = 1e7+10;
int n,m,a[maxn],b[maxn];
map<int,int >T;
int32_t main(){
    IOS;
    cin>>n;
    int nn=sqrt(n);
    int ans=0;
    fu(i,1,nn)
    {
        if(i*i+i>=n)continue;
        if(n/i*i==n)
        {
            ans+=n/i-1;
        }
    }
    cout<<ans;

    return 0;
}


Measured memory_bytes: 256
import sys,collections,math;sys.setrecursionlimit(10**7)
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

a,b,k = Is()
for i in range(k):
        b,a = a//2,b+a//2
if k % 2 == 0:
    print(a,b)
else:
    print(b,a)

Measured memory_bytes: 3564
/* imports all std modules {{{*/
import
  std.algorithm,
  std.array,
  std.ascii,
  std.base64,
  std.bigint,
  std.bitmanip,
  std.compiler,
  std.complex,
  std.concurrency,
  std.container,
  std.conv,
  std.csv,
  std.datetime,
  std.demangle,
  std.encoding,
  std.exception,
  std.file,
  std.format,
  std.functional,
  std.getopt,
  std.json,
  std.math,
  std.mathspecial,
  std.meta,
  std.mmfile,
  std.net.curl,
  std.net.isemail,
  std.numeric,
  std.parallelism,
  std.path,
  std.process,
  std.random,
  std.range,
  std.regex,
  std.signals,
  std.socket,
  std.stdint,
  std.stdio,
  std.string,
  std.system,
  std.traits,
  std.typecons,
  std.uni,
  std.uri,
  std.utf,
  std.uuid,
  std.variant,
  std.zip,
  std.zlib;
/*}}}*/

/+---test
3
1 0 0
---+/
/+---test
5
0 0 0 0 0
---+/

void main(string[] args) {
  readln;
  const A = readln.split.map!(to!long).array;
  const N = A.length;

  auto boxes = new bool[N];
  foreach_reverse (i; 1..N+1) {
    long x;
    for (long j = i*2; j <= boxes.length; j+=i) {
      x += boxes[j-1];
    }
    boxes[i-1] = (x%2 != A[i-1]);
  }

  size_t[] ans;
  foreach (i, v; boxes) if (v) ans ~= i+1;

  ans.length.writeln;
  foreach (i, v; ans) {
    if (i != 0) " ".write;
    v.write;
  }
  writeln;
}


Measured memory_bytes: 9240
#pragma GCC optimize ("O3")
#include <iostream>
#include <vector>
#include <array>
#include <set>
#include <map>
#include <cmath>

using namespace std;

vector<array<int, 3>> arr;

int main() {
    int N;
    cin >> N;
    arr.resize(N);
    for (int i = 0; i < N; i++) cin >> arr[i][0] >> arr[i][1] >> arr[i][2];
    bool ans = 1;
    int t = 0, x = 0, y = 0;
    for (int i = 0; i < N; i++) {
        int points = arr[i][0] - t;
        int dist = abs(arr[i][1] - x) + abs(arr[i][2] - y);
        if (dist > points || dist % 2 != points % 2) {
            ans = false;
        }
        if (dist == 0 && points == 0) {
            ans = false;
        }
        t = arr[i][0];
        x = arr[i][1];
        y = arr[i][2];
    }
    if (!ans) cout << "No" << endl;
    else cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 1408
#ifdef _WIN32
#include "XOR.h"
#endif

#include <stdio.h>

#include <iostream>
#include <vector>
#include <array>

constexpr int64_t MOD = 1'000'000'007;
constexpr int64_t help = 1;

#define ll long long int

void fastscan(ll& number) {
	//variable to indicate sign of input number 
	int c;

	number = 0;

	// extract current character from buffer 
	c = getchar();

	// Keep on extracting characters if they are integers 
	// i.e ASCII Value lies from '0'(48) to '9' (57) 
	for (; (c > 47 && c < 58); c = getchar())
		number = number * 10 + c - 48;

	// if scanned input has a negative sign, negate the 
	// value of the input number 
}
#ifdef _WIN32
namespace XOR
{
#endif 

	int main() {
		ll n;

		fastscan(n);


		std::array<ll, 62> bits{};
		for (ll i = 0; i < n; i++) {
			ll d;
			fastscan(d);
			for (ll b = 0; b < 62; b++) {
				bits[b] += !!(d & (help << b));
			}
		}

		ll ans = 0;

		for (ll b = 0; b < 62; b++) {
			ll p = (help << b) % MOD;
			ans += (bits[b] * (n - bits[b]) % MOD) * p;
			ans %= MOD;
		}

		std::cout << ans;
	}
#ifdef _WIN32
}
#endif 


Measured memory_bytes: 3164
#include <iostream>
#include <vector>
#include <functional>
#include <set>
using namespace std;

int main(){
    int N;
    cin >> N;
    vector<vector<int>> v(N+1);
    set<int> R,C;
    for(int i=0;i<N;i++){
        int r,c;
        cin >> r >> c;
        R.insert(r);
        C.insert(c);
        v[r].push_back(c);
        v[c].push_back(r);
    }
    if(R.size()!=N || C.size()!=N){
        cout << -1 << endl;
        return 0;
    }
    vector<int> vis(N+1,0);
    function<int(int)> dfs = [&](int n){
        vis[n] = 1;
        int res = 1;
        for(auto x:v[n]){
            if(!vis[x]) res += dfs(x);
        }
        return res;
    };
    int ans = 0;
    for(int i=1;i<=N;i++){
        if(!vis[i]) ans += dfs(i)-1;
    }
    cout << ans << endl;
}


Measured memory_bytes: 24232
N = int(input())
An = list(map(int, input().split()))
ans = 0
Ai = An[0]
for i in range(1, N):
    if Ai > An[i]:
#         print(Ai, An[i])
        ans += Ai - An[i]
    Ai = max(Ai, An[i])
print(ans)

Measured memory_bytes: 32244
#include <bits/stdc++.h>
#define ll long long int
#define MOD 1000000007
#define INF 1e18
#define PI 3.14159265358979

using namespace std;

ll gcd(ll a, ll b);
ll power(ll n, ll k);
ll inv(ll n);
ll genfact(ll n, ll k);
ll fact(ll n);
ll nck(ll n, ll k);

int main(void){
  int a, b;
  cin >> a >> b;
  if (a + b < 10)
    cout << a + b << endl;
  else
    cout << "error" << endl;

  return 0;
}

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

ll power(ll n, ll k){
  ll res = 1;
  while(k > 0){
    if (k & 1) 
      res = res * n % MOD;
    n = n * n % MOD;
    k >>= 1;
  }
  return res;
}

ll genfact(ll n, ll k){

  ll res = 1;
  while (k >= 0){
    res = (res * (n - k)) % MOD;
    k--;
  }

  return res;
}

ll inv(ll n){
  return power(n, MOD - 2);
}

ll fact(ll n){
  return genfact(n, n - 1);
}

ll nck(ll n, ll k){
  if (k == 0)
    return 1;
  if (n <= 0)
    return 0;

  return ((genfact(n, k) % MOD) * inv(fact(k))) % MOD;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<string>
#define MOD 1000000007

using namespace std;

int main(){
    int n,m,tmp, a[100009],dp[100009];
    cin >> n >> m;
    for(int i=0;i<=n;i++){
        a[i]=0;
        dp[i]=0;
    }
    for(int i=0;i<m;i++){
        cin >> tmp;
        a[tmp] = 1;
    }

    dp[0]=1;
    for(int i=1;i<=n;i++){
        if(a[i] == 1){
            dp[i]=0;
        }
        else{
            if(i == 1){
                dp[i] = dp[i-1]%MOD;
            }
            else{
                dp[i] = (dp[i-1] + dp[i-2])%MOD;
            }
        }
    }
    cout << dp[n] << endl;
}


Measured memory_bytes: 1024
/**
*    author:  y_takano
*    created: 19.06.2020 11:59:07
**/

#include <bits/stdc++.h>

using namespace std;

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

  int n, tmp;
  cin >> n;

  vector<int> v;

  for (size_t i = 0; i < n; i++)
  {
      cin >> tmp;
      v.push_back(tmp);
  }
  
  for (int i = v.size() - 1; i > 0; i--)
  {
    cout << v[i] << ' ';
  };

  cout << v[0] << endl;

  return 0;
}


Measured memory_bytes: 3124
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MS(a) memset(a,0,sizeof(a))
#define MP make_pair
#define PB push_back
const int INF = 0x3f3f3f3f;
const ll INFLL = 0x3f3f3f3f3f3f3f3fLL;
inline ll read(){
    ll x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
//////////////////////////////////////////////////////////////////////////
const int maxn = 1e5+10;

ll n,a[maxn],sum[maxn];

int main(){
	cin >> n;
	for(int i=1; i<=n; i++)
		a[i] = read();
	sort(a+1,a+1+n);

	for(int i=1; i<=n; i++)
		sum[i] = sum[i-1]+a[i];

	ll ans = 1;
	for(int i=n-1; i>=1; i--){
		if(sum[i]*2 < a[i+1]) break;
		ans++;
	}

	cout << ans << endl;

    return 0;
}

Measured memory_bytes: 1792
if __name__ == '__main__':
    s0 = str(input())
    s1 = s0[1:]
    # print(s0, s1)
    bad = False
    for x,y in zip(s0,s1):
        if x == y:
            bad = True
            break
    if bad:
        print('Bad')
    else:
        print('Good')

Measured memory_bytes: 2940
#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<ll, ll> P;
typedef tuple<ll, ll, ll> T;
constexpr auto INF = INT_MAX >> 1;
constexpr auto LINF = 5000000000000000;
constexpr auto MOD = 1000000007;

int main() {

	int n, q;
	string s;
	cin >> n >> s >> q;

	V<set<int>> alp(26);
	rep(i, n)alp[s[i] - 'a'].insert(i);

	rep(i, q) {

		int qq;
		cin >> qq;

		if (qq == 1) {
			int k;
			char c;
			cin >> k >> c;
			k--;
			alp[s[k] - 'a'].erase(k);
			alp[c - 'a'].insert(k);
			s[k] = c;
		}

		if (qq == 2) {
			int l, r;
			cin >> l >> r;
			l--;r--;
			int cnt = 0;
			rep(j, 26) {
				if (alp[j].size() == 0)continue;
				auto la = alp[j].lower_bound(l);
				if (la == alp[j].end())continue;
				if (*la <= r)cnt++;
			}
			cout << cnt << endl;
		}

	}

}

Measured memory_bytes: 24196
#include<stdio.h>
#define N 3

int C[N][N];

int cmp(int i,int j){
  if(C[i][j]-C[i+1][j]==C[i][j+1]-C[i+1][j+1]){
    if(C[i][j]-C[i][j+1]==C[i+1][j]-C[i+1][j+1]) return 0;
  }
  return 1;
}

int main(void){
  int i,j;
  for(i=0;i<N;i++)
    for(j=0;j<N;j++)
      scanf("%d",&C[i][j]);
  for(i=0;i<N-1;i++){
    for(j=0;j<N-1;j++){
      if(cmp(i,j)){
        puts("No");
        return 0;
      }
    }
  }
  puts("Yes");
  return 0;
}

Measured memory_bytes: 128
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned long long ULL;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

#define MP make_pair
#define EACH(i,c) for(auto i: c)
#define SORT(c) sort((c).begin(),(c).end())

#define ALL(a)  (a).begin(),(a).end()

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int N, Q;
	cin >> N >> Q;

	cerr << N << " " << Q << endl;

	string S;
	cin >> S;

	vector<char> T(Q), D(Q);
	REP(i, Q) cin >> T[i] >> D[i];

	auto f = [&](int i, int &l, int &r)
	{
		l = i; r = i;
		REP(j, Q){
			if(S[i] != T[j]) continue;
			if(D[j] == 'L') i--;
			else i++;
			l = min(l, i);
			r = max(r, i);
			if(l < 0) return;
			if(N <= r) return;
		}
	};

	int l = 0;
	int r = N;
	while(l + 1 < r){
		int mid = (l + r) / 2;
		int tmp = mid;
		int ll, rr;
		f(tmp, ll, rr);
		cerr << "ll rr " << tmp << " " << ll << " " << rr << endl;
		if(N <= rr) r = mid;
		else l = mid;
	}
	cerr << l << " " << r << endl;

	int right = (l + r) / 2;
	l = 0;
	r = N;
	while(l + 1 < r){
		int mid = (l + r) / 2;
		int ll, rr;
		f(mid, ll, rr);
		if(ll < 0) l = mid;
		else r = mid;
	}
	cerr << l << " " << r << endl;

	cout << right - (l + r) / 2 << endl;


	return 0;
}


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

#define vi vector<int>

int main() {

    int N;
    cin >> N;

    vi A;
    int a;
    for (int i = 0; i < N; i++) {
        cin >> a;
        A.push_back(a);
    }

    vi B;
    B = A;
    sort(A.begin(), A.end());

    for (int i = 0; i < N; i++) {
        if (B[i] == A[N-1]) {
            cout << A[N-2] << endl;
        }
        else {
            cout << A[N-1] << endl;
        }
    }

    return 0;
}


Measured memory_bytes: 3316
#include<bits/stdc++.h>
using namespace std;
int main(){
    bool n=false,s=false,w=false,e=false;
    string S;
    cin>>S;
    for(int i=0;i<S.size();i++){
        switch(S[i]){
            case 'N': n=true;break;
            case 'S': s=true;break;
            case 'W': w=true;break;
            case 'E': e=true;break;
        }
    }
    cout<<(n==s&&w==e?"Yes":"No")<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>

using namespace std;

int main() {
    int k, x;
    cin >> k >> x;
    for (int i=x-k+1; i<x+k; i++)
        cout << i << (i < x+k-1 ? ' ' : '\n');
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define inf 1e18
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define pb push_back
#define ff first
#define ss second
#define vll vector<ll>
#define pii pair<ll,ll>
#define sz(v) (v).size()
#define srt(v) sort(v.begin(),v.end())
#define ull unsigned long long
#define tell(a) cout<<a<<" "
#define el cout<<endl
#define rev(v) reverse(v.begin(),v.end())
#define rep(i,a,n) for(int i=a;i<n;i++)
#define M 1000000007
ll power(ll x, ll y, ll p){ll res = 1;x = x % p;while (y > 0){   if (y & 1)res = (res*x) % p;y = y>>1;
x = (x*x) % p;}return res;}



int main()
{
	IOS;
	int n;
	cin>>n;
	n=n%10;
	if(n==2||n==4||n==5||n==7||n==9)
	cout<<"hon";
	else if(n==0||n==1||n==6||n==8)
	cout<<"pon";
	else
	cout<<"bon";
}



Measured memory_bytes: 3652
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define ll          long long
#define pb          push_back
#define mp 	    make_pair
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define vii         vector<pii>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define all(a)      (a).begin(),(a).end()
#define fi          first
#define si          second
#define sz(x)       (ll)x.size()
#define endl        '\n'
#define mod        1000000007
#define mset(m,v) memset(m,v,sizeof(m))
using namespace std;
ll power(ll a , ll b,ll modi)
{
    ll res = 1 ;
    while(b)
    {
        if(b%2) {
            res = (res * a) % modi ;
        }
        b/=2 ;
        a = (a*a) % modi ;
    }
    return res ;
}
bool pali(vector<char>ch)
{
	for(int i=0;i<ch.size();i++)
	if(ch[i]!=ch[ch.size()-i-1])
	return false;
	return true;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t=1;
	//cin>>t;
	while(t--)
	{
	  double l;
	  cin>>l;
	  printf("%.10f",(l*l*l)/27.0);
	}
return 0;
}

Measured memory_bytes: 384
import java.util.*

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    val N = scanner.nextLong()
    
    val even = (N - 1) / 11 * 2 + 2
    val odd = (N + 4) / 11 * 2 + 1
    
    println(if(even < odd) even else odd)
}

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

int main()
{
	ll n,k;
	cin >> n >> k;
	vector<ll> a(n),b;
	for(auto &i:a)cin >> i;
	for(ll i = 0;i<n;i++)
	{
		ll now = 0;
		for(ll j = i;j<n;j++)
		{
			now += a[j];
			//cout<<bitset<8>(now)<<endl;
			b.push_back(now);
		}
	}
	sort(b.rbegin(),b.rend());
	for(ll i = 60;i>=0;i--)
	{
		ll cnt = 0;
		vector<ll> c;
		for(ll j = 0;j<b.size();j++)
		{
			if((b[j]>>i)&1)c.push_back(b[j]);
		}
		
		if(c.size()>=k)
		{
			b=c;
		}
	}
	for(ll i = 1;i<b.size();i++)
	{
		b[0]&=b[i];
	}
	cout<<b[0]<<endl;
}

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

int main(void){
    vector<int> num(100001, 1);
    num[0] = 0;
    num[1] = 0;
    for (int i = 2; i <= sqrt(100000); i++) {
        if (num[i] == 1) {
            for (int j = i + i; j <= 100000; j += i) {
                num[j] = 0;
            }
        }
    }
    vector<int> mys(100001);
    for (int i = 0; i <= 100000; i++) {
        if (num[i]) {
            if (num[(i + 1) / 2]) {
                mys[i] = 1;
            }
        }
    }
    vector<int> s(100002);
    for (int i = 0; i < 100002; i++) {
        s[i + 1] = s[i] + mys[i];
    }
    int Q;
    cin >> Q;
    int l, r;
    for (int i = 0; i < Q; i++) {
        cin >> l >> r;
        cout << s[r+1] - s[l] << endl;
    }
}


Measured memory_bytes: 4488
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<queue>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1001001001;

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

  if (S[2] == S[3] && S[4] == S[5]) cout<< "Yes" << endl;
  else cout<< "No" << endl;  
  return 0;
}



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

int main() {
    int n, m;
    cin >> n >> m;
    int x[m], xd[m-1];
    rep(i, m) cin >> x[i];

    sort(x, x+m);
    rep(i, m-1) xd[i] = x[i+1] - x[i];
    sort(xd, xd+m-1);

    int ans = 0;
    rep(i, m-n) ans += xd[i];

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


Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
#define ll long long
#define FOR(i, n, m) for(int i=n; i<m; ++i)

int main(){
  ll N, K;
  cin >> N >> K;
  ll count = 0;
  
  if(K%2==0) {
    count = (N/K)*(N/K)*(N/K)+((N+K/2)/K)*((N+K/2)/K)*((N+K/2)/K);
  }else{
    count = (N/K)*(N/K)*(N/K);
  }
    
  cout << count << endl;
}

Measured memory_bytes: 256
# coding: utf-8
from bisect import bisect_left, bisect_right

n = int(input().rstrip())
bo = sorted([int(i) * -1 for i in input().rstrip().split(" ")])

ans = 0
for i in range(n-2):
    for j in range(i+1,n-1):
        if j < int(i/2):
            break
        idx = bisect_left(bo, bo[i]-bo[j], j+1)
        ans += idx - j - 1

print(ans)


Measured memory_bytes: 3188
let () = Scanf.scanf "%d\n" @@ fun n ->
  let d =
    Array.init n @@ fun _ ->
      Array.init n @@ fun _ ->
        Scanf.scanf "%d " @@ fun a -> a in
  try
    for i = 0 to n - 1 do
      for j = 0 to n - 1 do
        for k = 0 to n - 1 do
          if d.(j).(i) + d.(i).(k) < d.(j).(k) then raise Not_found
        done
      done
    done;
    let d' = Array.make_matrix n n 300000000000 in
    begin
      List.concat @@ Array.to_list @@ Array.mapi (fun i d ->
        Array.to_list @@ Array.mapi (fun j d -> (i, j, d)) d) d
    end
    |> List.sort (fun (_, _, d) (_, _, d') -> compare d d')
    |> List.fold_left (fun acc (i, j, d) ->
        if d'.(i).(j) <= d
        then acc
        else begin
          d'.(i).(j) <- d;
          d'.(j).(i) <- d;
          for k = 0 to n - 1 do
            for l = 0 to n - 1 do
              if d'.(k).(i) + d + d'.(j).(l) < d'.(k).(l) then
                d'.(k).(l) <- d'.(k).(i) + d + d'.(j).(l);
              if d'.(k).(j) + d + d'.(i).(l) < d'.(k).(l) then
                d'.(k).(l) <- d'.(k).(j) + d + d'.(i).(l)
            done
          done;
          d + acc
        end) 0
    |> Printf.printf "%d\n"
  with Not_found -> print_endline "-1"

Measured memory_bytes: 16768
import java.io.*;
import java.util.*;
class Main{
	static final long MOD = 1_000_000_007; // 10^9+7
	static final int MAX = 2_147_483_646; // intMax 
	static final int INF = 1_000_000_000; // 10^9  
	public static void main(String[] args) throws Exception{
		hayami saori = new hayami();
		int x = saori.saori_hayami();
		int y = saori.saori_hayami();
		if(x*4 >= y && x*2 <= y && y % 2 == 0){
			System.out.println("Yes");
			return;
		}
		System.out.println("No");
		saori.close();
	}
}

class hayami implements Closeable {
	private final InputStream in = System.in;
	private final byte[] hayami = new byte[1024];
	private int Hayami = 0;
	private int saori = 0;
	private boolean HayamiSaori() {
		if (Hayami < saori) {
			return true;
		}else{
			Hayami = 0;
			try {
				saori = in.read(hayami);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (saori <= 0) {
				return false;
			}
		}
		return true;
	}
	private int SaoriHayami() { 
		if (HayamiSaori()) {
            return hayami[Hayami++];
         }else{
             return -1;
         }
	}
	private static boolean hayami_saori(int hayami) { 
		return 33 <= hayami && hayami <= 126;
	}
	public boolean hayamisaori() { 
		while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
	}
	public String nextHayami() {
		if (!hayamisaori()) throw new NoSuchElementException();
		StringBuilder hayamin = new StringBuilder();
		int saori = SaoriHayami();
		while(hayami_saori(saori)) {
			hayamin.appendCodePoint(saori);
			saori = SaoriHayami();
		}
		return hayamin.toString();
	}
	public long saorihayami() {//nextLong
		if (!hayamisaori()) throw new NoSuchElementException();
		long hayami = 0;
		boolean misao = false;
		int saori = SaoriHayami();
		if (saori == '-') {
			misao = true;
			saori = SaoriHayami();
		}
		if (saori < '0' || '9' < saori) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= saori && saori <= '9') {
				hayami *= 10;
				hayami += saori - '0';
			}else if(saori == -1 || !hayami_saori(saori)){
				return misao ? -hayami : hayami;
			}else{
				throw new NumberFormatException();
			}
			saori = SaoriHayami();
		}
	}
	public int saori_hayami() {//nextInt
		long hayami = saorihayami();
		if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) hayami;
	}
	public double Hayamin() { //nextDouble
		return Double.parseDouble(nextHayami());
	}
	public void close() {
		try {
			in.close();
		} catch (IOException e) {
		}
    }
    
}


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

int main(void){
    // Your code here!
   int a, b, c;
   cin >> a >> b >> c;
   if( -b + c <= 0 ){
       cout << "delicious" << endl;
   } else if(-b+c <= a){
       cout << "safe" << endl;
   } else {
       cout << "dangerous" << endl;
   }
   return 0;
}


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

typedef long long ll;
typedef pair<int, int> P;
#define MOD 1000000007
#define INF (1 << 30)
#define REP(i, m, n) for(int i = (int)m; i < (int)n; ++i)
#define rep(i, n) REP(i, 0, n)


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

    int l, a, b, c, d; cin >> l >> a >> b >> c >> d;
    cout << l - max((a+c-1)/c, (b+d-1)/d) << '\n';
    return 0;
}


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

int main() {
    int n, m;
    cin >> n >> m;
    vector<int> a(m);
    for(auto& e : a) cin >> e;
    int ans = n - accumulate(begin(a), end(a), 0);
    if(ans < 0) ans = -1;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3664
#include <bits/stdc++.h>
#define ALL(obj) begin(obj), end(obj)
#define debug(x) cerr << #x << ": " << x << '\n'
using namespace std;
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
template <class T>
bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return 1;
    }
    return 0;
}

using ll = long long;
using ull = unsigned long long;
const int INF = 2100100100;
// const int MOD = 1e9 + 7;

int main() {
    int x, a, b;
    cin >> x >> a >> b;
    if (b <= a) {
        cout << "delicious\n";
    } else if (b <= a + x) {
        cout << "safe\n";
    } else {
        cout << "dangerous\n";
    }
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <functional>
#include <utility>
#include <tuple>
#include <cctype>
#define INF 0x3f3f3f3f
#define MOD 1000000007
#define PI 4*atan(1.0)
#define mp make_pair
#define mt make_tuple
#define pb push_back
typedef long long ll;
typedef long double ld;
using namespace std;
int dx[4]={0,0,-1,1};
int dy[4]={-1,1,0,0};
const int SIZE=100050;
//int arr[SIZE]={};
//ここまでテンプレ
int main(){
	string s;
	cin>>s;
	int ss=s.length();
	for(int i=0;i<ss;i++){
		if(i==4)
			cout<<" ";
		cout<<s[i];
	}
	cout<<endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.io.*;
class Main{
	public static void main(String[]args){
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out, true);
		int n=Integer.parseInt(in.nextLine());
		String str=in.nextLine();
		

		String a[]=str.split(" ");
		String a_bub[]=str.split(" ");
		String a_sel[]=str.split(" ");

		//Bubble Sort
		for(int i=0;i<n;i++){
			for(int j=n-1;j>=i+1;j--){
				if((a_bub[j].charAt(1)-'0') < (a_bub[j-1].charAt(1)-'0')){
					String temp=a_bub[j];
					a_bub[j]=a_bub[j-1];
					a_bub[j-1]=temp;
				}
			}
		}

		//Selection Sort
		for(int i=0;i<n;i++){
			int min=i;
			for(int j=i;j<n;j++){
			       if((a_sel[j].charAt(1)-'0') < (a_sel[min].charAt(1)-'0'))
				       min=j;
			}
			String temp=a_sel[i];
			a_sel[i]=a_sel[min];
			a_sel[min]=temp;
		}		

		int flag_1=0;
		int flag=0;

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


			ArrayList<String> list_orig=new ArrayList<>();
			for(int j=0;j<a.length;j++){
				if( (a[j].charAt(1)-'0')==i)
					list_orig.add(a[j]);
			}

			ArrayList<String> list_sel=new ArrayList<>();
			for(int j=0;j<a_sel.length;j++){
				if( (a_sel[j].charAt(1)-'0')==i)
					list_sel.add(a_sel[j]);
			}

			ArrayList<String> list_bub=new ArrayList<>();
			
			for(int j=0;j<a_bub.length;j++){
				if( (a_bub[j].charAt(1)-'0')==i)
					list_bub.add(a_bub[j]);
			}

			for(int j=0;j<list_orig.size();j++){
				if(!list_orig.get(j).equals(list_sel.get(j))){
					flag_1=1;
					break;
				}
				if(flag_1==1)
					break;
			}


			for(int j=0;j<list_orig.size();j++){
				if(!list_orig.get(j).equals(list_bub.get(j))){
					flag=1;
					break;
				}
				if(flag==1)
					break;
			}

		}

		for(int i=0;i<n;i++){
			if(i==n-1)
				out.printf(a_bub[i]+"\n");
			else
				out.print(a_bub[i]+" ");
		}
		if(flag==1)
			out.println("Not stable");
		else
			out.println("Stable");


		for(int i=0;i<n;i++){
			if(i==n-1)
				out.printf(a_sel[i]+"\n");
			else
				out.print(a_sel[i]+" ");
		}
		if(flag_1==1)
			out.println("Not stable");
		else
			out.println("Stable");

	}
}


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

using namespace std;

#define rep(i, n) for(int i = 0; i < n; i++)
#define inv(n, a) for(int i = 0; i < n; i++) cin >> a[i]
#define MOD 1000000007
#define INF 1e7
#define LINF 1e15
typedef long long ll;
typedef long double ld;
using Graph = vector<vector<int>>;
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; }
// 'a' = 97 'z' = 122 => 'a' = 0 'z' = 25

int main() {
    int n; cin >> n;
    vector<int> x(n), l(n);
    vector<pair<int, int>> st;
    rep(i, n) {
        cin >> x[i] >> l[i];
        int s = x[i]-l[i];
        int t = x[i]+l[i];
        st.emplace_back(make_pair(s, t));
    }
    sort(st.begin(), st.end(), [](const auto &a, const auto &b){return a.second < b.second;});
    int cur = -INF, ans = 0;
    rep(i, n){
        if(cur <= st[i].first){ // 現在位置が i の左側範囲の外である
            ans++;
            cur = st[i].second; // i を残すと決めたなら、位置を Ti へ
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 2168
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define re(i,n) for(ll i=0;i<n;++i)
#define ocut cout
#define ouct cout
#define itn int
struct Union{
  vector<int> par;
  Union(int a){
  par=vector<int>(a,-1);
  }
  int find(int a){
    if(par[a]<0){
      return a;
    }
    else{
      return par[a]=find(par[a]);
    }
  }
  bool same(int a,int b){
    return (find(a)==find(b));
  }
  int size(int a){
    return -par[find(a)];
  }
  void unite(int a,int b){
    int c=find(a),d=find(b);
    if(c==d)
      return;
    if(size(c)<size(d)){
      swap(c,d);
    }
    par[c]+=par[d];
    par[d]=c;
  }
};
int main(){
  char s[8];
  cin >> s;
  int k=0;
  for(int i=0;i<4;i++){
    if(s[i]=='2')k++;
  }
  cout << k;
}

Measured memory_bytes: 256