akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <unordered_set>
#include <stdio.h>

using namespace std;

#define scan(x) do{while((x=getchar())<'0'); for(x-='0'; '0'<=(_=getchar()); x=(x<<3)+(x<<1)+_-'0');}while(0)
char _;
#define f first
#define s second
#define ll long long
#define ull unsigned long long
#define endl "\n"
#define PI 3.141592653589793
#define vi vector<int>
#define vll vector<long long>
#define p pair<int,int>
const int MOD = 1000000007;
inline double degcos(double ang) {return cos(ang*PI/180);}
inline double degsin(double ang) {return sin(ang*PI/180);}
#define rep(i,j,k,in) for (int i = j; i < k; i += in)


/*---END OF TEMPLATE---*/



int main() {
    cin.sync_with_stdio(0);
    cin.tie(0);
    //ifstream fin("data.in");
    //ofstream fout("data.out");
    int N;
    ll W;
    cin >> N >> W;
    ll dp[100001];
    dp[0] = 0;
    for (int i = 1; i < 100001; i++) {
        dp[i] = -1;
    }
    for (int i = 0; i < N; i++) {
        ll w;
        int v;
        cin >> w >> v;
        for (int j = 100000 - v; j >= 0; j--) {
            if (dp[j] != -1 && dp[j]+w <= W) {
                if (dp[j+v] == -1 || dp[j+v] > dp[j]+w) {
                    dp[j+v] = dp[j]+w;
                }
            }
        }
    }
    int mx = 0;
    for (int i = 100000; i >= 0; i--) {
        if (dp[i] != -1) {
            mx = i;
            break;
        }
    }
    cout << mx << endl;
    



}

Measured memory_bytes: 4408
#include<bits/stdc++.h>
using namespace std;
 
#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)

int main(){
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	if(a*b == c*d) cout << a*b << endl;
	else cout << max(a*b, c*d) << endl;
}

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

const int N = 100;

int main()
{
    int M[N][N];
    int n,u,k,v;

    cin >> n;

    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            M[i][j] = 0;
        }
    }

    for(int i=0;i<n;i++)
    {
        cin >> u >> k;
        u--;
        for(int j=0;j<k;j++)
        {
            cin >> v;
            v--;
            M[u][v] = 1;
        }
    }

    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            if(j) cout << " ";
            cout << M[i][j];
        }
        cout << endl;
    }

    return 0;
}


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

using namespace std;

using ll = long long;
using ull = unsigned long long;

int main(int argc, char const *argv[]) {
	int h,w;
	std::cin >> h >> w;
	std::vector<string> str(h);
	for (size_t i = 0; i < h; i++) {
		std::cin >> str[i];
	}

	std::vector<string> eraseH;
	for (size_t i = 0; i < str.size(); i++) {
		bool flag = false;
		for (size_t j = 0; j < str[i].size(); j++) {
			if (str[i][j] == '#') {
				flag = true;
				break;
			}
		}
		if (flag) {
			eraseH.push_back(str[i]);
		}
	}
	std::vector<bool> use(w,false);
	for (size_t i = 0; i < w; i++) {
		for (size_t j = 0; j < h; j++) {
			if (str[j][i] == '#') {
				use[i] = true;
				break;
			}
		}
	}

	for (size_t i = 0; i < eraseH.size(); i++) {
		for (size_t j = 0; j < use.size(); j++) {
			if (use[j]) {
				std::cout << eraseH[i][j];
			}
		}
		std::cout << '\n';
	}
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
	int N;
	while(cin>>N){
		int *num=new int[N];
		for(int i=0;i<N;i++){
			cin>>num[i];
		}
		int sum=0;//得数
		int f=0;
		int f1=0,f2=0,f3=0,f4=0,f5=0,f6=0,f7=0,f8=0;
		for(int i=0;i<N;i++){
			if(num[i]>=1&&num[i]<=399&&f1==0){
				sum++;
				f1=1;
			}else if(num[i]>=400&&num[i]<=799&&f2==0){
				sum++;
				f2=1;
			}else if(num[i]>=800&&num[i]<=1199&&f3==0){
				sum++;
				f3=1;
			}else if(num[i]>=1200&&num[i]<=1599&&f4==0){
				sum++;
				f4=1;
			}else if(num[i]>=1600&&num[i]<=1999&&f5==0){
				sum++;
				f5=1;
			}else if(num[i]>=2000&&num[i]<=2399&&f6==0){
				sum++;
				f6=1;
			}else if(num[i]>=2400&&num[i]<=2799&&f7==0){
				sum++;
				f7=1;
			}else if(num[i]>=2800&&num[i]<=3199&&f8==0){
				sum++;
				f8=1;
			}else if(num[i]>=3200){
				f++;
			}
		} 
		if(sum==0){
			cout<<"1"<<" "<<f<<endl;
		} else{
			cout<<sum<<" "<<sum+f<<endl;
		}
		
	}
	return 0;
}

Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections.Generic;
using System.IO;


class Program
{
    public static long Read()
    {
        return long.Parse(Console.ReadLine());
    }

    public static long[] Reads()
    {
        return Console.ReadLine().Split().Select(long.Parse).ToArray();
    }


    public static long Gcd(long a, long b)
    {
        if (a < b)
            // 引数を入替えて自分を呼び出す
            return Gcd(b, a);
        while (b != 0)
        {
            var remainder = a % b;
            a = b;
            b = remainder;
        }
        return a;
    }


    public static void Main()
    {
        var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
        Console.SetOut(sw);

        var input0 = Reads();
        long n = input0[0];
        long m = input0[1];
        var a = new long[m];
        var b = new long[m-1];
        var input = Reads();

        for (long i = 0; i < m; i++)
        {
            a[i] =input[i];
        }
        Array.Sort(a);
     
        for (long i = 0; i < m - 1; i++)
        {
            b[i] = a[i + 1] - a[i];
        }
        long answer = 0;
        Array.Sort(b);
        for (long i = 0; i < b.LongLength-n+1; i++)
        {
            answer += b[i];
        }
        Console.WriteLine(answer);


        Console.Out.Flush();
    }
}

Measured memory_bytes: 23264
#include <stdio.h>
#include <math.h>
#define sqr(x) ((x) * (x))

