akhauriyash/Code-Regression huggingface dataset:
import Data.Time

getDay :: Int -> Int -> String
getDay m d
    | delta == 0 = "Thursday"
    | delta == 1 = "Friday"
    | delta == 2 = "Saturday"
    | delta == 3 = "Sunday"
    | delta == 4 = "Monday"
    | delta == 5 = "Tuesday"
    | otherwise  = "Wednesday"
    where delta = (fromGregorian 2004 m d `diffDays` fromGregorian 2004 1 1) `mod` 7

main :: IO ()
main = interact $ unlines . map (\[m, d] -> getDay m d) . map (map read) . map words . takeWhile (/= "0 0") . lines

Measured memory_bytes: 4056
#include <iostream>
#include <string>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
using namespace std;

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

int main(){
    int N;
    cin >> N;
    vector<int> a(N);
    rep(i, N) cin >> a[i];
    sort(a.begin(), a.end());
    int min = a[0];
    int max = a[N-1];
    int mn_cost = 100000000;
    for(int i = min; i <= max; i++){
        int cost = 0;
        rep(j, N){
            cost += pow(a[j] - i, 2);
        }
        if(mn_cost > cost) mn_cost = cost;
    }
    cout << mn_cost << endl;
    return 0;
}

Measured memory_bytes: 3596
#include <bits/stdc++.h>
#define psi pair<string, int>
#define fi first
#define se second
using namespace std;

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

    map<string, int> cnt;

    for(int i = 1; i <= n; i++) {
        string s;
        cin >> s;

        cnt[s]++;
    }

    for(string x: vector<string>({"AC", "WA", "TLE", "RE"})) {
        cout << x << " x " << cnt[x] << endl;
    }
}


Measured memory_bytes: 3644
#include<iostream>
#include<map>
#include<algorithm>
using namespace std;
int M[1000001];

main(){
  int x,y;
  while(cin >> x >> y && y){
    int start = (x%y);
    fill(M,M+y,-1);
    
    int cnt = 0;
    M[start] =cnt;
    start*=10;
    while(true){
      if ( start%y == 0){
	cout << cnt+1 <<  " " << 0 << endl;
	break;
      }

      start%=y;
      if ( M[start]!=-1 ){
	int bef = M[start];
	//cout << bef << endl;
	cout << M[start] << " " << cnt+1 - M[start] << endl;
	break;
      }
      cnt++;
      M[start] = cnt;
      start*=10;
    }
    
  }
  return false;
}

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

int main(){
  int N,n;
  string S;
  n=0;
  cin >>N >>S;
  for(int i=0;i<(N-1);i++){
    if(S.at(i) != S.at(i+1)){
      n++;
    }
  }
  cout << n+1;
}


Measured memory_bytes: 512
import glob
import os

bn = os.path.basename(__file__).split('.')[0]
dn = os.path.dirname(__file__).split('/')

# 問題ごとのディレクトリのトップからの相対パス
REL_PATH = dn[len(dn)-2] + '\\' + dn[len(dn)-1] + '\\' + bn

# テスト用ファイル置き場のトップ
TOP_PATH = 'C:\\AtCoder'

class Common:

    problem = []
    index = 0

    def __init__(self, rel_path):
        self.rel_path = rel_path

    def initialize(self, path):
        file = open(path)
        self.problem = file.readlines()
        self.index = 0
        return

    def input_data(self):
        try:
            IS_TEST
            self.index += 1
            return self.problem[self.index-1]

        except NameError:
            return input()

    def resolve(self):
        pass

    def exec_resolve(self):
        try:
            IS_TEST
            for path in glob.glob(TOP_PATH + '\\' + self.rel_path + '/*.txt'):
                print("Test: " + path)
                self.initialize(path)
                self.resolve()
                print("\n\n")
        except NameError:
            self.resolve()


class Solver(Common):

    def resolve(self):

        X, N = map(int, self.input_data().split())
        if N == 0:
            p = []
        else:
            p = list(map(int, self.input_data().split()))

        result = [0,200]
        for i in range(0, 200):
            if i in p:
                continue
            if abs(X-i) < result[1]:
                result[0] = i
                result[1] = abs(X-i)
            elif abs(X-i) == result[1] and i < result[0]:
                result[0] = i

        print(str(result[0]))

solver = Solver(REL_PATH)
solver.exec_resolve()


Measured memory_bytes: 10000
#include <iostream>
#include <fstream>
#include <cmath>
#include <algorithm>
#include <stack>
#include <vector>
#include <random>
#include <set>
#include <map>
#include <queue>
#include <bitset>
using namespace std;
typedef long long ll;
#define FOR(I,A,B) for(ll I = ll(A); I < ll(B); ++I)



int main(){
	int n,k;
	cin >> n >> k;
	cout << n*k << endl;
}



Measured memory_bytes: 3088
#include<bits/stdc++.h>
using namespace std;
#define lint long long
#define ll long long
#define pq priority_queue
#define mp make_pair
#define vl vector<long long>
long long INF = 1e10;
#define pii pair<long long,long long>
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
/******************************define**********************************/

/*****************************functions********************************/

/****************************main function*****************************/
int main(void){
    int n; cin >> n;
    vector<int> s(3*n);
    for(int i = 0;i < 3*n;i++) cin >> s[i];
    sort(all(s));reverse(all(s));
    ll ans = 0;
    for(int i = 1;i <= 2*n - 1;i += 2) ans += s[i];
    cout << ans << endl;
    return 0;
}

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

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

	int n, m;
	cin >> n >> m;

	vector<int> cards;
	for(int i = 1; i <= n + n; ++i)
		cards.push_back(i);

	for(int i = 0; i < m; ++i) {
		int k;
		cin >> k;

		vector<int> tmp;
		if(k) {
			for(int j = k; j < n + n; ++j)
				tmp.push_back(cards[j]);

			for(int j = 0; j < n + n; ++j)
				tmp.push_back(cards[j]);
		}
		else {
			for(int i = 0; i < n; ++i) {
				tmp.push_back(cards[i]);
				tmp.push_back(cards[n + i]);
			}
		}
		cards.swap(tmp);
	}

	for(int i = 0; i < n + n; ++i)
		cout << cards[i] << endl;

	return EXIT_SUCCESS;
}

