akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <functional>
#include <iostream>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <queue>
#include <numeric>
#include <bitset>
#include <cmath>

using namespace std;
using ll = long long;
using ull = unsigned long long;
// const ll mod =  998244353 ;
const ll mod =  1000000007 ;
const ll inf = 1e18;
const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, 1, -1};


#define REP(i, n) for (ll i = 0; i < (n); ++i)
#define REP_FROM(i, j, n) for (ll i = (j); i < (n); ++i)
#define REP_REV(i, n) for (ll i = n-1; i >= 0; --i)
#define REP_FROM_REV(i, j, n) for (ll i = n-1; i >= j; --i)
#define all(x) (x).begin(),(x).end()
#define sz(x) ll(x.size())
template<typename T> inline T chmax(T& a, const T b) { return a = (a < b) ? b : a; }
template<typename T> inline T chmin(T& a, const T b) { return a = (a > b) ? b : a; }

ll power(ll base, ll exponent){ if(exponent % 2){ return power(base, exponent - 1) * base % mod; }else if(exponent){ ll root_ans = power(base, exponent / 2); return root_ans * root_ans % mod; }else{ return 1; }}
ll inverse(ll x){ return power(x, mod - 2);}
ll gcd(ll a, ll b) {if(a < b) gcd(b, a);ll r;while(r=a%b) {a=b;b=r;}return b;}
template<typename T> ll sum(T begin, T end) {return accumulate(begin, end, 0ll);}
struct combination{ vector<ll> fact, inv; combination(int sz) : fact(sz + 1), inv(sz + 1){ fact[0] = 1; for(int i = 1; i <= sz; i++){ fact[i] = fact[i - 1] * i % mod; } inv[sz] = power(fact[sz], mod - 2); for(int i = sz - 1; i >= 0; i--){ inv[i] = inv[i + 1] * (i + 1) % mod; } } ll C(int p, int q) const{ if(q < 0 || p < q) return 0; return (fact[p] * inv[q] % mod * inv[p - q] % mod); } };

using Pair = pair<ll, ll>;



signed main() {
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    ll n;
    cin >> n;
    vector<Pair> a;
    REP(i, n) {
        REP_FROM(j, i + 1, n) {
            if(i + j == n - 1 - n % 2) continue;
            a.emplace_back(i, j);
        }
    }
    cout << sz(a) << endl;
    for(auto x : a) {
        cout << x.first + 1 << " " << x.second + 1 << endl;
    }
    return 0;
}


Measured memory_bytes: 512
#include <algorithm>
#include <cstdio>

int a[100005];

int main(){
	int n;
	scanf("%d\n",&n);
	for (int i=1;i<=n;i++) scanf("%d",&a[i]);
	std::sort(a+1,a+n+1);
	for (int i=0;i<n;i++)
	if (i+1>=a[n-i-1]){
		bool flag=1;
		if ((a[n-i]-i)&1){
			int j=n-i-1;
			for (;a[j]>i;j--);
			if ((n-i-j)&1) flag=0;
		}
		printf(flag?"First":"Second");
		break;
	}
}

Measured memory_bytes: 512
package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	
	N := ScanInt(scanner)
	A := make([]int, N)
	B := make([]int, N)
	
	for i := 0; i < N; i++ {
	    A[i] = ScanInt(scanner)
	    B[i] = ScanInt(scanner)
	}
	
	ans := 0
	for i := N-1; i >= 0; i-- {
	    dif := (A[i] + ans) % B[i]
	    if dif != 0 {
	        dif = B[i] - dif
	    }
	    ans += dif
	}
	fmt.Println(ans)
	
}

