akhauriyash/Code-Regression huggingface dataset:
def IslandsWar():
    n, m = map(int, input().split())
    a = [list(map(int,input().split())) for _ in range(m)]
    a.sort(key=lambda x: x[1])
    removes = [a[0][1]]

    for i, j in a[1:]:
        check = False
        for k in removes:
            if i < k:
                check = True
                break
        if not check:
            removes.append(j)
    print(len(removes))
            
if __name__ == "__main__":
    IslandsWar()


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

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  double a_i;
  cin >> n;
  double rec = 0;
  for (int i = 0; i < n; i ++) {
    cin >> a_i;
    rec += 1.0 / a_i;
  }
  cout << 1.0 / rec << endl;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
	int n,m;
	while(cin>>n>>m){
		if(n==0&&m==0)
			break;
		int ans=0;
		for(int i=n;i>0;i--){
			for(int j=i-1;j<i&&j>0;j--)
				for(int k=j-1;k<j&&k>0;k--){
					if(i+j+k==m){
						ans++;
					}			
				}
		}
		cout<<ans<<endl;
	}
	return 0;
}


Measured memory_bytes: 3100
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>

typedef unsigned long long ULLONG;
typedef long long LLONG;
static const LLONG MOD_NUM = 1000000007;

template<class _T> static void getint(_T& a) {
	std::cin >> a;
}
template<class _T> static void getint(_T& a, _T& b) {
	std::cin >> a >> b;
}
template<class _T> static void getint(_T& a, _T& b, _T& c) {
	std::cin >> a >> b >> c;
}

static void C();

int main()
{
	C();
	fflush(stdout);
	return 0;
}

static void C()
{
	LLONG N;
	getint(N);

	std::vector<char> name;
	while (N) {
		LLONG a = N % 26LL;
		if (a == 0) {
			name.insert(name.begin(), 'z');
			N--;
		}
		else {
			name.insert(name.begin(), a + 'a' - 1);
		}
		N /= 26;
	}
	for (int i = 0; i < name.size(); i++) {
		printf("%c", name[i]);
	}
	putchar('\n');
}


Measured memory_bytes: 3572
//Mahir Ratanpara (DA-IICT)
#include<bits/stdc++.h>
using namespace std;
#define Ff(i,a,n) for(i=a;i<n;i++)
#define Fr(i,a,n) for(i=a;i>n;i--)
#define ll long long
#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
typedef pair<ll, ll>	pa;
typedef vector<ll>		vc;
typedef vector<pa>		vp;
typedef vector<vc>		vvc;
int mpow(int base, int exp); 
void ipgraph(ll n,ll m);
void dfs(int u, int par);
const int mod = 1000000007;
const int N = 3e5, M = N;
typedef unsigned long long ull;
//=======================

vc g[N];

int main() {
    FAST;
    int n = 0; cin >> n;
        ull a[n]; ull ans = 1;
        for(int i=0; i<n; i++)
        {
            cin >> a[i];
            if(a[i]==0){
                cout << 0; return 0;
            }
        }
        for(int i=0; i<n; i++)
        {
            if(1000000000000000000/a[i]<ans){
                cout << "-1"; return 0;
            }
            ans *= a[i];
        }
        cout << ans;
    return 0;
}

int mpow(int base, int exp) {
  base %= mod;
  int result = 1;
  while (exp > 0) {
    if (exp & 1) result = ((ll)result * base) % mod;
    base = ((ll)base * base) % mod;
    exp >>= 1;
  }
  return result;
}

void ipgraph(ll n, ll m){
	int i, u, v;
	while(m--){
		cin>>u>>v;
		g[u-1].pb(v-1);
		g[v-1].pb(u-1);
	}
}

void dfs(int u, int par){
	for(int v:g[u]){
		if (v == par) continue;
		dfs(v, u);
	}
}

Measured memory_bytes: 11428
#include<iostream>
using namespace std;
int main(){
	int a,b,c,i,n=0;
	cin>>a>>b>>c;
	for(i=a;i<=b;i++){
		if(c%i==0){
			n++;
	}
	}
	cout<<n<<endl;
	return 0;
	}	

Measured memory_bytes: 1164
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main() {
	int a;
	int x[100];
	cin >> a;
	int max = 0;
	int min = 0;
	for (int i = 0; i < a;  i++) {
		cin >> x[i];
		if (i == 0) {
			min = x[i];
			max = x[i];
		}
		else {
			if (x[i] < min)min = x[i];
			if (x[i] > max)max = x[i];
		}
	}

	cout << (max-min) << endl;
}


Measured memory_bytes: 256
N=int(input())
s=input()
S=[1 if i=="o" else -1 for i in s]
#print(S)
X=[[0 for i in range(N)] for i in range(4)]
X[0][0]=1
X[0][1]=1
X[1][0]=1
X[1][1]=-1
X[2][0]=-1
X[2][1]=1
X[3][0]=-1
X[3][1]=-1
for k in range(4):
    for i in range(2,N):
        if S[i-1]*X[k][i-1]==1:
            X[k][i]=X[k][i-2]
        else:
            X[k][i]=-X[k][i-2]
    flag=0
    for i in range(2):
        if S[i-1]*X[k][i-1]==1:
            if X[k][i]!=X[k][i-2]:
                flag=1
        else:
            if X[k][i]!=-X[k][i-2]:
                flag=1
    if flag==0:
        T=""
        for i in range(N):
            if X[k][i]==1:
                T=T+"S"
            else:
                T=T+"W"
        print(T)
        exit()
print(-1)



Measured memory_bytes: 7540
s = input()
if len(s) > 2:
  for a in range(len(s)-2):
    if len(set(list(s[a:a+3]))) != len(s[a:a+3]):
      print(a+1, a+3)
      break
  else:
    print(-1, -1)

else:
  print(1, 2) if len(set(list(s))) != len(s) else print(-1,-1)

Measured memory_bytes: 3188
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<functional>
#include<map>
#include<cstdlib>
#include<complex>
#include<numeric>
#include<set>
#include<deque>


using namespace std;
using Int = long long;
Int INF = 1LL << 60;
const Int MOD = 1000000000 + 7;
//
//template <class T>
//ostream& operator<<(ostream& os, const vector<T>& vec) {
//	for (const auto& e : vec) os << e << (&e == &vec.back() ? "" : " ");
//	return os;
//}

