akhauriyash/Code-Regression huggingface dataset:
import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

void main() {
    auto ab = reads!string;
    string a = ab[0], b = ab[1];

    writeln(a == b ? "H" : "D");
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <cstring>
#include <math.h>
#include <bitset>
#include <queue>
#include <set>
#include <iomanip>
#include <math.h>
#include <assert.h>
// #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr long long int INFLL = 1001001001001001LL;
constexpr long long int infll = 1001001001001001LL;
constexpr int INF = 1000000007;
constexpr int inf = 1000000007;
const int mod = 1000000007;

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

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

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

inline double nCr(const int n, int r)
{
    if (n == 0)
    {
        return 0;
    }
    if (r == 0)
    {
        return 1;
    }
    if (r == 1)
    {
        return n;
    }
    if (n == r)
    {
        return 1;
    }

    if (r > n / 2)
    {
        r = n / 2;
    }

    double result = 1;
    for (double i = 1; i <= r; i++)
    {
        result *= (n - i + 1) / i;
    }

    return (result);
}

template <typename T>
T seinomi(T a)
{
    if (a > 0)
    {
        return a;
    }
    else
    {
        return 0;
    }
}

template <typename T>
map<T, T> soinsuubunkai(T n) //連想配列[素因数f.first][個数f.second]
{
    map<T, T> ret;
    for (T i = 2; i * i <= n; i++)
    {
        while (n % i == 0)
        {
            ret[i]++;
            n /= i;
        }
    }
    if (n != 1)
        ret[n] = 1;
    return ret;
}

template <typename T>
T ketasuu(T num)
{
    return std::to_string(num).length();
}

int kaizyou(int k)
{
    int sum = 1;
    for (int i = 1; i <= k; ++i)
    {
        sum *= i;
    }
    return sum;
}

template <class ForwardIt, class T>
void iota(ForwardIt first, ForwardIt last, T value)
{
    while (first != last)
    {
        *first++ = value;
        ++value;
    }
}

//nの階乗を計算
int factorial(int n)
{
    int answer = 1;
    while (n > 1)
    {
        answer *= n;
        n--;
    }
    return answer;
}
int comb(int n, int r)
{
    return factorial(n) / (factorial(r) * factorial(n - r));
}

long long modpow(long long a, long long n, long long mod)
{
    long long res = 1;
    while (n > 0)
    {
        if (n & 1)
            res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}


template <typename T>
T amarinasi(T a,T b){
    if(a%b==0)
{
    return a/b;
}
else if(a%b>0)
{
    return a/b+1;
}
else
{
    return a/b-1;
}
}

//小数点以下10桁テンプレート（main関数内の最初に貼付け）
//std::cout << std::fixed << std::setprecision(10);

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

int main(){
ll n,x;
cin>>n>>x;
ll a[n];
ll sum=0;
for(int i=0;i<n;i++){
    cin>>a[i];
    sum+=a[i];
}
ll nokori=x-sum;
sort(a,a+n);
cout<<n+nokori/a[0]<<endl;
}












Measured memory_bytes: 256
#pragma GCC optimize ("O2")
#pragma GCC target ("avx2")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

const ll mod = 100000000000000003;
int ne[200001], he[1000001];
char C[1200100];

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


	fread(C, 1, 1200100, stdin);
	char* ci = C, c;
	int N = 0;
	while ((c = *ci++) >= '0') N = N * 10 + c - '0';

	char* s[200001];
	rep1(i, N) {
		s[i] = ci;
		while (*ci++ >= '0');
		int n = ci - s[i] - 1;		
		ne[i] = he[n];
		he[n] = i;
	}

	ll kotae = 0;
	unordered_map<ll, int> ha;
	for (int M = 1; M <= 1000001 - N; M++) {
		for (int p = he[M]; p; p = ne[p]) {
			auto S = s[p];
			int k[26] = {};
			ll are = 0;
			for (int i = M - 1; i >= 1; i--) {
				if (ha.find(are) != ha.end()) {
					int tmp = ha[are];
					rep(j, 26) if ((tmp >> j & 1)) {
						k[j]++;
					}
				}
				if (k[S[i] - 'a']) {
					kotae += k[S[i] - 'a'];
					k[S[i] - 'a'] = 0;
				}
				are = (are * 30 + S[i] - 'a' + 1) % mod;
			}

			if (k[S[0] - 'a']) {
				kotae += k[S[0] - 'a'];
				k[S[0] - 'a'] = 0;
			}

			ha[are] |= 1 << (S[0] - 'a');
		}
	}
	co(kotae);


	Would you please return 0;
}

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

class UnionFind {
	vector<int> data, mini;
	int root(int a) {
		return data[a] < 0 ? a : data[a] = root(data[a]);
	}
public:
	UnionFind(const vector<int>& mini_) : data(mini_.size(), -1), mini(mini_) {}
	bool Find(int a, int b) {
		return root(a) == root(b);
	}
	void Union(int a, int b) {
		int ra = root(a), rb = root(b);
		if (ra == rb) return;
		if (data[ra] < data[rb]) {
			data[ra] += data[rb];
			data[rb] = a;
			mini[ra] = min(mini[ra], mini[rb]);
		}
		else {
			data[rb] += data[ra];
			data[ra] = b;
			mini[rb] = min(mini[ra], mini[rb]);
		}
	}
	int Mini(int a) {
		return mini[root(a)];
	}
};

int main()
{
	int N, M, res = 0;
	string s, t;
	cin >> N;
	vector<string> a(N);
	vector<int> x(N);
	for (int i = 0; i < N; i++) {
		cin >> a[i] >> x[i];
	}
	UnionFind uf(x);
	cin >> M;
	for (int i = 0, is, it; i < M; i++) {
		cin >> s >> t;
		for (int j = 0; j < N; j++) {
			if (a[j] == s)
				is = j;
			else if (a[j] == t)
				it = j;
		}
		uf.Union(is, it);
	}
	for (int i = 0; i < N; i++) {
		res += uf.Mini(i);
	}
	cout << res << endl;
	return 0;
}

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

inline long long gcd(long long a, long long b){ //最大公約数
    if(a < b)swap(a, b); if(b == 0)return a;
    for(long long r; r = a % b; a = b, b = r); return b;
}

inline long long lcm(long long a, long long b){ //最小公倍数
    return a / gcd(a,b) * b;
}

int main(){

    ll N;
    cin >> N;

    for(ll i = 1; i <= 3500; i++){
        for(ll j = 1; j <= 3500; j++){
            ll k = 4 * i * j - N * j - N * i;
            if(k == 0)continue;
            if((N * i * j) % k == 0){
                ll h = i, n = j, w = (N * i * j) / k;
                if(h > 0 and n > 0 and w > 0){
                    cout << h << ' ' << n << ' ' << w << endl;
                    return 0;
                }
            }
        }
    }
}

Measured memory_bytes: 384
x = list(str(input()))
i = 0
counter =0
while i<len(x)-1 :
    if(x[i]==x[i+1]):
        if x[i+1]=="0":
            x[i+1]="1"
        else:
            x[i+1]="0"
       # x[i+1]=x[i-1]
        counter+=1
    i+=1
print(counter)

Measured memory_bytes: 3956
#include<stdio.h>
int main(void)
{
	int a, b, k, c[1000], j, l, i=1;
	scanf("%d %d %d", &a, &b, &k);
	for(l=a;l>0;--l){
		if(a%l==0 && b%l==0){
			c[i]=l;
			++i;
		}
	}
			printf("%d", c[k]);
	return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main()
{
    string a;
	cin>>a;
	int flag=false;
	for(int i=0;i<a.size();i++)
	{
		if(a[i]=='C')
		flag=true;
		if(a[i]=='F'&&flag==true)
		{
			cout<<"Yes";
			return 0;
		}
	} 
	cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		int ac = 0, wa = 0, tle = 0, re = 0;
		
		for(int i=0; i<n; i++) {
			String str = br.readLine();
			
			if(str.equals("AC"))
				ac++;
			else if(str.equals("WA"))
				wa++;
			else if(str.equals("TLE"))
				tle++;
			else if(str.equals("RE"))
				re++;
		}
		
		System.out.println("AC x "+ ac);
		System.out.println("WA x "+ wa);
		System.out.println("TLE x "+ tle);
		System.out.println("RE x "+ re);
	}

}

Measured memory_bytes: 43308
#include <algorithm>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;

#define rep(i, n) for(ll i = 0; i < n; i++)
#define REP(i, n) for(ll i = 1; i < n + 1; i++)
#define PI 3.14159265359
#define EPS 0.0000000001
#define MOD 1000000007
//cout << std::fixed << std::setprecision(15) << y << endl;


int main(){
    ll N;
    cin >> N;

    ll maxN = 0;
    ll p;
    ll ans = 0;
    rep(i, N){
        cin >> p;
        ans += p;
        maxN = max(maxN, p);
    }

    cout << ans - maxN / 2 << endl;

    return 0;
}

Measured memory_bytes: 3564
N = int(input()) + 1

ans_list = [[0 for i in range(10)] for j in range(10)]

for i in range(1,N):
    s = str(i)
    ans_list[int(s[0])][int(s[-1])] += 1

ans = 0
for i in range(0,10):
    for j in range(0,10):
        ans += ans_list[i][j]*ans_list[j][i]

print(ans)

Measured memory_bytes: 3064
a = input()
if a[0] == a[-1] and len(a)%2==0:
  print("First")
elif a[0] == a[-1] and len(a)%2==1:
  print("Second")
elif a[0] != a[-1] and len(a)%2==0:
  print("Second")
elif a[0] != a[-1] and len(a)%2==1:
  print("First")

Measured memory_bytes: 3316
#include <bits/stdc++.h>
#define ll long long
using namespace std;
string S;
ll n,k,r,s,p,ans;
int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL),cout.tie(NULL);
	
	cin>>n>>k;
	cin>>r>>s>>p;
	cin>>S;
	
	for (int i=0; i<k; i++) {
		for (int j=i; j<n; j+=k) {
			if (j-k>=0 && S[j]==S[j-k]) {
				S[j]='#';
				continue;
			}
			if (S[j]=='r') ans+=p;
			if (S[j]=='p') ans+=s;
			if (S[j]=='s') ans+=r;
		}
	}
	
	cout<<ans<<endl;
	
	return 0;
}

