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

#define F(i,a,b) for(long long  i =a; i<b; i++)
#define rF(i,a,b) for(long long i=a-1; i>=b;i--)
#define endl "\n"
#define min1(x,y,z) min(x, min(y,z))
#define max1(x,y,z) max(x, max(y,z))
#define input_vector(v,n,type) vector<type> v;for(int i=0;i<n;i++){type x;cin>>x;v.push_back(x);}
#define IOS ios_base::sync_with_stdio(false);  cin.tie(NULL);  cout.tie(NULL);
#define int long long
#define inf (1LL<<61)
typedef pair<int,int> ii;
typedef vector<pair<int,int>> vii;
typedef vector<int> vi;



int32_t main()
{
      IOS;

      int n, p;
      cin>>n>>p;

      string s;
      cin>>s;

      int ans = 0;
      if (p == 2 || p == 5) {
            for (int i = 0; i < n; i++) {
                  if ((s[i]-'0')%p == 0) 
                        ans += i+1;
            }
      } else {
            map<int, int> mp;
            mp[0] = 1;
            int t = 0, pw = 1;
            for (int i = n-1; i >= 0; i--) {
                  t = (t+(s[i]-'0')*pw)%p;
                  ans += mp[t];
                  mp[t]++;
                  pw = (pw*10)%p;
            }
      }

      cout<<ans<<endl;

            
            



            



      


        
























            return 0;
}

Measured memory_bytes: 1044
//Jai Bhole Ki
#include <bits/stdc++.h>
using namespace std;
#define fast static int fastline = []() { std::ios::sync_with_stdio(false); cin.tie(NULL); return 0; }();
#define ll long long
#define LL unsigned ll
#define pb push_back
#define pi pair<ll,ll>
#define debug(x) cout<<x<<"\n";
#define debug cout<<"debugged\n";
#define minval -2e9
#define maxval 2e9
long double PI =3.14159265358979323846;
 
const ll M=1e9+7;
const ll inf=1e18;
const ll ms=2e5+5;
fast;
bool com(pi &a,pi&b)
{
       return a.first-a.second>b.first-b.second;
}

void solve()
{
    ll a,b,c;cin>>a>>b>>c;
    ll x=min(b-1,c);
    cout<<(a*x/b)-a*(x/b);
}
int main()
{
 // freopen("input.txt","r",stdin);
//  freopen("output.txt","w",stdout);
    //int t;cin>>t;while(t--)
    {
        solve();
    }
    return 0;
}


Measured memory_bytes: 3564
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
using namespace std;
int a[105];
long long op[105];
int main(){
    long long mina=1e18;
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    sort(a,a+n);
    int l=a[0],r=a[n-1];
    for(int i=1;i<=100;i++){
        for(int j=0;j<n;j++){
            op[i]+=((a[j]-i)*(a[j]-i));
        }
        mina=min(mina,op[i]);
    }
    cout<<mina<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#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 fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
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; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     @hamayanhamayan
　　　　／　　　＼　 　  |　|
　　　 /　　 /￣￣￣￣/　　|
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿
　 　　　＼/＿＿＿＿/　（u　⊃
---------------------------------------------------------------------------------------------------*/














int N, A[301010];
int B[301010], C[301010];
//---------------------------------------------------------------------------------------------------
void _main() {
	cin >> N;
	rep(i, 0, N) cin >> A[i];

	map<int, int> cnt;
	rep(i, 0, N) cnt[A[i]]++;

	fore(p, cnt) B[p.second] += p.second;
	fore(p, cnt) C[p.second]++;

	rrep(i, 301000, 0) B[i] += B[i + 1];
	rrep(i, 301000, 0) C[i] += C[i + 1];

	rep(k, 1, N + 1) {
		int ans = 0;

		rep(cand, 1, N / k + 1) {
			int rest = N - (B[cand] - C[cand] * cand);
			if (cand * k <= rest) chmax(ans, cand);
		}
		
		printf("%d\n", ans);
	}
}







Measured memory_bytes: 17920
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include<bitset>

using namespace std;
#define loop(i,n) for(int i = 0; i < (n); ++i)
#define loops(i,f,n) for(int i = (f); i < (n); ++i)
#define INF 9999999
#define in(a) cin>>a
#define out(a) cout<<a<<endl

int main()
{
	string s;
	cin >> s;
	if((s[0] == s[1] and s[1] == s[2]) or (s[1] == s[2] and s[2] == s[3]))
        cout << "Yes\n";
    else
        cout << "No\n";
	return 0;
}

Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());

        int[] a = scanIntArray(scanner);

        int swapCount = 0;
        for (int i = 0; i < a.length; i++) {
            for (int j = n -1; j > i; j--) {
                if (a[j-1] > a[j]) {
                    swap(a, j-1, j);
                    swapCount++;
                }
            }
        }

        printIntArray(a, " ");
        System.out.println(swapCount);

    }

    private static int min(int x, int y) {
        return x < y ? x : y;
    }

    private static int max(int x, int y) {
        return x < y ? y : x;
    }

    private static void printIntArray(int[] array, String delimeter) {
        System.out.println(Arrays.stream(array)
                .mapToObj(String::valueOf)
                .collect(Collectors.joining(delimeter)));
    }

    private static int[] scanIntArray(Scanner scanner) {
        return Arrays.stream(scanner.nextLine().split(" ", 0))
                .mapToInt(Integer::parseInt)
                .toArray();
    }

    private static void swap(int[] a, int x, int y) {
        int tmp = a[x];
        a[x] = a[y];
        a[y] = tmp;
    }
}



