akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

int main(){
  long long N,Q;
  cin >> N >> Q;
  vector<long long> V1(N-2,N-2), V2(N-2,N-2);
  
  long long ans = (N-2)*(N-2), now1 = N-2, now2 = N-2;
  for(int i=0;i<Q;i++){
    long long q,x;
    cin >> q >> x;
    x -= 2;
    
    if(q==1){
      if(x<now1){
        ans -= now2;
        for(int j=x;j<now1;j++){
          V1[j] = now2;
        }
        now1 = x;
      }
      else{
        ans -= V1[x];
      }
    }
    if(q==2){
      if(x<now2){
        ans -= now1;
        for(int j=x;j<now2;j++){
          V2[j] = now1;
        }
        now2 = x;
      }
      else{
        ans -= V2[x];
      }
    }
  }
  
  cout << ans << endl;
  return 0;
}


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

int main(void){
	
	int a, b, d, count, z;
		
	while(cin >> a){
	  cin >> b;
		z = a + b;
		d = 10;
	  count = 1;
		while(z / d){
  		count++;
  		d *= 10;
		}
		cout << count << endl;
	}
	
	return 0;
}

Measured memory_bytes: 1160
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#include<iomanip>
#include<set>
#include<bitset>
#define rep(index,num) for(int index=0;index<num;index++)
#define rep1(index,num) for(int index=1;index<=num;index++)
#define brep(index,num) for(int index=num-1;index>=0;index--)
#define brep1(index,num) for(int index=num;index>0;index--)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-7
#define mp(a1,a2) make_pair(a1,a2)
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef long long ll;
typedef long double ld;
using namespace std;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
ll INFl=1e+18+1;
int INF=1e+9+1;
ll gcd(ll x,ll y){
	if(y==0) return x;
	return gcd(y,x%y);
}
ll lcm(ll x,ll y){
	return x/gcd(x,y)*y;
}
int main(){
	int N;
	ll M,a[100001],lcm1=1,lcm2=1;
	scan(N>>M);
	rep(i,N){
		scan(a[i]);
	}
	ll yaku2=gcd(a[0],(1LL<<30));
	int flag=1;
	rep(i,N) if(yaku2!=gcd(a[i],(1LL<<30))) flag=0;
	if(flag){
		rep(i,N){
			lcm2=lcm(lcm2,a[i]);
			if(lcm2>M) break;
		}
		rep(i,N){
			lcm1=lcm(lcm1,a[i]/2);
			if(lcm1>M) break;
		}
		prin(M/lcm1-M/lcm2);
	}
	else{
		prin(0);
	}

	return 0;
}


Measured memory_bytes: 1024
package main

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

func main() {
	sc := NewScanner()

	n := sc.NextInt()
	s := sc.NextLine()
	ss := strings.Split(s, " ")
	ans := ""
	for i := 0; i < n; i++ {
		ans += fmt.Sprintf("%s%s", string(ss[0][i]), string(ss[1][i]))
	}
	fmt.Printf("%v\n", ans)

}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r: rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			result = append(result, v)
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	result = append(result, v)

	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}


