akhauriyash/Code-Regression huggingface dataset:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

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

    static class AGC30_1 {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int A = in.nextInt();
            int B = in.nextInt();
            int C = in.nextInt();
            int geta = 0;

            if (A + B < C) {
                geta = 1;
            }

            if (B > C) {
                out.println(B + C + geta);
                return;
            } else {
                int diff = C - B;
                if (A > diff) {
                    out.println(B + B + diff + geta);
                } else {
                    out.println(B + B + A + geta);
                }
            }

        }

    }
}



Measured memory_bytes: 22740
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <algorithm>
#define rep(i,n) for(int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
using namespace std;
using Graph = vector<vector<int>>;
typedef long long ll;
const int mod= 1e+9+7;

int main(){
    ll N; cin>>N;
    ll k;
    map<ll,ll>mp;
    for(int i=2;i<=N;i++){
        k=i;
        for(int j=2;j<=i;j++){
            while(k%j==0){
                k/=j;
                mp[j]++;
            }
        }
    }
    ll ans=1;
    for(auto p:mp){
        ans*=p.second+1;
        ans%=mod;
    }
    cout<<ans<<endl;
}




Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl "\n"
#define all(s) s.begin(),s.end()
#define pb push_back
#define pi 3.1415926536
#define dig(a) fixed<<setprecision(a)
#define fast() ios_base::sync_with_stdio(false); cin.tie(NULL);
ll power(ll a, ll n) {ll res = 1; while (n) {if (n % 2) {res *= a;} n >>= 1; a *= a;} return res;}
ll powerm(ll a, ll n, ll m) {ll res = 1; while (n) {if (n % 2) {res = (res * a) % m;} n >>= 1; a = (a * a) % m;} return res;}

const int M=1e9+7;
ll mod(ll x){
      return ((x%M + M)%M);
}
ll add(ll a, ll b){
      return mod(mod(a)+mod(b));
}
ll mul(ll a, ll b){
      return mod(mod(a)*mod(b));
}
ll minu(ll a, ll b){
	return mod(mod(a)-mod(b));
}

int main(){
	fast();
	int test=1;
	//cin>>test;
	while(test--){
		ll n;
		cin>>n;
		if(n==1){
			cout<<0<<endl;
			continue;
		}
		if(n==2){
			cout<<2<<endl;
			continue;
		}
		ll a1 = add(powerm(10,n,M),powerm(8,n,M));
		ll a2 = mul(2,powerm(9,n,M));
		ll ans = minu(a1,a2);
		cout<<ans;
		
	}
	return 0;
}


Measured memory_bytes: 3688
#include <bits/stdc++.h>
using namespace std;
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#define fi first
#define se second
#define dbg(...) _dbg(#__VA_ARGS__",", __VA_ARGS__)
void _dbg(string){cout<<endl;}
template<class H,class... T> void _dbg(string s,H h,T... t){int l=s.find(',');cout<<s.substr(0,l)<<" = "<<h<<", ";_dbg(s.substr(l+1),t...);}
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

#define INF 1120000000

int main(){
  int h,w,n,m;
  cin>>h>>w>>n>>m;

  long plus = ((h+n-1)/n) * ((w+m-1)/m);
  long neg = (h/n)*(w/m);
  long a = 999999999;
  long b = -1000000000;

  if( plus*a + neg*b <= 0 ){
    cout << "No" << endl;
    return 0;
  }

  cout << "Yes" << endl;
  rep(i,h) rep(j,w){
    int d = 0;
    if((i+1)%n==0 && (j+1)%m==0) d = b;
    if(i%n==0 && j%m==0) d = a;
    printf("%d%c", d, " \n"[j==w-1]);
  }



  return 0;
}