Measured memory_bytes: 32572
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define vl vector<ll>
#define pl pair<ll,ll>
#define TC int t;cin>>t;while(t--)
#define in(n) ll n;cin>>n;
#define inarr(n) ll n;cin>>n;vector<ll>arr;
int main(void){
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    in(n);
    while(n>1000){
        n-=1000;
    }
    cout<<1000-n<<endl;
    return 0;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define DRI(X) int (X); scanf("%d", &X)
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define DRIII(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define RS(X) scanf("%s", (X))
#define CASET int ___T, case_n = 1; scanf("%d ", &___T); while (___T-- > 0)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define PII pair<int,int>
#define VI vector<int>
#define VPII vector<pair<int,int> >
#define PLL pair<long long,long long>
#define VPLL vector<pair<long long,long long> >
#define F first
#define S second
typedef long long LL;
using namespace std;
const int MOD = 1e9+7;
const int SIZE = 1e6+10;

int main(){
    DRI(n);
    int now=1;
    LL an=0;
    REP(i,n){
        DRI(x);
        if(!i){
            an+=x-1;
        }
        else{
            if(x==now+1)now++;
            else{
                an+=(x-1)/(now+1);
            }
        }
    }
    cout<<an<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main() {
    int n,m;
    int like[31] = {0};
    int ans = 0;
    cin >> n >> m;
    for (int i = 0; i < n; ++i) {
        int su = 0;
        cin >> su;
        for (int j = 0; j <su ; ++j) {
            int q = 0;
            cin >> q;
            like[q]++;
        }
    }

    for (int k = 0; k < m+1; ++k) {
        if(like[k] == n){
            ans++;
        }
    }

    cout << ans;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main() {
	int n;cin >> n;
	bool ans = 0;
	if (n % 4 == 0)ans = 1;
	for (int i = n;i > 0;) {
		if (i % 7 == 0) {
			ans = 1;
			break;
		}
		i -= 4;
	}
	if (ans)cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <climits>
#include <iomanip>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
int main(){
  string s;
  ll k;
  cin >> s >> k;
  int i = 0;
  int res = 0;
  res = 1;
  while(1){
    if(s[i] != '1'){
      res = s[i] - '0';
      break;
    }
    i++;
  }
  if(k < i + 1)cout << 1 << endl;
  else cout << res << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

using namespace std;
using boost::multiprecision::cpp_int;

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

#define deg_to_rad(deg) (((deg)/360)*2*PI)

const ll LINF = LLONG_MAX;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;

const ld PI = (acos(-1));
const ld EPS = 0.0000000001;
// cout << fixed << setprecision(10) << middle << endl;

int main() {
    // input, ready
    char c;
    cin >> c;
  
    // output
    if ((int)c<=(int)'Z') cout << "A" << endl;
    else cout << "a" << endl;

    return 0;
}


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

//関数
//main関数
int main() {
    
    
    
    //入力
    long N,Q;
    string S;
    cin>>N>>Q>>S;
    vector<long> l(Q);
    vector<long> r(Q);
    for(int i=0;i<Q;i++){
        cin>>l.at(i)>>r.at(i);
    }
    
    
    
    //計算
    vector<long> sum(N);
    bool waitingC=(S.at(0)=='A');
    for(int i=1;i<N;i++){
        sum.at(i)=sum.at(i-1);
        if(S.at(i)=='C' &&waitingC) sum.at(i)++;
        waitingC=(S.at(i)=='A');
    }
    
    //出力
    for(int i=0;i<Q;i++){
        cout<<sum.at(r.at(i)-1)-sum.at(l.at(i)-1)<<endl;
    }
}

Measured memory_bytes: 3456
MOD = int(1e9) + 7
N,K = map(int,input().split())
A = list(map(int, input().split()))
ans = 0
inv = pow(2,MOD-2,MOD)
for i in range(N):
    cnt = 0
    for j in range(N):
        if A[i] > A[j]:
            cnt += 1
    ans += (cnt * K * (K-1) * inv) % MOD
    for j in range(i,N):
        if A[i] > A[j]:
            ans += K
            ans %= MOD
    ans %= MOD
print(ans)


Measured memory_bytes: 42076
#include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
#include<algorithm> 
#include <iomanip>
#include <math.h>
#include <cctype>
//小文字を大文字 c-0x20;


#define db double
#define vi vector<int>
#define pb push_back
#define fi first
#define se second
#define ll long long
#define ld long double
#define maxn 5005
#define mod 998244353
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vll vector<ll>
#define vpi vector<pii>
#define vpll vector<pll>
#define vv(z,a,b) vector<vector<int>>z(a,vector<int>(b))
#define vvll(z,a,b) vector<vector<ll>>z(a,vector<ll>(b))
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(c) begin(c),end(c)
#define fix(k) fixed<<setprecision(k)
using namespace std;


int main(){
  db x1,x2,y1,y2;
  cin>>x1>>y1>>x2>>y2;
  db a=abs(x1-x2);
   db b=abs(y1-y2);
db h=a*a+b*b;
h=sqrt(h);
cout<<fix(5)<<h<<endl; 
  
}


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

using namespace std;

int main(){
  int a,b;
  cin>>a>>b;
  
  if(a!=1 && b!=1){
    cout<<"1";
  }
  else if(a!=2 && b!=2){
    cout<<"2";
  }
  else if(a!=3 && b!=3){
    cout<<"3";
  }
  
  
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<bool> vb;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define INT(str) stoi((str), 0)
#define INTB(str) stoi((str), 0, 2) // 2進数の文字列を int に
//cout << fixed << setprecision(15);

int main() {
  int x;
  cin >> x;
  cout << (x == 0 ? 1 : 0) << endl;
}


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

typedef long long ll;
typedef pair<int, int> P;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;

#ifdef LOCAL
#include "../lib/dump.hpp"
#else
#define dump(...)
#define dumpv(...)
#endif

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  // freopen("temp.1", "r", stdin);
  int N;
  cin >> N;
  for (int n = N; n <= 999; n++) {
    int n100 = n / 100;
    int n010 = (n % 100) / 10;
    int n001 = (n % 10);
    if (n100 == 0 && n010 == n001) {
      int ans = 0;
      ans += (n100 * 100) + (n010 * 10) + n001;
      cout << ans << endl;
      break;
    }
    if (n100 == n010 && n010 == n001) {
      int ans = 0;
      ans += (n100 * 100) + (n010 * 10) + n001;
      cout << ans << endl;
      break;
    }
  }
  return 0;
}

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


int main(){
	/*input*/
	int n, m, c;
	cin >> n >> m >> c;
	int b[20];
	int a[20][20];
	for(int i = 0; i < m; i++) cin >> b[i];
	for(int i = 0; i < n; i++) {
		for(int j = 0; j < m; j++) {
			cin >> a[i][j];
		}
	}

	/*calc*/
    int ans = 0;
    for(int i = 0; i < n; i++){
    	int sum  = 0;
		for(int j = 0; j < m; j++) {
    		sum += a[i][j] * b[j];
    		if(j == m-1) sum += c;
    	}
   		if(sum > 0) ans++;
    }

    /*output*/
	cout<< ans <<endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<cmath>
#include<iomanip>
#include<map>
#include<cstring>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using P = pair<int, int>;
const int INF = 1e9;
const ll LLINF = 1LL<<60;
/* -- template -- */

ll d[100000];
vector<vector<pair<int, ll>>> G;
bool visited[100000];
void dfs(int K){
    visited[K] = true;
    for(pair<int, ll> a : G[K]){
        if(!visited[a.first]){
            d[a.first] = d[K] + a.second;
            dfs(a.first);
        }
    }
}
int main(){
    int N; cin >> N;
    G.resize(N);
    rep(i, N - 1){
        int a, b;ll c;cin >> a >> b >> c;--a;--b;
        G[a].push_back(make_pair(b, c));
        G[b].push_back(make_pair(a, c));
    }
    int Q, K; cin >> Q >> K;--K;
    d[K] = 0;
    dfs(K);

    ll ans[Q];
    rep(i, Q){
        int x, y; cin >> x >> y;
        --x;--y;
        ans[i] = d[x] + d[y];
    }
    rep(i, Q)cout << ans[i] << endl;
}


Measured memory_bytes: 12800
/**********************************
	author:  mariogzsl
**********************************/

#include <bits/stdc++.h>

#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,b,a) for(int i=b-1;i>=a;i--)
#define f first
#define s second
#define puts(x) cout<<x<<endl
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	vector<int>v(5,-1);
	FOR(i,0,5){
		cin>>v[i];
	}
	int k;
	cin>>k;
	bool ans=true;
	FOR(i,0,5)
	FOR(j,0,5){
		if(i!=j and abs(v[i]-v[j])>k){
			ans=false;
			break;
		}
	}
	if(ans){
		cout<<"Yay!"<<endl;
	}else{
		cout<<":("<<endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

void fibonacci(int);
int F[44];
int main(){
  int n;
  

  scanf("%d",&n);

  fibonacci(n);

  printf("%d\n",F[n]);

  return 0;
}

void fibonacci(int n){
  int i;
  F[0] = 1;
  F[1] = 1;
  for(i=2;i<=n;i++){
    F[i] = F[i-2]+F[i-1];
  }
}



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

typedef struct node {
	struct node *left;
	struct node *right;
	struct node *parent;
	int key;
} node_t;

struct node *root = NULL;

int n;

void constructTree(int);
struct node* newNode(int);
void insert(struct node*);

int found(int);

void printInorder(struct node*);
void printPreorder(struct node*);

int main()
{
	int i, insertCount = 0;
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		char cmd[10];
		scanf("%s", cmd);
		if (cmd[0] == 'i') {
			int newKey;
			scanf("%d", &newKey);
			(insertCount == 0) ? constructTree(newKey) : insert(newNode(newKey));
			insertCount++;
		}
		else if (cmd[0] == 'f') {
			int findKey;
			scanf("%d", &findKey);
			(found(findKey)) ? printf("yes\n") : printf("no\n");
		}
		else {
			printInorder(root);
			printf("\n");
			printPreorder(root);
			printf("\n");
		}
	}
	return 0;
}

void constructTree(int insertValue) {
	root = newNode(insertValue);
}

struct node* newNode(int insertValue) {
	struct node *newNode = (struct node*) malloc(sizeof(struct node));
	newNode->left = NULL;
	newNode->right = NULL;
	newNode->parent = NULL;
	newNode->key = insertValue;

	return(newNode);
}

void insert(struct node *newNode) {
	struct node *y = (struct node*) malloc(sizeof(struct node));
	struct node *x = root;

	while (x != NULL) {
		y = x;
		if (newNode->key < x->key) {
			x = x->left;
		}
		else {
			x = x->right;
		}
	}
	newNode->parent = y;

	if (y == NULL) {
		root = newNode;
	}
	else if (newNode->key < y->key) {
		y->left = newNode;
	}
	else {
		y->right = newNode;
	}
}

int found(int targetKey) {
	struct node* current = (struct node *)malloc(sizeof(struct node));
	current = root;
	while (targetKey != current->key) {
		if (targetKey < current->key) {
			current = current->left;
		}
		else {
			current = current->right;
		}

		if (current == NULL) return 0;
	}
	return 1;
}
void printInorder(struct node *x) {
	if (x != NULL) {
		printInorder(x->left);
		printf(" %d", x->key);
		printInorder(x->right);
	}
}

void printPreorder(struct node *x) {
	if (x != NULL) {
		printf(" %d", x->key);
		printPreorder(x->left);
		printPreorder(x->right);
	}
}



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

using namespace std;

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

    vector<int> swing;
    vector<int> lost;
    vector<int> max_(2,0);
    for(int i=0; i< N; i++){
        int a,b;
        cin >> a >> b;
        if (a > max_[0] || (a==max_[0] && b<max_[1])){
            swing.push_back(max_[0]);
            lost.push_back(max_[1]);
            max_={a,b};
        }else{
            swing.push_back(a);
            lost.push_back(b);
        }
    }
    sort(swing.rbegin(), swing.rend());
    sort(lost.rbegin(), lost.rend());

    int ans = 0;
    for(int i=0; i<N; i++){
        if (lost[i]>max_[0]){
            H-=lost[i];
            ans+=1;
        }else{
            ans+=(H-max_[1])/max_[0]+((H-max_[1])%max_[0]>0)+1;
            break;
        }
        
        if(H<=0){
            break;
        }
    }
    cout << ans << '\n';
}

Measured memory_bytes: 1276
s = input()

flag = 0

for i in range(len(s)):
  if i % 2 == 0 and s[i] == "L":
    flag = 1
  elif i % 2 != 0 and s[i] == "R":
    flag = 1
if flag == 0:
  print("Yes")
else:
  print("No")

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

namespace ITP1
{
    class ITP1_4_A
    {
        static void Main(string[] args)
        {
            int a, b;
            int d, r;
            decimal f;

            List<int> dataSet = Console.ReadLine().Split().Select(int.Parse).ToList();

            a = dataSet[0];
            b = dataSet[1];

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

            Console.WriteLine($"{d} {r} {f}");
            Console.ReadLine();
        }
    }
}



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

int main(){
  long a,b,x;
  cin >> a >> b >> x;
  if (a%x==0){
    cout << b/x-a/x+1 << endl;
  }
  else{
    cout << b/x-a/x << endl;
  }
}

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


int main()
{
  int n;
  cin >> n;
  printf("%.6lf\n", (n + 1) / 2 / (double)n);
  return 0;
}

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

class Procon
{
    public Procon() { }
    static void Main(string[] agrs)
    {
        new Procon().Do();
    }

    Scanner cin;

    public void Do()
    {
        cin = new Scanner();
        int X = cin.nextInt();
        int A = cin.nextInt();

        if (X < A)
        {
            Console.WriteLine(0);
            return;
        }
        Console.WriteLine(10);
    }
}

class Scanner
{
    string[] s;
    int i;
    int max_i;

    public Scanner()
    {
        s = new string[0];
        max_i = 0;
        i = 0;
    }

    public string nextString()
    {
        if (i >= s.Length)
        {
            s = Console.ReadLine().Split(' ');
            max_i = s.Length;
            i = 0;
            if (max_i == 0)
            {
                return "";
            }
            return s[i++];
        }
        else
        {
            return s[i++];
        }
    }

    public int nextInt()
    {
        return int.Parse(nextString());
    }


    public long nextLong()
    {
        return long.Parse(nextString());
    }

    public double nextDouble()
    {
        return double.Parse(nextString());
    }

    public string[] arrayString()
    {
        return Console.ReadLine().Split(' ');
    }

    public int[] arrayInt()
    {
        string[] str = Console.ReadLine().Split(' ');
        int[] array = new int[str.Length];
        for (int i = 0; i < str.Length; i++)
        {
            array[i] = int.Parse(str[i]);
        }
        return array;
    }

    public long[] arrayLong()
    {
        string[] str = Console.ReadLine().Split(' ');
        long[] array = new long[str.Length];
        for (int i = 0; i < str.Length; i++)
        {
            array[i] = long.Parse(str[i]);
        }
        return array;
    }

    public double[] arrayDouble()
    {
        string[] str = Console.ReadLine().Split(' ');
        double[] array = new double[str.Length];
        for (int i = 0; i < str.Length; i++)
        {
            array[i] = double.Parse(str[i]);
        }
        return array;
    }
}



Measured memory_bytes: 13140
#include <bits/stdc++.h>
#define ll          long long int
#define uu          first
#define vv          second
#define pii         pair<int,int>
#define pll         pair<ll,ll>
#define INF         1e9
#define fastRead    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;

const int MAX = 3e3 + 3;
const ll MOD = 998244353;

int n, s;

int ara[MAX], dp[MAX][MAX], ase[MAX];


int main()
{
    fastRead;
    cin>>n>>s;
    for(int i = 1; i <= n ; i++ ) {
        cin>>ara[i];
    }
    dp[0][0] = 1;
    
    for(int i = 1; i <=n ; i++ ) {
        
        for(int j = s ; j >= 0 ; j-- ) {
            
            dp[i][j] = (dp[i-1][j]*2)%MOD;
            if(j - ara[i] >=0) dp[i][j] = (dp[i][j] + dp[i-1][j-ara[i]])%MOD;
        }
    }
    cout<<dp[n][s]<<'\n';
    return 0;
}

Measured memory_bytes: 38796
#include <bits/stdc++.h>
#define ft first
#define sc second
#define pt(sth) cout << sth << "\n"
#define chmax(a, b) {if(a<b) a=b;}
#define chmin(a, b) {if(a>b) a=b;}
#define moC(a, s, b) (a)=((a)s(b)+MOD)%MOD
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
static const ll INF=1e18;
static const ll MAX=1e5+7;
static ll MOD=1e9+7;
ll max(ll a, ll b) {return a>b?a:b;}
ll min(ll a, ll b) {return a<b?a:b;}


ll dp[1111][11111];

int main(void) {
  ll H, N;
  cin >> H >> N;
  ll i, j;
  ll a[1111], b[1111];
  ll max=0;
  
  for(i=0; i<N; i++) {
    cin >> a[i] >> b[i];
    chmax(max, a[i]);
  }
  
  
  for(i=0; i<N; i++) {
    for(j=0; j<=H; j++) {
      dp[i][j]=INF;
    }
  }
  dp[0][0]=0;
  
  for(i=0; i<N; i++) {
    for(j=0; j<=H; j++) {
      chmin(dp[i+1][j], dp[i][j]);
      chmin(dp[i][min(H, j+a[i])], dp[i][j]+b[i]);
    }
  }
  
  
  pt(dp[N-1][H]);
}



Measured memory_bytes: 88192
import * as fs from 'fs';

const readString = (() => {
  const input = fs.readFileSync(0).toString();
  const words = input.split(/[ \n]/);
  let i = 0;
  return () => words[i++] || '';
})();
const readInt = () => parseInt(readString(), 10);
const readBigInt = () => BigInt(readString());

const gcd = (a: bigint, b: bigint) => {
  const _gcd = (a: bigint, b: bigint): bigint => {
    const q = a % b;
    return q === 0n ? b : _gcd(b, q);
  };
  return a > b ? _gcd(a, b) : _gcd(b, a);
};

const MOD = 1000000007;
const MOD_BIGINT = BigInt(MOD);
class ModBigInt {
  constructor(public v: bigint) {}

  static of(n: number | bigint) {
    return new ModBigInt(ModBigInt.toBigInt(n));
  }

  static toBigInt(other: number | bigint | ModBigInt) {
    if (typeof other === 'bigint') return other;
    if (typeof other === 'number') return BigInt(other);
    return other.v;
  }

  clone = () => new ModBigInt(this.v);
  plus = (other: number | bigint | ModBigInt) => {
    this.v = (this.v + ModBigInt.toBigInt(other)) % MOD_BIGINT;
    return this;
  };
  minus = (other: number | bigint | ModBigInt) => {
    this.v = (this.v + MOD_BIGINT - ModBigInt.toBigInt(other)) % MOD_BIGINT;
    return this;
  };
  multiply = (other: number | bigint | ModBigInt) => {
    this.v = (this.v * ModBigInt.toBigInt(other)) % MOD_BIGINT;
    return this;
  };
  pow = (other: number) => {
    const v = mod(1);
    for (let i = 0; i < other; i++) v.multiply(this.v);
    return v;
  };
}

const mod = ModBigInt.of;

const abs = (a: bigint) => (a > 0n ? a : -a);

const count = (s: number) => {
  return Math.floor(Math.sqrt(2 * s + 0.25) - 0.5);
};

(function main() {
  let N = readInt();
  const s: { [p: number]: number } = {};
  for (let p = 2; p <= 1000000; p++) {
    while (N % p === 0) {
      N /= p;
      s[p] = s[p] || 0;
      s[p]++;
    }
    if (N === 1) break;
  }

  let result = 0;
  for (const p of Object.keys(s) as any) {
    result += count(s[p]);
  }
  if (N > 1) result += 1;
  console.log(result);
})();


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

char s[9][5], t[3][3][5];
int dx[]{ -1,0,1,0 }, dy[]{ 0,1,0,-1 };
int cnt = 0;
void dfs(int p) {
	rep(i, 3)rep(j, 3) {
		if (t[i][j][0])continue;
		rep(k, 4) {
			rep(l, 4) {
				int nx = i + dx[l], ny = j + dy[l];
				if (nx < 0 || 3 <= nx || ny < 0 || 3 <= ny || !t[nx][ny][0])continue;
				if (abs(s[p][(l + k) % 4] - t[nx][ny][(l + 2) % 4]) != 'a' - 'A')goto g;
			}
			if (p == 8)cnt++;
			else {
				rep(l, 4)t[i][j][l] = s[p][(l + k) % 4];
				dfs(p + 1); t[i][j][0] = 0;
			}g:;
		}
	}
}
int main() {
	int n; scanf("%d", &n);
	rep(i, n) {
		rep(j, 9)scanf("%s", s[j]);
		cnt = 0; dfs(0);
		printf("%d\n", cnt);
	}
}

Measured memory_bytes: 3200
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long N;
  cin >> N;
  vector<long> num(N);
  
  for (long i = 0; i < N; i++) {
    cin >> num.at(i);
    num.at(i) -= (i + 1);
  }
  
  sort(num.begin(), num.end());
  
  long ma,mb;
  
  if (N % 2 == 0) {
    ma = num.at(N/2);
    mb = num.at(N/2 - 1);
  }
  else {
    ma = num.at((N - 1)/2);
    mb = num.at((N - 1)/2);
  }
  
  long sunuke1,sunuke2 = 0;
  
  for (long i = 0; i < N; i++) {
    sunuke1 = sunuke1 + abs(num.at(i) - ma);
    sunuke2 = sunuke2 + abs(num.at(i) - mb);
  }
  
  cout << min(sunuke1,sunuke2) << endl;
  
  return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
const int N=110;
char s[N];
int dp[5][N][2],k,n;

int dfs(int now,int num,int flag){
    int ans=0;
    if(num>k)return 0;
    if(now==n+1)return(num==k);
    if(dp[num][now][flag]!=-1)return dp[num][now][flag];
    int lim=9;if(flag)lim=s[now]-'0';
    for(int i=0;i<=lim;i++){
        ans+=dfs(now+1,num+(i!=0),flag&&(i==lim));
    }
    return dp[num][now][flag]=ans;
}
int main(){
    scanf("%s",s+1);
    scanf("%d",&k);
    memset(dp,-1,sizeof(dp));
    n=strlen(s+1);
    cout<<dfs(1,0,1);
}

Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        long N = scan.nextLong();
        List<Long> list = new ArrayList<>();
        for (long i = 0; i < N ; i++) {
            list.add(scan.nextLong());
        }
        
        Collections.sort(list);
        list.removeIf(l -> l == 0);

        while(true){
            if (list.size() == 1){
                break;
            }
            Long first  = list.get(0);
            for(int i = 1; i <= list.size()-1; i++){
                Long target  = list.get(i);
                list.set(i,target % first);
            }
            Collections.sort(list);
            list.removeIf(l -> l == 0);
        }

        System.out.print(list.get(0));
    }
}


Measured memory_bytes: 61920
#include <iostream>

int main() {
    std::string S;
    std::cin >> S;
    
    int ans = 0;
    char current = S.front();
    
    for (auto itr = S.begin()+1; itr!=S.end(); itr++) {
        if (current == *itr) {
            ans++;
            if (current == '0')
                current = '1';
            else
                current = '0';
        } else {
            current = *itr;
        }
    }
    
    std::cout << ans << std::endl;
}

Measured memory_bytes: 512
#include <iostream>
#define NUM 44

using namespace std;

int main(){
    int n, fib[NUM];

    cin >> n;
    fib[0] = 1;
    fib[1] = 1;
    
    for(int i = 2; i <= n; i++){
        fib[i] = fib[i-1] + fib[i-2];
    }

    cout << fib[n] << endl;

    return 0;
}


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

using namespace std;

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

const char sp = ' ';
const char cmm = ',';
const int MOD = 1000000007;

using ll = long long;

ll mod(ll a, ll b){return (a%b+b)%b;}
ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b){return a*b/gcd(a,b);}
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
void Judge(bool b){b?Yes():No();}
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void JUDGE(bool b){b?YES():NO();}
ll powMod(ll b, ll e, ll m){ll r=1;while(e>0){if(e&1)r=(r%m)*(b%m)%m;b=(b%m)*(b%m)%m;e>>=1;}return r;}
double distance(ll x1, ll y1, ll x2, ll y2){return sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));}

template<typename T>
void ppp(T n){cout << n << endl;}

int main(){

    cin.tie(0);
    ios::sync_with_stdio(false);

    string s;
    cin >> s;

    int n = s.size();

    int ans = 0;
    for(int l = 1; l <= n; ++l){
        for(int i = 0; i+l-1 < n; ++i){
            string tmp = s.substr(i, l);
            bool ok = true;
            for(int j = 0; j < l; ++j){
                if(!(tmp[j] == 'A' or tmp[j] == 'T' or tmp[j] == 'G' or tmp[j] == 'C')){
                    ok = ok && false;
                    break;
                }
            }
            if(ok){
                int ts = tmp.size();
                ans = max(ans, ts);
            }
        }
    }

    ppp(ans);



    return 0;
}


Measured memory_bytes: 256
//雪花飄飄北風嘯嘯
//天地一片蒼茫

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
#define ll long long
#define ii pair<ll,ll>
#define iii pair<ii,ll>
#define fi first
#define se second
#define endl '\n'
#define debug(x) cout << #x << " is " << x << endl;

#define rep(x,start,end) for(auto x=(start)-((start)>(end));x!=(end)-((start)>(end));((start)<(end)?x++:x--))
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()

ll MAX(ll a){return a;}
ll MIN(ll a){return a;}
template<typename... Args>
ll MAX(ll a,Args... args){return max(a,MAX(args...));}
template<typename... Args>
ll MIN(ll a,Args... args){return min(a,MIN(args...));}

#define indexed_set tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>

mt19937 rng(chrono::system_clock::now().time_since_epoch().count());

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	int n;
	cin>>n;
	
	cout<<8-((n-400)/200);
}