Measured memory_bytes: 640
#include<iostream>
#include<string>
#include<vector>
#include<stdio.h>
#include<algorithm>
#include<stdlib.h>
#define _USE_MATH_DEFINES
#include<math.h>
#include<numeric>
#include<iomanip>
using namespace std;
int main() {
	int a, b, c;
	cin >> a >> b >> c;
	for (int i = 1; i <= b; i++) {
		if (a*i%b == c) {
			cout << "YES" << endl;
			break;
		}
		else if (i == b) {
			cout << "NO" << endl;
		}
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using Int = int64_t;
using UInt = uint64_t;
using C = std::complex<double>;
#define rep(i, n) for(Int i = 0; i < (Int)(n); ++i)
#define guard(x) if( not (x) ) continue;
#ifndef LOCAL_
#define fprintf if( false ) fprintf
#endif

int main() {
   std::string ss;
   std::cin >> ss;
   ss[3] = '8';
   printf("%s\n", ss.c_str());
}


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

#define ll long long
#define INF 99999999
#define INF_LL 1LL << 60
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define REP(i, a, n) for(int i = a; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

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

template < typename T > std::string to_string( const T& n )
{
    std::ostringstream stm ;
    stm << n ;
    return stm.str() ;
}

ll nCr(int n,int r){
    if(r==1)return n;
    if(r==2)return n*(n-1)/2;
    return n*(n-1)*(n-2)/6;
}

int main()
{
    int N;
    cin >> N;
    vector<ll> A(N);
    vector<ll>nums(N+1,0);
    rep(i,N)
    {
        cin >> A[i];
        nums[A[i]-1]++;
    }
    ll total = 0;
    rep(i, nums.size())
    {
        //total += nCr(nums[i],2);
        total += nums[i] * (nums[i]-1) /2;
    }

    rep(i,N)
    {
        ll tmp = nums[A[i]-1]-1;
        cout << total - tmp << endl;
    }
}


Measured memory_bytes: 5760
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <cmath>
#include <limits.h>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <functional>
#include <stdio.h>
using namespace std;

long long MOD = 1000000007;

int main() {
    
    int M;
    cin >> M;
    cout << 24+24-M << endl;
    
    
    
    
    return 0;
}

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

const double PI = 3.1415926535897932384626433832795;

inline double deg2rad(const double deg)
{
  return deg * PI / 180.0;
}

int main()
{
  double x = 0.0, y = 0.0, angle = 0.0;
  int step, deg;
  while (scanf("%d,%d", &step, &deg) != EOF) {
    if (step == 0 && deg == 0)
      break;

    x += step * sin(deg2rad(angle));
    y += step * cos(deg2rad(angle));

    angle += deg;

  }
  cout << static_cast<int>(x) << endl;
  cout << static_cast<int>(y) << endl;

  return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define maxn 100086

using namespace std;

int x, y, z;
multiset<string> st;

int main(){
	scanf("%d%d%d", &x, &y, &z);
	for(int i = 1;i <= x;i++) st.insert("a");
	for(int i = 1;i <= y;i++) st.insert("b");
	for(int i = 1;i <= z;i++) st.insert("c");
	while(st.size() > 1){
		string s = *st.begin(), t = *st.rbegin();
		st.erase(st.find(s)), st.erase(st.find(t));
		st.insert(s + t);
	}
	printf("%s", st.begin()->c_str());
}

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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> Pi;
typedef vector<ll> Vec;
typedef vector<int> Vi;
typedef vector<string> Vs;
typedef vector<vector<ll>> VV;
typedef vector<vector<int>> VVi;

#define REP(i, a, b) for(ll i=(a); i<(b); i++)
#define PER(i, a, b) for(ll i=(a); i>=(b); i--)
#define rep(i, n) REP(i, 0, n)
#define per(i, n) PER(i, n, 0)
const ll INF=1e18+18;
const ll MAX=100005;
const ll MOD=1000000007;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define YES(n) cout << ((n) ? "YES" : "NO") << endl;
#define ALL(v) v.begin(), v.end()
#define rALL(v) v.rbegin(), v.rend()
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a,b)
#define Each(a,b) for(auto &a :b)
#define REPM(i, mp) for (auto i = mp.begin(); i != mp.end(); ++i)
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define dbgmap(mp) cerr << #mp << ":"<<endl; for (auto i = mp.begin(); i != mp.end(); ++i) { cerr << i->first <<":"<<i->second << endl;}
#define dbgarr(n,m,arr) rep(i,n){rep(j,m){cerr<<arr[i][j]<<" ";}cerr<<endl;}
#define dbgdp(n,arr) rep(i,n){cerr<<arr[i]<<" ";}cerr<<endl;
#define sum(v) accumulate(ALL(v),0)
#define fi first
#define se second

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

template<typename T1, typename T2>
ostream &operator<<(ostream &s, const pair<T1, T2> &p) { return s<<"("<<p.first<<", "<<p.second<<")"; }

// vector
template<typename T>
ostream &operator<<(ostream &s, const vector<T> &v) {
    int len=v.size();
    for(int i=0; i<len; ++i) {
        s<<v[i];
        if(i<len-1) s<<" ";
    }
    return s;
}

// 2 dimentional vector
template<typename T>
ostream &operator<<(ostream &s, const vector<vector<T> > &vv) {
    int len=vv.size();
    for(int i=0; i<len; ++i) {
        s<<vv[i]<<endl;
    }
    return s;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<std::setprecision(10);

    ll h,a;
    cin>>h>>a;
    ll ans=0;

    for(ll i=0; h>0; i++) {
        h -= a;
        ans++;
    }
    cout<<ans<<endl;
    return  0;
}


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

#define EPS (1e-5)

typedef complex<double> P;

vector<P> crossPoint(P a,P b){
	vector<P> res;

	if(abs(abs(b-a) - 2.0) < EPS){
		P c = a + b;
		res.push_back( P(c.real()/2,c.imag()/2) );
	}
	else if(abs(b-a) < 2.0){
		P ab = b - a; //A©çBÖÌxNg
		P center = a + P(ab.real()/2,ab.imag()/2); //ABÌ_ÖÌxNg
		P un1 = (ab * P(0, +1)) / abs(ab); //abÌ@üxNg1
		P un2 = (ab * P(0, -1)) / abs(ab); //abÌ@üxNg2
		double dist = sqrt(1 - pow(abs(ab) / 2, 2)); //ABÌ_©ç~Ìð_ÜÅÌ£
		P c1 = center + un1 * dist; //~Ìð_ÖÌxNg1
		P c2 = center + un2 * dist; //~Ìð_ÖÌxNg2

		res.push_back(c1);
		res.push_back(c2);
	}

	return res;
}

int main(void){
	int n;

	while(cin>>n,n){
		P p[n];
		for(int i=0;i<n;i++){
			double x,y;
			char ch;
			cin>>x>>ch>>y;
			p[i] = P(x,y);
		}

		int ans = 1;
		for(int i=0;i<n;i++){
			for(int j=i+1;j<n;j++){
				vector<P> v = crossPoint(p[i],p[j]);
				if(v.empty()) continue;
				int countA = 2;
				int countB = 2;
				for(int k=0;k<n;k++){
					if(i == k || j == k) continue;
					if(abs(v[0]-p[k]) - 1.0 < EPS) countA++;
					if(v.size() == 2 && abs(v[1]-p[k]) - 1.0 < EPS) countB++;
				}
				ans = max(ans,max(countA,countB));
			}
		}
		cout<<ans<<endl;
	}

	return 0;
}

Measured memory_bytes: 0
// Copyright 2020 yaito3014
#include <bits/stdc++.h>
using namespace std;

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  int a, b, c;
  cin >> a >> b >> c;
  cout << (b - a == c - b ? "YES" : "NO") << endl;
}


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

bool check(string s ,int n,int m){
    for(int i = n; i < m - n + 1 / 2; ++i){
        if(s[i] != s[m - i]) return false;
    }
    return true;
}

int main(){
    string s;
    cin >> s;
    bool ans1 = true,ans2 = true,ans3 = true;
    ans1 = check(s,0,s.size() - 1);
    ans2 = check(s,0,(s.size() - 1) / 2 - 1);
    ans3 = check(s,(s.size() + 3) / 2 - 1, s.size() - 1);
    if(ans1 && ans2 && ans3){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#define MAX 100000

int Partition(int*, int, int);
void Swap(int*, int*);

main(){
  int n, i, x;
  int A[MAX];

  scanf("%d", &n);

  for( i = 0; i < n; i++){
    scanf("%d", &A[i]);
  }

  x = Partition(A, 0, n-1);

  for( i = 0; i < n; i++){
    if( i == x ) printf("[%d]", A[i]);
    else printf("%d", A[i]);
    if( i < n-1 ) printf(" ");
  }

  printf("\n");

  return 0;

}



int Partition(int *A, int p, int r){
  int x, i, j, k;

  x = A[r];
  i = p-1;

  for( j = p; j < r; j++){
   
    if( A[j] <= x ){
      i = i+1;
      Swap(&A[i], &A[j]);
    }
    
  }

  Swap(&A[i+1], &A[r]);

  return i+1;
  
}



void Swap(int *A, int *B){
  int x;

  x = *A;
  *A = *B;
  *B = x;

}

Measured memory_bytes: 992
/*
    Author: Alam Khan
    AUST CSE 40th Batch

*/

#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;

typedef long long ll;
typedef pair<ll,ll> pll;
typedef vector<ll> vl;
typedef deque<ll> dl;
typedef stack<ll> stl;
typedef set<ll> sl;
typedef map<string, ll> msl;
typedef map<ll,ll> mll;
typedef tree<ll,null_type,less_equal<ll>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
#define sf(n)     scanf("%lld",&n)
#define sff(n,m)     scanf("%lld %lld",&n,&m)
#define sfff(n,m,r)     scanf("%lld %lld %lld",&n,&m,&r)
#define sfs(n)     scanf("%s",n)
#define pf(n)     printf("%lld\n",n)
#define pff(n,m)     printf("%lld %lld\n",n,m)
#define pfff(n,m,r)     printf("%lld %lld %lld\n",n,m,r)
#define pfs(n)     printf("%s\n",n)
#define pfcs(i,n)     printf("Case %lld: %lld\n",i,n)
#define pb     push_back
#define prf     printf
#define inf     2e18
#define low     -1000000000000
#define PI        acos(-1.0)
#define rep1(i,n) for(i=1;i<n;i++)
#define rep0(i,n) for(i=0;i<n;i++)
#define rep(i,a,n) for(i=a;i<n;i++)
#define repe1(i,n) for(i=1;i<=n;i++)
#define repe0(i,n) for(i=0;i<=n;i++)
#define repe(i,a,n) for(i=a;i<=n;i++)
#define endl  "\n"
#define FAST  ios_base::sync_with_stdio(false);cin.tie(NULL);
#define fr freopen("input.txt","r",stdin)
#define fw freopen("output.txt","w",stdout)

int main()
{
    ll i,n,t,k,j,x=0,y=0,m;
    cin>>n>>m>>k>>x;
    if(x<=n && x>0)
    {
        y+= x;
        x = 0;
    }
    else if(x>0)
    {
        y+= n;
        x-= n;
    }
    //cout<<x<<" "<<y<<endl;
    if(x<=m && x>0)
    {
        x = 0;
    }
    else if(x>0)
    {
        x-= m;
    }
    //cout<<x<<" "<<y<<endl;
    if(x<=k && x>0)
    {
        y-= x;
    }
    else if(x>0)
    {
        y-= k;

    }
    cout<<y<<endl;
    return 0;
}



Measured memory_bytes: 3632
/*
_____________________$$o____________________o$$$$$o__
___________________o$o_$$o____oo$$$$$$$oo______o$$$$o
______________$o________o$$$$$o___oo$$$$$$$o______$$$
______________$$$ooo________o$$$$o______o$$$$$o_____o
____________oo_____oo_____oo___o$$$$$______$$$$$$____
_________ooooo___$$o_$___oooooo___o$$$$o__o__o$$$$___
_______ooo__ooo$$$$o_$$ooooooooooo__o$$$o__oo_oo$$$o_
______oo_o$$o_$$_o$o_o$o__oooooooooo__o$$$o_oo__o$$$o
____oooooo$$$$o___oo__$$o_ooo_oooooooo__o$$o_ooo_o$$$
___ooooooo__o___oooo__$$ooooo$_oooooooo__o$$__ooo_$$$
_$$o_ooooo___o$$$$$o__o$o__o_$o__oooooooo_o$$o_oo__$$
_$$$o_ooo_________o$$_$$o____$$o_ooooooooo_$$$o_oo_$$
__oo________o$$o____o_$$o____o$ooooooooooo_o$$o_oo_o$
___o$$$$$$$$$$$$$o___$$$o____$$o_oooooooooo_$$$o_o_o$
________o__oo$$$$$o__$$$o____$$o____oooooo__$$$o_o_o$
_________$$$$$$$$$o__$$_____$$$o___________$$$oooooo_
__________o$$$$$$$o_________$$___________o$o___oooooo
___________o$$$$o_______________ooooo__oo$__ooo__oooo
________________________________ooo_$$oo___oooo$o____
________________________________oooo_$$$$$o___oo$$$o_
________________________________ooooo_o$$$$$o_____$$$
________________________________oooooo_o$$$$$$ooo___o
________________________________ooooooo__o$$$$$o_____
*/
#include<bits/stdc++.h>
#define ll long long
#define ft first
#define sd second
#define HageBaIO_KPOCCbI int LOL;scanf("%d", &LOL);for(int i = 0; i < LOL; i++)
#define Terrorist ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
//BY |3 |<
const int dx[] = {1, 0, -1,  0};
const int dy[] = {0, 1,  0, -1};
//Where I am?
const ll N = 1e5 + 5;
const ll NN = 1e3 + 3;
const ll MOD = (1e9 + 7);
const ll MOD1 = 998244353;
const double PI = 3.14159265;
const int INF32 = 2e9;
const ll INF64 = 2e18;
//Don`t believe!!!//
int n, m, k, col[N], c, sz[N];
vector<int>g[N], h[N];
bool used[N];
void dfs(int v){
	used[v] = 1;
	col[v] = c;
	sz[c]++;
	for(int i = 0; i < g[v].size(); i++){
		if(!used[g[v][i]])dfs(g[v][i]);
	}
}
void KEK(){
	cin>>n>>m>>k;
	for(int i = 0, a, b; i < m; i++){
		cin>>a>>b;
		g[a].push_back(b);
		g[b].push_back(a);
	}
	for(int i = 1; i <= n; i++){
		if(!used[i]){
			dfs(i);
			c++;
		}
	}
	for(int i = 0, a, b; i < k; i++){
		cin>>a>>b;
		if(col[a] == col[b]){
			h[a].push_back(b);
			h[b].push_back(a);
		}
	}
	for(int i = 1; i <= n; i++){
		cout<<int(sz[col[i]]) - int(g[i].size()) - int(h[i].size()) - 1<<" ";
	}
}
int main(){
	Terrorist
	//HageBaIO_KPOCCbI
	KEK();
	return 0;
}
//TAUMAC, 9| BbIWEJI 3A TObOU!!!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Measured memory_bytes: 12280
#include <iostream>

using namespace std;

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


int main(){
  int a, b;
  cin >> a >> b;
  string s;
  cin >> s;
  rep(i, s.size()){
    if(s[i] == '-'){
      if(i != a){
        cout << "No" << endl;
        return 0;
      }
    }
    if(i == a){
      if(s[i] != '-'){
        cout << "No" << endl;
        return 0;
      }
    }
  }
  cout << "Yes" << endl;
  return 0;
}


Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var k, t int
	fmt.Scan(&k, &t)
	as := make([]int, t)
	for i := 0; i < t; i++ {
		fmt.Scan(&as[i])
	}

	if t == 1 {
		fmt.Println(k - 1)
		return
	}

	mx := 0
	for i := 0; i < t; i++ {
		if as[i] > mx {
			mx = as[i]
		}
	}

	if mx <= k/2 {
		fmt.Println(0)
	} else {
		fmt.Println(k - ((k-mx)*2 + 1))
	}
}


Measured memory_bytes: 512
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<list>
#include<queue>
#include<stack>
#include<deque>
using namespace std;

int main() {
		double x1, y1, x2, y2, x3, y3, x4, y4;
		while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4) {
			double x5 = x2 - x1, y5 = y2 - y1, x6 = x4 - x3, y6 = y4 - y3;
			if (x5 == 0 && y5 == 0 || x6 == 0 && y6 == 0) {
				puts("NO");
			}
			else if (x5 == 0 && y6 == 0 || x6 == 0 && y5 == 0) {
				puts("YES");
			}
			else if (x5 == 0 || x6 == 0 || y5 == 0 || y6 == 0) {
				puts("NO");
			}
			else if (abs(-1 - (x6 / y6)*(x5 / y5)) <= 0.0000001) {
				puts("YES");
			}
			else puts("NO");
		}
}

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

typedef long long ll;
typedef long double ld;
typedef vector<vector<int>> Graph;
#define pi 3.14159265359
#define inf 2147483647
#define INF 9223372036854775807
#define mod 1000000007
#define mod2 998244353

int main() {
    int A, B, C; cin >> A >> B >> C;
    if (C <= A + B) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3608
import bisect

A,B,Q = map(int,input().split())
INF = 10**12
S = [int(input()) for _ in range(A)]
T = [int(input()) for _ in range(B)]

S.append(-INF)
S.append(INF)
T.append(-INF)
T.append(INF)

S.sort()
T.sort()

mini = INF

for _ in range(Q):
    x = int(input())
    #スタート地点より右にあって，一番近くにある神社のid
    s1 = bisect.bisect_right(S,x,)
    s2 = s1-1
    #スタート地点より右にあって，一番近くにある寺のid
    t1 = bisect.bisect_right(T,x,)
    t2 = t1-1
    for i in [S[s1],S[s2]]:
        mini = min(mini,abs(x-i)+min(abs(i-T[t1]),abs(i-T[t2])))
    for j in [T[t1],T[t2]]:
        mini = min(mini,abs(x-j)+min(abs(j-S[s1]),abs(j-S[s2])))
    print(mini)
    mini = INF

Measured memory_bytes: 12088
import sys

s = input()

n = len(s)

n1 = int(n/2)

for i in range(n1):
    if s[i] == s[-1-i]:
        pass
    else:
        print('No')
        sys.exit()

n2 = int((n-1)/2) - 1

for i in range(n2):
    if s[i] == s[n2-i]:
        pass
    else:
        print('No')
        sys.exit()

n3 = int((n+3)/2)

diff = n-n3

n3 -= 1
n  -= 1

diff = int(diff/2)

for i in range(diff):
    if s[n3+i] == s[n-i]:
        pass
    else:
        print('No')
        sys.exit()

print('Yes')


Measured memory_bytes: 3064
# -*- coding: utf-8 -*-

import collections

n = int(input())
V = [int(i) for i in input().split()]

v_even = collections.Counter(V[0::2])
v_odd  = collections.Counter(V[1::2])

v_even_s = sorted(v_even.items(), key=lambda x:x[1], reverse=True)
v_odd_s  = sorted(v_odd.items(), key=lambda x:x[1], reverse=True)

if len(set(V)) == 1:
    print(int(len(V)/2))
elif v_even_s[0][0] == v_odd_s[0][0]:
    if v_even_s[0][1] > v_odd_s[0][1]:
        print(len(V) - v_even_s[0][1] - v_odd_s[1][1])
    elif v_even_s[0][1] < v_odd_s[0][1]:
        print(len(V) - v_even_s[1][1] - v_odd_s[0][1])
    else:
        if v_even_s[1][1] > v_odd_s[1][1]:
            print(len(V) - v_even_s[1][1] - v_odd_s[0][1])
        else:
            print(len(V) - v_even_s[0][1] - v_odd_s[1][1])
else:
    print(len(V) - v_even_s[0][1] - v_odd_s[0][1])


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

ll dp[101][100001];
ll val[101],wt[101];
ll solve(ll n,ll w,ll i)
{
	if(w==0 || i==n)
		return 0;
	if(dp[i][w]!=-1)
		return dp[i][w];
	ll x=0,y=0;
	y=solve(n,w,i+1);
	if(w-wt[i]>=0)
	{
		x=solve(n,w-wt[i],i+1)+val[i];
	}
	return dp[i][w]=max(x,y);
}

int main()
{
	ll n,w;
	cin>>n>>w;
	for(ll i=0;i<n;i++)
	{
		cin>>wt[i]>>val[i];
	}
	memset(dp,-1,sizeof(dp));
	cout<<solve(n,w,0);
	return 0;
}

Measured memory_bytes: 79104
from collections import deque

q = int(input())
a = deque()
for _ in range(q):
    op = list(map(int, input().split()))
    if op[0] == 0:
        a.append(op[1])
    elif op[0] == 1:
        print(a[op[1]])
    elif op[0] == 2:
        a.pop()



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

int main(){
    ll a[5];
    ll ans = 643;
    for(int i = 0; i < 5; i++) cin >> a[i];
    
    for(int i = 0; i < 5; i++){
        ll tmp = 0;
        for(int j = 0; j < 5; j++){
            if(i != j){
                tmp += a[j];
                if(a[j] % 10 != 0)
                    tmp = 10 * ((tmp/10) + 1);
            }
        }
        tmp += a[i];
        if(ans > tmp) ans = tmp;
    }
    
    cout << ans << "\n";
    return 0;
} 


Measured memory_bytes: 256
import sys

for line in sys.stdin:

    a_str, op, b_str = line.split()

    if op == '?': break
    
    a, b = int(a_str), int(b_str)

    if op == '+':
        print a + b
    elif op == '-':
        print a - b
    elif op == '*':
        print a * b
    elif op == '/':
        print a / b

Measured memory_bytes: 4200
#include<iostream>
#include<vector>
#include<algorithm>

typedef long long int ll;

using namespace std;

int main(void){

    ll n, ans, count = 0;
    cin >> n;

    vector<ll> carry(5), tmp(5);
    for(int i = 0;i < 5;i++){
        cin >> carry[i];
    }

    tmp = carry;

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

    ans = (tmp[0] != 0 ? (n+tmp[0]-1) / tmp[0] + 4 : 0);

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      double count = 0.0;
      for(int i = 1; i <= n; i++){
        if(i%2 == 1) count++;
      }
      System.out.println(count/n);
      }
}

Measured memory_bytes: 22356
#include<iostream>
#include<cmath>
using namespace std;
int main(){
  int N, Y, y, A, B, C;
  cin >> N >> Y;
  y = Y/1000;
  A = Y/10000;
  B = Y/5000;
  for(int i=0; i<=A; i++){
    for(int j=0; j<=B; j++){
      if(9*i+4*j == y-N && N-i-j>=0){
        C=N-i-j;
        printf("%i %i %i",i, j, C);
        return 0;
      }
    }
  }
  printf("-1 -1 -1");
  return 0;
}

Measured memory_bytes: 3724
#include <iostream>
#include <string>
#include <bits/stdc++.h>
#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define map map <int,int> 
#define hashmap unordered_map <int,int>
#define Set set <int>
#define hashset unordered_set <int> 
#define array vector <int> 
#define Pair pair<int,int>
using namespace std;

// void minput(int mat[][],int n,int m)
// {
//     for(int i=0;i<n;i++)
//     {
//         for(int j=0;j<m;j++)
//         cin>>mat[i][j];
//     }
// }

// void minput(int mat[][],int n,int m)
// {
//     for(int i=0;i<n;i++)
//     {
//         for(int j=0;j<m;j++)
//         cout<<mat[i][j]<<" ";
//         cout<<endl;
//     }
// }

void input(int arr[],int n)
{
    for(int i=0;i<n;i++)
    cin>>arr[i];
}

void output(int arr[],int n)
{
    for(int i=0;i<n;i++)
    cout<<arr[i]<<" ";
    
    cout<<endl;
}


int main() 
{
    FIO;
    string str1,str2;
    int count = 0;
    cin>>str1;
    cin>>str2;
    
    for(int i=0;i < min(str1.length(),str2.length());i++)
    {
        if(str2[i] == str1[i])
        count++;
    }
    cout<<count<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <set>
#include <map>

using namespace std;

int main()
{
	int ans = 0;
	long long int x,y;
	cin >> x >> y;
	while(x <= y){
		ans++;
		x *=2;
	}
	cout << ans << endl;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n; cin >> n;
  vector<long long> a(n),b(n);
  for(int i=0; i<n; i++) cin >> a[i] >> b[i];
  sort(a.begin(),a.end());
  sort(b.begin(),b.end());
  if(n%2 == 0){
    long long min = a[n/2-1]+a[n/2];
    long long max = b[n/2-1]+b[n/2];
    cout << max-min+1 << endl;
  }
  else{
    long long min = a[n/2];
    long long max = b[n/2];
    cout << max-min+1 << endl;
  }
}

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

int main(void){
    int n, m;
    cin >> n >> m;
    if (n == 1) {
        int a1;
        cin >> a1;
        for (int i = 0; i < m; i++) {
            a1 /= 2;
        }
        cout << a1 << endl;
        return 0;
    }

    priority_queue<int> a;
    for (int i = 0; i < n; i++) {
        int l;
        cin >> l;
        a.push(l);
    }
    for (int i = 0; i < m; i++) {
        int max = a.top();
        a.pop();
        a.push(max / 2);
    }

    long int sum = 0;
    for (int i = 0; i < n; i++) {
        sum += a.top();
        a.pop();
    }
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 892
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <bitset> // bitset
#include <deque> // deque
#include <iomanip> //setprecsion
#include <iostream> // cout, endl, cin
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <string> // string, to_string, stoi
#include <tuple> // tuple, make_tuple
#include <utility> // pair, make_pair
#include <vector> // vector

#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <cmath> //sin, cos, tan

using namespace std;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rrep(i, n) for (ll i = (n - 1); i >= 0; --i)
#define blank(ans) cout << (ans) << " ";
#define mp(p, q) make_pair(p, q)
#define mt(p, q, r) make_tuple(p, q, r)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef string str;

typedef vector<ll> vll;
typedef vector<ld> vd;
typedef vector<bool> vb;
typedef vector<bitset<20>> vbi;
typedef vector<char> vc;
typedef vector<str> vs;
typedef vector<vector<ll>> vvll;
typedef vector<vector<ld>> vvd;
typedef vector<vector<bool>> vvb;
typedef vector<vector<char>> vvc;
typedef vector<vector<str>> vvs;
typedef vector<pair<ll, ll>> vpll;
typedef vector<tuple<ll, ll, ll>> vtlll;

const ld PI = acos(-1.0);
const ll MAX = 9000000000000000000;
const ll MIN = -9000000000000000000;
const ld DMAX = 4500;
const ld DMIN = -4500;
const ll MOD = 1000000007;

template <typename T>
void fin(T a)
{
  cout << a << endl;
  exit(0);
}

//桁数
ll GetDigit(ll num)
{
  return log10(num) + 1;
}

//約数全列挙
vector<ll> enum_div(ll n)
{
  vector<ll> ret;
  for (ll i = 1; i * i <= n; ++i)
  {
    if (n % i == 0)
    {
      ret.push_back(i);
      if (i * i != n)
      {
        ret.push_back(n / i);
      }
    }
  }
  sort(begin(ret), end(ret));
  return ret;
}

//累乗(xのn乗%mod)
ll modpow(ll x, ll n, ll mod = MAX)
{
  ll res = 1;
  while (n > 0)
  {
    if (n & 1)
      res = res * x % mod;
    x = x * x % mod;
    n >>= 1;
  }
  return res;
}

//階乗
ll factorial(ll n)
{
  if (n > 0)
    return n * factorial(n - 1);
  else
    return 1;
}

ll modinv(ll a, ll mod)
{
  ll b = mod, u = 1, v = 0;
  while (b)
  {
    ll t = a / b;
    a -= t * b;
    swap(a, b);
    u -= t * v;
    swap(u, v);
  }
  u %= mod;
  if (u < 0)
    u += mod;
  return u;
}

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

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

void Main()
{
  ll sx, sy, gx, gy; cin >> sx >> sy >> gx >> gy;
  rep(i, gx - sx) cout << 'R';
  rep(i, gy - sy) cout << 'U';
  rep(i, gx - sx) cout << 'L';
  rep(i, gy - sy) cout << 'D';
  cout << 'D';
  rep(i, gx - sx + 1) cout << 'R';
  rep(i, gy - sy + 1) cout << 'U';
  cout << "LU";
  rep(i, gx - sx + 1) cout << 'L';
  rep(i, gy - sy + 1) cout << 'D';
  cout << "R\n";
}

//前処理
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(20); //高精度少数表示
  //cout << setfill('0') << internal << setw(4); 0埋め４桁
  Main();
  return 0;
}


Measured memory_bytes: 256
x = int(input())

cnt = 0
if x % 11 == 0:
    cnt = (x // 11) * 2
elif 1 <= x % 11 <= 6:
    cnt = (x // 11) * 2 + 1
elif 7 <= x % 11 <= 10:
    cnt = (x // 11) * 2 + 2

print(cnt)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
int main(){
    int N,X;
    cin>>N>>X;
    
    int a=INT_MAX;
    rep(i,N){
        int m;
        cin>>m;
        X-=m;
        a=min(a,m);
    }
    
    int cnt=N+X/a;
    cout<<cnt<<endl;
}


Measured memory_bytes: 256
use std::io::*;
use std::str::FromStr;

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n = read::<i64>();
    let mut s = n;
    for _ in 0..5 {
        let a = read::<i64>();
        s = std::cmp::min(s, a);
    }
    let ans = (n + s - 1) / s + 4;
    println!("{}", ans);
}


Measured memory_bytes: 4352
#include <iostream>
#include <sstream>
#include <string>

using namespace std;

int main(){
	int n,m,k,j,tmp,cnt;
	bool c[1000],f;
	string input[10000],str;
	while(cin >> m >> n,m){
		cnt = 0;
		f = true;
		for(int i = 0;i < 1000;++i){
			c[i] = true;
		}
		for(int i = 0;i < n;++i){
			cin >> input[i];
		}
		j = k = 0;
		while(j != n && f){
			if(c[k]){
				stringstream ss;
				tmp = j + 1;
				str = "";
				if(tmp % 3 && tmp % 5) ss << tmp;
				if(tmp % 3 == 0) ss << "Fizz";
				if(tmp % 5 == 0) ss << "Buzz";
				ss >> str;
			//	cout << str << " " << input[j] << endl;
				c[k] = (str == input[j]);
				if(!c[k]) ++cnt;
				++j;
			}
			++k;
			if(k == m) k = 0;
			if(m - cnt == 1) f = false;
		}
		j = 0;
		for(int i = 0;i < m;++i){
			if(c[i]){
				if(j) cout << " ";
				cout << i + 1;
				++j;
			}
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 1852
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <set>
#include <algorithm>
#include <array>
#include <complex>
#include <string>
#include <utility>
#include <map>
#include <queue>
#include <list>
#include <functional>
#include <numeric>
#include <stack>
#include <tuple>

using namespace std;
int dx[4] = { -1,0,1,0 };
int dy[4] = { 0,1,0,-1 };
const int INF = 100000000;
const long long LINF = 1000000000000000000;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-6;
using pii = std::pair<int, int>;
using ll=long long;  
using pLL = std::pair<ll, ll>;

#define SORT(v) std::sort(v.begin(), v.end())
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll K,A,B;
    cin >> K >> A >> B;
    if(B-A<=1){
        cout << K+1 <<endl;
        return 0;
    }
    ll temp1=0,temp2=0,ans=0,diff=0;
    ans = B;
    diff=B-A;
    temp1=K-(A+1);
    temp2=temp1/2;
    if(temp1%2==0){
        ans+=diff*temp2;
    }else{
        temp2=(temp1-1)/2;
        ans+=diff*temp2;
        ans++;
    }
    cout << ans <<endl;
    return 0;
}

Measured memory_bytes: 256
import numpy as np

x1, y1, x2, y2 =map(int, input().split())  #複数数値入力

x3 = y1-y2+x2
y3 = x2-x1+y2
x4 = y1-y2+x1
y4 = x2-x1+y1

L = [x3,y3,x4,y4]
print(' '.join(map(str, L)))

Measured memory_bytes: 20248
import sys
input = sys.stdin.readline


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    N = readint()
    X = readstr()
    s = sum(tuple(map(int, X)))
    s1 = s + 1
    s2 = s - 1 if s != 1 else 1
    m1 = int(X, 2) % s1
    m2 = int(X, 2) % s2
    t1 = [1]
    t2 = [1]
    for i in range(N):
        t1.append(t1[i] * 2 % s1)
        t2.append(t2[i] * 2 % s2)
    for i in range(N):
        ans = 0
        if X[i] == '0':
            x = (m1 + t1[(N - i - 1)]) % s1
        else:
            if s == 1:
                print(0)
                continue
            else:
                x = (m2 - t2[(N - i - 1)]) % s2
        d = sum(tuple(map(int, bin(x)[2:])))
        ans += 1
        while x:
            x %= d
            d = sum(tuple(map(int, bin(x)[2:])))
            ans += 1
        print(ans)


if __name__ == "__main__":
    main()


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

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

    int n, k;
    cin >> n >> k;

    int arr[n];
    for (int i = 0; i < n; i++) cin >> arr[i];

    int dp[n];
    for (auto &i : dp) i = 0;
    dp[0] = 0;

    for (int i = 1; i < n; i++) {
        int temp = INT_MAX;
        for (int j = i - 1; j >= max(0, i - k); j--) {
            temp = min(temp, dp[j] + abs(arr[j] - arr[i]));
        }
        dp[i] = temp;
    }

    cout << dp[n - 1];

}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using str = string;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
const double PI = 3.141592653589793238;
const ll mod = 1000000007;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define REP(i, m, n) for (int i = m; i < (int)n; i++)
#define all(a) (a).begin(), (a).end()
#define allg(a) (a).begin(), (a).end(), greator<>()
#define d20 std::setprecision(20)
#define veci vector<int>
#define vecll vector<long long int>
#define vecd vector<double>
template <typename T>
T lcm(T a, T b)
{
	return a / __gcd(a, b) * b;
}
void comb(vector<vector<long long int>> &v)
{
	for (int i = 0; i < v.size(); i++)
	{
		v[i][0] = 1;
		v[i][i] = 1;
	}
	for (int k = 1; k < v.size(); k++)
	{
		for (int j = 1; j < k; j++)
		{
			v[k][j] = (v[k - 1][j - 1] + v[k - 1][j]);
		}
	}
}
bool is_not_out_of_range(size_t now, size_t max_num)
{
	return !(now < 0 || max_num <= now);
}
ll repeat_squaring(ll n, ll p, ll m)
{
	if (p == 0)
		return 1;
	if (p % 2 == 0)
	{
		ll t = repeat_squaring(n, p / 2, m);
		return t * t % m;
	}
	return n * repeat_squaring(n, p - 1, m);
}

int main()
{
	str a, b, c;
	cin >> a >> b >> c;
	cout << a[0] << b[0] << c[0] << endl;
	return 0;
}

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

int main()
{
    int64_t T1, T2, A1, A2, B1, B2;
    cin >> T1 >> T2 >> A1 >> A2 >> B1 >> B2;

    if (A1 < B1)
    {
        swap(A1, B1);
        swap(A2, B2);
    }

    if (A2 > B2)
    {
        cout << 0 << endl;
        return 0;
    }

    int64_t d1 = T1 * A1 - T1 * B1;
    int64_t d2 = T1 * (B1 - A1) + T2 * (B2 - A2);
    if (d2 < 0)
    {
        cout << 0 << endl;
    }
    else if (d2 == 0)
    {
        cout << "infinity" << endl;
    }
    else
    {
        if (d1 % d2 == 0)
        {
            cout << d1 / d2 * 2 << endl;
        }
        else
        {
            cout << d1 / d2 * 2 + 1 << endl;
        }
    }
}

Measured memory_bytes: 256
from datetime import datetime
def era(f):
    meiji_st  = datetime(1868, 9, 8)
    taisho_st = datetime(1912, 7,30)
    showa_st  = datetime(1926,12,25)
    heisei_st = datetime(1989, 1, 8)

    y,m,d = f
    dt = datetime(y,m,d)
    if dt >= heisei_st:
        ret = "heisei %d %d %d" % (dt.year - heisei_st.year+1,dt.month,dt.day) 
    elif dt >= showa_st:
        ret = "showa %d %d %d" % (dt.year - showa_st.year+1,dt.month,dt.day) 
    elif dt >= taisho_st:
        ret = "taisho %d %d %d" % (dt.year - taisho_st.year+1,dt.month,dt.day) 
    elif dt >= meiji_st:
        ret = "meiji %d %d %d" % (dt.year - meiji_st.year+1,dt.month,dt.day) 
    else:
       ret = "pre-meiji"

    return(ret)

while True:
    try:
        f = map(int, input().strip().split())
        print(era(f))
    except EOFError:
        break

Measured memory_bytes: 8152
#include <bits/stdc++.h>
using namespace std;
int main() {
    int N; cin>>N;
    vector<int> L(N);
    for(int i=0;i<N;i++){
        cin>>L[i];
    }
    sort(L.begin(),L.end());
    int gokei=0;
    for(int i=0;i<N-1;i++){
        gokei=gokei+L[i];
    }
    if(L[N-1]<gokei){
        cout<<"Yes";
    }
    else{
        cout<<"No";
    }
    return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
#include <utility>
#include <set>
#include <vector>
#include <functional>
#include <map>
#include <queue>
using namespace std;
int N;
int sumdig(int x)
{
  if (x<10) return x;
  return x%10+sumdig(x/10);
}
int main()
{
  cin>>N;
  int minsum=1000000;
  for (int i=1;i<=N/2;i++)
    minsum=min(minsum,sumdig(i)+sumdig(N-i));
  cout<<minsum<<endl;
  //system("pause");
  return 0;
}

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

int main() {
	int n;
	cin>>n;
	string s;
	cin>>s;
	int k;
	cin>>k;
	k--;
	for(int i=0;i<n;i++)
	{
		if(s[i]!=s[k])s[i]='*';
	}
	cout<<s;
	return 0;
}

Measured memory_bytes: 256
n = input()
ans = 0
for i in range(0,len(n)):
  if i % 2 == 1:
    max_num = 10 ** i 
    min_num = 10 ** (i-1)
    ans +=  max_num - min_num
if len(n) % 2 == 1:
  ans += int(n) - (10 ** (len(n)-1) - 1)
print(ans)

Measured memory_bytes: 9168
#include <iostream>
#include <cmath>
#include <string>
#include <typeinfo>
#include <climits>
#include <algorithm>
#include <cctype>
#include <stdio.h>
#include <cstdlib>
using namespace std;

int main(){
    int a,b;
    cin >> a >> b;
    cout << (a-1)*(b-1);
}


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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,n,m) for(int i=(int)(n); i<=(int)(m); i++)
#define RFOR(i,n,m) for(int i=(int)(n); i>=(int)(m); i--)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

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 (a>b) { a=b; return 1; } return 0; }

#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert

using namespace std;

/* Some Libraries */

//-------------------------------------------------

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin>>N;
    vll l(N);
    rep(i,N) cin>>l[i];
    sort(all(l));
    int ans=0;
    rep(i,N)FOR(j,i+1,N-1)FOR(k,j+1,N-1){
        if (l[i]!=l[j] && l[j]!=l[k] && l[i]+l[j]>l[k]) ans++;
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 3656
import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        int n = sc.nextInt();
        long[] nn = new long[10001];

        for (int x = 1; x <= 100; x++) {
            for (int y = 1; y <= 100; y++) {
                for (int z = 1; z <= 100; z++) {
                    int t = x * x + y * y + z * z + x * y + y * z + z * x;
                    if(t <= 10000) nn[t]++;
                }
            }
        }

        for (int i = 1; i <= n; i++) {
            System.out.println(nn[i]);
        }


    }




    private static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;
        private boolean hasNextByte() {
            if (ptr < buflen) {
                return true;
            }else{
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (buflen <= 0) {
                    return false;
                }
            }
            return true;
        }
        private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
        private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
        public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
        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();
            }
        }
        public int nextInt() {
            long nl = nextLong();
            if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
            return (int) nl;
        }
        public double nextDouble() { return Double.parseDouble(next());}
    }
}


Measured memory_bytes: 35852
import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from collections import deque
sys.setrecursionlimit(10**7)
def gcd(a,b):return fractions.gcd(a,b) #最大公約数
def lcm(a,b):return (a*b) // fractions.gcd(a,b) #最小公倍数
def iin(): return int(input()) #整数読み込み
def ifn(): return float(input()) #浮動小数点読み込み
def isn(): return input().split() #文字列読み込み
def imn(): return map(int, input().split()) #整数map取得
def fmn(): return map(float, input().split()) #浮動小数点map取得
def iln(): return list(map(int, input().split())) #整数リスト取得
def iln_s(): return sorted(iln()) # 昇順の整数リスト取得
def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得
def fln(): return list(map(float, input().split())) # 浮動小数点リスト取得
def join(l, s=''): return s.join(l) #リストを文字列に変換
def perm(l, n): return itertools.permutations(l, n) # 順列取得
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数
def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得
def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) #組み合わせの総数
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 # 2点間の距離
MOD = 10**9+7

