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

public class Main {
    //static StringBuilder ss = new StringBuilder();
    public static void main(String[] args) throws IOException {
        InputReader in = new InputReader();
        PrintWriter out = new PrintWriter(System.out);
        int test_cases = 1;
        Solver s = new Solver();
        long start = System.currentTimeMillis();
        for (int i = test_cases; i >= 1; i--) {
            s.solve(1, in, out);
        }
        long end = System.currentTimeMillis();
        //System.out.println((end - start) / 1e3);
        //out.println(ss);
        out.close();
    }

    static class Solver {
        void solve(int test_number, InputReader in, PrintWriter out) throws IOException {
            long q = in.nextLong();
            long h = in.nextLong();
            long s = in.nextLong();
            long d = in.nextLong();
            long n = in.nextLong();
            out.println(f1(q, h, s, d, n));
        }

        private long f1(long q, long h, long s, long d, long n) {
            long qq = q * 8;
            long hh = h * 4;
            long ss = s * 2;
            long ans = 0;
            if (qq < hh && qq < ss && qq < d) {
                ans += n * (4 * q);
            }
            else if (hh < qq && hh < ss && hh < d) {
                ans += n * (2 * h);
            }
            else if (ss < qq && ss < hh && ss < d) {
                ans += n * (s);
            }
            else {
                ans += n / 2 * d;
                if (n % 2 == 1) {
                    ans += Math.min(4 * q, Math.min(2 * h, s));
                }
            }
            return ans;
        }
    }
    static class InputReader {
        BufferedReader br;
        StringTokenizer st;

        public InputReader()
        {
            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;
        }
    }
}

Measured memory_bytes: 23124
#include <iostream>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)

int main() {
  int a, b, h;
  cin >> a >> b >> h;
  cout << (a + b) * h / 2 << endl;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(){
int k,i,j=0;
char str[100];
  
scanf("%d",&k);
scanf("%s",str);

for(i=0;str[i]!='\0';i++){
  j++;
}
  
if(k<j){
  for(i=0;i<3;i++){
  str[k+i]='.';
    
  }
  for(i=0;i<k+3;i++){
  printf("%c",str[i]);
  }
}else{
  printf("%s",str);
}
 
  
}

Measured memory_bytes: 1700
using System;
 
class A
{
    public static void Main()
    {
        string[] str = Console.ReadLine().Split(' ');
        int A = int.Parse(str[0]);
        int B = int.Parse(str[1]);
        int C = int.Parse(str[2]);
 
        int temp;
 
        temp = A;
        A = B;
        B = temp;
 
        temp = A;
        A = C;
        C = temp;
 
        Console.WriteLine("{0} {1} {2}", A, B, C); 
    }
}

Measured memory_bytes: 13140
import math
from scipy.spatial import distance

a, b, h, m = map(int, input().split())

jishin = math.radians(90 - (h + m / 60) * 30)
hunshin = math.radians(90 - m * 6)

x = (a * math.cos(jishin), a * math.sin(jishin))
y = (b * math.cos(hunshin), b * math.sin(hunshin))

ans = distance.euclidean(x, y)
print(ans)


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

#define forn(i, n) for (int i = 0; i < int(n); ++i)
#define for1(i, n) for (int i = 1; i <= int(n); ++i)
#define fore(i, l, r) for (int i = int(l); i <= int(r); ++i)
#define ford(i, n) for (int i = int(n)-1; i >= 0; --i)
#define pb push_back
#define eb emplace_back
#define ms(a, x) memset(a, x, sizeof(a))
#define F first
#define S second
#define endl '\n'
#define all(x) (x).begin(),(x).end()

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 0x3f3f3f3f;
mt19937 gen(chrono::high_resolution_clock::now().time_since_epoch().count());
//template<typename... Args>
//void write(Args... args) { ((cout << args << " "), ...); cout<<endl;}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
	int k,n;
    cin>>k>>n;
    vector<int> a(n);
    for(auto& it:a) cin>>it;
    int  ans=k;
    forn(i,n-1){
        ans=min(ans,k-(a[i+1]-a[i]));
    }
    ans=min(ans,k-(a[0]+k-a.back()));
    cout<<ans;
    return 0;
}



Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define reps(i,s,n) for(int i=(s); i<(n); i++)
#define all(v) v.begin(),v.end()
#define outve(v) for(auto i : v) cout << i << " ";cout << endl
#define outmat(v) for(auto i : v){for(auto j : i) cout << j << " ";cout << endl;}
#define in(n,v) for(int i=0; i<(n); i++){cin >> v[i];}
#define out(n) cout << (n) << endl
#define fi first
#define se second
#define pb push_back
#define mod 1000000007
#define infi 1900000000
#define infl 1100000000000000000
#define cyes cout << "Yes" << endl
#define cno cout << "No" << endl
#define csp << " " <<
#define outset(n) cout << fixed << setprecision(n);
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
template<typename T> using ve = vector<T>;
template<typename T> using pq2 = priority_queue<T>;
template<typename T> using pq1 = priority_queue<T,vector<T>,greater<T>>;




int main()
{

    int N,K;
    cin >> N >> K;
    if(N*(N-1)/2-(N-1) < K){
        cout << -1 << endl;
        return 0;
    }
    
    int M = N-1;
    ve<pii> ans;
    reps(i,2,N+1) ans.pb({1,i});
    int k = N*(N-1)/2-(N-1);
    
    reps(u,2,N){
        reps(v,u+1,N+1){
            if(k > K){
                M++;
                ans.pb({u,v});
                k--;
            }else{
                break;
            }
        }
    }
    cout << M << endl;
    rep(i,M){
        cout << ans[i].fi csp ans[i].se << endl;
    }
    

    return 0;
}


Measured memory_bytes: 384
import java.util.Scanner;

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 str = "No";

        if (W >= x + r && 0 <= x - r) {
            if (H >= y + r && 0 <= y - r) {
                str = "Yes";
            }
        }

        System.out.println(str);
        sc.close();
    }

}


Measured memory_bytes: 26292
#include<stdio.h>