int main() {
	double x1, y1, x2, y2, x3, y3;
	double xp, yp, r;
	int n;
	int i;

	scanf("%d", &n);

	for(i = 0; i < n; i++) {
		scanf("%lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3);

		xp = ((sqr(x1) - sqr(x2) + sqr(y1) - sqr(y2)) * (y2 - y3) - (sqr(x2) - sqr(x3) + sqr(y2) - sqr(y3)) * (y1 - y2))
				/ (2 * ((x1 - x2) * (y2 - y3) - (x2 - x3) * (y1 - y2)));

		yp = ((sqr(x1) - sqr(x2) + sqr(y1) - sqr(y2)) * (x2 - x3) - (sqr(x2) - sqr(x3) + sqr(y2) - sqr(y3)) * (x1 - x2))
				/ (2 * ((y1 - y2) * (x2 - x3) - (y2 - y3) * (x1 - x2)));

		r = sqrt(sqr(x1 - xp) + sqr(y1 - yp));
	
		printf("%.3lf %.3lf %.3lf\n", xp, yp, r);

	}

	return 0;
}

Measured memory_bytes: 1084
#include <algorithm>
#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 ll long long
#define INF 1000000000000000000

class UnionFind {
  public:
    vector<ll> par; // 各元の親を表す配列
    vector<ll> siz; // 素集合のサイズを表す配列(1 で初期化)

    // Constructor
    UnionFind(ll sz_) : par(sz_), siz(sz_, 1) {
        for (ll i = 0; i < sz_; ++i)
            par[i] = i; // 初期では親は自分自身
    }
    void init(ll sz_) {
        par.resize(sz_);
        siz.assign(sz_, 1);
        for (ll i = 0; i < sz_; ++i)
            par[i] = i; // 初期では親は自分自身
    }

    // Member Function
    // Find
    ll root(ll x) { // 根の検索
        while (par[x] != x) {
            x = par[x] = par[par[x]]; // x の親の親を x の親とする
        }
        return x;
    }

    // Union(Unite, Merge)
    bool merge(ll x, ll y) {
        x = root(x);
        y = root(y);
        if (x == y)
            return false;
        // merge technique（データ構造をマージするテク．小を大にくっつける）
        if (siz[x] < siz[y])
            swap(x, y);
        siz[x] += siz[y];
        par[y] = x;
        return true;
    }

    bool issame(ll x, ll y) { // 連結判定
        return root(x) == root(y);
    }

    ll size(ll x) { // 素集合のサイズ
        return siz[root(x)];
    }
};

int main() {
    int N, M;
    cin >> N >> M;
    UnionFind tree(N);

    rep(i, M) {
        int a, b, c;
        cin >> a >> b >> c;
        a--, b--;
        tree.merge(a, b);
    }

    set<int> pars;
    rep(i, N) { pars.insert(tree.root(i)); }

    cout << pars.size() << endl;
}

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

int main(){
  int k;
  int c[100];

  cin >> c[0] >> c[1] >> c[2] >> c[3] >> c[4] >> k;

  if((c[4]-c[0])>k){
    printf(":(\n");
  }else{
  printf("Yay!\n");
  }
}




Measured memory_bytes: 256
N, A, B, C, D = map(lambda v: int(v), input().split())
S = list(input())

def check_movable(s):
    cnt = 0
    for v in s:
        if v == '#':
            cnt += 1
        elif v == '.':
            cnt = 0
        if cnt >= 2:
            return False
    return True
def check_throughable(s):
    cnt = 0
    for v in s:
        if v == '.':
            cnt += 1
        elif v == '#':
            cnt = 0
        if cnt >= 3:
            return True
    return False
if C < B:
    if check_movable(S[B:D]) and check_movable(S[A:C]):
        print('Yes')
    else:
        print('No')
elif C < D:
    if check_movable(S[B:D]) and check_movable(S[A:B]):
        print('Yes')
    else:
        print('No')
else:
    if check_throughable(S[B-2:D+1]) and check_movable(S[A:C]):
        print('Yes')
    else:
        print('No')

Measured memory_bytes: 6268
#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<utility>
#include<numeric>
#include<vector>
#include<map>
#include<unordered_map>
#include<set>
#include<tuple>
#include<stack>
#include<queue>
#include<functional>
#include<iterator>
#include<cmath>
#include<cctype>

using namespace std;

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

const int INF = 1e9;
const ll LINF = 1e18;
const int MOD = INF+7;

struct edge{int to,cost;};
	
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);

	string s;
	cin >> s;

	int len=s.size();
	if(len==1) cout << s << "\n";
	else{
		int ans=0;
		for(int i=len-1;i>=0;i--){
			if(s[i]=='9'){

	//			cout << "9 found\n";

				len--;
				ans+=9;
			}
			else break;
		}
	//	cout << "len:" << len << "\n";

		if(len>=2){
			s[0]--;;
			ans+=9*(len-1);
		}
	//	cout << (int)s[0] << "\n";
		if(len>=1) ans+=s[0]-'0';
		cout << ans << "\n";
	}
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>

using namespace std;

int main(void)
{
        string dividing[4]={"dream","dreamer","erase","eraser"};
        string s;
        cin >> s;

        
        reverse(s.begin(),s.end());
        for(int i=1;i<=4;i++)
                reverse(dividing[i-1].begin(),dividing[i-1].end());

        bool ans = true;

        for(int i=1;i<=s.size();)
        {
                bool can = false;
                for(int j=1;j<=4;j++)
                {
                        if(s.substr(i-1,dividing[j-1].size())==dividing[j-1])
                        {
                                can=true;
                                i+=dividing[j-1].size();
                                break;
                        }
                }
                if(can==false)
                {
                        ans=false;
                        break;
                }
        }
        cout << (ans? "YES" : "NO") << endl;
}

Measured memory_bytes: 512
//---------------------------------------------------------------
#include <bits/stdc++.h>
using namespace std;
#include <iostream>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <math.h>
#include <sstream>
#include <numeric>
#include <cctype>
#include <bitset>
#include <cassert>
#include<algorithm>
//---------------------------------------------------------------
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define SIZE 100005
#define INF 1000000000000000LL
#define all(x) x.begin(),x.end()
using pint = pair<int,int>;
using vec = vector<int>;
using ll=long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
//---------------------------------------------------------------
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; }
//---------------------------------------------------------------

//↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

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

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

    int n;cin>>n;
    vec x(n);
    int p=1;
    rep(i,n){
        cin>>x[i];
        p=max(p,x[i]);
    }

    int ans=10000000;
    rep1(i,p){
        int cnt=0;
        rep(j,n){
            cnt += (x[j] - i)*(x[j] - i);

        }
        
        ans=min(ans,cnt);
 
    }

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

Measured memory_bytes: 3612
#include <bits/stdc++.h>
#include <string>
#include <algorithm>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <float.h>
#include <iomanip>
#include <iostream>
using namespace std;
 
int gcd(int x,int y){
    if(y==0)return x;

    return gcd(y,x%y);
}
int lcm(int x,int y){
    return x*y/gcd(x,y);
}

int main(){

    int A,B,ans;
    cin>>A>>B;
    ans=A+B;
    ans=max(ans,A-B);
    ans=max(ans,A*B);

    cout<<ans<<endl;

    return 0;
}

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

int main () {
  string s;
  cin >> s;
  sort(s.begin(), s.end());
  

  string t;
  cin >>t;
  sort(t.begin(), t.end());
  reverse(t.begin(), t.end());
  
  if (s<t) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

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

bool solve (const string& s, const char ch)
{
	// horizonal
	if (s[0] == ch && s[1] == ch && s[2] == ch)
		return true;
	if (s[3] == ch && s[4] == ch && s[5] == ch)
		return true;
	if (s[6] == ch && s[7] == ch && s[8] == ch)
		return true;

	// vertical
	if (s[0] == ch && s[3] == ch && s[6] == ch)
		return true;
	if (s[1] == ch && s[4] == ch && s[7] == ch)
		return true;
	if (s[2] == ch && s[5] == ch && s[8] == ch)
		return true;

	// diagonal
	if (s[0] == ch && s[4] == ch && s[8] == ch)
		return true;
	if (s[2] == ch && s[4] == ch && s[6] == ch)
		return true;

	return false;
}

int main()
{
	string s;
	while (cin >> s) {
		if (solve(s, 'o'))
			cout << "o" << endl;
		else if (solve(s, 'x'))
			cout << "x" << endl;
		else
			cout << "d" << endl;
	}
	return 0;
}

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

using int64 = long long;

int64 solve(int64 n, int64 s) {
  if (n < s)
    return -1;
  if (n == s)
    return n + 1;
  int64 d = n - s;
  vector<int64> factors;
  for (int64 p = 1; p * p <= d; ++p) {
    if (d % p)
      continue;
    factors.push_back(p);
    if (p * p < d)
      factors.push_back(d / p);
  }

  sort(factors.begin(), factors.end());
  for (int64 p : factors) {
    int64 b = p + 1;
    int64 t = 0;
    for (int64 m = n; m; m /= b) {
      t += m % b;
    }
    if (s == t)
      return b;
  }

  return -1;
}

int main() {
  int64 n, s;
  cin >> n >> s;
  cout << solve(n, s) << "\n";
}


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

#define int long long
#define vvi vector<vector<int>>
#define vec vector
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define uniqueV(x) sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end());
#define rep(i, n) for (int (i) = (0); (i) < (n); ++(i))
#define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))
#define dbg(x) cerr << #x << ": " << x << endl;
#define dbg2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;
#define dbg3(x, y, z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = "<<"("<<x<<", "<<y<<", "<<z<<")"<<endl;
#define dbgB(value, size) cerr<<#value<<": "<<bitset<size>(value) << endl;
#define line() cerr << "---------------" << endl;

const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, -1, 1};
const double PI = 3.14159265358979323846;

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; }

template<typename T>
void printA(vector<T> &printArray, char between = ' ') {
   int paSize = printArray.size();
   for (int i = 0; i < paSize; i++) { cerr << printArray[i] << between;}
   if (between != '\n') {cerr << endl;}
}

// ------------------------------------------------------------------------------------------

int N;
int p[111111];

signed main() {
   cin >> N;
   rep (i, N) {
      cin >> p[i];
   }

   int cnt = 0;
   for (int i = 0; i < N; ) {
      int add = 1;
      if (p[i] == i+1) {
         cnt++;
         add = 2;
      }
      i += add;
   }

   cout << cnt << endl;

   return 0;
}

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

int main(int argc, char const *argv[])
{
    string S;
    int N;
    cin >> S;
    cin >> N;
    int Q, F;
    char C;
    bool rev = false;
    bool t;
    for (int i = 0; i < N; i++)
    {
        cin >> Q;
        // scanf("%d", &Q);
        if (Q == 2)
        {
            cin >> F >> C;
            // scanf("%d %c", &F, C);
            t = (F == 1) && rev || !(F == 1) && !rev;
            if (t)
            {
                S.push_back(C);
            }
            else
            {
                S.insert(S.begin(), C);
            }
        }
        else
        {
            rev = !rev;
        }
    }
    if (rev)
    {
        reverse(S.begin(), S.end());
    }
    cout << S << endl;
    return 0;
}


Measured memory_bytes: 900
#include<stdio.h>
int main()
{
    int n,h,w,i,j;
 
  while(1)
  {
      scanf("%d %d",&h,&w);
      if(h==0 && w==0 )
     {
         break;
     }
     for(i=0;i<h;i++)
     {
         for(j=0;j<w;j++)
         {
             printf("#");
         }
         printf("\n");
     }
      printf("\n");
 
  }
return 0;
 
}


Measured memory_bytes: 2056
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
int a[100000];
bool vis[100000];
int main() {
	int N;
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> a[i];
		a[i]--;
	}
	int ans = 0;
	int i = 0;
	vis[0] = 1;
	while (i != 1) {
		i = a[i];
		if (vis[i]) {
			cout << -1 << endl;
			return 0;
		}
		vis[i] = 1;
		ans++;
	}
	cout << ans << endl;
}

Measured memory_bytes: 768
from sys import stdin
import math
import fractions
from collections import deque
from collections import Counter
import itertools

INF = 10 ** 10

# N = 2 * 10^5
N = int(stdin.readline().rstrip())
AB = [list(map(int, stdin.readline().rstrip().split())) for _ in range(N)]

AB.sort(key=lambda x: (x[1], x[0]))

