akhauriyash/Code-Regression huggingface dataset:
// ?????¬???????????¬??????

#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
using namespace std;

#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define int long long int

template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}

typedef pair<int, int> pii;
typedef long long ll;

int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
constexpr ll INF = 1001001001001001LL;
constexpr ll MOD = 1000000007LL;

// ????????¢?´¢ (kD ??¨???2 ?¬???????????????§???)
struct Node {
    int loc, p, l, r;
};

struct Point {
    int id, x, y;
};

Node T[500010];
Point P[500010];
int np = 0, NIL = -1;

// [l, r) ??????????????????????????????????§????
int make(int l, int r, int depth=0) {
    if(l >= r) return NIL;
    int mid = (l + r) / 2, t = np++;
    if(depth % 2 == 0) {
        sort(P+l, P+r, [](const Point &a, const Point &b){return a.x < b.x;});
    }
    else {
        sort(P+l, P+r, [](const Point &a, const Point &b){return a.y < b.y;});
    }
    T[t].loc = mid;
    T[t].l = make(l, mid,   depth+1);
    T[t].r = make(mid+1, r, depth+1);
    return t;
}

// ?????? (sx, ty)????????? (tx, sy) ???????????¢???????????????????????????
// v ??? kD-tree ??????????????????????????????
void find(int v, int sx, int tx, int sy, int ty, vector<int> &ans, int depth=0) {
    int x = P[T[v].loc].x, y = P[T[v].loc].y;
    if(sx <= x && x <= tx && sy <= y && y <= ty) {
        // ans.push_back(Point{x, y});
        ans.push_back(P[T[v].loc].id);
    }

    if(depth % 2 == 0) {
        if(T[v].l != NIL && sx <= x) find(T[v].l, sx, tx, sy, ty, ans, depth+1);
        if(T[v].r != NIL && x <= tx) find(T[v].r, sx, tx, sy, ty, ans, depth+1);
    }
    else {
        if(T[v].l != NIL && sy <= y) find(T[v].l, sx, tx, sy, ty, ans, depth+1);
        if(T[v].r != NIL && y <= ty) find(T[v].r, sx, tx, sy, ty, ans, depth+1);
    }
}

// kD-tree end

int N, Q;

signed main() {
    scanf("%lld", &N);
    rep(i,0,N) {
        int x, y; scanf("%lld%lld", &x, &y);
        P[i] = Point{i, x, y};
        // T[i].l = T[i].r = T[i].p = NIL;
    }
    int root = make(0, N);

    scanf("%lld", &Q);
    rep(i,0,Q) {
        vector<int> ans;
        int sx, tx, sy, ty;
        scanf("%lld%lld%lld%lld", &sx, &tx, &sy, &ty);
        find(root, sx, tx, sy, ty, ans);
        sort(ans.begin(), ans.end());

        for(auto x : ans) printf("%lld\n", x);
        printf("\n");
    }
    return 0;
}

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

int main()
{
    string N;
    cin >> N;
    vector<int> digit(N.size());
    for (int i = 0; i < N.size(); i++)
    {
        digit[i] = N[i] - '0';
    }

    pair<int, int> current{0, 1};
    for (int d : digit)
    {
        current = make_pair(
            min(current.first + d, current.second + 10 - d),
            min(current.first + d + 1, current.second + 10 - d - 1));
    }
    cout << current.first << endl;
}


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

using namespace std;

typedef long long ll;

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

    vector<pair<ll, ll>> ab(n);
    for (int i = 0; i < n; i++) {
        cin >> ab[i].first >> ab[i].second;
    }

    sort(ab.begin(), ab.end(), [](pair<ll, ll> a, pair<ll, ll> b){return a.second < b.second;});

    bool possible = true;
    ll time = 0;
    for (int i = 0; i < n; i++) {
        time += ab[i].first;
        if (time > ab[i].second) {
            possible = false;
            break;
        }
    }

    cout << (possible ? "Yes" : "No") << endl;
}

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