Measured memory_bytes: 512
/*{{{*/
#include <bits/stdc++.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define FOR(I, A, B) for (int I = (A); I <= (B); ++I)
#define FORS(I, S) for (int I = 0; S[I]; ++I)
#define RS(X) scanf("%s", (X))
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define CASET int ___T; scanf("%d", &___T); for(int cs=1;cs<=___T;cs++)
#define MP make_pair
#define PB emplace_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<PII> VPII;
typedef pair<LL,LL> PLL;
typedef vector<PLL> VPLL;
template<class T> void _R(T &x) { cin >> x; }
void _R(int &x) { scanf("%d", &x); }
void _R(int64_t &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }
template<class T> void _W(const T &x) { cout << x; }
void _W(const int &x) { printf("%d", x); }
void _W(const int64_t &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template<class T,class U> void _W(const pair<T,U> &x) {_W(x.F); putchar(' '); _W(x.S);}
template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
#ifdef HOME
 #define DEBUG(...) {printf("# ");printf(__VA_ARGS__);puts("");}
#else
 #define DEBUG(...)
#endif
int MOD = 1e9+7;
void ADD(LL& x,LL v){x=(x+v)%MOD;if(x<0)x+=MOD;}
/*}}}*/
const int SIZE = 1e6+10;
int main(){
    LL an=0;
    map<int,int>AA;
    int N;
    R(N);
    FOR(i,1,N){
        int x;
        R(x);
        an+=AA[i-x];
        AA[i+x]++;
    }
    W(an);
    return 0;
}


Measured memory_bytes: 20700
/*input
6 15
6 5
5 6
6 4
6 6
3 5
7 2
*/
#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
using namespace std;
#define pb push_back
#define pii pair<int,int>
#define all(v) (v).begin(),(v).end()
#define mpr make_pair
#define MX 1000000007
#define ui unsigned int
#define ll long long
#define ld long double
#define fi first
#define se second
#define testcases int testcases;cin>>testcases;while(testcases--)
#define printvector(v) for(int i=0;i<v.size();i++) cout<<v[i]<<" ";  cout<<endl
#define printarray(v,n)  for(int i=0;i<n;i++) cout<<v[i]<<" ";  cout<<endl
#define inputarray(v,n)  for(int i=0;i<n;i++)cin>>v[i]
#define debug(i) cout<<"debug: "<<i<<endl
#define pr(i) cout<<i<<endl
#define timetaken cerr<<clock()/double(CLOCKS_PER_SEC)<<endl
#define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define toDigit(a) (a-'0')
ll powmod(ll base,ll exp,ll MOD){ll res=1;while(exp>0){if(exp%2==1) res=(res*base)%MOD;base=(base*base)%MOD;exp/=2;}return (res%MOD);}
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }

ll cal(int n, vector<pair<int,ll>>& a, int w){
    vector<vector<ll>>dp(n+1,vector<ll>(w+1,0));
    
    for(int i=1;i<=n;++i){
        for(int j=1;j<=w;++j){

            dp[i][j] = dp[i-1][j];
            
            if(a[i-1].fi <= j){
                dp[i][j] = max(dp[i][j], dp[i-1][j-a[i-1].fi] + a[i-1].se);
            }
        }
    }
    return dp[n][w];
}

int main() {
    fast_io;
    int n,w;
    cin>>n>>w;
    
    vector<pair<int,ll>>a(n);
    
    for(int i=0;i<n;++i){
        cin>>a[i].fi>>a[i].se;
    }
    
    pr(cal(n,a,w));
    return 0;
}

Measured memory_bytes: 80256
using System;

public class Program
{
	public static void Main(string[] args)
	{
		var ss = new StreamScanner();
		//---------------------------------


		for (int i = 0; i < 10000; i++)
		{
			var a = ss.Next<int>();
			var op = ss.Next<string>();
			var b = ss.Next<int>();

			if (op == "?")
			{
				break;
			}
			else if (op == "*")
			{
				Console.WriteLine(a * b);
			}
			else if (op == "/")
			{
				Console.WriteLine(a / b);
			}
			else if (op == "+")
			{
				Console.WriteLine(a + b);
			}
			else if (op == "-")
			{
				Console.WriteLine(a - b);
			}
		}








		/*
		//????????????int, double, string?????????????????£????????????
		int i = ss.Next<int>();
		double d = ss.Next<double>();
		string s = ss.Next<string>();

		//?????°???????????????????????¨?????????????????????????????????????????????????´???????
		int[] array = ss.Next<int>(10);
		*/
		//---------------------------------
	}
}



public class StreamScanner
{
	private readonly char[] _c = { ' ' };
	private int _index = -1;
	private string[] _input = new string[0];
	private readonly System.IO.StreamReader _sr = new System.IO.StreamReader(Console.OpenStandardInput());

	public T Next<T>()
	{
		if (_index == _input.Length - 1)
		{
			_index = -1;
			while (true)
			{
				string rl = _sr.ReadLine();
				if (rl == null)
				{
					if (typeof(T).IsClass) return default(T);
					return (T)typeof(T).GetField("MinValue").GetValue(null);
				}
				if (rl != "")
				{
					_input = rl.Split(_c, StringSplitOptions.RemoveEmptyEntries);
					break;
				}
			}
		}
		return (T)Convert.ChangeType(_input[++_index], typeof(T), System.Globalization.CultureInfo.InvariantCulture);
	}

	public T[] Next<T>(int x)
	{
		var ret = new T[x];
		for (var i = 0; i < x; ++i) ret[i] = Next<T>();
		return ret;
	}

	public T[][] Next<T>(int x, int y)
	{
		var ret = new T[y][];
		for (var i = 0; i < y; ++i) ret[i] = Next<T>(x);
		return ret;
	}
}

Measured memory_bytes: 9908
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
#define show(x) {for(auto i: x){cout << i << " ";} cout << endl;}
using namespace std;
using ll = long long;
using P = pair<int, int>;

ll attack(ll n) {
  if (n == 1) return 1;
  return 1 + 2 * attack(n/2);
}

int main() {
  ll N;
  cin >> N;
  ll ans = attack(N);
  cout << ans << '\n';
  return 0;
}

Measured memory_bytes: 3600
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
int main() {
    int n; cin >> n;
    string s; cin >> s;
    map<int, long long> m;
    for (int i = 0; i < n; i++) {
        m[s[i]]++;
    }
    long long ans = 1;
    for (auto x: m) {
        ans *= x.second + 1;
        ans %= mod;
    }
    cout << (mod + ans - 1) % mod << endl;
    return 0;
}

Measured memory_bytes: 1020
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;

const char nl = '\n';

void solve()
{
    int n; cin >> n;
    ll sum = 0;
    unordered_map<ll, ll> count;
    int a;
    while (n--) {
        cin >> a;
        sum += a;
        ++count[a];
    }
    int q; cin >> q;
    while (q--) {
        int b, c; cin >> b >> c;
        ll valcount = count[b];
        sum -= b * valcount;
        count[b] -= valcount;
        sum += c * valcount;
        count[c] += valcount;
        cout << sum << nl;
    }
}

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