int main(){
  int N,K;
  int dk = 1;
  scanf("%d %d",&N,&K);

  while(N-- != 0){
    if(dk * 2 >= dk + K)
      dk += K;
    else
      dk *= 2;
  }

  printf("%d\n",dk);

  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace std;
using namespace __gnu_pbds;
 
#define fi first
#define se second
#define mp make_pair
#define pb push_back
 
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef long double ld; 
typedef tree<ii, null_type, less<ii>, rb_tree_tag, tree_order_statistics_node_update> pbds;

vector<ii> vec;

int get(int x)
{
	int lb=lower_bound(vec.begin(),vec.end(),mp(x,-1))-vec.begin();
	if(lb<vec.size()&&vec[lb].fi==x) return vec[lb].se;
	else return 1;
}
int a[555555];
int cnt[555555];
int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	int n; cin>>n;
	bool hack=0;
	for(int i=0;i<n;i++) 
	{
		cin>>a[i];
		if(i>0&&a[i]<=a[i-1]) hack=1;
		//a[i]=1;
	}
	if(!hack){cout<<1<<'\n'; return 0;}
	int lo=2; int hi=int(1e9);
	int ans=2;
	while(lo<=hi){int K=(lo+hi)>>1;bool pos=1;vec.clear();
	for(int i=1;i<n;i++)
	{
		int v=a[i];
		if(a[i]>a[i-1]) continue;
		while(!vec.empty()&&vec.back().fi>v)
		{
			vec.pop_back();
		}
		
		if(vec.empty())
		{
			vec.pb(mp(v,2));
			if(vec.back().se>K) pos=0;
		}
		else
		{
			int cur=v;
			while(cur>0&&get(cur)>=K)
			{
				cur--;
			}
			if(cur<=0) cur=v;
			int gc=get(cur);
			while(!vec.empty()&&vec.back().fi>=cur)
			{
				vec.pop_back();
			}
			vec.pb(mp(cur,gc+1));
			if(vec.back().se>K){pos=0;}
		}
		
		/*
		for(ii x:vec)
		{
			cerr<<x.fi<<' '<<x.se<<'\n';
		}
		cerr<<"END "<<i<<'\n';
		*/
	}if(pos){ans=K;hi=K-1;} else{lo=K+1;}
	}
	
	cout<<ans<<'\n';
}


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

int main() {
  
  string s;
  cin >> s;
  
  int n = s.size();
  
  bool ans = true;
  
  REP(i,n) {
    if (i % 2 == 0 && s[i] == 'L') ans = false;
    if (i % 2 == 1 && s[i] == 'R') ans = false;
  }
  
  cout << (ans ? "Yes" : "No") << endl;
     
}

Measured memory_bytes: 256
/* Dsingh_24 */

#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define	endl		'\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define rep(i,a,b)	for(ll int i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define ios	    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;

#define N  100005

int main()
{
	ios
	set<string>s;
	ll n,i,j;
	cin>>n;
	string a;
	for(i=0;i<n;i++){
		cin>>a;
		s.insert(a);
	}
	cout<<s.size();
	return 0;
}

Measured memory_bytes: 19132
N,K=list(map(int,input().split()))
A=list(map(int,input().split()))

from collections import Counter
A_ = Counter(A).most_common()[::-1]

ans=0
for _ in A_[:len(A_)-K]:
    if len(A_)-K <= 0:
        break
    ans += _[1]
    
print(ans)

Measured memory_bytes: 128184
/*
 * Problem Description: Recursion / Divide and Conquer - Exhaustive Search
 * Category:
 * Author: Khan
 * Date: 15th October, 2017
 */

#include <stdio.h>

int n, A[50];

int solve(int i, int m)
{
    if(m == 0)
        return 1;
    if(i >= n)
        return 0;
    int res = solve(i + 1, m) || solve(i + 1, m - A[i]);
    return res;
}

int main(int argc, char const *argv[])
{
    //freopen("sample.txt", "r", stdin);
    int q, M, i;
    scanf("%d", &n);
    for (int i = 0; i < n; ++i)
    {
        scanf("%d", A + i);
    }
    scanf("%d", &q);
    for (int i = 0; i < q; ++i)
    {
        scanf("%d", &M);
        if(solve(0, M))
            printf("yes\n");
        else
            printf("no\n");
    }

    return 0;
}

Measured memory_bytes: 1716
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define itr(it,a) for( auto it = (a).begin(); it != (a).end(); ++it )
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).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; }

using ll = long long;

ll gcd( ll a, ll b )
{ return b ? gcd(b,a%b) : a; }

ll K, ans;

int main()
{
  std::cin >> K;

  repi( a, 1, K+1 ) repi( b, 1, K+1 ) repi( c, 1, K+1 )
  {
    ans += gcd(gcd(a,b),c);
  }

  std::cout << ans << std::endl;

  return 0;
}

Measured memory_bytes: 3196
// Aizu 2401: Equation
// 2017.9.27 bal4u@uu

#include <stdio.h>
#include <ctype.h>

typedef struct { int id, ord; char f; } T;
T var[12]; int n;

char buf[1002], *exp[2], *p;
char val[2050]; int assign;

int expr();
int factor()
{
	int x, id, f = 0;

	while (*p == '-') p++, f = !f;
	if      (*p == 'T') p++, x = 1;
	else if (*p == 'F') p++, x = 0;
	else if (*p == '(') p++, x = expr(), p++;
	else {			// a-k
		id = *p++ - 'a';
		x = (assign & (1 << var[id].ord)) != 0;
	}
	if (f) x = !x;
	return x;
}

int expr()
{
	int x, y, op;
	
	x = factor();
	while (1) {
		if      (*p == '*') p++,  op = 0;
		else if (*p == '+') p++,  op = 1;
		else if (*p == '-') p+=2, op = 2;
		else break;
		y = factor();
		if      (op == 0) x &= y;
		else if (op == 1) x |= y;
		else { if (x && !y) x = 0; else x = 1; }
	}
	return x;
}

int main()
{
	int i, lim, x, f; int y;

	while (scanf("%s", buf) && *buf != '#') {
		exp[0] = p = buf;
		while (*p && *p != '=') p++;
		if (!*p) { puts("NO"); continue; }
		*p++ = 0, exp[1] = p;

		for (i = 0; i < 11; i++) var[i].id = i, var[i].f = 0;
		for (i = 0; i < 2; i++) {
			for (p = exp[i]; *p; p++) if (isalpha(*p)) var[*p - 'a'].f = 1;
		}
		for (n = 0, i = 0; i < 11; i++) if (var[i].f) var[i].ord = n++;

		lim = 1 << n;
		for (f = 0, assign = 0; assign < lim; assign++) {
			p = exp[0];
			x = expr();
			p = exp[1];
			y = expr();
			if (y != x) { f = 1; break; }
		}
		puts(f ? "NO" : "YES");
	}
	return 0;
}

