akhauriyash/Code-Regression huggingface dataset:
# include "bits/stdc++.h"
using namespace std;
using LL = long long;
using ULL = unsigned long long;
const double PI = acos(-1);
template<class T>constexpr T INF() { return ::std::numeric_limits<T>::max(); }
template<class T>constexpr T HINF() { return INF<T>() / 2; }
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { -1,0,1,0 }, dy[4] = { 0,-1,0,1 };
const char dir[4] = { 'u','l','d','r' };
int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++)if ((n >> i) & 1)cnt++; return cnt; }
int d_sum(LL n) { int ret = 0; while (n > 0) { ret += n % 10; n /= 10; }return ret; }
int d_cnt(LL n) { int ret = 0; while (n > 0) { ret++; n /= 10; }return ret; }
LL gcd(LL a, LL b) { if (b == 0)return a; return gcd(b, a%b); };
LL lcm(LL a, LL b) { LL g = gcd(a, b); return a / g*b; };
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define UNIQUE(wpwpw)        (wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define REP(i,upupu)         FOR(i,0,upupu)
# define INIT                 std::ios::sync_with_stdio(false);std::cin.tie(0)
# pragma warning(disable:4996)

int n;
string s;

int main() {
	cin >> n;
	if (n == 0) {
		cout << 0 << endl;
		return 0;
	}

	LL v = 1;
	while (n) {
		if (n % (2 * abs(v))) {
			s += '1';
			n -= v;
		}
		else {
			s += '0';
		}
		v *= -2;
	}
	reverse(ALL(s));
	cout << s << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main()
{
  int a = 0, b = 0, n, tmpa, tmpb;

  while (1) {
  scanf("%d", &n);
  if(n == 0)
    break;
  a = 0; b = 0;
  for(int i = 0; i < n; i++) {
    scanf("%d%d", &tmpa, &tmpb);
    if(tmpa == tmpb) {
      a += tmpa; b += tmpb;
    } else if(tmpa > tmpb) {
      a += (tmpa + tmpb);
    } else {
      b += (tmpa + tmpb);
    }
  }
  printf("%d %d\n", a, b);
  }

  return 0;
}

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

typedef long long int ll;

int main()
{
    ll n, ans = 1, cnt = 0;
    cin >> n;
    vector<ll>a(n);
    for(ll i = 0;i < n;i++){
        cin >> a[i];
    }
    sort(a.begin(), a.end());
    for(ll i = n - 1;i > 0;i--){
        if(a[i] == a[i - 1]){
            ans *= a[i];
            i--;
            cnt++;
        }
        if(cnt == 2){
            break;
        }
    }

    if(cnt < 2){
        cout << 0;
        return 0;
    }

    cout << ans;

    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <math.h>
#include <algorithm>
#include <vector>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
#define ll long long int
#define PI 3.141592653589793
using namespace std;


// 最大公倍数
ll gcd(ll a,ll b){
    if(b == 0) return a;
    return gcd(b,a%b);
}
// 最小公倍数
ll lcm(ll a,ll b){
    ll g = gcd(a,b);
    return a/g*b;
}

int main() {
    ll A,B;

    cin >> A >> B;
    cout << lcm(A,B) << endl;

    return 0;
}

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

typedef long long ll;

template<typename T>
void remove(std::vector<T>& vector, unsigned int index)
{
    vector.erase(vector.begin() + index);
}


int main(){
 ll N,M;
 cin >> N >> M;
 if(2*N > M){
   cout << M / 2 << endl;
 }else{
   cout << (2*N+M)/4 << endl;
 }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int gcd(int x,int y){
    int a=x,b=y;
    if (x>y){
        a=y;b=x;
    }
    //a<=b
    if (a==0){
        return b;
    }
    if(b%a==0){
        return a;
    }
    else{
        return gcd(a,b%a);
    }
}
int main(){
    int N;
    cin>>N;
    int A[114514];
    int X[114514];
    int Y[114514];
    for(int i=0;i<N;i++){
        cin>>A[i];
        X[i]=0;Y[i]=0;
    }
    for(int i=1;i<N;i++){
        X[i]=gcd(X[i-1],A[i-1]);
    }
    for(int i=N-1;i>=0;i--){
        Y[i]=gcd(Y[i+1],A[i+1]);
    }
    int ans=1;
    for(int i=0;i<N;i++){
        int g=gcd(X[i],Y[i]);
        ans=max(g,ans);
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define INF 1000000000
using namespace std;
using ll = long long;
int main()
{
    int A,B,M;
    cin >> A >> B >> M;
    vector<int> a(A), b(B), x(M), y(M), c(M);
    int mina=INF, minb=INF;
    rep(i,A){
        cin >> a[i];
        mina = min(mina, a[i]);
    }
    rep(i,B){
        cin >> b[i];
        minb = min(minb, b[i]);
    }
    int minc = INF;
    rep(i,M){
        cin >> x[i] >> y[i] >> c[i];
        minc = min(minc, a[x[i]-1] + b[y[i]-1] - c[i]);
    }
    cout << min(mina + minb, minc) << endl;
}

Measured memory_bytes: 2304
//----------BHAVIK DIWANI(PICT_COMP)---------------
#include<bits/stdc++.h>
#include<stdlib.h>
#include<stdio.h>
#define test ll t; cin>>t; while(t--)
#define FOR(p,n) for(ll i=p;i<(ll)n;i++)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mod 1000000007
#define ll long long
#define int long long
#define ull unsigned long long
#define MAX 1000005
#define pb push_back
#define mkp make_pair
#define vi vector<int>
#define pii pair<int,int>
#define endl '\n'
#define vs vector<string>
#define mii map<int,int>
#define msi map<string,int>
#define vpii vector< pair<int, int > >
#define vpsi vector< pair< string ,int > >
#define forci(p,q) for(int i=p;i<q;i++)
ll gcd(ll a,ll b){ if(b==0) return a;    return gcd(b,a%b);}
ll lcm(ll a,ll b) { return (a/gcd(a,b)*b);}
ull power(ull a, ull b) {a %= mod;  ull res = 1;  while (b > 0) { if (b & 1) res = res * a % mod;  a = a * a % mod;  b >>= 1; }  return res%mod; }
ll modmul(ll x, ll y){return (x*y)%mod;}
ll modadd(ll x, ll y){return (x+y)%mod;}
ll modsub(ll x, ll y){return (x-y+mod)%mod;}
ll fact[1000007]={0};
void facto() {fact[0]=1;fact[1]=1;for(int i=2;i<100007;i++)fact[i]=(fact[i-1]*i)%mod;}
ll ncr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(power(fact[r],mod-2)))%mod; res=(res*(power(fact[n-r],mod-2)))%mod; return res;}
ll npr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(power(fact[n-r],mod-2)))%mod; return res;}
inline long long toint(const std::string &s) {std::stringstream ss; ss << s; long long x; ss >> x; return x;}
inline std::string tostring(long long number) {std::stringstream ss; ss << number; return ss.str();}
inline std::string tobin(long long x) {return std::bitset<63>(x).to_string();}
/*bool prime[MAX];
ull sieve(){memset(prime,true,sizeof(prime));for(ull p=2;p*p<MAX;p++){if(prime[p]==true){for(ull i=2*p;i<MAX;i+=p){prime[i]=false;}}}prime[0]=0;prime[1]=0;
}*/
using namespace std;
int solve()
{
	int n;
	cin>>n;
	int a[n];
	int sum=0;
	forci(0,n)	cin>>a[i], sum+=a[i];
	int mn=INT_MAX;
	for(int i=1;i<=100;i++)
	{
		int pos=i;
		int res=0;
		for(int j=0;j<n;j++)
			res+=abs(a[j]-pos)*abs(a[j]-pos);
		mn=min(res,mn);
	}
	cout<<mn<<endl;


}
signed main()
{
	fastio;
	clock_t start, end;
//	test
	{
		start=clock();
		solve();
		end=clock();
		double time_taken=double(end-start)/double(CLOCKS_PER_SEC);
//		cout<<"time taken :"<<time_taken<<endl;
	}
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
#include<iterator>
#include<list>
using namespace std;
typedef  long long int lint;
typedef pair<int, int> IP;
typedef pair<lint, lint> LLP;
typedef pair<char, char>CP;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define llower(v,hoge) *lower_bound(v.begin(), v.end(), hoge)
#define lupper(v,hoge) *upper_bound(v.begin(), v.end(), hoge)

int main() {
	set<lint>S;
	int N;
	cin >> N;
	lint tmp = 0;
	rep(i, N) {
		cin >> tmp;
		S.insert(tmp);
	}
	int M;
	cin >> M;
	rep(i, M) {
		cin >> tmp;
		S.insert(tmp);
	}
	for (set<lint>::iterator itr = S.begin(); itr != S.end(); itr++) {
		cout << *itr << endl;
	}
}




Measured memory_bytes: 21824
#include<iostream>
#include<queue>

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

const int INF = 1145141919;

int H, W;
bool field[50][50];
int cost[50][50];
int vx[4] = { 0,1,0,-1 }, vy[4] = { 1,0,-1,0 };

void bfs() {
	queue<P> q;
	for (int i = 0; i < H; i++)for (int j = 0; j < W; j++)cost[i][j] = INF;
	cost[0][0] = 0;
	q.push(P(0, 0));
	while (q.size()) {
		P pos = q.front(); q.pop();

		for (int i = 0; i < 4; i++) {
			int nx = pos.first + vx[i], ny = pos.second + vy[i];
			if (nx < 0 || ny < 0 || nx >= H || ny >= W)continue;
			if (cost[nx][ny] > cost[pos.first][pos.second] + 1 && field[nx][ny] == false) {
				cost[nx][ny] = cost[pos.first][pos.second] + 1;
				q.push(P(nx, ny));
			}
		}

	}
}

int main() {
	cin >> H >> W;
	int black_n = 0;
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			char c;
			cin >> c;
			if (c == '.')field[i][j] = false;
			else field[i][j] = true, black_n++;
		}
	}
	
	bfs();
	if (cost[H - 1][W - 1] == INF) {
		cout << -1 << endl;
	}
	else {
		cout << H * W - black_n - (cost[H - 1][W - 1] + 1) << endl;
	}

	return 0;
}

Measured memory_bytes: 256
import sys
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
H,W,K = LI()
c = [S() for _ in range(H)]
black = 0
for h in range(H):
    for w in range(W):
        if c[h][w]=='#':
            black += 1
ans = 0
for h in range(2**H):
    for w in range(2**W):
        copy_black = black
        bit_h = [h>>i&1 for i in range(H)]
        bit_w = [w>>i&1 for i in range(W)]
        for i,bit_i in enumerate(bit_h):
            for j in range(W):
                if bit_i==1:
                    if c[i][j]=='#':
                        copy_black -= 1
        for j,bit_j in enumerate(bit_w):
            for i in range(H):
                if bit_j==1:
                    if c[i][j]=='#':
                        copy_black -= 1
        for i,bit_i in enumerate(bit_h):
            for j,bit_j in enumerate(bit_w):
                if bit_i==bit_j==1:
                    if c[i][j]=='#':
                        copy_black += 1
        if copy_black==K:
            ans += 1
print(ans)


Measured memory_bytes: 9244
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <cstdio>
#include <string>
#include <cmath>
#include <queue>
#include <tuple>
#include <set>
#include <assert.h>
#include <sstream>
#include <string>
//#include <bits/stdc++.h>
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repr(i, n) for (int i = (n) - 1; i >= 0; i--)
#define FOR(i,i0,n) for(int (i)=(i0);(i)<(n);(i)++)
#define FORR(i,i0,n) for(int (i)=(n)-1; (i)>=(i0);(i)--)
#define SORT(x) sort(x.begin(),x.end())
#define SORTR(x) sort(x.begin(),x.end(),greater <>())
#define rn return
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
using namespace std;
using ll = long long;
typedef std::pair<ll,ll> P;
//#include <boost/multiprecision/cpp_int.hpp>
//using bint = boost::multiprecision::cpp_int;


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


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
char a1,b1,c1,d1;
int ans,a,b,c,d;
cin>>a1>>b1>>c1>>d1;
a=a1-'0';b=b1-'0';c=c1-'0';d=d1-'0';
for(char i='+';i<='-';i++)
    for(char j='+';j<='-';j++)
        for(char k='+';k<='-';k++)
        {
            ans=a;
            if(i=='+') ans+=b;
            else if(i=='-') ans-=b;
            if(j=='+') ans+=c;
            else if(j=='-') ans-=c;
            if(k=='+') ans+=d;
            else if(k=='-') ans-=d;
            if(ans==7)
            {
                cout<<a<<i<<b<<j<<c<<k<<d<<"="<<ans<<"\n";
                return 0;
            }
        }
}

