akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL)
#define endl "\n"
#define pb push_back
#define mod 1000000007
int dx[]={1,-1,0,0};
int dy[]={0,0,1,-1};
int dx8[]={1,-1,0,0,1,1,-1,-1};
int dy8[]={0,0,1,-1,1,-1,1,-1};

ll binexp(ll a, ll b, ll m) {
	a %= m;
	ll res = 1;
	while (b > 0) {
		if (b & 1)
			res = res * a % m;
		a = a * a % m;
		b >>= 1;
	}
	return res;
}
ll modinvfermat(ll a, ll m)
{
	return binexp(a, m - 2, m);
}
void task(bool flag)
{
	if (flag)
		cout << "YES\n";
	else
		cout << "NO\n";
}
ll lcm(ll a, ll b)
{
	return ((1LL * a * b) / (__gcd(a, b)));
}
 
void subset(ll val[],ll sum,ll n){


   bool dp[n+1][sum+1];
   memset(dp,false,sizeof dp);

   for(ll i=0;i<=n;i++){
   	for(ll j=0;j<=sum;j++){
   		if(i==0)dp[i][j]=false;

   		 if(j==0)dp[i][j]=true;

   	}
   }
   for(ll i=1;i<=n;i++){
   	for(ll j=1;j<=sum;j++){
   		if(val[i-1]<=j){
   			dp[i][j]=dp[i-1][j-val[i-1]]||dp[i-1][j];

   		}
   		else
   			dp[i][j]=dp[i-1][j];

   	}
   }
   vector<bool> v;
   ll ans=INT_MAX;

   for(ll i=0;i<=sum/2;i++){
   	if(dp[n][i]==true){
   		//cout<<i<<endl;

   		ans=min(ans,sum-2*i);

   	}
   }
   // ll ans=INT_MAX;
   // for(ll i=0;i<v.size();i++){
   // 	ans=min(ans,sum-2*v[i]);

   // }
cout<<ans<<endl;
return;




}
void solve(){

ll n;
cin>>n;
unordered_map<string,ll>m;

while(n--){
	string s;
	cin>>s;
	m[s]++;


}
cout<<"AC"<<" x "<<m["AC"]<<endl;
cout<<"WA"<<" x "<<m["WA"]<<endl;
cout<<"TLE"<<" x "<<m["TLE"]<<endl;
cout<<"RE"<<" x "<<m["RE"]<<endl;





return;
}




int main()
{  
#ifndef ONLINE_JUDGE
	// for getting input from input.txt
	freopen("input.txt", "r", stdin);
	// for writing output to output.txt
	freopen("output.txt", "w", stdout);
#endif
    fast;
    ll t;
    t=1;
   //cin>>t;
    while(t--){
    	solve();
    }
    
   
  



#ifndef ONLINE_JUDGE
	cout << "\nTime Elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " sec\n";
#endif
return 0;
}

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

typedef long long ll;
const int MOD = 1000000007;

int main(){
  int N;
  cin >> N;
  int cnt = 0;
  int res = 1;
  while(N >= res){
    res *= 2;
    cnt++;
  }
  cout << res / 2 << endl;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(){
	char str[30];
	int i;
	
	scanf("%s",str);
	
	for(i=0;str[i]!='\0';i++);
	
	for(i--;i>=0;i--)
		printf("%c",str[i]);
	
	printf("\n");

	return 0;
}

Measured memory_bytes: 524
import math
n, d = map(int, input().split())
xid = [list(map(int,input().split())) for _ in range(n)]
ans = 0

for i in range(n):
    for j in range(n):
        num = 0
        if i >= j:
            continue
        yi = xid[i]
        zi = xid[j]
        for k in range(d):
            num += (yi[k]-zi[k])**2
        num = math.sqrt(num)
        if num.is_integer():
            ans += 1

print(ans)

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

int main() {
    int a,s;
    while(true){
        cin >> a >> s;
        if(a == 0 && s == 0)break;
        for(int i = 0; i < s;i++){
            cout << "#";
        }
        cout << endl;
        for(int p = 0;p < a - 2;p++){
            for(int k = 0; k < s - 2;k++){
                if(k == 0)cout << "#";
                cout << ".";
                if(k == s - 3)cout << "#";
         
            }
            cout << endl;
        }
        for(int l = 0; l < s;l++){
            cout << "#";
        }
        cout << endl;
        cout << endl;
    }
    
}


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

int main() {
  char input;
  cin >> input;
  
  if(input == 'a' || input == 'i' ||input == 'u' ||input == 'e' ||input == 'o')
    cout << "vowel" << endl;
  else
    cout << "consonant" << endl;
}


Measured memory_bytes: 256
// https://atcoder.jp/contests/ddcc2020-qual/tasks/ddcc2020_qual_a
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) FOR(i, 0, n)
#define REPR(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()
#define DIV(a, b) ((a - 1) / b + 1)

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    vector<int> v(2);
    cin >> v[0] >> v[1];
    int ans = 0;
    if (v[0] == 1 && v[1] == 1) {
        ans += 400000;
    }
    REP(i, 2) {
        if (v[i] == 1) {
            ans += 300000;
        } else if (v[i] == 2) {
            ans += 200000;
        } else if (v[i] == 3) {
            ans += 100000;
        }
    }
    cout << ans << endl;
    return 0;
}


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

int side[7][7], point[201][201][201];


class Dice{
public:
	int top, s[6];
	Dice(int t, int f){
		s[0] = f; // front
		s[1] = 7 - f; // back
		s[2] = side[t][f]; //right
		s[3] = 7 - s[2]; //left
		s[4] = t; //top
		s[5] = 7 - t; //bottom
	}
};

//転がりたい場所にサイコロがいないかの判定
bool judge(int x, int y, int z, int j){
	int p;
	if (z == 0)
		return false;
	switch (j){
	case 0:
		p = point[x][y + 1][z - 1];
		break;
	case 1:
		p = point[x][y - 1][z - 1];
		break;
	case 2:
		p = point[x + 1][y][z - 1];
		break;
	case 3:
		p = point[x - 1][y][z - 1];
		break;
	}
	if (p == 0)
		return true;
	else
		return false;
}