Measured memory_bytes: 3612
#include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <string>
#include <map>

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

typedef long long ll;

using namespace std;

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

    vector<int> d;
    rep(i, n) {
        int x;
        cin >> x;
        d.push_back(x);
    }
    if ((n % 2) != 0) {
        cout << 0 << endl;
        return 0;
    }

    sort(d.begin(), d.end());
    int ans;
    ans = d[n/2] - d[n/2-1];
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 892
n = gets(chomp:true).to_i
s = gets.split.map(&:to_i)
gets
t = gets.split.map(&:to_i)
count = 0

t.each do |t|

  left = 0
  right = n

  while left < right do

    mid = (left+right)/2

    if s[mid] == t
      count += 1
      break
    elsif s[mid] > t
      right = mid
    elsif s[mid] < t
      left = mid+1
    end

  end

end

puts count


Measured memory_bytes: 15352
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<string, string> pss;
const int MX=100010, inf=2e9;

int n;
char S[50];
map<pss, int> cnt;
ll ans;

void put(int s){
    string R, B;
    for(int i=0; i<n; i++){
        if(s&(1<<i)) R.push_back(S[i]);
        else B.push_back(S[i]);
    }
    cnt[pss(R, B)]++;
}

void check(int s){
    string R, B;
    for(int i=0; i<n; i++){
        if(s&(1<<i)) R.push_back(S[2*n-1-i]);
        else B.push_back(S[2*n-1-i]);
    }
    ans+=cnt[pss(R,B)];
}

