akhauriyash/Code-Regression huggingface dataset:
/*
* @Author: Nguyen Quoc Cuong
* @Mail : 97quoccuong@gmail.com
* @Created at:   2018-10-24 14:39:59
* @Last Modified time: 2018-10-24 15:04:56
*/

#include <bits/stdc++.h>

#define mp make_pair
#define fi first
#define se second
#define pb push_back

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) x.size()

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define repd(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define repd1(i, n) for (int i = (int)(n);i; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)
#define ford(i, a, b) for (int i = (int)(a); i >= (int)(b); --i)

#define debug(a) cout << #a << " : " << a << endl
#define debuga(a,l,r) fore(i,l,r) cout << a[i] << ' ';cout << endl;
#define put(x) cout << (x) << endl;exit(0);

using namespace std;

typedef double ld;
typedef long long i64;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;

template<class T> bool umin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool umax(T &a, T b) { return a < b ? (a = b, true) : false; }
template<class T> T min(T a, T b, T c) { return min(a,min(b,c)); }
template<class T> T max(T a, T b, T c) { return max(a,max(b,c)); }

const i64 linf = 2e17;
const int inf = 2e9;
void Fan_chipu();
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(10);
  cout << fixed;
  Fan_chipu();
}
/*====================================================== END ==============================================*/
const int maxn = 3e5 + 7;

/*------------------------------------- */ void Fan_chipu() {
  int n,m,x,y;
  cin >> n >> m >> x >> y;
  vi a(n),b(m);
  rep(i,n) cin >> a[i];
  rep(i,m) cin >> b[i];
  sort(all(a));
  sort(all(b));
  if(a.back() < y and b[0] > x and a.back() < b[0]) cout << "No War";
  else  cout << "War";
}

Measured memory_bytes: 256
// Problem: D - Friends
// Contest: AtCoder - AtCoder Beginner Contest 177
// URL: https://atcoder.jp/contests/abc177/tasks/abc177_d
// Memory Limit: 1024 MB
// Time Limit: 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;

#define int long long
#define endl "\n"
#define deb(x) cout << #x << " -> " << x << endl;
#define print(x)                         \
    for (auto x_ : x) cout << x_ << " "; \
    cout << endl;
#define pb push_back
#define all(x) x.begin(), x.end()
#define mod 1000000007  // 1e9 + 7
#define prec(x, y) fixed << setprecision(y) << x

const int N = 2 * ((int)1e5) + 9;
vector<int> graph[N];
int color[N] = {};
int comp_count = 0;

void dfs(int src) {
    color[src] = 1;
    ++comp_count;
    for (auto &nbr : graph[src]) {
        if (!color[nbr]) {
            dfs(nbr);
        }
    }
}

void solve() {
    int n, m;
    cin >> n >> m;
    for (int i = 0; i < m; ++i) {
        int u, v;
        cin >> u >> v;
        --u;
        --v;
        graph[u].push_back(v);
        graph[v].push_back(u);
    }
    int ans = INT_MIN;

    for (int i = 0; i < n; ++i) {
        if (!color[i]) {
            dfs(i);
        }
        ans = max(ans, comp_count);
        comp_count = 0;
    }

    cout << ans << endl;
}

int32_t main() {
    ios::sync_with_stdio(0);
    cout.tie(0);
    cin.tie(0);

    int tc = 1;
    // cin >> tc;
    while (tc--) {
        solve();
    }
}

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

int main() {
  int n;
  cin>>n;
  vector<int>a(n);
  for(int i=1;i<n;i++){
    cin>>a[i];
  }
  vector<int>number(n);
  for(int i=1;i<n;i++){
    int x=a[i];
    number[x-1] ++;
  }
  for(int i=0;i<n;i++){
  cout <<number[i]<<endl;
  }
}


Measured memory_bytes: 4844
//#include <stdio.h>
#include <math.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <queue>
#include <map>
#include <utility>
#include <iomanip>

using namespace std;

#define ll long long

void solve()
{
    string S;
    cin >> S;
    ll len = S.size();
    ll halflen = len / 2;
    string a = S.substr(0, halflen);
    string b = S.substr(len - halflen, halflen);
    ll hug = 0;
    for (ll i = 0; i < halflen; i++)
    {
        if (a[i] != b[halflen - i - 1])
        {
            hug++;
        }
    }
    cout << hug << endl;

    return;
}

