akhauriyash/Code-Regression huggingface dataset:
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <functional>
#include <cstring>
#include <queue>
int spotx[1001] = { 0 };
int spoty[1001] = { 0 };
using namespace std;
int main() {
	int a, b, c, d, e;
	scanf("%d%d%d%d%d", &a, &b, &c, &d, &e);
	int hoge = b / d;
	int hogehoge = c / e;
	if (b%d != 0) {
		hoge++;
	}
	if (c%e != 0) {
		hogehoge++;
	}
	printf("%d\n", a - max(hoge, hogehoge));
	return 0;
}


Measured memory_bytes: 1024
#include<iostream>
#include<cstdio>
using namespace std;
long long n,p[20005],a[20005],b[20005],s[20005];
int main(){
	scanf("%lld",&n);
	for(int i=1;i<=n;i++) scanf("%lld",&p[i]);
	for(int i=1;i<=n;i++) a[i]=i*20000-1;
	for(int i=1;i<=n;i++) b[i]=400000000-a[i];
	for(int i=1;i<=n;i++) a[p[i]]+=i-1;
	for(int i=1;i<=n;i++) printf("%lld ",a[i]);
	printf("\n");
	for(int i=1;i<=n;i++) printf("%lld ",b[i]);
	printf("\n");
	return 0;
}

Measured memory_bytes: 1152
#include <stdio.h>
 
int main(int argc, const char * argv[]) {
    int s;
    int m;
    int h;
    int S;
     
    scanf("%d" ,&S);
    h=S/3600;
    m=(S-h*3600)/60;
    s=S-(h*3600+m*60);
    printf("%d:%d:%d\n",h,m,s);
    return 0;
}

Measured memory_bytes: 592
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <deque>
#include <utility>
#include <cmath>
using namespace std;
#define MAXSIZE 100005
#define PI 3.141592653589793
#define MOD_CONST 1000000007
using lli = long long int;
using PII = pair<int, int>;

int main(){
    lli n;
    cin >> n;
    vector<lli> divisors;
    for(lli num = 1; num <= sqrt(n); ++num){
        if(num == sqrt(n)){
            divisors.push_back(num);
        }else if(n % num == 0){
            divisors.push_back(num);
            divisors.push_back(n / num);
        }
    }
    
    size_t ans = MAXSIZE;
    for(size_t i = 0; i < divisors.size(); ++i){
        string s = to_string(divisors[i]);
        string t = to_string(divisors[++i]);
        ans = min(ans, max(s.length(), t.length()));
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#define EPS (1e-7)
#define INF (1e9)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
const double PI = acos(-1);
const ll MOD = 1000000007;
// const ll MOD = 998244353;
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;
}
///////////////////////////////////////////////////////////////

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int N,M; cin >> N >> M;
    string S; cin >> S;

    bool ok = true;
    vector<int> ans;
    for ( int i = N;i > 0;) {
        int k = max(i-M,0);
        while (S[k] == '1') {
            k++;
        }
        if (k == i) {
            ok = false;
            break;
        }
        ans.emplace_back(i-k);
        i = k;
    }

    reverse(all(ans));
    if (ok) {
        rep(i,ans.size()) cout << ans[i] << " ";
        cout << endl;
    } else cout << -1 << endl;
}

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

#define int long long
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
template<class T,class U>inline void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>inline void chmax(T &t,U f){if(t<f)t=f;}

const int SEG=1<<18;
pint seg[SEG*2];
pint put[SEG*2];
const pint none(-100,-100);
const pint fail(-10,-10);

inline void push(int k){
    if(put[k]==none)return;
    if(put[k]==fail){
        seg[k]=fail;
    }
    if(seg[k].se+1==put[k].fi){
        seg[k].se=put[k].se;
    }
    else{
        seg[k]=fail;
    }
    if(k<SEG-1){
            for(int i=1;i<=2;i++){
                if(put[k*2+i]==none)put[k*2+i]=put[k];
                else if(put[k*2+i]==fail)continue;
                else if(put[k]==fail||put[k*2+i].se+1!=put[k].fi)put[k*2+i]=fail;
                else put[k*2+i].se=put[k].se;
            }
    }
    put[k]=none;
}

void update(int a,int b,pint s,int k=0,int l=0,int r=SEG){
    push(k);
    if(r<=a||b<=l)return;
    if(a<=l&&r<=b){
        put[k]=s;
        push(k);
        return;
    }
    update(a,b,s,k*2+1,l,(l+r)/2);
    update(a,b,s,k*2+2,(l+r)/2,r);
}

signed main(){
    int N,K;
    cin>>N>>K;

    rep(i,SEG*2){
        seg[i]=pint(0,0);
        put[i]=none;
    }

    int Q;cin>>Q;
    while(Q--){
        int a,b,c;
        cin>>a>>b>>c;
        a--;
        update(a,b,pint(c,c));
    }
    rep(i,SEG*2)push(i);
    int ans=0;
    rep(i,N)if(seg[SEG-1+i]==pint(0,K))ans++;
    cout<<ans<<endl;
    return 0;
}

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

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
ll a,b,c,d;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>a>>b>>c>>d;
    while(a>0&&c>0)
    {
        c-=b;
        if(c<=0)
        {
            cout<<"Yes";
            return 0;
        }
        a-=d;
        if(a<=0)
        {
            cout<<"No";
            return 0;
        }
    }
    return 0;
}


Measured memory_bytes: 3656
#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c_deg;
  double s, l, h, rad, PI = acos(-1);
  cin >> a >> b >> c_deg;
  rad = c_deg * PI / 180;
  s = 0.5 * a * b * sin(rad);
  l = a + b + (sqrt(pow(a, 2) + pow(b, 2) - 2 * a * b * cos(rad)));
  h = b * sin(rad);

  cout << fixed << setprecision(8);
  cout << s << endl;
  cout << l << endl;
  cout << h << endl;
  return 0;
}


Measured memory_bytes: 3600
(N, M), *AB = [map(int, s.split()) for s in open(0)]
cnt = [1] * N
possibly_red = [False] * N
possibly_red[0] = True
for a, b in AB:
    a -= 1
    b -= 1
    cnt[a] -= 1
    cnt[b] += 1
    if possibly_red[a]:
        possibly_red[b] = True
        if cnt[a] == 0:
            possibly_red[a] = False
print(sum(possibly_red))


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

using namespace std;

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

typedef long long ll;

