akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <utility>
#include <typeinfo>
#include <cmath>
#include <numeric>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <vector>
#include <tuple>
#define REP(i,n) for(int i=0;i<n;i++)
typedef long long int ll;
using namespace std;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;
typedef vector<string> vs;

ll d = 1000000007;

int main()
{
  ll ans = 1;
  int n;
  cin >> n;
  int a[100000] = {};
  REP(i,n)
  {
    int tmp;
    cin >> tmp;
    a[tmp] ++;
  }

  REP(i,n)
  {
    if(n%2 == 0)
    {
      if(i%2 == 1)
      {
        if(a[i]==2)
        {
          ans = (ans * 2) %d;
        }
        else
        {
          ans = 0;
          break;
        }
      }
    }
    else
    {
      if(i==0)
      {
        if(a[i] != 1)
        {
          ans = 0;
          break;
        }
      }
      else if(i  %2 == 0)
      {
        if(a[i]==2)
        {
          ans = (ans * 2) %d;
        }
        else
        {
          ans = 0;
          break;
        }
      }
    }
  }
  cout << ans << endl;

  return 0;
}


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

using namespace std;

const double EPS = 1e-8;
const double INF = 1e12;

typedef complex<double> point;

namespace std {
    bool operator < (const point& a, const point& b) {
        return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
    }
}

double cross(const point& a, const point& b) {
    return imag(conj(a)*b);
}

double dot(const point& a, const point& b) {
    return real(conj(a)*b);
}

int ccw(point a, point b, point c) {
    b -= a; c -= a;
    if (cross(b, c) > 0)   return +1;       // counter clockwise
    if (cross(b, c) < 0)   return -1;       // clockwise
    if (dot(b, c) < 0)     return +2;       // c--a--b on line
    if (norm(b) < norm(c)) return -2;       // a--b--c on line
    return 0;
}

vector<point> convex_hull(vector<point> ps) {
    int n = ps.size(), k = 0;
    sort(ps.begin(), ps.end());
    vector<point> ch(2*n);
    for (int i = 0; i < n; ch[k++] = ps[i++]) // lower-hull
        while (k >= 2 && ccw(ch[k-2], ch[k-1], ps[i]) <= 0) --k;
    for (int i = n-2, t = k+1; i >= 0; ch[k++] = ps[i--]) // upper-hull
        while (k >= t && ccw(ch[k-2], ch[k-1], ps[i]) <= 0) --k;
    ch.resize(k-1);
    return ch;
}

int main()
{
    int n;
    char ch;

    while (cin >> n, n) {
        vector<point> input(n);
        vector<point> convex;
        
        for (int i = 0; i < n; i++) 
            cin >> input[i].real() >> ch >> input[i].imag();
        convex = convex_hull(input);
        cout << n - convex.size() << endl;
    }

    return 0;
}

Measured memory_bytes: 1260
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
	private static void solveTC(int __) {
		
		/* For Google */
//		ans.append("Case #").append(__).append(": ");

//		code start
		
		int a = scn.nextInt(), b = scn.nextInt(), c = scn.nextInt(), d = scn.nextInt();
		
		while (true){
			c-=b;
			if(c<=0){
				print("Yes");
				return;
			}
			a-=d;
			if (a<=0){
				print("No");
				return;
			}
		}

//		code end
		
//		ans.append("\n");
	}
	
	static void print(Object obj) {
		ans.append(obj.toString());
	}
	
	public static void main(String[] args) {
		
		scn = new Scanner();
//		int t = scn.nextInt();
		int t = 1;
		for (int i = 1; i <= t; i++) {
			ans = new StringBuilder();
			solveTC(i);
			System.out.print(ans);
		}
		
	}
	
	static Scanner scn;
	static StringBuilder ans;
	
	//Fast Scanner
	static class Scanner {
		BufferedReader br;
		StringTokenizer st;
		
		public Scanner() {
			br = new BufferedReader(new
					InputStreamReader(System.in));
		}
		
		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}
		
		int nextInt() {
			return Integer.parseInt(next());
		}
		
		long nextLong() {
			return Long.parseLong(next());
		}
		
		double nextDouble() {
			return Double.parseDouble(next());
		}
		
		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
		
		int[] nextIntArray(int n) {
			int[] array = new int[n];
			for (int i = 0; i < n; i++) {
				array[i] = nextInt();
			}
			return array;
		}
		
		Integer[] nextIntegerArray(int n) {
			Integer[] array = new Integer[n];
			for (int i = 0; i < n; i++) {
				array[i] = nextInt();
			}
			return array;
		}
		
		long[] nextLongArray(int n) {
			long[] array = new long[n];
			for (int i = 0; i < n; i++) {
				array[i] = nextLong();
			}
			return array;
		}
		
		String[] nextStringArray() {
			return nextLine().split(" ");
		}
		
		String[] nextStringArray(int n) {
			String[] array = new String[n];
			for (int i = 0; i < n; i++) {
				array[i] = next();
			}
			return array;
		}
	}
}

Measured memory_bytes: 32492
// Prep to Republic Olymp
#include <bits/stdc++.h>

#define x first
#define y second
#define pb push_back
#define mp make_pair
#define SZ(x) x.size()
#define NAME "main"
#define in insert
#define whole(x) x.begin(), x.end()
#define watch(x) cout << (#x) << " " << "is" << " " << x << endl

using namespace std;

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

const int N = 2 * (1e5);
const int MOD = (1e9) + 7;
const double pi = acos(0.0);
const ll INF = (1e17) + 6969;


signed main() {
#ifdef LOCAL 
	freopen(NAME".in", "r", stdin);
	freopen(NAME".out", "w", stdout);
#endif 
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr), cout.tie(nullptr);               
	double a, b;
	cin >> a >> b;
	cout << setprecision(7) << fixed << a / b;
	return false;
}

Measured memory_bytes: 256
li = list(input())

if li[0] == li[1] and li[1] == li[2]:
    print('Yes')
elif li[1] == li[2] and li[2] == li[3]:
    print('Yes')
