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

typedef long long LL;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned long long ULL;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

#define __m int mid=(l+r)>>1
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1

template<class T>
inline bool rd(T &num) {
    char in;bool IsN = false;
    while(in = getchar(), in != '-' && (in < '0' || in > '9'))if(in == EOF)return false;
    in == '-' ? (IsN = true, num = 0) : num = in - '0';
    while(in = getchar(), in >= '0' && in <= '9')num = num * 10 + in - '0';
    return IsN ? num = -num : num, true;
}
template<class T, class S>
inline bool rd(T &num1, S &num2){return rd(num1)&&rd(num2);}
template<class T, class S, class Z>
inline bool rd(T &num1, S &num2, Z &num3){return rd(num1)&&rd(num2)&&rd(num3);}
template<class T>
inline void _wr(T num){if(num>9)_wr(num/10);putchar('0'+num%10);}
template<class T>
inline void wr(T num){if(num < 0)putchar('-'),num=-num;_wr(num);}

void debug_out(){cerr<<endl;}
string to_string(string s){return '\"'+s+'\"';}
string to_string(char* s){return to_string((string)s);}
string to_string(bool s){return s?"true":"false";}
template<class T>
string to_string(T array);
template<class T,class S>
string to_string(pair<T,S>s){return '('+to_string(s.first)+','+to_string(s.second)+')';}
template<class T>
string to_string(T array){
    bool first=true;string res="[";
    for(const auto&e : array){
        if(!first)res+=",";first=false;res+=to_string(e);
    }
    return res+=']';
}
template<class Head, class... Tail>
void debug_out(Head H, Tail... T) {cerr << " " << to_string(H);debug_out(T...);}

string nico = "NicoNicoNi";
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#define infile(x) freopen(x,"r",stdin)
#define outfile(x) freopen(x,"w",stdout)
#define io ios::sync_with_stdio(0)
#else
#define debug(...)
#define infile(x)
#define outfile(x)
#define io ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#endif

#define rep(a,b,c) for(register int (a)=(b);(a)<(c);++(a))
#define per(a,b,c) for(register int (a)=(b);(a)>=(c);--(a))
#define none(a) memset(a,-1,sizeof(a))
#define clr(a) memset(a,0,sizeof(a))
#define inf(a) memset(a,0x3f,sizeof(a))
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define space putchar(' ')
#define enter puts("")
#define endl '\n'
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define lowbit(x) (x&-x)

const int maxn = 2e5+7;
const int inf  = 0x3f3f3f3f;
const ll  linf  = (1ll*inf)<<32|inf;
const int mod  = 1e9 + 7;
const int none = -1;
const double eps = 1e-7;

vector<int> num;
int main(){
    io;
    rep(i,0,5){
        int k;
        cin>>k;
        num.pb(k);
    }
    sort(num.begin(), num.end());
    int k;
    cin>>k;
    if(num[4]-num[0]>k)
        cout<<":("<<endl;
    else 
        cout<<"Yay!"<<endl;

    return 0;
}


Measured memory_bytes: 256
#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 ll          long long
#define fio         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb          push_back
#define vi          vector<ll>
#define pp          push_pop
#define pll         pair<ll,ll>
#define in          insert
#define ini(a,n)    memset(a,n,sizeof(a))
#define ff          first
#define ss          second
#define inf         10000000000000000
#define all(p)      p.begin(), p.end()
#define que_max     priority_queue <int>
#define que_min     priority_queue <int, vi, greater<int>>
#define print(a)    for(auto i:a){cout<<i<<" ";}
#define print1(a)   for(auto i:a){cout<<i.ff<<" "<<i.ss<<endl;}

typedef tree<pll, null_type, less<pll>, rb_tree_tag, tree_order_statistics_node_update> Set;
unordered_map<ll,vi> g;
unordered_map<ll,ll> vis;

const ll mod = 1e9+7;

ll power(ll x,ll y,ll p){ll r=1;x=x%p;while(y>0){if(y&1)r=(r*x)%p;y=y>>1;x=(x*x)%p;}return r;}
const ll N = 2e5+10;
ll dx[4]={-1, +1, 0, 0};
ll dy[4]={0, 0, +1, -1};
bool imp = false;
bool isPowerOfTwo (ll x)
{
    return x && (!(x&(x-1)));
}

void solve() {

    ll n,k;cin>>n>>k;
    ll a[n+10];
    for(ll i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    ll ans = 0;
    for(ll i=0;i<k;i++)
        ans += a[i];
    cout<<ans<<endl;

}

int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#endif

    fio
    int t=1;
    if(imp) cin>>t;

    while(t--)
    {
        // cout<<"Case #"<<tc<<": ";
        g.clear();
        vis.clear();
        solve();
        // tc++;
    }

}


Measured memory_bytes: 3652
# include "cstdio"

using namespace std;

const int maxm=200000+10; 

int 
	a[maxm], 
	b[maxm], 
	n;
long long 
	ans;

inline int read(){
	int s=0,w=1;
	char ch=getchar();
	while(ch<'0' || ch>'9'){
		if(ch=='-') w=-w;
		ch=getchar();
	}
	while(ch>='0' && ch<='9'){
		s=s*10+ch-'0';
		ch=getchar();
	}
	return s*w;
}

int main(){
	n=read(); 
	register int i,j;
	for(i=1;i<=n;i++){
		j=read();
		a[i]=j+a[i-1];
		b[i]=j^b[i-1];  
	}
	for (i=j=1;i<=n;i++){
         for(;a[i]-a[j-1]!=(b[i]^b[j-1]);j++);
        ans+=i-j+1;
    }
	printf("%lld",ans);
	return 0; 
} 

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

const int MAXN = 550;
struct node
{
    int c,s,f;
}ns[MAXN];
int N;
int res[MAXN];

