akhauriyash/Code-Regression huggingface dataset:
#include <iostream>

using namespace std;

typedef long long ll;

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

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);
	ll a, b;
	cin>>a>>b;
	cout<<a*b/gcd(a,b)<<'\n';
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <tuple>
#include <queue>
#include <set>
#include <math.h>
#include <array>
#include <list>
#include <set>
#define MOD 1000000007
#define INF 1000000000
using namespace std;
typedef long long ll;
typedef tuple<ll,int,int> p;
typedef vector<int> vi;
set <int> st;
string s;
int north=0,south=0,east=0,west=0;

int main(int argc,char const* argv[])
{
  cin >> s;
  for(int i=0;i<s.size();i++)
    {
      if(s[i]=='N') north++;
      else if(s[i]=='S') south++;
      else if(s[i]=='W') west++;
      else if(s[i]=='E') east++;
    }
  if((north>0 && south==0) || (south>0 && north==0) || (east>0 && west==0) || (west>0 && east==0)) 
    {
      cout << "No" << endl;
      return 0;
    }
  else 
    {
      cout << "Yes" << endl;
      return 0;
    }
}


Measured memory_bytes: 256
// Rustで競技プログラミングの入力をスッキリ記述するマクロ
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8

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

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

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

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

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

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

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

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

fn main() {
  input! {
      b: chars
  }
  println!("{}", match b[0] {
        'A' => 'T',
        'T' => 'A',
        'C' => 'G',
        'G' => 'C',
        _ => panic!()
    });
}


Measured memory_bytes: 4352
#include<cstdio>
#include<algorithm>
#include<iostream>
#include<string>
#include<cstring>
#include<vector>
#include<stack>
#include<bitset>
#include<cstdlib>
#include<cmath>
#include<set>
#include<list>
#include<deque>
#include<map>
#include<queue>
#include <fstream>
using namespace std;
typedef long long ll;
const ll INF = 0x3f3f3f3f;
const double PI = acos(-1.0);
const double eps = 1e-6;
const int mod = 1e9+7;
const int maxn = 200005;
ll T,n,m;
int main() {
	int T;
	ll a,b,c;
	cin>>a>>b>>c;
	if((a+b+c)>=22)
	 cout<<"bust\n";
	else 
		cout<<"win\n"; 
    return 0;
}



Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
  int N,i,j,A[200000]={0},check[200000]={},move[200000]={0};
  long long K;
  i=scanf("%d %lld",&N,&K);
  for(i=0;i<N;i++)check[i]=-scanf("%d",&A[i]);
  for(i=0,j=0;;i=A[i]-1,j++)if(check[i]<0)check[i]=j,move[j]=i;else break;
  if(K>=j)K=(K-check[i])%(check[i]-j)+check[i];
  return printf("%d\n",move[K]+1),0;
}

Measured memory_bytes: 4052
#include<stdio.h>

int main(void)
{
	int i, N, a;

	scanf("%d", &N);
	for (i = 1; i <= N; i++) {
		a = i*i;
		if (a > N) {
			a = (i - 1)*(i - 1); break;
		} 
	}
	printf("%d\n", a);
	return 0;
}

Measured memory_bytes: 128
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<list>
#include<bitset>
#include<stack>
#include<memory>
#include<numeric>
using namespace std;
using namespace std::chrono;
typedef long long int llint;
typedef long double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
/*cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);*/
const int mod=1000000007;
const llint big=2.19e15+1;
const long double pai=3.141592653589793238462643383279502884197;
const long double eps=1e-4;
template <class T,class U>bool mineq(T& a,U b){if(a>b){a=b;return true;}return false;}
template <class T,class U>bool maxeq(T& a,U b){if(a<b){a=b;return true;}return false;}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){if(a==0){return b;}return a/gcd(a,b)*b;}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
template<class T>llint LBI(const vector<T>&ar,T in){return lower_bound(ar.begin(),ar.end(),in)-ar.begin();}
template<class T>llint UBI(const vector<T>&ar,T in){return upper_bound(ar.begin(),ar.end(),in)-ar.begin();}
int main(void){
	int n,mae=mod,ans=0;
	cin>>n;
	while(n--){
		int x;cin>>x;
		if(mae<x){ans++;}
		mae=x;
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 3120
#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 popcount(n) (__builtin_popcountll(n))

using namespace std;

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 ll=long long;
using R=long double;
const R EPS=1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max(x,0.0L));}

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

// Problem Specific Parameter:

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

	string ans="";
	for(auto &c:s){
		if(isdigit(c))
			ans+=c;
		else{
			if(ans.size()>0) ans.pop_back();
		}
	}
	cout << ans << endl;
	return 0;
}

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

int main() {

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

    int q;
    cin >> q;
    int *T = new int[q];
    for (int i = 0; i < q; ++i) {
        cin >> T[i];
    }

    int count = 0;
    for (int i = 0; i < q; ++i) {
        for (int j = 0; j < n; ++j) {
            if (S[j] == T[i]) {
                ++count;
                break;
            }
        }
    }

    cout << count << endl;

    delete[] S;
    delete[] T;
    return 0;
}

Measured memory_bytes: 1236
// This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include <bits/stdc++.h>
using namespace std;

const int INF = 1e9;

struct Node {
    int index, dist;
    bool visited;
    vector<int> tos;
};

int main() {
    int n, m;
    cin >> n >> m;
    vector<Node> nodes(3 * n);
    for (int i = 0; i < 3 * n; i++) {
        nodes[i].index = i;
        nodes[i].dist = INF;
        nodes[i].visited = false;
    }
    for (int i = 0; i < m; i++) {
        int u, v;
        cin >> u >> v;
        u--;
        v--;
        for (int j = 0; j < 3; j++) {
            nodes[j * n + u].tos.push_back((j + 1) % 3 * n + v);
        }
    }
    int s, t;
    cin >> s >> t;
    s--;
    t--;
    queue<int> que;
    nodes[s].dist = 0;
    nodes[s].visited = true;
    que.push(s);
    bool answered = false;
    while (que.size() > 0) {
        int i = que.front();
        que.pop();
        if (i == t) {
            cout << nodes[i].dist / 3 << endl;
            answered = true;
            break;
        }
        nodes[i].visited = true;
        for (int j: nodes[i].tos) {
            if (nodes[j].visited == false) {
                nodes[j].dist = nodes[i].dist + 1;
                nodes[j].visited = true;
                que.push(j);
            }
        }
    }
    if (answered == false) {
        cout << -1 << endl;
    }
    return 0;
}