elif li[0] == li[1] and li[0] == li[2] and li[0] == li[3]:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 8972
#include<bits/stdc++.h>
#include<iostream>
#include<ctype.h>
using namespace std;
int main()
{
  string a;
  cin>>a;
  if(a.size()==6){
    for(int i=0;i<6;i++)
    {if(islower(a[i]))
        continue;
     else
       return 0;
    }
  if((a[2]==a[3])&&(a[4]==a[5]))
   cout<<"Yes";
  else
    cout<<"No";
  return 0;
  }
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#define rep(i, n) for(int i = 0; i < (int)(n); ++i)
#define REP(i, n) for(int i = 1; i < (int)(n); ++i)
using namespace std;

int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    rep(i, N) cin >> A[i];
    
    vector<vector<int>> S(300000);
    rep(i, N) {
        int x = i - A[i];
        if (x < 0) continue;
        if (x >= 300000) continue;
        S[x].push_back(i);
    }
    rep(i, 300000) sort(S[i].begin(), S[i].end());
    long long ans = 0;
    rep(i, N) {
        int x = i + A[i];
        if (x < 0) continue;
        if (x > 300000) continue;
        int left = -1;
        int right = (int)S[x].size();
        while (right - left > 1) {
            int mid = (right + left) / 2;
            if (S[x][mid] <= i) left = mid;
            else right = mid;
        }
        ans += (int)S[x].size() - right;
    }
    cout << ans << endl;
    return 0;
}


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

#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;

int main()
{
	int N, sleeping = 0;
  	
  	cin >> N;
  
	string X;
	bool sleep = false;
	vector<string> name(N);
	vector<int> time(N);

	

	rep(i, N) {
		cin >> name[i];
		cin >> time[i];
      	//cout << name[i] << endl;
      	//cout << time[i] << endl;
	}

	cin >> X;

	rep(i, N)
		if (sleep) sleeping += time[i];
		else if (name[i] == X) sleep = true;

	cout << sleeping;
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<algorithm>
#include<cassert>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
#include<list>
#include <cstring>
#include <functional>
//#include<unordered_map>
//#include<unordered_set>
using namespace std;
#define MOD 1000000007
#define MOD2 998244353
#define INF ((1<<30)-1)
#define LINF ((Int)1<<60)
#define EPS (1e-10)
#define REP(i,n) for(int i=0; i<(int)(n); ++i)
#define RREP(i,n) for(int i=1; i<=(int)(n); ++i)
#define FOR(i,k,n) for(int i=(k);i<(int)(n);++i)
typedef long long Int;
typedef pair<Int, Int> P;
typedef vector<double> vec;
typedef vector<vec> mat;
const int N = 100005;
//////////////////////////////

Int dp[4001][4001];
string s;
int n;

void solve()
{
	cin >> s;
	n = s.size();

	int rs = 0, bs = 0;
	dp[0][0] = 1;

	for (int i = 0; i < 2 * n; i++) {
		if (i < n) {
			rs += '2' - s[i];
			bs += s[i] - '0';
		}
		for (int r = 0; r <= rs; r++) {
			int b = i + 1 - r;
			if (b < 0 || b > bs) continue;
			dp[i + 1][r] = (dp[i + 1][r] + dp[i][r]) % MOD2;
			if (r > 0) dp[i + 1][r] = (dp[i + 1][r] + dp[i][r - 1]) % MOD2;
		}
	}

	cout << dp[2 * n][rs] << endl;
}

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(13);
	solve();
	return 0;
}



Measured memory_bytes: 50888
-- AtCoder Beginner Contest 134 B
import Control.Monad
import Control.Applicative
import Data.List

toInt :: String -> Int
toInt x = read x :: Int
 
getInts = do
  x <- getLine
  let y = (map$toInt)$words x
  return y

abc134b :: [Int] -> Int
abc134b (n:(d:rm)) = ceiling $ (fromIntegral n) / (fromIntegral (2*d + 1))

main :: IO()
main = do
  nd <- getInts
  let ans = abc134b nd
  print ans

Measured memory_bytes: 508
#include<iostream>
#include <algorithm>
#include<string>
#include <numeric>
#include<math.h>
#include <bits/stdc++.h>
using namespace std;

int main(void) {
    int a,b,c;
    cin>>a>>b>>c;
    int aaa[3] = {a,b,c};
    sort(aaa,aaa+3);
    cout<<aaa[2]*10+aaa[1]+aaa[0]<<endl;
    }


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <numeric>
#define M 1000000007
#define pb push_back
#define forz(i,s,n) for(lli i=s;i<n;i++)

#define fast_io                       \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);

typedef long long int lli;
//typedef pair<long long int, long long int> pll;
typedef unsigned long long int ull;
using namespace std;

lli recpow(lli x, lli n)
{
    if (n == 0)
        return 1;
    else if (n % 2 == 0) //n is even
        return recpow((x * x) % M, n / 2);
    else //n is odd
        return (x * recpow((x * x) % M, (n - 1) / 2)) % M;
}

bool sortbysec(const pair<int, int> &a,
               const pair<int, int> &b)
{
    return (a.second < b.second);
}

bool comp(pair<lli, lli> a, pair<lli, lli> b)
{
    if(a.first==b.first)
        return a.second<b.second;
    else
        return a.first<b.first;
}

void multiply(lli f[2][2], lli m[2][2])
{
    lli x = (f[0][0] % M * m[0][0] % M) % M + (f[0][1] % M * m[1][0] % M) % M;
    lli y = (f[0][0] % M * m[0][1] % M) % M + (f[0][1] % M * m[1][1] % M) % M;
    lli z = (f[1][0] % M * m[0][0] % M) % M + (f[1][1] % M * m[1][0] % M) % M;
    lli w = (f[1][0] % M * m[0][1] % M) % M + (f[1][1] % M * m[1][1] % M) % M;
    f[0][0] = x % M;
    f[0][1] = y % M;
    f[1][0] = z % M;
    f[1][1] = w % M;
}

lli u[2][2] = {{1, 1}, {1, 0}};

void power(lli f[2][2], lli n)
{
    if (n == 0 || n == 1)
        return;
    power(f, n / 2);
    multiply(f, f);
    if (n % 2 != 0)
        multiply(f, u);
}

lli fib(lli n)
{
    if (n == 1)
        return 2;
    else if (n == 2)
        return 3;
    else
    {
        lli h[2][2] = {{1, 1}, {1, 0}};
        power(h, n + 1);
        return h[0][0];
    }
}

