akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <utility>
#include <cmath>
#include <climits>
#include <bitset>

#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue

using namespace std;
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;

ll power(ll x, ll p){
  ll tmp = p;
  ll res = 1;
  ll curr = x;
  while(tmp){
    if(tmp % 2 == 1){
      res *= curr;
    }
    curr *= curr;
    tmp /= 2;
    if(res > 1e18)return -1;
  }
  return res;
}

int main(int argc, char const* argv[])
{
  ll a, b, c, k;
  cin >> a >> b >> c >> k;
  if(k % 2 == 1)cout << - a + b << endl;
  else cout << a - b << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using P = pair<int, int>;
const double eps = 1e-8;
const ll MOD = 1000000007;
const int INF = INT_MAX / 2;
const ll LINF = LLONG_MAX / 2;
template <typename T1, typename T2>
bool chmax(T1 &a, const T2 &b) {
  if(a < b) {a = b; return true;}
  return false;
}
template <typename T1, typename T2>
bool chmin(T1 &a, const T2 &b) {
  if(a > b) {a = b; return true;}
  return false;
}
template<typename T1, typename T2>
ostream& operator<<(ostream &os, const pair<T1, T2> p) {
  os << p.first << ":" << p.second;
  return os;
}
template<class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  for(int i=0;i<((int)(v.size()));++i) {
    if(i) os << " ";
    os << v[i];
  }
  return os;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  ll n, m; cin >> n >> m;
  vll a(n);
  vector<double> p(n);
  for(int i=0;i<(n);++i) cin >> a[i];
  for(int i=0;i<(n);++i) cin >> p[i], p[i] /= 100;
  vll val(1<<n);
  for(int i=0;i<(1<<n);++i) {
    ll now = 1;
    for(int j=0;j<(n);++j) {
      if((i>>j)&1) {
        ll tmp = a[j] / __gcd(now, a[j]);
        if(now <= 2e18 / tmp) {
          now *= tmp;
        } else {
          now = 2e18+1;
          break;
        }
      }
    }
    val[i] = m / now;
    if(__builtin_popcount(i) % 2 == 0) val[i] = -val[i];
  }
  val[0] = 0;
  for(int j=0;j<(n);++j) {
    for(int i=0;i<(1<<n);++i) {
      if((i>>j)&1) val[i] += val[i&~(1<<j)];
    }
  }
  vector<double> prob(1<<n, 1);
  for(int i=0;i<(1<<n);++i) {
    for(int j=0;j<(n);++j) {
      if((i>>j)&1) prob[i] *= p[j];
      else prob[i] *= 1 - p[j];
    }
  }
  double res = 0;
  for(int i=0;i<(1<<n);++i) res += val[i] * prob[i];
  cout << res << endl;
}



Measured memory_bytes: 19316
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using pint = pair<int,int>;
ll mod = 1000000007,mod2 = 998244353;

void chmin(long long &a, long long b) { if (a > b) a = b; }
void chmax(long long &a, long long b) { if (a < b) a = b; }
//void chmin(int &a, int b) { if (a > b) a = b; }
//void chmax(int &a, int b) { if (a < b) a = b; }