sum_time = 0

for A, B in AB:
    sum_time += A

    if sum_time > B:
        print("No")
        exit()

print("Yes")

Measured memory_bytes: 110808
package main

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

var sc = bufio.NewScanner(os.Stdin)

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

func main() {
	sc.Split(bufio.ScanWords)

	N := scanInt()
	d := make([]int, N)
	for i := 0; i < N; i++ {
		d[i] = scanInt()
	}
	sort.Ints(d)

	fmt.Println(d[N/2] - d[N/2-1])
}


Measured memory_bytes: 2048
#include <iostream>
#include <string>

using namespace std;

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

  int a = 0;
  int b = 0;
  for (int i = 0; i <= static_cast<int>(s.size()); ++i) {
    a += (i % 2 == 0 && s[i] == '0') || (i % 2 == 1 && s[i] == '1');
    b += (i % 2 == 0 && s[i] == '1') || (i % 2 == 1 && s[i] == '0');
  }
  cout << min(a, b) << endl;
}

Measured memory_bytes: 3772
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>

#define GYOU_MAX 256
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define s_pri(str) printf("%s\n",str);
#define PRINT(str) printf(#str "\n")
#define v_pri(val) printf("%d\n",val);
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define pi acos(-1.0)
#define sca(x) scanf("%d",&x);

typedef long long int ll;

/*
puts("aa");
//*/


int main(void) {
	
	int N;
	sca(N);
	int P[200000];
	rep(i, N) {
		sca(P[i]);
	}
	int count = 0;
	int min = 200000;
	rep(i, N) {
		if (P[i] < min) {
			min = P[i];
		}
		if (P[i] <= min) {
			count++;
		}

	}
	v_pri(count);


	return 0;
}

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

int main(int argc, const char * argv[]) {
    double a=0.0, b=0.0,c=0.0;
    double x=0.0,s=0.0,l=0.0,h=0.0;
    scanf("%lf %lf %lf",&a,&b,&c);
    x = c * M_PI/180;
    s = a*b*sin(x)/2.0;
    l = a+b+(sqrt(a*a+b*b-(2*a*b*cos(x))));
    h = b*sin(x);
    
    printf("%.8lf\n%.8lf\n%.8lf\n",s,l,h);
    return 0;
}

Measured memory_bytes: 652
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cstdlib>
#include <map>
using namespace std;
typedef long long ll;
#define GG puts("FUCK")
#define N 300050
char str[N];
int n,sum;
int main() {
	scanf("%d%s",&n,str+1);
	int i;
	for(i=1;i<=n;i++) {
		if(str[i]=='E') sum++;
	}
	int now=0,ans=1<<30;
	for(i=1;i<=n;i++) {
		if(str[i]=='E') sum--;
		ans=min(ans,now+sum);
		if(str[i]=='W') now++;
	}
	printf("%d\n",ans);
}

Measured memory_bytes: 512
#include<stdio.h>

void sorting(int a[]);
#define N 3
int main() {
	int sort[N];
	int i, d;
	for (i = 0;i < N;i++) {
		scanf("%d", &sort[i]);
	}
	sorting(sort);
	for (i = 0;i < N;i++) {
		printf("%d", sort[i]);
		if (i < N - 1) {
			printf(" ");
		}
	}
	printf("\n");
	return 0;
}

void sorting(int a[]) {
	int i, d;
	for (i = 0;i < N-1;i++) {
		if (a[0] >a[i + 1]) {
			d = a[0];
			a[0] = a[i + 1];
			a[i + 1] = d;
		}
	}
	for (i = 1;i < N-1;i++) {
		if (a[1] > a[i + 1]) {
			d = a[1];
			a[1] = a[i + 1];
			a[i + 1] = d;
		}
	}
}

Measured memory_bytes: 2732
#include <iostream>
#include <cstdio>
using namespace std;

int main() {

  int n , x , C , count;

  count = 0;

  while(1) {

    cin >> n >> x;

    if(n == 0 && x == 0) break;

    for(int i = n; i > 0; i--) {

      for(int j = n; j > 0; j--) {

	for(int k = n; k > 0; k--) {

	  C = i + j + k;

	  if(C == x && i > j && j > k) {

	    count++;

	  }

	}

      }
    
    }

    cout << count << "\n";

    count = 0;

  }

  return 0;

}

Measured memory_bytes: 1160
s = input()

if s=="SUN":
    print(7)
elif s=="MON":
    print(6)
elif s=="TUE":
    print(5)
elif s=="WED":
    print(4)
elif s=="THU":
    print(3)
elif s=="FRI":
    print(2)
elif s=="SAT":
    print(1)
else:
    pass

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

using i64 = int64_t;

#define rep(i, x, y) for (i64 i = i64(x), i##_max_for_repmacro = i64(y); i < i##_max_for_repmacro; ++i)
#define debug(x) #x << "=" << (x)

#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define print(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define print(x)
#endif

const int inf = 1.01e9;
const i64 inf64 = 4.01e18;
const double eps = 1e-9;

template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
    os << "(" << p.first << ", " << p.second << ")";
    return os;
}

template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
    os << "[";
    for (const auto &v : vec) {
        os << v << ",";
    }
    os << "]";
    return os;
}