Measured memory_bytes: 256
//
//  main.c
//  aoj_05
//
//  Created by k16031kk on 2018/05/17.
//  Copyright © 2018年 AIT. All rights reserved.
//

#include <stdio.h>

int main(int argc, const char * argv[]) {
    // insert code here...
    int a,b;
    scanf("%d %d",&a, &b);
    if(a < b){
        printf("a < b\n");
    } else if(a > b){
        printf("a > b\n");
    } else{
        printf("a == b\n");
    }
    return 0;
}



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

int main(){
  string S;
  cin>>S;
  if(S=="SUN")
    cout<<7<<endl;
  else if(S=="MON")
    cout<<6<<endl;
  else if(S=="TUE")
    cout<<5<<endl;
  else if(S=="WED")
    cout<<4<<endl;
  else if(S=="THU")
    cout<<3<<endl;
  else if(S=="FRI")
    cout<<2<<endl;
  else if(S=="SAT")
    cout<<1<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cctype>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <string>
#include <functional>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iomanip>
#include <bitset>
#define pb push_back
#define YES cout<<"YES"<<endl
#define Yes cout<<"Yes"<<endl
#define NO cout<<"NO"<<endl
#define No cout<<"No"<<endl
#define INF (1<<10)
#define MOD 1000000007
typedef long long ll;
using namespace std;

int main() {
    int r,g,b;
    cin>>r>>g>>b;
    if((r*100+g*10+b)%4==0)YES;
    else NO;
    return 0;
}


Measured memory_bytes: 256
N, K = map(int, input().split())
H_list = list(map(int, input().split()))

count = 0

if N<K:
    print(0)
else:
    # リストをソートする
    H_list = sorted(H_list, reverse=True)
    # 上位K位をスライスで削除
    H_list = H_list[K:]


    # リスト内の残りの数を合計
    count = sum(H_list)
    print(count)


Measured memory_bytes: 26024
#pragma comment(linker, "/STACK:1024000000,1024000000")
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <limits.h>
#include <assert.h>
#include <math.h>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <string>
#include <bitset>
#include <vector>
using namespace std;

#define LL long long

#define fi first
#define se second
#define lson l,mid,id<<1
#define rson mid+1,r,id<<1|1
#define ls id<<1
#define rs id<<1|1
#define MID(a,b) (((a)+(b))>>1)
#define maxx(a,b) ((a)<(b)?(b):(a))
#define minx(a,b) ((a)<(b)?(a):(b))
#define absx(a) ((a)<0?-(a):(a))
#define mk(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define itr iterator
#define lowbit(x) ((x)&-(x))

typedef unsigned LL ULL;
typedef unsigned uint;
typedef map<int,int> mii;
typedef pair<int,int> pii;
typedef pair<double,double> pdd;
typedef pair<LL,LL> pLL;

template< typename T > inline void read(T &x) {
    static bool fr_f; static char fr_ch;
    fr_f=0; x=0; fr_ch=getchar();
    while(fr_ch<'0' || '9'<fr_ch) {if(fr_ch=='-') fr_f=1; fr_ch=getchar();}
    while('0'<=fr_ch && fr_ch<='9') {x=(x<<1)+(x<<3)+fr_ch-'0'; fr_ch=getchar();}
    if(fr_f) x=-x;
}

template< typename T > inline void Max (T &a, T b) {if(a<b) a=b;}
template< typename T > inline void Min (T &a, T b) {if(b<a) a=b;}
template< typename T > inline void Swap(T &a, T &b) {T c=a;a=b;b=c;}
template< typename T > inline T Abs(T a) {if(a<0) return -a; else return a;}

const double   pi = acos(-1.0) ;
const int     MOD = (int)998244353 ;
const int     INF = (int)0x3f3f3f3f ;
const LL     LINF = (LL)INF<<32|INF ;
const int    SINF = (uint)(-1)>>1 ;
const LL    SLINF = (ULL)(-1)>>1 ;
const double DINF = 1e50 ;
const double  eps = 1e-8 ;
const int    maxn = (int) 1e5+20 ;
const int    maxm = (int) 1000+20 ;
const int    maxk = (int) 1000+20 ;

inline int sig(double x) {return x<-eps?-1:x>eps;}
inline LL fp(LL a,LL n,LL p) {LL res=1; for(;n;n>>=1,a=a*a%p) if(n&1) res=res*a%p; return res;}
template<typename T>inline T gcd(T a,T b) {for(T c;b;c=a%b,a=b,b=c); return a;}

//--------------------start--------------------

int n;
int a[3];
int idx[3];

void work()
{
    for(int i = 0; i < 3; i++) read(a[i]);
    for(int i = 0; i < 3; i++) idx[i] = i;

    int ans = INF;
    do
    {
        int tmp =  0;
        for(int i = 1; i < 3; i++) tmp += Abs(a[idx[i]] - a[idx[i - 1]]);
        ans = min(ans, tmp);
    }while(next_permutation(idx, idx + 3));

    cout <<ans <<endl;
}

//---------------------end---------------------

int main()
{
#ifdef yukihana0416
freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
#endif // yukihana0416
    work();
    return 0;
}


Measured memory_bytes: 256
(defun solve ()
     (loop repeat (read) with result = 1 and max = (expt 10 18) 
           with bool = t and x
           do (setf x (read))
           when bool
           do (setf result (* result x))
           if (> result max) 
           do (setf bool nil
                    result -1)
           else if (zerop x) do (setf result 0)
           finally (return result)))
     
(princ (solve))

Measured memory_bytes: 76900
#include<bits/stdc++.h>
typedef long long ll ;
typedef double db;
typedef long double ldb;
typedef unsigned long long ull ;
const double PI = acos(-1) ;

#define pf		  	printf
#define sf			  scanf
#define pb(a)         push_back(a)
#define for0(i,n)          for(int i=0;i<n;i++)
#define for1(i,n)          for(int i=1;i<=n;i++)
#define forab(i,a,b)       for(int i=a;i<=b;i++)
//#define gcd(a, b)     __gcd(a, b)
#define lcm(a, b)     ((a)*((b)/gcd(a,b)))
#define sq(a)		   (a)*(a)
#define nw				"\n"
//#define abs(x)		fabs(x)
#define pcase(z,x)     cout<<"Case "<<z<<": "<<x<<"\n"
#define CIN	ios_base::sync_with_stdio(0); cin.tie(0)
#define max 1000000000000000000

using namespace std;

int n,arr[2100000],ans;
int main(void)
{
    CIN;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        int x;
        cin>>x;
        arr[x]++;
    }
    for(int i=1;i<=1000000;i++)
    {
        if(arr[i]==1)ans++;
        if(arr[i]>0)
        {
            for(int j=i;j<=1000000;j+=i)
            {
                arr[j]=0;
            }
        }
    }
    cout<<ans<<nw;
}


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

