akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<list>
#include<set>
#include<map>
#include<utility>
#include<queue>
#include<cmath>
 
#define rep(i,x) for(int i=0;i<(int)(x);i++)
#define reps(i,x) for(int i=1;i<=(int)(x);i++)
#define rrep(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define rreps(i,x) for(int i=((int)(x));i>0;i--)
 
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define INF 2e9
#define MOD 1000000007
 
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
typedef long long ll;
typedef std::pair<ll, ll> P;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
 
 
using namespace std;
 
int main()
{
    ll n, k;
    cin >> n >> k;

    ll ans;
    if(k % 2 == 1){
        ll m = n/k;
        ans = pow(m, 3);
    }else{
        ll m = 0;
        ll a0 = 0;
        ll a1 = 0;
        reps(a, n){
            if(a % (k/2) == 0){
                if((a/(k/2))%2==0) a0++;
                else if ((a/(k/2))%2==1) a1++;  
            }
        }
        ans = pow(a0, 3) + pow(a1, 3);
    }
    cout << ans;
}

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

template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void POSS(T condition){ if(condition) cout << "POSSIBLE" << endl; else cout << "IMPOSSIBLE" << endl; }
template<class T> inline void Poss(T condition){ if(condition) cout << "Possible" << endl; else cout << "Impossible" << endl; }
template<class T> inline void First(T condition){ if(condition) cout << "First" << endl; else cout << "Second" << endl; }
int character_count(string text, char character){ int ans = 0; for(int i = 0; i < text.size(); i++){ ans += (text[i] == character); } return ans; }
long power(long base, long exponent, long module){ if(exponent % 2){ return power(base, exponent - 1, module) * base % module; }else if(exponent){ long root_ans = power(base, exponent / 2, module); return root_ans * root_ans % module; }else{ return 1; }}
struct position{ int y, x; }; position move_pattern[4] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}}; // double euclidean(position first, position second){ return sqrt((second.x - first.x) * (second.x - first.x) + (second.y - first.y) * (second.y - first.y)); }
template<class itr> void array_output(itr start, itr goal){ string ans; for(auto i = start; i != goal; i++){ ans += to_string(*i) + " "; } ans.pop_back(); cout << ans << endl; }
long gcd(long a, long b){ if(a && b){ return gcd(min(a, b), max(a, b) % min(a, b)); }else{ return a; }}
#define mod long(1e9 + 7)
#define all(x) (x).begin(), (x).end()
#define bitcount(n) __builtin_popcountl(long(n))

struct UnionFind
{
    vector< int > data;
    
    UnionFind(int sz)
    {
        data.assign(sz, -1);
    }
    
    bool unite(int x, int y)
    {
        x = find(x), y = find(y);
        if(x == y) return(false);
        if(data[x] > data[y]) swap(x, y);
        data[x] += data[y];
        data[y] = x;
        return(true);
    }
    
    int find(int k)
    {
        if(data[k] < 0) return(k);
        return(data[k] = find(data[k]));
    }
    
    int size(int k)
    {
        return(-data[find(k)]);
    }
};

int main(){
    int N, M;
    cin >> N >> M;
    int p[N];
    for(int i = 0; i < N; i++){
        cin >> p[i];
    }
    UnionFind uf(N);
    for(int j = 0; j < M; j++){
        int x, y;
        cin >> x >> y;
        uf.unite(x - 1, y - 1);
    }
    int ans = 0;
    for(int i = 0; i < N; i++){
        ans += (uf.find(i) == uf.find(p[i] - 1));
    }
    cout << ans << endl;
}



Measured memory_bytes: 1024
#include <iostream>
#define INF ((1 << 30) - 1)
using namespace std;
typedef long long Int;

Int n, k, h[110000], dp[110000];

int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> h[i];

  for (int i = 1; i < n; i++) dp[i] = INF;
  dp[0] = 0;

  for (int i = 0; i < n; i++) {
    for (int j = 1; j <= k; j++) {
      dp[i + j] = min(dp[i + j], dp[i] + abs(h[i] - h[i + j]));
    }
  }
  cout << dp[n - 1] << endl;
  return 0;
}

Measured memory_bytes: 5196
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin >> n;
	vector<int> l(2*n);
	for (int i=0; i<2*n; i++)
	{
		cin >> l[i];
	}
	sort(l.begin(), l.end());
	int ans=0;
	for (int i=0; i<2*n; i+=2)
	{
		ans+=min(l[i], l[i+1]);
	}
	cout<< ans << endl;
	return 0;
}

Measured memory_bytes: 256
while True:
  c = int(input())
  if c == 0:
    break
  else:
    for t in range(c):
     s = map(int,raw_input().split())
     pm,pe,pj = s[0],s[1],s[2]
     if pm == 100 or pe == 100 or pj == 100 or (pm+pe)/2 >= 90 or (pm+pe+pj)/3 >= 80:
       print "A"
     elif (pm+pe+pj)/3 >= 70:
       print "B"
     elif (pm+pe+pj)/3 >= 50 and pm >= 80 or pe >= 80:
       print "B"
     else:
       print "C"

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

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

using namespace std;

