akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<ctime>
using namespace std;


class Mincir{
private:
    typedef long long lt;
    typedef double dd;
    #define eps 1e-6
    #define sqr(x) ((x)*(x))
    #define MAXN 100007

    int n;
    struct point{dd x,y;}p[MAXN],O;
    dd R;

    dd getd(point a,point b){ return sqrt(sqr(a.x-b.x)+sqr(a.y-b.y));}

    point getO(point p1,point p2,point p3)//三点共圆求圆心
    {
        point res;
        dd a=p2.x-p1.x,b=p2.y-p1.y,c=p3.x-p2.x,d=p3.y-p2.y;
        dd e=sqr(p2.x)+sqr(p2.y)-sqr(p1.x)-sqr(p1.y);
        dd f=sqr(p3.x)+sqr(p3.y)-sqr(p2.x)-sqr(p2.y);
        res.x=(f*b-e*d)/(c*b-a*d)/2.0; 
        res.y=(a*f-e*c)/(a*d-b*c)/2.0;
        return res;
    }

    void mincir()
    {
        O=p[1]; R=0;
        for(int i=1;i<=n;++i)
        if(getd(p[i],O)-R>eps)
        {
            O=p[i]; R=0;
            for(int j=1;j<i;j++)
            if(getd(p[j],O)-R>eps)
            {
                O=(point){(p[i].x+p[j].x)/2.0,(p[i].y+p[j].y)/2.0};
                R=getd(p[i],p[j])/2.0;
                for(int k=1;k<j;++k)
                if(getd(p[k],O)-R>eps)
                {
                    O=getO(p[i],p[j],p[k]);
                    R=getd(p[i],O);
                }
            }
        }
    }
    #undef eps
    #undef sqr
    #undef MAXN
public:
    void solve(int Num,int *x,int *y)
    {
        n=Num;
        for (int i=1;i<=n;++i){
            p[i].x=x[i],p[i].y=y[i];
        }
        random_shuffle(p+1,p+1+n);
        mincir();
        //O为圆心,R为半径
        printf("%.6lf",R);
        return;
    }
};


int n,x[51],y[51];
int main(){
    scanf("%d",&n);
    for (int i=1;i<=n;++i)
        scanf("%d%d",&x[i],&y[i]);
    Mincir s;
    s.solve(n,x,y);
}

Measured memory_bytes: 256
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#if __cplusplus >= 201103L
#include <unordered_map>
#include <unordered_set>
#endif
#include <vector>
#define lson rt << 1, l, mid
#define rson rt << 1 | 1, mid + 1, r
#define LONG_LONG_MAX 9223372036854775807LL
#define pblank putchar(' ')
#define ll LL
#define fastIO ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> P;
int n, m;
ll k;
const int maxn = 2e5 + 10;
template <class T>
inline T read()
{
    int f = 1;
    T ret = 0;
    char ch = getchar();
    while (!isdigit(ch))
    {
        if (ch == '-')
            f = -1;
        ch = getchar();
    }
    while (isdigit(ch))
    {
        ret = (ret << 1) + (ret << 3) + ch - '0';
        ch = getchar();
    }
    ret *= f;
    return ret;
}
template <class T>
inline void write(T n)
{
    if (n < 0)
    {
        putchar('-');
        n = -n;
    }
    if (n >= 10)
    {
        write(n / 10);
    }
    putchar(n % 10 + '0');
}
template <class T>
inline void writeln(const T &n)
{
    write(n);
    puts("");
}
ll a[maxn], f[maxn];
inline int judge(ll x)
{
    ll cnt = 0;
    for (int i = 1; i <= n; i++)
        if (a[i] * f[n - i + 1] > x)
        {
            ll tmp = a[i] * f[n - i + 1] - x;
            cnt += tmp / f[n - i + 1];
            if (tmp % f[n - i + 1])
                ++cnt;
        }
    return cnt <= k;
}
int main(int argc, char const *argv[])
{
#ifndef ONLINE_JUDGE
    //freopen("in.txt", "r", stdin);
    // freopen("out.txt", "w", stdout);
#endif
    n = read<int>();
    k = read<ll>();
    for (int i = 1; i <= n; i++)
        a[i] = read<ll>();
    for (int i = 1; i <= n; i++)
        f[i] = read<ll>();
    sort(a + 1, a + 1 + n);
    sort(f + 1, f + 1 + n);
    ll l = 0, r = 1e12 + 1;
    ll res = 0;
    while (l <= r)
    {
        ll mid = l + r >> 1;
        if (judge(mid))
        {
            res = mid;
            r = mid - 1;
        }
        else
            l = mid + 1;
    }
    writeln(res);
    return 0;
}

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

int main() {
  
  int sx, sy, tx, ty;
  cin >> sx >> sy >> tx >> ty;
  
  for(int i = 0; i < ty-sy; i++) {
    cout << 'U';
  }
  for(int i = 0; i < tx-sx; i++) {
    cout << 'R';
  }
  for(int i = 0; i < ty-sy; i++) {
    cout << 'D';
  }
  for(int i = 0; i < tx-sx+1; i++) {
    cout << 'L';
  }
  for(int i = 0; i < ty-sy+1; i++) {
    cout << 'U';
  }
  for(int i = 0; i < tx-sx+1; i++) {
    cout << 'R';
  }
  cout << 'D' << 'R';
  for(int i = 0; i < ty-sy+1; i++) {
    cout << 'D';
  }
  for(int i = 0; i < tx-sx+1; i++) {
    cout << 'L';
  }
  cout << 'U' << endl;
  
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS // #pragma warning(disable:4996)
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <functional>
#include <sstream>
#include <cmath>
#include <set>
#include <map>
#include <stack>
using namespace std; 

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(a);i>=(b);i--)
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define all(a) a.begin(),a.end()
#define len(x) ((int)(x).size())
#define tmax(a,b,c) max((a),max((b),(c)))
#define tmin(a,b,c) min((a),min((b),(c)))
#define debug(x) cerr << #x << " is " << x << endl;

typedef pair<int, int> Pii;
typedef map<int, int> Mii;
typedef vector<int> Vi;
typedef vector<vector<int> > VVi;
typedef long long ll;
const int inf = 2e9;
const ll ll_inf = 1e17;
const int mod = 1e9 + 7;
const long double eps = 1e-10;
typedef pair<ll, ll> Pll; 

int g[10001][1300];

