akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
typedef long long ll;
#define INF 1000000000
#define MOD 1000000007
int dx[4]={1,0,-1,0},dy[4]={0,-1,0,1};
using namespace std;
int main(void){
    ll n,p;
    cin>>n>>p;
    vector<pair<ll,ll>>vec;
    ll val=sqrt(p);
    for(ll i=2;i<=val;i++){
        ll cnt=0;
        while(p%i==0){
            cnt++;
            p/=i;
        }
        if(cnt>0){
            vec.push_back(make_pair(i,cnt));
        }
    }
    if(p!=1)vec.push_back(make_pair(p,1));
    ll ans=1;
    for(int i=0;i<vec.size();i++){
        while(vec[i].second>=n){
            ans*=vec[i].first;
            vec[i].second-=n;
        }
    }
    cout<<ans<<endl;
 return 0;   
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<30
#define pb push_back
#define mp make_pair

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

ll d[15][2005], dp[2005][2005];

int main() {
	int n, K;
	cin >> n >> K;

	vector<int> id, v[2005];

	rep(i, n) {
		int a, b;
		cin >> a >> b;

		id.push_back(b-1);
		v[b-1].push_back(a);
	}

	sort(id.begin(), id.end());
	id.erase(unique(id.begin(),id.end()),id.end());

	rep(i, id.size()) {
		int j = id[i];
		sort(v[j].begin(), v[j].end(), greater<int>() );
	}

	memset(d, 0, sizeof(d));

	vector<P> p;

	rep(i, id.size()) {
		int j = id[i];

		REP(k, 1, v[j].size()+1) {
			d[j][k] += d[j][k-1] + v[j][k-1] + (k-1) * 2;
			p.push_back(mp(k, d[j][k]));
		}
	}

	memset(dp, 0, sizeof(dp));

	rep(i, id.size()) {
		rep(j, K + 1) {
			ll res = dp[i][j];
			rep(k, v[id[i]].size() + 1) {
				if(j >= k) {
					res	= max(res, dp[i][j - k] + d[id[i]][k]);
				}
			}

			dp[i+1][j] = res;
		}
	}

	// rep(i, p.size()) {
	// 	rep(j, K + 1) {
	// 		if(j < p[i].first) {
	// 			dp[i+1][j] = dp[i][j];
	// 		} else {
	// 			dp[i+1][j] = max(dp[i][j], dp[i][j - p[i].first] + p[i].second);
	// 		}
	// 	}
	// }

	cout << dp[ id.size()][K] << endl;

	return 0;
}

Measured memory_bytes: 32956
a = int(input())
b = input().split(' ')

for i in range(len(b)):
    b[i] = int(b[i])

c = []
c_odd = 0
c_even = 0
for j in range(len(b)):
    if j % 2 != 0:
        c_odd = c_odd + b[j]
    else:
        c_even = c_even + b[j]
    
c_0 = c_even - c_odd
c.append(c_0)

for k in range(len(b) - 1):
    c.append(int(2 * (b[k] - c[k] / 2)))

for l in range(len(c)):
  c[l] = str(c[l])

print(' '.join(c))

Measured memory_bytes: 17340
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define M1 					1000000007
#define M2 					998244353
#define ll 					long long int
#define pll 				pair<ll,ll>
#define mll 				map<ll,ll>
#define F 					first
#define S 					second
#define PB 					push_back
#define mp 					make_pair
#define lb 					lower_bound
#define ub 					upper_bound
#define V(a) 				vector<a>
#define endl 				'\n'
#define test(t) 			while(t--)
#define PI 					acos(-1.0)
#define rep(i,a,b) 			for(ll i=a;i<b;i++)
#define repp(i,b,a) 		for(ll i=b-1;i>=a;i--)
#define clr(ar, val)		memset(ar, val, sizeof(ar))
#define setbits(x) 			__builtin_popcountll(x)
#define zrobits(x) 			__builtin_ctzll(x)
#define ps(y) 				fixed << setprecision(y)
#define all(x) 				begin(x),end(x)
#define allr(x) 			rbegin(x),rend(x)
const int inf= 				0x3f3f3f3f;
const ll INF= 				0x3f3f3f3f3f3f3f3f;
const int dx[4]= 			{ 0, -1, 0, 1 };
const int dy[4]= 			{ -1, 0, 1, 0 };

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template<typename T>
#define o_set(T) tree<T, null_type,less<T>, rb_tree_tag,tree_order_statistics_node_update>
//member functions :
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set

ll CalculateMex(set<ll> Set){
    ll Mex = 0;
    while(Set.find(Mex)!=Set.end()){
        Mex++;
    }
    return Mex;
}

ll floor_div(ll a, ll b) {
	return a / b - (((a ^ b) < 0) and a % b);
}
ll ceil_div(ll a, ll b){
    return a / b + (((a ^ b) >= 0) and a % b);
}

inline void INP()
{
	#ifndef ONLINE_JUDGE
	    freopen("input.txt","r",stdin);   
	    freopen("output.txt","w",stdout);
	#endif 
}

void solve()
{
    ll n;
    cin>>n;
    cout << ps(15) << 2*PI*n << endl;

}

int32_t main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t=1;
    // cin>>t;
    test(t){
        solve();
    }
    return 0;
}


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

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define FOR(i, a, b) for (int (i) = (a); (i) <= (b); (i)++)
#define ROF(i, a, b) for (int (i) = (a); (i) >= (b); (i)--)
#define REP(i, n) FOR(i, 0, (n)-1)
#define sqr(x) ((x) * (x))
#define all(x) (x).begin(), (x).end()
#define reset(x, y) memset(x, y, sizeof(x))
#define uni(x) (x).erase(unique(all(x)), (x).end());
#define BUG(x) cerr << #x << " = " << (x) << endl
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define _1 first
#define _2 second

const int maxn = 1234;
const int inf = 0x3f3f3f3f;

int n, k;
ll a[maxn];
int upp[55];
vector<ll> b;

int main() {
    scanf("%d%d", &n, &k);
    FOR(i, 1, n) scanf("%lld", &a[i]);
    FOR(i, 1, n) {
        ll now = 0;
        FOR(j, i, n) {
            now += a[j];
            b.pb(now);
        }
    }
    sort(all(b));
    reverse(all(b));
    ll ans = 0;
    upp[50] = b.size();
    ROF(i, 50, 0) {
        ll mask = 1LL << i;
        int cur = -1;
        REP(j, upp[i]) if (!(b[j] & mask)) {
                cur = j;
                break;
            }
        if (cur == -1) cur = upp[i];
        if (cur >= k) {
            if (i) upp[i - 1] = cur;
            ans += mask;
        } else if (i) upp[i - 1] = upp[i];
        REP(j, cur) b[j] -= mask;
        if(i) sort(b.begin(), b.begin() + upp[i - 1], greater<ll>());
    }
    printf("%lld\n", ans);
}

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