void turn(int x, int y, int z, Dice d){
	while (true){
		if (z > 0 && point[x][y][z - 1] == 0)
			z--;
		else
			break;
	}
	for (int i = 6; i > 3; i--){
		for (int j = 0; j < 4; j++){
			if (i == d.s[j] && judge(x, y, z, j)){
				if (j == 0){
					Dice newd = Dice(d.s[1], d.s[4]);
					turn(x, y + 1, z, newd);
				}
				else if (j == 1){
					Dice newd = Dice(d.s[0], d.s[5]);
					turn(x, y - 1, z, newd);
				}
				else if (j == 2){
					Dice newd = Dice(d.s[3], d.s[0]);
					turn(x + 1, y, z, newd);
				}
				else if (j == 3){
					Dice newd = Dice(d.s[2], d.s[0]);
					turn(x - 1, y, z, newd);
				}
				return;
			}
		}
	}
	point[x][y][z] = d.s[4];
}



int main()
{
	//サイコロの設定
	side[1][2] = 3; side[1][3] = 5; side[1][4] = 2; side[1][5] = 4;
	side[2][3] = 1; side[2][4] = 6; side[2][6] = 3;
	side[3][5] = 1; side[3][6] = 5;
	side[4][5] = 6; side[4][6] = 2;
	side[5][6] = 4;
	for (int i = 1; i < 7; i++){
		for (int j = 1; j < 7; j++){
			if (i > j)
				side[i][j] = 7 - side[j][i];
		}
	}

	//入力
	int n, t, f;
	while (cin >> n, n){
		//初期化
		for (int i = 0; i < 201; i++){
			for (int j = 0; j < 201; j++){
				for (int k = 0; k < 201; k++){
					point[i][j][k] = 0;
				}
			}
		}

		//サイコロころがし
		for (int i = 0; i < n; i++){
			cin >> t >> f;
			Dice d = Dice(t, f);
			turn(100, 100, 200, d);
		}

		//集計
		int ans[7];
		for (int i = 0; i < 7; i++){
			ans[i] = 0;
		}
		for (int i = 0; i < 201; i++){
			for (int j = 0; j < 201; j++){
				for (int k = 200; k > -1; k--){
					if (point[i][j][k]>0){
						ans[point[i][j][k]]++;
						break;
					}
				}
			}
		}
		//出力
		for (int i = 1; i < 6; i++){
			cout << ans[i] << " ";
		}
		cout << ans[6] << endl;
	}
	return 0;
}

Measured memory_bytes: 32884
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <bitset>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <utility>
#include <set>
#include <map>
#include <tuple> 
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <list>
using namespace  std;
using ll = long long;
using P = pair<ll, ll>;
#define REP(i, n) for(long long (i)=0, i_bound = (long long)(n); (i)<i_bound; ++i)
#define FOR(i, a, b) for(long long (i)=(a); (i)<(b); ++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
const long long MOD = static_cast<long long>(1e9) + 7LL;
const long long INF = 1234567891234567890LL;
signed main(){
    string s[3] = {"Sunny", "Cloudy", "Rainy"};
    string t; cin>>t;
    if(t==s[0]){
        cout << s[1] << endl;
    }else if(t==s[1]){
        cout << s[2] << endl;
    }
    else{
        cout << s[0] << endl;
    }
    return 0;
}

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

int main(void){
  int N, d;
  cin >> N >> d;
  int p = 0;
  int ans = 0;
  for(int i = 0; i < N; i++){
    cin >> p;
    ans += max(0, p-d);
  }
  
  if(ans == 0){
    cout << "kusoge" << endl;
  }else{
    cout << ans << endl;
  }

  return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define repr(i,n) for(ll i=(n-1);i>=0;i--)
#define all(x) x.begin(),x.end()
#define br cout << "\n";
using namespace std;
const int INF = 1e9;
const int MOD = 1e9+7;
using Graph = vector<vector<ll>>;
template<class T> inline bool chmin(T &a, T b) { if(a > b){ a = b; return true;} return false;}
template<class T> inline bool chmax(T &a, T b) { if(a < b){ a = b; return true;} return false;}

// 0 false, 1 true 
// string to int : -48
// a to A : -32
// ceil(a)  1.2->2.0
// c++17	g++ -std=c++17 a.cpp

int main() {
    //std::cout << std::fixed << std::setprecision(15);
    ld a, b;
    cin >> a >> b;
    ld x = a * b;
    cout << (ll)floor(x) << endl;

}

Measured memory_bytes: 3748
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    ios::sync_with_stdio(0); cin.tie(0);
    string s, t, u; cin >> s >> t;
    int a, b; cin >> a >> b;
    cin >> u;
    if (u == s) --a;
    else --b;
    cout << a << ' ' << b << '\n';
    return 0;
}

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

using namespace std;

int main() {
  string x = "";
  string cur; cin >> cur;
  for(int i = 0; i < cur.length(); i++) {
    if(cur[i] == 'B') {
      if(!x.empty()) x.pop_back();
    }
    else x += cur[i];
  } cout << x << '\n';
}

Measured memory_bytes: 256
#include <stdio.h>
#pragma GCC optimize ("O3")

inline static int gl(void){
    int x = 0;
    for(;;){
        unsigned int c = getchar_unlocked() - 48;
        if(c < 10){
            x = x*10 + c;
        }else{
            break;
        }
    }
    return x;
}

inline static void pl(unsigned int s){
    char str[9];
    int pos=9;
    if(s==0){
        putchar_unlocked('0');
        return;
    }
    do{
        pos--;
        str[pos]=s%10+48;
        s/=10;
    }while(s!=0);
    for(; pos<9; pos++){
        putchar_unlocked(str[pos]);
    }
}

char a[501];
unsigned short out[1000000];

int main(void){
    const int h=gl(), w=gl();
    int pos=0;
    char haveCoin = 0;
    short old_y, old_x;
    for(int i=1; i<=h; i++){
        for(int j=1; j<=w; j++){
            int t = getchar_unlocked() - 48;
            getchar_unlocked();
            a[j] = t;
        }
        if(i%2==1){
            for(int j=1; j<=w; j++){
                if(haveCoin){
                    out[4*pos+0]=old_y;
                    out[4*pos+1]=old_x;
                    out[4*pos+2]=i;
                    out[4*pos+3]=j;
                    pos++;
                }
                haveCoin ^= a[j]&1;
                old_y = i;
                old_x = j;
            }
        }else{
            for(int j=w; j>0; j--){
                if(haveCoin){
                    out[4*pos+0]=old_y;
                    out[4*pos+1]=old_x;
                    out[4*pos+2]=i;
                    out[4*pos+3]=j;
                    pos++;
                }
                haveCoin ^= a[j]&1;
                old_y = i;
                old_x = j;
            }
        }
    }
    pl(pos); putchar_unlocked('\n');
    for(int i=0; i<pos; i++){
        pl(out[4*i+0]); putchar_unlocked(' ');
        pl(out[4*i+1]); putchar_unlocked(' ');
        pl(out[4*i+2]); putchar_unlocked(' ');
        pl(out[4*i+3]); putchar_unlocked('\n');
    }
    return 0;
}


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

