akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long mod = 1000000007;
		long ans1=1;
		long[] t1=new long[n];
		long[] a1=new long[n];
		long[] ans=new long[n];
		for(int i = 0; i<n; i++){
			t1[i] = sc.nextLong();
			if(i==0){
				ans[i]=t1[i];
			}else if(t1[i]!=t1[i-1]){
				ans[i]=t1[i];
			}
		}
		for(int i = 0; i<n; i++){
			a1[i] = sc.nextLong();
			if(ans[i]!=0){
				if(t1[i]>a1[i]){
					System.out.println(0);
					return;
				}
			}
			if(i==n-1){
				if(ans[i]!=0 && ans[i]!=a1[i]){
					System.out.println(0);
					return;
				}
				ans[i]=a1[i];
			}
			if(i!=0 && a1[i]!=a1[i-1]){
				if(ans[i-1]!=0 && ans[i-1]!=a1[i-1]){
					System.out.println(0);
					return;
				}
				ans[i-1]=a1[i-1];
				if(t1[i-1]<a1[i-1]){
					System.out.println(0);
					return;
				}
			}
		}
		for(int i = 0; i<n; i++){
			if(ans[i]==0){
				ans1*=Math.min(t1[i],a1[i]);
				ans1%=mod;
			}
		}
		System.out.println(ans1);
	}
}


Measured memory_bytes: 93772
#include <algorithm>
#include <iostream>
#include <string>
#include <cctype>

int main()
{
  std::string s[3];
  std::cin >> s[0] >> s[1] >> s[2];

  for (int i = 0; i < 3; ++i) {
    transform(s[i].begin(), s[i].end(), s[i].begin(), ::toupper);
  }

  std::cout << s[0][0] << s[1][0] << s[2][0] << std::endl;

  return 0;
}


Measured memory_bytes: 256
S = input()
K = int(input())

# 5 * 10^15
cnt = 0

for i in range(len(S)):
    if int(S[i]) == 1:
        cnt += 1
    else:
        if cnt >= K:
            print(1)
        else:
            print(int(S[i]))
        exit()

print(1)

Measured memory_bytes: 9164
#include <bits/stdc++.h>
using namespace std;
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;
}

#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define all(x) (x).begin(), (x).end() //sortなどの引数を省略したい
#define F first
#define S second

typedef long long ll;
const ll MOD = 1e9 + 7;
const int inf = 1000000;
const int minf = -1000000;
const ll lnf = 1e12;
const ll mlnf = -1e12;

// Graph problem
using Graph = vector<vector<int>>;
int dx[4] = { 1, 0, -1, 0 };
int dy[4] = { 0, 1, 0, -1 };

// solve

int main()
{
    int N;
    cin >> N;
    vector<int> A(N - 1);
    rep(i, N - 1) cin >> A[i];

    vector<int> ans(N);
    rep(i, N - 1)
    {
        ans[A[i] - 1]++;
    }
    rep(i, N) printf("%d\n", ans[i]);
    return 0;
}


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

ll n,m,arr[1000][3];
ll ans = -1e18;
int main(){
	cin>>n>>m;
	for(int i = 0; i < n; i++){
		cin>>arr[i][0]>>arr[i][1]>>arr[i][2];
	}
	vector<ll> temp(n);
	for(int i = 0; i <= 8 ; i++){
		int a = (i&1) ? -1 : 1;
		int b = (i&2) ? -1 : 1;
		int c = (i&4) ? -1 : 1;
		temp.clear();
		for(int j = 0; j < n; j++){
			ll tt = a*arr[j][0]+b*arr[j][1]+c*arr[j][2];
			temp.push_back(tt);
		}
		sort(temp.begin(),temp.end());
		reverse(temp.begin(),temp.end());
		ll cur = 0;
		for(int i = 0; i < m; i++) cur+=temp[i];
		ans = max(ans,cur);
	}
	cout<<ans;
}


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

int main() {
  string w;
  cin >> w;
  map<char, int> ma;
  for (int i = 0; i < w.size(); i++) {
    ma[w[i]]++;
  }
  bool res = true;
  for (auto k : ma) {
    if (k.second % 2 != 0) {
      res = false;
      break;
    }
  }
  cout << (res ? "Yes" : "No") << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	char Y[1000];
	char N, E, W, S;
	int countN = 0, countE = 0, countW = 0, countS = 0;
	scanf("%s", Y);
	int i = 0;
	while (true) {
		if (Y[i] == 'N') {
			countN++;
		}
		else if (Y[i] == 'E') {
			countE++;
		}
		else if (Y[i] == 'W') {
			countW++;
		}
		else if (Y[i] == 'S') {
			countS++;
		}
		else if (Y[i] == '\0')break;
		i++;
	}
	if (countN == 0 || countE == 0 || countW == 0 || countS == 0) {
		if (((countN == 0 && countS == 0)&&(countE!=0&&countW!=0)) || ((countE == 0 && countW == 0)&&(countS!=0&&countN!=0)))
			printf("Yes");
		else
			printf("No");
	}
	else
		printf("Yes");

	return 0;
}

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

int main(void)
{
    int n;

    cin >> n;
    vector<int> v(n);
    for(auto i = 0; i < n; i++) cin >> v[i];

    sort(v.begin(),v.end());
    auto l = accumulate(v.begin(),v.end()-1,0LL);
    if (v[n-1] < l) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;

    }
  
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <vector>
#include <algorithm>


using namespace std;

int main(){
  int N;
  cin>>N;
  char S[N];
  for(int i=0;i<N;i++)cin>>S[i];
  for(int i=0;i<N;i++){
    if(S[i]=='Y'){
      cout<<"Four\n";
      return 0;
    }
  }
  cout<<"Three\n";
  return 0;
}


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

#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define forn(i,o,n) for(int i=o;i<n;i++)
#define int long long
#define endl "\n"
#define mod 1000000007
#define mod2 998244353
#define double long double
#define pb push_back
#define mk make_pair
#define swap(x,y) (x^=y^=x^=y)
#define TT int ttt;cin>>ttt;while(ttt--)
#define oo 2000000000000000000


