akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

#define d(x) cerr << #x ":" << x << endl;
#define dd(x, y) cerr << "(" #x "," #y "):(" << x << "," << y << ")" << endl
#define rep(i, n) for (int i = (int)(0); i < (int)(n); i++)
#define repp(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define all(v) v.begin(), v.end()
#define dump(v)                  \
    cerr << #v ":[ ";            \
    for (auto macro_vi : v) {    \
        cerr << macro_vi << " "; \
    }                            \
    cerr << "]" << endl;
#define ddump(v)                           \
    cerr << #v ":" << endl;                \
    for (auto macro_row : v) {             \
        cerr << "[";                       \
        for (auto macro__vi : macro_row) { \
            cerr << macro__vi << " ";      \
        }                                  \
        cerr << "]" << endl;               \
    }
using lint       = long long;
const int INF    = 1e9;
const lint LINF  = 1e18;
const lint MOD   = 1e9 + 7;
const double EPS = 1e-10;

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

    vector<vector<char>> G(H, vector<char>(W));
    rep(i, H) rep(j, W) { cin >> G[i][j]; }
    ddump(G);

    int ans = 0;
    for (int x = 0; x < (1 << H); x++) {
        for (int y = 0; y < (1 << W); y++) {

            int sum_b = 0;
            for (int i = 0; i < H; i++) {
                for (int j = 0; j < W; j++) {
                    if ((x & (1 << i)) or (y & (1 << j))) continue;
                    if (G[i][j] == '#') sum_b++;
                }
            }
            if (sum_b == K) ans++;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3632
#include <stdio.h>

#define N 20

int a[N],n;

int solve(int,int);

int main(){
  int i,m,q;
  scanf("%d",&n);
  for(i=0; i<n; i++){
    scanf("%d",&a[i]);
  }

  scanf("%d",&q);
  for(i=0; i<q; i++){
    scanf("%d",&m);
    if(solve(0,m)==1){
      printf("yes\n");
    }else{
      printf("no\n");
    }
  }
  
  return 0;
}

int solve(int i,int m){
  if(m==0){
    return 1;
  }
  if(i>=n){
    return 0;
  }
  if(solve(i+1,m)==1 || solve(i+1,m-a[i])==1){
    return 1;
  }else{
    return 0;
  }
}



Measured memory_bytes: 2104
input()
s = input()
if len(s) == 1:
    print(1)
else:
    ans = len(s)
    cur_char = s[0]
    cur_counter = 1
    for char in s[1:]:
        if cur_char == char:
            cur_counter +=1
        else:
            ans -= cur_counter -1 
            cur_char = char
            cur_counter = 1
    ans -= cur_counter -1
    print(ans)


Measured memory_bytes: 39936
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define ll long long
using namespace std;
//typedef vector<unsigned int>vec;
//typedef vector<ll>vec;
//typedef vector<vec> mat;
typedef pair<int, int> P;
typedef pair<ll,ll> LP;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int INF = 1000000000;
const ll LINF = 1000000000000000000;//1e18
//const ll MOD = 1000000007;
const ll MOD = 998244353;
const double PI = acos(-1.0);
const double EPS = 1e-10;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
//template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};

void solve(){
    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, -1);
    queue<pair<int, int>> q;
    q.emplace(0, -1);
    while(!q.empty()){
        auto [cur, par] = q.front();q.pop();
        if(ans[cur] != -1) continue;
        ans[cur] = par;
        for(auto nv:  G[cur]){
            if(nv == par) continue;
            if(ans[nv] != -1) continue;
            q.emplace(nv, cur);
        }
    }
    for(int i=1;i<N;i++){
        if(ans[i] == -1){
            cout << "No" << endl;
            return;
        }
    }
    cout << "Yes" << endl;
    for(int i=1;i<N;i++){
        cout << ans[i] + 1 << endl;
    }
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
    // int T; cin >> T; REP(t,T) solve();
}


Measured memory_bytes: 10944
#include <iostream>
#include <cassert>
#include <fstream>
#include <sstream>
#include <math.h>
#include <memory>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <time.h>
#include <stdio.h>
#include <deque>

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define POW(n) ((n)*(n))
#define ALL(a) (a).begin(),(a).end()
#define cerr if(false) cerr

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<unsigned long long> vull;

string S;

void solve() {
	string ans = "";

	REP(i, S.size()) {
		if (S[i] == 'B') {
			if (ans.empty())continue;
			ans = ans.substr(0, ans.size() - 1);
		}
		else {
			ans += S[i];
		}
	}

	cout << ans << endl;
}

int main() {
	cin >> S;

	solve();

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
using namespace std;
int main(){
	int a[5];
	for(int i=0;i<5;i++) cin >> a[i];
	while(1){
		bool j = true;
		for(int i=0;i<4;i++){
			if(a[i]<a[i+1]){
				int t = a[i];
				a[i] = a[i+1];
				a[i+1] = t;
				j = false;
			}
		}
		if(j) break;
	}
	for(int i=0;i<4;i++) cout << a[i] << " ";
	cout << a[4] << endl;
}

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

#define rep(i, n) for ( ll i = 0; i < (n); ++i )
#define reps(i, n) for ( ll i = 1; i <= (n); ++i )
#define _rep(i, n) for ( ll i = (n) - 1; i >= 0; --i )
#define _reps(i, n) for ( ll i = n; i > 0; --i )
#define all(x) (x).begin(),(x).end()

using namespace std;
using ll =  long long;
using P = pair<ll, ll>;

int main( void )
{
	ll n, y;
	cin >> n >> y;

	rep( c10k, n + 1 ) {
		rep( c5k, n - c10k + 1 ) {
			if ( (10000 * c10k) + (5000 * c5k) + (1000 * (n - c10k - c5k)) == y) {
				cout << c10k << " " << c5k << " " << (n - c10k - c5k) << endl;
				return 0;
			}
		}
	}

	cout << -1 << " " << -1 << " " << -1 << endl;

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
void swap(int *a, int *b)
{
    int tmp;
    tmp = *a;
    *a = *b;
    *b = tmp;
}
 
void sort(int *c, int *d)
{
    if (*c > *d)
        swap(c, d);
}
 
int main(void) 
{
    int x, y;
    while (std::cin >> x >> y) {
        if (x == 0 && y == 0)
            break;
        if (x > y) {
            sort(&x, &y);
            cout << x << " " << y << endl;
        }
        else {
            cout << x << " " << y << endl;
        }
    }
	return 0;
}


Measured memory_bytes: 2972
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <math.h>
#include <complex>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <bitset>
#include <functional>
#include <assert.h>
#define int long
#define ll long long
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define eb emplace_back
#define all(x) x.begin(),x.end()
#define SZ(x) x.size()
#define fi first
#define se second
const int INF = 1e9;
using namespace std;

template<class t> using vc=vector<t>;
template<class t> using vvc=vc<vc<t>>;

using pi=pair<int,int>;
using vi=vc<int>;

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

    int N; cin >> N;
    cout << (N-2)*180 << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#define MAX 102
int main(){
  int n,m,i,j,A[MAX][MAX+1],k,flag=0;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    for(j=1;j<=n;j++){
      A[i][j]=0;
    }
  }
  for(i=0;i<n;i++){
    scanf("%d %d",&A[i][0],&m);
    for(j=1;j<=m;j++){
      flag = scanf("%d",&k);
      if(flag==1) A[i][k]=1;
      flag=0;
    }
  }
  
  for(i=0;i<n;i++){
    for(j=1;j<=n;j++){
      if(A[i][j]!=0) printf("1");
      else printf("0");
      if(j!=n) printf(" ");
    }
    printf("\n");
  }
}



Measured memory_bytes: 2104
#include <bits/stdc++.h>
#define rep(i,cc,n) for(int i=cc;i<=n;++i)
#define drep(i,cc,n) for(int i=cc;i>=n;--i)
#define sz(s) (int)(s.size())
#define vecprint(v) rep(i,0,v.size()-1)cout << v[i] << " ";cout << endl;
using namespace std;
const int mod=1000000007;
const int INF=1001001001;
typedef long long ll;
typedef pair<int,int> P;

int main(){
    int k,x;
    cin >> k >> x;
    if(500*k >= x)puts("Yes");
    else puts("No");

    // cout << ans << endl;
//  printf("%.10f\n",ans);

    return 0;
}


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

int main() {
  string s;
  cin >> s;
  
  int sum = 0;
  
  if(s[0] == '1'){
    sum++;
  }
  if(s[1] == '1'){
    sum++;
  }
  if(s[2] == '1'){
    sum++;
  }
  cout << sum;
  
  return 0;
}


Measured memory_bytes: 256
#include <cstdio>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
	while(true){
		int n,m;
		scanf("%d%d",&n,&m);
		if(n==0) break;
		int o[11]={};
		rep(i,n){
			int d,p;
			scanf("%d%d",&d,&p);
			o[p]+=d;
		}
		int ans=0;
		for(int i=10;i>=0;i--){
			if(m>o[i]){
				m-=o[i];
				continue;
			}else{
				ans+=i*(o[i]-m);
				for(int j=i-1;j>=0;j--) ans+=j*o[j];
				break;
			}
		}
		printf("%d\n",ans);
	}
	return 0;
}

Measured memory_bytes: 1012
#include <bits/stdc++.h>
using namespace std;
int main(){
	string s;
	cin>>s;
	int x=(int)(s[0]-'0')*10+(int)(s[1]-'0');
	int y=(int)(s[2]-'0')*10+(int)(s[3]-'0');
	if(x<=12 && x>=1 && y<=12 && y>=1)cout<<"AMBIGUOUS";
	else if(x<=12 &&x>=1&& y>=0)cout<<"MMYY";
	else if(x>=0 && y<=12 && y>=1 )cout<<"YYMM";
	else cout<<"NA";

	
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h> 
#define N 2005
#define V 40020
using namespace std;
vector<int>v[V];
int a[N],ans[N],Min[N],comp[V],last_not_coprime[N],n,cnt,tot,best_col[N],ID[N],m;
bool used[N],b[N][N];
map<int,int>pID;
int gcd(int x,int y){return !x?y:gcd(y%x,x);}
int get_id(int x)
{
	if(pID.count(x))return pID[x];
	pID[x]=m++;
	return m-1;
}
void dfs(int from)
{
    comp[from]=cnt;
	for(int i=0;i<v[from].size();i++)
	{
		int to=v[from][i];
		if(comp[to]>-1||(to<n&&used[to]))continue;
		dfs(to);
	}
}
void colors()
{
	cnt=0;memset(comp,-1,sizeof(comp));
	for(int i=0;i<n;i++)
	if(!used[i]&&comp[i]==-1)
	{
		dfs(i);
		cnt++;
	}
}
int main()
{
	ios::sync_with_stdio(0);
	cin>>n;
	m=n;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		int x=a[i];
		for(int y=2;y*y<=x;y++)
		if(!(x%y))
		{
			int id=get_id(y);
			v[i].push_back(id);
			v[id].push_back(i);
			while(!(x%y))x/=y;
		}
		if(x!=1)
		{
			int id=get_id(x);
			v[i].push_back(id);
			v[id].push_back(i);
		}
	}
	for(int i=0;i<n;i++)
	for(int j=0;j<n;j++)
	if(gcd(a[i],a[j])!=1)b[i][j]=b[j][i]=1,
	memset(Min,0x3f,sizeof(Min));
	memset(last_not_coprime,-1,sizeof(last_not_coprime));
	while(1)
	{
		colors();
		memset(best_col,-1,sizeof(best_col));
		for(int i=0;i<n;i++)
		if(Min[last_not_coprime[i]+1]>=a[i]&&!used[i])
		{
			if(best_col[comp[i]]==-1||a[i]<best_col[comp[i]])best_col[comp[i]]=a[i],
			ID[comp[i]]=i;
		}
		int id=-1;
		for(int i=0;i<cnt;i++)
		{
			if(best_col[i]==-1)continue;
			if(id==-1||best_col[id]<best_col[i])id=i;
		}
		id=ID[id];
		ans[tot++]=a[id];
		if(tot==n)
		{
			cout<<ans[0];
			for(int i=1;i<n;i++)
			cout<<' '<<ans[i];
			cout<<endl;
			return 0;
		}
		used[id]=1;
		for(int i=0;i<tot;i++)
		Min[i]=min(Min[i],a[id]);
		for(int i=0;i<n;i++)
		if(b[i][id])last_not_coprime[i]=tot-1;
	}
}

Measured memory_bytes: 5632
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String input = scanner.nextLine();
        String[] array = input.split(" ");

        if(array[0].equals(array[1])) {
            System.out.println("H");
        } else {
            System.out.println("D");
        }
    }
}