template <typename T>
bool chmin(T &a, const T &b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

template <typename T>
bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

template<typename T, size_t size> void fill(T (&ary)[size], const T& val){
    fill_n((T*)ary, size, val);
}

void solve() {
    //const i64 mod = 1'000'000'007;

    i64 H,W;
    cin >> H >> W;
    vector<string> S(H);
    rep(i,0,H){
        cin >> S[i];
    }

    vector<vector<i64>> a(H,vector<i64>(W));
    vector<vector<i64>> b(H,vector<i64>(W));
    vector<vector<i64>> c(H,vector<i64>(W));
    vector<vector<i64>> d(H,vector<i64>(W));
    rep(i,0,H){
        rep(j,0,W){
            if(S[i][j]=='#') continue;
            if(i==0){
                a[i][j]=1;
            }else{
                a[i][j]+=a[i-1][j]+1;
            }
        }
    }
    rep(i,0,H){
        rep(j,0,W){
            if(S[i][j]=='#') continue;
            if(j==0){
                b[i][j]=1;
            }else{
                b[i][j]+=b[i][j-1]+1;
            }
        }
    }
    for(i64 i=H-1; i>=0; --i){
        rep(j,0,W){
            if(S[i][j]=='#') continue;
            if(i==H-1){
                c[i][j]=1;
            }else{
                c[i][j]+=c[i+1][j]+1;
            }
        }
    }
    rep(i,0,H){
        for(i64 j=W-1; j>=0; --j){
            if(S[i][j]=='#') continue;
            if(j==W-1){
                d[i][j]=1;
            }else{
                d[i][j]+=d[i][j+1]+1;
            }
        }
    }

    i64 ans=0;
    rep(i,0,H){
        rep(j,0,W){
            chmax(ans,a[i][j]+b[i][j]+c[i][j]+d[i][j]-3);
        }
    }

    cout << ans << endl;
}

int main() {
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(16);
    solve();
    return 0;
}


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

using namespace std;

int main(){
    int N;
    vector<long long> L(87);
    cin >> N;
    L.at(0) = 2;
    L.at(1) = 1;
    for(int i = 2; i <= N; i++){
        L.at(i) = L.at(i - 1) + L.at(i - 2);
    }
    cout << L.at(N) << endl;
}

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

using namespace std;

typedef long long ll;

const int N = 1e6 + 5;
const int INF = 1e9 + 7;

ll n;

int main(){
    ios_base :: sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    cin >> n;
    ll w = 1000;
    if(n % 1000 == 0)w = 0;
    cout << w - (n % 1000);
    return 0;
}


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

int main(void)
{
	int n;
	cin >> n;
	long long ans = 0;
	for (int i = 1; i <= n; i++)
	{
		ans += i * (long long)(n / i + 1) * (n / i) / 2;
	}
	cout << ans << endl;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e5 + 7;

#include <math.h>
#define PI 3.14159265358979323846264338327950L


int main() {
    
    long long x;
    cin >> x;

    for (int i = 0; i < 1000; i++) {
        for (int j = -1000; j < 1000; j++) {
            if (pow(i, 5) - pow(j, 5) == x) {
                cout << i << " " << j;
                return 0;
            }
        }
    }
   

    return 0;
}

Measured memory_bytes: 4020
from math import gcd

t = int(input())
for _ in range(t):
    a, b, c, d = map(int, input().split())
    if b > d or b > a:
        print("No")
    else:
        tmp = gcd(b, d)
        rem = a % tmp
        min_c = (c - rem) // tmp
        if min_c + 1 >= b // tmp:
            print("Yes")
        else:
            print("No")

Measured memory_bytes: 8984
# -*- coding: utf-8 -*-

import sys
import os

N = int(input())
for _ in range(N):
    balls = list(map(int, input().split()))
    left = right = 0
    impossible = False

    for ball in balls:
        if ball > left and ball > right:
            # ?????£????????\?????????
            if left < right:
                right = ball
            else:
                left = ball
        elif ball > left:
            left = ball
        elif ball > right:
            right = ball
        else:
            impossible = True
            break

    if impossible:
        print('NO')
    else:
        print('YES')

Measured memory_bytes: 7592
#include <iostream>
using namespace std;
int main(){
  int N;
  cin >> N;
  int dp[50] = {1,1};
  for(int i = 2; i <= N; i++ ){
    dp[i] = dp[i-1] + dp[i-2];
  }
  cout << dp[N] << endl;
  return 0;
}


Measured memory_bytes: 3120
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class MainClass
{
	public const long Giri = 1000000007;
	public const long DpInf = 99999999999999;
	
	public static void Main(string[] args)
	{
		var s = Console.ReadLine();
		for(int i = 0; i < s.Length; i++)
		{
			if(i % 2 == 0)
			Console.Write(s[i]);
		}
		Console.WriteLine();
		
	}

	
	static long GCD(long a, long b)
	{
		var v = new[] { a, b };
		while (v[1] != 0) { v = new[] { v[1], v[0] % v[1] }; }
		return v[0];
	}
	public static string[] Input() { return Console.ReadLine().Split(); }
}

public static class Smarter
{
	public static int ToInt(this string str) { return int.Parse(str); }
	public static long ToLong(this string str) { return long.Parse(str); }
	public static int[] ToInt(this string[] str, int offset = 0)
	{
		var r = new int[str.Length];
		for(int i = 0; i < str.Length; i++) r[i] = str[i].ToInt() + offset;
		return r;
	}
}

Measured memory_bytes: 25916
#include <iostream>
#include<string>
#include<cmath>
#include<ciso646>
#include<cstring>
#include<iomanip>
#include<vector>
#include<algorithm>
#include<utility>
#include<map>
#include<math.h>

using ll = long long;
int M = 100100100;
using namespace std;
int main()
{
	
	string s;
	cin >> s;
	if (s >= "a" and s <= "z")
		cout << "a";
	else
		cout << "A";
	
	
}


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

using namespace std;

int main() {
	int n, m;
    cin >> n >> m;
    vector<int> food(m + 1, 0);
    int k;
    for (int i = 0; i < n; ++i) {
        cin >> k;
        for (int j = 0; j < k; ++j) {
            int a;
            cin >> a;
            ++food[a];
        }
    }
    int ans = 0;
    for (int i = 1; i <= m; ++i) {
        if (food[i] == n)
            ++ans;
    }
    cout << ans;
}

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

using namespace std;

void func_A() {

    int k, a, b;
    cin >> k >> a >> b;

    int temp = (a > b) ? a - b + 1 : b - a + 1;
    if (temp >= k) cout << "OK";
    else cout << "NG";
}

void func_B() {

    unsigned long long x;
    cin >> x;
    unsigned long long okane = 100;
    for (int i = 1; ; ++i) {
         okane *= 1.01;
         if (okane >= x) {
             cout << i;
             return;
        }
    }

}

void func_C() {


}

int main() {

    //func_A();
    func_B();
    //func_C();

    return 0;

}

Measured memory_bytes: 3632
#!/usr/bin/env python3
import sys
from functools import reduce
import numpy as np
sys.setrecursionlimit(10000000)
INF = 1<<32


def solve(N: int, M: int, a: "List[int]"):

    def gcd_base(a: int, b: int):
        while b:
            a, b = b, a%b
        return a

    def gcd(*numbers):
        return reduce(gcd_base, numbers)
    
    def lcm_base(a: int, b:int):
        return a*b // gcd_base(a,b)

    def lcm(*numbers):
        return reduce(lcm_base, numbers, 1)

    def num_of_2(x):
        c = 0
        while x%2 == 0:
            c += 1
            x//=2
        return c
    
    a0 = num_of_2(a[0])
    if any([num_of_2(i) != a0 for i in a]):
        print(0)
        exit()


    x = lcm(*a)
    t = x // 2

    # def div_of_2(x: int):
    #     c = 0
    #     while x%2 == 0:
    #         c += 1
    #     return c
    
    # y = div_of_2(t)

    # if t > M or any([y != div_of_2(i) for i in a]):
    if t > M:
        print(0)
        exit()

    ans = 1
    ans += (M-t)//x
    
    print(ans)

    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    a = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, M, a)

if __name__ == '__main__':
    main()


Measured memory_bytes: 26532
#include<stdio.h>
int main(){

  int i,a,b;

  for ( i = 0;; i++ ){
    
    scanf("%d %d", &a, &b);
    if ( a == 0 && b == 0 ) break;

    if ( a < b ){
      printf("%d %d\n", a, b);
    } else {
      printf("%d %d\n", b, a);
    }

  }

  return 0;
  
}

Measured memory_bytes: 596
import java.util.*;
import java.io.*;
import java.awt.geom.*;
import java.math.*;

public class Main {

	static final Scanner in = new Scanner(System.in);
	static final PrintWriter out = new PrintWriter(System.out,false);

	static boolean solve() {
		int n = in.nextInt();
		int m = in.nextInt();
		double p = in.nextInt();
		if (n + m + p == 0) return false;

		int[] x = new int[n];
		int cnt = 0;
		double sum = 0;
		for (int i=0; i<n; i++) {
			x[i] = in.nextInt();
			cnt += x[i];
			sum += x[i]*100;
		}

		sum -= sum*(p/100);
		out.println(x[m-1] == 0 ? 0 : (int)(sum/x[m-1]));

		return true;
	}

	public static void main(String[] args) {
		long start = System.currentTimeMillis();

		while(solve());
		out.flush();

		long end = System.currentTimeMillis();
		//trace(end-start + "ms");
		in.close();
		out.close();
	}

	static void trace(Object... o) { System.out.println(Arrays.deepToString(o));}
}

Measured memory_bytes: 36564
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from math import ceil, floor, sqrt, gcd
from copy import deepcopy

def main():
    a,b = map(int, input().split())
    print(a*b)
if __name__ == "__main__":
    main()

Measured memory_bytes: 9620
#include<iostream>
#include<algorithm>
#include<cmath>
#include<map>
#include<stdio.h>
#include<vector>
using namespace std;
#define int long long
#define rep(s,i,n) for(int i=s;i<n;i++)
#define c(n) cout<<n<<endl;
#define ic(n) int n;cin>>n;
#define sc(s) string s;cin>>s;
#define mod 1000000007
#define inf 1000000000000000007
#define f first
#define s second
#define mini(c,a,b) *min_element(c+a,c+b)
#define maxi(c,a,b) *max_element(c+a,c+b)
#define P pair<int,int>
//printf("%.12Lf\n",);
int keta(int x){
	rep(0,i,30){
		if(x<10){
			return i+1;
		}
		x=x/10;
	}
}
int gcd(int x,int y){
	int aa=x,bb=y;
	rep(0,i,1000){
		aa=aa%bb;
		if(aa==0){
			return bb;
		}	
		bb=bb%aa;
		if(bb==0){
			return aa;
		}
	}
}	
int lcm(int x,int y){
	int aa=x,bb=y;
	rep(0,i,1000){
		aa=aa%bb;
		if(aa==0){
			return x/bb*y;
		}	
		bb=bb%aa;
		if(bb==0){
			return x/aa*y;
		}
	}
}
bool p(int x){
	if(x==1)return false;
	rep(2,i,sqrt(x)+1){
		if(x%i==0&&x!=i){
			return false;
		}
	}	
	return true;
}
int max(int a,int b){
	if(a>=b)return a;
	else return b;
}
int min(int a,int b){
	if(a>=b)return b;
	else return a;
}	
int n2[41];		
int nis[41]; 
int nia[41];
int mody[41];
int nn;
int com(int n,int y){
	int ni=1;
	for(int i=0;i<41;i++){
		n2[i]=ni;
		ni*=2;
	}
	int bunsi=1,bunbo=1;
	rep(0,i,y)bunsi=(bunsi*(n-i))%mod;
	rep(0,i,y)bunbo=(bunbo*(i+1))%mod;
	mody[0]=bunbo;
	rep(1,i,41){
		bunbo=(bunbo*bunbo)%mod;
		mody[i]=bunbo;
	}
	rep(0,i,41)nis[i]=0;
	nn=mod-2;
	for(int i=40;i>=0;i-=1){
		if(nn>n2[i]){
			nis[i]++;
			nn-=n2[i];
		}
	}
	nis[0]++;
	rep(0,i,41){
		if(nis[i]==1){
			bunsi=(bunsi*mody[i])%mod;
		}
	}
	return bunsi;
}
int yakuwa(int n){
	int sum=0;
	rep(1,i,sqrt(n+1)){
		if(n%i==0)sum+=i+n/i;
		if(i*i==n)sum-=i;
	}
	return sum;
}	
bool hei(int n){
	rep(0,i,100){
		if(i*i==n){
			return true;
		}
	}
	return false;
}
int pow(int b,int a){	
	int aa=1;
	rep(0,i,a)aa*=b;	
	return aa;
}
int sankaku(int a){
	return a*(a+1)/2;
} 
signed main(){
	ic(n)
	c(n/500*1000+(n%500)/5*5)
}		

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

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

    int x;
    cin >> x;
    cout << x * x * x << endl;
}