func ScanInt(scanner *bufio.Scanner) int {
	scanner.Scan()
	i, e := strconv.Atoi(scanner.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func ScanFloat64(scanner *bufio.Scanner) float64 {
	scanner.Scan()
	f, e := strconv.ParseFloat(scanner.Text(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func ScanText(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func Max(a, b int) int {
	if a < b {
		return b
	}
	return a
}

func Min(a, b int) int {
	if a > b {
		return b
	}
	return a
}

func Abs(a int) int {
	if a < 0 {
		a *= -1
	}
	return a
}

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

int main(){
  int size;
  string str;
  while(cin >> str >> size,size){
    int cnt=0;
    vector<int> iv;
    bool frg = false;
    while(1){
      iv.push_back(stoi(str));
      while(str.size()<size){
        str = str.insert(0,"0");
      }
      //cout << str << endl;
      string smax = str;
      sort(smax.begin(),smax.end(),greater<char>());
      string smin = str;
      sort(smin.begin(),smin.end());
      //cout << "smax=" << smax <<  endl;
      int tmp = stoi(smax)-stoi(smin);
      //cout << "smin=" << smin << endl;
      for(int i=0; i<iv.size(); ++i){
        if(iv[i]==tmp){printf("%d %d %d\n",i,iv[i],cnt-i+1);frg=true;}
      }
      //iv.push_back(tmp);
      str = to_string(tmp);
      ++cnt;
      if(frg)break;
    }
  }  
}



Measured memory_bytes: 3276
import java.util.*;

class Main
{
    public static void main (String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();

        System.out.println(Math.min(a, b) + Math.min(c, d));
    }
}

Measured memory_bytes: 23764
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <functional>
#include <bitset>
#include <numeric>
#include <complex>
#include <iomanip>
#include <cassert>
#include <random>


int main() {
    int n, m; std::cin >> n >> m;
    std::vector<long long> x(n), y(n), z(n);
    for (int i = 0; i < n; i++) std::cin >> x[i] >> y[i] >> z[i];
    auto func = [&](int b) {
        std::vector<int> s(3);
        for (int i = 0; i < 3; i++) s[i] = (b >> i) & 1 ? 1 : -1;
        std::vector<std::vector<long long>>
            dp(n + 2, std::vector<long long>(m + 2, -1e18));
        for (int i = 0; i < n; i++) dp[i][0] = 0;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                dp[i + 1][j] = std::max(dp[i + 1][j], dp[i][j]);
                dp[i + 1][j + 1] = std::max(
                    dp[i + 1][j + 1],
                    dp[i][j] + s[0] * x[i] + s[1] * y[i] + s[2] * z[i]);
            }
        }
        long long ret = 0;
        for (int i = 0; i <= n; i++) ret = std::max(ret, dp[i][m]);
        return ret;
    };
    long long ans = -1e18;
    for (int i = 0; i < (1 << 3); i++) {
        ans = std::max(ans, func(i));
    }
    std::cout << ans << std::endl;
    return 0;
}

Measured memory_bytes: 8200
#!/usr/bin/env python3
import sys
input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return map(int,input().split())
def LI(): return list(map(int,input().split()))

def main():
    N = INT()
    Button = [INT() for _ in range(N)]

    count = 0
    isVisited = [False]*N
    GOAL = 1

    cur = 0
    while True:
        next = Button[cur]-1
        count += 1

        if next == GOAL:
            print(count)
            return
        
        if isVisited[next]:
            print(-1)
            return
        isVisited[next] = True
        cur = next
        
    return

if __name__ == '__main__':
    main()


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

//
// F(r) = (a*r + b) mod 26
//      = a*r + b - 26k
// -> r = ( F(r)+26k-b )/a
//
// F(r) is bijection, so 'a' is not a multiple of 2 and 13
//

int main() {
	int a, b, i ,j , n, k, kp, ff;
	char str[256], str2[256];
	
	scanf("%d\n",&n);
	for(;n>0;n--) {
		ff = 0;
		fgets( str, 256, stdin);
		for(a=1;;a++) {
			if ( ((a%2)==0)||((a%13)==0) ) continue;
			
			for( b=0; b<26; b++) {
				for(i=0; str[i]!='\0'; i++) {
					// except space or CRLF
					if (str[i]==' ') {
						str2[i]=' ';
						continue;
					}
					if (str[i]=='\n') {
						str2[i]='\n';
						continue;
					}
					
					// determine 'k'
					kp = b-(str[i]-'a');
					kp = ( kp -(kp%26) )/26;
					for(j=0;j<a;j++) {
						if ((( str[i]-'a' + 26*(kp+j) - b)%a)==0) {
							k = kp+j;
							break;
						}
					}
					
					str2[i] = ((str[i] -'a' + 26*k - b)/a) + 'a';
				}
				// Insert NULL
				str2[i]='\0';
				if ( (strstr( str2, "this")!=NULL)||(strstr( str2, "that")!=NULL)) {
					ff = 1;
					break;
				}
			}
			if (ff==1) break;
		}
		printf("%s", str2);
	}
	
	return;
}

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

int main() {

    int h, w; cin >> h >> w;
    vector<vector<char>> a(h+2, vector<char>(w+2,'#'));
	for (int i = 1; i <= h; i++) {
		for (int j = 1; j <= w; j++) {
			cin >> a[i][j];
		}
	}

	for (int i = 0; i <= h + 1; i++) {
		for (int j = 0; j <= w + 1; j++) {
			cout << a[i][j];
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int main(){
  int x;
  int len = 0;
  cin >> x;
  
  int temp = x;
  int num = 0;
  int ans = 0;
  for(int i = 0; temp > 0; i++){
    num = temp % 10;
    len ++;
    temp /= 10;
  }
  
  for( int i = 0; i < len; i++){
    ans *= 10;
    ans += num;
  }
  
  if(ans <  x){
    if(num == 9){
      num = 1;
      len++;
    } else {
      num++;
    }
    ans = 0;
    for(int i = 0; i < len; i++){
      ans *= 10;
      ans += num;
    }
  }
  
  cout << ans;
}

Measured memory_bytes: 256
import java.util.*;

class Main{
public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	long n = sc.nextLong();
	for(int i=(int)Math.sqrt(n); i>=1; i--) {
		if(n%i == 0) {
			System.out.println(String.valueOf(n/i).length());
			break;
		}
	}
}
}

Measured memory_bytes: 21972
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <random>
#include <chrono>

using namespace std;
using namespace __gnu_pbds;

#define endl '\n'

typedef long long ll;
typedef pair<int, int> pii;
//typedef tree<int,null_type,less<int>,rb_tree_tag, tree_order_statistics_node_update> indexed_set;

//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

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

	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	
	int n;
	cin >> n;
	
	vector<vector<int>> dp(15, vector<int>(15));
	
	for(int b = 1; b <= n; b++){
		
		int x = b;
		int last = x % 10, first = -1;
		while(x){
			first = x % 10;
			x /= 10;
		}
		
		dp[first][last]++;
	}
	
	ll ans = 0;
	for(int a = 1; a <= n; a++){
		int x = a;
		int last = x % 10, first = -1;
		while(x){
			first = x % 10;
			x /= 10;
		}
		
		ans += dp[last][first];
	}
	
	
	cout << ans << endl;

	return 0;
}


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

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

    int h, w, k;
    cin >> h >> w >> k;
    char C[h][w];
    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            cin >> C[i][j];
        }
    }

    int ans = 0;
    for(int i = 0; i < (1 << h); i++){
        vector<int> X;
        for(int j = 0; j < h; j++){
            if(i >> j & 1){
                X.push_back(j);
            }
        }

        for(int j = 0; j < (1 << w); j++){
            vector<int> Y;
            for(int bit = 0; bit < w; bit++){
                if(j >> bit & 1){
                    Y.push_back(bit);
                }
            }

            // for(auto x: X){
            //     cout << x << ' ';
            // }
            // cout <<  endl;
            // for(auto y : Y){
            //     cout << y << ' ';
            // }
            // cout << endl;
            // cout << "########" << endl;

            int total = 0;
            for(int x = 0; x < h; x++){
                for(int y = 0; y < w; y++){
                    if(C[x][y] == '.') continue;
                    bool f = true;
                    for(auto x_c: X){
                        if(x_c == x){
                            f = false;
                            continue;
                        }
                    }
                    if(!f) continue;
                    for(auto y_c: Y){
                        if(y_c == y){
                            f = false;
                            continue;
                        }
                    }
                    if(!f) continue;
                    total++;
                }
            }
            if(total == k){
                ans++;
                
            }
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3656
#include <cstdio>
#include <algorithm>
#include <queue>

const int MN = 100005, MQ = 100005;

int N, Q, nA[MN], nB[MN], nC[MN], qD[MQ], qE[MQ];
inline void tr(int &x) { x = std::lower_bound(nC + 1, nC + N + 1, x) - nC; }

int A[MN], B[MN], used[MN];
std::vector<int> R[MN];
std::priority_queue<std::pair<int, int>> pq;
int Ans[MN];

int main() {
	scanf("%d", &N), ++N;
	for (int i = 1; i < N; ++i) scanf("%d%d", &nA[i], &nB[i]);
	for (int i = 1; i <= N; ++i) scanf("%d", &nC[i]);
	scanf("%d", &Q);
	for (int i = 1; i <= Q; ++i) scanf("%d%d", &qD[i], &qE[i]);
	std::sort(nC + 1, nC + N + 1);
	for (int i = 1; i < N; ++i) tr(nA[i]), tr(nB[i]);
	for (int i = 1; i <= Q; ++i) tr(qD[i]), tr(qE[i]);
	for (int i = 1; i < N; ++i) ++A[nA[i]];
	for (int i = 1; i <= N; ++i) A[i] += A[i - 1] - 1;
	for (int i = 1; i < N; ++i)
		if (nA[i] > nB[i]) R[nA[i] - 1].push_back(i);
		else used[i] = 1;
	for (int i = N, S = 0; i >= 1; --i) {
		for (int j : R[i]) pq.push({-nB[j], j});
		S += B[i];
		while (A[i] + S < -1) {
			while (!pq.empty() && -pq.top().first > i) pq.pop();
			if (pq.empty()) {
				while (Q--) puts("-1");
				return 0;
			}
			auto p = pq.top(); pq.pop();
			int j = p.second, l = nB[j], r = nA[j] - 1;
			++S, ++B[r], --B[l - 1], used[j] = 1, ++Ans[1];
		}
	}
	for (int i = N; i >= 1; --i) A[i] += B[i] += B[i + 1];
	for (int i = 1; i <= N; ++i) B[i] = 0, R[i].clear();
	for (int i = 1; i < N; ++i) if (!used[i]) R[nB[i]].push_back(i);
	for (int i = 1, S = 0; i <= N; ++i) {
		Ans[i + 1] = Ans[i];
		for (int j : R[i]) pq.push({nA[j] - 1, j});
		S += B[i];
		while (A[i] + S == -1) {
			while (!pq.empty() && pq.top().first < i) pq.pop();
			if (pq.empty()) {
				for (int j = i; j <= N; ++j) Ans[j + 1] = N + 1;
				goto where;
			}
			auto p = pq.top(); pq.pop();
			int j = p.second, l = nB[j], r = nA[j] - 1;
			++S, ++B[l], --B[r + 1], ++Ans[i + 1];
		}
	}
	where:
	for (int i = 1; i <= Q; ++i) {
		int ans = -1;
		ans = std::max(ans, N - Ans[qD[i]]);
		ans = std::max(ans, N - Ans[qE[i]] - 1);
		printf("%d\n", ans);
	}
	return 0;
}

Measured memory_bytes: 13192
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			int[] a = new int[n];
			Map<Integer, Integer> map = new HashMap<>();
			IntStream.range(0, n).forEach(i -> {
				a[i] = scanner.nextInt();
				map.put(a[i], map.getOrDefault(a[i], 0) + 1);
			});
			int remain = map.size();
			// 解説通りに結果の計算方法を変更
			System.out.println(remain - ((remain & 1) ^ 1));
		}
	}
}


Measured memory_bytes: 64212
#include<iostream>
#include<unordered_set>

using namespace std;

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

	int a[n];
	for(int i=0; i<n; i++) cin >> a[i];

	int q;
	cin >> q;

	int m[q];
	for(int i=0; i<q; i++) cin >> m[i];

	unordered_set<int> x;

	int sum;
	for(int bit=0; bit<(1<<n); bit++){
		sum = 0;
		for(int i=0; i<n; i++){
			if(bit & (1<<i)) sum += a[i];
		}
		x.insert(sum);
	}

	for(int i=0; i<q; i++){
		if( x.find(m[i]) != x.end() ) cout << "yes" << endl;
		else cout << "no" << endl;
	}

	return 0;
}


Measured memory_bytes: 3116
#include <algorithm>
#include <cassert>
#include <iostream>
#include <map>
#include <random>
#include <set>
#include <vector>

using namespace std;
using LL = long long;
using pii = pair<LL, LL>;

#define div divdiv

#define X first
#define Y second

// DBG =======================================================================
template<typename T>
ostream& operator<< (ostream& out, const vector<T>& v) {
  out << "{";
  bool f = false;
  for (const auto& x : v) {
    if (f)
      out << ", ";
    f = true;
    out << x;
  }

  return out << "}";
}

template<typename T>
void dbg_p(int line, const char* name, T x) {
  cerr << "line " << line << ": " << name << " = " << x << endl;
}

#define DBG(x) { dbg_p(__LINE__, #x, x); }
// DBG =======================================================================

int main() {
  LL a, b, c, d;
  LL n;
  cin >> a >> b >> c >> d;
  cin >> n;

  b = min(b, 2 * a);
  c = min(c, 2 * b);
  d = min(d, 2 * c);
  LL res = (n / 2) * d + (n % 2) * c;
  cout << res << endl;
}

Measured memory_bytes: 256
import sys
## io ##
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))
MOD=10**9+7
#======================================================#
def main():
    n = II()
    sumv10 = 1
    for _ in range(n):
        sumv10 *= 10
        sumv10 %= MOD
    sumv9 = 1
    for _ in range(n):
        sumv9 *= 9
        sumv9 %= MOD
    sumv9 *= 2
    sumv8 = 1
    for _ in range(n):
        sumv8 *= 8
        sumv8 %= MOD
    print((sumv10 - sumv9 + sumv8)%MOD)