template<int Modulo = MOD> struct Mint {
	Int val;
	constexpr Mint(Int v = 0) noexcept : val(v% Modulo) {
		if (val < 0) v += Modulo;
	}
	constexpr int getmod() { return Modulo; }
	constexpr Mint operator - () const noexcept { return val ? Modulo - val : 0; }
	constexpr Mint operator + (const Mint& r) const noexcept { return Mint(*this) += r; }
	constexpr Mint operator - (const Mint& r) const noexcept { return Mint(*this) -= r; }
	constexpr Mint operator * (const Mint& r) const noexcept { return Mint(*this) *= r; }
	constexpr Mint operator / (const Mint& r) const noexcept { return Mint(*this) /= r; }
	constexpr Mint& operator += (const Mint& r) noexcept {
		val += r.val;
		if (val >= Modulo) val -= Modulo;
		return *this;
	}
	constexpr Mint& operator -= (const Mint& r) noexcept {
		val -= r.val;
		if (val < 0) val += Modulo;
		return *this;
	}
	constexpr Mint& operator *= (const Mint& r) noexcept {
		val = val * r.val % Modulo;
		return *this;
	}
	constexpr Mint& operator /= (const Mint& r) noexcept {
		Int a = r.val, b = Modulo, u = 1, v = 0;
		while (b) {
			Int t = a / b;
			a -= t * b; swap(a, b);
			u -= t * v; swap(u, v);
		}
		val = val * u % Modulo;
		if (val < 0) val += Modulo;
		return *this;
	}
	constexpr bool operator == (const Mint& r) const noexcept {
		return this->val == r.val;
	}
	constexpr bool operator != (const Mint& r) const noexcept {
		return this->val != r.val;
	}
	friend ostream& operator << (ostream& os, const Mint<Modulo>& x) noexcept {
		return os << x.val;
	}
	friend istream& operator >> (istream& is, Mint<Modulo>& x) noexcept {
		Int tmp; is >> tmp;
		x = Mint<Modulo>(tmp);
		return is;
	}
	friend constexpr Mint<Modulo> modpow(const Mint<Modulo>& a, Int n) noexcept {
		Mint res(1), tmp = a;
		while (n > 0) {
			if (n & 1) res *= tmp;
			tmp *= tmp;
			n >>= 1;
		}
		return res;
	}
};

using mint = Mint<>;

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	Int N, K;
	cin >> N >> K;

	vector<Int> a(N);
	for (Int i = 0; i < N; i++) {
		cin >> a[i];
	}

	vector<pair<mint, mint>> count(N, pair<mint, mint>());

	mint before;
	mint after;
	for (Int i = 0; i < N; i++) {
		before = 0;
		after = 0;
		for (Int j = 0; j < N; j++) {
			if (i == j) continue;
			if ((j < i) && (a[i] > a[j]))before+=1;
			if ((j > i) && (a[i] > a[j]))after+=1;
		}
		count[i].first = before;
		count[i].second = after;
	}

	mint ans = 0;
	for (Int i = 0; i < N; i++) {
		ans += count[i].second * K + (count[i].second + count[i].first) * K * (K - 1) / 2;
	}

	cout << ans << endl;
}

Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef unsigned long long int ulli;
#define vec(s) vector

#define vvec(s) vector<vector
>
typedef vector<lli> vi;
typedef vector<vi> vvi;
typedef pair<lli,lli> pii;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define Yes(x) cout<<(x?"Yes":"No")<<endl;
#define YES(x) cout<<(x?"YES":"NO")<<endl;
#define out(s) cout<<s<<endl;
#define pb(s) push_back(s);
#define sp " " 
#define INF 10000000000
#define LINF 9000000000000000000
#define all(s) s.begin(),s.end()
void vout(vi v){
    for(lli i=0;i<v.size();i++)
    cout<<v.at(i)<<endl;
}
int main(){
    cout << std::fixed << std::setprecision(10);
    string s, ans;
    cin>>s;
    if(s=="Sunny"){ 
        ans="Cloudy";
    }
    else if(s=="Cloudy"){ 
        ans="Rainy";
    }
    else{ 
        ans="Sunny";
    }
    out(ans);
}

Measured memory_bytes: 3632
//compiledef
#include <bits/stdc++.h>
#define rep(i, n) for(i=0;i<(n);i++)
#define per(i, n) for(i=(n);i>0;i--)
#define repx(i, n, x) for(i=(x);i<(n);i++)
#define xper(i, n, x) for(i=(n);i>(x);i--)
#define pback push_back

//c++def
using namespace std;
typedef long long int ll;
const ll MOD = 1e9+7;
const ll MOD2 = 998244353;
int a[2100];
int b[2100];
int n;
int check(int i, int x){
	static int dp[2100][2100];
	if(i==0){
		if(x==0) return 1;
		else return -1;
	}
	if(x<0) return -1;

	if(dp[i][x] != 0) return dp[i][x];
	if(check(i-1, x)==1) return dp[i][x] = 1;
	if(check(i-1, x-a[i-1])==1) return dp[i][x] = 1;
	return dp[i][x] = -1;
}

int main(){
	int i;
	int q;
	int m;
	cin >> n;
	rep(i, n)scanf("%d", &a[i]);
	cin >> q;
	rep(i, q){
		scanf("%d",  &m);
		if(check(n, m) == 1) printf("yes\n");
		else printf("no\n");
	}
}



Measured memory_bytes: 3292
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
ll mod = 10e9+7;

#define rep(i,n)   for(int i=(int)0; i<(int)n; i++)
#define REP(i,m,n) for(int i=(int)m; i<(int)n; i++)
#define all(var)     (var).begin(), (var).end()
#define prt(var)     cout << var << endl
#define prtd(n, var)  cout << setprecision(n) << var << endl
#define prt2(var1, var2) cout << var1 << " " << var2 << endl


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

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

  int n=s.size();

  rep(i,n){
    cout << "x";
  }

}


Measured memory_bytes: 256
//! Framework <https://github.com/vain0x/procon>

#![allow(non_snake_case)]
#![allow(unused_imports)]

use std::collections::*;

pub struct Scan(Box<dyn Iterator<Item = &'static str>>); // '

impl Scan {
    fn new() -> Self {
        let mut buf = String::new();
        let read_line = move || {
            std::io::stdin().read_line(&mut buf).unwrap();
            Box::leak(buf.split_off(0).into_boxed_str()).split_whitespace()
        };
        Scan(Box::new(std::iter::repeat_with(read_line).flatten()))
    }

    pub fn word<T: std::str::FromStr>(&mut self) -> T {
        self.0.next().unwrap().parse().ok().unwrap()
    }

    pub fn list<T: std::str::FromStr>(&mut self, len: usize) -> Vec<T> {
        std::iter::repeat_with(|| self.word()).take(len).collect()
    }
}

fn main() {
    let mut scan = Scan::new();

    let K = scan.word::<usize>();
    let A = scan.word::<usize>();
    let B = scan.word::<usize>();
    let ok = (A..=B).any(|x| x % K == 0);

    println!("{}", if ok { "OK" } else { "NG" });
}


Measured memory_bytes: 2144
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,m,ans=0,top=0,a[205]={0};
	cin>>n>>m;
	for(int i=1;i<=n;i++)a[++top]=2;
	for(int i=1;i<=m;i++)a[++top]=1;
	for(int i=1;i<=top;i++)
		for(int j=i+1;j<=top;j++)
			if((a[i]+a[j])%2==0)ans++;
	cout<<ans;
}

