akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/integer/common_factor.hpp>
#include <boost/integer/common_factor_rt.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>

using std::string;
using std::vector;
using std::set;
using std::multiset;
using std::unordered_set;
using std::map;
using std::multimap;
using std::unordered_map;
using std::pair;
using std::cin;
using std::cout;

typedef uintmax_t    ull;
typedef intmax_t     ll;
typedef uint64_t     ul;
typedef uint32_t     ui;
typedef uint8_t      uc;

typedef boost::multiprecision::number<boost::multiprecision::cpp_dec_float<1000>> cpp_dec_float_1000;

constexpr char CRLF  = '\n';
constexpr char SPACE = ' ';
constexpr char VECTOR_COUT_SEPARATOR = SPACE;
constexpr ll INF = 1000'000'007;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> std::ostream& operator<< (std::ostream& os, const std::vector<T>& vc) { for(auto it = vc.begin(); it != vc.end(); ++it) { if (std::next(it) == vc.end()) os << *it; else os << *it << VECTOR_COUT_SEPARATOR; } return os; }
template<class T1, class T2> inline std::ostream & operator<< (std::ostream & os, const std::pair<T1, T2> & p) { return os << p.first << ' ' << p.second; }

void solve(void)
{
  string str{}; cin >> str;
  int a, b, c, d;
  a = str[0] - 0x30;
  b = str[1] - 0x30;
  c = str[2] - 0x30;
  d = str[3] - 0x30;

  uc itr = 1 << 3;
  while (itr--)
  {
    int res = a;
    if(itr & 1 << 2)
      res += b;
    else
      res -= b;

    if(itr & 1 << 1)
      res += c;
    else
      res -= c;

    if(itr & 1 << 0)
      res += d;
    else
      res -= d;
    if(res == 7)
    {
      string ans = std::to_string(a);

      if(itr & 1 << 2)
        ans += "+";
      else
        ans += "-";
      ans += std::to_string(b);

      if(itr & 1 << 1)
        ans += "+";
      else
        ans += "-";
      ans += std::to_string(c);

      if(itr & 1 << 0)
        ans += "+";
      else
        ans += "-";
      ans += std::to_string(d);

      ans += "=7";
      cout << ans << CRLF;
      return;
    }
  }
  

  return;
}

int main(void)
{
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);

  solve();

  return 0;
}


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

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

