akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
using namespace std;

int main(){
  int N;
  cin >> N;
  int H[N];
  int max = 0;
  int count = 0;
  for (int i = 0; i < N; ++i) {
    cin >> H[i];
    if(H[i] >= max){
      count++;
      max = H[i];
    }
  }
  
  cout << count << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <numeric>
#include <set>
#include <stack>
#include <queue>
#include <time.h>

using namespace std;
typedef long long ll;
#define pl pair<ll,ll>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define foreach(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); itr++)
#define dbg(x) cout << #x"="<< (x) << endl
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back(a) 
#define in(x) cin >> x;
#define all(x) (x).begin(), (x).end()
#define INF 2147483600
#define fi first
#define se second

int n, s;//n 1~9 s 0~100
int ans=0;
//?????????????????¶.i??????????????????j??¨??????
//??\????????????????????????????????§????????????????????\???????????????.
int solve(int i,int j, int k){
	if(i==n){
		if(k==s)ans++;
	}else{
		FOR(l,j+1,10){
			if(k+l<=s){
				solve(i+1,l,k+l);
			}	
		}
	}
	return ans;
}


int main(){
	while(cin>>n>>s&&(n||s)){
		ans=0;
		cout<<solve(0,-1,0)<<endl;
	}
    return 0;
}

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

int main(){
	int n, i;
	double p = 0;
	cin >> n;
	vector<double> a(n);
	for (i = 0; i < n; i++){
		cin >> a[i];
		a[i] = 1.00 / a[i];
		p += a[i];
	}
	cout << setprecision(99) << 1.00 / p << endl;
	return 0;
}



Measured memory_bytes: 256
import numpy as np
import scipy.sparse.csgraph as csg
n=int(input())
g=np.array([list(map(int,input().split())) for _ in range(n)],dtype=np.uint32)
g2=csg.floyd_warshall(g,directed=False)
if np.any(g!=g2):
  print(-1)
else:
  g[g==0]=2*10**9
  t=0
  for i in range(n):
    for j in range(i+1,n):
      m=np.min(g[i]+g[j])
      if m>g[i,j]:
        t+=g[i,j]
  print(t)

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


#define li          long long int
#define rep(i,to)   for(li i=0;i<((li)(to));i++)
#define repp(i,start,to)    for(li i=(li)(start);i<((li)(to));i++)
#define pb          push_back
#define sz(v)       ((li)(v).size())
#define bgn(v)      ((v).begin())
#define eend(v)     ((v).end())
#define allof(v)    (v).begin(), (v).end()
#define dodp(v,n)       memset(v,(li)n,sizeof(v))
#define bit(n)      (1ll<<(li)(n))
#define mp(a,b)     make_pair(a,b)
#define rin rep(i,n)
#define EPS 1e-12
#define ETOL 1e-8
#define MOD 1000000007
typedef pair<li, li> PI;

#define INF bit(60)

#define DBGP 1


#define idp if(DBGP)
#define F first
#define S second
#define p2(a,b)     idp cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)       idp cout<<a<<"\t"<<b<<"\t"<<c<<endl
#define p4(a,b,c,d)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<endl
#define p5(a,b,c,d,e)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<endl
#define p6(a,b,c,d,e,f)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<endl
#define p7(a,b,c,d,e,f,g)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<endl
#define p8(a,b,c,d,e,f,g,h)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<endl
#define p9(a,b,c,d,e,f,g,h,i)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<endl
#define p10(a,b,c,d,e,f,g,h,i,j)        idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<"\t"<<j<<endl
#define foreach(it,v)   for(__typeof((v).begin()) it=(v).begin(); it!=(v).end(); ++it)
#define p2p(x)      idp p2((x).F, (x).S)
#define dump(x,n)   idp{rep(i,n){cout<<x[i]<<" ";}puts("");}
#define dump2(x,n)  idp{rep(i,n){cout<<"["<<x[i].F<<" , "<<x[i].S<<"] ";}puts("");}
#define dumpi(x)    idp{foreach(it, x){cout<<(*it)<<" ";}puts("");}
#define dumpi2(x)   idp{foreach(it, x){cout<<"["<<(it)->F<<" , "<<(it)->S<<"] ";}puts("");}

#define read2d(a,w,h)   rep(i,h)rep(j,w)cin>>a[i][j]
#define dump2d(a,w,h)   rep(i,h){rep(j,w)cout<<a[i][j]<<" ";puts("");}

typedef pair<li, li> PI;

li n, k;
li a[200200];
int main() {
    cin >> n >> k;
    rin{
        cin >> a[i];
    }
    sort(a, a + n);
    li res = 0;
    rep(i, n - k) {
        res += a[i];
    }
    cout << res << endl;

    return 0;
}

Measured memory_bytes: 5200
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e5+5;
int main()
{
   int n,a[N],low=3000000;
   cin>>n;
   int cnt=0;
   for(int i=0;i<n;i++)
   {
       cin>>a[i];
       if(a[i]<low) {low=a[i];cnt++;}
   }
   cout<<cnt;
    return 0;
}


Measured memory_bytes: 1024
#include <stdio.h>

int main(){
    int x, y;
    while(1){
        scanf("%d %d", &x, &y);
        if(x==0 && y==0)break;
        if(x<y){
            printf("%d %d\n", x, y);
        }else{
            printf("%d %d\n", y, x);
        }
    }
    return 0;
}


Measured memory_bytes: 2684
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define P pair<int,int>
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1000000000
#define MOD 1000000007
#define all(v) v.begin(),v.end()
#define pb push_back
int dx[]={0,1,0,-1},dy[]={1,0,-1,0};
int kaijo[200010];
struct edge{int to,cost;};
int gcd(int a,int b){
	if(b==0)return a;
	return gcd(b,a%b);
}
int lcm(int a,int b){
	return a/gcd(a,b)*b;
}
bool prime(int a){
	if(a==1)return false;
	for(int i=2;i*i<=a;i++){
		if(a%i==0)return false;
	}
	return true;
}
bool kosa(double ax,double ay,double bx,double by,double cx,double cy,double dx,double dy){//線分の交差判定
	double ta=(cx-dx)*(ay-cy)+(cy-dy)*(cx-ax);
	double tb=(cx-dx)*(by-cy)+(cy-dy)*(cx-bx);
	double tc=(ax-bx)*(cy-ay)+(ay-by)*(ax-cx);
	double td=(ax-bx)*(dy-ay)+(ay-by)*(ax-dx);
	return tc*td<0&&ta*tb<0;
}
void init_fact(int n){
	kaijo[0]=1;
	for(int i=1;i<=n;i++){
		kaijo[i]=kaijo[i-1]*i;
		kaijo[i]%=MOD;
	}
}
int modpow(int a,int b){
	if(b==0)return 1;
	if(b%2)return modpow(a,b-1)*a%MOD;
	int memo=modpow(a,b/2);
	return memo*memo%MOD;
}
int comb(int a,int b){
	return kaijo[a]*modpow(kaijo[a-b],MOD-2)%MOD*modpow(kaijo[b],MOD-2)%MOD;
}
int g(int x){
	x=modpow(x,MOD-2);
	return x;
}
int n;
signed main(){
	cin>>n;
	//1 9
	//3 900
	//5 90000
	string s=to_string(n);
	if(s.size()==6)cout<<90909<<endl;
	if(s.size()==5){
		cout<<909+n-9999<<endl;
	}
	if(s.size()==4)cout<<909<<endl;
	if(s.size()==3)cout<<9+n-99<<endl;
	if(s.size()==2)cout<<9<<endl;
	if(s.size()==1)cout<<n<<endl;
	return 0;
}


Measured memory_bytes: 256
#解説チラ見
n,m = map(int,input().split())
ans = n
pre = [i for i in range(n)]
for _ in range(m):
  x,y,z = map(lambda x: int(x)-1, input().split())
  X = [x]
  while pre[x] != x:
    x = pre[x]
    X.append(x)
  Y = [y]
  while pre[y] != y:
    y = pre[y]
    Y.append(y)
  if x != y:
    ans -= 1
    for xx in X:
      pre[xx] = y
    for yy in Y:
      pre[yy] = y
    pre[x] = y
print(ans)

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

using namespace std;

#define all(v) (v).begin(), (v).end()

struct operation
{
    long long range, replacement;

    operation(){}

    operation(int Range, int New)
    {
        range = Range, replacement = New;
    }

    const int operator <(operation & A)
    {
        return (replacement > A.replacement);
    }
};

int main()
{
    int no_of_elements, no_of_operations;
    cin >> no_of_elements >> no_of_operations;

    vector <long long> A(no_of_elements, 0);
    for(int i = 0; i < no_of_elements; i++)
        cin >> A[i];

    sort(all(A));

    vector <operation> O(no_of_operations);
    for(int i = 0; i < no_of_operations; i++)
        cin >> O[i].range >> O[i].replacement;

    sort(all(O));

    int last_operation = 0;
    for(int current = 0; current < no_of_elements && last_operation < no_of_operations;)
    { //cout << "Replacement = " << O[last_operation].replacement << " Range = " << O[last_operation].range << endl;

        for(int current_operations_remaining = O[last_operation].range; current_operations_remaining > 0 && current < no_of_elements; current_operations_remaining--)
        {
            A[current] = max(A[current], O[last_operation].replacement);

            current++;
        }

        last_operation++;
    }

    long long sum = 0;
    for(int i = 0; i < no_of_elements; i++)
        sum += A[i];

    cout << sum;
    return 0;
}


Measured memory_bytes: 2560
import java.util.*;
import java.io.*;

class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
    
            int a = scan.nextInt();
            int b = scan.nextInt();
            int C = scan.nextInt();
            
            double x = Math.sin(Math.toRadians(C));
            double y = Math.cos(Math.toRadians(C));
            double E = Math.sqrt(a*a + b*b - 2*a*b*y);
            double S = 0.5*a*b*x;
            double L = a + b + E;
            double h = S*2/a;

            System.out.println(S);
            System.out.println(L);
            System.out.println(h);
        
    }
}

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