int main(void){
  int n;
  string s;
  cin >> n >> s;
  for(int i = 0; i < s.size(); i++){
    char t = char(s[i] + n);
    if(t > 'Z'){
      s[i] = t - 'Z' + 'A' - 1;
    }else{
      s[i] = t;
    }
  }

  cout << s << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define mod 1000000007
#define pb push_back
#define ll long long
#define mp make_pair
using namespace std;
ll ku[214514];
ll l,n;
ll ksum(ll st, ll en){
	if(st>=n)return 0;
	if(en<0)return 0;
	if(en<st)return 0;
	if(st==0)return ku[en];
	return ku[en]-ku[st-1];
}
int main(){
	vector<ll> x;
	cin>>l>>n;
	for(ll i=0;i<n;i++){
		ll tmp;
		cin>>tmp;
		x.pb(tmp);
		if(i==0)ku[0]=x[0];
		else ku[i]=ku[i-1]+x[i];
	}
	ll ans = 0;
	for(ll i=0;i<n;i++){
		ll cur=0;
		ll cn = min(i, n-1-i);
		cur += l-x[i];
		cur += 2 * ksum(max(i-cn-1,(ll)0), i-1);
		cur += 2 * (cn*l - ksum(i+1,i+cn));
		if(cur>ans){ans=cur;}
		//cout<<i<<1<<cur<<endl;
		cur=0;
		cur += x[i];
		cur += 2 * ksum(i-cn, i-1);
		cur += 2 * ((l*(min(i+cn+1,n-1)-i)) - ksum(i+1,min(i+cn+1,n-1)));
		if(cur>ans){ans=cur;}
		//cout<<i<<2<<cur<<endl;
		cur=0;
		cur += max(x[i], l-x[i]);
		cur += 2 * ksum(i-cn, i-1);
		cur += 2 * (cn*l - ksum(i+1,i+cn));
		//cout<<i<<3<<cur<<endl;
		if(cur>ans){ans=cur;}
	}
	cout<<ans<<endl;
	return 0;
}

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

void MaxHeapify(vector<int> &A, int i)
{
    int H = A.size() - 1;
    int left = i * 2;
    int right = i * 2 + 1;

    int largest;
    if (left <= H && A[left] > A[i])
    {
        largest = left;
    }
    else
    {
        largest = i;
    }

    if (right <= H && A[right] > A[largest])
    {
        largest = right;
    }

    if (largest != i)
    {
        swap(A[i], A[largest]);
        MaxHeapify(A, largest);
    }
}

void BuildMaxHeap(vector<int> &A, int i)
{
    for (int j = (A.size() - 1) / 2; j > 0; j--)
    {
        MaxHeapify(A, j);
    }
}

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

    vector<int> A(H + 1);
    for (int i = 1; i <= H; i++)
    {
        cin >> A[i];
    }

    BuildMaxHeap(A, H);

    for (int i = 1; i <= H; i++)
    {
        cout << " " << A[i];
    }
    cout << endl;

    return 0;
}


Measured memory_bytes: 4592
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#define max(a, b)	(((a) > (b)) ? (a) : (b))		/* ２個の値の最大値 */
#define min(a, b)	(((a) < (b)) ? (a) : (b))		/* ２個の値の最小値 */
#define ENTER		printf("\n")					/* 改行プリント */
/********************************************************************************************************************************/
/* main *************************************************************************************************************************/
/********************************************************************************************************************************/
int DEBUG = 1;										/* デバッグプリント 提出時は0 */

char	s[100001];
int main()
{
	int		i,n,ans = 0;

	
	scanf("%d", &n);
	scanf("%s", s);

	for(i=0;i<n-1;i++) {
		if (s[i]!=s[i+1]) {
			ans++;
			i++;
		}
	}

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


	return 0;
}



Measured memory_bytes: 2108
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
  do {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
  } while (false);
  int n;
  cin >> n;
  vector<int> a(n), b(n), vec;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
    vec.push_back(a[i]);
    vec.push_back(b[i]);
  }
  sort(vec.begin(), vec.end());
  ll A = 0, B = 0, sum = 0;
  for (int i = 0; i < n; i++) {
    A += a[i];
    B += b[i];
    sum += vec[i];
  }
  ll ans = min(A, B);
  for (int i = 0; i < n; i++) {
    int x = n - 1;
    ll val = sum;
    if (a[i] < b[i]) {
      swap(a[i], b[i]);
    }
    if (a[i] > vec[x]) {
      val += a[i] - vec[x--];
    }
    if (b[i] > vec[x]) {
      val += b[i] - vec[x--];
    }
    ans = min(ans, val);
  }
  cout << ans << endl;
  return 0;
}


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

int main(){
	while(1){
		int a,b;
		char op;
		cin >> a >> op >> b;
		switch(op){
			case '+':
				cout << a+b << endl;
				break;
			case '-':
				cout << a-b << endl;
				break;
			case '*':
				cout << a*b << endl;
				break;
			case '/':
				cout << a/b << endl;
				break;
			default:
				break;
		}
		if(op=='?')
			break;
	}
	return 0;
}

Measured memory_bytes: 3076
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(void){
    int n,m; cin >> n >> m;
    for(int k=m/n; k>=1; k--){
        if(m%k==0){
            cout << k << endl;
            return 0;
        }
    }
    
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main() {
	int N;
	cin >> N;
	vector<int> a(N),b(N),c(N);
	vector<int> A(N + 1 , 0), B(N + 1 , 0), C(N + 1 , 0);
	for (int i = 0; i < N; i++) {
		cin >> a.at(i) >> b.at(i) >> c.at(i);
	}
	for (int i = 0; i < N; i++) {
		A[i + 1] = max(B[i] + a[i], C[i] + a[i]);
		B[i + 1] = max(A[i] + b[i], C[i] + b[i]);
		C[i + 1] = max(B[i] + c[i], A[i] + c[i]);
	}
	cout << max(A[N], max(B[N], C[N])) << endl;
	return 0;
}


Measured memory_bytes: 2560
mat = []
for _ in range(3):
    mat.append(list(map(int, input().split())))
for a0 in range(mat[0][0]+1):
    b0 = mat[0][0] - a0
    b1 = mat[0][1] - a0
    b2 = mat[0][2] - a0
    a1 = mat[1][0] - b0
    a2 = mat[2][0] - b0
    if a1 + b1 == mat[1][1] and a1 + b2 == mat[1][2] \
        and a2 + b1 == mat[2][1] and a2 + b2 == mat[2][2]:
        print('Yes')
        break
else:
    print('No')

Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <string>

int sumketa(int n){
	int sum = 0;
	while (n != 0) {
		sum = sum + n % 10;
		n = n/10;
	}
	return sum;
}

int main(int argc, char const *argv[]) {
	int n,a,b;
	std::cin >> n >> a >> b;
	int count = 0;
	for (int i = 0; i <= n; i++) {
		if (a <= sumketa(i) && sumketa(i) <= b) {
			count += i;
		}
	}

	std::cout << count << '\n';
	return 0;
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

func main() {
	a := nextString()
	b := nextString()

	if a == b {
		fmt.Println("H")
	} else {
		fmt.Println("D")
	}
}

// Input. ----------

var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Buffer([]byte{}, math.MaxInt64)
	sc.Split(bufio.ScanWords)
}

func nextInt() int {
	sc.Scan()
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}

	return i
}

func nextString() string {
	sc.Scan()
	if err := sc.Err(); err != nil {
		panic(err)
	}

	return sc.Text()
}

// ---------- Input.

// Util. ----------

func min(x, y int) int {
	if x < y {
		return x
	}

	return y
}

// ---------- Util.