const int mod=1e9+7;

ll Big_Mod(ll value, ll power)
{
    if(power==0) return 1;

    ll ans = Big_Mod(value, power/2);

    ans = (ans * ans) % mod;

    if(power % 2) ans = (ans * value) % mod;

    return ans;
}

void solve()
{
   ll n,fact[10],i,sum=0,X,Y,Z;
   cin>>n;
   if(n==1)
   {
       cout<<0<<endl;
   }
   else
   {
       X=Big_Mod(10LL, n);
       
       Y=2LL*Big_Mod(9LL, n);
       
       Z=Big_Mod(8LL ,n);
       
       sum=X+Z-Y;
       
       sum%=mod;
       
       sum+=mod;
       
       sum%=mod;
       
       cout<<sum<<endl;
   }
}

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

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


Measured memory_bytes: 3648
#include<bits/stdc++.h>
#define rep(i,n) for(int (i) = 0;(i) < (n);(i)++)
#define SORT(c) sort((c).begin(),(c).end())
#define INF 1000000007
//S.size()

using namespace std;


typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef vector<bool> VB;
typedef unsigned long long ll;



int main(void){
  int N,X;cin>>N>>X;
  int m[N];rep(i ,N)cin>>m[i];
  int cnt = 0;

  sort(m,m + N);
  for(int t = 0;t < N;t++){
    X -= m[t];
    cnt++;

    if(X < 0){
      cnt--;
      break;
    }
    else if(X == 0)break;
  }

  if(X > 0){
    cnt += X / m[0];
  }

  cout<<cnt;
}


Measured memory_bytes: 256
#ifndef LOCAL
#pragma GCC optimize ("O3")
#endif

#include <bits/stdc++.h>

using namespace std;

#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 {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 (c it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(x...) " [" #x ": " << (x) << "] "

using ll = long long;

constexpr int mod = 1000 * 1000 * 1000 + 7;

void OdejmijOd(int& a, int b) { a -= b; if (a < 0) a += mod; }
int Odejmij(int a, int b) { OdejmijOd(a, b); return a; }
void DodajDo(int& a, int b) { a += b; if (a >= mod) a -= mod; }
int Dodaj(int a, int b) { DodajDo(a, b); return a; }
int Mnoz(int a, int b) { return (ll) a * b % mod; }
void MnozDo(int& a, int b) { a = Mnoz(a, b); }

string Binary(int x, int len) {
  #ifdef LOCAL
  string s = bitset<105>(x).to_string();
  reverse(s.begin(), s.end());
  s = s.substr(0, len);
  reverse(s.begin(), s.end());
  return s;
  #else
  return "";
  #endif
}

constexpr int nax = 20;

int n, K;
int dp[nax + 1][nax + 1][1 << nax];

int main() {
  scanf("%d%d", &n, &K);
  for (int i = 0; i <= n; i++) {
    static char buf[(1 << nax) + 10];
    scanf("%s", buf);
    assert((int) strlen(buf) == (1 << i));
    for (int j = 0; j < (1 << i); j++) {
      assert(buf[j] == '0' or buf[j] == '1');
      dp[i][0][j] += (buf[j] - '0');
    }
  }

  for (int len = n; len >= 0; len--) {
    for (int pref = 0; pref < len; pref++) {
      for (int i = 0; i < (1 << len); i++) {
        const int ile = dp[len][pref][i];
        debug() << "dp[" << len << "][" << pref << "][" << Binary(i, len) << "] = " << ile;
        dp[len][pref + 1][i] += ile;
        int reszta = (i >> pref);
        const int blok = (i & ((1 << pref) - 1));
        const int bit0 = (reszta & 1);
        dp[pref][pref][blok] += ile;
        reszta >>= 1;
        for (int k = pref + 1; k < len; k++) {
          if ((reszta & 1) != bit0) {
            const int wyjm = k - pref;
            dp[len - wyjm][pref + 1][blok | (reszta << pref)] += ile;
            break;
          }
          reszta >>= 1;
        }
      }
    }
    for (int i = 0; i < (1 << len); i++) {
      debug() << "_dp[" << len << "][" << len << "][" << Binary(i, len) << "] = " << dp[len][len][i];
      if (dp[len][len][i] >= K) {
        for (int j = len - 1; j >= 0; j--) {
          printf("%d", ((i >> j) & 1));
        }
        printf("\n");
        return 0;
      }
    }
  }

  assert(false);
  return 0;
}


Measured memory_bytes: 556288
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int nn = sc.nextInt();
		int nnn = sc.nextInt();
		if((n+nn+nnn)>=22) System.out.println("bust");
		else	System.out.println("win");
	}
}

Measured memory_bytes: 21844
package main

import (
	"bufio"
	"fmt"
	"os"
)

var sc *bufio.Scanner = func() *bufio.Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	return sc
}()

func nextString() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	const (
		yes = "Yes"
		no  = "No"
	)
	s := nextString()
	m := make(map[rune]int, 4)
	for _, rr := range s {
		m[rr]++
	}
	countF := func(mm map[rune]int) bool {
		for _, i := range mm {
			if i != 2 {
				return false
			}
		}
		return true
	}

	if len(m) == 2 && countF(m) {
		fmt.Println(yes)
	} else {
		fmt.Println(no)
	}
}


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