Measured memory_bytes: 2944
#include<bits/stdc++.h>
using namespace std;
int a,b,c;
int main(){
  cin>>a>>b;
  vector<int>d(a,0);
  for(int i=0;i<b*2;i++){
    cin>>c;
    d[c-1]++;
  }
  for(int i=0;i<a;i++)cout<<d[i]<<endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>

using namespace std;

int dp[10000000];

int main()
{
	for(;;){
		int n;		//d³
		int g[6] 	= {200, 300, 500, 1000, 1200, 1500};
		int kane[6] = {380, 550, 850, 1520, 1870, 2244};
		
		fill(dp,dp+1000000, 10000000);
		
		dp[0] = 0;
		
		cin >> n;
		
		if(n == 0){
			break;
		}
		
		//d³ÜÅ
		for(int i = 0; i <= n*2; i+=100){
			for(int j = 0; j < 6; j++){
				if(i-g[j] < 0){
					continue;
				}
				if(dp[i-g[j]]+kane[j] < dp[i]){
					dp[i] = dp[i-g[j]]+kane[j];
				}
			}
		} 
		 /*
		for(int i = 0; i <= n*2; i+= 100){
			
			for(int j = 1;; j++){
				if(dp[i] < dp[i+j*100]){
					break;
				}
				else{
					dp[i] = dp[i+j*100];
				//	cout <<"*" <<dp[i] << endl;
				}
			}
	//		cout << dp[i] << endl;
		}
		
		*/
		
		cout << dp[n] << endl;
	}
	
	return 0;
}

Measured memory_bytes: 4772
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <cstdio>
#include <cstring>
using namespace std;

int main()
{
    int64_t x;
    cin >> x;

    int64_t t = x / 11;
    int64_t m = x % 11;

    int64_t ans = t * 2 + (m == 0 ? 0 : m <= 6 ? 1 : 2);

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map;
import java.util.Queue;
import java.util.Scanner;
import java.util.Set;

public class Main {
    void run() {
        Scanner sc = new Scanner(System.in);
        while (true) {
            int n = sc.nextInt();
            if (n == 0)
                break;
            Map<String, String> map = new HashMap<String, String>();
            String first = "";
            for (int i = 0; i < n; i++) {
                String tmp[] = sc.next().replace(".", "").split(":");
                map.put(tmp[0], tmp[1]);
                if (i == 0)
                    first = tmp[0];
            }
            Set<String> set = new HashSet<String>();
            Set<String> tag = new HashSet<String>();
            Queue<String> q = new LinkedList<String>();
            q.add(first);
            while (!q.isEmpty()) {
                String str = q.poll();
                if (tag.contains(str)) {
                    continue;
                }
                tag.add(str);
                String strs[] = map.get(str).split(",");
                for (int i = 0; i < strs.length; i++) {
                    if (map.containsKey(strs[i])) {
                        if (tag.contains(strs[i]))
                            continue;
                        q.add(strs[i]);
                    } else {
                        set.add(strs[i]);
                    }
                }
            }
            System.out.println(set.size());
        }
    }

    public static void main(String[] args) {
        new Main().run();
    }
}

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

using namespace std;

int d[10];
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    int N, K;
    cin >> N >> K;
    for(int i = 0; i < K ; i++){
        int temp;
        cin >> temp;
        d[temp] = 1;
    }

    for(int i = N ; i < 1000000 ; i++){
        int temp = i;
        bool v = false;
        while(temp > 0){
            int digit = temp % 10;
            temp /= 10;
            if(d[digit]){
                v = false;
                break;
            }
            v = true;
        }

        if(v){
            cout << i << "\n";
            return 0;
        }
    }
}

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

using namespace std;

typedef long long ll;

int main()
{
    ll A, B, C, K;
    cin >> A >> B >> C >> K;
    ll sum = 0;
    if (K <= A)
    {
        cout << K << endl;
        return 0;
    }
    if(K - A <= 0) {
        cout << A << endl;
        return 0;
    }
    cout << A - (K - A - B) << endl;
}

Measured memory_bytes: 3648
#ifndef LOCAL
#pragma GCC optimize("O3")
#endif
#include "bits/stdc++.h"
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

typedef long long ll;



int main() {
	ll a, b, c, k;
	cin >> a >> b >> c >> k;
	k %= 2;
	while(k--) {
		ll s = a + b + c;
		a = s - a;
		b = s - b;
		c = s - c;
		debug() << imie(a - b);
	}
	printf("%lld\n", a - b);
}


Measured memory_bytes: 256
a,b,c,x,y=[int(x) for x in input().split()]
def gauss(it):
    return max(it,0)
print(min([a*x+b*y,2*c*max(x,y),2*c*min(x,y)+a*gauss(x-min(x,y))+b*gauss(y-min(x,y))]))

Measured memory_bytes: 38420
#include <bits/stdc++.h>
#define ll long long
#define MODV 1000000007
#define INFLL LLONG_MAX // 9223372036854775807
#define EPS 1e-9
#define rep(i, n) for(ll i=0, i##_len=(ll)(n); i<i##_len; i++)
#define repf(i, n) for(ll i=1, i##_len=(ll)(n+1); i<i##_len; i++)
#define all(v) v.begin(), v.end()
#define endl "\n"
#define vi vector<ll>
#define vvi vector<vector<ll>>
#define Yes() cout << "Yes" << endl
#define YES() cout << "YES" << endl
#define No() cout << "No" << endl
#define NO() cout << "NO" << endl
#define Init() std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout<<fixed<<setprecision(15);
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; }
using namespace std;

template<typename Functor>
struct fix_type {
    Functor functor;

    template<typename... Args>
    decltype(auto) operator()(Args&&... args) const&
    { return functor(functor, std::forward<Args>(args)...); }
};

template<typename Functor>
fix_type<typename std::decay<Functor>::type> fix(Functor&& functor)
{ return { std::forward<Functor>(functor) }; }


int main(){
    Init();
    ll n, a, b, c; cin >> n >> a >> b >> c;
    vi l(n);
    rep(i, n) cin >> l[i];
    
    auto bf = fix([&](auto&& bf, ll i, ll sa, ll sb, ll sc){
        // n番目の竹まで計算が進んだ場合
        if(i == n){
            if(!sa || !sb || !sc) return (1LL<<60);
            else return abs(a-sa) + abs(b-sb) + abs(c-sc);
        }
        // i番目の竹をNull/A/B/Cのいずれかに含める 
        ll ret = bf(bf, i+1, sa, sb, sc);
        chmin(ret, bf(bf, i+1, sa+l[i], sb, sc) + (sa ? 10 : 0));
        chmin(ret, bf(bf, i+1, sa, sb+l[i], sc) + (sb ? 10 : 0));
        chmin(ret, bf(bf, i+1, sa, sb, sc+l[i]) + (sc ? 10 : 0));
        return ret;
    });

    cout << bf(0, 0, 0, 0) << endl;
}

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