int main(){
    ios::sync_with_stdio(0); cin.tie(0);
    cin>>n;
    cin>>S;
    for(int i=0; i<(1<<n); i++){
        put(i);
    }
    for(int i=0; i<(1<<n); i++){
        check(i);
    }
    cout<<ans;
    return 0;
}

Measured memory_bytes: 91904
/*   _/                _/                 _/_/_/   _/
  _/_/_/_/   _/_/   _/_/_/_/   _/_/    _/       _/_/
   _/     _/    _/   _/     _/    _/  _/_/_/     _/
  _/     _/    _/   _/     _/    _/  _/    _/   _/
   _/_/   _/_/       _/_/   _/_/      _/_/     _/ */
#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<set>
#include<map>
#include<queue>
#include<vector>
using namespace std;
using ll=long long;
const int MOD=1e9+7;
const double pi=3.14159265358979323846;
const int inf=2e9;
const ll INF=1e18;
using P=pair<int,int>;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
int main() {
  cin.tie(0),cout.tie(0);
  ios::sync_with_stdio(false);
  int n,ans=0;
  cin >> n;
  n++;
  while(n) {
    ans++;
    n/=2;
  }
  cout << ans-1 << "\n";
}


Measured memory_bytes: 3216
import sys
sys.setrecursionlimit(1000000)
H, W, K = map(int, input().split())
C = []
for _ in range(H):
    C.append(list(input()))

