akhauriyash/Code-Regression huggingface dataset:
def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)
      
N = int(input())
As = list(map(int, input().split()))

Ls = [0]
Rs = [0]
for i in range(N):
    la, lb = max([As[i], Ls[i]]), min([As[i], Ls[i]])
    Ls.append(gcd(la, lb))
    ra, rb = max([As[N - i - 1], Rs[i]]), min([As[N - i - 1], Rs[i]])
    Rs.append(gcd(ra, rb))
Ms = []
for i in range(N):
    a, b = max([Rs[N - i - 1], Ls[i]]), min([Rs[N - i - 1], Ls[i]])
    Ms.append(gcd(a, b))

print(max(Ms))

Measured memory_bytes: 14432
#include<iostream>
#include<algorithm>
#include<string>
#include<cmath>
#include<array>

int main() {
    size_t n;
    std::cin >> n;
    int t[n + 1], x[n + 1], y[n + 1];
    t[0] = x[0] = y[0] = 0;
    bool flag = true;
    for (int i = 1; i < n + 1; ++i) {
        std::cin >> t[i] >> x[i] >> y [i];
        int tt = t[i] - t[i - 1];
        int xx = x[i] - x[i - 1];
        int yy = y[i] - y[i - 1];
        int d = std::abs(xx) + std::abs(yy);
        if (d <= tt && (tt - d) % 2 == 0) {
        } else {
            flag = false;
            break;
        }
    }
    if (flag) std::cout << "Yes" << std::endl;
    else std::cout << "No" << std::endl;
}

Measured memory_bytes: 1408
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <stack>
#include <queue>
using namespace std;

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

  for(int i = 1; i < 10; i++) {
    for(int j = i; j < 10; j++){
      if(i*j == n) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
}


Measured memory_bytes: 256
//c++ テンプレ
#include<bits/stdc++.h>
using namespace std;

typedef long long llint;
typedef long double ld;

#define inf 1e18
#define mod 1000000007
priority_queue<llint,vector<llint>,greater<llint> > que;
priority_queue<llint> Que;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int n;
llint a[100005];
llint sum=0;
void calc(int b,int c){
    llint x=a[b];
    sum-=(b*x);
    a[b]=0;
    a[c]+=x;
    sum+=(c*x);
}
void solve(){
    cin >> n;
    for(int i=0;i<n;i++){
        llint x;
        cin >> x;
        a[x]++;
    }
    for(llint i=1;i<100005;i++){
        sum+=(i*a[i]);
    }
    int q;
    cin >> q;
    int b,c;
    for(int i=0;i<q;i++){
        cin >> b >> c;
        calc(b,c);
        cout << sum << endl;
    }
   
}

int main(){
    solve();
    return 0;
}




Measured memory_bytes: 4344
import qualified Data.ByteString.Char8 as B
import Control.Monad (replicateM)
import qualified Data.Set as S
import qualified Data.Vector.Unboxed as VU
import Data.Maybe (fromJust)

main = do
  n <- readLn
  an <- VU.replicateM n  (fst . fromJust . B.readInt <$> B.getLine)
  print $ S.size $ VU.foldl (\acc x -> if S.member x acc then S.delete x acc else S.insert x acc) S.empty an

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

using namespace std;

#define ll long long
#define ar array



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

	int n;
	cin >> n;
	cout << 1000 - (n%1000!=0?n%1000:1000);
	return 0;
}


Measured memory_bytes: 3632
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
  int N;
  cin >> N;
  int i=0;
  bool can = false;
  while(true) {
    if (N-i*i==0) {
      cout << i*i << endl;
      can = true;
    }
    if (can) {
      break;
    }
    if (N -i*i <0) {
      cout << (i-1)*(i-1) << endl;
      can = true;
    }
    if (can) {
      break;
    }
    i++;
  }
}

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

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int h, w;
  cin >> h >> w;
  char map[h][w];
  int ans[h][w];
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      cin >> map[i][j];
      ans[i][j] = 0;
    }
  }

  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      if (map[i][j]=='#') {
        for (int y = -1; y <= 1; y++) {
          for (int x = -1; x <= 1; x++) {
            if (0 <= i+y && i+y < h && 0 <= j+x && j+x < w) ++(ans[i+y][j+x]);
          }
        }
      }
    }
  }
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      if (map[i][j]=='#') cout << map[i][j];
      else cout << ans[i][j];
    }
    cout << '\n';
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = 1; i < (int)(n + 1); i++)
// vector<vector<int>> A(3, vector<int>(4));
int main() {
    int N,K;
    cin>>N>>K;
    vector<int>A(N);
    vector<int>B(300000);
    rep(i,N){
        cin>>A[i];
        B[A[i]]++;
    }
    int cnt=0;
    sort(B.begin(),B.end());
    rep(i,300000){
        if(B[i]!=0){
            cnt++;
        }
    }
    cnt=cnt-K;
    ll ans=0;
    rep(i,300000){
        if(cnt<=0){
            break;
        }
        else{
            if(B[i]!=0){
                ans+=B[i];
                cnt--;
            }
        }
    }
    cout<<ans<<endl;
}



Measured memory_bytes: 5064
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int S = reader.nextInt();
		reader.close();
		ArrayList<Integer> list = new  ArrayList<Integer>();
		int count = 1;
		while (!list.contains(S)) {
			list.add(S);
			if (S % 2 == 0) {
				S /= 2;
			} else {
				S = 3 * S + 1;
			}
			count++;
		}
		System.out.print(count);
	}
}



Measured memory_bytes: 22996
#include <iostream>
#include <cstdint>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int, int>> vpii;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvc;
typedef vector<vector<string>> vvs;
typedef vector<vector<ll>> vvll;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rrep(i, n) for (ll i = 1; i <= (n); ++i)
#define irep(it, stl) for (auto it = stl.begin(); it != stl.end(); it++)
#define drep(i, n) for (ll i = (n)-1; i >= 0; --i)
#define mes(a) cout << (a) << endl
#define dmes(a, b) cout << (a) << " " << (b) << endl
#define re0 return 0
#define mp(p, q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define rSort(a) sort(a.rbegin(), a.rend())
#define Rev(a) reverse(a.begin(), a.end())
#define MATHPI acos(-1)
#define itn int
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return 1;
    }
    return 0;
}
struct io
{
    io()
    {
        ios::sync_with_stdio(false);
        cin.tie(0);
    }
};
const int INF = INT_MAX;
const ll LLINF = 1LL << 60;
const ll MOD = 1000000007;
const double EPS = 1e-19;