Measured memory_bytes: 1752
import math
from collections import deque

def BellmanFord(edges, N, M, start):
    dist = [math.inf]*N
    dist[start] = 0

    for i in range(N):
        for j in range(M):
            if is_valid(edges[j][0], edges[j][1]):
                if dist[edges[j][1]] > dist[edges[j][0]] + edges[j][2]:
                    dist[edges[j][1]] = dist[edges[j][0]] + edges[j][2]
                    if i == N - 1:
                        return False

    return dist

def dfs(graph, N, start):
    visited = [False]*N
    visited[start] = True
    q = deque([start])

    while q:
        v = q.pop()
        for n_v in graph[v]:
            if not visited[n_v]:
                visited[n_v] = True
                q.append(n_v)
    
    return visited

def is_valid(f, t):
    return can_from_start[f] and can_from_start[t] and can_to_goal[f] and can_to_goal[t]


N, M, P = map(int, input().split())
graph = [[] for _ in range(N)]
graph_inv = [[] for _ in range(N)]
edges = []

for _ in range(M):
    A, B, C = map(int, input().split())
    graph[A - 1].append(B - 1)
    graph_inv[B - 1].append(A - 1)
    edges.append((A - 1, B - 1, - (C - P)))

can_from_start = dfs(graph, N, 0)
can_to_goal = dfs(graph_inv, N, N - 1)

dist = BellmanFord(edges, N, M, 0)

if dist:
    print(max(0, -dist[N - 1]))
else:
    print(-1)

Measured memory_bytes: 77380
//A.cpp
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <stack>
#include <math.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){return b!=0?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
const ll mod=1e9+7;


int main(){
  ll n,m;
  cin >> n >> m;
  ll a;
  priority_queue<ll> pque;
  rep(i,n){
    cin >> a;
    pque.push(-a);
  }
  vector<pair<ll,ll>> memo;
  ll b,c;
  rep(i,m){
    cin >> b >> c;
    memo.push_back(make_pair(-c,b));
  }
  sort(memo.begin(),memo.end());

  ll cnt;
  ll cheak;
  rep(i,m){
    cnt = memo[i].second;
    rep(j,cnt){
      cheak = pque.top();
      if(cheak > memo[i].first){
        pque.pop();
        pque.push(memo[i].first);
      }else{
        break;
      }
    }

  }

  ll ans = 0;
  rep(i,n){
    ans += pque.top();
    pque.pop();
  }
  printf("%lld\n", -ans);
  return 0;
}


Measured memory_bytes: 3188
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<map>
#include<string>
#include<numeric>
#include<set>
using namespace std;

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

    long n = (long)ceil(sqrt(S));
    if(n*n < S) n++;
    else if((n-1)*(n-1) >= S) n--;
    long q = n*n - S;

    cout << 0 << " " << 0 << " " << n << " " << q << " " << 1 << " " << n << endl;

    return 0;
}

Measured memory_bytes: 256
from collections import defaultdict

N = int(input())
a = list(map(int, input().split()))
d = defaultdict(int)
total = 0
for i in a:
    d[i] += 1
    total += i
Q = int(input())

for i in range(Q):
    b, c = map(int, input().split())
    cnt = d[b]
    total -= cnt * b
    d[b] = 0
    d[c] += cnt
    total += c * cnt
    print(total)

Measured memory_bytes: 24184
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	int d[n];
	for(int i=0;i<n;i++){
		cin>>d[i];
	}
	sort(d,d+n);	
	cout<<d[n/2]-d[n/2-1];
	return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
using namespace std;
int main() {
  int x;
  cin >> x;
  if(x == 3 or x == 5 or x == 7){
    cout << "YES" << endl;
  }
  else{
    cout << "NO" << endl;
  }
  }


Measured memory_bytes: 256
function Main(input){
  input = input.split("\n");
  inputStr = input[0].split(" ");
  var N = Number.parseInt(inputStr[0]);
  var K = Number.parseInt(inputStr[1]);
  inputStr = input[1].split(" ");
  var h = inputStr.map(inputStr => Number.parseInt(inputStr));
  //昇順ソート
  h.sort(function(a,b){
        if( a < b ) return -1;
        if( a > b ) return 1;
        return 0;
  });
  for(var i=0 ; i<N ; i++){
    if( h[i] >= K ){
      break;
    }
  }
  //引数に応じた結果を出力
  console.log(N-i);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 28028
#include<iostream>

int main(void){
    int n;
    int a[31]={};
    a[0]=1;
    a[1]=1;
    a[2]=2;
    for(int i=3;i<31;i++){
        a[i]=a[i-1]+a[i-2]+a[i-3];
    }
    while(std::cin>>n){
        if(n==0) break;
        std::cout<<a[n]/3650+1<<std::endl;
    }
    return 0;
}


Measured memory_bytes: 3068
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::{Bytes, Chars};
#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
	input! {
		nmax: usize,
	}

	let mut v: Vec<usize> = vec![0; 10000];
	let n2 = (nmax as f64).sqrt() as  usize;
	for x in 1..n2 {
		for y in 1..n2 {
			for z in 1..n2 {
				let s = x*x + y*y + z*z + x*y + y*z + z*x;
				if s <= nmax {
					v[s-1] += 1; 
				}
			} 
		}
	}
	for i in 0..nmax {
		println!("{}", v[i]);
	}
}



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

using namespace std;

const int inf = 1e9;
const int N = 205;