Measured memory_bytes: 1224
n,k=map(int,input().split())
d={}
for i in range(1,n+1):
	d[i]=0
while k:
	k-=1
	x=int(input())
	l=list(map(int,input().split()))
	for i in l:
		d[i]+=1
	
c=0
for i in d:
	if d[i]==0:
		c+=1
print(c)

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

namespace ABC084D_2
{
    class Program
    {
        static void Main(string[] args)
        {
            var Q = int.Parse(Console.ReadLine());

            var primes = PrimeNumbers(100000);

            //i以下で条件を満たす個数
            int[] ans = new int[100000];
            for (int i = 1; i < 100000; i++)
            {
                if (i % 2 == 0)
                {
                    ans[i] = ans[i - 1];
                    continue;
                }

                //条件を満たすか判定
                int c1 = Array.BinarySearch(primes, i);
                int c2 = Array.BinarySearch(primes, (i + 1) / 2);

                //
                if (c1 >= 0 && c2 >= 0)
                    ans[i] = ans[i - 1] + 1;
                else ans[i] = ans[i - 1];
            }

            List<int> anss = new List<int>();
            for (int i = 0; i < Q; i++)
            {
                var lr = ReadInt();
                anss.Add(ans[lr[1]] - ans[lr[0] - 1]);
            }

            foreach (var a in anss)
            {
                Console.WriteLine(a);
            }
            Console.ReadKey();
        }

        static int[] ReadInt()
        {
            int[] ret = Console.ReadLine().Split().Select(int.Parse).ToArray();
            return ret;
        }
        static long[] ReadLong()
        {
            long[] ret = Console.ReadLine().Split().Select(long.Parse).ToArray();
            return ret;
        }

        /// <summary>
        /// 自然数n以下の素数列挙 (NloglogN)
        /// </summary>
        /// <param name="n"></param>
        /// <returns></returns>
        public static int[] PrimeNumbers(int n)
        {
            int max = n;
            var searchList = Enumerable.Range(2, max).ToList();

            var pList = new List<int>();
            while (searchList.Count > 0)
            {
                int cand = searchList.First();

                pList.Add(cand);

                searchList.RemoveAll(x => x % cand == 0);
            }

            return pList.ToArray();
        }
    }
}


Measured memory_bytes: 20408
N = int(input())
H = list(map(int,input().split()))
ans = 0
for i in range(N):
    h = H[i]
    flag = True
    for j in range(i+1):
        if h < H[j]:
            flag = False
            break
    if flag == True:
        ans += 1
print(ans)



Measured memory_bytes: 3064
#include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
typedef long long int ll;

#define MOD 1e9+7


int gcd(int x,int y){

    if(y == 0){
        return x;
    }else{
        return gcd(y,x % y);
    }
}

int lcm(int x,int y){
    int tmp = gcd(x,y);
    return x*y/tmp;
}


int main(){

    int n;
    cin >> n;
    vector<int> arr(n);
    REP(i,n){
        cin >> arr[i];
    }

    int ans = 1;


    REP(i,n){
        ans = lcm(ans,arr[i]);
    }
    cout << ans << endl;




    return 0;
}


Measured memory_bytes: 3132
a, b ,k = map(int,input().split())
turn = True
for i in range(k):
    if turn :
        if a % 2 == 1:
            b = b + (a - 1) / 2
            a = (a - 1) / 2
        else :
            b = b + a /2
            a = a / 2
    else :
        if b % 2 == 1:
            a = a + (b - 1) / 2
            b = (b - 1) / 2
        else :
            a = a + b /2
            b = b / 2
    turn = not turn
print(str(int(a)) +" " + str(int(b)))

Measured memory_bytes: 3064
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
using ll = long long;

int main()
{
  int n;
  cin >> n;
  vector<string> s(n);

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

  sort(s.begin(), s.end());
  s.erase(unique(s.begin(),s.end()),s.end());
  cout << s.size() << endl;

  return 0;
}

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

using namespace std;

namespace {

    typedef double real;
    typedef long long ll;

    template<class T> ostream& operator<<(ostream& os, const vector<T>& vs) {
        for (int i = 0; i < vs.size(); i++) {
            os << vs[i] << endl;
        }
        return os;
    }
    template<class T> istream& operator>>(istream& is, vector<T>& vs) {
        for (auto it = vs.begin(); it != vs.end(); it++) is >> *it;
        return is;
    }

    bool comp(int a, int b) {
        if (a == b) return true;
        if (a > b) return not comp(b, a);
        if (a == 1) return false;
        if (a == 2) {
            if (b == 3) return false;
            else return true;
        }
        return true;
    }

    int N;
    vector<int> A;
    void input() {
        cin >> N;
        A.clear(); A.resize(N); cin >> A;
    }

    const int INF = 1<<30;

    int step(vector<int>& ans, vector<int>& stack, int prev) {
        int x = stack.back(); stack.pop_back();
        if (comp(x, prev)) {
            vector<int> a;
            a.push_back(x);
            a.insert(a.end(), ans.begin(), ans.end());
            ans = a;
            return INF;
        } else {
            ans.push_back(x);
            if (prev == INF || x >= 30) return INF;
            real p = pow(real(prev), x);
            return (p >= INF ? INF : int(p));
        }
    }