Measured memory_bytes: 21844
#include <stdio.h>

int main(void)
{
    char op;
    int a, b;
    scanf("%d %c %d", &a, &op, &b);

    if (op == '+') printf("%d\n", a + b);
    else if (op == '-') printf("%d\n", a - b);
    else printf("fool");

    return (0);
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
#include<iomanip>
#include<numeric>

using namespace std;
using ll = long long;
constexpr int mo = 1e9+7;
constexpr int  mod = mo;
constexpr int inf = 1<<30;
constexpr int mo2 = 998244353;
constexpr ll infl = 1ll<<60;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int h,w,k;
    cin>>h>>w>>k;
    vector<string> cake(h);
    for(int i=0;i<h;++i){
        cin>>cake[i];
    }
    vector<vector<int>> ans(h,vector<int>(w));
    int num = 1;
    for(int i=0;i<h;++i)for(int j=0;j<w;++j)if(cake[i][j] == '#'){
        ans[i][j] = num;
        int left = j,right = j;
        while(left-1>=0 and cake[i][left-1] != '#')ans[i][left-1] = num,left--;
        while(right+1<w and cake[i][right+1] != '#')ans[i][right+1] = num,right++;
        num++;
    }
    vector<int> pre;
    for(int i=0;i<h-1;++i){
        if(ans[i][0] != 0){
            if(ans[i+1][0] == 0) ans[i+1] = ans[i];
        }
    }
    for(int i=h-1;i>0;i--){
        if(ans[i][0] != 0){
            if(ans[i-1][0] == 0 ) ans[i-1] = ans[i];
        }
    }
    for(int i=0;i<h;++i){
        for(int j=0;j<w;++j){
            if(j)cout << " ";
            cout << ans[i][j];
        }
        cout << endl;
    }
    return 0;
}