if __name__ == '__main__':
    main()

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

using namespace std;

#define all(x) (x).begin(), (x).end()
#define pb(x) push_back(x)
#define vi vector<int>

#define ll long long int

int ctoi(char c) {return c-'0';}
int ord(char c) {return c-'a';}
int len(string s) {return s.length();}
int itoc(int i) {return i+'a';}

int main() {
string s,t;
cin>>s>>t;
cout<<t+s<<endl;
return 0;
}


Measured memory_bytes: 256
from bisect import bisect_right

n = int(input())
a = [-int(input()) for _ in range(n)]

lst = [a[0]]
for aa in a[1:]:
    i = bisect_right(lst, aa)
    if i == len(lst): lst.append(aa)
    else: lst[i] = aa

print(len(lst))

Measured memory_bytes: 14332
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<utility>
#include<algorithm> // sort
#include<map> // pair
#include<cmath>
#include<cstring>
#include<set>
using namespace std;
using ll = long long;
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 (a>b) { a=b; return 1; } return 0; }
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
#define all(x) (x).begin(),(x).end()
const ll mod = 1e9+7;
const int INF = 1e9;
const ll INFLONG = 1e18;
// vector<vector<ll>> vec(100,vector<ll>(3,0));
ll n,m;
vector<ll> vec;
void emb(ll x){
  REP(i,1,sqrt(m+1)){
    if(x % i == 0){
      vec.push_back(i);
      vec.push_back(x/i);
    }
  }
}
int main(){
  cin >> n >> m;
  ll ans=1;
  emb(m);
  sort(all(vec));
  for(auto itr:vec){
    if(itr * n <= m){
      ans = itr;
    }
  }
  cout << ans;
}


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