Measured memory_bytes: 3116
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
a,b,n=mii()

chk=0
if n>=b:
    chk=b-1
else:
    chk=n
print(floor(a*chk/b))



Measured memory_bytes: 77304
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
  string s; cin>>s;
  string a[4]={"dream","dreamer","erase","eraser"};
  reverse(s.begin(),s.end());
  for(int i=0;i<4;i++) reverse(a[i].begin(),a[i].end());
  bool ans=true;
  for(int i=0;i<s.size();){
    bool can2=false;
    for(int j=0;j<4;j++){
      string ss=a[j];
      if(s.substr(i,a[j].size())==ss){
        can2=true;
        i+=a[j].size();
      }
    }
    if(!can2){
      ans=false;
      break;
    }
  }
  if(ans)cout<<"YES"<<endl;
  else cout<<"NO"<<endl;
}

Measured memory_bytes: 512
using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var A = Console.ReadLine().Split().Select(double.Parse).ToArray();

            var height = A[0];
            var ans = 0.0;

            foreach (var i in A)
            {
                ans += Math.Max(height - i, 0);
                height = Math.Max(height, i);
            }

            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 47780
#include <iostream>
using namespace std;

int main() {
	int a[4], b[4], S=0, T=0;
	for(int i=0; i<4; i++){
		cin >> a[i];
		S += a[i];
	}
	for(int j=0; j<4; j++){
		cin >> b[j];
		T += b[j];
	}
	if(S>=T) cout << S << endl;
	else cout << T << endl;
	return 0;
}