using namespace std;

int gcd(int a, int b){
    if (b == 0)
        return a;
    return gcd(b, a % b); 
}
bool isPrime(int n){
    if(n < 2)
        return 0;
    if(n < 4)
        return 1;
    if(n % 2 == 0 or n % 3 == 0)
        return 0;
    for(int i = 5; i*i <= n; i += 6)
        if(n % i == 0 or n % (i+2) == 0)
            return 0;
    return 1;
}
int modexpo(int x,int p){
    int res = 1;
    x = x%mod;
    while(p){
        if(p%2)
            res = res * x;
        p >>= 1;
        x = x*x % mod;
        res %= mod;
    }
    return res;
}

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

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

int dp[105][100005];

int32_t main(){
    IOS
    int n,w;
    cin>>n>>w;
    vector<pair<int,int>>v;
    for(int i=0;i<n;i++){
        int a,b;
        cin>>a>>b;
        v.pb(mk(a,b));
    }
    sort(v.begin(),v.end());
    for(int i=1;i<=n;i++){
        for(int j=0;j<w+1;j++){
            if(j<v[i-1].first){
                dp[i][j]=dp[i-1][j];
            }
            else{
                dp[i][j]=max(dp[i-1][j-v[i-1].first]+v[i-1].second,dp[i][j-1]);
                dp[i][j] = max(dp[i][j],dp[i-1][j]);
            }
        }
    } 
    cout<<dp[n][w]<<endl;
}

Measured memory_bytes: 79360
m,n=map(int,raw_input().split())
M=10**9+7

def a(m,n):
	N=n
	ans=m
	c=1
	while n>1:
		ans=ans**2
		ans%=M
		n/=2
		c*=2

	N=N-c
	return ans,N


x=m; y=n

ans=1
while y>1:
	x,y=a(m,y)
	ans=(ans*x)%M

if y==1:
	print (ans*m)%M
else:
	print ans	






Measured memory_bytes: 4660
package main

import (
	"bufio"
	"container/list"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func scanInt() int {
	iv, _ := strconv.Atoi(scanString())
	return iv
}
func scanString() string {
	sc.Scan()
	return sc.Text()
}

func init() {
	sc.Split(bufio.ScanWords)
	buf := make([]byte, 10000)
	sc.Buffer(buf, 10000000)
}

func main() {
	s := scanString()
	ls := list.New()
	for _, r := range s {
		ls.PushBack(string(r))
	}
	rv := false
	q := scanInt()
	for i := 0; i < q; i++ {
		t := scanInt()
		switch t {
		case 1:
			rv = !rv
		case 2:
			f, c := scanInt(), scanString()
			if rv {
				f = 3 - f
			}
			if f == 1 {
				ls.PushFront(c)
			} else {
				ls.PushBack(c)
			}
		}
	}

	var wr = bufio.NewWriter(os.Stdout)
	if rv {
		for e := ls.Back(); e != nil; e = e.Prev() {
			wr.WriteString(e.Value.(string))
		}
	} else {

		for e := ls.Front(); e != nil; e = e.Next() {
			wr.WriteString(e.Value.(string))
		}
	}
	wr.WriteString("\n")
	wr.Flush()
}


Measured memory_bytes: 21888
def main():
    S = input()

    if S[0] == 'A':
        count = 0
        for i in range(2, 2+len(S[2:-1])):
            if S[i] == 'C':
                count += 1
                index = i
        if count == 1:
            S = S[1:index]+S[index+1:]
            if S.islower():
                print('AC')
                return
    print('WA')


if __name__ == '__main__':
    main()


Measured memory_bytes: 38256
#include <bits/stdc++.h>
#define ll long long
#define _ ios::sync_with_stdio(false);cout.tie(NULL);cin.tie(NULL);
using namespace std;

int main() { _
    int n; cin >> n;
    map <int, int> mp;
    for(int i = 1; i * i <= n; i++){
        for(int j = 1; j * j <= n; j++){
            for(int k = 1; k * k <= n; k++){
                mp[i * i + j * j + k * k + i * j + j * k + i * k]++;
            }
        }
    }
    for(int i = 1; i <= n; i++){
        cout << mp[i] << endl;
    }
}

Measured memory_bytes: 5304
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int i =1;
        while(i <= n){
           int x = i;
           if(x % 3 == 0){
               System.out.print(" "+i);
           }else{
                while(x!=0){
                    if(x % 10 == 3){
                        System.out.print(" "+i);
                        break;
                    }
                    x /= 10;
                }
           }
           i++;
        } 
        System.out.println();
    }
}


Measured memory_bytes: 28660
#include<iostream>
#define _USE_MATH_DEFINES
#include<math.h>
#include<vector>
#include<array>
#include<algorithm>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<cstdio>
#include<cstring>
#include<string>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vec;
typedef vector<vector<ll>> mat;
typedef pair<ll,ll> P;
typedef map<ll,ll> MP;
typedef priority_queue<ll> PQ;
typedef stack<ll> ST;
typedef queue<ll> QUE;
#define pb push_back
#define st first
#define nd second
#define SZ(x) ((int)(x).size())
#define FOR(i,s,n) for(int i=(int)(s); i< (int)(n); i++)
#define rep(i,n) FOR(i,0,n)
#define all(x) (x).begin(),(x).end()
#define each(x,c) for(auto x: (c))
#define LB(x,a) lower_bound(all(x), a)
#define UB(x,a) upper_bound(all(x), a)
const ll mod=1e9+7;
const ll INF=1e18;
const double EPS=1.0e-10;
const double PI=M_PI;

int main(){
    int A,B,C; cin>>A>>B>>C;
    cout<<C<<" "<<A<<" "<<B<<endl;
}

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

int N,K;
int p[1000];
int sum;

void sort(){
	int temp;
	
	for (int i = 0; i<N-1; i++){
		for(int j = 0; j<N-i-1; j++){
			if (p[j]>p[j+1]){
				temp = p[j];
				p[j] = p[j+1];
				p[j+1] = temp;
			}
		}
	}
}
int main() {
	cin>>N>>K;
	
	for (int i = 0; i<N; i++){
		cin>>p[i];
	}
	
	sort();
	
	for (int i = 0; i<K; i++){
		sum = sum + p[i];
	}
	
	cout<<sum<<endl;
	return 0;
}