Measured memory_bytes: 256
I=lambda:map(int,input().split());F=1e21;r=range;n,m=I();f=[-F,F];X=[0]+f;Y=X[:];R=(f,F),(f,-F),;H=(F,f),(-F,f),
for i in r(n):*a,c=I();R+=(a,c),;Y+=c,;X+=a
for i in r(m):a,*b=I();H+=(a,b),;X+=a,;Y+=b
def g(X):s=sorted(set(X));l=len(s);return{s[i]:i for i in r(l)},s,l
h,s,K=g(X);w,t,L=g(Y);V,U,v=[[[0]*-~K for i in r(L+1)]for _ in r(3)]
for(a,b),c in R:U[w[c]][h[a]]+=1;U[w[c]][h[b]]-=1
for d,(e,f)in H:V[w[e]][h[d]]+=1;V[w[f]][h[d]]-=1
for i in r(L):
 for j in r(K):U[i][j+1]+=U[i][j];V[i+1][j]+=V[i][j]
q=[(h[0],w[0])];a=0
while q:
 x,y=q.pop();v[y][x]=1;a+=(s[x]-s[x+1])*(t[y]-t[y+1])
 for e,f in(-1,0),(1,0),(0,1),(0,-1),:
  c=x+e;d=y+f
  if 1-v[d][c]and U[(f>0)+y][x]*f+V[y][(e>0)+x]*e==0:q+=[(c,d)];v[d][c]=1
print([a,'INF'][a>F])

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

typedef long long lli;
typedef pair<lli,lli> pll;
typedef vector<lli> vcL;

bool cmp(lli x, lli y) {
	return abs(x) < abs(y);
}

void solve() {
	int n = 1;
	cin >> n;
	lli s[ n+5 ];
	for (int i = 0; i < n; ++i) cin >> s[i];
	
	sort( s, s+n, cmp );
	
	lli neg = 0, sum = 0;
	
	for (int i = 0; i < n; ++i) {
		if ( s[i] < 0 ) neg++ ;
		sum += abs( s[i] );
	}
	
	if ( neg&1 ) {
		sum -= abs( s[0]*2 );
	}
	
	cout << sum << '\n';
}

int main() {
	int t = 1;
//	cin >> t;
	while ( t-- ) {
		solve();
	}
	return 0;
}

Measured memory_bytes: 1024
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

int x[110];

int main() {
	int n,m,p;
	while(cin>>n>>m>>p,n){
		m--;
		int i,sum=0;
		for(i=0;i<n;i++){
			cin>>x[i];
			sum+=x[i];
		}
		sum*=100-p;
		if(x[m]==0)cout<<0<<endl;
		else cout<<sum/x[m]<<endl;
	}
	return 0;
}

Measured memory_bytes: 0
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const long long MOD = 1e9 + 7, MAX = 1e18, larg = 1e5, INF = -1e9;
long long A, B, C, D, E, F, G, H, I, J, K, L, N, M, O, P, Q, R, S, T, U, V, W;
typedef long long ll;
typedef pair<ll, ll> Pa;

priority_queue<Pa> que;

int main()
{
    cin >> N >> H;
    rep(i, N){
        cin >> A >> B;
        que.push(Pa(A, 0));
        que.push(Pa(B, 1));
    }
    ll point = 0;
    int index = 0;
    while(point < H){
        Pa curr = que.top(); 
        if(curr.second == 0){
            index += (H - point-1)/curr.first+1;
            point = H;
        }else{
            que.pop();
            point += curr.first;
            index++;
        }
    }
    cout << index;
}


Measured memory_bytes: 6256
#include <bits/stdc++.h>
#define eps 1e-9

using namespace std;
typedef double db;
struct P{
    db x, y;
    P(){}
    P(db x, db y) : x(x) , y(y) {}
    P operator - (P a){ return P(x-a.x, y-a.y); }
    db times(P a){ return x*a.y-y*a.x; }
    db dot(P a){ return a.x*x + a.y*y; }
};
typedef P V;
struct L{ P p, q; };

int sign(db x){ return x<-eps ? -1 : x>eps; }

int PO(L s1, L s2){ //s1垂直与s2输出1，平行输出2，其他输出0
    V v1 = s1.p-s1.q, v2 = s2.p-s2.q; 
    if( !sign( v1.dot(v2) ) ) return 1;
    if( !sign( v1.times(v2) ) ) return 2;
    return 0;
}

int main(){
    //freopen("owo.in","r",stdin);
    L s1, s2;
    int n;
    cin >> n;
    while(n--){
        scanf("%lf%lf%lf%lf%lf%lf%lf%lf", &s1.p.x, &s1.p.y, &s1.q.x, &s1.q.y, &s2.p.x, &s2.p.y, &s2.q.x, &s2.q.y);
        printf("%d\n", PO(s1, s2));
    }
    return 0;
}


Measured memory_bytes: 3244
#include "bits/stdc++.h"

using namespace std;
using ll = long long;
constexpr ll mod = 1e9 + 7;

ll mypow(ll a, ll b) {
  if (b == 0) return 1;
  ll tmp = mypow(a, b / 2);
  if (b % 2)
    return (((tmp * tmp) % mod) * a) % mod;
  else
    return (tmp * tmp) % mod;
}

vector<vector<ll>> tbl(410, vector<ll>(410, 0));

int main() {
  for (int i = 0; i <= 400; i++) {
    for (int j = 0; j <= 400; j++) {
      tbl[i][j] = mypow(i, j);
      if (i) tbl[i][j] = (tbl[i - 1][j] + tbl[i][j]) % mod;
    }
  }
  int n, c;
  cin >> n >> c;
  vector<int> a(n), b(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
    //assert(a[i] == b[i]);
  }
  // dp[i][j] := i 人目までに j 個配る時の組み合わせ
  vector<vector<ll>> dp(n + 1, vector<ll>(c + 1, 0));
  dp[0][0] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= c; j++) {
      for (int k = 0; j + k <= c; k++) {
        dp[i + 1][j + k] +=
            dp[i][j] * (tbl[b[i]][k] + mod - tbl[a[i] - 1][k]) % mod;
        dp[i + 1][j + k] %= mod;
      }
    }
  }
  cout << dp[n][c] << endl;
}

