akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)n; i++)
#define all(x) (x).begin(),(x).end()
typedef long long int ll;
using namespace std;
int main()
{
  string a,b;
  cin >> a>> b;
  cout <<b <<a<< endl;

}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/numeric/interval.hpp>
#include <boost/numeric/interval/io.hpp>
#include <boost/any.hpp>
using namespace::std;
namespace mp = boost::multiprecision;
typedef mp::number<mp::cpp_dec_float<32,int64_t>> cfloat;
typedef mp::cpp_int cint;
typedef long long lint;
typedef long long ll;
typedef long double ldouble;
typedef vector<lint> vec;
typedef vector<vector<lint>> mat;
typedef vector<vector<vector<lint>>> mat3;
typedef vector<double> dvec;
typedef vector<vector<double>> dmat;
typedef vector<vector<vector<double>>> dmat3;
typedef vector<string> svec;
typedef vector<vector<string>> smat;
typedef vector<vector<vector<string>>> smat3;
typedef vector<pair<lint,lint>> pvec;
typedef vector<vector<pair<lint,lint>>> pmat;
typedef vector<vector<vector<pair<lint,lint>>>> pmat3;
#define rep(i, n) for(lint i = 0; i < (lint)(n); i++)
#define irep(i) for(lint i = 0;; i++)
#define irep1(i) for(lint i = 1;; i++)
#define irep2(i) for(lint i = 2;; i++)
#define rrep(i, n) for(lint i = (lint)(n-1); i >-1; i--)
#define rrepi(i,a,b) for(lint i = (lint)(b-1); i >a-1; i--)
#define repi(i,a,b) for(lint i=lint(a);i<lint(b);i++)
#define rep2(i,a,b,c) for(lint i=lint(a);i>lint(b);i+=c)
#define all(x) (x).begin(),(x).end()
#define PI 3.141592653589793
#define cout (cout<<fixed<<setprecision(15))
#define dist(x1,y1,x2,y2) (pow(pow(x2-x1,2)+pow(y2-y1,2),0.5))
#define output(v) do{bool f=0;for(auto i:v){cout<<(f?" ":"")<<i;f=1;}cout<<"\n";}while(0)
#define output2(v) for(auto i:v)output(i);
#define input(a,n) lint n;cin>>n;vector<lint>a(n);rep(i,n)cin>>a[i];
//#define sum(v) accumulate(all(v),0LL)
#define INF (1LL<<60)
#define IINF (1<<30)
#define LINF 9223372036854775807
#define MOD 1000000007
vector<lint> dx={-1,1,0,0,1,1,-1,-1};
vector<lint> dy={0,0,-1,1,1,-1,1,-1};
inline lint gcd(lint a,lint b){return b?gcd(b,a%b):a;}
inline lint lcm(lint a,lint b){return a*b/gcd(a,b);}
int main(){
    lint x,y;
    cin>>x>>y;
    if(abs(x-y)<2)cout<<"Brown";
    else cout<<"Alice";
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <queue>
#include <vector>
#include <stack>
#include <set>

using namespace std;

typedef long long ll;
#define mems(p) memset(p,0,sizeof(p));
#define mp make_pair;

void fast()
{ios_base::sync_with_stdio(false);cin.tie(0);}

ll r,g,b,n;

ll dp(ll pos, ll sumLeft) {
	if (sumLeft==0) return 1;
	if (pos==3) {
		if (sumLeft%b == 0) return 1;
		else return 0;
	}
	ll sum=0;
	if (pos==1) {
		for (int i = 0; i <= sumLeft/r; ++i)
		{
			sum+=dp(2,sumLeft-r*i);
		}
		return sum;
	}
	if (pos==2)
	{
		for (int i = 0; i <= sumLeft/g; ++i)
		{
			sum+=dp(3,sumLeft-g*i);
		}
		return sum;
	}
	return -1;
}

int main() {
	cin>>r>>g>>b>>n;
	cout<<dp(1,n)<<endl;
}

Measured memory_bytes: 256
x,y,z,k = map(int, input().split())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

x = 0
y = 0
z = 0
cakes = []
for x, a in enumerate(A):
    if x+1 > k: break
        
    for y, b in enumerate(B):
        if (x+1)*(y+1) > k: break
            
        for z, c in enumerate(C):
            if (x+1)*(y+1)*(z+1) > k: break
                
            cakes.append(a+b+c)
    
cakes.sort(reverse=True)      
for cake in cakes[:k]:
    print(cake)

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

using namespace std;
#define _for(i,j,N) for(int i = (j);i < (N);i++)
#define _rep(i,j,N) for(int i = (j);i <= (N);i++)
#define _dec(i,j,N) for(int i = (N-1);i >= (j);i--)
#define ALL(x) x.begin(),x.end()
#define PB push_back
#define LL long long

template<typename T>
ostream& operator<<(ostream& os,const vector<T>& v) {
    _for(i,0,v.size()) os << v[i] << " ";
    return os;
}

template<typename T>
ostream& operator<<(ostream& os,const set<T>& v){
    for(typename set<T>::iterator it = v.begin();it != v.end();it++)
    os << *it <<" ";
    return os;
}

vector<LL> A;
vector<LL> B;

const LL maxn = 1e12;

bool valid(LL a1,LL a2){
    if(a1 < 0 || a2 < 0) return false;
    return true;
}

int main()
{
    int AA,BB,Q;
    cin >> AA >> BB >> Q;
    _for(i,0,AA){
        LL num;
        cin >> num;
        A.PB(num);
    }

    _for(i,0,BB){
        LL num;
        cin >> num;
        B.PB(num);
    }

    _for(i,0,Q){
        LL x;
        cin >> x;
        auto it = upper_bound(ALL(A),x);
        auto it2 = upper_bound(ALL(B),x);

        LL ans = maxn;

        LL a1,a2,b1,b2;
        a1 = (it == A.begin())?-1:*(it-1);
        a2 = (it == A.end())?-1:*(it);
        b1 = (it2 == B.begin())?-1:*(it2-1);
        b2 = (it2 == B.end())?-1:*(it2);

        if(valid(a1,b1)){
            LL dis1 = x-a1;
            LL dis2 = x-b1;
            ans = min(ans,max(dis1,dis2));
        }
        if(valid(a1,b2)){
            LL dis1 = x-a1;
            LL dis2 = b2 - x;
            LL aa = min(dis1,dis2);
            LL bb = max(dis1,dis2);
            ans = min(ans,aa*2+bb);

        }
        if(valid(a2,b1)){
            LL dis1 = a2-x;
            LL dis2 = x - b1;
            LL aa = min(dis1,dis2);
            LL bb = max(dis1,dis2);
            ans = min(ans,aa*2+bb);
        }
        if(valid(a2,b2)){
            LL dis1 = a2 - x;
            LL dis2 = b2 - x;
            ans = min(ans,max(dis1,dis2));
        }

        cout << ans << endl;
    }

    return 0;
}

Measured memory_bytes: 3060
#include <algorithm>
#include <bitset>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define MOD (1000000007l)
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)