    void solve() {
        vector<int> nA;
        int zcount = 0;
        int ocount = 0;
        for (int i = 0; i < N; i++) {
            if (A[i] == 0) zcount++;
            else if (A[i] == 1) ocount++;
            else nA.push_back(A[i]);
        }
        sort(nA.begin(), nA.end());
        vector<int> ans;
        if (zcount % 2 == 0) {
            if (not nA.empty()) {
                int p = nA.back(); nA.pop_back();
                ans.push_back(p);
                while (not nA.empty()) {
                    p = step(ans, nA, p);
                }
            }
            for (int i = 0; i < zcount; i++) ans.push_back(0);
            for (int i = 0; i < ocount; i++) ans.push_back(1);
        } else {
            int s = -1;
            if (ocount >= 1) {
                s = 1;
                ocount--;
            } else if (not nA.empty()) {
                s = nA[0];
                nA.erase(nA.begin(), nA.begin() + 1);
            }
            if (not nA.empty()) {
                int p = nA.back(); nA.pop_back();
                ans.push_back(p);
                while (not nA.empty()) {
                    p = step(ans, nA, p);
                }
            }
            for (int i = 0; i < zcount - 1; i++) ans.push_back(0);
            if (s >= 0) ans.push_back(s);
            ans.push_back(0);
            for (int i = 0; i < ocount; i++) ans.push_back(1);
        }
        cout << ans;
    }
}

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

Measured memory_bytes: 3276
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int W = sc.nextInt();
        int H = sc.nextInt();
        int x = sc.nextInt();
        int y = sc.nextInt();
        int r = sc.nextInt();
        String ans = "";
        if(x>=r && (W-x)>=r && y>=r && (H-y)>=r){
            ans = "Yes";
        } else {
            ans = "No";
        }
        System.out.println(ans);
        sc.close();
    }
}


Measured memory_bytes: 26256
#include <bits/stdc++.h>
#define LL long long
#define FOR(i,c) for(__typeof(c.begin()) i = c.begin(); i != c.end(); i++)
#define F first
#define S second
using namespace std;

const LL mod = 1e9 + 7;

template<typename T> T gcd(T a, T b) { return b == 0?a: gcd(b, a % b); }
template<typename T> T LCM(T a, T b) { return a*(b/gcd(a, b)); }
template<typename T, typename S> T expo(T b, S e, const T &m){if(e <= 1)return e == 0?1: b;\
	return (e&1) == 0?expo((b*b)%m, e>>1, m): (b*expo((b*b)%m, e>>1, m))%m;}
template<typename T, typename S> T expo(T b, S e){if(e <= 1)return e == 0?1: b;\
	return (e&1) == 0?expo((b*b), e>>1): (b*expo((b*b), e>>1));}
template<typename T, typename S> T modinv(T a, S mod) { return expo(a, mod-2, mod); }
template<class T, class S> std::ostream& operator<<(std::ostream &os, const std::pair<T, S> &t) {
	os<<"("<<t.first<<", "<<t.second<<")";
	return os;
}
template<class T> std::ostream& operator<<(std::ostream &os, const std::vector<T> &t) {
	os<<"["; FOR(it,t) { if(it != t.begin()) os<<", "; os<<*it; } os<<"]";
	return os;
}
int main() {
  ios_base::sync_with_stdio(false);
  LL x, res = 0;
  cin >> x;
  res = (x / 11) * 2;
  x %= 11;
  if(x > 0 and x <= 6) res++;
  else if(x > 0) res += 2;
  cout << res << '\n';
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
  #include <complex>
  #include <vector>
  #include <string>
  #include <algorithm>
  #include <cstdio>
  #include <numeric>
  #include <cstring>
  #include <ctime>
  #include <cstdlib>
  #include <set>
  #include <map>
  #include <unordered_map>
  #include <unordered_set>
  #include <list>
  #include <cmath>
  #include <bitset>
  #include <cassert>
  #include <queue>
  #include <stack>
  #include <deque>
 #include <iomanip>
#include <fstream>
#include <climits>
 
  using namespace std;
   
 
//abcdefghijklmnopqrstuvwxyz
//ABCDEFGHIJKLMNOPQRSTUVWXYZ

  typedef long long ll;
  typedef long double lld;
  typedef unsigned long long ull;
  lld INF = 1e18;
  ll mod = 1e9+7;
  // lld PI = 3.141592653;

lld distance(lld x1, lld y1, lld x2, lld y2){
  return sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1));
}
lld btw(lld x1, lld y1, lld x2, lld y2, lld r1, lld r2){

  return max(distance(x1,y1,x2,y2) - r1 - r2, (lld)0);
}

  int main()
  {
      ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
     // fstream cin("text.txt");

      int n;
      lld x0,y0,x1,y1;
      cin>>x0>>y0>>x1>>y1;
      cin>>n;
      vector<vector<lld>> vertices(n+1);
      vertices[0] = {x0, y0, 0};
      for (int i = 1;i<=n;i++){
        lld a,b,c;
        cin>>a>>b>>c;
        vertices[i] = {a,b,c};
      }

      vertices.push_back({x1,y1,0});
      n++;
      vector<vector<lld>> adj(n+1, vector<lld>(n+1));
      for (int i = 0; i<=n;i++){
        for (int j = 0; j<=n;j++){
          adj[i][j] = btw(vertices[i][0], vertices[i][1], vertices[j][0], vertices[j][1], vertices[i][2], vertices[j][2]);
        }
      }

      vector<lld> d(n+1, INF);
      vector<bool> visited(n+1);
      d[0] = 0;
      for (int i = 0; i<=n;i++){
        int v = 0;
        for (int j = 1;j <=n;j++) if (!visited[j] && (visited[v] || d[j]<d[v])) v = j;
        visited[v] = true;
      // cout<<v<<endl;
        for (int j = 0; j<=n;j++){
          d[j] = min(d[j], d[v] + adj[v][j]);
          // cout<<j<<" "<<d[j]<< " "<<adj[v][j]<<endl;
        }
        // cout<<endl;
      }
      cout<<setprecision(30)<<d[n]<<"\n";

}
  