//マクロ
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPD(i, n) for (ll i = (ll)(n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define FORD(i, a, b) for (ll i = (a); i >= (b); i--)
#define ALL(x) (x).begin(), (x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size())      //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000000 //10^12
#define MOD 10000007      //10^9+7
#define PB push_back
#define MP make_pair
#define F first
#define S second

int main(int argc, char const *argv[])
{
    ll a;
    float b;
    cin >> a >> b;
    ll ans = a * (int(b * 1000)/10) / 100;
    cout << ans << endl;
    // cout << a << "×" << b*100 << "=" << ans << endl;
    // cout << b*100 << int(b*10000)/100 << endl;
    // ans = ans / 100;
    // cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3720
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vin=vector<int>;
using vll=vector<long long>;
using vvin=vector<vector<int>>;
using vvll=vector<vector<long long>>;
using vstr=vector<string>;
using vvstr=vector<vector<string>>;
using vch=vector<char>;
using vvch=vector<vector<char>>;
using vbo=vector<bool>;
using vvbo=vector<vector<bool>>;
using vpii=vector<pair<int,int>>;
using pqsin=priority_queue<int,vector<int>,greater<int>>;
#define mp make_pair
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,s,n) for(int i=(s);i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define decp(n) cout<<fixed<<setprecision((int)n)
const ll inf=1e9+7;
const ll INF=1e18;

const int MAX=510000;

vll fac(MAX);
vll finv(MAX);
vll inv(MAX);

void combinit(ll m){
    fac[0]=1;fac[1]=1;
    finv[0]=1;finv[1]=1;
    inv[1]=1;
    rep2(i,2,MAX){
        fac[i]=fac[i-1]*i%m;
        inv[i]=m-inv[m%i]*(m/i)%m;
        finv[i]=finv[i-1]*inv[i]%m;
    }
}

ll combi(ll n,ll k,ll m=inf){
    if(n<k)return 0;
    if(n<0||k<0)return 0;
    return fac[n]*(finv[k]*finv[n-k]%m)%m;
}

int main(){
    combinit(inf);
    ll n,k;cin>>n>>k;
    k=min(k,n-(ll)1);
    ll ans=(ll)0;
    rep(i,k+1){
        ans+=combi(n,i)*combi(n-(ll)1,i);
        ans%=inf;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 14932
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
    int a,b;
    bool p=false;
    cin>>a>>b;
    for(int i=10;i<1201;i++){
        if(i*8/100==a&&i/10==b){
            cout<<i<<endl;
            p=true;
            break;
        }
    }
    if(!p){
        cout<<-1<<endl;
    }
}


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

int main(void) {
    int n; cin >> n;
    int *a = new int[n+1];
    int *b = new int[n+1];
    int *c = new int[n];

    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= n; i++) cin >> b[i];
    for (int i = 1; i < n; i++) cin >> c[i];

    int points = 0;
    for (int i = 1; i <= n; i++) {
        int t = a[i];
        points += b[t];
    }

    for (int i = 1; i < n; i++) {
        if (a[i+1] - a[i] == 1) points += c[a[i]];
    }

    cout << points << "\n";
}

Measured memory_bytes: 888
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
int main(void){
    ll n;cin>>n;
    ll a, b;
    for(ll i=1; i*i<=n;i++){
        if(n%i==0)a=i;
    }
    b=n/a;
    co(a+b-2);
}



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

#define MOD 1000000007

int c[1001];

void f(int n) {
	int cur=2;
	while(cur*cur<=n) {
		while(n%cur==0) {
			c[cur]++;
			n/=cur;
		}
		cur++;
	}
	if(n>1) c[n]++;
}

long long pw(long long n, long long x) {
	if(x==0) return 1;
	if(x%2) return pw(n,x-1)*n%MOD;
	else { long long ret=pw(n,x/2); return ret*ret%MOD; }
}

int main() {
	int n;
	scanf("%d",&n);
	for(int i=2;i<=n;i++) {
		f(i);
	}
	long long res=1;
	for(int i=2;i<=1000;i++) if(c[i]) {
		res=res*(c[i]+1)%MOD;
	}
	printf("%lld\n",res);
	return 0;
}


Measured memory_bytes: 128
#include <iostream>
using namespace std;
int main(void){
    int n,m,c,ans = 0 ,temp[20] = {};
    cin >> n >> m >> c;
    int b[m];
    for(int i = 0; i < m; i++){
        cin >> b[i];
    }
    int a[n][m];
    for(int i = 0; i < n; i++){
        for(int j = 0; j < m; j++){
            cin >> a[i][j];
        }
    }
    //i = 0;
    //while(i < n){
    for(int i = 0; i < n; i++){
        for(int j = 0; j < m; j++){
            temp[i] += a[i][j]*b[j];
        }
        temp[i] += c;
        if(temp[i] > 0){
            ans++;
        }
        //i++;
    }
    
    cout << ans << endl;
    // for(int i = 0; i < n; i++){
    //     for(int j = 0; j < m; j++){
    //         temp =+ a[i][j]*b[j];
    //     }
    // }
    
    
    // for(int i = 0; i < m; i++){
    //     cout << b[i] << ' ';
    // }
    // cout << endl;
    // for(int i = 0; i < n; i++){
    //     for(int j = 0; j < m; j++){
    //         cout << a[i][j] << ' ';
    //         if(j == 2){
    //             cout << endl;
    //             }
    //     }
    // }
}


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

int cum[100005];

int main( )
{
    int n, m, i, j, k, l, r, c = 0;

    cin >> n >> m;
    for (i = 1; i <= m; i++)
    {
        cin >> l >> r;
        cum[l]++;
        cum[r + 1]--;
    }

    for (i = 1; i <= n; i++)
    {
        cum[i] += cum[i - 1];
    }
    for (i = 1; i <= n; i++)
    {
        if (cum[i] == m)
        {
            c++;
        }
    }

    cout << c << "\n";

    return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h> 
    #include<ext/pb_ds/assoc_container.hpp> 
    #include<ext/pb_ds/tree_policy.hpp>
    using namespace __gnu_pbds;
    using namespace std;
    template <typename T>
    using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
    #define int long long  
    typedef long double ld;
    #define pb push_back
    #define f(i,a,b) for(int i=a;i<b;i++)
    #define fd(i,a,b) for(int i=a-1;i>=b;i--)
    #define pf push_front
    #define fi first
    #define se second
    #define INF 1e10
    const double pi=3.14159265358979323;
    const int mod=998244353;
  /*  int gcd(int a, int b) 
    { 
    if (b == 0) 
        return a; 
    return gcd(b, a % b);  
      
    } 
    void swap(int a,int b)
    {
      int temp=a;
      a=b;
      b=temp;
    } 
    int  binpow(int  a,int  b) 
    {
    int res = 1;
    while (b > 0) {
        if (b%2 == 1)
            res = (res * a)%mod;
        a = (a* a)% mod;
        b >>= 1;
    }
    return res;
}
    int modinv(int y)
    {
        return binpow(y,mod-2);
    }

    int fact[500000+5];
    void precal()
    {
    fact[0]=1;
    for(int i=1;i<500000+5;i++)
    {
        fact[i]=(i*fact[i-1])%mod;
    }
}*/
int pr[1000000+5]={};
int mm[1000000+5]={};
    signed main() {

 
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);  
    #ifndef ONLINE_JUDGE
      if(fopen("INPUT.txt","r"))
      {
      freopen ("INPUT.txt" , "r" , stdin);
      freopen ("OUTPUT.txt" , "w" , stdout); 
      }
    #endif  
    // -------------------------------------Code starts here--------------------------------------------------------------------- 
    int t=1; 
    //cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        int a[n+1];
        f(i,1,n+1)
        {
            cin>>a[i];
            mm[a[i]]++;
        }
        int cnt=0;
        f(i,1,1000000+1)
        {
            if(mm[i])
            for(int j=2*i;j<1000000+5;j+=i)
                pr[j]=1;
        }
        f(i,1,n+1)
        {

            if(mm[a[i]]<2 && pr[a[i]]==0)
                cnt++;
        }
        cout<<cnt<<endl;
    }
}


Measured memory_bytes: 20632
N, M, X = list(map(int, input().split()))
costs = []
As = []
for i in range(N):
    t = list(map(int, input().split()))
    costs.append(t[0])
    As.append(t[1:])
ans = -1
for i in range(2 ** N):
    tot = [0] * M
    cost = 0
    for j in range(N):
        if i >> j & 1:
            cost += costs[j]
            for k in range(M):
                tot[k] += As[j][k]
        flag = True
        for k in range(M):
            if tot[k] < X:
                flag = False
        if flag:
            if ans < 0:
                ans = cost
            else:
                ans = min(ans, cost)
print(ans)

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

int main() {
    int n;
    cin >> n;
    int point_tar = 0, point_han = 0;
    
    vector<string> taro(n, ""), hanako(n, "");
    for (int i = 0; i < n; i++) {
        cin >> taro[i] >> hanako [i];
        if (taro[i] == hanako[i]) {
            point_tar++; point_han++;
        } else if (taro[i] > hanako[i]) {
            point_tar += 3;
        } else {
            point_han += 3;
        }
    }
    
    cout << point_tar << " " << point_han << endl;
    
    return 0;
}


Measured memory_bytes: 3276
def bb
	n = gets.chomp.to_i
	h = gets.chomp.split(/\s/).map{|x| x.to_i}

    r = 1
    for i in 2..n
        c = h[i-1]
        chk = true
        h[0..i-2].each do |x|
            if c < x
                chk = false
                break
            end
        end

        r += 1 if chk
    end

    puts r
end

bb


Measured memory_bytes: 1916
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007


int main() {
  
  string S;
  cin >> S;

  S += "0";

  int ans = 0,pre = 1;
  for(int i = 0;i < S.size()-1;i++) {
    
    if(S.at(i) == S.at(i+1)) {
      if(pre == 1) {
        ans++;
        i++;
        pre = 2;
      }else {
        ans++;
        pre = 1;
      }
    }else {
      ans++;
      pre = 1;
    }

  }

  cout << ans << endl;
  
}

Measured memory_bytes: 640
#include <iostream>

#define rep(i,n) for(int i = 0; i < (n); i++)

using namespace std;

int main() {
    int x,y;
    cin>>x>>y;
    bool turukame=false;
    rep(i,x+1){
        if((2*i+4*(x-i))==y){
            turukame=true;
            break;
        }
    }
    if(turukame)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;

    return 0;
}

Measured memory_bytes: 3632
N,L = map(int, raw_input().split())

t_all = 0
t_bite = 0

for i in range(N):
    t_all += (L+i)
#print t_all

for i in range(N):
    t_tmp = 0
    for j in range(N):
        if i == j:
            continue
        else:
            t_tmp += (L+j)
#    print t_tmp,i
    if abs(t_all - t_bite) > abs(t_all - t_tmp):
        t_bite = t_tmp

print t_bite


Measured memory_bytes: 2568
#include <bits/stdc++.h>
 
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<ll, ll> pii;
 
#define REP(a,b,c) for(ll (a)=(b);(a)<(c);(a)++)
#define PER(a,b,c) for(ll (a)=(b);(a)>=(c);(a)--)

int main(){
    ll N, M;
    vector<ll> A;
    ll AMAX=(ll)1E5;
    vector<ll> S(AMAX+10,0);

    cin >> N >> M;
    REP(i,0,N){
        ll a;
        cin >> a;
        A.push_back(a);
        S[A[i]]++;
    }
    sort(A.begin(), A.end());

    PER(i,AMAX,0){
        S[i]+=S[i+1];
    }

    ll l=0,r=AMAX*2+10;
    ll t=0;
    while(r-l>1){
        ll m=(l+r)/2;
        ll num = 0;
        REP(i,0,N){
            ll target=max(min(m-A[i],AMAX+1),(ll)0);
            num += S[target];
        }
        if(num >= M){
            l = m;
            t = num;
        }else{
            r = m;
        }
    }

    ll ret=0;
    REP(i,0,N){
        ll target=max(min(l-A[i],AMAX+1),(ll)0);
        ret += A[i] * S[target] * 2;
    }
    cout << ret - (t - M) * l << endl;
    
    return 0;
}

Measured memory_bytes: 2296
#include <algorithm>
#include <bitset>
#include <cctype>
#include <chrono>
#include <cmath>
#include <cstdio>
#include <ctime>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <string>
#include <tuple>
#include <unordered_map>
#include <vector>
using namespace std;

#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
/*----------------------------------------*/

int main() {
  cin.tie(0); ios::sync_with_stdio(false);
  // freopen("input.txt", "r", stdin);

  string s; cin >> s;
  int sz = s.size();
  bool isok = false;
  REP(i, sz) FOR(j, i, sz) {
    string ss = s.substr(0, i);
    ss += s.substr(j, sz-j);
    if (ss == "keyence") isok = true;
  }
  cout << (isok? "YES" : "NO") << '\n';
  return 0;
}


Measured memory_bytes: 256
import math
N,A,B = map(int,input().split())
H = [int(input()) for i in range(N)]
Hs = sum(H)
c = A - B
M = math.ceil(Hs / B)

m = 0

while M - m > 1:
	n = (M + m) // 2
	H2 = [H[i] - n * B for i in range(N) if H[i] - n * B > 0]
	cnts = [math.ceil(H2[i] / c) for i in range(len(H2))]
	cnt = sum(cnts)
	if cnt > n:
		m = n
	elif cnt == n:
		M = n
		break
	else:
		M = n
print(M)

Measured memory_bytes: 19260
#include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
using namespace std;
const long long int INF = 1e18;
const long long int mod = 1e9+7;

typedef pair<ll, ll> pairs;
typedef vector<pairs> p;

struct Edge{
    ll to, weight;
    Edge(ll t, ll w) : to(t), weight(w){}
};
using graph = vector<vector<ll>>;
using Graph = vector<vector<Edge>>;


ll gcd(ll a,ll b){
    if(b == 0){
        return a;
    }else{
        return gcd(b, a%b);
    }
}

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

ll keta(ll N){
    int tmp{};
    while( N > 0 ){
        tmp += ( N % 10 );
        N /= 10;
    }
    N = tmp;
    return N;
}

// 回文
bool kai(string S){
    bool flag = true;
    for(ll i=0;i<S.size()/2;++i){
        if(S[i] != S[S.size()-i-1]){
            flag = false;
            break;
        }
    }
    return flag;
}
// ---------------------------------------------

int main(){
    ll n, k;
    cin>>n>>k;
    vector<ll> a(n);
    vector<ll> b(200000, 0);
    for(ll i=0;i<n;++i){
        cin>>a[i];
        b[a[i]]++;
    }

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

    ll kinds = 0;
    for(ll i=0;i<b.size();++i){
        if(b[b.size()-i-1] == 0){
            break;
        }else{
            kinds++;
        }
    }
    //cout<<kinds<<endl;
    if(kinds <= k){
        cout<<0<<endl;
        return 0;
    }

    ll ans = 0;
    ll flag = k;
    for(ll i=0;i<b.size();++i){
        if(b[i] == 0)continue;
        ans += b[i];
        flag++;
        if(flag == kinds)break;
    }
    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 3328
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <numeric>
#include <queue>
#include <map> 
#include <set>
#include <string>
#include <functional>
#include <list>
#include <random>
#include <time.h>
#include <iomanip>
#include <assert.h>
#include <numeric>
#define int long long
#define double long double
#define mod 1000000007
#define MAXN (int)1e+5 * 2+1
#define LL_MAX 9223372036854775807	//ない環境用
#define LL_HALFMAX 9223372036854775807 / 2	//ない環境用

using namespace std;
std::mt19937 mt((int)time(0));

int dx[4] = { 0, 1, 0, -1 }; // x軸方向への変位
int dy[4] = { 1, 0, -1, 0 }; // y軸方向への変位



int x[100001], y[100001];
int a[200001];
int bo[100][100];
map<int, vector<int>> ma;

int grundyNumber(int l,int r) {
	if ((l == 0 && r == 0) ||
		(l == 1 && r == 0) ||
		(l == 0 && r == 1) ||
		(l == 1 && r == 1))
	{
		bo[l][r] = 0;
		return 0;
	}
	if (bo[l][r] != -1) return bo[l][r];
	set<int> s;
	for (int i = 1; i <= l / 2; i++) {
		s.insert(grundyNumber(l - 2 * i, r + i));
	}
	for (int i = 1; i <= r / 2; i++) {
		s.insert(grundyNumber(l + i, r - 2 * i));
	}
	int res = 0;
	while (s.find(res) != s.end()) res++;
	bo[l][r] = bo[r][l] = res;
	return res;
}

signed main() {
	int X, Y;
	cin >> X >> Y;
	//if (X > 100 || Y > 100) return 1;
	/*
	for (int i = 0; i < 100; i++) {
		for (int j = 0; j < 100; j++) {
			bo[i][j] = -1;
		}
	}
	for (int i = 0; i < 100; i++) {
		for (int j = 0; j < 100; j++) {
			grundyNumber(i, j);
		}
	}*/
	if (abs(X - Y) <= 1) cout << "Brown\n";
	else cout << "Alice\n";
	

	return 0;
}

Measured memory_bytes: 256
// B - ss

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// const int INF = 2147483647;
// const ll INF = 9223372036854775807;
// const ll MOD = 1e9 + 7;

bool is_even_string(string S) {
	if (S.size() % 2 != 0) return false;

	bool result = true;
	for (int i=0; i < S.size() / 2; i++) {
		if (S[i] != S[i + (S.size() / 2)]) result = false;
	}

	return result;
}

int main() {
	string S;
	cin >> S;

	int ans;
	while(1) {
		S.pop_back();
		if (is_even_string(S)) {
			ans = S.size();
			break;
		}
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 384
import sys

n = int(input())
minv = int(input())
maxv = -1000000000

for r in map(int,sys.stdin.readlines()):
  m = r-minv
  if maxv < m < 0:
    maxv = m
    minv = r
  elif maxv < m:
    maxv = m
  elif m < 0:
    minv = r

print(maxv)

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

#define pb push_back
#define ppp pop_back
#define pii pair<int,int>
#define fi first
#define se second

const int N = 1e5 + 5;

pii a[N];

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
#endif
	int n;
	cin >> n;
	for (int i=1; i<=n; i++) {
		int x, l;
		cin >> x >> l;
		a[i] = {x + l, x - l};
	}
	sort(a+1, a+n+1);
	for (int i=1; i<=n; i++) swap(a[i].fi, a[i].se);
	int ans = 0;
	int last = -1e9;
	for (int i=1; i<=n; i++) {
		if (a[i].fi >= last) {
			ans++;
			last = a[i].se;
		}
	}
	cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 1024
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		int N = sc.nextInt();
		double[] A = new double[N];
		for (int i = 0; i < N; ++i) {
			A[i] = sc.nextDouble();
		}
		final int MAX = 300001;
		double[][] dp = new double[2][MAX];
		for (int i = 1; i < MAX; ++i) {
			dp[0][i] = Math.abs(A[0] - i) / A[0];
		}
		for (int i = 1; i < N; ++i) {
			int t = i & 1;
			Arrays.fill(dp[t], 1e9);
			for (int j = 1; j < MAX; ++j) {
				for (int k = j; k < MAX; k += j) {
					dp[t][k] = Math.min(dp[t][k], Math.max(dp[1 - t][j], Math.abs(A[i] - k) / A[i]));
				}
			}
		}
		double ans = 1e9;
		for (int i = 1; i < MAX; ++i) {
			ans = Math.min(ans, dp[1 - N & 1][i]);
		}
		System.out.printf("%.9f\n", ans);
	}
}

Measured memory_bytes: 28044
#include<iostream>
#include<algorithm>

using namespace std;

int main(){
  int i, j, data[28];

  for(i=0; i<28; ++i)
    cin >> data[i];

  sort(data, data+28);

  for(i=1, j=0; i<=30; ++i, ++j){
    if(data[j] != i){
      cout << i << endl;
      --j;
    }
  }

  return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <algorithm>
using namespace std;
struct Node{
	int number, a;
} node[100005];

int cmp(Node a, Node b)
{
	return a.a < b.a;
}
int main()
{
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		cin >> node[i].a;
		node[i].number = i; 
	}
	sort(node + 1, node + n + 1, cmp);
	for (int i = 1; i <= n; i++)
	{
		if (i != n)
		{
			cout << node[i].number << " ";
		}
		else
		{
			cout << node[i].number << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 1536
#include <iostream>
using namespace std;
int n, a[200020];

int main() {
  cin.tie(0); ios_base::sync_with_stdio(false);
  cin >> n;
  for(int i = 0; i < n; ++i) cin >> a[i];
  for(int i = 0; i < n; ++i) {
    if(a[i] > i || (i < n-1 && a[i+1] - a[i] > 1)) {
      cout << -1 << endl;
      return 0;
    }
  }

  long ans = 0;
  for(int i = n-1; i >= 0; --i) {
    ans += a[i];
    while(i > 0 && a[i]-1 == a[i-1]) --i;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 1024
use v5.18;
use warnings;
sub read_line { chomp(my $s = <>); $s }
sub splited_read_line { split / /, read_line }

my $score = read_line;
say do {
  if ($score >= 2800) {
    'AGC'
  } elsif ($score >= 1200) {
    'ARC'
  } else {
    'ABC'
  }
};


Measured memory_bytes: 640
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#define lol(i,n) for(int i=0;i<n;i++)
#define mod 1000000007
typedef long long ll;

using namespace std;
#define N 99
#define M 49
ll a,b;
int main(){
    cin>>a>>b;
    cout<<M*2<<" "<<N<<endl;
    lol(i,M){
	lol(j,N){
	    if(i%2==0&&j%2==0&&a>1){
		cout<<".";
		a--;
	    }
	    else cout<<"#";
	}
	cout<<endl;
    }
    lol(i,M){
	lol(j,N){
	    if(i%2==1&&j%2==0&&b>1){
		cout<<"#";
		b--;
	    }
	    else cout<<".";
	}
	cout<<endl;
    }
    return 0;
}






Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<stack>
#include<queue>
#include<string>
#include<utility>
#include<numeric>
#include<algorithm>
#include<cmath>
#include<climits>
using namespace std;

using ll = long long;

class Stream{
public:
    Stream(){

    }
    //配列以外の入力を受け取る
    void read(){

    }
    template<typename First, typename... Rest>
    void read(First& first, Rest&... rest){
        cin >> first;
        read(rest...);
    }
    //配列を区切って出力する
    template<typename T>
    void write_vec(vector<T>& v, char divider){
        for(size_t i = 0; i < v.size(); i++){
            cout << v[i] << divider;
        }
    }
};

int main(){
    Stream io;
    
    int r, g, b;
    io.read(r, g, b);
    int s = r * 100 + g * 10 + b;
    string ans = "NO";
    if(s % 4 == 0){
        ans = "YES";
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#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, n, m) for (int i = m; i < n; i++)
#define INF 1e9
#define ALL(v) v.begin(), v.end()

typedef long long ll;
/**
 * C問以降は ll を使う.
 * double型にするのを忘れない.
 * nC2の求め方 (1/2)*n*(n-1)
 * vector<型> 変数名(要素数, 初期値)
 */
int main()
{
    int N;
    cin >> N;
    vector<int> A(N, 0);
    vector<int> B(N, 0);
    vector<int> C(N - 1, 0);
    REP(i, N) {
        int a;
        cin >> a;
        A.at(i) = a;
    }
    REP(i, N) {
        int b;
        cin >> b;
        B.at(i) = b;
    }
    REP(i, N-1) {
        int c;
        cin >> c;
        C.at(i) = c;
    }
    int total = 0;
    int prev = 0;
    REP(i, N)
    {
        total += B.at(A.at(i)-1);
        // cout << total << endl;
        if(prev == A.at(i)-1 && i != 0) {
            // cout << "prev  ";
            total += C.at(prev-1);
            // cout << total << endl;
        } 
        prev = A.at(i);
    }
    cout << total << endl;
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <vector>
#include <algorithm>
#include "memory.h"
#include <string>
#include <set>

using namespace std;

int n, m;
int X[100001], Y[100001];

vector<vector<int> > A;

int main() {
	scanf("%d%d", &n, &m);
	for(int i = 0; i < m; i++) { scanf("%d%d", &X[i], &Y[i]); X[i]--; Y[i]--; }
	for(int i = 0; i < n; i++) {
		vector<int> B(n, false);
		B[i] = true;
		for(int j = m-1; j >= 0; j--) {
			if (B[X[j]] && B[Y[j]]) {
				for(int k = 0; k < n; k++) B[k] = true;
				break;
			}
			if (B[X[j]]) B[Y[j]] = true;
			if (B[Y[j]]) B[X[j]] = true;
		}
//		printf("%d :   ", i); for(int j = 0; j < n; j++) printf("%d ", B[j]); printf("\n");
		A.push_back(B);
	}
	int ans = 0;
	for(int i = 0; i < n; i++) {
		for(int j = i+1; j < n; j++) {
			bool f = true;
			for (int k = 0; k < n; k++) if (A[i][k] && A[j][k]) { f = false; break; }
			if (f) { 
				//printf("%d %d\n", i, j); 
				ans++;
			}
		}
	}
	printf("%d\n", ans);
    return 0;
}

Measured memory_bytes: 1664
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <climits>
#include <iomanip>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
struct edge{
    ll p;//点
    ll w;//辺の重み*-1
};
vector<vector<edge> > graph(100000);
vector<ll> res(100000);
ll v,e,r;//vは頂点,eは辺,rは始点
void dijkstra(){
  for(int i = 0;i < v;i++)res[i] = pow(10,18);
    res[r] = 0;
    priority_queue<pair<ll,ll> > que;//重み、頂点
    que.push(make_pair(0,r));
    while(!que.empty()){
        edge now;
        now.p = que.top().second;
        now.w = que.top().first * -1;
        que.pop();
        if(res[now.p] < now.w)continue;
        for(int i = 0;i < graph[now.p].size();i++){
            if(res[graph[now.p][i].p] > now.w + graph[now.p][i].w){
                res[graph[now.p][i].p] = now.w + graph[now.p][i].w;
                que.push(make_pair(res[graph[now.p][i].p] * -1,graph[now.p][i].p));
            }
        }
    }
}
int main(){
   ll kazu = 0;
   cin >> v >> e >> kazu;
   vector<ll> travel(kazu);
   for(int i = 0;i < kazu;i++){
     cin >> travel[i];
     travel[i]--;
   }
   sort(travel.begin(),travel.end());
    for(int i = 0;i < e;i++){
        ll a,b,c;
        cin >> a >> b >> c;//マイナスするか?気をつける
        a--,b--;
        edge memoa = {b,c};
        edge memob = {a,c};
        graph[a].push_back(memoa);
        graph[b].push_back(memob);//無向グラフのときはこれを追加
    }
  vector<vector<ll>> dis(v,vector<ll>(v));
  for(int i = 0;i < v;i++){
    r = i;
    dijkstra();
    for(int j = 0;j < v;j++)dis[i][j] = res[j];
  }
  //cout << dis[1][3] << " " << dis[3][2] << endl;
  ll resmin = 0;
  resmin = pow(10,18);
  //cout << "a" << endl;
  do{
    ll now = 0;
    for(int i = 0;i < kazu - 1;i++){
      now += dis[travel[i]][travel[i + 1]];
    }
    resmin = min(now,resmin);
    //if(now == 4)for(auto item:travel)cout << item << " ";
    //cout << endl;
    //if(travel[0] == 1 && travel[1] == 3 && travel[2] == 2)cout << now << endl;
    //cout << 1 << endl;
  }while(next_permutation(travel.begin(),travel.end()));
  cout << resmin << endl;
}

Measured memory_bytes: 4608
#include<bits/stdc++.h>
using namespace std;
#define pi 3.14159
#define ll long long int 
int main()
{
	ll n;
	cin>>n;
	map<ll,ll>m;
	m[1]=0;
	for(ll i=2;i<n+1;i++)
	{
		ll x;
		cin>>x;
		m[x]++;
	}
	for(ll i=1;i<=n;i++)
	{
		cout<<m[i]<<endl;
	}
	
}

Measured memory_bytes: 16128
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<cmath>
#include<cstring>
#include<climits>
#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
#define LL long long
//#define getchar() (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2) ? EOF : *p1++)
//char buf[(1 << 21) + 1], *p1 = buf, *p2 = buf;
inline int read() {
	bool f=0;int x=0;char c=getchar();
	while(c<'0'||'9'<c){if(c==EOF)exit(0);if(c=='-')f=1;c=getchar();}
	while('0'<=c&&c<='9') x=(x<<3)+(x<<1)+(c^48),c=getchar();
	return !f?x:-x;
}
#define MAXN 2000000
#define INF 0x3f3f3f3f
#define Mod (int)(1e9+7)
LL fac[MAXN+5],inv[MAXN+5];
LL Pow(LL x,LL y){
	LL ret=1;
	while(y){
		if(y&1) ret=ret*x%Mod;
		x=x*x%Mod,y>>=1;
	}
	return ret;
}
void Prepare(){
	fac[0]=1;
	for(int i=1;i<=MAXN;i++)
		fac[i]=fac[i-1]*i%Mod;
	inv[MAXN]=Pow(fac[MAXN],Mod-2);
	for(int i=MAXN-1;i>=0;i--)
		inv[i]=inv[i+1]*(i+1)%Mod;
	return ;
}
vector<LL> Ball[MAXN+5];
struct node{
	LL c,w;
	friend bool operator < (node a,node b){return a.w<b.w;}
}ball[MAXN+5];
LL Max[MAXN+5];
bool vis[MAXN+5];
int main(){
	Prepare();
	LL n=read(),x=read(),y=read();
	for(int i=1;i<=n;i++){
		int c=read(),w=read();
		ball[i]=(node){c,w};
		Ball[c].push_back(w);
	}
	sort(ball+1,ball+n+1);
	vis[ball[1].c]=1;
	int t=1;
	while(t<=n&&ball[1].c==ball[t].c) t++;
	for(int i=2;i<=n;i++)//
		if(ball[1].c!=ball[i].c&&ball[1].w+ball[i].w<=y)//!!!!!!
			vis[ball[i].c]=1,Max[ball[i].c]++;
	for(int i=1;i<=n&&t<=n&&t!=1;i++)
		if(ball[i].c==ball[1].c&&ball[t].w+ball[i].w<=y)
			Max[ball[i].c]++;
	for(int i=1;i<=n;i++){
		sort(Ball[i].begin(),Ball[i].end());
		if(Ball[i].size())//
			Max[i]=max(Max[i],1ll);
		for(int j=1;j<(int)Ball[i].size();j++)
			if(Ball[i][0]+Ball[i][j]<=x)
				Max[i]=max(Max[i],1ll*j+1);
	}//
	LL ans=1;
	int cnt=0;
	for(int i=1;i<=n;i++)
		if(vis[i])
			cnt+=Max[i];
	ans=fac[cnt];
	for(int i=1;i<=n;i++)
		if(vis[i])
			ans=ans*inv[Max[i]]%Mod;
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 93184
#define swap(type, x, y) do { type t = x; x = y; y = t; } while (0)

/*--- クイックソート ---*/
void quick(long long int a[],long long int left,long long int right)
{
    long long int pl = left;                /* 左カーソル */
    long long int pr = right;                /* 右カーソル */
    long long int x = a[(pl + pr) / 2];    /* 枢軸は中央の要素 */

    do {
        while (a[pl] < x) pl++;
        while (a[pr] > x) pr--;
        if (pl <= pr) {
            swap(long long int, a[pl], a[pr]);
            pl++;
            pr--;
        }
    } while (pl <= pr);

    if (left < pr)  quick(a, left, pr);
    if (pl < right) quick(a, pl, right);
}

#include <stdio.h>
#include <string.h>
int main(void)
{
    long long int N,K,i,j,temp;
	long long int H[1000001];
	long long int ans=0;

	scanf("%lld %lld",&N,&K);
	for(i=0;i<N;i++){
		scanf("%lld",&H[i]);
	}
	quick(H,0,N-1);
	if(K>=N){
		printf("0\n");
	}
	else{
		for(i=0;i<N-K;i++){
            ans=ans+H[i];
            
        }
        printf("%lld",ans);
	}
	return 0;
    }


Measured memory_bytes: 3712
#line 2 "../../library/template.hpp"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pl = pair<ll, ll>;
using vl = vector<ll>;
#define rep(i, n) for(ll i = 0; i < (ll)n; i++)
#define rep3(i, l, r) for(ll i = l; i < (ll)r; i++)
#define per(i, n) for(ll i = (ll)n-1; i >= 0; i--)
#define per3(i, l, r) for(ll i = (ll)r-1; i >= (ll)l; i--)
#define all(v) begin(v), end(v)
template<class T, class U> inline void cmax(T &a, U b) { if (a < b) a = b; }
template<class T, class U> inline void cmin(T &a, U b) { if (a > b) a = b; }
constexpr char el = '\n';
template<class T, class U> ostream &operator<<(ostream &os, const pair<T, U> &p) { os << p.first << " " << p.second; return os; }
template<class T, class U> istream &operator>>(istream &is, pair<T, U> &p) { is >> p.first >> p.second; return is; }
template<class T> ostream &operator<<(ostream &os, const vector<T> &v) { rep(i, v.size()) os << v[i] << (i+1 != v.size() ? " " : ""); return os; }
template<class T> istream &operator>>(istream &is, vector<T> &v) { for(T &i : v) is >> i; return is; }
struct IoSetup {
  IoSetup() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); cerr << fixed << setprecision(15); }
} io_setup;
#line 2 "c.cpp"

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

  vl ans(n);
  
  rep3(i, 1, n+1) {
    if (i*i+1*1+1*1+i*1+1*1*1*i > n) break;
    rep3(j, i, n+1) {
      if (i*i+j*j+1*1+i*j+j*1*1*i > n) break;
      rep3(k, j, n+1) {
        ll sum = i*i+j*j+k*k+i*j+j*k+k*i;
        if (sum > n) break;
        if (sum <= n) {
          if (i == k) {
            ans[sum-1]++;
          } else if (i == j or j == k) {
            ans[sum-1] += 3;
          } else {
            ans[sum-1] += 6;
          }
        }
      }
    }
  }

  for (auto&& i : ans) {
    cout << i << el;
  }
}


Measured memory_bytes: 3688
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i,n) for(int i = 0; i < (n); ++i)
int main() {
    string s;
    cin >> s;
    int ans = 700;
    rep(i, 3) if ( s[i] == 'o' ) ans += 100; 
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#ifdef __LOCAL
    #define DBG(X) cout << #X << " = " << (X) << endl;
    #define SAY(X) cout << (X) << endl;
#else
    #define DBG(X)
    #define SAY(X)
#endif

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

using namespace std;

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

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

int A,B,C,X,Y;

void input(){
    fast_io();
    #ifdef __LOCAL
        fs::path p = __FILE__;
        fs::path input,output;
        input = output = p.parent_path();
        input += string("/input/") + string(p.stem()) + string(".txt");
        output += string("/output/") + string(p.stem()) + string(".txt");
        freopen(input.c_str(), "r", stdin);
        freopen(output.c_str(), "w", stdout);
    #endif
    cin >> A >> B >> C >> X >> Y;
}

int solve(){
    ll ans=0;
    if(A+B<=2*C){
        ans += A*X+B*Y;
    }
    else{
        int z=min(X,Y);
        ans += z*2*C;
        if(X<Y){
            ans+=min((Y-z)*B,(Y-z)*2*C);
        }
        else{
            ans+=min((X-z)*A,(X-z)*2*C);
        }
    }
    cout << ans << endl;
    return 0;
}   

int main()
{
    input();
    solve();
    return 0;
}


Measured memory_bytes: 256
X = input().strip()
Y = input().strip()

res = float("inf")
for i in range(len(X)-len(Y)+1):
    cnt =0
    for j in range(len(Y)):
        if X[i+j]!=Y[j]:cnt+=1
    res = min(res,cnt)
print(res if res!=float("inf") else 0)


Measured memory_bytes: 9116
#include<bits/stdc++.h>
using namespace std;
#define sz(x) (int)x.size()
#define pb push_back
#define mp make_pair
#define ll long long 
#define mod 1000000007
void setIO(string name) {
  ios_base::sync_with_stdio(0); cin.tie(0);
  freopen((name+".in").c_str(),"r",stdin);
  freopen((name+".out").c_str(),"w",stdout);
}
void fast(){
  ios_base::sync_with_stdio(false);cin.tie(NULL);
}


int main() {
   fast(); 
   int n;
   cin>>n;
   long long a[n];
   for(int i=0;i<n;i++){
    cin>>a[i];
   }
   long long sum=0;
   long long max1=a[0];
   for(int i=1;i<n;i++){
    if(a[i]>max1){
        max1=a[i];
    }else{
        sum+=max1-a[i];
    }
   }
   cout<<sum<<"\n";

} 

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

using db = double;
using ll = long long;
using vi = vector <int>;
#define op operator
#define pb push_back

ll sqr(ll x) { return x * x; }
struct poi {
	ll x, y;
	void w() { cout << x << ' ' << y << '\n'; }
	poi op -(poi p) {
		return {x - p.x, y - p.y};
	}
	ll dot(poi p) {
		return x * p.x + y * p.y;
	}
	ll len2() {
		return dot(*this);
	}
};

int cmp(ll a, ll b, ll c, ll d) {
	if(a >= 0 && c < 0) return 1;
	if(a < 0 && c >= 0) return -1;
	ll x = a * a * d, y = c * c * b;
	if(a >= 0)
		return (x > y) - (x < y);
	return -((x > y) - (x < y));
}

int main() {
	cout << fixed << setprecision(1);
	ios :: sync_with_stdio(0);

	for(int n; cin >> n && n; ) {
		vector <poi> v;
		while(n --) {
			int x, y; cin >> x >> y;
			v.pb({x, y});
		}
		poi p = {0, 0};
		poi d = {0, 1};
		db ans = 0;
		while(v.size()) {
			int id = 0;
			/*
			cout << "------\n";
			for(int i = 0; i < v.size(); i ++) {
				cout << d.dot(v[i] - p) << ' ' << (v[i] - p).len2() << '\n';
			}
			*/
			for(int i = 1; i < v.size(); i ++) {
				ll a = d.dot(v[i] - p);
				ll b = (v[i] - p).len2();
				ll c = d.dot(v[id] - p);
				ll d = (v[id] - p).len2();
				if(cmp(a, b, c, d) > 0)
					id = i;
				else if(cmp(a, b, c, d) == 0 && b < d)
					id = i;
			}
			d = v[id] - p;
			ans += sqrt(d.len2());
			p = v[id];
			//p.w();
			v.erase(v.begin() + id);
		}
		cout << ans << '\n';
	}

	return 0;
}

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

int main(){
    int N;
    cin >> N;
    vector<int> a(N+1,0);
    rep(i, N){
        cin >> a[i];
    }
    int s = 0;
    int ans = 0;
    rep(i, N){
        if(a[i] == a[i+1]){
            s++;
        }else{
            ans += (s+1)/2;
            s = 0;
        }
    }
    cout << ans << endl;
return 0;}

Measured memory_bytes: 256
import java.util.*;
import java.util.Arrays;
 
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    long [] arr = new long[N];
    for (int i = 0; i < N; i++) {
        arr[i] = sc.nextLong();
    }
    Arrays.sort(arr);
    long total = 0;
    for (int j = 0; j < N - K; j++) {
        total += arr[j];
    }
    System.out.println(total);
  }
}



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

using namespace std;

int main(int argc, char const *argv[]) {
	int n;
	std::cin >> n;
	map<int,int> mp;
	for (size_t i = 0; i < n; i++) {
		int temp;
		std::cin >> temp;
		auto itr = mp.find(temp);
		// このキーが存在しない
		if (itr == mp.end()) {
			mp.insert((make_pair(temp,1)));
		}
		// 存在する
		else {
			mp[temp]++;
		}
	}

	int count = 0;
	for (auto itr = mp.begin(); itr != mp.end(); itr++) {
		if (itr->second % 2 != 0) {
			count++;
		}
	}
	std::cout << count << '\n';
	return 0;
}


Measured memory_bytes: 4864
# coding=utf-8
from pprint import pprint
n = int(input())
red = []
blue = []

for _ in range(n):
    line = input().split(" ")
    red.append((int(line[0]), int(line[1])))

for _ in range(n):
    line = input().split(" ")
    blue.append((int(line[0]), int(line[1])))

g = []
for _ in range(2*n):
    g.append([])
match = [-1 for _ in range(2*n)]
used = [False for _ in range(2*n)]

def add_edge(v, u):
    g[u].append(v)
    g[v].append(u)

for (ri,r) in enumerate(red):
    for (bi,b) in enumerate(blue):
        if r[0]<b[0] and r[1]<b[1]:
            add_edge(ri, n+bi)

def dfs(v):
    used[v] = True
    for u in g[v]:
        w = match[u]
        if w<0 or not used[w] and dfs(w):
            match[v] = u
            match[u] = v
            return True
    return False

cnt = 0
for v in range(n):
    if match[v]<0:
        used = [False for _ in range(2*n)]
        if dfs(v):
            cnt += 1
print(cnt)


Measured memory_bytes: 3700
#include <bits/stdc++.h>
using namespace std;
int main(){
	long long int x,k,d;
  	cin>>x>>k>>d;
  	if(x>=0){
      long long int y=x/d;
      if(y>=k)
        cout<<x-k*d<<endl;
      else if((y-k)%2==0)
        cout<<x%d<<endl;
      else
        cout<<d-x%d<<endl;
    }
  else{
    long long int y=(-x)/d;    
      if(y>=k)
        cout<<-x-k*d<<endl;
      else if((y-k)%2==0)
        cout<<(-x)%d<<endl;
      else
        cout<<d-(-x)%d<<endl;
  }
    
 	
}

Measured memory_bytes: 3632
package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextLine() string {
	scanner.Scan()
	return scanner.Text()
}

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

func scanNums(len int) (nums []int) {
	var num int
	for i := 0; i < len; i++ {
		num = nextInt()
		nums = append(nums, num)
	}
	return
}

func min(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton min() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Min(float64(res), float64(nums[i])))
	}
	return res
}

func max(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton max() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Max(float64(res), float64(nums[i])))
	}
	return res
}

func sumSlice(nums []int) int {
	sum := 0
	for _, n := range nums {
		sum += n
	}
	return sum
}

func binarySearch(target int, list []int) int {
	left := 0
	right := len(list) - 1
	mid := (left + right) / 2

	for {
		if list[mid] < target {
			left = mid + 1
		} else {
			right = mid
		}
		mid = (left + right) / 2
		if left >= right {
			break
		}
	}
	return mid
}

func main() {
	scanner.Split(bufio.ScanWords) // switch to separating by space
	// scanner.Buffer([]byte{}, 1000000009) // switch to read large size input

	N := nextInt()

	s := ""
	length := 0
	mod := 0
	count := 0

	for i := 1; i < N+1; i++ {
		s = strconv.Itoa(i)
		length = len(s)
		mod = length % 2
		if mod == 1 {
			count++
		}
	}

	fmt.Println(count)
}


Measured memory_bytes: 1152
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n, Q;
vector<vector<int> > G;
vector<int> ans;

void dfs(int now, int ago){
  for(auto next : G[now]){
    if(next == ago) continue;
    ans[next] += ans[now];
    dfs(next, now);
  }
}

int main(){
  scanf("%d %d", &n, &Q);
  G.resize(n);
  ans.resize(n, 0);
  for(int i = 0; i < n - 1; i++){
    int a, b; scanf("%d %d", &a, &b);
    --a; --b;
    G[a].push_back(b); G[b].push_back(a);
  }
  for(int i = 0; i < Q; i++){
    int p, x; scanf("%d %d", &p, &x);
    ans[p - 1] += x;
  }
  dfs(0, -1);
  for(int  i = 0; i < n; i++) cout << ans[i] << " ";
  cout << endl;
}

Measured memory_bytes: 24412
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner stdIn = new Scanner(System.in);
		String S = stdIn.nextLine();
		
		StringBuffer sb = new StringBuffer(S);
		
		S = sb.reverse().toString();
		
		String[] word = {"maerd", "remaerd", "esare", "resare"};
		
		boolean canDivide = false;
		for(int i = 0; i < S.length();) {
			for(int j = 0; j < word.length; j ++) {
				canDivide = false;
				if(i + word[j].length() <= S.length()) {
					if(S.substring(i, i + word[j].length()).equals(word[j])) {
						canDivide = true;
						i += word[j].length();
						break;
					}
				}
			}
			if(!canDivide) {
				break;
			}
		}
		
		if(canDivide) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	}

}

Measured memory_bytes: 30540
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define mp make_pair
const int maxn = 4e5+5;
const int MOD = 1e9+7;
#define mod(x) x % MOD
#define INF 0x3f3f3f3f



ll dp[200][maxn] ;
ll a[200], s[maxn] ;
int n, k ;

signed main(){
	scanf("%d%d", &n, &k) ;
	for (int i = 0; i < n; i++) scanf("%lld", &a[i]) ;
	for (int j = 0; j <= k; j++) dp[0][j] = 0 ;
	for (int j = 0; j <= n; j++) dp[j][0] = 1 ;
	for (int i = 1; i <= n; i++) {
		s[0] = 0 ;
		for (int j = 1; j <= k + 1; j++) s[j] = s[j - 1] + dp[i - 1][j - 1] ;
		for (int j = 1; j <= k; j++) {
			dp[i][j] = s[j + 1] - s[max(0ll, j - a[i - 1])] ;
			dp[i][j] %= MOD ;
		}
	}
	printf("%lld\n", dp[n][k]) ;
	return 0 ;
}


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

int main(){
  int N,T; cin >> N >> T;
  int c,t;
  int m=1001;
  for(int i=0; i<N; i++){
    cin >> c >> t;
    if(t<=T){
      m=min(m,c);
    }
  }
  if(m>1000){
    cout << "TLE" << endl;
  }else{
    cout << m << endl;
  }
  
}

Measured memory_bytes: 256
function main(input){
  input = input.trim();
  var simo1 = parseInt(input.substr(-1,1));
  if(simo1==0 || simo1==1 || simo1==6 || simo1==8){
    console.log("pon");
  }else if(simo1==3){
    console.log("bon");
  }else{
    console.log("hon");
  }
}
main(require("fs").readFileSync("/dev/stdin","utf8"));


Measured memory_bytes: 29652
#include <bits/stdc++.h>
using namespace std;
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fileio freopen("in.in", "r", stdin),freopen("out.out", "w", stdout);
#define ll long long int
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define sd(x) scanf("%d",&x)
#define slld(x) scanf("%lld",&x)
#define pd(x) printf("%d\n",x)
#define plld(x) printf("%lld\n",x)
#define pss printf
#define MOD 1000000007
#define INF 1e18
#define eps 0.00001
#define endl '\n'
#define debug(n1) cout<<n1<<endl
const int N = 1e5;  // limit for array size
ll n;  // array size

int main(){
	
	int h,w;cin>>h>>w;
	int a[h][w];
	
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			cin>>a[i][j];
			a[i][j]%=2;
		}
	}
	
	vector<pair<pii,pii> >ans;
	
	for(int i=0;i<h;i++){
		for(int j=0;j<w-1;j++){
			if(a[i][j]==1){
				a[i][j+1]+=1;a[i][j+1]%=2;
				ans.pb({{i+1,j+1},{i+1,j+2}});
			}
		}
	}
	
	for(int i=0;i<h-1;i++){
		if(a[i][w-1]==1){
			a[i+1][w-1]+=1;a[i+1][w-1]%=2;
			ans.pb({{i+1,w},{i+2,w}});
		}
	}
	
	cout<<ans.size()<<endl;
	for(int i=0;i<ans.size();i++){
		cout<<ans[i].ff.ff<<" "<<ans[i].ff.ss<<" "<<ans[i].ss.ff<<" "<<ans[i].ss.ss<<endl;
	}
	
	return 0;
}

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