// GCC reference:
//   https://gcc.gnu.org/

// C++ language references:
//   https://cppreference.com/
//   https://isocpp.org/
//   http://www.open-std.org/jtc1/sc22/wg21/

// Boost libraries references:
//   https://www.boost.org/doc/


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

#define ff first
#define ss second
#define int long long
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define pb push_back
#define mp make_pair
#define endl "\n"      // Comment in INTERACTIVE(there just use endl which flushes output , no need of fflush(sdtout)).
//  for counting setbits -> __builtin_popcountll(x)
// for counting zerobits -> __builtin_ctzll(x)
#define fastio() ios_base::sync_with_stdio(false);        cin.tie(NULL); //(unties i/o buffer).
            // DON'T USE SCANF/PRINTF WITH IT (c/c++ -> seperates buffer).

const int mod = 1000000007;
const int N = 2*(1e5) + 2;
// int arr[N];
int memo[N];

int jump(int i,vi &h){  // i -> index where reach from previous.
    if(i <= 1)
        return 0;
    if(i == 2)
        return abs(h[1] - h[2]);
    // want min cost.
    return min(jump(i-1,h) + abs(h[i] - h[i-1])  ,  jump(i-2,h) + abs(h[i] - h[i-2]));
}

int jumpmemo(int i,vi &h){
    if(i <= 1)
        return 0;
    if(i == 2)
        return abs(h[1] -  h[2]);
    if(memo[i] != -1)
        return memo[i];

    return memo[i] = min(jumpmemo(i-1,h) + abs(h[i] - h[i-1])  ,  jumpmemo(i -2,h) + abs(h[i] - h[i-2]));
}

int32_t main(){
    fastio();

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

     memset(memo,-1 ,sizeof(memo));

     // ***** AC_chahiye EK BAR MEIN

     // BEGIN CODE HERE
    int n;
    cin>>n;
    vi h(n+1);
    for(int i = 1;i <= n; ++i)
        cin>>h[i];
    vi dp(n+1);

    dp[1] = 0, dp[2] = abs(h[2] - h[1]);
    for(int i = 3;i <= n; ++i)
        dp[i] = min(dp[i - 1] + abs(h[i] - h[i-1])  ,  dp[i - 2] + abs(h[i] - h[i - 2]));
    // cout<<dp[n]<<endl;
    // cout<<jump(n,h)<<endl;
    cout<<jumpmemo(n,h)<<endl;
    //getch();
}


Measured memory_bytes: 5760
# D
q = int(input())

a = [0] * q
b = [0] * q
for i in range(q):
    a[i], b[i] = map(int, input().split())

for i in range(q):
    k=min(a[i],b[i])
    score=a[i]*b[i]
    sqrt=int(score**0.5)
    if abs(a[i]-b[i])<=1:
        ans=(k-1)*2
    elif sqrt**2==score:
        ans=sqrt*2-3
    elif sqrt*(sqrt+1)>=score:
        ans=(sqrt-1)*2
    else:
        ans=sqrt*2-1
    print(ans)

Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define rt return 0
#define endln "\n"
#define all(v) v.begin(), v.end()
#define for1(i, a, b) for (long long int i = a; i < b; i++)
#define for2(i, a, b) for (long long int i = a; i > b; i--)
//  cout << fixed << setprecision(0) << pi <<" "<<npi<<endl;typedef long long int i;
typedef long long int lli;
typedef pair<lli, lli> pll;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    lli t;
    cin >> t;
    vector<lli> v;
    lli c = 0;
    lli f = 0;
    for1(i, 0, t)
    {
        lli a, b;
        cin >> a >> b;
        if (a == b)
        {
            c += 1;
        }
        else
        {
            c = 0;
        }
        if (c == 3)
        {
            f = 1;
        }
    }
    if (f)
    {
        cout << "Yes" << endl;
        return 0;
    }
    cout << "No" << endl;
}

Measured memory_bytes: 3648
X[]={1,0,-1,0},Y[]={0,1,0,-1},s[19][19];char *D="RDLU";
main(x,y,i,j,z){
	x=y=5;
	for(j=1;j<=2*y+1;j++)for(i=1;i<=2*x+1;i++)s[i][j]=0;
	for(j=2;j<=2*y;getchar(),j++)
		for(i=(j&1)?2:3;i<2*x+1;i+=2){
			s[i][j]=getchar()-'0';
		}
	putchar('R');
	for(z=0,x=4,y=2;x!=2||y!=2;){
		z=(z+3)%4;
		for(;!s[x+X[z]][y+Y[z]];z=(z+1)%4);
		x+=X[z]*2,y+=Y[z]*2;
		putchar(D[z]);
	}
	puts("");exit(0);
}

Measured memory_bytes: 524
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

#define repd(i, a, b) for (ll i = (a); i < (b); i++)
#define rep(i, n) repd(i, 0, n)

using namespace std;

namespace mp = boost::multiprecision;
using Bint = mp::cpp_int;

using ll = long long;
ll mod = pow(10, 9) + 7;

template <typename T> void output(T, ll);
ll gcd(ll, ll);
ll lcm(ll, ll);
Bint comb(Bint, Bint);
void prime_map(map<ll, ll> &, ll);

int main() {
    // source
    deque<int> q;
    int n;
    cin >> n;
    int a[n];
    rep(i, n) { cin >> a[i]; }

    rep(i, n) {
        if (n % 2 == (i + 1) % 2) {
            q.push_front(a[i]);
        } else {
            q.push_back(a[i]);
        }
    }

    rep(i, n) { cout << q[i] << " "; }
    cout << endl;
    return 0;
}

Bint comb(Bint a, Bint b) {
    Bint ans = 1;

    if (a < b) {
        return 0;
    }

    rep(i, b) {
        ans *= a - i;
        ans /= i + 1;
    }

    return ans;
}