using namespace std;

void solve() {
  ll N;
  string S;
  cin >> N >> S;
  ll ans = 0;
  rep (i, N - 2) {
    if (S[i] == 'A' and S[i+1] == 'B' and S[i+2] == 'C') ans++;
  }
  cout << ans << endl;
}

int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout.precision(12);
  cout << fixed;
  solve();
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,N) for(ll (i)=0;(i)<(N);(i)++)
#define chmax(x,y) x=max(x,y)
#define chmin(x,y) x=min(x,y)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int mod = 1000000007;
const int INF = 1001001001;

int main() {
  string s;
  cin >> s;
  int ans = 0;
  if (s[0] == s[1] && s[1] == s[2] && s[2] == 'R') ans = 3;
  else if (s[0] == s[1] && s[1] == 'R') ans = 2;
  else if (s[1] == s[2] && s[2] == 'R') ans = 2;
  else if (s[0] == 'R' || s[1] == 'R' || s[2] == 'R') ans = 1;
  cout << ans << endl;
}

Measured memory_bytes: 3616
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <utility>
#include <cstdlib>
#include <memory>
#include <queue>
#include <cassert>
#include <cmath>
#include <ctime>
#include <complex>
#include <bitset>
#include <fstream>
#include <unordered_map>
#include <unordered_set>
#include <numeric>

using namespace std;

#define ws ws_____________________
#define y1 y1_____________________
#define y0 y0_____________________
#define left left_________________
#define right right_______________
#define next next_________________
#define prev prev_________________
#define hash hash_________________

#define pb push_back
#define fst first
#define snd second
#define mp make_pair 
#define sz(C) ((int) (C).size())
#define forn(i, n) for (int i = 0; i < (int) n; ++i)
#define ford(i, n) for (int i = ((int) n) - 1; i >= 0; --i)
#define all(C) begin(C), end(C)

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef vector<vector <int> > vvi;
typedef vector<pii> vii;
typedef long double ld;
typedef complex<double> cd;
typedef vector<cd> vcd;

#define FILE_NAME "a"

const int MAXN = 2e5 + 10;
const int INF = 2e9;

string s;

bool read() {
	getline(cin, s);
	return true;
}

void solve() {
	forn(i, sz(s)) {
		if  (i == 4) {
			printf(" ");
		}
		printf("%c", s[i]);
	}
	puts("");
}

int main() {
#ifdef LOCAL
	freopen(FILE_NAME ".in", "r", stdin);
	// freopen(FILE_NAME ".out", "w", stdout);
#endif

	while (read()) {
		solve();
		break;
	}

#ifdef LOCAL
	cerr.precision(5);
	cerr << "Time: " << fixed << (double) clock() / CLOCKS_PER_SEC << endl;
#endif
	return 0;
}


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

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
#include <string>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cmath>
#include <climits>
#include <bitset>
#include <array>
#include <deque>
#include <queue>
#include <map>
#include <set>
#define all(x) (x).begin(),(x).end()

const int MOD = 1e9 + 7;

void solve(){

}
int main(){
    int N,K;
    cin >> N >> K;
    int cnt = 0;
    while (N > 0){
        N -= 2;
        cnt++;
    }
    if (cnt >= K) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }


    

    return 0;
}


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

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    vector<vector<vector<double>>> dp(n + 1, vector<vector<double>>(n + 1, vector<double>(n + 1)));
    for (int c = 0; c <= n; c++) {
        for (int b = 0; b + c <= n; b++) {
            for (int a = 0; a + b + c <= n; a++) {
                if (a == 0 && b == 0 && c == 0) {
                    continue;
                }
                dp[a][b][c] = n;
                if (a > 0) {
                    dp[a][b][c] += a * dp[a - 1][b][c];
                }
                if (b > 0) {
                    dp[a][b][c] += b * dp[a + 1][b - 1][c];
                }
                if (c > 0) {
                    dp[a][b][c] += c * dp[a][b + 1][c - 1];
                }
                dp[a][b][c] /= a + b + c;
            }
        }
    }
    int a = 0, b = 0, c = 0;
    for (int i = 0; i < n; i++) {
        int x;
        cin >> x;
        if (x == 1) {
            a++;
        } else if (x == 2) {
            b++;
        } else {
            c++;
        }
    }
    cout.precision(16);
    cout << fixed << dp[a][b][c] << endl;
}


Measured memory_bytes: 219940
#![allow(unused)]

use std::cmp;
use std::io::{self, BufRead};
use std::iter;

macro_rules! destruct_ {
  ($e: expr, ()) => (
    assert!($e.next().is_none())
  );
  ($e: expr, ($arg: ident, $( $args: ident, )*)) => (
    $arg = $e.next().unwrap();
    destruct_!($e, ($($args,)*))
  );
  ($e: expr, ($arg: ident $(, $args: ident )*)) => (
    $arg = $e.next().unwrap();
    destruct_!($e, ($($args,)*))
  );
}

macro_rules! into {
  ($e: expr, $($name: ident)*) => {
    let mut iter = $e.into_iter();
    destruct_!(iter, ($($name)*));
  }
}

macro_rules! get {
  ($i: ident) => (
    let stdin = io::stdin();
    let mut $i = Vec::new();
    for line in stdin.lock().lines() {
      $i.push(
        line
          .unwrap()
          .split_whitespace()
          .map(|a| a.parse().unwrap())
          .collect()
      );
    }
  )
}

macro_rules! p {
  ($a: expr) => (
    println!("{:?}", $a);
  )
}