Measured memory_bytes: 3596
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <queue>

using namespace std;

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

int f(char c){
  if(c == 'A') return 14;
  if(c == 'K') return 13;
  if(c == 'Q') return 12;
  if(c == 'J') return 11;
  if(c == 'T') return 10;
  return c - '0';
}

bool gt(int n1, char c1, int n2, char c2, char trump, char lead){
  if(c1 == c2) return n1 > n2;
  if(c1 == trump) return true;
  if(c2 == trump) return false;
  if(c1 == lead) return true;
  if(c2 == lead) return false;
  return n1 > n2;
}

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

  char ch;
  while(cin>>ch,ch!='#'){
	char in[2];
	VI num[4];
	string suit[4];
	REP(i,4) REP(j,13){
	  cin >> in;
	  num[i].PB(f(in[0]));
	  suit[i].PB(in[1]);
	}

	int ns = 0, ew = 0;
	int led = 1;
	REP(i,13){
	  int i1, i2;
	  char led_ch = suit[led][i];
	  if(gt(num[0][i], suit[0][i], num[2][i], suit[2][i], ch, led_ch))	i1 = 0;
	  else i1 = 2;
	  if(gt(num[1][i], suit[1][i], num[3][i], suit[3][i], ch, led_ch))	i2 = 1;
	  else i2 = 3;

	  if(gt(num[i1][i], suit[i1][i], num[i2][i], suit[i2][i], ch, led_ch))
		++ns, led = i1;
	  else
		++ew, led = i2;
	}
	if(ns > ew) cout << "NS " << ns-6 << endl;
	else cout << "EW " << ew-6 << endl;
  }
  
  return 0;
}

Measured memory_bytes: 1212
N=int(input())
ans=10000000000
for i in range(N-1):
        sum = 0
        num = i+1
        smu=0
        while num!=0:
        	dig = num % 10
        	sum = sum + dig
        	num = int(num / 10)
        smu+=sum
        sum=0
        num = N-(i+1)
        while num!=0:
        	dig = num % 10
        	sum = sum + dig
        	num = int(num / 10)
        smu+=sum
        ans=min(ans,smu)
print(ans)


Measured memory_bytes: 3064
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//int N = sc.nextInt(), L = sc.nextInt();
		//String[] array = new String[N];
		String s=sc.next();
		int sum=0;
		for(int i=0;i<s.length();i++) {
			sum+=Integer.parseInt(s.substring(i,i+1));
		}
		if(Integer.parseInt(s)%sum==0) {
			System.out.println("Yes");//Yes or YES注意
		}else {
			System.out.println("No");
		}

	}
	public static int sample(int n) {
		return n;
	}

}


Measured memory_bytes: 21716
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <cmath>
#include <queue>
#include <deque>
#include <set>
#include <iomanip>
#include <utility>
#define ll long long
#define ld long double
using namespace std;

ll mod=1000000007;

int main() {
    string S;
    cin >> S;
    vector<int> pow10(S.size());
    pow10[0]=1;
    for(int i=1; i<S.size(); ++i){
        pow10[i]=(pow10[i-1]*10)%13;
    }
    vector<vector<ll>> dp(1+S.size(), vector<ll>(13, 0));
    dp[0][0]=1;
    for(int i=0; i<S.size(); ++i){
        if(S[i]!='?'){
            int dig=S[i]-'0';
            for(int j=0; j<13; ++j){
                dp[i+1][(j+dig*pow10[S.size()-i-1])%13] += dp[i][j];
            }
        }else{
            for(int j=0; j<13; ++j){
                for(int k=0; k<10; ++k){
                    dp[i+1][(j+k*pow10[S.size()-i-1])%13] += dp[i][j];
                    dp[i+1][(j+k*pow10[S.size()-i-1])%13] %= mod;
                }
            }
        }
    }
    cout << dp[S.size()][5] << endl;
    return 0;
}


Measured memory_bytes: 16000
n = int(input())
a = list(map(int,input().split()))
b = [a_ for a_ in a]
 
ans = 10**14
for a0 in [-1,a[0],1]:
    if a0 == 0:
        continue
    ans_ = abs(a[0]-a0)
    b[0] = a0
    sign = b[0] > 0
    for i in range(1,n):
        b[i] = a[i]+b[i-1]
        if sign:
            if b[i] >= 0:
                ans_ += b[i]+1
                b[i] = -1
        else:
            if b[i] <= 0:
                ans_ += 1-b[i]
                b[i] = 1
        sign = not sign
    ans = min(ans, ans_)
print(ans)