using namespace std;

int write(int x,int y)
{
	int z=0;
	for(int j=0;j<x;j++)
	{
		for(int k=0;k<y;k++)
		{
			if(z==0)
			{
				cout<<"#";
				z=1;
			}
			else
			{
				cout<<".";
				z=0;
			}
		}
		if(y%2==0)
		{
			if(z==0)
				z=1;
			else
				z=0;
		}
		cout<<endl;
	}
	return(0);
}

int main()
{
	int a,b;
	unsigned int i=0;
	unsigned int j;
	vector<int> n;
	vector<int> m;
	
	while(1)
	{
		cin>>a>>b;
		
		if(a==0&&b==0)
			break;
		else
		{
		n.push_back(a);
		m.push_back(b);
		i++;
		}
	}
	for(j=0;j<i;j++)
	{
		write(n[j],m[j]);
		cout<<endl;
	}
	return(0);
}



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

int main(){
    int x,y;
    cin >> x >> y;
    vector<int> shokin(206);
    shokin.at(1)=300000;
    shokin.at(2)=200000;
    shokin.at(3)=100000;
    if(x==1&&y==1){
        cout << shokin.at(1)*2+400000 << endl;
    }else{
        cout << shokin.at(x)+shokin.at(y) << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;

int main() {
  string s, t = "CODEFESTIVAL2016";
  cin >> s;
  int ans = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] != t[i]) ans++;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256