//code begins here
int main()
{
    fast_io;
    lli n, w;
    cin>>n>>w;
    lli dp[w+1]={0};
    forz(i,0,n)
    {
        lli we, val;
        cin>>we>>val;
        for(lli wa=w-we;wa>=0;--wa)
        {
            dp[we+wa]=max(dp[we+wa], dp[wa]+val);
        }
    }
    lli ans=0;
    forz(i,0,w+1)
    ans=max(ans,dp[i]);
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 1024
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def main():
    X1, Y1, X2, Y2 = map(int, input().split())

    x, y = X2 - X1, Y2 - Y1
    print(X2 - y, Y2 + x, X1 - y, Y1 + x)


if __name__ == "__main__":
    main()


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

typedef long long ll;

int main() {
    ll H, W, D;
    cin >> H >> W >> D;
    vector<vector<ll>> A(H, vector<ll>(W));
    vector<ll> x(H * W), y(H * W), s(H * W + 1, 0);
    rep(i, H) {
        rep(j, W) {
            cin >> A[i][j];
            A[i][j]--;
            x[A[i][j]] = i;
            y[A[i][j]] = j;
        }
    }
    for (int i = 0; i + D < H * W; i++) {
        s[i + D] = s[i] + abs(x[i + D] - x[i]) + abs(y[i + D] - y[i]);
    }
    int Q, L, R;
    cin >> Q;
    rep(i, Q) {
        cin >> L >> R;
        cout << s[R - 1] - s[L - 1] << endl;
    }
}

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

    int ans = 0;
    for(int i=1; i<=n; i+=2){
        int count = 0;
        for(int j=1; j<=i; j++){
            if(i%j==0){
                count++;
            }
        }
        if(count == 8){
            ans++;
        }
    }
    cout << ans;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstring>
#include <map>

#define rep(i, N) for (int i = 0; i < (int)N; i++)
using namespace std;
typedef long long ll;
const ll LLINF = 9223372036854775807;
const int MOD = 1000000007;

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

  int result = 1000;
  rep(i, S.length()-2) result = min(result, abs((S[i]-'0')*100+(S[i+1]-'0')*10+(S[i+2]-'0')-753)); 
  cout << result << endl;
  return 0;
}

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

int main()
{
  int a,b,c,d,x,y;
  cin>>a>>b>>c>>d;
  if(c%b==0)
  {
    x=c/b;
  }
  else
  {
    x=c/b+1;
  }
  if(a%d==0)
  {
    y=a/d;
  }
  else
  {
    y=a/d+1;
  }

  if(x<=y)
  {
    cout<<"Yes"<<endl;
  }
  else
  {
    cout<<"No"<<endl;
  }
}


Measured memory_bytes: 3620
//
// Created on 2020/09/09.
//

#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <ios>
#include <iomanip>
#include <numeric>

#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef long long ll;
using namespace std;
const long long LINF =1e18;
const int INF = 1e9;



int main() {
    int n,m;
    cin>>n>>m;
    map<int,int>menu;
    for (int i = 0; i < n; ++i) {
        int k;
        cin>>k;
        for (int j = 0; j < k; ++j) {
            int a;
            cin>>a;
            menu[a]++;
        }
    }
    int ans = 0;
    for (int i = 0; i <= m; ++i) {
        if(menu[i]==n)ans++;
    }
    cout<<ans<<endl;
    return 0;
}



Measured memory_bytes: 3632
#include <cstdio>
#include <vector>
using namespace std;
using ll = long long;

int main() {
	int N, K;
	scanf("%d %d", &N, &K);
	vector<ll> A(N);
	for (int i = 0; i < N; i++) {
		scanf("%lld", &A[i]);
	}
	for (int i = 0; i < N - K; i++) {
		if (A[i] < A[i + K]) {
			printf("Yes\n");
		} else {
			printf("No\n");
		}
	}
	return 0;
}


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

#define int long long
#define double long double
#define ff first
#define ss second
#define endl '\n'
#define ii pair<int, int>
#define mp make_pair
#define mt make_tuple
#define DESYNC                      \
  ios_base::sync_with_stdio(false); \
  cin.tie(0);                       \
  cout.tie(0)
#define pb push_back
#define vi vector<int>
#define vii vector<ii>
#define all(x) x.begin(), x.end()
#define EPS 1e-9
#define INF 1e18
#define ROOT 1
#define M 1000000007
#define curtime chrono::steady_clock::now().time_since_epoch().count
#define rep(i, beg, n, s) for (int i = beg; i < n; i += s)
const double PI = acos(-1);

using namespace std;

inline int mod(int n, int m = M) {
  int ret = n % m;
  if (ret < 0) ret += m;
  return ret;
}

int exp(int n, int k) {
  if (k == 0) return 1;
  if (k == 1) return n;
  int ax = exp(n, k / 2);
  ax = mod(ax * ax);
  if (k % 2) ax = mod(ax * n);
  return ax;
}

int gcd(int a, int b) {
  if (a == 0)
    return b;
  else
    return gcd(b % a, a);
}
//#define MULTIPLE_TEST_CASE
void solution() {
  int n;
  cin >> n;
  int b = (n + 999) / 1000;
  cout << b * 1000 - n << endl;
}

int32_t main() {
  DESYNC;
  mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  int t = 1;
#ifdef MULTIPLE_TEST_CASE
  cin >> t;
#endif
  while (t--) solution();
}


Measured memory_bytes: 3632
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <algorithm>
#include <math.h>
#include <utility>
#include <set>
#include <map>
#include <cstring>
#include <cstdio>
#include <stack>
#define INF 1000000000
#define rep(i,n) for(int i =0;i<n;i++)
using namespace std;
typedef long long int ll;

ll gcd(ll a, ll b){
    if (a==0 or b == 0) {
        return 1;
    }
    ll aa = max(a,b);
    ll bb = min(a,b);
    while (aa % bb != 0) {
        ll tmp = bb;
        bb = aa%bb;
        aa = tmp;
    }
    return bb;
}