ans = 0
def dfs(HSelect, WSelect):
    global ans, H, W, K
    if len(HSelect) == H and len(WSelect) == W:
        count = 0
        for j in range(W):
            for i in range(H):
                if HSelect[i] or WSelect[j]:
                    continue
                if C[i][j] == "#":
                    count += 1
        if count == K:
            ans += 1
        return

    Hnext = HSelect[:]
    Wnext = WSelect[:]
    if len(HSelect) < H and len(WSelect) < W:
        dfs(Hnext+[False], Wnext+[False])
        dfs(Hnext+[True], Wnext+[False])
        dfs(Hnext+[False], Wnext+[True])
        dfs(Hnext+[True], Wnext+[True])
    elif len(HSelect) < H:
        dfs(Hnext+[False], Wnext)
        dfs(Hnext+[True], Wnext)
    elif len(WSelect) < W:
        dfs(Hnext, Wnext+[False])
        dfs(Hnext, Wnext+[True])


dfs([], [])
print(ans)

Measured memory_bytes: 9300
import math

N=input()
n=int(N)

p=input().split()
for i in range (len(p)):
    p[i]=int(p[i])

sum1=0

q=p.copy()

for i in range (len(q)):
    sum1=sum1+q[i]

avg=sum1/n

if avg-math.floor(avg)>=0.5:
    avg=math.floor(avg)+1