int main() {
  int N;
  cin >> N;
  
  if (N/1000 == N/100%10 && N/100%10 == N/10%10){
    cout << "Yes" << endl;
  }
  else if (N/100%10 == N/10%10 && N/10%10 == N%10) {
    cout << "Yes" << endl;
  }
  else  {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 764
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define P pair<ll,ll>
#define lvector vector<ll> 
#define rep(i,n) for(ll (i)=0; (i)<(n); ++(i))
#define print(a) cout << (a) << endl

string getans(string s, char op1, char op2, char op3) {
  string ret(s);
  ret.insert(ret.begin()+1,op1);
  ret.insert(ret.begin()+3,op2);
  ret.insert(ret.begin()+5,op3);
  ret+="=7";
  return ret;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s,ans;cin>>s;
  ll a=s[0]-'0',b=s[1]-'0',c=s[2]-'0',d=s[3]-'0';
  if     (a+b+c+d==7) ans=getans(s,'+','+','+');
  else if(a+b+c-d==7) ans=getans(s,'+','+','-');
  else if(a+b-c+d==7) ans=getans(s,'+','-','+');
  else if(a+b-c-d==7) ans=getans(s,'+','-','-');
  else if(a-b+c+d==7) ans=getans(s,'-','+','+');
  else if(a-b+c-d==7) ans=getans(s,'-','+','-');
  else if(a-b-c+d==7) ans=getans(s,'-','-','+');
  else if(a-b-c-d==7) ans=getans(s,'-','-','-');
  print(ans);
  return 0;
}

Measured memory_bytes: 256
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
#from fractions import gcd
#from itertools import combinations # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n = I()
A = [0] + readInts() + [0]
all = 0
for i in range(1,n+2):
    all += abs(A[i-1] - A[i])
#print(all)
nya = all
for i in range(1,n+1):
    all = nya
    all -= abs(A[i-1] - A[i])
    all -= abs(A[i] - A[i+1])
    all += abs(A[i-1] - A[i+1])
    print(all)


Measured memory_bytes: 14304
#if 0
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <list>

auto& in = std::cin;
auto& out = std::cout;
#define all(C) std::begin(C), std::end(C)
const double PI = 3.141592653589793238462643383279502884197169399375105820974944;

int32_t N;
char map[300][310];

int main()
{
	using std::endl;
	in.sync_with_stdio(false);
	out.sync_with_stdio(false);
	in.tie(nullptr);
	out.tie(nullptr);

	in >> N;
	for (int32_t i = 0; i < N; i++)
	{
		in >> map[i];
	}

	bool is_same = true;

	for (int32_t i = 0; i < N; i++)
	{
		for (int32_t j = 0; j < N; j++)
		{
			if (map[i][j] != map[0][0]) {
				is_same = false;
			}
		}
	}
	if (is_same) {
		out << N * N << endl;
	}

	return 0;
}
#endif


#if 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <list>

auto& in = std::cin;
auto& out = std::cout;
#define all(C) std::begin(C), std::end(C)
const double PI = 3.141592653589793238462643383279502884197169399375105820974944;

int32_t N;
char map[300][400];
int num[256];
int main()
{
	using std::endl;
	in.sync_with_stdio(false);
	out.sync_with_stdio(false);
	in.tie(nullptr);
	out.tie(nullptr);

	in >> N;
	for (int32_t i = 0; i < N; i++)
	{
		in >> map[i];
	}

	int32_t res = 0;
	for (int32_t w = 0; w < N; w++)
	{
		bool some_is_one = false;
		int h = 0;
		for (int32_t i = 0; i < N; i++)
		{
			for (int32_t j = 0; j < N; j++) {
				if (map[(h + i) % N][(w + j) % N] != map[(h + j) % N][(w + i) % N]) {
					some_is_one = true;
					break;
				}
			}
		}
		if (!some_is_one) {
			res += N;
		}
	}

		out << res << endl;
		return 0;




}
#endif


Measured memory_bytes: 384
fig = input()
symbol = fig.split(' ')
stack = []

for i in symbol:
    try:
        stack.append(int(i))
    except ValueError:
       if i == "+": stack.append(stack.pop()+stack.pop())
       elif i == "-": stack.append(-(stack.pop()-stack.pop()))
       elif i == "*": stack.append(stack.pop()*stack.pop())

print(stack[0])

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

const int64_t MOD = 1000000007;
typedef int64_t ll;
typedef uint64_t ull;

#define FOR(i, start, end) for(uint64_t i=start; i<end; i++)
#define REP(i, n) FOR(i, 0, n)

// 最大公約数gcd
// 最小公倍数lcm=m*n/gcd
uint64_t gcd(uint64_t m, uint64_t n) {
  uint64_t temp;
  while (m % n != 0){
    temp = n;
    n = m % n;
    m = temp;
  }
  return n;
}

uint64_t lcm(uint64_t m, uint64_t n) {
  return (m*n)/gcd(m,n);
}

// vector<vector<uint64_t> > v(n+1, vector<uint64_t>(n+1, 0))
// v[n][k]に組み合わせ数が入る。
void comb(vector<vector <uint64_t> > &v){
  for(uint64_t i = 0;i <v.size(); i++){
    v[i][0]=1;
    v[i][i]=1;
  }
  for(uint64_t k = 1;k <v.size();k++){
    for(uint64_t j = 1;j<k;j++){
      v[k][j]=(v[k-1][j-1]+v[k-1][j]);
    }
  }
}

// 掛け算オーバーフロー判定
bool is_product_overflow(uint64_t a, uint64_t b) {

	uint64_t prod = a * b;
	
	return (prod / b != a);
}

//素因数分解
void primeFactorization(uint64_t a, list<uint64_t> &factors){ //素因数分解を出力するプログラム
  long i,sq;
  if(a%2==0){ //偶数の場合
    factors.push_back(2);
    primeFactorization(a/2,factors); //2で割った値で再帰
    return;
  }
  sq = sqrt(a);
  for(i=3;i<=sq;i+=2){ //3以上√a以下の奇数の場合
	if(a%i==0){
	  factors.push_back(i);
      primeFactorization(a/i,factors); //割れた値で再帰
      return;
	}
  }
  //偶数でも3以上√a以下の奇数の場合でも割り切れない場合
  if(a!=1){ //aが1でないなら、a自身は素数
    factors.push_back(a);
  }
}

// フェルマーの小定理
// mod. m での a の逆元 a^{-1} を計算する
// (a/b)%m = a*movinv(b,m)%m  
int64_t modinv(int64_t a, int64_t m) {
    int64_t b = m, u = 1, v = 0;
    while (b) {
        int64_t t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

// 円周率
// M_PI

// #include <iomanip> // setprecisionを使用するのに必要
// cout << std::fixed << std::setprecision(15) << y << endl;

// 昇順
// priority_queue<int, vector<int>, greater<int> > queue;

signed main() {
  int n;
  cin >> n;
  
  vector<ull> a(n);
  for(int i=0;i<n;i++){
    cin >> a[i];
  }
  
  bool pairwise = true;

  
  char flag[1000001] = {};
  ull g = a[0];
  for(int i=0;i<n;i++){
    g = gcd(g,a[i]);
    if(!pairwise&&1==g) break;
    if(!pairwise) continue;
    list<ull> factors;
    primeFactorization(a[i], factors);
    factors.sort();
    factors.unique();
    for(auto f:factors){
      if(1==flag[f]){
        pairwise = false;
      }
      flag[f] = 1;
    }
  }
  
  if(pairwise){
    cout << "pairwise coprime" << endl;
  }
  else if(g==1){
    cout << "setwise coprime" << endl;
  }
  else{
    cout << "not coprime" << endl;
  }
    
  return 0;
}



Measured memory_bytes: 11844
#include <bits/stdc++.h>
using namespace std;
#define SZ(v) int((v).size())
#define ALL(vec) begin(vec), end(vec)
typedef long long i64;
template<typename T> inline bool uax(T &x, T y) {return (y > x) ? x = y, true : false;}
template<typename T> inline bool uin(T &x, T y) {return (y < x) ? x = y, true : false;}
#ifdef Rahul
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); \
  stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
#else
#define error(...) 42;
#endif
string to_string(char c) { return "'" + string(1, c) + "'";}
string to_string(string s) { return '"' + s + '"';}
string to_string(const char* s) { return to_string((string) s);}
template<typename A> string to_string(A);
template<typename A, typename B> string to_string(pair<A, B> p){
  return "(" + to_string(p.first) + ": " + to_string(p.second) + ")";}
template<typename A> string to_string(A v) {bool f = false; string r = "{"; 
  for (auto x: v) {if (f) r += ", "; r += to_string(x); f = true;} return r += "}";}
template<typename A> string to_string(vector<vector<A>> v) {string r; 
  for (auto x: v) r += "\n" + to_string(x); return r;}
int Nerr;
template<typename A> string to_string(A *p) {return to_string(vector<A>(p, p + Nerr));}
void err(istream_iterator<string>) { cerr << endl; }
template<typename T,typename... Args> void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " =: " << to_string(a) << "; "; err(++it, args...); }
template<typename T> void kek(T ans) {cout << ans << endl; exit(0);}
int const MOD = 1e9 + 7;
long long const INF = 1e18 + 42;
/***********************************************************************/

int32_t main() {
  cin.tie(nullptr) -> sync_with_stdio(false);
  
  int a, b, c;
  cin >> a >> b >> c;
  if (a == b && a != c) kek("Yes");
  if (a == c && a != b) kek("Yes");
  if (c == b && a != c) kek("Yes");
  kek("No");
}


Measured memory_bytes: 256
#include <stdio.h>
using namespace std;

int main()
{
    int Score[2];
    char grade;

    while (true)
    {
        scanf("%d %d %d", &Score[0], &Score[1], &Score[2]);

        if (Score[0] == -1 && Score[1] == -1 && Score[2] == -1)
            break;

        if (Score[0] == -1 || Score[1] == -1)
        {
            grade = 'F';
        }
        else if (Score[0] + Score[1] >= 80)
        {
            grade = 'A';
        }
        else if (Score[0] + Score[1] >= 65)
        {
            grade = 'B';
        }
        else if (Score[0] + Score[1] >= 50)
        {
            grade = 'C';
        }
        else if (Score[0] + Score[1] >= 30)
        {

            grade = (Score[2] >= 50) ? 
                    'C' : 'D';
        }
        else{
            grade = 'F';
        }
        printf("%c\n",grade);

    }


}


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

int32_t main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t = 1;
    // cin >> t;
    while (t--) {
        int h, w, k;
        cin >> h >> w >> k;
        vector<string> a(h);
        int b = 0;
        for (int i = 0; i < h; i++) {
            cin >> a[i];
            for (char c : a[i]) {
                if (c == '#') b++;
            }
        }
        if (b < k) {
            cout << 0;
            return 0;
        }
        int ans = 0;
        for (int r = 0; r <= (1 << h) - 1; r++) {
            for (int c = 0; c <= (1 << w) - 1; c++) {
                int cnt = 0;
                vector<vector<int>> vis(h, vector<int>(w));
                for (int i = 0; i < h; i++) {
                    if (r & (1 << i)) {
                        for (int j = 0; j < w; j++) {
                            if (a[i][j] == '#') cnt++;
                            vis[i][j] = 1;
                        }
                    }
                }
                for (int i = 0; i < w; i++) {
                    if (c & (1 << i)) {
                        for (int j = 0; j < h; j++) {
                            if (a[j][i] == '#' && !vis[j][i]) cnt++;
                        }
                    }
                }
                if (b - cnt == k) {
                    // cout << r << " " << c << endl;
                    ans++;
                }
            }
        }
        cout << ans;
    }
    return 0;
}

Measured memory_bytes: 3660
#![allow(unused_imports)]
#![allow(dead_code)]

use proconio::input;
use proconio::marker::{Bytes, Chars};
use std::collections::*;

fn main() {
    input! {
        n:usize,
        s:[String;n]
    }
    let mut count: BTreeMap<String, usize> = BTreeMap::new();
    count.entry("AC".to_string()).or_insert(0);
    count.entry("WA".to_string()).or_insert(0);
    count.entry("TLE".to_string()).or_insert(0);
    count.entry("RE".to_string()).or_insert(0);
    for x in s {
        *count.entry(x).or_insert(0) += 1;
    }
    println!("AC x {}", count["AC"]);
    println!("WA x {}", count["WA"]);
    println!("TLE x {}", count["TLE"]);
    println!("RE x {}", count["RE"]);
}

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

template <typename InputIterator>
typename InputIterator::value_type summation(InputIterator first,
                                             InputIterator last) {
  return std::accumulate(first, last, typename InputIterator::value_type());
}
template <typename T>
std::istream &operator>>(std::istream &stream, std::vector<T> &v);
template <typename T1, typename T2>
std::istream &operator>>(std::istream &stream, std::pair<T1, T2> &p);
template <typename T>
std::istream &operator>>(std::istream &stream, std::vector<T> &v) {
  for (auto &i : v) {
    stream >> i;
  }
  return stream;
}
template <typename T1, typename T2>
std::istream &operator>>(std::istream &stream, std::pair<T1, T2> &p) {
  stream >> p.first >> p.second;
  return stream;
}

class union_find {
 public:
  using tp = std::vector<size_t>::size_type;
  // 取り扱う型.

  explicit union_find(const tp n) : parent(n), rank(n, 0), cache() {
    for (tp i = 0; i < n; i++) {
      parent[i] = i;
    }
    cache.reserve(n);
  }

  tp root(tp n) {
    // 番号nの親を求める. ついでに経路圧縮を行う.

    while (parent[n] != n) {
      // 根になるまで親を探索. ついでにキャッシュ変数に追加.
      cache.push_back(n);
      n = parent[n];
    }
    for (const auto i : cache) {
      // キャッシュ変数に追加された子の親を経路圧縮.
      parent[i] = n;
    }
    cache.clear();
    return n;
  }

  bool same(tp x, tp y) {
    // xとyが同じグループに属しているか計算.
    return root(x) == root(y);
  }

  void unite(const tp x, const tp y) {
    // xとyを同じグループにする.
    const auto x_root = root(x);
    const auto y_root = root(y);

    if (x_root == y_root) {
      // 根が同じなら元から同じグループ.
      return;
    }

    if (rank[x_root] < rank[y_root]) {
      // rankの大きい方の根を統合後の根にする.
      parent[x_root] = y_root;
    } else if (rank[y_root] < rank[x_root]) {
      // rankの大きい方の根を統合後の根にする.
      parent[y_root] = x_root;
    } else {
      // rankが同じなら, どっちかを根にして根になったほうのランクを上げる.
      parent[x_root] = y_root;
      rank[x_root]++;
    }
  }

 private:
  std::vector<tp> parent;
  // 親の番号を格納. 自分が根なら parent[i] == i になる.
  std::vector<tp> rank;
  // 自分の下に何段分の子があるかを格納.
  std::vector<tp> cache;
  // root計算のときに経路圧縮を行うためのキャッシュ変数.
};

int main() {
  int64_t n, k, l;
  std::cin >> n >> k >> l;
  union_find uf1(n), uf2(n);

  std::vector<std::pair<int64_t, int64_t>> pq(k), rs(l);
  std::cin >> pq >> rs;

  for (const auto i : pq) {
    uf1.unite(i.first - 1, i.second - 1);
  }

  for (const auto i : rs) {
    uf2.unite(i.first - 1, i.second - 1);
  }

  std::map<std::pair<int64_t, int64_t>, int64_t> m;

  for (int64_t i = 0; i < n; i++) {
    const auto p1 = uf1.root(i);
    const auto p2 = uf2.root(i);
    if (m.find({p1, p2}) == m.cend()) {
      m[{p1, p2}] = 1;
    } else {
      m[{p1, p2}]++;
    }
  }

  for (int64_t i = 0; i < n; i++) {
    const auto p1 = uf1.root(i);
    const auto p2 = uf2.root(i);
    std::cout << m[{p1, p2}] << (i != n - 1 ? " " : "");
  }
  std::cout << std::endl;

  return 0;
}


Measured memory_bytes: 21120
#include <iostream>

int countCombinations(int n, int x) {
	int combinations = 0;
	for (int i = 1; i <= n - 2; i++) {
		if (x < 3 * i + 3)
			break;
		for (int j = i + 1; j <= n-1; j++) {
			if (x < i + 2 * j + 1)
				break;
			for (int k = j + 1; k <= n; k++) {
				if (x < i + j + k)
					break;
				else if (x == i + j + k)
					combinations++;
			}
		}
	}
	return combinations;
}

int main()
{
	int n, x;
	std::cin >> n >> x;

	while (n != 0 || x != 0) {
		std::cout << countCombinations(n, x) << "\n";
		std::cin >> n >> x;
	}
    return 0;
}




Measured memory_bytes: 3136
#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a,b,c,n,m;
    while(~scanf("%d %d",&n,&m))
    {
        a=n+m;
        b=n-m;
        c=n*m;
        if(a>=b&&a>=c)
        {
            printf("%d\n",a);
        }
        else if(b>=a&&b>=c)
        {
            printf("%d\n",b);
        }
        else if(c>=a&&c>=b)
        {
            printf("%d\n",c);
        }
    }
    return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
#define rep(i,x,y) for(int i=x;i<y;i++)
#define rept(i,x,y) for(int i=x;i<=y;i++)
#define per(i,x,y) for(int i=y;i>=x;i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define pii pair<int,int>
//	ios::sync_with_stdio(false);
//	cin.tie(0);
const int maxx = 2e5+7;
const int maxn = 1e9+7;
typedef long long ll;
using namespace std;
inline int read(){
   int s=0,w=1;
   char ch=getchar();
   while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}
   while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
   return s*w;
}
long double t,n,res=1,op=1e18;
long double a[maxx];
int main(){
		ios::sync_with_stdio(false);
	cin.tie(0);
	cin>>n;
	int f=0,ff=0;
	rept(i,1,n){
		cin>>a[i];
		if(a[i]==0)f=1;
	}
	if(f)cout<<0<<endl;
	else {
		rept(i,1,n){
			if(res*a[i]>op){
				ff=1;
				break;
			}else res*=a[i];
		}
	//	cout<<ff<<endl;
		if(ff)cout<<-1<<endl;
		else cout<<(ll)(res)<<endl;
	}
	return 0;
}