int main() {
    char s[3];
    for (int i = 0; i < 3; ++i) {
        cin >> s[i];
    }
    if(s[0] == s[1] && s[1] == s[2]){
        cout << "No" << endl;
    }else{
        cout << "Yes" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
/*
これを入れて実行
g++ code.cpp
./a.out
 */
 
#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <cmath>
#include <math.h>
#include <tuple>
#include <iomanip>
 
using namespace std;
typedef long long ll;
typedef long double ld;
 
int dy4[4] = {-1, 0, +1, 0};
int dx4[4] = {0, +1, 0, -1};
int dy8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dx8[8] = {0, 1, 1, 1, 0, -1, -1, -1};
 
const long long INF = 1LL << 60;
const ll MOD = 1e9 + 7;
 
bool greaterSecond(const pair<int, int>& f, const pair<int, int>& s){
    return f.second > s.second;
}
 
ll gcd(ll a, ll b){
	if (b == 0)return a;
	return gcd(b, a % b);
}
 
ll lcm(ll a, ll b){
    return a / gcd(a, b) * b;
}
 
ll nCr(ll n, ll r){
    if(r == 0 || r == n){
        return 1;
    } else if(r == 1){
        return n;
    }
    return (nCr(n - 1, r) + nCr(n - 1, r - 1));
}
 
ll nPr(ll n, ll r){
    r = n - r;
    ll ret = 1;
    for (ll i = n; i >= r + 1; i--) ret *= i;
    return ret;
}
 
//-----------------------ここから-----------

int main(void){
    int a, b;
    cin >> a >> b;

    if(a > 9 || b > 9){
        cout << -1 << endl;
    } else {
        cout << a * b << endl;
    }
}

Measured memory_bytes: 256
### SNIPPET
  # n = gets.split.map(&:to_i)
  # array = n.times.map { gets.split.map(&:to_i) }
  # [].all?(&:even?)
  # a = [*1..m].repeated_combination(n).to_a
  # [1,2,3,4,5].select { |num| num.even? }  # => [2, 4]
  # ["a","a","b"].group_by(&:itself).map{|k,v| [k, v.count]}.to_h #=> {"a"=>2, "b"=>1}
  # 切り捨て: .floor(2).to_f ,切り上げ： .ceil(2).to_f,四捨五入: round(2)
  # 3.upto(6) do |i|, 6.downto(3) do |i|
  # 公約数125.gcd(100)、公倍数125.lcm(100)
  # PI = Math::PI
  # 高さ = a * Math.sin(w / 180.0 * Math::PI), 底辺 = a * Math.cos(w / 180.0 * Math::PI)
  # def chmax(a, b) a > b ? a : b end
  # INF = Float::INFINITY
  # def chmin(a, b) a < b ? a : b end

card = []
3.times {card << gets.split.map(&:to_i)}

n = gets.to_i
hits = []
n.times {hits << gets.to_i}


hits.each do |h|
  3.times do |i|
    3.times do |j|
      if h == card[i][j]
        card[i][j] = 0
      end
    end
  end
end

flag = false
tcard = card.transpose
3.times do |k|
  if card[k].inject(:+) == 0 || tcard[k].inject(:+) == 0
    flag = true
  end
end

if card[0][0] == 0 && card[1][1] == 0 && card[2][2] == 0
  flag = true
end

if card[0][2] == 0 && card[1][1] == 0 && card[2][0] == 0
  flag = true
end

# puts flag ? "Yes" : "No"
if flag
  puts "Yes"
else
  puts "No"
end


Measured memory_bytes: 1788
#include <algorithm>
#include <cassert>
// #include <chrono>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
// #include <random>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>

/*
unsigned seed1 = std::chrono::system_clock::now().time_since_epoch().count();
mt19937 g1.seed(seed1);
*/
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<pii, pii> ppiipii;
typedef pair<int, ppiipii> pippiipii;
typedef pair<int, pii> pipii;
typedef pair<pii, int> ppiii;
typedef pair<int, ppiii> pippiii;
typedef pair<int, ll> pill;
typedef pair<int, double> pid;
// note to self, the below two triggers someone
typedef pair<ll, ll> pll;
typedef pair<ll, int> plli;
typedef long double ld;

char buf[100005];

int main() {
  scanf("%s", buf);
  int len = strlen(buf);
  int ret = 0;
  int diff = 0;
  for(int i = 0; i < len; i++) {
    if(diff > 0 && buf[i] == 'g') {
      diff--;
      ret++;
    }
    else if(diff > 0) {
      diff--;
    }
    else {
      diff++;
      if(buf[i] == 'p') {
        ret--;
      }
    }
  }
  printf("%d\n", ret);
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define REP(i,n) for(ll i=0;i<(n);i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORC(i,a,b,c) for(ll i=(a);i<(b);i+=(c))
#define pb(x) push_back(x)
#define ff first
#define ss second
#define dd double
#define mod 1000000007

template<class K,class other=null_type,class cmp=less<K>> using ordered_set=tree<K,other,
cmp, rb_tree_tag, tree_order_statistics_node_update>;

inline ll md(ll x){
    return x<mod?x:x%mod;
}

ll power(ll x, ll y){
    if(y==0){
        return 1;
    }
    ll x_=power(x,y/2);
    if(y & 1){
        return md(md(x_*x_)*md(x));
    }
    else{
        return md(x_*x_);
    }
}

ll mod_inverse(ll x){
    return power(x,mod-2);
}

class DSU{
    ll * rank, * parent, n;
public:
    DSU(ll n){
        rank=new ll[n];
        parent=new ll[n];
        this->n=n;
        makeset();
    }
    void makeset(){
        for(ll i=0;i<n;i++){
            parent[i]=i;
        }
    }
    ll find(ll x){
        if(parent[x]!=x){
            parent[x]=find(parent[x]);
        }
        return parent[x];
    }
    void Union(ll x, ll y){
        ll xset=find(x);
        ll yset=find(y);
        if(xset==yset){
            return;
        }
        if(rank[xset]<rank[yset]){
            parent[xset]=yset;
        }
        else if(rank[xset]>rank[yset]){
            parent[yset]=xset;
        }
        else{
            parent[xset]=parent[yset];
            rank[yset]++;
        }
    }
};

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,M;
    cin>>n>>M;
    DSU dsu(n);
    REP(i,M){
        ll u,v;
        cin>>u>>v;
        u--;
        v--;
        dsu.Union(u,v);
    }
    map<ll,ll> m;
    REP(i,n){
        m[dsu.find(i)]++;
    }
    ll maxx=0;
    for(auto & x:m){
        maxx=max(maxx,x.ss);
    }
    cout<<maxx<<endl;
}


Measured memory_bytes: 17584
//Code By CXY07
#include<bits/stdc++.h>
using namespace std;

#define int long long

const int MAXN = 1;
const int INF = 2e9;
const int mod = 1e9 + 7;

int n,ans;

signed main () {
	cin >> n;
	for(register int i = 1;i <= n; ++i)
		if(i % 3 && i % 5) ans += i;
	cout << ans << endl;
	return 0;
}


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

using namespace std;

typedef long long ll;


int main(int, char**)
{
	ll a, b, ans = 0;
	cin >> a >> b;

	if (a >= b) {
		ans = a;
		--a;
	} else {
		ans = b;
		--b;
    }
	if (a >= b) 
		ans += a;
	else
		ans += b;
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
#include <bitset>
#include <cmath>
#include <limits>
#include <iostream>
#include<set>
#include<tuple>
using namespace std;
#define INF 11000000000
#define MAX 100000
#define MOD 1000000007
typedef long long ll;
typedef pair<int,int> P;
typedef pair<pair<int,int>,int> p;
typedef pair< pair<int,int>, int> p; 
#define bit(n,k) ((n>>k)&1) /*nのk bit目*/
#define rad_to_deg(rad) (((rad)/2/M_PI)*360)


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

    for(int i=0;i<K;i++){
        if(i%2==0){
            A/=2;
            B+=A;
        }else{
            B/=2;
            A+=B;
        }
    }
    cout<<A<<" "<<B<<endl;
}



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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
#define REP(i, n) for(int i=0; i<n; i++)
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; }
const ll MOD = 1e9+7;

int main(){
    int N;
    cin >> N;
    int odd, even;
    odd = even = 0;
    REP(i,N){
        ll a;
        cin >> a;
        if(a % 2)  odd++;
        else even++;
    }

    if(odd % 2){
        cout << "NO" << endl;
    }
    else{
        cout << "YES" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
//============================================================================
// Name        : d.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include<vector>
#include<algorithm>
using namespace std;

int main() {
	int n,m;cin>>n>>m;
	vector<int> a(n),b(m);
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	for(int i=0;i<m;i++){
		cin>>b[i];
	}
	long long def=1;
	for(int i=0;i<9;i++){
		def*=10;

	}
	def+=7;
	long long ans=1;
	int rem=n+m;
	int num=n*m;
	int iused=0;
	int jused=0;
	int notuse=0;
	while(iused+jused<n+m){
		int flagi=0;
		int flagj=0;
		for(int i=0;i<n;i++){
			if(a[i]==num){
				flagi=1;
			}
		}
		for(int j=0;j<m;j++){
			if(b[j]==num){
				flagj=1;
			}
		}
		if(flagi==0){
			if(flagj==0){
				if(iused*jused<=n*m-num){
					cout<<0<<endl;
					return 0;
				}
				ans*=(iused*jused-(n*m-num));
			}else{
				jused++;
				ans*=iused;
			}
		}else{
			if(flagj==0){
				iused++;
				ans*=jused;
			}else{
				iused++;
				jused++;
			}
		}
		ans%=def;
		num--;
//		cout<<ans<<' '<<iused<<' '<<jused<<endl;
	}
	for(int i=1;i<=num;i++){
		ans*=i;
		ans%=def;
	}
	cout<<ans<<endl;
	return 0;
}

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

using namespace std;

template <int M, bool IsPrime = false> class Modulo {
  int n;
  static typename std::enable_if<IsPrime, LL>::type inv(LL a, LL p) {
    return (a == 1 ? 1 : (1 - p * inv(p % a, a)) / a + p);
  }

public:
  Modulo() : n(0) { ; }
  Modulo(int m) : n(m) {
    if (n >= M)
      n %= M;
    else if (n < 0)
      n = (n % M + M) % M;
  }
  Modulo(LL m) {
    if (m >= M)
      m %= M;
    else if (m < 0)
      m = (m % M + M) % M;
    n = m;
  }
  explicit operator int() const { return n; }
  explicit operator LL() const { return n; }
  bool operator==(const Modulo &a) const { return n == a.n; }
  Modulo &operator+=(const Modulo &a) {
    n += a.n;
    if (n >= M) n -= M;
    return *this;
  }
  Modulo &operator-=(const Modulo &a) {
    n -= a.n;
    if (n < 0) n += M;
    return *this;
  }
  Modulo &operator*=(const Modulo &a) {
    n = (LL(n) * a.n) % M;
    return *this;
  }
  Modulo operator+(const Modulo &a) const {
    Modulo res = *this;
    return res += a;
  }
  Modulo operator-(const Modulo &a) const {
    Modulo res = *this;
    return res -= a;
  }
  Modulo operator-() const { return Modulo(0) - *this; }
  Modulo operator*(const Modulo &a) const {
    Modulo res = *this;
    return res *= a;
  }
  Modulo operator^(int m) const {
    if (m == 0) return Modulo(1);
    const Modulo a = *this;
    Modulo res = (a * a) ^ (m / 2);
    return m % 2 ? res * a : res;
  }
  typename std::enable_if<IsPrime, Modulo>::type
  operator/(const Modulo &a) const {
    return *this * inv(LL(a), M);
  }
  typename std::enable_if<IsPrime, Modulo>::type operator/=(const Modulo &a) {
    return *this *= inv(LL(a), M);
  }
};

template <int M, bool IsPrime = false> bool is_zero(Modulo<M, IsPrime> x) {
  return int(x) == 0;
}
template <int M, bool IsPrime = false> int abs(Modulo<M, IsPrime> x) {
  return int(x);
}

const int mod = 1000000007;

using Mod = Modulo<mod, true>;

int l, c, d;

Mod fmemo[1024] = {};
Mod fact(int n) {
  if(LL(fmemo[n])) return fmemo[n];
  else if(n == 0) return fmemo[n] = Mod(1);
  else return fmemo[n] = fact(n-1) * n;
}

Mod inv_memo[1024] = {};
Mod inv_fact(int n) {
  if(LL(inv_memo[n])) return inv_memo[n];
  else return inv_memo[n] = Mod(1) / fact(n);
}

bool mexist[1024][1024];
Mod memo[1024][1024];
Mod pattern(int n, int r) {
  if(l == r) return (n == 0 ? 1 : 0);
  if(mexist[n][r]) return memo[n][r];
  Mod answer = pattern(n, r - 1);
  FOR(g, c, d) {
    if(n < g * r) break;
    answer += pattern(n - g * r, r - 1) * inv_fact(g) * (inv_fact(r) ^ g);
  }
  mexist[n][r] = true;
  return memo[n][r] = answer;
}
int main(void)
{
  int n, r;
  cin >> n >> l >> r >> c >> d;
  --l; ++d;
  cout << LL(pattern(n, r) * fact(n)) << endl;
  return 0;
}


Measured memory_bytes: 5504
package main

import (
	"bufio"
	"os"
	"strconv"
	"strings"
	"fmt"
)

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	tbl := []int{600, 800, 1000, 1200, 1400, 1600}
	for scanner.Scan() {
		n, _ := strconv.Atoi(scanner.Text())
		if n == 0 {
			 break
		}
		fee := 0
		for i := 0; i < n; i++ {
			scanner.Scan()
			buf := strings.Split(scanner.Text(), " ")
			x, _ := strconv.Atoi(buf[0])
			y, _ := strconv.Atoi(buf[1])
			h, _ := strconv.Atoi(buf[2])
			w, _ := strconv.Atoi(buf[3])
			s := x + y + h
			if s <= 160 && w <= 25 {
				k1, k2 := 0, 0
				if s <= 60 {
					k1 = 0
				} else {
					k1 = (s-61)/20 + 1
				}
				if w <= 2 {
					k2 = 0
				} else {
					k2 = (w-1)/5 + 1
				}
				if k1 < k2 {
					k1 = k2
				}
				fee += tbl[k1]
			}
		}
		fmt.Println(fee)
	}
}


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

int main(){
    int N;
    cin >> N;
    int cnt;
    int ans=0;
    for(int i=1;i<=N;i+=2){
        cnt = 0;
        for(int j=1;j<=i;j++){
            if(i%j==0){
                cnt++;
            }
        }
        if(cnt==8){
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>

int main(void){
	int t,n,p,q,a,b,j,k;
	
	scanf("%d",&n);
	for(t=0;t<n;t++){
		scanf("%d %d %d %d",&p,&q,&a,&b);
		j=p*a+q*b;
		if(a<5){
			a=5;
		}
		if(b<2){
			b=2;
		}
		k=(a*p+b*q)*4/5;
		if(j>k){
			j=k;
		}
		
		printf("%d\n",j);
	}
	return 0;

}

Measured memory_bytes: 600
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <climits>

using namespace std;
typedef long long unsigned int ll;
typedef pair<int, int> P;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

#define amari(x) ((x) % 1000000007)

#define fillInt(xs, x)        \
  for (int i = 0; i < (x); i++) \
    scanf("%d", &xs[i]);
#define fillLong(xs, x)       \
  for (int i = 0; i < (x); i++) \
    scanf("%ld", &xs[i]);
#define fillString(xs, x)       \
  for (int i = 0; i < (x); i++) \
    cin >> xs[i];
#define sortv(xs) sort(xs.begin(), xs.end());
#define sortvdi(xs) sort(xs.begin(), xs.end(), std::greater<int>());
#define lbv(xs, x) lower_bound(xs.begin(), xs.end(), x) - xs.begin();
#define ubv(xs, x) upper_bound(xs.begin(), xs.end(), x) - xs.begin();

#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define isValidPoint(x, y, mx, my) x >= 0 && x  < mx && y >= 0 && y < my

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

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

  string s;

  cin >> s;

  int scnt = 0;
  int cnt = 0;

  rep(i, s.size()){
    if (s[i] == 'S') {
      scnt++;
    } else if (s[i] == 'T' && scnt > 0){
      scnt--;
      cnt+=2;
    }
  }

  cout << s.size() - cnt << endl;

  return 0;
}


Measured memory_bytes: 832
import java.util.Scanner;
import java.util.Arrays;
public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
      int ans[] = new int[3];
      for(int i = 0; i < 3;i++){
          ans[i] = sc.nextInt();
      }
     Arrays.sort(ans);
     System.out.println(ans[0]+" "+ans[1]+" "+ans[2]);
	 sc.close();
	}
}



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

using namespace std;


void solve() {
    int r, D, x;
    cin >> r >> D >> x;
    auto f = [&](int x){return r*x-D;};
    for (int i = 0; i < 10; i++) {
        x = f(x);
        cout << x << "\n";
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    solve();
    cout << endl;
}


Measured memory_bytes: 256
n = int(raw_input())
a = 0
b = 0
for i in range(n):
    in_line = raw_input().split()
    if in_line[0] == in_line[1]:
        a += 1
        b += 1
    elif in_line[0] > in_line[1]:
        a += 3
    else:
        b += 3
print '{0} {1}'.format(a,b)

Measured memory_bytes: 6380
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
#define rep(i,n) for(int i = 0; i < ((int)(n)); i++)   // 0-indexed昇順

int main() {
    int N,M,X,Y;
    cin >> N >> M >> X >> Y;
    if (X >= Y) {
        cout << "War" << endl;
        return 0;
    }
    vector<int> A(N);
    rep(i,N) cin >> A.at(i);
    sort(A.begin(), A.end());
    vector<int> B(M);
    rep(i,M) cin >> B.at(i);
    sort(B.begin(), B.end());
    if (A[A.size() - 1] < B[0] && X < B[0] && Y > A[A.size() - 1]) {
        cout << "No War" << endl;
    } else {
        cout << "War" << endl;
    }
}


Measured memory_bytes: 256
#include<vector>
#include<cmath>
#include<map>
#include<cstdlib>
#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<set>
#include<stack>
#include<bitset>
#include<functional>
#include<ctime>
#include<queue>
#include<deque>
#include<complex>
#include<cassert>
using namespace std;
#define pb push_back
#define pf push_front
typedef long lint;
typedef complex<double> P;
#define mp make_pair
#define fi first
#define se second
typedef pair<int,int> pint;
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
int main()
{
	lint a,b,n,ma,mi;
	cin>>n>>a>>b;
	if(a>b){
		cout<<0<<endl;return 0;
	}
	if(n==1){
		if(a==b) cout<<1<<endl;
		else cout<<0<<endl;
		return 0;
	}
	ma=a+(n-1)*b;mi=b+(n-1)*a;
	cout<<(ma-mi+1)<<endl;
}

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

int main()
{
   int a,b,t;
   cin>>a>>b>>t;
   int count{};
   int sec = a;
   while(sec<=t)
   {
      count++;
      sec += a;
   }
   cout<<count*b;
   return 0;
}


Measured memory_bytes: 3544
#include<stdio.h>
#include<iostream>
#include<stack>
#include<vector>
#include<algorithm>

using namespace std;

int main()
{
    int acc=0;
    vector<int> resultSet;
    stack<int> downIdxSt;
    stack<pair<int,int> > downIdxToAreaSt;
    string line;
    cin>>line;
    for(int i=0; line[i]!='\0'; i++)
    {
        if(line[i]=='_')
            continue;
        else if(line[i]=='\\')
        {
            downIdxSt.push(i);
        }
        else if(!downIdxSt.empty() && line[i]=='/')
        {
            int downIdx=downIdxSt.top(), upIdx=i;
            downIdxSt.pop();
            int area=0;
            area+=(upIdx-downIdx);//当前这层的面积
            acc+=area;//累计这层面积
            //实际area加上这层中间的下层面积
            while(!downIdxToAreaSt.empty() && downIdxToAreaSt.top().first>downIdx)
            {
                area+=(downIdxToAreaSt.top().second);
                downIdxToAreaSt.pop();
            }
            downIdxToAreaSt.push(make_pair(downIdx, area));
        }
    }
    while(!downIdxToAreaSt.empty())
    {
        resultSet.push_back(downIdxToAreaSt.top().second);
        downIdxToAreaSt.pop();
    }
    reverse(resultSet.begin(), resultSet.end());
    printf("%d\n", acc);
    printf("%d", resultSet.size());
    for(int i=0; i<resultSet.size(); i++)
        printf(" %d", resultSet[i]);
    printf("\n");
    return 0;
}


Measured memory_bytes: 3444
#include <iostream>
#include <algorithm>
#include <vector>
#include <complex>

using namespace std;

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

    int mi = 1001;
    for(int i=0; i<n; i++)
    {
        int c, tt;
        cin >> c; cin >> tt;

        if(tt<=t) mi = min(mi, c);
    }

    if(mi != 1001)
    {
        cout << mi << endl;
    }
    else
    {
        cout << "TLE" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
#define fi first
#define se second
#define pb push_back
#define all(x) x.begin(), x.end()
#define mp make_pair
 
typedef long long ll;
typedef unsigned long long int ull;
typedef long double ld;
 
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
typedef pair<string, string> ss;
typedef pair<int, ss> iss;
 
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<ld> vld;
typedef vector<double> vd;
typedef vector<char> vc;
typedef vector<pll> vpll;
typedef vector<pii> vpii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<pair<int, pii>> vpiii;
 
typedef map<string, string> mss;
typedef map<string, int> msi;
typedef map<int, int> mii;
typedef map<int, bool> mib;
typedef map<int, ll> mill;
typedef map<int, vpii> mivpii;

const int MAX = 1e5;
const int WAYS = 3;

int a[MAX + 1][WAYS];
int dp[MAX + 1][WAYS];

void fast_io() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
}

int main() {
	fast_io();
//	freopen("input/dp_c.txt", "r", stdin);
	
	int n;
	cin >> n;
	for(int i = 1; i <= n; i++)
		cin >> a[i][0] >> a[i][1] >> a[i][2];
	
	for(int i = 1; i <= n; i++) {
		dp[i][0] = a[i][0] + max(dp[i - 1][1], dp[i - 1][2]);
		dp[i][1] = a[i][1] + max(dp[i - 1][0], dp[i - 1][2]);
		dp[i][2] = a[i][2] + max(dp[i - 1][0], dp[i - 1][1]);
	}
	
	int ans = 0;
	for(int i = 0; i < WAYS; i++)
		ans = max(ans, dp[n][i]);
	
	cout << ans << '\n';
	
	return 0;
}

Measured memory_bytes: 2560
import sys
from sys import stdin
import numpy as np

def main():
    #pass
    n = int(stdin.readline())
    if n%2!=0:
        print("0")
        return
    m = int(n/2)
    #print(m)
    d = np.array([int(x) for x in stdin.readline().rstrip().split()])
    d = np.sort(d)
    #print(n,d)
    k = int(d[m])-int(d[m-1])
    print(k)
    return
    
    

if __name__ == "__main__":
    main()

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

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) cin >> A[i];
  int ret = 0;
  for (int i = 0; i < N; i++) {
    int minj = i;
    for (int j = i+1; j < N; j++) {
      if (A[j] < A[minj]) minj = j;
    }
    if (minj != i) {
      swap(A[i], A[minj]);
      ret++;
    }
  }
  cout << A[0];
  for (int i = 1; i < N; i++) cout << ' ' << A[i];
  cout << endl;
  cout << ret << endl;
}


Measured memory_bytes: 3092
#import<iostream>
using namespace std;int s,d,a,i,N;main(){cin>>N;for(;i<N;++i,a=0){cin>>s>>d;for(;s-d;s/=2,d/=2){if(s%2)++a,++s;if(d%2)++a,--d;}cout<<a<<endl;}}

Measured memory_bytes: 3088
#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c;
  cin>>a>>b>>c;
  string ans="NO";
  for(int i=1;i<=10000000;i++){
    if((a*i)%b==c){
      ans="YES";
      break;
    }
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#pragma region InOutputMacros
#define ios\
    ios::sync_with_stdio(false);\
    cin.tie(nullptr);
#define VEC(type, name, size)\
    V<type> name(size);\
    IN(name)
#define VVEC(type, name, h, w)\
    VV<type> name(h, V<type>(w));\
    IN(name)
#define INT(...)\
    int __VA_ARGS__;\
    IN(__VA_ARGS__)
#define LL(...)\
    ll __VA_ARGS__;\
    IN(__VA_ARGS__)
#define STR(...)\
    string __VA_ARGS__;\
    IN(__VA_ARGS__)
#define CHAR(...)\
    char __VA_ARGS__;\
    IN(__VA_ARGS__)
#define DOUBLE(...)\
    DOUBLE __VA_ARGS__;\
    IN(__VA_ARGS__)
#define LD(...)\
    LD __VA_ARGS__;\
    IN(__VA_ARGS__)
template <class T> void scan(T &a) { cin >> a; }
template <class T> void scan(vector<T> &a) { for(auto &i : a) scan(i); }
template <class T, class L> void scan(pair<T, L> &p){ scan(p.first); scan(p.second); }
void IN() {}
template <class Head, class... Tail> void IN(Head &head, Tail &... tail) { scan(head); IN(tail...); }
template <class T> void print(T x){ cout << x << '\n';}
#pragma endregion
#pragma region Macros
#define ll long long
#define ld long double
#define FOR(i,l,r) for(ll i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define REPS(i,n) FOR(i,1,n+1)
#define RFOR(i,l,r) for(ll i=(l);i>=(r);--i)
#define RREP(i,n) RFOR(i,n-1,0)
#define RREPS(i,n) RFOR(i,n,1)
#define pb push_back
#define eb emplace_back
#define SZ(x) ((ll)(x).size())
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
template<class T = ll> using V = vector<T>;
template<class T = ll> using VV = V<V<T>>;
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; }
inline void Yes(bool b = true) {cout << (b ? "Yes" : "No") << '\n';}
inline void YES(bool b = true) {cout << (b ? "YES" : "NO") << '\n';}
inline void err(bool b = true) {if(b) {cout << -1 << '\n'; exit(0);}}
template<class T> inline void fin(bool b = true, T e = 0) {if(b) {cout << e << '\n'; exit(0);}}
template<class T> T Roundup_div(T x, T y) {return (x+(y-1))/y;}
template <typename T> T pow(T a, long long n, T e = 1) {T ret = e; while (n) {if (n & 1) ret *= a; a *= a; n >>= 1; } return ret; }
const ll INF = 1e18;
const ld eps = 1e-8;
#pragma endregion

void solve(){
    LL(a, b);
    if(a < b) swap(a, b);
    if(a == b){
        print(2 * a - 2);
        return;
    }
    if(a == b + 1){
        print(2 * b - 2);
        return;
    }
    ll c = floor(sqrt(a * b));
	if(c * c >= a * b) c--;
    if(c * (c + 1) >= a * b) print(2 * c - 2);
    else print(2 * c - 1);
}

int main(){
    ios;
    INT(t);
    while(t--) solve();
}

Measured memory_bytes: 3712
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
const double PI=3.14159265358979323846;
const in MOD = 1000000007;
const in INF=1e18+7;
const int inf=1e9+7;
using P=pair<int,int>;
vector<int> dx={0,1,-1,0};
vector<int> dy={1,0,0,-1};



int main(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cout << fixed << setprecision(10);
    int a,b,c;
    cin>>a>>b>>c;
    int x=b/a;
    cout<<min(x,c)<<endl;
}
//./problem.exe

Measured memory_bytes: 256
import numpy as np

N, M = map(int, input().split())
A = np.array([[i for i in input()] for j in range(N)])
B = np.array([[i for i in input()] for j in range(M)])

found = False
for i in range(N-M+1):
    for j in range(N-M+1):
        P = A[i:i+M,j:j+M]
        if (P == B).all():
            print("Yes")
            found = True
            break
    if found: break
if not found:
    print("No")

Measured memory_bytes: 12416
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <string>
#include <vector>
#include <bitset>
#define ls id<<1
#define rs id<<1|1
using namespace std;
typedef long long ll;
int n;
ll a[400000];
int ans[400000];
int l,r;
inline int check(int x){
	ans[1]=x*2;
	int t=x,tmp;
	bool flag=0;
	for(int i=1;i<n;++i){
		flag^=1;
		tmp=a[i]-t;
		if(tmp<0)return flag;
		ans[i+1]=tmp*2;
		t=tmp;
	}
	flag^=1;
	tmp=a[n]-t-x;
	if(tmp<0)return flag;
	else if(tmp>0)return flag^1;
	ans[n]=t*2;
	return -1;
}

int main(){
	cin>>n;
	for(int i=1;i<=n;++i)cin>>a[i];
	l=0,r=2e9;
	while(l<r){
		int mid=(l+r)>>1;
		int f=check(mid);
		if(f==1)r=mid;
		else if(f==0) l=mid+1;
		else break;
	}
	for(int i=1;i<=n;++i)
		printf("%d ",ans[i]);
	return 0;
}


Measured memory_bytes: 4224
#include "bits/stdc++.h"

#define REP(i,num) for(ll i=0;i<(num);++i)
#define LOOP(i) while(i--)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto pitr=c.begin();pitr!=c.end();++pitr){cout<<*pitr;if(next(pitr,1)!=c.end())cout<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=ll>
T in(){T x; cin >> x; return (x);}
template<typename T=ll,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

template<typename T>
bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template<typename T>
bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}

class UnionFind{
	vector<ll> rank;
	vector<ll> diff_weight;
	vector<ll> num;
public:
	vector<ll> par;

	UnionFind(ll N):par(N),num(N),rank(N),diff_weight(N){
		for(ll i=0;i<N;i++){
			par[i]=i;
			num[i]=1;
			rank[i]=0;
			diff_weight[i]=0;
		}
	}

	ll root(ll x){
		if(par[x]==x){
			return x;
		}
		ll r = root(par[x]);
		diff_weight[x]+=diff_weight[par[x]];
		return par[x]=r;
	}

	void unite(ll x,ll y){
		ll rx = root(x);
		ll ry = root(y);
		if (rx == ry) return;
		if(rank[rx]<rank[ry]) swap(rx,ry);
		if(rank[rx]==rank[ry]) ++rank[rx];
		par[ry] = rx;
		num[rx] += num[ry];
	}

	void relate(ll x,ll y,ll w){
		w+=weight(x),w-=weight(y);
		ll rx = root(x);
		ll ry = root(y);
		if (rx == ry) return;
		if(rank[rx]<rank[ry]){
			swap(rx,ry);
			w = -w;
		}
		if(rank[rx]==rank[ry]) ++rank[rx];
		par[ry] = rx;
		diff_weight[ry] = w;
		num[rx] += num[ry];
	}

	bool same(ll x,ll y){
		ll rx = root(x);
		ll ry = root(y);
		return rx == ry;
	}

	ll getsize(ll x){
		return num[root(x)];
	}

	ll weight(ll x){
		root(x);
		return diff_weight[x];
	}

	ll diff(ll x,ll y){
		return weight(y)-weight(x);
	}
};

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

	int N=in(),M=in();
	vll V=vecin(N);
	UnionFind uf(N);
	REP(i,M){
		int u=in()-1,v=in()-1;
		uf.unite(u,v);
	}

	ll S=0;
	REP(i,N){
		if(uf.root(i)==uf.root(V[i]-1)) S++;
	}
	out(S);
	return 0;
}