Measured memory_bytes: 6968
#include <bits/stdc++.h>
using namespace std;
int main(){
  string str;
  int sum=0;
  cin >> str;
  for (int i=0;i<4;i++){
  	if (str.at(i)=='+')
      sum++;
    else
      sum--;
  }
  cout << sum << endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MAX 111111
int n,A[MAX+1],L[MAX];
int lis(){
  L[0]=A[0];
  int length=1;
  for(int i=1;i<n;i++){
    if(L[length-1]<A[i]){
      L[length++]=A[i];
    }else{
      *lower_bound(L,L+length,A[i])=A[i];
    }
  }
  return length;
}
int main(){
  cin>>n;
  for(int i=0;i<n;i++) cin>>A[i];
  cout<<lis()<<endl;
  return 0;
}
/*
verified on 2017/04/26
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DPL_1_D&lang=jp
*/

Measured memory_bytes: 3888
#include<iostream>
#include<stack>
#include<string>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<iomanip>
#include<set>
#include<bitset>
#include<cmath>
#include<numeric>
#include<limits>

#define REP(i, m, n) for(int i = (m); i < (n); i++)
#define rep(i,n) REP(i,0,n)
#define NIL -1
using namespace std;
typedef long long ll;
typedef long long int lli;
static const int MOD = 10000007;
static const int MAX = 100005;


int N;
vector<int> S;

int XOR(int a, int b) {
  if ((a == 1 && b == 0) || (a == 0 && b == 1)) {
    return 1;
  } else {
    return 0;
  }
}

void outp(int A[]) {
  REP(i, 1 , N+1) {
    if (A[i] == 1) cout << i << " " ;
  }
  cout << endl;
}

int main(){
  cin >> N;
  int a[N+1];
  REP(i, 1, N+1) {
    cin >> a[i];
  }

  int b[N+1];
  for (int i = N; i >=1; i--) {
    int q = N/i;
    if ( q > 1) {
      int r = 0;
      REP(j, 2, q+1) {
        r += b[j*i];
      }
      b[i] = XOR(a[i], (r%2));
    } else {
      b[i] = a[i];
    }
  }
  int sum = 0;
  REP(i, 1, N+1) {
    if (b[i] == 1) sum++;
    // cout << b[i] << " ";
  }
  // cout << endl;
  cout << sum << endl;
  if (sum != 0) outp(b);
}


Measured memory_bytes: 2432
// Sun Apr 19 04:28:54 IST 2020          
#include <bits/stdc++.h>        
// #include <ext/pb_ds/tree_policy.hpp>
// #include <ext/pb_ds/assoc_container.hpp>
#define forn(i,a,b)        for( i = a ; i < b  ; i++ )
#define debug(x)           cout << #x << " " << x << " -- \n"
#define I__O               ios::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define int64              long long    
#define MOD                998244353
#define pi                 pair<int,int>
#define vi                 vector <int>
#define pb                 push_back
#define vp                 vector <pair<ll,ll>>
#define endl               cout << "\n"  
#define f1                 first 
#define s1                 second    
#define in                 insert
#define all(x)             (x).begin(),(x).end() 
#define precise(x)         cout << fixed << setprecision(12) << x << '\n'; 
using namespace std ;     
// using namespace __gnu_pbds;
// typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set ; 
const int N = 2e5+7;   
int tests(){  
  double r ;
  cin >> r ;
  r *= 44.0 ;
  r /= 7.00 ;
  precise(r);
  return  0; 
}
int32_t main(){
    I__O ;            
    int cases = 1 ; 
    // cin >> cases ;  
    for(int i = 1 ;i  <= cases ; i++ ){   
    // cout << "Case #" << i << ": ";
      tests(); 
    }
    return 0 ; 
}

// -Wall -Weptra -O2
// -pedantic -std=c++11
// -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC

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

int main(){
	long int a,b;
	cin>>a>>b;
	if(a>0) a--;
	long int a1[4]={a,1,a+1,0};
	long int b1[4]={b,1,b+1,0};
	long int ans=a1[a%4]^b1[b%4];
	cout<<ans<<endl;
}


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

int main() {
  int a,th,h,t,o;
  cin >> a;
  
  th = a / 1000;
  h = (a % 1000) / 100;
  t = (a % 100) / 10;
  o = a % 10;
  
  if (((th == h) && (h == t)) || ((h == t) && (t == o))) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 3596
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		//??\????????°?????????
		int intLoop = scan.nextInt();
		//????¨?????´???´????¢????
		ArrayList<int[]> numList = new ArrayList<int[]>();
		ArrayList<String[]> colorList = new ArrayList<String[]>();
		ArrayList<Integer> ansList = new ArrayList<Integer>();
		//??\???
		for(int i = 0; i < intLoop; i++){
			int[] intNum = new int[9];
			String[] strCol = new String[9];
			for(int j = 0; j < 9; j++){
				intNum[j] = scan.nextInt();
			}
			for(int j = 0; j < 9; j++){
				strCol[j] = scan.next();
			}
			numList.add(intNum);
			colorList.add(strCol);
		}
		for(int i = 0; i < intLoop; i++){
			int intCount = 0;

			int[] arrayR = new int[9];
			int[] arrayG = new int[9];
			int[] arrayB = new int[9];
			int[] intNum = numList.get(i);
			String[] strCol = colorList.get(i);
			//RGB???????????\?????????
			for(int j = 0; j < 9; j++){
				String s = strCol[j];
				if("R".equals(s)){
					arrayR[intNum[j] - 1]++;
				}else if("G".equals(s)){
					arrayG[intNum[j] - 1]++;
				}else if("B".equals(s)){
					arrayB[intNum[j] - 1]++;
				}

			}
			/*for(int j = 0; j < 9; j++){
				System.out.println((j + 1) + " = R : " + arrayR[j] + " G : " + arrayG[j] + " B : " + arrayB[j]);
			}*/
			for(int j = 0; j < 7; j++){
				boolean isReplay = false;
				if(arrayR[j] != 0 && arrayR[j+1] != 0 && arrayR[j+2] !=0){
					arrayR[j]--;
					arrayR[j+1]--;
					arrayR[j+2]--;
					intCount++;
					isReplay = true;
				}
				if(arrayG[j] != 0 && arrayG[j+1] != 0 && arrayG[j+2] !=0){
					arrayG[j]--;
					arrayG[j+1]--;
					arrayG[j+2]--;
					intCount++;
					isReplay = true;
				}
				if(arrayB[j] != 0 && arrayB[j+1] != 0 && arrayB[j+2] !=0){
					arrayB[j]--;
					arrayB[j+1]--;
					arrayB[j+2]--;
					intCount++;
					isReplay = true;
				}
				if(isReplay && (arrayR[j] != 0 || arrayG[j] != 0 || arrayB[j] != 0)){
					j--;
				}
				/*for(int p = 0; p < 9; p++){
				System.out.println((p + 1) + " = R : " + arrayR[p] + " G : " + arrayG[p] + " B : " + arrayB[p]);

				}*/
				//System.out.println("count : " + intCount);
			}
			for(int j = 0; j < 9; j++){

				if(arrayR[j] == 3){
					intCount++;
				}
				if(arrayG[j] == 3){
					intCount++;
				}
				if(arrayB[j] == 3){
					intCount++;
				}
			}
			if(intCount == 3){
				ansList.add(1);
			}else{
				ansList.add(0);
			}

		}

		//??????
		for(int i = 0; i < ansList.size(); i++){
			System.out.println(ansList.get(i));
		}
	}
}

Measured memory_bytes: 20800
#include<iostream>
#include<vector>
#include<sstream>
#include<string>
#include<numeric>
#include <algorithm>
#include<math.h>
#include<cstdio>
#include<string.h>
#include<stdio.h>
#include<stdlib.h>



using namespace std;
typedef long long ll;
int gcd( int m, int n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	// ユークリッドの方法
	while( m != n )
	{
		if ( m > n ) m = m - n;
		else         n = n - m;
	}
	return m;
}//gcd
int lcm( int m, int n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	return ((m / gcd(m, n)) * n); // lcm = m * n / gcd(m,n)
}//lcm
int input(){
  int x;
  cin>>x;
  return x;
}
int abs(int x){
  if(x>=0){
    return x;
  }else{
    return -x;
  }
}