int n, m, r, dis[N][N];
vector<pair<int, int>> child[N];
vector<int> mi;
int wyn = inf;

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cin >> n >> m >> r;
	for (int i = 1; i <= r; ++i) {
		int q;
		cin >> q;
		mi.push_back(q);
	}
	for (int i = 1; i <= n; ++i)
		for (int j = 1; j <= n; ++j) {
			dis[i][j] = inf;
			if (i == j)
				dis[i][j] = 0;
		}
	for (int i = 1; i <= m; ++i) {
		int a, b, c;
		cin >> a >> b >> c;
		child[a].push_back({b, c});
		child[b].push_back({a, c});
		dis[a][b] = dis[b][a] = c;
	}
	for (int i = 1; i <= n; ++i)
		for (int j = 1; j <= n; ++j)
			for (int k = 1; k <= n; ++k)
				dis[j][k] = min(dis[j][k], dis[j][i]+dis[i][k]);
	sort(mi.begin(), mi.end());
	do {
		int res = 0;
		for (int i = 0; i+1 < mi.size(); ++i) {
			if (dis[mi[i]][mi[i+1]] == 0)
				cout<<mi[i]<<" , "<<mi[i+1]<<"\n";
			res += dis[mi[i]][mi[i+1]];
		}
		wyn = min(wyn, res);
	} while(next_permutation(mi.begin(), mi.end()));
	cout<<wyn<<"\n";
}

Measured memory_bytes: 896
#include <bits/stdc++.h>
#include <string>
using namespace std;
 
int main() {
  string A,B,C;
  cin >> A >> B >> C;
  transform(A.begin(), A.end(), A.begin(), ::toupper);
  transform(B.begin(), B.end(), B.begin(), ::toupper);
  transform(C.begin(), C.end(), C.begin(), ::toupper);
  cout << A.at(0) << B.at(0) << C.at(0) << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
bool compare(vector<int>& a,vector<int> & b)
{
    return a[0]<b[0];
}
int main()
{
    int n;
    cin>>n;
    vector<vector<int>> a(n,vector<int>(2,0));
    for(int i=0;i<n;i++)
    {
        int temp;
        cin>>temp;
        a[i][0]=temp;
        a[i][1]=i+1;
    }
    sort(a.begin(),a.end(),compare);
    for(int i=0;i<n;i++)
    {
        cout<<a[i][1]<<" ";
    }
}

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

int main() {
    int n; cin >> n;
    vector<int> a(n);
    for(int i = 0; i < n; ++i) cin >> a[i];
    
    vector<int> num(100000, 0);
    for(int i = 0; i < n; ++i) ++num[a[i]];
    
    int res = 0;
    for(int x = 0; x < 100000; ++x) {
        res = max(res, num[x-1] + num[x] + num[x+1]);
    }
    
    cout << res << endl;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using namespace std;
const int INF=1e9+5;
typedef long long ll;

int main() {
  ll x,y;
  cin>>x>>y;
  string ans="No";
  for(int i=0;i<=x;i++){
    if(2*i+4*(x-i)==y){
      ans="Yes";
      break;
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 3620
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.AbstractMap;
import java.util.NoSuchElementException;

/** テンプレート */
public class Main {
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		int A = sc.nextInt();
		int B =  sc.nextInt();
		int C =  sc.nextInt();

		//************************************/
		// ここから出力処理
		//************************************/
		PrintWriter out = new PrintWriter(System.out);


		if(B >= A*C) {
			out.println(C);
		}else{
			out.println(B/A);

		}


		// 最後に必ずFlush
		out.flush();
	}

}

/** スキャン用 */
class FastScanner {
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

	/** クラス内部用だよ */
	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	}

	/** クラス内部用だよ */
	private int readByte() {
		if (hasNextByte()) {
			return buffer[ptr++];
		} else {
			return -1;
		}
	}

	/**
	 * クラス内部用だよ
	 * ASCII の文字の内、表示用の文字を返す関数
	 *
	 * @return 改行とか制御文字じゃない、表示用文字ならtrue
	 * */
	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}

	/**
	 * @return 改行文字とか空白以外を除いた、次の文字があればtrue
	 * */
	public boolean hasNext() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
			ptr++;
		}
		return hasNextByte();
	}

	/**
	 *
	 * @return 次の文字列
	 */
	public String next() {
		if (!hasNext()) {
			throw new NoSuchElementException();
		}

		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	/**
	 *
	 * @return 次のLong
	 */
	public long nextLong() {
		if (!hasNext())
			throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}

	/**
	 *
	 * @return 次のInt
	 */
	public int nextInt() {
		long nl = nextLong();
		if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
			throw new NumberFormatException();
		return (int) nl;
	}

	/**
	 *
	 * @return 次のDouble
	 */
	public double nextDouble() {
		return Double.parseDouble(next());
	}
}

class Pair<K, V> extends AbstractMap.SimpleEntry<K, V> {
	/** serialVersionUID. */
	private static final long serialVersionUID = 6411527075103472113L;

	public Pair(final K key, final V value) {
		super(key, value);
	}
}


Measured memory_bytes: 21204
#include<bits/stdc++.h>
using namespace std;
#define stop exit(0)
#define pb push_back
#define po pop_back
#define skip continue
//scanf("%lld",&a);
int main(){
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    vector<long long>v,u;
    pair<long long, long long>n;
    set<string>y;
    long long a,b,c,d=0,e=0,i,f=0,g=0,j,k=0,l=0,r=0,z,m,h,p[4];
    string t[4]={"AC","WA","TLE","RE"},s,x,q;
    double w;
    cin>>a;
    for(i=0;i<4;i++){
        p[i]=0;
    }
    while(a--){
        cin>>s;
        for(i=0;i<4;i++){
            if(s==t[i]){
                p[i]++;
                break;
            }
        }
    }
    for(i=0;i<4;i++){
        cout<<t[i]<<" x "<<p[i]<<endl;
    }
}

Measured memory_bytes: 3628
#include<cmath>
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<deque>
#include<queue>
#include<algorithm>
#include<list>
#include<cstring>
#include <numeric>

#define ll long long
#define int long long
#define ld long double
#define endl "\n"
#define debugv(v) cerr<<#v<<" : ";for (auto x:v) cerr<<x<<' ';cerr<<endl;
#define debug(x) cerr<<#x<<'='<<(x)<<endl;
#define debugp(p) cerr<<#p<<'='<<(p.first)<<" "<<p.second<<endl;
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL);
#define output(x)   cout << (x ? "YES" : "NO")<<endl;
const ll MOD = 1e9 + 7;
const int N = 'Z'+5;
const int demo = 10;
using namespace std;
const ll cfmod=998244353;
ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
int dx[4]={0,0,-1,1};
int dy[4]={-1,1,0,0};
char button[4]={'L','R','U','D'};

// Ahhiya thi lakhvanu chalu thasse....

signed main() {
    FAST
    int q = 1;
    //cin>>q;
    while (q--) {
        int arr[32]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
        int n;
        cin>>n;
        cout<<arr[n-1];
    }
}

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

