akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cmath>
#include <algorithm>
#include <stdio.h>
#include <cstring>
#include <string>
#include <cstdlib>
#include <vector>
#include <bitset>
#include <map>
#include <chrono>
#include <functional>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <queue>
#include <ctime>
#include <stack>
#include <set>
#include <list>
#include <deque>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <stdarg.h>
#include <utility>

using namespace std;

#define pb push_back
#define mp make_pair
#define ll long long
#define ull unisgned long long
#define ld long double
#define all(a) a.begin(), a.end()
#define SORT(a) sort(all(a))
#define pii pair<int, int>
#define tii triple<int, int, int>
#define e 1e-7
#define PI acos(-1)
#define sz(a) (int)(a.size())
#define inf 1e17
#define vi vector<int>
#define F first
#define S second
#define rng(x) for(int _ = 0; _ < (x); _++)
#define rngi(i, x) for(int i = 0; i < (x); i++)
#define rngsi(s, i, x) for(int i = (s); i <(x); i++)
#define int long long
#define problem ""

template<typename A, typename B, typename C>
struct triple{
    A X;
    B Y;
    C Z;
    triple(A a = 0, B b = 0, C c = 0) :X(a), Y(b), Z(c) {}
};
template<typename A, typename B, typename C>
triple<A, B, C> make_triple(A a = 0, B b = 0, C c = 0){
    return triple<A, B, C>(a, b, c);
}
template<typename A, typename B, typename C>
bool operator<(const triple<A, B, C>& a, const triple<A, B, C>& b){
    if (a.X != b.X)
        return a.X < b.X;
    if (a.Y != b.Y)
        return a.Y < b.Y;
    return a.Z < b.Z;
}
template<typename T, typename SS>
ostream& operator<<(ostream& ofs, const pair<T, SS>& p){
    ofs << "( " << p.F << " , " << p.S << " )";
    return ofs;
}
template<typename T>
void print(T a){
    for (auto i : a)
        cout << i << ' ';
    cout << '\n';
}
template<typename T>
T max(T a, T b, T c){
    return max(a, max(b, c));
}
template<typename T>
T min(T a, T b, T c){
    return min(a, min(b, c));
}
template<typename T, typename D>
D min(T a){
    return *min_element(all(a));
}
template<typename T, typename D>
D max(T a){
    return *max_element(all(a));
}
struct custom_hash{
    static uint64_t splitmix64(uint64_t x){
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const{
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
void solve(){
    int n ; cin >> n;
    rng(n){
        int x; cin >> x; if(x & 1) continue;
        if(x % 5 && x % 3) return void(cout << "DENIED\n");
    }
    cout << "APPROVED\n";
};
signed main()
{
    if(0){
        freopen(problem".in", "r", stdin);
        freopen(problem".out", "w", stdout);
    }
    srand(time(NULL));
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(false);
    int t = 1; //cin >> t;
    rng(t) solve();
}


Measured memory_bytes: 3652
#include<stdio.h>
int main()
{
    int N, m, min=10000001, i, sum=0, sum1=0, count=0;
    scanf("%d%d",&N, &m);
    int L[N];

    for(i=0; i<N; i++)
    {
        scanf("%d", &L[i]);
        sum += L[i];
        }

    for(i=0; i<N; i++)
        if(L[i] < min)
            min= L[i];
    int t_d = N + (m - sum) / min;
    printf("%d\n", t_d);

}

// Author: Sorowar Mahabub


Measured memory_bytes: 1724
from collections import deque
H,W=map(int, input().split())

A=[]
que=[]
done=[[-1]*W for _ in range(H)]
for h in range(H):
    a=list(input())
    A.append(a)
    for w in range(W):
        if a[w]=="#":
            que.append((h,w))
            done[h][w]=0

d=[(1,0),(-1,0),(0,1),(0,-1)]
que=deque(que)
ans=0
while que:
    h,w=que.popleft()
    now=done[h][w]
    for t in d:
        dh,dw=t
        nh=h+dh
        nw=w+dw
        if 0<=nh<H and 0<=nw<W:
            if done[nh][nw]==-1:
                done[nh][nw]=now+1
                que.append((nh,nw))
                ans=max(ans, now+1)



print(ans)


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

int main(){
	int m,f,r;
	while(1){
		scanf("%d %d %d",&m,&f,&r);
		if(m+f+r==-3) break;
		if(m==-1||f==-1) printf("F\n");
		else if(m+f>=80) printf("A\n");
		else if(m+f>=65) printf("B\n");
		else if(m+f>=50||(m+f>=30 && r>=50)) printf("C\n");
		else if(m+f>=30) printf("D\n");
		else printf("F\n");
	}
	return 0;
}

Measured memory_bytes: 1012
#include<bits/stdc++.h>
using namespace std;
string n;
vector<long long>v;
void dfs(long long now,int i,long long all)
{
	if(i==n.size())
	{
		all+=now;
		v.push_back(all);
		//cout<<all<<endl;
		return;
	}
	dfs(n[i]-'0',i+1,now+all);
	dfs(now*10+n[i]-'0',i+1,all);
}
int main()
{
	cin>>n;
	dfs(0,0,0);
	sort(v.begin(),v.end());
	//v.erase(unique(v.begin(), v.end()), v.end());
	long long x=0;
	for(int i=0;i<v.size();i++)x+=v[i];
	cout<<x/2;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

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

    int ma = 0;
    for (int i = 0; i < n; i++) {
        ma = max(ma, a[i]);
    }
    sort(b, b + n);
    reverse(b, b + n);

    int ans = 0;
    int c = 0;
    while (h > 0) {
        if (c < n && ma < b[c]) {
            h -= b[c];
            ans++;
            c++;
        } else {
            ans += (h + ma - 1) / ma;
            break;
        }
    }

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


Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < (int)n; i++)
#define all(x) x.begin(), x.end()
#define MOD 1000000007//1e9+7
typedef long long ll;
using namespace std;
int main()
{
  string sa, sb, sc;
  cin >> sa>> sb >>sc;
  queue<char > qa, qb, qc;
  int na = sa.size();
  int nb = sb.size();
  int nc = sc.size();
  char tmp;
  // REP(i,na){
  //   qa.push(sa[i]);
  // }
  // REP(i,nb){
  //   qb.push(sb[i]);
  // }
  // REP(i,nc){
  //   qc.push(sc[i]);
  // }
  // while(!qa.empty()){
  //   cout << qa.front() << endl;
  //   qa.pop();
  // }
  REP(i,na){
    qa.push(sa[i]);
  }
  REP(i,nb){
    qb.push(sb[i]);
  }
  REP(i,nc){
    qc.push(sc[i]);
  }

  int ta, tb, tc;
  ta = tb = tc = 0;
  tmp = sa[0];
  while(true){
    // cout << tmp << " ";
    if(tmp == 'a'){
      ta++;
      if(ta > na){
	cout << "A" <<endl;
	break;
      }
      tmp = qa.front();qa.pop();
      // cout << tmp << endl;
    }else if(tmp == 'b'){
      tb++;
      if(tb > nb){
	cout << "B" <<endl;
	break;
      }
      tmp = qb.front();qb.pop();
      // cout << tmp << endl;
    }else if(tmp == 'c'){
      tc++;
      if(tc > nc){
	cout << "C" <<endl;
	break;
      }
      tmp = qc.front();qc.pop();
      // cout << tmp << endl;
    }
  }
}


Measured memory_bytes: 256
from collections import Counter

n=int(input())
A=list(map(int,input().split()))
q=int(input())
 
counter = Counter(A)
sum_res = sum(A)
for _ in range (q):
       b,af = map(int,input().split())
       sum_res -= b*counter[b]
       sum_res += af*counter[b]
       
       counter[af] += counter[b]
       counter[b] = 0
       print(sum_res)
       

Measured memory_bytes: 94356
#include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
#include<queue>
#include<set>
#include<map>
#include<random>
#include<functional>
#include<utility>

#define rep(i,n) for(int i=0; i<n; i++)
#define pb push_back
#define P pair<int, int>
#define PLI pair<ll, int>

using namespace std;

typedef long long ll;


const int INF = 1e9;

int dx[] = { 0, 0, -1, 1 };
int dy[] = {-1, 1, 0, 0};

int H, W;
int A[35][35], dp[905][35][35];
int main() {
	cin >> H >> W;
	for (int i = 1; i <= H; i++) {
		for (int j = 1; j <= W; j++) {
			cin >> A[i][j];
		}
	}

	for (int i = 0; i <= H*W; i++) {
		for (int j = 0; j <= H + 1; j++) {
			for (int k = 0; k < W + 1; k++) {
				dp[i][j][k] = INF;
			}
		}
	}
	dp[0][1][1] = 0;

	for (int i = 0; i < H*W; i++) {
		for (int j = 1; j <= H; j++) {
			for (int k = 1; k <= W; k++) {
				for (int l = 0; l < 4; l++) {
					int nx = j + dx[l], ny = k + dy[l];
					dp[i + 1][nx][ny] = min(dp[i + 1][nx][ny], dp[i][j][k] + (2 * i + 1)*A[nx][ny]);
				}
			}
		}
	}

	int ans = INF;
	for (int i = 0; i <= H*W; i++) {
		ans = min(ans, dp[i][H][W]);
	}

	cout << ans << endl;

	return 0;
}



Measured memory_bytes: 7404
#include <iostream>
using namespace std;
int main() {
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	int N;
	cin >> N;
	int cur = 0;
	long long ans = 0;
	for (int i = 0; i < N; ++i) {
		int x;
		cin >> x;
		if (x == cur + 1) {
			++cur;
		}
		else if (x > cur) {
			ans += (x - 1) / (cur + 1);
		}
		if (cur == 0) cur = 1;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int A,B,C;
    cin >> A >> B >> C;
    int X;
    cin >> X;
    int count=0;
    for(int i=0; i<=A; i++)
    {
        for(int j=0; j<=B; j++)
        {
            for(int k=0; k<=C; k++)
            {
                if(X==(i*500+j*100+k*50))
                {
                    count++;
                }
            }
        }
    }
    cout << count << endl;
}

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

#define NREP() for(ll i = 0; i < n; i++)
#define REP(i, n) for(ll i = 0; i < n; i++)
#define ALL(x) (x).begin(), (x).end()
#define MSG(x) cout << x << endl;
#define IPT(t, x) t ipt; cin >> ipt; x.push_back(ipt);
#define YN(x) x ? cout << "YES" << endl : cout << "NO" << endl;
#define Yn(x) x ? cout << "Yes" << endl : cout << "No" << endl;
#define yn(x) x ? cout << "yes" << endl : cout << "no" << endl;

using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<string> vs;
typedef vector<vector<string>> vvs;

const static ll MOD = 1e9 + 7;
ll n, cnt, ans, tmp, sum, a, b, c, d, k, m, h, w, q, x, y;
string s, t;

int main() {
    vl a(3);
    cin >> a.at(0);
    cin >> a.at(1);
    cin >> a.at(2);
    sort(ALL(a));
    YN(a.at(0) == 5 && a.at(1) == 5 && a.at(2) == 7)
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
//#pragma GCC optimize("Ofast")
#define rep(i,n) for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
#define eb emplace_back
#define lb(v,k) (lower_bound(all(v),k)-v.begin())
#define ub(v,k) (upper_bound(all(v),k)-v.begin())
#define fi first
#define se second
#define pi M_PI
#define PQ(T) priority_queue<T>
#define SPQ(T) priority_queue<T,vector<T>,greater<T>>
using ll=long long;
using P=pair<ll,ll>;
using PP=tuple<ll,ll,ll>;
using S=multiset<ll>;
using vi=vector<ll>;
using vvi=vector<vi>;
using vvvi=vector<vvi>;
const ll inf=1001001001001001;
const int INF=1001001001;
const int mod=1000000007;
const double eps=1e-10;
template<class T> bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<class T> void out(T a){cout<<a<<'\n';}
template<class T> void outp(T a){cout<<'('<<a.fi<<','<<a.se<<')'<<'\n';}
template<class T> void outvp(T v){rep(i,v.size())cout<<'('<<v[i].fi<<','<<v[i].se<<')';cout<<'\n';}
template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<'\n';}
template<class T> void outvv(T v){rep(i,v.size())outv(v[i]);}
template<class T> bool isin(T x,T l,T r){return (l)<=(x)&&(x)<=(r);}
template<class T> void YesNo(T b){if(b)out("Yes");else out("No");}
void decimal(int x){cout<<fixed<<setprecision(x);}
//ll GCD(ll a,ll b){if(b==0) return a; return GCD(b,a%b);}
//ll LCM(ll a,ll b){return(a/GCD(a,b))*(b/GCD(a,b))*GCD(a,b);}
ll POW(ll a,ll b){a%=mod;if(b==0)return 1;if(b&1)return a*POW(a,b-1)%mod;ll k=POW(a,b/2);return k*k%mod;}
vi calc(ll x){vi res;while(x>0){res.eb(x%10);x/=10;}reverse(all(res));return res;}

const ll max_n=2000005;
vi fac(max_n),finv(max_n),inv(max_n);
// テーブルを作る前処理 O(max_n)
void init(){
	fac[0]=fac[1]=1;
	finv[0]=finv[1]=1;
	inv[1]=1;
	REP(i,2,max_n){
		fac[i]=fac[i-1]*i%mod;
		inv[i]=mod-inv[mod%i]*(mod/i)%mod;
		finv[i]=finv[i-1]*inv[i]%mod;
	}
}
// 二項係数計算 O(1)
ll COM(int n,int k){
	if(n<k) return 0;
	if(n<0||k<0) return 0;
	return fac[n]*(finv[k]*finv[n-k]%mod)%mod;
}
//init(); を忘れない！

void solve(){
  init();
  ll k;
  cin>>k;
  string s;
  cin>>s;
  ll n=s.size();
  ll ans=0;
  rep(i,k+1){
    ans=(ans+(POW(25,i)*COM(i+n-1,n-1))%mod*POW(26,k-i))%mod;
  }
  out(ans);
}

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


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

int main(){
    int a,b,c,x;
    cin >> a >> b >> c >> x;
    int ans = 0;
    for (int i = 0; i <= a; i++){
        for (int j = 0; j <= b; j++){
            for (int k = 0; k <= c; k++){
                int d = 500*i + 100*j + 50*k;
                if (d == x){
                    ans++;
                }
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define sc(n) scanf("%d",&n)
#define scl(n) scanf("%lld",&n)
#define pr(n) printf("%d",n)
#define prl(n) printf("%lld",n)
#define nl printf("\n")
#define fr(i,n) for(i=0;i<n;i++)
#define rep(i,st,en) for(i=st;i<=en;i++)
#define repv(i,en,st) for(i=en;i>=st;i--)
#define fout cout<<fixed<<setprecision(7)
#define bi(n) __builtin_popcount(n)
#define bil(n) __builtin_popcountll(n)


typedef long long ll;
typedef pair<int,int> pii;
const int N = 100010;
ll mod = 1e9+7;
ll fmod(ll b,ll exp){
    ll res =1;
    while(exp){if(exp&1ll)res=(res*b)%mod;
    b =(b*b)%mod;exp/=2ll;
    }
    return res;
}

ll A[N],pre[N];
ll dp[N];
ll diff(int i,int num)
{
    int ind = i-num-1;
    if(ind<0)return pre[i];
    else return (pre[i]-pre[ind]+mod)%mod;
}


int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    int t=1,n,i,j,m;
    int k;
    cin>>n>>k;
    rep(i,1,n)cin>>A[i];
    dp[0]=1;
    rep(i,0,k)pre[i]=1;
    rep(i,1,n)
    {
        for(int j=k;j>=0;j--)
        {
            dp[j]= diff(j,A[i]);
        }
        for(int j=1;j<=k;j++)
        {
            pre[j]=(pre[j-1]+dp[j])%mod;
        }

    }
    cout<<dp[k]<<"\n";

    
    return 0;
}


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

int main() {

    int n;
    cin >> n;

    long long power = 1;

    for(int i = 1; i < n + 1; i++)
    {
        power *= i;
        if(power / 1000000007 > 1) power %= 1000000007;
    }
    
    cout << power << endl;

}




Measured memory_bytes: 384
/* ***********************************************
Author        :taciturnity
Created Time  :2020/2/21 8:23:51
File Name     :TEST.cpp
************************************************ */
 
#include <iostream>
#include <vector>
#include <queue>
#include <cstdio>
#include <map>
#include <set>
#include <stack>
#include <string>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#define ll long long
#define INF 0x3f3f3f3f
#define rep(i,x,y) for(int i = x;i <= y;++i)
#define fori(i,x,y) for(int i = x;i >= y; -- i)
#define bug puts("--------------")
const int N = 2e5+10;
const double eps = 0.00000001;
const ll mod = 1e9 + 7 ;
using namespace std;
ll read()
{
    ll x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
ll fac[N];
ll Qpow(ll a,ll b,ll p){
    a = (a%p+p)%p;
    ll ans = 1;
    while(b){
        if(b&1) ans = ans * a % p;
        b >>= 1;
        a = a * a % p;
    }
    return ans;
}
ll C(ll n,ll m){
    return fac[n]*Qpow(fac[n-m]*fac[m]%mod,mod-2,mod)%mod;
}
void init(ll n){
    fac[0] = 1;
    rep(i,1,n){
        fac[i] = fac[i-1] * i%mod;
    }
}
int main(){
    int n = read(),k = read();
    init(N-10);
    k = min(k,n-1);
    ll ans = 0;
    rep(i,1,k){
        ans += C(n,i)*C(n-1,i)%mod;
        ans %= mod;
    }
    printf("%lld",(ans+1)%mod);
}

Measured memory_bytes: 1792
#include <iostream>

int main()
{
	int a, b, c;

	std::cin >> a >> b >> c;

	int total = a * 100 + b * 10 + c;

	bool ans;
	if (total % 4 == 0) {
		ans = true;
	} else {
		ans = false;
	}

	std::cout << (ans ? "YES" : "NO") << std::endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		long Q = sc.nextLong(), H = sc.nextLong(), S = sc.nextLong(), D = sc.nextLong();
		long N = sc.nextLong();
		long per_litter = Math.min(4 * Q, Math.min(2 * H, S));
		if(2 * per_litter < D) System.out.println(N * per_litter);
		else {
			long buy_D = (N - (N % 2)) / 2;
			System.out.println((N % 2) * per_litter + buy_D * D);
		}
	}
}

Measured memory_bytes: 22740
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;

int main() {
    int n, m; cin >> n >> m;
    vector<vector<int>> g(n);
    for (int i = 0; i < m; i++) {
        int a, b; cin >> a >> b;
        a--; b--;
        g[a].push_back(b);
    }
    vector<double> dp(n, 0), dp2(n, 0);
    double ans = numeric_limits<double>::max();
    for (int i = n - 2; i >= 0; i--) {
        double nax = 0;
        for (int u : g[i]) {
            dp[i] += dp[u];
            nax = max(nax, dp[u]);
        }
        if (g[i].size() == 1) dp2[i] = -1;
        else dp2[i] = (dp[i] - nax) / (g[i].size() - 1), dp2[i] += 1;
        dp[i] /= g[i].size();
        dp[i] += 1;
    }
    //cout << dp << endl;
    //cout << dp2 << endl;
    ans = min(ans, dp[0]);
    for (int i = n - 2; i >= 0; i--) {
        if (dp2[i] == -1) continue;
        vector<double> dp3 = dp;
        dp3[i] = dp2[i];
        for (int j = i - 1; j >= 0; j--) {
            dp3[j] = 0;
            for (int u : g[j]) {
                dp3[j] += dp3[u];
            }
            dp3[j] /= g[j].size();
            dp3[j] += 1;
        }
        //cout << i << " " << dp3 << endl;
        ans = min(ans, dp3[0]);
    }
    printf("%.10f\n", ans);
    return 0;
}

Measured memory_bytes: 1408
use proconio::input;

fn main() {
    input! {
        mut a: i64, b: i64, mut c: i64, d: i64,
    }
    let mut i = 0;
    while a > 0 && c > 0 {
        if i % 2 == 0 {
            c -= b;
        } else {
            a -= d;
        }
        i += 1;
    }
    let ret = if a <= 0 { "No" } else { "Yes" };
    println!("{}", ret);
}


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

long long f(int n){
    long long count=0;
    for(long long i=1;i*i+3+2*i<=n;i++){
        for(long long j=1;i*i+j*j+i*j+1+i+j<=n;j++){
            for(long long k=1;i*i+j*j+k*k+i*j+j*k+k*i<=n;k++){
                if(i*i+j*j+k*k+i*j+j*k+k*i==n){
                    count++;
                }
            }
        }
    }
    return count;
}

int main(void){
    // Your code here!
    long long N;cin>>N;
    for(long long i=1;i<=N;i++){
        cout<<f(i)<<endl;
    }
    return 0;
}


Measured memory_bytes: 3564
#include <iostream>

using namespace std;

int fib(int n);

int memo[45];

int main() {
  int n;

  //入力
  cin >> n;

  // 出力
  cout << fib(n) << endl;

  return 0;
}

int fib(int n){

  if(n == 0) return 1;
  else if(n == 1) return 1;
  else if(memo[n] != 0) return memo[n];
  else return memo[n] = fib(n-1) + fib(n-2);
}



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

int main(){
  string S, T;
  cin >> S >> T;
  int s_size = S.size(), t_size = T.size();
  int ans = 10000, tmp;
  for(int i = 0; i < s_size - t_size + 1; i++){
    tmp = t_size;
    for(int j = 0; j < t_size; j++){
      if(S.at(i + j) == T.at(j)) tmp--;
    }
    ans = min(ans, tmp);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3636
#include<cstdio>
using namespace std;
char s[1005];
int a[1005][1005];
int dx[4]={0,0,1,-1};
int dy[4]={1,-1,0,0};
int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	for (int i=1; i<=n; i++){
		scanf("%s",s);
		for (int j=0; j<m; j++)
			a[i][j+1]=(s[j]=='#');
	}
	for (int i=1; i<=n; i++)
		for (int j=1; j<=m; j++)
			if (a[i][j]){
				int flag=0;
				for (int k=0; k<4; k++){
					int fx=i+dx[k],fy=j+dy[k];
					if (i<1 || i>n || j<1 || j>m) continue;
					flag|=a[fx][fy];
				}
				if (!flag) {
					printf("No\n");
					return 0;
				}
			}
	printf("Yes\n");
	return 0;
}

Measured memory_bytes: 384
#include <stdio.h>

struct time{
	int h,m,s;
};

int main(){
	struct time ro,zan;

	while(1){
		scanf("%d %d %d",&ro.h,&ro.m,&ro.s);
		if(ro.h == -1 && ro.m == -1 && ro.s == -1){
			break;
		}

		zan.h = 2;
		zan.m = 0;
		zan.s = 0;

		zan.s -= ro.s;
		if(zan.s < 0){
			zan.m--;
			zan.s += 60;
		}
		zan.m -= ro.m;
		if(zan.m < 0){
			zan.h--;
			zan.m += 60;
		}
		zan.h -= ro.h;

		printf("%02d:%02d:%02d\n",zan.h,zan.m,zan.s);
		zan.s *= 3;
		zan.m *= 3;
		zan.h *= 3;
		if(zan.s >= 60){
			zan.m += zan.s/60;
			zan.s %= 60;
		}
		if(zan.m >= 60){
			zan.h += zan.m/60;
			zan.m %= 60;
		}
		printf("%02d:%02d:%02d\n",zan.h,zan.m,zan.s);
	}

	return 0;
}

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

int main(void){
    int n; cin >> n;
    int a[n]; int b[n];
    int cnt = 0;
    rep(i, n){
        cin >> a[i] >> b[i];
        if(a[i] == b[i]){
            cnt++;
            if(cnt == 3){cout << "Yes" << endl; return 0;}
        }
        else{cnt = 0;}
    }
    
    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
const ll MOD = 1000000007;
const int IINF = INT_MAX;
const ll LLINF = LLONG_MAX;
const int MAX_N = int(5e5 + 5);
const double EPS = 1e-10;
const 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 ALL(v) (v).begin(), (v).end()

string s;
int k=0;

int rec(){
    vector<int> ls;
    while(k<s.size()){
        if(s[k]=='['){
            k++;
            ls.push_back(rec());
        }
        else{
            int tmp=0;
            while(s[k]>='0' && s[k]<='9'){
                tmp *= 10;
                tmp += s[k]-'0';
                k++;
            }
            k++;
            if(tmp>0)return tmp/2+1;
            break;
        }
    }
    int res=0;
    SORT(ls);
    REP(i,int(ls.size())/2+1){
        res += ls[i];
    }
    return res;
}

int main() {
    int n;
    cin >> n;
    REP(i,n){
        cin >> s;
        k=0;
        cout << rec() << endl;
    }
    return 0;
}



Measured memory_bytes: 3188
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const long long mod = 1e9 + 7;

ll gcd(ll a, ll b) {
	return b ? gcd(b, a % b) : a;
}

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

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

	int ac = 0;
	int wa = 0;
	vector<int> tmpWa(100010);

	map<int, bool> mp;
	vector<pair<int, string>> vp(m);

	for (int i = 0; i < m; i++) {
		int num;
		string s;
		cin >> num >> s;
		mp[num] = false;
		vp[i] = make_pair(num, s);
	}

	for (auto a : vp) {
		int f = a.first;
		string s = a.second;
		if (!mp[f]) {
			if (s == "AC") {
				ac++;
				wa += tmpWa[f];
				mp[f] = true;
			} else {
				tmpWa[f]++;
			}
		}
	}

	cout << ac << " " << wa << endl;

}


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

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

int main() {
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
	string s; cin>>s;
	cout << (s.front()==s.back() ? "Yes" : "No") << endl;
	return 0;
}


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

int main()
{
    int q,a,b;
    string str,cmd,p;
    cin>>str;
    cin>>q;
    for (int i =0;i<q;++i)
    {
        cin>>cmd;
        if (cmd == "replace"){
            cin>>a>>b>>p;
            str = str.replace(str.begin()+a,str.begin()+b+1,p);
        }
        if (cmd == "reverse"){
            cin>>a>>b;
            reverse(str.begin()+a,str.begin()+b+1);
        }
        if (cmd == "print"){
            cin>>a>>b;
            cout << str.substr(static_cast<unsigned long long int>(a), static_cast<unsigned long long int>(b - a + 1)) << endl;
        }
    }
    return 0;
}



Measured memory_bytes: 3228
#include <map>
#include <set>
#include <cmath>
#include <ctime>
#include <queue>
#include <stack>
#include <bitset>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <cstring>
#include <iostream>
#include <algorithm>

#define fi first
#define se second
#define pb push_back
#define MP std::make_pair
#define PII std::pair<int, int>
#define all(x) (x).begin(), (x).end()
#define CL(a, b) memset(a, b, sizeof a)
#define rep(i, l, r) for (int i = (l); i <= (r); ++ i)
#define per(i, r, l) for (int i = (r); i >= (l); -- i)
#define PE(x, a) for (int x = head[a]; x;x = edge[x].next)

typedef long long ll;

const int MAXN = 3e5 + 7;

ll n, x, d, ans;
std::map<ll, std::vector<std::pair<ll, ll> > >  s;

int main() {
	std::cin >> n >> x >> d;
	if (d < 0) d = -d, x = -x;
	if (!d) {
		printf("%lld\n", !x ? 1ll : n + 1ll);
		return 0;
	}
	rep(k, 0, n) {
		ll s = x * k + d * (k * (k - 1ll) / 2ll);
        ll t = x * k + d * ((n - 1ll) * k - k * (k - 1ll) / 2);
        if (s <= t) {
        	ll r = s % d;
        	if (r < 0) r += d;
        	s -= r; t -= r;
        	::s[r].push_back(MP(s / d - 1, t / d));
        }
	}
	for (auto i : s) {
		auto vev = i.se;
		std::sort(all(vev));
		ll r = LLONG_MIN;
		for (auto v: vev) {
			ans += std::max(0ll, v.se - std::max(r, v.fi));
			r = std::max(r, v.se);
		}
	}
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 22144
#include <cstdlib>
#include <iostream>
#include <string>
#include <vector>
typedef long long LL;

int main() {
  int N, K; std::cin >> N >> K;
  if ((N+1)/2 >=  K) std::cout << "YES" << std::endl;
  else             std::cout << "NO" << std::endl;
}


Measured memory_bytes: 256
package main

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

func main() {
	io, flush := NewIO()
	defer flush()

	n := io.ScanInt()
	nums := io.ScanInts(n)

	var count int
	for i := 0; i < n-2; i++ {
		for j := i+1; j < n-1; j++ {
			if nums[i] == nums[j] {
				continue
			}
			for k := j+1; k < n; k++ {
				if nums[i] == nums[k] || nums[j] == nums[k] {
					continue
				}
				max := nums[i]
				if nums[j] > max {
					max = nums[j]
				}
				if nums[k] > max {
					max = nums[k]
				}
				if max < nums[i]+nums[j]+nums[k]-max {
					count++
				}
			}
		}
	}
	fmt.Println(count)
}

type IO struct {
	scanner *bufio.Scanner
	writer  *bufio.Writer
}

func NewIO() (*IO, func()) {
	io := &IO{
		scanner: newScanner(),
		writer:  newWriter(),
	}
	return io, func() { io.writer.Flush() }
}

func newScanner() *bufio.Scanner {
	s := bufio.NewScanner(os.Stdin)
	s.Buffer(make([]byte, 10000000), 10000000)
	s.Split(bufio.ScanWords)
	return s
}

func newWriter() *bufio.Writer {
	return bufio.NewWriter(os.Stdout)
}

func (io *IO) ScanBytes() []byte {
	if !io.scanner.Scan() {
		panic("scan string failed")
	}
	return io.scanner.Bytes()
}

func (io *IO) ScanString() string {
	if !io.scanner.Scan() {
		panic("scan string failed")
	}
	return io.scanner.Text()
}

func (io *IO) ScanStrings(n int) []string {
	strs := make([]string, n)
	for i := 0; i < n; i++ {
		strs[i] = io.ScanString()
	}
	return strs
}

func (io *IO) Scan2DStrings(y, x int) [][]string {
	strings := make([][]string, y)
	for i := 0; i < y; i++ {
		strings[i] = io.ScanStrings(x)
	}
	return strings
}

func (io *IO) Scan2DGraph(y int) [][]string {
	strs := make([][]string, y)
	for i := 0; i < y; i++ {
		strs[i] = strings.Split(io.ScanString(), "")
	}
	return strs
}

func (io *IO) ScanInt() int {
	return int(io.ScanInt64())
}

func (io *IO) ScanInt2() (int, int) {
	return int(io.ScanInt64()), int(io.ScanInt64())
}

func (io *IO) ScanInt3() (int, int, int) {
	return int(io.ScanInt64()), int(io.ScanInt64()), int(io.ScanInt64())
}

func (io *IO) ScanInt4() (int, int, int, int) {
	return int(io.ScanInt64()), int(io.ScanInt64()), int(io.ScanInt64()), int(io.ScanInt64())
}

func (io *IO) ScanInts(n int) []int {
	ints := make([]int, n)
	for i := 0; i < n; i++ {
		ints[i] = io.ScanInt()
	}
	return ints
}

func (io *IO) Scan2DInts(y, x int) [][]int {
	ints := make([][]int, y)
	for i := 0; i < y; i++ {
		ints[i] = io.ScanInts(x)
	}
	return ints
}

func (io *IO) ScanInt64() int64 {
	i, err := strconv.ParseInt(io.ScanString(), 10, 64)
	if err != nil {
		panic(err)
	}
	return i
}

func (io *IO) ScanFloat64() float64 {
	i, _ := strconv.ParseFloat(io.ScanString(), 64)
	return i
}

func (io *IO) ScanFloat64s(n int) []float64 {
	floats := make([]float64, n)
	for i := 0; i < n; i++ {
		floats[i] = io.ScanFloat64()
	}
	return floats
}

func (io *IO) Println(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}


Measured memory_bytes: 2172
import java.io.*;

public class Main {

	final static long MOD = 1000000007;
	public static String[] Ws = null;
	public static int wsIndx = 0;
	public static BufferedReader in = null;
	public static void main(String[] args) throws Exception {

		int N = nextInt();
		long ans =0;
		for(int i=1;i<=N;i++){
			if(i%5==0||i%3==0){

			}else{
				ans+=i;
			}
		}

		System.out.println(ans);

	}

	public static boolean isPalindromicStr(String s) {
		int h = 0;
		int t = s.length() - 1;
		while (h <= t) {
			if (s.charAt(h) != s.charAt(t)) {
				break;
			}
			h++;
			t--;
		}
		if (h > t) {
			return true;
		}
		return false;
	}


	public static void check() throws Exception{
		if(in == null){
			in = new BufferedReader(new InputStreamReader(System.in));
		}
		if(Ws==null || Ws.length<=wsIndx){
			Ws = in.readLine().split(" ");
			wsIndx=0;
		}
	}
	public static int nextInt()throws Exception{
		check();
		return Integer.parseInt(Ws[wsIndx++]);
	}

	public static long nextLong()throws Exception{
		check();
		return Long.parseLong(Ws[wsIndx++]);
	}

	public static String nextString()throws Exception{
		check();
		return Ws[wsIndx++];
	}

	public static int[] nextInts()throws Exception{
		check();
		int[] tmp = new int[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Integer.parseInt(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static long[] nextLongs()throws Exception{
		check();
		long[] tmp = new long[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Long.parseLong(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static String[] nextStrings()throws Exception{
		check();
		wsIndx=Ws.length;
		return Ws;
	}


}


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

using namespace std;

int main(int argc, char* argv[])
{
  vector<string> person(3); cin >> person[0] >> person[1] >> person[2];

  int cur = 0;
  while (1) {
    if (person[cur].size() == 0) {
      break;
    }
    int next = person[cur][0] - 'a';
    person[cur] = person[cur].substr(1);
    cur = next;
  }

  cout << (char)('A'+cur) << endl;
  return 0;
}


Measured memory_bytes: 256
def get_i() #空白区切の入力を数値(整数)の配列で返す
  return gets.chomp.split(" ").map(&:to_i)
end
def get_f() #空白区切の入力を数値(実数)の配列で返す
  return gets.chomp.split(" ").map(&:to_f)
end
def get() #空白区切の入力を文字列の配列で返す
  return gets.chomp.split(" ")
end
def get_nsp() #入力されたものを一文字ずつに区切った文字列の配列で返す
  return gets.chomp.split("")
end
def yn_judge(bool,y="Yes",n="No") #boolに真偽を投げることで、trueならy、falseならnの値を出力する
  return bool ? y : n 
end
def array(size,n=1,init=nil) #nに配列の次元数、sizeに配列の大きさ、initに初期値を投げることでその配列を返す
  if n==1
    return Array.new(size){init}
  else
    return Array.new(n).map{Array.new(size){init}}
  end
end

n=gets.to_i
i=1
while i<=n
  if (i%3).zero? or i.to_s.split("").count("3")>0
  print " "
  print(i)
  end
  i+=1
end
print("\n")


Measured memory_bytes: 7400
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
int  main()
{


	ios_base::sync_with_stdio(false);
	cin.tie(NULL);


	int n, m;
	cin >> n >> m;
	vector <bool> arr(n + 1, true);
	int x;

	for (int i = 0; i < m; i++)
	{
		cin >> x;
		arr[x] = false;
	}
	// if (arr[0] == false)
	// {
	// 	cout << 0;
	// 	return 0;
	// }
	vector <int> dp(n + 1, 0);
	if (arr[0])
		dp[0] = 1;
	if (arr[1] && arr[0])
		dp[1] = 1;

	for (int i = 2; i <= n; i++)
	{
		for (int j = 1; j <= 2; j++)
		{

			if (arr[i] && arr[i - j])
				dp[i] += dp[i - j];
			dp[i] %= mod;

		}
	}
	// for (int i = 1; i <= n; i++)
	// {
	// 	cout << dp[i] << " ";
	// 	// arr[x] = true;
	// }
	cout << dp[n];
}

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

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

	int ans = 400;
	int sum = 0;
	rep(i, n){
		int aji = l + i;
		sum += aji;
		if(abs(ans) > abs(aji)) ans = aji;
	}

	cout << sum - ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int a[10000];
int x, n;
int main() {
	scanf("%d", &x);
	while (a[x] < 2) {
		a[x]++;
		if (x % 2)x = 3 * x + 1;
		else x /= 2;
		n++;
	}
	printf("%d\n", n - 2);
}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <functional>
#include <stdio.h>
#include <string.h>
using namespace std;

struct Graph {
    struct Edge {
        bool operator>(Edge o) { return d > o.d; }
        int d, i;
    };
    Graph(int n) : e(n), v(n) {}
    void add_edge(int i, int j, int l) {
        e[i].push_back({ l, j });
    }
    void dijkstra(int i) {
        priority_queue<Edge, vector<Edge>, greater<>> q;
        fill(v.begin(), v.end(), 1 << 30);
        q.push({ v[i] = 0, i });
        while (!q.empty()) {
            auto p = q.top(); q.pop();
            if (p.d > v[p.i]) continue;
            for (auto o : e[p.i]) {
                int d = p.d + o.d;
                if (d < v[o.i]) {
                    v[o.i] = d;
                    q.push({ d, o.i });
                }
            }
        }
    }
    int abc051_d() {
        int k = 0;
        for (int i = 1; i < e.size(); i++) {
            dijkstra(i);
            for (auto o : e[i]) {
                if (o.i < i && v[o.i] < o.d) k++;
            }
        }
        return k;
    }
    vector<vector<Edge>> e;
    vector<int> v;
};

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

    int n, m;
    cin >> n >> m;
    Graph g(n);
    for (int i = 0; i < m; i++) {
        int a, b, c;
        cin >> a >> b >> c;
        a--; b--;
        g.add_edge(a, b, c);
        g.add_edge(b, a, c);
    }

    cout << g.abc051_d() << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,a,b) for (i=a;i<b;i++)
#define rep2(i,a,b) for (i=a;i>=b;i--)
#define mod 1000000007
#define mod2 998244353
#define FIO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define INF  1e9+5
#define f first
#define s second
#define endl '\n'
#define ll long long
#define ii pair <int,int>
#define pll pair <ll,ll>
#define vi vector <int>
#define vl vector <ll>
#define vvi vector < vi >
#define vii vector < ii >
#define vpl vector < pll >
#define vvii vector < vii >
#define vll vector < ll >
#define vb  vector <bool>
#define pb push_back
#define mk make_pair
#define eb emplace_back
#define pg priority_queue<ll, vector<ll>, greater<ll>>
#define pq priority_queue<ll>
#define sz(a) a.size()
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define cset(a) __builtin_popcountll(a)
#define FILL(a, b, T) fill_n((T *)a, sizeof(a) / sizeof(T), b)
#define debug(x) cerr << #x << " is " << x << endl;
using namespace std;
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
#define pis pair<ll,pll>
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a << endl;
    err(++it, args...);
}
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }
 
    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
// unordered_map<long long, int, custom_hash> safe_map;
// FOR VIEWERS, CODE STARTS HERE

int main()
{
    
    FIO;
    ll t, q, n, m, prev, maxx,  i, j, k1, k2, k3, k, x, y, flag, sum, cnt, ans, minn, cur;
    cin>>x;
    ans = 100;
    i = 0;
    double an = 100.00;
    if( an >= x)
    {
        cout<<i<<endl;
        return 0;
    }
    while(true and i < 1e7)
    {
        i++;
        an *= 1.01;
        // an /= 100; 
        // cout<<i<<" "<<an<<endl;
        if( an >= x)
        {
            cout<<i<<endl;
            return 0;
        }
        an = floor(an);
    }
    return 0;    
}


Measured memory_bytes: 3652
#include<bits/stdc++.h>
using ll=long long;
using namespace std;
#define rep(i, n) for(ll i=0; i<n; i++)
#define Rep(i, j, n) for(ll i=j; i<n; i++)
#define all(vec) vec.begin(), vec.end()
template<class T> inline bool chmin(T& a, T b) {if(a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if(a < b) {a = b; return true;} return false;}

int main(){
  ll x,k,d;
  cin>>x>>k>>d;
  int minu=0;
  if(x<0){x=-x;minu=1;}
  ll q=x/d;
  ll r1=x%d;
  if(q>k){
    cout<<x-k*d<<endl; return 0;
  }
  if(r1==0){
    if((k-q)%2==0)cout<<0<<endl;
    else cout<<d<<endl;
    return 0;
  }
  
  ll r2=d-r1;
  if((k-q)%2==0){
    cout<<abs(r1)<<endl;
  }else{
    cout<<abs(r2)<<endl;
  }
  
    
    
  return 0;
}


Measured memory_bytes: 3652
import java.util.*;
import java.lang.*;

public class Main {
 public static void main(String args[]){
	
	Scanner sc = new Scanner(System.in);
	int D = sc.nextInt();
	int N = sc.nextInt();
	
	int a = (int)Math.pow(100,D);

  if (N != 100){
	System.out.println( a*N );

  }else{
	System.out.println( a*(N+1) );
  }
 }
}

Measured memory_bytes: 22612
n,a,b,c,d=map(int,input().split())
s=list(input())
ch=0
ch1=0

if d<c:
  for i in range(a,c):
    if s[i]=='#':
      if s[i-1]=='#':
        ch+=1
  for j in range(b,d):
    if s[j]=='#':
      if s[j-1]=='#':
        ch+=1
  for k in range(b-1,d):
    
    if s[k-1]=='.' and s[k]=='.' and s[k+1]=='.':
      ch1+=1
      
  if ch==0 and ch1>0:
    print('Yes')
  else:
    print('No')
    
else:
  for i in range(a,c):
    if s[i]=='#':
      if s[i-1]=='#':
        ch+=1
  for j in range(b,d):
    if s[j]=='#':
      if s[j-1]=='#':
        ch+=1
  if ch==0:
    print('Yes')
  else:
    print('No')

Measured memory_bytes: 10708
import java.util.Scanner;

class Main {  
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    
    while (in.hasNext()){
      int n = in.nextInt();
      if (n == 0) break;
      int[] numbers = new int[n];
      long double_sum = 0;
      long sum_double = 0;
      
      for (int i = 0; i < n; i++) {
        numbers[i] = in.nextInt();
        double_sum += numbers[i];
      }
      double_sum = double_sum * double_sum;
      for (int i = 0; i < n; i++) sum_double += (numbers[i] * numbers[i]);
      
      double sd = Math.sqrt((sum_double - double_sum / (double)n) / (double)n);
      
      System.out.printf("%5.8f", sd);
      System.out.println();
    }
  }
}

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

int main(){

    int A, B;
    cin >> A >> B;

    if(A == B){
        cout << "IMPOSSIBLE" << endl;
    }else if( (A + B)%2 != 0){
        cout << "IMPOSSIBLE" << endl;
    }else{
        cout << (A + B)/2 << endl;
    }

    return 0;
}

Measured memory_bytes: 256
/**Bismillahir Rahmanir Rahim.**/
#include<bits/stdc++.h>
#include<stdlib.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<cstring>
#include<cstdio>
using namespace std;
typedef long long int            ll;
typedef long double              ld;
#define Faster  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pi                 acos(-1);
#define test        int t; cin>>t; while(t--)
//scanf("%[^\n]%*c", str);
//sort(s,s+n,greater<int>());
//cin.getline(array,size);
int main()
{
    char a;
    cin>>a;
    if(a>='A'&&a<='Z')
        cout<<"A"<<endl;
    else
        cout<<"a"<<endl;
}


Measured memory_bytes: 3616
#coding:utf-8
from collections import Counter
n = int(input())
A = list(map(int,input().split()))
c = Counter(A)
ans = 0
for i in c.items():
    if i[1]>=i[0]:
        ans += i[1]-i[0]
    else:
        ans += i[1]
print (ans)

Measured memory_bytes: 18672
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>

#define ll long long

using namespace std;

const int N = 110;
const int mod = 10007;

inline int read() {
	int jg = 0, jk = getchar() - '0', f = 1;
	while(jk < 0 || jk > 9) {
	    if(jk == '-' - '0')  f = -1;
		jk = getchar() - '0';
	}
	while(jk >= 0 && jk <= 9)
		jg *= 10, jg += jk, jk = getchar() - '0';
	return jg * f;
}

int n, xa[N], ya[N], ha[N], h;

int main() {
	//freopen("a.txt", "r", stdin);
    n = read();
	for(int i = 1; i <= n; ++i)
		xa[i] = read(), ya[i] = read(), ha[i] = read();
	for(int i = 0; i <= 100; ++i)
		for(int j = 0, l; j <= 100; ++j) {
			l = 1;
			for(int k = 1; k <= n; ++k)
				if(ha[k]) {
					h = ha[k] + abs(i - xa[k]) + abs(j - ya[k]);
					break;
				}
			for(int k = 1; k <= n; ++k)
				if(max(0, h - abs(i - xa[k]) - abs(j - ya[k])) != ha[k]) {
					l = 0;
					break;
				} 
			if(l) {
				printf("%d %d %d\n", i, j, h);
				return 0;
			}
		}
	return 0;
}

Measured memory_bytes: 3716
#include <iostream>
#include <cmath>
#include <cassert>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <numeric>
#include <queue>
#include <type_traits>
#include <fstream>
//#include <bits/stdc++.h>

typedef long long ll;
const ll INF = (ll)1e18 + 1;
const ll MOD = 1e9 + 7;

// print(x, y, z);
// printVec(va.begin(), va.end());
void print(){ std::cout << std::endl; }
template <typename Head> void print(Head&& head) { std::cout << head << std::endl; }
template <typename Head, typename... Tail> void print(Head&& head, Tail&&... tail)
{
  std::cout << head << " ";
  print(std::forward<Tail>(tail)...); // or print(tail...);
}
template<typename Iterator> void printVec(Iterator begin, Iterator end)
{
  for (Iterator it = begin; it != end; it++) {
    std::cout << "[" << it - begin << "] " << *it << " ";
    if ((it - begin) % 20 == 19 || it == end - 1) { std::cout << std::endl; }
  }
}
template<typename Iterator> void printVecPair(Iterator begin, Iterator end)
{
  for (Iterator it = begin; it != end; it++) {
    std::cout << "[" << it - begin << "] " << it->first << " " << it->second << " ";
    if ((it - begin) % 10 == 9 || it == end - 1) std::cout << std::endl;
  }
}

struct UnionFind {
public:
  std::vector<ll> par;
  std::vector<ll> rank;
  std::vector<ll> size;
  std::vector<ll> diff_weight;

  UnionFind(ll N){
    par         = std::vector<ll>(N+1, 0LL);
    rank        = std::vector<ll>(N+1, 0LL);
    size        = std::vector<ll>(N+1, 1LL);
    diff_weight = std::vector<ll>(N+1, 0LL);
    for (ll i = 0; i <= N; i++) par[i] = i;
  }

  ll find(ll x){
    if (par[x] == x) return x;
    ll root = find(par[x]);
    diff_weight[x] += diff_weight[par[x]];
    par[x] = root;
    return root;
  }

  void unite(ll x, ll y, ll w) {
    w += get_weight(x);
    w -= get_weight(y);

    x = find(x);
    y = find(y);
    if (x == y) return;

    size[x] += size[y];
    size[y] = size[x];

    if (rank[x] < rank[y]) std::swap(x, y), w = -w;
    if (rank[x] == rank[y]) rank[x]++;

    par[y] = x;
    diff_weight[y] = w;
    //print(x, y, diff_weight[x], diff_weight[y]);

    return;
  }

  bool is_same(ll x, ll y){
    return find(x) == find(y);
  }

  ll get_size(ll x){
    return size[find(x)];
  }

  ll get_weight(ll x){
    find(x);
    return diff_weight[x];
  }

  ll get_diff(ll x, ll y){
    //print("diff", y, x, get_weight(y), get_weight(x));
    return get_weight(y) - get_weight(x);
  }
};

int main(int argc, char* argv[])
{
  ll N, M;
  std::cin >> N >> M;
  std::vector< std::pair<ll, ll> > vp(M);
  for (ll i = 0; i < M; i++) {
    std::cin >> vp[i].first >> vp[i].second;
    vp[i].first--;
    vp[i].second--;
  }

  UnionFind islands(N);

  ll cur = N * (N-1) / 2;
  std::vector<ll> ans(M, 0LL);
  for (ll i = M-1; i >= 0; i--) {
    ans[i] = cur;
    if (islands.is_same(vp[i].first, vp[i].second)) continue;
    cur -= islands.get_size(vp[i].first) * islands.get_size(vp[i].second);
    islands.unite(vp[i].first, vp[i].second, 0);
  }

  for (ll i = 0; i < M; i++) {
    print(ans[i]);
  }

  return 0;
}


Measured memory_bytes: 6784
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,m;
    cin >> n >> m;
    vector<int> l(m);
    vector<int> r(m);
    for(int i=0; i<m; i++){
        cin >> l[i] >> r[i];
    }

    int ans=0;
    int mxl;
    int mnr;
    mxl = *max_element(l.begin(),l.end());
    mnr = *min_element(r.begin(),r.end());
    if(mxl<=mnr) ans = mnr-mxl+1;
    cout << ans << endl;
}




Measured memory_bytes: 1024
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
const int Q=1<<19;
int las[Q],e[Q],nn[Q],inc=0;
void ins(int x,int y)
{
    e[++inc]=y;
    nn[inc]=las[x];
    las[x]=inc;
}
int mlen[Q],als=0;
void dfs(int x,int last)
{
    int l0=0,l1=0;
    for(int t=las[x];t;t=nn[t]){
        int y=e[t];
        if(y==last)continue;
        dfs(y,x);
        int val=mlen[y]+1;
        if(val>l0)l1=l0,l0=val;
        else l1=max(l1,val);
    }
    als=max(als,l0+l1);
    mlen[x]=l0;
}
int main()
{
    int n;
    scanf("%d",&n);
    for(int i=1,x,y;i<n;i++)
        scanf("%d%d",&x,&y),ins(x,y),ins(y,x);
    dfs(1,0);
    puts(als%3==1?"Second":"First");
    return 0;
}

Measured memory_bytes: 22144
#include <iostream>
#include<algorithm>
using namespace std;
static const int MAX = 1000;
static const int VMAX = 10000;

int n,A[MAX], s;
int B[MAX], T[VMAX+1];

int solve(){
	int ans = 0;
	
	bool V[MAX];
	for(int i=0; i<n; i++){
		B[i] = A[i];
		V[i] = false;
	}
	sort(B, B+n);
	for(int i = 0; i<n; i++) T[B[i]] = i;
	for(int i = 0; i<n; i++){
		if( V[i] ) continue;
		int cur = i;
		int S = 0;
		int m = VMAX;
		int an = 0;
		while( 1 ){
			V[cur] = true;
			an++;
			int v = A[cur];
			m = min(m,v);
			S += v;
			cur = T[v];
			if ( V[cur] ) break;
		}
		ans += min(S + (an - 2)* m, m+S+(an+1)*s);
	}
	return ans;
}


int main(){
	cin >> n;
	s = VMAX;
	for(int i=0; i<n; i++){
		cin >> A[i];
		s = min(s, A[i]);
	}
	int ans = solve();
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 3172