Measured memory_bytes: 1280
/* Generated by powerful Codeforces Tool
 * You can download the binary file in here https://github.com/xalanq/cf-tool (Windows, macOS, Linux)
 * Author: alireza_kaviani
 * Time: 2020-06-08 13:52:16
**/
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;

#define all(x)                      (x).begin(),(x).end()
#define Sort(x)                     sort(all((x)))
#define X                           first
#define Y                           second
#define sep                         ' '
#define endl                        '\n'
#define SZ(x)                       ll(x.size())

ll poww(ll a, ll b, ll md) {
    return (!b ? 1 : (b & 1 ? a * poww(a * a % md, b / 2, md) % md : poww(a * a % md, b / 2, md) % md));
}

const ll MAXN = 1e6 + 10;
const ll LOG = 22;
const ll INF = 8e18;
const ll MOD = 1e9 + 7; // 998244353; // 1e9 + 9;

ll H , W , n , ans[10];
vector<pll> vec;
map<pll , ll> mark;

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

    cin >> H >> W >> n;
    for(int i = 0 , x , y ; i < n ; i++){
        cin >> x >> y;
        for(int j = 0 ; j < 3 ; j++){
            for(int k = 0 ; k < 3 ; k++){
                int nx = x - j , ny = y - k;
                if(nx <= 0 || ny <= 0 || nx + 2 > H || ny + 2 > W)  continue;
                vec.push_back({nx , ny});
            }
        }
        mark[{x , y}] = 1;
    }
    sort(all(vec));
    vec.resize(unique(all(vec)) - vec.begin());
    for(pll i : vec){
        int x = i.X , y = i.Y , c = 0;
        //cout << x << sep << y << endl;
        for(int j = 0 ; j < 3 ; j++)    for(int k = 0 ; k < 3 ; k++)    c += mark[{x + j , y + k}];
        ans[c]++;
    }
    ans[0] += (H - 2) * (W - 2) - SZ(vec);
    for(int i = 0 ; i < 10 ; i++)   cout << ans[i] << endl;
    
    return 0;
}
/*

*/


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

int main() {
    int a,b,m;
    cin >> a >> b >> m;
    vector<int> ref(a);
    vector<int> ele(b);
    int amin=1001001001,bmin=1001001001;
    rep(i,a) {
        cin >> ref[i];
        amin = min(amin,ref[i]);
    }
    rep(i,b) {
        cin >> ele[i];
        bmin = min(bmin,ele[i]);
    }
    int ans = amin+bmin;
    rep(i,m) {
        int x,y,c;
        cin >> x >> y >> c;
        x--; y--;
        int now = ref[x]+ele[y]-c;
        ans = min(ans,now);
    }
    cout << ans << endl;
}

Measured memory_bytes: 1024
#include <stdlib.h>
#include <cmath>
#include <cstdio>
#include <cstdint>
#include <string>
#include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
using namespace std;
using ll = long long;

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

  set<char> include;
  for(int i=0;i<S.size();i++){
    if(include.count(S.at(i))){
      cout << "no" << endl;
      return 0;
    }
    else{
      include.insert(S.at(i));
    }
  }

  cout << "yes" << endl;

  return 0;
}


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