Measured memory_bytes: 4224
s = int(input())
l, r = s / 100, s % 100
if 1 <= l <= 12:
    if 1 <= r <= 12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
elif 1 <= r <= 12:
    print('YYMM')
else:
    print('NA')


Measured memory_bytes: 9064
#include <bits/stdc++.h>
using namespace std;
 
int main() {
 int A,B,C,D,L,R;
  
  cin >> A >> B >> C >> D;
  L=A+B;
  R=C+D;
  if(L>R){
  	cout << "Left" << endl;
  }else if(L==R){
  	cout << "Balanced" << endl;
  }else if(L<R){
  	cout << "Right" << endl;
  }
}

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

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

    if(S.at(0) == 'R' && S.at(1) == 'R' && S.at(2) == 'R'){
        cout << 3 << endl;
    }else if(S.at(0) == 'R' && S.at(1) == 'R'){
        cout << 2 << endl;
    }else if(S.at(1) == 'R' && S.at(2) == 'R'){
        cout << 2 << endl;
    }else if(S.at(0) == 'S' && S.at(1) == 'S' && S.at(2) == 'S'){
        cout << 0 << endl;
    }else {
        cout << 1 << endl;
    }
}

Measured memory_bytes: 3620
#include<stdio.h>
int main(void)
{
	double f,e,x;
	int a,b,d,r;
	
	scanf("%d %d",&a,&b);
	
	d=a/b;
	r=a%b;
	
	e=a;
	x=b;
	
	f=e/x;
	
	printf("%d %d %1f",d,r,f);
	return 0;
}