#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = (n)-1; i >= 0; i--)
#define rep1(i,n) for(int i = 1; i <= (n); i++)
#define rrep1(i,n) for(int i = (n); i > 0; i--)

#define ll long long
#define pi pair<int, int>
#define pll pair<ll, ll>

#define MOD 1000000007
#define INF 1000000000000000LL

using namespace std;

int main(){
  int k;cin>>k;
  vector<ll> a(k);
  rrep(i, k)cin>>a[i];

  ll minc=2, maxc=2;
  for(auto c: a){
    if(minc/c*c < minc && minc/c*c+c>maxc) { cout<<-1<<endl; return 0; }
    minc = (minc+c-1)/c*c;
    maxc = maxc/c*c+c-1;
//cout<<c<<' '; printf("%d %d\n", minc, maxc);
  }

  printf("%lld %lld\n", minc, maxc);

  return 0;
}


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

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repA(i, a, n) for (int i = a; i <= (n); ++i)
#define repD(i, a, n) for (int i = a; i >= (n); --i)
#define tr(a, x) for (auto &a : x)
#define all(c) c.begin(), c.end()

#define lld long long
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define f first
#define s second
#define sz(a) int((a).size())
#define present(c, x) (c.find(x) != c.end())
#define cpresent(c, x) (find(all(c), x) != c.end())

#define vi vector<lld>
#define si set<lld>
#define endl "\n"
#define int long long
#define pii pair<int, int>
#define minq priority_queue<int, vector<int>, greater<int>>
#define mem(a, val) memset(a, val, sizeof(a))
#define scani(x) scanf("%lld", &x)
#define scani2(x, y) scanf("%lld %lld", &x, &y)
#define scani3(x, y, z) scanf("%lld %lld %lld", &x, &y, &z);
#define print(x) printf("%lld ", x)
#define println(x) printf("%lld\n", x)
#define SpeedForce ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define MOD 1000000009

using namespace std;

const int N = 3e5 + 11;
int dp[N], n, height[N], k;
int jump(int i)
{
     if (dp[i] != -1)
          return dp[i];
     
     dp[i] = INT_MAX;
     repA(j,1,k){
          if (i+j > n-1)
               break;

          dp[i] = min(abs(height[i]-height[i+j])+jump(i+j),dp[i]); 
     }
     
     return dp[i];
}

int32_t main()
{
     // #ifndef ONLINE_JUDGE
     //      freopen("input.txt", "r", stdin);
     //      freopen("output.txt", "w", stdout);
     // #endif

     SpeedForce;
     cin >> n >> k;
     
     rep(i,n){
          cin >> height[i];
     }

     rep(i,n){
          dp[i] = -1;
     }

     dp[n] = dp[n-1] = 0;
     dp[n-2] = abs(height[n-1]-height[n-2]);
     cout << jump(0) << endl;
}

Measured memory_bytes: 11428
#include <bits/stdc++.h>
#include <algorithm>
#include <math.h>
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
#define INF 999999999
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

using llong = long long;
using namespace std;

int main(){
    llong N,ans=0;
    double D,X[200100],Y[200100];
    cin >> N >> D;
    rep(i,N) {
        cin >> X[i] >> Y[i];
        if(sqrt(X[i]*X[i]+Y[i]*Y[i]) <= D) ans++;
    }
    
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 6972
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<char,int>;
const ll inf = numeric_limits< ll >::max()/3;

int main(void){
  string s;
  cin >> s;
  int n = (int)s.size();
  vector< P > c;
  for(int i = 0;i < n;++i){
    if(s[i] != 'x')
      c.push_back(P(s[i],i));
  }
  int size = (int)c.size();
  for(int i = 0;i < size;++i){
    if(c[i].first != c[size-i-1].first){
      cout << "-1" << endl;
      return 0;
    }
  }
  if(size == 0){
    cout << "0" << endl;
    return 0;
  }
  int mid1,mid2;
  if(size % 2 == 0){
    mid1 = c[size/2-1].second;
    mid2 = c[size/2].second;
  }else{
    mid1 = c[size/2].second;
    mid2 = c[size/2].second;
  }
  int cnt1 = 0,cnt2 = n-1;
  int res = 0;
  while(cnt1 != mid1 || cnt2 != mid2){
    if(cnt1 == mid1){
      --cnt2;
      ++res;
    }else if(cnt2 == mid2){
      ++cnt1;
      ++res;
    }else if(s[cnt1] == s[cnt2]){
      ++cnt1;
      --cnt2;
    }else if(s[cnt1] == 'x'){
      ++res;
      ++cnt1;
    }else if(s[cnt2] == 'x'){
      ++res;
      --cnt2;
    }
  }
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 1528
import java.util.*;

public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int X = sc.nextInt();
		int Y = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		
		Integer red[] = new Integer[A];
		Integer green[] = new Integer[B];
		Integer clear[] = new Integer[C];
		
		for(int i = 0; i < A; i++){
			red[i] = sc.nextInt();
		}
		for(int i = 0; i < B; i++){
			green[i] = sc.nextInt();
		}
		for(int i = 0; i < C; i++){
			clear[i] = sc.nextInt();
		}
		
		Arrays.sort(red, Collections.reverseOrder());
		Arrays.sort(green, Collections.reverseOrder());

		Integer apple[] = new Integer[X + Y + C];
		for(int i = 0; i < X; i++)apple[i] = red[i];
		for(int i = 0; i < Y; i++)apple[i + X] = green[i];
		for(int i = 0; i < C; i++)apple[i + X + Y] = clear[i];
		Arrays.sort(apple, Collections.reverseOrder());
		
		long sum = 0;
		for(int i = 0; i < X + Y; i++){
			sum += apple[i];
		}
		System.out.println(sum);
	}
}

Measured memory_bytes: 102016
#include<bits/stdc++.h>
using namespace std;
#define _ ios::sync_with_stdio(false);cin.tie(0);
#define __ cout<<fixed;cout<<setprecision(10);
#define int long long

int sumofDigits(string s) {
	int count = 0;
	for (int i = 0; i < s.length(); i++) {
		count += s[i] - '0';
		count %= 9;
	}
	if (count % 9 == 0) {
		return 1;
	}
	return 0;
}