namespace AtCoder
{
	class Program
	{
		static void Main(string[] args)
		{
			Question.Exec();
		}
	}

	public static class Question
	{
		public static void Exec()
		{
			long ln = long.Parse(Console.ReadLine());

			long answer = 0;
			long[] array = new long[ln + 1];
			array[0] = 2;
			array[1] = 1;
			for (var i = 2; i <= ln; ++i) {
				array[i] = array[i - 1] + array[i - 2];
			}

			answer = array[ln];

			Console.WriteLine($"{answer}");
			

			Console.ReadKey();
		}
	}
}

Measured memory_bytes: 13268
l = [x for x in input()]
s = []
for x in l:
    if x == "0":
        s.append("0")
        
    elif x == "1":
        s.append("1")
    
    elif x == "B":
        try:
            del s[-1]
        except IndexError:
            pass
print("".join(s))

Measured memory_bytes: 3060
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class AtCoderA
{
    static void Main()
    {
        var sc = new Scanner();

        string s = sc.Next();

        int length = s.Length;

        bool zero = true;

        int count = 0;

        for (int i = 0; i < length; i++)
        {
            if ((zero && s[i] == '0') || (!zero && s[i] == '1'))
            {
                count++;
            }
            zero = !zero;
        }

        int answer = Math.Min(count, length - count);

        Console.WriteLine(answer);
    }

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}

Measured memory_bytes: 11616
#include<iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<stack>
#include<queue>
#include<string>
#include<utility>
#include<numeric>
#include<algorithm>
#include<cmath>
#include<climits>
using namespace std;

using ll = long long;

class Stream{
public:
    Stream(){

    }
    //配列以外の入力を受け取る
    void read(){

    }
    template<typename First, typename... Rest>
    void read(First& first, Rest&... rest){
        cin >> first;
        read(rest...);
    }
    //配列を区切って出力する
    template<typename T>
    void write_vec(vector<T>& v, char divider){
        for(size_t i = 0; i < v.size(); i++){
            cout << v[i] << divider;
        }
    }
};

int main(){
    Stream io;
    
    int N;
    io.read(N);
    if(N == 1) {
        cout << "Hello World";
    }
    else {
        int A, B;
        io.read(A, B);
        cout << A + B;
    }
    return 0;
}

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

template<typename T>
ostream& operator<<(ostream &os, vector<T> &v){
	string sep = " ";
	if(v.size()) os << v[0];
	for(int i=1; i<v.size(); i++) os << sep << v[i];
	return os;
}

#ifdef DBG
void debug_(){ cout << endl; }
template<typename T, typename... Args>
void debug_(T&& x, Args&&... xs){
	cout << x << " "; debug_(forward<Args>(xs)...);
}
#define dbg(...) debug_(__VA_ARGS__)
#else
#define dbg(...)
#endif

int main() {
	ios_base::sync_with_stdio(false);
	cout << setprecision(20) << fixed;

	ll a;
	double b;
	cin >> a >> b;
	b*=100;
	ll c = a*(int)round(b);

	cout << c / 100 << endl;

	return 0;
}


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

const int N = 1e5 + 5;

int n, m, a[N];
std ::priority_queue<double> Q;

int main() {
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= n; ++i) {
		scanf("%d", &a[i]);
		Q.push((double)a[i]);
	}
	for (int i = 1; i <= m; ++i) {
		double t = Q.top(); Q.pop();
		t = t / 2.0; Q.push(t);
	}
	long long ans = 0;
	while (!Q.empty()) {
		double t = Q.top(); Q.pop();
		ans += (long long)t;
	}
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 1656
/*
....................../´¯/)
....................,/¯../
.................../..../
............./´¯/'...'/´¯¯`·¸
........../'/.../..../......./¨¯\
........('(...´...´.... ¯~/'...')
.........\.................'...../
..........''...\.......... _.·´
............\..............(
..............\.............\...
*/


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <climits>
#include <iomanip>
#include <unordered_map>
#include <unordered_set>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#define ll long long int
#define ull unsigned long long int
#define pb push_back
#define mp make_pair
#define ye cout<<"YES";
#define no cout<<"NO";
#define ln cout<<"\n";
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define pi 3.14159265358979323846
// cout<<"Case #"<<ts<<": “;
//priority_queue < pair<ll, ll>, vector<pair<ll, ll>>, greater<pair<ll, ll>>> pq;


using namespace std;

ll mod(ll x, ll m) {
	return (x % m + m) % m;
}

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

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	ll t = 1, r, n, a, d, c, b, x, y, sum, cnt, i, j, k, m, l, q, maxx, minn, temp, ans, flag, g, ts;
	ll mod = 1000000007;
	char ch, chh;
	double dans;
	string str, ttr;

	//cin >> t;


	for (ts = 1; ts <= t; ts++)
	{
		flag = 0; sum = 0; cnt = 0; ans = 0; k = 0; maxx = 0; minn = 0; a = 0; b = 0; temp = 0;

		cin >> n >> d;
		//ll arr[n]; for (i = 0; i < n; i++) {cin >> arr[i];}

		for (i = 0; i < n; i++)
		{
			cin >> x >> y;
			temp = (x * x) + (y * y);
			if (temp <= (d * d))
				cnt++;

		}
		cout << cnt;




		ln
	}
	return 0;
}


Measured memory_bytes: 3664
program NOMURA2020A
    implicit none
    integer(8)::i,tlen
    character(200000)::T
    read*,T
    tlen=len_trim(T)

    do i=1,tlen
        if(T(i:i)=="?")then
            T(i:i)="D"
        end if
    end do
    print'(A)',T(1:tlen)
end program NOMURA2020A

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

using E = System.Linq.Enumerable;