const int Inf = 1e9;
const double EPS = 1e-9;

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

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

int bitCount(long bits) {
    bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
    bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
    bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
    bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
    return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff);
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s, t;
    cin >> s >> t;
    int ans = 0;
    rep (i, 3) {
        if (s[i] == t[i]) ans++;
    }
    cout << ans << endl;
    
    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long long n,m,k,a[200005],b[200005];
int main(){
	cin>>n>>m>>k;
	int ans=0;
	cin>>a[1];
	for(int i=2;i<=n;i++)
	{
		cin>>a[i];
		a[i]+=a[i-1];		 
	}
	cin>>b[1]; 
	for(int i=2;i<=m;i++)
	{
		cin>>b[i];
		b[i]+=b[i-1];
	}
	int j=m;
	for(int i=0;i<=n;i++)
	{
		if(a[i]>k)
			break;
		while(a[i]+b[j]>k)
			j--;
		ans=max(ans,i+j);
	}
	cout<<ans;
	return 0;
}

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

int main() {
  int s;
  cin >> s;
  
  vector<int> f(1000009), x(1000009);
  f.at(0) = s;
  x.at(s)++;
  int i = 1, ans;
  while(1){
    if(f.at(i - 1) % 2 == 0){
      f.at(i) = f.at(i - 1) / 2;
      x.at(f.at(i))++;
      if(x.at(f.at(i)) == 2){
        ans = i;
        break;
      }
      i++;
    }
    else{
      f.at(i) = f.at(i - 1) * 3 + 1;
      x.at(f.at(i))++;
      if(x.at(f.at(i)) == 2){
        ans = i;
        break;
      }
      i++;
    }
  }
  
  cout << ans + 1 << endl;
}

Measured memory_bytes: 8064
#include <bits/stdc++.h>
#define FOR(i,a,b)  for(int (i)=(a);(i)<(b);(i)++)
#define REP(i,n)    FOR(i,0,n)
#define RER(i,n)    FOR(i,0,(n+1))
#define pb          push_back
#define mp(a,b)     make_pair((a),(b))
#define mset(m,v)   memset(m,v,sizeof(m))
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pair<int, int> > vpii;
typedef long long ll;
typedef vector<ll> vl;
typedef pair<ll,ll> pll;
typedef vector<pair<ll, ll> > vpll;
typedef vector<string> vs;
typedef long double ld;
const double EPS    = 1e-10;
const int INF       = 1e+9;
const double PI     = acos(-1);