pair<ll, ll> g(ll aa,ll ab, ll ba, ll bb){
    ll c = ab * bb;
    ll d = aa*bb - ba*ab;
    ll cd = gcd(d,c);
    return {d/cd,c/cd};
}

pair<ll, ll> h(ll aa,ll ab, ll ba, ll bb){
    ll c = ab * bb;
    ll d = aa*bb + ba*ab;
    ll cd = gcd(d,c);
    return {d/cd,c/cd};
}

ll fac2(int n){
    if (n==0) {
        return 1;
    }else{
        return 2*fac2(n-1);
    }
}

int main(){
    for (;;){
        string s;
        cin >> s;
        if(s=="#")break;
        vector<int> dir;
        for (int i=0; i<s.length(); i++) {
            if(s[i]=='n'){
                dir.push_back(1);
                i+=4;
            }else{
                dir.push_back(2);
                i+=3;
            }
        }
        pair<ll, ll> ans = {0,0};
        if (dir[dir.size()-1]==1) {
            ans = {0,1};
        }else{
            ans = {90,1};
        }
        for (int i=(int)dir.size()-2; i>=0; i--) {
            if (dir[i]==1) {
                ans = g(ans.first,ans.second,90,fac2((int)dir.size()-1-i));
            }else{
                ans = h(ans.first,ans.second,90,fac2((int)dir.size()-1-i));
            }
        }
        if (ans.second==1) {
            cout <<ans.first<<endl;
        }else{
            cout <<ans.first<<"/"<<ans.second<<endl;
        }
    }
}

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

int main () {
  int N, ans=0;
  cin >> N;
  vector<int> L(N);
  rep(i,N) {
      cin >> L[i];
  }
  for (int i = 0; i < N-2; i++) {
    for (int j = i+1; j < N-1; j++) {
      for (int k = j+1; k < N; k++) {
        int a, b, c;
        a=L[i];
        b=L[j];
        c=L[k];
        if (a!=b && b!=c && c!=a && a+b>c && b+c>a && c+a>b) {
          ans++;
        }
      }
    }
  }

  cout << ans << endl;
}

Measured memory_bytes: 3632
import java.util.Scanner;

public class Main {
    public static void main(String args[]){
        Scanner stdIn = new Scanner(System.in);
        int n = stdIn.nextInt();
        int count = 0;
        
        for(int i = 1; i <= n; i++){
           int j = String.valueOf(i).length();
           if(j % 2 == 1){
               count++;
           }
        }
        System.out.println(count);
    }
}


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

using namespace std;

int a, b, k;
int chk;

int main(void)
{
	scanf("%d", &k);
	scanf("%d %d", &a, &b);
	
	for(int i = a ; i <= b ; i++)
	{
		if(i % k == 0)
			chk = 1;
	}
	
	if(chk == 1)
		printf("OK");
	else
		printf("NG");
	
	return 0;
}

Measured memory_bytes: 3824
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int a, b, c, k;
	cin >> a >> b >> c >> k;
	int d = max({ a,b,c });
	int e = d;
	for (int i = 0; i < k; i++) d = d * 2;
	cout << a + b + c + d - e;
}


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

int main()
{
	int a, b, k;
	cin >> a >> b >> k;
	for(auto i = a; i <= min(a + k - 1, b); ++i){
		cout << i << endl;
	}
	for(auto i = max(a + k, b - k + 1); i <= b; ++i){
		cout << i << endl;
	}
	return 0;
}

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

int main(){
    int int_a, add, i;
    char char_a[1000];

    while(1){
        scanf("%s", &char_a);
        if (strcmp(char_a, "0") == 0) break;
        i = 0;
        add = 0;
        while(1){
        	if (char_a[i] == '\0') break;
            int_a = char_a[i] - '0';
            add = add + int_a;
            i++;
        }
        printf("%d\n", add);
    }
    return 0;
}


Measured memory_bytes: 2752
#include <iostream>
#include <map>
#include <algorithm>
using namespace std;
int main(void){
    int n,a[200000],c=0;
    map<int,int> m;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a[i];
        m[a[i]]++;
    }
    sort(a,a+n,greater<int>());
    for(int i=0;i<n;i++){
        if(m[a[i]]>0){
            long long p=1;
            while(p<=a[i]){
                p*=2;
            }
            if(m.find(p-a[i])!=m.end()){
                if(m[p-a[i]]>0&&(p!=2*a[i]||m[p-a[i]]>1)){
                    c++;
                    m[a[i]]--;
                    m[p-a[i]]--;
                }
            }
        }
    }
    cout<<c<<endl;
}


Measured memory_bytes: 10368
#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll a[100005];
long long b[100005];
ll freq[26];
int main()
{
	ll n;
	cin>>n;
	for(ll i=0;i<n;i++)
	{
		cin>>a[i];
	}
	sort(a,a+n);
	cout<<a[n/2]-a[n/2 -1]<<endl;
}

Measured memory_bytes: 1024
// ------------------
// author: MatsuTaku
// date  : 22/02/2020
// ------------------

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

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

  int N; cin>>N;
  vector<int> ds(N+1);
  for (int i = 1; i <= N; i++) {
    for (int j = i; j <= N; j+=i)
      ds[j] += 1;
  }
  int ans = 0;
  for (int i = 1; i <= N; i+=2) {
    if (ds[i] == 8)
      ans++;
  }
  cout << ans << endl;

  return 0;
}


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

#define REP(i,n) for(ll i=0;i<ll(n);++i)
#define RREP(i,n) for(ll i=ll(n)-1;i>=0;--i)
#define FOR(i,m,n) for(ll i=m;i<ll(n);++i)
#define RFOR(i,m,n) for(ll i=ll(n)-1;i>=ll(m);--i)
#define ALL(v) (v).begin(),(v).end()
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());
#define DUMP(v) REP(aa, (v).size()) { cout << v[aa]; if (aa != v.size() - 1)cout << " "; else cout << endl; }
#define INF 1000000001ll
#define MOD 1000000007ll
#define EPS 1e-9

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