public class Program
{
    public static void Main()
    {
        var abc = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
        Array.Sort(abc);
        Console.WriteLine(abc[2] * 10 + abc[1] + abc[0]);
    }
}

Measured memory_bytes: 13396
l = [[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]
n = int(input())
c = 0
for i in range(1,n+1):
    li = len(str(i))
    a = i%10
    b = i//(10**(li-1))
    l[a][b] = l[a][b]+1

for i in range(0,10):
    for j in range(0,10):
        c = c + l[i][j]*l[j][i]
print(c)

Measured memory_bytes: 3064
#include<cstdio>
#include<cstring>

int main()
{
    #ifdef LOCAL
    freopen("date.in", "r", stdin);
    freopen("date.out", "w", stdout);
    #endif
    char s[5];
    fgets(s, 5, stdin);
    int count = 0,i;
    for (i = 0; i < 3;i++)
        if(s[i]=='R')
            break;
    for (i; i < 3;i++)
        if(s[i]=='R')
            count++;
        else
            break;
    printf("%d",count);
    return 0;
}



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

string k;
int d;

int MAX = 1e9+7;

vector<vector<vector<int>> > records;

int dispatch(int number, int mod, bool smaller){

//cout << "*" << number << "(" << mod << ")(" << smaller << ")\n";

    if(number == (int)k.length()){
        if(mod == 0)
            return 1;
        else
            return 0;
    }

    if(records[number][mod][smaller] != -1)
        return records[number][mod][smaller];

    int sum = 0;
    int max_digit = (smaller)?9:(k[number]-'0');
    for(int digit = 0; digit <= max_digit; digit++){
        bool compared = true;
        if(!smaller && (digit == (k[number]-'0')))
            compared = false;
        int new_mod = mod - digit;
        while(new_mod < 0)
            new_mod += d;
//cout << "number=" << number << " digit=" << digit << "compared=" << compared << "\n";
        (sum += dispatch(number+1, (new_mod%d), compared)) %= MAX;
    }

    records[number][mod][smaller] = sum;
//cout << "number=" << number << " mod=" << mod << " smaller=" << smaller << " sum=" << sum << "\n";
    return sum;
}

/*
int dispatch(){
    int size = k.length();

    for(int number = 0; number < size; number++){
        for(mod = 0; mod < d; mod++){
            for(int exceed = 0; exceed < 2; exceed++){

                record[number][mod][exceed] = record[number-1][][]
            }
        }
    }

    return 0;
}
*/

int main(){
    cin >> k >> d;

    records = vector<vector<vector<int>>>(k.length(), vector<vector<int>>(d, vector<int>(2, -1)));
    int result = dispatch(0, 0, false);

    cout << (result+MAX-1)%MAX << "\n"; //exclude 0

    return 0;
}


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

#define all(x) begin(x), end(x)

using i64 = int_fast64_t;
using f64 = double;
using p64 = pair<i64, i64>;

constexpr i64 INF = INT_FAST64_MAX / 2;
constexpr f64 EPS = DBL_EPSILON;

void solve() {
    i64 n;
    cin >> n;
    map<i64, i64> acnt;
    i64 maxa = 0;
    for (i64 i = 0; i < n; i++) {
        i64 a;
        cin >> a;
        acnt[a]++;
        maxa = max(maxa, a);
    }

    set<i64> invalid;
    i64 ans = 0;
    for (auto& [ a, cnt ] : acnt) {
        if (invalid.find(a) != invalid.end()) continue;
        if (cnt == 1) ans++;
        for (i64 i = 1; i * a <= maxa; i++) invalid.insert(i * a);
    }
    cout << ans << endl;
}

int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    solve();
}