using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
vector<int> a(26, 0);

int a4, a2;
int h, w;
int t2, t4;

bool ch()
{
  if (t4 > a4) return false;
  a4 -= t4;
  a2 += a4 * 2;
  if (t2 > a2) return false;
  return true;
}

void init()
{
  cin >> h >> w;
  rep(i, h) rep(j, w) {
    char c;
    cin >> c;
    c -= 'a';
    a[c]++;
    if (a[c] == 4) {
      a4++;
      a2--;
      a[c] = 0;
    } else if (a[c] == 2) {
      a2++;
    }
  }
}


int main()
{
  init();
  if (h % 2) {
    if (w % 2) {
      t2 = (w / 2) + (h / 2);
    } else {
      t2 = w / 2;
    }
  } else {
    if (w % 2) {
      t2 = h / 2;
    } else {
      t2 = 0;
    }
  }
  t4 = (w / 2) * (h / 2);
  if (ch()) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 256
import sys
input=sys.stdin.readline
N,M,Q=map(int,input().split())

xmat=[[0]*(N+1) for _ in range(N+1)]
for i in range(M):
  l,r=map(int,input().split())
  xmat[l][r]+=1
#print(xmat)

smat=[[0]*(N+1) for _ in range(N+1)]
for i in range(1,N+1):
  for j in range(1,N+1):
    smat[i][j]=xmat[i][j]+smat[i][j-1]+smat[i-1][j]-smat[i-1][j-1]
#print(smat)

for i in range(Q):
  p,q=map(int,input().split())
  print(smat[q][q]-smat[p-1][q]-smat[q][p-1]+smat[p-1][p-1])

Measured memory_bytes: 56412
#include <stdio.h>
#include <stdlib.h>

typedef char String[1024];

int main(void)
{
    String str_a;
    String str_b;
    scanf("%s %s", str_a, str_b);
    
    int a = atoi(str_a);
    int b = atoi(str_b);
    int res = a - b;
    
    if (res < 0)
    {
        printf("a < b\n");
    }
    else if (res == 0)
    {
        printf("a == b\n");
    }
    else
    {
        printf("a > b\n");
    }
    return (0);
}


Measured memory_bytes: 2036
s = input()
n = len(s)
res = 0
l =[]

for i in range(1 << (n-1)):
    cnt = 1
    l = [0]
    for j in range(n-1):
        if (i >> j) & 1:
            l.append(j+1)
    l.append(n)
    for k in range(len(l)-1):
        res += int(s[l[k]:l[k+1]])

print(res)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define MOD 1000000007
#define PI 3.141592653589793238
#define pb push_back
#define ALL(V) (V).begin(), (V).end()
#define rep(i, a, b) for(int i = (a); i < (b); ++i)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long long int lint;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
inline ll gcd(ll a, ll b) { return (a % b == 0 ? b : gcd(b, a % b)); }
inline ll lcm(ll a, ll b) { return a * b / gcd(a, b); }
inline ll char_to_ll(char c) { return (int)(c - '0'); }
inline ll string_to_ll(string s) { return atoi(s.c_str()); }
inline bool is_prime(ll x){ if(x <= 1) return false; for(ll i = 2; sqrt(i) <= x; i++) if(x % i == 0) return false; return true; }

int main(){
    ll W, H, x, y, r;
    cin >> W >> H >> x >> y >> r;
    if(x - r >= 0 && r + x <= W && y - r >= 0 && y + r <= H) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}



Measured memory_bytes: 3088
#prag\
ma GCC optimize("O3")
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define inf 1000000000
#define mp make_pair
#define pii pair<int,int>
#define pb push_back
#define r1 rt<<1
#define r2 rt<<1|1
#define ld long double
#define ri register int
#define rep(i,a,b) for(ri i=a;i<=b;++i)
#define rep2(i,a,b,c) for(ri i=a;i<=b;i+=c)
#define REP(i,a,b) for(ri i=a;i>=b;--i)
#define REP2(i,a,b,c) for(ri i=a;i>=b;i-=c)
using namespace std;

const int N=1e5+5;
int a[N],f1[N],f2[N];
int main()
{
	ios::sync_with_stdio(false);cin.tie(0);
	ri n;cin>>n;
	rep(i,1,n) cin>>a[i];
	f1[1]=f2[1]=1;
	rep(i,2,n){
		if(a[i]>a[i-1]) f1[i]=min(f1[i-1],f2[i-1]+1),f2[i]=min(f1[i-1]+1,f2[i-1]+1);
		else if(a[i]<a[i-1]) f1[i]=min(f1[i-1]+1,f2[i-1]+1),f2[i]=min(f1[i-1]+1,f2[i-1]);
		else f1[i]=f1[i-1],f2[i]=f2[i-1];
		//cout<<f1[i]<<' '<<f2[i]<<endl;
	}
	cout<<min(f1[n],f2[n]);
	return 0;
}

Measured memory_bytes: 1408
#include<bits/stdc++.h>
const int M=1e9+7;// M=1e9+7;//M=300000;//
const int N=5e5+5;
typedef long long int ll;
using namespace std;
 
ll cnt(0),n,m,x,y,i,j,temp,k,ans(0),sum(0),mn(M),mx(-9e9);

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	
	string s;
	cin>>s;
	n=s.size();
	if(s[n-1]=='s')
	{
		cout<<s<<"es";
	}else cout<<s<<'s';
}