using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll max(ll a, int b) { return max(a, ll(b)); }
ll max(int a, ll b) { return max(ll(a), b); }
ll min(ll a, int b) { return min(a, ll(b)); }
ll min(int a, ll b) { return min(ll(a), b); }
///(´・ω・`)(´・ω・`)(´・ω・`)(´・ω・`)(´・ω・`)(´・ω・`)///


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n, k;
	cin >> n >> k;
	vi cnt(n, 0);
	vi v(n);
	REP(i, n)cin >> v[i];
	REP(i, n) {
		cnt[v[i] - 1]++;
	}
	sort(ALL(cnt));
	int ans = 0;
	int c = upper_bound(ALL(cnt), 0) - cnt.begin();
	FOR(i,c,n-k){
		ans += cnt[i];
	}
	cout << ans << endl;

}


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

using namespace std;

typedef long long ll ;

ll solve(ll a, ll b){
    return (a - 1) + (b - 1) ;
}

int main(){
    ll n ;
    cin >> n ;
    vector<ll> div ;
    for(ll i = 1; i * i <= n; i++){
        if ( n % i == 0 ){
            div.push_back(i) ;
            if ( n / i != i ) div.push_back(n / i) ;
        }
    }
    ll ans = 1e18 + 10 ;
    for(int i = 0; i < (int)div.size(); i++){
        ll a = div[i] ;
        ll b = n / div[i] ;
        if ( a > b ) swap(a,b) ;
        ans = min(ans, solve(a, b));
    }
    cout << ans << endl;
    return 0 ;
}


Measured memory_bytes: 384
def bubble(a):
	ct=0
	for i in range(len(a)-1):
		for j in range(len(a)-1,i,-1):
			if a[j]<a[j-1]:
				t=a[j]
				a[j]=a[j-1]
				a[j-1]=t
				ct+=1
	return a,ct
n=int(input())
table=list(map(int,input().split()))
b,c=bubble(table)
print(*b)
print(c)


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

int main()
{
    int N,i,AC=0,WA=0,TLE=0,RE=0;
	char str[3];
    cin>>N;
    for(i=0;i<N;i++)
    {
        cin>>str;
        if(!strcmp(str, "AC"))
        {
            AC++;
        }
        if(!strcmp(str,"WA"))
        {
            WA++;
        }
         if(!strcmp(str, "TLE"))
        {
            TLE++;
        }
         if(!strcmp(str, "RE"))
        {
            RE++;
        }
        
    }
    
cout<<"AC x "<< AC<<endl;
cout<<"WA x "<< WA<<endl;
cout<<"TLE x "<< TLE<<endl;
cout<<"RE x "<< RE<<endl;
 
return 0;
}


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

int main(){
	int n;
	cin>>n;
	int flag=0;
	while(n>0){
		int r = n%10;
		n=n/10;
		if(r==7){
			cout<<"Yes\n";
			flag=1;
			break;
		}
	}
	if(flag==0){
		cout<<"No\n";
	}
	return 0;
}

Measured memory_bytes: 3636
#include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<queue>
#include<map>
#include<set>
#include<complex>

using namespace std;

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

#define X real()
#define Y imag()

typedef complex<double> P;
class C:public P{
	public:
	double r;
	C(double x,double y,double r):P(x,y),r(r){}
};

template<class T> T sq(T x){return x*x;}
double dot(P a, P b){return a.X*b.X + a.Y*b.Y;}

P solve_eq2(double a,double b,double c,double d,double e,double f){
	double A = a*e-b*d;
	return P((c*e-b*f)/A, (a*f-c*d)/A);
}

C C_PPP(P a,P b,P c){
	P d = b-a;
	P e = c-a;
	
	double z1 = -dot(a,a);
	double z2 = -dot(b,b);
	double z3 = -dot(c,c);
	
	P f = solve_eq2(d.X, d.Y, z2-z1, e.X, e.Y, z3-z1);
	double u = z1-dot(a,f);
	
	return C(-f.X/2, -f.Y/2, sqrt(dot(f,f)/4-u));
}

int main(){
	
	int n;
	cin>>n;
	
	rep(i,n){
		double xa,ya,xb,yb,xc,yc;
		cin>>xa>>ya>>xb>>yb>>xc>>yc;
		
		C circle = C_PPP(P(xa,ya),P(xb,yb),P(xc,yc));
		
		printf("%.3lf %.3lf %.3lf\n",circle.X,circle.Y,circle.r);
	}
}

Measured memory_bytes: 1236
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
const ll INF = LLONG_MAX;
const ll MAX = 50000;
vector<ll> fac(MAX), finv(MAX), inv(MAX);

// テーブルを作る前処理
void COMinit()
{
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++)
    {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k)
{
    if (n < k)
        return 0;
    if (n < 0 || k < 0)
        return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}



int main()
{
    ll n, k;
    cin >> n >> k;
    COMinit();
    for (int i = 1; i < k + 1; i++)
    {
        cout << (COM(n - k + 1, i)) * COM(k - 1, i - 1) % MOD << "\n";
    }
}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define endl '\n'
#define Endl '\n'
#define fi first
#define ii pair<int,int>
#define iil pair<ll,ll>
#define se second
#define ld long double
#define mod 1000000007
#define popcount __builtin_popcountll
#define x0 zxcxzcsacasd
#define x1 ghfghujfgfg
#define y0 olkjhdnncvcv
#define y1 bhvgrewm345345435
#define debug(x) std::cerr<<#x<<": "<<(x)<<'\n'
#define all(x) x.begin(), x.end()
using namespace std;
void test_case(){
	string s;
	cin>>s;
	int n = s.length();
	if(s[n-1]!='s')cout<<s<<"s"<<endl;
	else cout<<s<<"es"<<endl;
}
int main(){
	int t = 1;
	// scanf("%d", &t);
	while(t--)test_case();
}


Measured memory_bytes: 3624
/*
    Author - Param Kothari
    Ah shit, here we go again
*/
 
/* Ordered Set Implementaton:

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 

using namespace __gnu_pbds;

typedef tree<
    int,
    null_type,
    less<int>,
    rb_tree_tag,
    tree_order_statistics_node_update>
ordered_set;
*/

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

#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pb push_back
#define mk make_pair 
 
typedef long long ll;
typedef long double ld;