int main()
{
    memset(res,0,sizeof(res));
    scanf("%d",&N);
    for(int i = 1; i < N; ++i)
        scanf("%d %d %d",&ns[i].c,&ns[i].s,&ns[i].f);

    for(int i = 1; i < N; ++i)
    {
        int& ans = res[i];
        ans += ns[i].s+ns[i].c;//从站台i到达了i+1
        for(int j = i+1; j < N; ++j)
        {
            if(ans < ns[j].s)
                ans = ns[j].s+ns[j].c;
            else if(ans%ns[j].f == 0)
                ans += ns[j].c;
            else
                ans = (ans/ns[j].f+1)*ns[j].f+ns[j].c;
        }
    }
    for(int i = 1; i <= N; ++i)
        printf("%d\n",res[i]);
    return 0;
}


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

int main(){
  string s;
  int k;
  cin >> k >> s;
  if(k >= s.size()){
    cout << s << endl;
  }
  else{
    for(int i = 0; i < k; i++) cout << s[i];
    cout << "..." << endl;
  }
}

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


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

    long long prs[n+1]={0};
    long long mns[n+1]={0};
    for( int i = 1; i<=n; i++){
        if(i - a[i] >=0 ){
            mns[i - a[i]] ++ ;
        }
        if(i + a[i] < n+1 ){
            prs[i + a[i]] ++ ;
        }
    }

    long long ans = 0;
    for( int i = 0; i<=n; i++){
        ans += prs[i]*mns[i];
    }
    cout << ans << endl;

    /*
    int hssize = n+1;
    int *hstbm;
    int *hstbp;
    hstbm = new int[hssize];
    hstbp = new int[hssize];
    */
        
    return 0;
}


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