Measured memory_bytes: 3648
import java.util.Scanner;

public class Main 
{
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		
		for(;;)
		{
			int n = scanner.nextInt();
			if(n == 0)
			{
				break;
			}
			
			double[] s = new double[1000];
			double sum = 0;
			for(int i=0; i<n; i++)
			{
				s[i] = scanner.nextDouble();
				sum += s[i];
			}
			
			double m = sum/n;
			double v = 0;
			for(int i=0; i<n; i++)
			{
				v += (s[i] - m) * (s[i] - m);
			}

			System.out.printf("%1$.8f\n", Math.sqrt(v/n));
		}
	}
}

Measured memory_bytes: 37936
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using System.Runtime.CompilerServices;
using static MyUtil;

class MyUtil
{
    public static int[] ReadIntArray()
    {
	return ReadLine().Split().Select(x => int.Parse(x)).ToArray();
    }
}

class Program
{
    public static void Main()
    {
	var tmp = ReadIntArray();
	int a = tmp[0], b = tmp[1], k = tmp[2];
	int c = a + (k - 1), d = b - (k - 1);

	if (c < d)
	{
	    for (int i = a; i <= c; i++)
	    {
		WriteLine(i);
	    }
	    for (int i = d; i <= b; i++)
	    {
		WriteLine(i);
	    }
	}
	else
	{
	    for (int i = a; i <= b; i++)
	    {
		WriteLine(i);
	    }
	}
	
    }
}


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

// iterator
#define REP(i,init, n) for(lli i=init;i<n;i++)
#define REPE(i,init, n) for(lli i=init;i<=n;i++)
#define REPIT(it,container) for(auto it = container.begin(); it != container.end(); it++)
#define REPIT_R(it,container) for(auto it = container.rbegin(); it != container.rend(); it++)

// input
#define cin1(x)             cin >> x
#define cin2(x, y)          cin >> x >> y
#define cin3(x, y, z)       cin >> x >> y >> z
#define ncin1(n, x)         REP(i, 0, n) {cin1(x[i]);}
#define ncin2(n, x, y)      REP(i, 0, n) {cin2(x[i], y[i]);}
#define ncin3(n, x, y, z)   REP(i, 0, n) {cin3(x[i], y[i], z[i]);}

// output
#define cout1(x)         cout << #x << ": " << x << endl;
#define ncout1(n, x)     REP(i, 0, n) {cout << #x << "[" << i << "]: "<< x[i] << endl;}

// sort
#define sort_r(x, y)        sort(x, y, greater<lli>()); // 降順(5,4,3,,,)

#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))

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

int main() {
    lli n;
    cin1(n);
    lli t[n+2], v[n+2];
    double total = 0;
    REPE(i, 1, n) {
        cin >> t[i];
        total += t[i];
    }
    lli total_t[n+1] = {0};
    REPE(i, 1, n) {
        total_t[i] = t[i] + total_t[i-1];
    }
    REPE(i, 1, n) {
        cin >> v[i];
    }
    v[0] = v[n+1] = 0;
    t[n+1] = LLONG_MAX; // 使わない
    double ans = 0;
    double left, right;
    left = 0;
    REPE(i, 1, n){
        double th1, th2, th3;
        double t_s, t_e;
        t_s = total_t[i-1];
        t_e = total_t[i];

        //cout << "i: " << i << endl;
        for (double cur = total_t[i-1]+0.5; cur <= total_t[i]; cur += 0.5) {
            th1 = v[i];
            //th2 = v[i-1] + (cur - t_s);
            //th3 = v[i+1] + (t_e - cur);


            th2 = th3 = LLONG_MAX;

            REPE(j, 1, n) {
                if (j <= i)
                    th2 = min(th2, v[j-1] + (cur - total_t[j-1]));
                if (j >= i )
                    th3 = min(th3, v[j+1] + (total_t[j] - cur));
            }

            right = min({th1, th2, th3});
            ans += (left + right) * 0.5 * 0.5;
            //cout << "  add: " << (left + right) * 0.5 * 0.5;
            //cout << "  (total: " << ans << ")";
            //cout << "  (right, left): " << right << ", " << left << endl;
            left = right;
        }
    }
    cout << fixed <<  ans << endl;
}


Measured memory_bytes: 256
d,g = map(int,input().split())
P,C = [0]*d,[0]*d
for i in range(d): P[i],C[i] = map(int,input().split())
ans = 10**9
for bin in range(1<<d):
    cnt = tot = rest_max_bit = 0
    for i in range(d):
        if bin & 1<<i:
            t = (i + 1)*100
            tot += P[i]*t + C[i]
            cnt += P[i]
        else: rest_max_bit = i
    if tot < g:
        t = (rest_max_bit + 1)*100
        p = (g - tot + t - 1)//t
        if p >= P[rest_max_bit]: continue
        cnt += p
    ans = min(ans, cnt)
print(ans)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int N, Q; cin >> N >> Q;
    string S; cin >> S;
    vector<int> A(N+1);
    for (int i = 2; i <= N; i++) {
        A[i] = A[i-1];
        if (S[i-2] == 'A' && S[i-1] == 'C') A[i]++;
    }
    for (int i = 0; i < Q; i++) {
        int l, r; cin >> l >> r;
        cout << A[r] - A[l] << '\n';
    }
    return 0;
}