int n;
int m[200][200];
int p[200];

int matrixChainMultiplication(){
    for (int i = 1; i <= n; i++){
        m[i][i] = 0;
    }
    for (int l = 2; l <= n; l++){
        for (int i = 1; i <= n-l+1; i++){
            int j = i+l-1;
            m[i][j] = 1001001001;
            for (int k = i; k <= j-1; k++){
                m[i][j] = min(m[i][j], m[i][k] + m[k+1][j] + p[i-1]*p[k]*p[j]);                
            }
        }
    }
    return m[1][n];
}

int main() {
    cin >> n;
    rep(i, n){
        int a, b; cin >> a >> b;
        p[i] = a;
        p[i+1] = b;
    }
    int ans = matrixChainMultiplication();

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3132
#include <stddef.h>
#include <iostream>
#include <vector>
using namespace std;
int main() {
  int g;
  vector<int> v;
  while (cin >> g) {
    v.clear();
    for (int i = 0; i < 10; i++)
      if (g & (1 << i)) v.push_back(1 << i);
    cout << v[0];
    for (size_t i = 1; i < v.size(); i++)
      cout << ' ' << v[i];
    cout << endl;
  }
}

Measured memory_bytes: 1208
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
  
using namespace std;
using namespace __gnu_pbds;
 
#define ll long long
#define uint unsigned int
#define ull  unsigned long long
#define pb push_back
#define mk make_pair
#define ins insert
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define X first
#define Y second
#define umap unordered_map
#define speed() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define setvalue(d,s,e,n) for(int qwe = s; qwe < e; ++qwe) d[qwe] = n
#define mset multiset
#define pqueue priority_queue
   
template<class T> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
        
const int  N = 2e5 + 314;
const int INF = 1e9;
const double PI = acos(-1);
const int MOD = 1e9 + 7;
const double eps = 1e-9;
const long long LINF = 1e18 + 3141;
 
void solve(){
    // 
    ll a;
    cin >> a;
    cout << a + a * a + a * a * a << "\n";
}
 
int main(){
    speed();
    int t = 1;
    // cin >> t;
    while(t--)solve();
}

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

int main(){
  int N, K, X, Y;
  cin >> N >> K >> X >> Y;
  
  int cost;
  cost = 0;
  
  for(int i=0; i<N; i++){
    if(i<K){
      cost = cost + X;
    }
    else{
      cost = cost + Y;
    }
  }
  cout << cost << endl;  
}

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

int main() {
    int n, d;
    cin >> n >> d;
    int cnt = 0;
    vector<int> x(n);
    vector<int> y(n);

    for (int i = 0; i < n; i++) {
        cin >> x.at(i) >> y.at(i);
        long long int a = x.at(i);
        long long int b = y.at(i);
        if (sqrt(a * a + b * b) <= d) {
            cnt++;
        }
    }

    cout << cnt << endl;

    return 0;
}


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

// @@ !! LIM()

int main(int argc, char *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << setprecision(20);

  ll N; cin >> N;
  vector<ll> V(N+1);
  for (ll i = 2; i <= N; i++) {
    ll a; cin >> a;
    V.at(a)++;
  }
  for (ll i = 1; i <= N; i++) {
    cout << V.at(i) << "\n";
  }

  return 0;
}



Measured memory_bytes: 4780
#include<iostream>
#include<string>
using namespace std;
int main() {
int x;
string a;
getline(cin,a);
for( x=0; x<a.size(); x++){
if( a[x] == 'a' && a[x+1] == 'p' && a[x+2] == 'p' && a[x+3] == 'l' && a[x+4] == 'e'){
a[x] = 'p';
a[x+1] = 'e';
a[x+2] = 'a';
a[x+3] = 'c';
a[x+4] = 'h';
}else if( a[x] == 'p' && a[x+1] == 'e' && a[x+2] == 'a' && a[x+3] == 'c' && a[x+4] == 'h'){
a[x] = 'a';
a[x+1] = 'p';
a[x+2] = 'p';
a[x+3] = 'l';
a[x+4] = 'e';
}
}
cout << a << endl;
  return 0;
}


Measured memory_bytes: 3080
a,b = map(int,input().split())
if a == b:
    print('Draw')
elif 1 < a < b:
    print('Bob')
elif 1 < b < a:
    print('Alice')
elif a == 1 and a != b:
    print('Alice')
elif b == 1 and a != b:
    print('Bob')

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

int int_len(int n) {
  int s=0;
  while(n!=0) s++, n/=10;
  return s;
}

int int_sum(int n) {
  int m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10;
  return m;
}






int ggcd(int a,int b)
{
 
  int r, tmp;
 
  
 
  /* 自然数 a > b を確認・入替 */
  if(a<b){
    tmp = a;
    a = b;
    b = tmp;
  }
 
  /* ユークリッドの互除法 */
  r = a % b;
  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }
 
 
 
  return b;
}







