akhauriyash/Code-Regression huggingface dataset:
import java.util.*;

public class Main
{
    final static int number_of_cards = 10;
    final static int max_number = 20;

    public static void main(String[] args){
	Scanner sc = new Scanner(System.in);

	while(sc.hasNext()){
	    int card1 = sc.nextInt();
	    int card2 = sc.nextInt();
	    int card3 = sc.nextInt();
	    int sum = card1 + card2;

	    boolean used_card[] = new boolean[number_of_cards + 1];
	    used_card[card1] = true;
	    used_card[card2] = true;
	    used_card[card3] = true;

	    int count = 0;
	    for(int i = 1; i <= number_of_cards; ++i){
		if(!used_card[i] && sum+i <= max_number){
		    ++count;
		}
	    }
	    System.out.println(judge(count));
	}
    }

    private static String judge(int count){
	return ((double)count/(double)(number_of_cards-3) >= 0.5)? "YES" : "NO";
    }
}

Measured memory_bytes: 17192
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int m = s.nextInt();
		int i = 0;
		int j = 0;
		int count = 0;


		int ary1[] = new int[2 * m];
		for (i = 0; i < 2 * m; i++) {
			ary1[i] = s.nextInt();


		}

		int ary[] = new int[n];

		for (i = 0; i < n; i++) {
			count = 0;
			for (j = 0; j < 2 * m; j++) {

				if (ary1[j] == i + 1) {
					count++;


				}
			}
			ary[i] = count;
			System.out.println(ary[i]);

		}

	}

}

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

#define int long long
signed main(){
  int n, m;
  while(cin >> n >> m, n != 0){
    vector<int> h(n), w(m);
    for(int i = 0; i < n ; i++){
      cin >> h[i];
    }
    for(int i = 0; i < m ; i++){
      cin >> w[i];
    }
    vector<int> hs(1500 * 1000 + 10, 0);
    for(int i = 0; i < n ; i++){
      int s = 0;
      for(int j = i ; j < n ; j++){
        s += h[j];
        hs[s]++;
      }
    }
    int res = 0;
    for(int i = 0; i < m ; i++){
      int s = 0;
      for(int j = i ; j < m ; j++){
        s += w[j];
        res += hs[s];
      }
    }
    cout << res << endl;
  }
}

Measured memory_bytes: 14760
while True:
    n,k=map(int,input().split())
    if n==0 and k==0: break
    a=[int(input()) for _ in range(n)]
    s=sum(a[0:k])
    ss=[s]
    for i in range(k,n):
        s=s+a[i]-a[i-k]
        ss.append(s)
    print(max(ss))    


Measured memory_bytes: 11700
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
 
using namespace std;
 
typedef long long ll;
 
#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;
 
#define MOD 1000000007
 
int main() {
  ll n;
  cin>>n;
  vector<ll> v;
  set<ll> se;
  rep(i,0,n){
    ll a;
    cin>>a;
    v.pb(a);
    se.insert(a);
  }
  sort(all(v));
  vector<ll> v1(all(se));
  sort(all(v1));
  if(v1.sz>2){
    cout << "No" << endl;
    return 0;
  }
  if(v1.sz==1){
    if(v1[0]==n-1||v1[0]<=n/2){
      cout << "Yes" << endl;
      return 0;
    }
    cout << "No" << endl;
    return 0;
  }
  if(v1.sz==2){
    if(v1[1]-v1[0]!=1){
      cout << "No" << endl;
      return 0;
    }
    //if(v[0]<n-1){
      ll c = 0;
      rep(i,0,v.sz){
        if(v[0]==v[i])c++;
      }
      if(c+(n-c)/2>=v1[1]&&v1[1]>=c+1){
        cout << "Yes" << endl;
        return 0;
      }
    //}
  }
  cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 6516
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a[5]={1,2,3,4,5};
  int b[5];
  int i=0;
  int x;
  
  for(;i<5;i++){
      cin >>  b[i];
      if(a[i] != b[i]){
         x=i;
      }
  }
  cout <<  a[x];
  
}  

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

int main()
{
  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  
  cout << max(a*b, c*d) << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <deque>
#include <cassert>
#include <complex>
#include <iomanip>
#include <random>

using namespace std;

typedef long long ll;
#define int ll

int M = (int)1e9 + 7;
#define msum(a, b) ((a) + (b) >= M ? (a) + (b) - M : (a) + (b))
#define msub(a, b) ((a) - (b) < 0 ? (a) - (b) + M : (a) - (b))
#define mmult(a, b) (((a) * (b)) % M)

typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vpi;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<short> vs;
typedef vector<vs> vvs;
typedef vector<vvs> vvvs;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef vector<ld> vld;
typedef vector<vld> vvld;
typedef vector<vvld> vvvld;
typedef vector<string> vst;
typedef vector<vst> vvst;
typedef pair<ld, ld> pld;
typedef complex<double> base;
typedef complex<int> point;

#define inmin(a, b) a = min(a, (b))
#define inmax(a, b) a = max(a, (b))
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define sqr(x) ((x) * (x))
#define fori(i, n) for(int i = 0; i < int(n); ++i)
#define SZ(a) ((int)((a).size()))
#define triple(T) tuple<T, T, T>
#define quad(T) tuple<T, T, T, T>


#define cerr cout
#define watch(x) cerr << (#x) << " = " << (x)    << endl;

const double PI = 2 * acos(0.0);

const string DIGITS = "0123456789";
const string ALPH = "abcdefghijklmnopqrstuvwxyz";

template <class T0, class T1>
inline ostream & operator << (ostream &out, pair<T0, T1> &a) {
	return out << "{" << a.first << ", " << a.second << "}";
}

template <class T0, class T1, class T2>
inline ostream & operator << (ostream &out, tuple<T0, T1, T2> &a) {
	return out << "{" << get<0>(a) << ", " << get<1>(a) << ", " << get<2>(a) << "}";
}

template <class T0, class T1, class T2, class T3>
inline ostream & operator << (ostream &out, tuple<T0, T1, T2, T3> &a) {
	return out << "{" << get<0>(a) << ", " << get<1>(a) << ", " << get<2>(a) << ", " << get<3>(a) << "}";
}

template<class T>
inline ostream & operator << (ostream &out, vector<T> &a) {
	out << "[";
	fori(i, a.size())
		out << a[i] << vector<string>{", ", "]  "}[i + 1 == a.size()];
	return out;
}

void smain();

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


	cout << setprecision(12) << fixed;
	smain();
}