fn main() {
  let mut args: Vec<Vec<i32>>;
  get!(args);
  let mut ls: &mut Vec<i32> = &mut args[1];

  ls.sort();
  p!(ls.iter().max().unwrap() - ls.iter().min().unwrap());
}


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

int main() {
  int n, i;
  cin >> n;
  
  vector<int> v(n);
  for(i = 0; i < n; i++){
    cin >> v.at(i);
  }
  
  sort(v.begin(), v.end());
  
  double keep = v.at(0);
  for(i = 1; i < n; i++){
    keep = (keep + v.at(i)) / 2;
  }
  
  cout << fixed << setprecision(20) << keep << endl;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    int[][] graph = new int[N+1][N+1];
    int[][] edge = new int[M][2];
    for (int i = 0; i < M; i++) {
      int a = sc.nextInt();
      int b = sc.nextInt();
      graph[a][b] = 1;
      graph[b][a] = 1;
      edge[i][0] = a;
      edge[i][1] = b;
    }
    
    int bridge = 0;
    for (int i = 0; i < M; i++) {

      int aa = edge[i][0];
      int bb = edge[i][1];

      graph[aa][bb] = 0;
      graph[bb][aa] = 0;

      int[] visited = new int[N+1];
      dfs(graph, 1, visited);
      boolean visiteAll = true;
      for (int j = 1; j <= N; j++) {
        if (visited[j] != 1) {
          visiteAll = false;
          break;
        }
      }
      if (!visiteAll) {
        bridge++;
      }
      
      graph[aa][bb] = 1;
      graph[bb][aa] = 1;
    }

    System.out.println(bridge);
  }
  
  private static void dfs(int[][] graph, int v, int[] visited) {
    visited[v] = 1;
    for (int i = 1; i < graph[v].length; i++) {
      if (graph[v][i] == 1 && visited[i] != 1) {
        dfs(graph, i, visited);
      }
    }
  }
}

Measured memory_bytes: 21844
n = int(input())
a = list()
for i in range(n):
	x, y = input().split()
	y = int(y)
	if x == "S":
		a.append(y + 0)
	if x == "H":
		a.append(y + 13)
	if x == "C":
		a.append(y + 26)
	if x == "D":
		a.append(y + 39)
for i in range(1, 53):
	if not (i in a):
		if i <= 13:
			print("S {}".format(i - 0))
		elif i <= 26:
			print("H {}".format(i - 13))
		elif i <= 39:
			print("C {}".format(i - 26))
		else:
			print("D {}".format(i - 39))



Measured memory_bytes: 5588
from sys import stdin as I
from sys import stdout as O
N,K = map(int,I.readline().split())
H = [None] + list(map(int,I.readline().split()))
DP = [1000000000000 for i in range(N+1)]
DP[1] = 0
for i in range(2,N+1): 
	for j in range(1,min(i-1,K)+1):DP[i] = min(DP[i],DP[i-j]+abs(H[i]-H[i-j]))
print(DP[N])

Measured memory_bytes: 58716
#include <iostream>

#define REP(i, a, b) for ( int i = (a); i < (b); i++ )
#define REVREP(i, a, b) for ( int i = (a); i > (b); i--)
#define DEBUG_INT(var) printf("the value of "#var" is %d\n", var)

using namespace std;