int fac(int n){
  int m=1;
  while(n>=1) m*=n,n--;
  return m;
}

int vec_sum(vector<int> v){
  int n=0;
  for(int i=0;i<v.size();i++) n+=v[i];
  return n;
}
///////////////////////////
int main() {
  string s,a;
  int count=0,n;
  cin>>s;
  rep(i,s.size()){
    if(i%2==0){
      a+='1';
    }else{
      a+='0';
    }
  }
  rep(i,s.size()){
    if(s[i]==a[i]) count++;
  }
  n=s.size()-count;
  cout<<min(count,n)<<endl;
}
///////////////////////////


Measured memory_bytes: 640
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    // 文字数
    int a = sc.nextInt();
    // 文字数
    String b = sc.next();

    char[] c = b.toCharArray();

    int result = 0;
    for (int i = 0; i < a - 2; i++) {
      if (c[i] == 'A' && c[i + 1] == 'B' && c[i + 2] == 'C') {
        result++;
      }
    }
    System.out.println(result);
  }
}


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


int main()
{
  ll MOD = 1000000007;
  int n;
  cin >> n;
  vector<vector<int>> a(n, vector<int>(n));
  rep(i, n)
    rep(j, n)
      cin >> a[i][j];
  vector<ll> dp(1<<n, 0);
  dp[0] = 1;
  rep(i, 1<<n)
  {
    int c = __builtin_popcount(i);
    rep(j, n)
      if ((i>>j&1) == 0 && a[c][j])
        dp[i|1<<j] = (dp[i|1<<j] + dp[i]) % MOD;
  }
  cout << dp[(1<<n)-1] << endl;
  return 0;
}

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

using namespace std;
using ll = long long;