Measured memory_bytes: 60016
#include <bits/stdc++.h>
using namespace std;
int main(){
    string s;
    cin>>s;
    if(s.front()=='A'){
        int cnt=0;
        int x=0;
        for(char c:s){
            if(c=='C')cnt++;
            if(c>='A'&&c<='Z')x++;
        }
        if(s[1]!='C'&&s.back()!='C'&&cnt==1&&x==2){
            puts("AC");
            return 0;
        }
    }
    puts("WA");
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <unordered_set>
#include <unordered_map>
#include <sstream>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <numeric>
#include <iterator>
using namespace std;

namespace {

}

int main()
{
	map<char, char> e{ { 'A', 'T' }, { 'T', 'A' }, { 'C', 'G' }, { 'G', 'C' } };

	char b;
	
	cin >> b;

	cout << e[b] << endl;


	return 0;
}


Measured memory_bytes: 3584
program train;
var 
    total : longInt;
    i, count, N, M : integer;
    a : array[1..100] of integer;

begin
    total := 0;
    read(N, M);
    for i := 1 to N do begin
        read(a[i]);
        total := total + a[i];
        end;
    count := 0;
    for i := 1 to N do 
        if a[i] >= total/(4*M)
            then count := count + 1;
    if count >= M
        then writeln('Yes')
        else writeln('No');
end.

Measured memory_bytes: 1356
fun main(args: Array<String>) {
    val n = readInteger()
    println((n + 1) / 2)
}

fun readInteger() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readStringList() = readLine()!!.split(" ")
fun readIntegerList() = readStringList().map(String::toInt)
fun readLongList() = readStringList().map(String::toLong)


Measured memory_bytes: 29988
#include <iostream>
#include <algorithm>
#include <string.h>
#include <math.h>
#include <vector>

using namespace std;

#define pb push_back
#define mp make_pair
#define ll long long
#define ull unsigned ll
#define db double
#define INF 0x3f3f3f3f
#define MOD 1000000007
#define PII pair<int, int>

int n,a;

int main()
{
    scanf("%d",&n);
    int x=0,y=0,z=0;
    for (int i=0;i<n;i++) {
        scanf("%d",&a);
        if (a%4==0) x++;
        else if (a%2==0) y++;
        else z++;
    }
    if (x>=z||(x+1==z&&y==0)) printf("Yes\n");
    else printf("No\n");
}

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

int main(){
    ll T, n;
    cin >> n >> T;
    vector<ll> t(n);
    for(ll i = 0;i < n;i++){
        cin >> t[i];
    }

    ll ans = 0;
    for(ll i = 0;i < n-1;i++){
        if(t[i+1] - t[i] > T){
            ans += T;
        }else{
            ans += (t[i+1] - t[i]);
        }
    }
    ans += T;
    cout << ans << endl;
}

Measured memory_bytes: 1792
r1, c1, r2, c2 = map(int, input().split())

class factorial:
  def __init__(self, n, p=10**9 + 7):
    self.__p  = p
    self.__fac  = [0] * (n+1)
    self.__inv  = [0] * (n+1)
    self.__finv = [0] * (n+1)

    self.__fac[0] = self.__fac[1] = 1
    self.__inv[1] = 1
    self.__finv[0] = self.__finv[1] = 1

    for i in range(2, n+1):
      self.__fac[i] = self.__fac[i-1] * i % p
      self.__inv[i] = p - self.__inv[p%i] * (p // i) % p
      self.__finv[i] = self.__finv[i-1] * self.__inv[i] % p
  
  def fact(self, n):
    return self.__fac[n]
  
  def perm(self, n, k):
    return self.__fac[n] * self.__finv[n-k] % self.__p
  
  def comb(self, n, k):
    return self.perm(n, k) * self.__finv[k] % self.__p

f = factorial(r2+c2+2)
print((f.comb(r2+c2+2, r2+1) + f.comb(r1+c1, r1) - f.comb(r1+c2+1, r1) - f.comb(c1+r2+1, c1)) % (10**9 + 7))

Measured memory_bytes: 85616
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#include <list>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
	int n, m, x;
    cin>>n>>m>>x;
    int c[12], a[12][12];
    for(int i=0; i<n; i++){
        cin>>c[i];
        for(int j=0; j<m; j++) cin>>a[i][j];
    }
    const int INF=1e9+7;
    int ans=INF;
    for(int i=0; i<(1<<n); i++){
        int s[12]={}, t=0;
        for(int j=0; j<n; j++){
            if(!(i&(1<<j))) continue;
            t+=c[j];
            for(int k=0; k<m; k++){
                s[k]+=a[j][k];
            }
        }
        bool dame=0;
        for(int k=0; k<m; k++){
            if(s[k]<x){
                dame=1;
            }
        }
        if(!dame) ans=min(ans, t);
    }
    if(ans==INF) cout<<-1<<endl;
    else cout<<ans<<endl;
	return 0;
}


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

int main()
{
	int n, p[200][3], score[200] = {0}, count[3][101] = {0};

	cin>>n;
	for(int i = 0; i < n; i++){
		for(int j = 0; j < 3; j++){
			cin>>p[i][j];
			count[j][p[i][j]]++;
		}
	}


	for(int i = 0; i < n; i++){
		for(int j = 0; j < 3; j++){
			if(count[j][p[i][j]] == 1) score[i] += p[i][j];
		}
	cout << score[i] << endl;
	}

	return 0;
}

Measured memory_bytes: 1164
import java.util.*;
import java.io.*;

public class Main {
	static int mod = (int) 1e9 + 7;
	static int DX[] = { -1, 0, 1, 0 }, DY[] = { 0, -1, 0, 1 };
	static final int INF = Integer.MAX_VALUE / 3;
	static final long LINF = Long.MAX_VALUE / 3;

	public static void main(String[] args) {
		FastScanner fs = new FastScanner(System.in);
		int n = fs.nextInt();
		int x[] = fs.nextIntArray(n);
		
		long rsum[] = new long[n+1];
		for(int i=0;i<n;i++) {
			rsum[i+1] = plus(rsum[i], div(1,(i+1)));
		}
		
		int d[] = new int[n-1];
		for(int i=0;i<n-1;i++) {
			d[i] = x[i+1] - x[i];
		}
		
		long res = 0;
		for(int i=0;i<n-1;i++) {
			long t = mul(d[i], rsum[i+1]);
			res = plus(res, t);
		}
		
		for(int i=1;i<n;i++) {
			res = mul(res, i);
		}
		System.out.println(res);
		
	}
	
	//MOD culculations
	static long plus(long x, long y) {
		return (x + y) % mod;
	}

	static long sub(long x, long y) {
		return (x - y + mod) % mod;
	}

	static long mul(long x, long y) {
		return (x * y) % mod;
	}

	static long div(long x, long y) {
		return x * modpow(y, mod - 2) % mod;
	}

	static long modpow(long x, long y) {
		if (y == 0)
			return 1;
		if (y % 2 == 1)
			return (x * modpow(x, y - 1)) % mod;
		long root = modpow(x, y / 2);
		return root * root % mod;
	}
	
}

//高速なScanner
class FastScanner {
	private BufferedReader reader = null;
	private StringTokenizer tokenizer = null;

	public FastScanner(InputStream in) {
		reader = new BufferedReader(new InputStreamReader(in));
		tokenizer = null;
	}

	public String next() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}

	public String nextLine() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken("\n");
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}

	public int[] nextIntArray(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	}

	public long[] nextLongArray(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nextLong();
		return a;
	}
}

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

ll mincost(ll arr[],ll n,ll k)
{
if(n==2)
    return abs(arr[2]-arr[1]);
else
    {
        ll dp[n+1];
        dp[1]=0;
        dp[2]=abs(arr[2]-arr[1]);
        
        for(ll i=3;i<=n;i++)
        {
            ll mn=INT_MAX;
        for(ll j=1;j<=k;j++)
            {
                if((i-j)>=1)
                    {
                        dp[i]=min(mn,dp[i-j]+abs(arr[i]-arr[i-j]));
                        mn=dp[i];
                    }
                // dp[i]=min(dp[i-1]+abs(arr[i]-arr[i-1]),dp[i-2]+abs(arr[i]-arr[i-2]));        
            }
        }
        
        return dp[n];
    }    
}