Measured memory_bytes: 1408
#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
using namespace std;
int main(){
  long long int i,j;
  long long int n,ans=1000000000,sum;
  cin>>n;
  vector<int> a(n);
  for(int i=0;i<n;++i)
    cin>>a.at(i);
  sort(a.begin(),a.end());
  for(i=0;i<101;++i){
    sum=0;
    for(j=0;j<n;++j){
      sum+=pow(a.at(j)-i,2);
      //cout<<sum<<' ';
    }
    ans=min(ans,sum);
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 256
using System;

class Program
{
    static void Main(string[] args) {
        int n = int.Parse(Console.ReadLine());
        int[] ary = ToIntArray(Console.ReadLine(), n);
        
        Console.WriteLine(process(n,ary));
        Console.ReadLine();
    }

    static string process(int n, int[] ary) {
        int ng = 0;
        for(var i=0; i<n; i++) {
            if (i+1 != ary[i]) {
                ng++;
                if (ng > 2) return "NO";
            }
        }
        return "YES";
    }

    static int[] ToIntArray(string strs, int n) {
        int[] ret = new int[n];
        var spl = strs.Split(' ');
        for (int i = 0; i < n; i++) ret[i] = int.Parse(spl[i]);
        return ret;
    }
}

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

using namespace std;

int main()
{
    int n,q;
    cin>>n>>q;
    vector < priority_queue <int> > a(n);
    while(q--)
    {
        int t,b;
        cin>>t>>b;
        if(t==0)
        {
            int x;
            cin>>x;
            a[b].emplace(x);
        }
        if(t==1)
        {
            if(!a[b].empty())
            {
                cout<<a[b].top()<<endl;
            }
        }
        if(t==2)
        {
            if(!a[b].empty())
                a[b].pop();
        }
  }
  return 0;
}




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

using namespace std;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)

typedef long long ll;
typedef pair<ll, ll> P;
const ll INF = 1LL<<60;

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

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 modpow(ll a, ll n, ll mod) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}

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

  int n, m;
  cin >> n >> m;

  vector<vector<int>> g(n);

  rep(i, m){
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }

  vector<int> ans(n);

  queue<int> q;
  q.push(0);

  vector<int> visit(n);

  rep(i, n) visit[i] = -1;
  visit[0] = 1;

  while(!q.empty()){

    int v = q.front();
    q.pop();

    for(auto nv : g[v]){

      if(visit[nv] != -1){
        continue;
      }

      visit[nv] = 1;
      ans[nv] = v;
      q.push(nv);

    }

  }

  cout << "Yes" << endl;
  rep(i, 1, n){
    cout << ans[i] + 1 << endl;
  }

  
  return 0;
}


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

#define int long long
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define pb push_back
#define fi first
#define se second
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

signed main(){
    int A,B,C,D,E;
    cin>>A>>B>>C>>D>>E;
    int ans=0;
    if(A<0){
        ans+=-A*C;
        ans+=D;
        A=0;
    }
    ans+=(B-A)*E;
    cout<<ans<<endl;
    return 0;
}

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

using namespace std;

int main(){
    int h, w;
    cin >> h >> w;
    vector<string> board(h+2);
    for(int i=1;i<=h;i++){
        cin >> board[i];
    }
    board[0] = board[h+1] = string(w+2, '.');
    for(int i=1;i<=h;i++){
        board[i] = '.' + board[i] + '.';
    }
    for(int i=1;i<=h;i++){
        for(int j=1;j<=w;j++){
            if(board[i][j] == '#')
                continue;
            int cnt = 0;
            for(int dx=-1;dx<=1;dx++){
                for(int dy=-1;dy<=1;dy++){
                    if(dx == 0 && dy == 0)
                        continue;
                    else if(board[i+dy][j+dx] == '#')
                        cnt++;
                }
            }
            board[i][j] = cnt + '0';
        }
    }
    for(int i=1;i<=h;i++){
        cout << board[i].substr(1, w) << endl;
    }

    return 0;
}


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

#define fast ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define int long long
#define endl '\n'

using namespace std;

const int N = 2e5 + 77;
int A[N];
int F(int a,int b){
    string x = to_string(a);
    string y = to_string(b);
    return max(x.length(),y.length());
}
int32_t main(){
    fast;
    int n , ans = 1e12; cin >> n ;
    for(int i = 1 ; i*i <= n ; ++i){
        if(n%i==0){
            int a = i ,b = n/i;
            ans = min(ans,F(a,b));
        }
    }
    cout << ans << endl;
    return 0;
}

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

using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define PRINT(item) cout << (item) << endl;
#define PRINT_VEC(V) \
    for (auto v : (V)) cout << v << ' ';
#define PRINT_ENTER() cout << endl;

int main() {
    /* code */
    int N;
    cin >> N;
    int a;
    REP(i, N) {
        cin >> a;
        if (a % 2 == 0) {
            if (a % 3 != 0 && a % 5 != 0) {
                cout << "DENIED " << endl;
                return 0;
            }
        }
    }
    cout << "APPROVED" << endl;
    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<vector>
#define debug(...) fprintf(stderr,__VA_ARGS__)
using namespace std;
inline char nc() {	
	return getchar();
	static char buf[100000],*l=buf,*r=buf;
	return l==r&&(r=(l=buf)+fread(buf,1,100000,stdin),l==r)?EOF:*l++; 
}
template<class T> void read(T &x) {
	x=0; int f=1,ch=nc();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=nc();}
	while(ch>='0'&&ch<='9'){x=x*10-'0'+ch;ch=nc();}
	x*=f;
}
const int maxn=500+5;
int N;
int c[maxn][maxn];
inline void adde(int u,int v,int w) {
	if(u>v) swap(u,v);
	c[u][v]=w;
}
void sol(vector<int> &v,int k) {
	if(v.size()==1) {
		return;
	}
	vector<int> t[2];
	for(unsigned int i=0;i<v.size();++i) {
		t[i&1].push_back(v[i]);
	}
	for(unsigned int i=0;i<t[0].size();++i) {
		for(unsigned int j=0;j<t[1].size();++j) {
			adde(t[0][i],t[1][j],k);
		}
	}
	sol(t[0],k+1);
	sol(t[1],k+1);
}
int main() {
	read(N);
	vector<int> v;
	for(int i=1;i<=N;++i) v.push_back(i);
	sol(v,1);
	for(int i=1;i<N;++i) {
		for(int j=i+1;j<=N;++j) {
			if(j!=i+1) printf(" ");
			printf("%d",c[i][j]);
		}
		printf("\n");
	}
	return 0;
}

Measured memory_bytes: 1536
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<(n);i++)
#define loop(i,a,n) for(i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;

#define L 100005

int main(void) {
    int i,j;
    int n;
    cin >> n;
    vi a(n);
    rep(i,n)cin >> a[i];
    int p[L][2] = {};
    rep(i,n){
        p[a[i]][i%2]++;
    }
    vector<pii> x,y;
    rep(i,L){
        x.push_back(pii(p[i][0],i));
        y.push_back(pii(p[i][1],i));
    }
    sort(all(x));
    sort(all(y));
    if(x[x.size()-1].second == y[y.size()-1].second){
        cout << n - (max(x[x.size()-2].first,y[y.size()-2].first) + x[x.size()-1].first) << endl;
    }else{
        cout << n - (x[x.size()-1].first + y[y.size()-1].first) << endl;
    }
}