else:
    avg=math.floor(avg)


stamina=0

for i in range(len(p)):
    stamina=stamina+(avg-p[i])**2
    
print(stamina)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#include <string>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <bitset>

#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
using Real = mp::number<mp::cpp_dec_float<1024>>;


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

const int MOD = 1000000007;

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

int main(int argc, const char * argv[]) {
  ll N,K; cin >> N >> K;
  ll sum = 0;
  map<ll,ll> mp;
  for(ll i=K; i>0; i--){
    mp[i] = modpow(K/i,N);
    ll cnt=2;;
    while(i*cnt<=K){
      mp[i] = (mp[i] - mp[i*cnt]) % MOD;
      cnt++;
    }
    sum += i * mp[i];
  }

  cout << sum%MOD << endl;

  return 0;
}


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

using namespace std;

int main()
{
	  long long a,b,c,s=0;
	  cin >> a >> b >> c;
	   s=a*100+b*10+c;
	   if(s%4==0)
	   cout<<"YES";
	   else
	   cout<<"NO";
	
	
	
	
	
	
	
	
	
	
	
	
}

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

int main() {
  int N , dig;
  bool j=0;
  
  cin >> N;

  for (int i = 0; i < 3; i++) {
    dig = N % 10;
    N = N - dig;
    N = N / 10;
    if(dig == 7) j = 1;
  }
  
  
  
  if(j == 1) cout << "Yes" << endl;
  else cout << "No" << endl;
}

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