int32_t main() {
	_ __

#ifdef LOCAL_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	string n;
	cin >> n;
	if (sumofDigits(n) == 1) {
		cout << "Yes\n";
	}
	else {
		cout << "No\n";
	}

#ifdef LOCAL_JUDGE
	cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << "s.\n";
#endif

	return 0;
}

Measured memory_bytes: 3732
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc= new Scanner(System.in);
        label:while(sc.hasNext()){
            String str = sc.next();
            String[] s = str.split(",");
            int[] a = new int[5];
            for(int i = 0; i < 5;i++){
                a[i]=Integer.parseInt(s[i]);
            }
            Arrays.sort(a);
            if(a[0]==a[1]&&a[1]==a[2]&&a[2]==a[3]){
                System.out.println("four card");
                continue;
            }
            if(a[1]==a[2]&&a[3]==a[2]&&a[4]==a[3]){
                System.out.println("four card");
                continue;
            }
            if(a[0]==a[1]&&a[0]==a[2] && a[3]==a[4]){
                System.out.println("full house");
                continue;
            }
            if(a[0]==a[1] && a[2]==a[3] && a[2] == a[4]){
                System.out.println("hull house");
                continue;
            }
            if(a[0]+1==a[1]&&a[0]+2==a[2]&&a[0]+3==a[3]&&a[0]+4==a[4]){
                System.out.println("straight");
                continue;
            }
            if(a[0]==1&&a[1]==10&&a[2]==11&&a[3]==12&&a[4]==13){
                System.out.println("straight");
                continue;
            }
            if(a[0]==a[1] && a[0]==a[2] || a[1]==a[2]&&a[1]==a[3] || 
                    a[2]==a[3] && a[2] == a[4]){
                System.out.println("three card");
                continue;
            }
            for(int i = 0; i < 3;i++){
                if(a[i]==a[i+1]){
                    for(int j = i+3; j < 5;j++){
                        if(a[j]==a[j-1]){
                            System.out.println("two pair");
                            continue label;
                        }
                    }
                }
            }
            for(int i = 0; i < 4; i++){
                if(a[i]==a[i+1]){
                    System.out.println("one pair");
                    continue label;
                }
            }
            System.out.println("null");
                 
        }
    }
 
}

Measured memory_bytes: 17164
#include "bits/stdc++.h"
using namespace std;

int main() {
	int x, a, b;
	cin >> x >> a >> b;
	if(abs(x-a)< abs(x-b)){
		cout << "A" << endl;
	}
	else {
		cout << "B"<< endl;
	}
	return 0;
}


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