signed main() {
    string s;
    cin >> s;
    
    ll r = 0;
   
    rep(i, (ll)s.size()) {
        if (s[i] == '1') r+= 1;
        if (s[i] == '2') r+= 2;
        if (s[i] == '3') r+= 3;
        if (s[i] == '4') r+= 4;
        if (s[i] == '5') r+= 5;
        if (s[i] == '6') r+= 6;
        if (s[i] == '7') r+= 7;
        if (s[i] == '8') r+= 8;
        if (s[i] == '9') r+= 9;
    }
    
    if (r % 9 == 0) {
        mes("Yes");
        re0;
    }
    mes("No");
    
    
    
    
}

Measured memory_bytes: 3748
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define repLRE(i, l, r) for (ll i = (l); i <= (r); ++i)
#define rrepLRE(i, l, r) for (ll i = (l); i >= (r); --i)
#define Sort(v) sort(v.begin(), v.end())
#define rSort(v) sort(v.rbegin(), v.rend())
#define Reverse(v) reverse(v.begin(), v.end())
#define Lower_bound(v, x) \
  distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) \
  distance(v.begin(), upper_bound(v.begin(), v.end(), x))

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
using vll = vector<ll>;
using vP = vector<P>;
using vT = vector<T>;
using vvll = vector<vector<ll>>;
using vvP = vector<vector<P>>;
using dqll = deque<ll>;

ll dx[9] = {-1, 1, 0, 0, -1, -1, 1, 1, 0};
ll dy[9] = {0, 0, -1, 1, -1, 1, -1, 1, 0};

/* Macros reg. ends here */

const ll INF = 1LL << 50;

int main() {
  // ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(15);

  ll n;
  cin >> n;

  vector<queue<ll>> que(n);
  rep(i, n) {
    rep(_, n - 1) {
      ll a;
      cin >> a;
      a--;
      que[i].push(a);
    }
  }

  set<P> games;

  auto chk = [&](ll x) {
    if (que[x].empty()) return;
    ll y = que[x].front();
    if (que[y].front() == x) {
      if (x > y) swap(x, y);
      games.insert(P(x, y));
    }
    return;
  };

  rep(i, n) chk(i);

  ll tsukaday = 0;
  while (!games.empty()) {
    tsukaday++;
    set<P> pgames;
    swap(games, pgames);
    for (P p : pgames) {
      que[p.first].pop();
      que[p.second].pop();
    }
    for (P p : pgames) {
      chk(p.first);
      chk(p.second);
    }
  }

  bool ok = true;
  rep(i, n) if (!que[i].empty()) {
    ok = false;
    break;
  }

  if(!ok) tsukaday = -1;
  cout << tsukaday << endl;

  return 0;
}


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

int main() {
    int n;
    cin >> n;
    vector<vector<int>> adj(n);
    for (int i = 1; i < n; i++) {
        int a;
        cin >> a;
        a--;
        adj[a].push_back(i);
        adj[i].push_back(a);
    }

    vector<int> depth(n);
    function<void(int, int)> dfs = [&](int v, int p) {
        vector<int> ds;
        for (int s : adj[v]) {
            if (s != p) {
                dfs(s, v);
                ds.push_back(depth[s]);
            }
        }
        sort(ds.begin(), ds.end());
        for (int i = 0; i < ds.size(); i++) {
            ds[ds.size() - 1 - i] += i;
        }
        sort(ds.begin(), ds.end());
        if (ds.size()) {
            depth[v] = ds.back() + 1;
        }
    };

    dfs(0, -1);
    cout << depth[0] << endl;
}