Measured memory_bytes: 2816
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <bitset>
#include <climits>
#define REP(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define RFOR(i,a,b) for (int i=(a)-1;i>=(b);i--)
#define ll long long
#define ull unsigned long long
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const int INF = 1e9;
const int MOD = 1e9 + 7;

using namespace std;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
	string T,P;
	cin>>T>>P;
	if(T.size() < P.size())return 0;
	REP(i,T.size()){
		bool found = true;
		REP(j,P.size()){
			if(i + j >= T.size() || T[i+j] != P[j]){
				found = false;break;
			}
		}
		if(found)cout << i << endl;
	}
  return 0;
}

Measured memory_bytes: 3248
#include <bits/stdc++.h>
#define N 10005
#define ll long long
#define endl '\n'

using namespace std;

int main()
{
	int a[3];
	for(int i=0;i<3;++i)
		cin >> a[i];
	sort(a,a+3);
	cout << a[0]+a[1] << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
        int N, K;
        cin >> N >> K;
        vector<long> V(N);
        vector<long> W(0);
        long S=-10000000*N;
        for (int i=0; i<N; i++) cin >> V.at(i);
        // pick up = i
        for (int i=0; i<=min(N, K); i++) {
                // pick up from left = j (pick up from right = i-j)
                int j=0;
                while (j<=i) {
                        W.erase(W.begin(), W.end());
                        int jj=0;
                        while (jj<j) {
                                W.push_back(V.at(jj));
                                jj++;
                        }
                        int jjj=1;
                        while (jj<i) {
                                W.push_back(V.at(N-jjj));
                                jj++;
                                jjj++;
                        }
                        sort(W.begin(), W.end());
                        int ii=0;
                        while(ii<K-i) {
                                if ((W.size()>0) && (W.at(0)<0)) W.erase(W.begin());
                                ii++;
                        }
                        long ss=0;
                        if (W.size()>0)
                                for (int i=0; i<W.size(); i++) ss += W.at(i);
                        S=max(S, ss);
                        j++;
                }
        }
        cout << S << endl;
        return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num1 = Integer.parseInt(sc.next());
        int num2 = Integer.parseInt(sc.next());
        int num3 = Integer.parseInt(sc.next());
        int sum = num1 + num2 + num3;
        if(sum>=22){
            System.out.println("bust");
        }else{
            System.out.println("win");
        }
    }
}

Measured memory_bytes: 22996
#include <iostream>

using namespace std;