Measured memory_bytes: 18908
#include <bits/stdc++.h>
using namespace std;
using ll = long long; using ull = unsigned long long;
#define int ll
using vb = vector<bool>; using vvb = vector<vb>;
using vi = vector<int>; using vvi = vector<vi>;
using vl = vector<ll>; using vvl = vector<vl>;
template<class T> using V = vector<T>;
template<class T> using VV = vector<V<T>>;
#define fi first
#define se second
#define maxs(x,y) (x=max(x,y))
#define mins(x,y) (x=min(x,y))
using pii = pair<int,int>; using pll = pair<ll,ll>;
#define FOR(i,a,b) for(ll i = (a); i < (ll)(b); ++i)
#define REP(i,n) FOR(i,0,n)
#define RFOR(i,a,b) for(ll i = (ll)(b)-1;i >= a;--i)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define eb(val) emplace_back(val)
const double PI = acos(-1), EPS = 1e-10;
const ll MOD = 1e9+7;
ostream& operator<<(ostream &os, const vector<int> &st){
  for(int i=0;i<(int)st.size();++i){
    if(i==(int)st.size()-1) os << st[i] << endl;
    else os << st[i] << " ";
  }
  return os;
}
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vi a(3),b(3);
  REP(i,3) cin >> a[i];
  REP(i,3) cin >> b[i];
  vi f(3);
  REP(i,3){
    f[i] = b[i]-a[i];
  }
  vi dp(1e5+1,0);
  REP(i,n){
    maxs(dp[i+1],dp[i]);
    REP(j,3){
      dp[i+a[j]] = max(dp[i+a[j]],dp[i]+f[j]);
    }
  }
  dp.resize(n+1);
  // cout << dp << endl;
  n += dp[n];
  dp.assign(n+5001,0);
  REP(i,3) f[i]*=-1;
  REP(i,n){
    maxs(dp[i+1],dp[i]);
    REP(j,3){
      dp[i+b[j]] = max(dp[i+b[j]],dp[i]+f[j]);
    }
  }
  n += dp[n];
  cout << n << endl;
}



Measured memory_bytes: 196352
#include <bits/stdc++.h>
  
#define INF 2000000010
#define mod7 1000000007
#define YJ 1145141919
#define INF_INT_MAX 2147483647
#define INF_LL_MAX 9223372036854775807
#define INF_LL 9223372036854775
#define EPS 1e-10
#define Pi acos(-1)
#define LL long long
#define ULL unsigned long long
#define LD long double 
 
using namespace std;

#define MAX_N 100005
#define MAX_M 100005

int N, M;
int X[MAX_N], Y[MAX_N];
int cnt[MAX_N];
bool red[MAX_N];

int main(){

  cin >> N >> M;
  for(int i = 0; i < M; i++){
    cin >> X[i] >> Y[i];
    X[i]--; Y[i]--;
  }

  fill(cnt, cnt+MAX_N, 1);
  memset(red, 0, sizeof(red));
  red[0] = true;

  for(int i = 0; i < M; i++){
    
    int from = X[i], to = Y[i];

    if(cnt[from] == 1){
      if(red[from]){
	red[from] = false;
	red[to] = true;
      }
    }
    else{
      red[to] |= red[from];
    }

    cnt[from]--;
    cnt[to]++;

  }

  int ans = 0;
  for(int i = 0; i < N; i++){
    ans += red[i];
  }

  cout << ans << endl;

  return 0;

}


Measured memory_bytes: 1536
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <stack>
#include <numeric>




typedef long long ll;
#define PI 3.14159265359
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define _GLIBCXX_DEBAC
#include <functional>
/*map<Keyの型, Valueの型> 変数名;
queue<型> 変数名;
priority_queue<型> 変数名;
priority_queue<型, vector<型>, greater<型>> 変数名;*/
//copy(v1.begin(), v1.end(), back_inserter(v2));
using namespace std;

ll gcd(ll a, ll b) {
	ll c;
	if (a < b) {
		c = a; a = b; b = c;
	}
	while (b != 0) {
		c = a % b; a = b; b = c;
	}
	return a;
}

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

int sort_greater(int m,int n) {
	vector<int> a(m);
	for (int i = 0; i < m; i++) {
		cin >> a[i];
	}
	sort(a.begin(), a.end(),greater<int>());
	for (int i = 0; i < n; i++) {
		cout << a[i];
	}
		return 0;
}

int bubblesort(int a[], int n) {
	int sw = 0;
	bool flag = 1;
	for (int i = 0; flag; i++) {
		flag = 0;
		for (int j = n - 1; j >= i + 1; j--) {
			if (a[j] < a[j - 1]) {
				swap(a[j], a[j - 1]);
				flag = 1;
				sw += 1;
			}
		}
	}
	return sw;
}

int a_z()
{
	for (int i = 0; i <= ('Z' - 'A'); i++) {
		cout << (char)('A' + i);
	}
	return 0;
}

int selecttionsort(int a[], int n) {
	int t,sw = 0, minj;
	for (int i = 0; i < n - 1; i++) {
		minj = i;
		for (int j = 0; j < n - 1; j++) {
			if (a[j] < a[minj]) {
				minj = j;
			}
		}
		t = a[i]; a[i] = a[minj]; a[minj] = t;
		if (i != minj) sw += 1;

	}
	return sw;
}

bool is_prime(int x) {
	if (x <= 1) return false;
	for (int i = 2; i * i <= x; i++) {
		if (x % i == 0) return false;
	}
	return true;
}

const ll mod = 1000000007;


map<string, int> memo;

using P=pair<int, int>;




/*void dfs(int v, int p = -1) {
	for (int u : to[v]) {
		if (u == p) continue;
		ans[u] += ans[v];
		dfs(u, v);
	}
}*/

ll nCr(ll n, ll r) {
	ll a = 1;
	for (ll i = n; i > n - r; --i) {
		a = a * i;
	}
	for (ll i = 1; i < r + 1; ++i) {
		a = a / i;
	}
	return a;
}