Measured memory_bytes: 18560
#include<iostream>
using namespace std;
#define ll long long int
ll  monster(ll h)
{
    if(h == 1) return 1;
    else return 2 * monster(h / 2) + 1;
}
int main()
{
    ll h; cin>>h;
    ll ans = monster(h);
    cout<<ans<<'\n';
    return 0;
}


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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REP1(i,n) for(int i=1, i##_len=(n); i<i##_len; ++i)
#define ll long long
static const int MAX = 10000;
static const ll INFTY = 1e12;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const ll MRINF = 5000000000000000;

int main() {

    int X;
    cin >> X;
    ll ans = 0;
    REP(i, 1000){
        for(int j=2; j<=1000; j++){
            if(pow(i, j)<=X){
                ans = max(ans, (ll)pow(i, j));
            }else{
                break;
            }
        }
    }
    cout << ans << endl;

    

}
/*
                   _ooOoo_
                  o8888888o
                  88" . "88
                  (| -_- |)
                  O\  =  /O
               ____/`---'\____
             .'  \\|     |//  `.
            /  \\|||  :  |||//  \
           /  _||||| -:- |||||-  \
           |   | \\\  -  /// |   |
           | \_|  ''\---/''  |   |
           \  .-\__  `-`  ___/-. /
         ___`. .'  /--.--\  `. . __
      ."" '<  `.___\_<|>_/___.'  >'"".
     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
     \  \ `-.   \_ __\ /__ _/   .-` /  /
======`-.____`-.___\_____/___.-`____.-'======
                   `=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         pass System Test!
*/

Measured memory_bytes: 3920
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include<random>
#include<math.h>
#include<limits.h>
#include<iterator>
#include<queue>
#define rep(i,a) for(int i=0;i<a;i++)
#define nrep(i,a,b) for(int i=a;i<b;i++)
#define mrep(i,a) for(int i=a;i>=0;i--)
#define ll long long
#define vl vector<ll> 
#define vvl vector<vector<ll> > 
#define vb vector<bool> 
#define vvb vector<vector<bool> > 
#define INF 1123456789012345
using namespace std;

int main(){
	string n; cin >> n;
	if (n[0]==n[2]) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main() {
  string s;
  bool flg = false;
  cin >> s;
  for (int i = 0; i < s.size()-1 ; i++){
  	if (s[i] == s[i+1]) flg = true;
  }
  if (!flg) cout << "Good" << endl;
  else cout << "Bad" << endl;
}


Measured memory_bytes: 256
#引数　n, 返り値nまでの素数をリストで返す
def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    #根号
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]
n = int(input())
prime_list = primes(55555)
ans = []
count = 0

for i in prime_list:
    if i % 5 == 1:
        ans.append(i)
        count += 1
    if count == n:
        break
print(" ".join(map(str, ans)))

Measured memory_bytes: 3572
use proconio::input;

fn main() {
    input!(s: proconio::marker::Chars);
    let n = s.len();
    let mut i = n / 2;
    while 0 < i && s[i - 1] == s[i] && s[n - i - 1] == s[n - i] {
        i -= 1;
    }
    println!("{}", n - i);
}


Measured memory_bytes: 2508
#include <stdio.h>
#define N 100000

typedef struct card{
  int value;
  char mark;
}CARD;

int cnt = 0;

CARD QUICK[N],MERGE[N];

int part(int p,int r){
  int i;
  CARD x,tmp;
  x = QUICK[r];
  i = p-1;
  for(int j = p; j < r; j++){
    if(QUICK[j].value <= x.value) {
      i++;
      tmp = QUICK[i];
      QUICK[i] = QUICK[j];
      QUICK[j] = tmp;
    }
  }
  tmp = QUICK[i+1];
  QUICK[i+1] = QUICK[r];
  QUICK[r] = tmp;
  return i+1;
}

void quick_sort(int p,int r){
  int q;
  if(p < r){
    q = part(p,r);
    quick_sort(p,q-1);
    quick_sort(q+1,r);
  }
}

void merge(int left,int mid,int right){
  int n1,n2,i,j,k;
  CARD L[N],R[N];
  n1 = mid - left;
  n2 = right - mid;
  for(i = 0; i < n1;i++){
    L[i] = MERGE[left + i];
  }
  for(i = 0; i < n2;i++){
    R[i] = MERGE[mid + i];
  }
  L[n1].value = 999999999;
  R[n2].value = 999999999;
  i = 0;
  j = 0;
  for(k = left; k < right;k++){
    if(L[i].value <= R[j].value){
      MERGE[k] = L[i];
      i++;
      cnt++;
    }
    else {
      MERGE[k] = R[j];
      j++;
      cnt++;
    }
  }
}

void merge_sort(int left,int right){
  int mid;
  if(left + 1 < right){
    mid = (left + right)/2;
    merge_sort(left,mid);
    merge_sort(mid,right);
    merge(left,mid,right);
  }
}


int main(){
  int n,i,value;
  char tmp[5];
  scanf("%d",&n);
  for(i = 0; i < n; i++){
    scanf("%s%d",tmp,&value);
    MERGE[i].mark = QUICK[i].mark = tmp[0];
    MERGE[i].value = QUICK[i].value = value;
  }
  quick_sort(0,n-1);
  merge_sort(0,n);
  for(i = 0; i < n;i++){
    if(QUICK[i].mark != MERGE[i].mark) {
      printf("Not stable\n");
      break;
    }
  }
  if(i == n) printf("Stable\n");
  for(i = 0; i < n; i++){
    printf("%c %d\n",QUICK[i].mark,QUICK[i].value);
  }
  return 0;
}
  
  
  



Measured memory_bytes: 4072
#define _USE_MATH_DEFINES

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>

using namespace std;

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

long long int INF = 1e18;
long long int MOD = 1e9 + 7;

long long int N, Q;
string s;
vector<string> v;

int check(long long int pos){
    char c = s[pos];
    for(int i = 0; i < Q; i++){
        if(v[i][0] == c){
            if(v[i][1] == 'L'){
                pos -= 1;
            }else{
                pos += 1;
            }
        }
        if(pos < 0){
            return 0;
        }
        if(pos >= N){
            return 2;
        }
        c = s[pos];
    }
    return 1;
}

long long int bin_search(long long int lef, long long int rig, int num){
	long long int middle = (lef + rig) / 2;
	//cout << middle << " ";
	if(rig - lef <= 1){
        return lef;
	}
	if(check(middle) == num){
		lef = middle;
	}else{
		rig = middle;
	}
	return bin_search(lef, rig, num);
}

int main(){
    cin >> N >> Q;
    cin >> s;
    for(int i = 0; i < Q; i++){
        string t, d;
        cin >> t >> d;
        v.push_back(t + d);
    }
    long long int pos1 = bin_search(-1, N, 0);
    long long int pos2 = bin_search(pos1, N, 1);
    cout << pos2 - pos1 << endl;
    return 0;
}

Measured memory_bytes: 11508
s = input()
t = input()

ma = {c : [] for c in s}
mb = {c : [] for c in t}
for i in range(len(s)):
    ma[s[i]].append(i)
    mb[t[i]].append(i)

a = [item for item in ma.values()]
b = [item for item in mb.values()]
a.sort()
b.sort()
if(a==b):
    print('Yes')
else:
    print('No')


Measured memory_bytes: 14256
#include <iostream>
#include <string>

using namespace std;

string A, B;

int main() {
  cin >> A;
  cin >> B;
  int a = 0, b = 0;
  int sz = A.size() + B.size();
  for (int i = 1; i <= sz; i++) {
    if (i % 2 == 0) {
      cout << B[b];
      b++;
    } else {
      cout << A[a];
      a++;
    }
  }
  return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include<iostream>
#include<map>
#include<algorithm>
#include<vector>
#include <cmath>
#include <iomanip>
#include <regex>
#include <bits/stdc++.h>
#include <string>
using namespace std;


int main(){
    long N;
    cin>>N;
    long res = (N-1)*N/2;
    cout<<res<<endl;

}

Measured memory_bytes: 256
// Author: getharshkumar

#include <bits/stdc++.h>
using namespace std;
#define ll int64_t
const ll N = 1e6 + 6, M = 1e9 + 7;
ll a[N];
int main()
{
    ios::sync_with_stdio(false), cin.tie(nullptr);
    ll n;
    cin >> n >> a[0];
    a[0]--;
    for (ll i = 1; i < n; i++)
    {
        cin >> a[i];
        if (a[i] > a[i - 1])
            a[i]--;
        else if (a[i] < a[i - 1])
            return cout << "No", 0;
    }
    cout << "Yes";
    return 0;
}

Measured memory_bytes: 1024
#include<iostream>
#include<vector>
#include<algorithm>
int main() {
	int n, m;
	std::cin >> n >> m;
	std::vector<std::pair<int, int>>p(m);
	for (int i = 0; i < m; i++)std::cin >> p[i].first >> p[i].second;
	int ans = 0;
	std::sort(p.begin(), p.end(), [](const auto a, const auto b) {return a.second < b.second; });
	int flag = 0;
	for (std::pair<int, int>i : p) {
		if (flag <= i.first) {
			ans++;
			flag = i.second;
		}
	}
	printf("%d\n", ans);
}

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

#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false

int main()
{
   int n,m;
   cin>>n>>m;
   vector<int> a(n);
   rep(i,m){
       int e,f;
       cin>>e>>f;
       a[e-1]++;
       a[f-1]++;
   }
   rep(i,n){
       cout<<a[i]<<endl;
   }
    return 0;
}

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

int main() {
	int X, A;
	cin >> X >> A;

	if (X < A) {
		cout << 0 << endl;
	}
	else {
		cout << 10 << endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <vector> 
#include <algorithm> 
using namespace std;
typedef long long ll;
const long long mod = 1e9+7;
int main (){
	int N, M;
	cin >> N >> M;
    
    vector<int> inputvec(N+1,true);

    for(int i = 0; i< M; i++ ){
        int a;
        cin >> a;
        inputvec[a]=false;
    }
    
    vector<int> dp(N+2,0);
    dp[N]=1;
    for(int i = N-1; i>-1; i-- ){
        if(inputvec[i]==true){
            dp[i]=dp[i+1] + dp[i+2];
            dp[i]%=mod;

        }
    }

    cout<<dp[0]<<endl;
    return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>
#include <map>

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

const ll MOD = 1000000007;

template <typename T>
T gcd(T a, T b) {
	if (a < b) swap(a, b);
		while (b != 0) {
			T tmp = b;
			b = a % b;
			a = tmp;
		}
	return a;
}

P red(P p){
    if(p.first == 0) return P(0, 1);
    if(p.second == 0) return P(1, 0);
    bool is_neg = false;
    if(p.first > 0) is_neg = false;
    else is_neg = true;
    ll g = gcd<ll>(abs(p.first), abs(p.second));
    if(!is_neg) return P(p.first/g, p.second/g);
    else return P(-p.first/g, -p.second/g);
}

P rest(P p){
    if(p.first == 0) return P(1, 0);
    if(p.second == 0) return P(0, 1);
    return red(P(p.second, -p.first));
}

vector<int> zero;
map<P, vector<int>> mp;
int N;
ll pow2[200005];

void init(){
    pow2[0] = 1;
    for(int i = 1; i <= 200000; i++){
        pow2[i] = (pow2[i-1]*2)%MOD;
    }
}

set<P> st;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << setprecision(10) << fixed;
    cin >> N;
    init();
    for(int i = 0; i < N; i++){
        ll a, b;
        cin >> a >> b;
        if(a == 0 && b == 0) zero.push_back(i);
        else{
            P p = red(P(a, b));
            mp[p].push_back(i);
        }
    }
    ll ans = 1;
    
    for(auto i : mp){
        P p = i.first;
        if(st.count(p) != 0) continue;
        auto v = i.second;
        P q = rest(p);
        st.insert(p);
        st.insert(q);
        // cout << p.first << '/' << p.second << ' ' << q.first << '/' << q.second << endl;
        if(mp.count(q) == 0){
            ans *= pow2[v.size()];
            ans %= MOD;
        }else{
            auto u = mp[q];
            ans*= (pow2[v.size()]+pow2[u.size()]-1);
            ans %= MOD;
        }
    }
    ans += zero.size();
    ans %= MOD;
    cout << (ans-1+MOD)%MOD << endl;
}

Measured memory_bytes: 52008
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long long int lli;
typedef long double ld;
const int oo = 1e9;
//const int mod = 1e9+9;
/*ll gcd(ll x, ll y){return (y ? gcd(y, x%y) : x); }
*ll lcm(ll x, ll y){return x*(y/gcd(x,y));}
*void exEuclid(int a, int b){
	if(b==0){x = 1; y=0; d=a; return ;}
	exEuclid(b, a%b);
	int x1=y;
	int y1=x-(a/b)*y;
	x=x1; 100000
	y=y1;
} 
* */
//===========================================================//
int n;
const int nx = 1e5+5;
int ac[nx][3];
int dp[3][nx];
int go(int a, int i){
	if(i == n) return 0;
	if(dp[a][i] != -1) return dp[a][i];
	int& ans = dp[a][i];
	
	if(a==0){
		ans=max(ans, go(1, i+1)+ac[i][0]);
		ans=max(ans, go(2, i+1)+ac[i][0]);
	}
	if(a==1){
		ans=max(ans, go(0, i+1)+ac[i][1]);
		ans=max(ans, go(2, i+1)+ac[i][1]);
	}
	if(a==2){
		ans=max(ans, go(0, i+1)+ac[i][2]);
		ans=max(ans, go(1, i+1)+ac[i][2]);
	}
	
	return ans;
}
int main(){
	cin>>n;
	for(int i=0; i<n; i++) cin>>ac[i][0]>>ac[i][1]>>ac[i][2];
	memset(dp, -1, sizeof dp);
	cout<<max(go(0,0),max(go(1,0),go(2,0)))<<"\n";
	return 0;
}

Measured memory_bytes: 7296
arr = $stdin.gets.chomp.split""
arr.map! do |a_j|
 a_j.to_i
end

for i in 0..2
  if arr[i] == 1
    arr[i] = 9
  elsif arr[i] == 9
      arr[i] = 1
  end
end

arr.each do |x|
  print x
end

puts ""

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

int main(){

const int n = 3;
const int num = 10;
int t;

int a[num] = {0};
int b[n] = {0};
for(int i = 0; i < num; i++)
{
	cin >> a[i];
}
b[0] = a[0];
for(int i = 1; i < num; i++)
{
	t = a[i];
	for(int j = 0;j < n; j++)
	{
		if(t > b[j])
		{
			for(int k = n-1; k >= j+1; k--)
			{
			b[k] = b[k-1];
			}
		b[j] = t;
		break;
		}
	
	}

}
for(int i = 0;i < n;i++)
	cout << b[i] << "\n";
    return 0;
}

Measured memory_bytes: 1160
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char) 
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n: i32 = read();
    let y: i32 = read();
    for i in 0..n+1 {
        for j in 0..n-i+1 {
            let k = n-i-j;
            if k < 0 {
                continue;
            }
            if i*10000 + j*5000 + k*1000 == y {
                println!("{} {} {}", i, j, k);
                return;
            }
        }
    }
    print!("-1 -1 -1");
}


Measured memory_bytes: 4352
n = int(input())
B = list(map(int, input().split()))


A0 = B[0]
An = B[-1]
A = []
A.append(A0)
for i in range(n - 2):
    a = min(B[i], B[i + 1])
    A.append(a)
A.append(An)

print(sum(A))


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

int gcd(int a, int b)
{
    int c;

    if (a < b) {
        a+=b; b=a-b; a-=b;
    }

    while (b != 0) {
        c = a % b;
        a = b;
        b = c;
    }

    return a;
}

int main(void){
    int a;
    bool ans = false;
    cin >> a;
    if (a == 2) ans = true;
    cin >> a;
    if (a == 2) ans = true;
    if (ans == true) cout << "No" << endl;
    else cout  << "Yes" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <bits/stdc++.h>
 
using namespace std;
long long int N, M, Q;
long long int ans = 0;
string S;
vector<long long int>a, b, c, d;
 
 
 
int main() {
    cin >> S;
    if (S[2]==S[3]&&S[4]==S[5]) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 3624
//author:luckYrat(twitter:@luckYrat_)
//#include <bits/stdc++.h>

//def
#include <iostream>

#include <cmath>
#include <algorithm>
#include <iomanip>

//array
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <utility>
#include <climits>



using namespace std;

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

#define anyfill(n,s) setw(n) << setfill(s)
#define loop(s) for(int i = 0; s > i; i++)
#define rep(i,q) for(int i = 0; (q) > i; i++)
#define repp(i,n,q) for(int i = n; (q) > i; i++)
#define dep(i,q) for(int i = (q); 0 < i; i--)


#define MAX 1000000000
const int mod = 1000000007;
#define EPS (1e-10)

#define pb push_back
#define fir first
#define scn second
#define ednl endl

#define YesNo(a) (a?"Yes":"No")
#define YESNO(a) (a?"YES":"NO")
#define yesno(a) (a?"yes":"no")


P ar4[4] = {{0,1},{0,-1},{1,0},{-1,0}};
P ar8[8] = {{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,-1},{1,0},{1,1}};
/*
確認ポイント
cout << fixed << setprecision(n) << 小数計算//n桁の小数表記になる
vector.unique()は隣接した同じ要素を削除するので先にソートをする

計算量は変わらないが楽できるシリーズ
C++11以降でmin({a,b,c...})で複数個のmic,maxを処理できる
min(max)_element(iter,iter)で一番小さい(大きい)値のポインタが帰ってくる
count(iter,iter,int)でintがiterからiterの間にいくつあったかを取得できる

*/
__attribute__((constructor))
void initial() {
 cin.tie(0);
 ios::sync_with_stdio(false);
}



int main(){
  int a,b;cin>>a>>b;
  if(a==b)cout << a*2 << endl;
  else cout << max(a,b)*2-1 << endl;
}


Measured memory_bytes: 256
N, K, S = map(int, input().split())
ans = []

if S == 10**9:
    for _ in range(K):
        ans.append(S)
    for _ in range(N-K):
        ans.append(1)
else:
    for _ in range(K):
        ans.append(S)
    for _ in range(N-K):
        ans.append(S+1)

print(*ans)


Measured memory_bytes: 13784
//失敗するからこそそこから立ち向かって行く強さがあってそんな強さが本当の強さだと私は思うから
// ぜったいあきらめない
#include<bits/stdc++.h>
using namespace std;
 
#if defined(DAIJOBU)
#include "/home/ichigo/debug.hpp"
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define deb(x...)
#endif
#define FIO {ios::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr);}


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


Measured memory_bytes: 256
#include<iostream>
#include<vector>

using namespace std;
using ll = long long ;

int main(){
    ll n,k;
    cin>>n>>k;
    ll ans =0;
    for (ll i=k+1;i<=n;i++){
        ans +=((n-k)/i +1) * (i-k);
        if(n%i>=k){
            ans -= (i-1-n%i);
        }
    }
    if (k==0) ans -= n;
    cout<<ans<<endl;
}

Measured memory_bytes: 256
// #pragma GCC optimize(2)
// #pragma G++ optimize(2)
// #pragma comment(linker,"/STACK:102400000,102400000")

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

typedef long long int64;
typedef unsigned int ui;
typedef unsigned long long ull;
typedef float fl;
typedef double dl;
typedef pair<int,int> pii;
#if (WIN32) || (WIN64) || (__WIN32) || (__WIN64) || (_WIN32) || (_WIN64) || (WINDOWS)
#define lld "%I64d"
#define llu "%I64u"
#else
#define lld "%lld"
#define llu "%llu"
#endif
#define uint(n) ((unsigned int)(n))
#define int64(n) ((long long)(n))
#define ull(n) ((unsigned long long)(n))
#define fl(n) ((float)(n))
#define dl(n) ((double)(n))
#define char(n) ((char)(n))
#define Bool(n) ((bool)(n))
#define fixpoint(n) fixed<<setprecision(n)

const int INF=1061109567;
const int NINF=-1044266559;
const int64 LINF=4557430888798830399;
const dl eps=1e-15;
#define MOD (1000000007)
#define PI (3.1415926535897932384626433832795028841971)

#define MP make_pair
#define MT make_tuple
#define All(a) (a).begin(),(a).end()
#define pall(a) (a).rbegin(),(a).rend()
#define Log(x,y) log(x)/log(y)
#define SZ(a) ((int)(a).size())
#define rep(i,n) for(int i=0;i<((int)(n));i++)
#define rep1(i,n) for(int i=1;i<=((int)(n));i++)
#define repd(i,n) for(int i=((int)(n))-1;i>=0;i--)
#define repd1(i,n) for(int i=((int)(n));i>=1;i--)
#define repv(itr,v) for(__typeof((v).begin()) itr=(v).begin();itr!=(v).end();itr++)
#define repV(i,v) for(auto i:v)
#define repE(i,v) for(auto &i:v)
#define MS(x,y) memset(x,y,sizeof(x))
#define MC(x) MS(x,0)
#define MINF(x) MS(x,63)
#define MCP(x,y) memcpy(x,y,sizeof(y))
#define UN(v) sort(All(v)),v.erase(unique(All(v)),v.end())
#define filein(x) freopen(x,"r",stdin)
#define fileout(x) freopen(x,"w",stdout)
#define fileio(x)\
	freopen(x".in","r",stdin);\
	freopen(x".out","w",stdout)
#define filein2(filename,name) ifstream name(filename,ios::in)
#define fileout2(filename,name) ofstream name(filename,ios::out)
#define fileio2(filename,name) fstream name(filename,ios::in|ios::out)
#define sqr(x) ((x)*(x))
#define Pause system("pause")
#define Cls system("cls")
#define fs first
#define sc second
#define SF scanf
#define PF printf

const int maxn=INF;

inline int64 powmod(int64 a,int64 b){int64 res=1;a%=MOD;assert(b>=0);for(;b;b>>=1){if(b&1)res=res*a%MOD;a=a*a%MOD;}return res%MOD;}

int main()
{
	int64 n;cin>>n;
	cout<<((powmod(10,n)-powmod(9,n)*2+powmod(8,n)+MOD)%MOD+MOD)%MOD;

	return 0;
}

Measured memory_bytes: 3560
N, K = [int(_) for _ in input().split()]
MOD = 10 ** 9 + 7

ans = 0


class ModFactorial:
    """
    階乗, 組み合わせ, 順列の計算
    """

    def __init__(self, n, MOD=10 ** 9 + 7):
        """

        :param n: 最大の要素数.
        :param MOD:
        """
        kaijo = [0] * (n + 10)
        gyaku = [0] * (n + 10)

        kaijo[0] = 1
        kaijo[1] = 1
        for i in range(2, len(kaijo)):
            kaijo[i] = (i * kaijo[i - 1]) % MOD
        gyaku[0] = 1
        gyaku[1] = 1
        for i in range(2, len(gyaku)):
            gyaku[i] = pow(kaijo[i], MOD - 2, MOD)
        self.kaijo = kaijo
        self.gyaku = gyaku
        self.MOD = MOD

    def nCm(self, n, m):
        return (self.kaijo[n] * self.gyaku[n - m] * self.gyaku[m]) % self.MOD

    def nPm(self, n, m):
        return (self.kaijo[n] * self.gyaku[n - m]) % self.MOD

    def factorial(self, n):
        return self.kaijo[n]


mf = ModFactorial(N, MOD)
for i in range(1, N + 1):
    if N - i > K: continue

    p = N - i
    # print(i, p, mf.nCm(p + i - 1, i - 1))
    ans += mf.nCm(p + i - 1, i - 1) * mf.nCm(N, i)
    ans %= MOD
print(ans)


Measured memory_bytes: 82016
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE MultiWayIf #-}


import Control.Arrow
import Control.Concurrent
import Control.Monad
import qualified Data.ByteString.Char8 as C
import Data.Complex
import Data.Function
import Data.Function.HT
import qualified Data.IntMap.Strict as IM
import qualified Data.IntSet as IS
import Data.List
import Data.Ord
import Data.Maybe
import qualified Data.Sequence as Sq
import Data.Vector.Algorithms.Search
import qualified Data.Vector as V
import qualified Data.Vector.Mutable as VM
import qualified Data.Vector.Unboxed as U
import qualified Data.Vector.Unboxed.Mutable as UM
import Debug.Trace


------------------
-- #   Read   # --
------------------

r :: Int -> IO (U.Vector Int)
r n = U.unfoldrN n (C.readInt . C.dropWhile (==' ')) <$> C.getLine

r' :: IO [Int]
r'  =   unfoldr    (C.readInt . C.dropWhile (==' ')) <$> C.getLine



main :: IO ()
main = do
    s <- r'
    print $ succ $ fromMaybe 0 $ elemIndex 0 s



Measured memory_bytes: 3776
def bingo():
    # 初期処理
    A = list()
    b = list()
    comb_list = list()
    is_bingo = False
    # 入力
    for _ in range(3):
        dummy = list(map(int, input().split()))
        A.append(dummy)
    N = int(input())
    for _ in range(N):
        dummy = int(input())
        b.append(dummy)
    # ビンゴになる組み合わせ
    for i in range(3):
        # 横
        comb_list.append([A[i][0], A[i][1], A[i][2]])
        # 縦
        comb_list.append([A[0][i], A[1][i], A[2][i]])
    # 斜め
    comb_list.append([A[0][0], A[1][1], A[2][2]])
    comb_list.append([A[0][2], A[1][1], A[2][0]])
    # 集計（出現した数字をnullに置き換え)
    for i in b:
        for j in range(8):
            for k in range(3):
                if i == comb_list[j][k]:
                    comb_list[j][k] = 'null'
    # すべてnullのリストの存否
    for i in comb_list:
        for j in i:
            if 'null' != j:
                is_bingo = False
                break
            else:
                is_bingo = True
        # 一組でもbingoがあれば即座に関数を抜ける
        if is_bingo == True:
            return 'Yes'
    # すべてのリストを確認後
    if is_bingo == False:
        return 'No'
        

result = bingo()
print(result)


Measured memory_bytes: 9176
#include<iostream>
#include<string>
#include<queue>
using namespace std;

int main()
{
	int k;
	string str;
	cin >> str;

	priority_queue<int> cpp;
	while (str != "end")
	{
		if (str[0] == 'i')
		{
			cin >> k;
			cpp.push(k);
			
		}
		else if (str[0] == 'e')
		{
			cout << cpp.top() << endl;
			cpp.pop();
		}
			cin >> str;
	}
	
	return 0;
}


Measured memory_bytes: 7044
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <numeric>
//#include <stdio.h>
//#include <stack>
//#include <queue>
#include <cstdio>
#include <cmath>
#include <iterator>
#include <map>
//#include <fstream>
//#include <list>
//#include <iomanip>
#include <cctype>

using namespace std;

#define MOD 1000000007
#define Int int64_t
#define PI 3.14159265358979
#define ssort(z) sort(z.begin(),z.end())
#define eerase(z) z.erase(unique(z.begin(),z.end()),z.end())
#define ccnt(z,w) count(z.begin(),z.end(),w)


void printVec(std::vector<int> & vec) {
	std::cout << "";
	for (auto it = vec.begin(); it != vec.end(); ++it) {
		std::cout << *it << " ";
	}
	std::cout << std::endl;
}
void printVec1(std::vector<string>& vec) {
	std::cout << "";
	for (auto it = vec.begin(); it != vec.end(); ++it) {
		std::cout << *it << " ";
	}
	std::cout << std::endl;
}

Int gcd(Int a, Int b) {
	return b != 0 ? gcd(b, a % b) : a;
}
Int lcm(Int a, Int b) {
	return a * b / gcd(a, b);
}

bool comp(const string a, const string b) {
	return a.length() < b.length();
}

bool integer(double num) {
	return floor(num) == num;
}

string gen(int num) {
	string str = "";
	for (int i = 0; i < num; i++) str += ".";
	return str;
}
Int fact(int num) {
	if (num == 0) return 1;
	else return num * fact(num - 1);
}

int main() {
	int n, k,temp; cin >> n >> k;
	vector<pair<int,int>> a(n);
	for (int i = 0; i < n; i++) {
		cin >> temp;
		a[i] = make_pair(temp,i);
	}
	n--; k--;
	cout << (n+k-1)/k;

	cout << endl;
	return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ios_base:: sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    string s;cin>>s;
    ll mm = s[5]-'0';
    mm*=10;
    mm+=s[6]-'0';
    if(mm<=4)cout<<"Heisei";
    else cout<<"TBD";
}

Measured memory_bytes: 256
n = int(input())
s = list(map(int, input().split()))

if s == sorted(s):
  print('YES')
else:
  
  s1 = sorted(s)
  count = 0
  for i in range(n):
    if s1[i]!=s[i]: count+=1
      
  if count==2:
    print('YES')
  else:
    print('NO')



Measured memory_bytes: 2940
/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
     public static long minCost(int []w , int []v , int curr_ind , int n , long [][]dp , int k_w){
	        if(curr_ind > n || k_w <= 0 )
	        return 0;
	        
	        if(dp[curr_ind][k_w]!=-1) return dp[curr_ind][k_w];
	        
	        long a = Long.MIN_VALUE;
	        
	        // do not pick
	        a = Math.max(a , minCost(w,v,curr_ind + 1 , n , dp , k_w ) );
	        
	        //pick the element
	       
	         
	        
	        if(w[curr_ind] <= k_w ){
	            
	       //      System.out.println("pick the ele :");
	       //  System.out.println("item w : "+ w[curr_ind]);
	       //   System.out.println("knap w : "+ k_w);
	            
	          
	             a = Math.max(a , (v[curr_ind] + minCost(w , v , curr_ind + 1 ,n, dp ,  k_w - w[curr_ind])) );
	        }
	        
	        
	       
	        
	        return dp[curr_ind][k_w] = a;
	        
	        
	    }
    
	public static void main (String[] args) throws java.lang.Exception
	{
	    
	   
	    
	    
		// your code goes here
		 Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = sc.nextInt();
		int k_w = sc.nextInt();
		
	//	System.out.println("W : "+k_w);
		    int w[] = new int[n+1];
			int v[] = new int[n+1];
			
			
		for(int i = 1 ;i<=n;i++){
		  
		    w[i] = sc.nextInt();
		    v[i] = sc.nextInt();
		    
			}
			
			
			long dp[][]=new long[n + 1][k_w + 1];
			
			for(int i=0;i<n+1;i++){
		      for(int j =0;j<k_w + 1;j++){
			dp[i][j] = -1 ;
			}}
			
			System.out.println(minCost(w , v, 1 , n , dp , k_w));
	}
}


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

int n,m,buc[100005],buc2[100005],d[100005];

int main(){
	scanf("%d%d",&n,&m);
	for(int i=1,x;i<=n;++i){
		scanf("%d",&x);
		++buc[x],++buc2[x%m];
	}
	int ans=buc2[0]/2;
	if(m%2==0)ans+=buc2[m/2]/2;
	for(int i=1;i<=(m-1)/2;++i){
		int t=min(buc2[i],buc2[m-i]);
		ans+=t;
		d[i]+=t,d[m-i]+=t;
	}
	for(int i=1;i<m;++i)
		if(i*2!=m){
			int sum=0,cnt[2]={};
			for(int j=i;j<=100000;j+=m)
				sum+=buc[j],++cnt[buc[j]&1];
			if(d[i]<=cnt[1])cnt[1]-=d[i];
			else cnt[1]=d[i]-cnt[1]&1;
			ans+=(sum-d[i]-cnt[1])/2;
		}
	printf("%d\n",ans);
}


Measured memory_bytes: 1408
#include <stdio.h>
int main(void )
{
	int s;
	int H;
	int M;
	int S;
	
	scanf("%d", &s);
	
	H = s / 3600;
	M = (s - (3600 * H)) / 60;
	S = s - ((M * 60) + (H * 3600));
	
	
	
	
	printf("%d:%d:%d\n", H, M, S);
	
	
	return (0);
}

Measured memory_bytes: 592
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <numeric>
#include <cmath>

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

template<class T> inline bool chmin(T& a,T b) {if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a,T b) {if (a < b) {a = b; return true;} return false;}

const ll MOD = 1000000007;
const int INF = 1<<30;
//const ll INF = (ll)1e18 + 1;

int main(){
  int a, b, c; cin >> a >> b >> c;
  if (b + c >= a) cout << b + c - a << endl;
  else cout << 0 << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int x = 0;
		while (true) {
			int a = sc.nextInt();
			String op = sc.next();
			int b = sc.nextInt();
			if (op.equals("?")) {
				break;
			} else if (op.equals("+")) {
				x = a + b;
			} else if (op.equals("-")) {
				x = a - b;
			} else if (op.equals("*")) {
				x = a * b;
			} else {
				x = a / b;
			}
			System.out.println(x);
		}
	}
}



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

#define F first
#define S second
#define int long long
#define ull  unsigned long long
#define pb push_back

using namespace std;
using namespace __gnu_pbds;
typedef  tree< int , null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
const int N = 600000;
const int K = 1000000000;
int a[N], b[N];
main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt","w", stdout);
    int n;
    cin >> n;
    int s1 = 0;
    int s2 = 0;
    for (int i = 1; i <= n; i++){
        cin >> a[i];
        s1 += a[i];
    }
    for (int i = 1; i <= n; i++){
        cin >> b[i];
        s2 += b[i];
    }
    int k = s2 - s1;
    if (k < 0){
        cout << "No";
        return 0;
    }
    int x = k + k;
    int y = k;
    for (int i = 1; i <= n; i++){
        if (abs(a[i] - b[i]) % 2 == 1){
            b[i]++;
            y--;
        }
        if (a[i] < b[i]) x -= b[i] - a[i]; else y -= a[i] - b[i];
    }
    if (x < 0 || y < 0){
        cout << "No";
    } else{
        cout << "Yes";
    }
}


Measured memory_bytes: 2432
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int[] org_X = new int[N];
		int[] sort_X = new int[N];
		
		for(int i = 0 ; i < N ; i++){
			org_X[i] = scan.nextInt();
			sort_X[i] = org_X[i];
		}
		Arrays.sort(sort_X);
		
		if( N%2 == 1 ){
			System.out.println("input error");	
		}
		else if( N == 2 ){
			System.out.println(org_X[1]);
			System.out.println(org_X[0]);
		}
		else{
			for(int index = 0 ; index < N ; index++){
				
				if (org_X[index] <= sort_X[N/2-1] ){
					System.out.println(sort_X[N/2]);		
				}
				else {
					System.out.println(sort_X[N/2-1]);			
				}
			}	
		}
	}
}



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