Measured memory_bytes: 14464
#define _USE_MATH_DEFINES // M_PI
#include<cmath>
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define rREP(i,a,n) for(int (i)=(n)-1; (i)>=(a);--(i))
#define all(x) (x).begin(),(x).end()
#define out(y,x,h,w) (y)<0||(x)<0||(y)>=(h)||(x)>=(w)
constexpr int INF = 2147483647;
constexpr ll mod = 1000000007;

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;
}
inline void init() {
	cin.tie(nullptr); cout.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

int main() {
	init();

	int N; cin >> N;
	int K; cin >> K;
	vector<int>H(N);
	rep(i, N)cin >> H[i];
	sort(all(H));
	ll ans = 0;
	rep(i, N - K)ans += H[i];
	cout << ans << "\n";


	return 0;
}

Measured memory_bytes: 1024
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <cassert>
#include <bitset>

//#include <boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision;

//std::cout << std::fixed << std::setprecision(10)
//std::ios::sync_with_stdio(false);
constexpr long long MOD = 1000000007;

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

int main()
{
  long long X;
  std::cin >> X;
  long long N = std::sqrt(X) + 1;
  long long A, B;
  auto sqrt5 = [](long long x)
  {
    long long l = 1, r = x + 1;
    while(l + 1 < r)
    {
      long long mid = (l + r) / 2;
      long long y2 = mid * mid;
      long long y3 = y2 * mid;
      long long y4 = y3 * mid;
      long long y5 = y4 * mid;
      if(x <= y2 || x <= y3 || x <= y4 || x < y5)
        r = mid;
      else if(y5 == x)
        return mid;
      else
        l = mid;
    }
    return l;
  };
  for(long long i = 1; i <= N; ++i)
  {
    long long A5 = std::pow(i, 5LL);
    if(A5 == X)
    {
      A = i;
      B = 0;
      break;
    }
    else if(A5 < X)
    {
      auto sq5 = sqrt5(X - A5);
      if(std::pow(sq5, 5LL) == X - A5)
      {
        A = i;
        B = -sq5;
        break;
      }
    }
    else
    {
      auto sq5 = sqrt5(A5 - X);
      if(std::pow(sq5, 5LL) == A5 - X)
      {
        A = i;
        B = sq5;
        break;
      }
    }
  }
  std::cout << A << " " << B << std::endl;
  return 0;
}



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

ll N,M;
vector<ll> A;
struct BC{
  int B, C;
  bool operator < (const BC &bc) const {
    return C > bc.C;
  };
};
vector<BC> bc_list;
int main(void){
  cin>>N>>M;
  for(ll i=0;i<N;i++){
    ll a;
    cin>>a;
    A.push_back(a);
  }
  for(ll i=0;i<M;i++){
    BC bc; cin>>bc.B>>bc.C;
    bc_list.push_back(bc);
  }
  sort(A.begin(),A.end());
  sort(bc_list.begin(),bc_list.end());
  ll bc_n=0,bc_i0=0;
  for(ll i=0;i<N;i++){
    if(i-bc_i0+1>bc_list[bc_n].B){
      bc_i0 = i;
      bc_n++;
      if(bc_n>=(ll)bc_list.size()) break;
    }
    if(A[i]<bc_list[bc_n].C) A[i]=bc_list[bc_n].C;
  }
  ll sum=0;
  for(auto a:A) sum+=a;
  cout<<sum<<endl;
  return 0;
}


Measured memory_bytes: 2548
#include<stdio.h>

int m[45];

int fi(int);

int main(){
  int n,i;
  scanf("%d",&n);
  
  for(i=0;i<45;i++)m[i]=-1;
  
  printf("%d\n",fi(n));
  
  return 0;
}

int fi(int f){
  if(f==0 || f==1)return m[f]=1;
  if(m[f] != -1)return m[f];
  return m[f]=fi(f-1)+fi(f-2);
}



Measured memory_bytes: 2112
#include <stdio.h>
int main(void)
{
    int n, k, ans;
    
    scanf("%d%d", &n, &k);

    if(n%2==0){
        ans=n/2;
    }
    else{
        ans=n/2+1;
    }
    if(ans>=k) printf("YES\n");
    else printf("NO\n");

    
    
    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cassert>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define rep(i,n) FOR(i,0,n)
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define vint vector<int>
#define vdouble vector<double>
#define vstring vector<string>
using namespace std;

#include<map>
#include<set>
#include<queue>

typedef long long ll;
typedef unsigned long long ull;

const int MAX_N = 1000000;
static const int INFTY = (1 << 21);

class Edge{
public:
    int from, to, cost;
    Edge(int from = 0, int to = 0, int cost = 0) :
            from(from), to(to), cost(cost){}

    bool operator < (const Edge &e) const{
        return cost < e.cost;
    }
    bool operator >(const Edge &e) const{
        return cost > e.cost;
    }

};

class Node{
public:
    vector<Edge> edges;
    int dist;
    int done;
    int times;
    int timee;

    Node(){
        dist = INFTY;
        done = 0;
    }
};

class Graph{
public:
    vector<Node> nodes;
    Graph(int n) {
        rep(i, n) { Node n;  nodes.push_back(n); }
    }
    Node& operator[](int i){
        return nodes[i];
    }
};

class Data{

public:
    int dist;
    Edge *edge;
    Data(int dist, Edge *edge) {
        this->dist = dist;
        this->edge = edge;
    }

    bool operator < (const Data &d) const{
        return dist < d.dist;
    }
    bool operator >(const Data &d) const{
        return dist > d.dist;
    }
};

Graph G(0);

int V;
int t;

void dfs(int v){
    if (G[v].done != 0) return;

    // fprintf(stderr, "%d %d\n", v, t);

    G[v].done = 1;
    t++;
    G[v].times = t;
    for(auto &e: G[v].edges){
        dfs(e.to);
    }
    t++;
    G[v].timee = t;
}

void dfs_run(){
    t = 0;
    rep(i, V) dfs(i);
}

int main() {

    cin >> V;
    G = Graph(V);

    rep(i, V){
        int from; cin >> from; from--;
        int e_count; cin >> e_count;

        vint vec;
        rep(j, e_count){
            int to; cin >> to; to--;
            vec.push_back(to);
        }
        sort(vec.begin(), vec.end());
        rep(j, e_count){
            G[from].edges.push_back(Edge(from, vec[j], 1));
        }
    }

    dfs_run();

    rep(i, V){
        fprintf(stdout, "%d %d %d\n", i+1, G[i].times, G[i].timee);
    }
}

Measured memory_bytes: 3284
#include<iostream>
#include<vector>
#include<string>
#include<set>
#include<map>
#include<algorithm>
#include<cmath>
#include<unordered_map>
#include<unordered_set>
#include<bitset>
#include<sstream>
#include<numeric>
#include<queue>
#include<cstdio>
#include<iterator>
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("unroll-loops")
using namespace std;
using ll = long long;
using ull = unsigned long long;

#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define pb(x) push_back(x)
ll mod = 1e9 + 7;
ll inf = 1e9 + 7;
template<typename T, typename U>
T binpow(T a, U n) {
    if (n == 0)
        return 1;
    if (n % 2 == 1)
        return (binpow(a, n - 1) * a) % mod;
    else {
        ll b = binpow(a, n / 2) % mod;
        return (b * b) % mod;
    }
}
template<typename T>
T gcd(T a, T b) {
    if (b == 0)
        return a;
    else
        return gcd(b, a % b);
}
template<typename T>
istream& operator>>(istream& str, vector<T>& vec) {
    for (auto& w : vec) str >> w;
    return str;
}
template<typename T>
ostream& operator<<(ostream& str, vector<T>& vec) {
    for (auto& w : vec) str << w << ' ';
    return str;
}

struct segtree {
    vector<set<ll>>mn;
    vector<ll>tree;
    size_t size = 1;
    //void build(ll x, ll lx, ll rx, vector<ll>& vec);
    void build(ll size_) {
        while (size < size_) {
            size *= 2;
        }
        tree.resize(size * 2 - 1);
        mn.resize(size * 2 - 1);
    }
    void update(ll i, ll x, ll v, ll lx, ll rx) {
        if (rx - lx == 1) {
            tree[x] = v;
            return;
        }
        ll m = (lx + rx) / 2;
        if (i < m) {
            update(i, 2 * x + 1, v, lx, m);
        }
        else {
            update(i, 2 * x + 2, v, m, rx);
        }
        tree[x] = tree[2 * x + 1] + tree[2 * x + 2];
    }

    ll get(ll l, ll r, ll x, ll lx, ll rx) {
        if (l <= lx && rx <= r) return tree[x];
        if (rx <= l || lx >= r) return 0;
        ll m = (lx + rx) / 2;
        return get(l, r, 2 * x + 1, lx, m) + get(l, r, 2 * x + 2, m, rx);
    }
};

vector <vector<int>>g;
vector<bool>used;

int dfs(int v, int p = -1) {
    used[v] = true;
    ll cur = 0;
    for (auto to : g[v]) {
        if (!used[to]) {
            cur += dfs(to);
        }       
    }
    cur++;
    return cur;
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int n, m;
    cin >> n >> m;
    g.resize(n);
    used.resize(n);
    int maxx = 0;
    for (int i = 0; i < m; ++i) {
        int v, u;
        cin >> v >> u; v--; u--;
        g[v].push_back(u);
        g[u].push_back(v);
    }
    for (int i = 0; i < n; ++i) {
        if (!used[i])
            maxx = max(maxx, dfs(i));
    }
    cout << maxx;
}

Measured memory_bytes: 23448
x,y,z,k=gets.split(' ').map(&:to_i)
#h=gets.split(' ').map(&:to_i)
#tajigen = Array.new(4) { Array.new(2,0) }
a=gets.split(' ').map(&:to_i)
b=gets.split(' ').map(&:to_i)
c=gets.split(' ').map(&:to_i)

xy = Array.new
k_count = 0
for i in 0..x-1
  for j in 0..y-1
    xy.push(a[i]+b[j])
    #break if k_count >=k
  end
end

xy.sort!.reverse!
xy_new = Array.new
while k_count<k && xy[k_count]
  xy_new[k_count]=xy[k_count]
  k_count+=1
end
#puts xy
#c.sort!.reverse!

=begin
count =0
xy_count = 0
z_count = 0
while count<k
  if z_count >=z
      z_count=0
      xy_count+=1
  end
  ans = (xy[xy_count])+(c[z_count])
  z_count+=1
  count += 1
  puts ans
end
=end

abc = Array.new

for i in 0..(xy_new.length-1)
  for j in 0..z-1
    abc.push(xy_new[i]+c[j])
  end
end

abc.sort!.reverse!
=begin
if k<x*y*z
  k=x*y*z
end
=end
for i in 0..k-1
  puts abc[i]
end


Measured memory_bytes: 70124
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define Z class
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1e9+7,MAXL=1LL<<61,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<ll,ll> P;

void Main() {
  ll n,m;
  cin >> n >> m;
  ll a[n];
  rep(i,n) R a[i];
  vector<ll> v;
  ll sum=0,ans=0;
  rep(i,n+1) {
    vector<ll> g=v;
    ll c=i,s=sum;
    if(c<=m) ans=max(ans,s);
    rrep(j,n) {
      if(i>j||c>m) break;
      sort(all(g));
      ll d=s,cc=c;
      ans=max(ans,d);
      rep(k,g.size()) {
        if(cc<m) {
          d-=g[k];
          ans=max(ans,d);
          cc++;
        }
      }
      c++;
      s+=a[j];
      g.pb(a[j]);
    }
    if(i==n) break;
    sum+=a[i];
    v.pb(a[i]);
  }
  pr(ans);
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)
#define TO_STRING(VariableName) # VariableName
#define LOG(x) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<endl;
#define LOG2(x,y) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<endl;
#define LOG3(x,y,z) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;
#define LOG4(w,x,y,z) if(DEBUG)cout<<TO_STRING(w)<<"="<<w<<" "<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;
 
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; }

const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

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

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

// a^{-1} mod を計算する
long long modinv(long long a, long long mod) {
    return modpow(a, mod - 2, mod);
}

lli com(lli n,lli a){
	lli ans = 1;

	a = min(a,n-a);

	REP(i,0,a){
		ans *= (n-i);
		ans %= MOD;
	}
	REP(i,0,a){
		ans *= modinv(a-i,MOD);
		ans %= MOD;
	}
	LOG(ans);
	return ans;
}

int main(){

	lli n,a,b;
	cin>>n>>a>>b;

	COMinit();

	lli ans = modpow(2,n,MOD);

	ans = (ans + MOD - com(n,a))%MOD;
	ans = (ans + MOD -com(n,b))%MOD;
	cout<<(ans+MOD-1)%MOD<<endl;

    return 0;
}

Measured memory_bytes: 12160
#include<bits/stdc++.h>
using namespace std;
int bubble_sort(vector<int> &v, int size){
  int j,swp, count_swap;
  bool is_swap;
  count_swap = 0;
  is_swap = true;
  while ( is_swap){
    is_swap = false;
    for( j=size-1; j>=1; j--){
      if( v[j] < v[j-1]){
        swp = v[j]; v[j] = v[j-1]; v[j-1] =swp;
        is_swap = true;
        count_swap++;
      }
    }
  }
  return count_swap;
}    
     
int main(){
  int n; cin>>n;
  vector<int> vec(n);
  int count;
  for( int i=0; i<n; i++){
    cin >> vec[i];
  }
  count = bubble_sort(vec, n);
  for( int i=0; i<n; i++){
    cout << vec[i];
    if( i != n-1) cout << ' ';
  }
  cout << endl;
  cout << count << endl;
  return 0;
}


Measured memory_bytes: 3092
#include <cstdio>
#include <utility>
#include <vector>
#include <algorithm>
using namespace std;

#define _gp(l) const auto gcu{getchar##l}; const auto pcu{putchar##l}
#ifdef __linux
_gp(_unlocked);
#else
_gp();
#endif
#define _DEF(r, n, ...) inline r n(__VA_ARGS__) noexcept
#define _T template <typename T>
#define _HT template <typename H,typename... T>
#define _OP(t) inline operator t()
struct _in {
#ifdef _GLIBCXX_STRING
	_OP(string){string s;for(char c;c=gcu(),c!=' '&&c!='\n';)s+=c;return s;}
#define _S
#endif
	_OP(char){char c=gcu();gcu();return c;}
	_OP(double){double d; scanf("%lf",&d); gcu();return d;}
	_T _OP(T){T n{},m{1},c;if((c=gcu())=='-')m=-1,c=gcu();do{n=10*n+(c-'0'),c=gcu();}while(c>='0'&&c<='9');return m*n;}
} in;
#define _SCAN(...) _DEF(bool,scan,__VA_ARGS__)
#ifdef _S
_SCAN(string &o) {int c{gcu()};if(c==EOF)return false;else{ungetc(c,stdin);string t=move(in);o=t;return true;}}
#endif
_T _SCAN(T &o) {int c{gcu()};return c==EOF?false:(ungetc(c,stdin),o=in,true);}
_HT _SCAN(H &h,T&&... t){return scan(h)&&scan(t...);}
#define _OUT(...) _DEF(void,out,__VA_ARGS__)
#define _OUTL(...) _DEF(void,outl,__VA_ARGS__)
_OUT(bool b){pcu('0'+b);}
_OUT(const char *s){while(*s)pcu(*s++);}
_OUT(char c){pcu(c);}
#ifdef _S
_OUT(string &s){for(char c:s)pcu(c);}
#endif
_T _OUT(T n){static char b[20];char *p=b;T m=n<0?pcu('-'),-1:1;
	if(!n)*p++='0';else while(n)*p++=(char)(n%10*m+'0'),n/=10;while(p!=b)pcu(*--p);}
	_OUTL(){out('\n');}
#ifdef _GLIBCXX_VECTOR
	_T _OUT(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);}