int main(){
  
  int A,B,C,D;
  int ans;

  cin >> A >> B >> C >> D;

  if(B <= C || D <= A){
    ans=0;
  }else if(A < C && B < D){
    ans=B-C;
  }else if(C < A && D < B){
    ans=D-A;
  }else if(C<=A && B<=D){
    ans=B-A;
  }else if(A<=C && D <= B){
    ans=D-C;
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
def main():
    num = [int(i) for i in input().split()]
    iter_num = 0

    while True:
        if (num[0] == num[1]) and (num[1] == num[2]) and (num[2] == num[0]):
            break
        num = sorted(num)
        if num.count(num[2]) == 1:
            num[0] += 1
            num[1] += 1
            iter_num += 1
            continue

        if num.count(num[2]) == 2:
            num[0] += 2
            iter_num += 1
            continue

    print(iter_num)


if __name__ == '__main__':
    main()

Measured memory_bytes: 3064
from bisect import bisect_left, bisect_right

def main():
    N = int(input())
    L = sorted(list(map(int, input().split())))

    ans = 0
    for ia in range(N):
        for ib in range(ia+1, N-1):
            a = L[ia]
            b = L[ib]

            c_min = max(a-b, b-a)
            c_max = a + b
            ic_begin = bisect_right(L, c_min, lo=ib+1)
            ic_end   = bisect_left( L, c_max, lo=ib+1)

            ans += ic_end - ic_begin

    print(ans)
main()

Measured memory_bytes: 74300
// 基本テンプレート
 
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
using namespace std;
 
#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define int long long int
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
typedef pair<int, int> pii;
typedef long long ll;
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1001001001001001LL;
const ll MOD = 1000000007LL;
 
signed main() {
    int A, B, C, X, Y; cin >> A >> B >> C >> X >> Y;

    int ans = INF;
    if(2*C <= A+B) {
        chmin(ans, max(X, Y) * 2 * C);

        int cost = min(X, Y) * 2 * C;
        int sub = min(X, Y);
        X -= sub;
        Y -= sub;
        cost += X * A;
        cost += Y * B;
        chmin(ans, cost);
    }
    else {
        chmin(ans, A*X + B*Y);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
/// kazuki08
/*
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
typedef long long ll;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
#define ar array
//#define inf 1000000000
#define mod 1000000007
#define dmp(x) cerr<<"line "<<__LINE__<<" "<<#x<<":"<<x<<endl
#define fs first
#define sc second
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define mt make_tuple
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){
    return o<<"("<<p.fs<<","<<p.sc<<")";
}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){
    o<<"{";
    for(const T& v:vc) o<<v<<",";
    o<<"}";
    return o;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());



signed main(){
IOS;
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
  
  int a,b,c,k,ans=0;
  cin >> a >> b >> c >> k;
  ans = min(k,a);
  k-=ans;
  if(k){
    k-= min(b,k);
  }
  if(k){
    ans-=k;
  }
  cout << ans << endl;

return 0;
}
///....


Measured memory_bytes: 3656
#include <stdio.h>

int main(void) {

  long n;
  scanf("%ld", &n);
  long bit[100];
  for (long i = 0; i < 100; i++) {
    bit[i] = 0;
  }
  if (n >= 0) {
    bit[0] = n;
  } else {
    bit[0] = -n;
    bit[1] = -n;
  }
  for (long i = 1; i < 50; i++) {
    bit[i] += bit[i-1]/2;
    bit[i+1] += bit[i-1]/2;
    bit[i-1] %= 2;
  }
  int flag = 0;
  for (long i = 40; i > 0; i--) {
    if (bit[i] == 1) {
      flag = 1;
    }
    if (flag == 1) {
      printf("%ld", bit[i]);
    }
  }
  printf("%ld\n", bit[0]);

  return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(c) (c).rbegin(),(c).rend()
#define mp make_pair
#define endl '\n'
#define vec vector<ll>
#define mat vector<vector<ll> >
#define fi first
#define se second
typedef long long ll;
typedef pair<ll,ll> pll;
typedef long double ld;
const ll inf=1e9+7;
const ll mod=998244353;
signed main(){
    ll n;cin>>n;
    vector<ll>a(n);
    rep(i,n)cin>>a[i];
    vector<ll>b(0);
    b.pb(a[0]);
    REP(i,1,n){
        if(a[i]==a[i-1])continue;
        b.pb(a[i]);
    }
    if(b.size()==1){
        cout<<1000<<endl;
        return 0;
    }
    ll c=0;
    ll now=1000;
    ll s=0;
    if(b[1]>b[0]){
        c+=now/b[0];
        now=now%b[0];
        s=1;
    }
    b.pb(-inf);
    REP(i,1,b.size()-1){
        if(s){
            if(b[i+1]>b[i])continue;
            else{
                now+=b[i]*c;
                c=0;
                s=0;
            }
        }else{
            if(b[i+1]<b[i])continue;
            else{
                c+=now/b[i];
                now=now%b[i];
                s=1;
            }
        }
    }
    cout<<now<<endl;
}

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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void solve() {
    ll N;
    cin >> N;
    vector<P> items(N);
    rep(i, N) cin >> items[i].first >> items[i].second;
    ll Q;
    cin >> Q;

    vector<vector<ll>> dp(min(N + 1, (ll)(1 << 10) + 1), vector<ll>(100001, 0));
    rep2(i, 1, min(N + 1, (ll)(1 << 10) + 1)) {
        rep(j, 100001) {
            ll par = i / 2;
            dp[i][j] = dp[par][j];
            if (j - items[i - 1].second >= 0) {
                dp[i][j] = max(dp[i][j], dp[par][j - items[i - 1].second] + items[i - 1].first);
            }
        }
    }
    vector<ll> ans(Q);
    vector<P> query(Q);
    rep(q, Q) cin >> query[q].first >> query[q].second;
    rep(q, Q) {
        int v = query[q].first;
        int L = query[q].second;
        vector<int> use;
        v--;
        int u = v;
        use.push_back(u);
        while (u != 0) {
            u = (u - 1) / 2;
            use.push_back(u);
        }
        if (v < (1 << 10)) {
            ans[q] = dp[v + 1][L];
            continue;
        }
        sort(use.begin(), use.end());
        int n = use.size();
        vector<int> use_p;
        int last = -1;
        rep(i, n) {
            if (use[i] >= (1 << 10)) {
                use_p.push_back(use[i]);
            } else {
                last = max(last, use[i]);
            }
        }
        ll a = 0;
        rep(i, 1 << (int) use_p.size()) {
            int value = 0;
            int weight = 0;
            rep(j, use_p.size()) {
                if (i & (1 << j)) {
                    value += items[use_p[j]].first;
                    weight += items[use_p[j]].second;
                    if (weight > L) break;
                }
            }
            if (L - weight < 0) continue;
            a = max(a, dp[last + 1][L - weight] + value);
        }
        ans[q] = a;
    }
    rep(q, Q) {
        cout << ans[q] << '\n';
    }
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    solve();
    return 0;
}


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

using ll = long long int;
using bigint = int64_t;

#define pll pair<ll, ll>
#define vll vector<ll>
#define vpll vector<pll>
#define lob lower_bound
#define upb upper_bound
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define pf push_front
#define ins insert
#define mp make_pair
#define w(t) cin >> t;while(t--)
#define bitcount __builtin_popcount
#define endl "\n"
#define sz(s) (int)s.size()
#define mem(n,m) memset(n,m,sizeof(n))
#define deb(x) cout << #x << " = " << x << endl;
#define rep(i,n) for(ll i = 0; i < n; i++)
#define ren(i,n) for(ll i = n-1; i >= 0; i--)
#define all(x) x.begin(),x.end()
#define fo(i, a, b) for(ll i = a; i <= b; i++)
#define ffo(i, a, b) for(ll i = a; i >= b; i--)
#define ffi(i,a,b,c) for(ll i = a ; i <= b ; i += c)
#define IOS ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
const int MOD = 1000000007;

void io_set() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

void solve() {
    ll n, k;
    cin >> n >> k;
    ll a[n];
    rep(i, n)   cin >> a[i];
    fo(i, k, n - 1) {
        cout << (a[i] > a[i - k] ? "Yes\n" : "No\n");
    }
}

int main() {
    IOS;
    //io_set();
    ll tt = 1;
    //cin >> tt;
    while (tt--) {
        solve();
    }
    return 0;
}

Measured memory_bytes: 5212
#include<stdio.h>
#define MAX 100
#define WHITE 0
#define GRAY 1
#define BLACK 2
#define INFTY 1000000

int n,M[MAX][MAX];

int prim(){
  int u,j,i,min;
  int omomi[MAX],oya[MAX],color[MAX];

  for(i=0;i<n;i++){
    omomi[i]=INFTY;
    oya[i]=-1;
    color[i]=WHITE;
  }
  omomi[0]=0;

  while(1){
    min=INFTY;
    u=-1;
    for(i=0;i<n;i++){
      if(min>omomi[i]&&color[i]!=BLACK){
	u=i;
	min=omomi[i];
      }
    }
    if(u==-1)break;
    color[u]=BLACK;
    for(j=0;j<n;j++){
      if(color[j]!=BLACK&&M[u][j]!=INFTY){
	if(omomi[j]>M[u][j]){
	  omomi[j]=M[u][j];
	  oya[j]=u;
	  color[j]=GRAY;
	}
      }
    }
  }
  int sum=0;
  for(i=0;i<n;i++){
    if(oya[i]!=-1)sum+=M[i][oya[i]];
  }
  return sum;
}

int main(){
  int i,j,k;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      scanf("%d",&k);
      M[i][j]=(k==-1)?INFTY:k;
    }
  }
  printf("%d\n",prim());
  return 0;
}



Measured memory_bytes: 2112
#include <cstdio>
#include <iostream>
#include <string>
using namespace std;

int main(){
	int n, q;
	int year[51];
	string name[51];
	
	year[0]=1;
	name[0]="kogakubu10gokan";
	
	scanf(" %d %d", &n, &q);
	for(int i=1; i<=n; ++i) cin >> year[i] >> name[i];
	
	bool st=true;
	for(int i=0; i<n; ++i){
			if(year[i+1]>q){
				st=false;
				cout<<name[i]<<endl;
				break;	
			}
	}
	
	if(st) cout<<name[n]<<endl;
}

Measured memory_bytes: 1252
#include <iostream>
#include <string.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <functional>
#include <cassert>
#include <utility>
#include <stack>
#include <queue>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,n1,n2) for(int i=n1;i<n2;i++)
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
typedef pair<int,int> Pi;
typedef long long int ll;
const int INF=(ll)(1<<30)-1;
const ll INFl=(ll)9223372036854775807;
const int MAX=10000;
const ll MOD=(ll)1e9+7;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a, b)*b;}
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};

int n;
int t[100100],x[100100],y[100100];

int main(){
	cin>>n;
	t[0]=0,x[0]=0,y[0]=0;
	for(int i=1;i<=n;i++)
		cin>>t[i]>>x[i]>>y[i];
	for(int i=1;i<=n;i++){
		if(t[i]%2!=(x[i]+y[i])%2||(t[i]-t[i-1])<abs((x[i]-x[i-1])+abs(y[i]-y[i-1]))){
			cout<<"No"<<endl;
			return 0;
		}
	}
	cout<<"Yes"<<endl;
	return 0;
}

Measured memory_bytes: 1408
#include <iostream>

using namespace std;

bool graph[8][8] = {false};

int dfs(int iterate, bool * visited, int n)	{
  bool all_visited = true;
  for (int i = 0; i < n; i++)	{
    if (visited[i] == false)	
      all_visited = false;
  }
  if (all_visited)
    return 1;
  int rval = 0;
  for (int i = 0; i < n; i++)	{
    if (graph[iterate][i] == false)	{
      continue;
    }
    if (visited[i] == true)	{
      continue;
    }
    visited[i] = true;
    rval += dfs(i, visited, n);
    visited[i] = false;
  }
  return rval;
}

int main()	{
  int n, m;
  cin >> n >> m;
  int a, b;
  for (int i = 0; i < m; i++)	{
    cin >> a >> b;
    graph[a - 1][b - 1] = graph[b - 1][a - 1] = true;
  }
  bool visited[n] = {false};
  visited[0] = true;
  cout << dfs(0, visited, n) << endl;
  return 0;
}

Measured memory_bytes: 3588
#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>

int main(void){
    int n, m;
    std::cin >> n >> m;
    for(int i = 0; i < m; ++i){
        int tmp;
        std::cin >> tmp;
        n -= tmp;
        if(n < 0){
            std::cout << -1 << std::endl;
            return 0;
        }
    }
    std::cout << n << std::endl;

    return 0;
}

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

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

    int len = s.size();

    string ans="";
    for (int i=0; i<len; ++i) {
        if (i%2==0) {
            ans += s[i];
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 888
#include <bits/stdc++.h>
#define For(i,l,r) for (register int i=l; i<=r; i++)
using namespace std;
typedef unsigned long long LL;
typedef signed long long ll;
template <typename T>
inline void read(T &x) {
	char c = getchar(); int w = 1; x = 0;
	while (!isdigit(c))
		(c == '-') && (w = -w), c = getchar();
	while (isdigit(c))
		x = (x << 1) + (x << 3) + (c ^ '0'), c = getchar();
	x *= w;
}

int n, x;
int main() {
    read(n);
    for (register int i=1; i<=n; ++i) {
        read(x);
        if (x % 2 == 0) {
            if (x % 3 && x % 5) return puts("DENIED"), 0;
        }
    }
    puts("APPROVED");
	getchar();
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <locale>
#include <map>
#include <numeric>
#include <queue>
#include <string>
#include <vector>

const long long int INF = 1e9;
typedef long long int ll;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define Rep(i, n) for(int i = 1; i <= (int)(n); i++)
#define llrep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define llRep(i, n) for(ll i = 1; i <= (ll)(n); i++)

using namespace std;

struct Point{
	int x,y;
};

bool vector_finder(std::vector<ll> vec, ll number) {
    auto itr = std::find(vec.begin(), vec.end(), number);
    size_t index = std::distance( vec.begin(), itr );
  if (index != vec.size()) { // 発見できたとき
    return true;
    }
  else { // 発見できなかったとき
    return false;
    }
}

ll factorial(ll N){
    ll ans = 1;
    llRep(i,N){
        ans *= i;
    }
    return ans;
}

ll extended_factorial(ll N){
    ll ans = 1;
    llRep(i,N){
        ans *= i;
        ans %= (ll)(1e9+7);
    }
    return ans;
}

vector<ll> Eratosthenes(ll N){
    bool arr[N+1];
    //initialization
    arr[0] = false;
    arr[1] = false;
	for(ll i = 2; i < N+1; i++){
		arr[i] = true;
	}
    //eratosthenes
	for(ll i = 2; i <= sqrt(N); i++){
		if(arr[i]){
			for(ll j = 0; i * (j + 2) <= N; j++){
				arr[i *(j + 2)] = false;//not prime number
			}
		}
	}
    vector<ll> prime;
    llRep(i,N){
        if (arr[i]==true){
            prime.push_back(i);
        }
    }
    return prime;
}

char alphabet[] = {
    'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'
};


int main(){
    int a;
    string S;
    cin >> a;
    cin >> S;
    if (a >= 3200){
      cout << S << endl;
    }else{
      cout << "red" << endl;
    }
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		while(true){

			int a = sc.nextInt();
			String op = sc.next();
			int b = sc.nextInt();

			if(op.equals("?"))break;

			int ans = 0;

			switch(op){
			case "+":
				ans = a+b;
				break;
			case "-":
				ans = a-b;
				break;
			case "*":
				ans = a*b;
				break;
			case "/":
				ans = a/b;
				break;
			}

			System.out.println(ans);
		}
	}
}



Measured memory_bytes: 26376
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define lowbit(a) ((a) & -(a))
#define clean(a, b) memset(a, b, sizeof(a))
const int mod = 1e9 + 7;
const int inf = 0x3f3f3f3f;
const int maxn = 2e6 + 9;

int _;

//========================================================================

//========================================================================
int main()
{
    int n,sum=7;
    scanf("%d",&n);
    if(n%2==0) 
    {
        printf("-1\n");
        return 0;
    }
    if(n==1||n==7) 
    {
        printf("1\n");
        return 0;
    }
    for(int i=1;i<=n;i++)
    {
        if(sum==0) 
        {
            printf("%d\n",i);
            return 0;
        }
        sum=(sum*10+7)%n;
    }
    printf("-1\n");
    return 0;
}

Measured memory_bytes: 3676
#include <bits/stdc++.h>
using namespace std;
/* 角度でソートし全区間を試す */

#define rep(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define repn(i, m, n) for (int (i) = (m) ; (i) < (int)(n) ; ++(i))
#define rep_rev(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define repn_rev(i, m, n) for (int (i) = (int)(n) - 1 ; (i) >= (m) ; --(i))

#define INF 2e9
#define ll long long
#define MOD 1e9+7

int main(){
    int n;
    cin>>n;
    int a[n], b[n], c[n];
    rep(i, n){
        cin>>a[i];
        a[i]--;
    }
    rep(i, n){
        cin>>b[i];
    }
    rep(i, n-1){
        cin>>c[i];
    }
    int prev = a[0];
    int ans = b[a[0]];
    for(int i=1; i<n; i++){
        if(a[i] == a[i-1]+1){
            ans += c[a[i-1]];
        }
        ans += b[a[i]];
    }
    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 256
h, w = [int(x) for x in input().split()]
board = [input() for _ in range(h)]

mines=['' for _ in range(h)]

#print(board)

for row in range(h):
    for col in range(w):
        if board[row][col] != '#':
            counts = 0
            dx = [x for x in range(-1, 2) if (col+x>=0 and col+x<w)]
            dy = [y for y in range(-1, 2) if (row+y>=0 and row+y<h)]
            #print('row:{}, col:{}, dx:{}, dy:{}'.format(row,col,dx,dy))
            for x in dx:
                for y in dy:
                    #print('row+y:{}, col+x:{}'.format(row+y, col+x))
                    if board[row+y][col+x] == '#':
                        counts += 1
            mines[row] += str(counts)
        else:
            mines[row] += '#'
for mine in mines:
    print(mine)

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

void Aout(vector <double> A, int n);
void insertionsort(vector <double> A, int n);

int main(void){
	int n;

	cin>>n;
	vector <double> A(n);

	for (int i=0; i<n; i++)
		cin>>A[i];
	Aout(A, n);
	insertionsort(A, n);

	return 0;
}

void Aout(vector <double> A, int n){
	for (int i=0; i<n; i++){
		if (i!=0) cout<<" ";
		cout<<A[i];
	}
	cout<<endl;
}
void insertionsort(vector <double> A, int n){
	double key;
	int i;
	for (int j=1; j<n; j++){
		key = A[j];
		i = j-1;
		while (i>=0){
			if (A[i] <= key) break;
			A[i+1] = A[i];
			i--;
		}
		A[i+1] = key;
		Aout(A, n);
	}
}

Measured memory_bytes: 1312
#include <bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define inf 0x3f3f3f3f
using namespace std;
const int maxn=205;
ll a[105];
map<int,int> ma;
int main() {
	int n,x;
	cin>>n;
	int pos=0;
	for(int i=0;i<n;i++) {
		cin>>x;
		if(!ma[x])  a[pos++]=x;
		ma[x]++;
	}
	//cout<<pos<<endl;
	sort(a,a+pos);
	ll ans=0;
	for(int i=0;i<pos-2;i++) {
		for(int j=i+1;j<pos-1;j++) {
			for(int k=j+1;k<pos;k++) {
				if(a[k]<a[i]+a[j])
					ans+=(ma[a[k]]*ma[a[j]]*ma[a[i]]);
			}
		}
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 3640
#include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstring>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

const int MAX = 107;
const int MOD = 1000000007;

void solve() {
    int n;
    cin >> n;
    pair<int, int> p[MAX];
    for (int i = 0; i < n; i++) {
        cin >> p[i].first >> p[i].second;
    }
    long double val = 0;
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            val += sqrt(pow(p[i].first - p[j].first, 2.0) + pow(p[i].second - p[j].second, 2.0));
        }
    }
    cout << fixed << setprecision(17) << (2.0 * val / (n));
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    //freopen("in.in", "r", stdin); freopen("out.out", "w", stdout);
    //int tt; cin >> tt; for (int i = 1; i <= tt; i++) {cout << "Case #" << i << ": "; solve();}
    solve();
}

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

int main(){
    while(1){
        int w,d;
        cin >> w >> d;
        if(w==0) break;

        vector<int> h1(21,0), h2(21,0);
        for(int i=0; i<w; i++){
            int h;
            cin >> h;
            h1[h]++;
        }
        for(int i=0; i<d; i++){
            int h;
            cin >> h;
            h2[h]++;
        }

        int ans=0;
        for(int i=1; i<=20; i++){
            ans += i*max(h1[i], h2[i]);
        }
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 3048
# -*- coding: utf-8 -*-
# https://atcoder.jp/contests/abc138/tasks/abc138_d

# n: 頂点の数 ((n-1)回エッジを作る)
# q: 頂点に整数を足し込む操作の回数
n, q = map(int, input().split())

values = [0 for _ in range(n)]  # n 個の頂点の値はすべて 0 で初期化する
links = [[] for _ in range(n)]  # n 番目の頂点が、エッジを伸ばしている先の頂点のリスト

# 木の構築
for _ in range(n - 1):
    a, b = [int(x) - 1 for x in input().split()]
    links[a].append(b)
    links[b].append(a)

# 初期値の挿入
for _ in range(q):
    node, value = map(int, input().split())
    node -= 1  # 0 オリジン対応
    values[node] += value

# 値の伝播
stack = [(0, -1)]  # (頂点の番号, 親頂点の番号) を stack につめて、空になるまでイテレートする
while 0 < len(stack):
    node, parent = stack.pop()
    for link in links[node]:
        if link == parent:
            continue
        values[link] += values[node]
        stack.append((link, node))

print(*values)


Measured memory_bytes: 60384
#include<bits/stdc++.h>
using namespace std;
int main(){
  char a[6];
  for(int i=0;i<6;i++){
  	cin>> a[i];}
  if(a[2]==a[3]&&a[4]==a[5]){
    cout<<"Yes";}
  else{
    cout<<"No";
  }
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,i,j,k,l,t,arr[303][303]={},x,y,z=0;
    char c[303][303];
    scanf("%d %d %d",&n,&m,&k);
    for(i=0;i<n;i++)
        scanf("%s",&c[i]);
        l=0;
    z=0;
    for(i=0;i<n;i++){
            y=0;
        for(j=0;j<m;j=k+1){
                k=j;
                while(k<m && c[i][k]=='.')
                    k++;
                if(k<m){
                    y++;
                    z++;
                    for(x=j;x<=k;x++)
                        arr[i][x]=z;
                }
                else if(y>0){
                    for(x=j;x<m;x++)
                        arr[i][x]=z;
                }
                else if(z>0){
                    for(x=j;x<m;x++)
                        arr[i][x]=arr[i-1][x];
                }

        }
    }
    for(i=n-1;i>=0;i--)
    {
        for(j=0;j<m;j++){
            if(arr[i][j]==0)
                arr[i][j]=arr[i+1][j];
        }
    }
    for(i=0;i<n;i++)
    {
        for(j=0;j<m;j++)
            printf("%d ",arr[i][j]);
        printf("\n");
    }
}


Measured memory_bytes: 1152
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <random>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <ctime>
#include <bitset>
#include <complex>

using namespace std;

typedef long double ld;

const ld eps = 1e-9;
const ld INF = 1e18;

struct Point {
    ld x;
    ld y;

    Point() {}

    Point(ld x_, ld y_) {
        x = x_;
        y = y_;
    }

    Point operator*(ld z) const {
        return Point(x * z, y * z);
    }

    Point operator/(ld z) const {
        return Point(x / z, y / z);
    }

    Point np() const {
        return Point(-y, x);
    }

    ld operator*(const Point &other) const {
        return x * other.y - y * other.x;
    }

    Point operator-(const Point &other) const {
        return Point(x - other.x, y - other.y);
    }

    Point operator+(const Point &other) const {
        return Point(x + other.x, y + other.y);
    } 

    ld dist(const Point &other) const {
        ld dx = (x - other.x);
        ld dy = (y - other.y);
        return hypot(dx, dy);
    }
};

Point intersect(const Point &a, const Point &b, const Point &c, const Point &d) {
    ld s1 = (c - a) * (d - a);
    ld s2 = (d - b) * (c - b);
    ld s = s1 + s2;
    assert(fabs(s) > eps);
    Point np = b - a;
    np = np / s;
    np = np * s1;
    return a + np;
}

bool is_on_line(const Point &a, const Point &b, const Point &c) {
    ld cur = (b - a) * (c - a);
    return fabs(cur) < eps;
}

Point getmid(const Point &a, const Point &b) {
    Point res = a + b;
    res = res / (ld)2;
    return res;
}

Point get3(const Point &a, const Point &b, const Point &c) {
    Point f = getmid(a, b);
    Point f1 = f + (b - a).np();
    Point s = getmid(a, c);
    Point s1 = s + (c - a).np();
    return intersect(f, f1, s, s1);
}

ld solve(Point to, vector<Point> a) {
    ld res = 0;
    for (auto t : a) {
        res = max(res, to.dist(t));
    }
    return res;
}


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

    int n;
    cin >> n;
    vector<Point> a(n);
    for (auto &t : a) {
        cin >> t.x >> t.y;
    }
    ld ans = INF;
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            ans = min(ans, solve(getmid(a[i], a[j]), a));
        }
    }
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            for (int k = j + 1; k < n; k++) {
                if (is_on_line(a[i], a[j], a[k])) continue;
                ans = min(ans, solve(get3(a[i], a[j], a[k]), a));
            }
        }
    }
    cout << fixed << setprecision(16);
    cout << ans << endl;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a) for(int i = 0; i < (a); i++)
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const int MOD = 1e9 + 7;

int main(){
	int a,b;
	cin >> a >> b;
	if(a <= 5) cout << 0 << endl;
	else if(a <= 12)cout << b / 2 << endl;
	else cout << b << endl;
}

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

typedef long long ll;

const int maxn = 110, maxv = 1e5 + 5;
const ll INF = 0x3f3f3f3f;
int N, v[maxn];
ll w[maxn], dp[maxn][maxv], W;

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

    cin >> N >> W;
    for (int i = 1; i <= N; i++) {
        cin >> w[i] >> v[i];
    }
    const int V = 1000 * N;
    memset(dp, INF, sizeof(dp));
    dp[1][0] = 0;
    dp[1][v[1]] = w[1];
    for (int i = 2; i <= N; i++) {
        for (int j = 0; j <= V; j++) {
            dp[i][j] = dp[i - 1][j];
            if (j < v[i]) {
                continue;
            }
            dp[i][j] = min(dp[i][j], w[i] + dp[i - 1][j - v[i]]);
        }
    }
    int answer = 0;
    for (int i = 0; i <= V; i++) {
        if (dp[N][i] <= W) {
            answer = i;
        }
    }
    cout << answer;

    return 0;
}

Measured memory_bytes: 89520
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
typedef long long ll;

int main()
{
  int H, W;
  cin >> H >> W;
  int N;
  cin >> N;
  int a[N];
  FOR(i,0,N) cin >> a[i];
  int now = 1;
  int ans[H][W];
  FOR(y,0,H) {
    if(y % 2 == 0) {
      FOR(x,0,W) {
        if(a[now-1]==0) now++;
        ans[y][x] = now;
        a[now-1]--;
      }
    }
    if(y % 2 == 1) {
      for(int x = W - 1; x >= 0; x--) {
        if(a[now-1]==0) now++;
        ans[y][x] = now;
        a[now-1]--;
      }
    }
  }
  FOR(y,0,H) {
    FOR(x,0,W) {
      printf("%d%c",ans[y][x],x==W-1?'\n':' ');
    }
  }
  return 0;
}

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

int main() {
  int N;
  cin >> N;
 for (int i =0 ; i <N ; i++) {
  string S;
  cin >> S;
   if (S == "Y") {
   cout << "Four" << endl ;
   break;
   }
   else if (i == N-1){
   cout << "Three" << endl ;
   }
 } 
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm> // sort
#include <map> // pair
#include <numeric> // accumulate(begin,end,初期値)
#include <string>
#include <cstdio>
#include <queue>
#include <stack>
#include <set>
#include <cmath>

typedef long long ll;
using namespace std;

#define FALSE printf("false\n");
#define TRUE printf("true\n");
#define all(x) (x).begin(),(x).end()
#define print(x) cout<<x<<endl
#define rep(i,n) for(int i = 0;i < ((int)(n));++i)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define SUM(vec) accumulate(all(vec),0)
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define test(a) cout<<#a<<':'<<a<<endl

const ll INF = 1e9+7;

// 各桁の和
template<typename T>inline T digit(T num){T sum = 0;while(num){sum+=num%10;num/=10;}return sum;}
template<typename T>inline T gcd(T a,T b){if(b == 0)return a;return gcd(b,a%b);}
template<typename T>inline T lcm(T a, T b){T g = gcd(a,b);return a/g*b;}
template<typename T>inline T power(T a,T b){T tmp=1;rep(i,b){tmp*=a;}return tmp;}

int main() {
  cin.tie(0); ios::sync_with_stdio(0);
  ll n,k,q;cin>>n>>k>>q;
  vector<int> a(n,0);
  rep(i,q){
    int no;cin>>no;
    a[no-1]++;
  }

  rep(i,n){
    if((q - a[i]) < k)print("Yes");
    else print("No");
  }

  return 0;
} 

Measured memory_bytes: 1024
#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; }

int main(){
	int x,y;cin>>x>>y;
	for(int i = 0; i <= x; i++) {
		int j = x - i;
		if (i * 2 + j * 4 == y){
			cout << "Yes" << endl;
			return 0;
		}
	}
	cout << "No" << endl;

	return 0;
}

Measured memory_bytes: 3600
package main

import (
  "fmt"
)

func maxInt(a ...int) int {m := a[0]; for _, x := range a {if x > m {m = x}}; return m}
func minInt(a ...int) int {m := a[0]; for _, x := range a {if x < m {m = x}}; return m}

func main() {
  var n int 
  var s string 
  fmt.Scan(&n, &s)
  x := 0
  res := x
  for _, c := range s {
    if c == 'I' {
      x++
      res = maxInt(res, x)
    } else {
      x--
    }
  }
  fmt.Println(res)

}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
#define  ft  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define  ll  long long
#define  pi  pair<int,int>
#define  pb  push_back
#define  F   first
#define  S   second
const int N=1e5+3;
ll a[N];
int main()
{
    ft
    ll t,i,j,k,n,m,l=0,r;
    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        l=__gcd(l,a[i]);
    }
    cout<<l<<"\n";
    return 0;
}



Measured memory_bytes: 1024
a,b=gets.split(' ').map(&:to_i)
#h=gets.split(' ').map(&:to_i)
#tajigen = Array.new(4) { Array.new(2,0) }

rangea1= (a / 0.08)
rangea2= ((a+1) / 0.08)

if rangea1==(a/0.08).to_i
  rangea1=rangea1.to_i
  else
    rangea1=(rangea1+1).to_i
end

if rangea2==((a+1)/0.08).to_i
  rangea2=(rangea2-1).to_i
else
  rangea2=rangea2.to_i
end

rangeb1=(b/0.10)
rangeb2=((b+1)/0.10)

if rangeb1==(b/0.10).to_i
  rangeb1=rangeb1.to_i
  else
    rangeb1=(rangeb1+1).to_i
end

if rangeb2==((b+1)/0.10).to_i
  rangeb2=(rangeb2-1).to_i
else
  rangeb2=rangeb2.to_i
end
=begin
puts rangea1
puts rangea2
puts rangeb1
puts rangeb2
=end
a=(rangea1..rangea2).to_a
b=(rangeb1..rangeb2).to_a

c= a & b
if c[0]!=nil
  puts c[0]
else
  puts "-1"
end


Measured memory_bytes: 3836
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<limits>
#include<iomanip>
#include<cmath>
#include<climits>

using namespace std;

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

const int mod=1e9+7;

int gcd(int a,int b){
    if(b==0){
        return a;
    }else{
        return gcd(b,a%b);
    }
}
int main(){
    int n;
    cin >> n;
    vector<int> a(n),b(n);
    int aMax=-1,bMax=-1;
    for(int i=0;i<n;i++){
        cin >> a[i] >> b[i];
        if(aMax<a[i]){
            aMax=a[i];
            bMax=b[i];
        }
    }
    cout << aMax+bMax << endl;
    return 0;
}

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


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

    int n, m;
    cin >> n >> m;
    vector<int> ans(n);
    for (int i = n / 2 + 1; i < n; i++)
        ans[i] = m;
    
    for (int i = 0; i < n - 1; i++)
        cout << ans[i] << " ";
    cout << ans[n - 1] << endl;
}


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

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