template <typename T> void output(T a, int precision) {
    if (precision > 0) {
        cout << setprecision(precision) << a << "\n";
    } else {
        cout << a << "\n";
    }
}

template <typename T> T min(T a, T b) {

    if (a < b) {
        return a;
    } else {
        return b;
    }
}

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

ll lcm(ll a, ll b) { return a * b / gcd(a, b); }

void prime_map(map<ll, ll> &m, ll num) {
    ll cache = num;
    repd(i, 2, sqrt(num) + 2) {
        if (num % i == 0) {
            if (m[i] == 0) {
                m[i] = 1;
            } else {
                m[i]++;
            }

            num /= i;
            break;
        }
    }

    if (cache == num) {
        if (m[num] == 0) {
            m[num] = 1;
        } else {
            m[num]++;
        }
        return;
    } else {
        prime_map(m, num);
    }
}


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

int main() {
  ll n, a, b; cin >> n >> a >> b;
  if ((b - a) % 2 == 0) cout << (b - a) / 2 << endl;
  else {
    ll tmp = (a + b - 1) / 2;
    cout << min(tmp, n - tmp) << endl;
  }
  
  return 0;
}


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

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

    int n, m;
    cin >> n >> m;

    map<int, int> penalty;
    map<int, int> is_ac;
    int res1 = 0;
    int res2 = 0;
    rep(i, m){
        int p;
        string s;
        cin >> p >> s;

        if(s=="WA") {
            if(!is_ac[p]) ++penalty[p];
        }
        else{
            is_ac[p] = 1;
        }
    }

    for(auto itr = is_ac.begin(); itr != is_ac.end(); ++itr){
        int p = itr->first;
        if(is_ac[p]) {
            ++res1;
            res2 += penalty[p];
        }
    }

    cout << res1 << " " << res2 << endl;


    return 0;
}

Measured memory_bytes: 9600
//g++ test.cpp -o test.out
//入出力：http://kaitei.net/cpp/iostream/
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <iomanip>
using namespace std;

int N;//頂点の数
int M;//辺の数
int a[28];
int b[28];
int ans = 0;

int num_of_egde[9] = {0,0,0,0,0,0,0,0,0};//i番目の頂点からいくつ辺が伸びているかをnum_of_egde[i]とする
int edge[9][28];//頂点iからいける点をedge[i]に一つずつ格納していく

void order_edge(){
	for(int i=0;i<M;i++){
		edge[a[i]][num_of_egde[a[i]]] = b[i];
		num_of_egde[a[i]]++;
		edge[b[i]][num_of_egde[b[i]]] = a[i];
		num_of_egde[b[i]]++;
	}
}

//present_nodeは現在どの頂点にいるかを表す
//頂点iを訪れたことがあるならばvisited_bitのiビット目は1
void search(int present_node,int visited_bit){
	if((visited_bit >> (present_node-1))&1){//現在の頂点にすでにきたことがあるならば
		return;//条件を満たさないので関数停止
	}
	visited_bit = visited_bit + (1 << (present_node-1));//きたことを記録
	if(visited_bit == ((1<<N)-1)){//すべての頂点を回ったならば
		ans++;
		return;
	}
	for(int i=0;i<num_of_egde[present_node];i++){
		search(edge[present_node][i],visited_bit);
	}
}

void solve(){
	order_edge();
	search(1,0);
}

int main(){
	cin >> N >> M;
	for(int i=0;i<M;i++) cin >> a[i] >> b[i];

	solve();

	cout << ans;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define pi M_PI
#define R cin>>
#define Z class
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1000000007,MAXL=1LL<<61,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<int,int> P;

void Main() {
  string s;
  R s;
  map<char,int> m;
  rep(i,s.size()) {
    m[s[i]]++;
  }
  tr(it,m) {
    if(it->S%2) {
      pr("No");
      return;
    }
  }
  pr("Yes");
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}


Measured memory_bytes: 256
#include<stdio.h>

#define N 8
#define FREE -1
#define NOTFREE 1
#define FALSE 2
#define TRUE 3

int row[N], col[N], dpos[2 * N - 1], dneg[2 * N - 1];
int X[N][N];

void initialize(void);
void printboard(void);
void recursive(int);

void initialize() {
  int i;

  for(i = 0; i < N; i++) {
    row[i] = FREE;
    col[i] = FREE;
  }

  for(i=0;i<2*N-1;i++) {
    dpos[i] = FREE;
    dneg[i] = FREE;
  }
}

void printboard() {
  int i, j;

  for(i = 0; i < N; i++)
    for(j = 0; j < N; j++)
      if(X[i][j] == TRUE) {
        if(row[i] != j)return;
      }

  for(i = 0; i < N; i++) {
    for(j = 0; j < N; j++) {
      if(row[i] == j)printf("Q");
      else printf(".");
    }
    printf("\n");
  }
}

void recursive(int i) {
  int j;

  if(i == N){
    printboard();
    return;
  }

  for(j = 0; j < N; j++) {
    if(NOTFREE == col[j] || NOTFREE == dpos[i+j] || NOTFREE == dneg[i-j+N-1])continue;
    row[i] =j;
    col[j] = dpos[i + j] = dneg[i - j + N - 1] = NOTFREE;
    recursive(i+1);
    row[i] = col[j] = dpos[i + j] = dneg[i - j + N - 1] = FREE;
  }
}
int main() {
  int i, j, k, r, c;

  initialize();

  for(i = 0; i < N; i++)
    for(j = 0; j < N; j++)
      X[i][j] = FALSE;

  scanf("%d", &k);
  for(i = 0; i < k; i++) {
    scanf("%d %d", &r, &c);
    X[r][c] = TRUE;
  }

  recursive(0);

  return 0;
}



Measured memory_bytes: 2144
memo=-1
n = int(input())
if n==0: 
    print("0")
    exit()
while n != 0:
    if n>0:
        i=1
        j=0
        while i<n:
            i|=i<<2
            j+=2
        n-=1<<j;
    else:
        i=2
        j=1
        while i<abs(n):
            i|=i<<2
            j+=2
        n+=1<<j;
    if memo != -1:
        for i in range(memo-j-1):
            print("0",end="")
    print("1",end="")
    memo=j
for i in range(memo):
    print("0",end="")
print("")


Measured memory_bytes: 3064
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) {
		StringBuilder sb =new StringBuilder();
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int r,c;
		String str;
		String strs[];
		try {
			str = br.readLine();
			strs=str.split(" ");
			r=Integer.parseInt(strs[0]);
			c=Integer.parseInt(strs[1]);
			int total[]=new int[c+1];
			for(int i=0;i<r;i++){
				int sum=0;
				str=br.readLine();
				strs=str.split(" ");
				for(int j=0;j<c;j++){
					sum+=Integer.parseInt(strs[j]);
					total[j]+=Integer.parseInt(strs[j]);
					sb.append(strs[j]).append(" ");
				}
				total[c]+=sum;
				sb.append(sum);
				sb.append("\n");
			}
			for(int i=0;i<c+1;i++){
				if(i != 0){
					sb.append(" ");
				}
				sb.append(total[i]);
			}
			System.out.println(sb);
		} catch (Exception e) {
			System.err.println(e);
		}

	}

}

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

