akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
 
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
 
#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=(int)(a)-1;i>=(int)(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)
 
#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
 
// #define DEBUG
 
#ifdef DEBUG
    #define dump(...) fprintf(stderr, __VA_ARGS__)
#else
    #define dump(...)
#endif
 
template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}
 
using namespace std;
using ll=long long;
using vi=vector<int>;
using vll=vector<ll>;
 
const double EPS = 1e-10;
const double PI = acos(-1.0);
const ll inf =1LL << 62;
const ll mod=1000000007LL;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
 
 
ll extgcd(ll a,ll b,ll& x,ll& y){x=1,y=0;ll g=a;if(b!=0) g=extgcd(b,a%b,y,x),y-=a/b*x;return g;}
ll ADD(const ll &a, const ll &b,const ll &mod) { return (a+b)%mod;}
ll SUB(const ll &a, const ll &b,const ll &mod) { return (a-b+mod)%mod;}
ll MUL(const ll &a, const ll &b,const ll &mod) { return (1LL*a*b)%mod;}
ll DIV(const ll &a, const ll &b,const ll &mod) {ll x,y; extgcd(b,mod,x,y);return MUL(a,(x+mod)%mod,mod);}
 
random_device rd;
mt19937 mt(rd());
uniform_int_distribution<int> dice(1,6);
uniform_real_distribution<double> score(0.0,10.0);

const int M = 4;
map<vi, int> dic;

inline void rot(vi& c){
    rep(i, M-1){
        swap(c[i], c[i+1]);
    }
}

inline void rev(vi& c){
    reverse(_all(c));
}

inline void reg(vi& c){
    rep(i, M){
        dic[c]++;
        rot(c);
    }
}

inline void del(vi& c){
    rep(i, M){
        dic[c]--;
        rot(c);
    }
}

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

    int n; cin >> n;
    vector<vi> C(n, vi(M));
    for(auto& c : C){
        for(auto& e : c) cin >> e;
        reg(c);
    }

    ll res = 0LL;
    rep(i, n){
        vi& c1 = C[i];
        del(c1);
        // cerr << dic[c1] << endl;

        rep(j, i+1, n){
            vi& c2 = C[j];
            del(c2);
            rev(c2);

            rep(k, 4){
                ll cur = 1LL;
                vector<vi> used;
                rep(l, 4){
                    vi c = {c2[l], c2[(l+1) % M], c1[(l+1) % M], c1[l]};
                    int num = max(dic[c], 0);
                    cur *= num;
                    if(num == 0) break;
                    del(c);
                    used.emplace_back(c);
                }
                for(auto e : used) reg(e);
                res += cur;

                rot(c2);
            }
            rev(c2);
            reg(c2);
        }
        // cerr << res << endl;
    }

    cout << res << endl;

    return 0;
}


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

int gcb(int a,int b){
    if(a%b == 0) return b;
    return gcb(b,a%b);
}

int main() {
    //input
    int n,m;
    std::cin >> n;
    std::cin >> m;

    vector<bool> c(n+1,true);
    for(int i=0;i<m;i++){
        int a;
        cin >>a;
        c[a] = false;
    }

    vector<long long int> dp(n+1);
    dp[0] = 1;
    for(int i=0;i<n;i++){
        for(int j=i+1;j<=min(n,i+2);j++){
            if(c[j]){
                dp[j] += dp[i];
                dp[j] %= 1000000007;
            }

        }
    }
    cout << dp[n];
    return 0;
}

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

#define fast ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define int long long
#define endl '\n'

using namespace std;

const int N = 4e6 + 77;

bool isPrime(int n){
    if(n<2) return false;
    if(n==2) return true;
    if(n%2==0) return false;
    for(int i = 3 ; i*i <= n ; i += 2){
        if(n%i==0) return false;
    }
    return true;
}

int32_t main(){
    fast;
    int a , b; cin >> a >> b;
    set<int> A,B,C,Ans;
    for(int i = 1 ; i*i <= a ; ++i){
        if(a%i==0){
            A.insert(i);
            A.insert(a/i);
        }
    }
    for(int i = 1 ; i*i <= b ; ++i){
        if(b%i==0){
            B.insert(i);
            B.insert(b/i);
        }
    }
    for(int i : A) if(B.find(i)!=B.end()) C.insert(i);
    for(int i : C) if(isPrime(i)) Ans.insert(i);
    for(int i : C){
        bool ok = true;
        for(int j : Ans){
            if(__gcd(i,j)!=1){
                ok = false;
                break;
            }
        }
        if(ok) Ans.insert(i);
    }
    cout << Ans.size() << endl;
    return 0;
}

Measured memory_bytes: 4424
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
    sizeは(int)とキャストしよう
    ごちゃごちゃ場合分けを考える前に全探索は考えましたか？
*/

int main(){
    int N; cin >> N;
    vector<int> d(N);
    for(int i=0; i<N; i++) cin >> d[i];
    sort(d.begin(), d.end());

    if(d[N/2-1] == d[N/2]){
        cout << 0 << endl;
    } else {
        cout << d[N/2] - d[N/2-1] << endl;
    }
}

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

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

  ll X, Y; cin >> X >> Y;
  
  string ans = "No";
  for (ll i = 0; i < X + 1; i++) {
    if (i * 2 + (X - i) * 4 == Y) ans = "Yes";
  }
  cout << ans << '\n';
  return 0;
}

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

#define ll long long

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

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

    sort(a.begin(), a.end());

    ll a_max = a[a.size()-1];
    ll a_min = a[0];
    
    ll total = 0;
    for(int i=0; i<a.size(); ++i) total += a[i];

    cout << a_min << " " << a_max << " " << total << endl;
    return 0;
}


Measured memory_bytes: 3172
#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <string>
#include <map>

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = (n) - 1; i >= 0; i--)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (a); i > (b); i--)
#define ALL(a) (a).begin(), (a).end()

int N, A[200000];

bool check(int n) {
    map<int, int> mii;
    int before = 0;
    REP(i, N) {
        if (A[i] <= before) {
            vector<int> target;
            for (auto it = mii.rbegin(); it != mii.rend(); it++) {
                if (it->first >= A[i]) target.push_back(it->first);
                else break;
            }
            for (int j : target) mii.erase(j);

            target.clear();
            bool ok = false;
            RREP(j, A[i]) {
                if (mii.find(j) != mii.end() && mii[j] == n - 1) target.push_back(j);
                else {
                    mii[j]++;
                    ok = n != 1;
                    break;
                }
            }
            for (int j : target) mii.erase(j);
            if (!ok) return false;
        }
        before = A[i];
    }
    return true;
}