Measured memory_bytes: 1068
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;
#define MAXN 100000
int n;
// edge[i].firstはどことつながっているか,secondはその重みを示す
vector<vector<pair<int, int> > > edge;

int main(void) {
    cin >> n;
    edge.reserve(n);
    for (int i = 0; i < n-1; i++) {
        int tmp, tmp1, tmp2;
        cin >> tmp >> tmp1 >> tmp2;
        edge[tmp].push_back(make_pair(tmp1, tmp2));
        edge[tmp1].push_back(make_pair(tmp, tmp2));
    }
    // 適当な点(0)からスタート
    long long start0[n];
    for (int i = 0; i < n; i++) start0[i] = -1;
    start0[0] = 0;
    queue<int> q;
    q.push(0);
    int max = 0, max_index = 0;
    while (!q.empty()) {
        int now = q.front(); q.pop();
        for (int i = 0; i < edge[now].size(); i++) {
            int next = edge[now][i].first;
            if (start0[next] == -1) {
                start0[next] = start0[now] + edge[now][i].second;
                q.push(next);
            }
        }
    }
    for (int i = 0; i < n; i++) {
        if (max < start0[i]) {
            max = start0[i];
            max_index = i;
        }
    }
    
    //printf("max: %d index: %d\n", max, max_index);

    long long start_max[n];
    for (int i = 0; i < n; i++) start_max[i] = -1;
    start_max[max_index] = 0;
    queue<int> qm;
    qm.push(max_index);
    int maxmax = 0, maxmax_index = 0;
    while (!qm.empty()) {
        int now = qm.front(); qm.pop();
        for (int i = 0; i < edge[now].size(); i++) {
            int next = edge[now][i].first;
            if (start_max[next] == -1) {
                start_max[next] = start_max[now] + edge[now][i].second;
                qm.push(next);
            }
        }
    }
    for (int i = 0; i < n; i++) {
        if (maxmax < start_max[i]) {
            maxmax = start_max[i];
            maxmax_index = i;
        }
    }
    cout << maxmax << endl;

    return 0;
}