using namespace std;

#define pb push_back
#define mp make_pair
#define MOD ((int)(1e9) + 7)

const int N = 2 * ((int)1e5) + 5;

int n;
char str[N];
stack<char> s;

int main ()
{
	scanf("%s",str + 1);
	n = strlen(str + 1);
	for (int i = 1; i <= n; i++)
	{
		if (str[i] == 'S')
			s.push('S');
		else if (str[i] == 'T' && (int)s.size() > 0 && s.top() == 'S')
			s.pop();
		else if (str[i] == 'T')
			s.push('T');
	}
	printf("%d",(int)s.size());
}

Measured memory_bytes: 640
import math
a,b=map(int,input().split())
ans=0.0
for i in range(1,a+1):
    # print(i,round(b/i,2),math.log2(i),math.log2(b/i),math.ceil(math.log2(b/i)))
    # print(i,(1 / ((2**(max(1,math.ceil(math.log2(b/i)))))*a)))
    temp = (1 / ((2**(max(1,math.ceil(math.log2(b/i)))))*a))
    if i >= b:
        temp = 1/a
    ans += temp
print(ans)

Measured memory_bytes: 3060
#include<iostream>
#include<algorithm>
#include<math.h>
#include<string>
#include<vector>
#include<queue>
using namespace std;
typedef pair<int, int>P;
typedef long long ll;