N = iin()
p = fln()

dp = [[0 for _ in range(N+1)] for _ in range(N+1)]
dp[0][0] = 1.0

for i in range(N):
    for j in range(i+1):
        dp[i+1][j+1] += dp[i][j] * p[i]
        dp[i+1][j] += dp[i][j] * (1.0-p[i])
ans = 0.0
for i in range((N+1)//2, N+1):
    ans += dp[N][i]
print(ans)


Measured memory_bytes: 274548
#include <stdio.h>

int main(void){
  int N,H,W;
  int A[1000];
  int B[1000];
  int cnt = 0;
  int i;

  scanf("%d %d %d",&N,&H,&W);

  for(i=0;i<N;i++){
    scanf("%d %d",&A[i],&B[i]);
     if(A[i]>=H&&B[i]>=W)
      cnt += 1;
    }

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

  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(ll i = 0; i < (n); ++i)
#define repA(i, a, n) for(int  i = a; i <= (n); ++i)
#define all(x) x.begin(), x.end()
#define sz(x) (int) (x).size()
#define fill(a) memset(a, 0, sizeof(a))
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
#define endl '\n'
#define init(n) int n;cin>>n;int a[n];rep(i,n)cin>>a[i];
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long long int> vll;
typedef vector<pii> vii;
ll p=998244353 ;
ll add(ll a,ll b){
    ll t=(a+b);
    if(t>=p)t-=p;
        return t;
}
ll sub(ll a,ll b){
    ll t=a-b+p;
    t=t%p;
    return t;
}
ll power(ll a,ll x){
    if(x<0)return 1;
    ll r=1;
    while(x!=0){
        if(x%2==1){
            r=r*a;r%=p;
        }
        a=a*a;a%=p;
        x=x/2;
    }
    return r;
}
ll mul(ll a,ll b){
    ll t=(a*b);
    if(t>=p)t%=p;
    return t;
}
map<int,int> m;
int rec(int i){
    if(i==1)return 0;
    if(m.find(i)!=m.end())return m[i];
    int x;
    if(i%2==0){
        x=1+rec(i/2);
    }
    else{
        x=1+rec(3*i+1);
    }
    m[i]=x;
    return x;
}
int getKth(int lo, int hi, int k) {
    int arr[1001];
    memset(arr,-1,sizeof(arr));
    pair<int,int> b[hi-lo+1];
    for(int i=1;i<=1000;i++){
        if(arr[i]==-1){
            rec(i);
        }
        arr[i]=m[i];
    }
    for(int i=lo;i<=hi;i++){
        b[i-lo].first=arr[i];
        b[i-lo].second=i;
    }
    sort(b,b+hi-lo+1);
    return b[k-1].second;
}
int main() {
   
    cin.sync_with_stdio(0); cin.tie(0);
    cin.exceptions(cin.failbit);
    int T=1;
    // cin>>T;
    while(T--){
        int n,x,y;cin>>n>>x>>y;
        int ans[n]={0};
        int dp[n+1][n+1];
        memset(dp,0,sizeof(dp));
        for(int i=1;i<=n;i++){
            dp[x][i]=abs(x-i);
            dp[y][i]=abs(y-i);
        }
        dp[x][y]=1;
        dp[y][x]=1;
        for(int i=1;i<=n;i++){
            dp[x][i]=min(dp[x][i],1+dp[y][i]);
        }
        for(int i=1;i<=n;i++){
            dp[y][i]=min(dp[y][i],1+dp[x][i]);
        }
        for(int i=1;i<=n;i++){
            for(int j=1;j<=n;j++){
                dp[i][j]=abs(i-j);
                dp[i][j]=min({dp[i][j],dp[x][i]+dp[x][j],dp[y][i]+dp[y][j]});
                ans[dp[i][j]]++;
            }
        }
        for(int i=1;i<n;i++){
            cout<<ans[i]/2<<endl;
        }
    }   
    return 0;   
}   

Measured memory_bytes: 15872
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
typedef long long LL;
int main() {
	std::string up,down;
	std::cin >> up >> down;
	if (up[0] == down[2] && up[1] == down[1] && up[2] == down[0]) {
		std::cout << "YES" << std::endl;
	}
	else {
		std::cout << "NO" << std::endl;
	}

}

Measured memory_bytes: 256
# coding:utf-8

import sys
# from collections import Counter, defaultdict

INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


a, b, c = LI()
print(min(b // a, c))


Measured memory_bytes: 3060