int main() {
  int n,m,x;
  long long ans=0;
  priority_queue<int> A;

  cin >> n >> m;

  for(int i=0;i<n;i++) {
    cin >> x;
    A.push(x);
  }

  for(int i=0;i<m;i++) {
    x = A.top();
    A.pop();
    A.push(x/2);
  }

  for(int i=0;i<n;i++) {
    ans += A.top();
    A.pop();
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 892
N=input("")
N=int(N)
S=[]
f=1
for i in range(1,N+1,1):
    mystr=input("")
    if i>=2:
        if lastchar!=mystr[0]:
            f=0
            break
        if mystr in S:
            f=0
            break

    lastchar=mystr[-1]
    S+=[mystr]
if f==0:
    print("No")
else:
    print("Yes")


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i,N) for(int i=0;i<N;i+=1)
using namespace std;
int main() {
int A,B,C;
cin>>A>>B>>C;
int D;
D=min(B+C,min(A+B,A+C));
cout<<D<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
/*#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
Apparently, the tree supports the same operations as the set 
(at least I haven't any problems with them before), but also there are two new features — 
find_by_order() — The first returns an iterator to the k-th largest element (counting from zero)
order_of_key() — the number of items in a set that are strictly smaller than our item. 
https://codeforces.com/blog/entry/11080
using namespace __gnu_pbds; */
using namespace std;
#define test() int t;cin>>t;for(int test=1;test<=t;test++)
#define int long long
#define MOD 1000000007
#define pb push_back 
#define ins insert
#define fast(); ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ld long double
#define endl '\n'
int m(int a) {
    return ((a%MOD)+MOD)%MOD;
}
int p(int a, int b) {
    if (b==0) return (int)1;
    int x = p(a, b>>1);
    if (b & 1) return m(x*m(a*x));
    return m(x*x);
}
signed main(){
    fast();
    int a, b, n;
    cin >> a >> b >> n;
    int x = min(b-1, n);
    cout << floor(a*x/b)-a*floor(x/b) << endl;;
}

Measured memory_bytes: 3792
#include <bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < (n); i++)
using namespace std;
using ll = long long;
const ll INF = 1LL << 60;

int main(void) {
  int n;
  cin >> n;
  cout << n*n*n << '\n';
  return 0;
}

Measured memory_bytes: 3628
/***********************************************************
 *This code By @1353055672(Ligen)                          *
 *[Warning]You're not excepted to understand this code!    *
 *RP++                                                     *
 ***********************************************************/
//#pragma GCC optimize(3)
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>
#define ll long long
#define ull unsigned long long
#define mn 1000020
#define inf (ll)(1e18)
#define mod (int)(1e9+7)
#define FOR(a,b,c) for (register ll a=b;a<=c;a++)
#define FORD(a,b,c) for (register ll a=b;a>=c;a--)
using namespace std;
inline ll read(){
    ll x=0,f=1;
    char c=getchar();
    while (c<'0'||c>'9'){
        if (c=='-')f=-1;
        c=getchar();
    }
    while (c>='0'&&c<='9'){
        x=x*10+c-'0';
        c=getchar();
    }
    return x*f;
}
inline void writeln(ll a){
    if(a==0){puts("0");return;}
    if(a<0)putchar('-'),a=-a;
    char c1[120];
    int h=0;
    while(a)c1[++h]=a%10+'0',a/=10;
    FORD(i,h,1)putchar(c1[i]);putchar('\n');
    return;
}
inline ll Max(ll a,ll b){return (a>b)?a:b;}
inline ll Min(ll a,ll b){return (a<b)?a:b;}
inline ll Abs(ll x){return (x<0)?-x:x;}
inline void Swap(ll &x,ll &y){ll t=x;x=y;y=t;}
inline ll gcd(ll a,ll b){return a==0?b:gcd(b%a,a);}
//---------------------Head Files--------------------------//
int v[100020],a[520][100020];
int main(){
	ll n=read();
	if(1ll*floor(sqrt(1ll*8*n+1))*floor(sqrt(1ll*8*n+1))!=1ll*8*n+1)return puts("No"),0;
	ll k=(sqrt(8*n+1)+1)/2,num=0,bl=2ll*n/k,mx=0;
	puts("Yes");printf("%d\n",k);
	FOR(i,1,k){
//		printf("%d ",);
		num=0;
		FOR(j,1,i-1){
			FOR(kk,1,bl)if(v[a[j][kk]]<2){
				v[a[j][kk]]++;a[i][++num]=a[j][kk];break;
			}
			if(num>bl)break;
		}
		if(num<bl){FOR(j,num+1,bl)a[i][j]=++mx,v[mx]++;num=bl;}
		printf("%d ",num);
		FOR(j,1,num-1)printf("%d ",a[i][j]);printf("%d\n",a[i][num]);
	}
	return 0;
}


Measured memory_bytes: 175872
#include<bits/stdc++.h>
#define IL inline
#define _ 1000005
#define ll long long
using namespace std ;

IL int gi(){
	int data=0,fu=1; char ch=0;
	while(ch!='-'&&(ch<'0'||ch>'9'))ch=getchar(); if(ch=='-')fu=-1,ch=getchar();
	while('0'<=ch&&ch<='9')data=(data<<1)+(data<<3)+(ch^48),ch=getchar();return data*fu;
}

int n,m,pl,nl,ans[_<<2],val[_<<2],A[_],sum[_],Delta;
IL void Insert(int o,int l,int r,int ps,int v){
	if(l==r){val[o]+=v; ans[o]=val[o]>0; return; }
	int mid=(l+r)>>1;
	ps<=mid?Insert(o<<1,l,mid,ps,v):Insert(o<<1|1,mid+1,r,ps,v);
	ans[o]=ans[o<<1]+ans[o<<1|1];
}
int Query(int o,int l,int r,int ql,int qr){
	if(ql<=l&&r<=qr)return ans[o];
	int mid=(l+r)>>1,ret=0;
	if(ql<=mid)ret+=Query(o<<1,l,mid,ql,qr); if(qr>mid)ret+=Query(o<<1|1,mid+1,r,ql,qr);
	return ret;
}
IL void Modify(int x,int op){int k=sum[pl+x]+(op>0); sum[pl+x]+=op; Insert(1,1,nl,pl+x-k+1,op);}
IL int GetAns(){return n-Query(1,1,nl,pl+1,pl+n);}

int cnt[_];
IL int Ans(){
	for(int i=1;i<=n+m;++i)cnt[i]=sum[i]=0;
	for(int i=1;i<=n;++i)if(A[i]>0)cnt[A[i]]++;
	for(int i=1;i<=n+m;++i)
		if(cnt[i]&&i-cnt[i]+1<=n){
			int l=i-cnt[i]+1,r=i;
			l=max(l,1); r=min(r,n); if(l<=r)sum[l]++,sum[r+1]--;
		}
	for(int i=1;i<=n;++i)sum[i]+=sum[i-1];
	int ret=n;
	for(int i=1;i<=n;++i)ret-=sum[i]>0; return ret; 
}

int main(){
	n=gi(); m=gi(); pl=m; nl=m+n+m;
	for(int i=1;i<=n;++i)A[i]=gi(),Modify(A[i],1);
	
	int p,x;
	while(m--){
		p=gi(); x=gi();
		if(p>0)Modify(A[p]+Delta,-1),A[p]=x-Delta,Modify(A[p]+Delta,1);
		else if(x>0)--pl,++Delta;
		else ++pl,--Delta;
		printf("%d\n",GetAns()); continue;
	}
	

	/*
	int p,x;
	while(m--){
		p=gi(); x=gi();
		if(p>0)A[p]=x;
		else {
			for(int i=1;i<=n;++i)A[i]+=x;
		}
		printf("%d\n",Ans()); continue;
	}
	*/
	return 0;
}


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

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

constexpr int INF = 1e9;
constexpr ll INFLL = 1e18;

int main() {
    int N; cin >> N;
    vector<int> x(N), rx;
    for(int i = 1; i < N; ++i) {
        x[i] = 10 + x[i - 1];
    }
    rx = x;
    vector<int> d(N);
    for(int i = 0; i < N; ++i) {
        cin >> d[i];
    }
    for(int i = 0; i < N; ++i) {
        x[i] += d[i];
        rx[i] += d[N - i - 1];
    }

    bool ans = true;
    int last = 1;
    for(int i = 0; i < last; ++i) {
        last = min(N, max(last, x[i] / 10 + 1));
    }
    ans &= last == N;
    last = 1;
    for(int i = 0; i < last; ++i) {
        last = min(N, max(last, rx[i] / 10 + 1));
    }
    ans &= last == N;

    if(ans) {
        cout << "yes" << endl;
    } else {
        cout << "no" << endl;
    }
}


Measured memory_bytes: 6248
n = int(input())

multiple = [False] * 1_000_001
once = set()
twice = set()
count = 0

for a in sorted(map(int, input().split())):
  if a in once:
    if a in twice:
      continue
    else:
      count -= 1
      twice.add(a)
  elif multiple[a]:
    continue
  else:
    count += 1
    once.add(a)
    for x in range(a, 1_000_001, a):
      multiple[x] = True
print(count)

Measured memory_bytes: 39880
package main

import (
	"fmt"
	"sort"
)

func main() {
	var n int
	fmt.Scan(&n)
	vs := make([]int, n)
	for i := range vs {
		fmt.Scan(&vs[i])
	}

	sort.Ints(vs)
	sum := float64(vs[0])
	for i := 1; i < n; i++ {
		sum = (sum + float64(vs[i])) / 2
	}

	fmt.Println(sum)
}


Measured memory_bytes: 1836
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double a = sc.nextDouble();
		double b = sc.nextDouble();
		double C = Math.toRadians(sc.nextDouble());
		double S = (Math.sin(C) * a) * b/ 2;
		double L = a + b + Math.sqrt(a*a + b*b - 2*a*b*Math.cos(C));
		double h = b*Math.sin(C);
		System.out.println(S);
		System.out.println(L);
		System.out.println(h);
		sc.close();
	}
}