#define N 400000
const int oo = (int)1e9;






void smain()
{
	string s;
	cin >> s;
	int n = s.size();
	string t = "keyence";
	vi a(n), b(n);
	
	int ans = 0, sna = 0;
	for (int i = 0; i < 7; i++)
		if (s[i] == t[i])
			ans++;
		else
			break;

	for (int i = n - 1, j = 6; j >= 0; i--, j--)
		if (s[i] == t[j])
			sna++;
		else
			break;

	if (ans + sna >= 7)
		cout << "YES";
	else
		cout << "NO";

	
}

//m1.codeforces.com, m2.codeforces.com или m3.codeforces.com

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define repr(i, n) REPR(i, n, 0)
#define REPR(i, s, e) for(int i=(int)(s-1); i>=(int)(e); i--)
#define all(r) r.begin(),r.end()
#define rall(r) r.rbegin(),r.rend()

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;

const ll INF = 1e18;
const ll MOD = 1e9 + 7;

template<typename T> T chmax(T& a, const T& b){return a = (a > b ? a : b);}
template<typename T> T chmin(T& a, const T& b){return a = (a < b ? a : b);}

int main(){
    string s;
    cin >> s;
    int cnt = 0, ans = 0;
    for(auto&& c: s) {
        if(c == 'R') cnt++;
        else cnt = 0;
        chmax(ans, cnt);
    }
    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 3632
#include<iostream>
using namespace std;
int main()
{
  int A, B;
  cin >> A >> B;
  if(A-1 > B){
    cout << 2*A - 1;
  }
  else if(A < B-1){
    cout << 2*B - 1;
  }
  else if(A == B || A+1 == B || A == B+1){
    cout << A + B;
  }
  return 0;
}

Measured memory_bytes: 256
#include<algorithm>
#include<climits>
#include<cmath>
#include<cstdlib>
#include<iomanip>
#include<iostream>
#include<numeric>
#include<string>
using namespace std;

long gcd(long x, long y) { if (x > y) { return gcd(y, x); } long r; while (y != 0) { r = x % y; x = y; y = r; }return x; }
long lcm(long x, long y) { return(x / gcd(x, y)) * y; }
void indexsort(long* first, long* last, long* func) { sort(first, last, [&](long a, long b) {return func[a] < func[b]; }); }
//--------------------

int main() {

	long res = 0;
	long N; cin >> N;
	long A[100009]; for (int i = 0; i < N; i++) cin >> A[i]; A[N] = INT_MAX;

	sort(A, A + N);

	long iteF = 0;
	long iteX = 0;
	
	while (iteF != N) {
		while (A[iteF] == A[iteX]) iteX++;
		res += (iteX - iteF) % 2;
		iteF = iteX;
	}

	cout << res << endl;
}

Measured memory_bytes: 1024
#include "bits/stdc++.h"
#define REP(i, n) for(int i = 0; i < int(n); i++)
#define FOR(i,n,m) for(int i = int(n); i < int(m); i++)
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;
const int INF = 1e9 + 6;
const ll LLINF = 1e18 + 1;

int main() {
    int n; cin >> n;
    vector<int> a(n), ans(n, INF);
    REP(i, n) {
        cin >> a[i];
        ans[lower_bound(ans.begin(), ans.end(), a[i]) - ans.begin()] = a[i];
    }
    int cnt = 0;
    REP(i, n) {
        if (ans[cnt] != INF) {
            cnt++;
        }
        else {
            break;
        }
    }
    cout << cnt << endl;
    return 0;
}


Measured memory_bytes: 3616
// 2020-08-14 14:45:58
#include<bits/stdc++.h>
#ifdef LOCAL
#include "lib/debug.hpp"
#else
#define debug(...) 1
#endif
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define rep(i, n) REP(i, 0, (n))
#define repc(i, n) REPC(i, 0, (n))
#define REP(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define REPC(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define REPCM(i, n, m) for (int i = (int)(n); i >= (int)(m); i--)
using namespace std;
using ll = long long;
using ld = long double;
using pr = pair<ll, ll>;
using vll = vector<ll>;
using vpr = vector<pr>;
using P = pair<int, int>;
template<class T> inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } else return false; }
template<class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } else return false; }
const int mod = 1000000007;
struct mint {
  ll val;
  constexpr mint(ll v = 0) noexcept : val(v % mod) {
    if (val < 0) val += mod;
  }
  constexpr mint operator + (const mint& rhs) const noexcept {
    return mint(*this) += rhs;
  }
  constexpr mint operator - (const mint& rhs) const noexcept {
    return mint(*this) -= rhs;
  }
  constexpr mint operator * (const mint& rhs) const noexcept {
    return mint(*this) *= rhs;
  }
  constexpr mint operator / (const mint& rhs) const noexcept {
    return mint(*this) /= rhs;
  }
  constexpr mint operator ~ () const noexcept {
    ll a = this->val, b = mod, u = 1, v = 0;
    while (b > 0) {
      ll t = a / b;
      a -= t * b;
      u -= t * v;
      ll c = a; a = b; b = c;
      ll w = u; u = v; v = w;
    }
    if (u < 0) u += mod;
    u %= mod;
    return u;
  }
  constexpr mint& operator += (const mint& rhs) noexcept {
    val += rhs.val;
    if (val >= mod) val -= mod;
    return *this;
  }
  constexpr mint& operator -= (const mint& rhs) noexcept {
    if (val < rhs.val) val += mod;
    val -= rhs.val;
    return *this;
  }
  constexpr mint& operator *= (const mint& rhs) noexcept {
    val = val * rhs.val % mod;
    return *this;
  }
  constexpr mint& operator /= (const mint& rhs) noexcept {
    val = val * (~(mint(rhs))).val % mod;
    return *this;
  }
  friend mint modpow (mint a, ll n) noexcept {
    auto res = mint(1);
    while(n > 0) {
      if(n&1) res *= a;
      a *= a;
      n >>= 1;
    }
    return res;
  }
  friend std::ostream& operator << (std::ostream& os, const mint& a) noexcept {
    return os << a.val;
  }
  friend std::string debug_s (mint a) noexcept {
    return std::to_string(a.val);
  }
};