Measured memory_bytes: 3092
#include<iostream>

using namespace std;
int main(){
  int d;
  cin >> d;
  if(d==25) cout << "Christmas\n";
  if(d==24) cout << "Christmas Eve\n";
  if(d==23) cout << "Christmas Eve Eve\n";
  if(d==22) cout << "Christmas Eve Eve Eve\n";
  return 0;
}

	 


Measured memory_bytes: 256
# include <iostream>
# include <iomanip>
using namespace std;
int main(){
	int n,temp;
  float res = 0;
  	cin >> n;
  	for (int i = 0; i < n; i++){
    	cin >> temp;
      res += 1.0/temp;    
    }
  cout << setprecision(8) << 1.0/res << '\n';

}

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

using namespace std;

#define int 	long long
#define endl	"\n"
#define mod		1000000007
#define IOS		ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)

int32_t main(){

	IOS;
	
	int k;
	string s;
	cin >> k >> s;

	if(s.size() > k)
		s = s.substr(0 ,k) + "...";

	cout << s << endl;

	return 0;
}

Measured memory_bytes: 3616
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>

using namespace std;
using ll = long long;
ll gcd(ll a, ll b);
int main(){
cin.tie(0);
ll n,x,t;
cin>>n>>x>>t;
if(n%x==0)
cout<<(int(n/x))*t;
else cout<<(int(n/x)+1)*t;

return 0;
}