Measured memory_bytes: 640
#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 reps(i,a,b) for(int i= a; i < b; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int n, m;
vector<pair<int, int>> vec;

bool check(int num) {
  stringstream stm;
  stm << num;
  string nt = stm.str();
  if (nt.size() != n) return false;
  bool ok  = true;
  rep(i, m) {
    if (nt[vec[i].first-1] != vec[i].second + '0') {
      ok = false;
    }
  }
  return ok;
}

int main() {

  cin >> n >> m;
  rep(i, m) {
    int s, c;
    cin >> s >> c;
    vec.push_back(make_pair(s, c));
  }
  int ans = -1;
  rep(i, 1000) {
    if (check(i)) {
      cout << i << endl;
      return 0;
    }
  }

  cout << ans << endl;
  return 0;
}
// int main()
// {
//   int n, m;
//   cin >> n >> m;
//   vector<int> vec(n+1, 0);
//   rep(i, m) {
//     int s, c;
//     cin >> s >> c;
//     if (vec[s] != 0) {
//       if (vec[s] != c) {
//         cout << -1 << endl;
//         return 0;
//       }
//     } else {
//       vec[s] = c;
//     }    
//   }
//   ll ans = 0;
//   reps(i, 1, n+1) {
//     if (i == 0) break;

//     if (vec[i] == 0 && i == n) {
//       if (n > 1) {
//         cout << -1 << endl;
//         return 0;
//       } else {
//         cout << 0 << endl;
//         return 0;
//       }
//     } else {
//       ans += vec[i] * pow(10, n-i);
//     }
//   }
//   cout << ans << endl;
  
//   return 0;
// }

Measured memory_bytes: 3636
#include<iostream>

using namespace std;

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

	if (S[0] == 'Y' && S[1] == 'A' && S[2] == 'K' && S[3] == 'I') {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}

Measured memory_bytes: 256
;; -*- coding: utf-8 -*-
(eval-when (:compile-toplevel :load-toplevel :execute)
  (defparameter OPT
    #+swank '(optimize (speed 3) (safety 2))
    #-swank '(optimize (speed 3) (safety 0) (debug 0)))
  #+swank (progn (ql:quickload '(:cl-debug-print :fiveam))
                 (shadow :run)
                 (use-package :fiveam)))
#+swank (cl-syntax:use-syntax cl-debug-print:debug-print-syntax)