int main()
{
    long long int w,h,x,y;
    cin >> w >> h >> x >> y;
    double maxArea = w*h/2.0;
    char isCenter = w==x+x && h==y+y ? '1' : '0';
    cout << fixed << setprecision(10) << maxArea << " " << isCenter << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long

const int N = 2e5 + 5;

int n, ans = -1e18, have;
int a[N], cache[N][4];
int pref[N], suf[N], cp[N], cs[N];
bool vis[N][4];

int dp(int idx, int have)
{
	if(idx > n)
	{
		if(have <= 1)
			return 0;
		return -1e18;
	}
	int &ans = cache[idx][have];
	if(vis[idx][have])
		return ans;
	vis[idx][have] = 1;
	if(!have)
		ans = a[idx] + dp(idx + 2, have);
	else
		ans = max(a[idx] + dp(idx + 2, have), dp(idx + 1, have - 1));
	return ans;
}

int32_t main()
{
	IOS;
	cin >> n;
	for(int i = 1; i <= n; i++)
		cin >> a[i];
	int ans;
	if(n % 2)
		ans = max(dp(1, 2), dp(2, 1));
	else
		ans = max(dp(1, 1), dp(2, 0));
	cout << ans;
	return 0;
}

Measured memory_bytes: 16952
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(i64 (i) = (s);(i) < (e);(i)++)
#define all(x) x.begin(),x.end()
#define STRINGIFY(n) #n
#define TOSTRING(n) STRINGIFY(n)
#define PREFIX "#" TOSTRING(__LINE__) "| "
#define debug(x) \
{ \
  std::cout << PREFIX << #x << " = " << x << std::endl; \
}

std::ostream& output_indent(std::ostream& os, int ind) {
  for(int i = 0; i < ind; i++) os << " ";
  return os;
}

template<class S, class T> std::ostream& operator<<(std::ostream& os, const std::pair<S, T>& p);
template<class T> std::ostream& operator<<(std::ostream& os, const std::vector<T>& v);

template<class S, class T> std::ostream& operator<<(std::ostream& os, const std::pair<S, T>& p) {
  return (os << "(" << p.first << ", " << p.second << ")");
}
template<class T> std::ostream& operator<<(std::ostream& os, const std::vector<T>& v) {
  os << "[";
  for(int i = 0;i < v.size();i++) os << v[i] << ", ";
  return (os << "]");
}

template<class T>
static inline std::vector<T> ndvec(size_t&& n, T val) { return std::vector<T>(n, std::forward<T>(val)); }
template<class... Tail>
static inline auto ndvec(size_t&& n, Tail&&... tail) {
  return std::vector<decltype(ndvec(std::forward<Tail>(tail)...))>(n, ndvec(std::forward<Tail>(tail)...));
}
template<class Cond> struct chain {
  Cond cond; chain(Cond cond) : cond(cond) {}
  template<class T> bool operator()(T& a, const T& b) const { if(cond(a, b)) { a = b; return true; } return false; }
};
template<class Cond> chain<Cond> make_chain(Cond cond) { return chain<Cond>(cond); }

int main() {
  i64 N;
  cin >> N;
  i64 ans = 0;
  rep(i,1,N + 1) {
    i64 a;
    cin >> a;
    if(i % 2 == 1 && a % 2 == 1) {
      ans++;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 3672
N,A,B = map(int,input().split())

if N < 1 or B - A < 0:
  print(0)
  exit(0)
  
if N == 1 and A < B:
  print(0)
  exit(0)
  
  
if A == B or N <= 2:
  print(1)
  exit(0)
  
c = N-2
r = B-A+1

ans = c*(r-1) + 1
print(ans)



Measured memory_bytes: 9124
package main

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

// 1回目に(1,2,3...)が出て勝つ確率をたす

func main() {
	sc := NewScanner(os.Stdin)
	N := sc.NextInt()
	K := sc.NextInt()
	ans := 0.0
	for i := 1; i <= N; i++ {
		p := 1.0
		n := i
		for ; n < K; n, p = n*2, p/2.0 {
		}
		ans += p / float64(N)
	}
	fmt.Println(ans)
}

func vmin(v []int) int {
	mn := math.MaxInt32
	for i := 0; i < len(v); i++ {
		mn = min(mn, v[i])
	}
	return mn
}

func gcd(x, y int) int {
	if y > 0 {
		return gcd(y, x%y)
	}
	return x
}

func lcm(x, y int) int {
	return x / gcd(x, y) * y
}

func max64(x, y float64) float64 {
	if x > y {
		return x
	}
	return y
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

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

func min64(x, y float64) float64 {
	if x < y {
		return x
	}
	return y
}

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

func NewScanner(r io.Reader) *Scanner {
	rdr := bufio.NewReaderSize(r, 1024)
	return &Scanner{r: rdr}
}

func (s *Scanner) ReadLine() {
	s.buf = make([]byte, 0)
	for {
		line, isp, err := s.r.ReadLine()
		if err != nil {
			os.Exit(1)
		}
		s.buf = append(s.buf, line...)
		if !isp {
			break
		}
	}
}

func (s *Scanner) NextInt64() int64 {
	i, err := strconv.ParseInt(s.Next(), 10, 64)
	if err != nil {
		os.Exit(1)
	}
	return i
}

func (s *Scanner) NextInt() int {
	i, err := strconv.Atoi(s.Next())
	if err != nil {
		os.Exit(1)
	}
	return i
}

func (s *Scanner) NextFloat64() float64 {
	i, err := strconv.ParseFloat(s.Next(), 64)
	if err != nil {
		os.Exit(1)
	}
	return i
}

func (s *Scanner) Next() string {
	s.Pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	next := string(s.buf[start:s.p])
	s.p++
	return next
}

func (s *Scanner) Pre() {
	if s.p >= len(s.buf) {
		s.ReadLine()
		s.p = 0
	}
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vvvi = vector<vector<vector<int>>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vvvl = vector<vector<vector<ll>>>;
using vs = vector<string>;
using vb = vector<bool>;
#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 REP(i, n) FOR(i, 0, (n))
#define REPR(i, n) FORR(i, (n) - 1, 0)
#define REP1(i, n) FOR(i, 1, (n) + 1)
#define REPS(c, s) for (char c : s)
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define REV(c) reverse(ALL(c))
#define sz(v) (int)v.size()
#define endl '\n'
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
template<class T> inline void prn(vector<T>& v) {int n = sz(v); REP(i, n) cout << v[i] << ' ';}
template<class T> inline void printv(vector<T>& v) {int n = sz(v); REP(i, n) cout << v[i] << (i == n - 1 ? endl : ' ');}
template<class T> inline void printvv(vector<vector<T>>& v) {for (auto u : v) printv(u);}
template<class T> inline void printlnv(vector<T>& v) {int n = sz(v); REP(i, n) cout << v[i] << endl;}
const int MOD = 1000000007;
const int INF = 1000000001;
const ll LINF = 1000000001000000001LL;
 
void solve();
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(numeric_limits<double>::max_digits10);
    solve();
    return 0;
}

void solve() {
    string s;
    cin >> s;
    int ans = 0;
    int t = 0;
    REPS(c, s) {
        if (c == 'R') t++;
        else {
            chmax(ans, t);
            t = 0;
        }
    }
    chmax(ans, t);
    cout << ans << endl;
}

Measured memory_bytes: 3636
#include <iostream>
#include <vector>
#include <cstdio>
#include <map>
#include <algorithm>
#include <queue>
using namespace std;
int N,Q;
int V[200002];
int ra[200002];
vector<int> G[200002];
int main(){	
	for(int i=0;i<200002;i++)ra[i]=-1;
	cin >> N >> Q;
	for(int i=1;i<N;i++){
		int a,b;
		cin >> a >> b;
		G[a].push_back(b);
		G[b].push_back(a);	}
	for(int i=1;i<=Q;i++){
		int p,x;
		cin >> p >> x;
		V[p]+=x;
	}

	queue<int> q,qq;
	ra[1]=0;
	q.push(1);
	while(!q.empty()){
		int x=q.front();
		q.pop();
		for(int i=0;i<G[x].size();i++){
			int u = G[x][i];
			
			if(ra[u]==-1)ra[u]=ra[x]+1;
			if(ra[u]!=-1 && ra[x] < ra[u])q.push(u);
		}
	}


	qq.push(1);
	while(!qq.empty()){
		int x=qq.front();
		qq.pop();
		for(int i=0;i<G[x].size();i++){
			int u = G[x][i];
				if(ra[x]<ra[u]){
				V[u]+=V[x];
				qq.push(u);
			}
		}
	}
	for(int i=1;i<=N;i++)cout << V[i] << endl;
	return 0;
}

Measured memory_bytes: 16372
/*
https://t.me/unstoppabIesoIvemachinechannel
*/
#pragma ARCENIY_KIRILLOV_POVELITEL_KROKODILOV
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("no-stack-protector")
//#pragma GCC push_options
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC pop_options
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define rng(a) a.begin(),a.end()
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define rep(i, n) for (int i = 0; i < n; i++)
#define per(i, n) for (int i = n - 1; i > -1; i--)
#define rer(i, x, n) for (int i = x; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef long double ld;















int a[3];
double dp[303][303][303];
double n;
double ans(int x, int y, int z){
    if (x < 0 || y < 0 || z < 0) return 0;
    if(dp[x][y][z]) return dp[x][y][z];
    return dp[x][y][z] = (ans(x - 1, y, z) * x + ans(x + 1, y - 1, z) * y + ans(x, y + 1, z - 1) * z + n) / (x + y + z);
}
main(){
    cin >> n;
    cout << fixed << setprecision(10);
    for (int i = 0;i < n; i++){
        int b;
        cin >> b;
        a[b - 1]++;
    }
    dp[0][0][0] = 0.00000000000001;
    cout << ans(a[0], a[1], a[2]);
    //for (int i = 0; i <= a[0]; i++){
     //   for (int j = 0; j <= a[1]; j++){
    //        for (int k = 0; k <= a[2]; k++){
       //     }
     //   }
  //  }
}


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

using namespace std;
// ascending order
#define vsort(v) sort(v.begin(), v.end())
// descending order
#define vsort_r(v) sort(v.begin(), v.end(), greater<int>())
#define vunique(v) v.erase(unique(v.begin(), v.end()), v.end())
#define mp make_pair
#define ts(x) to_string(x)
#define rep(i, a, b) for(int i = (int)a; i < (int)b; i++)
#define repm(i, a, b) for(int i = (int)a; i > (int)b; i--)
#define bit(a) bitset<8>(a)
#define des_priority_queue priority_queue<int, vector<int>, greater<int> >
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 (a > b) { a = b; return 1; } return 0; }
typedef long long ll;
typedef pair<int, int> P;
const ll INF = 1e18;

#define MAX_V 1000000
#define MAX_N 16
int n, k;
ll a[MAX_N], copy_a[MAX_N];

void input() {
  cin >> n >> k;
  rep(i, 0, n) cin >> a[i];
  memcpy(copy_a, a, sizeof(a));
}

bool validate(ll a[]) {
  int cnt = 1;
  ll max_v = a[0];
  rep(i, 1, n) {
    if(a[i] > max_v) {
      max_v = a[i];
      ++cnt;
    }
  }
  return cnt >= k;
}

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

  input();

  ll rsl = 1e18;
  for(int bit = 0; bit < (1 << n); ++bit) {
    ll tmp = 0, max_v = copy_a[0];
    memcpy(copy_a, a, sizeof(a));
    for(int mask = 0; mask < n; ++mask) {
      if(bit & (1 << mask)) {
        if(mask == 0) continue;
        tmp += max(0ll, max_v - copy_a[mask] + 1);
        copy_a[mask] = max(max_v + 1, copy_a[mask]);
      }
      max_v = max(max_v, copy_a[mask]);
    }
    if(validate(copy_a)) {
      chmin(rsl, tmp);
    }
  }
  cout << rsl << endl;
}



Measured memory_bytes: 256
from collections import defaultdict

n, k = map(int, input().split())
P = list(map(int, input().split()))
C = list(map(int, input().split()))

P = [p - 1 for p in P]

# Pの要素の中で循環するモノ同士をまとめる
sep = []
visited = [0] * n
for i in range(n):
  s = i
  box = []
  while visited[s] == 0:
    box.append(s)
    visited[s] = 1
    s = P[s]
  if box != []:
    sep.append(box)

ans = - 10 ** 19
for sp in sep:
  SB = defaultdict(int)
  sumC = sum([C[i] for i in sp]) 
  sn = len(sp)

  if sumC > 0:
    d, mk = divmod(k, sn)
    if d > 0:
      pscore = (d - 1) * sumC
      mk += sn 
    else:
      pscore = 0
  else:
    mk = min(k, sn * 2)
    pscore = 0

  for p in sp: 
    cnt = 0
    score = 0
    mv = - 10 ** 19
    s = p
    while cnt < mk:
      score += C[s]
      s = P[s]
      cnt += 1
      mv = max(mv, score)
    
    SB[p] = mv

  ans = max(ans, max(SB.values()) + pscore)
  
print(ans)

Measured memory_bytes: 69816
#include <cstdint>
#include <iostream>

using namespace std;

int64_t pow3(int64_t x) { return x * x * x; }

int main() {
  int n, k;
  cin >> n >> k;
  int cnt = 0;
  int cnt2 = 0;
  bool is_even = k % 2 == 0;
  for (int i = 1; i <= n; i++) {
    if (i % k == 0)
      ++cnt;
    if (is_even && i % k == k / 2)
      ++cnt2;
  }
  const int64_t ans = pow3(cnt) + pow3(cnt2);
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#define rep(i,n) for(ll i = 0; i < n; i++)
typedef long long ll;
using namespace std;
#define llMAX numeric_limits<long long>::max()
#define intMAX numeric_limits<int>::max()
#define d_5 100000
#define d9_7 1000000007
#define vll vector<vector<long long>>
#define vl vector<long long>
#define vi vector<int>
#define vii vector<vector<int>>
#define pb push_back
#define pf push_front
#define ld long double
#define ll long long

int main(void){
  int m1,m2,d1,d2;
  cin>>m1>>d1>>m2>>d2;
  if(m1!=m2){
    cout<<1;
  }else{
    cout<<0;
  }
  //cout<<":("<<endl;
  return 0;
}

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

using namespace std;

typedef vector<int> vi;

void dfs(vi e[], int x, int p[], int h[]) {
    for (int y : e[x]) {
        if (h[y] == -1) {
            h[y] = h[x] + 1;
            p[y] = x;
            dfs(e, y, p, h);
        }
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    int n, u, v;
    cin >> n >> u >> v;
    u--, v--;
    vi e[n];
    for (int i = 0; i < n - 1; i++) {
        int a, b;
        cin >> a >> b;
        a--, b--;
        e[a].push_back(b);
        e[b].push_back(a);
    }

    int p[n], h[n];
    for (int i = 0; i < n; i++) {
        h[i] = -1;
    }
    p[v] = -1;
    h[v] = 0;
    dfs(e, v, p, h);

    int ans = 0;
    int dis = h[u];
    while (dis > 2) {
        u = p[u];
        dis -= 2;
        ans++;
    }

    int pu = p[u];
    for (int i = 0; i < n; i++) {
        h[i] = -1;
    }
    h[u] = 0;
    h[pu] = n + 1;
    dfs(e, u, p, h);

    h[pu] = -1;
    int hmax = 0;
    for (int i = 0; i < n; i++) {
        hmax = max(hmax, h[i]);
    }

    ans += hmax;
    if (dis == 2) {
        ans++;
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 12928
'use strict';
const main = input => {
  const d = parseInt(input[0], 10);
  switch (d) {
    case 25:
      console.log('Christmas');
      break;
    case 24:
      console.log('Christmas Eve');
      break;
    case 23:
      console.log('Christmas Eve Eve');
      break;
    case 22:
      console.log('Christmas Eve Eve Eve');
      break;
  
    default:
      break;
  }
}
main(require("fs").readFileSync("/dev/stdin", "utf8").split('\n'));

Measured memory_bytes: 7372
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] w = new int[n];
		for(int i = 0 ; i < n ; i++) {
			w[i] = sc.nextInt();
		}
		int ans = Integer.MAX_VALUE;
		for(int i = 1 ; i < n ; i++) {
			int s1 = 0;
			int s2 = 0;
			for(int j = 0 ; j < i ; j++) {
				s1 += w[j];
			}
			for(int j = i ; j < n ; j++) {
				s2 += w[j];
			}
			ans = Math.min(ans, Math.abs(s2 - s1));
		}
		System.out.println(ans);
		sc.close();

	}

}


Measured memory_bytes: 23124
#include <iostream>
#include <cmath>
#include <cstring>
#include <algorithm>
using namespace std;
int main() {
	int a, b, c, d, e, f;
	double maxd = 0, maxa = 0, maxs = 0;
	cin >> a >> b >> c >> d >> e >> f;
	for(int i = 0; i <= f / (a * 100); i++)
		for(int j = 0; (j * b + i * a) * 100 <= f; j++)
			for(int k = 0; k * c + (i * a + j * b) * 100 <= f; k++)
				for(int l = 0; l * d + k * c + (i * a + j * b) * 100 <= f; l++) {
					if(i == 0 && j == 0 && k == 0 && l == 0)
						continue;
					if((k * c + l * d) > (i * a + j * b) * e)
						continue;
					if((double)(k * c + l * d) / (double)((i * a + j * b) *100 + k * c + l * d) > maxd)
						maxd = (double)(k * c + l * d) / (double)((i * a + j * b) *100 + k * c + l * d), maxa = (i * a + j * b) *100 + k * c + l * d, maxs = k * c + l * d;
				}
	if(maxa == 0)
		maxa = a * 100;
	cout << maxa << " " << maxs << endl;
	return 0;
}


Measured memory_bytes: 256
n,a,b,c = map(int,input().split())
mod = 10**9 + 7

## nCkのmodを求める関数
# テーブルを作る(前処理)
max = 2 * 10**5 + 100
fac, finv, inv = [0]*max, [0]*max, [0]*max

def comInit(max):
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1

    for i in range(2,max):
      fac[i] = fac[i-1]* i% mod
      inv[i] = mod - inv[mod%i] * (mod // i) % mod
      finv[i] = finv[i-1] * inv[i] % mod

comInit(max)

# 二項係数の計算
def com(n,k):
    if(n < k):
        return 0
    if( (n<0) | (k < 0)):
        return 0
    return fac[n] * (finv[k] * finv[n-k] % mod) % mod

ex_game = (pow(100-c,mod-2,mod) * 100)%mod
win_a = (pow((a+b),mod-2,mod) * a)%mod
win_b = (pow((a+b),mod-2,mod) * b)%mod

exp_a = [1] * (n+1)
exp_b = [1] * (n+1)

for i in range(1,n+1):
    exp_a[i] = (exp_a[i-1] * win_a)%mod
    exp_b[i] = (exp_b[i-1] * win_b)%mod

ans = 0
for i in range(n):
    #高橋くんwin E(n,i)
    ans += com(i+n-1,i) * exp_a[n] * exp_b[i] * ex_game*(n+i)
    #青木くんwin E(i,n)
    ans += com(i+n-1,i) * exp_b[n] * exp_a[i] * ex_game*(n+i)
    ans %= mod

print(ans)

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

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

    ll c, k;
    cin >> c >> k;

    ll t[n];
    for(int i = 0; i < n; i++){
        cin >> t[i];
    }

    sort(t, t + n);

    ll ans = 1;
    ll now_jyou = 1;
    ll limit = t[0] + k;

    for(int i = 1; i < n; i++){
        if(t[i] > limit || now_jyou == c){
            limit = t[i] + k;
            now_jyou = 1;
            ans++;
        }else{
            now_jyou++;
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  int ans=n*100/108;
  if((double)ans<(double)n*100/108)ans++;
  if((int)ans*108/100==n)cout << ans << endl;
  else cout << ":(" << endl;
}

Measured memory_bytes: 3560
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1LL << 30;
int MOD = 1e9+7;
main(){
    string S;
    cin >> S;
    for(int i = 0;i < (1 << 3);i++){
        int sum = S[0] - '0';
        bool flag = 1;
        for(int j = 0;j < 3;j++){
            if(i&(1<<j))sum += S[j+1] - '0';
            else sum -= S[j+1] - '0';
        }
        if(sum != 7)continue;
        for(int j = 0;j < 7;j++){
            if(j&1)cout << ((i & (1 << j/2)) ? '+' : '-');
            else cout << S[j/2];
        }
        cout << "=7" << endl;
        break;
    }
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    int n, l, r;
    int i, sum = 0;
    cin>>n;
    for(i = 1; i <= n; i++)
    {
        cin>>l;
        cin>>r;
        sum += r - l + 1;
    }
    cout<<sum<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <vector>
#include <string>
#include <string.h>
#include <iomanip>
#include <limits>
using namespace std;

const int MAX_N=10000;
int n,k,a[50];

int main(){
	cin >> n >> k;
	for(int i=0;i<n;i++) cin >> a[i];
	int s=0;
	sort(a,a+n);
	reverse(a,a+n);
	for(int i=0;i<k;i++) s+=a[i];
	
	cout << s << endl;
	return 0;
}


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

int main() {
  int A,B;
  cin >> A >> B;

  if (A+B > A-B && A+B > A*B) {
    cout << A+B << endl;
  }
  else if (A-B > A*B) {
    cout << A-B << endl;
  }
  else {
  cout << A*B << endl;
  } 
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rep2(i,s,n) for (int i = s; i < n; ++i)
#define all(a) a.begin(),a.end()
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
    int n,m;
    cin >> n >> m;
    vector<int> v(n,0);
    rep(i,m) {
        int a,b;
        cin >> a >> b;
        a--; b--;
        v[a]++;
        v[b]++;
    }
    rep(i,n) cout << v[i] << endl;
}

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

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

  vector<int> L(N*2);
  for(int i = 0; i < N*2; i++){
    cin >> L.at(i);
  }
  
  sort(L.begin(), L.end());
  
  int ans;
  ans = 0;
  for(int i = 0; i < N*2; i=i+2){
    ans = ans + L.at(i);
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define SZ(x) ((int)x.size())
#define L(i,u) for (register int i=head[u]; i; i=nxt[i])
#define rep(i,a,b) for (register int i=(a); i<=(b); i++)
#define per(i,a,b) for (register int i=(a); i>=(b); i--)
using namespace std;
typedef long long ll;
typedef unsigned int ui;
typedef pair<int,int> Pii;
typedef vector<int> Vi;
template<class T> inline void read(T &x){
	x=0; char c=getchar(); int f=1;
	while (!isdigit(c)) {if (c=='-') f=-1; c=getchar();}
	while (isdigit(c)) {x=x*10+c-'0'; c=getchar();} x*=f;
}
template<class T> inline void umin(T &x, T y){x=x<y?x:y;}
template<class T> inline void umax(T &x, T y){x=x>y?x:y;}
inline ui R() {
	static ui seed=416;
	return seed^=seed>>5,seed^=seed<<17,seed^=seed>>13;
}

int main() {
	int n;read(n);int res=0;
	if(n>=3){
		if(n&1)res=n/2;
		else res=n/2-1;
	}
	cout<<res;
	return 0;
}


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

using namespace std;
typedef long long int L;
L f1(L n, L W, L* w, L* v){
    
    L** f = new L*[n+1];
    for(L i = 0; i<=n; i++){
        f[i] = new L[W+1];
    }
    //f[i][j] denotes the answer for array starting from ith index and W = j;
    
    for(L j = 1; j<=W; j++){
        if(w[n] <= j){
            f[n][j] = v[n];
        }else f[n][j] = 0;
    }
    
    for(L i = 0; i<=n; i++){
        f[i][0] = 0;
    }
    
    for(L i = n-1; i>=1; i--){
        for(L j = 1; j<=W; j++){
            
            L x, y; x = y = -1;
            
            if(w[i] <= j){
                x = v[i] + f[i+1][j - w[i]];
            }
            
            y = f[i+1][j];
            
            f[i][j] = max(x, y);
        }
    }
    return f[1][W];
}
int main(){
    L n, W;
    cin >> n >> W;
    L w[100002], v[100002];
    for(L i = 1; i<=n; i++){
        cin >> w[i] >> v[i];
    }
    
    cout << f1(n, W, w, v) << "\n";
}

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

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

  map<int,int> m;
  rep(i,n){
     int p;
     cin >> p;
     int pp= p - x;
     m[pp]=1;

  }
if(m[0]!=1){
    cout << x << endl;
    return 0;
}
int check =-1;
  while(true){
      
      if(m[check]!=1){
          cout << x + check << endl;
          return 0;
      }
      if(check<0){
          check= check*(-1);
      }
      else{
          check = check*(-1) - 1;
      }
  }


}

Measured memory_bytes: 3624
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
class Program
{
    static void Main(string[] args)
    {
            // 入力
            string[] sS = System.Console.ReadLine().Trim().Split(' ');
            decimal iN = decimal.Parse(sS[0]);
            decimal iK = decimal.Parse(sS[1]);

            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            sw.Start();

            // 解析
            decimal iM =Math.Truncate(iN / iK);
            decimal iX = iN - iM * iK;
            List<decimal> lstRet = new List<decimal>();
            lstRet.Add(iX);
            for (int i = 0; i < 4; i++)
            {
                iX = Math.Abs(iX - iK);
                lstRet.Add(Math.Abs(iX));
            }
            lstRet.Sort();

            // 出力
            System.Console.WriteLine("{0}", lstRet[0].ToString().Trim());

            sw.Stop();
#if DEBUG
            Console.WriteLine();
            Console.WriteLine("{0}", sw.Elapsed.ToString());
            Console.WriteLine("続行するには何かキーを押してください．．．");
            Console.ReadKey();
#endif
    }

}


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

using namespace std;
long long ans;
long long n;
long long num = 2;
long long solver(long long arg1) {
    long long retnum = num * arg1 / __gcd(num , arg1);
    return retnum;
}
int main(int argc, char* argv[]) {
    scanf("%d", &n);
    ans = solver(n);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep2(i,m,n) for (int i = (int)(m); i < (int)(n); i++)
#define rep(i,n) rep2(i,0,n)
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
using namespace std;
using ll = long long;
template <typename T>
T sq(T x){
  return x * x;
}

signed main (){
  int N;
  cin >> N;
  vector<int> T(N);
  rep(i,N){
    cin >> T.at(i);
  }
  int M;
  cin >> M;
  vector<int> P(M);
  vector<int> X(M);
  rep(i,M){
    cin >> P.at(i) >> X.at(i);
  }
  rep(j,M){
  ll tot_time = 0;
    rep(i,N){
      if(P.at(j) - 1 == i){
        tot_time += X.at(j);
      }else{
        tot_time += T.at(i);
      }
    }
 cout << tot_time <<endl;
  }
  return 0;


}


Measured memory_bytes: 256
#include <bits/stdc++.h>
const int mod=1e9+7;
using LL=long long;
using std::cout;using std::endl;using std::cin;
using std::vector;using std::string;using std::set;using std::multiset;
using std::pair;using std::map;
using std::min;using std::max;
using std::make_pair;using std::swap;
std::ostream& operator<<(std::ostream& os,std::map<int,int>& obj){for(std::map<int,int>::iterator itr=obj.begin();itr!=obj.end();itr++){os<<itr->first<<"^"<<itr->second<<" ";}return os;}
std::ostream& operator<<(std::ostream& os,std::vector<std::map<int,int>>& obj){for(auto itr=obj.begin();itr!=obj.end();itr++){os<<*itr<<std::endl;}return os;}
std::ostream& operator<<(std::ostream& os,std::vector<int>& obj){for(auto itr=obj.begin();itr!=obj.end();itr++){os<<*itr<<" ";}return os;}
std::ostream& operator<<(std::ostream& os,std::vector<std::vector<int>>& obj){for(auto itr=obj.begin();itr!=obj.end();itr++){os<<*itr<<std::endl;}return os;}

namespace ndifix{
template<class T> void sort(T &v){std::sort(v.begin(),v.end());}
template<class T> void rsort(T &v){std::sort(v.rbegin(),v.rend());}

}


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

  int ans=0;
  for(int i=0;i<n-2;i++){if(min({p[i],p[i+1],p[i+2]})!=p[i+1] && max({p[i],p[i+1],p[i+2]})!=p[i+1])ans++;}
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 764
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<climits>
#include<numeric>
#include<cmath>
#include<cstring>
#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 VSORT(v) sort(v.begin(), v.end());
#define VE vector<int>
#define VEP vector<pair<int,int>>
#define llong long long
#define pb(a) push_back(a)
using namespace std;
int dp[1000+1][1000+1];
int lim;
//int cost_vec[/*num*/];
//int val_vec[/*num*/];
int main() {
	int num;
	cin >> num;
	vector<string> vec(2*num);
	REP(i, num) {
		cin >> vec[2 * i];
		cin >> vec[2 * i + 1];
	}
	REP(i, num) {
		memset(dp, 0, sizeof(dp));
		REP(k, vec[i * 2].size()) {
			REP(n, vec[i * 2+1].size()) {
				if (vec[i * 2][k] == vec[i * 2 + 1][n]) {
					dp[k + 1][n + 1] = dp[k][n] + 1;
				}
				else {
					dp[k + 1][n + 1] = max(dp[k][n + 1], dp[k + 1][n]);
				}
			}
		}
		cout << dp[vec[i * 2].size()][vec[i * 2+1].size()] << endl;
	}
	return 0;
}


Measured memory_bytes: 7116
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define watch(x) cout << (#x) << " is " << (x) << endl

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;

const int MOD = 1e9 + 7;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s; cin >> s;
    if(s[0] != 'A')
    {
        cout << "WA";
        return 0;
    }
    else
    {
        int cnt = 0;
        int idxC;
        for(int i = 2; i < s.size() - 1; i++)
        {
            if(s[i] == 'C')
            {
                cnt++;
                idxC = i;
            }
            if(cnt == 2)
            {
                cout << "WA";
                return 0;
            }
        }
        if(!cnt)
        {
            cout << "WA";
            return 0;
        }
        else
        {
            for(int i = 1; i < s.size(); i++)
            {
                if(i == idxC) continue;
                if(isupper(s[i]))
                {
                    cout << "WA";
                    return 0;
                }
            }
        }
    }
    cout << "AC";

    return 0;
}


Measured memory_bytes: 256
D=int(input())
c=list(map(int,input().split()))
s=[list(map(int,input().split())) for _ in range(D)]
ld=[0]*26
ans=0
for d in range(D):
    sa=-10**10
    for i in range(26):
        ta=s[d][i]
        td=ld[:]
        td[i]=d+1
        for j in range(26):
            ta-=(d+1-ld[j])*c[j]
        if sa<=ta:
            sa=ta
            idx=i+1
            ld=td[:]
    print(idx)

Measured memory_bytes: 9236
#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
typedef  unsigned long long int ull;
using P=pair<ll,ll>;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
//const ll mod=998244353;
const ll mod=1000000007;
ll GCD(ll a,ll b) {return b ? GCD(b,a%b):a;}
ll LCM(ll c,ll d){return c/GCD(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
int main(){
  ll n;double m;
  cin>>n>>m;
  ll d=round(m*100);
  n*=d;
  cout<<n/100<<"\n";
}

Measured memory_bytes: 3696
n = int(input().rstrip())
data = input().rstrip()
data = [int(v) for v in data.split(' ')]

counter = 0

while True:
    flag = False
    for i, v in enumerate(data):
        if v % 2 == 0:
            data[i] = v / 2
        else:
            flag = True
            break

    if flag:
        break
    else:
        counter += 1

print(counter)


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

using namespace std;

//FILE *fi=freopen("1.txt","r",stdin);

int n,a[100001],t;
vector<pair<int,int> > kq;
priority_queue<int> duong;
priority_queue<int,vector<int>,greater<int> > am;

void nhap()
{
    scanf("%d",&n);
    for (int i=1;i<=n;++i)
    {
        scanf("%d",&a[i]);
    }
    sort(a+1,a+1+n);
}

void process()
{
    int vt=1;
    if (a[1]>=0)
    {
        vt++;
        kq.push_back({a[1],a[n]});
        am.push(a[1]-a[n]);
        for (int i=2;i<n;++i)
            duong.push(a[i]);
        t=a[n]-a[1];
    }
    else if (a[n]<0)
        {
            vt++;
            kq.push_back({a[n],a[1]});
            duong.push(a[n]-a[1]);
            for (int i=2;i<n;++i)
                am.push(a[i]);
            t=a[n]-a[1];
        }
        else
        {
            for (int i=1;i<=n;++i)
            {
                if (a[i]<0) am.push(a[i]);
                else duong.push(a[i]);
            }
        }
    for (;vt<n;++vt)
    {
        if (am.size()>=duong.size())
        {
            kq.push_back({duong.top(),am.top()});
            int k=duong.top()-am.top();
            duong.pop();
            am.pop();
            t=k;
            if (k<0) am.push(k);
            else duong.push(k);
        }
        else
        {
            kq.push_back({am.top(),duong.top()});
            int k=am.top()-duong.top();
            duong.pop();
            am.pop();
            t=k;
            if (k<0) am.push(k);
            else duong.push(k);
        }
    }
    cout<<t<<"\n";
    for (auto i:kq)
        cout<<i.first<<" "<<i.second<<"\n";
}

int main()
{
    nhap();
    process();
    return 0;
}


Measured memory_bytes: 3828
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
	private static final int MOD = (int)Math.pow(10, 9);
	public static void main(String[] args) {
		FastReader sc = new FastReader();
		int n = sc.nextInt();
		// count[0] is number of 0
		int[] count = new int[2];
		
		for (int i = 0; i < n; i++) {
			count[sc.nextInt() % 2]++;
		}
		
		while (count[0] > 1 || count[1] > 1) {
			if (count[0] >= 2) {
				count[0]--; // 兩個偶變成一個偶，所以全體偶數少一
			}
			if (count[1] >= 2) {
				count[1] -= 2; // 兩個奇數合成一個偶，所以全體奇數少二 
				count[0]++;    // 但是偶數會加一個
			}
		}
		
		if ((count[0] == 0 && count[1] == 1) || (count[0] == 1 && count[1] == 0)) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
	
	private static int findDigit(int num) {
		int res = 0;
		while (num > 0) {
			res += (num % 10);
			num /= 10;
		}
		return res;
	}
	
	static class FastReader {
	    BufferedReader br;
	    StringTokenizer st;
	
	    public FastReader() {
	      br = new BufferedReader(new InputStreamReader(System.in));
	    }
	  
	    String next() { 
	      while (st == null || !st.hasMoreElements()) {
	        try {
	          st = new StringTokenizer(br.readLine());
	        } catch (IOException  e) {
	          e.printStackTrace();
	        }
	      }
	      return st.nextToken();
	    }
	
	    int nextInt() {
	      return Integer.parseInt(next());
	    }
	
	    long nextLong() {
	      return Long.parseLong(next());
	    }
	
	    double nextDouble() { 
	      return Double.parseDouble(next());
	    }
	
	    String nextLine() {
	      String str = "";
	        try{
	            str = br.readLine();
	        } catch (IOException e) {
	            e.printStackTrace();
	        }
	        return str;
	      }
	  }
}


Measured memory_bytes: 36532
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <iomanip>
using namespace std;
typedef long long unsigned int ll;
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define MOD 1000000007

#define REP(i,n) for(int i=0;i<n;i++)
#define REPS(i,f,n) for(int i=(f);i<(n);i++)
#define EACH(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)

#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int dy4[]={0, 0, 1, -1};
int dx4[]={1, -1, 0, 0};
int dx8[]={0, 0, 1, -1, 1, 1, -1, -1};
int dy8[]={1, -1, 0, 0, 1, -1, -1, 1};

// https://beta.atcoder.jp/contests/abc103/tasks/abc103_d

int main() {
    int N, M; cin >> N >> M;
    vector<P> ab(M);
    int a, b;
    REP(i, M) {
        cin >> a >> b;
        ab[i] = {b, a};
    }

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

    int now = 0;
    int ans = 0;
    REP(i, M) {
        if (ab[i].second >= now) {
            ans++;
            now = ab[i].first;
        }
    }

    cout << ans << "\n";

    return 0;
}


Measured memory_bytes: 1024
#include<iostream>
#include<vector>

#define REP(i,j,k) for( int i = j; i < k; i++ )
#define rep(i,j) REP(i,0,j)

using namespace std;

typedef vector<int> VI;
typedef vector< VI > VVI;

int main(){
	
	int N,M,C;
	
	VI B(20);
	VVI A( 20, VI(20) );
	
	cin >> N >> M >> C;
	
	rep(j,M) cin >> B[j];
	rep(i,N) rep(j,M) cin >> A[i][j];
	
	int cnt = 0;
	
	rep(i,N){
		
		int tmp = C;
		rep(j,M) tmp += A[i][j] * B[j];
		if(tmp>0) cnt++;
		
	}
	
	cout << cnt << endl;
	
	return 0;
	
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    int n, x, y, z ;
    cin >> n ;
    x=n*800;
    if (n>=1 && n<=100)
    {
        if (n>=15)
        {
            z=n/15 ;
            y=(z*200);
            cout << x-y ;
        }
        else
            cout << x ;
    }

    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define BUF_SIZE 102


int comp1(const void* a, const void* b) {
  return *(char*)a - *(char*)b;
}
int comp2(const void* a, const void* b) {
  return *(char*)b - *(char*)a;
}


int main(void) {
  char line1[BUF_SIZE];
  char line2[BUF_SIZE];
  FILE *fp;
  fp = stdin;
  if(!fgets(line1, BUF_SIZE, fp)) return 0;
  if(!fgets(line2, BUF_SIZE, fp)) return 0;
  int len1, len2;
  len1 = strlen(line1); line1[len1-1] = '\0';
  len2 = strlen(line2); line2[len2-1] = '\0';
  qsort(line1, len1-1, sizeof(char), comp1);
  qsort(line2, len2-1, sizeof(char), comp2);
  int flag = 0;
  if(strcmp(line1, line2) < 0) {
    flag = 1;
  }
  printf("%s\n", flag ? "Yes" : "No");
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define N 100
using namespace std;
int main(void){
    int n = 0;
    char s[N] = {0};
    bool F = true;
    cin >> n;
    for(int i=0;i<n;i++)cin >> s[i];
    for(int i=0;i<n;i++){
        if(s[i] == 'Y'){
            F = false;
            break;
        }
    }
    if(F){
        cout << "Three" << endl; 
    }else{
        cout << "Four" << endl;
    }
}


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

int main() {
  int n,m,ans=0;
  string t;
  cin >> n >> m;
  vector<int> a(n);
  vector<string> s(0);
  vector<vector<string>> u(n,vector<string>(0));
  for (int i=0;i<n;i++){
    cin >> a.at(i);
    for (int j=0;j<a.at(i);j++){
      int y=0;
      cin >> t;
      u.at(i).push_back(t);
      for (int k=0;k<s.size();k++){
        if (s.at(k)==t) {y=1;break;}
      }
      if (y==0) s.push_back(t);
    }
    sort(u.at(i).begin(),u.at(i).end());
  }
  sort(s.begin(),s.end());
  vector<vector<pair<pair<string,string>,int>>> h(s.size(),vector<pair<pair<string,string>,int>>(s.size()));
  for (int i=0;i<s.size()-1;i++){
    for (int j=i+1;j<s.size();j++){
      pair<pair<string,string>,int> v;
      v.first.first=s.at(i);v.first.second=s.at(j);v.second=0;
      h.at(i).at(j)=v;
    }
  }
  for (int i=0;i<n;i++){
    for (int j=0;j<a.at(i)-1;j++){
      for (int k=j+1;k<a.at(i);k++){
       for (int e=0;e<s.size()-1;e++){
           if (h.at(e).at(s.size()-1).first.first==u.at(i).at(j)){
         for (int ii=e+1;ii<s.size();ii++){
           if (h.at(e).at(ii).first.first==u.at(i).at(j) && h.at(e).at(ii).first.second==u.at(i).at(k)) h.at(e).at(ii).second++;
         }
           }
       }
      }
    }
  }
  for (int i=0;i<s.size()-1;i++) {
    for (int j=i+1;j<s.size();j++){
      if (h.at(i).at(j).second>=m) ans++;
    }
  }
  cout << ans << endl;
  for (int i=0;i<s.size()-1;i++) {
    for (int j=i+1;j<s.size();j++){
      if (h.at(i).at(j).second>=m) cout << h.at(i).at(j).first.first << " " << h.at(i).at(j).first.second << endl;
    }
  }
}


Measured memory_bytes: 26332
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define P pair<ll,ll>
#define V vector<ll>

#define rep(i,n) for(ll i = 0; i < (n); i++)
#define repd(i,n) for(ll i = (n); i >= 0; i--)
#define FOR(i,t,n) for(ll i = (t); i < (n); i++)
#define FORD(i,t,n) for(ll i = (n); i >= t; i--)
#define ALL(x) x.begin(),x.end()
#define asort(x) sort(ALL(x))

int main() {
    ll n, ac = 0, wa = 0, tle = 0, re = 0;
    string s;
    cin >> n;
    rep(i,n) {
        cin >> s;
        if(s[0] == 'A') ac++;
        else if(s[0] == 'W') wa++;
        else if(s[0] == 'T') tle++;
        else if(s[0] == 'R') re++;
    }
    cout << "AC x " << ac << endl;
    cout << "WA x " << wa << endl;
    cout << "TLE x " << tle << endl;
    cout << "RE x " << re << endl;
}

Measured memory_bytes: 3620
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <set>
#include <cstring>
#include <iomanip>
#include <queue>
#include <deque>
#include <cmath>
using namespace std;
#define inf 280201280201280201
#define mn 2005
#define FLN "test"
#define int long long
#define MOD 1000000007
typedef pair<int, int> ii;
//constance

//common data structures and templates
struct dsu{
  vector<int> p, rank;
  void init(int n){
    p.assign(n, -1);
    for(int i=0; i< n; ++i) p[i] = i;
    rank.assign(n, 1);
  }
  int root(int i){
    return p[i] == i ? i : p[i] = root(p[i]);
  }
  bool isSameSet(int i, int j){
    return root(i)== root(j);
  }
  void unify(int i, int j){
    if(!isSameSet(i, j)){
      int x = root(i), y = root(j);
      if(rank[x] > rank[y]){
        p[y] = x;
        rank[x] += rank[y];
      }    
      else{
        p[x] = y;
        rank[y] += rank[x];
      }
    }
  }
};
//gb
int n, m, X;
dsu uf;
pair<int, ii> e[mn];
int check[mn], PW[mn];
vector<vector<ii> > mst;
int s;
//functions here
void input(){
  cin >> n >> m >> X; 
  mst.assign(n, vector<ii>());
  for(int i=0; i< m; ++i){
    int x,y, w; cin >> x >> y >> w;
    e[i] = {w, {--x, --y}};
  }
}
int dfs(int v, int p, int des){
  int ret = -1;
  for(ii u : mst[v]){
    if(u.first!= p){
      if(u.first== des) return u.second;
      else{
        int w = dfs(u.first, v, des);
        if(w > 0) ret = max(u.second, w); 
      }
    }
  }
  return ret;
}
void prep(){
  PW[0] = 1;
  for(int i=1; i< mn; ++i) PW[i] = (PW[i-1]*2)%MOD;
}
void solve(){
  prep();
  s= 0;
  uf.init(n);
  sort(e, e+m);
  memset(check, 0, sizeof check);
  for(int i=0; i< m; ++i){
    if(!uf.isSameSet(e[i].second.first, e[i].second.second)){
      check[i] = 1;
      uf.unify(e[i].second.first, e[i].second.second);
      s += e[i].first;
      mst[e[i].second.first].push_back({e[i].second.second, e[i].first});
      mst[e[i].second.second].push_back({e[i].second.first, e[i].first});
    }
  }
  int cnt = 0, cntt= 0, cnttt = 0;
  for(int i=0; i< m; ++i){
    if(check[i] == 0){
      int w = dfs(e[i].second.second,-1, e[i].second.first);
      if(s-w + e[i].first > X) check[i] = -1;
      if(s-w + e[i].first < X) check[i] = 1;
    }
    else if(check[i]== 1){
      if(s==X) check[i] = 0;
      if(s > X) check[i] = -1;
    }
    if(check[i] == 0) ++cnt;
    if(check[i] == 1) ++cntt;
    if(check[i] == -1) ++cnttt;
    cerr << e[i].second.first+1 << " " << e[i].second.second+1 << " "<< check[i] << "\n";
  }
  cnt += (cntt >0);
  if(cnttt == m){
    cout << 0;
    return;
  }
  cout << ((PW[cnt]+ MOD-2)%MOD*PW[cnttt])%MOD;
}

//#define LOCAL 1

signed main(signed argc, char** argv) {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
#ifdef LOCAL
	   freopen(FLN".inp", "r", stdin);
	   freopen(FLN".out", "w", stdout);
#endif
  input();
  solve();
	return 0;
}


Measured memory_bytes: 512
/*
#include <boost/multiprecision/cpp_int.hpp>
typedef boost::multiprecision::cpp_int mint; //*/
#include <bits/stdc++.h>
#define  rep(i,n) for(li i=0;i<(n);i++)
#define  red(i,n) for(li i=(n)-1;i>=0;i--)
#define  all(a) begin(a),end(a)
#define  pb(a) push_back(a)
using namespace std;
using li = long long;
using vi = vector<li>;
using vs = vector<string>;



int main()
{
    int n,k,ans=0;
    cin>>n>>k;
    int a[n];
    rep(i,n)cin>>a[i];
    sort(a,a+n);
    reverse(a,a+n);
    rep(i,k) ans+=a[i];
    cout<<ans<<endl;

       
    
    return 0;
}

Measured memory_bytes: 256
#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 ifaxb(a, x, b) if (a < x && x < b) // 比較は昇順
#define vi vector<int>
#define vii vector<vi>
#define vs vector<string>
#define vss vector<vs>
#define all(x) x.begin(), x.end()
#define ff first
#define ss second
#define pq priority_queue
#define ipair pair<int, int>
#define spair pair<string, string>
#define lpair pair<LL, LL>
#define MP make_pair
#define MM multimap
#define PB push_back
#define INF 2147483647
#define _INF -2147483647
#define pi 3.1415926536
#define MAXN 100004
using namespace std;
typedef long long ll;

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

  vi P(N);
  int sum = 0;
  rep(i, N)
  {
    cin >> P[i];
    sum += P[i];
  }

  sort(all(P));

  cout << sum - P[N - 1] / 2 << endl;

  return 0;
}

Measured memory_bytes: 256