int main() {
	int a, b; cin >> a >> b;
	if (a >= 13) {
		cout << b << endl;
	}
	else if (a >= 6) {
		cout << b / 2 << endl;
	}
	else {
		cout << 0 << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
typedef pair<int,int>pi;
#define ff first
#define ss second
#define inf 1000000000
#define IOS ios_base::sync_with_stdio(0)
#define bitseT(y,pos) (1<<pos)|y
#define bitchecK(y,pos) ((1<<pos)&y)
#define meM(y,a) memset(y,a,sizeof y)
#define sC(a) scanf("%d",&a)
#define alL(a) a.begin(),a.end()
#define prinT(a,sz)  cout<<a[0];for(int i=1;i<sz;i++)cout<<" "<<a[i];cout<<endl
int main()
{
    IOS;
    map<int,int>mp;
    multiset<int,greater<int > >st;
    int n,k;cin>>n>>k;
    for(int i=0;i<n;i++)
    {
        int a,b;cin>>a>>b;
        st.insert(a);
        st.insert(b);
        mp[a]=1;
    }
    int ans=0;
    int sum=0;
    for(auto it=st.begin();it!=st.end();it++){
        int val=*it;
//        cout<<"val = "<<val<<endl;
        if(mp[val]==1){
            ans+=ceil((1.0*k-sum)/val);
            break;
        }
        sum+=val;
        ans++;
        if(sum>=k)break;
    }
    cout<<ans<<endl;
}



/*
100 150
50 80
40 70

*/


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

#define INF INT_MAX
#define ll long long
#define MAX_PRIME 300000

using namespace std;

bool isPrime[MAX_PRIME+1];	//true:?´???°??§?????????false:?´???°??§??????
int sumOfPrime[MAX_PRIME+1]; //?´???????

int main(){
	//?????????
	for(int i = 0;i <= MAX_PRIME;i++){
		isPrime[i] = true;
	}
	isPrime[0] = isPrime[1] = false;
	sumOfPrime[0] = 0;

	//?´???°???n <= 123456???????±???????
	for(ll i = 1;i <= MAX_PRIME;i++){
		sumOfPrime[i] = sumOfPrime[i-1];
		if(isPrime[i] == true){
			sumOfPrime[i]++;
			for(ll j = 2; i*j <= MAX_PRIME;j++){
				isPrime[i*j] = false;
			}
		}
	}

	int x;
	while(true){
		scanf("%d",&x);
		if(x == 0)
			break;
		cout << sumOfPrime[2*x] - sumOfPrime[x] << endl;
	}

	return 0;
}

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

int main()
{
  int n, m;
  cin >> n >> m;
  vector<long long> v(m);
  for (int i = 0; i < m; i++) {
    cin >> v.at(i);
  }
  sort(v.begin(), v.end());
  vector<long long> len(m-1);
  for (int i = 0; i+1 < m; i++) {
    len.at(i) = v.at(i+1) - v.at(i);
  }
  sort(len.begin(), len.end());
  int npick = max(0, m - n);
  cout << accumulate(len.begin(), len.begin()+npick, 0) << '\n';
  return 0;
}


Measured memory_bytes: 1792
#include <cstdio>
#include <cctype>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;

#define ll long long
#define reg register
#define rep(i, a, b) for (reg int i = (a), i##end = (b); i <= i##end; ++i)
#define dep(i, a, b) for (reg int i = (a), i##end = (b); i >= i##end; --i)

template <typename _typer> inline _typer read() {
    _typer init = 0;
    char ch = getchar(), k = 0;
    for ( ; !isdigit(ch); ch = getchar()) k = (ch == '-');
    for ( ; isdigit(ch); ch = getchar())
        init = (init << 3) + (init << 1) + (ch ^ 48);
    return k ? -init : init;
}
const ll N = 0, INF = 1e9;


int main() {
    int a = read<int>(), b = read<int>();
    cout << max(a + b, max(a - b, a * b)) << endl;
    return 0;
}



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

int main() {
  int N;
  cin >> N;
  int cnt;
  string N_str;
  for(int i=1;i<N+1;i++){
    N_str=std::to_string(i);
    if(N_str.length() % 2 != 0) cnt++;
  }
  cout << cnt << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h> 
 
#define INF (1<<31)//INT_MAX/2
#define MOD 1000000007
 
using ll  = long long;
using ull = unsigned long long;

int main(int argc, char *argv[])
{
    int N;
    std::cin >> N;

    std::vector<ull> lucas(N + 1);
    lucas[0] = 2;
    lucas[1] = 1;

    for (int i = 2; i <= N; i++) {
        lucas[i] = lucas[i-1] + lucas[i-2];
    }

    std::cout << lucas[N] << std::endl;

    return 0;
}

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

const int MAX_N = 2e6 + 12, MOD = 1e9 + 7;
int x1, x2, x3, x4, x5, x6;
int y1, y2, y3, y4, y5, y6;
int F[MAX_N], Fdiv[MAX_N];
int ans;

int _sum (int a, int b) {
	int c = a + b;
	if (MOD <= c)
		c -= MOD;

	return c;
}

int _sub (int a, int b) {
	int c = a - b;
	if (c < 0)
		c += MOD;

	return c;
}

int _mul (int a, int b) {
	int c = 1LL * a * b % MOD;
	return c;
}

int _pow (int a, int b) {
	if (!b)
		return 1;

	int res = _pow(a, b >> 1);
	res = _mul(res, res);

	if (b & 1)
		res = _mul(res, a);

	return res;
}

int _choose (int a, int b) {
	if (b < a || min(a, b) < 0)
		return 0;

	return _mul(F[b], _mul(Fdiv[a], Fdiv[b - a]));
}

void preProcess() {
	F[0] = 1;
	Fdiv[0] = 1;
	for (int i = 1; i < MAX_N; i++) {
		F[i] = _mul(i, F[i - 1]);
		Fdiv[i] = _pow(F[i], MOD - 2);
	}
}

int calc1 (int x, int y) {
	int c = _choose(x - x1 + 1, x - x1 + 1 + y - y1 + 1);
	c = _sum(c, _choose(x - x2, x - x2 + y - y2));
	c = _sub(c, _choose(x - x1 + 1, x - x1 + 1 + y - y2));
	c = _sub(c, _choose(x - x2, x - x2 + y - y1 + 1));
	return c;
}

int calc2 (int x, int y) {
	int c = _choose(x6 - x + 1, x6 - x + 1 + y6 - y + 1);
	c = _sum(c, _choose(x5 - x, x5 - x + y5 - y));
	c = _sub(c, _choose(x6 - x + 1, x6 - x + 1 + y5 - y));
	c = _sub(c, _choose(x5 - x, x5 - x + y6 - y + 1));
	return c;
}

int main() {
	preProcess();
	ios::sync_with_stdio(false), cin.tie(0);
	cin >> x1 >> x2 >> x3 >> x4 >> x5 >> x6;
	cin >> y1 >> y2 >> y3 >> y4 >> y5 >> y6;


	for (int i = x3 + 1; i + 1 <= x4; i++) {
		ans = _sum(ans, _mul(_sub(_sub(0, i), y3), _mul(calc1(i, y3 - 1), calc2(i, y3))));
		ans = _sum(ans, _mul(_sum(_sum(1, i), y4), _mul(calc1(i, y4), calc2(i, y4 + 1))));
	}

	for (int j = y3 + 1; j + 1 <= y4; j++) {
		ans = _sum(ans, _mul(_sub(_sub(0, x3), j), _mul(calc1(x3 - 1, j), calc2(x3, j))));
		ans = _sum(ans, _mul(_sum(_sum(1, x4), j), _mul(calc1(x4, j), calc2(x4 + 1, j))));
	}

	ans = _sum(ans, _mul(_sub(_sub(0, x3), y3), _mul(calc1(x3 - 1, y3), calc2(x3, y3))));
	ans = _sum(ans, _mul(_sub(_sub(0, x3), y3), _mul(calc1(x3, y3 - 1), calc2(x3, y3))));

	ans = _sum(ans, _mul(_sum(_sum(1, x4), y4), _mul(calc1(x4, y4), calc2(x4 + 1, y4))));
	ans = _sum(ans, _mul(_sum(_sum(1, x4), y4), _mul(calc1(x4, y4), calc2(x4, y4 + 1))));

	if (x3 < x4 && y3 < y4) {
		ans = _sum(ans, _mul(_sub(_sub(0, x4), y3), _mul(calc1(x4, y3 - 1), calc2(x4, y3))));
		ans = _sum(ans, _mul(_sum(_sum(1, x4), y3), _mul(calc1(x4, y3), calc2(x4 + 1, y3))));
	
		ans = _sum(ans, _mul(_sub(_sub(0, x3), y4), _mul(calc1(x3 - 1, y4), calc2(x3, y4))));
		ans = _sum(ans, _mul(_sum(_sum(1, x3), y4), _mul(calc1(x3, y4), calc2(x3, y4 + 1))));
	}

	if (x3 == x4 && y3 < y4) {
		ans = _sum(ans, _mul(_sum(_sum(1, x3), y3), _mul(calc1(x3, y3), calc2(x3 + 1, y3))));
		ans = _sum(ans, _mul(_sub(_sub(0, x3), y4), _mul(calc1(x3 - 1, y4), calc2(x3, y4))));
	}
	if (x3 < x4 && y3 == y4) {
		ans = _sum(ans, _mul(_sum(_sum(1, x3), y3), _mul(calc1(x3, y3), calc2(x3, y3 + 1))));
		ans = _sum(ans, _mul(_sub(_sub(0, x4), y3), _mul(calc1(x4, y3 - 1), calc2(x4, y3))));
	}
	cout << ans << "\n";
	return 0;
}

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

using pii = pair<int,int>;
using ll = long long;
#define rep(i, j) for(int i=0; i < (int)(j); i++)
#define repeat(i, j, k) for(int i = (j); i < (int)(k); i++)
#define all(v) v.begin(),v.end()
#define debug(x) cerr << #x << " : " << x << endl

template<class T> bool set_min(T &a, const T &b) { return a > b  ? a = b, true : false; }
template<class T> bool set_max(T &a, const T &b) { return a < b  ? a = b, true : false; }
// vector
template<class T> istream& operator >> (istream &is , vector<T> &v) { for(T &a : v) is >> a; return is; }
template<class T> ostream& operator << (ostream &os , const vector<T> &v) { for(const T &t : v) os << "\t" << t; return os << endl; }
// pair
template<class T, class U> ostream& operator << (ostream &os , const pair<T, U> &v) { return os << "<" << v.first << ", " << v.second << ">"; }

const int INF = 1 << 30;
const ll INFL = 1LL << 60;


class Solver {
  public:
    bool solve() {
        ll N, K; cin >> N >> K;
        vector<ll> A(N), F(N); cin >> A >> F;
        sort(all(A));
        sort(all(F));reverse(all(F));
        ll l = 0, r = INFL; // r
        while(l + 1 < r) {
            ll m = (l + r) / 2;
            ll k = K;
            rep(i, N) {
                if(A[i] * F[i] > m) {
                    ll tmp = A[i] - m / F[i];
                    assert(tmp > 0);
                    assert((A[i] - tmp) * F[i] <= m);
                    k -= tmp;
                }
            }
            (k >= 0 ? r : l) = m;
        }
        ll kk = K;
        rep(i, N) {
            if(A[i] * F[i] > 0) kk -= A[i];
        }
        if(kk >= 0) r = 0;
        cout << r << endl;
        return 0;
    }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    Solver s;
    s.solve();
    return 0;
}


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

typedef long long int LL;
typedef long long int LLint;
typedef pair<int,int> intpair;
typedef pair<bool,bool> boolpair;
typedef pair<string,string> strpair;
typedef pair<LL,LL> LLpair;
typedef pair<double,double> doublepair;
typedef pair<float,float> floatpair;
typedef vector<int> intvector;
typedef vector<bool> boolvector;
typedef vector<string> strvector;
typedef vector<LL> LLvector;
typedef vector<double> doublevector;
typedef vector<float> floatvector;
#define ED return 0;
#define TEST cout << "OK" << endl;
#define UP(a,b) ((a+(b-1))/b)
#define SORT(vec) sort(vec.begin(),vec.end());
#define DOUBLECHANGE(count) cout << setprecision(count);
#define REV(vec) reverse(vec.begin(),vec.end());
#define ipow(x,y) LL(pow(x,y))
#define INF 999999999
const long long mod = 1000000007;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, K;
    cin >> N >> K;
    vector<int> vec (N);
    for(int i = 0;i < N;i++){
    	cin >> vec.at(i);
    }
    SORT(vec);
    int ans = INF;
    for(int i = 0;i < N-K+1;i++){
    	ans = min(ans,abs(vec.at(i)-vec.at(i+K-1)));
    }
    cout << ans << endl;
}

Measured memory_bytes: 640
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <queue>

using namespace std;

using PII = pair<int, int>;

const int inf = 1e9;

int main() {
	int n, x, y;
	cin >> n >> x >> y;
	x--;
	y--;

	vector<int> n_dist(n, 0);
	for (int st = 0; st < n; st++) {
		queue<int> que;
		vector<int> dist(n, inf);

		auto push = [&](int to, int d) {
			if (dist[to] != inf) {
				return;
			}
			dist[to] = d;
			que.push(to);
		};
		push(st, 0);

		while (!que.empty()) {
			int now = que.front();
			que.pop();
			int d = dist[now];

			if (now > 0) { push(now-1, d+1); }
			if (now < n - 1) { push(now+1, d+1); }
			if (now == x) { push(y, d+1); }
			if (now == y) { push(x, d+1); }
		}

		for (int i = 0; i < n; i++) {
			n_dist[dist[i]]++;
		}
	}

	for (int i = 1; i < n; i++) {
		cout << n_dist[i] / 2 << endl;
	}
	return 0;
}


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

using namespace std;
typedef long long ll;

struct Range {
	ll first, last, sz;
};

vector<ll> getDP(const vector<ll> a) {
	const int n = (int) a.size();
	vector<ll> dp(n + 1, 0);

	vector<Range> ranges;

	ranges[0].last;

	for (int i = n - 1; i >= 0; --i) {
		dp[i] = dp[i+1];
		ranges.push_back( { a[i], a[i], 1LL });

		// cerr << "i = " << i << endl;

		while (ranges.size() > 1) {
			const int k = (int) ranges.size();

			if (ranges[k - 1].last <= ranges[k - 2].first)
				break;
			while (ranges[k - 1].last > ranges[k - 2].first) {
				ranges[k - 2].first <<= 2;
				// cerr << ranges[k-2].first << endl;
				ranges[k - 2].last <<= 2;
				dp[i] += ranges[k - 2].sz;
			}
			ranges[k - 2].first = ranges[k - 1].first;
			ranges[k - 2].sz += ranges[k - 1].sz;
			ranges.pop_back();
		}
		// cerr << "sz = " << ranges.size() << endl;
		// cerr << "sum = " << sum << endl;
	}

	return dp;
}

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

	int n;
	cin >> n;
	vector<ll> a(n);
	for (ll &x : a)
		cin >> x;

	const vector<ll> dp1 = getDP(a);

	reverse(a.begin(), a.end());
	const vector<ll> dp2 = getDP(a);

	ll ans = 1LL << 60;
	for (int i = 0; i <= n; ++i) {
		const ll res = i + 2 * dp1[i] + 2 * dp2[n - i];
		// cerr << i << ' ' << 2*dp1[i] << ' ' << 2*dp2[n-i] << ' ' << res << endl;
		ans = min(ans, res);
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 14180
package main

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

var sc = bufio.NewScanner(os.Stdin)
var buff []byte

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

func nextFloat64() float64 {
	sc.Scan()
	f, err := strconv.ParseFloat(sc.Text(), 64)
	if err != nil {
		panic(err)
	}
	return f
}

func nextInt() int {
	sc.Scan()
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return i
}

func nextInts(n int) (r []int) {
	r = make([]int, n)
	for i := 0; i < n; i++ {
		r[i] = nextInt()
	}
	return r
}

var dy = []int{0, 1, 0, -1}
var dx = []int{1, 0, -1, 0}
var MAX = math.MaxInt64

func maxInt(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r < a[i] {
			r = a[i]
		}
	}
	return r
}
func minInt(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r > a[i] {
			r = a[i]
		}
	}
	return r
}
func sum(a []int) (r int) {
	for i := range a {
		r += a[i]
	}
	return r
}
func absInt(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

type Pair struct {
	a, b int
}

type Pairs []Pair

func (p Pairs) Len() int {
	return len(p)
}
func (p Pairs) Swap(i, j int) {
	p[i], p[j] = p[j], p[i]
}

func (p Pairs) Less(i, j int) bool {
	if p[i].a == p[j].a {
		return p[i].b < p[j].b
	}
	return p[i].a < p[j].a
}

func init() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(buff, bufio.MaxScanTokenSize*1024)
	log.SetFlags(log.Lshortfile)
}

var inf = math.MaxInt64

type Point struct {
	x, y int
}

var H, W, K int
var i, j int

func main() {
	// s := time.Now()
	H = nextInt()
	W = nextInt()
	K = nextInt()
	var start, goal Point
	start.y = nextInt() - 1
	start.x = nextInt() - 1
	goal.y = nextInt() - 1
	goal.x = nextInt() - 1
	grid := make([]string, H)
	for i = 0; i < H; i++ {
		grid[i] = nextString()
	}
	step := make([][]int, H)
	for i = 0; i < H; i++ {
		step[i] = make([]int, W)
	}
	for i = 0; i < H; i++ {
		for j = 0; j < W; j++ {
			step[i][j] = inf
		}
	}
	step[start.y][start.x] = 0
	q := make([]*Point, 0)
	q = append(q, &start)
	idx := 0
	var next Point
	for idx < len(q) {
		now := q[idx]
		idx++
		for d := 0; d < 4; d++ {
			var k int
			for k = 1; k <= K; k++ {
				next.x = now.x + dx[d]*k
				next.y = now.y + dy[d]*k
				if next.x < 0 || next.x >= W || next.y < 0 || next.y >= H {
					break
				}
				if grid[next.y][next.x] == '@' {
					break
				}
				if step[next.y][next.x] <= step[now.y][now.x] {
					break
				}
				if step[next.y][next.x] <= step[now.y][now.x]+1 {
					continue
				}
				step[next.y][next.x] = step[now.y][now.x] + 1
				q = append(q, &Point{x: next.x, y: next.y})
			}
		}
		// elapsed := time.Since(s)
		// if elapsed > 2900*time.Millisecond {
		// 	break
		// }
	}
	if step[goal.y][goal.x] == inf {
		fmt.Println("-1")
	} else {
		fmt.Println(step[goal.y][goal.x])
	}
}


Measured memory_bytes: 45344
#include<bits/stdc++.h>
using namespace std;
#define int long long 
int n,m,a[200005],b[200005];
signed main()
{
	cin>>n>>m;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];b[i]=1;
	}
	for(int i=1;i<=m;i++)
	{
		int u,v;
		cin>>u>>v;
		if(a[u]>=a[v])b[v]=0;
		if(a[v]>=a[u])b[u]=0;
	}
	int ans=0;
	for(int i=1;i<=n;i++)
		ans+=b[i];
	cout<<ans;
}