int main() {
    bool ans = false;

    vector<vector<int> > A(3,vector<int>(3));
    for (size_t i = 0; i < 3; i++)
    {
        for (size_t j = 0; j < 3; j++)
        {
            cin >> A.at(i).at(j);
        }
        
    }

    int N = 0;
    cin >> N;
    vector<int> l(N,0);
    for(int i = 0; i < N; i++) {
    cin >> l.at(i);
    for (size_t j = 0; j < 3; j++)
    {
        for (size_t k = 0; k < 3; k++)
        {
            if (A.at(k).at(j) == l.at(i))
            {
                A.at(k).at(j) = 0;
            }
            
        }
        
    }
    
    }
    for (size_t i = 0; i < 3; i++)
    {
        if(A.at(0).at(i) == A.at(1).at(i) && A.at(2).at(i) == A.at(1).at(i))ans = true;
        if(A.at(i).at(0) == A.at(i).at(1) && A.at(i).at(1) == A.at(i).at(2))ans = true;
    }
    
    if(A.at(0).at(0) == A.at(1).at(1) && A.at(2).at(2) == A.at(1).at(1))ans = true;
    if(A.at(0).at(2) == A.at(1).at(1) && A.at(2).at(0) == A.at(1).at(1))ans = true;

    


    
    

    if(ans) {
    cout << "Yes" << endl;
    } else {
    cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 3604
from collections import deque
num = int(input())
A = deque()

for i in range(num):
    queryi = list(map(int, input().split()))

    if queryi[0] == 1:
        print(A[queryi[1]])

    elif queryi[0] == 2:
        if queryi[1] == 0:
            A.popleft()
        else:
            A.pop()

    else:
        if queryi[1] ==0:
            A.appendleft(queryi[2])
        else:
            A.append(queryi[2])


Measured memory_bytes: 21976
#include <set>
#include <map>
#include <list>
#include <stack>
#include <queue>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
#define int long long


signed main(void){
  int n;
  vector<int> l;

  cin >> n;
  for(int i = 0; i < 2*n; i++){
    l.push_back(0);
    cin >> l[i];
  }

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

  int ret = 0;
  for(int i = 0; i < 2*n; i+=2){
    ret += l[i];
  }

  cout << ret << "\r\n";

}


Measured memory_bytes: 256
#define TEST_MODE true
 
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
 
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep2(i, a, b) for (int i = (a); i < (int)(b); ++i)
#define rrep(i, n) for (int i = (n)-1; i >= 0; --i)
#define rrep2(i, a, b) for (int i = (a)-1; i >= (int)b; --i)
#define range(i, a, b, c) for (int i = a;		\
                               c > 0 ? i < b : i > b;	\
                               i += c)
#define chmax(a, b) (a = (a) < (b) ? (b) : (a))
#define chmin(a, b) (a = (a) > (b) ? (b) : (a))
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define all(a) a.begin(), a.end()
#define ifnot(a) if (not(a))
#define int long long
 
#if TEST_MODE == true
const bool test = true;
#define dump(x) cerr << #x << " = " << (x) << " "
#define dumpl(x) cerr << #x << " = " << (x) << " " << endl;
#else
const bool test = false;
#define dump(x) 
#define dumpl(x) 
#endif
 
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
const int INF = (int)1 << 60;
const ll INFL = (ll)1 << 60;
ll mod_n = (int)1e9 + 7;
const double eps = 1e-10;
typedef long double Real;
// return -1, 0, 1
int sgn(const Real &r) { return (r > eps) - (r < -eps); }
int sgn(const Real &a, const Real &b) { return sgn(a - b); }
 
//.....................
const int MAX = (int)2e5 + 5;
 
vector<string> split(const string &str, char sep)
{
  vector<string> v;
  stringstream ss(str);
  string buffer;
  while (getline(ss, buffer, sep))
    {
      v.push_back(buffer);
    }
  return v;
}
 
template <class InputIterator>
int sum(InputIterator begin, InputIterator end)
{
  return accumulate(begin, end, 0ll);
}
 
template<typename T>
T gcd(T a, T b)
{
  T c;
  while (a != 0) {
    c = a; a = b%a;  b = c;
  }
  return b;
}
 
class Solver {
public:
  int N;
  vector<int> a;

  void solve() {
    cin >> N;
    a.resize(N);
    rep(i, N) cin >> a[i];
    
    int cnt = 0;
    rep(i, N) {
      while (a[i] % 2 == 0) {
        a[i] /= 2;
        cnt += 1;  
      }
    }
    cout << cnt << endl;
  }
};
 
signed main()
{
  srand(time(NULL));
  cout << fixed << setprecision(20);
  auto ptr = new Solver();
  ptr->solve();
  delete ptr;
  // while (true) {    
  //     auto ptr = new Solver();
  //     ptr->solve();
  //     delete ptr;
  // }
  return 0;
}
 
// class Mycin {
// 	bool flag = true;
// public:
// 	Mycin& operator >> (int& a) {flag = scanf("%lld", &a) != EOF; return *this;}
// 	Mycin& operator >> (char& a) {flag = scanf("%c", &a) != EOF; return *this;}
// 	Mycin& operator >> (string& s) {flag = (bool)(cin >> s); return *this;}
// 	operator bool() {return flag;}
// } mycin;
 
// class Mycout {
// public:
// 	Mycout& operator << (const int& a) {printf("%lld", a); return *this;}
// 	Mycout& operator << (const char c) {printf("%c", c); return *this;}
// 	Mycout& operator << (const string& s) {printf("%s", s.c_str()); return *this;}
// } mycout;
 
// #define cin mycin
// #define cout mycout
// #define endl '\n'


Measured memory_bytes: 384
#include<stdio.h>
#include<iostream>
#include<vector>
#include <fstream>
#include<math.h>
#include <numeric>
#include<algorithm>
#include <stdlib.h>
# include <map>

using namespace std;

int main(){
int n,i;
cin >> n >> i;
cout << n-i+1 << endl;
}

Measured memory_bytes: 256
def main04():
    data = input().split()
    heilist = []
    for i in range(200):
        kari = (i+1)*(i+1)
        heilist.append(kari)
    nd = []
    dislist = []
    resultnum = 0
    for i in range(2):
        nd.append(int(data[i]))
    for i in range(nd[0]):
        kari = input().split()
        karilist = []
        for j in range(nd[1]):
            karilist.append(int(kari[j]))
        dislist.append(karilist)
    for i in range(0,nd[0]-1,1):
        for j in range(i+1,nd[0],1):
            heihou = 0
            for k in range(nd[1]):
                heihou = heihou + (dislist[i][k] - dislist[j][k]) * (dislist[i][k] - dislist[j][k])
            for k in range(200):
                if heihou == heilist[k]:
                    resultnum = resultnum + 1
                    break
    print(resultnum)

if __name__ == "__main__":
    main04()

Measured memory_bytes: 3064
# atcoder : python3 (3.4.3)
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
mod = 10**9+7

# main
N,K = map(int,input().split())
AB = [list(map(int,input().split())) for _ in range(N)]

Cnt = [0]*(10**5+1)
for a,b in AB:
    Cnt[a] += b

i = 1
for ci in range(len(Cnt)):
    if i <= K < i+Cnt[ci]:
        print(ci)
        sys.exit()
    else:
        i += Cnt[ci]

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

#define faster  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

#define sq(x)   (x)*(x)
#define PI      acos(-1.0)
#define nl      '\n'

typedef long long int ll;
typedef unsigned long long int  llu;

int main()
{
    int A[10],ans;
    cin>>A[0]>>A[1]>>A[2]>>A[3]>>A[4];
    for(int i=0; i<5; i++)
    {
        if(A[i]==0)
        {
             ans=i+1;
             break;
        }

    }
    cout<<ans<<nl;
    return 0;
}


Measured memory_bytes: 3620
package main

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

func main() {
	n := readI()
	P, Q := make([]int, n), make([]int, n)
	for i := 0; i < n; i++ {
		P[i] = readI()
	}
	for i := 0; i < n; i++ {
		Q[i] = readI()
	}

	if isLager(P, Q) {
		P, Q = Q, P
	}

	i := 0
	for ; !isSame(P, Q); i++ {
		nextPermutation(P)
	}

	fmt.Println(i)
}

func isLager(a, b []int) bool {
	for i := 0; i < len(a); i++ {
		if a[i] != b[i] {
			if a[i] > b[i] {
				return true
			}
			return false
		}
	}
	return false
}

func isSame(a, b []int) bool {
	for i := 0; i < len(a); i++ {
		if a[i] != b[i] {
			return false
		}
	}
	return true
}

func nextPermutation(p []int) bool {
	swap := func(a []int, b, c int) {
		a[b], a[c] = a[c], a[b]
	}
	rev := func(s []int) {
		for i := 0; i < len(s)/2; i++ {
			swap(s, i, len(s)-1-i)
		}
	}

	l, r := len(p)-2, len(p)-1

	for p[l] >= p[l+1] {
		if l == 0 {
			rev(p)
			return false
		}
		l--
	}
	for p[l] >= p[r] {
		r--
	}

	swap(p, l, r)
	rev(p[l+1:])
	return true
}

/*-----------Input utils-----------*/

var sc = bufio.NewScanner(os.Stdin)

func init() {
	if len(os.Args) >= 2 {
		if os.Args[1] == "debug" {
			debug()
		}
	}
	const buf = 200100
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, buf), buf)
}