int main() {
    cin >> N;
    REP(i, N) cin >> A[i];
    int ng = 0, ok = 300000;
    while (ok - ng > 1) {
        int mid = (ng + ok) / 2;
        if (check(mid)) ok = mid;
        else            ng = mid;
    }
    cout << ok << endl;
    return 0;
}


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

int main() {
  int N;
  cin >>N;
  set<string> gacha;
  for(int i=0;i<N;i++){
    string S;
    cin >> S;
    gacha.insert(S);
  }
  cout << gacha.size() << endl;
}

Measured memory_bytes: 19160
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        RectangleCutting solver = new RectangleCutting();
        solver.solve(1, in, out);
        out.close();
    }

    static class RectangleCutting {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int w = in.nextInt();
            int h = in.nextInt();
            int x = in.nextInt();
            int y = in.nextInt();

            out.print((double) w * h / 2 + " ");
            if (2 * x == w && 2 * y == h) {
                out.print(1);
            } else {
                out.print(0);
            }
        }

    }
}



Measured memory_bytes: 38732
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
#define all(x) (x).begin(), (x).end()
#define fsp(x) fixed << setprecision(x)
const ll inf = LLONG_MAX;
const long double pi = acos(-1);
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	//const ll p = 1e9 + 7;
	//const ll p = 998244353;

	ll n, m, x;
	cin >> n >> m >> x;
	vll c(n);
	vector<vll> a(n, vll(m));
	for (ll i = 0; i < n; i++) {
		cin >> c[i];
		for (ll j = 0; j < m; j++) cin >> a[i][j];
	}

	ll lim = pow(2, n);
	vector<bool> v(n, false);
	ll ans = inf;
	while (lim--) {
		vll w(m, 0);
		ll cost = 0;
		for (ll i = 0; i < n; i++) {
			if (v[i]) {
				for (ll j = 0; j < m; j++) {
					w[j] += a[i][j];
				}
				cost += c[i];
			}
		}
		bool flag = true;
		for (ll i = 0; i < m; i++) {
			if (w[i] < x) flag = false;
		}
		if (flag) ans = min(ans, cost);
		if (lim == 0) break;
		ll z = n - 1;
		while (z >= 0 && v[z]) {
			v[z] = false;
			z--;
		}
		v[z] = true;
	}
	if (ans == inf) cout << -1 << endl;
	else cout << ans << endl;
}


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

int main(){
    int n; cin >> n;
    int ac = 0 ,wa = 0 ,tle = 0 ,re = 0;
    for(int i=0; i<n; i++){
        string s; cin >> s;
        if(s == "AC"){
            ac++;
        }else if(s == "WA"){
            wa++;
        }else if(s == "TLE"){
            tle++;
        }else{
            re++;
        }
    }

    cout << "AC x " << ac << endl;
    cout << "WA x " << wa << endl;
    cout << "TLE x " << tle << endl;
    cout << "RE x " << re << endl;
}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vs = vector<string>;
using msi = map<string, int>;
using mii = map<int, int>;
using psi = pair<string, int>;
using pii = pair<int, int>;
using vlai = valarray<int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define range(i,s,n) for(int i=s;i<n;i++)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define INF 1E9
#define EPS 1E-9
#define MOD (1E9+7)
#define PI 3.1415926535897932384

std::ostream &operator<<(std::ostream &out, const vector<int> &tgt)
{
	string s;
	for (int i = 0; i<tgt.size(); i++) {
		s += (to_string(tgt[i]) + ((i != tgt.size() - 1) ? " " : ""));
	}
	out << s;
	return out;
}

int main() {
	int n;
	cin >> n;
	vvi vv(n, vi('z' - 'a' + 1, 0));
	vi v('z' - 'a' + 1, 0);
	string s;
	rep(i, n) {
		cin >> s;
		rep(j, s.size()) {
			vv[i][s[j] - 'a']++;
		}
	}
	rep(i, 'z' - 'a' + 1) {
		int m = vv[0][i];
		range(j, 1, n) {
			m = min(m, vv[j][i]);
		}
		v[i] = m;
	}
	rep(i, v.size()) {
		rep(j, v[i]) {
			cout << (char)('a' + i);
		}
	}
	cout << endl;

}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#define INF 0x3f3f3f3f
using namespace std;
typedef long long LL;
const int maxn=1e5+6;
const int mod=1e9+7;
int n,m,sum;
int a[maxn];
int read(){        
    int s = 0, f = 1;        
    char ch = getchar();        
    while(!isdigit(ch)) {        
        if(ch == '-') f = -1;        
        ch = getchar();        
    }        
    while(isdigit(ch)) {        
        s = s * 10 + ch - '0';        
        ch = getchar();        
    }        
    return s * f;        
}   
bool cmp(int x,int y){
	return x>y;
}
bool check(){
	for(int i=1;i<=m;i++){
		if(a[i]*4*m<sum)
		  return false;
	}
	return true;
}     
int main(){
	cin>>n>>m;
	for(int i=1;i<=n;i++)
	    cin>>a[i],sum+=a[i];
	sort(a+1,a+1+n,cmp);
	if(check())  cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
 	return 0;
} 