int main(void) {

	char S[4], T[4];
    scanf("%s", S);
    scanf("%s", T);
    
    int ans = 0;
    REP(i, 0, 3) {
    	if ( S[i] == T[i] ) ans++;
    }
    printf("%d\n", ans);

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <numeric>
#include <vector>
#include <map>
#include <algorithm>
#include <set>
#include <queue>
#include <tuple>
#include <functional>
#include <cstring>

#define PI 3.14159265359
#define INF 1e9
#define LINF 1e18
#define IMOD 1000000007 
#define irep(i,n) for(int  i = 0; i < n; i++)
#define irep2(i,a,n) for(int i = a; i < n; i++)
#define lrep(i,n) for(long long  i = 0; i < n; i++)
#define lrep2(i,a,n) for(long long i = a; i < n; i++)

typedef long long ll;
typedef std::vector<int> v_int;
typedef std::vector<std::vector<int> > v2_int;
typedef std::vector<ll> v_ll;
typedef std::vector<std::vector<ll> > v2_ll;
typedef std::vector<std::string> v_string;
typedef std::vector<std::vector<std::string> > v2_string;
typedef std::vector<bool> v_bool;
typedef std::vector<std::vector<bool> > v2_bool;
typedef std::pair<ll, ll> pll;

using namespace std;

void prime_factorial(ll n, map<ll, ll> &fact) {

    for(ll i = 2; i * i <= n; i++) {
        if(n % i == 0) {
            while (n % i == 0) {
                fact[i]++;
                n /= i;
            }
        }
    }

    if(n > 1) { fact[n]++; }
}
int main() 
{
    ll n;
    cin >> n; 

    ll ans = 1;
    map<ll, ll> fact;

    for(int i = 1; i <= n; i++) {
        prime_factorial(i, fact);
    }

    for(auto prime : fact) {
        //cout << "pow(" << prime.first << "," << prime.second << ")" << endl;
        ans *= (prime.second + 1);
        ans %= IMOD; 
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
/*  -*- coding: utf-8 -*-
 *
 * g.cc: G: Coinage
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>

using namespace std;

/* constant */

/* typedef */

typedef long long ll;

/* global variables */

/* subroutines */

// exgcd:
//   For given x>0 and y>0, solve a, b, c such that ax+by=c (=gcd(x,y))

void exgcd(int x, int y, int &a, int &b, int &c) {
  int r0 = x, r1 = y;
  int a0 = 1, a1 = 0;
  int b0 = 0, b1 = 1;

  while (r1 > 0) {
    int q1 = r0 / r1;
    int r2 = r0 % r1;
    int a2 = a0 - q1 * a1;
    int b2 = b0 - q1 * b1;
    r0 = r1, r1 = r2;
    a0 = a1, a1 = a2;
    b0 = b1, b1 = b2;
  }
  c = r0;
  a = a0;
  b = b0;
}

/* main */

int main() {
  int l;
  string s, t;
  cin >> l >> s >> t;

  int sn = s.size(), tn = t.size();
  int a, b, c;
  exgcd(sn, tn, a, b, c);
  ll da = tn / c, db = sn / c;
  //printf("%d,%d -> a,b,c=%d,%d,%d\n", sn, tn, a, b, c);
  ll aa = (ll)a * l / c, bb = (ll)b * l / c;
  //printf("-> %lld,%lld,%d (%lld,%lld)\n", aa, bb, l, da, db);
  
  if (s + t < t + s) {
    if (bb < 0) {
      ll d = (-bb + db - 1) / db;
      bb += db * d;
      aa -= da * d;
    }
    else if (bb > 0) {
      ll d = bb / db;
      bb -= db * d;
      aa += da * d;
    }
    for (int i = 0; i < aa; i++) cout << s;
    for (int i = 0; i < bb; i++) cout << t;
    cout << endl;
  }
  else {
    if (aa < 0) {
      ll d = (-aa + da - 1) / da;
      aa += da * d;
      bb -= db * d;
    }
    else if (aa > 0) {
      ll d = aa / da;
      aa -= da * d;
      bb += db * d;
    }
    for (int i = 0; i < bb; i++) cout << t;
    for (int i = 0; i < aa; i++) cout << s;
    cout << endl;
  }
  //printf("a=%d, b=%d\n", a, b);

  return 0;
}


Measured memory_bytes: 1544
#include <iostream>

using namespace std;

int main(){
  int N, M, sum=0;
  cin >> N >> M;
  int A[M];
  for(int i=0; i<M; i++) cin >> A[i];
  for(int i=0; i<M; i++) sum += A[i];
  if(N >= sum) cout << N-sum << endl;
  else cout << -1 << endl;
  return 0;
}


Measured memory_bytes: 3628
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
  const int MAX_P = 60000;
  bool p[MAX_P];
  for (int i = 0; i < MAX_P; ++i)
    p[i] = true;
  p[0] = p[1] = false;

  for (int i = 2; i*i <= MAX_P; ++i) {
    if (p[i]) {
      for (int j = i+i; j < MAX_P; j += i)
	p[j] = false;
    }
  }

  vector<int> prime;
  for (int i = 0; i < MAX_P; ++i) {
    if (p[i])
      prime.push_back(i);
  }

  int n;
  while (~scanf("%d", &n)) {
    printf("%d %d\n", *(lower_bound(prime.begin(), prime.end(), n)-1),
	   *upper_bound(prime.begin(), prime.end(), n));
  }
  return 0;
}

Measured memory_bytes: 0
#include<iostream>
#include<string>
#include<math.h>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<stack>

#define ll long long
#define vl vector<ll>
#define vvl vector< vector<ll> >
#define vb vector<bool>
#define vbb vector< vector<bool> >

#define all(a) (a).begin(),(a).end()
using namespace std;

ll f(ll a){
	if (a % 2 == 0) return a / 2;
	else return 3 * a + 1;
}

int main(){
	ll s; cin >> s;
	ll count = 0;
	vb ngo(1000001,0);
	while (!ngo[s]){
		ngo[s] = 1;
		s = f(s);
		count++;
	}cout << count+1 << endl;
}

Measured memory_bytes: 384
#include <iostream>
 using namespace std;
 long long N, A[87], CurrentMoney = 1000;
 int main() {
 cin >> N;
 for (int i = 1; i <= N; i++) cin >> A[i];
 for (int i = 1; i <= N - 1; i++) {
 long long Stocks = 0;
 if (A[i] < A[i + 1]) Stocks = CurrentMoney / A[i];
 CurrentMoney += (A[i + 1] - A[i]) * Stocks;
 }
 cout << CurrentMoney << endl;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
 
int main() {
int N;
  cin >>N;
  int NS=N;
int S=0;
for (int i = 0; i < 10; i++) {
  if(N>0)
  {
  S +=N%10;
    N /=10;
  }
}

if(NS%S==0){
  cout <<"Yes"<<endl;
}
  else{
    cout <<"No"<<endl;
  }
  
}

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

int main(){
	int a, b;
	cin >> a >> b;
	
	cout << a/b << " ";
	cout << a%b << " ";
	cout << a/b << ".";
	cout << (a%b)*100000/b << endl;
	
	return 0;
}


Measured memory_bytes: 3104
l,r=map(int,input().split())
if l//2019!=r//2019:
    print(0)
    exit()

ans=2019
for i in range(l,r):
    for k in range(i+1,r+1):
        ans=min(ans,(i%2019)*(k%2019)%2019)
print(ans)

Measured memory_bytes: 3060
n = gets.to_i
A = gets.split.map &:to_i
m = gets.to_i
B = gets.split.map &:to_i
ans = Array.new(m,false)

[true, false].repeated_permutation(n) do |c|
  sum = c.zip(A).select(&:first).map(&:last).sum
  B.each_with_index do |b,i|
    ans[i] = true if b == sum
  end
end

ans.each do |flag|
  puts flag ? "yes": "no"
end


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


int main(){
	int len;
	string s;
	cin >> s;
	
	long long x,ans=0;
	len=s.size();
	for(int i=0;i<1<<(len-1);i++){
		x=0;
		for(int j=0;j<len;j++){;
			x=x*10 + s[j]-'0';
			if(i & (1<<j)){
				ans+=x;
				x=0;
			}
		}
		ans+=x;
	}
	
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
	using namespace std;
	typedef long long int ll;
	
	#define pii                 pair<int,int>
	#define vi                  vector<int>
	#define vii                 vector<std::vector<int>> v;
	#define mem(dp,a)           memset(dp,a,sizeof dp)
	#define sonic               ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	#define pb(x)               push_back(x)
	#define mkp(x,y)             make_pair(x,y)
	#define all(c)              c.begin(), c.end()
	#define ff                  first
	#define ss                  second
	#define INF                 INT_MAX
	
	/* Bit Manipulation */
	
	#define isOn(S, j) (S & (1 << j))
	#define setBit(S, j) (S |= (1 << j))
	#define clearBit(S, j) (S &= ~(1 << j)) // to turn off
	#define toggleBit(S, j) (S ^= (1 << j))
	#define lowBit(S) (S & (-S)) // to get lsb
	#define setAll(S, n) (S = (1 << n) - 1)
	
	#define modulo(S, N) ((S) & (N - 1))   // returns S % N, where N is a power of 2
	#define isPowerOfTwo(S) (!(S & (S - 1)))
	#define nearestPowerOfTwo(S) ((int)pow(2.0, (int)((log((double)S) / log(2.0)) + 0.5)))
	#define turnOffLastBit(S) ((S) & (S - 1))
	#define turnOnLastZero(S) ((S) | (S + 1))
	#define turnOffLastConsecutiveBits(S) ((S) & (S + 1))
	#define turnOnLastConsecutiveZeroes(S) ((S) | (S - 1))
	
	void printSet(int vS) {                         // in binary representation
	  printf("S = %2d = ", vS);
	  stack<int> st;
	  while (vS)
	    st.push(vS % 2), vS /= 2;
	  while (!st.empty())                         // to reverse the print order
	    printf("%d", st.top()), st.pop();
	  printf("\n");
	}
		
	/* Bit Manipulation Ends. */
		
	// Global variables declared here...
	
	//*******User-Defined Functions*********//
	
	
	
	//*******Functions end here************//
	
	//*******Main func starts**************//
	int main()
	{
	    sonic;
		string s,t;
		cin >> s >> t;
		int cnt = 0;
		for (int i=0;i<s.length();i++)
		{
			if (s[i] != t[i])
			{
				cnt++;
			}
		}
		cout << cnt << endl;
	}
	//******Main Ends here****************//
	
	
	


Measured memory_bytes: 3812
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<map>
#include<stack>
#include<queue>
#include<set>
using namespace std;
typedef long long ll;
const ll mod = 1e9+7;
int main(){
	ll n,x,y;
	cin>>n>>x>>y;
	ll s=(n/(x+y)*x)+min(n%(x+y),x);
	cout<<s;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 1000000000
#define LLINF 1000000000000000ll
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define all(x) (x).begin(),(x).end()
#define sq(x) ((x)*(x))
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define repn(i,a,n) for(int (i)=(a);(i)<(int)(n);(i)++)
#define EQ(a,b) (abs((a)-(b))<eps)
#define MOD 1000000007ll
template<class T> void chmin(T& a,const T& b){if(a>b)a=b;}
template<class T> void chmax(T& a,const T& b){if(a<b)a=b;}
string s;
int main(){
	cin >> s;
	int len = s.length();
	if(s[0]==s[len-1]){
		if(len%2==1)cout << "Second" << endl;
		else cout << "First" << endl;
	}else{
		if(len%2==1)cout << "First" << endl;
		else cout << "Second" << endl;
	}
	return 0;
}

Measured memory_bytes: 512
#include <stdio.h>
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <deque>
#include <set>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <chrono>
#include <random>
#include <time.h>
#include <fstream>
#define ll long long
#define rep2(i,a,b) for(ll i=a;i<=b;++i)
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep3(i,a,b) for(ll i=a;i>=b;i--)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pq priority_queue<int>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb emplace_back
#define vec vector<int>
#define vecll vector<ll>
#define vecpii vector<pii>
#define endl "\n"
#define all(c) begin(c),end(c)
using namespace std;
int in() {int x;scanf("%d",&x);return x;}
ll lin() {ll x;scanf("%lld",&x);return x;}
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;}
void print(vec v){for(auto e:v)cout<<e<<" ";cout<<endl;}
void print(vecll v){for(auto e:v)cout<<e<<" ";cout<<endl;}
void print(vector<vec> v){for(auto e:v){for(auto ee:e)cout<<ee<<" ";cout<<endl;}}
void print(map<int,int> mp){for(auto e:mp)cout<<e.first<<" "<<e.second<<endl;cout<<endl;}
const int INF=1e6;
const ll int MOD=998244353;

main(){
    ll n=in(),m=in(),v=in(),p=in();
    vecll a;
    rep(i,n){
        a.pb(in());
    }
    sort(all(a));
    if(v<=p){
        ll t=a[n-p];
        int ans=0;
        rep(i,n)if(a[i]+m>=t)ans++;
        cout<<ans;
    }
    else{
        v=v-p+1;
        int ans=p-1;
        n=n-p;
        ll rui=0;
        rep3(i,n,0){
            ll t=a[i]+m;
            if(t<a[n])break;
            if((1+i)*m+t*(n-i)-rui >=v*m) ans++;
            rui+=a[i];
        }
        cout<<ans;
    }
}

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

using namespace std;

int main(){
	string s , rijec="keyence";
	cin>>s;
	int n=s.length() , pozK , pozE;
	size_t poz1 , poz2;
	for (int i=0;i<n;i++){
		if (s[i]=='k'){
			pozK=i;
			break;
		}
	}
	for (int i=n-1;i>=0;i--){
		if (s[i]=='e'){
			pozE=i;
			break;
		}
	}
	
	if (pozK==0 && pozE==n-1){
		for (int i=1;i<7;i++){
			poz1=s.find(rijec.substr(0,i));
			poz2=s.find(rijec.substr(i,6-i));
			if (poz1<=poz2 && poz1!=string::npos && poz2!=string::npos){
				cout<<"YES";
				break;
			}
			else if (i==6) cout<<"NO";
		}
	}
	else if (s.find(rijec)!=string::npos) cout<<"YES";
	else cout<<"NO";
	
	return 0;
}


Measured memory_bytes: 256
n,k = map(int, input().split())
mod = 10 ** 9 + 7
ans = 0
for i in range(k,n+2):
    left = i * (i-1) // 2
    right = i * (n + n-i+1) // 2
    ans += right - left + 1
print(ans % mod)

Measured memory_bytes: 9152
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>

using namespace std;

int main()
{
  int N, M;
  cin >> N >> M;
  vector<bool> bridges(N - 1, true);
  vector<pair<int, int>> requests;
  requests.reserve(M);
  for (int n = 0; n < M; ++n) {
    int a, b;
    cin >> a >> b;
    --a; --b;
    requests.push_back(make_pair(a, b));
  }

  sort(requests.begin(), requests.end(), [](auto &a, auto &b) {
      return a.first == b.first ? a.second < b.second : a.first < b.first;
  });

  int ca = 0;
  int cb = N - 1;
  int removed = 1;
  for (const auto r: requests) {
    int a = r.first;
    int b = r.second;
    if (a >= cb) {
      ++removed;
      ca = a;
      cb = b;
    } else {
      ca = max(ca, a);
      cb = min(cb, b);
    }
    // cout << a << " " << b << " " << ca << " " << cb << endl;
  }
  cout << removed << endl;
  return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

int main(){
    //1000000000000 0.56
    //1000000000000 0.59

    long long A;
    float B;
    cin >> A >> B;
    long long prev = A*B;
    B = B*100 + 0.5;
    double seisuuB;
    modf(B, &seisuuB);
    long long res = A*(int)seisuuB/100;

    cout << res << endl;
}

Measured memory_bytes: 3740
#include<bits/stdc++.h>
#define N 2001
#define M 1000000007
using namespace std;
typedef long long ll;

ll n,x,dp[N][N],sum,ans,k1,k2;
ll d,D;

ll mod_power(ll a,ll b){
  ll X=a,r=1;
  while(b){
    if(b%2)r=(r*X)%M;
    b/=2;
    X=(X*X)%M;
  }
  return r;
}

ll ncr(ll a,ll b){
  b=mod_power(b,M-2);
  return (a*b)%M;
}

int main(){
  while(1){
    cin>>n>>d>>x;
    if(!n&&!d&&!x)break;
    D=d;
    if(D>=N-1)D=N-1;
    memset(dp,0,sizeof(dp));
    for(ll i=1;i<x;i++)dp[0][i]=1;
    for(ll i=0;i<D-1;i++){
      sum=0;
      for(ll j=1;j<n;j++){
	sum=(sum+dp[i][j])%M;
	if(j>=x)sum=(sum-dp[i][j-x+1]+M)%M;
	dp[i+1][j+1]=sum;
      }
    }
    ans=0;
    k1=k2=1;
    for(ll i=0;i<D;i++){
      k1=(k1*((d-i)%M))%M;
      k2=(k2*(i+1))%M;
      if(k1<0)break;
      ans=(ans+(ncr(k1,k2)*dp[i][n])%M)%M;
    }
    cout<<ans<<endl;
  }
  return 0;
}

Measured memory_bytes: 32448
#include<cstdio>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
#include<cstring>
#include<cctype>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<list>
#define ull unsigned long long 
#define ll long long 
#define pii pair<int,int >
#define iiii pair<int,pii >
#define MAXN 100020
 
using namespace std;

int X[MAXN],Y[MAXN],par[MAXN],Rank[MAXN];
vector<pii >vX,vY;
set<pair<int,pii > >Set;
ll res=0;
int n;

void fInit(int n)
{
	for(int i=0;i<n;i++)
	{
		par[i]=i;
		Rank[i]=0;
	}
}

int fFind(int x)
{
	if(par[x]==x) return x;
	return par[x]=fFind(par[x]);
}

ll fUnite(int x,int y)
{
	x=fFind(x);y=fFind(y);
	if(x==y)return false;
	if(Rank[x]<Rank[y])par[x]=y;
	else
	{
		par[y]=x;
		if(Rank[x]==Rank[y])Rank[x]++;
	}
	return 1;
}

int know(int x,int y)
{
	return abs(x-y);
}

int main()
{
	scanf("%d",&n);
	for(int i=0;i<n;i++)
	{
		scanf("%d%d",X+i,Y+i);
		vX.push_back(make_pair(X[i],i));
		vY.push_back(make_pair(Y[i],i));
	}
	
	fInit(n);
	sort(vX.begin(),vX.end());
	sort(vY.begin(),vY.end());
	
	for(int i=0;i<n-1;i++)
	{
		Set.insert(make_pair(know(vX[i+1].first,vX[i].first),make_pair(vX[i+1].second,vX[i].second)));
		Set.insert(make_pair(know(vY[i+1].first,vY[i].first),make_pair(vY[i+1].second,vY[i].second)));
	}
	
	while (Set.size())
	{
		set<iiii >::iterator it=Set.begin();
		res+=fUnite((*it).second.second,(*it).second.first)*(ll)(*it).first;
		Set.erase(it);
	}
	
	cout<<res<<endl;
	
	return 0;	
} 

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

int main() {
  int N;
  int s;
  int t = 0;

  cin >> N;
  s = N;

  while (s > 0){
   t += s % 10;  
   s = s / 10;
  }
  if (N % t)
    cout << "No";
  else
    cout << "Yes";
}


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

int main(){

	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	short x, y;

	cin >> x >> y;

	if(x < y)
		cout << "0";
	else 
		cout << "10";
	

	return 0;
}



Measured memory_bytes: 256
fn main() {
    let (n, k) = read_to_pair::<usize>();
    let lim = (n - 1) * (n - 2) / 2;
    if k > lim {
        println!("-1");
        return;
    }
    let diff = lim - k;
    let mut edges = Vec::new();
    for i in 1..(n - 1) {
        for k in (i + 1)..n {
            edges.push((i, k));
        }
    }
    let m = n - 1 + diff;
    println!("{}", m);
    for i in 1..n {
        println!("{} {}", i, n);
    }
    for (i, e) in edges.iter().enumerate() {
        if i >= diff {
            break;
        }
        println!("{} {}", e.0, e.1);
    }
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

#[allow(dead_code)]
fn read_to_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

#[allow(dead_code)]
fn read_to_pair<T: std::str::FromStr + Copy>() -> (T, T) {
    let v = read_to_vec();
    (v[0], v[1])
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
typedef long double lb;
typedef pair<int,int> P;
const int MOD = 1000000007;
const ll INF = 1e16;
const double EPS = 1e-10;
const double PI = 3.141592653589793;
template<class T> inline bool chmin(T& a, T b){if(a>b){a = b;return 1;}return 0;}
template<class T> inline bool chmax(T& a, T b){if(a<b){a = b;return 1;}return 0;}
const pair<int,int> fd[] = {make_pair(1,0),make_pair(-1,0),make_pair(0,1),make_pair(0,-1)}; 
#define int long long
#define double long double

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

template<typename T>
struct edge {
  int to, from;T cost;
  edge(int to, T cost) : from(-1), to(to), cost(cost) {}
  edge(int from, int to, T cost) : from(from), to(to), cost(cost) {}
};
template<typename T>
using edges = vector<edge<T>>;
template<typename T>
using graph = vector<edges<T>>;
template<typename T>
using matrix = vector<vector<T>>;

#define edge edge<int>
#define edges edges<int>
#define graph graph<int>
#define matrix matrix<int>

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

int k,n,a[210000],r[210000];map<int,int> mp;queue<int> que;


signed main(){
  cin>>n>>k;rep(i,n)cin>>a[i];
  repd(i,1,n+1)r[i] = r[i-1] + a[i-1];
  rep(i,n+1){
    (r[i] -= i) %= k;
  }
  int ans = 0;
  rep(i,n+1){
    //i番目の要素とペアになるのは、iより左にあるr[i]と同じ要素
    //-> i以前のr[i]の数を各iについて加える
    ans += mp[r[i]];
    mp[r[i]]++;
    que.push(r[i]);
    if(que.size() >= k){
      mp[que.front()]--;
      que.pop();
    }
  }
  cout << ans << endl;
} 


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

int main(){
    int N; cin >> N;
    int n = N;
    int digit = 0;
    while(n != 0){
        n /= 10;
        digit++;
    }

    int ans = 0;
    if(digit == 1){
        cout << N << endl;
    }else if(digit % 2 == 1){
        for(int i = 1; i <= digit - 2; i += 2){
            ans += 9 * powf(10, i - 1);
        }
        ans += N - powf(10, digit - 1) + 1;
        cout << ans << endl;
    }else{
        for(int i = 1; i <= digit - 1; i += 2){
            ans += 9 * powf(10, i - 1);
        }
        cout << ans << endl;
    }

}


Measured memory_bytes: 384
#include <cstdio>
#include <vector>
using namespace std;

int main()
{
    char s;
    int h = 0;
    int pod = 0;
    vector<int> downs;
    vector< pair<int, int> > pods;
    int i = 0;
    int sum = 0;
    while (scanf("%c", &s) != EOF && s != '\n') {
        if (s == '\\') {
            downs.push_back(i);
        }
        else if (s == '/' && 0 < downs.size()) {
            int pod_opposite = downs.back(); downs.pop_back();
            int area = i - pod_opposite;
            sum += area;
            while (0 < pods.size() && pod_opposite < pods.back().first) {
                area += pods.back().second; pods.pop_back();
            }
            pods.push_back(make_pair(pod_opposite, area));
        }
        i++;
    }

    printf("%d\n%lu", sum, pods.size());
    for (int i=0; i<pods.size(); i++) {
        printf(" %d", pods[i].second);
    }
    printf("\n");
    return 0;
}

Measured memory_bytes: 1160
object Main {
  def main(args: Array[String]): Unit = {
    import scala.io.StdIn.readLine
    val n = readLine.split(" ").map(_.toInt).head

    val ans = (1 until n).map(a => (a.toString + (n - a).toString).split("").filterNot(_ == "").map(_.toInt).sum).min

    println(ans)
  }
}


Measured memory_bytes: 90092
// WIP

#include <cmath>
#include <iomanip>
#include <iostream>

const double PI = acos(-1);

using namespace std;

void solve() {
    double a, b, h, m;
    cin >> a >> b >> h >> m;
    double rad = PI * 2 * ((h / 12) + (m / 60) / 12 - m / 60);
    double rsq = (a * a + b * b) - 2 * a * b * cos(rad);
    cout << setprecision(20) << sqrt(rsq) << endl;
}

void solve_error_version() {
    int a, b, h, m;
    cin >> a >> b >> h >> m;

    double h_angle = h / 12.0 * 359 + m / 59 * 12.0 / 359;
    double m_angle = m / 59.0 * 359;

    double angle = abs(h_angle - m_angle);

    cout << h_angle << " " << m_angle << endl;

    if (angle == 180) {
        cout << a + b << endl;
    } else {
        if (angle > 180) {
            angle = 360 - angle;
        }
        double co = cos(angle * PI / 180);
        cout << co << endl;
        double ans = sqrt(a * a + b * b - 2 * a * b * co);
        cout << ans << endl;
    }
}
int main() {
#ifdef _LOCAL_DEV
    freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
#endif

    solve();
    return 0;
}

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

int N, W;

int main (int argc, char* argv[]){
	cin >> N >> W;
    vector<int> v(N);
    vector<int> w(N);
    for (int i = 0; i < N; i++) {
        cin >> v[i] >> w[i];
    }

    // cout << "N: " << N << endl;
    // cout << "W: " << W << endl;
    // cout << "v: " << endl;
    // for(auto e: v){
    //     cout << e << endl;
    // }
    // cout << "w: " << endl;
    // for(auto e: w){
    //     cout << e << endl;
    // }

    vector<vector<int> > dp(N + 1, vector<int>(W + 1, 0));
    for (int i = N - 1; i >= 0; i--) {
        for (int j = 0; j < W + 1; j++) {
            if (j < w[i]) {
                dp[i][j] = dp[i + 1][j];
            }else {
                dp[i][j] = max(dp[i + 1][j], dp[i + 1][j - w[i]] + v[i]);
            }
        }
    }

    // for (auto e: dp) {
    //     for (auto i: e) {
    //         cout << i << " ";
    //     }
    //     cout << endl;
    // }


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

Measured memory_bytes: 6792
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1e9+7;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define ALL(obj) (obj).begin(), (obj).end()

int main(){
    int N, M;
    cin >> N >> M;
    vector<pair<ll, ll>> ab(N);
    REP(i, N){
        ll A, B;
        cin >> A >> B;
        ab[i] = make_pair(A, B);
    }
    sort(ALL(ab));
    ll sum = 0;
    REP(i, N){
        if(M >= ab[i].second){
            sum += ab[i].first * ab[i].second;
            M -= ab[i].second;
        }else{
            sum += ab[i].first * M;
            break;
        }
    }
    printf("%lld", sum);
}


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

int main() {
  int a,b;cin>>a>>b;
  
  int p = a+b;
  int q = a-b;
  int r = a*b;
  
  if (max(p,q)>r) {
    cout<<max(p,q)<<endl;
  }
  else {
    cout<<r<<endl;
  }
    
}


Measured memory_bytes: 256
#[allow(dead_code)]
fn is_whitespace(c: &char) -> bool {
    c.is_whitespace()
}

#[allow(dead_code)]
fn is_eol(c: &char) -> bool {
    ['\r', '\n'].contains(c)
}

#[allow(unused_macros)]
macro_rules! input {
    ($var:ident, $($r:tt)*) => {
        input_inner!{$var, $($r)*}
    };

    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        #[allow(unused_mut, unused_variables, bare_trait_objects)]
        let mut next = move |f: &Fn(&char)->bool| -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|f(&c))
                .take_while(|c|!f(&c))
                .collect()
        };
        input_inner!{next, $($r)*};
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; eol ]) => {
        $next(&is_eol).split(' ').map(|x| x.parse::<$t>().unwrap()).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, parser) => {
        $next
    };

    ($next:expr, $t:ty) => {
        $next(&is_whitespace).parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{BinaryHeap, HashMap, HashSet};

#[allow(dead_code)]
struct Edge {
    from: usize,
    to: usize,
}

#[allow(dead_code)]
type Graph = Vec<Vec<usize>>;
#[allow(dead_code)]
const M: usize = 1_000_000_007;

fn main() {
    input! {
        n: usize,
        r: usize,
    }

    if n >= 10 {
        println!("{}", r);
    } else {
        println!("{}", r + 100 * (10 - n));
    }
}


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

int main(void)
{
string a, b;
cin>>a>>b;
if(a.length()>b.length()){
cout<<"GREATER"<<endl;
return 0;
}
if(a.length()<b.length()){
cout<<"LESS"<<endl;
return 0;
}

if(a.length() == b.length()){
for(int i = 0; i < a.length(); ++i){
if(a[i]>b[i]){
cout<<"GREATER"<<endl;
return 0;
}
if(a[i]<b[i]){
cout<<"LESS"<<endl;
return 0;
}
}
}

cout<<"EQUAL"<<endl;

return 0;
}

Measured memory_bytes: 256
///Astalavista Code........~boy_with_no_gf
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define Br cout<<endl
#define int long long
#define double long double
#define all(v) v.begin(),v.end()
#define pb push_back
#define mk make_pair
#define allr(v) v.rbegin(),v.rend()
#define PT(x) cout << (x) << endl
#define PTT(x) cout << (#x) << " is " << (x) << endl; 
#define lets_go ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
const int M = 1e9 + 7;
const int N = 2e6 + 10;
const int IM = 1e15 + 37;
const double PI = 3.1415926535897932384;
inline void PP(int n) { cout << n << " ";}
void PV(vi v) { for (int i = 0 ; i < v.size() ; i++) cout << v[i] << " " ; cout << endl;}
void PVV(vii v) {for (int i = 0 ; i < v.size() ; i++) cout << v[i].first << " " << v[i].second << endl;}
void PA(int v[], int n, int x = 0) { for (int i = x ; i < n + x; i++)cout << v[i] << " " ; cout << endl;}
void IN(int a[], int n, int x = 0) {for (int i = x; i < n + x; i++)cin >> a[i];}
// <=================================================================================================================================
// <=================================================================================================================================


void fun(){
    int n;cin>>n;
    vector<bool>arr(n,false);
    for(int i=0;i<n;i++){
        int a,b;cin>>a>>b;
        if(a==b)
            arr[i]=true;
        else
        {
            arr[i]=false;
        }
    }
    int t=0;
    for(int i=0;i<n;i++){
        if(arr[i])
            t++;
        else
        {
            t=0;
        }
        if(t==3){
            cout<<"Yes";
            return;}
    }
    cout<<"No";
}

signed  main() {
    lets_go

    int t;
    t=1;
    //cin >> t;
    while (t--) {            
         fun();             
    }                        
                            
                            
    return 0;

}

Measured memory_bytes: 3652
#include <stdio.h>
#include <math.h>

typedef long long ll;

int main() {
	ll a, b, c, d;
	scanf("%lld %lld %lld %lld", &a, &b, &c, &d);
	ll x[4] = {0};
	x[0] = a * c;
	x[1] = a * d;
	x[2] = b * c;
	x[3] = b * d;
	ll min = -1e18 - 1;
	for (int i = 0; i < 4; i++)
	{
		min = (x[i] > min) ? x[i] : min;
	}
	printf("%lld", min);
	
	
	
	return 0;
}


Measured memory_bytes: 1736
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const double pi = acos(-1);

int main() {
    ll n, m, k;
    cin >> n >> m >> k;

    vl a(n);
    vl ruiA(n+1);
    rep(i, n) {
        cin >> a[i];
        ruiA[i+1] = ruiA[i] + a[i];
    }

    vl b(m);
    vl ruiB(m+1);
    rep(i, m) {
        cin >> b[i];
        ruiB[i+1] = ruiB[i] + b[i];
    }

    ll ans = 0;
    rep(i, n+1) {
        if(k < ruiA[i]) {
            break;
        }
        auto pos = upper_bound(all(ruiB), k - ruiA[i]) - ruiB.begin();
        chmax(ans, i + pos - 1);
    }

    out(ans);
    re0;
}

Measured memory_bytes: 9592
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;

int main(){
    int X, Y, Z, K;
    ll a;
    vector<ll> A, B, C, D, E, F;
    cin >> X >> Y >> Z >> K;
    for(int i = 0; i < X; ++i){
        cin >> a;
        A.push_back(a);        
    }
    for(int i = 0; i < Y; ++i){
        cin >> a;
        B.push_back(a);        
    }
    for(int i = 0; i < Z; ++i){
        cin >> a;
        C.push_back(a);        
    }
    
    for( auto a : A ){
        for ( auto b : B){
            D.push_back(a+b);
        }
    }
    sort(D.begin(), D.end(), greater<ll>());
    for (int i = 0; i < min(K, X*Y); ++i){
        E.push_back(D[i]);
    }
    
    
    for( auto e : E ){
        for ( auto c : C){
            F.push_back(e+c);
        }
    }
    sort(F.begin(), F.end(), greater<ll>());
    for (int i = 0; i < K; ++i){
        cout << F[i] << endl;
    }
}


Measured memory_bytes: 43408
# -*- coding: utf-8 -*-
from fractions import gcd

# スペース区切りの整数の入力
N, X = map(int, input().split())
pos = [int(x.strip()) for x in input().split()]

# 一番近い場所を検索
tikai = [i - X for i in pos]
kyori = list(map(abs,tikai))

a = kyori[0]
for xi in kyori[1:]:
    a = gcd(a, xi)
print(a)

Measured memory_bytes: 16660