int main()
{
	int N, M;
	while (cin>>N>>M && (N || M)) {
		fill(g[0], g[10001], 0);
		int r; cin >> r;
		rep(i,0,r) {
			int t,n,m,s;
			cin>>t>>n>>m>>s;
			if (s == 1)
				g[m][t] += 1;
			else
				g[m][t] -= 1;
		}
		rep(i,1,M+1) rep(j,540, 1260) g[i][j+1] += g[i][j];  

		int q; cin >> q;
		rep(i,0,q) {
			int s,e,m;
			cin>>s>>e>>m;
			int cnt = 0;
			rep(j,s,e) if (g[m][j]) cnt++;
			cout << cnt << endl;
		}
	}
	return 0;
}

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

int main() {
    int N, dp[100001];
    cin >> N;
    memset(dp, 0, sizeof(dp));
    for (int i = 1; i <= N; ++i) {
        dp[i] = dp[i - 1] + 1;
        for (int d = 1; d <= i; d *= 6) dp[i] = min(dp[i], dp[i - d] + 1);
        for (int d = 1; d <= i; d *= 9) dp[i] = min(dp[i], dp[i - d] + 1);
    }
    cout << dp[N] << endl;
    
    return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
int a[100005];

int main(void){
    int n;cin>>n;
    rep(i,100005)a[i]=0;
    rep(i,n){
        int t;cin>>t;
        a[t-1]++;
        a[t]++;
        a[t+1]++;
    }
    int maxi=0;
    rep(i,100005)if(maxi<a[i])maxi=a[i];
    cout<<maxi<<endl;
    return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long int LLI;
string check(char s[], char t[], int s_size, int t_size)
{
	int smaller = s_size > t_size ? t_size : s_size;
	for(int i = 0; i < smaller; i++)
		if( s[i] > t[t_size - i - 1] )
			return "No";
		else if( s[i] < t[t_size - 1 - i] )
			return "Yes";
	if( t_size > s_size )
		return "Yes";
	return "No";
}
int main()
{
	string s, t;
	cin >> s >> t;
	char s_arr[ s.size() ], t_arr[ t.size() ];
	
	for(int i = 0; i < s.size(); i++)
		s_arr[i] = s[i];
	sort(s_arr,s_arr+s.size());	
	for(int i = 0; i < t.size(); i++)
		t_arr[i] = t[i];
	sort(t_arr,t_arr+t.size());	
	cout << check(s_arr,t_arr,s.size(),t.size());
}

Measured memory_bytes: 3592
C = [list(map(int,input().split())) for _ in range(3)]
for a1 in range(101):
    for a2 in range(101):
        for a3 in range(101):
            b1 = C[0][0]-a1 == C[1][0]-a2 == C[2][0]-a3
            b2 = C[0][1]-a1 == C[1][1]-a2 == C[2][1]-a3
            b3 = C[0][2]-a1 == C[1][2]-a2 == C[2][2]-a3
            if b1 and b2 and b3:
                print('Yes')
                exit()
print('No')

Measured memory_bytes: 9180
#include<bits/stdc++.h>
using namespace std;
constexpr int64_t mod=1e9+7;

int main()
{
  int n,ans=0;
  string s;
  cin>>n>>s;
  for (int i = 0; i < s.size()-2; ++i)
  {
    if(s[i]=='A'&&s[i+1]=='B'&&s[i+2]=='C') ans++;
  }
  cout<<ans;
}

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

char a[307][307];
int ans[307][307];
int hk[307];

int main(){

   int h,w,k;
   int t = -1;

   cin >> h >> w >> k;
   for(int i = 0;i < h;i++){
        for(int j = 0;j < w;j++){
            cin >> a[i][j];
            if(a[i][j]=='#') hk[i] = 1;
            if(t==-1&&a[i][j]=='#') t = i;
        }
   }
   int x = 1;
   for(int i = t;i < h;i++){
        int cnt = 0;
        if(!hk[i]){
            for(int j = 0;j < w;j++){
                ans[i][j] = ans[i-1][j];
            }
        }
        else{
            for(int j = 0;j < w;j++){
                if(a[i][j]=='#'){
                    cnt++;
                    if(cnt==2){
                        x++;
                        cnt = 1;
                    }
                }
                ans[i][j] = x;
            }
            x++;
        }
   }
   for(int i = 0;i < t;i++){
        for(int j = 0;j < w;j++){
                ans[i][j] = ans[t][j];
        }
   }
   for(int i = 0;i < h;i++){
        for(int j = 0;j < w;j++){
            cout << ans[i][j];
            if(j!=w-1) cout << " ";
            else cout << endl;
        }
   }
}


Measured memory_bytes: 1152
# -*- coding: utf-8 -*-
import math

def dist(x, y):
    s = 0
    for _x, _y in zip(x, y):
        s += (_x - _y) ** 2
    return math.sqrt(s)


n, d = map(int, input().split())
xs = []
for _ in range(n):
    xs.append(list(map(int, input().split())))

cnt = 0
for i in range(n):
    for j in range(i+1, n):
        d = dist(xs[i], xs[j])
        if d == int(d):
            cnt += 1

print(cnt)


Measured memory_bytes: 38384
#include <iostream>

int main()
{
	int a, b, kekka;
	std::cin >> a >> b;
	kekka = a * b;
	if(kekka % 2 == 1)
	{
		std::cout << "Yes";
	}
	else
	{
		std::cout << "No";
	}
}

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

int main(){
  while(true){
    int n;
    cin>>n;
    if(n==0){
      break;
    }
    int x=0;
    int tmp[n];
    for(int i=0;i<n;i++){
      cin>>tmp[i];
      x=x+tmp[i];
    }
    int f=x/n;
    int p=0;
    for(int i=0;i<n;i++){
      if(tmp[i]<=f){
        p++;
      }
    }
    cout<<p<<endl;
  }
}



Measured memory_bytes: 3096
#coding: utf-8
import math
import heapq
import bisect

MOD = 10**9+7

N,M = map(int, input().split())

A = []
for i in range(N):
    a,b = map(int, input().split())
    A.append((-b,a))
A = sorted(A,key=lambda x:(-x[1], -x[0]))
#この時点で、Aは(-報酬,日付)のタプルで、(-報酬)降順→日付降順になっている

H = []
heapq.heapify(H)
ans = 0

for i in range(1,M+1):
    while A and A[-1][1]<=i:
        data = A.pop()
        heapq.heappush(H,data)
    if H:
        ans += -(heapq.heappop(H)[0])

print(ans)

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

#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define all(x) (x).begin(),(x).end()

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; }
typedef long long ll;

const long long INF = 1LL << 60;

int main()
{
    int N, K;
    cin >> N >> K;

    int ans = 1;
    rep(i, N) {
        if (ans * 2 < ans + K) {
            ans *= 2;
        }
        else {
            ans += K;
        }
    }

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


Measured memory_bytes: 256
function main()
  
  (A,B) = map(x -> parse(Int,x), split(readline()))
  
  count = 0
  check = 1
  
  while true
    
    if check >= B
      println(count)
      break
    else
      count += 1
      check += (A-1)
    end
    
  end
  
end

main()

Measured memory_bytes: 110476
import java.util.Scanner;
public class Main {
	//public static int N,K,a=-1;
	public static String ans="",s;

	//public static int a[][]=new int[5][5];

	public static void main(String[]args) {
		Scanner sc=new Scanner(System.in);
		int k=sc.nextInt();
		int s=sc.nextInt();
		int ans=0;
		for(int i=0;i<=k;i++) {
			for(int j=0;j<=k;j++) {
				int z=s-i-j;
				if(0<=z&&z<=k)ans++;
			}
		}
		System.out.println(ans);
	}
}

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

long long int x, l[87];

long long int lucas(long long int n)
{
    switch (n)
    {
    case 0:
        return 2;
    case 1:
        return 1;
    default:
        long long int sum = 0;
        sum = (l[n - 1]) ? l[n - 1] : (l[n - 1] = lucas(n - 1));
        sum += (l[n - 2]) ? l[n - 2] : (l[n - 2] = lucas(n - 2));
        return sum;
    }
}

int main()
{
    l[0] = 2;
    l[1] = 1;
    cin >> x;
    cout << lucas(x) << endl;
    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
using namespace std;
int a[111];
int i,j,b,n;
bool bo=1;
void print(int a[],int k)
{
	for(i=1;i<n;++i)
	  printf("%d ",a[i]);
	printf("%d\n%d\n",a[n],k);
}
void bubble(int a[])
{
	int k=0;
	do
	{
		b=1;//b==1则排序完成 
		for(j=1;j<=n-1;++j)
		{
			if(a[j]>a[j+1])
			{
				int temp=a[j];
				a[j]=a[j+1];
				a[j+1]=temp;
				b=0;
				k++;
			}
		}
		
	}while(!b);
	print(a,k);
}
int main()
{
	scanf("%d",&n);
	for(i=1;i<=n;++i)
	  scanf("%d",&a[i]);
	bubble(a);
	return 0; 
}


Measured memory_bytes: 2728
// INCLUDES
#include <bits/stdc++.h>
#include<assert.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp>
//DEFINES
#define MAX 1000001
#define pii pair<int, int>
#define c1 __builtin_popcount
#define F first
#define S second
#define all(s) begin(s),end(s)
#define MIN3POS(a, b, c) (a) =< (b) ? ((a) =< (c) ? 1 : 3) : ((b) =< (c) ? 2 : 3)
#define MAX3POS(a,b,c) (a) >= (b) ? ((a) >= (c) ? 1 : 3) : ((b) >= (c) ? 2:3)
#define endl '\n'
#define int long long
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define FOR(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define IOS   ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
//NAMESPACES
using namespace __gnu_pbds; 
using namespace std;
vector<string> vec_splitter(string s) {
    s += ',';
    vector<string> res;
    while(!s.empty()) {
        res.push_back(s.substr(0, s.find(',')));
        s = s.substr(s.find(',') + 1);
    }
    return res;
}
void debug_out(
vector<string> __attribute__ ((unused)) args,
__attribute__ ((unused)) int idx, 
__attribute__ ((unused)) int LINE_NUM) { cerr << endl; } 
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
    if(idx > 0) cerr << ", "; else cerr << "Line(" << LINE_NUM << ") ";
    stringstream ss; ss << H;
    cerr << args[idx] << " = " << ss.str();
    debug_out(args, idx + 1, LINE_NUM, T...);
}
#ifdef XOX
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
#else
#define debug(...) 42
#endif
template <typename T> 
ostream& operator<<(ostream& os, const vector<T>& v) 
{ 
    os << "["; 
    for (int i = 0; i < v.size(); ++i) { 
        cout << v[i]; 
        if (i != v.size() - 1) 
            os << ", "; 
    } 
    os << "]"; 
    return os; 
} 
template <typename T> 
ostream& operator<<(ostream& os, const set<T>& v) 
{ 
    os << "["; 
    for (auto it : v) { 
        os << it; 
        if (it != *v.rbegin()) 
            os << ", "; 
    } 
    os << "]"; 
    return os; 
} 
  template <typename T, typename S> 
ostream& operator<<(ostream& os, const map<T, S>& v) 
{ 
    for (auto it : v)  
        cout << it.first << " : " 
           << it.second << "\n"; 
      
    return os; 
} 
template <typename T, typename S> 
ostream& operator<<(ostream& os, const pair<T, S>& v) 
{ 
    os << "("; 
    cout << v.first << ", " 
       << v.second << ")"; 
    return os; 
} 
  
// D

void solve(){
    int n;
    cin>>n;
    vector<int> v(n+1);
    FOR(i,1,n+1) cin>>v[i];
    map<int,int> front;
    int cnt = 0;
    for(int i=1;i<=n;i++) {
        cnt+=front[i-v[i]];
        front[i+v[i]]++;
    }
    cout<<cnt;
}
int32_t main()
{
IOS
int t=1;
// cin>>t;
while(t--) {
    solve();
}

return 0;
}
// Use emplace back in place of pushback
// Use tie function , for object destructuring

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

int com(int a, int b){
    int m = min(a-b, b);
    int ans = 1;
    b = m;
    rep(i, m){
        ans *= a;
        a--;
    }
    rep(i, m){
        ans /= b;
        b--;
    }
    cout << ans << endl;
    return ans;
}

int main(){
    string s;
    cin >> s;
    int k;
    cin >> k;
    int n = s.size();
    ll ans = 0;
    if(n >= 4){
        if(k == 1){
            ans += s.at(0)-'0';
            ans += (n-1)*9;
        }else if(k == 2){
            ans += (s.at(0)-'0'-1)*(n-1)*9;
            ans += (n-1)*(n-2)/2*9*9;
            int l = 1;
            while(s.at(l) == '0'){
                l++;
                if(l == n) break;
            }
            if(l != n){
                ans += (s.at(l)-'0');
                ans += (n-1-l)*9;
            }
        }else{
            ans += (s.at(0)-'0'-1)*(n-1)*(n-2)/2*9*9;
            ans += (n-1)*(n-2)*(n-3)/6*9*9*9;
            int l = 1;
            while(s.at(l) == '0'){
                l++;
                if(l == n-1) break;
            }
            if(l != n-1){
                ans += (s.at(l)-'0'-1)*(n-1-l)*9;
                ans += (n-1-l)*(n-2-l)/2*9*9;
                l++;
            }
            while(s.at(l) == '0'){
                l++;
                if(l == n) break;
            }
            if(l != n){
                ans += (s.at(l)-'0');
                ans += (n-1-l)*9;
            }
        }
    }else{
        int l = 0;
        rep(i, n) l += (s.at(i)-'0')*pow(10, n-1-i);
        rep(i, l){
            int m = i+1;
            int cou = 0;
            while(m != 0){
                if(m%10 != 0) cou++;
                m /= 10;
            }
            if(cou == k) ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

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

typedef long long ll;
const int MOD = 1000000007;
const int INF = 1LL << 30;

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

int bfs(vector<string> v, int x, int y){
  int H = v.size(), W = v[0].size();
  vector<vector<int>> dist(H, vector<int>(W, -1));
  queue<pair<int,int>> que;

  int res = 0;
  que.push({x,y});
  dist[x][y] = 0;
  while(!que.empty()){
    int x = que.front().first;
    int y = que.front().second;
    res = max(res, dist[x][y]);
    que.pop();
    for(int dir = 0; dir < 4; dir++){
      int nx = x + dx[dir], ny = y + dy[dir];
      if(nx < 0 || nx >= H || ny < 0 || ny >= W) continue;
      if(v[nx][ny] == '#') continue;
      if(dist[nx][ny] == -1){
	dist[nx][ny] = dist[x][y] + 1;
	que.push({nx, ny});
      }
    }
  }
  return res;
}

int main(){
  int H,W;
  cin >> H >> W;
  vector<string> v(H);
  for(int i = 0; i < H; i++) cin >> v[i];

  int res = 0;
  for(int x = 0; x < H; x++){
    for(int y = 0; y < W; y++){
      if(v[x][y] == '#') continue;
      res = max(res, bfs(v, x, y));
    }
  }
  cout << res << endl;
}


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

inline int read(){
    int X=0,w=0; char ch=0;
    while(!isdigit(ch)) {w|=ch=='-';ch=getchar();}
    while(isdigit(ch)) X=(X<<3)+(X<<1)+(ch^48),ch=getchar();
    return w?-X:X;
}

inline void write(int x){
     if(x<0) putchar('-'),x=-x;
     if(x>9) write(x/10);
     putchar(x%10+'0');
}

inline void writeln(int x){
     if(x<0) putchar('-'),x=-x;
     if(x>9) write(x/10);
     putchar(x%10+'0');
     puts("");
}

int main(){
    int a,b;
    a=read(),b=read();
    writeln(a*b);
	
	return 0;
}


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

long long abso(long long);
int int_sort(const void *, const void *);

int main()
{
  long long n, a[200000], i, b, ans;

  scanf("%lld", &n);

  for (i = 0; i < n; ++i)
  {
    scanf("%lld", &(a[i]));
  }

  for(i = 0; i < n; ++i)
  {
    a[i] -= i + 1;
  }

  qsort((void *)a, n, sizeof(a[0]), int_sort);

  if (n % 2 == 0)
  {
    b = a[n / 2 - 1];
  }
  else
  {
    b = a[(n + 1) / 2 - 1];
  }

  ans = 0;
  for (i = 0; i < n; ++i)
  {
    ans += abs(a[i] - b);
  }

  printf("%lld\n", ans);

  return 0;
}

long long abso(long long a)
{
  if (a < 0) a = - a;

  return a;
}

int int_sort( const void * a , const void * b )
{
  if (*( long long *)a < *(long long *)b)
  {
    return -1;
  }
  else if (*( long long *)a == *(long long *)b)
  {
    return 0;
  }
  return 1;
}


Measured memory_bytes: 3324
N = int(input())
x,y,h = [],[],[]
for i in range(N):
    i1,i2,i3 = map(int,input().split())
    x.append(i1)
    y.append(i2)
    h.append(i3)
    if i3 != 0:
        tmp = i

for i in range(101):
    for j in range(101):
        H = h[tmp] + abs(i-x[tmp]) + abs(j-y[tmp])
        flg = True
        for n in range(N):
            if h[n] != max(H - abs(i-x[n]) - abs(j-y[n]),0):
                flg = False
                break
        if flg == True:
            print(i,j,H)

Measured memory_bytes: 3064
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int m = 0;
        int[] x = new int[n];
        for (int i = 0 ; i < n ;i++) {
            x[i] = sc.nextInt();
            if (x[i] < 0) {
                m++;
            }
        }
        int[] b = new int[n];
        int[] c = new int[n];
        for (int i = 0 ; i < n ; i++) {
            if (x[i] < 0) {
                b[i] = -2 * x[i];
                c[i] = -1 *x[i];
            } else {
                b[i] = x[i];
                c[i] = 2 * x[i];
            }
        }
        int cost = Integer.MAX_VALUE;
        for (int i = 0 ; i <= n - k ; i++) {
            int e = x[i];
            int f = x[i + k - 1];
            if (e < 0 && f < 0) {
                cost = Math.min(cost, -1 * e);
            } else if (e < 0 && f >= 0) {
                cost = Math.min(cost, Math.min(-2 * e + f, -1 * e + 2 *f));
            } else {
                cost = Math.min(cost, f);
            }
        }
System.out.println(cost);
    }

}


Measured memory_bytes: 50824
#include <bits/stdc++.h>
using namespace std;
#define forn(i, n) for(int i = 0; i < int(n); i++)
#define fore(i, l, r) for(int i = int(l); i < int(r); i++)
#define pb push_back
#define all(x) x.begin(), x.end()
#define sz(a) int((a).size())
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef pair<int, int> pii;
const int mod = 1e9 + 7;
template<class T, class U> inline void add_self(T &a, U b){a += b;if (a >= mod) a -= mod;if (a < 0) a += mod;}
template<class T, class U> inline void min_self(T &x, U y) { if (y < x) x = y; }
template<class T, class U> inline void max_self(T &x, U y) { if (y > x) x = y; }

#define _deb(x) cout<<x;
void _print() {cerr << "]\n";} template <typename T, typename... V>void _print(T t, V... v) {_deb(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
template <class T, class U> void print_m(const map<T,U> &m, int w=3){if(m.empty()){cout<<"Empty"<<endl; return;}for(auto x: m)cout<<"("<<x.first<<": "<<x.second<<"),"<<endl;cout<<endl;}
template<class T, class U>void debp(const pair<T, U> &pr, bool end_line=1){cout<<"{"<<pr.first<<" "<<pr.second<<"}"; cout<<(end_line ? "\n" : ", ");}
template <class T> void print_vp(const T &vp, int sep_line=0){if(vp.empty()){cout<<"Empty"<<endl; return;}if(!sep_line) cout<<"{ ";for(auto x: vp) debp(x,sep_line);if(!sep_line) cout<<"}\n";cout<<endl;}
template <typename T>void print(const T &v, bool show_index = false){int w = 2;if(show_index){for(int i=0; i<sz(v); i++)cout<<setw(w)<<i<<" ";cout<<endl;}for(auto &el: v) cout<<setw(w)<<el<<" ";cout<<endl;}
template <typename T>void print_vv(const T &vv){if(sz(vv)==0) {cout<<"Empty"<<endl; return;} int w = 3;cout<<setw(w)<<" ";for(int j=0; j<sz(*vv.begin()); j++)cout<<setw(w)<<j<<" ";cout<<endl;int i = 0;for(auto &v: vv){cout<<i++<<" {";for(auto &el: v) cout<<setw(w)<<el<<" ";cout<<"},\n";}cout<<endl;}

ll powMod(ll n, ll p) {
    assert(p>=0);
    ll res = 1;
    while (p) {
        if (p & 1) (res *= n) %= mod;
          (n *= n) %= mod;
        p >>= 1;
    }
    return res;
}

int main(){
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int n;
    while(cin>>n){
        ll ans = powMod(10,n) - 2*powMod(9,n) + powMod(8,n);
        ans = (ans%mod+mod)%mod;
        cout<<ans<<"\n";
    }
    return 0;
}

Measured memory_bytes: 3648
#ifndef BZ
#pragma GCC optimize "-O3"
#endif
#include <bits/stdc++.h>

#define FASTIO
#define ALL(v) (v).begin(), (v).end()
#define rep(i, l, r) for (int i = (l); i < (r); ++i)

#ifdef FASTIO
#define scanf abacaba
#define printf abacaba
#endif

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

using namespace std;


/*
ll pw(ll a, ll b) {
	ll ans = 1; while (b) {
		while (!(b & 1)) b >>= 1, a = (a * a) % MOD;
		ans = (ans * a) % MOD, --b;
	} return ans;
}
*/

const ll INF = 1e18;

int n;
ll l, r;

int a[5100];
ll dp[5100];

int main() {
#ifdef FASTIO
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#endif
	cin >> n >> r >> l;
	for (int i = 0; i < n; ++i)
		cin >> a[i];
	dp[0] = 0;
	for (int i = 1; i <= n; ++i)
		dp[i] = INF;
	for (int i = 0; i < n; ++i) {
		ll mn = INF;
		for (int j = 0; j < a[i]; ++j) {
			mn = min(mn, dp[j]);
			dp[j] += r;
		}
		dp[a[i]] = mn;
		for (int j = a[i] + 1; j <= n; ++j)
			dp[j] += l;
	}
	ll ans = INF;
	for (int i = 0; i <= n; ++i)
		ans = min(ans, dp[i]);
	cout << ans << "\n";
	return 0;
}




Measured memory_bytes: 384
import java.util.Scanner;

class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        sc.close();

        if(num >= 400 && num <=599){
            System.out.println(8);
        }
        if(num >= 600 && num <=799){
            System.out.println(7);
        }
        if(num >= 800 && num <=999){
            System.out.println(6);
        }
        if(num >= 1000 && num <=1199){
            System.out.println(5);
        }
        if(num >= 1200 && num <=1399){
            System.out.println(4);
        }
        if(num >= 1400 && num <=1599){
            System.out.println(3);
        }
        if(num >= 1600 && num <=1799){
            System.out.println(2);
        }
        if(num >= 1800 && num <=1999){
            System.out.println(1);
        }        
    }
}

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

int main() {
  string S,T;
  cin>>S>>T;
  bool a=true;
  rep(i,S.size()){
    if(S[i]!=T[i]){
      a=false;
      break;
    }
  }
  if(a){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}

Measured memory_bytes: 3624
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#define EPS (1e-7)
#define INF (1e9)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
#define pii pair<int, int>
#define pll pair<long long, long long>
const double PI = acos(-1);
const ll MOD = 1000000007;
// const ll MOD = 998244353;
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< typename T >
struct edge {
    int src,to;
    T cost;

    edge(int to, T cost) : src(-1), to(to), cost(cost) {}

    edge(int src, int to, T cost) : src(src), to(to), cost(cost) {}

    bool operator<(const edge &e) const {
        return cost < e.cost;
    }
};
 
int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int N,M; cin >> N >> M;
    vector<vector<edge<ll>>> G(N);
    rep(i,M) {
        ll a,b,c; cin >> a >> b >> c;
        a--; b--;
        G[a].emplace_back(b,-c);
    }

    vector<ll> dist(N,1e18);
    dist[0] = 0;
    rep(i,3*N) {
        rep(v,N) {
            for (auto e : G[v]) {
                if (dist[v] != 1e18 && chmin(dist[e.to],dist[v]+e.cost)) {
                    if (i >= N-1) {
                        dist[e.to] = -1e18;
                    }
                }
            }
        }
    }

    if (dist[N-1] == -1e18) cout << "inf" << endl;
    else cout << -dist[N-1] << endl;
}

Measured memory_bytes: 384
#include <iostream>
#include <algorithm>

using namespace std;

unsigned int d[101];

int main()
{
	unsigned int n;
	unsigned int num;
	bool flag = true;
	cin >> n;
	for (unsigned int i = 0; i < n; ++i)
		cin >> d[i];

	while (flag) {
		flag = false;
		for (unsigned int i = n-1; i > 0; --i) {
			if (d[i] < d[i-1]) {
				unsigned int x = d[i-1];
				d[i-1] = d[i];
				d[i] = x;
				++num;
				flag = true;
			}
		}
	}
	for (unsigned int i = 0; i < n - 1; ++i)
		cout << d[i] << " ";
	cout << d[n-1] << "\n" << num << endl;
	return 0;
}



Measured memory_bytes: 3124
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(x) (x).begin(),(x).end()

#include <bits/stdc++.h>
using namespace std;

int selectionSort(vector<int>& A,int N){
  int c=0;
  rep(i,N){
    int minj=i;
    for(int j=i;j<N;j++){
      if(A[j]<A[minj]) minj = j;
    }
    if(minj != i){
      swap(A[i],A[minj]);
      c++;
    }
  }
  return c;
}

int main() {
  int n;
  cin >> n;
  
  vector<int> vec(n);
  rep(i,n) cin >> vec[i];
  
  int ans=selectionSort(vec,n);
  
  for(int i=0;i<n;i++){
    if(i>0) cout <<" ";
    cout<<vec[i];
  }
  cout<<endl;
  cout<<ans<<endl;
      
  return 0;
}


Measured memory_bytes: 3104
//Author : Prakhar Asaiya
#include<bits/stdc++.h>
using namespace std;
#define REP(i,a,b) for(ll i=a;i<b;++i)
#define REPN(i,a,b) for(ll i=a;i<=b;++i)
#define db1(x) cout<<#x<<"="<<x<<'\n'
#define db2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n'
#define db3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<<"="<<z<<'\n'
#define ll long long
const int M=1e9+7;



int main()
{/*
#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#*/
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  
  int k;
  cin>>k;
  string s;
  cin>>s;
  if(s.size()<=k)
  cout<<s<<"\n";
  else
  {
  	string t = s.substr(0,k) + "...";
  	cout<<t<<"\n";
  }


   return 0;
}


Measured memory_bytes: 3612
#include <stdio.h>

int main() {
    int n;
    scanf("%d", &n);

    int d[n], num[101]={0};
    int i;

    for(i=0; i<n; i++) {
        scanf("%d", &d[i]);
        num[d[i]] += 1;
    }

    int count=0;
    for(i=100; i>0; i--) {
        if(num[i]>0) {
            count += 1;
        }
    }

    printf("%d\n", count);

    return 0;

}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int main(){
  int K,A,B,i,cnt=0;
  cin>>K;
  cin>>A>>B;
  for(i=A;i<=B;i++)
  {
    if(i%K==0)
      cnt++;
    else 
      continue;
  }
  if(cnt>=1)
  cout<<"OK";
  else
    cout<<"NG";
  return 0;
}

Measured memory_bytes: 3632
//https://onlinejudge.u-aizu.ac.jp/challenges/sources/JOI/Prelim/0515?year=2007

#include <bits/stdc++.h>

using namespace std;

int main() {
    int h, w, n;

    while (true) {
        cin >> h >> w >> n;
        if (h + w == 0) return 0;

        int sheet[20][20] = {};
        while (n--) {
            int x, y;
            cin >> x >> y;
            sheet[x][y] = 1;//通れないところ
        }

        int dp[20][20] = {};
        dp[1][0] = 1;
        for (int i = 1; i <= h; ++i) {
            for (int j = 1; j <= w; ++j) {
                if (sheet[i][j] == 1) continue;
                dp[i][j] = dp[i - 1][j] + dp[i][j - 1];
            }
        }

        cout << dp[h][w] << endl;
    }
}

/*
 * dfsしようと思ったが，経路数を求めるだけなので断念。
 *
 */


Measured memory_bytes: 3044
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <list>
#include <iterator>
#pragma warning(disable:4996)
 
typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223300000000000000
#define INF 2140000000
#define MOD 1000000007
using namespace std;


int main(int argc, char* argv[])
{
    long n;
    scanf("%ld", &n);

    long odd=(n%2);
    long sum=(odd? n: n+1);

    vector<long> zz(n+1);
    long i;
    for(i=1; i<=n; i++) {
        if(i==n && odd) {
            zz[i]=i;
        }
        else {
            zz[i]=MIN(i, sum-i);
        }
    }

    vector<pair<long, long> > vv;
    long j;
    for(i=1; i<=n; i++) {
        for(j=i+1; j<=n; j++) {
            if(zz[i]!=zz[j]) {
                vv.push_back( make_pair(i, j) );
            }
        }
    }

    printf("%ld\n", vv.size());
    for(i=0; i<vv.size(); i++) {
        printf("%ld %ld\n", vv[i].first, vv[i].second);
    }

    return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <numeric>

using namespace std;

int main(){
   int x,t;
   cin>>x>>t;
   cout<<max(x-t,0)<<endl;

}

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

class Main
{
    public static void main(String args[])throws Exception
    {
        BufferedReader bu=new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb=new StringBuilder();
        long n=Long.parseLong(bu.readLine()),i;
        HashMap<Long,Integer> hm=new HashMap<>();
        for(i=2;i*i<=n;i++)
        if(n%i==0)
        {
            int c=0;
            while(n%i==0)
            {
                c++;
                n/=i;
            }
            hm.put(i,c);
        }
        if(n>=2)
        if(hm.get(n)==null) hm.put(n,1);
        else hm.put(n,hm.get(n)+1);
        long c=0;
        for(long x:hm.keySet())
        {
            int cur=1,tot=hm.get(x);
            while(cur<=tot)
            {
                c++;
                tot-=cur;
                cur++;
            }
        }
        System.out.print(c);
    }
}


Measured memory_bytes: 33080
#include<iostream>
 
using namespace std;
 
int main(){
  static bool cmp[1000000]={true};
  static int npr[1000000];
  for(int i=2;i<1000000;i++){
    if(!cmp[i]){
      for(int j=2;j*i<1000000;j++){
    cmp[i*j]=true;
      }
    }
    npr[i]=npr[i-1]+!cmp[i];
  }
  for(int n;cin>>n;n++){
    cout<<npr[n]<<endl;
  }
  return 0;
}

Measured memory_bytes: 7876
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
/*int recur(vector<vector<char>>& arr,vector<vector<int>>& dp,int i,int j)
{
    if(i==arr.size() || j==arr[0].size())
    return 0;
    if(i==0 and j==0 and arr[i][j]=='#')
    return 0;
    if(dp[i][j]!=1)
    return dp[i][j];
    if(arr[i][j]=='#')
    {
         dp[i][j]=0;
    }
    else
   return  dp[i][j]=recur(arr,dp,i+1,j)+recur(arr,dp,i,j+1);
    
}*/
int main(){
    int h,w;
    cin>>h>>w;
    char arr[h+1][w+1];
    for(int i=1;i<=h;i++)
    {
        for(int j=1;j<=w;j++)
        {
            cin>>arr[i][j];
        }
    }
   vector<vector<int>>dp (h+1,vector<int>(w+1,0));
   dp[h][w]=1;
   for(int i=h;i>=1;i--)
   {
       for(int j=w;j>=1;j--)
       {
           if(i==h && j==w)
           continue;
           if(arr[i][j]=='#')
           dp[i][j]=0;
           else
           dp[i][j]=(((i==h) ? 0:dp[i+1][j])+((j==w) ? 0:dp[i][j+1]))%mod;
       }
   }
   cout<<dp[1][1]<<"\n";
return 0;
}

Measured memory_bytes: 8556
#include <bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define COUT(x) cout<<(x)<<"\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define REP(i, n) for(int i=0;i<n;i++)
#define YES(x) cout<<(x?"YES":"NO")<<"\n"
#define Yes(x) cout<<(x?"Yes":"No")<<"\n"
#define dump(x) cout<<#x<<" = "<<(x)<<"\n"
#define endl "\n"
using G = vector<vector<int>>;
using M = map<int,int>;
using P = pair<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int,vector<int>,greater<int>>;
using V = vector<int>;
using ll = long long;
using edge = struct { int to; int cost; };
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; }
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int main() {
  IOS;
  int n,k; cin >> n >> k;
  vector<int> p(n);
  REP(i,n) cin >> p[i];
  sort(ALL(p));
  int ans = 0;
  REP(i,k) {
    ans += p[i];
  }
  COUT(ans);

  return 0;
}


Measured memory_bytes: 3616
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0;i<(int)(n);i++)
#define rrep(i, n) for(int i=((int)(n));i>0;i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)	
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())
#define REVSORT(c) SORT(c);REVERSE(c)
#define ALL(x) (x).begin(),(x).end()
#define INF 1e9
#define LOOP while(true)
const long long MOD = 10e9 + 7;
typedef long long ll;

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

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

#define rep(i,n) for (int i = 0; i < (n); i++)
#define ru(a,b) (((a)+((b)-1)) / (b))   //切り上げ(a/b)
#define dump(x)  cout << #x << " = " << (x) << endl;
using namespace std;
using ll = long long;
using P = pair<int, int>;

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

	if (a == b && b != c)
		cout << "Yes" << endl;
	else if (a == c && c != b)
		cout << "Yes" << endl;
	else if (c == b && b != a)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;

	return 0;
}

Measured memory_bytes: 256
N=int(input())
A=[int(input()) for i in range(N)]
import bisect
B=[]
C=A[::-1]
for i in C:
  a=bisect.bisect_right(B,i)
  if a==len(B):
    B.append(i)
  else:
    B[a]=i
print(len(B))

Measured memory_bytes: 8604
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        
        while (true) {
            int N = sc.nextInt();
            int M = sc.nextInt();
            if (N == 0 && M == 0) break;
            
            int total1 = 0;
            int total2 = 0;
            int[] arr1 = new int[N];
            int[] arr2 = new int[M];
            
            for(int i = 0; i < N; i++) {
                arr1[i] = sc.nextInt();
                total1 += arr1[i];
            }
            for(int i = 0; i < M; i++) {
                arr2[i] = sc.nextInt();
                total2 += arr2[i];
            }
            
            int ans1 = -999;
            int ans2 = -999;
            boolean foundAnswer = false;
            
            for (int i = 0; i < N; i++) {
                int num1 = arr1[i];
                for (int j = 0; j < M; j++) {
                    int num2 = arr2[j];
                    if (total1 - num1 + num2 == total2 - num2 + num1) {
                        if (!foundAnswer) {
                            ans1 = num1;
                            ans2 = num2;
                        } else {
                            if (ans1 + ans2 > num1 + num2) {
                                ans1 = num1;
                                ans2 = num2;
                            }
                        }
                        foundAnswer = true;
                    }
                }
            }
            
            if (!foundAnswer) {
                System.out.println(-1);
            } else {
                System.out.println(ans1 + " " + ans2);
            }
        }
    }
}