Measured memory_bytes: 256
function Main(input) {
	input = input.trim().split("\n").map(function(x) { return x.split(" ")});
	var N = parseInt(input[0][0], 10);
	var arr_ab = [];
	var arr_cd = [];
	for (var i = 0; i < N; i++){
		arr_ab.push(input[i + 1].map(e => parseInt(e, 10)));
		arr_cd.push(input[i + N + 1].map(e => parseInt(e, 10)));
	}
	var arr_redConnection = Array.from({length: N}, ()=> []);
	var arr_blueConnection = Array.from({length: N}, ()=> []);
	var arr_redConnectionCount = Array.from({length: N}, ()=> 0);
	var arr_blueConnectionCount = Array.from({length: N}, ()=> 0);
	var remainedPaths = 0;
	for (var i = 0; i < N; i++){
		for (var j = 0; j < N; j++){
			if (arr_ab[i][0] < arr_cd[j][0] && arr_ab[i][1] < arr_cd[j][1]) {
			arr_redConnection[i].push(j);
			arr_redConnectionCount[i] ++;
			arr_blueConnection[j].push(i);
			arr_blueConnectionCount[j] ++;
			remainedPaths ++;
			}
		}
	}

	var tmp;
	var whichIsChosen = [-1, -1];
	var ans = 0; 
	var exclude = [Array.from({length: N}, ()=> 0), Array.from({length: N}, ()=> 0)];
	while (remainedPaths > 0){
		tmp = 2 * N;
		for (var i = 0; i < arr_redConnection.length ; i++){
			if (exclude[0][i] === 1) continue;
			for (var j of arr_redConnection[i]){
				if (exclude[1][j] === 1) continue;
				if ((arr_redConnectionCount[i] + arr_blueConnectionCount[j]) <= tmp){
					tmp = arr_redConnectionCount[i] + arr_blueConnectionCount[j];
					whichIsChosen[0] = i;
					whichIsChosen[1] = j;
				}
			}
		}
		remainedPaths -= (tmp - 1);
		ans ++;
		for (var i of arr_redConnection[whichIsChosen[0]]){
			arr_blueConnection[i] = arr_blueConnection[i].filter(n => n !== whichIsChosen[0]);
			arr_blueConnectionCount[i] --;
		}
		for (var i of arr_blueConnection[whichIsChosen[1]]){
			arr_redConnection[i] = arr_redConnection[i].filter(n => n !== whichIsChosen[1]);
			arr_redConnectionCount[i] --;
		}
		exclude[0][whichIsChosen[0]] = 1;
		exclude[1][whichIsChosen[1]] = 1;
		arr_redConnection[whichIsChosen[0]] = whichIsChosen[1];
		arr_redConnectionCount[whichIsChosen[0]] = 1;
		arr_blueConnection[whichIsChosen[1]] = whichIsChosen[0];
		arr_blueConnectionCount[whichIsChosen[1]] = 1;
	}
	console.log(ans);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8")); 

Measured memory_bytes: 35116
using System;

namespace atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int A = Int32.Parse(s[0]);
            int B = Int32.Parse(s[1]);
            int K = Int32.Parse(s[3]);

            int minus = K - (A + B) ;

            if (minus > 0)
            {

                Console.WriteLine(A - minus);
            }
            else if (K < A)
            {
                Console.WriteLine(K);
            }
            else
            {
                Console.WriteLine(A);
            }
        }
    }
}


Measured memory_bytes: 27548
x,y = gets.split(" ").map(&:to_i)

x_kame = (y / 2) - x
x_turu = x - x_kame

if x_kame >= 0 && x_turu >= 0 && x == x_kame + x_turu && y == x_kame*4 + x_turu*2
  puts "Yes"
else
  puts "No"
end

Measured memory_bytes: 14276
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <functional>
#include <numeric>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
#include <limits>
#include <iomanip>
#include <bitset>
#include <queue>

using namespace std;
typedef long long ll;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
#define rep(i, n) for(int i = 0;i < n;i++)
const long long INF = 1LL << 60;

int MOD = 1000000007;