#endif
	_HT _OUT(H &&h, T... t){out(h);out(t...);}
	template <typename... T> _OUTL(T... t){out(t...);outl();}
	struct range{
		int e,b=0,s=1;range(int _b,int _e,int _s):e(_e),b(_b),s(_s){} range(int _b,int _e): e(_e), b(_b){} range(int _e):e(_e){}
		struct it{int v,s; it(int _v,int _s):v(_v),s(_s){} operator int()const{return v;} operator int&(){return v;}int operator*()const{return v;}
			it& operator++(){v+=s;return *this;} }; it begin(){return {b,s};} it end(){return {e,s};}};
#define times(i,n) for(int i=n;i;i--)

int main() {
	for (int n; (n = in);) {
		vector<int> J(n);
		for (int &i: J)
			i = in;
		for (int o {32}, i {}; o;) {
			outl(o -= (o - 1) % 5);
			outl(o -= min(o, J[i++ % n]));
		}
	}
}


Measured memory_bytes: 2344
n,m,x = map(int,input().split())
book_list = [list(map(int,input().split())) for _ in range(n)]

min_cost = float('inf')
 
for i in range(2**len(book_list)):  # 空集合を除く場合はrange(1, 2**len(list1))
    # list2 = []
    cost = 0
    score_list = [0 for _ in range(m)]
    for j in range(len(book_list)):
        if (i >> j) &1 == 1:
            cost += book_list[j][0]
            for idx in range(m):
                score_list[idx] += book_list[j][idx+1]
    if min(score_list) >= x:
        min_cost = min(min_cost,cost)