Measured memory_bytes: 29124
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <math.h>
using namespace std;
int main(void){
    int n;
    cin>>n;
    int x=n%1000,y=n/10;
    if(x%111==0||y%111==0){
        cout<<"Yes"<<endl;
        return 0;
    }
    cout<<"No"<<endl;
    return 0;
}


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

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;
using lint=long long;

class mint{
	static const int MOD=1e9+7;
	int x;
public:
	mint():x(0){}
	mint(long long y){ x=y%MOD; if(x<0) x+=MOD; }

	mint& operator+=(const mint& m){ x+=m.x; if(x>=MOD) x-=MOD; return *this; }
	mint& operator-=(const mint& m){ x-=m.x; if(x<   0) x+=MOD; return *this; }
	mint& operator*=(const mint& m){ x=1LL*x*m.x%MOD; return *this; }
	mint& operator/=(const mint& m){ return *this*=inverse(m); }
	mint operator+(const mint& m)const{ return mint(*this)+=m; }
	mint operator-(const mint& m)const{ return mint(*this)-=m; }
	mint operator*(const mint& m)const{ return mint(*this)*=m; }
	mint operator/(const mint& m)const{ return mint(*this)/=m; }

	friend mint inverse(const mint& m){
		int a=m.x,b=MOD,u=1,v=0;
		while(b>0){ int t=a/b; a-=t*b; swap(a,b); u-=t*v; swap(u,v); }
		return u;
	}