constexpr int MAX = 1e6;
int p[MAX + 10];
bool used[MAX + 10];
int main() {
	for(int i = 2; i <= MAX; ++i) {
		if(p[i] > 0) continue;
		for(int j = i; j <= MAX; j += i) {
			if(p[j] > 0) continue;
			p[j] = i;
		}
	}
	int n; cin >> n;
	int g = 0;
	bool pa = true;
	for(int i = 0; i < n; ++i) {
		int a; cin >> a;
		g = gcd(g, a);
		while(a > 1) {
			int d = p[a];
			if(used[d]) {
				pa = false;
			}
			used[d] = true;
			while(a > 1 and a % d == 0) {
				a /= d;
			}
		}
	}
	if(pa) {
		cout << "pairwise coprime" << '\n';
	} else if(g == 1) {
		cout << "setwise coprime" << '\n';
	} else {
		cout << "not coprime" << '\n';
	}
	return 0;
}

Measured memory_bytes: 8488
import sys
sys.setrecursionlimit(10**7)

def LI(): return [int(x) for x in input().split()]
def TI(): return tuple(LI())
def II(): return int(input())

N,M=LI()

MP={}
for _ in range(M):
    fr, to = TI()
    if not fr in MP:
        MP[fr] = []
    MP[fr].append(to)

RESL=[-1]*(N+1)
def dfs(n):
    if RESL[n] != -1:
        return RESL[n]
    else:
        res = 0
        if n in MP:
            for to in MP[n]:
                res = max(res, dfs(to))
            res += 1
        RESL[n] = res
        return res
for i in range(1, N+1): dfs(i)
# print(RESL)
print(max(RESL))


Measured memory_bytes: 160004
N = int(input())
table = [0] * (N + 1)
for i in range(1, N + 1):
    for j in range(i, N + 1, i):
        table[j] += 1
ans = 0
for i in range(N):
    i += 1
    ans += i * table[i]
print(ans)

Measured memory_bytes: 146048
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <sstream>
#include <vector>
#include <string>
#include <iomanip>
#include <bitset>
using namespace std;
#define INF	100000000
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define lb lower_bound
#define ub upper_bound
#define SS stringstream
#define rep(i,n) for(int i = 0; i < n; i++)
#define sz(x) ((int)(x).size())
#define SORT(x) sort((x).begin(), (x).end())
#define RSORT(x) sort((x).begin(), (x).end(), greater<int>() )
#define clr(a,b) memset((a),(b),sizeof(a))
typedef long long int ll;
typedef pair<int, int> P;
typedef vector<int> Vi;
typedef vector<ll> Vll;
typedef vector<P> Vp;
typedef priority_queue<P, vector<P>, greater<P> > PQ;

int a,b,t=0;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	while(cin >> a >> b){
		if(a == 0 && b == 0) break;
		if(t != 0) cout << endl;
		bool ok = true;
		for(int i = a; i <= b; i++){
			if(i%400==0||(i%100!=0&&i%4==0)){
				ok = false;
				cout << i << endl;
			}
		}
		if(ok) cout << "NA" << endl;
		t++;
	}
}

Measured memory_bytes: 1192
#include<stdio.h>

int main(void)
{
  int n,k,x,y,ans;
  scanf("%d%d%d%d",&n,&k,&x,&y);
  if(k>n)
    ans=n*x;
  else
    ans=k*x+(n-k)*y;
  printf("%d\n",ans);
  return 0;
}


Measured memory_bytes: 128
while formula = STDIN.gets
  (0..9). each do |i|
    f = formula.gsub(/X/, i.to_s)
    l, r, a = f.chomp.split(/[+|=]/)
    if i == 0 and (l.length > 1 and l[0] == '0') or (r.length > 1 and r[0] == '0') or (a.length > 1 and a[0] == '0') then next end
    if l.to_i + r.to_i == a.to_i then
      puts i
      break
    end
    if i == 9 then
      puts 'NA'
    end
  end
end

Measured memory_bytes: 8868
#include "bits/stdc++.h"
using namespace std;
#define REP(i, n) for(ll i = 0;i < n;i++)
#define ll long long
#define MOD 1000000007
#define llMAX 9223372036854775807
#define llMIN -9223372036854775808
using vi = vector<ll>; // intの1次元の型に vi という別名をつける
using vvi = vector<vi>; // intの2次元の型に vvi という別名をつける

ll n,k,x,y;

int main(){
  ll ans=0;
  double d;
  cin >> d ;
  d*=3.14159265358979323846*2.0;

  //小数点表記
  cout << setprecision(16) << d<<endl;
  return 0;
}


Measured memory_bytes: 3784
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <list>
#include <ctime>
#include <sstream>
#include <queue>
#include <stack>
#include <random>
#include <bitset>
#include <numeric>
#include <cassert>
using namespace std;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;
#define rep(x, b, e) for(int x=(b); x<(e); ++x)
#define ford(x, b, e) for(int x=((int)(b))-1; x>=(e); --x)
#define all(c) c.begin(),c.end()
#define sz(x) ((int)((x).size()))
#define pb push_back
#define st first
#define nd second
#define mp(x,y) make_pair(x,y)
typedef short int sint;

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it) {
	*this << ((it != d.b) ? ", " : "") << *it;
  }
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