if min_cost == float('inf'):
    print(-1)
else:
    print(min_cost)

Measured memory_bytes: 9224
import java.util.Scanner;

public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
while(true){
int H = sc.nextInt();
int W = sc.nextInt();
if (W == 0 && H == 0) break;
for(int i=1;i<=H;i++){
for(int j=1;j<=W;j++){
if ((i+j) % 2 == 0){
System.out.printf("#");
}else{
System.out.printf(".");
}
}
System.out.println("");
}
System.out.println("");
}
sc.close();
}
}


Measured memory_bytes: 56656
#include <bits/stdc++.h>
// #include "/usr/local/include/cxx_pretty_print/cxx_pretty_print.hpp"

using namespace std;
/* type aliases */
using i32 = int32_t; using ui32 = uint32_t; using i64 = int64_t; using ui64 = uint64_t; using i128 = __int128;
using f32 = float;   using f64  = double;   using f80 = long double;
using PII = pair<i32, i32>; using PLL = pair<i64, i64>; using PFF = pair<f32, f32>; using PDD = pair<f64, f64>;
using VB  = vector<bool>;   using VS  = vector<string>;
using VI  = vector<i32>;    using VL  = vector<i64>;    using VF  = vector<f32>;    using VD  = vector<f64>;
using VVI = vector<VI>;     using VVL = vector<VL>;     using VVF = vector<VF>;     using VVD = vector<VD>;
using VPI = vector<PII>;    using VPL = vector<PLL>;    using VPF = vector<PFF>;    using VPD = vector<PDD>;
/* constants */
constexpr i64 mod = 1000000007;                                // 10^9+7
constexpr i64 inf = 9000000000000000000;                       // 9*10^18
/* macros */
#define MAX(c)        *max_element(ALL(c))
#define MIN(c)        *min_element(ALL(c))
#define SIZE(c)       (i64)((c).size())                        // unsined int (size_t) -> int64_t
#define ALL(c)        (c).begin(), (c).end()
#define RALL(c)       (c).rbegin(), (c).rend()
#define REP(i, n)     for (i64 i=0; i<(i64)(n); ++i)           // 0 to n-1
#define REPD(i, n)    for (i64 i=(i64)(n)-1; i>=0; --i)        // n-1 to 0
/* debug */
#define debug(x)      cerr << #x << ": " << (x) << '\n'
#define debugvec(v)   for (size_t _ = 0; _ < (v).size(); ++_) {cerr << #v << '[' << _ << "]: " << (v)[_] << '\n';}
/* useful output */
auto print = [](auto x) {cout << (x) << '\n';};
template <class T> void printvec(T v, string sep=" ", string end="\n") {REP(i, SIZE(v)-1) cout << v[i] << sep; cout << v[SIZE(v)-1] << end;}
/* useful input */
VS splitstr(string s, char delim=' ') {VS v; string buf; stringstream ss{s}; while (getline(ss, buf, delim)) v.push_back(buf); return v;}