Measured memory_bytes: 9224
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

int main() {
	ll n,k;
	cin>>n>>k;
	ll sum=0;
	for(ll i=n-2;i>=0;i--){
		sum+=i;
	}
	if(sum<k){
		cout << -1;
		return 0;
	}
	cout << n-1+sum-k<<endl;	
	for(ll i=0;i<n-1;i++){
		cout << 1<<" ";
		cout << i+2<<endl;
	}
	sum=sum-k;
	if(sum==0){
		return 0;
	}
	for(ll i=2;i<=n;i++){
		for(ll j=i+1;j<=n;j++){
			cout << i << " "<<j<<endl;
			sum--;
			if(sum==0){
				return 0;
			}
		}
	}
	// your code goes here
	return 0;
}

Measured memory_bytes: 256
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007

#A
def A():
    s = LS()
    t = sorted(s)
    if s[0] == s[1]:
        print("=")
    elif s[0] == t[0]:
        print("<")
    else:
        print(">")

#B
def B():
    return

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == "__main__":
    A()


Measured memory_bytes: 38512
#include <iostream>
#include <algorithm>
#include <string>
#include <stdlib.h>
#include <vector>
#include <climits>
#include <math.h>
#include <map>
#include <set>
using namespace std;
int main()
{
	string s;
	cin>>s;int flag=0;
		if (s[0]=='7' || s[1]=='7' || s[2]=='7')
		{
			flag=1;
		}
	if (flag==1)
	{
		cout<<"Yes";
	}
	else
		cout<<"No";
}

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