void solve(){
    ll n, k;
    cin >> k >> n;
    vector<ll> a(n + 1), diff(n + 1);
    for(int i = 0; i < n; i++){
        cin >> a[i];
    }
    for(int i = 0; i < n - 1; i++){
        diff[i] = a[i + 1] - a[i];
    }
    diff[n - 1] = k - a[n - 1] + a[0];
    ll res = 0;
    for(int i = 0; i < n; i++){
        res += diff[i];
    }
    cout << res - *max_element(diff.begin(), diff.end()) << "\n";
    return;
}
 
int main(){
    IOS;
    int t = 1;
    //cin >> t;
    while(t--){
        solve();
    }
    return 0;
}


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


void input(vector<vector<string>> &mas, int H){
  vector<string> str(H);
  for(int i=0;i<H;i++){
    cin >> str.at(i);
  }
  for(int i=0;i<mas.size();i++){
    for(int j=0;j<mas.at(0).size();j++){
      mas.at(i).at(j) = str.at(i).at(j);
    }
  }
}
void rawpress(vector<vector<string>> &mas, int &H, int &W){
  for(int i=0;i<H;i++){
    int count = 0;
    for(int j=0;j<W;j++){
      if(mas.at(i).at(j) == "."){
        count++;
      }
    }
    if(count==W){
      H--;
      for(int m=i;m<H;m++){
        for(int n=0;n<W;n++){
          mas.at(m).at(n) = mas.at(m+1).at(n);
        }
      }
      i--;
    }
  }
}
void colpress(vector<vector<string>> &mas, int &H, int &W){
  for(int i=0;i<W;i++){
    int count = 0;
    for(int j=0;j<H;j++){
      if(mas.at(j).at(i) == "."){
        count++;
      }
    }
    if(count==H){
      W--;
      for(int m=i;m<W;m++){
        for(int n=0;n<H;n++){
          mas.at(n).at(m) = mas.at(n).at(m+1);
        }
      }
      i--;
    }
  }
}
int main(){
  int H,W;
  cin >> H >> W;
  vector<vector<string>> mas(H,vector<string>(W));
  input(mas,H);
  rawpress(mas,H,W);
  colpress(mas,H,W);
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      cout << mas.at(i).at(j);
      if(j==W-1){
        cout << endl;
      }
    }
  }
  
}

Measured memory_bytes: 768
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Console;
using static System.Math;

namespace atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(In));
        }

        public long Min(params long[] a)
        {
            var min = a[0];
            for (int i = 1; i < a.Length; i++)
            {
                if (min > a[i]) min = a[i];
            }
            return min;
        }

        public long Max(params long[] a)
        {
            var max = a[0];
            for (int i = 1; i < a.Length; i++)
            {
                if (max < a[i]) max = a[i];
            }
            return max;
        }

        public void Solve(ConsoleInput input)
        {
            var n = input.ReadIntArray(4);
            var a = new List<int> { 1, 9, 7, 4 };
            foreach (var nn in n)
            {
                if (!a.Remove(nn)) break;
            }
            if (a.Count == 0)
            {
                WriteLine("YES");
            }
            else
            {
                WriteLine("NO");
            }

            //Solve(input);
        }

        private long Xxor(long x, long[] a)
        {
            long fx = 0;
            foreach (var ai in a)
            {
                fx += x ^ ai;
            }
            return fx;
        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private readonly char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            _separator = separator;
            _stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); } }
        public int ReadInt { get { return int.Parse(Read); } }
        public long ReadLong { get { return long.Parse(Read); } }
        public double ReadDouble { get { return double.Parse(Read); } }
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
    }
}


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

#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;

int main() {
    string s; cin >> s;
    int n = s.size();
    int l = -1, r = -1;
    for(int i = 0; i < n; i++){
        if(l >= 0 && r >= 0) break;
        if(l < 0 && s[i] == 'A') l = i;
        if(r < 0 && s[n - 1 - i] == 'Z') r = n - 1 - i;
    }
    r = r - l + 1;
    cout << s.substr(l, r).size() << endl;
}


Measured memory_bytes: 772
#define ll long long
#define INF 99999999
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,m,x;
    int res = 0;
    cin >> n >> m >> x;
    vector<int> a(m);
    rep(i,m){
        cin >> a[i];
        if(a[i] > x){
            res = i;
            break;
        }
    }
    cout << min(res, m-res) << endl;
 
    return 0;
}

Measured memory_bytes: 256
#include <cstdint>
#include <functional>
#include <iostream>
#include <set>
#include <vector>

struct Value
{
    int c;
    std::vector<int> a;
};

namespace combination
{
template <typename T>
void recursiveCombination(
    const std::vector<T>& the_original,
    std::vector<T>& result,
    uint64_t s,
    uint64_t rest,
    std::function<void(const std::vector<T>&)>& the_func)
{
    if (rest == 0)
    {
        the_func(result);
        return;
    }

    if (s < 0)
    {
        return;
    }

    if (0 < s)
    {
        recursiveCombination(the_original, result, s - 1, rest, the_func);
    }

    result[rest - 1] = the_original[s];

    if ((0 < s) || (rest == 1))
    {
        recursiveCombination(the_original, result, s - 1, rest - 1, the_func);
    }
}

/// 組み合わせを列挙する
template <typename T>
void forEach(
    const std::vector<T>& the_original,
    uint64_t the_selection,
    std::function<void(const std::vector<T>&)> the_func)
{
    std::vector<T> result(the_selection);

    recursiveCombination(
        the_original,
        result,
        the_original.size() - 1,
        the_selection,
        the_func);
}
}  // namespace combination

int X;
std::set<int> g_result;

void func(const std::vector<Value>& the_selection)
{
    for (size_t m = 0, M = the_selection[0].a.size();
         m < M;
         ++m)
    {
        int sum_a = 0;
        for (size_t n = 0, N = the_selection.size();
             n < N;
             ++n)
        {
            sum_a += the_selection[n].a[m];
        }

        if (sum_a < X)
        {
            // 未達成
            return;
        }
    }
    int sum_c = 0;

    for (size_t n = 0, N = the_selection.size();
         n < N;
         ++n)
    {
        sum_c += the_selection[n].c;
    }

    g_result.insert(sum_c);
}