void Main() {
    i32 n, elm;
    i32 cnt{};
    cin >> n;
    for(i32 i = 1; i <= n; ++i) {
        cin >> elm;
        if (i % 2 == 1 && elm % 2 == 1) ++cnt;
    }
    print(cnt);
}


signed main() {
    cin.tie(nullptr);                                         // cin と cout の tie を切り高速化
    cout << fixed << setprecision(15);                        // 浮動小数点数が 1e-006 のように表示されることを防ぐ
    Main();
}

Measured memory_bytes: 3632
#pragma GCC optimize(2)
#include<bits/stdc++.h>
#define ll long long
#define maxn 1000005
#define inf 1e9
#define pb push_back
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=a;i>=b;i--)
using namespace std;

inline int read()
{
	int x=0,w=1; char c=getchar();
	while(c<'0'||c>'9') {if(c=='-') w=-1; c=getchar();}
	while(c<='9'&&c>='0') {x=(x<<1)+(x<<3)+c-'0'; c=getchar();}
	return w==1?x:-x;
}

vector <int> mp[maxn];
int val[maxn],n,f[maxn];

inline void dfs(int u,int fa)
{
	f[u]=0;
	for(int i=0;i<mp[u].size();i++)
	{
		int v=mp[u][i]; if(v==fa) continue;
		if(val[v]<val[u])
		{
			dfs(v,u);
			if(!f[v]) f[u]=1;
		}
	}
}

int main()
{
	n=read(); rep(i,1,n) val[i]=read();
	rep(i,1,(n-1))
	{
		int u=read(),v=read();
		mp[u].pb(v); mp[v].pb(u);
	}
	rep(i,1,n)
	{
		dfs(i,0);
		if(f[i]) printf("%d ",i);
	}
	return 0;
}

Measured memory_bytes: 27520
const drawFrame = function (h, w) {
    console.log(Array(w + 1).join('#') + '\n'
        + Array(h - 1).join('#' + Array(w - 1).join('.') + '#\n')
        + Array(w + 1).join('#') + '\n');
};
const isZero = function (a) {return 0 === a;};

const chunk = require('fs').readFileSync('/dev/stdin', 'utf8');
const lines = chunk.split('\n');

while (true) {
    var hw = lines.shift().split(' ').map(Number);
    if (hw.every(isZero)) {
        break;
    }
    drawFrame(hw[0], hw[1]);
}

Measured memory_bytes: 16476
/*
    Created by Tejas Chaudhari
    link:
*/

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;

void re_curse()
{
    ll n,m;
    cin>>n>>m;
    ll sum=0;
    for(int i=0;i<m;i++)
    {
        ll x;
        cin>>x;
        sum+=x;
    }
    if(n-sum<0)
    {
        cout<<-1<<endl;
    }
    else
    {
        cout<<n-sum<<endl;
    }
    
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    re_curse();
    return 0;
}

Measured memory_bytes: 3640
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String a = sc.next();
        String b = sc.next();
        String c = sc.next();
        int count = 0;
        for (int i = 0 ; i < n ; i++) {
            Set<String> set = new HashSet<>();
            set.add(a.substring(i, i+1));
            set.add(b.substring(i, i+1));
            set.add(c.substring(i, i+1));
            count += set.size() - 1;
        }
        System.out.println(count);
    }

}

Measured memory_bytes: 23764
from collections import defaultdict
N,T=map(int,input().split())
A=[int(i) for i in input().split()]
mi=A[0]
s=0
dd=defaultdict(int)
for i in range(1,N):
    mi=min(mi,A[i])
    s=max(A[i]-mi,s)
    dd[A[i]-mi]+=1
print(dd[s])