int main(){
    int a,b;
    cin >> a >> b;
    int v[1000];
    v[1]=1;
    for(int i=1;i<1000;i++){
        v[i+1]=v[i]+i+1;
    }
    for(int i=1;i<1000;i++){
        if(v[i+1]-v[i]==b-a){
            cout << v[i]-a << endl;
            return 0;
        }
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <fstream>
#include <string>
#include <math.h>
#include <cstdlib>
#include <istream>
#include <sstream>
#include <cctype>
#define fore(i,x,y) for(long long i=x;i<y;i++)
typedef long long ll;
using namespace std;
int main()
{
	int A,B,C,D;
	cin>>A>>B>>C>>D;
	if(A+B<C+D){
		cout << "Right" << endl;
	}
	else if(A+B>C+D){
		cout << "Left" << endl;
	}
	else{
		cout << "Balanced" << endl;
	}
}

Measured memory_bytes: 256
import itertools

N = int(input())
A = [0] * N
xy_list = [0] * N
for i in range(N):
    A[i] = int(input())
    xy = [0] * A[i]
    for j in range(A[i]):
        xy[j] = tuple(int(x) for x in input().split())
    xy_list[i] = xy

m = 0
for p in itertools.product([0, 1], repeat=N):
    for i in range(N):
        if p[i] == 0:
            continue
        for j in range(A[i]):
            x, y = xy_list[i][j]
            if p[x - 1] != y:
                break
        else:
            continue
        break
    else:
        s = sum(p)
        if s > m:
            m = s
print(m)


Measured memory_bytes: 3064
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_map>
#include<climits>
#include<cstdlib>
#include<cmath>
#include<string>
#include<iomanip>
#include<bitset>
#include<list>

using namespace std;

#define ll long long int

ll const MOD = 1000000007;
ll const INF = (long long int)1 << 61;

ll mypow(ll x,ll n,ll mod = MOD){
    ll ret = 1;
    while(n > 0){
        if(n&1){
            ret = (ret*x)%mod;
        }
        x = (x*x)%mod;
        n >>= 1;
    }
    return ret;
}

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

ll twoPow(ll shiftNum){
    return (1LL << (shiftNum - 1));
}

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

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

    ll ans = a[0];
    for(int i = 1; i < n; i++){
        ans += max(a[i] - a[i-1],0LL);
    }

    cout << ans << endl;

    return 0;
}

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

///******************************** C o n t a i n e r ********************************///

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef map<int,int> mii;
typedef map<ll,int> mli;

///*********************************** C o n s t ***********************************///

const int       N=1e6+3;
const double    PI = acos(-1);
const ll        MOD=1000000007;  ///1e9+7

///********************************** M a r c o ***********************************///

#define pb push_back
#define F first
#define S second
#define test int tc; cin>>tc; while(tc--)
#define forn(i,n) for(i=0;i<n;i++)
#define rforn(i,n) for(i=n-1;i>=0;i--)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define sz(x) x.size()
#define el <<'\n'
#define sp <<' '
#define print(a) {for(auto x:a)cout<<x<<" ";cout<<endl;}
#define mem(a,b) memset(a, b, sizeof(a))
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b)))
#define sqr(a) (a)*(a)