int main()
{
    std::string s;
    std::cin >> s;

    const int mod = 1000000007;

    std::reverse(s.begin(), s.end());

    int pos = 1;
    std::vector<long long> reminds(13, 0);
    reminds[0] = 1;
    for (auto c : s) {
        std::vector<long long> new_reminds(13, 0);

        if (c == '?') {
            for (int i = 0; i < 10; i++) {
                for (int j = 0; j < 13; j++) {
                    new_reminds[(i * pos + j) % 13] += reminds[j];
                    new_reminds[(i * pos + j) % 13] %= mod;
                }
            }
        } else {
            int i = c - '0';
            for (int j = 0; j < 13; j++) {
                new_reminds[(i * pos + j) % 13] += reminds[j];
                new_reminds[(i * pos + j) % 13] %= mod;
            }
        }

        pos *= 10;
        pos %= 13;
        reminds = new_reminds;
    }

    std::cout << reminds[5] << std::endl;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define EPS (1e-10)
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

bool is_prime(ll n){
	if(n==1)return false;
	for(ll i=2;i*i<=n;i++){
		if(n%i==0)return false;
	}
	return true;
}
vector<ll>divsor(ll n){
	vector<ll>res;
	for(ll i=1;i*i<=n;i++){
		if(n%i==0){
			res.push_back(i);
			if(i!=n/i)res.push_back(i);
		}
	}
	return res;
}
map<ll,int>prime_factor(ll n){
	map<ll,int>res;
	for(ll i=2;i*i<=n;i++){
		while(n%i==0){
			res[i]++;
			n/=i;
		}
	}
	if(n!=1)res[n]++;
	return res;
}
ll dp[200000][50];
signed main(){
	int n,m;cin>>n>>m;
	dp[0][0]=1;
	rep(i,n)rep(j,40){
		for(int k=0;j+k<40;k++){
			(dp[i+1][j+k]+=dp[i][j])%=MOD;
		}
	}
	auto mp=prime_factor(m);
	ll ans=1;
	for(auto&p:mp){
		(ans*=dp[n][p.second])%=MOD;
	}
	cout<<ans<<endl;
}

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

int main(){
  int a,b,c,k;
  cin >> a >> b >> c >> k;
  for(int i = 1; i <= k; i++){
    if(a >= b){
      b *= 2;
      continue;
    }
    if(a < b && b >= c){
      c *= 2;
    }
  }
  if(a < b && b < c){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}

Measured memory_bytes: 3620
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define Rep(i, k, n) for (int i = k; i < (int)(n); i++)

int main()
{
  int s, w;
  cin >> s >> w;
  if (s <= w)
    cout << "unsafe" << endl;
  else
    cout << "safe" << endl;
}

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

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int64 i = 0;i < (n);i++)
#define FOR(i, a, b) for(int64 i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

const int64 mod = 1e9+7;

int main(void){
	int64 N, H, W;
	cin >> N >> H >> W;
	cout << (N-H+1)*(N-W+1) << endl;
}


Measured memory_bytes: 256
#include <iostream>                                           
#include <string>
using namespace std;
 
int main(){
  int n, max_v = 0, value = 0;
  string str;
  cin >> n >> str;
  for(int i = 0; i < n; i++){
    if(str[i] == 'I') value++;
    else value--;
    max_v = max(max_v, value); 
  }
  cout << max_v << endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<list>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<set>
#include<map>
#include<queue>
#include<cstring>
#include<sstream>
using namespace std;

typedef long long ll;

int main() {
  int N; cin >> N;
  int A;
  int cntOdd = 0;
  for ( int i = 0; i < N; i++ ) {
    cin >> A;
    if ( A % 2 == 1 ) cntOdd++;
  }

  if ( cntOdd % 2 == 0 ) cout << "YES" << endl;
  else cout << "NO" << endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<math.h>
#include<algorithm>
using namespace std;
#define USINT_MAX 4294967295

int main(){
	int n, a[100000],b=0;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	for (int i = 0; i < n; i++) {
		int temp = a[i]-1;
		if (a[temp]==i+1)b++;
	}
	b = b / 2;
	cout << b << endl;
	return 0;
}

Measured memory_bytes: 640
#include<iostream>
#include<vector>
#include<algorithm>
#include<utility>
#include<string>
using namespace std;
#define rep(i, n) for(int i=0;i<n;i++)
int main(){
    string s;
    cin>>s;
    rep(i, 10){
        if(i==3)
            cout<<'8';
        else
            cout<<s[i];
    }
    cout<<endl;
    return 0;
}

Measured memory_bytes: 256
import sys
import math
from fractions import gcd
# import queue
# from collections import Counter
# from itertools import accumulate
# from functools import reduce

def lcm(a, b):
    return a * b // gcd(a, b)

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

big_prime = 1000000007

"""
# 標準入力取得
## 文字列
 =  sys.stdin.readline().rstrip()
 =  list(sys.stdin.readline().rstrip())

## 数値
 =  int(sys.stdin.readline())
 =  map(int, sys.stdin.readline().split())
 =  list(map(int, sys.stdin.readline().split()))
 =  [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""
N = int(sys.stdin.readline())
list_v = list(map(int, sys.stdin.readline().split()))
list_v.sort()
sum = 0

for i in range(N):
    if(i==0):
        sum += list_v[i] / (2 ** (N-i-1))
    else:
        sum += list_v[i] / (2 ** (N-i))

print(sum)



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

n, m = map(int, input().split())
ab = []
cd = []
for _ in range(n):
    a, b = map(int, input().split())
    ab.append((a, b))
for _ in range(m):
    c, d = map(int, input().split())
    cd.append((c, d))
ans = []
for a, b in ab:
    t = 10**18
    checkpoint = -1
    for i, cdi in enumerate(cd):
        c, d = cdi
        dist = abs(a-c)+abs(b-d)
        if dist < t:
            t = dist
            checkpoint = (i+1)
    ans.append(checkpoint)
print(*ans, sep='\n')


Measured memory_bytes: 8984
#include <bits/stdc++.h>
#include <variant>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/range/irange.hpp>
#include <boost/range/adaptor/indexed.hpp>
#define FOR(i,k,n)  for(int i = (k);i < (n);++i)
#define REP(i,n)    FOR(i,0,n)
#define ALL(x) begin(x),end(x)

using namespace std;
using namespace boost::adaptors;
using namespace std::string_literals;
using ll = int64_t;
using vecint = vector<int>;
using vecll = vector<ll>;
using boost::irange;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin>>n;
  string s;
  cin>>s;
  vecint cnt(3, 0);
  ll ans = 0;
  REP(i,n){
    int ci = s[i]%3;
    FOR(j,i+1,n) {
      int cj = s[j]%3;
      if (ci == cj) continue;
      int ck = 3-ci-cj;
      ans += cnt[ck];
      int d = j-i;
      int k = i-d;
      if (k >= 0 && s[k]%3 == ck) --ans;
    }
    ++cnt[ci];
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 3664
#include<cstdio>
using namespace std;
int n,k,ans,now,w,a[10];
bool b[10];
int main(void){
	register int i,j,k,x;
	scanf("%d%d",&n,&k);
	for(i=1;i<=k;++i)
		scanf("%d",&x),b[x]=1;
	x=n,now=0;
	while(x)a[++now]=x%10,x/=10,w+=b[a[now]];
	if(now==0)now=1,w=b[0];
	while(1){
		if(w==0){
			if(now==0)
				puts("0");
			else 
			for(i=now;i;--i)
				printf("%d",a[i]);
			return 0;
		}
		w-=b[a[1]],++a[1];if(1==now&&a[now]==10)++now;
		for(i=2;i<=now;++i){
			if(!(i==now&&a[now]==0))w-=b[a[i]];
			if(a[i-1]==10)a[i-1]%=10,a[i]+=1;
			w+=b[a[i-1]];
			if(i==now&&a[now]==10)++now;
		}
		w+=b[a[now]];
	}
}

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

//--------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define LL long long
#define INF INT_MAX/3

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

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

int main(){
  int n;
  scanf("%d",&n);
  printf("%d\n",800 * n - 200 * (n / 15));
}


Measured memory_bytes: 256
#include<stdio.h>
int main(void){
  int N;
  int S=0;
  int array[100];
  scanf("%d",&N);
  for(int i=0; i<N-1; i++){
    scanf("%d",&array[i]);
    for(int j=i+1; j<N; j++){
      scanf("%d",&array[j]);
      S=S+array[i]*array[j];
    }
  }
  printf("%d",S);
}

Measured memory_bytes: 128
N,u,v=gets.split.map(&:to_i)
u-=1;v-=1
list=Array.new(N){Array.new}
(N-1).times do |i|
    a,b=gets.split.map(&:to_i)
    list[a-1].push(b-1)
    list[b-1].push(a-1)
end
dp=Array.new(N,-1) #dp[i]:=ノードiの親
stack=Array.new
visited=Array.new(N,false)
stack.push(v)
until stack.empty?
    pres=stack.pop
    next if visited[pres]
    visited[pres]=true
    list[pres].each do |e|
        dp[e]=pres if dp[e]==-1
        stack.push(e)
    end
end
dp[v]=-1
path=Array.new
path.push(u)
while true
    break if dp[path[0]]==-1
    path.unshift(dp[path[0]])
end

conf=path[(path.size-1)/2]
if path.size==2
    list[conf]=[path[(path.size-1)/2+1]]
else
    list[conf]=[path[(path.size-1)/2+1],path[(path.size-1)/2-1]]
end
dp=Array.new(N,-1) #dp[i]:=u->iの距離
valid=Array.new(N,false)
stack=[v]
until stack.empty?
    pres=stack.pop
    next if dp[pres]!=-1
    d=-1
    valid[pres]=true if pres==conf
    list[pres].each do |e|
        d=d<dp[e] ? dp[e] : d
        valid[pres]=true if valid[e]
        stack.push(e)
    end
    dp[pres]=d+1
end
res=0
N.times do |i|
    res=res<dp[i] ? dp[i] : res if valid[i]
end
puts res-1

Measured memory_bytes: 14588
#include <bits/stdc++.h>
// unsolved
int n, black_count, white_count, white_num, black_num;
std::string s;
std::vector<std::pair<int, int>> vec;
int min_count;

int main() {
    black_count = 0;
    white_count = 0;
    std::cin >> n >> s;
    min_count = n * n;
    vec.assign(n, {0, 0});
    for (int i = 0; i < n; i++) {
        if (s[i] == '#') {
            black_count++;
        }
    }
    white_count = n - black_count;
    for (int i = 0; i < n; i++) {
        if (i == 0) {
            if (s[i] == '.') {
                white_num = white_count - 1;
            }
            else {
                white_num = white_count;
            }
            vec[i] = std::make_pair(white_num, 0);
            continue;
        }
        if (s[i-1] == '#') {
            vec[i].second = vec[i-1].second + 1;
        }
        else {
            vec[i].second = vec[i-1].second;
        }
        if (s[i] == '.') {
            vec[i].first = vec[i-1].first - 1;
        }
        else {
            vec[i].first = vec[i-1].first;
        }
    }

    int sum = 0;
    for (int i = 0; i < n; i++) {
        sum = vec[i].first + vec[i].second;
        if (sum < min_count) {
            min_count = sum;
        }
    }
    std::cout << min_count << std::endl;
}


Measured memory_bytes: 2180
//Created by Kira

#include<bits/stdc++.h>
using namespace std;

#define IOS cin.sync_with_stdio(0);cin.tie(0); cout.tie(0);
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
#define pii pair<int,int> 
#define pb push_back
#define vi vector<int> 
using ll = long long;

const int mod = 1e9 + 7;

ll pwr(ll a, ll b);
    



int main(){
   IOS

    ll n; cin>>n;
   string s; 
    while(n){
        n--;
        s += string(1, 'a' + n % 26);
        n /= 26;
    }

    reverse(all(s));
    cout<<s<<"\n";

}

ll pwr(ll a, ll b){
   a %= mod;	//Remove mod if not required
   ll res = 1;
   while(b > 0){
    if(b&1) res = res * a % mod;
        a = a * a % mod;
    b >>= 1;
    }

    return res;
}



Measured memory_bytes: 3640
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vll = vector<long long>;
using vp = vector<pair<int, int>>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using vvll = vector<vector<long long>>;
template<class T> inline bool chmax(T &a, T b) { if (a<b) {a=b; return 1;} return 0;}
template<class T> inline bool chmin(T &a, T b) { if (b<a) {a=b; return 1;} return 0;}
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n, k;
    cin >> n >> k;
    double ans = 0;
    for (int x = 1; x <= n; ++x) {
        double tmp = 1.0 / n;
        int now = x;
        while (now < k) {
            now *= 2;
            tmp /= 2;
        }
        ans += tmp;
    }
    cout << fixed << setprecision(12) << ans << endl;
}

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

using namespace std;
typedef long long ll;

#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i, m, n) for(int i = m;i < n;i++)

int main(){
// ここに処理を記述
	string s,t;

	cin >> s >> t;

	string ls = s + s;

	vector<int> ch[26];

	REP(i, ls.size()){
		int temp = ls[i] - 'a';
		ch[temp].push_back(i+1);
	}

	// cout << t << "\n";

	ll ans = 0;
	int cur = 0;
	int idx;

/*
	REP(i, 26){
		REP(j, ch[i].size()){
			cout << ch[i][j] << ",";
		}
		if(ch[i].size()==0){continue;}
		cout << "\n";
	}
*/

	REP(i, t.size()){
		int temp = t[i] - 'a';
		if(ch[temp].size() == 0){
			cout << "-1" << endl;
			return 0;
		}
		else{
			int pos = *upper_bound(ch[temp].begin(),ch[temp].end(),cur);
			// cout << "cur " << cur << " pos " << pos <<"\n";

			if(pos > s.size()-1){
				ans += (ll)s.size();
				cur = pos - ( s.size() );
			}
			else{
				cur = pos;
			}
		}
		// cout << ans + 1 << "\n";
	}

	ans += (ll)cur;

	cout << ans << endl;

	return 0;
}

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

int main() {
  int n, elem;

  vector<int> a;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> elem;
    a.push_back(elem);
  }
  for (int i = 1; i <= n; i++) {
    if (i != 1) {
      cout << " ";
    }   
    cout << a[a.size() - i]; 
  }
  cout << endl;
}

Measured memory_bytes: 3120
def func():
    pass


def main():
    n, m = map(int, input().split())
    x = [int(i) for i in input().split()]

    if n >= m:
        print(0)
        exit()

    x.sort()
    d = []
    for i in range(m - 1):
        d.append(x[i + 1] - x[i])

    top_n_d = sorted(d, reverse=True)[:n - 1]

    # print(x)
    # print(d)
    # print(top_n_d)

    print(max(x) - min(x) + 1 - sum(top_n_d) - 1)


if __name__ == '__main__':
    main()


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

using namespace std;

#define debug(x) '[' << #x << " is: " << x << "] "
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.precision(10);
	cout << fixed;
	#ifndef ONLINE_JUDGE
		//freopen("input.txt","r",stdin);
	#endif
	int n;
	cin>>n;
	vector<int> a(n);
	for(int i=0;i<n;i++)cin>>a[i];
	int i=n-1;
	for(;i>=0;i-=2)cout << a[i] << ' ';
	i+=2;
	if(!i)i++;
	else i--;
	for(;i<n;i+=2)cout << a[i] << ' ';
	cout << '\n';
}

Measured memory_bytes: 2944
#include<stdio.h>
 
struct dice{
  int s1[6];
  int jmen[24],zmen[24];
};
 
int main(){
  struct dice D;
  int i,j,n;
 
  for(i=0;i<6;i++)
    scanf("%d",&D.s1[i]);
 
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d %d",&D.jmen[i],&D.zmen[i]);
 
  
    if(D.jmen[i] == D.s1[0]){
      if(D.zmen[i] == D.s1[1])printf("%d\n",D.s1[2]);
      else if(D.zmen[i] == D.s1[2])printf("%d\n",D.s1[4]);
      else if(D.zmen[i] == D.s1[3])printf("%d\n",D.s1[1]);
      else if(D.zmen[i] == D.s1[4])printf("%d\n",D.s1[3]);
    }
    else if(D.jmen[i] == D.s1[1]){
      if(D.zmen[i] == D.s1[5])printf("%d\n",D.s1[2]);
      else if(D.zmen[i] == D.s1[2])printf("%d\n",D.s1[0]);
      else if(D.zmen[i] == D.s1[3])printf("%d\n",D.s1[5]);
      else if(D.zmen[i] == D.s1[0])printf("%d\n",D.s1[3]);
    }
    else if(D.jmen[i] == D.s1[2]){
      if(D.zmen[i] == D.s1[1])printf("%d\n",D.s1[5]);
      else if(D.zmen[i] == D.s1[5])printf("%d\n",D.s1[4]);
      else if(D.zmen[i] == D.s1[0])printf("%d\n",D.s1[1]);
      else if(D.zmen[i] == D.s1[4])printf("%d\n",D.s1[0]);
    }
    else if(D.jmen[i] == D.s1[3]){
      if(D.zmen[i] == D.s1[1])printf("%d\n",D.s1[0]);
      else if(D.zmen[i] == D.s1[0])printf("%d\n",D.s1[4]);
      else if(D.zmen[i] == D.s1[5])printf("%d\n",D.s1[1]);
      else if(D.zmen[i] == D.s1[4])printf("%d\n",D.s1[5]);
    }
    else if(D.jmen[i] == D.s1[4]){
      if(D.zmen[i] == D.s1[0])printf("%d\n",D.s1[2]);
      else if(D.zmen[i] == D.s1[2])printf("%d\n",D.s1[5]);
      else if(D.zmen[i] == D.s1[3])printf("%d\n",D.s1[0]);
      else if(D.zmen[i] == D.s1[5])printf("%d\n",D.s1[3]);
    }
    else if(D.jmen[i] == D.s1[5]){
      if(D.zmen[i] == D.s1[1])printf("%d\n",D.s1[3]);
      else if(D.zmen[i] == D.s1[2])printf("%d\n",D.s1[1]);
      else if(D.zmen[i] == D.s1[3])printf("%d\n",D.s1[4]);
      else if(D.zmen[i] == D.s1[4])printf("%d\n",D.s1[2]);
    }
  }
  return 0;
}


Measured memory_bytes: 2044
#include<iostream>
using namespace std;
int main(){
	int n;
	cin>>n;
	string s;
	cin>>s;
	int tot=0;
	int minv=0x7fffffff;
	for(int i=0;i<s.size();++i)
		if(s[i]=='R')
			++tot;
	minv=min(minv,tot);
	int tot2=0;
	for(int i=0;i<tot;++i)
		if(s[i]=='W')
			++tot2;
	minv=min(minv,tot2);
	tot=0;
	for(int i=0;i<s.size();++i)
		if(s[i]=='W')
			++tot;
	cout<<min(minv,tot)<<endl;
	return 0;
} 

Measured memory_bytes: 3708
package main

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

//Util
func nextStr() string {
	sc.Scan()
	return sc.Text()
}

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

func maxInt(a, b int) int {
	if a > b {
		return a
	} else {
		return b
	}
}

func minInt(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}

func absInt(a int) int {
	if a >= 0 {
		return a
	} else {
		return -a
	}
}

func absFloat64(a float64) float64 {
	if a >= 0 {
		return a
	} else {
		return -a
	}
}

func maxFloat64(a, b float64) float64 {
	if a > b {
		return a
	} else {
		return b
	}
}

func minFloat64(a, b float64) float64 {
	if a > b {
		return b
	} else {
		return a
	}
}

func str2Int(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}

func reverse(s string) string {
	runes := []rune(s)
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}
	return string(runes)
}

func powInt(p, q int) int {
	return int(math.Pow(float64(p), float64(q)))
}

func isPrime(x int) bool {
	if x == 1 {
		return false
	}
	if x == 2 {
		return true
	}
	if x%2 == 0 {
		return false
	}

	b := true
	rootx := int(math.Sqrt(float64(x)))
	i := 3
	for i <= rootx {
		if x%i == 0 {
			b = false
			break
		}
		i += 2
	}
	return b
}

func PrimeFactors(n int) (pfs []int) {
	// Get the number of 2s that divide n
	for n%2 == 0 {
		pfs = append(pfs, 2)
		n = n / 2
	}

	// n must be odd at this point. so we can skip one element
	// (note i = i + 2)
	for i := 3; i*i <= n; i = i + 2 {
		// while i divides n, append i and divide n
		for n%i == 0 {
			pfs = append(pfs, i)
			n = n / i
		}
	}

	// This condition is to handle the case when n is a prime number
	// greater than 2
	if n > 2 {
		pfs = append(pfs, n)
	}

	return
}

func sumInts(x []int) int {

	total := 0
	for _, v := range x {
		total += v
	}

	return total
}

//Main
const (
	initialBufSize = 10000
	maxBufSize     = 1000000
	mod            = 1e9 + 7
)

var (
	sc *bufio.Scanner = func() *bufio.Scanner {
		sc := bufio.NewScanner(os.Stdin)
		buf := make([]byte, initialBufSize)
		sc.Buffer(buf, maxBufSize)
		return sc
	}()
)

func IsFirstUpper(v string) bool {
	if v == "" {
		return false
	}
	r := rune(v[0])
	return unicode.IsUpper(r)
}

var s string

func main() {
	sc.Split(bufio.ScanWords)

	s = nextStr()
	if IsFirstUpper(s) {
		fmt.Println("A")
	} else {
		fmt.Println("a")
	}

}


Measured memory_bytes: 1772
# -*- coding: utf-8 -*-
"""
Created on Sun Feb  3 21:03:02 2019

@author: Yamazaki Kenichi
"""

N = int(input())
A = list(map(int,input().split()))

m = max(A)
if sum(A)-m >m:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) FOR(i,0,n)
#define repr(i,n) for(int i=(n)-1;0<=i;--i)
#define each(e,v) for(auto&& e:(v))
#define all(v) begin(v),end(v)
#define dump(x) cerr<<#x<<": "<<(x)<<endl
using namespace std;
using vint = vector<int>;
using ll = long long;
using vll = vector<ll>;
template <class T> void chmin(T& a, const T& b) { a = min(a, b); }
template <class T> void chmax(T& a, const T& b) { a = max(a, b); }
void yes() { cout << "Yes" << endl; exit(0); }
void no() { cout << "No" << endl; exit(0); }

struct UnionFind {
    vector<int> parent, height;
    int group;
    UnionFind(int N) {
        parent = vector<int>(N, -1);
        height = vector<int>(N, 1);
        group = N;
    }
    int find(int a) {
        if(parent[a] < 0) return a;
        parent[a] = find(parent[a]);
        return parent[a];
    }
    bool same(int a, int b) {
        return find(a) == find(b);
    }
    int count(int a) {
        return -parent[find(a)];
    }
    void unite(int a, int b) {
        a = find(a); b = find(b);
        if(a == b) return;
        group--;
        if(height[b] < height[a]) swap(a, b);
        if(height[a] == height[b]) height[a]++;
        parent[b] += parent[a];
        parent[a] = b;
    }
};

int main() {
    int n, m; cin >> n >> m;
    UnionFind uf(n);
    rep(i, m) {
        int x, y, z; cin >> x >> y >> z;
        uf.unite(x-1, y-1);
    }
    cout << uf.group << endl;
    return 0;
}


Measured memory_bytes: 1152
#include<bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(0);cin.tie(0)
#define fst first
#define snd second
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define sz size()
#define FORN(i,j,n) for(long long i=j; i<(long long)n;i++) 
#define FOR(i,n) FORN(i,0,n)
#define FORIT(i,x) for( auto i = x.begin() ; i != x.end() ; i++ )
#define MOD 998244353LL
#define LIM 262150
#define ones(x) __builtin_popcount(x)
#define trace(x)    cerr << #x << ": " << x << endl;
#define trace2(x, y) cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
using namespace std;
 
typedef long long ll ;
typedef unsigned long long ull ;
typedef vector <int> vi;
typedef pair <int,int> ii;
typedef vector <string> vs;
typedef vector <ii> vii;
ll n,w;
ll ans = 0;
ll dp[105][100005];
ll v[105];
ll p[105];
int main() {
	fastio;
	cin>> n >> w;
	FORN(i,1,n+1) cin>> p[i] >> v[i];
	FOR(i,n+1){
		FOR(j,1e5+1){
			dp[i][j] = 1e14;
		}
	}
	FORN(i,0,n+1){
		FOR(j,1e5+1){
		    if(j == 0){ dp[i][j] = 0; continue; }
		    if(i == 0){ dp[i][j] = 1e14; continue; }
			if(j >= v[i]){
				dp[i][j] = min( dp[i-1][j-v[i]] + p[i] , dp[i-1][j]);
			}
			else{
				dp[i][j] = dp[i-1][j];
			}
		}
	}
	FOR(i,1e5+1){
		if(dp[n][i]<=w){
			ans = max(ans,i);
		}
	}
	cout<< ans << '\n'; 
	//cout<< dp[3][100000] << '\n';
	return 0;
}

Measured memory_bytes: 82544
#include <vector>
#include <algorithm>
#include <iostream>
#include <cassert>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <ctime>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <cassert>
#include <stack> 

#define INFLL 2000000000000000000
#define INF 2000000000
#define MOD 1000000007
#define PI acos(-1.0)
#define MAXLEN 29

typedef std::pair <int, int> pii;
typedef long long ll;
typedef std::vector <ll> vll;

using namespace std;

int sz[100000];
int p[100000];
int m, n;
ll cost[100000];
priority_queue <ll> pq;
ll mini[100000];
int w[100000];
bool used[100000];

int get(int a) {
	while (p[a] != a) a = p[a];
	return a;
}
void merge(int a, int b) {
	a = get(a);
	b = get(b);
	if (a == b) return;
	if (sz[a] > sz[b]) {
		p[b] = a;
		sz[a] += sz[b];
	} else {
		p[a] = b;
		sz[b] += sz[a];
	}
}

int main() {
	scanf("%d %d", &n, &m);
	for (int i = 0; i < n; i++) scanf("%lld", &cost[i]);
	int x, y;
	for (int i = 0; i < n; i++) {
		p[i] = i;
		sz[i] = 1;
	}
	ll ans = 0;
	int cnt = n;
	for (int i = 0; i < m; i++) {
		scanf("%d %d", &x, &y);
		merge(x, y);
		cnt--;
	}
	if (m == n - 1) {
		cout << 0 << endl;
		return 0;
	}
	if (2 * (n - m - 1) > n) {
		cout << "Impossible" << endl;
		return 0;
	}
	for (int i = 0; i < n; i++) mini[i] = INF;
	for (int i = 0; i < n; i++) {
		int c = get(i);
		if (mini[c] > cost[i]) {
			if (mini[c] != INF) {
				ans -= cost[w[c]];
				used[w[c]] = false;
			}
			ans += cost[i];
			used[i] = true;
			w[c] = i;
			mini[c] = cost[i];
		}
	}
	for (int i = 0; i < n; i++) if (!used[i]) pq.push(-cost[i]);
	for (int i = n - m; i > 2; i--) {
		ans += -pq.top();
		pq.pop();
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 4216
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<functional>
#include<math.h>

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

int main() {
	string s;
	cin >> s;
	int q;
	cin >> q;
	int fla = 0;

	rep(i, q) {
		int t;
		cin >> t;
		if (t == 1) {
			fla++;
		}
		if (t == 2) {
			int f;
			string c;
			cin >> f >> c;
			
			if (fla % 2 == 0) {
				if (f == 1) {
					s.insert(0, c);
				}
				if (f == 2) {
					s += c;
				}
			}
			if (fla % 2 != 0) {
				if (f == 1) {
					s += c;
				}
				if (f == 2) {
					s.insert(0, c);
				}
			}
		}
	}
	if (fla % 2 != 0) reverse(s.begin(), s.end());
	cout << s << endl;

	return 0;
}


Measured memory_bytes: 900
mod = 998244353

N = int(input())

nums = [int(x) for x in input().split(' ')]
if nums[0] != 0:
	print(0)
	exit()
	
nums.sort()
#print('yeah')

if N > 1 and nums[1] != 1:
	print(0)
	exit()
	
if N == 1:
	print(1)
	exit()
	


def pow_mod(m,n):
	prod = 1
	for i in range(n):
		prod = (m * prod) % mod
		
	return prod

count = 1
counts = []
cnt_current = 0
zero_count = 0
for num in nums[1:]:
	if num > count:
		counts.append(cnt_current)
		if num - count > 1:
			print(0)
			exit()
		cnt_current = 1
		count = num
	else:
		cnt_current += 1
		
if count > 1:
	counts.append(cnt_current)
		
#print(counts)
		
if count == 1:
	print(1)
	exit()
	
out = 1
for i in range(len(counts) - 1):
	out *= pow_mod(counts[i],counts[i+1]) % mod
	
print(out % mod)


Measured memory_bytes: 14396
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
#include <bitset>
#include <iomanip>
#include <stack>
#include <list>
#include <map>
#include <unordered_map>
#include <chrono>
#include <numeric>
using namespace std;
using ll = long long;
const ll INF = (ll)1e18+1;
const ll DIV = 1000000007;
//#define TEST


int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
#ifdef TEST
    chrono::system_clock::time_point start, end;
    start = chrono::system_clock::now();
#endif
    string N;
    cin >> N;
    ll dig_sum = 0;
    for(size_t i=0;i<N.size(); i++)
    {
        dig_sum += N[i] - '0';
    }
    if(dig_sum % 9 == 0) cout << "Yes" << endl;
    else cout << "No" << endl;
#ifdef TEST
    end = chrono::system_clock::now();
    cerr << static_cast<double>(chrono::duration_cast<chrono::microseconds>(end - start).count() / 1000.0) << "[ms]" << endl;
#endif
    return 0;
}

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

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define INF 999999999
#define M_PI 3.14159265358979323846

#ifdef __LOCAL
    #define DBG(X) cout << #X << " = " << (X) << endl;
    #define SAY(X) cout << (X) << endl;
#else
    #define DBG(X)
    #define SAY(X)
#endif

#ifdef __LOCAL
    #include <filesystem>
    namespace fs = std::filesystem;
#endif

using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

int dx[]={1, 0, -1, 0, 0};
int dy[]={0, 1, 0, -1, 0};
const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);
const int NIL = -1;
static mt19937 _g(time(nullptr));
 
std::string pad(int num){ char buffer[4]; std::snprintf(buffer, sizeof(buffer), "%03d", num); return buffer;}
inline ll randint(ll a, ll b) { ll w = (_g() << 31LL) ^ _g(); return a + w % (b - a + 1); }
inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T> inline T sign(T x) { return T(x > 0) - T(x < 0); }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline T fetch() { T ret; cin >> ret; return ret; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

int main()
{
    fast_io();
    #ifdef __LOCAL
        fs::path p = __FILE__;
        fs::path input,output;
        input = output = p.parent_path();
        input += string("/input/") + string(p.stem()) + string(".txt");
        output += string("/output/") + string(p.stem()) + string(".txt");
        freopen(input.c_str(), "r", stdin);
        freopen(output.c_str(), "w", stdout);
    #endif
    
    int N,K;
    int ans=0;
    vector<int> H;
    cin >> N >> K;
    H = fetch_vec<int>(N);
    FOR(i,0,N) ans += (H[i]>=K) ;
    cout << ans << endl;
    
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
#define MOD 1000000007
#define MAX 510000
#define Rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep(i, n) for(ll i = 1; i <= (ll)(n); i++)

using namespace std;
typedef long long ll;
typedef pair<int, int> P;

//cout << fixed << setprecision(10);//
//最小公倍数//
ll gcd(ll x, ll y) {
	if (x == 0) return y;
	return gcd(y%x, x);
}
ll lcm(ll x, ll y) { return x * y / gcd(x, y); }

//べき//
ll squ(ll n, ll p, ll m){
	if(p==0) return 1;
	if(p%2==0){
		ll t=squ(n, p/2, m);
		return t*t%m;
	}
	return n*squ(n,p-1,m);
	
}


//逆元mod(mを法とするaの逆元)//
long long modinv(long long a, long long m) {
	long long b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}

//Cmonp//
ll fac[MAX], finv[MAX], inv[MAX];

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

// 二項係数計算
ll COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

//nが大

ll com(ll n,ll m){
	if(n<=0 || m<=0 || n==m){
		return 1;
	}
	if(n<m){
		return 0;
	}
	ll k=1;
	for(ll i=1;i<=m;i++){
       k*=(n-i+1); 
	   k%=MOD;
	   k*=modinv(i,MOD);
	   k%=MOD;
	}

	return k;
}


//


////////////////////////////////////////////////////////////////////

int main(){
ll h,w;
cin>>h>>w;

char grid[h+1][w+1];
ll dp[h+1][w+1];
Rep(i,h+1){
	Rep(j,w+1){
dp[i][j]=0;
	}
}



rep(i,h){
	rep(j,w){
		cin>>grid[i][j];
	}
}

dp[1][1]=1;
for(int i=1;i<=h;i++){
	for(int j=1;j<=w;j++){
if(grid[i][j]=='.'&&(i!=1 || j!=1)){
	dp[i][j]=dp[i-1][j]+dp[i][j-1];
	dp[i][j]%=MOD;
}
	}
}

cout<<dp[h][w]<<endl;
return 0;



}

Measured memory_bytes: 9088
def resolve():
    S = input()
    T = input()
    sl = len(S)
    tl = len(T)
    mn = 10000
    for i in range(sl - tl+1):
        count = 0
        #print(T,S[i:i+tl])
        for j,k in zip(T,S[i:i+tl]):
            if j!=k:
                count+=1
        
        mn=min(mn,count)
    print(mn)
resolve()

Measured memory_bytes: 73392
#include <stdio.h>

int main(void)
{
	int a;
	int b;

	
	scanf("%d %d",&a,&b);
	if (a < b)
		printf("a < b\n");
	else if (a > b)
		printf("a > b\n");
	else
		printf("a == b\n");
	return 0;
}

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

using namespace std;

#define ll long long

int main (){
	int n;
	cin>>n;
	vector<ll> v(n);
	vector<vector<ll>> dp(n, vector<ll>(n));
	for(int i=0; i<n; ++i) cin>>v[i];
	for(int r=0; r<n; ++r){
		for(int l=r; l>=0; --l){
			if(l==r) dp[l][r]=v[l];
			else dp[l][r]=max(v[l]-dp[l+1][r], v[r]-dp[l][r-1]);
		}
	}
	cout << dp[0][n-1];


	return 0;
}


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

int main(void){

  std::string s;
  std::cin >> s;

  if(s.c_str()[0] == s.c_str()[1]){
    std::cout << "1 2" << std::endl;
    return 0;
  }

  for(int i=0; i<s.size()-2; i++){
    int count = 0;
    count += (s.c_str()[i] - s.c_str()[i+1]) ? 0 : 1;
    count += (s.c_str()[i] - s.c_str()[i+2]) ? 0 : 1;
    count += (s.c_str()[i+1] - s.c_str()[i+2]) ? 0 : 1;
    if (count){
      std::cout << i+1 << " " << i+3 << std::endl;
      return 0;
    }
  }

  std::cout << "-1 -1" << std::endl;
  return 0;
}

Measured memory_bytes: 512
#include <stdio.h>
int main(void) {
    int x, y, kane;
    scanf("%d", &x);
    scanf("%d", &y);
    kane=0;
    if (x == 1) {
        kane=300000;
    } else if (x == 2) {
        kane=200000;
    } else if (x == 3) {
        kane=100000;
    }
    if (y == 1) {
        kane+=300000;
    } else if (y == 2) {
        kane+=200000;
    } else if (y == 3) {
        kane+=100000;
    }
    if (x == 1 && y==1) {
        kane+=400000;
    }
    printf("%d", kane);
    return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
//using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define per(i,j,n) for(int i=(int)(j);(int)(n)<=i;i--)
#define ll long long
#define ALL(a) (a).begin(),(a).end()
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define pb push_back
#define mp make_pair
#define endl "\n"
using std::cin;
using std::cout;
using std::vector;
using std::pair;
using std::string;
using std::upper_bound;
using std::lower_bound;
using vi=vector<int>;
using vii=vector<vi>;
using pii=pair<int,int>;
const int MOD=1e9+7;
const int MAX=1e5;
const ll INF=(1ll<<62)-1;
signed main(){
    int N; cin>>N;
    int Xor=0;
    vector<bool> cnt(40);
    rep(i,0,N){
        int X; cin>>X;
        Xor^=X;
        std::bitset<40> bit(X);
        rep(j,0,40){
            if(bit.test(j)){
                cnt[j]=1;
                break;
            }
        }
    }
    int ans=0;
    per(i,39,0){
        std::bitset<40> bit(Xor);
        if(bit.test(i)){
            if(cnt[i]){
                ans++;
                Xor^=(1ll<<i+1)-1;
            }
            else{
                ans=-1;
                break;
            }
        }
    }
    cout<<ans<<endl;
}



Measured memory_bytes: 256
/********
*	??????????????¢
*********/	
/*********??¢?????´?????????
*	?????¢???3???????????¨??¨????????????????????????????????´?????????????????????????????§Yes??§????????????
*	??????????????´??????????????°??????????????????????????????????????§No??§???????????¨????????????????????????
*********/

#include <iostream>
using namespace std;

class Cube{		//??????????????????
public:
	int f[6];
	Cube(){}
	void roll_z(){	roll(1,2,4,3);	}	//
	void roll_y(){	roll(0,2,5,3);	}	//toW(?\?)
	void roll_x(){	roll(0,1,5,4);	}	//toN(???)
	void roll(int i, int j, int k, int l){
		int t= f[i];
		f[i] = f[j];
		f[j] = f[k];
		f[k] = f[l];
		f[l] = t;
	}
};

bool eq(Cube c1, Cube c2 ){
	for(int i= 0; i<6; i++){
		if(c1.f[i] != c2.f[i] ){
			return false;
		}
	}
	return true;
}


bool equal( Cube c1, Cube c2 ){
	for(int i= 0; i < 6; i++){
		for(int j = 0; j < 4; j++ ){
			if( eq(c1, c2)){
				return true;
			}
			c1.roll_z();
		}
		if( i% 2 == 0){
			c1.roll_y();
		}
		else{
			c1.roll_x();
		}
	}
	return false;
}


int main()
{
	Cube dice1,dice2;//??????????????????????????????
	
	//????????????????????????????????\???
	for(int i =0; i<6; i++){
		cin >> dice1.f[i];
	}
	for(int i =0; i<6; i++){
		cin >> dice2.f[i];
	}

	//???????????????
	if( equal(dice1, dice2)){
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	
	return 0;
}

Measured memory_bytes: 1160
#include<stdio.h>
#include<iostream>
#include<string>
#include<complex>
#include<algorithm>
#include<vector>

int main()
{
	int n;
	long long a, min = 10000000000000, max{};

	scanf("%d", &n);
	for (int i = 0; i < n; ++i)
	{
		scanf("%lld", &a);
		if (a < min) min = a;
		if (a > max) max = a;
	}

	printf("%lld\n", max - min);

	return 0;
}

Measured memory_bytes: 256