Measured memory_bytes: 5368
import numpy as np

n, m, x = map(int, input().split())
ca = [list(map(int, input().split())) for _ in range(n)]

ans = 10**9
for i in range(2**n):
    cost = 0
    an = np.array([0]*m)
    for j in range(n):
        if (i >> j) & 1:
            cost += ca[j][0]
            an = an + np.array(ca[j][1:])
    
    if not np.any(an < x):
        ans = min(ans, cost)

if ans == 10**9:
    print(-1)
else:
    print(ans)

Measured memory_bytes: 27360
#pragma region header
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define int long long
#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 rev(i, n) for(int i = (int)(n - 1); i >= 0; i--)
#define rev1(i, n) for(int i = (int)(n); i > 0; i--)
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define resort(v) sort((v).rbegin(), (v).rend())
#define vi vector<int>
#define vvi vector<vector<int>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
using ll = long long;
using P = pair<int, int>;
/* ----------------よく使う数字や配列----------------- */
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};
constexpr ll mod = 1e9+7;
constexpr ll inf = INT32_MAX/2;
constexpr ll INF = LLONG_MAX/2;
constexpr long double eps = DBL_EPSILON;
constexpr long double pi = 3.141592653589793238462643383279;
/* ----------------------end----------------------- */

/* --------------------テンプレート------------------ */
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;
}
/* ----------------------end----------------------- */