int main() {
	ll n,k;
	cin>>n>>k;
	ll arr[n+1];
	for(ll i=1;i<=n;i++)
	    cin>>arr[i];
    cout<<mincost(arr,n,k);
	return 0;
}

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

using namespace std;

int main()
{
    int N;
    cin >> N;
    vector<int> H;
    int Ans = 0;
    int c = 0;
    int buf;
    for (int i = 0; i < N; i++)
    {
        cin >> buf;
        H.push_back(buf);
        if (i != 0)
        {
            if (H[i - 1] >= H[i])
            {
                c++;
            }
            else
            {
                c = 0;
            }
            if (Ans < c)
            {
                Ans = c;
            }
        }
    }

    cout << Ans << endl;
    return 0;
}

Measured memory_bytes: 892
def resolve():
	N, M, *A = map(int, open(0).read().split())
	vote = sum(A) * (1 / (4*M))
	num = list(filter(lambda x: x >= vote, A))
	num = len(num)
	if num >= M:
		print("Yes")
	else:
		print("No")
resolve()

Measured memory_bytes: 38384
from collections import deque
n, m = map(int, input().split())

g = [[] for i in range(n)]

for i in range(m):
  u, v = map(int, input().split())
  u, v = u-1, v-1
  g[u].append(v)
# print(g)

s, t = map(int, input().split())
s, t = s-1, t-1

visited = [[-1]*3 for j in range(n)]

l = 0
queue = deque([[s, l]])
visited[s][l] = 0
while queue:
  x, l = queue.popleft()
  if [x, l] == [t, 0]:
    print(visited[x][l]//3)
    exit()
  for x_ in g[x]:
    new_x, new_l = x_, (l+1)%3
    if visited[new_x][new_l] == -1:
      visited[new_x][new_l] = visited[x][l]+1
      queue.append([new_x, new_l])
    
print(visited[t][0])

Measured memory_bytes: 38104
#include<cstdio>
#include<cstring>
int max(int x,int y)
{
	return x > y ? x : y;
}
using namespace std;
int main()
{
	int a,b,c;
	scanf("%d %d %d",&a,&b,&c);
	int a1=a*10+b+c;
	int a2=b*10+a+c;
	int a3=c*10+a+b;
	printf("%d",max(a1,max(a2,a3)));
 } 

Measured memory_bytes: 128
#include<iostream>
#include<cmath>
#include<algorithm>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(){
	int n;
	pair<long double,long double> p[4],vec[2];
	cin>>n;
	rep(j,n){
		rep(i,4)cin>>p[i].first>>p[i].second;
		rep(i,2){
			vec[i].first=p[i*2].first-p[i*2+1].first;
			vec[i].second=p[i*2].second-p[i*2+1].second;
		}
		double check=vec[0].first*vec[1].second-vec[0].second*vec[1].first;
		if(abs(check)<1e-10)cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
	return 0;
}

Measured memory_bytes: 1224
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;
using static System.Math;

namespace AtTest.NothingToLearn
{
    class ABC100_B
    {
        static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(OpenStandardOutput()) { AutoFlush = false };
            SetOut(sw);

            Method(args);

            Out.Flush();
        }

        static void Method(string[] args)
        {
            int[] dn = ReadInts();
            int res = (int)Pow(100, dn[0]) * dn[1];
            if (dn[1] == 100)
            {
                res += (int)Pow(100, dn[0]);
            }
            WriteLine(res);
        }

        private static string Read() { return ReadLine(); }
        private static char[] ReadChars() { return Array.ConvertAll(Read().Split(), a => a[0]); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }
    }
}


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

#ifdef LOCAL
#define DEBUG(...) debug(#__VA_ARGS__, __VA_ARGS__);
#else
#define DEBUG(...) 6;
#endif

template<typename T, typename S> ostream& operator << (ostream &os, const pair<T, S> &p) {return os << "(" << p.first << ", " << p.second << ")";}
template<typename C, typename T = decay<decltype(*begin(declval<C>()))>, typename enable_if<!is_same<C, string>::value>::type* = nullptr>
ostream& operator << (ostream &os, const C &c) {bool f = true; os << "["; for (const auto &x : c) {if (!f) os << ", "; f = false; os << x;} return os << "]";}
template<typename T> void debug(string s, T x) {cerr << s << " = " << x << "\n";}
template<typename T, typename... Args> void debug(string s, T x, Args... args) {cerr << s.substr(0, s.find(',')) << " = " << x << " | "; debug(s.substr(s.find(',') + 2), args...);}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

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

    if (a < b)
        cout << string(b, a + '0') << "\n";
    else
        cout << string(a, b + '0') << "\n";

    return 0;
}


Measured memory_bytes: 3612
import math

while True:
    n = int(input())
    if n == 0:
        break
    sn = [int(s) for s in input().split()]
    m = sum(sn) / n
    a2 = 0.0
    for s in sn:
        a2 += pow(s-m, 2)
    print(math.sqrt(a2/n))

Measured memory_bytes: 7780
quicksort :: (Ord a) => [a] -> [a]
quicksort [] = []
quicksort (x:xs) = let smallList = [a | a <- xs, a < x]
                       largeList = [a | a <- xs, a >= x]
                   in quicksort smallList ++ [x] ++ quicksort largeList

stringToInt :: String -> Int
stringToInt = read

main = do
    line <- getLine
    let [a, b, c] = quicksort . map stringToInt $ words line
    putStrLn $ show a ++ " " ++ show b ++ " " ++ show c
    



Measured memory_bytes: 3484
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define erep(i,a,b) for(int i=a;i<=(int)(b);++i)
#define per(i,a,b) for(int i=(a);i>(b);--i)
#define eper(i,a,b) for(int i=(a);i>=b;--i)
#define pb push_back
#define mp make_pair
#define INF (1<<30)-1
#define MOD 1000000007
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef pair<int,int> Pii;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a, b)*b;}