ll gcd(ll a, ll b){

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

}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
using Int = long long;
Int powmod(Int x, unsigned long long y, Int M)
{
    if (y == 0) return 1;
    if (y % 2 == 0) return powmod(x*x%M, y/2, M);
    return x*powmod(x*x%M, y/2, M)%M;
}
Int f(Int A, Int B, Int R, Int N, Int M)
{
    if (N == 0) return 0;
    if (N % 2 == 0) return f((A*R+A+B)%M, 2*(B+R*B)%M, R*R%M, N/2, M);
    return (f(A, B, R, N-1, M)*R + (N-1)%M*B%M+A)%M;
}
int main()
{
    Int L, A, B, M; cin >> L >> A >> B >> M;
    array<Int, 19> counts = {};
    Int idx = 0;
    for (int i = 1; i < counts.size(); i++) {
        Int k = (Int)pow(10, i) - 1 - A;
        if (k < idx*B) continue;
        k /= B;
        k = min(L-1, k);
        counts[i] = k - idx + 1;
        idx += counts[i];
    }
    Int ans = 0;
    for (int i = 1; i < counts.size(); i++) {
        unsigned long long s = 0, t = 0;
        for (int j = 1; j < i; j++) s += counts[j];
        for (int j = i+1; j < counts.size(); j++) t += j * counts[j];
        ans = (ans + f((A%M+B%M*(s%M))%M, B%M, powmod(10, i, M), counts[i], M) * powmod(10, t, M)) % M;
    }
    cout << ans << '\n';
    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <iterator>
#include <vector>

using namespace std;

const int MAX = 10000;
vector<int> V[MAX];
int NIL = -1;

int color[MAX];
int WHITE = 0;
int GRAY = 1;

vector<int> ans;

void dfs(int u) {

	color[u] = GRAY;
	for (int i = 0; i < (int) V[u].size(); ++i) {
		int next = V[u][i];
		if (color[next] == WHITE)
			dfs(next);
	}
	ans.push_back(u);
}

int main() {

	int v, e;
	scanf("%d %d", &v, &e);

	for (int i = 0; i < v; ++i) {
		color[i] = WHITE;
	}

	for (int i = 0; i < e; ++i) {
		int s, t;
		scanf("%d %d", &s, &t);
		V[s].push_back(t);
	}

	for (int i = 0; i < v; ++i) {
		if (color[i] == WHITE)
			dfs(i);
	}

	for (auto itr = ans.rbegin(); itr != ans.rend(); ++itr) {
		cout << *itr << endl;
	}

	return 0;
}

Measured memory_bytes: 3848
#include <iostream>
using namespace std;
int main(){
  int N; cin >>N;
  int ans = 0;
  for(int i = 0; i < N; i++){
	int a; cin >> a;
    while(a % 2 == 0 and a > 0){
      a /=2;
      ans++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 3632
n = int(input())
a = list(map(int,input().split()))
l = [a[i]-i-1 for i in range(n)] # ai - iのリスト
b = sorted(l)[n//2] # bは中央値になる
ans = 0
for i in range(n):
    ans += abs(l[i]-b)
print(ans)

Measured memory_bytes: 26836
# 2020/04/27
# AtCoder Beginner Contest 109 - B

# Input
n = int(input())
d = dict()

# Check
ans = 'Yes'
wkc = 9
for i in range(n):
    w = input()
    if d.get(w) == None:
        d[w] = 1
    else:
        ans = 'No'
        break

    if i > 0 and wkc != w[0]:
        ans = 'No'
        break
    
    wkc = w[len(w)-1]

# Output
print(ans)


Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define x first
#define y second
using namespace std;
pair<int,int> a[300010],c;
priority_queue<pair<int,int>,vector<pair<int,int> >,greater<pair<int,int> > >q;
int main(){int n,r=0,i;cin>>n;for(i=0;i<n;i++)scanf("%d%d",&a[i].x,&a[i].y);sort(a,a+n);long long s=0;for(i=0;i<n;i++){s+=a[i].x,c.x=a[i].y,c.y=a[i].x;q.push(c);while(!q.empty()){if(s<=q.size()*q.top().x)break;s-=q.top().y,q.pop();}if(r<q.size())r=q.size();}cout<<r<<endl;return 0;}

Measured memory_bytes: 9392
/*     ####   ####  #               ####  #        ##   #    # #    # ###### #####
	  #      #    # #              #      #       #  #  ##  ## ##  ## #      #    #
	   ####  #    # #               ####  #      #    # # ## # # ## # #####  #    #
		   # #  # # #                   # #      ###### #    # #    # #      #####
	  #    # #   #  #              #    # #      #    # #    # #    # #      #   #
	   ####   ### # ###### #######  ####  ###### #    # #    # #    # ###### #    #
*/
 
#include<bits/stdc++.h>
using namespace std;
 
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<string> VS;
typedef vector<pair<LL, LL> > VP;
 
 
#define For(in) for (LL i = 0; i < (n); i++)
#define FOR(in) for(LL i=1; i <= (n); i++)
#define pb push_back
#define srt(v) sort(v.begin(), v.end())
#define rev(v) reverse(v.begin(), v.end())
#define uniq(v) v.erase(unique(v.begin(), v.end()), v.end());
#define exit(); return 0;
#define no "NO"
#define yes "YES"
#define con continue;
 
 
LL concate(LL a, LL b)
{
	ostringstream os;
	os <<a <<b;
	istringstream is(os.str());
	LL c;
	is>> c;
	return c;
}
 
LL binpow(LL a, LL b, LL c)
{
	a %= c;
	LL res = 1 ;
	while(b > 0){
		if(b & 1)
		res = res * a % c ;
		a = a * a % c ;
		b >>= 1;
		//cout<<res<<endl;
	}
	return res;
}
 
LL check(char vowel)
{
	return vowel=='a' || vowel=='e' || vowel=='i' || vowel=='o' || vowel=='u';
}
LL mod = 1e9+7;
 
 
int main()
{
	//LL q,t;
	//cin>>t;
	//while(t--)
	//{
	    LL a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,r=0,u=0,w=0,x=0,y=0,z=0;
		LL aa[1000];
		LL flag=0, flag1=0, co=0, co1=0, co2=0, co3=0, x1=0, x2=0, y1=0, y2=0, z1=0, z2=0;
		LL ma=0, mi=100000000;
		LL mid=0, temp=0, stop=0, start=0;
		double pi= 3.141592653589793;
		double d1=0.0, d2, d3, d4;
		VLL v,v1,v2,v3,v4,v5,v6,v7,v8,v9,v10;
		VS vs, vs1, vs2, vs3, vs4;
		VP vp, vp1,vp2;
		char ch, ch1, ch2[1001];
		string str, str1, str2, str3, str4, str5;
		pair<LL, LL> pa;
		list<LL> li, li1;
		map<LL, LL> mp, mp1;
		set<LL> st;
		map<LL ,LL> :: iterator imll;
		VLL :: iterator ivll;
		set<LL> :: iterator isll;
		VP :: iterator ivp;
 

		cin>>ch>>ch1;
		if(ch<ch1)cout<<"<"<<endl;
		else if(ch==ch1)cout<<"="<<endl;
		else cout<<">"<<endl;
	//}
	exit()
 
 
}


Measured memory_bytes: 3588
k = int(input())

def answer(k):
    if k % 2 == 0 or k % 5 == 0:
        return -1
    d = 1
    r = 7
    while r % k != 0:
        r = 10 * r + 7
        r %= k
        d += 1
    return d

print(answer(k))


Measured memory_bytes: 9196
#include <iostream>
using namespace std;
int main(){
        int a,b;
        cin >> a >> b;
        int array[5];
        int ans=0;
        for (size_t i = a; i <= b; i++) {
                int tmp = i;
                for (size_t j = 0; j < 5; j++) {
                        array[j] = tmp%10;
                        tmp/=10;
                }
                if(array[0]==array[4]&&array[1]==array[3]) ans++;
        }
        cout << ans << endl;

        return 0;
}


Measured memory_bytes: 256
// https://atcoder.jp/contests/arc095/tasks/arc095_b
//
#![allow(unused_imports)]
use std::io::*;
use std::fmt::*;
use std::str::*;
use std::cmp::*;
use std::collections::*;

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

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

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

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

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

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

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

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

#[allow(unused_macros)]
macro_rules! dvec {
    ($t:expr ; $len:expr) => {
        vec![$t; $len]
    };

    ($t:expr ; $len:expr, $($rest:expr),*) => {
        vec![dvec!($t; $($rest),*); $len]
    };
}

#[allow(unused_macros)]
macro_rules! ifv {
    ($t:expr, $a:expr, $b: expr) => {
        if $t { $a } else { $b }
    }
}

#[allow(unused_macros)]
macro_rules! fill {
    ($t:expr, $v:expr) => {
        for i in 0..$t.len() {
            $t[i] = $v;
        }
    };
}

#[allow(unused_macros)]
macro_rules! join {
    ($t:expr, $glue:expr) => {
        $t.into_iter().map(|w| w.to_string()).collect::<Vec<_>>().join($glue)
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

fn main() {
    input! {
        n: usize, a: [i32; n]
    };
    let mut a = a;
    a.sort();

    let mut best = a[0];
    let mut right = a[n-1];
    for i in 1..n-1 {
        let d = (a[i]*2 - a[n-1]).abs();
        if d < (best*2 - a[n-1]).abs() {
            best = a[i];
        }
    }
    println!("{} {}", right, best);
}


Measured memory_bytes: 6396
n, p = map(int, input().split())
a = list(map(int, input().split()))

dp = [[0]*2 for _ in range(n+1)]
dp[0][0] = 1

for k in range(n):
    for i in range(2):
        dp[k+1][i] = dp[k][i] + dp[k][(i+a[k])%2]
print(dp[-1][p])


Measured memory_bytes: 3060