Measured memory_bytes: 256
import Data.Array.IO

main = do
    [n,k] <- (map read . words) <$> getLine :: IO [Int]
    s <- getLine
    let s' = 0:0:preproc s++[0,0]
    arr <- buildAccum s'
    s'' <- postproc' arr (2*k+1) 3
    print $ if s'' == [] then n else maximum s''


preproc :: String -> [Int]
preproc s = let h = head s in
            if h == '0' then 0:preprocAux h 0 s
                        else   preprocAux h 0 s
    where
        preprocAux :: Char -> Int -> String -> [Int]
        preprocAux cur ac [] = if cur=='0' then [ac,0] else [ac]
        preprocAux cur ac xx@(x:xs) = if x == cur
            then    preprocAux x (ac+1) xs
            else ac:preprocAux x 1 xs

postproc' :: IOArray Int Int -> Int -> Int -> IO [Int] 
postproc' arr n curPos = do
    (_,br) <- getBounds arr
    if br-curPos+1 < n
        then return []
        else do
            x <- sum' arr n curPos
            recls <- postproc' arr n (curPos+2)
            return $ x:recls
                where
                    sum' arr n cur = do
                        r <- readArray arr (cur+n-1)
                        l <- readArray arr (cur-1)
                        return $ r-l

buildAccum :: [Int] -> IO (IOArray Int Int)
buildAccum xs = newArray (1,length xs) 0 >>= (\arr -> buildAccumAux arr 1 0 xs)
    where
        buildAccumAux :: IOArray Int Int -> Int -> Int -> [Int] -> IO (IOArray Int Int)
        buildAccumAux arr pos ac []     = return arr
        buildAccumAux arr pos ac (x:xs) = do
            let accVal = ac+x
            writeArray arr pos accVal
            buildAccumAux arr (pos+1) accVal xs