int moji(char in)
{
    int ans = (int)in-(int)'a'+1;
    if((in < 1) || (in > 26)){
        ans = 100;
    }
    return ans;
}
const int VV=10;//場合に応じてVVの値のみ変更する必要あり
//dijkstra(s)sがスタート地点でそこからの最短距離を配列dで表す。正の重みのみ使用可能
int cost[VV][VV];
int d[VV];
bool used[VV];
void dijkstra(int s){
  fill(d,d+VV,100000);
  fill(used,used+VV,false);
  d[s]=0;
  while(true){
    int v=-1;
    for(int u=0;u<VV;u++){
      if(!used[u]&&(v==-1||d[u]<d[v]))v=u;
    }
    if(v==-1)break;
    used[v]=true;
    for(int u=0;u<VV;u++){
      d[u]=min(d[u],d[v]+cost[v][u]);
    }
  }

}

int compare_int(const void *a, const void *b)//qsort(quick sort利用時に使用)
{
    return *(int*)a - *(int*)b;
}









int main() {
  int c[3][3];
  for(int i=0;i<3;i++){
    for(int j=0;j<3;j++){
      cin>>c[i][j];
    }
  }
  if((c[0][0]+c[1][1]+c[2][2]==c[1][0]+c[2][1]+c[0][2])&&(c[1][0]+c[2][1]+c[0][2]==c[0][1]+c[1][2]+c[2][0])){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
  


  


  

  


  

    


  

  
  
  
  
}


  
  

  

  



Measured memory_bytes: 256
/**
 * Author : Deep Raval
 * There are no two words in the English language more harmful than "good job".
 * 1729 0_0
**/
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <numeric>
using namespace std;
using ll = long long;
#define endl '\n'
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) 
{
  cerr << " " << to_string(H);
  debug_out(T...);
}
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#define FAST_IO ios::sync_with_stdio(0); std::cin.tie(0); std::cout.tie(0);
#define bp(x) __builtin_popcount(x)
#define zf(x) __builtin_clz(x)
#define zl(x) __builtin_ctz(x)
#define par(x) __bultin_parity(x)
#define all(x) (x).begin(), (x).end()
/* **************************************************************************************** */

void test_case()
{
    ll n;
    cin >> n;
    vector <ll> a(n);
    for(ll &x : a) cin >> x;
    ll ans = 0;

    for(int i = 0; i < n; i ++)
    {
        for(int j = i + 1; j < n; j ++)
        {
            for(int k = j + 1; k < n; k ++ )
            {
                ll p = a[i], q = a[j] , r = a[k];
                if(p + q > r && q + r > p && p + r > q && p != q && q !=r && r != p)  
                    ans ++;
            }
        }
    }


    cout << ans << endl;
	return ;
}
int main()
{
	FAST_IO
    int t = 1;
    //cin >> t;
    while(t--)
        test_case();
	return 0;
}

Measured memory_bytes: 3660
// eddy1021
#include <bits/stdc++.h>
using namespace std;
typedef double D;
typedef long double LD;
typedef long long ll;
typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
typedef pair<LD,LD> Pt;
typedef tuple<int,int,int> tiii;
typedef tuple<LL,LL,LL> tlll;
#define mod9 1000000009ll
#define mod7 1000000007ll
#define INF  1023456789ll
#define INF16 10000000000000000ll
#define FI first
#define SE second
#define X FI
#define Y SE
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define eps 1e-9
#define SZ(x) (int)(x).size()
#define ALL(x) (x).begin(), (x).end()
#ifndef ONLINE_JUDGE
#define debug(...) printf(__VA_ARGS__)
#else 
#define debug(...)
#endif
inline LL getint(){
  LL _x=0,_tmp=1; char _tc=getchar();    
  while( (_tc<'0'||_tc>'9')&&_tc!='-' ) _tc=getchar();
  if( _tc == '-' ) _tc=getchar() , _tmp = -1;
  while(_tc>='0'&&_tc<='9') _x*=10,_x+=(_tc-'0'),_tc=getchar();
  return _x*_tmp;
}
inline LL add( LL _x , LL _y , LL _mod = mod7 ){
  _x += _y;
  return _x >= _mod ? _x - _mod : _x;
}
inline LL sub( LL _x , LL _y , LL _mod = mod7 ){
  _x -= _y;
  return _x < 0 ? _x + _mod : _x;
}
inline LL mul( LL _x , LL _y , LL _mod = mod7 ){
  _x *= _y;
  return _x >= _mod ? _x % _mod : _x;
}
LL mypow( LL _a , LL _x , LL _mod ){
  if( _x == 0 ) return 1LL;
  LL _ret = mypow( mul( _a , _a , _mod ) , _x >> 1 , _mod );
  if( _x & 1 ) _ret = mul( _ret , _a , _mod );
  return _ret;
}
LL mymul( LL _a , LL _x , LL _mod ){
  if( _x == 0 ) return 0LL;
  LL _ret = mymul( add( _a , _a , _mod ) , _x >> 1 , _mod );
  if( _x & 1 ) _ret = add( _ret , _a , _mod );
  return _ret;
}
inline bool equal( D _x ,  D _y ){
  return _x > _y - eps && _x < _y + eps;
}
int __ = 1 , _cs;
/*********default*********/
#define N 101010
void build(){

}
LL n , t[ N ] , a[ N ];
void init(){
  n = getint();
  for( int i = 1 ; i <= n ; i ++ )
    t[ i ] = getint();
  for( int i = 1 ; i <= n ; i ++ )
    a[ i ] = getint();
}
LL bl[ N ] , br[ N ] , al[ N ] , ar[ N ];
void solve(){
  bl[ 1 ] = br[ 1 ] = t[ 1 ];
  for( int i = 2 ; i <= n ; i ++ )
    if( t[ i ] > t[ i - 1 ] )
      bl[ i ] = br[ i ] = t[ i ];
    else{
      bl[ i ] = 1;
      br[ i ] = t[ i ];
    }
  al[ n ] = ar[ n ] = a[ n ];
  for( int i = n - 1 ; i >= 1 ; i -- )
    if( a[ i ] > a[ i + 1 ] )
      al[ i ] = ar[ i ] = a[ i ];
    else{
      al[ i ] = 1;
      ar[ i ] = a[ i ];
    }
  LL ans = 1;
  for( int i = 1 ; i <= n ; i ++ ){
    LL cl = max( al[ i ] , bl[ i ] );
    LL cr = min( ar[ i ] , br[ i ] );
    if( cl > cr ){
      ans = 0; break;
    }
    ans = mul( ans , cr - cl + 1 );
  }
  cout << ans << endl;
}
int main(){
  build();
  //__ = getint();
  while( __ -- ){
    init();
    solve();
  }
}