long long memo[100100],A[100100],B[100100];

int main(){
	for(long long i = 2; i <= 100010; i++){
		if(memo[i] == 0) A[i]=1;
	
		for(long long j = 1; i*j <= 100010; j++)
			memo[i*j] = 1;
}

	for(long long i=3;i<100010;i++){
		if(A[i]==1&&A[(i+1)/2]==1) B[i]=1;
	}
	
	for(long long i=1;i<100010;i++){
		B[i]+=B[i-1];
	}
	
	long long n,a,b;
	cin >> n;
	for(long long i=0;i<n;i++){
		cin >> a >> b;
		cout << B[b]-B[a-1] << endl;
	}
	
	return 0;
}

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

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

    cout << 800*n - 200*(n/15) << endl;
    
    return 0;
}

Measured memory_bytes: 3612
/*	
	:)
*/
#include <bits/stdc++.h> 
using namespace std;
#define fl(i,a,b) for(int i=a;i<b;i++)
#define endl '\n'
#define pb push_back
#define ff first
#define ff first
#define ss second
#define inf 2e18
#define mod 998244353
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define mx 205
#define ll long long
#define pi 3.1415926535897932384626433
void solve()
{
	int n;
	cin >> n;
	n %= 10;
	if(n == 3)
	{
		cout << "bon" << endl;
	}
	else if(n == 0 || n == 1 || n == 6 || n == 8)
	{
		cout << "pon";
	}
	else cout << "hon";
}
main()
{
	fast;
	int t =  1;
	while(t--)
	{
		solve();
	}
}