int main()
{
    int n;
    cin >> n;
    vector<int> p(n);
    rep(i, n) cin >> p[i];

    int count = 0;

    for (int i = 0; i < n - 2; i++)
    {
        if ((p[i] > p[i + 1] && p[i + 2] <= p[i + 1]) || (p[i + 2] > p[i + 1] && p[i] <= p[i + 1]))
            ++count;
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 256
DIV = 10**9 + 7
n, k = map(int, input().split())
li = list(map(int, input().split()))
x, y = 0, 0

for i in range(n):
    for j in range(i + 1, n):
        if li[i] > li[j]:
            x += 1

for i in range(n):
    for j in range(n):
        if li[i] > li[j]:
            y += 1

print(((x * k) + (y * ((k * (k - 1) // 2)))) % DIV)

Measured memory_bytes: 3188
#include <stdio.h>
#define MAX_SIZE 101
typedef struct { int seq, o[MAX_SIZE][2]; } dfs_t;

static dfs_t *dfs(int g[MAX_SIZE][MAX_SIZE], int size, int i, dfs_t *dt) {
  int j;

  if (dt->o[i][0] > 0) return dt;

  dt->o[i][0] = dt->seq++;
  for (j = 1; j <= size; ++j) {
    if (g[i][j] == 0) continue;
    if (i != j) dt = dfs(g, size, j, dt);
  }
  if (dt->o[i][1] == 0) dt->o[i][1] = dt->seq++;
  return dt;
}

int main(int argc, char **argv) {
  int n, i, j, k, l, m, g[MAX_SIZE][MAX_SIZE];
  dfs_t dt;

  dt.seq = 1;
  for (i = 0; i < MAX_SIZE; ++i) {
    dt.o[i][0] = dt.o[i][1] = 0;
    for (j = 0; j < MAX_SIZE; ++j) g[i][j] = 0;
  }

  scanf("%d", &n);
  for (i = 0; i < n; ++i) {
    scanf("%d %d", &k, &l);
    for (j = 0; j < l; ++j) {
      scanf("%d", &m);
      ++g[k][m];
    }
  }

  for (i = 1; i <= n; ++i) dfs(g, n, i, &dt);
  for (i = 1; i <= n; ++i) printf("%d %d %d\n", i, dt.o[i][0], dt.o[i][1]);
}


Measured memory_bytes: 2108
s = list(input())
ans=0
for i in range(2**(len(s)-1)):
    ops=[]
    d=i
    for j in range(len(s)-1):
        if d%2==1:
            ops.append('+')
        else:
            ops.append('')
        d//=2
    form=[]
    for i in range(len(ops)):
        form.append(s[i])
        form.append(ops[i])
    form.append(s[-1])
    #print(form)
    ans+=eval(''.join(form))
print(ans)


Measured memory_bytes: 3188
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{

    class Program
    {

        static void Main(string[] args)
        {
            var s = Console.ReadLine().Split(' ');
            var l = int.Parse(s[0]);
            var r = int.Parse(s[1]);

            if (r / 2019 * 2019 >= l || l >= r)
            {
                // 2019を超えるとき
                Console.WriteLine(0);
            }
            else
            {
                // 2019の倍数を通らないとき
                int temp = 2018;
                int savedi = 0;
                int savedj = 0;
                for (int i = l; i <= r; i++)
                {
                    for (int j = i + 1; j <= r; j++)
                    {
                        temp = Math.Min(temp, ((i % 2019) * (j % 2019)) % 2019);
                    }
                }
                Console.WriteLine(temp);
            }
#if DEBUG
            Console.WriteLine("続行するには何かキーを押してください．．．");
            Console.ReadKey();
#endif
        }
    }
}


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

# define C continue;
# define R return

# define D double
# define I insert
# define ll long long
# define ld long double

# define ull unsigned long long
# define ui unsigned int

# define pb push_back
# define pf push_front

# define vi vector < int >
# define vc vector < char >
# define vs vector < string >
# define vb vector < bool >
# define vd vector < D >
# define vll vector < ll >
# define vull vector < ull >
# define vld vector < ld >

# define vvi vector < vector < int > >
# define vvb vector < vector < bool > >
# define vvc vector < vector < char > >
# define vvll vector < vector < ll > >
# define vvd vector < vector < D > >
# define vvld vector < vector < ld > >

# define all(v) (v).begin() , (v).end()
# define allrev(v) (v).rbegin() , (v).rend()
# define allcomp(v) v.begin() , v.end() , comp
# define allrevcomp(v) v.rbegin() , v.rend() , comp

# define pii pair < int , int >
# define pll pair < ll , ll >
# define pld pair < ld , ld >
# define pDD pair < D , D >

# define vpld vector < pld >
# define vpii vector < pii >
# define vpll vector < pll >
# define vpDD vector < pDD >

# define vvpii vector < vector < pii > >
# define F first
# define S second
# define mp make_pair

# define dist(a,b,p,q) sqrt((p-a)*(p-a) + (q-b)*(q-b))

# define pp(n) printf("%.10Lf",n);
# define line cout<<"\n";
# define fast ios_base::sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0);

string vow = "aeiou";

const int dxhorse[] = {-2, -2, -1, -1, 1, 1, 2, 2};
const int dyhorse[] = {1, -1, 2, -2, 2, -2, 1, -1};

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

const ld pie = 3.14159265358979 ;
const ll mod = 1e9 + 7 ;

void solve ( int test_case )
{
    int a , b ; 
    cin >> a >> b ; 
    
    if ( a < b ) swap ( a , b ) ; 
    
    int ans = a ; 
    a -- ; 
    
    ans += max ( a , b ) ; 
    cout << ans ; line
}

int main()
{
    int t = 1;
    // cin >> t;

    for ( int i=0 ; i < t ; i++ ) solve(i);
    return 0;
}


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

using namespace std;

#define int long long
#define INF 1e9
#define LINF 1e18

typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<P, int> Pi;
typedef pair<P, P> PP;

const int MOD = 1e9 + 7;
const int dy[]={0, 0, 1, -1};
const int dx[]={1, -1, 0, 0};

template <class T> void chmin(T& a, const T& b) { a = min(a, b); }
template <class T> void chmax(T& a, const T& b) { a = max(a, b); }

int N, M;
P p[100000];

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

    cin >> N >> M;
    for(int i = 0; i < N; ++i) {
        int A, B;
        cin >> A >> B;
        p[i] = P(A, B);
    } 
    sort(p, p + N);
    int res = 0, itr = 0;
    while(M > 0) {
        res += p[itr].first;
        --p[itr].second; --M;
        if(p[itr].second == 0) ++itr;
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 1792
import sys
import random
import itertools
sys.setrecursionlimit(20000000)
#input = sys.stdin.readline
h, w = map(int,input().split())
a = [[j for j in input()] for i in range(h)]
def osen(x,y):
    global kuro2
    if x >0 and a[x-1][y] == ".":
        kuro2.append([x-1,y])
        a[x-1][y] = "#"
    if x < h-1 and a[x+1][y] == ".":
        kuro2.append([x+1,y])
        a[x+1][y] = "#"       

    if y >0 and a[x][y-1] == ".":
        kuro2.append([x,y-1])
        a[x][y-1] = "#"
    if y < w-1 and a[x][y+1] == ".":
        kuro2.append([x,y+1])
        a[x][y+1] = "#"      



kuro = []
for i in range(h):
    for j in range(w):
        if a[i][j] == "#":
            kuro.append([i,j])
ans = 0
while kuro:
    kuro2 = []
    while kuro:
        x,y = kuro.pop()
        osen(x,y)
    kuro = kuro2
    ans += 1

print(ans-1)

Measured memory_bytes: 180092
#include <stdio.h>
#include <iostream>
#include <string>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <sstream>
#include <fstream>
#include <iomanip>

#define rep(i,a,b) for(long long i=a;i<b;i++)

using namespace std;


int main(void) {

	long long N = 0, D = 0, A = 0, B = 0, C = 0;
	long long x[100] = {};

	string s;

	long long min = 1000000000, max = 0;
	long long dif = 0;


	cin >> N;
	rep(i, 0, N) {
		cin >> x[i];
	}

	rep(i, 0, N) {

		if (x[i] < min)min = x[i];
		if (x[i] > max)max = x[i];

	}

	cout << max - min << endl;

	return 0;

}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
int main() {
	string s;
	cin >> s;
	int ans = 1000;
	for (int i = 0;i < s.size() - 2;i++) {
		ans = min(ans, abs(stoi(s.substr(i, 3)) - 753));
	}
	cout << ans << endl;
	getchar();getchar();
	return 0;
}

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

int main(void)
{
	int a, b, waru = 1, sum, count=0;

	while (cin >> a >> b)
	{
		count = 0;
		sum = a + b;
		while (sum != 0)
		{
			sum /= 10;
			count++;
		}
		cout << count << endl;;
	}
	return 0;
}




Measured memory_bytes: 3092
/**
 *    author:  tourist
 *    created: 11.05.2020 14:09:09       
**/
#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  vector<int> p(n);
  for (int i = 0; i < n; i++) {
    cin >> p[i];
  }
  int cur = 0;
  for (int i = 0; i < k; i++) {
    cur += p[i];
  }
  int mx = cur;
  for (int i = k; i < n; i++) {
    cur += p[i] - p[i - k];
    mx = max(mx, cur);
  }
  cout << fixed << setprecision(1) << (mx + k) * 0.5 << '\n';
  return 0;
}


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

void dfs(int pos, int *A, bool *U, const int N) {
  if (pos == N) {
    for (int i = 0; i < N; ++i) {
      if (i > 0) cout << ' ';
      cout << A[i];
    }
    cout << endl;
  } else {
    for (int i = 0; i < N; ++i) {
      if (U[i]) continue;
      A[pos] = i + 1;
      U[i] = true;
      dfs(pos + 1, A, U, N);
      U[i] = false;
    }
  }
}

int main() {
  int N;
  int A[9];
  bool U[9] = {};
  cin >> N;

  dfs(0, A, U, N);

  return 0;
}



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

#define ALL(v) v.begin(), v.end()
#define V vector
#define P pair
#define ld long double
#define ll long long
#define mod 1000000007
#define IINF INT_MAX
#define INF 1LL << 30


int main() {
    int r; cin >> r;
    cout << 3 * r * r << endl;

    return 0;
}


Measured memory_bytes: 3612
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
#include<stdio.h>
#include<string.h>
#include <bitset>
// #include<assert.h>
#include<random>
using namespace std;
#define int long long

#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
// #define MOD 998244353 
#define MEM_SIZE 10000
#define DEBUG_OUT true
#define ALL(x) (x).begin(), (x).end()

template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return; std::cout << e <<" ";}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){std::cout<< e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class... Ts> void DEBUG(T d, Ts... e){if(DEBUG_OUT == false)return;DEBUG(d);DEBUG(e...);}
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; abort();}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }



void solve(void)
{ 
  int H,W,K; cin>>H; cin>>W;cin>>K;
  vector<vector<char> >  mat (H,vector<char>(W,0));
  int res = 0;
  for (int i = 0; i < H; i++)
  {
    for (int j = 0; j < W; j++)
    {
       cin>>mat[i][j];
    }
  }

    for (int b = 0; b < (1<<H); b++)
    {
        vector<int> bit1;
        for (int i = 0; i < H; i++)
        {
            bit1.push_back((b>>i)&1);
        }
            for (int b2 = 0; b2 < (1<<W); b2++)
            {
                vector<int> bit2;
                for (int i = 0; i < W; i++)
                {
                    bit2.push_back((b2>>i)&1);
                }

                //ここに書く。
                int cnt = 0;
                for (int i = 0; i < H; i++)
                {
                  for (int j = 0; j < W; j++)
                  {
                    if(bit1[i] == 0 && bit2[j] == 0)
                    {
                      if(mat[i][j] == '#')cnt++;
                    }
                  }
                  
                }
                // DEBUG(cnt);
                if(cnt == K) res++;
                
            }
        }
    
  
  cout<<res<<endl;
  
  return;
}
int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(11);
  solve();

  return 0;
}


Measured memory_bytes: 3612
N, D = map(int, input().split())

X = [0] * N
Y = [0] * N

for i in range(N):
    X[i], Y[i] = map(int, input().split())

count = 0

for i in range(N):
    if(D**2 >= X[i]**2 + Y[i]**2):
        count += 1

print(count)


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

int main(void)
{
  char S[10000];
  int N,i,m,k;

  scanf("%d%s",&N,S);
  m=strlen(S);

  for(i=0;i<m;i++){
    k= S[i]-'A';
    k=(k+N)%26;
    printf("%c",'A'+k);
   }

   printf("\n");
 }


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

int N, L;
string S[110];
string ans;

int main() {
    cin >> N >> L;
    for (int i = 0; i < N; i++) cin >> S[i];
    
    sort(S, S + N);
    for (int i = 0; i < N; i++) ans += S[i];
    
    cout << ans << endl;
}


Measured memory_bytes: 256
#![allow(unused_imports)]

use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::iter::once;
#[cfg(debug_assertions)]
include! {"./debug.rs"}

#[cfg(not(debug_assertions))]
macro_rules! debug {
    ($($arg:expr),*) => {};
}

macro_rules! read {
    ([$t:ident] ; $n:expr) =>
        ((0..$n).map(|_| read!([$t])).collect::<Vec<_>>());
    ([$t:ident]) =>
        (rl().split_whitespace().map(|w| read_type!(w, $t)).collect::<Vec<_>>());
    (_, [$t:ident] ; $n:expr) =>
        ((0..$n).map(|_| read!(_, [$t])).collect::<Vec<_>>());
    (_, [$t:ident]) =>
        (rl().split_whitespace().skip(1).map(|w| read_type!(w, $t)).collect::<Vec<_>>());
    ($($t:ident),+ ; $n:expr) =>
        ((0..$n).map(|_| read!($($t),+)).collect::<Vec<_>>());
    ($t:ident) => (read_type!(rl(), $t));
    ($($t:ident),*) => {{
        let buf = rl();
        let mut w = buf.split_whitespace();
        ($(read_type!(w.next().unwrap(), $t)),*)
    }};
}

macro_rules! read_type {
    ($s:expr, chars) => {
        $s.chars().collect::<Vec<char>>()
    };
    ($s:expr, usize1) => {
        read_type!($s, usize) - 1
    };
    ($s:expr, $t:ty) => {
        $s.parse::<$t>().unwrap()
    };
}

fn rl() -> String {
    let mut buf = String::new();
    std::io::stdin().read_line(&mut buf).unwrap();
    buf.trim_right().to_owned()
}

trait IteratorExt: Iterator + Sized {
    fn vec(self) -> Vec<Self::Item> {
        self.collect()
    }
}

impl<T: Iterator> IteratorExt for T {}

////////////////////////////////////////////////////////////////////////////////

fn main() {
    let n = read!(usize);
    let xy = read!(i64, i64; n);

    let mut count = HashMap::new();

    for i in 0..n - 1 {
        for j in i + 1..n {
            let mut diff = (xy[i].0 - xy[j].0, xy[i].1 - xy[j].1);
            if diff.0 < 0 || diff.0 == 0 && diff.1 < 0 {
                diff = (-diff.0, -diff.1);
            }
            let b = match count.get(&diff) {
                Some(&x) => x,
                None => 0,
            };
            count.insert(diff, b + 1);
        }
    }

    debug!(count);

    let ans = if n == 1 {
        1
    } else {
        n - count.iter().map(|(_, &v)| v).max().unwrap()
    };

    println!("{}", ans);
}


Measured memory_bytes: 4352
#include <cstdio>
#include <algorithm>
using namespace std;
int main()
{
    long long a, b, idx;
    for (; ;) {
        scanf("%lld %lld", &a, &b);
        if (a == 0 && b == 0) break;
        if (b > a) swap(a, b);
        idx = 1;
        while (a % b!= 0) {
            long long tmp = b;
            b = a % b;
            a = tmp;
            idx++;
        }
        printf("%lld %lld\n", b, idx);
    }
    return 0;
}



Measured memory_bytes: 2592
N = int(input())
As = list(map(int, input().split()))
A_all = sum(As)//2
ans = [0]*N

a0 = sum(As[1:N:2])
ans[0] = (A_all-a0)
for i in range(1,N):
    ans[i] = As[i-1]-ans[i-1]

ans = [a*2 for a in ans]
print(*ans)

Measured memory_bytes: 15200
import java.util.*;
public  class Main
{
public static void main(String args[])
{
  Scanner sc=new Scanner(System.in);
  int n=Integer.parseInt(sc.nextLine());
  String h[]=sc.nextLine().split(" ");
  int a[]=new int[n+1];
  for(int i=0;i<h.length;i++)
  {
  	a[Integer.parseInt(h[i])]+=1;
  }
  StringBuilder sb=new StringBuilder();
  for(int i=1;i<=n;i++){sb.append(a[i]+"\n");}
System.out.println(sb.toString());
}}

Measured memory_bytes: 71280
#include <stdio.h>

int main(){
  int n;
  scanf("%d",&n);
  n = n%10;
  if(n==2||n==4||n==5||n==7||n==9) puts("hon");
  else if(n==0||n==1||n==6||n==8) puts("pon");
  else puts("bon");
}

Measured memory_bytes: 1664
#include<bits/stdc++.h>				//edit by thidailoc
using namespace std;				//team three wolves
typedef long long ll;
typedef vector<ll> vi;
#define fu(i,a,b)   for(ll i=a;i<b;i++)
#define fd(i,b,a)   for(ll i=b;i>=a;i--)
#define pb(i)	    push_back(i)
#define popb(i)     pop_back(i)
#define sc(a) 	    scanf("%lld",&a);
#define sc2(a,b)    scanf("%lld%lld",&a,&b)
#define pr(a)	    printf("%lld ",a)
#define pr2(a,b)    printf("%lld %lld",a,b)
#define lowb(a,n,x) lower_bound(a,a+n,x) -a
#define lowb2(a,x)	lower_bound(a.begin(),a.end(),x) -a.begin()
#define all(x) 		(x).begin(), (x).end()
#define sz(a) 		(ll)a.size()
#define le			length()						
#define re 			return 	
#define debug(x)    cerr << #x << " = " << x << endl
#define INPUT       freopen("locin.txt", "r", stdin)
#define OUTPUT      freopen("locout.txt", "w", stdout)
double const eps = 1e-6;	//dung trong sai so
ll const Base=1e9+7;
ll arr[1000000],mark[1000000];

ll Solves(){
	//INPUT;
	ll n,k,cnt=0,ans=0,x;
	// PROCESSING IN HERE
	string a,b,c;
	cin>>a>>b>>c;
	if(a[a.le-1]==b[0] and b[b.le-1]==c[0])cout<<"YES";
	else cout<<"NO";
	
	re 0;
}


int main(){
	Solves();
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
const int N = 2e4 + 10;
int n, a[N], b[N], p[N];
int main() {
	scanf("%d", &n);
	for (int i = 1; i <= n; i++)
		scanf("%d", &p[i]);
	for (int i = 1; i <= n; i++)
		a[i] = a[i - 1] + 30000,
		b[n - i + 1] = a[i];
	for (int i = 1; i <= n; i++)
		a[p[i]] += i;
	for (int i = 1; i < n; i++)
		printf("%d ", a[i]);
	printf("%d\n", a[n]);
	for (int i = 1; i < n; i++)
		printf("%d ", b[i]);
	printf("%d\n", b[n]);
	return 0;
}

Measured memory_bytes: 896
import kotlin.math.*
import java.io.BufferedReader
import java.io.InputStreamReader


private var fs = BufferedReader(InputStreamReader(System.`in`))
private fun readLn() = fs.readLine()!! // string line
private fun readStrings() = readLn().split(" ") // list of strings
private fun readLong() = readLn().toLong()
private fun readLongs() = readStrings().map { it.toLong() } // list of ints
private fun readInt() = readLn().toInt() // single int
private fun readInts() = readStrings().map { it.toInt() } // list of ints

fun main() {
    solveAtc()
}
fun solveAtc() {
    var n = readLong()
    var a = readLongs().toLongArray()
    var sum:Long = 1
    if(a.contains(0)){
        println(0)
        return
    }
    for(i in a){
        if(i <= 1000000000000000000/sum){
            sum *= i
        }
        else{
            println(-1)
            return
        }
    }
    println(sum)
}

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

int main(){
	long long n,k;
	cin >> n >> k;
	long long s1=0,s2;
	if(k%2==0) s1=(n+k/2)/k;
	s2=n/k;
	cout << s1*s1*s1 + s2*s2*s2;
}


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

int main(){

  vector<vector<int>> A(3,vector<int>(3));
  for(int i=0;i<3;++i){
    for(int j=0;j<3;++j){
      cin>>A[i][j];
    }
  }
  int N;
  cin>>N;
  set<int> b;
  for(int i=0;i<N;++i){
    int c;
    cin>>c;
    b.insert(c);
  }

  bool frag=false;
  for(int i=0;i<3;++i){
    int cnt=0;
    for(int j=0;j<3;++j){
      if(b.count(A[i][j])) ++cnt;
    }
    if(cnt==3) frag=true;
  }
  for(int i=0;i<3;++i){
    int cnt=0;
    for(int j=0;j<3;++j){
      if(b.count(A[j][i])) ++cnt;
    }
    if(cnt==3) frag=true;
  }
  int cnt=0;
  for(int i=0;i<3;++i){
    if(b.count(A[i][i])) ++cnt;
  }
  if(cnt==3) frag=true;
  cnt=0;
  for(int i=0;i<3;++i){
    if(b.count(A[i][2-i])) ++cnt;
  }
  if(cnt==3) frag=true;

  if(frag) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;

}

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

using namespace std;

int main(void){
    int A, B;
    string s;
    cin >> A >> B >> s;
    for(int i=0;i<A;i++){
        if(!isdigit(s[i])){
            cout << "No" << endl;
            return 0;
        }
    }

    if(s[A] != '-'){
        cout << "No" << endl;
        return 0;
    }

    for(int i=0;i<B;i++){
        if(!isdigit(s[A+1+i])){
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 256
N = int( input())
X = [ list( map( int, input().split())) for _ in range(N)]
for j in range(N):
    if X[j][2] != 0:
        k = j
        break
A = X[j]
for cx in range(101):
    for cy in range(101):
        H = A[2] + abs( A[0] - cx) + abs( A[1] - cy)
        Flag = True
        for i in range(N):
            if max( H - abs(X[i][0]-cx) - abs(X[i][1] - cy), 0) != X[i][2]:
                Flag = False
                break
        if Flag:
            print('{} {} {}'.format(cx, cy, H))
            break
    if Flag:
        break


Measured memory_bytes: 3064
#include<stdio.h>

int main(){
	int a,n;
	int count=0;
	scanf("%d",&a);
	n=a;
	while(a!=0){
		while(n!=1){
			if(n%2==0){
				n/=2;
			}else {
				n*=3;
				n++;
			}
			count++;
		}
		printf("%d\n",count);
		scanf("%d",&a);
		n=a;
		count=0;
	}
	return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <vector>
#include <cassert>
#include <algorithm>
#include <functional>
using ll=long long;
using namespace std;
int main(){
    int n,x;
    cin >> n >> x;
    ll count=1;
    ll reg=0;
    bool a=1;
    for(int i=0;i<n;i++){
        int l;
        cin >> l;
        reg=reg+l;
        if(reg>x){
            a=0;
            break;
        }
        count++;
    }
    if(a){
        cout<< n+1 <<endl;
    }else{
        cout << count << endl;
    }
}

Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10000000)

#const
dxdy=((1,0),(0,1))
#my functions here!
def pin(type=int):
    return map(type,input().rstrip().split())


#your code here!
def resolve():
    N,=pin()
    A=((pin()))
    ans=[0]*N
    for a in A:
        ans[a]+=1
    for v in ans[1:]:
        print(v)
    print(0)

import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """5
1 1 2 2"""
        output = """2
2
0
0
0"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """10
1 1 1 1 1 1 1 1 1"""
        output = """9
0
0
0
0
0
0
0
0
0"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """7
1 2 3 4 5 6"""
        output = """1
1
1
1
1
1
0"""
        self.assertIO(input, output)


if __name__ == "__main__":
    #unittest.main()

    #I wrote my code above!

    resolve()#and submit 2 atcoder!



Measured memory_bytes: 33764
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define sz(s) (int)(s).size()
#define sqr(x) (x) * (x)
#define re(i, n) for (int i = 1; i <= n; i ++)
#define pb push_back
#define finish(x) return cout << x << endl, 0
#define MP make_mair
#define trav(x, a) for(auto& x: a)
#define all(x) (x).begin(),(x).end()
#define pi acis(-1)
#define Sor(x) sort(all(x))
#define Rev(x) reverse(all(x))
#define F first
#define S second
#define I insert
#define N 2222222
#define MOD 1000000007
#define nol(a) memset(a, 0, sizeof(a))
#define minus(a) memset(a, 0xff, sizeof(a))
#define T(a, b, c) make_pair(a, make_pair(b, c))
#define deb(x) cerr << #x << " = " << x << '\n'
#define eb emplace_back
#define vll vector<long long>
#define file freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout)
#define INF 1000000021

using namespace std;
using namespace __gnu_pbds;

typedef long double ld;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
//typedef vector<ll> vll;
typedef tree<pll, null_type, less<pll>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
//const ld pi = 2 * acos(0.0);
template <typename _T>inline void read(_T &f){f = 0; _T fu = 1; char c = getchar();while (c < '0' || c > '9') { if (c == '-') { fu = -1; } c = getchar();}    while (c >= '0' && c <= '9') { f = (f << 3) + (f << 1) + (c & 15); c = getchar();}f *= fu;}
template <typename T>void print(T x){if (x < 0) putchar('-'), x = -x;if (x < 10) putchar(x + 48);else print(x / 10), putchar(x % 10 + 48);}
template <typename T> void print(T x, char t){print(x); putchar(t);}
template <class T> bool umin(T& a, T b) {if(a>b){a = b; return 1;}return 0;}
template <class T> bool umax(T& a, T b) {if(a<b){a=b; return 1;}return 0;}
template <class T, class TT> bool pal(T a, TT n){int k = 0; for(int i =0; i <= n / 2; i ++){if(a[i]!=a[n-i-1]){k=1;break;}}return k?0:1;}
template<class T>void eras(vector<T>& a,T b){a.erase(find(a.begin(),a.end(),b));}
//int yil[13] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

ll powmod(ll a, ll b, ll m = MOD){ll r = 1;while(b>0){if(b&1)r=r*a%m;a=a*a%m;b>>=1;}return r;}
string to_upper(string a)
{
	for (int i = 0; i < (int)a.size(); ++ i) if (a[i] >= 'a' && a[i] <= 'z') a[i] -= 'a' - 'A';
	return a;
}
string to_lower(string a)
{
	for (int i = 0; i < (int)a.size(); ++ i) if (a[i] >= 'A' && a[i] <= 'Z') a[i] += 'a' - 'A';
	return a;
}
map<string, int> mp;
int main()
{
	ios::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
	int q;
	cin >> q;
	while (q --)
	{
		string s;
		cin >> s;
		mp[s] ++;
	}
	string s1 = "AC", s2 = "WA", s3 = "TLE", s4 = "RE";
	cout << s1 << ' ' << "x" << ' ' << mp[s1] << '\n';
	cout << s2 << ' ' << "x" << ' ' << mp[s2] << '\n';
	cout << s3 << ' ' << "x" << ' ' << mp[s3] << '\n';
	cout << s4 << ' ' << "x" << ' ' <<  mp[s4] << '\n';
	





}



Measured memory_bytes: 3664
#include<iostream>
using namespace std;
int d[105];
int r[105];
int a[105][105];
int main(void)
{
    int n,k,cnt=0;
    cin >> n >> k;
    for(int i=1;i<=k;i++)
    {
        cin >> d[i];
        for(int j=1;j<=d[i];j++)
        {
            cin >> a[i][j];
            r[a[i][j]]++;
        }
    }
    for(int i=1;i<=n;i++)
        if(r[i]==0)
            cnt++;
    cout << cnt;
    return 0;
}


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

const int N = 2e5 + 7;

int a[N];

int main() {
	ios_base :: sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int n; cin >> n;
	for(int i = 1; i <= n; i++) {
		cin >> a[i];
	}
	sort(a + 1, a + n + 1, greater <int> ());

	priority_queue <tuple <int, int, int> > pq;

	long long ans = a[1];

	pq.push(make_tuple(min(a[1], a[2]), 1, 2));
	pq.push(make_tuple(min(a[2], a[1]), 2, 1));

	for(int i = 3; i <= n; i++) {
		int k, l, r; tie(k, l, r) = pq.top(); pq.pop();
		ans += k;
		pq.push(make_tuple(min(a[i], a[l]), l, i));
		pq.push(make_tuple(min(a[i], a[r]), i, r));
	}

	cout << ans << endl;
}

Measured memory_bytes: 7132
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <functional>
#include <cassert>
#include <utility>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,n1,n2) for(int i=n1;i<n2;i++)
typedef long long ll;
typedef pair<int,int> Pii;
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;}


int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int a,b,c;
	cin>>a>>b>>c;
	int res=0;
	if(a>=b&&a>=c){
		res=a*10+b+c;
	}else if(b>=a&&b>=c){
		res=b*10+a+c;
	}else{
		res=c*10+b+a;
	}
	cout<<res<<endl;
	return 0;
}




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

using namespace std; 

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
typedef long long LL;
typedef priority_queue<int> PQ_DESC;
typedef priority_queue<int, vector<int>, greater<int>> PQ_ASC;
typedef priority_queue<PII> PQ_DESC_PII;
typedef priority_queue<PII, vector<PII>, greater<PII>> PQ_ASC_PII;

#define ALL(c) (c).begin(),(c).end()
#define PB push_back
#define MP make_pair
#define SORT_ASC(c) sort(ALL(c))
#define SORT_DESC(c) sort(ALL(c), greater<typeof(*((c).begin()))>())
#define SIZE(a) int((a).size())

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

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int LARGE_INT = 1e9+100;
const int INF = 2e9+100;
const LL INF_LL = (LL)INF * 300 * 300;
const int MOD = 1e9+7;

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

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

LL modinv(LL a) {
    LL b = MOD, u = 1, v = 0;
    while (b) {
        LL t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= MOD;
    if (u < 0) u += MOD;
    return u;
}

LL moddev(LL a, LL b){
	return a * modinv(b) % MOD;
}

void Main()
{
    int n;cin>>n;
    VI p(n);
    REP(i, n) cin >> p[i];

    int m = LARGE_INT;
    int result = 0;
    REP(i,n){
        if(p[i] <= m){
            result++;
        }
        m = min(m,p[i]);
    }

    cout << result << endl;
    

	return;
}

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

Measured memory_bytes: 1024
#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;
ll ans=0,n,k,dp[105][10005],i,j,u,num;
const ll mod=1e9+7;
ll pow(ll a,ll b)
{
	ll ans=1;
	while(b)
	{
		if(b&1)ans=ans*a%mod;
		a=a*a%mod;
		b>>=1;
	}
	return ans;
}
ll M(ll x){return x>=mod?x-mod:x;}
int main()
{
	scanf("%lld%lld",&n,&k);
	ans=n*(1LL+k)*k/2LL*pow(k+1LL,n-1LL)%mod;
	dp[n+1][0]=1;
	for(i=n;i>0;i--)
	{
		for(j=0;j<=(n-i)*k;j++)
		{
			for(u=0;u<=k;u++)
			{
				if(u>i||i-u>j)num=0;
				else num=1+(j-(i-u))/i;
				dp[i][j+num]=M(dp[i][j+num]+dp[i+1][j]);
			}
		}
	}
	//printf("%lld\n",ans);
	//for(i=1;i<=n;i++)for(j=0;j<=n;j++)printf("%lld %lld %lld\n",i,j,dp[i][j]);
	for(i=1;i<=n*k;i++)ans=M(ans-dp[1][i]*i%mod+mod);
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 8192
function main(input) {
    "use strict";
    let args = input.split(" ").map(value => +value);
    const a = args[0];
    const b = args[1];
    const c = args[2];

    const noPoisons = a + b;

    const maxC = noPoisons > c - 1 ? c : noPoisons + 1;

    console.log(maxC + b);
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

using namespace std;

int main()
{

 int n,k;
  cin>>n>>k;
  vector<int> a(n);
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  for(int i=0;i<n-k;i++){
    if(a[i]<a[k+i])
      cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
  }

    return 0;
}


Measured memory_bytes: 4036
#include <bits/stdc++.h>
#define rep(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define repr(i, n, m) for (int i = (int)(n) - 1; i >= (int)(m); i--)
using namespace std;
using ll = int64_t;
const int MOD = 1000000007; // 10^9+7

int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    rep(i, 0, N)
    {
        // **ASCENDING ORDER** from n to m (m is **EXCLUDED**)
        cin >> A[i];
    }

    bool app = true;
    rep(i, 0, N)
    {
        if (A[i] % 2 == 0)
        {
            if (A[i] % 3 == 0 || A[i] % 5 == 0)
            {
                continue;
            }
            else
            {
                app = false;
                break;
            }
            
        }
    }

    cout << (app ? "APPROVED" : "DENIED") << endl;
}


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


void solve(long long N, std::vector<long long> A, long long Q, std::vector<long long> B, std::vector<long long> C){
  map<long long, long long> nums;
  long long acc = 0;
  for(long long i = 0; i < N; i++) {
    nums[A[i]]++;
    acc += A[i];
  }

  for(long long i = 0; i < Q; i++) {
    if(nums[B[i]] > 0) {
      cout << ((acc - B[i] * nums[B[i]]) + C[i] * nums[B[i]]) << endl;
      acc = ((acc - B[i] * nums[B[i]]) + C[i] * nums[B[i]]);
      nums[C[i]] += nums[B[i]];
      nums[B[i]] = 0;
    }
    else {
      cout << acc << endl;
    }
  }
}

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long N;
  scanf("%lld",&N);
  std::vector<long long> A(N);
  for(int i = 0 ; i < N ; i++){
    scanf("%lld",&A[i]);
  }
  long long Q;
  scanf("%lld",&Q);
  std::vector<long long> B(Q);
  std::vector<long long> C(Q);
  for(int i = 0 ; i < Q ; i++){
    scanf("%lld",&B[i]);
    scanf("%lld",&C[i]);
  }
    solve(N, std::move(A), Q, std::move(B), std::move(C));
    return 0;
}


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

using namespace std;

#define LL long long
#define FAST() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

LL cnt[100005];

int main()
{
    FAST();
    int i,n,q;
    LL x,y,z,ans=0;
    cin >> n;
    for(i=0;i<n;i++)
    {
        cin >> x;
        ans+=x,++cnt[x];
    }
    cin >> q;
    while(q--)
    {
        cin >> x >> y;
        z=cnt[x];
        ans+=(y-x)*z;
        cnt[x]=0,cnt[y]+=z;
        cout << ans << '\n';
    }
    return 0;
}


Measured memory_bytes: 4404
#include <bits/stdc++.h>
#define forn(i, n) for (int i = 0; i<(int)n; ++i)
#define rfor(i, n) for (int i = n-1; i>=0; --i)
#define rmod(x, y) (((x%y)+y)%y)
using namespace std;
typedef vector<int>::iterator vit;
typedef unsigned int uint;
typedef unsigned short ushort;
typedef long long ll;
const int MAXN = 1024;

//OPERATORS


//GLOBALS


//FUNCTIONS


int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n; cin >> n;
	vector<int> dp(3,0);
	for(int i = 0; i <  n; i++){
		vector<int> c(3);
		vector<int> dpl(3,0);
		cin >> c[0] >> c[1] >> c[2];
		for(int i = 0; i < 3; i++){
			for(int j= 0; j < 3; j++){
				if(j != i){
					dpl[j] = max(dpl[j],dp[i]+c[j]);
				}
			}
		}
		dp = dpl;
	}
	cout << max(dp[0],max(dp[1],dp[2]) )<< endl;


	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;



#define SIZE 100005

int N,M;
int min_dist[SIZE];
vector<int> ANS;
char buf[SIZE];




int main(){

	scanf("%d %d",&N,&M);
	scanf("%s",buf);

	vector<int> V;

	for(int i = 0; i <= N; i++){
		if(buf[i] == '0'){

			V.push_back(i);
		}
	}

	stack<int> S;

	S.push(N);

	int left,right,mid;
	int pre = V.size()-1,next;

	while(pre > 0){

		left = 0,right = pre-1,mid = (left+right)/2;
		next = -1;

		while(left <= right){

			if(V[pre]-V[mid] <= M){

				next = mid;
				right = mid-1; //より左へ
			}else{

				left = mid+1;
			}
			mid = (left+right)/2;
		}
		if(next == -1){

			printf("-1\n");
			return 0;
		}
		S.push(V[next]);
		pre = next;
	}

	int loc = S.top();
	S.pop();
	printf("%d",S.top()-loc);
	loc = S.top();
	S.pop();

	while(!S.empty()){

		printf(" %d",S.top()-loc);
		loc = S.top();
		S.pop();

		if(S.empty())break;
	}

	return 0;
}


Measured memory_bytes: 1400