Measured memory_bytes: 4992
#include <bits/stdc++.h>
using namespace std;
int main (){
    int n;
    cin >> n;
    
    vector<int> b(n),ans(0);
    
    for(int i=0;i<n;i++){
        cin >> b.at(i);
        if(b.at(i) > i+1){
            cout << -1 << endl;
            return 0;
        }
    }//input

    for(int j=n;0<j;j--){//nかいやる
        bool check = false;
        for(int k=j;0<k;k--){
            
            if(b.at(k-1) == k){
                ans.push_back(b.at(k-1));
                b.erase(b.begin()+k-1);
                check = true;
                break;
            }
        }
        
        if(check == false){
            cout << -1 << endl;
            return 0;
        }
    }

    reverse(ans.begin(),ans.end());
    for(int i=0;i<n;i++){
        cout << ans.at(i) << endl;
    }
}

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

using namespace std;

int S[500000];
int L[250001];
int R[250001];
int cnt;

void merge(int *A, int left, int mid, int right) {
	int n1=mid-left;
	int n2=right-mid;
	for(int i=0; i<n1; i++) L[i]=A[left+i];
	for(int i=0; i<n2; i++) R[i]=A[mid+i];
	L[n1]=numeric_limits<int>::max();
	R[n2]=numeric_limits<int>::max();
	int i=0, j=0;
	for(int k=left; k<right; k++) {
		if(L[i]>R[j]) A[k]=R[j++];
		else A[k]=L[i++];
	}
	cnt+=(right-left);
}

void mergeSort(int *A, int left, int right) {
	if(left+1<right) {
		int mid=(left+right)/2;
		mergeSort(A, left, mid);
		mergeSort(A, mid, right);
		merge(A, left, mid, right);
	}
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin>>n;
	for(int i=0; i<n; i++) cin>>S[i];
	mergeSort(S, 0, n);
	if(n>0) cout<<S[0];
	for(int i=1; i<n; i++) cout<<' '<<S[i];
	cout<<'\n'<<cnt<<'\n';
	return 0;
}



Measured memory_bytes: 7028
#include <stdio.h>

int main (){
    int a, b, c, d = 0 ;
    scanf("%d %d %d", &a, &b, &c);
    for (int i = a; i <= b; i++)
    {
        if (c % i == 0){
            d++;
        } 
    }
            printf("%d\n", d);
    return 0;
}


Measured memory_bytes: 2104
n = int(input())
a = [0] * n
xy = [0] * n
for i in range(n):
     a[i] = int(input())
     xy[i] = [list(map(int,input().split())) for _ in range(a[i])]
memo = [0] * (2**n)
for i in range(2**n):
     flag = True
     ch = [0]*n  # あらかじめ ["-", "-", "-"] というリストを作っておく
     for j in range(n):
          if ((i >> j) & 1):
               ch[n - j - 1] = 1
     for k in range(n):
          if ch[k] == 1:
               for l in range(a[k]):
                    if xy[k][l][1] == ch[xy[k][l][0] - 1]:
                         continue
                    else:
                         flag = False

     if flag:
          memo[i] = sum(ch)
print(max(memo))



Measured memory_bytes: 43884
#include<stdio.h>

int main(){
  int x = 0;
  int y = 0;
  int amari = 0;
  int syou = 0;
  int i = 0;

while(1){
scanf("%d%d",&x,&y);
if(1 <= x && y <= 1000000000){
  break;
}
}

if(x < y){
  while(1){
    amari = y % x;
    if(amari == 0){
      syou = x;
      break;
    }
    else{
      y = x;
      x = amari;
    }
  }
}

if(x > y){
  while(1){
    amari = x % y;
    if(amari == 0){
      syou = y;
      break;
    }
    else{
      x = y;
      y = amari;
    }
  }
}

else if(x == y){
  syou = x;
}
printf("%d",syou);
printf("\n");
return 0;

}



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

int main()
{
   int n,k,x,y; cin >> n >> k >> x >> y;
   ll ans = 0;

   rep(i,n){
        if(i>=k) ans += y;
        else ans += x;
   }

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


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

//#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; }

using Weight = int;
using Flow = int;
struct Edge {
	int s, d; Weight w; Flow c;
	Edge() {};
	Edge(int s, int d, Weight w = 1) : s(s), d(d), w(w), c(w) {};
	bool operator<(const Edge &e)const { return w < e.w; }
};
using Edges = vector<Edge>;
using Graph = vector<Edges>;
using Array = vector<Weight>;
using Matrix = vector<Array>;

inline ostream &operator<<(ostream &os, const Edge &e) { return (os << '(' << e.s << ", " << e.d << ", " << e.w << ')'); }

void add_edge(Graph &g, int a, int b, Weight w = 1) {
	g[a].emplace_back(a, b, w);
	g[b].emplace_back(b, a, w);
}
void add_arc(Graph &g, int s, int d, Weight w = 1) { g[s].emplace_back(s, d, w); }


//????´?????????£?????°????????????
Edges bridges(const Graph &g, int root = 0) {
	/*
	e(u, v) ????????§?????? <=> ord[u] >= low[v]
	e(u, v) ?????? <=> ord[u] < low[v]
	*/
	int n = g.size();
	vector<bool> vis(n);
	vector<int> ord(n);
	vector<int> low(n);
	Edges bri;
	int o = 0;
	function<void(int, int)> dfs = [&](int u, int p) {
		if (vis[u])return;
		vis[u] = true;
		ord[u] = o++;
		low[u] = ord[u];
		bool is_art = false;
		for (auto &e : g[u]) {
			if (!vis[e.d]) {
				dfs(e.d, u);
				chmin(low[u], low[e.d]);
				if (ord[u] < low[e.d])bri.emplace_back(u, e.d);
			}
			else if (e.d != p) {
				chmin(low[u], ord[e.d]);
			}
		}
	};
	dfs(root, -1);
	return bri;
}

//s <= d ?????? s1 <= s2 ?????? d1 <= d2 ??????????????????????????????
void sort(Edges &es) {
	for (auto &e : es)
		if (e.s > e.d)
			swap(e.s, e.d);
	sort(es.begin(), es.end(), [](Edge e1, Edge e2) {return e1.s == e2.s ? e1.d < e2.d : e1.s < e2.s; });
}

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N, M; cin >> N >> M;
	Graph g(N);
	rep(i, 0, M) {
		int s, t; cin >> s >> t;
		add_edge(g, s, t);
	}
	Edges bri = bridges(g);
	sort(bri);
	rep(i, 0, bri.size()) {
		cout << bri[i].s << " " << bri[i].d << endl;
	}
	return 0;
}

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