Measured memory_bytes: 3636
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
int N;
std::vector<double> x, y;
int main(){
    std::cin >> N;
    x.resize(N);
    y.resize(N);
    int n = 1;
    std::vector<double> num(N);
    for(int i = 0; i < N; i++){
        std::cin >> x[i] >> y[i];
        num[i] = i + 1;
        n *= i + 1;
    }
    double ans = 0;
    do{
        for(int i = 1; i < N; i++) ans += std::sqrt((x[num[i] - 1] - x[num[i - 1] - 1])* (x[num[i] - 1] - x[num[i - 1] - 1]) + (y[num[i] - 1] - y[num[i - 1] - 1])* (y[num[i] - 1] - y[num[i - 1] - 1]));
    }while(std::next_permutation(num.begin(), num.end()));
    ans = ans / n;
    printf("%.10lf\n", ans);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll mod = 998244353;
#define s(x, n) memset(x, n, sizeof(x));
#define pb(x) push_back(x)
#define NIL -1
#define MAX 200010
ll n, q;
ll p[MAX];
ll b[MAX];
ll tree[4 * MAX];
ll lazy[4 * MAX];

void build(int node, int start, int end)
{
    if (start == end)
        tree[node] = 1;
    else
    {
        int mid = (start + end) / 2;
        build(2 * node, start, mid);
        build(2 * node + 1, mid + 1, end);
        // cout << b[mid - start + 1] << " ";
        tree[node] = ((tree[2 * node] * b[end - mid]) % mod + (tree[2 * node + 1]) % mod) % mod;
        //cout << tree[node] << "\n";
    }
}
void updaterange(int node, int start, int end, int l, int r, int val)
{
    if (lazy[node] != 0)
    {
        tree[node] = ((p[end - start + 1]) * lazy[node]) % mod;
        if (start != end)
        {
            lazy[node * 2] = lazy[node];
            lazy[node * 2 + 1] = lazy[node];
        }
        lazy[node] = 0;
    }
    if (start > end || start > r || end < l)
        return;
    if (start >= l && end <= r)
    {
        // cout << (p[end - start + 1]) << " " << start << " " << end << "\n";

        tree[node] = (val * p[end - start + 1]) % mod;
        //cout << "d- " << end - start + 1 << "\n";
        if (start != end)
        {
            lazy[node * 2] = val;
            lazy[node * 2 + 1] = val;
        }
        return;
    }
    ll mid = (start + end) / 2;
    updaterange(2 * node, start, mid, l, r, val);
    updaterange(2 * node + 1, mid + 1, end, l, r, val);
    tree[node] = ((tree[2 * node] * b[end - mid]) % mod + (tree[2 * node + 1]) % mod) % mod;
    //cout << tree[node] << " " << b[mid - start + 1] << "\n";
    //cout << tree[node] << "\n";
}

void solve()
{
    cin >> n >> q;
    p[0] = 0;
    b[0] = 1;
    for (int i = 1; i <= n; i++)
    {
        p[i] = (p[i - 1] + b[i - 1]) % mod;
        b[i] = (b[i - 1] * (ll)10) % mod;
        //cout << p[i] << " ";
    }
    build(1, 1, n);
    // cout << queryrange(1, 1, n, 1, n) % mod << "\n";
    //cout << tree[1] << "\n";
    while (q--)
    {
        int l, r, d;
        cin >> l >> r >> d;
        updaterange(1, 1, n, l, r, d);
        cout << tree[1] % mod << "\n";
    }
}
int main()
{
#ifdef WIN32
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

#ifndef WIN32
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#endif
    int t;
    t = 1;
    /// cin >> t;
    for (int I = 1; I <= t; I++)
    {
        solve();
    }
    return 0;
}


Measured memory_bytes: 14944
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
#include<queue>
using namespace std;
const int mod = 1000000007;
#define ll long long

int main()
{
	int A, B;
	cin >> A >> B;
	cout << max(0, A - B * 2) << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
long double pi = 2 * acos(0.0);
const ll mod = 1e9 + 7;

void solve() {
    ll x;
    cin >> x;
    if(!x) cout << "1\n";
    else cout << "0\n";    
}   

int main() {
    ios_base :: sync_with_stdio(false); 
    cin.tie(nullptr);   
    ll t = 1;
    //cin >> t;
    while(t--) {
        solve();
    }
    return 0;
}

Measured memory_bytes: 3616