auto main() -> int
{
    char a, b;
    cin >> a >> b;

    if ( a > b ) {
        cout << ">" << endl;
    } else if ( a < b ) {
        cout << "<" << endl;
    } else {
        cout << "=" << endl;
    }
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h> //C++の標準ライブラリを一行で一括でインクルードする
#include <math.h> //数学関数と数学定数を利用する
using namespace std;
typedef long long ll;

int main(){
  int A,B,C;
  cin >> A >> B >> C;
  
  int ans = C - A + B;
  
  if (ans < 0 ){
    cout << 0;
  }else{
    cout << ans;  
  }
  
  return 0;
}

Measured memory_bytes: 256
//Author: A_S_M_M@sud_P@rvez
#include<bits/stdc++.h>
using namespace std;
#define    MP ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define    For(i,n) for(int i=0;i<n;i++)
#define    forn(i,n) for(int i=1;i<=n;i++)
#define    fors(i,s) for(int i=0;i<s.size();i++)
#define    all(v) v.begin(),v.end()
#define    gcd(a, b) __gcd(a , b)
#define    lcm(a,b) (a*(b/__gcd(a,b)))
#define    test   int t;cin>>t;for(int l=0;l<t;l++)
#define    nl     "\n"
#define    End    return 0 
#define    gt     greater<int>()
#define    ll     long long 
#define    mp     make_pair
#define    pb     push_back
#define    vi     vector<int>
#define    vl     vector<ll>
#define    mod    1000000007
#define    sp(n)  fixed<<setprecision(n)
#define    pi     acos(-1)

int main()
{
MP;
    //test
    {
        string s,s1;
        cin>>s>>s1;
        cout<<s1<<s;
    }

End;
}


Measured memory_bytes: 3588
#include <algorithm>
#include <functional>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <bitset>
#include <climits>

#define all(c) (c).begin(), (c).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second

const int INF=100000000;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
using namespace std;
typedef pair<int ,int > P;
typedef long long ll;

template<typename T>
class UnionFind {
    int size_;
    std::vector<T> par;
    std::vector<T> rank;

public:
    UnionFind(int size_) : size_(size_) {
        par.resize(size_);
        rank.resize(size_);

        for(int i=0; i<size_; i++) {
            par[i]  = i;
            rank[i] = 0;
        }
    }

    T find(T x) {
        return par[x] == x ? x : par[x] = find(par[x]);
    }
    void unite(T x,T y) {
        x = find(x);
        y = find(y);
        if(x == y) return;

        if(rank[x] < rank[y]) {
            par[x] = y;
        }
        else {
            par[y] = x;
            if(rank[x] == rank[y]) rank[x]++;
        }
    }
    bool same(T x,T y) {
        return find(x)==find(y);
    }
};
int n,m;
int d;
struct Edge{
    int a,b,w;
    Edge(int a,int b,int w) : a(a),b(b),w(w){}
    Edge(){}
    bool operator<(const Edge& e) const {
        return abs(d-w) < abs(d-e.w);
    }
};


vector<Edge> es;

void solve() {
    int ans=INF;
    rep(i,m) {
        vector<Edge> t=es;
        d=es[i].w;
        sort(all(t));

        //cout<<i<<" ";
        //rep(j,m) printf("%d:%d %d %d, ",j,es[j].a,es[j].b,es[j].w);
        //cout<<endl;

        UnionFind<int> uf(n);
        vector<int> vec;
        vec.pb(es[i].w);
        uf.unite(es[i].a,es[i].b);
        rep(j,m) {
            Edge e=t[j];
            if(es[i].a==e.a&&es[i].b==e.b) continue;
            if(!uf.same(e.a,e.b)) {
                //printf("unit(%d,%d)\n",e.a,e.b);
                uf.unite(e.a,e.b);
                vec.pb(e.w);
            }
        }
        int mini=*min_element(all(vec));
        int maxi=*max_element(all(vec));
        //printf("%d : %d %d\n",i,mini,maxi);
        bool ok=true;
        rep(i,n) rep(j,n) if(!uf.same(i,j)) ok=false;
        if(ok) ans=min(ans,maxi-mini);
    }

    if(ans==INF) cout<<"-1"<<endl;
    else cout<<ans<<endl;
}

int main() {
    while(cin>>n>>m) {
        if(n==0&&m==0) break;
        es.resize(m);
        rep(i,m) {
            int a,b,w;
            cin>>a>>b>>w;
            a--,b--;
            es[i]=Edge(a,b,w);
        }
        if(n-1>m) {
            cout<<"-1"<<endl;
            continue;
        }
        solve();
    }
    return 0;
}

Measured memory_bytes: 1344
import sys
import numpy as np

# input処理を高速化する
input = sys.stdin.readline

# 入力
N, W = map(int, input().split())

def knapsack(n, w):
    # dp[i][j] : i番目の品物で重さj以下の価値の最大値
    dp = np.zeros([N+1, W+1], dtype='int64')
    # forは関数の中で回す。
    for i in range(N):
        w, v = map(int, input().split())
        # i+1番目でwより小さい場合は、i番目と変更なし
        dp[i+1][:w] = dp[i][:w]
        dp[i+1][w:] = np.maximum(dp[i][w:], dp[i][:-w] + v)
        # print(dp)
    return dp[-1][-1]

print(knapsack(N, W))


Measured memory_bytes: 92420
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); i++)
typedef long long ll;
const int mod = 1e9 + 7;
int main() {

    string s;
    cin >> s;

    int a[3] = {};
    rep(i, s.length()){
        if(s[i] == 'a'){
            a[0]++;
        }
        else if(s[i] == 'b'){
            a[1]++;
        }
        else{
            a[2]++;
        }
    }
    
    sort(a, a+3);
    if(a[1] - a[0] <= 1 && a[2] - a[1] <= 1 && a[2] - a[0] <= 1){
        cout << "YES" << endl;
    }
    else{
        cout << "NO" << endl;
    }

    return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define COUT(x) cout<<(x)<<endl
#define dump(x)  cout << #x << " = " << (x) << endl;
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;
using M = map<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int, vector<int>, greater<int>>;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int main() {
  double a, b; cin >> a >> b;
  cout << ceil((a+b)/2) << endl;
  return 0;
}


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

using namespace std ;

int main()
{
    int n ;
    cin >>  n ;
    vector<int> a(n) ;
    int ma = 0 ;
    int mi = 1000 ;
    for(int i=0;i < n;i++){
     cin >> a[i] ;
     ma = max(ma,a[i]) ;
     mi = min(mi,a[i]) ;
    }
    cout << ma - mi ;
    return 0 ;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#include <cmath>
#include <map>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,a,n) for(int i=a;i<n;i++)
#define been(ix) (ix).begin(),(ix).end()
using namespace std;
typedef long long ll; 
typedef vector<int> vi;
typedef vector<long long> vl;
const ll INFL = 1e18;
const int INF = 1001001001; 
typedef pair<int,int> P;
#define foreach(ix,i) for(auto& (ix) : (i))
typedef long double ld;
const int mod =1000000007;
int main(){
 int n;
 cin>>n;
 if(n==0){
     cout<<0<<endl;
     return 0;
 }
 string ans;
 int cnt =0;
 while(n!=0){
    if(n%2==0){
         ans.push_back('0');
    }
    else{
        ans.push_back('1');
    }
    int x =n;
    n/=-2;
    if(x<0&&x%2!=0)n++;
 }
 reverse(been(ans));
 cout<<ans<<endl;

}


Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

void getSide(double x1, double y1, double x2, double y2, double x3, double y3, double *a, double *b, double *c) {
    double marginX1, marginX2, marginX3;
    double marginY1, marginY2, marginY3;
    
    marginX1 = fabs(x1 - x2);
    marginX2 = fabs(x2 - x3);
    marginX3 = fabs(x3 - x1);
    marginY1 = fabs(y1 - y2);
    marginY2 = fabs(y2 - y3);
    marginY3 = fabs(y3 - y1);
    
    *a = sqrt(pow(marginX1, 2) + pow(marginY1, 2));
    *b = sqrt(pow(marginX2, 2) + pow(marginY2, 2));
    *c = sqrt(pow(marginX3, 2) + pow(marginY3, 2));
    
}

    // 半径取得の処理
double getR(double a, double b, double c) {
    double r, s;
    s = (a + b + c) / 2;
    r = (a * b * c) / (4 * sqrt(s * (s - a) * (s - b) * (s - c)));
    return r;
}

    // 中心座標を求める処理
void getCentralCoodinate(double x1, double y1, double x2, double y2, double x3, double y3, double *xp, double *yp) {
    double a1, b1, c1;
    double a2, b2, c2;
    double marginX1, marginX3;
    double marginY1, marginY3;
    
    *xp = 0;
    *yp = 0;
    
    marginX1 = x2 - x1;
    marginX3 = x3 - x1;
    marginY1 = y2 - y1;
    marginY3 = y3 - y1;
    
    a1 = 2 * marginX1;
    b1 = 2 * marginY1;
    a2 = 2 * marginX3;
    b2 = 2 * marginY3;
    
    c1 = pow(x1, 2) - pow(x2, 2) + pow(y1, 2) - pow(y2, 2);
    c2 = pow(x1, 2) - pow(x3, 2) + pow(y1, 2) - pow(y3, 2);
    
    *xp = (b1 * c2 - b2 * c1) / (a1 * b2 - a2 * b1);
    *yp = (a2 * c1 - a1 * c2) / (a1 * b2 - a2 * b1);
}

    // main処理
int main(void) {
    double x1, x2, x3;
    double y1, y2, y3;
    double xp, yp;
    double a, b, c, r;
    int n;
    
    cin >> n;
    while(n--) {
        cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
        getSide(x1, y1, x2, y2, x3, y3, &a, &b, &c);
        r = getR(a, b, c);
        getCentralCoodinate(x1, y1 ,x2, y2, x3, y3, &xp, &yp);
        
        cout << setprecision(3);
        cout << setiosflags(ios::fixed);
        cout << xp << " " << yp << " " << r << endl;
    }
    
    return 0;
}

Measured memory_bytes: 1292
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int N = sc.nextInt();
		int T = sc.nextInt();
		int A = sc.nextInt();

		double min = Double.MAX_VALUE;
		int ans = 0;

		for (int i = 1; i <= N; i++) {
			int h = sc.nextInt();

			double t = T - (h * 0.006);
			double d = Math.abs(A - t);

			if (min > d) {
				min = d;
				ans = i;
			}
		}

		out.println(ans);

		sc.close();

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}

}