void comb(vector<vector <long long int> >& v) {
	for (int i = 0; i < v.size(); i++) {
		v[i][0] = 1;
		v[i][i] = 1;
	}
	for (int k = 1; k < v.size(); k++) {
		for (int j = 1; j < k; j++) {
			v[k][j] = (v[k - 1][j - 1] + v[k - 1][j]);
		}
	}
}


int main() {
	int x, y;
	cin >> x >> y;
	cout << x + y / 2;

	return 0;
}













Measured memory_bytes: 256
dustshoot = input()

def insu2(n):
    if n == 0:
        return 0

    counter = 0
    flag = 0
    while(flag == 0):
        flag = n % 2
        if flag == 0:
            counter += 1
            n = n / 2
        else:
            break
    return counter

ip = input().split()
usdata = []
c_sum = 0

for i in ip:
    usdata.append(int(i))

for i in usdata:
    add = insu2(i)
    c_sum += add

print(c_sum)



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

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

using namespace std;

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

int main() {
  int n;
  string s;
  cin >> n >> s;

  int res = 0;
  // どこかで切る
  for (int i = 1; i < n; ++i) {
    // それぞれ条件に合う文字数を数える
    int cnt = 0;
    for (char c = 'a'; c <= 'z'; c++) {
      bool leftOk = false;
      bool rightOk = false;
      for (int j = 0; j < i; ++j) {
        if (s[j] == c) {
          leftOk = true;
          break;
        }
      }
      for (int j = i; j < n; ++j) {
        if (s[j] == c) {
          rightOk = true;
          break;
        }
      }
      if (leftOk && rightOk) {
        cnt++;
      }
    }
    res = max(res, cnt);
  }
  cout << res << endl;

  return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("O3")

#include "bits/stdc++.h"
#include "ext/pb_ds/tree_policy.hpp"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/rope"

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

typedef long long ll;
typedef pair<int, int> pii;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) for(int i = 0; i < (a); ++i)
#define pb push_back
#define mp make_pair
#define sz(x) (int)x.size()
#define f first
#define s second

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