void answer() {
  int n, k;
  cin >> n >> k;
  vector<int> xs;
  unordered_map<int, mint> dp;
  REPC(i, 1, n) {
    int c = n/i;
    xs.push_back(c);
    dp[c] = c;
    i = n/c;
  }
  sort(ALL(xs));
  rep(_, k-1) {
    unordered_map<int, mint> p;
    swap(dp, p);
    int past = 0;
    for(const int x : xs) {
      dp[x] = p[n/x] * (x - past);
      if(past > 0) dp[x] += dp[past];
      past = x;
    }
  }
  cout << dp[n] << '\n';
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  answer();
  return 0;
}

Measured memory_bytes: 10368
n = int(input())
a = list(map(int, input().split()))

a.sort()
s = [0 for _ in range(n)]
s[0] = a[0]

for i in range(1, n):
    s[i]  = s[i-1] + a[i]
    
for i in range(n):
    s[i] *= 2

def find(a, x):
    u, l = len(a), -1
    
    while u > l+1:
        md = (u+l) // 2
        if x >= a[md]:
            l = md
        else:
            u = md
    return u - 1      

ans = [0 for _ in range(n)]
for i in range(n):
    cur = i 
    nx  = find(a, s[i])
    while nx != cur:
        cur = nx
        nx  = find(a, s[nx])
    ans[i] = nx
    
count = 0    
for x in ans:
    if x == len(a) - 1:count+=1
print(count)    

Measured memory_bytes: 16048
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int cmp(ll a,ll b)
{
    return a>b;
}
int main()
{
    int n,a[100009];
    ll x,ans=0;
    scanf("%lld%d",&x,&n);
    for(int i=1;i<=n;i++)
        scanf("%lld",&a[i]);
    for(int i=1;i<=n;i++)
        ans+=a[i];
    if(ans>=x)
        printf("Yes");
    else
        printf("No");
    return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

const int INF = 1e9;

struct SegmentTree{
    int n, width;
    VI dat[2];

    void init(int x){
        n = x;
        dat[0].resize(4*n);
        dat[1].resize(4*n);
        width = 1;
        while(width < n) width *= 2;
        REP(j,2) REP(i,2*width-1) dat[j][i] = INF;
    }

    void update(int i, int x, int k){
        i += width-1;
        dat[k][i] = x;
        while (i>0){
            i = (i-1)/2;
            dat[k][i] = min(dat[k][i*2+1],dat[k][i*2+2]);
        }
    }

    int query(int a, int b, int k, int l, int r, int p){
        if (r<=a || b<=l) return INF;
        if (a<=l && r<=b) return dat[p % 2][k];
        int vl = query(a,b,k*2+1,l,(l+r)/2,p);
        int vr = query(a,b,k*2+2,(l+r)/2,r,p);
        return min(vl,vr);
    }
};

int n, a[200010], pos[200010];
SegmentTree sg;
vector<P> ans;

pair<P, pair<P, P> > calc(int l, int r){
    if (r <= 0 || l >= n || l >= r) return make_pair(P(INF,INF), make_pair(P(INF, INF), P(INF, INF)));
    // cout << l << r << endl;
    int mi = sg.query(l,r,0,0,sg.width,l%2);
    int j = pos[mi];
    int mi2 = sg.query(j+1,r,0,0,sg.width,(j+1)%2);
    int j2 = pos[mi2];
    return make_pair(P(mi, mi2), make_pair(P(j, j2), P(l, r)));
}

int main(){
    cin >> n;
    REP(i,n){
        scanf("%d", &a[i]);
        pos[a[i]] = i;
    }

    sg.init(n);
    REP(i,n){
        sg.update(i, a[i], i%2);
    }

    priority_queue<pair<P, pair<P, P> >, vector<pair<P, pair<P, P> > >, greater<pair<P, pair<P, P> > > > pq;
    pq.push(calc(0,n));

    while (ans.size() < n/2){
        pair<P, pair<P, P> > p = pq.top();
        pq.pop();
        ans.push_back(p.first);
        int l = p.second.second.first, r = p.second.second.second;
        int j1 = p.second.first.first, j2 = p.second.first.second;
        pq.push(calc(l,j1));
        pq.push(calc(j1+1,j2));
        pq.push(calc(j2+1,r));
    }

    REP(i,n/2) printf("%d %d ", ans[i].first, ans[i].second);
    cout << endl;

    return 0;
}

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

int main() {
  int n;
  cin >> n;
  int a[4];
  a[0] = n / 1000;
  a[1] = (n - 1000 * a[0]) / 100;
  a[2] = (n - 1000 * a[0] - 100 * a[1]) / 10;
  a[3] = n % 10;
  int count = 0;
  for(int i = 0; i < 4; i++) {
    if(a[i] == 2) count ++;
  }
  cout << count << endl;
  return 0;
}

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

using namespace std;
#define INF 1e9+5
void solve(int n){
    vector<int>h(n+1);
    for(int i=1;i<=n;++i){
        cin>>h[i];
    }
    int dp[n+1];
    memset(dp, 0 , sizeof(dp));
    dp[2] = abs(h[2]-h[1]);
    dp[3] = min(abs(h[3]-h[2]), abs(h[3]-h[1]));
    for(int i=3;i<=n;++i){
        dp[i] = min(dp[i-1]+abs(h[i]-h[i-1]), dp[i-2]+abs(h[i]-h[i-2]));
    }
    cout<<dp[n]<<endl;
}
int main()
{
    int n;
    cin>>n;
    solve(n);
    return 0;
}


Measured memory_bytes: 4020
n, m = map(int, input().split())

lights = []
for _ in range(m):
    l = list(map(int, input().split()))
    lights.append(l[1:])

p = list(map(int, input().split()))

ans = 0
for i in range(2 ** n):
    for index, light in enumerate(lights):
        n = 0
        for j in light:
            n += i >> (j - 1) & 1
        if n % 2 == p[index]:
            continue
        else:
            break
    else:
        ans += 1
print(ans)

Measured memory_bytes: 39920
n,c,k = map(int,input().split())
t = []
for _ in range(n):
    a = int(input())
    t.append(a)
t.sort()

ans = 0
cnt = 1
rng = t[0]+k

for i in range(1,n):
    if t[i] <= rng and cnt < c:
        cnt += 1
    else:
        rng = t[i]+k
        cnt = 1
        ans += 1
ans += 1

print(ans)

Measured memory_bytes: 13224
#pragma region RegionDefs
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0,i##_len=(n);i<i##_len;++i)
#define reps(i,l,r) for(int i=(l),i##_len=(r);i<i##_len;++i)
#define all(x) begin(x),end(x)
using namespace std;
typedef long long ll;
const ll INF = 1e9;
template<class T=ll> using V = vector<T>;
template<class T=ll> using PQ = priority_queue<T>;
template<class T=ll> using PQG = priority_queue<T, V<T>, greater<T>>;
const ll MOD = 1000000007LL;
void in() {}
template<class Head, class... Tail>
void in(Head&& head, Tail&&... tail)
{
    cin >> head;
    in(move(tail)...);
}
#define IN(...) ll __VA_ARGS__; in(__VA_ARGS__)
#define INS(T, ...) T __VA_ARGS__; in(__VA_ARGS__)
#define VIN(T, v, n) V<T> v(n); for(auto& _elem:v)cin>>_elem
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 (a>b) {a=b; return 1;} return 0;}
#define y0 y__0
#define y1 y__1
#define j0 j__0
#define j1 j__1
#define YN(e) cout << ((e) ? "YES" : "NO") << endl
#define yn(e) cout << ((e) ? "Yes" : "No") << endl
#pragma endregion RegionDefs

