akhauriyash/Code-Regression huggingface dataset:
n, k = gets.chomp.split(" ").map(&:to_i)
d = []
a = []
k.times do
  d << gets.to_i
  a << gets.chomp.split(" ").map(&:to_i)
end
sn = Array.new(n, 0)
a.each do |arr|
  arr.each do |i|
    sn[i - 1] += 1
  end
end
puts sn.count { |i| i == 0 }

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

int main(){
    int n, d;
    cin >> n >> d;
    double x[n];
    double y[n];
    for(int i=0; i<n; i++){
        cin >> x[i] >> y[i];
    }

    int ans=0;
    for(int i=0; i<n; i++){
        //cout << endl;
        //cout << x[i]*x[i]+y[i]*y[i] << " " << d*d << endl;
        if(sqrt(x[i]*x[i]+y[i]*y[i])<=d){
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 6956
#include <cstdio>
#include <climits>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <string>
#include <cstdio>
#include <climits>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <utility>
#include <queue>
#include <cstring>
#include <set>
#include <map>
#include <complex>
#define rep(i, n) for (int i = 0; i < int(n); i++)
using namespace std;
long long MOD = 1000000007;
long long INF = 1000000000000000; //10^15
typedef long long ll;
typedef unsigned long long ull;


ll powMod(ll x, ll n, ll mod) {
  if (n == 0) return 1;
  ll t = powMod(x, n/2, mod);
  t = t * t % mod;
  if (n & 1) return t * x % mod;
  return t;
}

int main(void) {

  ll n;
  int a[200100];
  cin >> n;
  int am = 0;
  rep(i, n) {
    cin >> a[i];
    am = max(a[i], am);
  }

  ll cnt[200100] = {};
  rep(i, n) cnt[a[i]]++;

  ll ans = 0;
  rep(i, am + 1) {
    ans += cnt[i] * (cnt[i] - 1LL)/2LL;
  }

  rep(i, n) {
    ll x = cnt[a[i]];
    cout << ans - (x - 1LL) << endl;
  }
}


Measured memory_bytes: 4992
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  vector<tuple<string,int,int>> v;
  for (int i=0;i<N;i++){
    string S;
    int P;
    cin >> S >> P;
    v.push_back(make_tuple(S,100-P,i+1));
  }
  sort(v.begin(),v.end());
  for (int i=0;i<N;i++){
    cout << get<2>(v[i]) << endl;
  }
}

Measured memory_bytes: 256
import java.util.*;
public class Main{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int a[] = new int[n];
    int b[] = new int[n+1];
    int c[] = new int[n*(n+1)/2];
    int min = 100;
    for(int i=0 ; i<n ; i++){
      a[i] = sc.nextInt();
    }
    for(int i=0 ; i<n+1 ; i++){
      if(i==0){
        b[i] = 0;
      }else{
        b[i] = a[i-1] + b[i-1];
      }
    }
    // for (int i = 0; i < n+1; i++) {
    //   System.out.println(b[i]);
    // }
    for(int i=0 ; i<n ; i++){
      c[i] = b[n]-b[i];
      int x = Math.abs(c[i]-b[i]);
      min = Math.min(min,x);
    }
    // Arrays.sort(c);
    System.out.println(min);
  }
}


Measured memory_bytes: 23252
#ABC121 B
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
a = []
for i in range(n):
    a.append(list(map(int, input().split())))

count = 0

for i in range(n):
    sub_total = 0
    for j in range(m):
        sub_total += a[i][j] * b[j]
    if sub_total + c > 0:
        count += 1
print(count)


Measured memory_bytes: 3060
#include<stdio.h>
#include<stdlib.h>
int main(){
  int n,sum;
  int *a;
  scanf("%d",&n);

  a = (int *)calloc(n,sizeof(int));
  if(a == NULL) exit(-1);

  sum = 0;
  for(int i = 0;i < n; i++){
    scanf("%d",&a[i]);
    a[i]--;
    sum += a[i];
  }
  free(a);
  printf("%d",sum);
  return 0;
}


Measured memory_bytes: 128
(*
ocamlfind ocamlopt -package batteries -linkpkg main.ml -o a.out
*)
open Batteries

let () =
        Scanf.sscanf (read_line ()) "%f" (
                fun n -> 
                        List.range 0 `To 7
                      |> List.map float_of_int
                      |> List.map (fun elmnt ->
                              2.0 ** elmnt
                      )
                    |> List.filter (fun elmnt ->
                            elmnt <= n
                    )
                  |> List.max
                |>  int_of_float
        ) |> Printf.printf "%d\n"


Measured memory_bytes: 3072
#include <bits/stdc++.h>  // clang-format off
using Int = long long;
#define REP_(i, a_, b_, a, b, ...) for (Int i = (a), lim##i = (b); i < lim##i; i++)
#define REP(i, ...) REP_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
struct SetupIO { SetupIO() { std::cin.tie(nullptr), std::ios::sync_with_stdio(false), std::cout << std::fixed << std::setprecision(13); } } setup_io;
#ifndef _MY_DEBUG
#define dump(...)
#endif  // clang-format on

/**
 *    author:  knshnb
 *    created: Mon Mar 30 18:58:16 JST 2020
 **/

signed main() {
    Int n, Q;
    std::cin >> n >> Q;
    std::vector<Int> a(n);
    REP(i, n) std::cin >> a[i];
    REP(q, Q) {
        Int x;
        std::cin >> x;
        Int ans = 0, acc = 0, j = 0;
        REP(i, n) {
            while (j < n && acc + a[j] <= x) {
                acc += a[j];
                j++;
            }
            ans += j - i;
            acc -= a[i];
        }
        std::cout << ans << "\n";
    }
}



Measured memory_bytes: 3616
#include <iostream>
#include <vector>
#include <map>

using namespace std;

int main(void)
{
	int n,m;
	int i1,i2;
	int sum;
	int c;
	map<int,int>::iterator i;

	while(1){
		cin>>n>>m;
		if(n+m==0) break;

		vector<int> h(n);
		vector<int> w(m);
		map<int,int> hh,ww;
		for(i1=0;i1<n;i1++) cin>>h[i1];
		for(i1=0;i1<m;i1++) cin>>w[i1];

		for(i1=1;i1<=n;i1++){
			sum=0;
			for(i2=0;i2<i1;i2++) sum+=h[i2];
			hh[sum]++;
			for(i2;i2<n;i2++){		
				sum+=h[i2];
				sum-=h[i2-i1];
				hh[sum]++;
			}	
		}

		for(i1=1;i1<=m;i1++){
			sum=0;
			for(i2=0;i2<i1;i2++) sum+=w[i2];
			ww[sum]++;
			for(i2;i2<m;i2++){
				sum+=w[i2];
				sum-=w[i2-i1];
				ww[sum]++;
			}	
		}

		c=0;
		for(map<int,int>::iterator it=hh.begin();it!=hh.end();it++){
			//cout<<it->first<<" "<<it->second<<endl;
			i=ww.find(it->first);
			if(i!=hh.end()) c+=(it->second*i->second);
		}
		//cout<<endl;

		/*for(map<int,int>::iterator it=ww.begin();it!=ww.end();it++){
			cout<<it->first<<" "<<it->second<<endl;
		}
		cout<<endl;*/

		cout<<c<<endl;


	}
	return 0;
} 

Measured memory_bytes: 27984
n = int(input())
def factorize(n):
    a=[]
    while n%2==0:
        a.append(2)
        n//=2
    f=3
    while f*f<=n:
        if n%f==0:
            a.append(f)
            n//=f
        else:
            f+=2
    if n!=1:
        a.append(n)
    return a
li = []
for i in range(1,10):
    li.append(i*(i+1)//2)
sum1 = 0
a = factorize(n)
liset = set(a)
relist = list(liset)
for i in range(len(liset)):
    b = a.count(relist[i])
    for j in range(10):
        if b >= li[j] and b < li[j+1]:
            sum1 += j+1
            break
print(sum1)

Measured memory_bytes: 9236
#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#define rs(a, b) ((a) >> (b))
#define ls(a, b) ((a) << (b))
#define gcd __gcd
#define lcm(a, b) ((a * b) / gcd(a, b))
#define pq priority_queue
#define um unordered_map
#define us unordered_set
#define lb lower_bound
#define ub upper_bound
#define F first
#define B begin()
#define E end()
#define ln length()
#define sz size()
#define S second
#define em empty()
#define nani(x) cerr << #x << " is " << x << endl;
#define ch(x) (x - 'a' + 1)
#define mp make_pair
#define pb push_back
#define loop(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define scan(x, n) loop(i, 0, n) cin >> x[i];
#define adde(g, u, v) g[u].pb(v), g[v].pb(u);
#define addew(g, u, v, w) g[u].pb({ v, w }), g[v].pb({ u, w });
#define print(x, n) loop(i, 0, n) cout << x[i] << " ";
#define fast ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define inf 10000000000
#define mod 1000000007

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<long> vl;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef pair<long, long> pll;
typedef vector<ii> vii;
typedef vector<pll> vll;
typedef um<int, int> umii;
typedef um<char, int> umci;
typedef map<char, int> mci;
typedef map<int, int> mii;

int main()
{
    fast;
    //freopen("input.txt", "r", stdin);
    int n;
    cin >> n;
    double a[n];
    scan(a, n);
    sort(a, a + n);

    double ans = 0;

    for (int i = 1; i < n; i++) {
        a[i] = (a[i - 1] + a[i]) / (double)2;
    }

    cout << setprecision(10) << a[n - 1];

    return 0;
}


Measured memory_bytes: 256
#include <iostream>


int main() {
    long long int N;
    std::cin >> N;

    long long int sum = (N + 1) * N / 2;
    
    long long int sum_3 = (N / 3) * (3 + N - N % 3) / 2;
    long long int sum_5 = (N / 5) * (5 + N - N % 5) / 2;
    long long int sum_15 = (N / 15) * (15 + N - N % 15) / 2;

    std::cout << sum + sum_15 - sum_3 - sum_5 << std::endl;
}


Measured memory_bytes: 3192
#include<iostream>
using namespace std;
int a[100001];
int find(int i){
	if(a[i]!=i)
		return a[i]=find(a[i]);
	return i;
}
int main(){
	int n,m;
	cin>>n>>m;
	for(int i=1;i<=n;++i)
		a[i]=i;
	int sum=0;
	for(int i=1;i<=m;++i){
		int x,y,z;
		cin>>x>>y>>z;
		int u=find(x),v=find(y);
		a[u]=v;
	}
	for(int i=1;i<=n;++i)
		if(a[i]==i)
			++sum;
	cout<<sum<<endl;
	return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define int ll
#define pb push_back
#define setbits(x)          __builtin_popcountll(x)
#define endl "\n"
typedef long long ll;
int32_t main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n,m;
cin>>n>>m;
int ans=n*m;
if(n==1||m==1)
{
    cout<<1<<endl;
    return 0;
}
ans+=1;
ans/=2;
cout<<ans<<endl;
    return 0;
}


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

int main() {
  int x;
  bool a = false;
  bool b = false;
  bool c = false;
  bool d = false;
  string color;
  cin >> x;

  for (int i = 0; i < x; i++){
    
    cin >> color;
    
    if (color == "P"){
      a = true;
    }
    
    else if(color == "G"){
      b = true;
    }
    
    else if(color == "W"){
      c = true;
    }
    
    else if(color == "Y"){
      d = true;
    }
  }
  
  if(a && b && c && d){
    cout << "Four" << endl;
  }
  
  else{
    cout << "Three" << endl;
}
}

Measured memory_bytes: 256
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String {
            bytes
                .by_ref()
                .map(|r| r.unwrap() as char)
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
    input!{
        n: usize,
        s: chars
    }
    let d = 1000000007;
    let m = s.len();
    if s[0] == 'W' || s[m - 1] == 'W' {
        println!("0");
        return;
    }
    let mut v = vec![false; m];
    v[0] = true;
    let mut sum = 1;
    let mut f = true;
    for i in 1..m {
        if (s[i] == 'B') ^ f {
            v[i] = true;
            sum += 1;
        } else {
            sum -= 1;
        }
        f = !f;
    }
    if sum != 0 || v[m - 1] {
        println!("0");
        return;
    }
    let mut c = 0;
    let mut ans: usize = 1;
    for i in 0..m {
        if v[i] {
            c += 1;
        } else {
            ans = ans * c % d;
            c -= 1;
        }
    }
    println!("{}", ans * stair_m(n, d) % d);
}

fn stair_m(n: usize, d: usize) -> usize {
    (1..n+1).fold(1, |ac, x| ac * x % d)
}


Measured memory_bytes: 4352
#include <iostream>
#include <vector>
#include <map>
#include <queue>
#include <string>
#include <algorithm>
#include <cmath>
#include <climits>
#include <fstream>
#include <cstdlib>
#include <cstdio>
#define REP(i, n) for(long long int i=0; i<(n); i++)
#define FOR(i, a, n) for(long long int i=(a); i<(n); i++)
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<char> vc;

int main(){
    int n,d;cin>>n>>d;
    int ans = 0;
    if(n%(2*d+1) == 0){
        ans = n/(2*d+1);
    }else{
        ans = n/(2*d+1) + 1;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
sum = 0
while 1:
    sum += 1
    if(sum != 1):
        print()
        print()
    H, W = map(int, input().split())
    if(H == 0 and W == 0):
        break

    for i in range(H):
        if(i == 1):
            print()
        for j in range(W):
            if(i == 0 or j == 0 or i == H-1):
                print('#',end="")
            elif(j == W-1):
                print('#')
            else:
                print('.',end="")



Measured memory_bytes: 6996
h,w = map(int,input().split())
s = list(map(int,input().split()))
g = list(map(int,input().split()))
s[0] -= 1
s[1] -= 1
g[0] -= 1
g[1] -= 1
raw = []
seen = []
for _ in range(h):
  tmp = input()
  raw.append(tmp)
  t = []
  for j in range(w):
    if tmp[j] == '.':
      t.append(0)
    else:
      t.append(1)
  seen.append(t)

now = [s]
ans = 0

def check(ii,jj):
  if 0 <= ii < h and 0 <= jj < w:
    if seen[ii][jj] == 0:
      seen[ii][jj] = 1
      now.append([ii,jj])

while now:
  for x in now:
    a,b = x
    check(a-1,b)
    check(a+1,b)
    check(a,b-1)
    check(a,b+1)
  if seen[g[0]][g[1]] == 1:
    print(ans)
    break
  ans += 1
  last = now
  now = []
  for x in last:
    a,b = x
    for di in range(-2,3):
      for dj in range(-2,3):
        check(a+di,b+dj)
else:
  print(-1)

Measured memory_bytes: 105104
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>

char s[524288];
int a[524288];
int n;
int f[524288][27];
int e[524288][20];

int main() {
    //freopen("C.in", "r", stdin);
    scanf("%s", s);
    n = strlen(s);
    memset(f, -1, sizeof(f));
    memset(e, -1, sizeof(e));
    for (int i = n - 1; i >= 0; --i) {
        a[i] = s[i] - 97;
        int fnow = i;
        int now = a[i];
        f[i][a[i]] = i;
        for (int j = a[i] + 1; j < 27; ++j) {
            f[i][j] = f[f[i][j - 1] + 1][j - 1];
            if (f[i][j] == -1)
                break;
        }
        if (f[i][26] > -1) {
            e[i][0] = f[i][26];
            for (int j = 0; j < a[i]; ++j)
                f[i][j] = f[f[i][26] + 1][j];
        }
    }
    for (int j = 1; j < 20; ++j)
        for (int i = 0; i < n; ++i)
            if (e[i][j - 1] > -1)
                e[i][j] = e[e[i][j - 1] + 1][j - 1];
    int Q;
    scanf("%d", &Q);
    while (Q--) {
        int l, r;
        scanf("%d%d", &l, &r);
        --l;
        --r;
        for (int i = 19; i >= 0; --i)
            if (e[l][i] > -1 && e[l][i] <= r)
                l = e[l][i] + 1;
        if (l == r + 1)
            printf("Yes\n");
        else
            printf("No\n");
    }
    return 0;
}

Measured memory_bytes: 99328
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <cfloat>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

vector<vector<ll> > table;
vector<P> roads;
vector<P> qs;

int main() {
  ll X, Y;
  cin >> X >> Y;

  string ans = "No";

  if (X % 500 <= Y) ans = "Yes";

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
n,m=map(int, input().split())
a=list(map(int, input().split()))
su=0
co=0
for x in a:
    su+=x
iki=su/int((4*m))
for x in a:
    if x>=iki:
        co+=1
if co>=m:
    out='Yes'
else:
    out='No'
print(out)

Measured memory_bytes: 9108
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<string>
#include<cmath>
using namespace std;
typedef long long ll;

int main() {
  int N;
  cin >> N;
  ll A[N];
  for(int i=0;i<N;++i){
    cin >> A[i];
  }
  
  ll a;
  ll c = 1000000000000000000;
  int check=0;
  a = A[0];
  double b;
  for(int i=1;i<N;++i){
    b = (double)a/pow(10,18)*(double)A[i];
    a = a*A[i];
    //cout<<a<<" "<<b<<endl;
    if(b>1 || a>c) check = 1;
    if(A[i]==0) check = 0;
  }
  if(check == 0) cout<<a<<endl;
  else cout<<"-1"<<endl;




}

Measured memory_bytes: 4368
program main
implicit None
integer::n,i,t,s
integer,allocatable::a(:)
	read *,n
	allocate(a(n))
	t = 0
	s = 0
	
	do i = 1,n
		read *,a(i)
		if(a(i) > t)then
			t = a(i)
		endif
		s = s + a(i)
	enddo
	
	s = s - (t/2)
	
	print 101,s

101 format(i0)
end program main

Measured memory_bytes: 768
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef pair<int, int> P;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vvvi = vector<vector<vector<int>>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using vvvll = vector<vector<vector<ll>>>;
using vd = vector<double>;
using vvd = vector<vector<double>>;
using vvvd = vector<vector<vector<double>>>;
using vb = vector<bool>;
using vvb = vector<vector<bool>>;
using vs = vector<string>;
using pint = pair<int, int>;
using Graph = vvi;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
bool cmp(pint a, pint b) {return a.second < b.second;}
void YN(bool flg) {cout<<(flg?"YES":"NO")<<'\n';}
void Yn(bool flg) {cout<<(flg?"Yes":"No")<<'\n';}
void yn(bool flg) {cout<<(flg?"yes":"no")<<'\n';}

int main() {
    int n;
    cin >> n;
    vi a(n);
    rep(i, n) cin >> a[i];

    int x = 0;
    int cnt = 0;
    rep(i, n) {
        if(a[i] == x + 1) {
            cnt++;
            x++;
        }
    }

    if(cnt == 0) {
        cout << -1 << endl;
    } else {
        cout << n - cnt << endl;
    }
    
    return 0;
}

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

int main(int argc, const char * argv[]) {
    char word[400],word2[400],word3[400];
    int h,i,j,r,sum;
    while (1) {
        scanf("%s",word);
        sum = strlen(word);
        if(word[0]=='-'){
            break;
        }
        scanf("%d",&h);
        for(i=0;i<h;i++){
            scanf("%d",&r);
            strcpy(word2,word);
            strcpy(word3,word);
            strcat(word2,word3);
            for(j=0;j<sum*2;j++){
                word2[j]=word2[j+r];
            }for(j=0;j<sum;j++){
                word[j]=word2[j];
            }
        }
        for(i=0;i<sum;i++){
            printf("%c",word[i]);
        }
        printf("\n");
    }
    return 0;
}

Measured memory_bytes: 588
#include<stdio.h>
#define NUM 10

int main(void)
{
	int a,b,temp;
	int top1,top2,top3;
	int mountain[NUM];
	
	for(a = 0 ; a < NUM ; a++){
		scanf("%d",&mountain[a]);
	}
	for(b = 9 ; b >= 0 ; b--){
		for(a = 0 ; a < b ; a++){
			if(mountain[a] > mountain[a+1]){
				temp = mountain[a];
				mountain[a] = mountain[a+1];
				mountain[a+1] = temp;
			}
		}
	}
	top1 = mountain[9];	top2 = mountain[8];	top3 = mountain[7];
	
	printf("%d\n%d\n%d\n",top1,top2,top3);
	
	return 0;
}

Measured memory_bytes: 600
#include<bits/stdc++.h>
using namespace std;
 
#define ALL(V) (V).begine(),(V).end()
#define SORT(V) sort(ALL(V))
#define REV(V) reverse(ALL(V))
#define RSORT(V) SORT(V);REV(V)
 
#define rep(i,n) for(int i = 0;i < (int)(n);++i)
#define Rep(i,n) for(int i = 1;i <= (int)(n);++i)
 
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;}
 
#define SZ(x) ((int)(x).size())
 
typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
 
double PI = 3.14;
 
/* 入力 */
int N,M;
 
void calc()
{
    cin >> N;
    cout << (double)N * 2 * PI << endl;
    return;
}
 
int main()
{
    calc();
}

Measured memory_bytes: 3788
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static void main(String[] args)  {
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            br.readLine();
          	Main app = new Main();
            String[] split = br.readLine().split(" ");
            int n = split.length;
            int[] A = new int[n];
            for (int i = 0; i < n; i++) {
               A[i] = Integer.parseInt(split[i]); 
            }
            long[][] dp = new long[n + 1][n + 1];
            for (int L = n - 1; L >= 0; L--) {
                for (int R = L; R < n; R++) {
                    if (L == R) {
                        dp[L][R] = A[L];
                    } else {
                        dp[L][R] = Math.max(A[L] - dp[L + 1][R], A[R] - dp[L][R - 1]);
                    }
                }
            }
            System.out.println(dp[0][n - 1]);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}


Measured memory_bytes: 128848
import java.util.*;

public class Main {


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

        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();

         System.out.println(c + " " + a + " " + b);

        sc.close();
    }

}

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

using namespace std;

//#define LOCAL
#define pb push_back
#define mk make_pair
#define all(x) (x).begin(), (x).end()
//#define size(x), ((int)(x).size())
#define fi first
#define se second

#define deb(x) cout<<#x <<" = "<<x<<endl;
#define deb2(x,y) cout<<#x <<" = "<<x<<" "<<#y<<" "<<y<<endl;
#define deb3(x,y,z) cout<<#x <<" = " <<x<<" "<<#y<<" "<<y<<" "<<#z<<" = "<<z<<endl;
#define deb4(w,x,y,z) cout<<#w<<" = " << w<<" "<<#x <<" = "<<x <<" "<<#y<<" = "<<y <<" "<<#z<<" = "<<z<<endl;


typedef long long LL;
typedef vector<int> VI;
typedef pair<int,int> PI;

//cin.ignore(numeric_limits<streamsize>::max(), '\n');

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

    #ifdef LOCAL
    clock_t time;
    time = clock();
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    //start_here 
    
    int n;
    cin>>n;

    int ans =n- (n/1000)*1000;
    if(ans != 0)
        ans -= 1000;
    cout<<abs(ans)<<endl;

    //end_here
    #ifdef LOCAL
    time = clock() - time;
    cout<<"Total time: "<<(float)time/CLOCKS_PER_SEC<<"s"<<endl;
    #endif

    return 0;
}



Measured memory_bytes: 3648
#include <bits/stdc++.h>
#define N 100020
#define ll long long
using namespace std;
inline int read(){
  int x=0,f=1;char ch=getchar();
  while(ch>'9'||ch<'0')ch=='-'&&(f=0)||(ch=getchar());
  while(ch<='9'&&ch>='0')x=(x<<3)+(x<<1)+ch-'0',ch=getchar();
  return f?x:-x;
}
int a[N];
int ans;
int main(int argc, char const *argv[]) {
  int n = read() << 1;
  for (int i = 1; i <= n; ++ i) {
    a[i] = read();
  }
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i += 2) {
    ans += a[i];
  }
  cout << ans << endl;
  return 0;
}

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

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

    int64_t N, D; 
    cin >> N >> D; 

    D  = D*D; 
    int64_t cnt = 0; 


    for (int64_t i = 0; i < N; i++)
    {
        int64_t X, Y; 
        cin >> X >> Y; 
        if (X*X + Y*Y <= D) {
            cnt ++; 
        }
    }

    cout << cnt; 
    
  return 0;
}


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

int main(){
    int h, w, a, b;
    cin >> h >> w >> a >> b;
    for (int i = 0; i < h; i++){
        for (int j = 0; j < w; j++){
            if (i < b){
                if (j < a) cout << 1;
                else cout << 0;
            }
            else{
                if (j < a) cout << 0;
                else cout << 1;
            }
        }
        cout << endl;
    }
}

Measured memory_bytes: 1280
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
	ll N, H;
	cin >> N >> H;
	ll a[N], b[N];
	for (ll i = 0; i < N; i++) {
		cin >> a[i] >> b[i];
	}
	sort(a, a + N);
	sort(b, b + N);
	ll a_max = a[N - 1];
	ll cnt = 0;
	for (ll i = N - 1; i >= 0; i--) {
		if (a_max <= b[i]) {
			H -= b[i];
			cnt++;
		}
		if(H<=0){cout<<cnt<<endl; return 0;}
    }
	while (H > 0) {
		H -= a_max;
		cnt++;
	}
	cout << cnt << endl;
}

Measured memory_bytes: 1920
#include<bits/stdc++.h>
using namespace std;
#define N 100000
int data[N];
int main(){
	int n,flag=0;
	cin>>n;
	for(int i=0;i<n;i++)cin>>data[i];
	int maxs=data[0];
	for(int i=1;i<n;i++){
		if(maxs-data[i]>1){
			flag=1;
			break;
		}
		maxs=max(maxs,data[i]);
	}
	if(flag==0)cout<<"Yes\n";
	else cout<<"No\n";
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

// increment
#define rep_n(_1, _2, _3, NAME, ...) NAME
#define rep_2(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep_3(i, initial, n) for (int i = (int)(initial); i < (int)(n); ++i)
#define repeat(...) rep_n(__VA_ARGS__, rep_3, rep_2, rep_1)(__VA_ARGS__)
// decrement
#define rep_r_n(_1, _2, _3, NAME, ...) NAME
#define rep_r_2(i, n) for (int i = (int)(n); i > 0; i--)
#define rep_r_3(i, initial, n) for (int i = (int)(initial); i > (int)(n); i--)
#define repeat_r(...) rep_r_n(__VA_ARGS__, rep_r_3, rep_r_2)(__VA_ARGS__)
// define variable
using namespace std;
typedef long long ll;
using mpint = boost::multiprecision::cpp_int; // 多倍長整数（任意精度）
typedef pair<int, int> P;
const double EPS = numeric_limits<double>::epsilon();
const long long INF = (long long)1e18;
// 最大公約数
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; }
// char -> int
int ctoi(char c) { return (int)(c - '0'); }

int main() {
	int N, M;
	cin >> N >> M;
	int n = N * (N -1) / 2;
	int m = M * (M-1) / 2;

	cout << (n + m) << endl;
	return 0;
}


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

using namespace std;
using ll = long long;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define INF 9223372036854775807
#define all(x) (x).begin(), (x).end()

ll ts = 1000000007;

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

  ll h, w;
  cin >> h >> w;

  string board[50];

  REP(i, h) { cin >> board[i]; }

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

  REP(i, h) {
    REP(j, w) {
      if (board[i][j] == '#') continue;

      ll num = 0;
      REP(k, 8) {
        ll ni = i + dy[k];
        ll nj = j + dx[k];

        if (ni < 0 || ni >= h) continue;
        if (nj < 0 || nj >= w) continue;

        if (board[ni][nj] == '#') {
          num++;
        }
      }
      board[i][j] = char(num + '0');
    }
  }

  REP(i, h) { cout << board[i] << "\n"; }
}

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

class UnionFind {
public:
  UnionFind(int n) : parent(n, -1) {}

  int root(int a) {
    if (parent[a] < 0) return a;
    return parent[a] = root(parent[a]);
  }

  int size(int a) { return -parent[root(a)]; }

  bool connect (int a, int b) {
    int root_a = root(a);
    int root_b = root(b);
    if (root_a == root_b) return false;

    if (size(a) < size(b)) swap(a, b);
    parent[root_a] += parent[root_b];
    parent[root_b] = root_a;
    return true;
  }

  int num_of_element() const { return parent.size(); }

private:
  vector<int> parent;
};

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << setprecision(20);

  int n, m;
  cin >> n >> m;
  vector<int> a(m), b(m);
  rep(i, m) {
    cin >> a[i] >> b[i];
    // 0 indexedにする
    --a[i];
    --b[i];
  }

  UnionFind u(n);
  vector<ll> ans(m);
  ans[m-1] = (ll)n * (n-1)/2;
  for (int i = m - 1; i >= 1; --i) {
    ans[i-1] = ans[i];
    if (u.root(a[i]) != u.root(b[i])) {
      ans[i-1] -= (ll)u.size(a[i]) * u.size(b[i]);
    }
    u.connect(a[i], b[i]);
  }
  rep(i, m) { cout << ans[i] << endl; }
  return 0;
}


Measured memory_bytes: 3328
#!/usr/bin/env python3
import sys
from itertools import accumulate
def solve(k: int, q: int, d: "List[int]", n: "List[int]", x: "List[int]", m: "List[int]"):
    for query in range(q):
        N,X,M = n[query],x[query],m[query]
        count = [0]*k
        D = [0]*k
        c = 0
        for i in range(k):
            D[i] = d[i]%M
            if D[i] == 0:
                c += 1
            count[i] = c
        accum = list(accumulate(D))
        SUMD = accum[-1]
        COUNTD = count[-1]

        if (N-1)%k == 0:
            last = X+((N-1)//k)*SUMD
            equal_count = COUNTD*((N-1)//k)
        else:
            last = X + SUMD*((N-1)//k) + accum[(N-1)%k-1]
            equal_count = COUNTD*((N-1)//k)+count[(N-1)%k-1]
        
        shounari_count = last//M - X//M
        dainari_count = N-shounari_count-equal_count-1
        print(dainari_count)
    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    k = int(next(tokens))  # type: int
    q = int(next(tokens))  # type: int
    d = [int(next(tokens)) for _ in range(k - 1 - 0 + 1)]  # type: "List[int]"
    n = [int()] * (q)  # type: "List[int]"
    x = [int()] * (q)  # type: "List[int]"
    m = [int()] * (q)  # type: "List[int]"
    for i in range(q):
        n[i] = int(next(tokens))
        x[i] = int(next(tokens))
        m[i] = int(next(tokens))
    solve(k, q, d, n, x, m)

if __name__ == '__main__':
    main()


Measured memory_bytes: 84316
# -*- coding: utf-8 -*-
# N = int(input())
A,B = map(int,input().split())

if A == B:
    print('Draw')
else:
    if A == 1:
        print('Alice')
    elif B == 1:
        print('Bob')
    else:
        if A > B:
            print('Alice')
        else:
            print('Bob')


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

int main(){
    int N;
    cin >> N;
    string S;
    cin >> S;
    
    int ans = 0;
    for(int i = 1;i<N;i++){
        int cnt = 0;

        for(char c = 'a';c<='z';c++){
            bool left = false,right = false;

            for(int j = 0;j<i;j++){
                if(S[j]==c) left = true;
            }
            for(int k = i;k<N;k++){
                if(S[k]==c) right = true;
            }
            
            if(left&&right) cnt++;
        }
        if(ans<cnt) ans = cnt;
    
    }
    printf("%d",ans);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define inf INT_MAX
#define INF LLONG_MAX
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define int ll
#define vi vector<int>
#define IP pair<int,P>
#define PI pair<P,int>
#define PP pair<P,P>
#define Yes(f){cout<<(f?"Yes":"No")<<endl;}
#define YES(f){cout<<(f?"YES":"NO")<<endl;}
int Madd(int x,int y) {return (x+y)%M;}
int Msub(int x,int y) {return (x-y+M)%M;}
int Mmul(int x,int y) {return (x*y)%M;}
#define PS pair<string,int>


signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(20);

  int n,t;
  cin>>n>>t;
  queue<PS> q;
  rep(i,n){
    string s;
    int m;
    cin>>s>>m;
    q.push(PS(s,m));
  }

  int s=0;
  while(q.size()){
    PS p=q.front(); q.pop();
    if(p.S<=t){
      cout<<p.F<<' '<<s+p.S<<endl;
      s+=p.S;
    }else{
      q.push(PS(p.F,p.S-t));
      s+=t;
    }
  }


}


Measured memory_bytes: 6348
#include <bits/stdc++.h>
using namespace std;
int qtas_pedras, pedras[100009];
long long custo_ate_aqui[100009];
void menor_custo(int pedra, int k){
    int j = pedra;
    //cout<<"pedra eh"<<pedra<<endl;
    while(j>0 && j>(pedra-k)){
        j--;
        //cout<<"j eh"<<j<<endl;
        long long opcao = custo_ate_aqui[j]+abs(pedras[pedra]-pedras[j]);
        custo_ate_aqui[pedra] = min(opcao, custo_ate_aqui[pedra]);
    }
}
int main(){
    int temp, k;
    cin>>qtas_pedras>>k;
    for(int i=0;i<qtas_pedras;i++){
        cin>>temp;
        pedras[i]=temp;
        custo_ate_aqui[i] = 1000000009;
    }
    qtas_pedras--;
    custo_ate_aqui[0] = 0;
    custo_ate_aqui[1] = abs(pedras[0]-pedras[1]);
    //cout<<custo_ate_aqui[qtas_pedras]<<endl;
    /*
    for(int i=0;i<=qtas_pedras;i++){
        cout<<"i"<<i<<"qi"<<custo_ate_aqui[i]<<endl;
    }
    */
   for(int i=2;i<=qtas_pedras;i++){
       menor_custo(i, k);
       //cout<<"menor c i"<<i<<' '<<custo_ate_aqui[i]<<endl;
   }
   cout<<custo_ate_aqui[qtas_pedras]<<endl;
}


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

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

	auto parity = [&](int x) {
		int res = 0;
		while (x) {
			res ^= 1;
			x /= 10;
		}
		return res;
	};

	int N; cin >> N;
	int ans = 0;
	for (int x = 1; x <= N; x++) {
		ans += parity(x);
	}
	cout << ans << '\n';

	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#define N 100001
 
typedef struct{
  char mark;
  int num,id;
}Cards;
 
Cards A[N];
 
 
void QuickSort(int p, int r){
  int q;
  if (p<r){
    q = Partition(p,r);
    QuickSort(p,q-1);
    QuickSort(q+1,r);
  }
}
 
int Partition(int p, int r){
  int x,i,j;
  Cards temp;
  x = A[r].num;
  i = p-1;
  for (j=p;j<=r-1;j++){
    if (A[j].num<=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;
}
 
int main(){
  int n,i,key,flag=0;
  char temp;
  scanf("%d%c",&n,&temp);
  for (i=0;i<n;i++){
    scanf("%c%d%c",&A[i].mark,&A[i].num,&temp);
    A[i].id=i;
  }
  QuickSort(0,n-1);
  for (i=1;i<n;i++){
    if ((A[i].num==A[i-1].num) && (A[i].id<=A[i-1].id)){
      printf("Not stable\n");
      flag=1;
      break;
    }
  }
  if (flag==0){
    printf("Stable\n");
  }
 
  for (i=0;i<n;i++){
    printf("%c %d\n",A[i].mark,A[i].num);
  }
  
  return 0;
}

Measured memory_bytes: 1780
/*---------------------------*\
____________Mari000____________         
________Mostafa  Shehab________    
\*---------------------------*/

#include <bits/stdc++.h>
using namespace std;
 
#define PI  3.14159265  // PI = acos(-1)
#define EPS (1e-10)
#define endl "\n"
typedef long long ll;
typedef long double ld;
//template <class Type>

ll power(ll x,ll y,ll p);
int Bit(ll x);
 
inline int D(){
	int t;
	scanf("%d",&t);
	return t;
}
inline ll llD(){
	ll t;
	scanf("%lld",&t);
	return t;
}

const int N=1e5 + 5;
int arr[N];
int n,m;
int a,b,c,d;
unordered_map<int,int> mp;
char ch[100];
bool f1=true;

int main(){
	scanf("%d%d",&a,&b);
	scanf("%s",ch);
	for(int i=0;ch[i];++i){
		if(i!=a)
			f1&=(ch[i]-'0'<10 && isdigit(ch[i]));
		else
			f1&=(ch[i] == '-');
			
	}
	puts(f1?"Yes" : "No");
		

}










ll power(ll x,ll y,ll p){ 
    ll res = 1;      // Initialize result 
  
    x = x % p;  // Update x if it is more than or  
                // equal to p 
    while (y > 0){ 
        // If y is odd, multiply x with result 
        if (y & 1) 
            res = (res*x) % p; 
  
        // y must be even now 
        y = y>>1; // y = y/2 
        x = (x*x) % p;
    }
    return res; 
}


int Bit(ll x){
	if(!x)
		return 0;
	return 1+Bit(x>>1);
}


















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

#define REP(i,n) for(ll i=0;i<ll(n);++i)
#define RREP(i,n) for(ll i=ll(n)-1;i>=0;--i)
#define FOR(i,m,n) for(ll i=m;i<ll(n);++i)
#define RFOR(i,m,n) for(ll i=ll(n)-1;i>=ll(m);--i)
#define ALL(v) (v).begin(),(v).end()
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());
#define DUMP(v) REP(aa, (v).size()) { cout << v[aa]; if (aa != v.size() - 1)cout << " "; else cout << endl; }
#define INF 1000000001ll
#define MOD 1000000007ll
#define EPS 1e-9

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


using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll max(ll a, int b) { return max(a, ll(b)); }
ll max(int a, ll b) { return max(ll(a), b); }
ll min(ll a, int b) { return min(a, ll(b)); }
ll min(int a, ll b) { return min(ll(a), b); }
///(´・ω・`)(´・ω・`)(´・ω・`)(´・ω・`)(´・ω・`)(´・ω・`)///
struct edge { int to, cap, rev, cost; };

constexpr int MAX_V = 20002;
vector<edge> G[MAX_V];
int level[MAX_V];
int iter[MAX_V];

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

void bfs(int s) {
	fill_n(level, MAX_V, -1);
	queue<int> q;
	level[s] = 0;
	q.push(s);
	while (!q.empty()) {
		int v = q.front(); q.pop();
		for (int i = 0; i < G[v].size(); i++) {
			edge &e = G[v][i];
			if (e.cap > 0 && level[e.to] < 0) {
				level[e.to] = level[v] + 1;
				q.push(e.to);
			}
		}
	}
}
ll dfs(int v, int t, int f) {
	if (v == t)return f;
	for (int &i = iter[v]; i < G[v].size(); i++) {
		edge &e = G[v][i];
		if (e.cap > 0 && level[v] < level[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;
}
ll max_flow(int s, int t) {
	int flow = 0;
	for (;;) {
		bfs(s);
		if (level[t] < 0)return flow;
		fill_n(iter, MAX_V, 0);
		ll f;
		while ((f = dfs(s, t, INF)) > 0) {
			flow += f;
		}
	}
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int h, w;
	cin >> h >> w;
	vector<string> v(h);
	REP(i, h)cin >> v[i];
	REP(i, h) {
		REP(j, w) {
			REP(k, 4) {
				int ni = i + dy[2*k], nj = j + dx[2*k];
				if (ni < 0 || ni == h || nj < 0 || nj == w) {
					add_edge(i*w + j + 1+h*w, 2*h*w + 1, 1000000);
				}
				else {
					add_edge(i*w + j + 1+h*w, ni*w + nj + 1, 1);
				
				}
			}
			if (v[i][j] == 'X') {
				add_edge(0, i*w + j + 1, 1000000);
				add_edge(i*w + j + 1, i*w + j + 1 + w*h, 1000000);
			}
			else {
				add_edge(i*w + j + 1, i*w + j + 1 + w*h, 1);
			}
			
		}
	}
	ll ans = max_flow(0, 2 * w*h + 1);
	if (ans >= 100000)cout << -1 << endl;
	else cout<<ans << endl;
}

Measured memory_bytes: 3964
#include <iostream>
#include <string>
#include <stack>
#include <queue>
#include <cmath>
#include <iomanip>
 
#include <fstream>
#include <vector>
#include <algorithm>
 
using namespace std;
 
int main(void)
{
 
    
    long double a, b;
    
    cin >> a >> b;
  
  b *= 100;
  floor(b);
  b /= 100;
    
    cout << fixed << setprecision(0) << floor(a*b) << endl;
    
}

Measured memory_bytes: 3792
//
//  main.cpp
//  20190730lesson
//
//  Created by Priscilla Leang on 7/30/19.
//  Copyright 漏 2019 Priscilla Leang. All rights reserved.
//

#include <iostream>
using namespace std;
int main(int argc, const char * argv[]) {
    int x, y, m;
    m = 0;
    cin>> x;
    for (int i = 1; i<= x; i+=2){  //only odd numbers
        y = 0;
        for(int j = 1; j <= x; j++){
            if (i % j ==0){
                y++;
            }
        }
        if (y == 8){
            m++;
        }
            
    }
    cout << m;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define ALL(x) (x).begin(), (x).end()
#define REP(i ,n) for(int i = 0; i < (int)(n); i++)
#define pb push_back
typedef vector<int>vint;
typedef vector<ll>vll;
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename A,typename B>inline bool chmin(A &a,const B &b){if(a>b){a=b;return true;}else{return false;}}
template<typename A,typename B>inline bool chmax(A &a,const B &b){if(a<b){a=b;return true;}else{return false;}}

int main(){
    int N;
    cin >> N;
    vint ans(26,100);
    REP(i,N){
        vint c(26);
        string S;
        cin >> S;;
        for(auto s:S){
            c[s-'a']++;
        }
        REP(j,26){
            chmin(ans[j],c[j]);
        }
    }
    REP(i,26){
        REP(j,ans[i]){
            cout << (char)('a'+i);
        }
    }
    cout << endl;
}

/*
int main()
{
    int N;
    cin >> N;
    vector<string> S(N);
    cin >> S;
    vector<map<char,int>> cnt(N);
    REP(i,N)REP(j,26)cnt[i][(char)('a'+j)] = 0;
    REP(i,N){
        for(auto s:S[i]){
            cnt[i][s]++;
        }
    }
    string ans = "";
    REP(i,26){
        int num = 100;
        REP(j,N){
            chmin(num,cnt[j][(char)('a'+i)]);
        }
        REP(j,num){
            ans = ans + (char)('a'+i);
        }
    }
    cout << ans << endl;
}
*/

Measured memory_bytes: 3604
#include<stdio.h>
long int mini(long int a,long int b){
  if(a>b) return b;
  return a;
}

int main(void){
  long int ans=1000000000,cnt=0,n,i;
  scanf("%ld",&n);
  long int a[n];
  for(i=0;i<n;i++){
    scanf("%ld",&a[i]);
  }
  for(i=0;i<n;i++){
    cnt=0;
    while(a[i]){
      if(a[i]%2==1) break;
      a[i]/=2;
      cnt++;
    }
    ans=mini(ans,cnt);
  }
  printf("%ld\n",ans);
  return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
long long int mod(long long int n)
{
    if(n>=0)
    {
        return n;
    }
    else
    {
        return -1*n;
    }
}
int main()
{
    long long int n,m,i,j,l,k;
    cin>>n>>m;
    long long int a[n][2];
    long long int b[m][2];
    for(i=1;i<=n;i++)
    {
        for(j=1;j<=2;j++)
        {
            cin>>a[i][j];
        }
    }
    for(i=1;i<=m;i++)
    {
        for(j=1;j<=2;j++)
        {
            cin>>b[i][j];
        }
    }
    long long int c[m];
    for(i=1;i<=n;i++)
    {   k=1;

        for(j=1;j<=m;j++)
        {
            long long int num=mod(a[i][1]-b[j][1])+mod(a[i][2]-b[j][2]);
            c[k]=num;
            k++;
        }
        long long int low=*std::min_element(c+1,c+1+m);
        for(l=1;l<=m;l++)
        {
            if(c[l]==low)
            {
                cout<<l<<endl;
                break;
            }
        }

    }
}


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

int find(int a, int b, int c) {
    for (int i=a; i>0; i--) {
        if ((a%i==0)&&(b%i==0)&&(c%i==0)) {
            return i;
        }
    }
    return 1;
}

int gcd(int a, int b, int c, vector<vector<vector<int>>> &store) {
    if (store.at(a-1).at(b-1).at(c-1) == -1) {
        store.at(a-1).at(b-1).at(c-1) = find(a,b,c);
    }
    return store.at(a-1).at(b-1).at(c-1);
}

int main(void) {
    int k, total=0;
    cin >> k;
    vector<vector<vector<int>>> store(k, vector<vector<int>>(k, vector<int>(k, -1)));
    for (int a=1; a<k+1; a++) {
        for (int b=1; b<k+1; b++) {
            for (int c=1; c<k+1; c++) {
                total += gcd(min(a,min(b,c)), a+b+c - min(a,min(b,c)) - max(a,max(b,c)), max(a,max(b,c)), store);
            }
        }
    }
  cout << total << endl;
}


Measured memory_bytes: 36144
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long H = sc.nextLong();
        long W = sc.nextLong();
        long X = H*W + 1;
        
        if(H==1 || W==1){
          System.out.println(1);
        }else if((H*W)%2 == 0){
            System.out.println((H*W)/2);
        }else{
            System.out.println(X/2);
        }
    }
}


Measured memory_bytes: 21972
/************************************
/ AUTHOR : YATHARTH GOSWAMI         /  
/ ALIAS : hacker_yg                 /
/ INSTITUTE : IIT Kanpur            /
************************************/
//          TEMPLATE                //

#include <bits/stdc++.h>

#define ll long long
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define F first
#define S second

using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int k;
    cin >> k;
    string s;
    cin >> s;
    if ((int)s.length() <= k) cout << s;
    else {
        for (int i = 0; i < k; i++) {
            cout << s[i];
        }
        cout << "...";
    }
    return 0;
}




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

int func(int a) {
	if (a % 2 == 0) return a / 2;
	else return a * 3 + 1;
}

int main() {
	int s, ans;
	cin >> s;
	vector<int> vec(1000001);
	vector<int> cnt(1000001);
	vec[0] = s;
	cnt[vec[0]]++;
	for (int i = 1; i < vec.size(); i++) {
		vec[i] = func(vec[i - 1]);
		cnt[vec[i]]++;
		if (cnt[vec[i]] > 1) {
			ans = i;
			break;
		}
	}
	cout << ans + 1 << endl;
}

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

using namespace std;
using ll = long long;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll X;
  cin >> X;
  ll res = X / 11 * 2;
  if (X % 11 > 0) res++;
  if (X % 11 > 6) res++;
  cout << res << '\n';
  return 0;
}


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

using namespace std;

//------------------------------- Libraries --------------------------------//

//------------------------------- Type Names -------------------------------//

using i64 = int_fast64_t;

using seika = string;
//akari : 1D, yukari : 2D, maki : 3D vector
template <class kizuna>
using akari = vector<kizuna>;
template <class yuzuki>
using yukari = akari<akari<yuzuki>>;
template <class tsurumaki>
using maki = akari<yukari<tsurumaki>>;
//akane : ascending order, aoi : decending order
template <class kotonoha>
using akane = priority_queue<kotonoha, akari<kotonoha>, greater<kotonoha>>;
template <class kotonoha>
using aoi = priority_queue<kotonoha>;

//------------------------------- Dubug Functions ---------------------------//
inline void print()
{
    cout << endl;
}
template <typename First, typename... Rest>
void print(const First &first, const Rest &... rest)
{
    cout << first << ' ';
    print(rest...);
}
//------------------------------- Solver ------------------------------------//

void solve()
{
    unsigned n, m;
    cin >> n >> m;
    cout << bitset<32>(n & m) << endl;
    cout << bitset<32>(n | m) << endl;
    cout << bitset<32>(n ^ m) << endl;
}

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



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

int main() {
  int H1,M1,H2,M2,K;
  cin>>H1>>M1>>H2>>M2>>K;
  cout<<H2*60+M2-H1*60-M1-K;
  
}


Measured memory_bytes: 3624
import math
import sys
import collections

# imgur.com/Pkt7iIf.png

def getdict(n):
    d = {}
    if type(n) is list:
        for i in n:
            if i in d:
                d[i] += 1
            else:
                d[i] = 1
    else:
        for i in range(n):
            t = ii()
            if t in d:
                d[t] += 1
            else:
                d[t] = 1
    return d
def cdiv(n, k): return n // k + (n % k != 0)
def ii(): return int(input())
def mi(): return map(int, input().split())
def li(): return list(map(int, input().split()))
def lcm(a, b): return abs(a*b) // math.gcd(a, b)

a, b = mi()
print(' '.join(str(x) for x in range(max(-10**6, b-a+1), min(10**6, b+a))))

Measured memory_bytes: 38384