struct custom_hash 
{
    static uint64_t splitmix64(uint64_t x) 
    {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const 
    {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    vector<int> p (n);
    F0R(i, n) cin >> p[i];
    int res = 0;
    FOR(i, 1, n - 1)
    {
        if(p[i] < p[i + 1] && p[i] > p[i - 1]) res++;
        if(p[i] > p[i + 1] && p[i] < p[i - 1]) res++;
    }
    cout << res;
    return 0;
}

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

int main() {
	int a;
	int b;

	cin >> a >> b;

	if (a < b) {
		cout << "a < b" << endl;
	}
	else if (a > b) {
		cout << "a > b" << endl;
	}
	else {
		cout << "a == b" << endl;
	}

	return 0;
}


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

int GCD(int a,int b){
    while (a){
        int tmp = a;
        a=b%a;
        b=tmp;
    }
    return b;
}

int main() {
    int a,b,c;
    cin>>a>>b>>c;
    cout<<(c%GCD(a,b)?"NO":"YES")<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <string>    
#include <vector>
#include <queue>
#include <map>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
ll n;
string str;

int main(){
	cin >> n;
	cout << 3*n*n << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define vout(x) rep(i,x.size()) cout << x[i] << " "
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
template<class T> bool chmax(T &a, T b) {if(a<b) {a=b;return 1;}return 0;}
using namespace std;
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll,int>;
const int inf = 1e9;
const ll inf_l = 1e18;
const int MAX = 1e5;
const int mod = 1e9+7;

int main() {
    int n; cin >> n;
    ll n_x = 0, n_y = 0;
    rep(i,n) {
        int t, a; cin >> t >> a;
        ll n = max((n_x+t-1)/t,(n_y+a-1)/a);
        if (n == 0) {n_x = t; n_y = a;}
        else {
            n_x = n * t; 
            n_y = n * a;
        }
    }
    cout << n_x + n_y << endl;
}

Measured memory_bytes: 256
#![allow(unused_imports)]
#![allow(unused_variables)]
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(deprecated)]

use std::cell::{Cell, Ref, RefCell, RefMut};
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::fmt::{Debug, Formatter, Write as FmtWrite};
use std::io::{stderr, stdin, BufRead, Write};
use std::mem::{replace, swap};
use std::ops::*;
use std::rc::Rc;
use std::usize;

const MOD_10_9_7: u64 = 1_000_000_007;
const INF: i64 = 1_000_000_000_000;
const MIN_INF: i64 = -1_000_000_000_000;

/// FYI: https://github.com/vain0x/scan-bench
#[allow(unused_macros)]
macro_rules! read {
    ([$t:ty] ; $n:expr) =>
        ((0..$n).map(|_| read!([$t])).collect::<Vec<_>>());
    ($($t:ty),+ ; $n:expr) =>
        ((0..$n).map(|_| read!($($t),+)).collect::<Vec<_>>());
    ([$t:ty]) =>
        (rl().split_whitespace().map(|w| w.parse().unwrap()).collect::<Vec<$t>>());
    ($t:ty) =>
        (rl().parse::<$t>().unwrap());
    ($($t:ty),*) => {{
        let buf = rl();
        let mut w = buf.split_whitespace();
        ($(w.next().unwrap().parse::<$t>().unwrap()),*)
    }};
}

fn rl() -> String {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    buf.trim_right().to_owned()
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($format:tt)*) => (write!(std::io::stderr(), $($format)*).unwrap());
}

#[allow(unused_macros)]
macro_rules! debugln {
    ($($format:tt)*) => (writeln!(std::io::stderr(), $($format)*).unwrap());
}

fn a() {
    let n = read!(usize);
    if n <= 2 {
        println!("0");
        return;
    }
    println!("{}", ((n - 1) as f64 / 2 as f64).floor() as u64);
}

/// 累乗のmod
pub fn mod_pow(x: u64, n: u64, m: u64) -> u64 {
    let mut res = 1;
    let mut x = x % m;
    let mut n = n;
    while n > 0 {
        if n & 1 == 1 {
            res = (res * x) % m;
        }
        x = (x * x) % m;
        n >>= 1;
    }
    res
}

fn b() {
    let n = read!(usize);
    let d: Vec<usize> = read![[usize]];

    if d[0] > 0 {
        println!("0");
        return;
    }

    if n == 1 {
        println!("1");
        return;
    }

    let mut count = vec![0; n];
    for i in 0..d.len() {
        if i > 0 && d[i] == 0 {
            println!("0");
            return;
        }
        count[d[i]] += 1;
    }

    let mut ans = 1u64;
    let mo = 998244353u64;
    for i in 1..(n - 1) {
        if i == 1 {
            // ans += count[i] % mo;
            continue;
        } else {
            let tmp = mod_pow(count[i - 1], count[i], mo);
            ans = ans % mo;
            ans *= tmp;
        }
    }

    println!("{}", ans);
}

fn main() {
    b();
}

Measured memory_bytes: 6396
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import static java.lang.Integer.parseInt;

public class Main {

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;

		int[] hills = new int[10001];

		while ((line = br.readLine()) != null && !line.isEmpty()) {
			hills[parseInt(line)]++;
		}

		int count = 0;
		outer:
		for (int i = hills.length - 1; ; i--) {
			if (hills[i] > 0) {
				for (int j = 0; j < hills[i]; j++) {
					System.out.println(i);
					count++;
					if (count == 3) break outer;
				}
			}
		}
	}
}

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

using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define erep(i, n) for (ll i = 0; i <= (ll)(n); ++i)
#define FOR(i,a,b) for (ll i = (a); i < (ll)(b); ++i)
#define EFOR(i,a,b) for (ll i = (a); i <= (ll)(b); ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } }

typedef pair<int, int> P;

int main() {
    int n; cin >> n;
    vector<P> ab(n);
    vector<P> cd(n);
    rep(i, n) {
        int a,b; cin >> a >> b;
        ab[i] = make_pair(a, b);
    }
    sort(ab.begin(), ab.end());
    rep(i, n) {
        int a,b; cin >> a >> b;
        cd[i] = make_pair(a, b);
    }
    sort(cd.begin(), cd.end());

    vector<bool> used(n, false);
    int ans = 0;
    rep(i, n) {
        vector<P> tmp;
        rep(j, n) {
            if(cd[i].first > ab[j].first && !used[j]) {
                tmp.push_back(make_pair(ab[j].second, j));
            }
        }
        if(tmp.empty()) continue;
        sort(tmp.begin(), tmp.end(), greater<P>());
        rep(j, tmp.size()) {
            if(cd[i].second > tmp[j].first) {
                used[tmp[j].second] = true;
                ans++;
                break;
            }
        }
    }


    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
/*
これを入れて実行
g++ code.cpp
./a.out
 */

#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <cmath>
#include <tuple>
#include <iomanip>

using namespace std;
typedef long long ll;
typedef long double ld;

int dy4[4] = {-1, 0, +1, 0};
int dx4[4] = {0, +1, 0, -1};
int dy8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dx8[8] = {0, 1, 1, 1, 0, -1, -1, -1};

const long long INF = 1LL << 60;
const ll MOD = 1e9 + 7;

bool greaterSecond(const pair<int, int>& f, const pair<int, int>& s){
    return f.second > s.second;
}

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

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

ll nCr(ll n, ll r){
    if(r == 0 || r == n){
        return 1;
    } else if(r == 1){
        return n;
    }
    return (nCr(n - 1, r) + nCr(n - 1, r - 1));
}

ll nPr(ll n, ll r){
    r = n - r;
    ll ret = 1;
    for (ll i = n; i >= r + 1; i--) ret *= i;
    return ret;
}

//-----------------------ここから-----------

int main(void){
    string s;
    cin >> s;

    string ans;

    for(int i = 0; i < s.size(); i++){
        if(s[i] == '1'){
            ans.push_back('1');
        } else if(s[i] == '0'){
            ans.push_back('0');
        } else {
            if(ans.size() > 0){
                ans.pop_back();
            }
        }
    }
    cout << ans << endl;
}

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

def main():
  n = int(input())
  d = 26
  name = ''
  while n > 0:
    if n % d == 0:
      name += chr(ord('a') - 1 + d)
      n -= d
    else:
      name += chr(n % d + ord('a') - 1 )
      n -= n % d
    n //= d
  print(name[::-1])

if __name__=='__main__':
  main()



Measured memory_bytes: 9136
import java.util.Arrays;
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt(); //足場の数
		
		int k = stdIn.nextInt();
		
		int[] h = new int[n];
		
		for(int i = 0; i < n; i++) {
			h[i] = stdIn.nextInt();
		}
		
		int[] dp = new int[n];
		Arrays.fill(dp, Integer.MAX_VALUE);
		
		dp[0] = 0;
		dp[1] = Math.abs(h[1]- h[0]);
		
		for(int i = 0; i < n; i++ ) {
			
			for(int j = i+1; j <= i+k; j++) {
				if(j >= n) {
					break;
				}
				dp[j] = Math.min(dp[i]+Math.abs(h[j]-h[i]),dp[j]);
						
				
			}
			
			
			
		}
		System.out.println(dp[n-1]);
		
		
	}

}


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