/* --------------------ライブラリ-------------------- */
ll fact(int i) {       //階乗
    if (i == 0) return 1;
    return (fact(i - 1)) * i % mod;
}
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 ;
}
int keta(ll n) {        //桁数を求める
    if(n == 0) return 1;
    int count = 0;
    while(n != 0) {
        n /= 10;
        count++;
    }
    return count;
}
ll ketasum(ll n) {    //各桁の和
    ll sum = 0;
    while(n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
bool isprime(int n) { //素数判定
    if(n==1)return false;
    if(n==2)return true;
    for(int i = 2;i<=sqrt(n);i++) {
        if(n%i==0) return false;
    }
    return true;
}
/* ----------------------end----------------------- */
#pragma endregion

signed main() {
    int n;cin >> n;
    vi v(n);
    rep(i, n) cin >> v[i];
    // sort(all(v));
    // rep(i, n) cout << v[i] << ' ';cout << endl;
    map<int,int> mp;
    rep(i, n) mp[v[i]]++;
    vi ans;
    for(auto p:mp) ans.pb(p.second);
    resort(ans);
    // rep(i, ans.size()) cout << ans[i] << ' ';cout << endl;
    int count = 0;
    rep(i, ans.size()) {
        if(ans[i]>1) {
            if(ans[i]&1) count+=ans[i]-1;
            else if(i<n-1) count+=ans[i],ans[i+1]--;
            else count+=ans[i];
        }
    }
    cout << n-count << endl;
    return 0;
}

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

void fnInput(int& rnTrgSu, int& rnTrgKin)
{
  cin >> rnTrgSu >> rnTrgKin;
}

int fnRcsSch(int nPos, int nTrgSu, int nTrgKin, vector<int>& rvnMoneyCnt)
{
  const vector<int> cnvnMoney{10000, 5000, 1000};

  if (nTrgSu == 0 && nTrgKin == 0) return 1;
  if (nTrgKin <  0)                return 0;
  if (nPos == rvnMoneyCnt.size())  return 0;

  if (nPos == rvnMoneyCnt.size() - 1)
  {
    rvnMoneyCnt[nPos] = nTrgSu;
    if (fnRcsSch(nPos + 1, 0, nTrgKin - cnvnMoney[nPos] * nTrgSu, rvnMoneyCnt))
      return 1;
  }
  else
    for (int i = 0; i <= nTrgSu; i++)
    {
      rvnMoneyCnt[nPos] = i;
      if (fnRcsSch(nPos + 1, nTrgSu - i, nTrgKin - cnvnMoney[nPos] * i, rvnMoneyCnt))
        return 1;
    }

  rvnMoneyCnt[nPos] = 0;
  return 0;
}

int fnExhSch(int nTrgSu, int nTrgKin)
{
  vector<int> vnMoneyCnt(3);

  if (fnRcsSch(0, nTrgSu, nTrgKin, vnMoneyCnt))
  {
    for (int i = 0; i < vnMoneyCnt.size(); i++)
    {
      if ( i )  cout << " ";
      cout << vnMoneyCnt[i];
    }
    cout << endl;
  }
  else
    cout << -1 << " " << -1 << " " << -1 << endl;
}

int main()
{
  int nTrgSu, nTrgKin;
  
  fnInput(nTrgSu, nTrgKin);
  fnExhSch(nTrgSu, nTrgKin);

  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
using namespace std;

int main()
{
  long long n;
  cin>>n;
  long long tmpa,tmpb;
  long long tmpc;
  long long tmp=10000000000;
  int ans;
  int y;
  int anans=1000000;

  for(long long i=1;i<=sqrt(n);i++){
    if(n%i==0){  
        tmpa=i;
        tmpb=n/i;
        if(tmpa>tmpb){
          tmpc=tmpa;
        }else{
          tmpc=tmpb;
        }
        if(tmp>tmpc){
          tmp=tmpc;
        }else{
          continue;
        }
        ans=10000;
        y=1;
        for(long long j=1;j<=10000000000;j*=10){
          if(int(tmp/j)>=1)ans=y;
          y++;
        }
        if(ans<anans){
          anans=ans;
      }
    }
  }

  cout<<anans<<endl;
  return 0;
}


Measured memory_bytes: 256
use std::io::*;

fn main() {
    let mut s: String = String::new();
    std::io::stdin().read_to_string(&mut s).ok();
    let mut itr = s.trim().split_whitespace();
    let mut n: u64 = itr.next().unwrap().parse().unwrap();
    if n % 2 == 1 {
        println!("0");
        return;
    }
    let mut ans = 0u64;
    while n > 0 {
        ans += n / 5 / 2;
        n /= 5;
    }
    println!("{}", ans);
}


Measured memory_bytes: 4352
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <string>
#include <math.h>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <stdlib.h>
#include <time.h>
#include <limits.h>
#include <assert.h>
using namespace std;
const int MOD = 1e9 + 7;
int h, w, dp[1000][1000];
char a[1000][1001];
int calc(int i, int j) {
	if (a[i][j] == '#') return 0;
	if (i == h - 1 && j == w - 1) return 1;
	if (dp[i][j] != -1) return dp[i][j];
	int res = 0;
	if (i + 1 < h) res = (res + calc(i + 1, j)) % MOD;
	if (j + 1 < w) res = (res + calc(i, j + 1)) % MOD;
	return dp[i][j] = res;
}
int main() {
	scanf("%d %d", &h, &w);
	for (int i = 0; i < h; i++) scanf("%s", a[i]);
	memset(dp, -1, sizeof(dp));
	int ans = calc(0, 0);
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 5248
#include <cstdio>
#include <iostream>
#include <cassert>
#include <string>
#include <algorithm>
#include <cstring>
#include <utility>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <deque>
#include <unordered_map>
using namespace std;
typedef long long LL;
typedef long double LD;
typedef pair<int, int> pii;
typedef pair<LL, LL> pll;
const int MAXN = 1234567;
const LL MOD = (LL)1e9 + 7;
vector<int> cand[MAXN];
int A[MAXN];

LL mul(LL a, LL b) {
   return (a * b) % MOD;
}

LL add(LL a, LL b) {
   return (a + b) % MOD;
}

LL sub(LL a, LL b) {
   return (a - b + MOD) % MOD;
}

int main() {
    int N;
    scanf("%d", &N);
    int cur = 0;
    for (int i = 1; i <= N; i++) {
        int tmp;
        scanf("%d", &tmp);
        cur ^= tmp;
        cand[cur].push_back(i);
        A[i] = cur;
    }
    cand[0].push_back(N + 1);
    LL ans = 0;
    if ((int)cand[0].size() > 1 && cand[0][(int)cand[0].size() - 2] == N) {
       LL sum = 1;
       for (int i = 0; i < (int)cand[0].size() - 2; i++) {
           sum = mul(sum, 2);
       }
       ans = add(sum, ans);
    }
    for (int i = 1; i < MAXN; i++) {
        LL dp0 = 1, dp1 = 0;
        int pre_cnt = 0;
        if (cand[i].empty() || (cand[i].back() != N && cur)) continue;
        for (int j : cand[i]) {
            int upr_cnt = upper_bound(cand[0].begin(), cand[0].end(), j) - cand[0].begin();
            int cnt0 = upr_cnt - pre_cnt;
            LL tmp = mul(dp1, cnt0);
            dp0 = add(dp0, tmp);
            dp1 = add(dp1, dp0);
            //printf("i = %d j = %d cnt0 = %d dp0 = %lld dp1 = %lld\n", i, j, cnt0, dp0, dp1);
            pre_cnt = upr_cnt;
        }
        //printf("i = %d dp0 = %lld dp1 = %lld\n", i, dp0, dp1);
        if (cand[i].back() == N) ans = add(ans, dp0);
        else ans = add(ans, dp1);
    }
    printf("%lld\n", ans);
    return 0;
}


Measured memory_bytes: 41460
#include<stdio.h>
#include<string.h>
int main(){
  char s[1010];
  int w,n;
  scanf("%s",s);
  scanf("%d",&w);
  n=strlen(s);
  for(int i=0;i<n;i++)
    if(i%w==0)
      printf("%c",s[i]);
  printf("\n");
}

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

using ull = unsigned long long;

template<class T>           //自定义读入函数
inline void read(T &a) {
    register T x = 0, flag = 1;
    register char ch;
    while (!isdigit(ch = getchar())) if (ch == '-') flag = -1;
    while (x = x * 10 + (ch & 15), isdigit(ch = getchar()));
    a = x * flag;
}

template <class T>        //自定义写入函数
inline void write(T x) {
    if (x < 0)
        putchar('-'), x = -x;
    if(x >= 10) write(x / 10); 
    putchar(x % 10 + '0');
}

template<class T> inline bool Chkmax(T& x, const T& y) { return x < y ? x = y, true : false; }   //自定义比较函数
template<class T> inline bool Chkmin(T& x, const T& y) { return x > y ? x = y, true : false; }   //自定义比较函数

#define For(i, a, b) for (int i = (a); i <= (b); i++)   //从小到大重复
#define Rep(i, a, b) for (int i = (a); i >= (b); i--)   //从大到小重复
#define For_edge(x) for (int i = head[x]; i; i = net[i])
#define mem0(a) memset(a, 0, sizeof a)    

int main()
{
	ull a;
	double b;
	scanf("%llu%lf", &a, &b);
	ull c = (ull)(b*100 + 1e-6);
	ull result = a * c / 100;
	cout << result << endl;
	return 0;
}

Measured memory_bytes: 3760
#pragma region 
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<cstring>
#include<string>
typedef long long ll;
template <typename T>void read(T &x){x=0;char ch=getchar();ll f=1;while(!isdigit(ch)){if(ch=='-')f*=-1;ch=getchar();}while(isdigit(ch)){x=x*10+ch-48;ch=getchar();}x*=f;}
#define IO ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
using namespace std;
#pragma endregion

int main() {
    IO;
    int k, a, b;
    cin >> k >> a >> b;
    if (a%k==0||b%k==0) 
        cout << "OK\n";
    else
        cout << (a / k - b / k ? "OK\n" : "NG\n");
}

Measured memory_bytes: 3644
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,a,b;
vector<ll> v,u;
int main(void){
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a>>b;
        v.push_back(a);
        u.push_back(b);
    }
    sort(v.begin(),v.end());
    sort(u.begin(),u.end());
    
    if(n%2==1)cout<<u[(n-1)/2]-v[(n-1)/2]+1<<endl;
    else{
        cout<<u[(n-1)/2]+u[n/2]-v[(n-1)/2]-v[n/2]+1<<endl;
    }
}


Measured memory_bytes: 6620
// warm heart, wagging tail,and a smile just for you!
//                                                                     ███████████   
//                                                                   ███╬╬╬╬╬╬╬╬╬╬███
//                                                                ███╬╬╬╬╬████╬╬╬╬╬╬███
//                                            ███████████       ██╬╬╬╬╬████╬╬████╬╬╬╬╬██
//                                      █████████╬╬╬╬╬████████████╬╬╬╬╬██╬╬╬╬╬╬███╬╬╬╬╬██
//                               ████████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████████╬╬╬╬╬╬██╬╬╬╬╬╬╬██
//                             ████╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████████╬╬╬╬╬╬╬╬╬╬╬██
//                           ███╬╬╬█╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬███╬╬╬╬╬╬╬█████
//                         ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬████████╬╬╬╬╬██
//                       ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬╬╬╬╬███
//                     ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬██
//                 ████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████╬╬╬╬╬████
//     █████████████╬╬╬╬╬╬╬╬██╬╬╬╬╬████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬██████
//   ████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬██████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██████╬╬╬╬╬╬╬███████████╬╬╬╬╬╬╬╬██╬╬╬██╬╬╬██
// ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████╬╬╬╬╬╬╬╬╬╬╬█╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬██
// ██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬▓▓▓▓▓▓╬╬╬████╬╬████╬╬╬╬╬╬╬▓▓▓▓▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬███
// ██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██████▓▓▓▓▓▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓▓▓▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬█████
// ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████████
//   ███╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██
//       ██████████████  ████╬╬╬╬╬╬███████████████████████████╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████
//                         ███████                           █████  ███████████████████  
#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
#define INF 1LL<<60
#define fs first
#define sc second
#define pb push_back
#define int long long
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i = (b-1);i>=a;i--)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define RITR(itr,mp) for(auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr)
#define range(i,a,b) (a)<=(i) && (i)<(b)
#define debug(x)  cout << #x << " = " << (x) << endl;
#define SP << " " << 
typedef pair<int,int> P;
typedef vector<vector<P> > Graph;

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

  int n;
  cin >> n;

  int dp[n+1][3];
  dp[0][0] = dp[0][1] = dp[0][2] = 0;

  REP(i,n){
    int a,b,c;
    cin >> a >> b >> c;
    dp[i+1][0] = max(dp[i][1]+a,dp[i][2]+a);
    dp[i+1][1] = max(dp[i][0]+b,dp[i][2]+b);
    dp[i+1][2] = max(dp[i][0]+c,dp[i][1]+c);
  }

  cout << max({dp[n][0],dp[n][1],dp[n][2]}) << endl;

  return 0;
}

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


// time and space complexity = O(K*N)
int m = 1e9+7;

signed main(){
    
    int n,k;
    cin >> n >> k;
    vector<int> arr(n+1);
    // arr[i] = max candies ith child can take
    for(int i=1;i<=n;i++) cin >> arr[i];

    int dp[1+n][1+k];
    int sum[1+n][1+k];
    // dp[i][j] == number of ways of distributing j candies among first i children
    // sum[i][j] == sum of ith row of dp matrix from column 0 to j
    
    for(int j=0;j<=k;j++) {dp[0][j] = 0; sum[0][j]=1;}
    for(int i=0;i<=n;i++) {dp[i][0] = 1; sum[i][0]=1;}
    
    for(int child=1;child<=n;child++){
        for(int cand=1;cand<=k;cand++){
            int mx = arr[child];

            int mini = max(0LL, cand - mx);

            // BUG WAS HERE======================================================================
            dp[child][cand] = (sum[child-1][cand] - sum[child-1][mini] +m )%m + dp[child-1][mini];
            dp[child][cand] %= m;

            // sum update
            sum[child][cand] = dp[child][cand] + sum[child][cand-1];
            sum[child][cand] %= m;
        }
    }


    cout << dp[n][k] << endl;

    return 0;
}

Measured memory_bytes: 161396
#include<iostream>

using namespace std;

int main() {

	int n,a,b;

	n = 0;

	for (n = 1; n <= 10000; n++ ) {

		cin >> a >> b;

		if (a > 0 || b > 0) {

			if (a >= b)

				cout << b << " " << a << endl;

			else if (b >= a)

				cout << a << " " << b << endl;

		}

		else if (a == 0 && b == 0) {
			break;
		}

		else
			break;

	}

}

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


int main(){
    int a,b,n;

    while(cin>>a){
        int sum=0;
        cin>>b>>n;

        for(int i=1;i<=n;i++){
            a*=10;
            sum += (a/b)%10;
            a-=b*(a/b);
        }
        cout<<sum<<endl;
    }

    return 0;
}

Measured memory_bytes: 1160
#include <stdio.h>

int main (void)
{

int x,y,s,r;

scanf("%d %d\n",&x,&y);

if(x < y){
  s = x;
  x = y;
  y = s;
}

r = x % y;
while(r!= 0){
  
  x = y;
  y = r;
  r = x % y;
}
  
  printf("%d\n",y);

return 0;

}

Measured memory_bytes: 1800
#pragma region Macros
#include <bits/stdc++.h>
using namespace std;
#include <boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i, n) for(int i=(n); i>=0; --i)
#define FOR(i, n, m) for(int i=(m), i##_len=(n); i<i##_len; ++i)
#define EACH(i, v) for(const auto& i : v)
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
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; }
template<class Value>using vec = vector< Value >;
using ll = long long;
using P = pair< long long, long long >;
#define fi first
#define se second
#define el endl
#pragma endregion

