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

using namespace std;

typedef long long ll;

#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define FORd(i,a,b) for(int i=a;i>=b;i--)
#define fi first
#define se second
#define II pair<ll,ll>

const int maxn=2e5+10;
const ll maxN=1e18+10;

int main()
{
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int n,k,a[maxn];
  cin >> n >> k;
  FOR(i,1,n) cin >> a[i];
  sort(a+1,a+1+n);
  ll dem=0;
  FOR(i,1,n-k) dem+=a[i];
  cout << dem;
}
    

Measured memory_bytes: 1024
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);

		int a = scan.nextInt();
		int b = scan.nextInt();
		String s = scan.next();
		StringBuilder sb = new StringBuilder();
		sb.append(s);
		String aS = sb.substring(0, a);
		char haihun = sb.charAt(a);
		String bS = sb.substring(a+1, s.length());

		//System.out.println(aS);
		//System.out.println(haihun);
		//System.out.println(bS);
		boolean hantei = true;
		if(aS.matches("[0-9]*")) {
			hantei =true;
		}else {
			hantei = false;
		}

		if(hantei ==true && haihun == '-') {
			hantei  = true;
		}else {
			hantei = false;
			//System.out.println(hantei);
		}

		if(hantei == true && bS.matches("[0-9]*")) {
			hantei  = true;
		}else {
			hantei = false;
		}

		if(hantei == true) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}

	}

}


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

long a[100000];

int main()
{
  int N;
  long K;
  cin >> N >> K;
  int count[40] = {};
  for (int i = 0; i < N; i++)
  {
    cin >> a[i];
    for (int j = 39; j >= 0; j--)
    {
      if (a[i] & (1L << j))
      {
        count[j]++;
      }
    }
  }
  long used = 0;
  int div = N / 2;
  bool isOdd = N % 2 == 1;
  for (int j = 39; j >= 0; j--)
  {
    if ((used + (1L << j)) <= K)
    {
      if (count[j] < div || (isOdd && (count[j] <= div)))
      {
        used += (1L << j);
      }
    }
  }
  long result = 0;
  for (int i = 0; i < N; i++)
  {
    result += used ^ a[i];
  }

  cout << result << endl;
  return 0;
}


Measured memory_bytes: 1024
package main

import (
        "fmt"
)

func solution(a, b, n int) int {
        x := n

        if n >= b-1 {
                x = b - 1
        }

        return a*x/b - a*(x/b)
}

func main() {
        var a, b, n int
        fmt.Scan(&a, &b, &n)
        fmt.Println(solution(a, b, n))
}

Measured memory_bytes: 1752
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define LLINF 1000000000000000ll
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define all(x) (x).begin(),(x).end()
#define sq(x) ((x)*(x))
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define repn(i,a,n) for(int (i)=(a);(i)<(int)(n);(i)++)
#define EQ(a,b) (abs((a)-(b))<eps)
#define dmp(x) cerr << __LINE__ << " " << #x << " " << x << endl;
template<class T> void chmin(T& a,const T& b){if(a>b)a=b;}
template<class T> void chmax(T& a,const T& b){if(a<b)a=b;}
template<class T,class U>
ostream& operator << (ostream& os,pair<T,U>& p){
	os << p.fi << ',' << p.sec; return os;
}
template<class T,class U>
istream& operator >> (istream& is,pair<T,U>& p){
	is >> p.fi >> p.sec; return is;
}
template<class T>
ostream& operator << (ostream &os,const vector<T> &vec){
	for(int i=0;i<vec.size();i++){
		os << vec[i];
		if(i+1<vec.size())os << ' ';
	}
	return os;
}
template<class T>
istream& operator >> (istream &is,vector<T>& vec){
	for(int i=0;i<vec.size();i++)is >> vec[i];
	return is;
}
void fastio(){
	cin.tie(0);
	ios::sync_with_stdio(0);
	cout<<fixed<<setprecision(20);
}
vector<int> G[10010],rG[10010];
vector<int> vs;
int V,E,Q;
bool used[10010];
int cmp[10010];
vector<int> cmpv[1000];
void add_edge(int from,int to)
{
    G[from].pb(to);
    rG[to].pb(from);
    return;
}
void dfs(int s)
{
    used[s]=true;
    for(int i=0;i<G[s].size();i++)
    {
        if(!used[G[s][i]])dfs(G[s][i]);
    }
    vs.pb(s);
}
void rdfs(int s,int k)
{
    used[s]=true;
    cmp[s]=k;
		cmpv[k].pb(s+1);
    for(int i=0;i<rG[s].size();i++)
    {
        if(!used[rG[s][i]])rdfs(rG[s][i],k);
    }
}
int scc()
{
    memset(used,0,sizeof(used));
    vs.clear();
    for(int v=0;v<V;v++)
    {
        if(!used[v])dfs(v);
    }
    memset(used,0,sizeof(used));
    int k=0;
    for(int i=vs.size()-1;i>=0;i--)
    {
        if(!used[vs[i]])rdfs(vs[i],k++);
    }
    return k;
}
int same(int u,int v)
{
    if(cmp[u]==cmp[v])return 1;
    else return 0;
}
int main()
{
    cin >> V >> E;
    for(int i=0;i<E;i++)
    {
        int s,t;
        cin >> s >> t;
				s--;t--;
        add_edge(s,t);
    }
    int K = scc();
		for(int i=0;i<K;i++)sort(all(cmpv[i]));
		for(int i=0;i<V;i++){
			cout << cmpv[cmp[i]] << endl;
		}	
    return 0;
}



Measured memory_bytes: 4768
#include <iostream>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
    int h, n;
    cin >> h >> n;
    int s = 0;
    for (int i = 0; i < n; ++i)
    {
        int x;
        cin >> x;
        s += x;
    }
    if (h <= s)
        cout << "Yes";
    else
        cout << "No";
    return 0;
}


Measured memory_bytes: 256
n=int(input())
a=list(map(int, input().split()))
import math
x=[0 for _ in range(n)]
if n%2!=0:
    x[0]+=1
for i in range(n):
    x[a[i]]+=1

j=True
for t in x:
    if t%2!=0:
        j=False