func debug() {
	testFile, err := os.Open("./test/sample-2.in")
	if err != nil {
		fmt.Fprintln(os.Stderr, "There is no testfile.")
		os.Exit(1)
	}
	sc = bufio.NewScanner(testFile)
}

func readS() string {
	sc.Scan()
	return sc.Text()
}

func readR() []rune {
	return []rune(readS())
}

func readI() int {
	i, _ := strconv.Atoi(readS())
	return i
}

func readF() float64 {
	f, _ := strconv.ParseFloat(readS(), 64)
	return f
}


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

int main(){
  int n,m;
  cin>>n>>m;
  int ans;
  ans=(n-m)*100+m*1900;
  rep(i,m){
    ans*=2;
  }
  cout<<ans<<endl;
}



Measured memory_bytes: 3576
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <iomanip>
#include <cassert>
#include <bitset>
using namespace std;

#define rep(i, n) for (int i=0; i<(n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define index(xs, x) (int)(lower_bound(all(xs), x) - xs.begin())
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007
struct UF {
  int U[400000];
  UF(int N) {
    rep(i, N) U[i] = i;
  }
  int find(int x) {
    if (U[x] == x) return x;
    return U[x] = find(U[x]);
  }
  void unite(int x, int y) {
    x = find(x), y = find(y);
    U[x] = y;
  }
};

int N;
int U[400000];
bool dead[400000];
int A[400000], B[400000]; // 0, 1

signed main() {
  ios::sync_with_stdio(false); cin.tie(0);
  cin >> N;
  U[0] = -1;
  rep(i, N-1) {
    cin >> U[i+1];
    U[i+1]--;
  }
  rep(i, N) {
    int x; cin >> x;
    if (x == 0) A[i]++;
    else B[i]++;
  }
  UF uf(2*N);

  typedef pair<double, int> P;
  priority_queue<P, vector<P>, greater<P> > q;
  for (int i=1; i<N; i++) q.push(P((double)B[i]/(double)A[i], i));

  int V = N;
  long long sum = 0;
  while (!q.empty()) {
    int x = q.top()._2;
    q.pop();
    if (dead[x]) continue;
    int p = uf.find(U[x]);
    dead[x] = dead[p] = true;
    int root = V++;
    U[root] = U[p];
    uf.unite(x, root);
    uf.unite(p, root);
    //cout<<x<<"->"<<p<<" (root="<<root<<")\n";
    sum += 1LL*B[p]*A[x];
    A[root] = A[p] + A[x];
    B[root] = B[p] + B[x];
    if (U[root] != -1) {
      q.push(P((double)B[root]/(double)A[root], root));
    }
  }
  cout << sum << "\n";
  return 0;
}


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

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define itn long long

typedef long long ll;
typedef pair<ll,ll> p;


int main()
{
  int n, m;
  cin >> n >> m;
  vector<p> v(m, {0, 0});

  for (int i = 0; i < m; i++)
  {
    cin >> v[i].second >> v[i].first;
  }
  sort(all(v));
  int res = 1;
  // cout << v[0].first << endl;
  // for(auto a : v) cout << a.first << " : " << a.second << endl;
  // cout << "==========--" << endl;

  for (int i = 0; i < m; i++)
  {
    if(v[i].second >= v[0].first){
      res++;
      v[0].first = v[i].first;
      // cout << v[0].first << " : " << i << endl;
    }
  }

  cout << res << endl;



}

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

using namespace std;

map<int, int> mp;
int n, x, tot, tmp;
int main() 
{
    cin>>n;
    for (int i = 0; i < n; i++)
    {
        scanf("%d", &x);
        if (mp.find(x-1) != mp.end())
        {
            tmp = mp[x-1];
            mp.insert(make_pair(x, tmp+1));
            if (tot<=tmp+1) tot=tmp+1;
        }
        else 
        {
            mp.insert(make_pair(x, 1));
            tot = max(tot, 1);
        }
    }
    cout<<n-tot<<endl;
    return 0;
}

Measured memory_bytes: 9600
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define debug(x) cerr<<#x<<": "<<x<<endl
#define trav(a,x) for(auto &a:x)
#define all(x) x.begin(),x.end()
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
ll solve(ll a, ll b) {
    assert((b-a)%2==0);
    return (b-a)/2;
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll n,a,b;
    cin>>n>>a>>b;
    ll ans = -1;
    if(a>b) swap(a,b);
    if((b-a)%2==0) {
        ans = (b-a)/2;
    }
    else {
        ans =  min(a+solve(1,b-a), n-b+1+solve(a+(n-b+1),n));
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]
DX = [-1, -1, 0, 1, 1, 1, 0, -1]
DY = [0, 1, 1, 1, 0, -1, -1, -1]

for i in range(h):
    for j in range(w):
        if s[i][j] == '.':
            c = 0
            for y, x in zip(DY, DX):
                y = i + y
                x = j + x
                if y < 0 or x < 0 or w - 1 < x or h - 1 < y:
                    continue
                if s[y][x] == '#':
                    c += 1
            s[i][j] = c

for i in s:
    print(*i, sep='')


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

ll gcd(ll x, ll y);
int fac(ll n, vector<int> num);

const int INF = 1001001001;

//mint�p�̒萔 (10��9��)
const int mod = 1000000007;

struct mint {
    ll x; // typedef long long ll;
    mint(ll x = 0) :x((x% mod + mod) % mod) {}
    mint operator-() const { return mint(-x); }
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod - a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this; }
    mint operator+(const mint a) const { return mint(*this) += a; }
    mint operator-(const mint a) const { return mint(*this) -= a; }
    mint operator*(const mint a) const { return mint(*this) *= a; }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const { return pow(mod - 2); }
    mint& operator/=(const mint a) { return *this *= a.inv(); }
    mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream& operator>>(istream & is, const mint & a) { return is >> a.x; }
ostream& operator<<(ostream & os, const mint & a) { return os << a.x; }

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

    rep(i, 3) {
        if (n[i] == '1') {
            cout << '9';
        }
        else {
            cout << '1';
        }
    }

    return 0;
}