Measured memory_bytes: 5096
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()

a, b = na()
ct = 0
for i in range(0, 20):
    ct = a * i - (i - 1)
    if ct >= b:
        print(i)
        break

Measured memory_bytes: 3060
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <functional>
using namespace std;

int n, a[100009], b[100009], minx = 2000000000, minid;

int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> b[i] >> a[i];
		if (minx > a[i]) { minx = a[i]; minid = b[i]; }
	}
	cout << minx + minid << endl;
	return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define INF 2147483647
#define INFF 9223372036854775807
#define ll long long
#define pb push_back
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,m,n) for(int i=m;i<n;i++)
#define ALL(N) (N.begin(),N.end())

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int M, D, ans=0;
  cin >> M >> D;
  if(M<4 || D<22) ans=0;
  else {
    for(int m=4; m<=M; m++) {
      for(int d=22; d<=D; d++) {
        int d_1=d%10, d_10=d/10;
        if(d_1>=2 && d_1*d_10==m) ans++;
      }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
import numpy as np

N, D = map(int, input().split())
XY = [list(map(int, list(input().split()))) for i in range(N)]

ans = 0
for i in range(N):
    if np.sqrt(XY[i][0]**2 + XY[i][1]**2) <= D:
        ans += 1

print(ans)

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

int main() {
long double pi = 3.1415926535897932;
  int A, B,H,M;
  cin >> A >> B >> H >> M;
  double angle = 60 * H - 11 * M;
  long double a = A*A + B*B -2*A*B*cos(2*pi*angle/720);
  cout << fixed << setprecision(12) << sqrt(a);
}

Measured memory_bytes: 4164
import java.util.Scanner;

public class Main {

	static boolean f(int w, int[] book, int n, int m) {
		int need = 1;
		int s = 0;
		for (int i = 0; i < m; i++) {
			if (book[i] > w) {
				return false;
			}
			if (s + book[i] > w) {
				need++;
				s = 0;
			}
			s += book[i];
		}
		return need <= n;
	}

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		while (true) {
			int n = scanner.nextInt();
			int m = scanner.nextInt();
			if (n == 0 && m == 0)
				break;
			int[] book = new int[m];
			int r = 0;
			for (int i = 0; i < m; i++) {
				book[i] = scanner.nextInt();
				r += book[i];
			}
			int l = r / n;

			while (r - l > 1) {
				int mid = (l + r) / 2;
				if (f(mid, book, n, m)) {
					r = mid;
				} else {
					l = mid;
				}
			}
			System.out.println(f(l, book, n, m) ? l : r);
		}

	}
}

Measured memory_bytes: 21012
# エイシング プログラミング コンテスト 2020: B – An Odd Problem
N = int(input())
a = [int(i) for i in input().split()]

num_odd = 0

for idx in range(1, N + 1, 2):
    if a[idx -1] % 2 == 1:
        num_odd += 1

print(num_odd)

Measured memory_bytes: 8888
#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
using namespace std;
#define Ma_PI 3.141592653589793
#define eps 0.00000001
#define LONG_INF 1e9
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define MOD 998244353
#define REP(i,n) for(long long i = 0;i < n;++i)    
#define seg_size 524288
long long gcd(long long a, long long b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}
int imos[1270];
int main() {
	while (true) {
		int n, m;
		cin >> n >> m;
		if (n == 0) return 0;
		int r;
		cin >> r;
		vector<tuple<int, int, int>> gogo;
		REP(i, r) {
			int a, b, c, d;
			cin >> a >> b >> c >> d;
			c--;
			if (d == 1) {
				gogo.push_back(make_tuple(1, c, a));
			}
			else {
				gogo.push_back(make_tuple(-1, c, a));
			}
		}
		int query;
		cin >> query;
		REP(i, query) {
			int a, b, c;
			cin >> a >> b >> c;
			c--;
			REP(q, 1270) {
				imos[q] = 0;
			}
			REP(q, gogo.size()) {
				if (get<1>(gogo[q]) == c) {
					imos[get<2>(gogo[q])] += get<0>(gogo[q]);
				}
			}
			for (int q = 1; q < 1270; ++q) {
				imos[q] += imos[q - 1];
			}
			int ans = 0;
			for (int q = a; q < b; ++q) {
				if (imos[q] > 0) {
					ans++;
				}
			}
			cout << ans << endl;
		}
	}
}


Measured memory_bytes: 3028
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<math.h>
#include<queue>
#include<deque>
#include<stack>
#include<cstdio>
#include<utility>
#include<set>
#include<list>
#include<cmath>
#include<stdio.h>
#include<string.h>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
#include<cstring>
using namespace std;
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define REP(i, n) FOR(i, 0, n - 1)
#define NREP(i, n) FOR(i, 1, n)
using ll = long long;
using pii = pair<int, int>;
using piii = pair<pii, pii>;
const ll dx[4] = { -1, 0, 0, 1 };
const ll dy[4] = { 0, -1, 1, 0 };
const ll INF = 1e9 + 7;
const ll inf = 1LL << 50;
int gcd(int x, int y) {
	if (x < y)swap(x, y);
	if (y == 0)return x;
	return gcd(y, x%y);
}
void mul(ll a, ll b) {
	a = a * b % INF;
}
struct Accelerate_Cin {
	Accelerate_Cin() {
		cin.tie(0);
		ios::sync_with_stdio(0);
		cout << fixed << setprecision(20);
	};
};
///////////////////////////////////////

//解法１
//操作を逆にして更新していく
//最小をL、最大をRとして更新していく
//最初は二人だけ残るのでL＝R＝２
//後ろからA[i]をつかつて更新していく
//更新はx'=floor(x/A[i])*A[i]として更新する
//そのためL'=ceil(L/A[i])*A[i]として更新する
int main() {
	int K;
	cin >> K;
	int A[100100];
	REP(i, K)cin >> A[i];
	ll L = 2, R = 2;
	for (int i = K - 1; i >= 0; --i) {
		L = (L + A[i] - 1) / A[i] * A[i];
		if (R < L) {
			cout << -1 << endl;
			return 0;
		}
		R = (R / A[i] + 1)*A[i] - 1;
	}
	cout << L << " " << R << endl;
	return 0;
}


Measured memory_bytes: 640
# -*- coding: utf-8 -*-
import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll

def solve(k, cnt):
    if cnt == N: return 1
    used[k] = True
    res = 0
    for i in xrange(N):
        if used[i]: continue
        if G[k][i] == 0: continue
        res += solve(i, cnt + 1)
    used[k] = False
    return res

N, M = map(int, raw_input().split())
used = [False]*N
G = [[0]*N for i in xrange(N)]
for i in xrange(M):
    a, b = map(int, raw_input().split())
    a -= 1; b -= 1;
    G[a][b] = G[b][a] = 1

print solve(0, 1)



Measured memory_bytes: 4392
n = int(input())
ac = 0
tle = 0
wa = 0
re = 0
for i in range(n):
    s = input()
    if s == 'WA':
        wa += 1
    elif s == 'RE':
        re += 1
    elif s == "TLE":
        tle += 1
    else:
        ac += 1
print("AC x {}".format(ac))
print("WA x {}".format(wa))
print("TLE x {}".format(tle))
print("RE x {}".format(re))

Measured memory_bytes: 69828
open Printf
open Scanf

let id x = x
             
let () =
  let h = scanf "%d\n" id in
  let hp = Array.init (h+1) (fun i -> if i = 0 then 0
                                      else if i = h then let v = scanf "%d\n" id in v
                                      else let v = scanf "%d " id in v) in
  Array.iteri (fun i v -> if i > 0 then
                            begin
                              printf "node %d: " i;
                              printf "key = %d, " v;
                              (let p = i / 2 in if p <> 0 then printf "parent key = %d, " hp.(p));
                              (let l = 2 * i in if l <= h then printf "left key = %d, " hp.(l));
                              (let r = 2 * i + 1 in if r <= h then printf "right key = %d, " hp.(r));
                              printf "\n"
                            end
              ) hp

Measured memory_bytes: 2652
from heapq import  heapify,heappop,heappush

n,m = map(int,input().split())
A = list(map(int,input().split()))
A = [a*-1 for a in A]

heapify(A)
for i in range(m):
    a = heappop(A)
    if a % 2 == 0:
        a //= 2
    else:
        a = a // 2 +1
    heappush(A,a)

print(sum(A)*-1)

Measured memory_bytes: 14180
#include <bits/stdc++.h>
#define DAU  ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define PLEC return 0;
using namespace std;
int n, s;
int main() {
    DAU
    cin >> n;
    for (int i = 1; i <= n; ++i)
        for (int j = 1; j <= n; ++j)
            for (int k = 1; k <= n; ++k)
                s += __gcd(i, __gcd(j, k));
    cout << s;
    PLEC
}


Measured memory_bytes: 3660
#include <bits/stdc++.h>
using namespace std;
int n,i;
char s[22];
int main() {
  scanf("%s",s);
  n=strlen(s);
  if (n&1) { puts("No"); return 0; }
  for (i=0; i<n; i+=2) if (s[i]!='h') { puts("No"); return 0; }
  for (i=1; i<n; i+=2) if (s[i]!='i') { puts("No"); return 0; }
  puts("Yes");
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
	const int N = 100;
	char a[N][N];

	int n,d,caseCount=0,i,j,x,y,dd[]={-1,0,1,0},angle,c;
	scanf("%d",&d);
	while(d--)
	{
		scanf("%d",&n);
		for(i=0;i<n;++i)for(j=0;j<n;++j)a[i][j]=' ';

		x=0;y=n-1;
		angle=0;
		for(c=0;c<3;++c)
		{
			for(;x>=0&&y>=0&&x<n&&y<n; x+=dd[(angle+1)%4],y+=dd[angle])
			{
				a[y][x]='#';
			}
			x-=dd[(angle+1)%4];
			y-=dd[angle];
			angle=(angle+1)%4;;
		}
		if(n>2)
		{
			for(;n;)
			{
				c=0;
				for(; a[y+2*dd[angle]][x+2*dd[(angle+1)%4]]!='#'; x+=dd[(angle+1)%4],y+=dd[angle])
					a[y][x]='#',c++;
				if(c<2) break;
				angle=(angle+1)%4;;
			}
			a[y][x]='#';
		}
		else if(n==2)
			a[n-1][n-1]=' ';

		printf("%s",(caseCount++?"\n":""));
		for(i=0;i<n;++i)
		{
			for(j=0;j<n;++j)
				putchar(a[i][j]);
			putchar('\n');
		}
	}
	return 0;
}

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

#define ll long long
#define INF_LL 1LL << 60
#define INF 99999999
#define MOD (ll)1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define REP(i, a, n) for(int i = a; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

void put_double(double obj){printf("%.12f\n",obj);};

template < typename T > std::string to_string( const T& n )
{
    std::ostringstream stm ;
    stm << n ;
    return stm.str() ;
}

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }


int main()
{
    int H,W;
    cin >> H >> W;

    vector<string> a(H);
    rep(i,H) cin >> a[i];
    vector<int> erased;

    rep(i,H)
    {
        bool flag = true;
        rep(j,a[i].size())
        {
            if( a[i][j] == '#' )
            {
                flag = false;
                break;
            }
        }
        if(flag)
        {
            erased.push_back(i);
        }
    }
    sort(all(erased),greater<int>());
    
    rep(i,erased.size()) a.erase(a.begin()+erased[i]);

    erased.clear();

    rep(i,W)
    {
        bool flag = true;
        rep(j,a.size())
        {
            if( a[j][i] == '#' )
            {
                flag = false;
                break;
            }
        }
        if(flag)
        {
            erased.push_back(i);
        }
    }
    
    sort(all(erased),greater<int>());

    rep(i,a.size())
    {
        rep(j,erased.size()) a[i].erase(a[i].begin()+erased[j]);
    }

    rep(i,a.size()) cout << a[i] << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define mod 1000000007
#define fs first
#define ss second
const int maxN = 2e5+5;
unordered_map<ll,ll> m;
ll freq[maxN];
int main(){
 
  int n;
  cin >> n;
  int a[n];

  for(int i=0;i<n;i++) scanf("%d",a+i),freq[a[i]]++;
   
  ll ans = 0;

  for(int i =1;i<=n;i++){
      ans += (freq[i]*(freq[i]-1))/2;
  }

  for(int k =0;k<n;k++){
   int cut = freq[a[k]]-1;
   if(cut > 0)  printf("%lld\n",ans -cut);
   else printf("%lld\n",ans);
  }

}

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

bitset<4000050>f;
int n,s,a,i;

int main(){
     scanf("%d",&n);f[0]=1;
     while(n--){
     	scanf("%d",&a);
     	f|=f<<a;
        s+=a;
     }
     for(i=(s+1)/2;!f[i];++i);
     printf("%d\n",i);
}

Measured memory_bytes: 1792
#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 mod 1000000007
typedef long long ll;

int main() {
    ll n, a, b;
    cin >> n >> a >> b;
    ll sum = a + b;
    ll shou = n / sum;
    ll amari = n % sum;
    cout << a * shou + min(amari, a) << endl;
    return 0;
}


Measured memory_bytes: 256