Measured memory_bytes: 23764
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<string>
#include<cctype>
using namespace std;

int main(){
int a,b,c;cin>>a>>b>>c;
if(a<b&&b<c)cout<<"Yes"<<endl;
else cout<<"No"<<endl;

return 0;
}

Measured memory_bytes: 1156
N, D = map(int, input().split())
time = 0
floor = 1
num = 0
result = 0
for _ in [0]*N:
    t, f = map(int, input().split())
    if floor-1+f-1 <= t-time:
        result += num * (floor-1)
        num = 1
    elif abs(floor-f) <= t-time and num < D:
        result += num * abs(t-time)
        num += 1
    else:
        print(-1)
        break
    time, floor = t, f
else:
    result += num * (floor-1)
    print(result)

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

using namespace std;

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

    string s, t;
    cin >> s >> t;
    const int n = s.size(), m = t.size();
    vector<vector<int>> nxt_occ(n + 1, vector<int>(26, n));
    for (int i = n - 1; i >= 0; --i) {
        for (int j = 0; j < 26; ++j) {
            if (s[i] == j + 'a') {
                nxt_occ[i][j] = i;
            } else {
                nxt_occ[i][j] = nxt_occ[i + 1][j];
            }
        }
    }
    /*for (int i = 0; i < n; ++i) {
        for (int j = 0; j < 26; ++j) {
            cout << nxt_occ[i][j] << " ";
        }
        cout << endl;
    }*/
    long long res = 0;
    for (int i = 0, j = 0; i < m; ++i) {
        int k = t[i] - 'a';
        if (nxt_occ[j][k] < n) {
            //cout << "goto " << nxt_occ[j][k] << endl;
            res += nxt_occ[j][k] - j + 1;
            j = nxt_occ[j][k] + 1;     
        } else {
            //cout << "goto " << "start" << endl;
            res += n - j - 1;
            ++res;
            j = 0;
            if (nxt_occ[j][k] < n) {
                //cout << "and goto " << nxt_occ[j][k] << endl;
                res += nxt_occ[j][k] - j + 1;
                j = nxt_occ[j][k] + 1;
            } else {
                cout << -1 << "\n";
                return 0;
            }
        }
        if (j >= n) {
            j = 0;
        }
        //cout << res << endl;
    }
    cout << res << "\n";

    return 0;
}

Measured memory_bytes: 13776
//
// Created by karth on 7/4/2020.
//
#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
#define PB push_back
#define MP make_pair
#define FF first
#define SS second

//void setIO(string s) {
//    ios_base::sync_with_stdio(0); cin.tie(0);
//    freopen((s+".in").c_str(),"r",stdin);
//    freopen((s+".out").c_str(),"w",stdout);
//}

void sieve() {
    vector<int> spf;
    int MAXN = 100001;
    spf[1] = 1;
    for (int i = 2; i < MAXN; i++)
        spf[i] = i;
    for (int i = 4; i < MAXN; i += 2)
        spf[i] = 2;
    for (int i = 3; i * i < MAXN; i++) {
        if (spf[i] == i) {
            for (int j = i * i; j < MAXN; j += i)
                if (spf[j] == j)
                    spf[j] = i;
        }
    }
}


vector<int> factors(int n) {
    vector<int> vi;
    for (int i = 1; i <= sqrt(n); ++i) {
        if (n % i == 0) {
            vi.push_back(i);
            if (i != sqrt(n)) {
                vi.push_back(n / i);
            }
        }
    }
    sort(vi.begin(), vi.end());
}

int factorial(int n) {
    if (n == 1)
        return 1;
    return n * factorial(n - 1);
}

int nCr(int n, int r) {
    return factorial(n) / (factorial(r) * factorial(n - r));
}


int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    string s, t;
    cin >> s >> t;
    int ans = 0;
    for(int i = 0; i < s.size(); ++i){
        if(s[i] != t[i]){
            ans++;
        }
    }
    cout << ans << "\n";
}


Measured memory_bytes: 3868
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int ans;
    if((a + b)%2==0){
      ans = (a+b) /2;
    }else{
      ans = (a+b+1)/2;
    }
    System.out.println(ans);
  }
}