int main() {

    int n, m;
    cin >> n >> m;
    int hito[60][2];
    int point[60][2];
    for (int i = 0; i < n; ++i) {
        ll a, b; cin >> a >> b;
        hito[i][0] = a;
        hito[i][1] = b;
    }
    for (int i = 0; i < m; ++i) {
        ll c, d; cin >> c >> d;
        point[i][0] = c;
        point[i][1] = d;
    }
    ll d;
    for (ll i = 0; i < n; ++i) {
        int ans = 0;
        ll mn = 10000000000;
        for (ll j = 0; j < m; ++j) {
            d = abs(hito[i][0]-point[j][0]) + abs(hito[i][1]-point[j][1]);
            if (mn > d) {
                mn = d;
                ans = j + 1;
            }
        }
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 256
{-# LANGUAGE BangPatterns #-}

import Data.List (sort)

main :: IO ()
main = do
  getLine
  vs <- sort . map read . words <$> getLine
  print $ solve vs

solve :: [Double] -> Double
solve (v:vs) = go v vs
  where
    go !acc []     = acc
    go !acc (v:vs) = go ((acc + v) / 2.0) vs

Measured memory_bytes: 892
from sys import stdout
printn = lambda x: stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True # and False
BIG = 999999999
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

M,D = inm()
cnt = 0
for m in range(1,M+1):
    for d in range(1,D+1):
        d1 = d%10
        d2 = d//10
        if m==d1*d2 and d1>=2 and d2>=2:
            cnt += 1
print(cnt)


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

#define REP(i,m,n) for(int i=(m); i<(int)(n); i++)
#define RREP(i,m,n) for(int i=(int)(n-1); i>=m; i--)
#define rep(i,n) REP(i,0,n)
#define rrep(i,n) RREP(i,0,n)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define aut(r,v) __typeof(v) r = (v)
#define each(it,o) for(aut(it,(o).begin()); it!=(o).end(); ++it)
#define reach(it,o) for(aut(it,(o).rbegin()); it!=(o).rend(); ++it)
#define fi first
#define se second
#define debug(...) {cerr<<"[L"<<__LINE__<<"] "; _debug(__VA_ARGS__);}

template<typename T1, typename T2> ostream& operator<<(ostream& o, const pair<T1, T2>& p)
{return o<<"("<<p.first<<", "<<p.second<<")";}
template<typename T>string join(const vector<T>&v, string del=", ")
{stringstream s;rep(i,v.size())s<<del<<v[i];return s.str().substr(del.size());}
template<typename T>ostream& operator<<(ostream& o, const vector<T>&v)
{if(v.size())o<<"["<<join(v)<<"]";return o;}
template<typename T>ostream& operator<<(ostream& o, const vector<vector<T> >&vv)
{int l=vv.size();if(l){o<<endl;rep(i,l){o<<(i==0?"[ ":",\n  ")<<vv[i]<<(i==l-1?" ]":"");}}return o;}
template<typename T>ostream& operator<<(ostream& o, const set<T>& st)
{vector<T> v(st.begin(),st.end());o<<"{ "<<join(v)<<" }";return o;}
template<typename T1, typename T2>ostream& operator<<(ostream& o, const map<T1, T2>& m)
{each(p,m){o<<(p==m.begin()?"{ ":",\n  ")<<*p<<(p==--m.end()?" }":"");}return o;}
inline void _debug(){cerr<<endl;}
template<class First, class... Rest>
void _debug(const First& first, const Rest&... rest){cerr<<first<<" ";_debug(rest...);}

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;

const double PI = (1*acos(0.0));
const double EPS = 1e-9;
const ll INF = 0x3f3f3f3f;
const ll INFL = 0x3f3f3f3f3f3f3f3fLL;
const ll mod = 1e9 + 7;

inline void finput(string filename) {
    freopen(filename.c_str(), "r", stdin);
}

vl A;
vvl dp;

ll rec(int l, int r, int me){
    if(dp[l][r] != INFL) return dp[l][r];
    if(l == r) return (me ? 1 : -1) * A[l];
    ll ret;
    if(me){
        ret = max(A[l] + rec(l+1, r, me^1), A[r] + rec(l, r-1, me^1));
    }else{
        ret = min(-A[l] + rec(l+1, r, me^1), -A[r] + rec(l, r-1, me^1));
    }
    return dp[l][r] = ret;
}

int main(){
    ios_base::sync_with_stdio(0);
    // finput("./input");

    int n; cin >> n;
    A = vl(n);
    rep(i,n) cin >> A[i];
    dp = vvl(n, vl(n, INFL));

    cout << rec(0, n-1, 1) << endl;
    return 0;
}

Measured memory_bytes: 70912
#pragma region kyomukyomupurin

/**
 *    author  : 𝒌𝒚𝒐𝒎𝒖𝒌𝒚𝒐𝒎𝒖𝒑𝒖𝒓𝒊𝒏
 *    created : 2020-05-22 15:47:32
 **/

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#include <cmath>
#include <complex>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

using int64 = long long;

template <class T>
using binary_heap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

template <class T, class U>
std::ostream& operator<<(std::ostream& os, const std::pair<T, U>& p) {
  return os << '(' << p.first << ", " << p.second << ')';
}

template <class T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec) {
  int n = 0;
  for (auto e : vec) os << (n++ ? ", " : "{") << e;
  return os << (n ? "}" : "{}");
}

template <class T>
std::ostream& operator<<(std::ostream& os, const std::set<T>& st) {
  int n = 0;
  for (auto e : st) os << (n++ ? ", " : "{") << e;
  return os << (n ? "}" : "{}");
}

template <class T, class U>
std::ostream& operator<<(std::ostream& os, const std::map<T, U>& mp) {
  int n = 0;
  for (auto e : mp) os << (n++ ? ", " : "{") << e;
  return os << (n ? "}" : "{}");
}

template <class T>
std::istream& operator>>(std::istream& is, std::vector<T>& vec) {
  for (T& e : vec) is >> e;
  return is;
}

#define all(_) begin(_), end(_)
#define rall(_) rbegin(_), rend(_)

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]: ", debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

void debug_out() { std::cerr << '\n'; }

template <class Head, class... Tail>
void debug_out(Head&& head, Tail&&... tail) {
  std::cerr << head;
  if (sizeof...(Tail) != 0) std::cerr << ", ";
  debug_out(std::forward<Tail>(tail)...);
}

#pragma endregion kyomukyomupurin

unsigned long long fast_gcd(unsigned long long x, unsigned long long y) {
  int shift;
  if (x == 0) return y;
  if (y == 0) return x;
  shift = __builtin_ctzll(x | y);
  x >>= __builtin_ctzll(x);
  do {
    y >>= __builtin_ctzll(y);
    if (x > y) std::swap(x, y);
    y -= x;
  } while (y);
  return x << shift;
}

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

  int n, x; cin >> n >> x;
  vector<int> a(n); cin >> a;
  for (int& e : a) e = abs(e - x);
  cout << accumulate(all(a), 0, [](int p, int q){ return fast_gcd(p, q); }) << endl;

  return 0;
}

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