void solve()
{
    IN(x, y);
    rep(i, x+1) {
        if (i*2+(x-i)*4 == y) {
            cout << "Yes" << endl;
            return;
        }
    }
    cout << "No" << endl;
}

int main()
{
    cin.tie(0); cout.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(numeric_limits<double>::max_digits10);

    solve();

    return 0;
}

Measured memory_bytes: 3648
#include <iostream>

int main(int argc, char ** argv)
{
  //
  std::string s, t, u;
  int a, b;
  std::cin >> s >> t;
  std::cin >> a >> b;
  std::cin >> u;

  if (s == u) {
    a--;
  } else {
    b--;
  }
  std::printf("%d %d\n", a, b);
  return 0;
}

Measured memory_bytes: 256
let () =
  let n = int_of_string (read_line()) in
  let string_numbers = Str.split (Str.regexp " ") (read_line()) in
  let reverse = List.rev string_numbers in
  let rec loop list i =
    match list with
    |[] -> ()
    |h::[] -> print_string h;
              print_string "\n";
              if i <> 1 then raise (Sys_error ": number of the numbers is wrong");
    |h::t -> print_string h;
             print_string " ";
             loop t (i-1)
  in
  loop reverse n
;;


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

int main() {
  int H, W;
  cin >> H >> W;
  vector<vector<char>> a(H, vector<char>(W));
  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      cin >> a.at(i).at(j);
    }
  }
  
//  cout << H << W << endl;
//  for(int i = 0; i < H; i++){
//    for(int j = 0; j < W; j++){
//      cout << a.at(i).at(j);
//    }
//    cout << endl;
//  }
  
  set<int> restHs;
  set<int> restWs;  
  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      if(a.at(i).at(j) == '#'){
        restHs.insert(i);
        restWs.insert(j);
      }        
  	}
  }  
  
//  for (int h : restHs) { 
//    cout << h;
//  }
//  cout << endl;
//  for (int w : restWs) { 
//    cout << w;
//  }
//  cout << endl;
  
  for (int h : restHs) {
    for (int w : restWs) { 
    	cout << a.at(h).at(w);
    }
    cout << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i)