Measured memory_bytes: 22996
#include <bits/stdc++.h>
#define BIT(n) (1LL << (n))
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPB(i, n) for (int i = 0; i < BIT(n); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define FORA(i, n) for (auto &&i : n)
#define FORS(i, m, n) for (int i = m; i <= n; i++)
#define DEBUG(x) cerr << #x << ": " << x << "\n"
#define ALL(v) v.begin(), v.end()
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
#define epb emplace_back
#define int long long
using namespace std;
template < class T > using vec = std::vector< T >;
template < class T > void print(T &x) { cout << x << "\n"; }
typedef long long ll;
const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI = acos(-1.0);
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
signed main() {
  cin.tie(0), ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  string S,T;
  cin >> S>>T;
  int N=S.size();
  bool flg = false;
  REP(i,N){
    bool flgnow = true;
    REP(j,N){
      if (S[j]!=T[(i+j)%N]){
        flgnow=false;
        break;
      }
    }
    if (flgnow){
      flg = true;
      break;
    }
  }
  if (flg){
    print("Yes");
  }
  else{
    print("No");
  }
  return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <cmath>
#include <iostream>
#include <iomanip>
using std::cin;
using std::cout;
using std::endl;
using std::fixed;
using std::setprecision;

int main()
{
	double r;
	cin >> r;
	cout << fixed << setprecision(7) << M_PI * r * r << " " <<  2 * M_PI * r <<endl;
	return 0;
}

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

using ll = long long;

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

template<typename T>
T lcm(T a, T b)
{
	return a * b / gcd(a, b);
}

template<typename T>
T ext_gcd(T a, T b, T& x, T& y)
{
	x = 1;
	y = 0;
	T x0 = 0, y0 = 1;
	while (b != 0)
	{
		T q = a / b;
		a -= q * b;
		swap(a, b);
		x -= q * x0;
		swap(x, x0);
		y -= q * y0;
		swap(y, y0);
	}
	return a;
}

template<typename T>
T inv_mod(T a, T mod)
{
	T t1, t2;
	ext_gcd(a, mod, t1, t2);
	t1 %= mod;
	if (t1 < 0)		t1 += mod;
	return t1;
}

template<typename T>
T combination_large(T n, T k, T mod)
{
	if (n < k || n < 0 || k < 0)	return 0;
	vector<T> inv(n + 1, 1), fact(n + 1, 1), fact_inv(n + 1, 1);
	for (T i = 2; i <= n; ++i)
	{
		inv[i] = mod - inv[mod % i] * (mod / i) % mod;
		fact[i] = (fact[i - 1] * i) % mod;
		fact_inv[i] = fact_inv[i - 1] * inv[i] % mod;
	}
	return fact[n] * (fact_inv[k] * fact_inv[n - k] % mod) % mod;
}

template<typename T>
T combination(T n, T k, T mod = 1)
{
	vector<vector<T>> table(n + 1, vector<T>(k + 1, 1));
	for (T i = 1; i <= n; ++i)
	{
		table[i][0] = 1;
		for (T j = 1; j <= n; ++j)
		{
			table[i][j] = (table[i - 1][j - 1] + table[i - 1][j]) % mod;
		}
	}
}


int main(int, char**)
{
	long long N;
	scanf("%lld",&N);

	ll count = 0;
	vector<vector<ll>> table(10, vector<ll>(10, 0));
	for (ll i = 1; i <= N; ++i)
	{
		auto s = to_string(i);
		auto d = s[0] - '0';
		++table[d][i % 10];
	}
	for (ll i = 1; i <= N; ++i)
	{
		auto s = to_string(i);
		auto d = s[0] - '0';
		if (d == i % 10)
		{
			count += table[d][d];
		}
		else
		{
			count += table[i % 10][d];
		}
	}
	cout << count << endl;

	return 0;
}


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

using namespace std;

#define int long long

signed main() {
  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  long double x = 100;
  int in;
  cin >> in;
  int t = 1000000, c = 0;
  while (t--) {
    if (x >= in) return cout << c, 0;
    ++c;    
    x = x + floor(x / 100.0);
    // cout << x << '\n';
  }
  // cout << x << '\n';
  return 0;
}

Measured memory_bytes: 3692
#include <stdio.h>

int main(void)
{
	int money;
	
	while (scanf("%d", &money) * money != 0){
		int count = 0;
		int coin = 500;
		int i;
		
		money = 1000 - money;
		for (i = 0; money > 0; i++){
			count += money / coin;
			money %= coin;
			coin /= i % 2 == 0 ? 5 : 2;
		}
		printf("%d\n", count);
	}
	
	return 0;
}

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

int main(void)
{
    long long int a,b,c,d,i,j,k,n;
    string s;
    char C[5];

    cin >> a >> b >>c;

    if(a*b<c) cout << a*b;
    else cout << c;

    return 0;
}


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

const int N = 1e5 + 10;

int a[N];
int dp[N];

void init() {
    for (int i = 0; i < N; i++) {
        dp[i] = INT_MAX;
    }
}

int main() { 
    ios_base::sync_with_stdio(0); 
    cin.tie(0);
    int n, k;
    cin >> n >> k;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }
    init();
    dp[1] = 0;
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= k; j++) {
            dp[i + j] = min(dp[i + j], dp[i] + abs(a[i] - a[i + j]));
        }
    }
    cout << dp[n] << '\n';
}

Measured memory_bytes: 1024
n,m,x,y = gets.split(" ").map(&:to_i)
x_ary = gets.split(" ").map(&:to_i).max
y_ary = gets.split(" ").map(&:to_i).min
count = 0

(-100..100).each do |n|
    if x_ary < n && y_ary >= n
        if  x < n && n <= y
            count +=1
            puts "No War"
        break
        end
    end
end
puts "War" if count == 0

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

int main() {
  int w, h, n;
  cin >> w >> h >> n;
  int x[101] = {0}, y[101] = {0}, a[101] = {0};
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i] >> a[i];
  bool area[101][101] = {false};
  for (int i = 0; i < w; i++) {
    for (int j = 0; j < h; j++) {
      area[i][j] = true;
    }
  }
  for (int i = 0; i < n; i++) {
    if (a[i] == 1) {
      for (int j = 0; j < x[i]; j++) {
        for (int k = 0; k < h; k++) {
          area[j][k] = false;
        }
      }
    } else if (a[i] == 2) {
      for (int j = x[i]; j < w; j++) {
        for (int k = 0; k < h; k++) {
          area[j][k] = false;
        }
      }
    } else if (a[i] == 3) {
      for (int j = 0; j < w; j++) {
        for (int k = 0; k < y[i]; k++) {
          area[j][k] = false;
        }
      }
    } else if (a[i] == 4) {
      for (int j = 0; j < w; j++) {
        for (int k = y[i]; k < h; k++) {
          area[j][k] = false;
        }
      }
    }
  }
  int counter = 0;
  for (int i = 0; i < w; i++) {
    for (int j = 0; j < h; j++) {
      if (area[i][j]) counter++;
    }
  }
  cout << counter << endl;
  return 0;
}

Measured memory_bytes: 256
x,y = map(int, input().split())

answer = 0

if x == 1:
  answer += 300000
elif x == 2:
  answer += 200000
elif x == 3:
  answer += 100000

if y == 1:
  answer += 300000
elif y == 2:
  answer += 200000
elif y == 3:
  answer += 100000

if x == 1 and y == 1:
  answer += 400000

print(answer)

Measured memory_bytes: 3064
#include <stdio.h>
int main(int argc,char *argv[]){
    int n,m,a,b,i,c[51]={0};
    scanf("%d %d",&n,&m);
    for(i=0; i<m; i++){
        scanf("%d %d",&a,&b);
        c[a]++;
        c[b]++;
    }
    for(i=1; i<=n; i++){
        printf("%d\n",c[i]);
    }
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;

using namespace std;

const double PI = 3.14159265358979323846;
typedef long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
//#define rep(i, n) for (ll i = 0; i < (n); ++i)
typedef pair<ll, ll> P;
const ll INF = 10e17;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)
#define ret() return 0;

double equal(double a, double b) {
    return fabs(a - b) < DBL_EPSILON;
}

std::istream &operator>>(std::istream &in, set<int> &o) {
    int a;
    in >> a;
    o.insert(a);
    return in;
}

std::istream &operator>>(std::istream &in, queue<int> &o) {
    ll a;
    in >> a;
    o.push(a);
    return in;
}