Measured memory_bytes: 3188
#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>

std::string make_nines(int d)
{
  std::ostringstream oss;
  for (int i = 0; i < d; ++i) {
    oss << '9';
  }
  return oss.str();
}

long solve1(const std::string& n)
{
  if (n.size() <= 0) return 0;
  int a = n[0] - 0x30;
  if (a == 0) return solve1(n.substr(1));
  return a + 9 * (n.size() - 1);
}

long solve2(const std::string& n)
{
  if (n.size() <= 1) return 0;
  int a = n[0] - 0x30;
  if (a == 0) return solve2(n.substr(1));
  return (a - 1) * solve1(make_nines(n.size() - 1))
      + solve1(n.substr(1))
      + solve2(make_nines(n.size() - 1));
}

long solve3(const std::string& n)
{
  if (n.size() <= 2) return 0;
  int a = n[0] - 0x30;
  if (a == 0) return solve3(n.substr(1));
  return (a - 1) * solve2(make_nines(n.size() - 1))
      + solve2(n.substr(1))
      + solve3(make_nines(n.size() - 1));
}

long solve(const std::string& n, int k)
{
  if (k == 1) return solve1(n);
  if (k == 2) return solve2(n);
  return solve3(n);
}

int main()
{
  std::string n;;
  int k;
  std::cin >> n >> k;

  std::cout << solve(n, k) << std::endl;
}


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

#define rep(i,n) for(int i=0;i<(n);i++)
typedef long long LL;
using namespace std;

int kaijo(int n) {
	if (n <= 1) {
		return 1;
	}
	else {
		return n * kaijo(n - 1);
	}
}

float len(int xi, int xj, int yi, int yj) {
	int XX = (xi - xj)*(xi - xj);
	int YY = (yi - yj)*(yi - yj);

	return sqrt(XX + YY);
}
int main() {
	int n; cin >> n;
	vector<int> x(n), y(n);
	rep(i, n) {
		cin >> x[i] >> y[i];
	}

	float dic = 0;
	float ans = 0;
	rep(i, n){
		rep(j, n) {
			dic += len(x[i], x[j], y[i], y[j]);
		}
	}
  dic/=2;
	ans = (2 * dic) / n;
	printf("%.10f\n", ans);
	return 0;
}

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

using namespace std;

typedef long long ll;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	string s;
	cin >> s;
	int ans = 0,n = s.size();
	for(int i=0;i<n/2;i++){
		if(s[i]!=s[n-1-i]) ans++;
	}
	cout << ans << "\n";
	
	return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define per(i, n) for (int i = (int)(n-1); i >= 0; i--)
#define sz(x) int(x.size())
#define all(x) (x).begin(), (x).end()
#define INF 2e9
#define LINF 1e18
template<class T> inline bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T &a, const T &b) { if (a > b) { a = b; return 1; } return 0; }
typedef long long ll;
typedef pair<int, int> P;

int main() {
    string s, t; cin >> s >> t;
    int n = sz(s), m = sz(t);
    vector<vector<int> > is(26); //それぞれの文字が何番目に出てくるか
    rep(i, n) is[s[i]-'a'].push_back(i);
    rep(i, n) is[s[i]-'a'].push_back(i+n);
    ll ans = 0;
    int p = 0; //今の位置
    rep(i, m) {
        int c = t[i]-'a';
        if (sz(is[c]) == 0) { //そもそもtの文字がない場合
            puts("-1");
            return 0;
        }
        p = *lower_bound(all(is[c]), p)+1; 
        if (p >= n) { //1周期舐めたらansに1周期分の長さ足しとく
            p -= n;
            ans += n;
        }
    }
    ans += p;
    cout << ans << endl;

}

Measured memory_bytes: 1724
#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long ll;
typedef double db;
typedef pair<int,int> pii;
typedef vector<int> vi;
#define check system("pause")
#define all(x) (x).begin(),(x).end()
#define de(a) cout<<#a<<" = "<<a<<endl
#define dd(a) cout<<#a<<" = "<<a<<" "
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define INF 0x3f3f3f3f
const ll mod = 1e9+7;
const int N = 1e6+20;
#define dep(i,a,b) for(int i=(a);i>=(b);i--)
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define mes(p,b) memset(p,b,sizeof(p))
#define sz(x) int(x.size())

int main()
{
  	ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	long double a,b;
	cin>>a>>b;
	ll t=a*b;
	cout<<t; 
  	return 0;
}



Measured memory_bytes: 3752
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
#define VL vector<ll>
#define VS vector<string>
#define VB vector<bool>
#define VP vector<pair<ll,ll>>
#define VVL vector<vector<ll>>
#define VVP vector<vector<pair<ll,ll>>>
#define PL pair<ll,ll>
#define ALL(v) (v).begin(), (v).end()

int main(){
    long double N, M;
    cin >> N >> M;
    cout << (ll)(N*M) << endl;
    return 0;
}

Measured memory_bytes: 3732
n, k = map(int, input().split())
a = list(map(int, input().split()))