	friend istream& operator>>(istream& is,mint& m){ long long t; is>>t; m=mint(t); return is; }
	friend ostream& operator<<(ostream& os,const mint& m){ return os<<m.x; }
	int to_int()const{ return x; }
};

mint pow(mint m,long long k){
	mint res=1;
	for(;k>0;k>>=1,m*=m) if(k&1) res*=m;
	return res;
}

lint n;
map<lint,mint> memo[62];

mint dfs(int i,lint sum){
	if(i==-1) return 1;

	if((sum<<(i+1))+2*((1LL<<(i+1))-1)<=n) return pow(mint(3),i+1);

	if(memo[i].count(sum)>0) return memo[i][sum];

	mint res=0;
	// a_i = 0, b_i = 0
	res+=dfs(i-1,sum*2);
	// a_i = 0, b_i = 1
	if(sum*2+1<=(n>>i)){
		res+=dfs(i-1,sum*2+1);
	}
	// a_i = 1, b_i = 1
	if(sum*2+2<=(n>>i)){
		res+=dfs(i-1,sum*2+2);
	}
	return memo[i][sum]=res;
}

int main(){
	cin>>n;
	cout<<dfs(61,0)<<'\n';
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int lld;
lld ar[100005][3];
lld n,k;
lld dp[100005][3];
lld change(lld x, lld y)
{
    if(x>=n)
        return 0;
    if(y!=-1 && dp[x][y]!=-1)
        return dp[x][y];
    else
    {
        lld a=-1,b=-1,c=-1;
        if(y!=0)
        {
            a=change(x+1,0)+ar[x][0];
        }
        if(y!=1)
            b=change(x+1,1)+ar[x][1];
        if(y!=2)
            c=change(x+1,2)+ar[x][2];

        lld ans=max(a,max(b,c));
        dp[x][y]=ans;
        return ans;
    }
}
int main()
{

    cin>>n;
    lld i,j;
    for(i=0;i<n;i++)
       for(j=0;j<3;j++)
            {
                cin>>ar[i][j];
                dp[i][j]=-1;
                dp[i+1][j]=-1;
            }


    cout<<change(0,-1);
}


Measured memory_bytes: 11136
local DBG = false
local function dbgpr(...)
    if DBG then
        io.write("[dbg]")
        print(...)
    end
end

local MOD = 1000 * 1000 * 1000 + 7
local function product(t)
    local a = 1
    for _,v in pairs(t) do
        a = a * v % MOD
    end
    return a
end


local H, W, K = io.read("n", "n", "n")

local comb_tbl = {}
local function comb(n)
    if comb_tbl[n] then
        return comb_tbl[n]
    end
    if n <= 0 then
        comb_tbl[n] = 1
        dbgpr("comb",n,1)
        return comb_tbl[n]
    end
    if n == 1 then
        comb_tbl[n] = 2
        dbgpr("comb",n,2)
        return comb_tbl[n]
    end
    if n == 2 then
        comb_tbl[n] = 3
        dbgpr("comb",n,3)
        return comb_tbl[n]
    end
    local a = (comb(n-1) + comb(n-2)) % MOD
    comb_tbl[n] = a
    dbgpr("comb",n,a)
    return a
end

local tbl = {}
local function key(h, w, k)
    return tostring(h) .. "*" .. tostring(w) .. "*" .. tostring(k)
end

local function solve(h, w, k)
    local key_hwk = key(h,w,k)
    if tbl[key_hwk] then
        return tbl[key_hwk]
    end
    if w == 1 then
        dbgpr(h,w,k,1)
        tbl[key_hwk] = 1
        return tbl[key_hwk]
    end
    assert(w >= 2)
    if h == 0 then
        if k == 1 then
            tbl[key_hwk] = 1
        else
            tbl[key_hwk] = 0
        end
        dbgpr(h,w,k,tbl[key_hwk])
        return tbl[key_hwk]
    end
    if h < k - 1 then
        tbl[key_hwk] = 0
        dbgpr(h,w,k,tbl[key_hwk])
        return tbl[key_hwk]
    end
    assert(h >= k - 1)
    local from_just, from_left, from_right = 0, 0, 0
    do
        local left_place = k - 2
        local right_place = w - k - 1
        dbgpr(h,w,k,"from_just",solve(h-1, w, k),left_place,right_place)
        from_just = product({solve(h-1, w, k), comb(left_place), comb(right_place)})
    end
    if k > 1 then
        local left_place = k - 3
        local right_place = w - k - 1
        dbgpr(h,w,k,"from_left",solve(h-1, w, k-1),left_place,right_place)
        from_left = product({solve(h-1, w, k-1), comb(left_place), comb(right_place)})
    end
    if k < w then
        local left_place = k - 2
        local right_place = w - k - 2
        dbgpr(h,w,k,"from_right",solve(h-1, w, k+1),left_place,right_place)
        from_right = product({solve(h-1, w, k+1), comb(left_place), comb(right_place)})
    end
    dbgpr(h,w,k,"jlr",from_just,from_left,from_right)
    local ans = (from_just + from_left + from_right) % MOD
    tbl[key_hwk] = ans
    return tbl[key_hwk]
end

print(solve(H,W,K))

Measured memory_bytes: 1008
#include <iostream>
#include <stdio.h>

int main()
{
    using namespace std;

    int a, b, d, r;
    double f;

    cin >> a >> b;

    d = a / b;
    r = a % b;
    f = (double)a / (double)b;

    printf("%d %d %f\n", d, r, f);
}


Measured memory_bytes: 3212
def partition(A, l, r):
    """ partition A[l:r] using q(A[r]) and return q's index
    """
    q = A[r][1]
    sep_i = l # left elements of seq <= q < right ones
    for j in range(l, r):
        if A[j][1] <= q:
            # A[j] is left element
            
            # add A[j] to last of left, and replace first of right to last
            A[sep_i], A[j] = A[j],  A[sep_i]
            sep_i += 1 # update separator
        else:
            # A[j] is right element
            pass

    A[sep_i], A[r] = A[r], A[sep_i]
    
    return sep_i

def quick_sort(A, l, r):
    if l < r:
        q = partition(A, l, r-1)
        quick_sort(A, l, q)
        quick_sort(A, q+1, r)

def is_stable(A, B):
    cA = list(A)
    for x in B:
        i = cA.index(x)
        if i == 0:
            pass
        elif cA[i - 1][1] == x[1]:
            return False
        del cA[i]
    return True

A = []
r = int(input())
for _ in range(r):
    mark, num = input().split()
    A.append([mark, int(num)])

B = list(A)
quick_sort(A, 0, r)

if is_stable(A, B):
    print('Stable')
else:
    print('Not stable')

for x in A:
    print(*x)


Measured memory_bytes: 19112