Measured memory_bytes: 13820
#coding:utf-8
import math

def f(n,m):
    return n//m + (0 if n%m==0 else 1)

N=int(input())
T,A=1,1
for i in range(N):
    t_i,a_i=list(map(int,input().split()))

    if T<=t_i and A<=a_i:
        T,A=t_i,a_i
    else:
        raito=max(f(T,t_i),f(A,a_i))
        T,A=t_i*raito,a_i*raito

print(T+A)


Measured memory_bytes: 3064
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
    int A, B, m;
    cin>>A>>B>>m;
    int a[100010], b[100010];
    for(int i=0; i<A; i++) cin>>a[i];
    for(int i=0; i<B; i++) cin>>b[i];
    int ans=(*min_element(a, a+A))+(*min_element(b, b+B));
    for(int i=0; i<m; i++){
        int x, y, c; cin>>x>>y>>c;
        x--; y--;
        ans=min(ans, a[x]+b[y]-c);
    }
    cout<<ans<<endl;
	return 0;
}


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

int main(){
  int N;
  vector<int64_t> A(200010);
  set<int64_t> B;

  cin >> N;
  for(int i=0; i<N; i++){
    cin >> A[i];
    B.insert(A[i]);
  }

  if(B.size() == N){
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}

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

int main() {
    ll N, A, B;
    cin >> N >> A >> B;

    ll tmp = A + B;
    ll ans = (N / tmp) * A;
    ans += min((N % tmp), A);
    cout << ans << endl;
}


Measured memory_bytes: 256
def get_num_coin(ini_point, k):
  n = 0
  tmp_point = 0
  while tmp_point <= k-1:
    n+=1
    tmp_point = ini_point*(2**n)
  return n

n, k = map(int, input().split())
ans = 0
for ini_point in range(1, n+1):
  if ini_point >= k:
    ans += 1/n
    continue
  else:
    num_coin = get_num_coin(ini_point, k)
    ans += 1/n * (0.5**num_coin)
print(ans)

Measured memory_bytes: 3064
#include <algorithm>
#include <climits>
#include <iostream>
#include <string>
#include <utility>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <iomanip>
#include <cmath>
#include <stack>

using namespace std;
using ll = long long int;

template <class T> ostream &operator<<(ostream &os, vector<T> &v) {
  for (auto i = v.begin(); i != v.end(); i++) {
    os << *i << " ";
  }
  return os;
}


void solve(long long N, long long M, std::vector<long long> a, std::vector<long long> b){
  map<ll, vector<ll>> m;
  for(ll i=1; i<=N; i++) {
    vector<ll> v;
    m[i] = v;
  }
  for(ll i=0; i<M; i++) {
    m[a[i]].push_back(b[i]);
    m[b[i]].push_back(a[i]);
  }
  ll ans = 0;
  for(ll i=0; i<M; i++) {
    stack<ll> st;
    vector<ll> vi(N+1, 0);
    st.push(1);
    while(!st.empty()) {
      ll cur = st.top();
      vi[cur] = 1;
      st.pop();
      for(auto x: m[cur]) {
	if((a[i]==x and b[i]==cur) or (a[i]==cur and b[i]==x) or vi[x]==1) continue;
	st.push(x);
      }
    }
    ll f = 0;
    for(ll j=1; j<=N; j++)
      f+=vi[j];
    if(f!=N)
      ans++;
  }
  std::cout << ans << std::endl;
}

int main(){
  long long N;
  scanf("%lld",&N);
  long long M;
  scanf("%lld",&M);
  std::vector<long long> a(M);
  std::vector<long long> b(M);
  for(int i = 0 ; i < M ; i++){
    scanf("%lld",&a[i]);
    scanf("%lld",&b[i]);
  }
  solve(N, M, std::move(a), std::move(b));
  return 0;
}



Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
	int N;
	cin >> N;
	int num[] = {105,135,165,189,195};
	for(int i = 0; i <= 4;i++){
		if(N<num[i]){
			cout << i;
			return 0;
		}
	}
	cout << 5;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <algorithm>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#define vv(a, b, c, d) vector<vector<d> >(a, vector<d>(b, c))
#define vvi std::vector<std::vector<int> >
#define vvl std::vector<std::vector<ll> >
#define MODs 1000000007;
typedef long long int ll;
typedef long double ld;
using namespace std;

int main(int argc, char const *argv[]) {
  ll N;
  std::cin >> N;
  vvi A = vv(N, 2, 0, int);
  for(int i=0;i<N;i++){
    std::cin >> A[i][0];
    A[i][1] = i+1;
  }
  sort(A.begin(), A.end());
  for(int i=0;i<N;i++){
    std::cout << A[i][1] << (i==N-1?"\n":" ");
  }
  return 0;
}


Measured memory_bytes: 6272