using i64 = int64_t;
using ll = long long;
const ll MAX = 1e15 + 1;
int main() {
  ll N;
  cin >> N;
  vector<ll> p(12);
  p.at(0) = 26;
  rep(i,11){
    p.at(i + 1) = p.at(i) + pow(26,i+2);
  }
  if(N <= p.at(0)){
    cout << char(N + 96)<< endl;
    return 0;
  }
  if(N <= p.at(1)){
    ll K = N - (p.at(0)+1);
    cout << char(int(K / p.at(0))+97) << char(K % 26 + 97) << endl;
    return 0;
  }
  if(N <= p.at(2)){
    ll K = N -(p.at(1) + 1);
    cout << char(int(K / ll(pow(26,2)))+97);
    K =  K % ll(pow(26,2));
    cout << char(int(K / 26)+97) << char(K % 26 + 97) << endl;
    return 0;
  }
  if(N <= p.at(3)){
    ll K = N - (p.at(2) + 1);
    cout << char(int(K / ll(pow(26,3)))+97);
    K = K % ll(pow(26,3));
    cout << char(int(K / ll(pow(26,2)))+97);
    K =  K % ll(pow(26,2));
    cout << char(int(K / 26)+97) << char(K % 26 + 97) << endl;
    return 0;
  }
  for(int i = 4; i < 12;i ++){
    if(N <= p.at(i)){
      ll K = N -(p.at(i-1) + 1);
      int j = i;
      while(j > 1){
        cout << char(int(K / ll(pow(26,j)))+97);
        K = K % ll(pow(26,j));
        j --;
      }
      cout << char(int(K / 26)+97) << char(K % 26 + 97) << endl;
      return 0;
    }
  }
  return 0;
}

Measured memory_bytes: 4064
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"

using namespace std;

const long long int MOD = 1000000007;

long long int N, M, K, H, W, L, R;


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

	string s;
	for (int i = 0; i < 3; i++) {
		cin >> s;
		cout << s[i];
	}
	cout << endl;
	return 0;
}

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

int main() {
    // int name;
    // name = 10;
    // cout << name << endl;

    // name = 5;

    // cout << name << endl;

    // int a;

    // cin >> a;
    // cout << a * 10 << endl;

    // string text;
    // double d;
    // cin >> text;
    // cin >> d;
    // cout << text << ", " << d << endl;

    // int a, b, c;
    // cin >> a >> b >> c;
    // cout << a * b * c << endl;

    // int a, b;
    // cin >> a >> b;
    // cout << a + b << endl;

    int m;
    cin >> m;
    cout << 24 + 24 - m << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int hi[4] = {0, 1, 0, -1};
int hj[4] = {1, 0, -1, 0};
const int maxn = 110;
int a[maxn * maxn];
int f[maxn][maxn];

int main() {
	int n, m;
	//freopen("a.inp", "r", stdin);
	scanf("%d %d", &n, &m);
	int k;
	scanf("%d", &k);
	for (int i = 0; i < k; i++) {
		scanf("%d", &a[i]);
	}
	// sort(a,a+k);
	int x = 1;
	int y = 1;
	int dir = 0;
	for (int i = 0; i <= n + 1; i++) {
		f[i][0] = 1;
		f[i][m + 1] = 1;
	}
	for (int j = 0; j <= m + 1; j++) {
		f[0][j] = 1;
		f[n + 1][j] = 1;
	}
	for (int i = 0; i < k; i++) {
		for (int j = 0; j < a[i]; j++) {
			f[x][y] = i + 1;
			int x1 = x + hi[dir];
			int y1 = y + hj[dir];
			if (f[x1][y1]) {
				dir ++;
				dir %= 4;
			}
			x = x + hi[dir];
			y = y + hj[dir];
		}
	}
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= m; j++) {
			cout << f[i][j] << " ";
		}
		cout << endl;
	}
}

Measured memory_bytes: 384
<?php

// $s = trim(fgets(STDIN));
// fscanf(STDIN, "%d %d", $a, $b);
// $n = array_map('intval', explode(' ', trim(fgets(STDIN))));

$x = array_map('intval', explode(' ', trim(fgets(STDIN))));

foreach ($x as $i => $x_i) {
    if ($x_i === 0) {
        echo ($i + 1), PHP_EOL;
        break;
    }
}


Measured memory_bytes: 15992
N = int(input())
Ai = list(map(int,input().split()))


flag = False

for i in range(N):
  if(Ai[i]%2 == 0):
    if(Ai[i]%3 != 0 and Ai[i]%5 != 0):
      flag = True
      break

if(flag):
  print('DENIED')
else:
  print('APPROVED')

Measured memory_bytes: 38384
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

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

/*
    freopen("input","r",stdin);
    freopen("output","w",stdout);
*/

int P[100010];

int U[100010];

int f(int n) {
    if (U[n] == n) return n;
    int q = f(U[n]);
    U[n] = q;
    return U[n];
}

void merge(int n, int m) {
    int a = f(n);
    int b = f(m);
    if (a != b) U[a] = b;
    return;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    int N, M;
    cin >> N >> M;
    for (int i = 1;i <= N;i++) U[i] = i;
    for (int i = 1;i <= N;i++) cin >> P[i];
    for (int i = 0;i < M;i++) {
        int a, b;
        cin >> a >> b;
        merge(a, b);
    }
    int sol = 0;
    for (int i = 1;i <= N;i++) {
        int d = P[i];
        if (f(d) == f(i)) sol++;
    }
    cout << sol << endl;
    return 0;
}

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

int a,b;

int main()
{
    scanf("%d%d",&a,&b);
    if(a+b==15)
    {
        printf("+\n");
        return 0;
    }
    if(a*b==15)
    {
        printf("*\n");
        return 0;
    }
    printf("x\n");
    return 0;
}

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

#define TRACE(x) cerr << #x << " :: " << x << endl
#define _ << " " <<
#define SZ(x) (int)(x).size()
#define ALL(x) (x).begin(),(x).end()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define RFOR(i,a,b) for (int i=(a);i>=(b);--i)

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    string S; cin >> S;
    cout << S.substr(0,3) << '\n';
}



Measured memory_bytes: 3648
#include <iostream>
#include <vector>
#include <algorithm>
#define ll long long
using namespace std;
int main(){
    int a,b;
    cin>>a>>b;
    if(a>=10||b>=10){
        cout<<-1<<endl;
    }else{
        cout<<a*b<<endl;
    }
    return 0;
}

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

string s;
long long n, q, k;
long long cnt[1000005][2] = {0};

long long solve();