int main()
{
    size_t N, M;
    std::cin >> N >> M >> X;

    std::vector<Value> v(N);
    for (size_t n = 0; n < N; ++n)
    {
        v[n].a.resize(M);

        std::cin >> v[n].c;

        for (size_t m = 0; m < M; ++m)
        {
            std::cin >> v[n].a[m];
        }
    }

    for (size_t n_sel = 1; n_sel <= N; ++n_sel)
    {
        combination::forEach<Value>(v, n_sel, func);
    }

    if (g_result.empty())
    {
        std::cout << -1 << std::endl;
    }
    else
    {
        std::cout << *g_result.begin() << std::endl;
    }
}


Measured memory_bytes: 3732
#include <iostream>
using namespace std;
int main(){
    int n,a,b,c,d,ab,cd;
    cin>>n>>a>>b>>c>>d;
    ab=n/a*b;
    cd=n/c*d;
    if(n%a!=0){
        ab=ab+b;
    }
    if(n%c!=0){
        cd=cd+d;
    }
    if(ab>cd){
        cout<<cd<<endl;
    }
    else{
        cout<<ab<<endl;
    }
}



Measured memory_bytes: 3064
#include<iostream>
#include<string>
#include<set>
#include<utility>
#include<vector>
#include<map>
#include<algorithm>
#include<queue>
#include<stack>
#include<iomanip>

#define P pair<int, int>

typedef long long ll;

using namespace std;


int N, M;
int cards[205];
int main() {
	cin >> N >> M;
	for (int i = 1; i <= 2 * N; i++) cards[i] = i;


	for (int i = 0; i < M; i++) {
		int k;
		cin >> k;
		int tmp[205];
		for (int j = 1; j <= 2 * N; j++) tmp[j] = cards[j];
		if (k == 0) {
			for (int j = 1; j <= N; j++) {
				cards[2 * j - 1] = tmp[j];
				cards[2 * j] = tmp[N + j];
			}
		}
		else {
			for (int j = 1; j <= 2*N-k; j++) {
				cards[j] = tmp[k + j];
			}
			for (int j = 1; j <= k; j++) {
				cards[2 * N - k + j] = tmp[j];
			}
		}
	}

	for (int i = 1; i <= 2 * N; i++)
		cout << cards[i] << endl;

	return 0;
}



Measured memory_bytes: 3084
import java.util.*;
//import java.util.stream.Collectors;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		String a = sc.next();
		String b = sc.next();
		String resultA = "";
		String resultB = "";
		for(int i=0; i<Integer.parseInt(b); i++){
			resultA += a;
		}
		for(int i=0; i<Integer.parseInt(a); i++){
			resultB += b;
		}
		System.out.println(resultA.compareTo(resultB) < 0 ? resultA : resultB);
	}
}


Measured memory_bytes: 39252
//DUEL
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define x first
#define y second
#define pii pair<int,int>
#define pb push_back
#define eb emplace_back
#pragma GCC optimize("unroll-loops")
#define shandom_ruffle(a, b) shuffle(a, b, rng)
#define vi vector<int>
#define vl vector<ll>
#define popcnt __builtin_popcount
#define popcntll __builtin_popcountll

using namespace std;
using namespace __gnu_pbds;

using ll=long long;
using ull=unsigned long long;
using ld=long double;
int MOD=1000000007;
int MOD2=998244353;
vector<int> bases;
const ll LLINF=1ll<<60;
const char en='\n';

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void yes() {cout<<"YES"<<en; exit(0);}
void no() {cout<<"NO"<<en; exit(0);}
inline int rund() {int x576363482791fuweh=rng();return abs(x576363482791fuweh)%RAND_MAX;}
template<class T>
void prVec(vector<T> w,bool fl=false)
{
	cout<<w.size()<<en;
	for (int i=0;i<int(w.size())-1;++i) cout<<w[i]<<' ';
	if (w.size()) cout<<w[w.size()-1]<<en;
	if (fl) cout<<flush;
}

void M998()
{
	swap(MOD,MOD2);
}

ll raand()
{
	ll a=rund();
	a*=RAND_MAX;
	a+=rund();
    return a;
}

#define rand raand

ll raaand()
{
	return raand()*(MOD-7)+raand();
}

string to_upper(string a)
{
	for (int i=0;i<(int)a.size();++i) if (a[i]>='a' && a[i]<='z') a[i]-='a'-'A';
	return a;
}

string to_lower(string a)
{
	for (int i=0;i<(int)a.size();++i) if (a[i]>='A' && a[i]<='Z') a[i]+='a'-'A';
	return a;
}

ll sti(string a,int base=10)
{
	ll k=0;
	for (int i=0;i<(int)a.size();++i)
	{
		k*=base;
		k+=a[i]-'0';
	}
	return k;
}

template<class T>
void eras(vector<T>& a,T b)
{
	a.erase(find(a.begin(),a.end(),b));
}

string its(ll k,int base=10)
{
	if (k==0) return "0";
	string a;
	while (k)
	{
		a.push_back((k%base)+'0');
		k/=base;
	}
	reverse(a.begin(),a.end());
	return a;
}

ll min(ll a,int b)
{
	if (a<b) return a;
	return b;
}

ll min(int a,ll b)
{
	if (a<b) return a;
	return b;
}

ll max(ll a,int b)
{
	if (a>b) return a;
	return b;
}

ll max(int a,ll b)
{
	if (a>b) return a;
	return b;
}

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

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

template<class T,class K>
pair<T,K> mp(T a,K b)
{
	return make_pair(a,b);
}

inline int mult(ll a,ll b)
{
	return (a*b)%MOD;
}

inline int pot(int n,int k)
{
	if (k==0) return 1;
	ll a=pot(n,k/2);
	a=mult(a,a);
	if (k%2) return mult(a,n);
	else return a;
}

int divide(int a,int b)
{
	return mult(a,pot(b,MOD-2));
}

inline int sub(int a,int b)
{
	if (a-b>=0) return a-b;
	return a-b+MOD;
}

inline int add(int a,int b)
{
	if (a+b>=MOD) return a+b-MOD;
	return a+b;
}

bool prime(ll a)
{
	if (a==1) return 0;
	for (int i=2;i<=round(sqrt(a));++i)
	{
		if (a%i==0) return 0;
	}
	return 1;
}