s = sum(a)
d = []
for i in range(1, s):
    if s % i == 0:
        d.append(i)
    if s <= i * i:
        break
    if s % i == 0:
        d.append(s // i)
d = list(reversed(sorted(d)))

for di in d:
    b = []
    for ai in a:
        b.append(ai % di)
    b = list(sorted(b))
    cnt = 0
    il = 0
    ir = n - 1
    while il < ir:
        if b[il] <= di - b[ir]:
            cnt += b[il]
            b[ir] += b[il]
            b[il] = 0
            il += 1
        else:
            cnt += di - b[ir]
            b[il] -= di - b[ir]
            b[ir] = di
            ir -= 1
    if cnt <= k:
        print(di)
        break

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

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

int main() {
  int h, w;
  char t[60][60];
  
  cin >> h >> w;
  for (int i = 1; i <= h; i++) {
    for (int j = 1; j <= w; j++) {
      cin >> t[i][j];
    }
  }

  bool ans = true;

  for (int i = 1; i <= h; i++) {
    for (int j = 1; j <= w; j++) {
      if (t[i][j] == '#') {
        bool flag = false;
        for (int k = 0; k < 4; k++) {
          if (t[i+dx[k]][j+dy[k]] == '#') {
            flag = true;
          }
        }
        if (flag == false) {
          ans = false;
        }
      }
    }
  }

  cout << (ans ? "Yes" : "No") << endl;
}

Measured memory_bytes: 256
D, N = map(int, input().split())
if N != 100:
    if D == 0:
        print(N)
    elif D == 1:
        print(N*100)
    else:
        print(N*10000)
else:
    if D == 0:
        print(101)
    elif D == 1:
        print(10100)
    else:
        print(1010000)

Measured memory_bytes: 3060
//#pragma GCC optimize (2)
#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ii =  pair<int,int>;
const int  dir[2][2] = {{-1,0},{0,1}};
const int mod = 1000000007;
const int INF = 0x3f3f3f;
#define all(v) v.begin(),v.end()
ll quick_pow(ll base, ll n) {
    ll ans = 1;
    while (n ) {
        if (n & 1 )ans *= base;
        base *= base;
        n >>= 1;
    }
    return ans;
}
void solution();
int main() {
    int T = 1;
//    cin>>T;
    while (T--) {
        solution();
    }
    return 0;
}
void solution(){
    string s;
    getline(cin,s);
    ll x = 0;
    for (char i : s) {
        x+=i-'0';
    }
    cout<<(x%9==0?"Yes\n":"No\n");
}

Measured memory_bytes: 3732
N, K, Q = map(int, input().split())
point = [0] * (N + 1)
for _ in range(Q):
    point[int(input())] += 1

for i in range(1, N + 1):
    if K - (Q - point[i]) > 0:
        print("Yes")
    else:
        print("No")


Measured memory_bytes: 4680
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define REP(i,n) for (ll i = 0; i < (n); ++i)
#define RREP(i, n) for (ll i = (n) - 1; i >= 0; --i)
#define ALL(v) (v).begin(), (v).end()
template<class T>
using reverse_priority_queue = priority_queue<T, vector<T>, greater<T>>;


int main(){
    ll k;
    cin >> k;
    ll tmp = 0;
    REP(i, k){
        tmp = (7 + (tmp * 10) % k) % k;
        if(tmp == 0){
            cout << i + 1 << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    return 0;
}


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

int main()
{
    int i;
    int n,m;
    vector<int> vc;
    i = 0;
    cin >> n >> m;
    while (i < n)
    {
        int x;
        cin >> x;
        vc.push_back(x);
        i++;
    }
    int count = 0;
    int sum = accumulate(vc.begin(), vc.end(), 0);
    float dis = 4*m;
    for (int i = 0; i < n; i++)
    {
        if (vc[i] >= sum/dis)
            count++;
        if (count >= m)
        {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}



Measured memory_bytes: 256
import itertools

n = int(input())
d = [int(num) for num in input().split()]

d.sort(reverse=True)

result = []
for conb in itertools.combinations(d, 2):
  result.append(list(conb)) 
  
answer = 0
for i in result:
  answer += i[0]*i[1]

print(answer)

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

int main() {
    int n,res=0,ans=1,count=0;
    cin>>n;
    for (int i=1; i<=n; i++) {
        int m=i;
        res=0;
        while(m>=2) {
            if (m%2==0) res++;
            m/=2;
        }
        if (count<res) {
            ans=i;
            count=res;
        }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int RANGE = 6000;
const int geta = 3000;
const int MAX_N = 57;

int main() {
    int N, K;
    cin >> N >> K;
    vector<int> A(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
        A[i] -= K;
    }
    
    long long dp[MAX_N][RANGE] = {0};
    for (int i = 0; i < MAX_N; i++) for (int j = 0; j < RANGE; j++) dp[i][j] = 0;
    // i 番目までで j になるように作る通り
    for (int i = 0; i < N; i++) {
        dp[i+1][A[i]+geta]++;
        for (int j = 100; j < RANGE-100; j++) {
            dp[i+1][j] += dp[i][j];
            dp[i+1][j+A[i]] += dp[i][j];
        }
    }
    
    cout << dp[N][geta] << endl;
    return 0;
}

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

int main()
{
    int N;
    cin >> N;
    
    vector<queue<int>> A(N);
    vector<bool> check(N);
    int count = 0;
    int total_count= 0;
    int day_count = 0;
    
    for (int i=0; i<N; i++){
        for(int j=0; j<N-1; j++){
            int a;
            cin >> a;
            A[i].push(a);
//            cout << A[i].back() << endl;
         }
    }
//    A[0].pop();
//    cout << A[2].front() << endl;;
    
//    cout << A[A[0].front()]
    vector<int> v;
    vector<int> next;
    for (int i=0; i<N; i++){
        v.push_back(i);
    }
//    for (auto i : v){
//        cout << i << endl;;
//    }
    
    do {
//        cout << "do" << endl;
        day_count++;
        count = 0;
        for(int i=0; i<N; i++){
            check[i] = true;
        }
        
        if (next.empty()){
            v = v;
        }
        else{
            v = next;
            next.clear();
        }
        
        for(auto i : v){
//            cout << v[i] << endl;
            //キューが空になっている場合の処理
            if (A[i].empty()){
                continue;
            }
            else if(A[(A[i].front()-1)].empty()){
                continue;
            }
            
            // もしも対戦相手が両思いなら
            if(A[(A[i].front()-1)].front()-1 == i){
                //もしも両方とも今日試合をしていないなら
                if((check[i] == true) && (check[A[i].front()-1] == true)){
//                    cout << i << endl;
                    count++;
                    total_count++;
                    check[i] = false;
                    check[A[i].front()-1] = false;
                    next.push_back(i);
                    next.push_back(A[i].front()-1);
//                    cout << "aaaaa" << A[i].front()-1 << endl;
                    A[A[i].front()-1].pop();
                    A[i].pop();
                }
            }
        }
//        for(int i=0; i<N; i++){
//
//        }
        if (total_count == N*(N-1)/2){
            break;
        }
        if (count == 0){
            day_count = -1;
            break;
        }
    } while (count != 0);
    
    cout << day_count << endl;
    
    return 0;
}


Measured memory_bytes: 4736