int main(void) {
  string s;
  int tmp=0, abc[3] = {1, 1, 1};
  cin >> s;
  for (int i=0;i < 3;i++) {
    tmp += abc[s[i] - 'a'];
    abc[s[i] - 'a']--;
  }
  if (tmp == 3) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;

#include <math.h>
#define PI 3.14159265358979323846264338327950L

long long gcd(long long a, long long b) {
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
long long lcm(long long a, long long b) {
    return (a * b) / gcd(a, b);
}

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

    return 0;
}

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


int main(){
    int a,b;    cin >> a >> b;
    if(a<=9 && b<=9) cout << a*b << endl;
    else cout << -1 << endl;
}




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

int main(int argc, char const *argv[])
{
    int n;
    cin >> n;
    int array[n];
    for (int i = 0; i < n; ++i)
    {
        cin >> array[i];
    }
    for (int i = 0; i < n; ++i)
    {
        cout << array[n-1-i];
        if(i!=n-1) cout << " ";
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 1160
#define _USE_MATH_DEFINES  // M_PI等のフラグ

#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
#include <vector>

#define MOD 1000000007
#define COUNTOF(array) (sizeof(array)/sizeof(array[0]))

using namespace std;

string replace_with_str(string str, string str_from, string str_to) {
    string::size_type pos = 0;
    while (pos = str.find(str_from, pos), pos != string::npos) {
        str.replace(pos, str_from.length(), str_to);
        pos += str_to.length();
    }
    return str;
}

int main(int argc, char const *argv[]){
    int N;
    cin >> N;
    int T, A;
    cin >> T >> A;
    float diff = 10000;
    int ans;
    for(int i=0; i<N; i++){
        int H;
        cin >> H;
        
        float t = T - H * 0.006;
        if(diff >= abs(t - A)){
            diff = abs(t - A);
            ans = i + 1;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cctype>
#include <map>

using namespace std;

inline int read()
{
	int x=0,f=1;
	char ch=getchar();
	while (!isdigit(ch)) f=ch=='-'?-1:f,ch=getchar();
	while (isdigit(ch)) x=x*10+ch-'0',ch=getchar();
	return x*f;
}

const int N=100005;

int a[N],b[N],a_[N],b_[N],fa[N],id[N];
map<int,int> lab;
int n,ans,sum,idx,cnt;

int getfather(int son){return fa[son]==son?son:fa[son]=getfather(fa[son]);}

void merge(int x,int y)
{
	x=getfather(x),y=getfather(y);
	if (x==y) return;
	fa[y]=x;
}

int main()
{
	//freopen("xor.in","r",stdin),freopen("xor.out","w",stdout);
	n=read(),sum=0;
	for (int i=1;i<=n;++i) sum^=a[i]=read();
	a[n+1]=sum,sum=0;
	for (int i=1;i<=n;++i) sum^=b[i]=read();
	b[++n]=sum;
	copy(a,a+1+n,a_),copy(b,b+1+n,b_);
	sort(a_+1,a_+1+n),sort(b_+1,b_+1+n);
	for (int i=1;~ans&&i<=n;++i) if (a_[i]!=b_[i]) ans=-1;
	if (~ans)
	{
		idx=0;
		for (int i=1;i<=n;++i) lab[a_[i]]=idx+=a_[i]!=a_[i-1]||i==1;
		for (int i=1;i<=n;++i)
			if (a[i]!=b[i]||i==n)
			{
				ans+=i<n;
				if (!id[lab[a[i]]]) id[lab[a[i]]]=++cnt,fa[cnt]=cnt;
				if (!id[lab[b[i]]]) id[lab[b[i]]]=++cnt,fa[cnt]=cnt;
			}
		for (int i=1;i<=n;++i) if (a[i]!=b[i]) merge(id[lab[a[i]]],id[lab[b[i]]]);
		for (int i=1;i<=cnt;++i) ans+=i==getfather(i);
		--ans;
	}
	printf("%d\n",ans);
	//fclose(stdin),fclose(stdout);
	return 0;
}

Measured memory_bytes: 7296
#include <iostream>
#include <algorithm>
#include <string>
#include <iomanip>
using namespace std;

int main() {
   int n, m, l;
   cin >> n >> m >> l;
   long long a[100][100] = {};
   for(int i = 0; i < n; i++){
     for(int j = 0; j < m; j++){
       cin >> a[i][j];
     }
   }

   long long b[100][100] = {};
   for(int i = 0; i < m; i++){
     for(int j = 0; j < l; j++){
       cin >> b[i][j];
     }
   }
   long long c[100][100] = {};
   for(int i = 0; i < n; i++){
     for(int j = 0; j < l; j++){
       for(int k = 0; k < m; k++){
         c[i][j] += a[i][k] * b[k][j];
       }
     }
   }

   for(int i = 0; i < n; i++){
     for(int j = 0; j < l; j++){
       if(j == l - 1){
         cout << c[i][j] << endl;
         continue;
       }
       cout << c[i][j] << " ";
     }
   }



}



Measured memory_bytes: 3356
#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<map>
using namespace std;
int main() {
  string s;
  cin >> s;
  for(int i=0; i<s.size()-1; i++) {
    if(s[i]==s[i+1]) {
      cout << i+1 << " " << i+2 << endl;
      return 0;
    }
    else if(s[i]==s[i+2]) {
      cout << i+1 << " " << i+3 << endl;
      return 0;
    }
  }
  cout << -1 << " " << -1 << endl;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
#define F first
#define S second
#define ll long long
#define pb push_back

using namespace std;

ll n,k;

int main()
{
    cin >> n >> k;
    if (n<k)n=min(n,abs(n-k));
    else
    {
        ll tmp=n/k;
        n-=tmp*k;
        n=min(n,abs(n-k));
    }
    cout << n << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <math.h>
#define ALL(a)    a.begin(), a.end() 
#define rep(i, K, N)  for(int i = K; i < N; i++)
#define ll long long int
using namespace std;
int main() {
ll N, M, count = 0;cin >> N;
vector<ll> A(N);

M = N;

rep(i, 0, N)cin >> A[i];

sort(ALL(A));

while(M >= 2){

    rep(i,1, M){
    if(A[i]%A[0] == 0){A[i] = powl(10, 9);count++;}
    else A[i] %= A[0];
    }

M = N - count;
 
sort(ALL(A));

}

cout << A[0];

}

Measured memory_bytes: 4048
#include <bits/stdc++.h>
using namespace std;
//#pragma GCC optimize("Ofast")
#define rep(i,n) for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
#define eb emplace_back
#define lb(v,k) (lower_bound(all(v),k)-v.begin())
#define ub(v,k) (upper_bound(all(v),k)-v.begin())
#define fi first
#define se second
#define pi M_PI
#define PQ(T) priority_queue<T>
#define SPQ(T) priority_queue<T,vector<T>,greater<T>>
using ll=long long;
using P=pair<ll,ll>;
using PP=tuple<ll,ll,ll>;
using S=multiset<ll>;
using vi=vector<ll>;
using vvi=vector<vi>;
using vvvi=vector<vvi>;
const ll inf=1001001001001001;
const int INF=1001001001;
const int mod=1000000007;
const double eps=1e-10;
template<class T> bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<class T> void out(T a){cout<<a<<'\n';}
template<class T> void outp(T a){cout<<'('<<a.fi<<','<<a.se<<')'<<'\n';}
template<class T> void outvp(T v){rep(i,v.size())cout<<'('<<v[i].fi<<','<<v[i].se<<')';cout<<'\n';}
template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<'\n';}
template<class T> void outvv(T v){rep(i,v.size())outv(v[i]);}
template<class T> bool isin(T x,T l,T r){return (l)<=(x)&&(x)<=(r);}
template<class T> void YesNo(T b){if(b)out("Yes");else out("No");}
void decimal(int x){cout<<fixed<<setprecision(x);}
//ll GCD(ll a,ll b){if(b==0) return a; return GCD(b,a%b);}
//ll LCM(ll a,ll b){return(a/GCD(a,b))*(b/GCD(a,b))*GCD(a,b);}
ll POW(ll a,ll b){a%=mod;if(b==0)return 1;if(b&1)return a*POW(a,b-1)%mod;ll k=POW(a,b/2);return k*k%mod;}
vi calc(ll x){vi res;while(x>0){res.eb(x%10);x/=10;}reverse(all(res));return res;}

void solve(){
  string n; cin>>n;
  ll a=0;
  rep(i,n.size()){
    string s="";
    s+=n[i];
    a+=stoi(s);
  }
  YesNo(a%9==0);
}

signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
}


Measured memory_bytes: 3772
import math, sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache
from heapq import heapify, heappop, heappush
from itertools import accumulate, combinations, permutations
input = sys.stdin.readline
mod = 10**9 + 7
ns = lambda: input().strip()
ni = lambda: int(input().strip())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

def main():
    a, b, c, x, y = nm()

    if a + b <= 2*c:
        ans = a*x + b*y
    elif int(a if x > y else b) <= 2*c :
        ans = 2*c*min(x, y) + int(a if x > y else b)*abs(x - y)
    else:
        ans = 2*c*max(x, y)

    print(ans)


if __name__ == '__main__':
    main()

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

int main()
{
  long N, M, Ans;
  cin >> N >> M;

  vector<long> A(M);

  int Sum = 0;

  for (long i = 0; i < M; i++)
  {
    cin >> A.at(i);
    Sum += A.at(i);
  }

  Ans = N - Sum;

  cout << (Ans >= 0 ? Ans : -1) << endl;
}


Measured memory_bytes: 3600
#include <bits/stdc++.h>
typedef long long ll; 

using namespace std;

int main() {
	int N, M, Q;
	cin >> N >> M >> Q;
	vector<vector<int>> v(N + 1);
	for (int i = 0; i < M; i++) {
		int l, r;
		cin >> l >> r;
		v[l].push_back(r);
	}

	vector<int> p(Q);
	vector<int> q(Q);
	for (int i = 0; i < Q; i++) {
		cin >> p[i] >> q[i];
	}

	for (int i = 0; i < v.size(); i++) {
		sort(v[i].begin(), v[i].end());
	}

	vector<int> res(Q, 0);
	for (int i = 0; i < Q; i++) {
		int sum = 0;
		for (int j = p[i]; j <= q[i]; j++) {
			if (v[j].empty()) continue;

			auto it = upper_bound(v[j].begin(), v[j].end(), q[i]);
			int x = it - v[j].begin();
			sum += x;
		}

		res[i] = sum;
	}

	for (int i = 0; i < res.size(); i++) {
		cout << res[i] << endl;
	}

	return 0;
}


Measured memory_bytes: 3328
#include <iostream>
#include <vector>
#include <deque>
#include <algorithm>
#include <numeric>
#include <string>
#include <cstring>
#include <list>
#include <unordered_set>
#include <tuple>
#include <cmath>
#include <limits>
#include <type_traits>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <set>
#include <bitset>
#include <regex>
#include <random>
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
#define rep(i,n)for(ll i=0;i<n;++i)
#define exout(x) printf("%.10f\n", x)
const double pi = acos(-1.0);
const ll MOD = 1000000007;
const ll INF = 1e18;
const ll MAX_N = 201010;

//最大公約数
ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}

ll lcm(ll x, ll y) {
	if (x == 0 || y == 0)return 0;
	return (x / gcd(x, y) * y);
}

ll dx[4] = { 0,0,-1,1 };
ll dy[4] = { -1,1,0,0 };
char a[110][110];

//long longしか使わない
//素数は1より大きい
//lower_boundは指定したkey以上の要素の一番左のイテレータをかえす
//upper_boundは指定したkeyより大きい要素の一番左のイテレータをかえす
int main() {
	string s;
	cin >> s;
	ll n = s.length();
	reverse(s.begin(), s.end());
	vector<ll>cnt(2019);
	ll res = 0;
	ll x = 1, ans = 0;
	rep(i, n) {
		cnt[res]++;
		res += (s[i] - '0') * x;
		res %= 2019;
		ans += cnt[res];
		x = x * 10 % 2019;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 3752
#include<stdio.h>
int main(int argc){
int a,b,c,w1,w2,w3;
scanf("%d %d %d",&a,&b,&c);
if(a>b){
w1=a;
a=b;
b=w1;}
if(b>c){
w2=b;
b=c;
c=w2;}
if (a>b){
w3=a;
a=b;
b=w3;}
printf("%d %d %d\n",a,b,c );
return 0;
}

Measured memory_bytes: 596
#include<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
int main(){
    //priority_queue<int,greater<int> > Q;
    priority_queue<double, vector<double>, greater<double> > Q;
    int N;
    cin>>N;
    for(int i=0;i<N;i++){
        double a;
        cin>>a;
        Q.push(a);
    }
    while(2<=Q.size()){
        double a,b;
        a=Q.top();Q.pop();
        b=Q.top();Q.pop();
        Q.push((a+b)/(double)2);
    }
    cout<<Q.top()<<endl;
    return 0;
}


Measured memory_bytes: 256
N = int(input())
balls = [tuple(map(int, input().split())) for _ in range(N)]

balls.sort()

ans = N
for i in range(N):
    for j in range(i+1, N):
        p, q = balls[j][0]-balls[i][0], balls[j][1]-balls[i][1]
        useds = [False] * N
        num = 0
        for a in range(N):
            if useds[a]: continue
            useds[a] = True
            num += 1
            x, y = balls[a]
            for b in range(a+1, N):
                if useds[b]: continue
                if balls[b] == (x+p, y+q):
                    useds[b] = True
                    x, y = balls[b]
        ans = min(ans, num)

print(ans)


Measured memory_bytes: 3064
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<vector>
#include<list>
#include<cmath>
#include<algorithm>
#include<bitset>
#define lson node<<1,st,mid
#define rson node<<1|1,mid+1,ed
#define mem(a,x) memset(a,x,sizeof(a))
#define me(a) memset(a,0,sizeof(a))
#define IOS ios::sync_with_stdio(false)
#define lowbit(x) x&(-x)
#define up(i,x,y) for(long long i=x;i<y;i++)
#define down(i,x,y) for(long long i=x;i>=y;i--)
#define in freopen("in.txt","r",stdin)
#define out freopen("out.txt","w",stdout)   
typedef long long ll;
const ll mod = 1e9+7;
const ll INF = 0x3f3f3f3f;
const ll maxn = 1e6+5;
const ll N = 1e3+5;
const double pi = acos(-1.0);
const double eps=1e-9;
using namespace std;

set<string>se;
int main(){
    int n;
    cin>>n;
    string s;
    for(int i=0;i<n;i++){
        cin>>s;
        se.insert(s);
    }
    cout<<se.size()<<endl;
}

Measured memory_bytes: 15604
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
using LL = long long;
const LL LINF = 1e18;
using namespace std;
#define COUT(v) cout<<(v)<<endl
#define CIN(n)  int(n);cin >> (n)
#define LCIN(n) LL(n);cin >> (n)
#define SCIN(n) string(n);cin >> (n)
#define YES(n) cout<<((n)? "YES" : "NO")<<endl
#define Yes(n) cout<<((n)? "Yes" : "No")<<endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) <<endl

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

#define FOREACH(x,a) for(auto& (x) : (a) )

#define ALL(obj) (obj).begin(),(obj).end()

#define P pair<LL,LL>
#define I vector<int>
#define S set<int>
#define pb(v) push_back(v)
#define V vector
#define rt return
#define rmsame(a) sort(ALL(a)),a.erase(unique(ALL(a)), a.end())

typedef string::const_iterator State;
class PalseError {};
class Edge{
public:
    LL from,to,value;
    Edge(LL a,LL b,LL c){
        from = a;
        to = b;
        value = c;
    }
    Edge(LL a,LL b){
        from = a;
        to = b;
    }
};
//スタート点,頂点数、辺を渡して、最短経路の配列を返す

int main(){
    //CIN(N);
    //SCIN(str);
    //CIN(a);
    CIN(a);
    CIN(b);
    if(a % 2 != 0 && b % 2 != 0){
        Yes(true);
    }else{
        Yes(false);
    }
    return 0;
}


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

// 定義
typedef long long         ll;
typedef pair<ll, ll>      P;
#define ALL(x)            (x).begin(),(x).end()
#define REP(i, n)         for(ll i = 0 ; i < (ll)n ; ++i)
#define REPN(i, m, n)     for(ll i = m ; i < (ll)n ; ++i)
#define REVREP(i, n)      for(ll i = n - 1; i >= 0 ; i--)
#define VL                vector<ll>
#define VVL               vector<vector<ll>>
#define VVVL              vector<vector<vector<ll>>>
#define VC                vector<char>
#define VVC               vector<vector<char>>
#define INF               (ll)2e9
#define INF_LL            1LL<<60
//#define MOD             998244353
#define MOD               1000000007

ll Ceil(ll val, ll div)   { return (val + div - 1) / div; }
ll CeilN(ll val, ll div)  { return Ceil(val, div) * div; }
ll FloorN(ll x, ll n)     { return (x - x % n); }
bool IsOdd(ll x)          { return ((x & 1) == 1); }
bool IsEven(ll x)         { return ((x & 1) == 0); }
template<class T> bool chmax(T& a, T b) { if (a <= b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T& a, T b) { if (a >= b) { a = b; return 1; } return 0; }

void Solve()
{
	ll N;
	cin >> N;
	VL A(N);
	REP(i, N) cin >> A[i];

	ll sum = 0;
	REP(i, N) sum ^= A[i];

	REP(i, N) {
		ll ans = sum ^ A[i];
		cout << ans << endl;
	}
}

// メイン
int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Solve();
	return 0;
}


Measured memory_bytes: 4764
#include<stdio.h>

int setprice(int x,int y,int b,int p){
  if(b<5){
    b=5;
  }
  if(p<2){
    p=2;
  }
  return (x*b+y*p)*4/5;
}

void doit(int n){
  int x,y,b,p;
  int set=0;
  int amount;
  int stp;

  if(n!=0){
    scanf("%d %d %d %d",&x,&y,&b,&p);
    if((b>=5)&&(p>=2)){
      set=1;
    }
    amount=(x*b+y*p);
    stp=setprice(x,y,b,p);
    if(amount<stp){
      printf("%d\n",amount);
    }
    else{
      printf("%d\n",stp);
    }
    doit(n-1);
  }
}

int main(){
  int n;
  scanf("%d",&n);
  doit(n);
  return 0;
}

Measured memory_bytes: 608
import sys
 
K = int(sys.stdin.readline())
A = list(map(int, sys.stdin.readline().split()))
 
if A[-1] != 2:
    print(-1)
    sys.exit()
 
l = 2
r = 2
for i in range(K-2, -1, -1):
    l = ((l - 1) // A[i] + 1) * A[i]
    r = ((r + A[i+1] - 1) // A[i]) * A[i] 
 
    if r < l:
        print(-1)
        sys.exit()
 
print(l, r + A[0] - 1)

Measured memory_bytes: 20520
#include <iostream>
#include <string>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <map>
#include <cmath>
#include <queue>
#include <utility>
#include <functional>
#include <deque>
#include <cctype>
#include <stack>
#include <bitset>

using ll = long long;
typedef unsigned long long ull;
typedef std::pair<ll, ll>P;

ll min(ll a, ll b) {
	if (a >= b)return b;
	else return a;
}
ll max(ll a, ll b) {
	if (a >= b)return a;
	else return b;
}
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a%b);
}
ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}

const ll Z = 1000000007;
const ll INF = 1 << 30;
const ll INF2 = 9000000000000000000LL;
bool flag = true;
bool fl = true;
int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
std::string abc = "abcdefghijklmnopqrstuvwxyz";
struct edge { ll to, cost; };

int main() {
	int n, m;
	std::string s[1000], t[1000];
	std::cin >> n;
	for (int i = 0;i < n;i++) {
		std::cin >> s[i];
	}
	std::cin >> m;
	for (int i = 0;i < m;i++) {
		std::cin >> t[i];
	}
	int ans = 0;
	for (int i = 0;i < n;i++) {
		int sum = 0;
		for (int j = 0;j < n;j++) {
			if (s[i] == s[j])sum++;
		}
		for (int j = 0;j < m;j++) {
			if (s[i] == t[j])sum--;
		}
		ans = max(ans, sum);
	}
	std::cout << ans << std::endl;
}

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

int main(){
    char ch;
    int cnt[26]={};
    while(cin >> ch){
        ch=tolower(ch);
        if(isalpha(ch)){
            cnt[ch-'a']++;
        }
    }
    for(int i=0;i<26;i++){
        printf("%c : %d\n",i+'a',cnt[i]);
    }
    return 0;
}


Measured memory_bytes: 3124
#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<string>
#include<queue>
#include<utility>
#include<cmath>
#include<sstream>
#include<istream>
#include<numeric>
#include<stdlib.h>

using namespace std;

int main()
{

  int a, b, h;
  cin >> a >> b >> h;

  cout << (a+b)*h/2 << endl;

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
#define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{   
    fast;
    lli a[100005]={0};
    lli n,q;
    cin>>n;
    lli x,y;
    lli sum=0;
    for(lli i=0;i<n;i++)
    {
        cin>>x;
        sum+=x;
        a[x]++;
    }
    cin>>q;
    while(q--)
    {
        cin>>x>>y;
        if(a[x]>0)
        {
            sum-=x*a[x];
            sum+=y*a[x];
            a[y]+=a[x];
            a[x]=0;
        }
        cout<<sum<<endl;
    }
    return 0;
}

Measured memory_bytes: 4432
#include<cstdio>
#include<iostream>
#include<algorithm> 
using namespace std;
int str[55];
int main()
{
	int i,n,k,sum=0;
	cin>>n>>k;
	for(i=0;i<n;i++)
		cin>>str[i];
	sort(str,str+n);
	for(i=n-k;i<n;i++)
	{
		sum+=str[i];
		/*cout<<str[i]<<endl;*/
	}
	cout<<sum<<endl;	
}


Measured memory_bytes: 256
n, m = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
w = 0
ans = 0
for i in range(n - 1):
    w += (x[i + 1] - x[i]) * (i + 1) * (n - i - 1)
    w %= (10 ** 9 + 7)
for i in range(m - 1):
    ans += w * (y[i + 1] - y[i]) * (i + 1) * (m - i - 1)
    ans %= (10 ** 9 + 7)
print(ans)

Measured memory_bytes: 18624
using System;
using System.Collections;
using System.Collections.Generic;

namespace ConsoleApplication6
{
    class Program
    {
        static void Main(string[] args)
        {
            var read = Console.ReadLine();
            var split = read.Split(' ');
            int a = int.Parse(split[0]);
            int b = int.Parse(split[1]);
            long answer = 0;
            answer = (a - b)*100;
            answer += 1900 * b;
            answer *= (long)Math.Pow(2, b);
            Console.WriteLine(answer);

        }
    }
}


Measured memory_bytes: 11092
#include <bits/stdc++.h>
using namespace std;
// g++ -std=c++17 -Wshadow -Wall sol.cpp -o  s -g -fsanitize=address -fsanitize=undefined -D_GLIBCXX_DEBUG
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
	*this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define fi first
#define se second
#define all(v) (v).begin(), (v).end()
#define sz(v) ((int)(v).size())
using ii = pair<int, int>;
using ll = long long;
using vi = vector<int>;
using vvi = vector< vi > ;
using ld = long double;
const int inf = 0x3f3f3f3f;
const ll linf = 0x3f3f3f3f3f3f3f3fll;
template<typename T> T abs (T x) { return x < 0 ? -x : x; }
template<typename T> void max_self(T &a, T b) {  a = max(a, b); }
template<typename T> void min_self(T &a, T b) {  a = min(a, b); }
const int MAX = 1e5 + 10;
void solve(int tc) {
    int n, k;
    cin >> n >> k;
    vector<int>v(n);
    for(auto &x : v)
      cin >> x;
    // for(auto x : v)cout << x << endl;
    vector<bool>dp(k+1,false);
    dp[0] =  true;
    for(int i = 1; i <= k; ++i) {
      bool ok = true;
      for(int x : v) {
        if(i-x >= 0){
          if(dp[i-x]) {
            ok = false;
            break;
          }
        }
      }
      dp[i] = ok;
    }
    // for(int i = 0 ; i <= k; ++i) debug() << imie(i) <<  imie(dp[i]);
    for(auto x : v) {
      if(k - x >= 0 && dp[k - x]){
        puts("First");
        return;
      }
    }
    puts("Second");
}

int main() {
  int tc = 1;
  ios::sync_with_stdio(false);
  cin.tie(0);
  // cin >> tc;
  for(int i = 1; i <= tc; ++i)solve(i);
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <numeric>
#include <queue>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <sstream>
#include <stack>
#include <map>
#include <set>
#include <ios>
#include <cctype>
#include <cstdio>
#include <functional>
#include <cassert>

#define REP(i,a) for(int i = 0;i < (a);++i)
#define FOR(i,a,b) for(int i = (a);i < (b); ++i)
#define FORR(i,a,b) for(int i = (a) - 1;i >=(b);--i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SIZE(obj) (int)(obj).sizeT()
#define YESNO(cond,yes,no){cout <<((cond)?(yes):(no))<<endl; }
#define SORT(list) sort(ALL((list)));
#define RSORT(list) sort((list).rbegin(),(list).rend())
#define ASSERT(cond,mes) assert(cond && mes)

using namespace std;
using ll = long long;

constexpr int MOD = 1'000'000'007;
constexpr int INF = 1'050'000'000;

template<typename T>
T round_up(const T& a, const T& b) {
    return (a + (b - 1)) / b;
}

template <typename T1, typename T2>
istream& operator>>(istream& is, pair<T1, T2>& p) {
    is >> p.first >> p.second;
    return is;
}

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

template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
    REP(i, (int)v.size())is >> v[i];
    return is;
}

template <typename T>
ostream& operator<<(ostream& os, vector<T>& v) {
    REP(i, (int)v.size())os << v[i] << endl;
    return os;
}

template <typename T>
T clamp(T& n, T a, T b) {
    if (n < a)n = a;
    if (n > b)n = b;
    return n;
}

template <typename T>
static T GCD(T u, T v) {
    T r;
    while (v != 0) {
        r = u % v;
        u = v;
        v = r;
    }
    return u;
}

template <typename T>
static T LCM(T u, T v) {
    return u / GCD(u, v) * v;
}

std::vector<ll> enum_div(ll n) {
    std::vector<ll> ret;
    for (ll i = 1; i*i <= n; ++i) {
        if (n%i == 0) {
            ret.push_back(i);
            if (i != 1 && i*i != n) {
                ret.push_back(n / i);
            }
        }
    }
    ret.emplace_back(n);
    return ret;
}
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    std::cout << fixed << setprecision(20);

    ll N;
    cin >> N;

    ll A;
    for (ll i = 1; i*i <= N; ++i) {
        if (N%i == 0) {
            A = N / i;
        }
    }

    int digit = log10(A) + 1;
    cout << digit << endl;
    return 0;
}

Measured memory_bytes: 640
#include "bits/stdc++.h"
using namespace std;
 
int main(){
  long long int h,w;
  cin>>h>>w;
  vector<vector<long long int> > c(10,vector<long long int>(10));
  for(int i=0;i<10;i++){
    for(int j=0;j<10;j++){
      cin>>c[i][j];
    }
  }
 
  for(int k=0;k<10;k++){
    for(int j=0;j<10;j++){
      for(int i=0;i<10;i++){
        c[i][j]=min(c[i][j],c[i][k]+c[k][j]);
      }
    }
  }
 
  long long int ans=0LL;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      int a;
      cin>>a;
      if(a!=-1){
        ans+=c[a][1];
      }
    }
  }
 
  cout<<ans<<endl;
 
  return 0;
}


Measured memory_bytes: 384
#include<cstdio>
#include<cstring>
#include<algorithm>
#define rep(a,b,c) for (int a=b;a<=c;a++)
#define per(a,b,c) for (int a=b;a>=c;a--)
#define go(u) for (int o=ft[u],v;v=E[o].t;o=E[o].n)
#define fi first
#define se second
using namespace std;
typedef long long LL;
typedef double dob;
typedef pair<int,int> par;
const int P=1000000007,inv2=500000004;
LL ans,n,k,a[233],p[233],cnt;
LL pw(LL x,int k){
	LL y=1;
	while (k){
		if (k&1) y=y*x%P;
		x=x*x%P;
		k>>=1;
	}
	return y;
}
#define g(n) pw(k,(n+1)>>1)
void dfs(LL dep,LL fn,LL gn,LL hn){
	if (dep>cnt){
		LL dlt=g(gn)*hn%P;
		if (fn%2==0) dlt=dlt*inv2%P;
		ans=(ans+dlt*fn)%P;
		return;
	}
	LL ff=fn;
	rep(i,0,a[dep]){
		LL gg=gn;
		rep(j,0,i){
			dfs(dep+1,ff,gg,hn*(i-j>1?0:i-j==1?-1:1));
			gg*=p[dep];
		}
		ff*=p[dep];
	}
}
int main(){
	scanf("%lld%lld",&n,&k);
//	if (n%2==1){
//		printf("%lld\n",g(n)*n%P);
//		return 0;
//	}
	rep(i,2,1e6){
		if (n%i!=0) continue;
		p[++cnt]=i;
		while (n%i==0){
			++a[cnt];
			n/=i;
		}
	}
	if (n!=1) a[++cnt]=1,p[cnt]=n;
	dfs(1,1,1,1);
	ans=(ans+P)%P;
	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int fib(int);

int main(){

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

  printf("%d\n",A[n]);
  return 0;
}
    

  



Measured memory_bytes: 2112