int main()
{
    solve();
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int N=5e5;

  int a[N],r[N];
int cmp(int x,int y)
{
  return a[x]<a[y];
}

  int n,A;
int main()
{
  cin>>n;
  for (int i=0;++i<=n;)
    scanf("%d",a+i),
		r[i]=i;
  sort(r+1,r+n+1,cmp);
  for (int i=0;++i<=n;)
    A+=r[i]&1^i&1;
  cout<<A/2;
  exit(0);
}


Measured memory_bytes: 1024
package main

import(
    "fmt"
)



func main() {
    var n int
    fmt.Scan(&n)
    ans := "No"
    if n/100 == n%10 {
        ans = "Yes"
    }
    fmt.Println(ans)
}





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

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

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

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

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

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

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

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

func scanNums(len int) (nums []int){
    var num int
    for i:=0; i<len; i++{
        fmt.Scan(&num)
        nums = append(nums,num)
    }
    return
}

func scanNums64(len int) (nums []int64){
    var num int64
    for i:=0; i<len; i++{
        fmt.Scan(&num)
        nums = append(nums,num)
    }
    return
}

func scanString(len int) (str []string){
    var s string
    for i:=0; i<len; i++{
        fmt.Scan(&s)
        str = append(str,s)
    }
    return
}

func scanTwoNums(n,m int) ([][]int){
    Nums := make([][]int, n)
    for i:=0; i<n; i++{
        Nums[i] = make([]int, m)
    }
    return Nums
}


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

int main(){
	string s, t;
  	cin >> s >> t;
  
  	int cnt = 0;
  	rep(i, s.size()){
    	if(s[i] != t[i]) cnt++;
    }
  
  	cout << cnt << endl;
}

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

// エイリアス
using  ll = long signed long;
using ull = long unsigned long;
using  ld = long double;
using   P = pair<int, int>;
using llP = pair<ll, ll>;
using DoP = pair<double, double>;

// 汎用マクロ
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define FOREACH(i,q) for (auto &i : q)
#define UNIQUE(v) do { sort((v).begin(), (v).end()); (v).erase(unique((v).begin(), (v).end()), (v).end()); } while (false)
#define SZ(x) ((int)(x).size())
template <class T>inline bool chmin(T &a, const T b) {if (a > b) { a = b; return true;} return false;}
template <class T>inline bool chmax(T &a, const T b) {if (a < b) { a = b; return true;} return false;}
template <class T>inline void line_out(const vector<T> vec) {int n = SZ(vec); rep(i, n) { cout << vec[i]; if(i < n-1) cout << " ";}cout << endl;}
const int di[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dj[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int INF = 1 << 28;
const ll INF64 = 1ll << 60;
const int mod = 1000000007;
//const int mod = 998244353;
struct mint
{
  ll x; // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a)
  {
    if ((x += a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator-=(const mint a)
  {
    if ((x += mod - a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator*=(const mint a)
  {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const
  {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const
  {
    mint res(*this);
    return res -= a;
  }
  mint &operator++()
  {
    if ((x += 1) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator--()
  {
    if ((x += mod - 1) >= mod)
      x -= mod;
    return *this;
  }
  mint operator*(const mint a) const
  {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const
  {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const
  {
    return pow(mod - 2);
  }
  mint &operator/=(const mint a)
  {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const
  {
    mint res(*this);
    return res /= a;
  }
};


int main()
{
  int n, m; cin >> n >> m;
  vector<int> a(n);
  rep(i, n) cin >> a[i];
  int sum = accumulate(ALL(a), 0);
  sort(RALL(a));
  if(a[m-1]*4*m >= sum) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 3600
//url:
//problem name: 

#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); ++i)
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;
using ll = long long;
using P = pair<int,int>;
using Pl = pair<long long,long long>;
using veci = vector<int>;
using vecl = vector<long>;
using vecveci = vector<vector<int>>;
using vecvecl = vector<vector<long long>>;

const int MOD = 1000000007;

int main() {
    int N; cin >> N;
    ll ans = 1;
    for(int i = 1; i <= N; i++) {
        ans *= i;
        ans %= MOD;
    }
    cout << ans << endl;
}

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

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
#define mem(a,b) memset(a,b,sizeof(a))
#define shutdown ios::sync_with_stdio(false)
#define MAX 1e18+1000//1*10^18

int main()
{
    char a[10];
    scanf("%4s",&a);
    if(a[0]=='Y'&&a[1]=='A'&&a[2]=='K'&&a[3]=='I')
        printf("Yes\n");
    else
        printf("No\n");
    return 0;
}


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;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
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; }
template<typename T>vector<T> make_v(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>auto make_v(size_t a,Ts... ts){return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type fill_v(T &t,const V &v){t=v;}
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type fill_v(T &t,const V &v){for(auto &e:t) fill_v(e,v);}
/*
 <url:>
 問題文============================================================
 =================================================================
 解説=============================================================
 ================================================================
 */

template<class Type>
Type solve(Type res = Type()){
    ll N; cin >> N;
    vector<ll> A(N),B(N);
    for(int i = 0; i < N; i++) cin >> A[i] >> B[i];
    
    vector<pll> P(N);
    for(int i = 0; i < N;i++) P[i] = {A[i] + B[i],i};
    sort(P.rbegin(),P.rend());
    for(int i = 0; i < N;i++){
        res += i%2==0? A[P[i].second] : -B[P[i].second];
    }
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    // solve(0);
    cout << fixed << setprecision(15) << solve<ll>() << endl;
    return 0;
}


Measured memory_bytes: 3456
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

class Graph {
  public:
    Graph(int size):
        m_arcs(size) {}

    void add_arc(int from, int to) {
        m_arcs[from].push_back(to);
    }

    int size() const {
        return m_arcs.size();
    }

    int longest_path() const {
        vector<int> dp(size(), 0);
        int answer = 0;
        for (int i = 0; i < size(); ++i)
            answer = max(answer, dfs(i, dp));
        return answer;
    }

  private:
    int dfs(int node, vector<int> &dp) const {
        if (dp[node])
            return dp[node];

        for (auto &x: m_arcs[node])
            dp[node] = max(dp[node], 1 + dfs(x, dp));
        return dp[node];
    }
    vector< vector<int> > m_arcs;
};

int main() {
    ios::sync_with_stdio(false);
    int N, M; cin >> N >> M;

    Graph G(N);
    for (int i = 0; i < M; ++i) {
        int x, y; cin >> x >> y;
        G.add_arc(x - 1, y - 1);
    }

    cout << G.longest_path() << "\n";
}


Measured memory_bytes: 8832
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair< ll, ll > Pi;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep2(i,n) for(int i=1;i<=(n);i++)
#define rep3(i,i0,n) for(int i=i0;i<(n);i++)
#define pb push_back
#define mod 1000000007
const ll INF = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}
#define all(x) x.begin(), x.end()
#define mp make_pair
bool compare(Pi a, Pi b) {
    if(a.first != b.first){
        return a.first < b.first;
        
    }else{
        return a.second < b.second;
    }
}


bool In_map(ll y,ll x,ll h,ll w){
    if(y<0 || x<0 || y>=h || x>=w){
        return 0;
    }else{
        return 1;
    }
}
const vector<ll> dx{1,0,-1,0};
const vector<ll> dy{0,1,0,-1};


int main() {
    ll X,Y,A,B,C;
    cin >>X>>Y>>A>>B>>C;
    vector<ll>p(A);
    vector<ll>q(B);
    vector<ll>r(C);

    rep(i,A) cin>>p[i];
    rep(i,B) cin>>q[i];
    rep(i,C) cin>>r[i];

    sort(all(p));
    sort(all(q));
    sort(all(r));
    reverse(all(p));
    reverse(all(q));
    reverse(all(r));
    ll cnta=0;
    ll cntb=0;
    ll cntc=0;
    while(1){
        if(cntc==C) break;
        if(X-1-cnta>=0 && Y-1-cntb>=0){
            if(p[X-1-cnta]<q[Y-1-cntb]){
                if(p[X-1-cnta]<r[cntc]){
                    p[X-1-cnta] = r[cntc];
                    cnta++;
                    cntc++; 
                }else{
                    break;
                }
            }else{
                if(q[Y-1-cntb]<r[cntc]){
                    q[Y-1-cntb] = r[cntc]; 
                    cntb++;
                    cntc++;
                }else{
                    break;
                }
            }
        }else if(X-1-cnta>=0){
            if(p[X-1-cnta]<r[cntc]){
                p[X-1-cnta] = r[cntc];
                cnta++;
                cntc++; 
            }else{
                break;
            }
        }else if(Y-1-cntb>=0){
            if(q[Y-1-cntb]<r[cntc]){
                q[Y-1-cntb] = r[cntc]; 
                cntb++;
                cntc++;
            }else{
                break;
            }
        }else{
            break;
        }

    }
    ll ans=0;
    rep(i,X){
        ans+=p[i];
    }

    rep(i,Y){
        ans+=q[i];
    }
    cout << ans << endl;


    return 0;
    

}

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

int main() {
    int n;
    cin >> n;
    int x[n] = {};
    int y[n] = {};

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

    int man = 0;
    for(i = 0; i < n; i++){
        if (x[i] > y[i]) {
            man += x[i] - y[i];
        }
        else{
            man += y[i] - x[i];
        }
    }

    double euc = 0;
    for(i = 0; i < n; i++){
        if (x[i] > y[i]) {
            euc += (x[i] - y[i]) * (x[i] - y[i]);
        }
        else{
            euc += (y[i] - x[i]) * (y[i] - x[i]);
        }
    }
    euc = sqrt(euc);

    double min_3 = 0;
    for(i = 0; i < n; i++){
        if (x[i] > y[i]) {
            min_3 += (x[i] - y[i]) * (x[i] - y[i]) * (x[i] - y[i]);
        }
        else{
            min_3 += (y[i] - x[i]) * (y[i] - x[i]) * (y[i] - x[i]);
        }
    }
    min_3 = cbrt(min_3);

    int che = 0;
    for(i = 0; i < n; i++){
        if (x[i] > y[i] && che < x[i] - y[i]) {
            che = x[i] - y[i];
        }
        else if (y[i] > x[i] && che < y[i] - x[i]) {
            che = y[i] - x[i];
        }
    }

    cout << fixed << setprecision(7) << man << endl;
    cout << fixed << setprecision(7) << euc << endl;
    cout << fixed << setprecision(7) << min_3 << endl;
    cout << fixed << setprecision(7) << che << endl;
}



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

using namespace std;
#define PB push_back
#define MP make_pair
#define LL long long
#define int LL
#define FOR(i,a,b) for(int i = (a); i <= (b); i++)
#define RE(i,n) FOR(i,1,n)
#define REP(i,n) FOR(i,0,(int)(n)-1)
#define R(i,n) REP(i,n)
#define VI vector<int>
#define PII pair<int,int>
#define LD long double
#define FI first
#define SE second
#define st FI
#define nd SE
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())

template<class C> void mini(C &a4, C b4) { a4 = min(a4, b4); }
template<class C> void maxi(C &a4, C b4) { a4 = max(a4, b4); }

template<class TH> void _dbg(const char *sdbg, TH h){ cerr<<sdbg<<'='<<h<<endl; }
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
  while(*sdbg!=',')cerr<<*sdbg++;cerr<<'='<<h<<','; _dbg(sdbg+1, a...);
}

template<class T> ostream &operator<<(ostream& os, vector<T> V) {
  os << "["; for (auto vv : V) os << vv << ","; return os << "]";
}
template<class L, class R> ostream &operator<<(ostream &os, pair<L,R> P) {
  return os << "(" << P.st << "," << P.nd << ")";
}

#ifdef LOCAL
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (__VA_ARGS__)
#define cerr if(0)cout
#endif

const int MAX = 1 << 19;
int n,nn;
int t[MAX],ma[MAX],mi[MAX];
vector<int> d[MAX];
void nie(){
  cout << "NO\n";
  exit(0);
}
int reverse(int i){
  int res = 0;
  R(j,nn)if((i >> j) & 1){
    res += 1 << (nn - j - 1);
  }
  return res;
}
int res[MAX];
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(11);
  cerr << fixed << setprecision(6);
  cin >> nn;
  n = 1 << nn;
  R(i,n){
    mi[i] = 0;
    ma[i] = n-1;
  }
  
  R(i,n){
    cin >> t[i];
    /*
    if(i == n-1){
      if(t[i] != n && t[i] != 0){
        nie();
      }
      t[i] = n;
    }
    if(i == 0){
      if(t[i] != 1 && t[i] != 0){
        nie();
      }
      t[i] = 1;
    }*/
    t[i]--;
    if(t[i] != -1){
      mi[i] = t[i];
      ma[i] = t[i];
    }
  }
  R(i,n){
    R(j,nn)if((i >> j) & 1){
      maxi(mi[i], mi[i - (1 << j)]); 
    }
  }
  for(int i = n - 1; i >= 0;i--){
    R(j,nn)if((i >> j) & 1){
      mini(ma[i - (1 << j)], ma[i]);
    }
  }
  R(i,n){
    if(ma[i] < mi[i])nie();
    debug(ma[i],mi[i]);
    d[mi[i]].PB(i);
  }
  set<PII> pom;
  R(i,n){
    for(int ak:d[i]){
      pom.insert({ma[ak],ak});
    }
    if(pom.empty())nie();
    if(ma[pom.begin()->SE] < i)nie();
    res[reverse((*pom.begin()).SE)] = i;
    pom.erase(pom.begin());
  }
  cout << "YES\n";
  R(i,n){
    cout << res[i] + 1 << " ";
  }
  cout << "\n";
  
}


Measured memory_bytes: 46584
#include<functional>
#include <algorithm>
#include  <iostream>
#include   <ctype.h>
#include   <cstring>
#include   <fstream>
#include    <cstdio>
#include    <vector>
#include    <string>
#include     <cmath>
#include     <deque>
#include     <stack>
#include     <queue>
#include      <list>
#include       <set>
#include       <map>
#define INF 0X7FFFFFFF
#define PI acos(-1.0)
typedef long long ll;
using namespace std;
const int mod = 1e9 + 7;
inline int getint()
{
	int w = 0, q = 0;
	char c = getchar();
	while ((c<'0' || c>'9') && c != '-') c = getchar();
	if (c == '-') q = 1, c = getchar();
	while (c >= '0'&&c <= '9') w = w * 10 + c - '0', c = getchar();
	return q ? -w : w;
}
int n;
int a[100005];
int main() {
	n = getint();
	for (int i = 0; i < n; i++) {
		a[i] = getint();
	}
	sort(a, a + n);
	int i = 0;
	ll ans = 1;
	bool flag = true;
	if (n & 1) {
		if (a[0] != 0) {
			ans = 0;
			flag = false;
		}
		i++;
	}
	int j = 1;
	for (; i < n&&flag; i += 2) {
		j = i + 1;
		if (a[i] != j || a[i] != a[i + 1]) {
			ans = 0;
			flag = false;
		}
		ans *= 2;
		ans %= mod;
	}
	cout << ans << endl;
	return 0;
}

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

#define rep(i, n) for (int i = 0; i < n; ++i)
#define all(x) (x).begin(),(x).end()
#define endl "\n"

using ll = long long;
using P = pair<int,int>;
using mp =  map<int,int>;

const int MOD = 1e9 + 7;

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

    string s;
    cin >> s;

    deque<char> de;
    rep(i, s.size()){
        de.push_back(s[i]);
    }

    int q;
    cin >> q;
    int cnt = 0;
    rep(i, q){
        int x;
        cin >> x;
        if(x == 1){
            cnt++;
        }

        if(x == 2){
            int f; char c;
            cin >> f >> c;
            if(cnt % 2 == 0){
                if(f == 1){
                    de.push_front(c);
                }else{
                    de.push_back(c);
                }
            }else{
                if(f == 2){
                    de.push_front(c);
                }else{
                    de.push_back(c);
                }
            }
        }
    }

    if(cnt % 2 == 1){
        reverse(all(de));
    }

    for (auto& p : de) {
        cout << p;
    }
    cout << endl;

    return 0;
}


Measured memory_bytes: 976
//   Rishabh Agarwal
#include <bits/stdc++.h>
#define F first
#define S second
#define MAX 10000003
using namespace std;

typedef long long int ll;
const ll mod = 1e9+7;
const ll INF= 1e18;
long double PI=3.1415926;

ll power(ll a,ll b){
    if(b==0){
        return 1;
    }
    ll temp=power(a,b/2)%mod;
    if(b%2==0){
        return (temp*temp)%mod;
    }
    else{
        return ((a*temp)%mod*temp)%mod;
    }
}

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

vector<ll>v;
vector<ll>::iterator it;
map<ll,ll>mp;

void primeFactors(ll n)  
{  
    while (n % 2 == 0)  
    {  
        mp[2]++;
        n = n/2;  
    }  
    for (ll i = 3; i <= sqrt(n); i = i + 2)  
    {  
        while (n % i == 0)  
        {  
            mp[i]++;
            n = n/i;  
        }  
    }  
    if (n > 2){ 
        mp[n]++; 
    } 
}  

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    
    #ifndef ONLINE_JUDGE
	freopen("inp.txt", "r", stdin);
	freopen("out.tex", "w", stdout);
    #endif

    ll t;
    //cin>>t;
    t=1;
    //ll c=1;
    while(t--){
        ll a[5];
        ll ans;
        //cin>>a>>b>>c>>d>>e;
        for(ll x=0; x<5; x++){
            cin>>a[x];
            if(a[x]==0){
                cout<<x+1<<"\n";
            }
        }
        mp.clear();  
        v.clear();
        //cout<<"Case #"<<c<<": "<<ans<<"\n";
        //c++;
    }
    return 0;
}

Measured memory_bytes: 3692
//In the name of Allah :)
#include <bits/stdc++.h>
using namespace std;

const int MAXN = 2e5 + 10;
int h[MAXN];
map <int , int> m;
int main(){
	ios_base::sync_with_stdio(NULL);cin.tie(nullptr);cout.tie(nullptr);
        int n;
        long long ans = 0;
        cin >> n;
        for(int i = 1 ; i <= n ; i++){
                cin >> h[i];
                m[i-h[i]]++;
        }
        for(int i = 1 ; i <= n ; i++){
                ans += m[i + h[i]];
        }
        cout << ans << endl;
}


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

    int sum(string N){
        int tally = 0;
        for (int i = 0; i < N.size(); ++i){
            tally += (N[i] - '0');
        }
        return tally;
    }

    void solve (string N){
        if (sum(N) % 9 == 0){
            cout << "Yes" << "\n";
            return;
        }
        cout << "No" << "\n";
    }

    int main(){
        string N;
        cin >> N;
        solve(N);
    }


Measured memory_bytes: 3896
#include <stdio.h>
int main(void){
    int n;
    int i,j,k;
    int v;
    
    scanf("%d",&n);
    int A[n];
    for(i=0;i<n;i++){
        scanf("%d",&A[i]);
    }
    for(i=1;i<=n-1;i++){
        for(k=0;k<n;k++){
            if(k==0){
                printf("%d",A[k]);
            }else{
                printf(" %d",A[k]);
            }
        }
        printf("\n");
        v = A[i];
        j = i - 1;
        while(A[j]>v && j>=0){
            A[j+1] = A[j];
            j--;
        }
        A[j+1] = v;
    }
    for(k=0;k<n;k++){
        if(k==0){
            printf("%d",A[k]);
        }else{
            printf(" %d",A[k]);
        }
    }
    printf("\n");
    
}


Measured memory_bytes: 2040
#include <bits/stdc++.h>
using namespace std;
using ll = long long; // ll は long long　と同じとする。(int64_t)
int main(){
    int N , M;
    cin >> N >> M;
    int total = 0;
    vector <int> A(M);
    for(int i = 0; i < M; i++){
        cin >> A.at(i);
        total+=A.at(i);
    }
    if(total > N){
        cout << -1 << endl;
    }
    else{
        cout << N - total << endl;
    }
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN = 1e5 + 5;

ll n;
ll pre(int x){ return 1ll * (x + 1) * x / 2; }
int work(ll x){
    int l = 1, r = x / 2 + 1, mid, res = -1;
    while(l <= r){
        mid = (l + r) >> 1;
        if(pre(mid) <= x) res = mid, l = mid + 1;
        else r = mid - 1;
    }
    return res;
}
int main(){
    ios::sync_with_stdio(false);

    cin >> n;
    vector<int> v;
    for(ll i = 2; i * i <= n; i++){
        if(n % i == 0){
            int cnt = 0;
            while(n % i == 0)
                cnt++, n /= i;
            v.push_back(cnt);
        }
    }
    if(n > 1) v.push_back(1);
    int ans = 0;
    for(int& x : v) ans += work(x);
    cout << ans;
}


Measured memory_bytes: 3644
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, N) for (int i = 0; i < (int)N; ++i)
#define all(a) (a).begin(), (a).end()

int N, K, Q;
vector<int> p;

int main() {
  cin >> N >> K >> Q;
  p.resize(N, 0);
  rep(i, Q) {
    int A;
    cin >> A;
    p[A - 1]++;
  }

  rep(i, N) { cout << ((K - (Q - p[i])) > 0 ? "Yes" : "No") << endl; }
  return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define sz(v) (v).size()
#define all(v) (v).begin(),(v).end()
using namespace std;
template <typename T> T Max(T X,T Y){return X>Y?X:Y;}
template <typename T> T Min(T X,T Y){return X<Y?X:Y;}
template <typename T> void chmax(T &X,T Y){X=X>Y?X:Y;return;}
template <typename T> void chmin(T &X,T Y){X=X<Y?X:Y;return;}

const int maxn=100005,maxm=200005;
int n,m;
int len,to[maxm<<1],nxt[maxm<<1],head[maxn],dist[maxn],from[maxn];
queue<int> q;

inline void addedge(int u,int v)
{
	len++,nxt[len]=head[u],head[u]=len,to[len]=v;
	return;
}

int main()
{
	memset(dist,-1,sizeof(dist));
	scanf("%d%d",&n,&m);
	for(int i=1;i<=m;i++)
	{
		int u,v;
		scanf("%d%d",&u,&v);
		addedge(u,v);
		addedge(v,u);
	}
	
	dist[1]=0;
	q.push(1);
	while(!q.empty())
	{
		int pos=q.front();
		q.pop();
		for(int i=head[pos];i;i=nxt[i])
		{
			if(dist[to[i]]!=-1) continue;
			dist[to[i]]=dist[pos]+1;
			from[to[i]]=pos;
			q.push(to[i]);
		}
	}
	
	for(int i=1;i<=n;i++)
		if(dist[i]==-1)
		{
			printf("No\n");
			return 0;
		}
	
	printf("Yes\n");
	for(int pos=2;pos<=n;pos++)
		printf("%d\n",from[pos]);
	return 0;
}

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

int main(){
    int n;
    cin >> n;
    vector<pair<pair<string, int>,int>> r;
    for(int i=0;i<n;i++){
        int p;
        string s;
        cin >> s >> p;
        r.push_back({{s, -p}, i+1});
    }
    sort(r.begin(), r.end());

    for(int i=0;i<n;i++) cout << r[i].second << endl;
    
    return 0;
}

Measured memory_bytes: 256
n = int(input())
#s = input()
#n, k= map(int,input().split())
#da = list(map(int,input().split()))
a = [int(input()) for i in range(n)]

roop = 0
now = 0
while roop < n+1:
    if now == 1:
        print(roop)
        break
    else:
        now = a[now]-1
        roop += 1
else:
    print(-1)


Measured memory_bytes: 7084
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
typedef long long ll;
typedef pair<int, int> P;
const int INF = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
int main() {
  string S;
  cin >> S;
  ll ans = 0;
  ll cnt = 0;
  REP(i,S.size()){
    if(S[i]=='B'){
      cnt++;
    }else{
      ans += cnt;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
typedef map<int, int> mi;
typedef set<int> si;
#define VV(T) vector<vector< T > >
#define dump(x)  cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) << endl

#define rep(i, n) REP(i, 0, n)                              // 0, 1, ..., n-1
#define REP(i, x, n) for(int i = x; i < n; i++)             // x, x + 1, ..., n-1
#define FOREACH(x,a) for(auto& (x) : (a) )
#define SORT(x) sort(x.begin(), x.end())

#define ALL(v) (v).begin() , (v).end()
#define RALL(v) (v).rbegin(), (v).rend()

#define pb push_back
#define pu push
#define mp make_pair
#define fi first
#define sc second

#define COUT(x) cout << (x) << endl
#define VECCIN(x) for(auto&youso_: (x) )cin>>youso_
#define VECCOUT(x) for(auto&youso_: (x) )cout<<youso_<<" ";cout<<endl

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(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll N, T; cin >> N >> T;
    vector<ll> v(N);
    rep(i, N) {
        cin >> v[i];
    }

    ll ans = 0;
    ll l = v[0], r = v[0] + T;
    REP(i, 1, N) {
        if(v[i] > r) {
            ans += r - l;
            l = v[i];
        }
        r = v[i] + T;
    }
    ans += r - l;
    COUT(ans);
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define range(i, l, r) for(long long int (i) = (l); (i) < (r); (i)++)
#define reversed_range(i, l, r) for (long long int (i) = (r) - 1; (i) >= l; (i)--)
using namespace std;
template <typename T>
using vec = vector<T>;
using lint = long long;
using ulint = unsigned long long;
using pint = pair<int, int>;
using plint = pair<lint, lint>;

template <typename S, typename T>
ostream& operator <<(ostream& os, pair<S, T> p) {
    os << "(";
    os << p.first << ", " << p.second;
    return os << ")";
}

template <typename T>
ostream& operator <<(ostream& os, vec<T> v) {
    os << "[";
    if (v.size() == 0) return os << "]";
    for (int i = 0; i < v.size() - 1; i++) {
        os << v.at(i) << ", ";
    }
    return os << v.at(v.size() - 1) << "]";
}

template <typename T>
ostream& operator <<(ostream& os, set<T>& s) {
    os << "{";
    if (s.begin() == s.end()) return os << "}";
    auto it_first_item = s.begin();
    cout << *it_first_item;
    for (auto it = ++it_first_item; it != s.end(); it++) {
        cout << ", " << *it;
    }
    return cout << "}";
}

template <typename T>
ostream& operator <<(ostream& os, unordered_set<T>& s) {
    os << "{";
    if (s.begin() == s.end()) return os << "}";
    auto it_first_item = s.begin();
    cout << *it_first_item;
    for (auto it = ++it_first_item; it != s.end(); it++) {
        cout << ", " << *it;
    }
    return cout << "}";
}

template <typename K, typename V>
ostream& operator <<(ostream& os, map<K, V> m) {
    os << "{";
    if (m.begin() == m.end()) return os << "}";
    auto it_first_item = m.begin();
    cout << it_first_item->first << ": " << it_first_item->second;
    for (auto it = ++it_first_item; it != m.end(); it++) {
        cout << ", " << it->first << ": " << it->second;
    }
    return os << "}";
}

template <typename K, typename V>
ostream& operator <<(ostream& os, unordered_map<K, V> m) {
    os << "{";
    if (m.begin() == m.end()) return os << "}";
    auto it_first_item = m.begin();
    cout << it_first_item->first << ": " << it_first_item->second;
    for (auto it = ++it_first_item; it != m.end(); it++) {
        cout << ", " << it->first << ": " << it->second;
    }
    return os << "}";
}

lint pow(lint num, lint e, lint MOD) {
    lint res = 1;
    lint cur_num = num;
    while (e) {
        if (e & 1) {
            res *= cur_num;
            res %= MOD;
        }
        cur_num *= cur_num;
        cur_num %= MOD;
        e >>= 1;
    }
    return res;
}

int main() {
    cin.tie(0); cout.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    lint X; cin >> X;
    lint q = X / 100, r = X % 100;
    cout << (r > 5 * q ? 0 : 1) << "\n";
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define SPEED ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef vector<int>vi;
typedef pair<int,int>pi;
typedef vector<pi>vpi;
typedef vector<vi>vvi;
#define double long double
#define pow powl
#define sqrt sqrtl
#define cbrt cbrtl
#define floor floorl
#define ceil ceill
#define pb push_back
#define ep emplace_back
#define PB pop_back
#define pf push_front
#define ef emplace_front
#define PF pop_front
#define mp make_pair
#define ub(a,b) upper_bound(all(a),b)-a.begin()
#define lb(a,b) lower_bound(all(a),b)-a.begin()
#define bs(a,b) binary_search(all(a),b)
#define mem(a,b) memset(a,b,sizeof(a))
#define in(a,n) FOR(i,0,n-1) cin>>a[i]
#define in1(a,n) FOR(i,1,n) cin>>a[i]
#define ff first
#define ss second
#define out(a,n) FOR(i,0,n-1) cout<<a[i]<<" ";cout<<endl;
#define out1(a,n) FOR(i,1,n) cout<<a[i]<<" ";cout<<endl;
#define clr(a) a.clear()
#define pow2(a) (1LL<<a)
#define all(a) a.begin(),a.end()
#define all1(a) a.begin()+1,a.end()
#define rall(a) a.rbegin(),a.rend()
#define rall1(a) a.rbegin(),a.rend()
#define sz(a) ((int)a.size())
#define FOR(i,a,b) for(auto i=a;i<=b;i++)
#define NFOR(i,a,b) for(auto i=a;i>=b;i--)
const int mod=1e9+7;

inline int add(int a,int b){return (a%mod + b%mod)%mod;}
inline int sub(int a ,int b){return (a%mod - b%mod + mod)%mod;}
inline int mul(int a,int b){a%=mod;b%=mod;return a*b%mod;}
inline int power(int a,int b,int MOD){a%=mod;int res=1;while(b){if(b&1){res*=a;res%=MOD;}a=a*a;a%=MOD;b>>=1;}return res;}

#define trace(x) cout<<#x<<" :: "<<x<<endl;
#define trace2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<endl;
#define trace3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<endl;
#define trace4(x,y,z,w) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\t"<<#w<<" :: "<<w<<endl;
clock_t time_p = clock();
void time()
{
  time_p = clock() - time_p;
  cerr << "Time elapsed : " << (double)(time_p)/CLOCKS_PER_SEC <<endl;
}
signed main()
{
     SPEED;
     int a,b;
     cin>>a>>b;
     cout<<(a<=8&&b<=8 ? "Yay!" : ":(")<<endl;
     time();
     return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0,i##_len=int(n);i<i##_len;++i)
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define All(x) (x).begin(),(x).end()
#define rAll(x) (x).rbegin(),(x).rend()
using namespace std;
using ll = long long;

int main(){
    int H,W;
    cin>>H>>W;
    vector<string> S(H);
    REP(i,H) cin>>S[i];
    vector<bool> used(H*W,false);
    queue<pair<int,int>> que;
    ll ans=0;
    int dx[4]={-1,1,0,0},dy[4]={0,0,-1,1};
    REP(i,H) REP(j,W){
        if(used[i*W+j]) continue;
        que.push(make_pair(i,j));
        used[i*W+j]=true;
        ll white=0,black=0;
        while(!que.empty()){
            pair<int,int> p=que.front();que.pop();
            int x=p.first,y=p.second;
            if(S[x][y]=='#') black++;
            else white++;
            REP(k,4){
                int nx=x+dx[k],ny=y+dy[k];
                if(0<=nx&&nx<H&&0<=ny&&ny<W&&!used[nx*W+ny]&&S[x][y]!=S[nx][ny]){
                    used[nx*W+ny]=true;
                    que.push(make_pair(nx,ny));
                }
            }
        }
        ans+=black*white;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 512
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define ALL(v) (v).begin(), (v).end()
#define LENGTHOF(x) (sizeof(x) / sizeof(*(x)))
#define AFILL(a, b) fill((int*)a, (int*)(a + LENGTHOF(a)), b)
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define INF 1 << 30
#define EPS 1e-10

typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;

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

void dfs(int y, int x){
  if(g[y][x] == '0') return;
  g[y][x] = '0';
  rep(d, 4){
    int ny = y+dy[d], nx = x+dx[d];
    if(ny < 0 || ny >= 12 || nx < 0 || nx >= 12 || g[ny][nx] == '0') continue;
    dfs(ny, nx);
  }
}

int main(){
  while(~scanf("%s", g[0])){
    REP(i, 1, 12) scanf("%s", g[i]);

    int res = 0;
    rep(i, 12) rep(j, 12){
      if(g[i][j] == '0') continue;
      res++;
      dfs(i, j);
    }
    printf("%d\n", res);
  }
  return 0;
}

Measured memory_bytes: 1136
def f(n):
    if n % 2 == 0:
        return int(n / 2)
    else:
        return 3 * n + 1

def solve_B():
    s = int(input())
    list = [0] * 1000000
    list[s] += 1
    for i in range(2, 1000000):
        x = f(s)
        if list[x] == 1:
            return i
        list[x] += 1
        s = x

print(int(solve_B()))

Measured memory_bytes: 10868
#include <cstdio>
int main()
{
    int n, h, t, a[6];
    scanf("%d", &n);
    for (int i = 0; i < 6; ++i) a[i] = 0;
    for (int i = 0; i < n; ++i) {
        scanf("%d.%d", &h, &t);
        h = 10*h + t;
        if (h < 1650) a[0]++;
        else if (h < 1700) a[1]++;
        else if (h < 1750) a[2]++;
        else if (h < 1800) a[3]++;
        else if (h < 1850) a[4]++;
        else a[5]++;
    }
    for (int i = 0; i < 6; ++i) {
        printf("%d:", i+1);
        for (int j = 0; j < a[i]; ++j) putchar('*');
        puts("");
    }
    return 0;
}

Measured memory_bytes: 0
#ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define reps(i,a,b) for(int i=a;i<b;++i)
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
using namespace std;
using ll = long long;
using P = pair<int, int>;
template<typename T> inline bool chmax(T &a,T b){if(a<b){a=b;return 1;}return 0;}
template<typename T> inline bool chmin(T &a,T b){if(b<a){a=b;return 1;}return 0;}
template<typename T> vector<T> make_vec(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>
auto make_vec(size_t a,Ts... ts){return vector<decltype(make_vec<T>(ts...))>(a,make_vec<T>(ts...));}
template<typename T,typename U,typename... V>
typename enable_if<is_same<T,U>::value>::type fill_v(U &u,const V... v){u=U(v...);}
template<typename T,typename U,typename... V>
typename enable_if<!is_same<T,U>::value>::type fill_v(U &u,const V... v){for(auto &e:u)fill_v<T>(e,v...);}

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

    int a, b;
    cin >> a >> b;
    if (a < b) puts("a < b");
    else if (a == b) puts("a == b");
    else puts("a > b");
}



Measured memory_bytes: 3108
#include<iostream>

using namespace std;

int main() {
	long long int a,b,ans;
	cin >> a;
	cin >> b;
	ans = (a * b / 2) + ((a * b) % 2);
	if (a == 1 || b == 1)ans = 1;
	cout << ans<< endl;

	return 0;
}

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

int main(){
    int a,b,c,d;
    int train,bus;

    cin >> a;
    cin >> b;
    cin >> c;
    cin >> d;
    
    if (a>b) train = b;
    else train = a;

    if (c>d) bus = d;
    else bus = c;

    cout << train + bus <<endl;
}

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

int main() {
    string S,T;
    cin >> S >> T;
    sort(S.begin(),S.end());
    sort(T.begin(),T.end());
    reverse(T.begin(),T.end());
    int count = 0;
    if (S < T) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
    
}


Measured memory_bytes: 3592
#include <stdio.h>
#include <math.h>
long long int power(long long int m,long long int n){
	if(n==1){
	    return m;
	}
	else if(n%2==0){
	    return(power(((m*m)%1000000007),(n/2)));
	}
	else{
		//return(power(((m*m)%1000000007)),((n/2))*(m%1000000007));
		return power(m*m%1000000007,n/2)*m%1000000007;
    }
}
int main(void)
{
	long long int m,n,p;
	scanf("%lld %lld",&m,&n);
	p=power(m,n);

	printf("%lld\n",p);
	return 0;
}


Measured memory_bytes: 2140
import numpy as np
X=int(input())
flag=1
for c in range(np.power(10,9)):
    c+=1
    x=X
    if x%c==0:
        x=x//c
        for a in range(np.power(10,3)):
            if (np.power(a,4) + np.power(a,3)*(a-c) + np.power(a,2)*np.power(a-c,2) + a*np.power(a-c,3) + np.power(a-c,4))==x:
                print(a,a-c)
                flag=0
                break
    if flag==0:
        break

Measured memory_bytes: 27220
#include <math.h>

#include <algorithm>
#include <array>
#include <bitset>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <sstream>
#include <vector>

using namespace std;
using Graph = vector<vector<int>>;

using ll = long long;
typedef pair<ll, ll> P_ll;
typedef pair<int, int> P;

const ll INF_ll = 1e17;
const int INF = 1e8;

int main() {
  ll N;
  cin >> N;
  vector<ll> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  sort(A.begin(), A.end(), greater<ll>());
  ll ans = 0;
  ans += A[0];
  int max_rout_idx = 1;
  for (int i = 2; i < N; i++) {
    ans += A[max_rout_idx];
    if (i % 2 != 0) {
      max_rout_idx++;
    }
  }
  cout << ans << endl;

  return 0;
}

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

#define jk(i,j,k) for (int i = (j); i <= (k); i++)
#define kj(i,j,k) for (int i = (j); i >= (k); i--)
#define int long long
#define lb long double
#define ul unsigned long long
#define mp std::make_pair
#define pb push_back
#define pr(a,b) printf(a, b)
#define sc(a,b) scanf(a, &b)
#define x first
#define y second
#define al(x) (x).begin(), (x).end()
#define me(a) memset((a), 0, sizeof(a))

inline int rd() { int data = 0, w = 1; char ch = 0; while (ch != '-' && (ch > '9' || ch < '0')) ch = getchar(); (ch == '-') && ( w = -1, ch = getchar() ); while (ch >= '0' && ch <= '9') { data = data * 10 + ch - '0'; ch = getchar(); } return data * w; }
inline void P (int v) { if (v < 0) { putchar('-'); v = -v; } if (v > 9) P(v / 10); putchar(v % 10 + '0'); }

int a[10];

signed main () {
	a[rd()] = a[rd()] = 1;
	jk (i, 1, 3) if (!a[i]) P(i);
    return 0;
}

Measured memory_bytes: 256
import Control.Monad
import Data.Char
import Data.List

solve :: Int -> [Int] -> Int
solve n ds
    | (length $ ns \\ ds) == length ns = n
    | otherwise = solve (n+1) ds
        where
            ns = map digitToInt $ (show n)

main = do
    [n, _] <- map read . words <$> getLine :: IO [Int]
    ds <- map read . words <$> getLine :: IO [Int]
    print $ solve n ds


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

int main() {
  int n;cin>>n;
  string s;
  vi ans(4,0);
  rep(i,n) {
    cin>>s;
    if (s=="AC") ans[0]++;
    else if (s=="WA") ans[1]++;
    else if (s=="TLE") ans[2]++;
    else ans[3]++;
  }
  cout<<"AC x "<<ans[0]<<endl;
  cout<<"WA x "<<ans[1]<<endl;
  cout<<"TLE x "<<ans[2]<<endl;
  cout<<"RE x "<<ans[3]<<endl;
}


Measured memory_bytes: 3604
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;

template <typename TYPE>
void print_vec(const vector<TYPE>& v){
	for(int i=0; i<v.size(); i++){
		cout << v[i] << " ";
	}
	cout << endl;
}

template <typename TYPE>
void print_vec2(const vector<vector<TYPE>>& v){
	for(int i=0; i<v.size(); i++){
		cout << "i=" << i << ":   ";
		for(int j=0; j<v[i].size(); j++){
			cout << v[i][j] << "   ";
		}
		cout << endl;
	}
}


int main(){//
    int X, Y;
    cin >> X >> Y;

    for(int turu=0; turu<=X; turu++){
        int kame = X - turu;
        int asi  = 2*turu + 4*kame;
        if( asi  == Y) {
            cout << "Yes" << endl;
            return 0;
        } 
    }
    cout << "No" << endl;    
}

Measured memory_bytes: 3604