int main() {
  cin >> n >> s >> q;
  for(long long i = 0; i < n; ++i) {
    if(i != 0) {
      cnt[i][0] = cnt[i - 1][0];
      cnt[i][1] = cnt[i - 1][1];
    }
    if(s[i] == 'D') ++cnt[i][0];
    if(s[i] == 'M') ++cnt[i][1];
  }
  for(long long i = 0; i < q; ++i) {
    cin >> k;
    cout << solve() << endl;
  }
  return 0;
}
long long solve() {
  long long now = 0, ans = 0;
  for(long long i = 0; i < n; ++i) {
    if(i >= k && s[i - k] == 'D') {
      if(i != 0) now -= cnt[i - 1][1];
      now += cnt[i - k][1];
    }
    if(s[i] == 'M') {
      if(i != 0) now += cnt[i - 1][0];
      if(i >= k) now -= cnt[i - k][0];
    }
    if(s[i] == 'C') ans += now;
  }
  return ans;
}


Measured memory_bytes: 17028
use proconio::input;
fn main(){
    input!{
        n:usize,
        mut a_s:[i32;n]
    }
    let mut cnt = 1;
    let mut prev:i32 = -1;
    let mut ans = 0;
    a_s.push(-1);
    for a in a_s {
        cnt = 
            if prev == a { 
                cnt + 1
            } else {
                ans += (cnt)/2; 
                1
            };
        prev = a;
    }
    println!("{}",ans)

}


Measured memory_bytes: 2176
//https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8 より
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

//

fn run() {
    input! {
        a: usize,
        b: usize,
        m: usize,
        p: [u32; a],
        q: [u32; b],
        c: [(usize1, usize1, u32); m],
    }
    let mut ans = *p.iter().min().unwrap() + *q.iter().min().unwrap();
    for (x, y, c) in c {
        ans = std::cmp::min(ans, p[x] + q[y] - c);
    }
    println!("{}", ans);
}

fn main() {
    run();
}


Measured memory_bytes: 14328
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

		int cntOdd = 0;

		for (int i = 0; i < N; i++) {
			int num = sc.nextInt();
			if (num % 2 == 1) {
				cntOdd++;
			}
		}

		if (cntOdd % 2==1) {
			System.out.println("NO");
		} else {
			System.out.println("YES");
		}
	}
}


Measured memory_bytes: 50400
N = int(input())
wa, wb, wc = [0] * 3
for a, b, c in (map(int, input().split()) for _ in range(N)):
  wa, wb, wc = a + max(wb, wc), b + max(wa, wc), c + max(wa, wb)
print(max(wa, wb, wc))


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

int main(){
    int n; cin >> n;
    long long L[100];
    L[0] = 2; L[1] = 1;
    for(int i=2;i<=n;++i) {
         L[i] = L[i-1] + L[i-2];
    }
    cout << L[n] << endl;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <stack>
#include <string>
#include <utility>
#include <vector>

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

using namespace std;

template <typename T> void output(T, int);
int gcd(int a, int b);

int main() {
    // source
    int r, g, b, n;
    int ans = 0;
    cin >> r >> g >> b >> n;
    rep(i, n / r + 1) {
        rep(j, n / g + 1) {
            int temp = n - r * i - g * j;
            if (temp / b >= 0 && temp % b == 0) {
                ans++;
            }
        }
    }
    cout << ans << endl;
    return 0;
}

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

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


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"io"
	"math"
	"os"
	"sort"
	"strconv"
	"strings"

)


func main() {
	solve(os.Stdin, os.Stdout)
}

type ReaderEx struct {
	baseScanner *bufio.Scanner
	words       []string
	nextWordIdx func() int
	initWordIdx func(int)
}

func NewScannerEx(stdin io.Reader) *ReaderEx {
	var this ReaderEx
	var idx int
	var wordsCnt int
	this.baseScanner = bufio.NewScanner(stdin)
	this.baseScanner.Buffer(make([]byte, 0), 1E+11)
	this.nextWordIdx = func() int {
		cur := idx
		idx = (idx + 1) % wordsCnt
		return cur
	}
	this.initWordIdx = func(wc int) {
		idx = 0
		wordsCnt = wc
	}
	return &this
}

func (me *ReaderEx) Scan(doSplit bool) (isScanned bool) {
	isScanned = me.baseScanner.Scan()
	if doSplit {
		me.words = strings.Fields(me.baseScanner.Text())
	} else {
		me.words = []string{me.baseScanner.Text()}
	}
	me.initWordIdx(len(me.words))
	return
}

func (me *ReaderEx) nextBytes() []byte {
	return []byte(me.words[me.nextWordIdx()])
}
func (me *ReaderEx) nextString() string {
	return me.words[me.nextWordIdx()]
}

type StringArray []string

func (me *ReaderEx) nextStringArray() StringArray {
	return me.words[me.nextWordIdx():]
}

func (me StringArray) toStrings() []string {
	return me
}

func (me StringArray) toInts() []int {
	strValues := me.toStrings()
	values := make([]int, len(strValues))
	for i, v := range strValues {
		n, err := strconv.Atoi(v)
		if err != nil {
			panic(err)
		}
		values[i] = n
	}
	return values
}
func (me *ReaderEx) nextInt() int {
	n, err := strconv.Atoi(me.words[me.nextWordIdx()])

	defer func() {
		if err != nil {
			panic(fmt.Sprintf("getInt(%d)", n))
		}
	}()
	return n
}

func pow(x, y, mod int) (ans int) {

	ans = 1
	for bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {
		if y&bit != 0 {
			ans *= x
			if mod > 0 {
				ans %= mod
			}
		}
		if bit <= 1 {
			return
		}
		ans *= ans
		if mod > 0 {
			ans %= mod
		}
	}
}

type factType struct {
	prime int
	count int
}