int main(){
    std::ios_base::sync_with_stdio(false);
    // n, k
    int n,k; cin >> n >> k;
    std::vector<ll> a(n); rep(i,n) cin >> a[i];

    std::vector<ll> rskw(n); rskw[0]=a[0];
    for(int i=1; i<n; i++) rskw[i] = rskw[i-1]+a[i];

    std::vector<ll> best_rskw(n);

    if(a[0]<=0) best_rskw[0] = 0;
    else best_rskw[0] = a[0];

    for(int i=1; i<n; ++i){
      if(a[i] <= 0) best_rskw[i] = best_rskw[i-1];
      else best_rskw[i] = best_rskw[i-1]+a[i];
    }
    
    // rep(i,n) cout << rskw[i] << " ";
    // cout << '\n';
    // rep(i,n) cout << best_rskw[i] << " ";
    // cout << '\n';

    ll ans = 0LL;

    for(int i=0; i<n-k+1; i++){

      ll left = 0LL;
      ll right = 0LL;
      ll mid = rskw[i+k-1];

      if(i!=0) left = best_rskw[i-1];
      right = best_rskw[n-1]-best_rskw[i+k-1];

      if(i!=0) mid-=rskw[i-1];
      if(mid<0LL) mid=0LL;

      ans = max(ans, left+right+mid);
    }

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


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

#[fastout]
#[allow(non_snake_case)]
fn main() {
    input! {
        A: i128, B: Chars
    }
    let B = format!("{}{}{}", B[0], B[2], B[3]);
    let B: i128 = B.parse().unwrap();
    println!("{}", A * B / 100);
}


Measured memory_bytes: 2172
#include<bits/stdc++.h>
using namespace std;
const long long mod=1000000000+7;
const long long INF=-mod;

//マクロ
//型エイリアス
using ll = long long;
using P=pair<long long,long long>;
using vl=vector<long long>;
//ショートカット
#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,k,n) for(int i=k;i<n;i++) //半開区間
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(),v.rend()
#define pb push_back
//入力
#define vin(v,N) for(long long i=0;i<N;i++) cin>>v.at(i)
#define lin(n) long long n;cin>>n
#define vlin(v,N) vector<long long>v(N);for(long long i=0;i<N;i++)cin>>v.at(i)

//関数
//最大公約数
long long gcd(long long m,long long n){
  long long a=max(m,n);
  long long b=min(m,n);
  long long r=a%b;
  while(r!=0){
    a=b; b=r; r=a%b;
  }
  return b;
}
// 最小公倍数
long long lcd(long long m,long long n){
  return m*n/gcd(m,n);
}
//xのn乗
long long power(long long x,long long N){
  long long ret=1;
  for(long long i=0;i<N;i++)   
    ret*=x;
  return ret;
}
//nCr
long long C(long long n, long long r);
//nCr (mod)
long long modC(long long n, long long r) {
    vector<long long> f(n+1),inv(n+1),invf(n+1);
    f[0]=f[1]=1;
    invf[0]=invf[1]=1;
    inv[1]=1;
    for (long long i=2;i<n+1;i++) {
        f[i]=(i*f[i-1])%mod;
        inv[i]=mod-((mod/i)*inv[mod%i])%mod;
        invf[i]=(inv[i]*invf[i-1])%mod;
    }
    long long cmb=f[n]*(invf[r]*invf[n-r]%mod)%mod;
    if (n>=r) return cmb;
    else return 0;
}
//素因数分解(mapで返す)
map<long long,long long> factor(long long p){
  ll p1=p;
  map<long long,long long>ret;
  for(long long i=2;i*i<=p1;i++){
     while(p%i==0){
      ret[i]++;
      p/=i;
    }
  }
  if(p!=1)
  ret[p]++;
  return ret;
}
//素数判定
bool is_prime(long long N){
  for(long long i=2;i*i<=N;i++){
    if(N%i==0)
      return false;
  }
  return true;
}
//最大値更新
void chmax(long long &a,long long b){
  a=max(a,b);
}
//最小値更新
void chmin(long long &a,long long b){
  a=min(a,b);
}

//メイン関数
int main(){
  //doubleの桁数
  cout<<fixed<<setprecision(10);
  
  lin(N);vlin(a,N);
  
  ll res=0;
  
  rep(i,N){
    if(a[i]==i+1){
      res++;
      i++;
    }
  }
  
  cout<<res;
}

Measured memory_bytes: 1024
#include"bits/stdc++.h"
using namespace std;
using ll=long long;
using ull=unsigned long long;
constexpr auto inf=static_cast<ll>(1e18);
template<typename T=ll>inline T in(){T ret;cin>>ret;return ret;}
template<typename T=ll>inline auto vec2(size_t h,size_t w,T v=T()){return vector<vector<T>>(h,vector<T>(w,v));}
inline void setp(int n){cout<<fixed<<setprecision(n);}
inline void delnl(){cin.ignore(numeric_limits<streamsize>::max(),'\n');}

class union_find{
    private:
        vector<ll>par,sz,rank;
        ll cnt;
    public:
        union_find  (ll n):par(n),sz(n,1),rank(n,0),cnt(n){iota(par.begin(),par.end(),0);}
        ll   count  ()          {return cnt;}
        ll   find   (ll n)      {return par[n]==n?n:par[n]=find(par[n]);}
        ll   size   (ll n)      {return sz[find(n)];}
        bool is_same(ll x, ll y){return find(x)==find(y);}
        void unite  (ll x, ll y)
        {
            x=find(x);y=find(y);
            if(x!=y){
                if(rank[x]<rank[y]){
                    par[x]=y;
                    sz[y]+=sz[x];
                }else{
                    par[y]=x;
                    sz[x]+=sz[y];
                    if(rank[x]==rank[y])++rank[x];
                }
                --cnt;
            }
        }
};
pair<ll,ll>get_unique_dist_vec(const pair<ll,ll>&p1,const pair<ll,ll>&p2)
{
    ll dx=p2.first-p1.first;
    ll dy=p2.second-p1.second;
    if(dx<0){dx*=-1;dy*=-1;}
    else if(dx==0)dy=abs(dy);
    return {dx,dy};
}
int main()
{
    ll n=in();
    vector<pair<ll,ll>>cood(n);
    for(ll i=0;i<n;++i){
        cood[i].first=in();
        cood[i].second=in();
    }

    set<pair<ll,ll>>tang;
    for(ll i=0;i<n;++i){
        for(ll j=i+1;j<n;++j){
            tang.emplace(get_unique_dist_vec(cood[i],cood[j]));
        }
    }

    ll ans=n;
    for(const auto&t:tang){
        union_find uf(n);
        for(ll i=0;i<n;++i){
            for(ll j=i+1;j<n;++j){
                if(t==get_unique_dist_vec(cood[i],cood[j])){
                    uf.unite(i,j);
                }
            }
        }
        ans=min(ans,uf.count());
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 384
N, M = map(int, input().split())
K = [[] for _ in range(M)]
S = [[] for _ in range(M)]

for i in range(M):
    ks = list(map(int, input().split()))
    K[i] = ks[0]
    S[i] = ks[1:]
P = list(map(int, input().split()))


n = N
Switch = [[] for _ in range(n+1)]
ans = 0
for bit in range(2**n):
    cost = 0
    for i in range(n):
        mask = 1 << i
        if bit & mask:
            Switch[i+1] = 1
        else:
            Switch[i+1] = 0
#    print()
#    print(Switch)
    
    Light = [0 for _ in range(M)]
    for i in range(M):
        count = 0
        for s in S[i]:
            count += Switch[s]
#        print(count)
        if count%2 == P[i]:
            Light[i] = 1
#    print(Light)
    if all(Light):
        ans += 1
print(ans) 

Measured memory_bytes: 9124
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <iomanip>
#include <cmath>
#include <map>
#include <ctype.h>
using namespace std;

typedef long long ll;

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

int digitSum(int n) {
  int sum = 0;
  while (n > 0) {
    sum += n % 10;
    n /= 10;
  }
  return sum;
}

int main() {
  int n;
  cin >> n;
  int sn;
  sn = digitSum(n);
  if (n % sn == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//nもrも10^5くらいのときにはこれ使うと良き
//二項係数の計算
const int MAX = 510000;
ll fac[MAX],finv[MAX],inv[MAX];

//テーブルの初期化
void COMinit(){
	fac[0] = fac[1] = 1;//階乗
	finv[0] = finv[1] = 1;//階乗の逆元
	inv[1] = 1;//逆元(1の逆元は1)
	for(int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % mod;//累積積的な感じ
		inv[i] = mod - inv[mod % i] * (mod / i) % mod;//inv[i] = iの逆元(mod mod)
		finv[i] = finv[i - 1] * inv[i] % mod;//階乗の逆元の計算
	}
}



ll COM(int n,int k){//二項係数の計算
	if(n < k){
		return 0;
	}
	if (n < 0 || k < 0){
		return 0;
	} 
	return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
}

//繰り返し二乗法
ll mod_pow(ll x,ll n){
	ll res = 1;
	while(n > 0){
		if(n & 1){
			res = res * x % mod;
		}
		x = x * x % mod;
		n >>= 1;
	}
	return res;
}
//階乗の計算
ll mod_fact(ll n){
	if (n != 1LL){
		return (mod_fact(n - 1LL) * n) % mod;
	}
	else{
		return 1LL;
	}
}

ll mod_comb(ll n,ll r){//nが大きくて(10^9)でrが小さい時(10^5)にO(r)で計算できるやつ
	ll a = 1LL;
	for(ll i = 1LL; i <= r; i++) {
		a *= (n - i + 1LL);
		a %= mod;
	}
	ll b = mod_pow(mod_fact(r),mod - 2);//r!の逆元（フェルマーの小定理）
	return (a * b) % mod;
}

int main(){
	int s;cin>>s;
	if(s < 3){
		cout << 0 << endl;
	}
	else{
		ll i = 2;
		ll length = s / 3;
		ll ans = 1;
		COMinit();
		while(i <= length){
			ll tmp = s - i * 3;
			ans += COM(tmp + i - 1,tmp);
			ans %= mod;
			i++;
		}
		cout << ans << endl;
	}
	return 0;
}

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

inline int read_int(void)
{
	int i;
	int c;
	i = 0;

	while(1) {
		c = getc(stdin);
		if (c >= '0' && c <= '9') {
			i = c - '0';
			break;
		}
	}
	while(1) {
		c = getc(stdin);
		if (c >= '0' && c <= '9') {
			i = i * 10 + (c - '0');
		} else {
			break;
		}
	}
	return i;
}

int compare_int(const void *a, const void *b)
{
	// 降順 
	return *(int *) b - *(int *) a;
}

typedef int value_type; /* ソートするキーの型 */

/* x, y, z の中間値を返す */
value_type med3(value_type x, value_type y, value_type z) {
    if (x < y) {
        if (y < z) return y; else if (z < x) return x; else return z;
    } else {
        if (z < y) return y; else if (x < z) return x; else return z;
    }
}

/* クイックソート
 * a     : ソートする配列
 * left  : ソートするデータの開始位置
 * right : ソートするデータの終了位置
 */
void quicksort(value_type a[], int left, int right) {
    if (left < right) {
        int i = left, j = right;
        value_type tmp, pivot = med3(a[i], a[i + (j - i) / 2], a[j]); /* (i+j)/2 ではオーバーフローしてしまう */
        while (1) { /* a[] を pivot 以上と以下の集まりに分割する */
            while (a[i] > pivot) i++; /* a[i] >= pivot となる位置を検索 */
            while (pivot > a[j]) j--; /* a[j] <= pivot となる位置を検索 */
            if (i >= j) break;
            tmp = a[i]; a[i] = a[j]; a[j] = tmp; /* a[i], a[j] を交換 */
            i++; j--;
        }
        quicksort(a, left, i - 1);  /* 分割した左を再帰的にソート */
        quicksort(a, j + 1, right); /* 分割した右を再帰的にソート */
    }
}

int main(int argc, char *argv[])
{
	int n, i, c;
	int j;
	int a[200000];
	
	int x, y;
	int min_sq, l_min_sq;
	
	scanf("%d", &n);

	for (i = 0; i < n; i++) {
	//	scanf("%d", &a[i]);
		a[i] = read_int();
	}
	
	//qsort(a, n, sizeof(int), compare_int);
	quicksort(a, 0, n - 1);

	c = 0;

	l_min_sq = -1;
	for (i = 0; i < n; i++) {
		x = a[i];
		if (x == 0) {continue;}
		min_sq = pow(2, (int) log2(x) + 1);

		if (l_min_sq != min_sq) {
			j = n - 1;
		}
		for (;j > i; j--) {
			y = a[j];
			if (y == 0) {continue;}
			if (y == min_sq - x) {
				a[j] = 0;
				c++;
				break;
			}
			if (y > min_sq - x) {
				break;
			}
		}
		l_min_sq = min_sq;
	}

	printf("%d\n", c);
	
	return 0;
}

Measured memory_bytes: 896
#include<iostream>
#include<vector>
#define int long long
const int N=1e5+2;
using namespace std;
vector<int> adj[N];
int tich[N],tich1[N],cac[N],f[N],mod,hix[N];
void dfs1(int x,int p){
	f[x]=1;
	int i;
	for(i=0;i<adj[x].size();i++){
		if(adj[x][i]!=p){
			dfs1(adj[x][i],x);
			f[x]*=(f[adj[x][i]]+1);
			f[x]%=mod;
		}
	}
}
void dfs(int x,int p){
	cac[x]=cac[p]*hix[x]+1;
	cac[x]%=mod;
	//ans+=cac[x]*f[x];
	//ans%=mod;
	int i;
	tich[0]=1;
	tich1[adj[x].size()+1]=1;
	for(i=0;i<adj[x].size();i++){
		if(adj[x][i]!=p){
			tich[i+1]=(tich[i]*(f[adj[x][i]]+1))%mod;
		}
		else{
			tich[i+1]=tich[i];
		}
	}
	for(i=adj[x].size();i>0;i--){
		if(adj[x][i-1]!=p){
			tich1[i]=(tich1[i+1]*(f[adj[x][i-1]]+1))%mod;
		}
		else{
			tich1[i]=tich1[i+1];
		}
	}
	for(i=0;i<adj[x].size();i++){
		if(adj[x][i]!=p){
			hix[adj[x][i]]=(tich[i]*tich1[i+2])%mod;
		}
	}
	for(i=0;i<adj[x].size();i++){
		if(adj[x][i]!=p){
			dfs(adj[x][i],x);
		}
	}
}
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n,m,i,j,k,l;
	cin>>n>>mod;
	for(i=1;i<n;i++){
		cin>>j>>k;
		adj[j].push_back(k);
		adj[k].push_back(j);
	}
	dfs1(1,1);
	dfs(1,1);
	for(i=1;i<=n;i++){
		//cout<<f[i]<<" cac"<<endl;
		cout<<(f[i]*cac[i])%mod<<'\n';
	}
}

Measured memory_bytes: 14080
#include <stdio.h>

int main()
{   int n;
    scanf("%d",&n);
    int b[n];
    for(int i=0;i<n;i++){
        scanf("%d",&b[i]);
    }
    int a[n],t=0,flag=0;
    while(t<n){
        flag=0;
        for(int i=n-t-1;i>=0;i--){
            if(i+1==b[i]){
                a[t]=b[i];
                t++;
                flag=1;
                for(int j=i;j<n-t;j++){
                    b[j]=b[j+1];
                }
                break;
            }
        }
        if(flag==0){
            printf("-1");
            return 0;
        }
    }
    for(int i=n-1;i>=0;i--){
        printf("%d\n",a[i]);
    }
    return 0;
}


Measured memory_bytes: 128
#include <stdio.h>

int main() {
	int H, W;
	while (1) {
		scanf("%d %d", &H, &W);
		if (H == 0 && W == 0) {
			break;
		}
		for (int i = 0; i < H; i++) {
			for (int k = 0; k < W; k++) {
				printf("#");
			}
			printf("\n");
		}
		printf("\n");
	}
}


Measured memory_bytes: 2124
using System;
class Program
 {
   	static void Main(string[] args)
        {
    　　	string a = Console.ReadLine(); //標準入力
		string[] aa = a.Split(' ');
		

	       	int D = int.Parse(aa[0]);
	       	int T = int.Parse(aa[1]);
       		int S = int.Parse(aa[2]);

		
		bool test = false;

      double time = (double)D/(double)S;
      test = (double)T >=time;
		if(test){
			Console.WriteLine("{0}", "Yes");
		}else{
			Console.WriteLine("{0}", "No");
		}
		
    }
 
 }

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


int main()
{
	int n;
	int card[4][14] = { {0} };
	cin >> n;
	for (int i = 0; i < n; i++){
		char c;
		int num, mark;
		cin >> c >> num;
		if (c == 'S'){
			mark = 0;
		}
		else if (c == 'H'){
			mark = 1;
		}
		else if (c == 'C'){
			mark = 2;
		}
		else{
			mark = 3;
		}
		card[mark][num] = 1;
	}
	for (int i = 0; i < 4; i++){
		for (int j = 1; j < 14; j++){
			char c;
			if (card[i][j] == 0){
				if (i == 0){
					c = 'S';
				}
				else if (i == 1){
					c = 'H';
				}
				else if (i == 2){
					c = 'C';
				}
				else{
					c = 'D';
				}
				cout << c << " " << j << endl;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <sstream>
#include <stack>
#include <iomanip>
#include <string>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <map>
#include <set>
#include <vector>
#include <utility>
#include <queue>
#include <cmath>

#define BEGIN(x) x.begin()
#define END(x) x.end()
#define ALL(x) BEGIN(x), END(x)
#define PAIR make_pair
#define VEC(type) vector<type >

#define FOR(i, A, B) for(auto i = (A);i != (B); i++)
#define FORD(i, A, B) for(auto i = (A);i != (B); i--)

#define READRANGE(begin, end) FOR(it, begin, end) cin >> *it
#define READVEC(V) READRANGE(BEGIN(V), END(V))

using namespace std;

typedef long long lint;
typedef pair<int, int> Pii;
typedef pair<int, lint> Pil;
typedef pair<lint, lint> Pll;
typedef pair<lint, int> Pli;

// ---- BEGIN LIBRARY CODE ----
// ---- END LIBRARY CODE ----
void io_init()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
};

int main(int argc, char **argv)
{
    io_init();

    // Actual program code starts here.
    int n, K;
    cin >> n >> K;
    string S;
    cin >> S;

    int ret = 0, kSpan = 0;
    VEC(int) zeros;
    FOR(i, 0, n) {
        if (S[i] == '1') {
            kSpan++;
        } else {
            if (i == 0 || S[i - 1] == '1')
                zeros.push_back(i);
            else
                zeros.back() = i;

            if (zeros.size() <= K)
                kSpan = i + 1;
            else {
                kSpan = i - zeros[zeros.size() - 1 - K];
            }
        }

        ret = max(ret, kSpan);
    }

    cout << ret << endl;
    return 0;
};


Measured memory_bytes: 768
import static java.lang.Integer.parseInt;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

/**
 * Misterious Gems
 */
public class Main {

	static Main main = new Main();

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

		while (!(line = br.readLine()).equals("0")) {

			int n = parseInt(line);
			Map map = main.new Map(n);

			for (int i = 0; i < n; ++i) {
				map.setGem(br.readLine());
			}

			int m = parseInt(br.readLine());
			for (int i = 0; i < m; ++i) {
				map.command(br.readLine());
			}

			if (map.isComplete()) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
		}
	}

	class Map {

		final int SIZE = 21;
		final int START = 10;
		final int[] H = { 1, -1, 0, 0 };
		final int[] V = { 0, 0, 1, -1 };
		final int EAST = 0;
		final int WEST = 1;
		final int NORTH = 2;
		final int SOUTH = 3;

		int total, gets = 0;
		boolean[][] map;
		int[] current;

		Map(int n) {
			total = n;
			map = new boolean[SIZE][SIZE];
			current = new int[] { START, START };
		}

		void setGem(String info) {
			StringTokenizer st = new StringTokenizer(info);
			int x, y;
			x = parseInt(st.nextToken());
			y = parseInt(st.nextToken());
			map[x][y] = true;
		}

		void command(String command) {
			int dir, distance;

			switch (command.charAt(0)) {
			case 'N':
				dir = NORTH;
				break;
			case 'E':
				dir = EAST;
				break;
			case 'S':
				dir = SOUTH;
				break;
			case 'W':
				dir = WEST;
				break;
			default:
				dir = 0;
			}

			distance = parseInt(command.substring(2));

			for (int i = 0; i < distance; ++i) {
				current[0] += H[dir];
				current[1] += V[dir];
				if (map[current[0]][current[1]]) {
					++gets;
					map[current[0]][current[1]] = false;
				}
			}
		}

		boolean isComplete() {
			if (total == gets) {
				return true;
			} else {
				return false;
			}
		}

	}

}

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

#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()

typedef long long ll;
typedef array<int, 3> tri;
typedef long double ld;

template <class T> istream& operator>>(istream& I, vector<T>& v) {for (T &e: v) I >> e; return I;}
template <class T> ostream& operator<<(ostream &O, const vector<T>& v) {for (const T &e: v) O << e << ' '; return O;}



void _main() {
        int n; cin >> n;
        vector<int> a(n); cin >> a;
        map<int, int> freq;
        for (int i = 0; i < n; i++) {
                freq[a[i]]++;
                freq[a[i] - 1]++;
                freq[a[i] + 1]++;
        }

        int ans = 0;
        for (auto it: freq) ans = max(ans, it.second);
        cout << ans;
}



signed main() {
        ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//        freopen("input.txt", "r", stdin);
        int _t = 1;
//        cin >> _t;
        while (_t--) _main();
        return 0;
}


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

#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)

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

int main() {
  std::cout << std::fixed << std::setprecision(20);

  int64_t N, K, Q;
  cin >> N >> K >> Q;

  vector<int64_t> A(Q);
  REP(i,Q) cin >> A[i];


  vector<int64_t> score(N,0);

  REP(i,Q){
    score[A[i] - 1]++;
  }
  REP(i,N){
    if(K > ( Q - score[i]) ) cout << "Yes" << endl;
    else cout << "No" << endl;
  }


}

Measured memory_bytes: 2176
#include <iostream> 
#include <cstdio> 
#include <cstdlib> 
#include <cstring> 
#include <cmath> 
#include <algorithm>
#include <vector>
#include <queue> 
using namespace std; 
inline int gi() { 
    int data = 0, w = 1; 
    char ch = 0; 
    while (!isdigit(ch) && ch != '-') ch = getchar(); 
    if (ch == '-') w = -1, ch = getchar(); 
    while (isdigit(ch)) data = 10 * data + ch - '0', ch = getchar();
    return w * data; 
} 
long long X; 
int main () { 
	cin >> X; 
	for (long long a = -500; a <= 500; a++)
		for (long long b = -500; b <= 500; b++) { 
			long long t1 = a * a * a * a * a, t2 = b * b * b * b * b; 
			if (t1 - t2 == X) return printf("%lld %lld\n", a, b) & 0; 
		} 
    return 0; 
} 

Measured memory_bytes: 3256
import java.io.*;
import java.util.*;

public class Main {

	final static long MOD = 1000000007L;
	public static String[] Ws = null;
	public static int wsIndx = 0;
	public static BufferedReader in = null;
	public static ArrayList<int[]> list = new ArrayList<>();
	public static void main(String[] args) throws Exception {

		int N =nextInt();
		int M =nextInt();

		long ans =((M*19)+(N-M))*(long)Math.pow(2, M);



		System.out.println(ans+"00");
	}


	public static String[] toStringArray(String s) {
		String[] tmp = new String[s.length()];
		char[] c = s.toCharArray();
		for (int i = 0; i < tmp.length; i++) {
			tmp[i] = String.valueOf(c[i]);
		}
		return tmp;
	}

	public static String concatStringArray(String[] s){
		StringBuffer sb = new StringBuffer();
		for(String x:s){
			sb.append(x);
		}
		return sb.toString();
	}

	public static void check() throws Exception{
		if(in == null){
			in = new BufferedReader(new InputStreamReader(System.in));
		}
		if(Ws==null || Ws.length<=wsIndx){
			Ws = in.readLine().split(" ");
			wsIndx=0;
		}
	}
	public static int nextInt()throws Exception{
		check();
		return Integer.parseInt(Ws[wsIndx++]);
	}

	public static long nextLong()throws Exception{
		check();
		return Long.parseLong(Ws[wsIndx++]);
	}

	public static String nextString()throws Exception{
		check();
		return Ws[wsIndx++];
	}

	public static int[] nextInts()throws Exception{
		check();
		int[] tmp = new int[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Integer.parseInt(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static long[] nextLongs()throws Exception{
		check();
		long[] tmp = new long[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Long.parseLong(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static String[] nextStrings()throws Exception{
		check();
		wsIndx=Ws.length;
		return Ws;
	}


}


Measured memory_bytes: 21332
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
int main() {
    int n = 0, k=0;
    cin>>n>>k;
    int h[n];
    for (int i =0; i<n; i++)
    {
        cin>>h[i];
    }
    long long int dp[n];
    dp[0] = 0;
    dp[1] = abs(h[1]-h[0]);
    for (int i=2; i<n; i++)
    {
        dp[i] = 2e18;
        for (int j=1; j<=k;j++)
        {
            if ((i-j) < 0)
            {
                break;
            }
            dp[i]=min(dp[i], dp[i-j]+abs(h[i]-h[i-j]));
        }
    }
    cout<<dp[n-1]<<endl;
    return 0;
}

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

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

    const int MOD = 1000000007;
    vector<long long> ex(N+1, 0); // exp[p] := p の指数
    for (long long n = 2; n <= N; ++n) {
        // n を素因数分解
        long long n2 = n;
        for (long long a = 2; a <= n2; ++a) {
            while (n2 % a == 0) {
                ex[a]++;
                n2 /= a;
            }
        }
    }
    long long res = 1;
    for (int p = 2; p <= N; ++p) {
        res *= ex[p] + 1; // 約数の個数は (exp + 1) の積
        res %= MOD;
    }
    cout << res << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int MOD=1e9+7;
//const int MOD=998244353;
const int INF=1e9;
const long long LINF=1e18;
#define int long long
//template
template <typename T>
void fin(T a){
  cout<<a<<endl;
  exit(0);
}
//main
signed main(){
  int N;cin>>N;
  if(N&1){
    double a=N;
    a=(N/2+1)/a;
    fin(a);
  }
  fin("0.5");
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int N = Integer.parseInt(sc.next());
    	int bit = 0;
    	for (int i=0; i<N; i++){
    		bit |=Integer.parseInt(sc.next());
    	}
    		System.out.println(Integer.numberOfTrailingZeros(bit));
    }
}

Measured memory_bytes: 22996
from collections import deque
from collections import Counter, defaultdict
from itertools import product, permutations,combinations
from operator import itemgetter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right, bisect
#pypyではscipy, numpyは使えない
#from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson, minimum_spanning_tree
#from scipy.sparse import csr_matrix, coo_matrix, lil_matrix
import numpy as np
from fractions import gcd
from math import ceil,floor, sqrt, cos, sin, pi, factorial
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7

def main():
  n, m = map(int, readline().split())
  py = [[int(x) for x in readline().split()] for _ in range(m)]
  p_to_y = defaultdict(set)
  for p, y in py:
    p_to_y[p].add(y)
  
  def set_to_rank_dict(se):
    return {x:i for i, x in enumerate(sorted(se), 1)}
  
  p_to_y = {p:set_to_rank_dict(se) for p, se in p_to_y.items()}
  for p, y in py:
    print('{:06g}{:06}'.format(p,p_to_y[p][y]))
  
  
  
  
if __name__ == '__main__':
  main()

Measured memory_bytes: 95316
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const int mod=1000000007;
const double PI = 3.14159265359;
#define pb  push_back
#define FOR(i,n) for(int i=0;i<(n);i++)
#define FORA(i,a,b) for(int i=(a);i<=(b);i++)
#define FORD(i,a,b) for(int i=(a);i>=(b);i--)
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);
#define count_1(n)  __builtin_popcountll(n)
#define parity(n)   __builtin_parityll(n)   //Even parity 0 as output
void show    (int a[], int arraysize) { for (int i = 0; i < arraysize; ++i)  {cout << a[i] << " ";}	cout<<endl;}
int gcd(int a, int b) { if (b == 0) return a; return gcd(b, a % b);}
void sieve(int n)
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));

    for (int p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (int i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for (int p=2; p<=n; p++)
       if (prime[p])
          cout << p << " ";
}
int main()
{FAST
int s,w;
cin>>s>>w;
if(w>=s)
{
	cout<<"unsafe\n";
}
else
{
	cout<<"safe\n";
}

return  0;
}




Measured memory_bytes: 3616
use std::vec::Vec;

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>().split_whitespace().map(|e| e.parse().ok().unwrap()).collect()
}

fn main() {
    let mut input: Vec<usize> = read_vec();
    let k: usize = read();

    let mut tmp = 1;
    for i in 0..k {
        tmp *= 2;
    }

    input.sort();
    let ans = input[0] + input[1] + input[2]*tmp;

    println!("{}", ans);




}


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

int main()
{
    int b[10][10];
    memset(b, 0, sizeof(b));
    int n,m;
    cin>>n>>m;
    for(int i=0; i<m; i++)
    {
        int k;
        cin>>k;
        for(int j=0; j<k; j++)
        {
            int l;
            cin>>l;
            l--;
            b[i][l]=1;
        }
    }
    int p[10];
    for(int i=0; i<m; i++)
        cin>>p[i];
    int count=0;
    for(int i=0; i<(1<<n); i++)
    {
        bool flag=true;
        for(int j=0; j<m; j++)
        {
            int cc=0;
            int temp=i;

            for(int k=0; k<n; k++)
            {

                cc+=((temp)%2)*b[j][k];
                temp/=2;


            }
            if(cc%2!=p[j])
                    flag=false;
        }
        if(flag)
            count++;

    }
    cout<<count;
}


Measured memory_bytes: 256
#include <iostream>
#include <set>
#include <map>
#include <sstream>
#include <string>
#include <vector>
#include <iomanip>
#include <algorithm>

#define ll long long

using namespace std;

/*   Every goose should go to prison!!!!!
     ██▀▀▄  ██     ██
▄███▀██░░░▌ ██     ██
█████████████████████████████
    ▐██░░░▐ ██     ██
    ▌██░░░░▐██     ██
█████████████████████████████
   ▐░██░▐▒▒▒██▒▒▒▀▀██
   ▐░██░▐▄▒▒██▒▒▒▒▒██▄
█████████████████████████████
     ██▄▄▄▄▄██▄▄▄▄▄██▄▄▄▀▄
     ██    ▌██▌▌   ██
█████████████████████████████
     ██  ▄▄▌██▌▌   ██ */


vector<ll> a;
vector<ll> b;
vector<ll> dpv;

ll dp(ll ch) {
    if(ch <= 0) {
        return 0;
    }
    if(dpv[ch] != -1) {
        return dpv[ch];
    }
    ll mi = 1e12;
    for(ll i = 0; i < a.size(); ++i) {
        mi = min(mi, dp(ch - a[i]) + b[i]);
    }
    return dpv[ch] = mi;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    ll h, n;
    cin >> h >> n;
    a.resize(n);
    b.resize(n);
    for(ll i = 0; i < n; ++i) {
        cin >> a[i] >> b[i];
    }
    dpv = vector<ll>(h + 1, -1);
    cout << dp(h);
    return 0;
}


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

#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;

typedef long long ll;

const int INF = 1 << 30;
const ll LLINF = 1LL << 62;

int mod = 1000000007;

struct SegmentTree{
private:
    int n;
    vector<bitset<26>> node;

public:
    SegmentTree(){}
    SegmentTree(string S){
        int sz = S.length();
        int height = ceil(log2(sz));

        n = pow(2, height);
        node.resize(2*n-1, 0);
        for(int i = 0; i < sz; i++){
            node[i + (n-1)].set(S[i]-'a');
        }
        for(int i = n-2; i >= 0; i--){
            node[i] = node[(i << 1) + 1] | node[(i << 1) + 2];
        }
    }

    //区間和の取得
    bitset<26> getval(int a, int b, int k=0, int l=0, int r=-1){
        if(r < 0) r = n;

        //[l, r)は[a, b)と全く重ならない -> 0(単位元)を返す
        if(r <= a || b <= l) return 0;

        //[l, r)は[a, b)を完全に含む -> その区間の総和を返す
        if(a <= l && r <= b) return node[k];

        //[l, r)は[a, b)を一部含む -> 子を探索して左右の子の和を返す
        bitset<26> vl = getval(a, b, (k << 1) + 1, l, (l+r)/2);
        bitset<26> vr = getval(a, b, (k << 1) + 2, (l+r)/2, r);
        return vl | vr;
    }

    //1点の値を更新
    void update(int idx, char c){
        idx = idx + (n-1);
        node[idx].reset();
        node[idx].set(c-'a');
        while(idx > 0){
            idx = (idx % 2 == 0)? idx/2 - 1 : idx/2;
            node[idx] = node[(idx << 1) + 1] | node[(idx << 1) + 2];
        }
    }

    void show(){
        for(int i = 0; i < n; i++){
            cout << node[i + (n-1)] << " ";
        }
        cout << endl;
    }
};

int main(void){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int N; cin >> N;
    string S; cin >> S;
    int Q; cin >> Q;
    SegmentTree st(S);
    rep(i, Q){
        int cmd; cin >> cmd;
        if(cmd == 1){
            int idx; char c;
            cin >> idx >> c;
            st.update(idx-1, c);
        }
        else{
            int l, r; cin >> l >> r;
            cout << st.getval(l-1, r).count() << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 9500
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef long double ld;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

const long long mod = 1000000007;
const long long inf = 1e18;

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    int x,a,b;
    cin>>x>>a>>b;
    if(abs(a-x)<abs(b-x))
        cout<<'A'<<endl;
    else
        cout<<'B'<<endl;
    return 0;
}


Measured memory_bytes: 256