int main() {
	ios_base::sync_with_stdio(false);

	ll a, b, k;
	cin >> a >> b >> k;
	if (k >= a)	{
		k -= a;
		a = 0;
	} else {
		a -= k;
		k = 0;
	}
	if (k >= b) {
		b = 0;
	} else {
		b -= k;
	}
	cout << a << ' ' << b << endl;
}

Measured memory_bytes: 256
///******* In the name of Allah *******///

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

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

void Ok()
{
    long long int a[300013],b[10013],c,d,e,f,g,h,t,s,i,j,k,l1,l2,m,n,r,sum = 0,ans_1,ans_2,ans_3,cnt = 0,Max,Min,flag,div,temp;
    double aa,bb,cc,dd,ee,tot;
    char aaa[3013],bbb[1013],ccc[1013],num;
    cin>>n;
    for(i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    sort(a+1,a+n+1);
    for(i=1;i<n;i++)
    {
        if(a[i]!=a[i+1])
        {
            cnt++;
        }
    }
    if(cnt==(n-1))
    {
        cout<<"YES"<<endl;
    }
    else
    {
        cout<<"NO"<<endl;
    }

}

int main()
{
    Ok();

    return 0;
}


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


int main(){
	int N;
	cin>>N;
	
	int a[N];
	for(int i=0;i<N;i++){
		cin>>a[i];
	}
	
	if(a[0]!=0){
		cout<<-1<<endl;
		return 0;
	}
	long long ans = 0;
	for(int i=1;i<N;i++){
		if(a[i]>a[i-1]+1){
			cout<<-1<<endl;
			return 0;
		}
		if(a[i]==a[i-1]+1){
			ans++;
		}
		else{
			ans++;
			ans+=a[i]-1;
		}
	}
	
	cout<<ans<<endl;
	
	return 0;
}

Measured memory_bytes: 1024
import java.util.Scanner;

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

        int k, tot = 0;
        while((k = Integer.parseInt(sc.next())) > 0) {
            for (int i = 0, max = k*(k-1)/2; i < max; i++) {
                tot += Integer.parseInt(sc.next());
            }
            System.out.println(tot / (k - 1));
            tot = 0;
        }
    }
}

Measured memory_bytes: 56856
package main

import (
	"fmt"
)

func main() {
	var n int64
	fmt.Scan(&n)

	i := int64(1)
	var ret int64
	for {
		m := (n - i) / i
		if m <= i {
			break
		}
		if (n-i)%i == 0 {
			ret += m
		}
		i++
	}

	fmt.Println(ret)
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define BORDER (int)1e6
#define INF (int)1e7

using namespace std;

int main(){
	vector<int> t(1,0),t1(1,0);
	int c=1;
	while(t[c-1]<=BORDER){
		int temp;
		temp=c*(c+1)*(c+2)/6;
		t.push_back(temp);
		if(temp%2==1 ){
			t1.push_back(temp);
		}
		c++;
	}

    vector<int> table(BORDER,0),table1(BORDER,0);

    for(int i = 1; i < BORDER; i++){
        int ans = INF;
        for(int j = 1; j < t.size(); j++){
            if(t[j] > i)break;
            if(i - t[j] >= 0){
                ans = min( ans, table[i-t[j]]+1);
            }
        }
        table[i] = ans;
        ans = INF;
        for(int j = 1; j < t1.size(); j++){
            if(t1[j] > i) break;
            if(i - t[j] >= 0){
                ans = min( ans, table1[ i - t1[j]] + 1);
            }
        }
        table1[i] = ans;
    }



	while(true){
		int n;
		cin >> n;
		if(n==0)break;
		cout << table[n] << " " << table1[n] << endl;
	}
	return 0;
}
		

Measured memory_bytes: 10504
#include "bits/stdc++.h"
#define rep(i, N) for(int (i) = 0; (i) < (N); (i)++)
#define debug(var) std::cout << #var << " : " << var << std::endl;
using ll = long long;
using ull = unsigned long long;
using vint = std::vector<int>;
using vvint = std::vector<std::vector<int>>;
using namespace std;
ll mod = 1e9 + 7;


int main() {


	int A, B; cin >> A >> B;
	if (abs(B - A) <= 1)cout << "Yay!";
	else cout << ":(";


	return 0;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include<stdio.h>
int f(int n);
int main(){
	int a,b,c;
	scanf("%d%d%d", &a, &b, &c);
	if ((b - a > 0) && (c - b > 0)) printf("Yes\n");
	else printf("No\n");
	return 0;
}

Measured memory_bytes: 580
#include <bits/stdc++.h>
using namespace std;
// define
#define int long long
#define UNIQUE(v) v.erase(unique(all(v)), v.end());
#define ZIP(v) sort(all(v)),UNIQUE(v)
#define ADD(a, b) a = (a + b) % mod
#define SUB(a, b) a = (a+mod-b)%mod
#define MUL(a, b) a = (((a)%mod) * ((b)%mod)) % mod
#define rollcall cout << "I'm Sucu." << endl;
#define repi(i,m,n) for(int i = m;i < n;i++)
#define drep(i,n,m) for(int i = n;i >= m;i--)
#define rep(i,n) repi(i,0,n)
#define rrep(i,n) repi(i,1,n+1)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(), v.rend()
#define dmp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define pf(x) push_front(x)
#define fi first
#define se second
// typedef
typedef complex<double> Point;
typedef pair<int, int> P;
typedef pair<int, P> PP;
typedef pair<P, int> Pi;
typedef vector<int> vi;
typedef deque<int> dq;
const int inf = 1e9+7;
const int INF = 1e18+7;
const int mod = 1e9+7;
// int sum = accumulate(a, a+n, 0LL);
// int mx = max_element(a, a+n);
// int mn = min_element(a, a+n);
// int cnt = count(a, a+n, k);

int N,cnt;

string S;

signed main()
{

    cin >> N;
    cin >> S;

    for(int i=0;i<1000;i++)
    {
        int c[3]={i/100,(i/10)%10,i%10};
        int f=0;
        for(int j=0;j<N;j++)
        {
            if(S[j]==('0'+c[f]))f++;
            if(f==3)break;
        }
        if(f==3)cnt++;
    }

    cout << cnt << endl;
    
    return 0;
}

Measured memory_bytes: 256