/*���C�u�����ő����*/
//���[�O���b�h�̌ݏ��@
ll gcd(ll x, ll y) {
    ll num[3];
    num[0] = (x > y) ? x : y;
    num[1] = (x <= y) ? x : y;
    num[2] = num[0] % num[1];

    while (num[2]) {
        num[0] = num[1];
        num[1] = num[2];
        num[2] = num[0] % num[1];
    }

    return num[1];
}

/*�f��������*/
//���색�C�u����
int fac(ll n, vector<int> num) {
    ll kazu = n;
    for (int i = 2; i <= sqrt(n); i++) {
        while (1) {
            if (kazu % i != 0) break;

            kazu /= i;
            num[i]++;
        }
    }
    if (kazu == n && n != 1) return 1;
    int ans = 0;
    if (kazu != 1) ans++;
    for (int i = 2; i <= sqrt(n); i++) {
        for (int j = 1; j <= num[i]; j++) {
            num[i] -= j;
            ans++;
        }
    }
    return ans;
}

Measured memory_bytes: 3612
#include <stdio.h>
#define MAX 100000

int partition(int *, int, int);

int main() {
  int i, n, q;
  int A[MAX];

  scanf("%d", &n);
  for ( i = 0; i < n; i++ ) scanf("%d", &A[i]);

  q = partition(A, 0, n - 1);

  for ( i = 0; i < n; i++ ) {
    if (i != q ) printf("%d", A[i]);
    else printf("[%d]", A[i]);

    if ( i < n - 1 ) printf(" ");
  }
  printf("\n");

  return 0;
}

int partition(int *A, int p, int r) {
  int x, i, j, temp;

  x = A[r];
  i = p - 1;

  for ( j = p; j < r; j++ ) {
    if ( A[j] <= x ) {
      i++;
      temp = A[i];
      A[i] = A[j];
      A[j] = temp;
    }
  }
  temp = A[i+1];
  A[i+1] = A[r];
  A[r] = temp;
  
  return i+1;
}

Measured memory_bytes: 996
class UF():
    def __init__(self, N: int):
        self.parent = [-1 for _ in range(N)]

    def root(self, A: int) -> int:
        if self.parent[A] < 0:
            return A
        self.parent[A] = self.root(self.parent[A])
        return self.parent[A]

    def size(self, A: int) -> int:
        return -self.parent[self.root(A)]

    def connect(self, A: int, B: int) -> bool:
        A = self.root(A)
        B = self.root(B)
        if A == B:
            return False
        if self.size(A) < self.size(B):
            A, B = B, A
        self.parent[A] += self.parent[B]
        self.parent[B] = A
        return True


def main():
    N, M = map(int, input().split())
    A = []
    B = []
    for _ in range(M):
        a, b = map(int, input().split())
        A.append(a - 1)
        B.append(b - 1)
    ans = [0 for _ in range(M)]
    ans[M - 1] = (N * (N - 1)) // 2
    uf = UF(N)
    for i in range(M - 1, 0, -1):
        ans[i - 1] = ans[i]
        if uf.root(A[i]) != uf.root(B[i]):
            ans[i - 1] -= uf.size(A[i]) * uf.size(B[i])
            uf.connect(A[i], B[i])

    for a in ans:
        print(a)


main()


Measured memory_bytes: 18640
///----> bismillahir rahmanir rahim <---- -- { ^ _ ^ }
///     { ^_^ }   { ^ _ ^ }



#include<bits/stdc++.h>
using namespace std;


typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi; ///VECTOR<VECTOR<INT>NAME>NAME 2
typedef vector<vl> vvl;///LONG LONG
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;///VECTOR WITH PAIR
typedef vector<pll> vll;
typedef double dl;

#define endl "\n"
#define PB push_back
#define F first
#define S second
#define as(a) (a).begin(),(a).end()
#define ras(a) (a).rbegin(),(a).rend()
#define sz(x) (int)x.size()

const double PI = acos(-1);
const double eps = 1e-9;
const int inf = 2000000000;
const ll infLL = 9000000000000000000;
#define MOD 1000000007

#define over return 0;

#define mem(a,b) memset(a, b, sizeof(a) )
#define sqr(a) ((a) * (a))

#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)
void faltu () {            cerr << endl;}
template < typename T, typename ... hello>void faltu( T arg, const hello &... rest) {cerr << arg << ' ';faltu(rest...);}

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


///--------> YOUR JOURNEY STARTS HERE <-------



int main(){


float n,x,t;
cin>>n>>x>>t;
float y=ceil(n/x);
cout<<int(y*t)<<endl;
over
}


Measured memory_bytes: 3652
#include<string>
#include<iostream>
#include<vector>
using namespace std;


int main()
{
	int n;
	int sum = 0;

	/*
	char c = '3';
	cout << (int)(c-'0')<<endl;
	*/
	cin >> n;
	
	for(int i=0;i<n;i++){
		string str1, str2;
		cin >> str1 >> str2;
		int s = 1;
		int mcxi1 = 0, mcxi2=0;
		for(int j=0;j<str1.size();j++){
			int temp=0;
			 if(str1[j]=='m'){
				 temp+=1000*s;
				 s=1;
			 }else if(str1[j]=='c'){
				 temp+=100*s;
				 s=1;
			 }else if(str1[j]=='x'){
				 temp+=10*s;
				 s=1;
			 }else if(str1[j]=='i'){
				 temp+=s;
				 s=1;
			 }else{
				 s=(int)(str1[j]-'0');
			 }
			 mcxi1+=temp;
		}
		//cout << mcxi1<<endl;
		for(int j=0;j<str2.size();j++){
			int temp=0;
			 if(str2[j]=='m'){
				 temp+=1000*s;
				 s=1;
			 }else if(str2[j]=='c'){
				 temp+=100*s;
				 s=1;
			 }else if(str2[j]=='x'){
				 temp+=10*s;
				 s=1;
			 }else if(str2[j]=='i'){
				 temp+=s;
				 s=1;
			 }else{
				 s=(int)(str2[j]-'0');
			 }
			 //cout<<temp<<endl;
			 mcxi2+=temp;
		}
		//cout<<mcxi<<endl;
		int mcxi = mcxi1+mcxi2;
		//cout << mcxi << endl<<endl;
		string ans ="";
		int sen = mcxi/1000;
		if(sen==1){
			ans+="m";
		}else if(sen>0){
			ans+=(char)(sen+'0');
			ans+="m";
		}
		if(sen>0){
			mcxi-=sen*1000;
		}
		//cout << mcxi << endl;

		int hyaku = mcxi/100;
		if(hyaku==1){
			ans+="c";
		}else if(hyaku>0){
			ans+=(char)(hyaku+'0');
			ans+="c";
		}
		if(hyaku>0){
			mcxi-=hyaku*100;
		}
		//cout << mcxi << endl;

		int ju = mcxi/10;
		if(ju==1){
			ans+="x";
		}else if(ju>0){
			ans+=(char)(ju+'0');
			ans+="x";
		}
		if(ju>0){
			mcxi-=ju*10;
		}
		//cout << mcxi << endl;

		if(mcxi==1){
			ans+="i";
		}else if(mcxi>0){
			ans+=(char)(mcxi+'0');
			ans+="i";
		}
		//cout << mcxi << endl;
		cout << ans <<endl;
	}
	//cout<<sum<<endl;
	return 0;
}