bool contain(set<int> &s, int a) { return s.find(a) != s.end(); }

//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);
//const ll mod = 1e10;

typedef priority_queue<ll, vector<ll>, greater<ll> > PQ_ASK;

int main() {
    string s;
    cin >> s;
    int n = s.size();

    ll ans = 0;
    ll a_seq = 0;
    rep(i, n - 2) {
        if (s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C') {
            s[i + 2] = 'A';
            ans += a_seq + 1;
            i++;
        } else if (s[i] == 'A') {
            a_seq++;
        } else {
            a_seq = 0;
        }
    }
    cout << ans << endl;
}


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

using ll = long long int;
using ull = unsigned long long int;
using P = pair<ll, ll>;
using P3 = pair<ll, P>;
using PP = pair<P ,P>;
constexpr ll MOD = ll(1e9+7);
constexpr int IINF = INT_MAX;
constexpr ll LLINF = LLONG_MAX;
constexpr int MAX_N = int(2e5) + 5;
constexpr double EPS = 1e-8;
constexpr int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0};
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define SORTR(v) sort((v).rbegin(), (v).rend())
#define ALL(v) (v).begin(), (v).end()

int main(){
    int n;
    cin >> n;
    vector<int> d(n);
    for(int i=0;i<n;i++){
        cin >> d[i];
    }
    int ans = 0;
    for(int i=0;i<n;i++){
        for(int j=i+1;j<n;j++){
            ans += d[i]*d[j];
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int calc(int A, int B)
{
    for (int i = 1; i <= 1009; i++)
    {
        if ((int)(i * 0.08) == A && (int)(i * 0.10) == B)
        {
            return i;
        }
    }

    return -1;
}

int main()
{
    int A, B;
    cin >> A >> B;
    cout << calc(A, B) << endl;

    return 0;
}

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

#define rep(i,n) for(ll i=0;i<(n);++i)
using ll = long long;
using pll = pair<ll,ll>;
constexpr ll INF = (1LL<<60);
constexpr ll MOD = (1e9+7);
//constexpr ll MOD = (998244353);
template<class T> bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T> bool chmin(T &a,const T &b){if(a>b){a=b;return 1;}return 0;}
void dump(){cout<<endl;}
template<class T,class... Ts> void dump(T&& h, Ts&&... t){cout<<h<<", ";dump(forward<Ts>(t)...);}
template<class T> istream &operator>>(istream&is,vector<T>&v){for(auto &elemnt:v)is>>elemnt;return is;}
template<class T,class U> istream &operator>>(istream&is,pair<T,U>&p){is>>p.first>>p.second;return is;}
template<class T>vector<T> make_vector(size_t a){return vector<T>(a);}
template<class T, class... Ts>auto make_vector(size_t a, Ts... ts){return vector<decltype(make_vector<T>(ts...))>(a, make_vector<T>(ts...));}

void solve1();void solve2();
int main(){
  solve1();
  return 0;
}

template<class T>
class segtree {
private:
  ll n=1;
  T unit;
  std::vector<T> dat;
  std::function<T(T,T)> func;
public:
  segtree(){}
  segtree(std::vector<T>& a,T v,std::function<T(T,T)> f){
    build(a,v,f);
  }
  void build(std::vector<T>& a,T v,std::function<T(T,T)> f){
    ll sz=a.size();
    unit=v;
    func=f;
    while(n<sz)n<<=1LL;
    dat.resize(2*n-1,unit);
    for(int i=0;i<sz;++i)dat[i+n-1]=a[i];
    for(int i=n-2;i>=0;--i){
      dat[i]=func(dat[i*2+1],dat[i*2+2]);
    }
  }
  void update(ll idx,T val){
    idx+=n-1;
    dat[idx]=val;
    while(idx){
      idx--;idx>>=1LL;
      dat[idx]=func(dat[idx*2+1],dat[idx*2+2]);
    }
  }
  T query(ll a,ll b,ll k=0,ll l=0,ll r=-1){
    if(r<0)r=n;
    if( b<=l || r<=a )return unit;
    if( a<=l && r<=b )return dat[k];
    else{
      auto left=query(a,b,2*k+1,l,(l+r)/2);
      auto right=query(a,b,2*k+2,(l+r)/2,r);
      return func(left,right);
    }
  }
};


void solve1(){

  ll m;
  cin>>m;
  vector<pll> dc(m);
  cin>>dc;

  ll sum = 0;
  ll n = 0;
  for(auto const& x:dc){
    n += x.second;
    sum += x.first*x.second;
  }

  //cout<<(n-1+sum/10)<<endl;
  cout<<(n-1+(sum-1)/9)<<endl;

}


Measured memory_bytes: 3328
#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream> 
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include<fstream>
#include <unordered_map>  
using namespace std;
#define eps 0.00000001
#define LONG_INF 10000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define f(n) for(int i=0;i<n;++i)
#define REP(i,n) for(long long i = 0;i < n;++i)
int geko[4] = {4,6,9,11};
int main(){
	int x,y;
	cin >> x >> y;
	if(y == 2||x == 2){
		if(y == 2&&x == 2){
			cout << "Yes" << endl;
			return 0;
		}else{
			cout << "No" << endl;
			return 0;
		}
	}
	int nya = 0;
	for(int i = 0;i < 4;++i){
		if(geko[i] == x){
			nya++;
		}
	}
	for(int i = 0;i < 4;++i){
		if(geko[i] == y){
			nya++;
		}
	}
	if(nya == 1){
		cout << "No" << endl;
		return 0;
	}
	cout << "Yes" << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<cstdio>
#include<cstdlib>
using namespace std;
struct Node{int key; Node *p,*l,*r;};
Node *null,*root;


void insert(int k){
Node *x,*y,*z;
	y=null;
	x=root;
	z=(Node*)malloc(sizeof(Node));
	z->key=k;
	z->l=null;
	z->r=null;
	while(x!=null){
	    y=x;
		if(z->key<x->key)
		x=x->l;
		else 
		x=x->r;
	}
	z->p=y;
	if(y==null)
	root=z;
	else if(z->key>y->key)
	y->r=z;
	else
	y->l=z;
}
void in_p(Node *u){
	if(u==null)
	return;
	in_p(u->l);
	printf(" %d",u->key);
	in_p(u->r);
}
void pre_p(Node *u){
	if(u==null)
	return ;
	printf(" %d",u->key);
	pre_p(u->l);
	pre_p(u->r);
}
void print(){
	in_p(root);
	printf("\n");
	pre_p(root);
	printf("\n");
}
bool find(Node *a,int k){
	if(a==null)
	return false;
	    else if(a->key==k)
		return true;
		else if(a->key>k)
	     find(a->l,k);
	    else 
	    find(a->r,k);
	}

main(){
	int i,n,key;
	string com;
	scanf("%d",&n);
	
	for(i=0;i<n;i++){
		cin>>com;
		if(com=="insert"){
			scanf("%d",&key);
			insert(key);
		}
		else if(com=="find"){
			scanf("%d",&key);
			if(find(root,key))
			printf("yes\n");
			else
			printf("no\n");
		}
		else
		print();
	}
	
	return 0;
}



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

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] array = new int[3];
		array[0] = sc.nextInt();
		array[1] = sc.nextInt();
		array[2] = sc.nextInt();

		Arrays.sort(array);
		System.out.println(array[0]+ array[1]);

	}

}


Measured memory_bytes: 22740
#include<bits/stdc++.h>
using namespace std;
#define ALL(obj) (obj).begin(), (obj).end()
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, a, b) for(int i = (a); i >= (b); i--)
#define REP(i, n) for(int i = 0; i < (n); ++i)
#define RREP(i, n) for(int i = n; i >= n; i--)