Measured memory_bytes: 21032
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
int main(){
    ll n;
    cin >> n;
    ll ans;
    if(n%2==0) ans = n/2-1;
    else ans = n/2;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using pii=pair<int,int>;
using ll=long long;

#define fi first
#define se second
#define pb push_back
#define rep(i,n) for(int i=0; i<(int)(n); i++)

int main() {
	int n,r;
	cin >> n >> r;
	if(n>=10) cout << r << endl;
	else cout << r+100*(10-n) << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define int long long
#define ld long double
#define fi first
#define se second
#define all(uiet) uiet.begin(),uiet.end()
#define read(UIET) for(int i = 0; i < n; ++i) cin >> UIET[i]
#define out(UIET) for(int i = 0; i < n; ++i) cout << UIET[i] << " "
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define vpp vector<pair< int, int > >
#define pll pair<int , int >
#define ppll pair < pll , pll >
#define debug(n1) cout << n1 << endl
#define len(a) ((int) (a).size())
#define endl "\n"
#define mod 1000000007
const int INF=(1LL<<60)-1;
bool isPerfectSquare(long double x) {   
    long double sr = sqrt(x); 
    return ((sr - floor(sr)) == 0); 
} 
bool isPrime(int x){
    for(int i = 2; i * i <= x; ++i){
        if(x % i == 0) return 0;
    }
    return 1;
}
int fun(int n){
    if(n & 1) return 3 * n + 1;
    else return n/2;
}
int32_t main(){
    SPEED;
    int a, b, m;
    cin >> a >> b >> m;
    int arr[a], brr[b];
    for(int i = 0; i < a; ++i){
        cin >> arr[i];
    }
    for(int i = 0; i < b; ++i){
        cin >> brr[i];
    }
    int ans = *min_element(arr, arr + a) + *min_element(brr, brr + b);
    while(m--){
        int x, y, c;
        cin >> x >> y >> c;
        x--;
        y--;
        if(x <= a && y <= b){
            int cal = arr[x] + brr[y] - c;
            ans = min(ans, cal);
        }
    }
    cout << ans ;
}


Measured memory_bytes: 5224
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.NoSuchElementException;
import java.util.stream.IntStream;

public class Main {

	public static void main(String[] args) throws IOException {
		new Main().solve();
	}

	private void solve() throws IOException {
		try {
			solveA();
			//			 solveB();
			//			 solveC();
			//			 solveD();
			//			 solveE();
			//			 solveF();
		} finally {
			if (in != null) {
				in.close();
			}
			if (out != null) {
				out.flush();
				out.close();
			}
		}

	}

	private void solveA() {
		int[] wk = IntStream.range(0, 3).map(i -> nextInt()).toArray();

		Arrays.sort(wk);

		out.println(wk[0] + wk[1]);
	}

	private void solveB() {
		int numN = nextInt();

		out.println("");
	}

	private void solveC() {
		int numN = nextInt();

		out.println("");
	}

	private void solveD() {
		int numN = nextInt();

		out.println("");
	}

	private void solveE() {
		int numN = nextInt();

		out.println("");
	}

	private void solveF() {
		int numN = nextInt();

		out.println("");
	}

	private final PrintWriter out = new PrintWriter(System.out);
	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;
	}

	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}

	private void skipUnprintable() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr]))
			ptr++;
	}

	public boolean hasNext() {
		skipUnprintable();
		return hasNextByte();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

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

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

Measured memory_bytes: 26580
#include<bits/stdc++.h>
#define rep(i, x) for (ll i = 0; i < (x); i++)

using namespace std;
typedef long long int ll;

int main(void) {
  ll N, K;
  cin >> N >> K;
  vector<ll> a(N);
  rep(i, N)
    cin >> a[i];
  sort(begin(a), end(a));
  ll ans = 0;
  rep(i, K)
    ans += a[i];
  cout << ans << endl;
  return 0;
}


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

int main(){
    int n;
    cin >> n;
    vector<tuple<string,int,int> > spm;
    for (size_t i = 0; i < n; i++)
    {
        int p;
        string s;
        int m = i+1;
        cin >> s >> p;
        spm.push_back(make_tuple(s,-p,m));
    }
    sort(spm.begin(),spm.end());
    for(auto e:spm){
        cout << get<2>(e) << endl;
    }
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
int main(int argc, char *argv[]){
        int People, Kind;
        scanf("%d %d", &People, &Kind);
        int i,j;
        int victim[1001];
        int tmp, index;
        int gaisha = 0;
        for(i = 0; i < 1001; i++){
                victim[i] = 0;
        }
        for(i = 0; i < Kind; i++){
                scanf("%d", &tmp);
                for(j = 0; j < tmp; j++){
                        scanf("%d", &index);
                        victim[index] = 1;
                }
        }
        for(i = 1; i <= People;i++){
                if(victim[i] == 0){
                        gaisha++;
                }
        }
        printf("%d\n", gaisha);
        return 0;
}

Measured memory_bytes: 1736
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

s = list(input())
q = I()
front = []
back = []
cnt = 0
for _ in range(q):
    query = input().split()
    if query[0] == "1":
        cnt += 1
    else:
        if query[1] == "1":
            if cnt % 2 == 0:
                front.append(query[2])
            else:
                back.append(query[2])
        else:
            if cnt % 2 == 0:
                back.append(query[2])
            else:
                front.append(query[2])

if cnt % 2 == 0:
    print(''.join(front[::-1])+''.join(s)+''.join(back))
else:
    print(''.join(back[::-1])+''.join(s[::-1])+''.join(front))


Measured memory_bytes: 73848
#include<cstdio>
#include<cstring>
#include<cmath>
#include<bitset>
#include<iostream>
#include<algorithm>
#include<string>
#include<utility>
#include<tuple>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<numeric>
#include<functional>
#include<iomanip>
#include<random>

#define IOS ios::sync_with_stdio(false),cin.tie(0)
#define REP(i,n) for(int i = 0;i < n;i++)
#define FOR(i,a,b) for(int i = a;i < b;i++)
#define MEM(a,b) memset(a,b,sizeof(a))
#define ALL(x) (x).begin(),(x).end()
#define LMAX 9223372036854775807
#define LMIN -9223372036854775808

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<ull, ull> UP;
typedef tuple<int, int, int> T;

struct UnionFind {
	vector<int> data;
	UnionFind(int size) : data(size, -1) {}
	void unionSet(int x, int y) {
		x = root(x), y = root(y);
		if (x != y) {
			if (data[y] < data[x])swap(x, y);
			data[x] += data[y]; data[y] = x;
		}
	}
	bool findSet(int x, int y) {
		return root(x) == root(y);
	}
	int root(int x) {
		return data[x] < 0 ? x : data[x] = root(data[x]);
	}
	int size(int x) {
		return -data[root(x)];
	}
};

int gcd(int a, int b) {
	if (a < b)swap(a, b);
	int k = a % b;
	if (k == 1)return 1;
	if (k == 0)return b;
	int ans = gcd(b, k);
	return ans;
}
int digisum(ll a) {
	int sum = 0;
	while (a) {
		sum += a % 10;
		a /= 10;
	}
	return sum;
}


int main() {
	IOS;
	ll sum = 0;
	string s;
	cin >> s;
	REP(i, 3) {
		if (s[i] == '1')sum++;
	}
	cout << sum << endl;
}



Measured memory_bytes: 256