int main(int argc, char *argv[]) {
  int n;
  std::cin >> n;
  std::vector<int> a;
  while (std::cin >> n) {
    a.push_back(n);
  }
  int count = 0;
  while (true) {
    for (int i=0; i<a.size(); i++) {
      if (a.at(i) % 2 != 0) {
        std::cout << count << std::endl;
        return 0;
      }
    }
    count++;
    for (int i=0; i<a.size(); i++) {
      a.at(i) /= 2;
    }
  }
}


Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<vector>
#include<cstdlib>
#include<map>
#include<fstream>
#include<string>
#include<sstream>
#include<iomanip>
#include<numeric>
#include<cctype>
using namespace std;

void sout(string* a, string* b) {
	if (*a > * b) {
		string c = *a;
		*a = *b;
		*b = c;
	}
}
int combination(int n, int k) {
	if (n > k && k > 0) {
		return (combination(n - 1, k) + combination(n - 1, k - 1));
	}
	else
		return 1;
}


int main() {
	int m, d;
	cin >> m >> d;
	int c = 0;
	int d1 = d / 10;
	int d2 = d % 10;
	for (int i = 2; i < d1; i++) {
		for (int j = 2; j < 10; j++) {
			if (i*j <= m)
				c++;
			//cout << 10 * i + j << endl;
		}
	}
	for (int i = 2; i <= d2; i++) {
		if (d1 * i <= m) {
			c++;
		}
	}
	cout << c << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<cstdio>

using namespace std;

int main(){
    double r,S,L;
    scanf("%lf", &r);
    
    S = 3.141592653589 *(double)r*(double)r;
    L = 3.141592653589 *2*(double)r;
    
    printf("%.6lf %.6lf\n", S,L);
    
    return 0;
}



Measured memory_bytes: 3200
#include<bits/stdc++.h>
#define rep(a,b,c) for(int a=b;a<=c;a++)
#define per(a,b,c) for(int a=b;a>=c;a--)
#define ios; ios::sync_with_stdio(false); cin.tie(0);
#define pb push_back
#define mk make_pair
#define fi first
#define se second
#define mem(a,b) memset(a,b,sizeof(a))
#define inf 0x3f3f3f3f
#define ls(x) (x<<1)
#define rs(x) (ls(x)|1)
#define eps 1e-11
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef vector<int> VI;
typedef double db;
mt19937 rnd(random_device{}());
const int mod = 1e9 + 7;
const int N = 2e5 + 5;
const int M = 1e3 + 5;
inline ll gcd(ll a,ll b){ return b?gcd(b,a%b):a; }
inline ll lcm(ll a,ll b){ return a*b/gcd(a,b); }
inline ll ksm(ll x,ll y){ ll res=1; while(y){if(y&1) res=res*x%mod;
x=x*x%mod; y>>=1;} return res; }
ll x,y,a;

int main(){
    db b;
    scanf("%lld%lf",&a,&b);
    x=a*(int)b;
    y=100*(b-(int)b+eps);
    ll ans = x + a*y/100;
    printf("%lld\n", ans);
    return 0;
}
/*
*/
//
//                            _ooOoo_
//                           o8888888o
//                           88" . "88
//                           (| -_- |)
//                           O\  =  /O
//                        ____/`---'\____
//                      .'  \|     |//  `.
//                     /  \|||  :  |||//  \
//                    /  _||||| -:- |||||-  \
//                    |   | \  -  /// |   |
//                    | \_|  ''\---/''  |   |
//                    \  .-\__  `-`  ___/-. /
//                  ___`. .'  /--.--\  `. . __
//               ."" '<  `.___\_<|>_/___.'  >'"".
//              | | :  `- \`.;`\ _ /`;.`/ - ` : | |
//              \  \ `-.   \_ __\ /__ _/   .-` /  /
//         ======`-.____`-.___\_____/___.-`____.-'======
//                            `=---='
//        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//                     佛祖保佑      永无BUG


Measured memory_bytes: 3820
#include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>
using namespace std;

typedef long long LL;
const int INF = 100000000;

using namespace std;
int main()
{
#ifdef LOCAL
    std::ifstream in("input.txt");
    std::cin.rdbuf(in.rdbuf());
#endif
    int N;
    cin >> N;

    vector<int> v;
    for(int i=0;i<N;i++){
        int tempV;
        cin >> tempV;
        v.push_back(tempV);
    }

    std::sort(v.begin(), v.end());

    float currentNum = v[0];
    for(int i=1;i<N;i++){
        currentNum = (float)(v[i]+currentNum)/2;
    }

    cout << currentNum << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <unordered_set>
#include <unordered_map>
#include <random>
using namespace std;
#define ll long long
#define fr first
#define sc second
#define pll pair<ll, ll>
#define all(v) v.begin(), v.end()

int H, W, M;
set<int> row[330000];
set<int> col[330000];
map<int, int> mp;

int main(int argc, char** argv) {
	ios::sync_with_stdio(false);
	cin.tie(0);

	cin >> H >> W >> M;
	for (int i = 0; i < M; i++) {
		int a, b; cin >> a >> b;
		row[a].insert(b);
		col[b].insert(a);
	}
	
	int row_mx = 0, row_mx_cnt = 0, row_mx_idx = 0;
	for (int i = 1; i <= 300000; i++) {
		if (row[i].size() == 0) continue;
		if (row[i].size() == row_mx) {
			row_mx_cnt++;
			row_mx_idx = i;
			for (int j : row[i]) mp[j]++;
		}
		else if (row[i].size() > row_mx) {
			row_mx = row[i].size();
			row_mx_cnt = 1;
			row_mx_idx = i;
			mp.clear();
			for (int j : row[i]) mp[j]++;

		}
	}
	
	int ans = 0;
	for (int i = 1; i <= 300000; i++) {
		if (col[i].size() == 0) continue;
		int col_cnt = col[i].size();
		if (row_mx_cnt == mp[i]) {
			ans = max(ans, row_mx + col_cnt - 1);
		}
		else {
			ans = max(ans, row_mx + col_cnt);
		}
	}
	cout << ans << '\n';
	return 0;
}


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

int main(int argc, char **argv)
{
	int i, tmp;
	std::vector<int> vec;

	std::cin >> i;

	while(i--){
		std::cin >> tmp;
		if(std::find(std::begin(vec), std::end(vec), tmp) == std::end(vec))
			vec.push_back(tmp);
	}

	std::cout << vec.size() << std::endl;

	return 0;
}


Measured memory_bytes: 256
class Dice:
  def __init__(self, top=1, front=2, left=4, right=3, back=5, bottom=6):
    self.d = {"TOP":top, "FRONT":front, "LEFT":left, "RIGHT":right, "BACK":back, "BOTTOM":bottom}

  def roll_x(self):
    self._roll("TOP", "FRONT", "BOTTOM", "BACK")
  
  def roll_y(self):
    self._roll("FRONT", "LEFT", "BACK", "RIGHT")
  
  def roll_z(self):
    self._roll("TOP", "LEFT", "BOTTOM", "RIGHT")
  
  def _roll(self, a, b, c, d):
    self.d[a], self.d[b], self.d[c], self.d[d] = \
    self.d[b], self.d[c], self.d[d], self.d[a]
  
  def all_rolls(self):
    ret = []
    for i in range(6):
      if i%2:
        self.roll_x()
      else:
        self.roll_y()
      for _ in range(4):
        self.roll_z()
        t = self.d.copy()
        ret.append(t)
    return ret

  def equivalent(self, dice):
    for i in range(6):
      if i%2:
        self.roll_x()
      else:
        self.roll_y()
      for _ in range(4):
        self.roll_z()
        t = self.d.copy()
        if t==dice.d:
          return True
    return False

n = int(input())
d = []
flag = False
for i in range(n):
  a = list(map(int, input().split()))
  d.append(Dice(a[0], a[1], a[3], a[2], a[4], a[5]))
for i in range(n):
  for j in range(i+1, n):
    if d[i].equivalent(d[j]):
      flag = True
      break
if flag:
  print("No")
else:
  print("Yes")


Measured memory_bytes: 5604
def main():
    N = int(input())
    ans = 1
    
    for num in range(N, 0, -1):
        int_rt_num = int(num**0.5)
        if(num == int_rt_num**2):
            ans = num
            print(ans)
            break
    
if __name__=="__main__":
    main()

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

using namespace std;
typedef long long int ll;
typedef pair <ll,ll> P;
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define REPR(i, n) for(int i = n-1; i > 0; i--)
#define FOR(i, n, m) for(int i = n; i < (int)(m); i++)
#define PRINT(x) cout << x << endl
#define ALL(v) v.begin(), v.end()
#define INF (ll)1e18
#define PI 3.14159265358979

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

ll MOD = 1000000007;

int main()
{
    ll H, N;
    cin >> H >> N;
    vector<P> v(N);
    ll ma = 0;
    REP(i, N) {
        ll A, B;
        cin >> A >> B;
        v[i] = P(A, B);
        ma = max(ma, A);
    }
    vector<ll> dp(H+ma+1, INF);
    dp[0] = 0;
    REP(i, H+1) {
        REP(j, N) {
            dp[i + v[j].first] = min(dp[i+v[j].first], dp[i] + v[j].second);
        }
    }
    ll mi = INF;
    FOR(i, H, H+ma+1) {
        mi = min(mi, dp[i]);
    }
    PRINT(mi);
    return 0;
}


Measured memory_bytes: 384
-- 1_4_D
main = do n <- getLine
          cs <- getLine
          putStr $ show $ minimum $ map (\x -> read x::Int) $ words cs
          putStr " "
          putStr $ show $ maximum $ map (\x -> read x::Int) $ words cs
          putStr " "
          putStrLn $ show $ sum $ map (\x -> read x::Int) $ words cs

Measured memory_bytes: 12216
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <queue>
using namespace std;

int Q;

bool judge(long long x, long long score) {
    return x * (x + 1) > score;
}

long long bin_search(long long score, long long left, long long right) {
    if (left + 2 > right) {
        return judge(left, score)? left: right;
    }
    
    long long mid = (left + right) / 2;
    if (judge(mid, score)) {
        return bin_search(score, left, mid);
    } else {
        return bin_search(score, mid, right);
    }
}

int main() {
    cin >> Q;
    for (int i = 0; i < Q; i++) {
        int A, B;
        cin >> A >> B;
        long long ans = min(A, B) - 1, score = 1ll * A * B - 1;
        long long x = bin_search(score, min(A, B) + 1, 1e9);
        ans += x - min(A, B) - 1 + score / x;
        cout << ans << endl;
    }
}

Measured memory_bytes: 256
A = int(input())
B = int(input())
C = int(input())
X = int(input())

count = 0
for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            if 500*i + 100*j + 50*k == X:
                count += 1
print(count)


Measured memory_bytes: 3060
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <queue>
#define llong long long
#define INF (__INT32_MAX__ / 2)

using namespace std;
typedef pair<int, int> ipair;
llong modulo(llong left, llong right) { return (left % right + right) % right; }

int N, h[101];
int main(int argc, char **argv) {
    cin >> N;
    for(int i = 1; i <= N; ++i)
        cin >> h[i];
    
    int res = 0;
    for(int i = 1; i <= N; ++i)
        if(h[i] > h[i - 1]) {
            res += h[i] - h[i - 1];
        }

    cout << res << endl;
}

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

using namespace std;

int main(void) {
    int N;
    cin >> N;
    vector<int> A(N);
    for(int i=0; i<N; i++) {
        cin >> A[i];
    }

    int64_t ans = 0;
    int tmp = 0;
    int r = 0;
    for(int l=0; l<N; l++) {
        while(r < N && (tmp & A[r]) == 0) {
            tmp ^= A[r];
            ++r;
        }
        ans += r-l;
        tmp ^= A[l];
    }

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


Measured memory_bytes: 1024
#include<stdio.h> 
int main() 
{ 
int a,b,c,d,e; 
scanf("%d%d",&a,&b); 
c=a+b; 
d=a-b; 
e=a*b; 
if(c>d&&c>e)printf("%d\n",c); 
else if(d>e)printf("%d\n",d); 
else printf("%d\n",e); 
return 0; 
}

Measured memory_bytes: 2108