const int N=300010;
int n;
set<int> a;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	for (int i=0;i<10;++i) bases.push_back(rand()%(MOD-13893829*2)+13893829);
	cin>>n;
	for (int i=0;i<n;++i)
	{
		int x;
		cin>>x;
		a.insert(x);
	}
	if (a.size()!=n) cout<<"NO";
	else cout<<"YES";
}





Measured memory_bytes: 9600
/*
ID: rchalam1
LANG: C++14
TASK:
*/
// For train.usaco.org, fill the template above.

// Competitive Coding Template

// GCC OPTIMIAZTION FLAGS
#ifdef ONLINE_JUDGE
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#endif

#include <bits/stdc++.h>

/*
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
*/
// All Includes for Competitive Coding Template

using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;

using vi = std::vector<int>;
using vll = std::vector<long long>;
using vull = std::vector<unsigned long long>;

#define FOR(i, a, b) for (auto i = (a); i < (b); ++i)
#define F0R(i, a) FOR(i, 0, a)
#define ROF(i, a, b) for (auto i = (a); i >= (b); --i)
#define R0F(i, a) ROF(i, a, 0)
#define ITR(a, x) for (auto& a: x)

#define FSRT(set) sort((set).begin(),(set).end())
#define RSRT(set) sort((set).rbegin(),(set).rend())
#define CSRT(set, function) sort((set).begin(),(set).end(), (function))
#define TRS(set) sort((set).begin(),(set).end(), greater<>())
#define REV(set) reverse((set).begin(),(set).end());

#define ALL(set) (set).begin(), (set).end()

#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define ff first
#define ss second

// For stdio, call setIO() or setIO("").
void setIO(std::ifstream &readFile, std::ofstream &writeFile, const std::string &name = "", bool stdIO = false)
{
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(nullptr);
	std::cout.tie(nullptr);
	if(!name.empty() && !stdIO)
	{
		readFile.open(name + ".in");
		if(readFile.fail()) return;
		writeFile.open(name + ".out");
		std::cin.rdbuf(readFile.rdbuf());
		std::cout.rdbuf(writeFile.rdbuf());
	}
}

// To time program, create object Timer  to start timing, and call Timer.elapsed().
#include <chrono>

class Timer
{
	std::chrono::time_point<std::chrono::high_resolution_clock> m_beg;
public:
	Timer() : m_beg(std::chrono::high_resolution_clock::now())
	{}

	void reset()
	{ m_beg = std::chrono::high_resolution_clock::now(); }

	[[nodiscard]] long double elapsed() const
	{
		return std::chrono::duration_cast<std::chrono::duration<long double, std::ratio<1> >>(
				std::chrono::high_resolution_clock::now() - m_beg).count();
	}
};

// Defines datatype
using dt = int;
// Defines MAXN value
constexpr dt MAXN = 1e5 + 1;
// Defines Modulus
constexpr dt MOD = 1e9 + 7;
// Defines Floating Point Correction
constexpr long double EPS = 1e-9;

//*****
//START CODE BELOW
//*****

int main(int argc, char *argv[])
{
	static std::ifstream readFile;
	static std::ofstream writeFile;
	setIO(readFile, writeFile);
	int a, b, m;
	cin >> a >> b >> m;
	vector<int> as(a), bs(b);
	for(auto &a : as) cin >> a;
	for(auto &b : bs) cin >> b;
	int answer = *min_element(as.begin(), as.end()) + *min_element(bs.begin(), bs.end());
	while(m--)
	{
		int x, y, c;
		cin >> x >> y >> c;
		answer = min(answer, as[x - 1] + bs[y - 1] - c);
	}
	cout << answer << '\n';
}

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

using namespace std;

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

  int M, D; cin>>M>>D;
  int ans = 0;
  for (int m = 1; m <= M; m++) {
    for (int t = 2; t <= 9; t++) {
      if (m % t)
        continue;
      auto o = m/t;
      if (o < 2 or o > 9)
        continue;
      auto d = t*10+o;
      if (d <= D) {
        ans++;
      }
    }
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>

using namespace std;

#define sz(a) static_cast<int>((a).size())
#define f first
#define s second
#define els(v) for (auto &el : (v))


#ifdef KIRYA
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define dbg(...)
#endif

template<typename T>
void _dbg(const char* _s, T _h) {
    cerr << _s << " = " << _h << "\n";
}

template<typename T, typename... Ts>
void _dbg(const char*_s, T _h, Ts... _t) {
    int _b = 0;
    
    while (((_b += *_s == '(') -= *_s == ')') != 0 || *_s != ',')
        cerr << *_s++;
    
    cerr << " = " << _h << ",";
    _dbg(_s + 1, _t...);
}

const int64_t INF = static_cast<int64_t>(1e9) + 7;
const int64_t LINF = INF * INF;
const int MAXN = static_cast<int>(1e6) + 17;

void solve() {
    int val;
    cin >> val;
    cout << val * val << '\n';
}

int main() {
    cin.tie(nullptr);
    cout.tie(nullptr);
    ios_base::sync_with_stdio(false);
    
    int q = 1;

    for (int i = 0; i < q; ++i) {
        solve();
    }
}

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

int main() {
  int K, N, range=0;
  cin >> K >> N;
  int a[N];
  for(int i=0; i<N; i++) {
    cin >> a[i];
  }
  for(int i=1; i<N; i++) {
    if(range<=a[i]-a[i-1]) {
      range=a[i]-a[i-1];
    }
  }
  if(range<=K-a[N-1]+a[0]) {
    range=K-a[N-1]+a[0];
  }
  cout << K-range << endl;
}

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

int main(){
  int n;
  cin >> n;
  int temp = 0;
  int check = n;
  for(int i = 0; i < 8; i++){
    temp += n%10;
    n = n - n%10;
    n = n/10;
  }
  string ans;
  ans = (check%temp == 0 )? "Yes": "No";
  cout << ans << endl;
}


Measured memory_bytes: 256
H,W=map(int,input().split())
if H==1 or W==1:
  print(1)
  exit()
if H%2==1 and W%2==1:
  ans=((W//2+1)+(W//2))*(H//2)+W//2+1
else:
  ans=H*W//2
print(ans)

Measured memory_bytes: 2940