Measured memory_bytes: 1208
import bisect
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
A=[0]
B=[0]
for i in range(n):
  A.append(A[-1]+a[i])
for i in range(m):
  B.append(B[-1]+b[i])
ans=[0]
for i in range(n+1):
  x=k-A[i]
  if x>=0:
    y=bisect.bisect(B,x)
    ans.append(i+y-1)
print(max(ans))

Measured memory_bytes: 127036
package main

import "fmt"

func main() {
	var m = map[string]int{
		"SUN": 7,
		"MON": 6,
		"TUE": 5,
		"WED": 4,
		"THU": 3,
		"FRI": 2,
		"SAT": 1,
	}
	var s string
	fmt.Scan(&s)
	fmt.Println(m[s])

	return
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define DO long double
#define pb push_back
#define pfr push_front
#define eb emplace_back
#define ef emplace_front
#define gc getchar_unlocked
#define fi first
#define se second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mp make_pair
#define vi vector<int>
#define vll vector<ll>
#define fr( i,j,k) for( i = j; i < k; i++)
#define bck( i,j,k) for( i = j; i > k; i--)
#define all( x) x.begin(), x.end()
//---------------------------------------------------------------------------------------------------------

#define error( args...) { vector<string> _v = split( #args, ','); err( _v.begin(), args); cerr << '\n'; }
vector<string> split( const string& s, char c) {
    vector<string> v;
    stringstream ss( s);
    string x;
    while ( getline( ss, x, c))
        v.emplace_back( x);
    return move( v);
}
void err( vector<string>::iterator it) { }
template<typename T, typename... Args>
void err( vector<string>::iterator it, T a, Args... args) {
    cerr << it -> substr( ( *it)[0] == ' ', it -> length()) << " = " << a << '\t';
    err( ++it, args...);
}
//---------------------------------------------------------------------------------------------------------

const int NN = 1e6 + 5, mod = 1e9+7;

string ans = "";
void recur(int n){
    if(n == 0) return ;

    if(n > 0){
        ans += (char)('0' + (n%2));
        n = -n/2;
        recur(n);
    }
    else {
        int m = -n/2;
        m += abs(n)%2;
        ans += (char)('0' + (abs(n)%2));
        recur(m);
    }
}
int main(){
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int n, i, j, k;
    cin >> n;
    recur(n);
    if(ans.size() == 0)
        cout << '0';
    else {
        reverse(all(ans));
        cout << ( ans );
    }
    return 0;
}



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

using namespace std;

int gcd(int p, int q) {
    if (p % q == 0)return q;
    return gcd(q, p % q);
}

int main()
{
    double l;
    cin >> l;
    double o;

    if ((int)l % 3 == 0) {
        o = (l / 3)*(l / 3)*(l / 3);
        printf("%0.12f\n", o);
    }
    else {
        o = (l / 3)*(l / 3)*(l / 3);
        printf("%0.12f\n", o);
    }

    
    return 0;
}



Measured memory_bytes: 3752
#include<iostream>
using namespace std;
int main(){
  int n;
  bool able=false;
  cin>>n;
  for(int i=1;i<=9;i++){
    if(n%i==0&&n/i<=9){
      able=true;
    }
  }
  if(able){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
  return(0);
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
if(a==1&&b==2)
cout<<3;
else if(a==1&&b==3)
cout<<2;
else if(a==2&&b==1)
cout<<3;
else if(a==2&&b==3)
cout<<1;
else if(a==3&&b==1)
cout<<2;
else if(a==3&&b==2)
cout<<1;
return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<climits>
#include<vector>
#include<utility>//pair
#include<cmath>//abs,sqrt
#include<cstring>
#include<map>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define prin(arg) cout<<arg<<"\n"
#define prin2(arg1,arg2) cout<<arg1<<" "<<arg2<<"\n"
#define fill(arg,n) memset(arg,n,sizeof(arg))
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
const int INF=1e+9;
const ll INFLL=1e+17;
struct edge{
  int to,cap,rev;
};
vector<edge> g[200000];
bool used[200000];

void add_edge(int from,int to){
  edge e;
  e.to=to;e.cap=1;e.rev=g[to].size();
  g[from].push_back(e);
  e.to=from;e.cap=0;e.rev=g[from].size()-1;
  g[to].push_back(e);
}

int dfs(int v,int t,int f){
  if(v==t) return f;
  used[v]=true;
  rep(i,g[v].size()){
    edge &e=g[v][i];
    if(e.cap>0&&!used[e.to]){
      int d=dfs(e.to,t,min(f,e.cap));
      if(d>0){
	e.cap-=d;
	g[e.to][e.rev].cap+=d;
	return d;
      }
    }
  }
  return 0;
}

int max_flow(int s,int t){
  int flow=0;
  while(1){
    fill(used,0);
    int f=dfs(s,t,INF);
    if(f==0) return flow;
    flow+=f;
  }
}
int n;
int a[110],b[110],c[110],d[110];
int main(){
  cin>>n;
  int s=2*n,t=2*n+1;
  rep(i,n){
    cin>>a[i]>>b[i];
  }
  rep(i,n){
    cin>>c[i]>>d[i];
  }
  rep(i,n){
    rep(j,n){
      if(c[i]>a[j]&&d[i]>b[j]){
	add_edge(i,j+n);
      }
    }
  }
  rep(i,n){
    add_edge(s,i);
  }
  rep(i,n){
    add_edge(i+n,t);
  }
  prin(max_flow(s,t));
  return 0;
}


Measured memory_bytes: 5248
n, d = list(map(int, input().split()))
p = []
ans = 0
for i in range(n):
  p.append(list(map(int, input().split())))
  for j in range(i):
    s = 0
    for k in range(d):
      s += (p[i][k] - p[j][k]) ** 2
    t = int(s ** 0.5 + 1e-7)
    if t * t == s:
      ans += 1
print(ans)

Measured memory_bytes: 3064
N, M, C = map(int, raw_input().split())
B = map(int, raw_input().split())
count = 0
for i in xrange(N):
    A = map(int, raw_input().split())
    val = C
    for idx in xrange(M):
        val += A[idx]*B[idx]
    if val > 0: count += 1

print count

Measured memory_bytes: 2568
#include<bits/stdc++.h>
using namespace std;
#define NIL -1
#define MAX 1000000001
#define llt long long int

int main()
{
    char c[6];
    cin>>c;
    if(c[2]==c[3] && c[4]==c[5])
    cout<<"Yes"<<endl;
    else
    cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <queue>
#include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <set>
#include <map>
using namespace std;

#define REP(i, a, b) for (int i = (a), i##_end_ = (b); i < i##_end_; ++i)
#define MP make_pair
#define PB push_back
#define SZ(x) (int((x).size()))
#define ALL(x) (x).begin(), (x).end()
#define X first
#define Y second
template<typename T> inline bool chkmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; }
template<typename T> inline bool chkmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }

template <class T>  
inline bool RD(T &ret) {  
        char c; int sgn;  
        if (c = getchar(), c == EOF) return 0;  
        while (c != '-' && (c<'0' || c>'9')) c = getchar();  
        sgn = (c == '-') ? -1 : 1 , ret = (c == '-') ? 0 : (c - '0');  
        while (c = getchar(), c >= '0'&&c <= '9') ret = ret * 10 + (c - '0');  
        ret *= sgn;  
        return 1;  
}  
template <class T>  
inline void PT(T x) {  
        if (x < 0) putchar('-') ,x = -x;  
        if (x > 9) PT(x / 10);  
        putchar(x % 10 + '0');  
}

const int INF = 0x3f3f3f3f;
typedef long long LL;
typedef pair<int, int> pii;
typedef long double LD;


const LL MOD = 1e9 + 7;
LL dp[1 << 17][42];

void add(LL &ans, LL val) {
	ans += val;
	if(ans >= MOD) ans -= MOD;
}
int main() {
	LL ans = 0;
	int n, x, y, z;
	cin >> n >> x >> y >> z;
	int gmask = (1 << (x + y + z - 1)) | (1 << (z + y - 1)) | (1 << (z - 1));
	int m = 1 << (x + y + z);
	dp[0][0] = 1;
   	for(int i = 1; i <= n; i ++) {
		ans = 10 * ans % MOD;
		for(int mask = 0; mask < m; mask ++) {
			if((mask & gmask) == gmask || dp[mask][i - 1] == 0) continue;
			for(int num = 1; num <= 10; num ++) {
				int nmask = ((mask << num) | (1 << (num - 1))) & (m - 1);
				if((nmask & gmask) == gmask) add(ans, dp[mask][i - 1]);
				else add(dp[nmask][i], dp[mask][i - 1]);
			}
		}
	}	
	cout << ans << endl;
}



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

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define zero_pad(num) setfill('0') << std::right << setw(num)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;

vector<int> dx = {-1, 0, 1, 0};
vector<int> dy = {0, -1, 0, 1};

int main() {
    int h, w;
    cin >> h >> w;
    vector<string> s(h);
    rep(i, h)cin >> s[i];
    vector<vector<int>> d(h, vector<int>(w, 1001001));
    vector<vector<bool>> vis(h, vector<bool>(w, false));
    queue<P> que;
    rep(i, h)rep(j, w){
        if(s[i][j] == '#'){
            d[i][j] = 0;
            vis[i][j] = true;
            que.push(make_pair(i, j));
        }
    }

    int ans = 0;
    while(!que.empty()){
        P p = que.front();
        que.pop();
        int y = p.first;
        int x = p.second;
        rep(i, 4){
            if(y+dy[i]<0 || y+dy[i]>=h)continue;
            if(x+dx[i]<0 || x+dx[i]>=w)continue;
            if(vis[y+dy[i]][x+dx[i]])continue;
            vis[y+dy[i]][x+dx[i]] = true;
            ans = max(d[y][x] + 1, ans);
            d[y+dy[i]][x+dx[i]] = d[y][x] + 1;
            que.push(make_pair(y+dy[i], x+dx[i]));
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 17252
import sys, math
import bisect, heapq
import collections

sys.setrecursionlimit(10 ** 6)

input = sys.stdin.readline

gets = lambda: input().rstrip()
getn = lambda: int(input())
getmul = lambda: (int(i) for i in input().split())
getlist = lambda: [int(i) for i in input().split()]

n = getn()
A = getlist()

before = {}
res = 0
for i, a in enumerate(A):
    res += before.get(i - a, 0)
    before[i + a] = before.get(i + a, 0) + 1

print(res)


Measured memory_bytes: 40708
# coding: utf-8
# Your code here!

class UnionFind():
    #負の値はルートで集合の個数
    #正の値は次の要素を返す
    def __init__(self,size):
        self.table = [-1 for _  in range(size)]

    #集合の代表を求める
    def find(self,x):
        while self.table[x] >= 0:
            #根に来た時,self.table[根のindex]は負の値なのでx = 根のindexで値が返される。
            x = self.table[x]
        return x

    #併合
    def union(self,x,y):
        s1 = self.find(x)#根のindex,table[s1]がグラフの高さ
        s2 = self.find(y)
        if s1 != s2:#根が異なる場合
            if self.table[s1] != self.table[s2]:#グラフの高さが異なる場合
                if self.table[s1] < self.table[s2]:
                    self.table[s2] = s1
                else:
                    self.table[s1] = s2
            else:
                #グラフの長さが同じ場合,どちらを根にしても変わらない
                #その際,グラフが1長くなることを考慮する
                self.table[s1] += -1
                self.table[s2] = s1
        return
    
n,m = list(map(int,input().split()))
pp = list(map(int,input().split()))
p = [i-1 for i in pp]


uf = UnionFind(n)
for i in range(m):
    x,y = list(map(int,input().split()))
    uf.union(x-1,y-1);
c=0;
for i in range(n):
    if(uf.find(i)==uf.find(p[i])):
        c = c+1

print(c)
    
    
    
    

Measured memory_bytes: 13892