;; BEGIN_INSERTED_CONTENTS
(defmacro dbg (&rest forms)
  #+swank
  (if (= (length forms) 1)
      `(format *error-output* "~A => ~A~%" ',(car forms) ,(car forms))
      `(format *error-output* "~A => ~A~%" ',forms `(,,@forms)))
  #-swank (declare (ignore forms)))

(defmacro define-int-types (&rest bits)
  `(progn
     ,@(mapcar (lambda (b) `(deftype ,(intern (format nil "UINT~A" b)) () '(unsigned-byte ,b))) bits)
     ,@(mapcar (lambda (b) `(deftype ,(intern (format nil "INT~A" b)) () '(signed-byte ,b))) bits)))
(define-int-types 2 4 7 8 15 16 31 32 62 63 64)

(declaim (inline println))
(defun println (obj &optional (stream *standard-output*))
  (let ((*read-default-float-format* 'double-float))
    (prog1 (princ obj stream) (terpri stream))))

(defconstant +mod+ 1000000007)

;; Body

(defun main ()
  (let* ((n (read))
         (x (read))
         (y (read)))
    (dotimes (i (- n 1))
      (let* ((taka (read))
             (aoki (read))
             (k (max (ceiling x taka) (ceiling y aoki))))
        (setf x (* taka k)
              y (* aoki k))))
    (println (+ x y))))

#-swank(main)


Measured memory_bytes: 18404
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
typedef long long ll;
typedef pair<int, int> pii;
int main() {
    int n, k; cin >> n >> k;
    int count = 0;
    rep(i, n){
        int a; cin >> a;
        if(a >= k) count++;
    }
    cout << count << endl;
    return 0;
}


Measured memory_bytes: 3644
import java.util.Scanner;
public class Main{
	static char map[][]=new char[20][20];
	static int ans; 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(true){
			int w=sc.nextInt();
			int h=sc.nextInt();
			int x=0,y=0;
			ans=0;
			if(w==0&&h==0)break;
			for(int i=0;i<h;i++){
				String str=sc.next();
				for(int j=0;j<w;j++){
					map[i][j]=str.charAt(j);
					if(map[i][j]=='@'){
						x=j;y=i;
					}
				}
			}
			dfs(x, y, w, h);
			System.out.println(ans);
		}
	}
	
	public static void dfs(int x,int y,int w, int h){
		int x_m[]={1,0,-1,0};
		int y_m[]={0,1,0,-1};
		ans++;
		for(int i=0;i<4;i++){
			int nx=x+x_m[i];
			int ny=y+y_m[i];
			map[y][x]='#';
			if(0<=nx&&0<=ny&&nx<w&&ny<h&&map[ny][nx]=='.'){
				dfs(nx, ny, w, h);
			}
		}
		
	}
}

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

int main()
{
    char arr[3];
    int i = 0;

    for (i = 0; i < 3; i++)
    {
        cin >> arr[i];
    }

    if(arr[0] == arr[1] && arr[1] == arr[2])
        cout << "No";
    else
        cout << "Yes";

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#pragma gcc optimize("ofast")
using namespace std;

#define ll long long
#define ull unsigned long long
#define ui unsigned int
#define mod 1000000007
#define us unsigned short
#define IOS ios_base::sync_with_stdio(0);
#define INF LONG_MAX
#define PI 3.1415926535897932384626
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define rep(x,j,n)for(int x=j;x<n;x++)
typedef vector<pair<ll,ll>> vpi;
typedef vector<ll> vi;
typedef vector<vi> vvi;

ll modexp(ll a,ll b,ll m)
{
	ll r=1;
	a=a%m;
	while(b>0)
	{
	if(b&1)
		r=(r*a)%m;
	b=b/2;
	a=(a*a)%m;
	}
	return r%m;
}

ll n;
vi arr;
vvi g;
vi ans;

void mbfs(const vi &start , const vi &end)
{
    vi d(n,INF);
    queue<ll>q;
    for(auto v: start)
    {
        d[v] = 0;
        q.push(v);
    }
    while(!q.empty())
    {
        ll v = q.front();
        q.pop();

    }
}

int main() {
    ll n; cin>>n;
    vector<string>arr(n);
    vi brr(n);
    string s;
    rep(i,0,n)cin>>arr[i]>>brr[i];
    cin>>s;
    ll ans = 0,flag = 0;
    rep(i,0,n)
    {
        if(flag)ans+=brr[i];
        else
        {
            if(s==arr[i])flag = 1;
        }
    }
    cout<<ans<<endl;
   return 0;
}
/*
7
1 2 3 5 4 6 7
*/


Measured memory_bytes: 256
import java.util.Scanner;

class Main {
	public static void bubble(int[] A) {
		int N = A.length;
        for(int k=0;k<N;k++) {
            System.out.print(String.format("%d%s", A[k], (k==N-1 ? "" : " ")));
        }
		System.out.println("");
		for(int i=1;i<N;i++) {
			int v = A[i];
			int j = i - 1;
			while (j >= 0 && A[j] > v) {
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			for(int k=0;k<N;k++) {
				System.out.print(String.format("%d%s", A[k], (k==N-1 ? "" : " ")));
			}
			System.out.println("");
		}
	}
	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int A[] = new int[n];
		in.nextLine();
		String[] A_str = in.nextLine().split(" ");
		for(int i=0;i<n;i++) A[i] = Integer.parseInt(A_str[i]);

		bubble(A);
	}
}

Measured memory_bytes: 57052
#include <iostream>
#include <fstream>
#include <string> 
#include <cmath>  
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <functional>

using namespace std;
using ll = long long;

#define FOR(i, m, n) for(int i = (m);i < (n);i++)
#define REP(i,n) for(int i = 0; i < int(n); i++)
#define VI vector<int>
#define VVI vector<vector<int>>
#define VVVI vector<vector<vector<int>>>
#define VL vector<ll>
#define PAIR pair<int,int>
#define MP make_pair
#define VP vector<pair<int,int>>
#define VS vector<string>
#define PQUE priority_queue<int> //5,5,4,3,3,2,...
#define REPQUE priority_queue<int, vector<int>, greater<int>> //1,1,2,3,4,4,5,...
#define SUM(obj) accumulate((obj).begin(), (obj).end(), 0)
#define SORT(obj) sort((obj).begin(), (obj).end()) // 1,2,3,4,5...
#define RESORT(obj) sort((obj).begin(), (obj).end(), greater<int>()) // 5,4,3,2,1...
#define UB(obj,n) upper_bound((obj).begin(), (obj).end(), n) //itr > n
#define LB(obj,n) lower_bound((obj).begin(), (obj).end(), n) //itr>= n

const ll MOD = (ll)1e9 + 7;

int main() {
	string S;
	cin >> S;
	vector<bool> e(26,false);
	REP(i, S.size()) e[S[i] - 'a'] = true;
	REP(i, 26) {
		if (!e[i]) {
			cout << (char)('a' + i) << endl;
			return 0;
		}
	}
	cout << "None" << endl;

	return 0;
}

Measured memory_bytes: 512
# A=gets.to_i
# B=gets.split.map(&:to_i)
# C=N.times.map{gets.to_i}
# D=N.times.map{gets.split.map(&:to_i)}
# S=gets.chomp
# MOD=1000000007


K,X=gets.split.map(&:to_i)

min=[X-K+1,-1000000].max
max=[X+K-1,1000000].min

puts (min..max).to_a.join(" ")

Measured memory_bytes: 1788
#include<stdio.h>
#include<string.h>
int main(){
	int h,i;
	char buf[1001];
	scanf("%s",buf);
	h=strlen(buf);
	for(i=0;i<h;i++){
		if(buf[i]>'C')buf[i]-=3;		
		else buf[i]=buf[i]-'A'+'X';
	}
	printf("%s\n",buf);
	return 0;
}

Measured memory_bytes: 0
#include<algorithm>
#include<cstdio>
#include<vector>
using u32 = unsigned int;
constexpr u32 DEF = 2147483647;

class segtree {
	::std::vector<u32> tree;
public:
	explicit segtree(const u32 size) :tree(size << 1, DEF) {}
	u32 fold(u32 first, u32 last)const {
		u32 ret = DEF;
		first += tree.size() >> 1;
		last += tree.size() >> 1;
		while (first < last) {
			if (first & 1) ret = ::std::min(ret, tree[first++]);
			if (last & 1) ret = ::std::min(ret, tree[--last]);
			first >>= 1;
			last >>= 1;
		}
		return ret;
	}
	void set(u32 index, const u32 value) {
		index += tree.size() >> 1;
		tree[index] = value;
		while (index >>= 1)
			tree[index] = ::std::min(tree[index << 1], tree[index << 1 | 1]);
	}
};

void scan(u32 &d) {
	d = 0;
	int c;
	while (c = fgetc(stdin), c == '\n' || c == ' ');
	do d = d * 10 + c - '0'; while (c = fgetc(stdin), c != '\n'&&c != ' ');
}

int main() {
	u32 n, q;
	scan(n);
	scan(q);

	segtree seg(n);

	u32 c, x, y;
	while (q--) {
		scan(c);
		scan(x);
		scan(y);

		if (c)
			printf("%u\n", seg.fold(x, y + 1));
		else
			seg.set(x, y);
	}

	return 0;
}



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

int main() {
  string s,t;
  cin >>s>>t;
  
  for(int i=0; i<s.size(); i++){
    if(s[i]!=t[i]){
      cout <<"No"<<endl;
      return 0;
    }
  }
  cout << "Yes"<<endl;
  return 0;
  
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,b,c,d;
  cin>>a>>b>>c>>d;
  if(a+b > c+d){
  cout<<"Left";
  }
  else if(a+b < c+d){
  cout<<"Right";
  }
  else{
  cout<<"Balanced";
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#include "string"
#define endl '\n'
#define PI pair<int,int>
#define ff first
#define ss second
#define int long long 
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL)


int32_t main() { 
	boost;
	
	int n,k;
	cin>>k>>n;
	int a[n+1];
	for(int i=0;i<n;i++)
		cin>>a[i];
	int ans = 0,mx=a[0]+k-a[n-1];
	for(int i=1;i<n;i++){
		ans+=(a[i]-a[i-1]);
		mx=max(mx,a[i]-a[i-1]);
	}
	if(mx != a[0]+k-a[n-1])
		ans+=a[0]+k-a[n-1]-mx;
	cout<<ans<<endl;
}		     

Measured memory_bytes: 1792
#include <atcoder/math>
#include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()
#ifdef _DEBUG_
  #define debug(...) printf(__VA_ARGS__)
#else
  #define debug(...) (void)0
#endif
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
typedef vector<int> VI;

constexpr ll INF = 1e18;

vector<ll> fac;
ll solve(int n, ll x, ll y) {
  if (n == SZ(fac)) {
    if (x == 1)
      return y - 1;
    if (y == 1)
      return x;
    auto r = atcoder::crt({1ll, 0ll}, {x, y});
    debug("%lld %lld -- %lld, %lld\n", x, y, r.F, r.S);
    return r.F - 1;
  }
  return min(solve(n + 1, x * fac[n], y), solve(n + 1, x, y * fac[n]));
}

int main() {
  ll N;
  cin >> N;
  N *= 2;
  for (ll i = 2; i * i <= N; i++) {
    ll val = 1;
    while (N % i == 0) {
      val *= i;
      N /= i;
    }
    if (val > 1)
      fac.PB(val);
  }
  if (N > 1)
    fac.PB(N);
  ll ans = solve(0, 1, 1);
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3616
N,K=map(int, input().split())
p = list(map(int, input().split()))

p = [(n+1)/2 for n in p]
import numpy as np
s = np.cumsum(p)

e=s[K-1]
max_e=e
for i in range(0,N-K):
  e=s[i+K]-s[i]
  max_e = max(max_e, e)
    
print(max_e)

Measured memory_bytes: 24812
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
using namespace std;
const int maxn = 55;
ll total[maxn], pattys[maxn];
ll n, x;

ll solve(ll l, ll level) {
    if(level == 0) return 1LL;

    ll fl = l + 1;
    ll fr = l + total[level-1];
    ll sl = l + total[level-1] + 2;
    ll sr = l + total[level-1] + 1 + total[level-1];

    if(x >= fl && x <= fr) return solve(l+1, level-1);
    else if(x >= sl && x <= sr) return pattys[level-1] + 1 + solve(sl, level-1);

    if(x == l) return 0LL;
    else if(x == fr + 1) return pattys[level-1] + 1LL;
    else if(x == sr + 1) return pattys[level];
}

int main() {
    cin>>n>>x;
    total[0] = pattys[0] = 1LL;
    for(int i=1;i<=n;i++) {
        total[i] = 3LL + 2LL * total[i-1];
        pattys[i] = 2LL * pattys[i-1] + 1LL;
    }
    cout<<solve(1, n)<<"\n";
    return 0;
}

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


//bは大きい順
bool f(vector<int> &b, int n, int num, int begin, int end) {
	//cout << "  " << n << " " << num << " (" << begin << " - " << end << ")" << endl;
	if (begin == end) {
		b[begin] = num;
		return false;
	}
	int centerIdx = (begin + end) / 2;
	if (b[centerIdx] >= num) {//centerIdxの位置はnum以上
		//centerIdxより左には存在しない
		return f(b, n, num, centerIdx + 1, end);
	}
	//それ以外のとき、左に存在する
	/*
	if (b[centerIdx + 1] < num) {//右に存在すると分かったとき、その左端における場合
		b[centerIdx + 1] = num;
		return true;
	}
	*/
	return f(b, n, num, begin, centerIdx);
}

int main() {
	int n; cin >> n;
	vector<int> a(n);
	vector<int> b(n);
	
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		b[i] = -1;
	}
	int color = 1;
	b[0] = a[0];
	for (int i = 1; i < n; i++) {
		/*
		cout << "(";
		for (int j = 0; j < color; j++) {
			if (j != 0) cout << " ";
			cout << b[j];
		}
		cout << ")" << endl;
		*/
		if (b[color - 1] >= a[i]) {
			b[color++] = a[i];
			continue;
		}
		f(b, color, a[i], 0, color);
	}
	cout << color << endl;

	
}

Measured memory_bytes: 1152
n = gets.to_i
hs = gets.split(" ").map(&:to_i)

$count = 0

def foo(array)
  return if array.empty? || array.all?{|a| a == 0}
  tmp_array = Array.new([])
  i = 0
  array.each do |a|
    if a == 0
      i += 1
    else
      tmp_array[i] ||= []
      tmp_array[i] << a
    end
  end
  tmp_array.compact!
  $count += tmp_array.size
  tmp_array.each do |t|
    tmp = t.map{|e2| e2 - 1}
    foo(tmp)
  end
end

foo(hs)
puts $count

Measured memory_bytes: 4092
#include <iostream>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
int a[210];

int main(){
    int n;
    cin >> n;
    int ans = 0;

    rep(i, n){
        cin >> a[i];
    }

    while(true){
        bool exist_odd = false;
        rep(i, n) {
            if(a[i] % 2 != 0) exist_odd = true;
        }
        if(exist_odd) break;

        rep(i, n) a[i] = a[i] / 2;
        ans++;

    }
    cout << ans << endl;
    
}

Measured memory_bytes: 256
import math


class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  # 10
    """
    def __init__(self, n_max, mod=998244353):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        if n < r:
            return 0
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        # 階乗のリストと階乗のmod逆元のリストを返す O(n)
        # self.make_modinv_list()が先に実行されている必要がある
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        # 0からnまでのmod逆元のリストを返す O(n)
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
        return modinv


def main():
    N, M, K = map(int, input().split())
    MOD = 998244353
    ans = 0
    comb = Combination(10**6)
    for k in range(K+1):
        tmp = M * pow(M-1,N-(k+1),MOD)
        tmp %= MOD
        ans += tmp * comb(N-1,k)
        ans %= MOD
    print(ans)


if __name__ == "__main__":
    main()

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

int main()
{
	int N;
	cin >> N;
	bool ans = false;
	for(int i = 0; i < N; i++) {
		char c; cin >> c; if(c == 'Y') ans = true;
	}
	if(ans) {
		cout << "Four" << endl;
	} else {
		cout << "Three" << endl;
	}
	return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

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

            string input;

            while (!string.IsNullOrEmpty(input = Console.ReadLine()))
            {
                int[] temp = Array.ConvertAll(input.Split(','), int.Parse);
                table.Add(temp);
            }

            int m = table.Count / 2;

            for (int i = 1; i <= m; i++)
            {
                table[i][0] += table[i - 1][0];
                table[i][table[i].Length - 1] += table[i - 1][table[i].Length - 2];

                for (int j = 1; j < table[i].Length - 1; j++)
                {
                    int a = table[i][j] + table[i - 1][j - 1];
                    int b = table[i][j] + table[i - 1][j];
                    table[i][j] = Math.Max(a, b);
                }
            }

            for (int i = table.Count - 2; i >= m; i--)
            {
                table[i][0] += table[i + 1][0];
                table[i][table[i].Length - 1] += table[i + 1][table[i].Length - 2];

                for (int j = 1; j < table[i].Length - 1; j++)
                {
                    int a = table[i][j] + table[i + 1][j - 1];
                    int b = table[i][j] + table[i + 1][j];
                    table[i][j] = Math.Max(a, b);
                }
            }
            Console.WriteLine(table[m].Max());
        }
    }
}

Measured memory_bytes: 9552
import java.util.Scanner;

public class Main {
    public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        try{
            int r = scanner.nextInt();
            int d = scanner.nextInt();
            int x = scanner.nextInt();
            int xN = x;
            for(int i=0;i<10;i++){
                xN =r*xN -d ;
                System.out.println(xN);
            }
        }catch(Exception e){
            System.out.println(e.getMessage());
        }finally{
            scanner.close();
        }
    }
}


Measured memory_bytes: 20688
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>
#include <tuple>


using namespace std;

int main(){

	long N, T, A;
	long ans;
	double ansT;

	ans = -1;
	ansT = 10000;

	cin >> N;

	cin >> T >> A;

	double H[N];

	for(long i = 0; i<N; i++){
		cin >> H[i];
		double x =  abs(A - (T - H[i] * 0.006));
		if(x < ansT){
			ansT = x;
			ans = i+1;
		}
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
import java.util.*;
import static java.lang.Math.*;
import java.math.BigInteger;

public class Main {

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		String n = sc.next();
		
		// 計算
		
		// 出力
		for(int i = 0; i < n.length(); i++){
		    if(n.charAt(i) == '1' ) System.out.print(9);
		    if(n.charAt(i) == '9' ) System.out.print(1);
		}
		
		
	}
}

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

int main(){
    int a, b;

    while(cin >> a >> b, a != 0){
        for(int y = 0; y < a; y++){
            for(int x = 0; x < b; x++){
                if(y == 0 || y == a - 1){
                    cout << '#';
                    continue;
                }
                if(x == 0 || x == b - 1)
                    cout << '#';
                else
                    cout << '.';
            }
            cout << endl;
        }
        cout << endl;
    }
    return 0;
}


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

#define vi vector<int>
#define vl vector<long>
#define vvi vector<vector<int>>
#define vvl vector<vector<long>>
#define pint pair<int, int>
#define plong pair<long, long>

int N, M;
string S;

int main() {
    cin>>N>>M>>S;
    int count = 0, pos = N;
    vi ans = {};
    while(pos > 0){
        int i = M;
        if(pos-i < 0){
            i = pos;
            pos = 0;
            ans.push_back(i);        
            count++;
            break;
        }else{
            while(S[pos - i] !='0'){
                i--;
                if(i==0){
                    cout << -1 << endl;
                    return 0;
                }
            }
            pos -= i;
            ans.push_back(i);
            count++;
        }
    }
    reverse(ans.begin(), ans.end());
    //cout << count << endl;
    REP(i, 0, count){
        cout << ans[i] << " ";
    }
    cout << endl;
}

Measured memory_bytes: 1144
n,m=map(int,input().split())
x=list(map(int,input().split()))
x.sort()
y=[]
for i in range(len(x)-1):
  y+=[x[i+1]-x[i]]
y.sort()
if n>=m:
  print(0)
else:
  print(sum(y[:m-n]))

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

int main() {
  int n;
  cin >> n;
  vector<double> p(n), dp(n + 1);
  for (int i = 0; i < n; i++) cin >> p.at(i);
  dp.at(0) = 1.0;
  for (int i = 0; i < n; i++) {
    for (int j = i; j >= 0; j--) {
      dp.at(j + 1) += p.at(i) * dp.at(j);
      dp.at(j) -= p.at(i) * dp.at(j);
    }
  }
  double ans = 0.0;
  for (int i = (n + 1) / 2; i <= n; i++) ans += dp.at(i);
  cout << setprecision(17) << ans << endl;
}


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

int main() {
  int N, K, Q = 0;
  cin >> N >> K >> Q;
  vector<int> game(Q);
  vector<int> player(N);
  vector<string> output(N);
  for(int i = 0; i < Q; i++) {
    cin >> game.at(i);
  }
  for(int i = 0; i < Q; i++) {
    player.at(game.at(i)-1) = player.at(game.at(i)-1) + 1;
  }
  for(int i = 0; i < N; i++) {
    player.at(i) = player.at(i) - (Q - K);
  }
  for(int i = 0; i < N; i++) {
    if(player.at(i) > 0) {
      output.at(i) = "Yes";
    }
    else if(player.at(i) <= 0) {
      output.at(i) = "No";
    }
  }
  for(int i = 0; i < N; i++) {
    cout << output.at(i) << endl;
  }
}


Measured memory_bytes: 6912
from bisect import bisect_right

n = int(input())
a = [-int(input()) for _ in range(n)]

li = list()
for e in a:
    i = bisect_right(li, e)
    if i == len(li):
        li.append(e)
    else:
        li[i] = e

ans = len(li)
print(ans)


Measured memory_bytes: 7836
#include<iostream>
#include<climits>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<stdio.h>
#include <string>
#include <complex>
#include <functional>
using namespace std;
//typedef pair<string,string> P;
//double dat[100][100];
//int dp[6][1010];//動的計画法
//int prime[10000001];
//char str[1010][1010];
//vector<pair<int,int> > pc[100001];
//int ABS(int a){return max(a,-a);}
long long num[100000];
int main(){
	int ans=0;
	int n;
	cin>>n;
	int s[n];
	for(int i=0;i<n;i++){
		cin>>s[i];
		ans+=s[i];
	}
	int tmp=n;
		if(ans%10){ cout<<ans<<endl;
			return 0;
		}
		else{
			sort(s,s+n);
			for(int i=0;i<n;i++){
				if(s[i]%10!=0){
					ans-=s[i];
					cout<<ans<<endl;
					return 0;
				}
			}
		}
		cout<<0<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int N;
  int K;
  cin>>N>>K;
  int V[N];
  for(int i = 0;i<N;i++)
  {
    cin>>V[i];
  }
  for(int i = K;i<N;i++)
  {
    if(V[i] > V[i-K]) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
  }


}


Measured memory_bytes: 4328
#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 n;
  cin >> n;
  vector<int> is(1000010,0);
  vector<int> v(n);
  rep(i,n)cin >> v[i],is[v[i]]++;
  ll res = 0;
  rep(i,n){
    bool ok = (is[1] < 1 && is[v[i]] <= 1) || (v[i] == 1 && is[1] <= 1);
    for(ll j = 2;j*j <= v[i];j++){
      if((v[i]%j) != 0)continue;
      if(is[j] >= 1 || is[v[i]/j] >= 1){
        ok = false;
        break;
      }
    }
    if(ok)res++;
  }
  cout << res << endl;

  




  return 0;
}

Measured memory_bytes: 7976
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <stdio.h>
#include <tuple>
#include <bitset>
#include <cfloat>
#include <fstream>
#include <limits.h>
#include <list>
#include <math.h>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <numeric>
#include <utility>
#include <sstream>

template<class T> inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
template<class T> inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}

using namespace std;
#define int long long
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repr(i,n) for(ll i=n;i>=0;i--)
#define P pair<ll, ll>
#define sz(x) (ll)x.size()
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define VE vector<ll>
#define COUT(x) cout<<(x)<<endl
#define MA map<ll,ll>
#define SE set<ll>
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,VE,greater<ll>>
#define COUT(x) cout<<(x)<<endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define EPS (1e-10)
ll gcd(ll a, ll b) {
	if (a < b)swap(a, b);
	if (b == 0) return a;
	unsigned r;
	while ((r = a % b)) {
		a = b;
		b = r;
	}
	return b;
}
ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}
bool prime(ll n) {
	for (ll i = 2; i <= sqrt(n); i++) {
		if (n%i == 0)return false;
	}
	return n != 1;
}
map<ll, ll> prime_factor(ll n) {
	map<ll, ll> ret;
	for (ll i = 2; i * i <= n; i++) {
		while (n % i == 0) {
			ret[i]++;
			n /= i;
		}
	}
	if (n != 1) ret[n] = 1;
	return ret;
}

const long long MOD = 1000000007;
//const long long MOD = 998244353;
const long long INF = 1LL << 60;



const long double PI = 3.14159265359;
const int MAX_N = 100010;

int cnt[60][2];

signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n; cin >> n;
	VE a(n); rep(i, n)cin >> a[i];
	rep(i, n) {
		rep(j, 60) {
			bool tmp = (bool)(a[i] & (1LL << j));
			cnt[j][tmp]++;
		}
	}
	int ans = 0;
	for (int i = 59; i >= 0; i--) {
		ans *= 2; ans %= MOD;
		ans += cnt[i][0] * cnt[i][1] % MOD;
	}
	cout << ans % MOD << endl;
	return 0;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
 
int main() {
 
  int N,n,m;
  cin >> N;
  n=N;
  int sum=0;
  for (int i=8;i>-1;i--){
    m=pow(10,i);
    sum += N/m;
      N=N%m;
  } 
  if(n%sum==0){
  	cout << "Yes" << endl;
  }else{
  	cout << "No" << endl;
  }
}

Measured memory_bytes: 384
s = input()
n = len(s)
t = 'keyence'
flg = False
for i in range(8):
  if i == 7:
    u = s[:7]
  else:
    u = s[:i] + s[i-7:]
  if u == t:
    flg = True
    break

if flg:
  print('YES')
else:
  print('NO')

Measured memory_bytes: 9044
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

m = min([a, b, c, d, e])

if n % m == 0:
    print(n//m + 4)
else:
    print(n//m + 4 + 1)

Measured memory_bytes: 38384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

int main() {
	ll n,m;
	cin>>n>>m;
	ll cnt=0;
	for(ll i=0;i<m;i++){
		ll now;
		cin>>now;
		cnt+=now;
	}
	if(cnt<=n){
		cout << n-cnt;
	}
	else{
		cout << -1;
	}
	// your code goes here
	return 0;
}

Measured memory_bytes: 3636
#include <iostream>
#include <string>
#include <map>
#include <algorithm>
#include <vector>
#include <math.h>
#define rep(i,s,n)for(int i = s;i<n;i++)
#define repe(i,s,n)for(int i = s;i<=n;i++)
using namespace std;
typedef long long ll;
static const ll MOD = 1e9 + 7;
static const ll INF = 1e25;

static const int MAX = 4;

ll t[100001] = {};
int main() {
	ll n, q; cin >> n >> q;
	string s; cin >> s;
	rep(i, 1, s.size()) {
		if (s[i - 1] == 'A' && s[i] == 'C') {
			s[i] = 'x';
		}
	}
	rep(i, 1, s.size()) {
		if (s[i] == 'x') {
			t[i] += t[i - 1] + 1;
		}
		else {
			t[i] = t[i - 1];
		}
	}

	rep(i, 0, q) {
		ll l, r; cin >> l >> r;
		l--, r--;
		if (s[l] == 'x')l++;
		cout << t[r] - t[l] << endl;
	}

	return 0;
}

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

int main() {

  int A, B, C;
  cin >> A >> B >> C;
  
  if(A == B && B != C) cout << "Yes" << endl;
  else if(A == C && A != B) cout << "Yes" << endl;
  else if(B == C && A != B) cout << "Yes" << endl;
  else cout << "No" << endl;
  
}

Measured memory_bytes: 3624
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <iomanip>
#include <queue>
#include <map>

#define rep(i,n) for(int i = 0; i < n; i++)
#define rep1(i,n) for(int i = 1; i <= n; i++)
#define co(x) cout << x <<endl
#define cs(x) cout << x <<" "
#define ALL(a) (a).begin(),(a).end()
#define INF 1e12
typedef long long ll;
using namespace std;


int main()
{
	int N;
	cin >> N;
	vector<ll> a(N);
	rep(i, N)cin >> a[i];
	vector<ll> csum(N);
	rep(i,N)
	{
		if (i == 0) csum[i] = a[i];
		else csum[i] = csum[i - 1] + a[i];
	}
	ll mi = INF;
	rep(i, N-1)
	{
		ll x = csum[i];
		ll y = csum[N - 1] - csum[i];
		ll def = abs(x - y);
		mi = min(mi, def);
	}
	co(mi);
	return 0;
}

Measured memory_bytes: 3328
X=gets.chomp
A=X.split(" ")[0].to_i
B=X.split(" ")[1].to_i
if A==1 then
	A+=13
end
if B==1 then
	B+=13
end
if A>B then
	print 'Alice'
elsif A==B then
	print 'Draw'
else
	print 'Bob'
end

Measured memory_bytes: 1788
#include <iostream>
#include <algorithm>
#include <climits>

using namespace std;

long long n, W;
long long w[110], v[110];
long long dp[110][100010];

int main() {
    //入力
    cin >> n >> W;
    for(int i = 0; i < n; i++) {
        cin >> w[i] >> v[i];
    }

    //初期化
    for(int i = 0; i <= W; i++){
        dp[0][i] = 0;
    }

    //計算
    for(int i = 0; i < n; i++) {
        for(int j = 0; j <= W; j++) {
            if(w[i] > j){
                dp[i+1][j] = dp[i][j];
            }
            else{
                dp[i+1][j] = max(dp[i][j], dp[i][j - w[i]] + v[i]);
            }
        }
    }

    //出力
    cout << dp[n][W];
    return 0;
}


Measured memory_bytes: 80128
import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    int a=sc.nextInt();
    int b=sc.nextInt();
    int c=sc.nextInt();
    int d=sc.nextInt();
    System.out.println(a*b-a*d-b*c+c*d);
  }
}


Measured memory_bytes: 21716
n,m = map(int,input().split())
xyz = [[int(i) for i in input().split()] for j in range(n)]

ans = 0

num = 2**3

for i in range(num):
    tmp = format(i,'0'+str(3)+'b')
    li = []
    for j in range(n):
        kari = 0
        for k in range(3):
            kari += xyz[j][k]*(-1)**int(tmp[k])
        li.append(kari)
    li.sort(reverse=True)
    temp = 0
    for l in range(m):
        temp += li[l]
    ans = max(ans,temp)
    
print(ans)

Measured memory_bytes: 3284
#include <bits/stdc++.h>
#define ll long long int
#define yorn(f) cout<<((f)?"Yes":"No")<<endl;
#define YORN(f) cout<<((f)?"YES":"NO")<<endl;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define println(x) cout << x << endl;
using namespace std;
int main()
{
    int a, b;
    cin >> a >> b;
    int k = (a + b) / 2;
    if (abs(k - a) == abs(k - b)) {
        println(k)
    }
    else {
        println("IMPOSSIBLE")
    }
    return 0;
}

Measured memory_bytes: 3564
#include <cstdio>
#include <vector>
using namespace std;

bool is_common_diff_seq(vector<int> seq){
  int diff = seq[1] - seq[0];
  for(int i = 2; i < seq.size(); i++)
    if(seq[i] - seq[i - 1] != diff)
      return false;
  return true;
}

int main(){
  while(true){
    int n;
    vector<int> hs;

    scanf("%d", &n);
    if(n == 0) break;

    for(int i = 0; i < n + 1; i++){
      int h;
      scanf("%d", &h);
      hs.push_back(h);
    }

    for(vector<int>::iterator k = hs.begin(); k != hs.end(); k++){
      int removed_h = *k;
      hs.erase(k);
      if(is_common_diff_seq(hs)){
        printf("%d\n", removed_h);
        break;
      }
      hs.insert(k, removed_h);
    }
  }
}

Measured memory_bytes: 1056
using System;
class p
{
  static void Main()
  {
    int N = int.Parse(Console.ReadLine());
    string[] ipt = Console.ReadLine().Split(' ');
    string S = ipt[0];
    string T = ipt[1];
    string result = string.Empty;
    for (int i = 0; i < N; i++) {
      result += S[i].ToString();
      result += T[i].ToString();
    }
    Console.WriteLine(result);
  }
}

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

typedef long long ll;

const int MAX=1e5;

int main(){
    int N,W; cin >> N >> W;
    int w[N],v[N];
    for(int i=0;i<N;i++){
        cin >> w[i] >> v[i];
    }
    ll dp[N+1][MAX];
    for(int i=0;i<=W;i++) dp[0][i]=0;
    for(int i=0;i<N;i++){
        for(int j=0;j<=W;j++){
            if(j-w[i]>=0){
                dp[i+1][j]=max(dp[i][j],dp[i][j-w[i]]+v[i]);
            }else{
                dp[i+1][j]=dp[i][j];
            }
        }
    }
    cout << dp[N][W] << endl;
}

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

ans = True
for x in a:
    if not x % 2 == 0 or (x % 3 == 0 or x % 5 == 0):
        pass
    else:
        ans = False

if ans:
    print("APPROVED")
else:
    print("DENIED")


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

/* -------------------------------- Template -------------------------------- */

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(),(x).end()

using namespace std;

using ll = long long;
using ld = long double;

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

template<typename T> T inf() { assert(false); }
template<> constexpr int inf<int>() { return 1e9; }
template<> constexpr ll inf<ll>() { return 1e18; }
template<> constexpr ld inf<ld>() { return 1e30; }

struct yes_no : numpunct<char> {
  string_type do_truename()  const { return "Yes"; }
  string_type do_falsename() const { return "No"; }
};

/* -------------------------------- Library -------------------------------- */

/* ---------------------------------- Main ---------------------------------- */

int main() {
  locale loc(locale(), new yes_no);
  cout << boolalpha;
  cout.imbue(loc);

  string s;
  cin >> s;
  int n = s.size();
  int res = n / 2;
  for (char c: s) {
    if (c == 'p') --res;
  }
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int m,f,r;
    while (1)
    {
        cin >> m >> f >> r;
        if (m == -1 && f == -1 && r == -1)
            break;
        int mfSum = max(0,m) + max(0,f);
        if (m == -1 || f == -1)
                cout << "F" << endl;
        else if (mfSum >= 80)
            cout << "A" << endl;
        else if(mfSum >= 65)
            cout << "B" << endl;
        else if(mfSum >= 50)
            cout << "C" << endl;
        else if(mfSum >= 30){
            if(r >= 50){
                cout << "C" << endl;
                continue;
            }
            cout << "D" << endl;
        }
        else
            cout << "F" << endl;
    }
    
  
    return 0;
}


Measured memory_bytes: 3096