#define ABS(a) ((a < 0) ? ((-1)*(a)) : (a))

#define endl "\n"
#define pb push_back
#define rtn return
#define elif else if

#define INF 2000000000	//int型は2 * 10^9ぐらいまで
#define MOD 1000000007
 
const int dx[]={1,0,-1,0}, dy[]={0,-1,0,1};

typedef long long ll;
typedef unsigned long long ull;

template <typename T>
inline T GCD(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;}
template <typename T>
inline T LCM(T a,T b){T c=GCD(a,b);a/=c;return a*b;}
template <typename T>
inline T nCr(T a,T b){T i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
template <typename T>
inline T nHr(T a,T b){return nCr(a+b-1,b);}
template <typename T>
inline T POW(T a,T b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}

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

	string a, b, c;
	cin >> a >> b >> c;
	if(a.back() == b.front() && b.back() == c.front()) cout << "YES" << endl;
	else cout << "NO" << endl;

	rtn 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <numeric>
#include <ctype.h>
#include <cstdlib>
#include <string.h>
#include <cmath>
#include <cstdio>





using namespace std;


int main()
{
	int count = 0, point = 0;

	while (true)
	{
		cin >> count;

		if (count == 0)
			break;

		double *s = new double[count];
		double sum = 0, ave = 0, _sum = 0, stddevi = 0;

		for (int i = 0; i < count; i++)
		{
			cin >> s[i];
			sum += s[i];
		}

		ave = sum / count;

		for (int i = 0; i < count; i++)
		{
			_sum += pow(s[i] - ave, 2.0);
		}

		stddevi = sqrt(_sum / count);

		cout << stddevi << endl;






	}
	
	

	
}

Measured memory_bytes: 3264
#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#define MAXN 500005
using namespace std;
int main()
{
	int n, x, t, ans;
	scanf("%d%d%d", &n, &x, &t);
	if (n % x == 0) ans = t * n / x;
	else ans = t * (n / x + 1);
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 3824
n = int(input())
*l, = map(int,input().split())
ans = 0
for i in range(1,n-1):
  if (l[i-1] < l[i] and l[i] < l[i+1]) or (l[i-1]>l[i] and l[i]>l[i+1]):
    ans += 1
print(ans)

Measured memory_bytes: 3060
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll mod = 1e9 + 7;
const int sz = 2e6 + 1;

int k;
string s;
ll fact[sz], inv_fact[sz];

ll bpow(ll x, ll p) {
	if (p == 0)
		return 1;
	if (p % 2)
		return (x * bpow(x, p - 1)) % mod;
	else {
		ll b = bpow(x, p / 2);
		return (b * b) % mod;
	}
}

ll inv(ll x) {
	return bpow(x, mod - 2);
}

void calc_fact() {
	fact[0] = 1;
	inv_fact[0] = 1;
	for (int i = 1; i < sz; i++) {
		fact[i] = (fact[i - 1] * i) % mod;
		inv_fact[i] = inv(fact[i]);
	}
}

ll cnk(ll nn, ll kk) {
	return fact[nn] * inv_fact[nn - kk] % mod * inv_fact[kk] % mod;
}

void solve() {
	cin >> k >> s;
	int n = s.size();
	calc_fact();
	ll ans = 0;
	for (int i = 0; i <= k; i++) {
		ans += cnk(n + k - i - 1, n - 1) * bpow(25, k - i) % mod * bpow(26, i) % mod;
		ans %= mod;
	}
	cout << ans;
}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
#if defined(_DEBUG)
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	int q = 1;
	//cin >> q;
	for (; q > 0; q--) {
		solve();
		cout << endl;
	}
}

Measured memory_bytes: 35644
def cmb(n, r, p):
  if (r < 0) or (n < r):
    return 0
  r = min(r, n - r)
  return fac[n]*finv[r]*finv[n-r]%p

def perm(n,r,p):
  if (r < 0) or (n < r):
    return 0
  return fac[n]*finv[n-r]%p

n = 2*pow(10,5)+10
MOD = pow(10,9)+7

fac = [-1]*(n+1); fac[0] = 1; fac[1] = 1 #階乗
finv = [-1]*(n+1); finv[0] = 1; finv[1] = 1 #階乗の逆元
inv = [-1]*(n+1); inv[0] = 0; inv[1] = 1 #逆元
for i in range(2,n+1):
  fac[i] = fac[i-1]*i%MOD
  inv[i] = MOD - inv[MOD%i]*(MOD//i)%MOD
  finv[i] = finv[i-1]*inv[i]%MOD


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
 
    if temp!=1: #最後に残ったもの（もしくは素数）の場合はここ
        arr.append([temp, 1])
 
    if arr==[]: #1の場合はここ
        arr.append([n, 1])
 
    return arr


N,M = map(int,input().split())
A = factorization(M)
#print(A)
ans = 1
for X in A:
  if X == [1,1]:
    continue
  k = X[1]
  temp = cmb(k+N-1,k,MOD)
  ans = ans*temp%MOD
print(ans%MOD)


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

typedef long long ll;

#define pb push_back
#define rep(i, a, n) for(int i = (a); i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
#define mod 1e9+7

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

int main() {
  int n, a[100001] = {}, k = 0, c = 0;
  cin >> n;

  rep(i, 0, n) {
    int b;
    cin >> b;
    a[b]++;
  }

  rep(i, 0, 100001) if(a[i] > 2) a[i] = a[i] % 2 == 0 ? 2 : 1;
  rep(i, 0, 100001) {
    if(a[i]) {
      c++;
      if(a[i] > 1) k++;
    }
  }
  cout << (k % 2 == 0 ? c : c - 1) << endl;
}


Measured memory_bytes: 640
object Main extends App {
  import java.util.Arrays

  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt
  val X = Array.fill(n)(sc.nextInt)
  val Xs = X.clone()
  Arrays.sort(Xs)
  val halfB = Xs(n / 2 - 1) // before
  val halfA = Xs(n / 2) // after

  for (i <- 0 until n) {
    if (X(i) <= halfB) {
      println(halfA)
    } else {
      println(halfB)
    }
  }
}

Measured memory_bytes: 69664
#include <iostream>
#include <math.h>

using namespace std;
#define mod 1000000007

int main()
{
	long long  X;
	cin >> X;
	long long cur = 100,  cnt =  0;
	while(cur < X){
		cur += cur * 0.01;
		cnt++;
	}
	cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;

#define ALL(x) (x).begin(), (x).end()
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)


void solve(long long N, std::vector<long long> a, std::vector<long long> b, std::vector<long long> c){
    lint res[N][3];
    REP(i,N){
        REP(j,3){
            res[i][j] = 0LL;
        }
    }
    res[0][0] = a[0];
    res[0][1] = b[0];
    res[0][2] = c[0];
    FOR(i, 1, N){
        res[i][0] = max(res[i-1][1], res[i-1][2]) + a[i];
        res[i][1] = max(res[i-1][0], res[i-1][2]) + b[i];
        res[i][2] = max(res[i-1][0], res[i-1][1]) + c[i];
    }
    lint tmp = 0;
    cout << max(res[N-1][0], max(res[N-1][1], res[N-1][2])) << "\n";

}

int main(){

    long long N;
    scanf("%lld",&N);
    std::vector<long long> a(N);
    std::vector<long long> b(N);
    std::vector<long long> c(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&a[i]);
        scanf("%lld",&b[i]);
        scanf("%lld",&c[i]);
    }
    solve(N, std::move(a), std::move(b), std::move(c));
    return 0;
}



Measured memory_bytes: 4992
# 1 # 0 # -1 K
a, b, c, K = map(int, input().split())
sum = 0

if K >= a:
  K = K - a
  sum += a*1
elif K != 0:
  sum += int(K)*1
  K = 0
  
if K >b:
  sum +=b*0
  K = K - b
elif K != 0:
  sum += int(K)*0
  K = 0
  
if K > c:
  sum +=c*-1
  K = K -c
elif K!=0:
  sum += int(K)*-1
  K = 0
print(sum)

Measured memory_bytes: 9236
#include<iostream>
#include<string>
using namespace std;
int main(){
  string s;
  int n;
  std::cin >> n>>s;
  string ch[2];
  string ans="No";
  if(n%2==0){
    ch[0]=s.substr(0,s.length()/2);
    ch[1]=s.substr(s.length()/2,s.length()-1);
    if(ch[0]==ch[1])ans="Yes";
  }
  std::cout << ans << '\n';
  return 0;
}


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

int H, W, K, S_h, S_w;
string A[800];
int is_first[800][800] = {};

int dh[] = {1, 0, -1, 0}, dw[] = {0, 1, 0, -1};

void go(int h, int w, int k){
    queue<pair<pair<int, int>, int> > Q;
    Q.push(make_pair(make_pair(h, w), k));
    while(!Q.empty()){
        pair<pair<int, int>, int> now = Q.front();
        Q.pop();
        int h = now.first.first;
        int w = now.first.second;
        int k = now.second;
        is_first[h][w] = k;
        if(k > 1){
            for(int i = 0; i < 4; i++){
                int h_ = h + dh[i];
                int w_ = w + dw[i];
                if((0 <= h_) && (h_ < H) && (0 <= w_) && (w_ < W) && (A[h_][w_] == '.') && (is_first[h_][w_] == 0)){
                    is_first[h_][w_] = k - 1;
                    Q.push(make_pair(make_pair(h_, w_), k - 1));
                }
            }
        }
    }
}

int main(){
    cin >> H >> W >> K;
    for(int h = 0; h < H; h++){
        cin >> A[h];
        for(int w = 0; w < W; w++){
            if(A[h][w] == 'S'){
                S_h = h;
                S_w = w;
            }
        }
    }
    go(S_h, S_w, K + 1);

    int ans = 1000;
    for(int h = 0; h < H; h++){
        for(int w = 0; w < W; w++){
            if(is_first[h][w]){
                int dist = min(h, min(H - 1 - h, min(w, W - 1 - w)));
                ans = min(ans, 1 + (dist + K - 1) / K);
            }
        }
    }
    cout << ans << endl;
    
}


Measured memory_bytes: 3584
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>

#define FOR(i, a, b) for (int i = (a); i < int(b); ++i)
#define RFOR(i, a, b) for (int i = (b)-1; i >= int(a); --i)
#define REP(i, n) FOR(i, 0, n)
#define REP1(i, n) FOR(i, 1, int(n) + 1)
#define RREP(i, n) RFOR(i, 0, n)
#define RREP1(i, n) RFOR(i, 1, int(n) + 1)
#define ALL(c) begin(c), end(c)

int _ = (
#ifndef LOCAL
    std::cin.tie(nullptr), std::ios::sync_with_stdio(false),
#endif
    std::cout.precision(10), std::cout.setf(std::ios::fixed));

using ll = long long;
using ull = unsigned long long;
using ld = long double;
template <typename T> using vec = std::vector<T>;
using namespace std;

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

  const int N = S.size();
  vec<string> x;
  string s;
  for (int i = 0; i < N;) {
    s = S.substr(i, 1);
    if (!x.empty() && s == x.back()) {
      s = S.substr(i, 2);
      i += 2;
    } else {
      i++;
    }
    x.emplace_back(s);
  }
  int answer = x.size();
  if (x.size() >= 2 && x[answer - 1] == x[answer - 2]) {
    answer--;
  }
  cout << answer << endl;
  return 0;
}


Measured memory_bytes: 11812