func fact(n int) (facts []*factType) {

	for i := 2; i*i <= n; i++ {
		if n%i == 0 {
			fa := factType{prime: i}
			for n%fa.prime == 0 {
				n /= fa.prime
				fa.count++
			}
			facts = append(facts, &fa)
		}
	}
	if n > 1 {
		facts = append(facts, &factType{prime: n, count: 1})
	}
	return facts
}
func dec2bin(n int) (ret []bool) {
	for bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {
		ret = append(ret, n&bit != 0)

		if bit <= 1 {
			return
		}
	}

}

func abs(v int) int {
	if v < 0 {
		v = -v
	}
	return v
}

func b2i(b bool) (i int) {
	if b {
		i = 1
	} else {
		i = 0
	}
	return
}

func solve(stdin io.Reader, stdout io.Writer) {

	r := NewScannerEx(stdin)
	r.Scan(true)
	_, k := r.nextInt(), r.nextInt()
	r.Scan(true)
	p := r.nextStringArray().toInts()

	sort.Sort(sort.IntSlice(p))

	sumInt := func(src []int) (vs int) {
		vs = 0
		for i := range src {
			vs += src[i]
		}
		return
	}
	fmt.Fprintln(stdout, sumInt(p[:k]))
}


Measured memory_bytes: 1768
#include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include <vector>
#include <algorithm>
#include <functional>
#include <map>
#include <climits>
#include <memory>
#include <sstream>
#include <iomanip>
#include <cstdio>

using namespace std;

int main() {

	cin.tie(0);
	ios::sync_with_stdio(false);

	int n, k;
	cin >> n >> k;

	double ans = 0;

	for (int i = 1; i <= n; i++) {
		if (i >= k) {
			ans += 1.0 / n;
		}
		else {
			int j = 0;
			while (1) {
				if (i*pow(2, j) >= k) break;
				else j++;
			}
			ans += pow(0.5, j) / n;
		}
	}

	printf("%.16lf\n", ans);

	return 0;
}

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

int main()
{
	string w;
	cin >> w;
	string t;
	int count = 0;
	while (cin >> t,t!="END_OF_TEXT") {
		for (int i=0;i<t.size();i++) {
			if (t[i]<= 'Z' && t[i] >= 'A') {
				t[i] +=32 ;
			}
		}
		if (w == t) {
			count++;
		}
	}
	cout << count << endl;
}


	




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

using namespace std;

#define ll long long

const int N=1e6+5,MOD=1000000007;

int n,b[N],a[N],q,m,u,v,tc,k,l,ans,x;

char s[N];

int main(){ 
    std::ios::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
   
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        int x=i,dig=0;
        while(x){
            x/=10;
            dig++;
        }
        if (dig&1)
            ans++;
    }
    printf("%d\n",ans);

}   


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
long long ans;
int main()
{
	long long n,x,k;
	scanf("%lld",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%lld",&x);
		k+=x;
		if(x==0)
		{
			ans+=k/2;
			k=0;
		}
	}
	ans+=k/2;
	k=0;
	printf("%lld",ans);
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, from, to) for (int i = from; i < (to); ++i)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define pb push_back
using ll = long long;
using vin=vector<int>;
using vll=vector<ll>;
using vst=vector<string>;
using P = pair<int, int>;
const int inf=1e9+7;
const ll INF=1e18;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };


int main(){cout<<fixed<<setprecision(10);
		   int h,w,n;
           cin>>h>>w>>n;
           cout<<(n+max(h,w)-1)/(max(h,w))<<endl;
}

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

using namespace std;

typedef long long ll;

const ll MOD = 1000000007;
const ll INF = 1LL<<60;
//int INF = numeric_limits<int>::max();

int main(int, char**) {
	string s; cin >> s;
	string ret;
	if (s[0]==s[1] || s[1]==s[2] || s[2]==s[3]) ret = "Bad";
	else ret = "Good";
	cout << ret << endl;
	return 0;
}

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


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

int N, M;

void solve() {
    vector<int> v(N), d(M);
    for (auto& i : v) cin >> i;
    for (auto& i : d) cin >> i;

    int start = 0;
    int ans = 0;
    for (int i = 0; i < M; i++) {
        if (start >= N) break;
        ans++;
        start = d[i] + start + v[d[i] + start];
    }

    cout << ans << endl;
}

int main() {
    while (cin >> N >> M, N || M) solve();
}

Measured memory_bytes: 3096
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define Rep(i,a,n) for (int i=a;i<=n;i++)
#define Per(i,a,n) for (int i=n;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}()); 
const ll mod=1000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head

signed main(){
   int a,b,c;cin>>a>>b>>c;
   vector<int> v;
   v.pb(a);
   v.pb(b);
   v.pb(c);
    sort(all(v));
    if(v[0]==v[1]&&v[0]!=v[2]) return 0*puts("Yes");
    if(v[1]==v[2]&&v[0]!=v[2]) return 0*puts("Yes");
    puts("No");
    return 0;
}

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

int main(){
  int n,m;
  cin >> n >> m;
  vector<int> A(m+10);
  int ans = 0;
  rep(i,m){
    cin >> A[i];
    ans += A[i];
  }
  if(ans <= n) cout << n-ans << endl;
  else puts("-1");
  return 0;
}


Measured memory_bytes: 3664
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,b,c,d,e,k;
  cin >> a >> b >> c >> d >> e >> k;
  
  if (e-a > k){
    cout << ":(" << endl;
  }
  else {
    cout << "Yay!" << endl;
  }
}
  
 

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

using namespace std;

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

const int N = 16;
const ll inf = numeric_limits<ll>::max();

ll grid[N][N], score[1 << N], memo[1 << N], n;
bool vis[1 << N];

ll dp(int mask);