const string YES = "Yes";
const string NO = "No";

void Main();
void solve(long long N, long long K, std::vector<long long> A);

int main(){
    std::cin.tie(nullptr);
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}

void Main(){
    long long N;
    scanf("%lld",&N);
    long long K;
    scanf("%lld",&K);
    std::vector<long long> A(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&A[i]);
    }
    solve(N, K, std::move(A));
}

void solve(long long N, long long K, std::vector<long long> A){
    FOR(i, N-K, 0){
        if(A[i] < A[i+K]){
            cout << YES << el;
        }else{
            cout << NO << el;
        }
    }
}



Measured memory_bytes: 4860
#include<stdio.h>
int main()
{
      int p,h, j, i, k=0;
      scanf("%d%d",&h,&p);
      int ara[p];
      for(j=0;j<p;j++)
      {
          scanf("%d",&ara[j]);
          k=k+ara[j];
      }


         if(k>=h)
         {
               printf("Yes\n");
         }

         else if(k<h)
         {
             printf("No\n");

         }

      return 0;

      }



Measured memory_bytes: 2000
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 10 19:50:26 2018
ABC99B
@author: maezawa
"""

a, b = list(map(int, input().split()))

n = b - a

tn = sum([i for i in range(1, n+1)])
snow = tn - b
print(snow)

Measured memory_bytes: 3060
N,W=map(int,input().split())
k=[[0,0] for i in range(N)]
dp=[[0]*(W+1) for j in range(N+1)]
for i in range(N):
    k[i][0],k[i][1]=map(int,input().split())



for i in range(N):
    for w in range(W+1):
        if k[i][0]>w:
            dp[i+1][w]=dp[i][w]
        else:
            dp[i+1][w] = max(dp[i][w-k[i][0]]+k[i][1],dp[i][w])


print(dp[N][W])

Measured memory_bytes: 120044
#include <iostream>
#include <vector>
#include <algorithm>
#define M 100000
using namespace std;

struct W{
    int a;
    int b;
    bool operator<( const W& right ) const {
        return a < right.a;
    }
};

int main(void){
    
    int n, m;
    cin >> n >> m;
    vector<W> wars(m);
    
    for(int i = 0; i < m; i ++) cin >> wars[i].a >> wars[i].b;
    sort(wars.begin(), wars.end());
    
    int dp[M+1];  // dp[i] : i個目以降の要望を叶えるために取り除く橋数の最小値
    int dp2[M+1]; // dp2[i] : ↑で取り除いた橋のうち最も西にあるものの番号
    
    dp[m] = 0, dp2[m] = n;

    for(int i = m-1; i >= 0; i --){
        // # 新しく切る必要がない場合
        if(dp2[i+1] < wars[i].b){
            dp[i] = dp[i+1];
            dp2[i] = dp2[i+1];
        }
        // なるべく左を切る
        else{
            dp[i] = dp[i+1] + 1;
            dp2[i] = wars[i].a;
        }
    }

    cout << dp[0] << "\n";
}


Measured memory_bytes: 1792