using namespace std;
typedef long long ll;
typedef long double ld;
#define X first;
#define Y second;
typedef pair<int,int> pii;
typedef pair<ll,int> pli;
typedef pair<ll,ll> pll;
const ll INF = 2e18;
const int inf = 1e9+10;
const int maxN = 1e5 + 10;
const int maxK = 1e4+10;
const int maxD = 15;
const int maxH = 100; 
const int MOD = 998244353;

ll AbsMin(ll x,ll y)
{
	if(abs(y) < abs(x))
	{
		return y;
	}
	else
	{
		return x;
	}
}
int main()
{
	ll x,k,d;
	scanf("%lld%lld%lld",&x,&k,&d);
	ll ans = 2e15;
	if (k%2 == 0)
	{
		ll len = 2*d;
		ll g = k/2;
		
		if(x < 0)
		{
			ll y = -x;
			ll cnt = y/len;
			cnt = min(cnt,g);
			x += cnt * len;
			if(g - cnt > 0)
			{
				ans = AbsMin(x,x+len);
			}
			else
				ans = x;
		}
		else if(x >= 0)
		{
			ll y = x;
			ll cnt = y/len;
			cnt = min(cnt,g);
			x -= cnt*len;
			if(g - cnt > 0)
			{
				ans = AbsMin(x,x-len);
			}
			else
				ans = x;
		}
	}
	else if (k%2 == 1)
	{
		ll len = 2*d;
		ll g = k/2;
		
		if(x < 0)
		{
			x += d;
		}
		else if(x >= 0)
		{
			x -= d;
		}
		if(x < 0)
		{
			ll y = -x;
			ll cnt = y/len;
			cnt = min(cnt,g);
			x += cnt * len;
			if(g - cnt > 0)
			{
				ans = AbsMin(x,x+len);
			}
			else
				ans = x;
		}
		else if(x >= 0)
		{
			ll y = x;
			ll cnt = y/len;
			cnt = min(cnt,g);
			x -= cnt*len;
			if(g - cnt > 0)
			{
				ans = AbsMin(x,x-len);
			}
			else
				ans = x;
		}
	}
	printf("%lld\n",abs(ans));
	return 0;
}

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

const int maxn=700+10;
int n,m,ans,type[maxn];
bool g[maxn][maxn];
vector<int> vec,dp;

void dfs(int pos,int t,int&a,int&b){
	type[pos]=t;
	if(t==1)
		++a;
	else
		++b;
	for(int i=1;i<=n;++i)
		if(g[pos][i])
			if(type[i])
				if(type[i]==type[pos]){
					puts("-1");
					exit(0);
				}
				else
					;
			else
				dfs(i,-t,a,b);
}

int main(){
	cin>>n>>m;
	for(int i=1;i<=n;++i)
		for(int j=1;j<=n;++j)
			g[i][j]=i!=j;
	while(m--){
		int u,v;
		cin>>u>>v;
		g[u][v]=g[v][u]=false;
	}
	for(int i=1;i<=n;++i)
		if(!type[i]){
			int a=0,b=0;
			dfs(i,1,a,b);
			vec.push_back(abs(a-b));
		}
	dp.push_back(0);
	for(int i=0;i<vec.size();++i){
		vector<int> tmp;
		for(int j=0;j<dp.size();++j){
			tmp.push_back(abs(dp[j]-vec[i]));
			tmp.push_back(dp[j]+vec[i]);
		}
		sort(tmp.begin(),tmp.end());
		tmp.erase(unique(tmp.begin(),tmp.end()),tmp.end());
		dp=tmp;
	}
	int sizea=(n+dp.front())/2,sizeb=(n-dp.front())/2;
	cout<<sizea*(sizea-1)/2+sizeb*(sizeb-1)/2<<endl;
	return 0;
}

Measured memory_bytes: 768
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; ++i)
#define REPP(i, n) for(int i = 1; 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()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1000000007;
const ll INF = 1000000000;

int main() {
    int n,d; cin >> n >> d;
    int ans = n/(2*d + 1) + (n%(2*d + 1)!=0);
    cout << ans << endl;
    return 0;
}

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

#include <cmath>
using namespace std;
int main()
{

const double PI = 3.141592654;
   float n;
    cin>>n;
    n=2*PI*n;
    cout<<fixed<<setprecision(15)<<n<<endl;


    return 0;
}


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

using namespace std;