typedef long long ll;
#define int ll
#define db(x) cout<<#x<<" = "<<x<<"\n";
#define FIN ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define ALL(a) a.begin(),a.end()
#define mset(a,b) memset(a,b,sizeof(a));


 main() 
{
	FIN;
	int n;
	cin>>n;
	
	int arr[n];
	int sum=0;
	unordered_map<int,int> m;
	
	for(int i=0;i<n;i++)
	{
	    cin>>arr[i];
	    m[arr[i]]++;
	    sum=sum+arr[i];
	}
	int q;
	cin>>q;
	for(int i=0;i<q;i++)
	{
	    int a,b;
	    cin>>a>>b;
	    if(m[a]!=0)
	    {
	       // int value=m[a];
	        sum=sum-m[a]*a;
	        sum=sum+m[a]*b;
	        cout<<sum<<endl;
	        m[b]=m[b]+m[a];
	        m[a]=0;
	    }
	    else
	    cout<<sum<<endl;
	}


}

Measured memory_bytes: 7844
#include<bits/stdc++.h>
#define IO ios::sync_with_stdio(false);\
    cin.tie(0);\
    cout.tie(0);
using namespace std;
typedef long long LL;
const int maxn = 1e5+10;

int main()
{
    IO;
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    cout<<min(a,b)+min(c,d)<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define INF 999999999
#define M_PI 3.14159265358979323846
#define ALL(X) (X).begin(),(X).end()

#ifdef __LOCAL
    #define DBG(X) cout << #X << " = " << (X) << endl;
    #define SAY(X) cout << (X) << endl;
#else
    #define DBG(X)
    #define SAY(X)
#endif

#ifdef __LOCAL
    #include <filesystem>
    namespace fs = std::filesystem;
#endif

using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

int dx[]={1, 0, -1, 0, 0};
int dy[]={0, 1, 0, -1, 0};
const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);
const int NIL = -1;
static mt19937 _g(time(nullptr));
 
std::string pad(int num){ char buffer[4]; std::snprintf(buffer, sizeof(buffer), "%03d", num); return buffer;}
inline ll randint(ll a, ll b) { ll w = (_g() << 31LL) ^ _g(); return a + w % (b - a + 1); }
inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T> inline T sign(T x) { return T(x > 0) - T(x < 0); }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const map<T, S> p) { for (auto el : p) cout << "[" << el.first << "," << el.second << "] "; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline T fetch() { T ret; cin >> ret; return ret; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

int N;
vector<string> S;
map<string, int> C;

void input(){
    #ifdef __LOCAL
        fs::path path_to_file = __FILE__;
        fs::path input,output;
        input = output = path_to_file.parent_path();
        input += string("/input/") + string(path_to_file.stem()) + string(".txt");
        output += string("/output/") + string(path_to_file.stem()) + string(".txt");
        freopen(input.c_str(), "r", stdin);
        freopen(output.c_str(), "w", stdout);
    #endif
    cin >> N;
    REP(i,N){
        string s;;
        cin >> s;
        S.push_back(s);
        C[s]++;
    }
}

int solve(){
    input();
    int times=0;
    map<int,vector<string> > stock_ans;
    for(auto c:C) {
        if(c.second<times) continue;
        stock_ans[c.second].push_back(c.first);
        times = max(times,c.second);
        }
    
    VSORT(stock_ans[times])
    for(auto ans:stock_ans[times]) cout << ans << "\n";

    return 0;    
}

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


Measured memory_bytes: 28400
#include <bits/stdc++.h>
using namespace std;
constexpr int MAXN = 1e5 + 7;

vector<int> from[MAXN];
int dp[MAXN];

void dfs(int u)
{
    if (dp[u] || from[u].empty())
        return;
    for (int v : from[u]) {
        dfs(v);
        dp[u] = max(dp[u], 1 + dp[v]);
    }
}

int main()
{
    int n, m;
    scanf("%d%d", &n, &m);
    for (int i = 0; i != m; ++i) {
        int u, v;
        scanf("%d%d", &u, &v);
        from[u].push_back(v);
    }
    for (int i = 1; i <= n; ++i)
        if (!dp[i])
            dfs(i);
    int ans = 0;
    for (int i = 1; i <= n; ++i)
        ans = max(ans, dp[i]);
    printf("%d\n", ans);
}

Measured memory_bytes: 8192
#include <iostream>
#include <vector>
#include <algorithm>
#include <stdlib.h>
#include <limits.h>
#include <map>
#include <math.h>
#include <cmath>

using namespace std;

int main(){
  double n;cin>>n;
  double num = ceil(n/2);
  //cout<<num<<endl;
  cout<<num/n<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using pint = pair<int, int>;
using vi = vector<int>;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()

const int MOD = 1000000007;
const int INF = 1 << 30;

long long modpow(long long a, long long n) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}

int main() {
    lint n, a, b;
    cin >> n >> a >> b;

    lint res = modpow(2, n);
    res--;

    lint inv[200050];
    inv[1] = 1;
    for (int i = 2; i <= max(a, b); i++) {
        inv[i] = inv[i-1] * modpow(i, MOD-2);
        inv[i] %= MOD;
    }

    lint nca = inv[a];
    for (int i = n; i >= n-a+1; i--) {
        nca *= i;
        nca %= MOD;
    }

    lint ncb = inv[b];
    for (int i = n; i >= n-b+1; i--) {
        ncb *= i;
        ncb %= MOD;
    }

    res -= nca;
    res -= ncb;
    res = ((res % MOD) + MOD) % MOD;
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 1792