print(2**(n//2)%(10**9+7) if j else 0)

Measured memory_bytes: 14008
#include <bits/stdc++.h>
#define cinf(n,x) for(int i=0;i<(n);i++) cin >> x[i];
typedef long long int ll;
using namespace std;

int main(){
  int n; cin >>n;
  vector<int> a(n);
  cinf(n,a);
  for(int i=0;i<n;i++){
  	a[i]-=(i+1);
  }
  sort(a.begin(),a.end());
  ll ans=0;
  if(n%2==1){
  	int m=a[n/2];
  	for(int i=0;i<n;i++){
  		ans+=abs(a[i]-m);
  	}
  }
  else{
  	int m=a[n/2];
  	int l=a[n/2-1];
  	ll ans1=0;
  	for(int i=0;i<n;i++){
  		ans+=abs(a[i]-m);
  	}
  	for(int i=0;i<n;i++){
  		ans1+=abs(a[i]-l);
  	}
  	ans=min(ans,ans1);
  }
  cout << ans << endl;
} 

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
    int main(){
        int A,B;cin>>A>>B;
        int ans=-1;
        for(int i=1;i<=10000;i++){
            double hati=i*0.08;
            double ju=i*0.1;
            if((int)hati==A&&(int)ju==B){
                ans=i;
                break;
        }

    }

    cout<<ans<<endl;


    }






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

typedef long long ll;
#define all(x) (x).begin(),(x).end()

template<typename T>
T mod(T a, T b){
    return (a + b) % b;
}

template<typename T>
T gcd(T a, T b){
    if (b == 0) return a;
    return gcd(b, a % b);
}

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

// n を素因数分解
map<ll, ll> factor(ll n){
    map<ll, ll> mp;
    for (ll i = 2; i*i <= n; i++) {
        while (n % i == 0) {
            mp[i]++;
            n /= i;
        }
    }

    if (n > 1) {
        mp[n]++;
    }

    return mp;
}

// 文字列に "hoge" が含まれているか
// string str = "hogepiyo";
// if (str.find("hoge") != string::npos) {
//     cout << "文字列が含まれています" << endl;
// }

// char to string
// char c = 'a';
// string str = {c};

void solve(){
    ll N;
    cin >> N;

    vector<ll> A(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }

    ll n = 1;
    ll ans = 0;
    for (int i = 0; i < N; i++) {
        if (A[i] != n) {
            ans++;
        } else {
            n++;
        }
    }

    if (ans != N) cout << ans << endl;
    else cout << -1 << endl;
    return;
}

int main(int argc, char const* argv[])
{
    solve();
    return 0;
}


Measured memory_bytes: 1792
#include <iostream>
#include<vector>
#include<math.h>
#include<string>

typedef long long ll;
typedef unsigned short int unsi;
typedef unsigned int uni;
typedef unsigned long int unli;

using namespace std;

int main() {
	int N;
	ll InputA;
	ll XOR_A = 0;
	ll C;
	bool Can = true;

	cin >> N;

	for (int i = 0; i < N; i++) {
		cin >> InputA;
		XOR_A ^= InputA;
		//cout << XOR_A << endl;
	}

	C = (XOR_A ^ XOR_A);

	if (XOR_A ==C) {
		cout << "Yes" << endl;
	}else {
		cout << "No" << endl;
	}
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
using st=string;
using ch=char;
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<P> vP;
typedef vector<ch> vc;
typedef vector<vc> vvc;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
#define ROF(i,a,b) for(ll i=a;i>=b;i--)
#define per(i,a) ROF(i,a,0)
const ll MOD=1000000007;
const ll MOD2=998244353;
const ld PI=acos(-1);
const ll INF=1e18;
st abc="abcdefghijklmnopqrstuvwxyz";
st ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
struct edge{ll to,cost;};

int main() {
  ll N;
  cin >> N;
  vl a(N);
  rep(i,N){
    cin >> a[i];
  }
  sort(a.begin(),a.end());
  cout << a[N/2]-a[N/2-1] << endl;
}

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

using namespace std;

#define debug(n) cerr << #n << ':' << n << endl;
#define dline    cerr << __LINE__ << endl;

using ll = long long;
template<class T, class U> using P = pair<T,U>;
template<class T> using Heap = priority_queue<T>;
template<class T> using heaP = priority_queue<T,vector<T>,greater<T>>;
template<class T,class U> using umap = unordered_map<T,U>;
template<class T> using uset = unordered_set<T>;

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

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

template<class T, size_t N, class U>
void Fill(T (&a)[N], const U&v){
    fill((U*)a,(U*)(a+N),v);
}

template<class T>
istream& operator >> (istream&is, vector<T>&v){
  for(auto&e:v)is >> e;
  return is;
}

int main(){
  ll x; cin >> x;
  for(ll i = -200; i <= 200; ++i){
    for(ll j = -200; j <= 200; ++j){
      if(pow(i,5) - pow(j,5) == x){
	cout << i << ' ' << j << endl;
	return 0;
      }
    }
  }
  return 0;
}


Measured memory_bytes: 4096
A_array = [list(map(int,input().split())) for _ in range(3)]
hit_array = [[0] * 3 for _ in range(3)]
N = int(input())
for i in range(N):
    b = int(input())
    for j in range(3):
        for k in range(3):
            if b == A_array[j][k]:
                hit_array[j][k] = 1
for i in range(3):
    if hit_array[i][0] and hit_array[i][1] and hit_array[i][2]:
        print("Yes")
        exit()
    if hit_array[0][i] and hit_array[1][i] and hit_array[2][i]:
        print("Yes")
        exit()

if hit_array[0][0] and hit_array[1][1] and hit_array[2][2]:
    print("Yes")
    exit()

if hit_array[0][2] and hit_array[1][1] and hit_array[2][0]:
    print("Yes")
    exit()

print("No")

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

vector<vector<int>> G(100005);
map<pair<int, int>, int> ans;

void dfs(int now, int p, int uc) {
  int color = 1;
  for (int i = 0; i < G[now].size(); i++) {
    int v = G[now][i];
    if (v == p) continue;
    if (color == uc) color++;
    ans[make_pair(now, v)] = color; color++;
    dfs(v, now, color - 1);
  }
  
}

int main(void) {

  int n;
  cin >> n;
  int a[n], b[n];
  rep (i, n - 1) {
    cin >> a[i] >> b[i];
    a[i]--; b[i]--;
    G[a[i]].push_back(b[i]);
    G[b[i]].push_back(a[i]);
  }

  dfs(0, -1, -1);

  int mc = 0;
  rep (i, n - 1) mc = max(mc, ans[make_pair(a[i], b[i])]);
  
  cout << mc << endl;
  rep (i, n - 1) cout << ans[make_pair(a[i], b[i])] << endl;

  return 0;
}

Measured memory_bytes: 15872
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        '''
        要素xが属するグループの根を返す
        '''
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
    
    def union(self, x, y):
        '''
        要素xが属するグループと要素yが属するグループとを併合する
        '''
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        '''
        要素xが属するグループのサイズ（要素数）を返す
        '''
        return -self.parents[self.find(x)]

    def same(self, x, y):
        '''
        要素x, yが同じグループに属するかどうかを返す
        '''
        return self.find(x) == self.find(y)

    def members(self, x):
        '''
        要素xが属するグループに属する要素をリストで返す
        '''
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        '''
        各要素の親要素の番号を格納するリスト
        '''
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        '''
        グループの数を返す
        '''
        return len(self.roots())

    def all_group_members(self):
        '''
        {ルート要素: [そのグループに含まれる要素のリスト], ...}の辞書を返す
        '''
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


N, M = map(int, input().split())
AB = reversed([list(map(int, input().split())) for _ in range(M)])

ans = []
last = N * (N-1) // 2
ans.append(last)

G = UnionFind(N)

for A, B in AB:
    A, B = A-1, B-1
    if G.same(A, B):
        ans.append(ans[-1])
    else:
        a_size = G.size(A)
        b_size = G.size(B)
        ans.append(ans[-1] - (a_size * b_size))
    G.union(A, B)

ans = ans[:-1]
print(*ans[::-1], sep='\n')


Measured memory_bytes: 104076
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include<math.h>
#define ll long long
#define pai 3.1415926535897932384626433832795028841971693
long long min(long long a, long long b){
    if(a < b) return a;
    else return b;
}
long long max(long long a, long long b){
    if(a < b) return b;
    else return a;
}
int main(){
  char s[21];
  scanf("%s",s);
  printf("%c%c%c",s[0],s[1],s[2]);
  return 0;
}

Measured memory_bytes: 1732
#include <bits/stdc++.h>
#define int long long int
#define MOD(x) ((x % MOD_N) + MOD_N) % MOD_N
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);--i)
#define RFORE(i,a,b) for(int i=(b);i>=(a);--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(c) (c).begin(),(c).end()
#define RALL(c) (c).rbegin(),(c).rend()
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define SZ(c) (int)((c).size())
#define EACH(i,v) for(auto i=v.begin();i!=v.end();++i)
#define REACH(i,v) for(auto i=v.rbegin();i!=v.rend();++i)
#define LB(c,x) distance((c).begin(),lower_bound(ALL(c),x))
#define UB(c,x) distance((c).begin(),upper_bound(ALL(c),x))
#define COUNT(c,x) (lower_bound(ALL(c),x)-upper_bound(ALL(c),x))
#define UNIQUE(c) SORT(c); (c).erase(unique(ALL(c)),(c).end());
#define COPY(c1,c2) copy(ALL(c1),(c2).begin())
#define EXIST(s,e) (bool)((s).find(e)!=(s).end())
#define PB push_back
#define MP make_pair
#define DUMP(x)  cerr<<#x<<" = "<<(x)<<endl;
#define NL cerr<<endl;
using namespace std;
template<typename T,typename U> using P=pair<T,U>;
template<typename T> using V=vector<T>;
template<typename T>bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<typename T>bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<typename T>T sum(vector<T>&v){return accumulate(ALL(v),T());}
template<typename T>T sum(vector<T>&v,int a,int b){return accumulate(v.begin()+a,v.begin()+b,T());}
template<typename T>T max(vector<T>&v){return *max_element(ALL(v));}
template<typename T>T min(vector<T>&v){return *max_element(ALL(v));}
template<typename T>T max_index(vector<T>&v){return distance((v).begin(),max_element(ALL(v)));}
template<typename T>T min_index(vector<T>&v){return distance((v).begin(),min_element(ALL(v)));}

struct edge { int to, cost; };

template<typename T>auto&operator<<(ostream&s,const vector<T>&v){s<<"[";bool a=1;for(auto e:v){s<<(a?"":" ")<<e;a=0;}s<<"]";return s;}
template<typename T,typename U>auto&operator<<(ostream&s,const pair<T,U>&p){s<<"("<<p.first<<","<<p.second<<")";return s;}
template<typename T>auto&operator<<(ostream&s,const set<T>&st){s<<"{";bool a=1;for(auto e:st){s<<(a?"":" ")<<e;a=0;}s<<"}";return s;}
template<typename T,typename U>auto&operator<<(ostream&s,const map<T,U>&m){s<<"{";bool a=1;for(auto e:m){s<<(a?"":" ")<<e.first<<":"<<e.second;a=0;}s<<"}";return s;}

const int INF = 1e18;
const int MOD_N = 1e9+7;

signed main()
{
   int n, m; cin >> n >> m;
   V<int> c(m);
   REP(i, m) {
      cin >> c[i];
   }

   V<int> num(n+1, INF);
   num[0] = 0;
   REP(i, n) REP(j, m) if (i + c[j] <= n) {
      chmin(num[i + c[j]], num[i] + 1);
   }
   cout << num[n] << endl;

   return 0;
}



Measured memory_bytes: 3068
module UnionFind
    implicit none
    public
        type :: Union_Find
            integer,allocatable,dimension(:) :: par
            integer(8),allocatable,dimension(:) :: g1,g2
        end type Union_Find
    contains
        subroutine init(p,n)
            implicit none
            type(Union_Find)  p
            integer n,i
            allocate( p%par(0:n) )
            allocate( p%g1(0:n) )
            allocate( p%g2(0:n) )
            p%g1 = 0
            p%g2 = 0
            do i=0,n
                p%par(i) = i
            enddo
        end subroutine init
        recursive function root(p,n) result(ret)
            implicit none
            type(Union_Find) p
            integer ret,n
            if(p%par(n)==n)then
                ret = n
                return
            else
                p%par(n) = root(p,p%par(n))
                ret = p%par(n)
                return
            endif
        end
        subroutine unite(p,a,b)
            implicit none
            type(Union_Find) p
            integer a,b
            a = root(p,a)
            b = root(p,b)
            if(a/=b)then
                p%par(a) = b
                p%g1(b) = p%g1(b) + p%g1(a)
                p%g2(b) = p%g2(b) + p%g2(a)
            endif
        end
end module UnionFind

program atcoder
    use UnionFind
    implicit none
    integer :: i,j,w,h,now,to
    integer(8) :: ans=0
    integer,allocatable,dimension(:) :: did
    character(len=401) :: s(401)
    type(Union_Find) uf
    read*,h,w
    do i=1,h
        read(*,*)s(i)
    enddo
    allocate( did(0:(w+1)*(h+1)+1) )
    did = 0
    call init(uf,(h+1)*(w+1)+1)

    do i = 1,h
        do j = 1,w
            if(s(i)(j:j)=='#')then
                uf%g1(w*i+j) = 1
            else 
                uf%g2(w*i+j) = 1
            endif
        enddo
    enddo
    do i = 1,h
        do j = 1,w
            now = w*i+j
            to = w*(i-1)+j
            if(i>1 .and.s(i)(j:j)/=s(i-1)(j:j))then
                call unite(uf,now,to)
            endif
            to = w*(i+1)+j
            if(i<h .and.s(i)(j:j)/=s(i+1)(j:j))then
                call unite(uf,now,to)
            endif 
            to = w*i+j-1
            if(j>1 .and.s(i)(j:j)/=s(i)(j-1:j-1))then
                call unite(uf,now,to)
            endif
            to = w*i+j+1
            if(j<w .and.s(i)(j:j)/=s(i)(j+1:j+1))then
                call unite(uf,now,to)
            endif
        enddo
    enddo

    do i = 1,h
        do j = 1,w
            to = root(uf,i*w+j)
            if(did(to) == 0 )then
                did(to) = 1
                ans = ans + uf%g1(to)*uf%g2(to)
            endif
        enddo
    enddo
    write(*,'(I0)')ans
    stop 
contains


end program atcoder


Measured memory_bytes: 4224
n,m=map(int,input().split())
SC=[list(map(int,input().split())) for _ in range(m)]
flag=0
ans=-1
if n==1:
    for i in range(10):
        I=str(i)
        flag=0
        for j in range(m):
            s=SC[j][0]
            c=SC[j][1]
            if I[s-1]==str(c):
                flag+=0
            else:
                flag+=1
        if flag==0:
            ans=i
            break
elif n==2:
    for i in range(10, 100):
        I=str(i)
        flag=0
        for j in range(m):
            s=SC[j][0]
            c=SC[j][1]
            if I[s-1]==str(c):
                flag+=0
            else:
                flag+=1
        if flag==0:
            ans=i
            break
elif n==3:
    for i in range(100,1000):
        I=str(i)
        flag=0
        for j in range(m):
            s=SC[j][0]
            c=SC[j][1]
            if I[s-1]==str(c):
                flag+=0
            else:
                flag+=1
        if flag==0:
            ans=i
            break
print(ans)

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

int main(){
  int n;
  bool answer = true;
  cin >> n;
  vector<int> time(n+1),x(n+1),y(n+1);
  for(int i=1; i<n+1; i++){
    cin >> time[i] >> x[i] >> y[i];
  }
  
  int distance,dtime;
  for(int i=0; i<n; i++){
    distance = abs(x[i] - x[i+1])+abs(y[i] - y[i+1]);
    dtime = time[i+1] - time[i];
    
    if(distance > dtime){
      answer = false;
      break;
    }
    
    if((dtime - distance)%2 == 1){
      answer = false;
      break;
    }
  }
  
  if(answer){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}

Measured memory_bytes: 1408
class DynamicProgramming(object):

    def __init__(self, item_n: int, border: int, obj_coef: list, sbj_coef: list, initializer: int = 0):
        self.item_n = item_n
        self.border = border
        self.table = [[initializer for _ in range(self.item_n + 1)] for _ in range(self.border + 1)]

        if len(obj_coef) == self.item_n:  # to 1-base
            obj_coef = [0] + obj_coef
        self.obj_coef = obj_coef

        if len(sbj_coef) == self.item_n:
            sbj_coef = [0] + sbj_coef
        self.sbj_coef = sbj_coef

    def __str__(self):
        return "\n".join(list(map(lambda l:
                                  " ".join(list(map(str, l)))
                                  , self.table)))

    def __repr__(self):
        return "DynamicProgramming object:\n" + \
               "item_n: " + str(self.item_n) + ", border: " + str(self.border) + "\n" +\
               "table:\n" + self.__str__()

    def solve(self, expr: callable) -> list:
        for weight_lim in range(1, self.border + 1):
            for item_idx in range(1, self.item_n + 1):
                self.table[weight_lim][item_idx] = expr(weight_lim, item_idx)

        return self.table

    def knapsack_expr(self, weight_lim: int, item_idx: int) -> int:
        res = self.table[weight_lim][item_idx - 1]
        if weight_lim - self.sbj_coef[item_idx] >= 0:
            res = max(res, self.table[weight_lim - self.sbj_coef[item_idx]][item_idx - 1] + self.obj_coef[item_idx])
        return res

    def coin_expr(self, target, coin_idx) -> int:
        if self.sbj_coef[coin_idx] == 1:
            res = target
        else:
            res = self.table[target][coin_idx - 1]
            if target - self.sbj_coef[coin_idx] >= 0:
                res = min(res, self.table[target - self.sbj_coef[coin_idx]][coin_idx] + self.obj_coef[coin_idx])
        return res

    def fill_0_idx_with(self, value: int) -> "DynamicProgramming":
        self.table[0] = [value for _ in range(self.item_n + 1)]
        for i in range(1, self.border + 1):
            self.table[i][0] = value
        return self


if __name__ == '__main__':
    N = int(input())
    values = sorted(list(set([6 ** i for i in range(7)] + [9 ** i for i in range(6)])))
    values_len = len(values)
    dp = DynamicProgramming(values_len, N, [1 for _ in range(values_len)], values, initializer=int(10e5))\
        .fill_0_idx_with(0)
    print(dp.solve(dp.coin_expr)[N][values_len])


Measured memory_bytes: 40384
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <numeric> // accumulate(v.begin(), v.end(), 0)

using namespace std;
#define ll long long

int main(){
  int N;
  cin >> N;
  vector<ll> A(N);
  int ans = 0;
  for(int i=0; i<N; i++){
    cin >> A[i];
    ll tmp = A[i];
    while(tmp % 2 == 0){
      tmp /= 2;
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define PI 3.14159265359 // このように定数として使えるようにしておく
int main() {
  cout << fixed << setprecision(10);//小数点以下の桁を10まで表示させる
  double a,b,x;
  cin >> a >> b >> x;
  double v=a*a*b;//水筒の体積を求める
  double ans;
  //水筒の体積の半分でxの値を場合分け
  //atanはtanの逆関数 ラジアンで出力されることを忘れずに
  if(v==2*x) ans = atan(b/a)*180.0/PI;
  if(v>2*x) ans = atan(a*b*b/(2*x))*180.0/PI;
  if(v<2*x) ans = atan(2*(a*a*b-x)/(a*a*a))*180.0/PI;
  cout << ans << endl;
  
}




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

int main()
{
	int a,b;
	cin>>a>>b;
	int c = b*10;
	for(int d=c;d<c+10;d++)
	{
		if( d*8/100 == a )
		{
			cout << d <<endl;
			return 0;
		}
	}
	cout << -1 << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
  long long int n, k, h, ans;
  ans = 1000000000;
  vector<long long int> v;
  cin >> n >> k;

  for(int i=0;i<n;i++){
    cin >> h;
    v.push_back(h);
  }
  sort(v.begin(), v.end());

  for(int i=0;i<n-k+1;i++){
    if(ans>v[i+k-1]-v[i]){
      ans = v[i+k-1]-v[i];
    }
  }

  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 1400
#include<bits/stdc++.h>
using namespace std;
#define ll  long long
#define ld  long double
#define endl '\n'
#define FAST ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const ll MOD = (ll)1e9+7;
const double PI = 3.141592653589793238463;
const int MAXN = 1000030;
int main() {
   int n;
   cin>>n;
    vector<ll> plus,minus;
   for(int i=0;i<n;i++){
       ll a,b;
       cin>>a>>b;
       plus.push_back(a+b);
       minus.push_back(a-b);
   }
   sort(plus.begin(),plus.end());
   sort(minus.begin(),minus.end());
   cout<<max((plus[n-1]-plus[0]),(minus[n-1]-minus[0]))<<endl;
  
    return 0;
}

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

i_odd_u = (2 * x - 1)
i_even_u = 2 * x

if i_odd_u % 11 == 0:
    print(i_odd_u // 11)
elif i_even_u % 11 == 0:
    print(i_even_u // 11)
else:
    print(i_odd_u // 11 + 1)

Measured memory_bytes: 3064
#include<iostream>
#include<string.h>
using namespace std;
int main(){
	int n, cou = 0, N = 5, E = 3, W = 4, S = 2, U = 1, D = 6,A=0;
	char c[30] = { 0 };
	while (1){
		N = 5, E = 3, W = 4, S = 2, U = 1, D = 6;
		cou = 1;
		cin >> n;
		if (n == 0){
			break;
		}
		for (int i = 0; i < n; i++){
			cin >> c;
			A = 0;
			if (c[0] == 'N'){
				A = N;
				N = U;
				U = S;
				S = D;
				D = A;
				cou = cou + U;
			}
			else if (c[0] == 'E'){
				A = E;
				E = U;
				U = W;
				W = D;
				D = A;
				cou = cou + U;
			}
			else if (c[0] == 'W'){
				A = W;
				W = U;
				U = E;
				E = D;
				D = A;
				cou = cou + U;
			}
			else if (c[0] == 'S'){
				A = S;
				S = U;
				U = N;
				N = D;
				D = A;
				cou = cou + U;
			}
			else if (c[0] == 'L'){
				A = E;
				E = S;
				S = W;
				W = N;
				N = A;
				cou = cou + U;
			}
			else if (c[0] == 'R'){
				A = S;
				S = E;
				E = N;
				N = W;
				W = A;
				cou = cou + U;
			}
		}
		cout << cou << endl;
	}
	return 0;
}

Measured memory_bytes: 3072
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,m=100,a,s=0;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a;
		s+=a;
		if(a%10)m=min(m,a);
	}
	if(s%10==0)s-=m;
	cout<<(s%10?s:0)<<endl;
}


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

using namespace std;

long long n,q,m,k,t,l;

int main(){
    cin>>n>>m;
    vector<string>v(n);
    for (int i=0; i<n; i++){
        cin>>v[i];
    }
    sort(v.begin(), v.end());
    for (int i=0; i<n; i++){
        cout<<v[i];
    }
}


Measured memory_bytes: 3620
#include <bits/stdc++.h>
 
#define int long long
 
using namespace std;
 
int a[301][301];
int was[301];
int u[301];
 
 main () {
	ios_base::sync_with_stdio (0);	
	cin.tie (0), cout.tie (0);
	string s;
	cin >> s;
	int n = s.size ();
	int kol = n * (n - 1) / 2;
	for (int i = 0;i < s.size ();i ++) {
		kol -= u[s[i]];
		u[s[i]] ++;
	}
	cout << kol + 1;
	return 0;
}

Measured memory_bytes: 720
#include<stdio.h>
 
int main(void)
{
    int n, m;
    int A[100][100];
    int B[100];
    int h, w, C[100] = { 0 };
    scanf("%d %d", &n, &m);
    for (h = 0; h<n; h++)
    {
        for (w = 0; w<m; w++)
        {
            scanf("%d", &A[h][w]);
        }
    }
    for (w = 0; w<m; w++)
    {
        scanf("%d", &B[w]);
    }
    for (h = 0; h < n; h++)
    {
        for (w = 0; w < m; w++)
        {
            C[h] += A[h][w] * B[w];
        }
    }
    for (h = 0; h<n; h++)
    {
        printf("%d\n", C[h]);
    }
 
    return 0;
}

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

int main(){
    ll n;
    cin >> n;
    ll ans = 0;
    const ll rt = sqrt(n);
    for(ll i = 1; i <= rt; i++){ // √N 以下
        const ll cnt = n / i;  // i を約数に含む数が何個あるか
        ans += cnt * (cnt + 1) / 2 * i; // i + 2*i + 3*i + ... + cnt*i を足す
    }
    // √N より上
    for(ll cnt = n / rt - 1; cnt; cnt--){
        const ll l = n / (cnt + 1), r = n / cnt; // i を約数に含む数が cnt 個ある  これを満たす i の範囲は (l, r]
        // i + 2*i + 3*i + ... + cnt*i を i = l+1 -> r まで足す
        ans += cnt * (cnt + 1) * (r * (r + 1) - l * (l + 1)) / 4;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3628
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <iomanip>
#include <climits>
#include <functional>
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<string> VS;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<PII> VPI;
typedef vector<PLL> VPL;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define all(a) (a).begin(),(a).end()
#define pf push_front
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define ub upper_bound
#define lb lower_bound

int main(){
  int D;
  cin>>D;
  VL C(26);
  rep(i,26) cin>>C[i];
  VVL S(D,VL(26));
  rep(i,D) rep(j,26) cin>>S[i][j];
  rep(i,D){
    ll X=0;
    rep(j,26) if(S[i][X]<S[i][j]) X=j;
    cout<<X+1<<endl;
  }
}


Measured memory_bytes: 3716
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF=2147483647;
inline ll read(){
	ll x=0,f=1;
	char ch=getchar();
	while(ch<'0'||ch>'9'){
		if(ch=='-') f=-1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9'){
		x=(x<<1)+(x<<3)+(ch^48);
		ch=getchar();
	}
	return x*f;
}
int n;
int main(){
	n=read();
	n%=10;
	if(n==3) printf("bon\n");
	else if(n==0||n==1||n==6||n==8) printf("pon\n");
	else printf("hon\n");
	return 0;
}

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

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

ll mod=1e9+7;

using namespace std;


ll inputValue(){
	ll a;
	cin >> a;
	return a;
};

void inputArray(int * p, ll a){
	rep(i, a){
		cin >> p[i];
	}
};

template<typename T>
void inputVector(vector<T>& p, ll a){
	rep(i, a){
		T input;
		cin >> input;
		p.emplace_back(input);
	}
}


template <typename T>
void output(T a) {
	cout << a << "\n";
}

ll count(ll i,ll j, vector<string>& m)
{
	return 0;     
}



int main(int argc, const char * argv[]) {
	ios_base::sync_with_stdio(false);
	cin.tie(0);

	ll x,a;

	cin >> x >> a;

	cout << (x < a ? 0 : 10) << endl;

}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
using namespace std;
int c[52];
int check(int j,int k){
  for(int l=0;l<j;l++){
  if(k==c[l])
    return 1;
  }
  return 0;
}
int main(){
  int n,b,m=0,s=0;
  char a;
  cin>>n;
  vector<pair<char,int> > vpci(52);
  vector<pair<char,int> > vpci2(52);
  for(int i=0;i<4;i++){
    for(int j=1;j<=13;j++){
      switch(i){
      case 0: vpci[s]=make_pair('S',j);s++; break;
      case 1: vpci[s]=make_pair('H',j);s++; break;
      case 2: vpci[s]=make_pair('C',j);s++; break;
      case 3: vpci[s]=make_pair('D',j);s++; break;
      }
    }
  }
    for(int k=0;k<n;k++){
      cin >> a >> b;
      vpci2[k] = make_pair(a,b);
    }
    for(int l=0;l<n;l++){
      for(int t=0;t<52;t++){
	if(vpci2[l].first == vpci[t].first && vpci2[l].second == vpci[t].second){
	  c[m]=t;
	  m++;
	}
      }
    }
    for(int aa=0;aa<52;aa++){
      if(check(m,aa)==0)
	cout<<vpci[aa].first<<" "<<vpci[aa].second<<endl;    
    }
  return 0;
}

Measured memory_bytes: 3068
#include <stdio.h>
#include <math.h>

int main(void)
{
    //for debug
    FILE *fin, *fout;
//#define DEBUG    
#ifdef DEBUG
    fin=fopen("input.txt","r");
    fout=fopen("output.txt","w");
#else
    fin=stdin; fout=stdout;
#endif

    while(feof(fin)==0){
        int a,b,c,d,e,f;
        double x,y;
        fscanf(fin,"%d %d %d %d %d %d\n",
               &a,&b,&c,&d,&e,&f);
        double det=(double)a*(double)e-(double)b*(double)d;
        x=((double)e*(double)c-(double)b*(double)f)/det;
        y=(-(double)d*(double)c+(double)a*(double)f)/det;
        //round
        x=x*1000.0f+0.5f; y=y*1000.0f+0.5f;
        x=floor(x); y=floor(y);
        x=x/1000.0f; y=y/1000.0f;
        //write
        fprintf(fout,"%.3f %.3f\n",x,y);
    }
    
    return 0;
}

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

using namespace std;

int main(){
  
  
  int a;
  string s;
  
  cin>>a;
  cin>>s;
  
  if(a>=3200)cout<<s<<endl;
  
  else{cout<<"red"<<endl;}
  
  
  
  
  
  
  
  
  
  
}

Measured memory_bytes: 256
k, n = gets.split.map(&:to_i)

houses = gets.split.map(&:to_i)

distance = []
houses[0..-2].each_with_index do |h, index|
  distance << houses[index + 1] - h
end

distance << k - houses[-1] + houses[0]

puts distance.inject(&:+) - distance.max


Measured memory_bytes: 17084
#pragma region
#include <assert.h>
#include <math.h>

#include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
#define pb push_back
#define f(i, a, b) for (int i = a; i < b; i++)
#define revf(i, b, a) for (int i = b; i >= a; i--)
#define all(v) v.begin(), v.end()
#define srt(v) sort(v.begin(), v.end())
#define revsrt(v) sort(v.rbegin(), v.rend())
#define sp << ' ' <<
#define en << '\n'
#define precision(x) cout << fixed << setprecision(x);

using namespace std;

template <typename T, typename U>
ostream &operator<<(ostream &os, pair<T, U> &v) {
  os << "{" << v.first << ", " << v.second << "}" en;
  return os;
}

template <typename T> ostream &operator<<(ostream &os, set<T> &v) {
  for (T t : v)
    os << t << " ";
  os en;
  return os;
}

template <typename T> ostream &operator<<(ostream &os, vector<T> &v) {
  for (T t : v)
    os << t << " ";
  os en;
  return os;
}

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

#define int long long
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef vector<vpii> vvpii;
#pragma endregion

int mod = 1e9 + 7; // 998244353;
const int MAX = 1e5 + 5;

void preprocessing() {}

void solvetestcase() {
  int n;
  cin >> n;
  vi dp(n + 1, 0);
  dp[0] = 1;
  f(i, 0, n + 1) {
    f(j, 3, n + 1) {
      if (j > i)
        continue;
      dp[i] += dp[i - j];
      dp[i] %= mod;
    }
  }
  cout << dp[n] en;
}

#undef int
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);

  preprocessing();

  int t = 1;
  // UNCOMMENT FOR TESTCASES	\
	cin >> t;

  f(T, 1, t + 1) {
    // UNCOMMENT FOR CODEJAM,HACKERCUP	\
		cout << "Case #" << T << ": ";
    solvetestcase();
    cout.flush();
  }

  return 0;
};

/*
    AUTHOR:     KUNAL TAWATIA
    EDUCATION:  INDIAN INSTITUTE OF TECHNOLOGY, JODHPUR
*/


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

int main(){
  int64_t n;
  cin >> n;
  int64_t div2 = 0;
  int64_t div5 = 0;
  int64_t cp = n;
  while(cp > 0){
    div2 += cp/2;
    cp = cp /2;
  }
  cp = n;
  while(cp > 0){
    div5 += cp/10;
    cp = cp *2 / 10;
  }
  //cout << div2 << div5 << endl;
  if(n%2==0){
    cout << min(div2,div5) << endl;
  }else{
    cout << 0 << endl;
  }

}
       


Measured memory_bytes: 256
using System;
using System.Linq;

class Program
{
    static void Main()
    {
        var a = Console.ReadLine().Split().Select(int.Parse).ToArray();
        if (a[0] == 1)
        {
            a[0] += 13;
        }
        if (a[1] == 1)
        {
            a[1] += 13;
        }
        if (a[0] > a[1])
        {
            Console.WriteLine("Alice");
        }
        else if (a[0] < a[1])
        {
            Console.WriteLine("Bob");
        }
        else
        {
            Console.WriteLine("Draw");
        }
    }
}

Measured memory_bytes: 13268
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<queue>
#include<deque>
#include<cmath>
#include<map>
#include<unordered_map>
#include<set>
#include<cstring>
#include<iomanip> //cout << fixed << setprecision(15) << x << endl;

using namespace std;
typedef long long ll;
const ll INF = 1e9 + 8;
const ll MOD = 1e9 + 7;
const ll LLINF = 1e18;
#define Pint pair<int, int>
#define rng(i, a, b) for(ll i = ll(a); i < ll(b); i++)
#define rnr(i, a, b) for(ll i = ll(a); i >= ll(b); i--)
#define rep(i, b) rng(i, 0, b)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
/* -- template -- */

int main() {
    int n, m; cin >> n >> m;
    int a[n][m]; rep(i, n) rep(j, m) cin >> a[i][j];
    bool use[m];
    rep(i, m) use[i] = true;
    int ans = n;//INFの気持ち
    rep(k, m) {
        map<int, int> cnt;
        rep(i, n) {
            rep(j, m) {
                if(use[a[i][j] - 1]) {
                    cnt[a[i][j]]++;
                    break;
                }
            }
        }
        int tmp = 0, x = 0;
        for(auto i : cnt) {
            tmp = max(tmp, i.second);
            if(tmp == i.second) x = i.first - 1;
        }
        ans = min(ans, tmp);
        use[x] = false;//一番大きいやつをけしましょか？
    }
    cout << ans << endl;
}


Measured memory_bytes: 3948
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define Y cout << "YES\n"
#define N cout << "NO\n"
#define REP(i, a, b) for (int i = a; i <= b; i++)
#define R(i,n) for(int i = 0 ; i < n ; i++)

int main()
{
    ll n , l , a[100010] , ans = 0 , max = 0 , b ;
    cin >> n >> l ;
    R(i,n)
    {
        cin >> a[i] ;
        if(i != 0)
        {
            if(max < (a[i] + a[i-1]))
            {
                max = (a[i] + a[i-1]) ;
                b = i ;
            }
        }
    }
    if(max < l)
    {
        cout << "Impossible\n" ;
    }
    else
    {
        cout << "Possible\n" ;
        for(int i = 1 ; i < b ; i++)
        {
            cout << i << endl ;
        }
        for(int i = n - 1 ; i > b ; i--)
        {
            cout << i << endl ;
        }
        cout << b << endl ;
    }
}

Measured memory_bytes: 1536
n = int(input())
ac = 0
tle = 0
re = 0
wa = 0
for i in range(n):
    s = input()
    if s == 'AC':
        ac += 1
    elif s == 'TLE':
        tle += 1
    elif s == 'WA':
        wa += 1
    else:
        re += 1
print('AC x', ac, '\nWA x', wa, '\nTLE x', tle, '\nRE x', re)


Measured memory_bytes: 70020
import java.util.Scanner;

class Main {

	private static final String LIGHT_FLY = "light fly";
	private static final String FLY = "fly";
	private static final String BANTAM = "bantam";
	private static final String FEATHER = "feather";
	private static final String LIGHT = "light";
	private static final String LIGHT_WELTER = "light welter";
	private static final String WELTER = "welter";
	private static final String LIGHT_MIDDLE = "light middle";
	private static final String MIDDLE = "middle";
	private static final String LIGHT_HEAVY = "light heavy";
	private static final String HEAVY = "heavy";

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			while (scanner.hasNextDouble()) {
				double weight = scanner.nextDouble();
				System.out.println(getWeightClass(weight));
			}
		}
	}

	private static String getWeightClass(double weight) {
		String weghitClass = null;

		if (weight <= 48.00) {
			weghitClass = LIGHT_FLY;
		} else if (weight <= 51.00) {
			weghitClass = FLY;
		} else if (weight <= 54.00) {
			weghitClass = BANTAM;
		} else if (weight <= 57.00) {
			weghitClass = FEATHER;
		} else if (weight <= 60.00) {
			weghitClass = LIGHT;
		} else if (weight <= 64.00) {
			weghitClass = LIGHT_WELTER;
		} else if (weight <= 69.00) {
			weghitClass = WELTER;
		} else if (weight <= 75.00) {
			weghitClass = LIGHT_MIDDLE;
		} else if (weight <= 81.00) {
			weghitClass = MIDDLE;
		} else if (weight <= 91.00) {
			weghitClass = LIGHT_HEAVY;
		} else {
			weghitClass = HEAVY;
		}
		return weghitClass;
	}
}

Measured memory_bytes: 27888
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define INF (1<<30)
#define LINF (lint)(1LL<<56)
#define endl "\n"
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define reprev(i,n) for(int (i)=(n-1);(i)>=0;(i)--)
#define Flag(x) (1<<(x))
#define Flagcount(x) __builtin_popcount(x)
#define pint pair<int,int>
#define pdouble pair<double,double>
#define plint pair<lint,lint>
#define fi first
#define se second
typedef long long lint;
constexpr lint MOD=1000000007;
int dx[8]={1,1,0,-1,-1,-1,0,1};
int dy[8]={0,1,1,1,0,-1,-1,-1};

long long powmod(lint a,lint b){
  return b?powmod(a*a%MOD,b/2)*(b%2?a:1)%MOD:1;
}
 
long long fac[510000],finv[510000],inv[510000];
void COMinit(){
  fac[0]=fac[1]=1;
  finv[0]=finv[1]=1;
  inv[1]=1;
  for(int i=2;i<510000;i++){
    fac[i]=fac[i-1]*i%MOD;
    inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
    finv[i]=finv[i-1]*inv[i]%MOD;
  }
}
long long COM(int n,int k){
  if (n<k) return 0;
  if (n<0 || k<0) return 0;
  return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
}
long long facdiv(lint n,lint k){
  if (n<k) return 0;
  if (n<0 || k<0) return 0;
  return (fac[n]*finv[k])%MOD;
}
 
int main(void){
    COMinit();
    lint N,K;
    cin >> N >> K;
    if(K==1){
        cout << (COM(N,2)*2)%MOD << endl;
    }
    else if(N-1<=K){
        cout << COM(N+N-1,N) << endl;
    }
    else{
        lint ans=0;
        for(int i=0;i<=K;i++){
            lint place=N-i;
            ans=(ans+COM(N-1,place-1)*COM(N,place))%MOD;
        }
        cout << ans << endl;
    }
}

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

inline void fastRead_int(int &x) {
    register int c = getchar_unlocked();
    x = 0;
    int neg = 0;

    for(; ((c<48 || c>57) && c != '-'); c = getchar_unlocked());

    if(c=='-') {
      neg = 1;
      c = getchar_unlocked();
    }

    for(; c>47 && c<58 ; c = getchar_unlocked()) {
      x = (x<<1) + (x<<3) + c - 48;
    }

    if(neg)
      x = -x;
}

int main(){

	int n, k;
	fastRead_int(n);fastRead_int(k);

	int arr[n], cost[n];
	for (int i = 0; i < n; ++i)	{
		fastRead_int(arr[i]);
		cost[i] = INT_MAX;
	}

	cost[n-1] = 0;

	for(int i = n-1; i >= 0; i--){
		for(int j = 1; j <= k; j++){
			if(i+j < n)cost[i] = min( abs(arr[i]- arr[i+j]) + cost[i+j], cost[i]);
			else break;
		}
	}
		
	printf("%d\n", cost[0]);
	
	return 0;
}

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

using namespace std;

#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define i_i pair<int, int>
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define vp vector< i_i >
#define all(a) (a).begin(), (a).end()
#define Int(x) int x; cin >> x;
#define int2(x, y) Int(x); Int(y);
#define int3(x, y, z) Int(x); int2(y, z);
#define fir first
#define sec second
#define ffir first.first
#define fsec first.second
#define sfir second.first
#define ssec second.second
#define Decimal fixed << setprecision(10)

//int dxy[5] = {0, 1, 0, -1, 0};
// BIT avl cusum dijkstra dinic geo2 gin graph kruskal lca lcm matrix ncm next_combination segtree st tmp topcoder uf vi 

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

    int2(n, m);

    vp kyoko(n);
    rep(i, n) {
        kyoko[i].fir = kyoko[i].sec = i; // min, max
    }

    vp yui(m);
    rep(i, m) {
        int2(a, b);
        yui[i] = {a, b};
    }
    sort(all(yui));

    rep(i, yui.size()) {
        int tmp = yui[i].sec;
        kyoko[tmp-1].fir = kyoko[tmp].fir = 
            min(kyoko[tmp-1].fir, kyoko[tmp].fir);
        kyoko[tmp-1].sec = kyoko[tmp].sec = 
            max(kyoko[tmp-1].sec, kyoko[tmp].sec);
    }

    cout << kyoko[0].sec - kyoko[0].fir + 1;
    Rep(i, n) {
        cout << " " << kyoko[i].sec - kyoko[i].fir + 1;
    }
    cout << endl;


    return 0;
}








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

int main()
{
  long long n;

  cin >> n;

  vector<int> l(n);

  long long flag = 0;

  rep(i, n)
  {
    cin >> l.at(i);
  }

  for (int i = 0; i < n; i++)
  {
    for (int j = i; j < n; j++)
    {
      for (int k = j; k < n; k++)
      {
        if ((l.at(i) != l.at(j) && l.at(j) != l.at(k)) && l.at(i) != l.at(k))
        {
          if ((l.at(i) + l.at(j)) > l.at(k) && (l.at(j) + l.at(k)) > l.at(i) && (l.at(i) + l.at(k)) > l.at(j))
          {
            flag++;
          }
        }
      }
    }
  }
  cout << flag;
}


Measured memory_bytes: 3632
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>

using ll = long long;

using namespace std;

int main() {
    int n;
    cin >> n;
    int l[n];
    for (auto &li:l) cin >> li;
    sort(l, l+n);
    int ans=0;
    for (int i=0; i<n; i++) {
        for (int j=0; j<i; j++) {
            int k = lower_bound(l, l+n, l[i]+l[j]) - l;
            ans += max(k - i - 1, 0);
            //cerr << i << ' ' << j << ' ' << k << '\n';
        }
    }
    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 256
package main

import (
	"fmt"
	"math"
)

func main() {
	var a, b int
	fmt.Scan(&a, &b)
	if a > b {
		a, b = b, a
	}
	num := gcd(a, b)
	countMap := make(map[int]int, 0)
	for num%2 == 0 {
		countMap[2]++
		num /= 2
	}
	if isPrime(num) {
		countMap[num]++
		num = 1
	}
	sqrtNum := int(math.Sqrt(float64(num)))
	//素因数分解
	for i := 3; i <= sqrtNum; i += 2 {
		//iが素数でないならば次へ
		if !isPrime(i) {
			continue
		} else {
			for num%i == 0 {
				countMap[i]++
				num /= i
				sqrtNum = int(math.Sqrt(float64(num)))
				if isPrime(num) {
					countMap[num]++
					num = 1
				}
			}
		}
	}
	countMap[1]++
	fmt.Println(len(countMap))
}

func gcd(i int, j int) int {
	var k int
	for j > 0 {
		k = i % j
		i = j
		j = k
	}
	return i
}

func isPrime(num int) bool {
	sqrtNum := int(math.Sqrt(float64(num)))
	for i := 3; i <= sqrtNum; i += 2 {
		if num%i == 0 {
			return false
		}
	}
	return true
}


Measured memory_bytes: 512
#include<stdio.h>
int main(void)
    {
    	int a,s,i,j,k,b;
    	scanf("%d",&a);
    	scanf("%d",&s);
    	b=0;
    	for(i=0;i<=a;i++){
    		for(j=0;j<=a;j++){
    			if(0<=s-i-j&&s-i-j<=a){ 
					b=b+1;
    	}
			}
		}
		
    	printf("%d\n",b);
    }

Measured memory_bytes: 128