Measured memory_bytes: 28016
#include <cstdio>
#include <queue>

using namespace std;

int input[100005];

priority_queue<int> q;

int main(){
    //printf("%d",1000000000%13);
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        scanf("%d",&input[i]);
        q.push(input[i]);
    }
    while(q.size()>1){
        int now1=q.top();
        q.pop();
        int now2=q.top();
        int newnum=now1%now2;
        if(newnum!=0) q.push(newnum);
    }
    printf("%d",q.top());
    
    return 0;
}

Measured memory_bytes: 1148
using System;

namespace abca154
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split(' ');
            string a = str[0];
            string b = str[1];
            string[] abc = Console.ReadLine().Split(' ');
            int c=int.Parse(abc[0]);
            int d =int.Parse(abc[1]);
            string e = Console.ReadLine();
           
            if (e == a)
                Console.WriteLine("{0} {1}",c-1, d);
            if (e == b)
                Console.WriteLine("{0} {1}",c,d-1);
        }
    }
}


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

#define rep(i,n) for(ll i=0;i<n;i++)
#define REP(i,a,n) for(ll i=a;i<n;i++)

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

const int INF = 100000000;
const ll LINF = 1e18+5;

bool pairCompare(const pll& Fir, const pll& Sec)
{
    return Fir.second < Sec.second; // 2番目について昇順
}

int main() {
    ll N;
    cin >> N;
    vector<pll> X(N);
    rep(i,N) {
        ll x,l;
        cin >> x >> l;
        X[i] = make_pair(x-l,x+l);
    }
    sort(X.begin(), X.end(), pairCompare);
    ll t = X[0].second;
    ll ans = 1;
    REP(i,1,N){
        if(t <= X[i].first) {
            ans++;
            t = X[i].second;
        }
    }
    cout << ans << endl;
    return 0;
}

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

int main(){
  int n;
  cin >> n;
  set<int> s;

  rep(i,n) {
    int a;
    cin >> a; 
    auto itr = s.find(a);
    if (itr == s.end()) s.insert(a);
    else s.erase(a);
  }
  cout << s.size() << endl;
  return 0;
}

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


using namespace std;


const int MOD = 1e9 + 7;
const int N = 1e5;
const long long INF = 1e9;


int main() {
  	int n;
  	cin >> n;
  	int x = (n + 1) / 2;
  	cout << setprecision(10) << 1.0 * x / n;
}


Measured memory_bytes: 256
import sys
input=sys.stdin.readline
from bisect import bisect_left,insort_left
d=int(input())
c=list(map(int,input().split()))
s=[list(map(int,input().split()))for _ in range(d)]
t=[int(input())for _ in range(d)]
m=int(input())
dq=[list(map(int,input().split()))for _ in range(m)]
x=[[0]for _ in range(26)]
ans=0
for i in range(d):
  v=t[i]-1
  ans+=s[i][v]-c[v]*(i-x[v][-1]+1)*(i-x[v][-1])//2
  x[v].append(i+1)
for i in range(26):
  ans-=c[i]*(d+1-x[i][-1])*(d-x[i][-1])//2
  x[i].append(d+1)
for dd,q in dq:
  p=t[dd-1]
  t[dd-1]=q
  ans-=s[dd-1][p-1]
  ans+=s[dd-1][q-1]
  pi=bisect_left(x[p-1],dd)
  qi=bisect_left(x[q-1],dd)
  pl=dd-x[p-1][pi-1]
  pr=x[p-1][pi+1]-dd
  ql=dd-x[q-1][qi-1]
  qr=x[q-1][qi]-dd
  del x[p-1][pi]
  x[q-1].insert(qi,dd)
  ans-=c[p-1]*pl*pr
  ans+=c[q-1]*ql*qr
  print(ans)


Measured memory_bytes: 89868
#include <bits/stdc++.h>
using namespace std;
#define SZ(x) ((int)(x).size())

typedef	long long ll;

int main(void)
{
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	
	int target_green, target_red, green_cnt, red_cnt, spare_cnt;
	cin >> target_green >> target_red >> green_cnt >> red_cnt >> spare_cnt;

	vector<ll> green(green_cnt), red(red_cnt), spare(spare_cnt);

	for (auto &v : green) cin >> v;
	for (auto &v : red) cin >> v;
	for (auto &v : spare) cin >> v;
	sort(green.rbegin(), green.rend());
	sort(red.rbegin(), red.rend());
	sort(spare.rbegin(), spare.rend());

	vector<pair<ll, int> > apples;
	
	for (int i(0); i < target_green; ++i)
		apples.emplace_back(green[i], 0);
	for (int i(0); i < target_red; ++i)
		apples.emplace_back(red[i], 1);
	for (int i(0); i < spare_cnt; ++i)
		apples.emplace_back(spare[i], 2);

	sort(apples.begin(), apples.end());

	int spare_left(spare_cnt);
	int spare_needed(0);
	ll ans(0);
	for (auto v : apples)
	{
		ll taste = v.first;
		int type = v.second;
		if (type == 2)
		{
			if (spare_needed == spare_left)
			{
				ans += taste;
				spare_needed--;
			}
			spare_left--;
		}
		else
		{
			if (spare_needed == spare_left)
				ans += taste;
			else
				spare_needed++;
		}
	}
	cout << ans << endl;
}



Measured memory_bytes: 12780
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <cstring>
#include <set>
#include <utility>
#include <iostream>
#include <cassert>
#include <stack>
#define rep(i, a, b) for (int i = a; i <= b; ++i)
#define per(i, a, b) for (int i = a; i >= b; --i)
#define rvc(i, S) for (int i = 0; i < S.size(); ++i)
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define debug(...) fprintf(stderr,__VA_ARGS__)
using namespace std;

typedef long long LL;
typedef pair<int, int> pii;
typedef vector<int> VI;

int main(){
    int n,k;
    cin>>n>>k;
    puts(n/2+n%2 >=k? "YES":"NO");
    return 0;
}


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

using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
#define rep(i,n) for(ll i = 0;i < (ll)n;i++)
#define ALL(x) (x).begin(),(x).end()
#define MOD 1000000007



int main(){
  
  int a,b,c,d,k;
  cin >> a >> b >> c >> d >> k;
  a = a*60+b;
  c = c*60+d;
  cout << c-k-a << endl;
  

  






  return 0;
}


Measured memory_bytes: 3636