ll nxt(int curr, int mask, int cnt){
    //cout << curr << " " << mask <<  " " << cnt << endl;
    if(cnt == n){
        if(!curr) return - inf;
        return dp(mask | curr) + score[curr];
    }

    ll ans = nxt(curr, mask, cnt + 1);
    if((mask & (1 << cnt)) == 0) ans = max(ans, nxt(curr | (1 << cnt), mask, cnt + 1));
    return ans;   
}

ll dp(int mask){
    //cout << mask << endl;
    if(mask == (1 << n) - 1) return 0;
    if(vis[mask]) return memo[mask];
    vis[mask] = true;
    ll ans = nxt(0, mask, 0);
    return memo[mask] = ans;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n;
    for(int i = 0; i < n; i++)
        for(int j = 0; j < n; j++)
            cin >> grid[i][j];
    
    for(int i = 0; i < (1 << n); i++)
        for(int j = 0; j < n; j++)
            for(int k = 0; k < j; k++)
                if((i & (1 << j)) && (i & (1 << k)))
                    score[i] += grid[j][k];  
    
    cout << dp(0) << endl;
}

Measured memory_bytes: 1408
using System;
using System.Collections.Generic;
using System.Linq;

namespace Volume0_0001
{
	class Program
	{
		static void Main(string[] args)
		{
			List<int> h = new List<int>();

			for(int i = 0; i < 10; i++) {
				h.Add(int.Parse(Console.ReadLine()));
			}

			foreach(int i in h.OrderByDescending(x => x).Take(3)) {
				Console.WriteLine(i);
			}
		}
	}
}



Measured memory_bytes: 16248
#include <bits/stdc++.h>
using namespace std;
#define SZ(v) int((v).size())
#define ALL(vec) (vec).begin(),(vec).end()
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;}
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); \
  stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
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 += "}";}
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() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  
  int h, a; cin >> h >> a;
  kek((h + a - 1) / a);
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<list>
#include<queue>
#include<stack>
#include<deque>
using namespace std;

int main() {
	int a; cin >> a;
	for (int b = 0; b < a; b++) {
		double x1, y1, r1, x2, y2, r2;
		cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
		double s = sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
		if (s+r1<r2) {
			puts("-2");
		}
		else if (s+r2<r1) {
			puts("2");
		}
		else if (s - r2 - r1 > 0) {
			puts("0");
		}
		else puts("1");
	}
}

Measured memory_bytes: 3096
using System;

namespace tes
{
    class Program
    {
        public static void Main()
        {
            String str = Console.ReadLine();
            String[] num = str.Split(' ');
            if (int.Parse(num[0]) < int.Parse(num[1]))
            {
                Console.WriteLine("a < b");
            }
            else if (int.Parse(num[0]) > int.Parse(num[1]))
            {
                Console.WriteLine("a > b");
            }
            else
            {
                Console.WriteLine("a == b");
            }
        }
    }
}

Measured memory_bytes: 5288
//15:53-17:33
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
#define mod 1000000007
string s;
ll L,R;
ll hhash[200005];
ll modpow(ll x,ll n){
	ll res=1;
	while(n>0)
	{
		if(n&1) res=res*x%mod;
		x=x*x%mod;
		n>>=1;
	}
	return res;
}
ll calc(int l,int r){
	ll ret = hhash[r]-(l?hhash[l-1]:0LL); //cout << ret << endl;
	return (ret%mod+mod)%mod * modpow(modpow(37LL,1LL*l),mod-2) % mod;
}
vector<vector<ll> >vec;
vector<ll>num;
vector<ll>cnt[200005];
vector<ll>C(ll idx){
	if(idx <= s.size()) return idx<=0?vector<ll>(26,0LL):cnt[idx-1];
	int x = upper_bound(num.begin(),num.end(),idx)-num.begin();
	x--;
	vector<ll>V = C(idx-num[x]);
	for(int i=0;i<26;i++) V[i] += vec[x][i];
	return V;
}
int main(){
	cin >> s >> L >> R;
	ll seed = 1;
	for(int i=0;i<s.size();i++){
		hhash[i] += (1+s[i]-'a') * seed % mod;
		seed *= 37LL; seed %= mod;
		if(i){
			hhash[i] = (hhash[i]+hhash[i-1])%mod;
			cnt[i] = cnt[i-1]; cnt[i][s[i]-'a']++;
		}
		else{
			cnt[i].resize(26,0LL); cnt[i][s[i]-'a']++;
		}
	}
	int n = s.size(); n /= 2; //cout << n<< endl;
	ll beg = n,nex = 2*n;
	for(int i=n+1;i<2*n;i++){
	    //if(i==22) cout << hhash[2*n-1-i] << " " << calc(i,2*n-1) << endl;
		if(hhash[2*n-1-i] == calc(i,2*n-1)){
			nex = i; break;
		}
	}
	vector<ll>hoge(26,0ll);
	for(int i=0;i<beg;i++){
		hoge[s[i]-'a']++;
	}
	vector<ll>hoge2(26,0ll);
	for(int i=0;i<nex;i++){
		hoge2[s[i]-'a']++;
	}
	vec.pb(hoge); vec.pb(hoge2);
	num.pb(beg); num.pb(nex); //cout << beg << " " << nex << endl;
	while(1){
		vector<ll>hoge3(26,0LL);
		ll S = 0;
		for(int i=0;i<26;i++){
			hoge3[i] = vec[vec.size()-1][i]+vec[vec.size()-2][i];
			S += hoge3[i];
		}
		if(S > R) break;
		else{
			vec.pb(hoge3);
			num.pb(num[num.size()-1]+num[num.size()-2]); //cout << num[num.size()-1] << endl;
		}
	}
	vector<ll>B = C(R);
	vector<ll>S = C(L-1);
	for(int i=0;i<26;i++) cout << B[i]-S[i] << (i==25?'\n':' ');
}

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

int main()
{
    string S, T;
    cin >> S >> T;
    cout << T + S << endl;
}

Measured memory_bytes: 256