int main(){
  int n;


  while(1){
    int ans =0;
    cin >> n;
    if(n == 0){
      //cout << " n " << n <<endl;
      break;
    }
    
    for(int i = n; i > 0 ; i -= 2){
      
      string str1, str2;
      str1 = str2 = "null";
      /* if(i == 1){
        cin >> str1 >> str2;
      }else{
        cin >> str1 ;
        } */

      if ( n%2 == 1 && i == 1 ) {
        cin >> str1;
        break;
      }

      cin >> str1 >> str2;

      if(str1 == "lu" && str2 == "ru"){
        ans++;
      }
      if(str1 == "ru" && str2 == "lu"){
        ans++;
      }
      if(str1 == "ld" && str2 == "rd" ){
        ans++;
      }
      if(str1 == "rd" && str2 == "ld"){
        ans++;
      }
    }

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



Measured memory_bytes: 3172
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define int long long
using namespace std;
typedef vector<int>   vint;
typedef pair<int,int> pint;

signed main()
{
    int N,K; cin>>N>>K;
    vint a(N);
    REP(i,N) cin>>a[i];

    int ans=1+((N-K)+(K-2))/(K-1);
    cout<<ans<<endl;
}


Measured memory_bytes: 1024
main :: IO ()
main = do
  [n, k] <- map read . words <$> getLine :: IO [Int]
  ds <- map ('R' ==) . head . words <$> getContents :: IO [Bool]
  let
    s = length . filter id . (zipWith (==) <$> id <*> tail) $ ds :: Int
  print $ (s + 2 * k) `min` (n - 1)


Measured memory_bytes: 4980
n, k = map(int, input().split())
r, s, p = map(int, input().split())
t = input()

table = [-1 for i in range(len(t) + k)]
count = 0
for i in range(len(t)):
    if table[i-k] != -1 and table[i-k] == t[i]:
        continue
    elif t[i] == "r":
            count += p
            table[i] = "r"
    elif t[i] == "s":
            count += r
            table[i] = "s"
    elif t[i] == "p":
            count += s
            table[i] = "p"

print(count)

Measured memory_bytes: 4724
import sys
input=sys.stdin.readline
import math

def get_edges_include_node(i, Edges): # 頂点 i を含む辺のリストを返す
    es = []
    for e in Edges:
        if i in e:
            es.append(e)
    return es

def dfs(i, e0, goal, Edges): # 頂点 i から頂点 j にたどり着けるかどうか
    if e0 in Edges:
        Edges.remove(e0)
    for e1 in get_edges_include_node(i, Edges):
        if goal in e1:
            return True
        else:
            ni = e1[1] if e1[0] == i else e1[0]
            if dfs(ni, e1, goal, Edges):
                return True                
    return False
def main():

    N,M = map(int, input().split())
    Edges = []
    for _ in range(M):
        a,b = map(int, input().split())
        Edges.append((a,b))
    ans = 0
    for e in Edges:
        tmp = []
        for e2 in Edges:
            tmp.append((e2[0], e2[1]))
        if not dfs(e[0], e, e[1], tmp):
            ans += 1
    print(ans)


if __name__ == '__main__':
    main()


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

int main() {
	int A, P;
	cin >> A >> P;
	int ans;
	ans = 3*A + P;
	cout << ans/2 << endl;
	return 0;
}


Measured memory_bytes: 3556
import java.util.*;
class Main{
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int h=in.nextInt(),w = in.nextInt();
        in.nextLine();
        StringBuilder pad = new StringBuilder();
        for(int i=0;i<w+2;i++) pad.append("#");
        System.out.println(pad);
        for(int i=0;i<h;i++){
            String temp = in.nextLine();
            System.out.println("#"+temp+"#");
        }
        System.out.println(pad);
    }
}

Measured memory_bytes: 21844
#include<stdio.h>

int main(){
	int N;
	scanf("%d",&N);
	if(N==25) printf("Christmas\n");
	else if(N==24) printf("Christmas Eve\n");
	else if(N==23) printf("Christmas Eve Eve\n");
	else if(N==22) printf("Christmas Eve Eve Eve\n");
	return 0;
}

Measured memory_bytes: 128
#include <cstdio>
#include <climits>
#include <iostream>
#include <algorithm>
#include <string>
#include <cstdio>
#include <climits>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <utility>
#include <queue>
#include <cstring>
#define rep(i, n) for (int i = 0; i < int(n); i++)
using namespace std;
long long MOD = 1000000007;
long long INF = 1000000000000000;
#define MAX_V 330

typedef long long ll;

int main(void) {
  int a, b;
  cin >> a >> b;
  if (a <= 9 && b <= 9) cout << a * b << endl;
  else cout << -1 << endl;

  return 0;
}


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

using namespace std;

int main() {
    std::ios::sync_with_stdio(false); 
    cin.tie(nullptr);
    
    int n1, n2, n3, n4;
    cin >> n1 >> n2 >> n3 >> n4;
    set<int> s{n1, n2, n3, n4};
    if (s.count(1) && s.count(7) && s.count(9) && s.count(4)) {
        cout << "YES\n";
    } else {
        cout << "NO\n";
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pi;
const int inf = 1000000000;
int main(){
	set<ll>arr;
	set<ll>::iterator it,jt;
	arr.insert(0);
	arr.insert(1);
	ll start = 2;
	while(1){
		ll curr = pow(start,5);
		it = arr.end();
		it--;
		if(curr-*it>inf) break;
		arr.insert(curr);
		start++;
	}
	ll x;
	cin>>x;
	for(jt = arr.begin(); jt!=arr.end(); jt++){
		long long a_5 = *jt;
		long long b_5 = a_5-x;
		if(b_5>=0){
			it = arr.find(b_5);
			if(it!=arr.end()){
				cout<<pow(a_5,0.2)<<" "<<pow(b_5,0.2);
				return 0;
			}
		}
		else{
			it = arr.find(b_5*-1);
			if(it!=arr.end()){
				cout<<pow(a_5,0.2)<<" "<<pow(b_5*-1,0.2)*-1;
				return 0;
			}
		}
	}
}

Measured memory_bytes: 4260
/*
    author: Salam_35
    Created at :

*/

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

#define ll long long int
#define pb push_back
#define sc(n) scanf("%d",&n)
#define Max 100005
#define scan(n) scanf("%lld",&n)
#define pi acos(-1.0)
#define _fastio  ios_base:: sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ALL(x) x.begin(),x.end()
#define sci(n) scanf("%d",&n);
#define scl(n) scanf("%lld",&n);
#define load(array,size)  for(ll i=0 ; i<size ; i++) cin>>array[i] ;
#define load1(array,size)  for(ll i=1 ; i<=size ; i++) cin>>array[i] ;
#define INF	1LL<<19
#define pll pair<ll,ll>
#define mst(arr,value) memset(arr,value,sizeof(arr));
#define tst() int testsalam;cin >> testsalam;while(testsalam--)
#define Mod 100000007
#define YES cout<<"Yes"<<endl;
#define NO cout<<"No"<<endl;
#define endl '\n'
//void inversemod(ll n, ll mod, ll invmod[],ll MOD){for(int i=2; i<=n; ++i) invmod[i]=MOD-MOD/i*invmod[MOD%i]%MOD;}
//void bigmod( ll a, ll b ,ll mod){ll r = 1;a = a%mod;while(b){if( b%2 ) r = (r*a)%mod;b = b/2;a = (a*a)%mod; }return (ll)r;}

typedef vector<ll>vec;
typedef pair<ll,ll> pii;
typedef map<ll,ll>mpll;
typedef set<ll>seet;

int main()
{
    ll a,b,n;
    cin >> a >> b >> n;
    if(n<b)
    {
    	cout<<((a*n)/b)-(a*(n/b))<<endl;
    }
    else 
    	n=b-1,cout<<((a*n)/b)-(a*(n/b))<<endl;
}


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

int main(){
	string ans[] = {"Bob", "Draw", "Alice"};
	int a, b;
	cin >> a >> b;
	a = a == 1 ? 14 : a;
	b = b == 1 ? 14 : b;
	cout << ans[(a > b) + (a >= b)] << endl;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T> V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> > Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T> mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }

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

/*starry sky tree
 add(O(logN)):区間[a, b)に値xを加算する
 getMin(O(logN)): 区間の最小値を得る
 */
static const int MAX_SIZE = 1 << 17;
typedef long long ll;
ll segMin[2 * MAX_SIZE - 1], segAdd[2 * MAX_SIZE - 1];

void add(int a, int b, int x, int k = 0, int l = 0, int r = MAX_SIZE){
    if (r <= a || b <= l) return; //もし交差しない区間であれば終える.
    
    if (a <= l && r <= b){ //もし今みている区間[l, r)が[a, b)に完全に内包されていれば
        segAdd[k] += x;  //区間[l, r)にkを加算する.
        return;
    }
    
    //子の区間に(必要があれば)xを加算する.
    add(a, b, x, k * 2 + 1, l, (l + r) / 2);
    add(a, b, x, k * 2 + 2, (l + r) / 2, r);
    
    //親の区間の最小値は, 子の区間の最小値 + 自分に一様に加算されている値 である.一様に加算される値は更新しなくて良い.
    segMin[k] = min(segMin[k * 2 + 1] + segAdd[k * 2 + 1], segMin[k * 2 + 2] + segAdd[k * 2 + 2]);
}

ll getMin(int a, int b, int k = 0, int l = 0, int r = MAX_SIZE){
    if (r <= a || b <= l) return (LLONG_MAX);
    if (a <= l && r <= b) return (segMin[k] + segAdd[k]); //完全に内包されていれば,その区間の最小値を返す.
    
    ll left = getMin(a, b, k * 2 + 1, l, (l + r) / 2); //子の区間の最小値を求める.
    ll right = getMin(a, b, k * 2 + 2, (l + r) / 2, r); //子の区間の最小値を求める
    
    //親の区間の最小値は, 子の区間の最小値 + 自分に一様に加算されている値
    return (min(left, right) + segAdd[k]);
}

int main(void) {
    cin.tie(0); ios::sync_with_stdio(false);
    int n,q; cin >> n >> q;
    
//    SegTree ST(n);
//    BIT bit(n);
    while(q--){
        int com; cin >> com;
        if(com == 0){
            int s,t,x; cin >> s >> t >> x;
           // ST.update(s-1,t,x);
            add(s-1,t,x);
        }else{
            int i; cin >> i;
            //cout << ST.query(i-1,i) << endl;
            cout << getMin(i-1,i) << endl;
        }
    }
    
    return 0;
}



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

int main(){
    int n,k;
    cin>>n>>k;
    vector<int>a(n);
    rep(i,n)cin>>a[i];
    sort(a.begin(),a.end());
    int sum=0;
    rep(i,k)sum+=a[i];
    cout<<sum<<endl;
}

Measured memory_bytes: 3600
#include <iostream>
#include <string>

int main(){

	const std::string correct_word = "Hoshina";
	const std::string find_word = "Hoshino";
	
	int N;

	std::cin >> N;
	std::cin.ignore();

	for(int i = 0; i < N; ++i){
	
		std::string str;
		std::getline(std::cin,str);

		std::string::size_type pos = str.find(find_word);
		
		while(pos != std::string::npos){

			 str.replace(pos, find_word.length(), correct_word);

			 pos = str.find(find_word, pos + find_word.length());
		}
	
		std::cout << str << std::endl;
	
	}
	return 0;
}

Measured memory_bytes: 1220
#include <bits/stdc++.h>
using namespace std;
string s;
int main(){
	cin>>s;
	int x = s[0] - '0';
	x = x * 100 + x * 10 + x;
	int y = (s[0] - '0') * 100 + (s[1] - '0') * 10 + (s[2] - '0');
	if(x < y)cout<<x + 111;
	else cout<<x;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i,n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i,a,b) for (ll i=(a);i<(ll)b; i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define INF 1000000000000000
#include <iomanip>
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll,ll> p;
constexpr int MOD = 1000000007;

void print(const std::vector<int>& v)
{
  std::for_each(v.begin(), v.end(), [](int x) {
    std::cout << x << " ";
  });
  std::cout << std::endl;
}

int main ()
{
  int N;cin>>N;
  if (N>= 1000){
    cout<<"ABD"<<endl;
    return 0;
  }
  cout<<"ABC"<<endl;
  
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define ALL(obj)   (obj).begin(),(obj).end()

#define debug(var)  do{std::cout << __LINE__ << "> " << #var << ": ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }

using namespace std;
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;

void Main() {
	int x; cin >> x;
	cout << (int)pow(x, 3) << endl;
}

int main() {
    cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
}



Measured memory_bytes: 3304
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
ll M=1e9+7;


class DS{
    public:
    vector<ll > parent;
    vector<ll > nodes;
    DS(ll n){
        parent.resize(n+1);
        nodes.resize(n+1);
        for(ll i=0;i<=n;i++){parent[i]=i;nodes[i]=1;}
    }
    void join(ll a,ll b){
        ll x=findparent(a),y=findparent(b);
        if(x==y)return;
        parent[x]=y;
        nodes[y]+=nodes[x];
    }
    ll findparent(ll a){
        if(a==parent[a])return a;
        parent[a]=findparent(parent[a]);
        return parent[a];
    }
 };
 
 
int main()
{
	ll n,m;
	cin>>n>>m;
	map<pair<ll,ll> ,ll > map1;
	DS ds(n);
	for(ll i=1;i<=m;i++){
		ll a,b;
		cin>>a>>b;
		if(a>b) swap(a,b);
		if(map1.find({a,b})==map1.end()){
			ds.join(a,b);
		}
		map1[{a,b}]=1;
	}
	
	ll ans=1;
	for(ll i=1;i<=n;i++){
		ans=max(ans,ds.nodes[i]);
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 18836
#include <iostream>
using namespace std;
int main(){
    int ans[4][2]={0};
    double l,r;
    while (1) {
        cin>>l>>r;
        if(cin.eof())break;
        if(l>=1.1)ans[0][0]++;
        else if(l>=0.6)ans[1][0]++;
        else if(l>=0.2)ans[2][0]++;
        else ans[3][0]++;
        if(r>=1.1)ans[0][1]++;
        else if(r>=0.6)ans[1][1]++;
        else if(r>=0.2)ans[2][1]++;
        else ans[3][1]++;
    }
    for (int i=0; i<4; i++) {
        cout<<ans[i][0]<<" "<<ans[i][1]<<endl;
    }
    return 0;
}

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

int main(){
    double n;
    cin >> n;
    double result = ceil(n / 1.08);

    if (floor(result * 1.08) == n) {
        cout << ceil(result) << endl;
    }
    else { cout << ":(" << endl; }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
#define ms(s,x) memset(s,x,sizeof(s))
#define pb push_back
#define pf push_front
#define mp make_pair
#define inf 0x3f3f3f3f
typedef long long ll;
using namespace std;

const double PI = acos(-1.0);
const double eps = 1e-8;
const int MAXN = 1e5+5;
const ll MOD = 1e9+7;

int main()
{
    vector <int> vec;
    stack <pair<int, int>> stk;
    pair <int, int> p;
    int ans = 0, cnt = 0;
    string str;
    cin >> str;
    int len = str.size();
    rep(i, 0, len-1)
    {
        if (str[i] == '\\')
        {
            stk.push(mp(i, 0));
            cnt++;
        }
        if (str[i] == '/' && !stk.empty() && cnt)
        {
            int sum = 0;
            while (stk.size() > 1 && stk.top().second)
            {
                sum += stk.top().second;
                stk.pop();
            }
            p = stk.top();
            stk.pop();
            sum += i-p.first;
            p.second = sum;
            stk.push(p);
            cnt--;
        }
    }
    while (!stk.empty())
    {
        p = stk.top();
        if (p.second)
        {
            ans += p.second;
            vec.pb(p.second);
        }
        stk.pop();
    }
    cout << ans << endl;
    cout << vec.size();
    per(i, vec.size()-1, 0)
    {
        cout << ' ' << vec[i];
    }
    cout << endl;

    return 0;
}



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

using namespace std;

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

template<typename A, typename B> bool chmin(A &a, const B &b){ return b < a && (a = b, true); }
template<typename A, typename B> bool chmax(A &a, const B &b){ return a < b && (a = b, true); }

int main() {
  string s,s1,t,t1,u,u1;
  int n;
  cin >> s;
  n = s.size();
  for (int i = 0; i < n/2; i++){
    t += s[i];
  }
  for (size_t i = n/2+1; i < n; i++){
    u += s[i];
  }
  t1 = t;
  u1 = u;
  s1 = s;
  reverse(t.begin(), t.end());
  reverse(u.begin(), u.end());
  reverse(s.begin(), s.end());
  if (s == s1 && t == t1 && u == u1){
    cout << "Yes\n";
  }
  else{
    cout << "No\n";
  }
  
  return 0;
}



Measured memory_bytes: 3616
# -*- coding: utf-8 -*-

c_500 = int(input())
c_100 = int(input())
c_50 = int(input())
how = int(input())

count = 0
for i in range(c_500 + 1):
    for j in range(c_100 + 1):
        for k in range(c_50 + 1):
            if i*500 + j*100 + k*50 == how:
                count += 1
print(count)

Measured memory_bytes: 3060
import math
N, D = map(int, input().split(' '))
X_ls = []
cnt = 0
 
for i in range(N):
    X_ls.append(list(map(int, input().split(' '))))

for i in range(N - 1):
    for j in range(i+1, N):
        dist_squared, dist = 0, 0
        for y, z in zip(X_ls[i], X_ls[j]):
            dist_squared += (y - z) ** 2
        dist = math.sqrt(dist_squared)
        if dist - math.floor(dist) == 0:
            cnt += 1
print(cnt)

Measured memory_bytes: 9172
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N = int(input())
    A = [int(x) for x in input().split()]

    A.sort()

    B = [0] * (A[-1] + 1)

    ans = 0
    for i, a in enumerate(A):
        if B[a] == 1:
            continue
        for aa in range(a, len(B), a):
            B[aa] = 1

        if i != len(A) - 1 and A[i] == A[i + 1]:
            continue

        ans += 1

    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 31312
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int num;
  cin >> num;
  string c = "YES";
  vector<int> vec(num);
  for(int i=0; i<num; ++i){
    cin >> vec[i];
  }
  sort(vec.begin(),vec.end());
 
  for(int m=0; m+1<num; m++){
    if(vec[m] == vec[m+1]){
      c="NO"; break;
    }
  }
  cout << c << endl;
  return 0;
}

Measured memory_bytes: 1024
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_set>
#include<unordered_map>
#include<bitset>
#include<iomanip>
#include<list>
#include<deque>
using namespace std;
//#define MODE 1
#ifdef MODE
#define DEB(X) cout<< #X <<": "<<X<<" ";
#define END cout<<endl;
#else
#define DEB(X) {}
#define END {}
#endif
typedef long long ll;
#define int ll
#define uset unordered_set
#define umap unordered_map
typedef std::pair<int,int> P;
struct edge{int to,cost;};
const int INF=100000000000000000;
const int INF2=9223372036854775807;
const int MOD=1000000007;
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define min(X,Y) (((int)(X)<(int)(Y))?(X):(Y))
#define max(X,Y) (((int)(X)>(int)(Y))?(X):(Y))
#define MAX(X,Y) (*max_element(X,Y))
#define MIN(X,Y) (*min_element(X,Y))
#define NP(X,Y) next_permutation(X,Y)
#define setp(X,Y) cout<<fixed<<setprecision(Y)<<X;
int ceil2(int a,int b){if(a%b==0){return a/b;}else{return a/b+1;}}
int pow2(int a,int b){int r=1;for(int i=1;i<=b;i++){r*=a;}return r;}
int Log2(int a){int t=0;while(1){if(a==0||a==1){break;}a/=2;t++;}return t;}

int N,L;
int d[110][110];

int nCr(int n, int r) {
	if(n==0)return 1;
	if(n<r)return 0;
	if(r*2>n)r=n-r;
	int dividend=1;
	int divisor=1;
	for (int i=1;i<=r;i++){
		dividend*=(n-i+1);
		divisor*=i;
	}
	return dividend/divisor;
}

signed main(){
	cin>>N>>L;
	int R=nCr(N-1,2);
	if(L>R){
		cout<<-1<<endl;
		return 0;
	}
	for(int i=1;i<N;i++){
		d[0][i]=1;
	}
	R=R-L;
	REP(j,N){
		REP(i,j){
			if(R<=0)break;
			if(i==0)continue;
			d[i][j]=1;
			R--;
		}
	}
	int M=0;
	REP(j,N){
		REP(i,N){
			if(d[i][j]==1){
				M++;
			}
		}
	}
	cout<<M<<endl;
	REP(j,N){
		REP(i,N){
			if(d[i][j]==1){
				cout<<i+1<<" "<<j+1<<endl;
			}
		}
	}
	return 0;
}


Measured memory_bytes: 384
from math import*
n=int(input())
a=list(map(int,input().split()))
b=[a[0]]
c=[a[-1]]
for i in range(1,n):
  b+=[gcd(b[-1],a[i])]
  c+=[gcd(c[-1],a[-i-1])]
ans=0
c=c[::-1]
for i in range(n):
  if i==0:ans=max(ans,c[i+1])
  elif i==n-1:ans=max(ans,b[i-1])
  else:
    ans=max(ans,gcd(c[i+1],b[i-1]))
print(ans)

Measured memory_bytes: 90908
<?php

class LowLinks {
    private $edges, $root, $ord, $low, $cnt, $bridges, $articulations, $par;

    function __construct($edges, $v, $root=0) {
        $this->edges = $edges;
        $this->root = $root;
        $this->ord = array_fill(0, $v, null);
        $this->low = array_fill(0, $v, null);
        $this->cnt = 0;
        $this->bridges = [];
        $this->articulations = [];
        $this->par = array_fill(0, $v, null);
    }

    function getArticulations() {
        return $this->articulations;
    }

    function getBridges() {
        return $this->bridges;
    }

    function build() {
        $this->search($this->root);
    }

    function search($node) {
        $this->ord[$node] = $this->cnt;
        $this->low[$node] = $this->cnt;
        $this->cnt++;
        $dim = 0;
        foreach($this->edges[$node] as $to) {
            if ($to === $this->par[$node]) continue;
            if ($this->ord[$to] === null) {
                $this->par[$to] = $node;
                $this->search($to);
                $dim++;
                $this->low[$node] = min($this->low[$node], $this->low[$to]);
                if ($node != $this->root and $this->ord[$node] <= $this->low[$to]) {
                    $this->articulations[] = $node;
                }
            } else {
                $this->low[$node] = min($this->low[$node], $this->ord[$to]);
            }

            if ($node == $this->root and $dim > 1) {
                $this->articulations[] = $node;
            }

            if ($this->ord[$node] < $this->low[$to]) {
                $this->bridges[] = [$node, $to];
            }
        }
    }
}

function compBridge($bridge1, $bridge2) {
    $u1 = min($bridge1);
    $v1 = max($bridge1);
    $u2 = min($bridge2);
    $v2 = max($bridge2);
    if ($u1 < $u2) {
        return -1;
    } elseif ($u1 > $u2) {
        return 1;
    } else {
        if ($v1 < $v2) {
            return -1;
        } elseif ($v1 > $v2) {
            return 1;
        } else {
            return 0;
        }
    }
}

list($v, $e) = explode(" ", trim(fgets(STDIN)));
$edges = array_fill(0, $v, []);
for ($i = 0; $i < $e; $i++) {
    list($s, $t) = explode(" ", trim(fgets(STDIN)));
    $edges[(int)$s][] = (int)$t;
    $edges[(int)$t][] = (int)$s;
}

$lowlinks = new LowLinks($edges, $v, 0);
$lowlinks->build();

/*** print articulations
$articulations = array_unique($lowlinks->getArticulations());
sort($articulations);
foreach($articulations as $art) {
    echo $art . "\n";
}
*/

$bridges = $lowlinks->getBridges();
usort($bridges, "compBridge");
foreach($bridges as $bridge) {
    echo min($bridge) . " " . max($bridge) . "\n";
}




Measured memory_bytes: 50636
#include <cstdio>
#include <algorithm>
 
using namespace std;
 
int A[200500];
 
int main()
{
	int Test=1; while (Test--){
    int n; scanf("%d", &n);
    for(int i = 1; i <= n; i++) {
      int a; scanf("%d", &a); 
      A[i] = a;
    }
 
    long long ans = 0;
 
    int cur = 0;
    for(int i = 1, j = 1; i <= n; i++) { // (i, j)가 유효
      while(j <= n && (cur & A[j]) == 0) cur |= A[j++];
      ans += j - i;
      cur ^= A[i];
    }
 
    printf("%lld\n", ans);
	}
 
	return 0;
}

Measured memory_bytes: 896