#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);

///*********************************** F u n c t i o n ***********************************///

ll powmod(ll a,ll b){ll p=MOD;a%=p;if(!a) return 0;ll pr=1;while(b>0){if(b&1){pr*=a;pr%=p;--b;}a*=a;a%=p;b/=2;}return pr;}
bool isPrime(ll n){ if(n<=1)return false;if(n<=3)return true;if(n%2==0 or n%3==0)return false;for(ll i=5;i*i<=n;i+=6){if(n%i==0 or n%(i+2)==0)return false;}return true;}
void seive(bool a[]){ll mx=sqrt(N),ii,jj;for(ii=3;ii<=mx;ii+=2)if(!a[ii])for(jj=ii*ii;jj<=N;jj+=2*ii)a[jj]=true;}
void numofdiv(ll a[]){ll mx=sqrt(N),ii,jj;for(ii=1;ii<=mx;ii++){for(jj=ii*ii;jj<=N;jj+=ii){if(jj==ii*ii) a[jj]++; else a[jj]+=2;}}}
void sumofdiv(ll a[]){ll mx=sqrt(N),ii,jj;for(ii=1;ii<=mx;ii++){for(jj=ii*ii;jj<=N;jj+=ii){if(jj==ii*ii) a[jj]+=ii; else a[jj]+=ii+jj/ii;}}}