ll N;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
    cin >> N;
    for (ll h = 1; h <= 3500; ++h) {
        for (ll n = 1; n <= 3500; ++n) {
            if (4*n*h-n*N-h*N == 0) continue;
            if (h*N*n % (4*n*h-n*N-h*N) == 0 && h*N*n / (4*n*h-n*N-h*N) > 0) {
                ll w = h*N*n / (4*n*h-n*N-h*N);
                printf("%lld %lld %lld\n", h, n, w);
                return 0;
            }
        }
    }
    return 0;
}

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

int main(void){
    int a,b;
    cin >> a;
    cin >> b;
    int d = a / b;
    int r = a % b;
    double f = double(a) / double(b);
    cout << d;
    cout << " ";
    cout << r;
    cout << " ";
    cout << fixed << setprecision(5) << f;
    cout << endl;
}


Measured memory_bytes: 3288
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define nl '\n'
#define ff first
#define ss second
/* -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- */

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

  int n; cin >> n;
  int a[1+n];
  int index[20]; fill(index, index+20, 0);
  for(int i=1; i<=n; i++) {
    cin >> a[i];
  }

  ll ans = 0;
  int lo = 0;
  for(int i=1; i<=n; i++) {
    for(int j=0; j<20; j++) {
      if( (a[i] >> j) & 1 ) {
	lo = max(lo, index[j]);
	index[j] = i;
      }
    }
    ll len = i - lo;
    // cerr << len << nl;
    ans += len;
  }
  cout << ans << nl;

  return 0;
}

/* -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- */


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fi first
#define se second

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    ll n,m,sum=0;
    cin>>n>>m;
    vector<ll> a(m);
    for(ll i=0;i<m;i++){
        cin>>a[i];
        sum+=a[i];
    }
    if(sum>n) cout<<"-1";
    else cout<<-sum+n;
    return 0;
}

Measured memory_bytes: 3660
import java.util.*;
import java.util.function.*;
import java.math.*;
public class Main {
    public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int N = s.nextInt();
		int[][] a = new int[N][3];
		int[][] b = new int[N][3];
		for(int i = 0; i < N; i++) {
			a[i][0] = s.nextInt();
			a[i][1] = s.nextInt();
			a[i][2] = 1; 
		}
		for(int i = 0; i < N; i++) {
			b[i][0] = s.nextInt();
			b[i][1] = s.nextInt();
			b[i][2] = 1;
		}
		
		Arrays.sort(b, (x, y) -> Integer.compare(x[0], y[0]));
		Arrays.sort(a, (x, y) -> Integer.compare(y[1], x[1]));
		
		// a,b : 0=x, 1=y, 2=使用済みフラグ, 3=内包する点の数
		int ret = 0;
		for(int i = 0; i < N; i++) {
			for(int j = 0; j < N; j++) {
				if(b[i][0] > a[j][0] && b[i][1] > a[j][1] && a[j][2] > 0) {
					b[i][2]--;
					a[j][2]--;
					ret++;
					break;
				}
			}
		}
		System.out.println(ret);
    }
}

Measured memory_bytes: 28372
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_nl = lambda: list(map(int, readline().split()))
in_na = lambda: map(int, read().split())
in_s = lambda: readline().rstrip().decode('utf-8')


def main():
    a, b, x = in_nn()
    ans = b // x
    if a == 0:
        ans += 1
    else:
        ans -= (a - 1) // x
    print(ans)


if __name__ == '__main__':
    main()


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

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define FORR(i, a, b) for (int i = (int)(b)-1; i >= (int)(a); i--)

#define CHMIN(a, b) (a) = min((a), (b))
#define CHMAX(a, b) (a) = max((a), (b))

#define DEBUG(x) cout << #x << ": " << (x) << endl
#define PRINT(x) cout << x << endl
int main() {
  int N;
  cin >> N;
  vi X(N), Y(N);
  vl h(N);
  tuple<int, int, ll> inner;

  FOR(i, 0, N) {
    cin >> X[i] >> Y[i] >> h[i];
    if (h[i] >= 1) inner = make_tuple(X[i], Y[i], h[i]);
  }

  FOR(tmpx, 0, 101) {
    FOR(tmpy, 0, 101) {
      bool ok = true;
      ll H =
          get<2>(inner) + abs(get<0>(inner) - tmpx) + abs(get<1>(inner) - tmpy);
      FOR(i, 0, N) {  //最大10^6
        ll tmph = max(H - abs(X[i] - tmpx) - abs(Y[i] - tmpy), 0LL);
        if (h[i] != tmph) {
          ok = false;
          break;
        }
      }
      if (ok) {
        ll H = get<2>(inner) + abs(get<0>(inner) - tmpx) +
               abs(get<1>(inner) - tmpy);
        cout << tmpx << " " << tmpy << " " << H << endl;
        return 0;
      }
    }
  }
}



Measured memory_bytes: 256
# ABC119D - Lazy Faith
from bisect import bisect_left as bsl, bisect_right as bsr


def main():
    A, B, Q, *STX = map(int, open(0).read().split())
    INF = 1 << 60
    S, T, X = [-INF] + STX[:A] + [INF], [-INF] + STX[A : A + B] + [INF], STX[A + B :]
    ans = []
    for x in X:
        i, j = bsr(S, x), bsr(T, x)
        dist = min(
            min(abs(s - x) + abs(t - s), abs(t - x) + abs(s - t))
            for s in (S[i - 1], S[i])
            for t in (T[j - 1], T[j])
        )
        ans.append(dist)
    print("\n".join(map(str, ans)))


if __name__ == "__main__":
    main()

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

int main(){
    ll n;
    cin>>n;
    ll m = n;
    ll ans =0 ;
    while(m!=0){
        ans += m%10;
        m /= 10;
    }
    if(n%ans==0){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
}

Measured memory_bytes: 256