///**************************************************** C o d e ****************************************************///
///-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=///



void _case()
{
    ll n;
    cin>>n;
    ll a[n+1],c=0;
    for(ll i=1;i<=n;i++) cin>>a[i];
    for(ll i=1;i<=n;i++) if(a[i]&1 and i&1) c++;
    cout<<c el;

}

main()
{
//    fastio();
//    test _case();
//    while(1) _case();
        _case();

}


///Thank you.


///Brainless_Loco Terminates Here!


Measured memory_bytes: 3596
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
using namespace std;
#define INF 1e9
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, n) for(int i = 0; i < n; i = i + 2)
#define repv(i, n, v) for(int i = 0; i < n; i = i + v)
#define rrep(i, n) for(int i = n; i >= 0; i--)
#define sortI(a, b, c) c == 0 ? sort(a, a + b) : sort(a, a + b, greater<int>())
#define sortS(s, a) a == 0 ? sort(s.begin(), s.end()) : sort(s.begin(), end(), greater<char>)
#define vi vector<int>
#define vf vector<float>
#define vc vector<char>
#define vs vector<string>
#define ll long long
#define lint long int
#define llint long long int
#define atoz abcdefghijklmnopqrstuvwxyz
#define atoZ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
#define AtoZ ABCDEFGHIJKLMNOPQRSTUVWXYZ

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

int main(void){

  //入力
  int N, M;
  cin >> N >> M;
  
  //配列
  int city[N] = {0};
  int a[M], b[M];
  rep(i, M){
    cin >> a[i] >> b[i];
    city[ a[i] - 1 ]++;
    city[ b[i] - 1 ]++;
  }
  
  rep(i, N) cout << city[i] << endl;

  return 0;
}

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

int main ()
{
int x,y;
cin>>x>>y;
if(y>x*4||y%2!=0||x>y/2)
    cout<<"No\n";
else
    cout<<"Yes\n";

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


Measured memory_bytes: 3648
#include <iostream>
#include <vector>

using namespace std;
using ll = long long;

int main() {
  int n;
  cin >> n;
  vector<ll> vec(26, 0);
  for (int i = 0; i < n; ++i) {
    char c;
    cin >> c;
    ++vec[c - 'a'];
  }

  ll ans = 1;
  for (int i = 0; i < 26; ++i)
    ans = (ans * (vec[i] + 1) ) % 1000000007;
  cout << ans - 1 << endl;
}


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

 
int main(){
  
  int n,k;
  cin>>n>>k;
  if(n>=10)cout<<k<<endl;
  else cout<<k+100*(10-n)<<endl;
}

Measured memory_bytes: 256