akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<vector>
#include<utility>
#include<string>
#include<queue>
typedef long long ll;
using namespace std;
ll mod = 1000000007;
ll expr(string &s,int a,int b);
ll term(string &s,int a,int b);
ll number(string &s,int a,int b);


ll calc(string &s,int &t){
    ll ans;
    bool flag =0;
    while(1){
        if(s[t]=='>'||s[t]=='$'){
            t++;
            break;
        }
        if(s[t]>='0'&&s[t]<='9'){
            ll tmp = 0;
            while(s[t]>='0'&&s[t]<='9'){
                tmp *=10;
                tmp +=(ll)(s[t]-'0');
                t++;
            }
            if(!flag){
                ans = tmp;
                flag = 1;
            }else{
                if(tmp>=30)ans= 0;
                else for(int i=0;i<tmp;i++){
                    ans/=2;
                }
            }
        }
        if(s[t]=='p'){
            t++;
        }
        if(s[t]=='S'){
            t += 2;
            ll tmp = calc(s,t);
            tmp = tmp*tmp%mod;
            if(!flag){
                ans = tmp;
                flag = 1;
            }else{
                if(tmp>=30)ans= 0;
                else for(int i=0;i<tmp;i++){
                    ans/=2;
                }
            }
        }
    }
    return ans;
}


int main(){
    while(1){
        string s1,s;
        getline(cin,s1);
        if(s1[0]=='#')break;
        for(int i=0;i<s1.size();i++){
            if(s1[i]!=' '){
                s.push_back(s1[i]);
            }
        }
        vector<bool> p((int)s.size());
        for(int i=0;i<s.size();i++){
            if(s[i]!='<'&&s[i]!='>'){
                if(i==0)continue;
                if(s[i-1]=='>'){
                    p[i-1]=1;
                    p[i-2]= 1;
                }
            }
        }
        string ss;
        int tmp = 0;
        while(tmp<(int)s.size()){
            if(p[tmp]){
                ss.push_back('p');
                tmp+=2;
            }else{
                ss.push_back(s[tmp]);
                tmp++;
            }
        }
        ss.push_back('$');
        int cnt = 0;
        cout << calc(ss,cnt) << endl; 
    }
    return 0;
}


Measured memory_bytes: 6096
#include<bits/stdc++.h>
#define PI 3.141592653589
using namespace std;
using ll = long long;

template<typename T_char>
T_char ToUpper(T_char cX){return toupper(cX);}

int main(){
  ll n;
  cin >> n;
  ll l0 = 2;
  ll l1 = 1;
  ll ans;
  if(n==1){
    cout << 1 << endl;
    return 0;
  }
  for(int i=2; i<=n; ++i){
    ans = l0 + l1;
    l0 = l1;
    l1 = ans;
  }

  cout << ans;
  return 0;
}

Measured memory_bytes: 3640
//Code is like humor. When you have to explain it, it’s bad.
#define fastio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#include <bits/stdc++.h>
#define MOD 1000000007
#define int long long
using namespace std;
#define ss second
#define ff first
int32_t main()
{
    fastio;
    int T,n,m,i,j,k,a,b,c;
    T=1;
    while(T --> 0)
    {
        cin>>n>>m;
        int A[n];
        int sum=0;
        for(i=0;i<n;i++)
        {
            cin>>A[i];
            sum+=A[i];
        }
        sort(A,A+n,greater<int>());
        double x= sum/(4.0*m);
        for(i=0;i<m;i++)
        {
            if(A[i] < x)
                break;
        }
        i!=m? cout<<"No":cout<<"Yes";
    }
    return 0;
}

Measured memory_bytes: 256
#[allow(unused_macros)]
macro_rules ! read_value {($ next : expr , ($ ($ t : tt ) ,* ) ) => {($ (read_value ! ($ next , $ t ) ) ,* ) } ; ($ 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 , usize1 ) => {read_value ! ($ next , usize ) - 1 } ; ($ next : expr , $ t : ty ) => {$ next () . parse ::<$ t > () . expect ("Parse error" ) } ; }
#[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 ) * } } ; }
#[allow(unused_macros)]
macro_rules ! input {(source = $ s : expr , $ ($ r : tt ) * ) => {let mut iter = $ s . split_whitespace () ; let mut next = || {iter . next () . unwrap () } ; input_inner ! {next , $ ($ r ) * } } ; ($ ($ r : tt ) * ) => {let stdin = std :: io :: stdin () ; let mut bytes = std :: io :: Read :: bytes (std :: io :: BufReader :: new (stdin . lock () ) ) ; let mut next = move || -> String {bytes . by_ref () . map (| r | r . unwrap () as char ) . skip_while (| c | c . is_whitespace () ) . take_while (| c |! c . is_whitespace () ) . collect () } ; input_inner ! {next , $ ($ r ) * } } ; }

#[allow(unused_macros)]
macro_rules ! min {($ a : expr $ (, ) * ) => {{$ a } } ; ($ a : expr , $ b : expr , $ (, ) * ) => {{std :: cmp :: min ($ a , $ b ) } } ; ($ a : expr , $ ($ rest : expr ) ,+ $ (, ) * ) => {{std :: cmp :: min ($ a , min ! ($ ($ rest ) ,+ ) ) } } ; }
#[allow(unused_macros)]
macro_rules ! chmin {($ base : expr , $ ($ cmps : expr ) ,+ $ (, ) * ) => {{let cmp_min = min ! ($ ($ cmps ) ,+ ) ; if $ base > cmp_min {$ base = cmp_min ; true } else {false } } } ; }

fn main() {
    input! {
        n: i64,
    }

    let mut ret = n - 1;
    for i in 1..=n {
        if i * i > n {
            break;
        }
        if n % i == 0 {
            chmin!(ret, i + n / i - 2);
        }
    }

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


Measured memory_bytes: 2140
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
long long mo = 1e9 + 7;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<class A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}cout << "\n";}
ld PI=3.14159265358979323846;

int main(){
    ll N;
    string S;
    vector<ll> x(5,0);
    rep(i,5){
        cin >> x[i];
    }
    rep(i,5){
        if(x[i] == 0){
            cout << i+1 << endl;
            return 0;
        }
    }
    //cout << N << endl;
}


Measured memory_bytes: 3596
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>
#include <bitset>
#include <complex>
#include <stack>



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

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

typedef long long ll;

using namespace std;


int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s,res;
  cin>>s;
  res+=s[0];
  string t;
  int n=s.length()-2;
  while(n>0){t=(char)('0'+n%10)+t;n/=10;}
  res+=t;


  res+=s[s.length()-1];
  cout<<res<<endl;
  return 0;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

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

int main(){	
	cin.tie(0);
   	ios::sync_with_stdio(false);
	
	llong N, x, mini=2e15;
	cin >> N;
	REP(i, 5){
		cin >> x;
		mini = min(mini, x);
	}
	llong yobun = N/mini - (N%mini==0 ? 1 : 0);
	
	cout << 5 + yobun << '\n';

	return 0;
}


Measured memory_bytes: 256
fn main() {
    proconio::input! {
        n: usize,
        d: i64,
        xy: [(i64, i64); n],
    }
    let d2 = d * d;

    let mut r = 0;
    for (x, y) in xy {
        if x * x + y * y <= d2 {
            r += 1;
        }
    }
    println!("{}", r);
}


Measured memory_bytes: 7864
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
int calc(int);
void doWhen1(string s) {
  int n = s.size();
  vector<int> ans(n);
  int cur = 1;
  int tot = 0;
  for (auto& ch : s) {
    tot <<= 1;
    tot += (ch - '0');
    tot %= 2;
  }
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '1') {
      ans[i] = 0;
    } else {
      ans[i] = calc((tot + cur) % 2) + 1;
    }
    cur <<= 1;
    cur %= 2;
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i] << '\n';
  }
}
int calc (int x) {
  return x == 0 ? 0 : 1 + calc(x % __builtin_popcount(x));
}
int f (string s) {
  int val = 0;
  for (auto& ch : s) {
    val <<= 1;
    val += (ch - '0');
  }
  return calc(val);
}
signed main() { 
  ios::sync_with_stdio(false); cin.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ones = 0;
  for (auto& ch : s) if (ch == '1') ones++;
  if (ones == 1) {
    doWhen1(s);
    return 0;
  }
  int mod[2] = {ones - 1, ones + 1};
  int tot[2] = {0, 0};
  for (int i = 0; i < n; i++) {
    int x = s[i] - '0';
    for (int j = 0; j < 2; j++) {
      tot[j] <<= 1;
      tot[j] += x;
      tot[j] %= mod[j];
    }
  }
  vector<int> ans(n);
  vector<int> naive(n);
  int cur[2] = {1, 1};
  for (int i = n - 1; i >= 0; i--) {
    int x = s[i] - '0';
    if (x == 1) {
      int val = (tot[0] - cur[0] + mod[0]) % mod[0];
      ans[i] = calc(val) + 1;
      // s[i] = '0';
      // naive[i] = f(s);
      // s[i] = '1';
    } else {
      int val = (tot[1] + cur[1]) % mod[1];
      ans[i] = calc(val) + 1;
      // s[i] = '1';
      // naive[i] = f(s);
      // s[i] = '0';
    }
    for (int j = 0; j < 2; j++) {
      cur[j] <<= 1;
      cur[j] %= mod[j];
    }
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i] << '\n';
    //cerr << naive[i] << '\n';
  }
  return 0;
}

Measured memory_bytes: 5140
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0:i < (n);i++)
typedef long long ll;
using namespace std;
int main(){
  string s,t;
  cin >> s >> t;
 int count = 0;
  for(int i=0;i<3;i++) if(s.at(i) == t.at(i)) count++;
  cout <<  count << endl;

}


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

int main(void){
  int n;
  string s;
  cin >> n >> s;
  if(n % 2 == 0){
    string t = s.substr(n/2, n/2);
    s = s.substr(0, n/2);
    if(s == t){
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define oo 0x3f3f3f3f

int main()
{
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    ll n,s=0,mod=1e9+7;
    cin>>n;
    vector<ll>A(n);
    for(auto&x:A)cin>>x,s+=x;

    ll res = 0;
    for(auto&x:A)res = (res + ((s-x)%mod)*x)%mod;

    res=  (res * ((mod+1)/2))%mod;

    cout<<res;
}


Measured memory_bytes: 4748
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
using ll = long long;
using pii = pair<int, int>;
constexpr ll INF = 1ll<<30;
constexpr ll longINF = 1ll<<60;
constexpr ll MOD = 1000000007;
constexpr bool debug = 0;
//---------------------------------//

ll N, K;
int A[212345], F[212345];

int main() {
	cin >> N >> K;
	REP(i, N) scanf("%d", A + i);
	REP(i, N) scanf("%d", F + i);
	
	sort(A, A + N);
	sort(F, F + N, greater<int>());
	
	ll l = -1, r = longINF;
	
	while (r - l > 1) {
		ll m = (l + r) / 2;
		ll sum = 0;
		REP(i, N) sum += max<ll>(0, A[i] - m / F[i]);
		if (sum <= K) r = m;
		else l = m;
	}
	
	cout << r << endl;
	
	return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define ll long long int
#define pii pair<int, int>
#define F first
#define S second
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define eb emplace_back
#define REP(n) for(int i = 0; i < n; i++)
#define all(p) p.begin(), p.end()
#define count_1(p) __builtin_popcountll(p)
#define count_0(p) __builtin_ctzll(p)
using namespace std;
const int MOD = 1e9 + 7;
const int INF = 987654321;
template <typename 	X = int> inline X min(X a, X b, X c) { return min(min(a, b), c); }
template <typename 	X = int> inline X max(X a, X b, X c) { return max(max(a, b), c); }
template <typename 	X = int> inline X mid(X s, X e) { return (s + (e-s)/2); }
template <typename 	X = int> inline X len(X s, X e) { return (e - s + 1); }

void solve()
{
	int n, m, k;
	cin >> n >> m >> k;
	vector<int> A(n), B(m);
	vector<ll> preA(n), preB(m);
	REP(n)
	{
		cin >> A[i];
		if(i == 0)
			preA[i] = A[i];
		else
			preA[i] = preA[i - 1] + A[i];
	}
	REP(m)
	{
		cin >> B[i];
		if(i == 0)
			preB[i] = B[i];
		else
			preB[i] = preB[i - 1] + B[i];
	}
	if(A[0] > k)
	{
		cout << upper_bound(all(preB), k) - preB.begin() << "\n";
		return;
	}
	if(B[0] > k)
	{
		cout << upper_bound(all(preA), k) - preA.begin() << "\n";
		return;
	}
	int r = upper_bound(all(preA), k) - preA.begin();
	int l = upper_bound(all(preB), k - preA[r-1]) - preB.begin();
	r--; l--;
	ll curtime;
	if(l == -1)
		curtime = preA[r];
	else
		curtime = preA[r] + preB[l];
	int ct = r + l + 2;
	while(r >= 0 && l < m)
	{
		curtime -= A[r];
		r--;
		while(l+1 < m && curtime + B[l+1] <= k)
			curtime += B[++l];
		ct = max(ct, r + l + 2);
	}
	cout << ct << "\n";
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	int T = 1;
	while(T--)
		solve();
	return 0;
}


Measured memory_bytes: 7944
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <functional>
#include <cstdio>
#include <unordered_set>
#include <unordered_map>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

int main() {
  vector<string> cities;
  map<string, priority_queue<pii> > points;
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) {
    string S;
    int P;
    cin >> S >> P;
    cities.push_back(S);
    if (points.find(S) != points.end()) {
      points[S].push(make_pair(P, i));
    } else {
      points[S] = priority_queue<pii>();
      points[S].push(make_pair(P, i));
    }
  }
  sort(cities.begin(), cities.end());
  for (auto c : cities) {
    // string c = cities.top();
    // cities.pop();
    while (!points[c].empty()) {
      pii x = points[c].top(); points[c].pop();
      cout << x.second + 1 << endl;
    } 
  }
  return 0;
}


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

using namespace std;

int main(){
  int N; cin >> N;
  const int MAX = 1e5+10;
  vector<int> cnt(MAX);
  for(int i=0;i<N;++i){
	int b, e; cin >> b >> e;
	++e;
	cnt[b]++;
	cnt[e]--;
  }

  vector<int> acc(MAX);
  for(int i=0,s=0;i<MAX;++i)
	acc[i] = (s += cnt[i]);

  int ans = 0;
  for(int i=0;i<MAX;++i)
	if(acc[i] >= i-1)
	  ans = i-1;
  
  cout << ans << endl;
  
  return 0;
}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
//---------------------------
using namespace std;
//---------------------------
#define REP(i,n) for(int i = 0; i < (n); i++)
#define P(x) cout << (x) << "\n"

#define MOD 1e9+7
#define PI acos(-1.0)
#define ll long long
#define INF 1000000001

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

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

  // ifstream in("input.txt");
  // cin.rdbuf(in.rdbuf());

  string s;cin>>s;
  if(s[0]==s[2]){
    P("Yes");
  }else{
    P("No");
  }
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i)
using ll = long long;
int main() {
  int X;
  cin >> X;
  int Y = X/200;
  cout << 10-Y << endl;
  return 0;
}

Measured memory_bytes: 3620
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	var sc = bufio.NewScanner(os.Stdin)
	sc.Scan()
	n, _ := strconv.Atoi(sc.Text())
	maxPrice := 0
	totalPrice := 0
	for i := 0; i < n; i++ {
		sc.Scan()
		p, _ := strconv.Atoi(sc.Text())
		if maxPrice < p {
			maxPrice = p
		}
		totalPrice += p
	}
	totalPrice -= maxPrice / 2
	fmt.Println(totalPrice)
}


Measured memory_bytes: 640
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <iostream>
#include <climits>
#include <cfloat>
 
 
using namespace std;
 
double distance(double x1, double y1, double x2, double y2)
{
    double dx = x1-x2;
    double dy = y1-y2;
    return sqrt(dx*dx+dy*dy);
}
 
int main()
{
    double x[4], y[4];
    while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf\n"
        , x, y, x+1, y+1, x+2, y+2, x+3, y+3) != EOF)
    {
        bool f1 = x[0] == x[1] && y[2] == y[3]
        || x[2] == x[3] && y[0] == y[1];
 
        double a[2];
        for (int i = 0; i < 2; ++i)
            a[i] = (y[2*i+1]-y[2*i])/(x[2*i+1]-x[2*i]);
 
        bool f2 = fabs(a[0]*a[1] + 1) <= 0.000001;
 
        if (f1 || f2)
            puts("YES");
        else
            puts("NO");
    }
 
    return 0;
}

Measured memory_bytes: 1196
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using static System.Console;
using static System.Math;
using static MyIO;
using static MyUtil;

public class A { public static void Main() => (new Solver()).Solve(); }

public class Solver
{
	public void Solve()
	{
		long N = GetLong();
		long X = GetLong();
		long T = GetLong();
		WriteLine((N + X - 1) / X * T);
	}
}

public static class MyIO
{
	private static string[] args = new string[0];
	private static int cnt = 0;
	private static IEnumerable<string> getArgs(long N) => Range(0, N).Select(_ => getArg());
	private static string getArg()
	{
		if(cnt == args.Length) { args = Console.ReadLine().Split(); cnt = 0; }
		return args[cnt++];
	}

	public static int GetInt() => int.Parse(getArg());
	public static long GetLong() => long.Parse(getArg());
	public static double GetDouble() => double.Parse(getArg());
	public static decimal GetDecimal() => decimal.Parse(getArg());
	public static string GetString() => getArg();
	public static char GetChar() => getArg()[0];
	public static int[] GetInts(long N) => getArgs(N).Select(int.Parse).ToArray();
	public static long[] GetLongs(long N) => getArgs(N).Select(long.Parse).ToArray();
	public static double[] GetDoubles(long N) => getArgs(N).Select(double.Parse).ToArray();
	public static decimal[] GetDecimals(long N) => getArgs(N).Select(decimal.Parse).ToArray();
	public static string[] GetStrings(long N) => getArgs(N).ToArray();
}

public static class MyUtil
{
	public static void chmax<T>(ref T x, T y) where T : IComparable<T> { if(x.CompareTo(y) < 0) x = y; }
	public static void chmin<T>(ref T x, T y) where T : IComparable<T> { if(x.CompareTo(y) > 0)	x = y; }
	public static void swap<T>(ref T x, ref T y) { T tmp = x; x = y; y = tmp; }
	public static long rightShift(long x, long y) => (x >> (int)y);
	public static long leftShift(long x, long y) => (x << (int)y);
	public static bool contains(long s, long x) => (rightShift(s, x) & 1L) == 1L;
	public static long gcd(long x, long y) => (y == 0) ? x : gcd(y, x % y);
	public static long lcm(long x, long y) => (x / gcd(x,y)) * y;	
	public static IEnumerable<int> Range(long start, long count) => Enumerable.Range((int)start, (int)count);
	public static void Sort(this List<string> source) => source.Sort(StringComparer.Ordinal);
}


Measured memory_bytes: 27400
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi =vector<vi>;

int main(){
  ll a,b;
  cin >>a>>b;
  ll c = a/b;
  a = a-b*c;
  a = abs(a-b);
  if(a > b/2) cout << b-a << endl;
  else cout << a << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll  long long
#define ull unsigned long long  
using namespace std;
#define  inf 1e11+18
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL)
#define mod 1000000007
#define  f1(i,n) for(i=1;i<=n;i++)
#define f0(i,n)  for(i=0;i<n;i++)
#define w(x)   while(x--)
const int maxn=3005;
#define  pq priority_queue
#define  ff first
#define  ss second 
#define pb  push_back
#define lb lower_bound

ll dp[105][10][2];
ll solve(string s,int k,int pos,int st)
{
	if(pos==s.length()&&k>0||k<0)
		return 0;
	if(pos==s.length()&&k==0)
		return 1;
	if(dp[pos][k][st]!=-1)
		return dp[pos][k][st];
	ll ans=0;
	int limit=s[pos]-'0';
	if(st==0)
		limit=9;
	int i;

   
    	for(i=0;i<=limit;i++)
    	{
    		int str=st;
              if(i<limit)
              	str=0;
    		if(i>0)
    		{  
    			if(k>0)
                ans+=solve(s,k-1,pos+1,str);
            else
            	continue;

    		}
    		 if(i==0)
    		{
    			ans+=solve(s,k,pos+1,str);
    		}
    	}
    
    	dp[pos][k][st]=ans;
    	return ans;
    
}
int main()
{
     int k;
     string s;
     cin>>s>>k;
     //cout<<s;
     memset(dp,-1,sizeof(dp));
     cout<<solve(s,k,0,1)<<"\n";
}

Measured memory_bytes: 3640
#include <stdio.h>

int gcd(int p, int q){
  while(q != 0){
    int r = p % q;
    p = q;
    q = r;
    }
    return p;
    }


int main(void){
 int k,i,j,t,sum=0,x;
 (void)scanf("%d",&k);
for(i=1;i<=k;i++){
  for(j=1;j<=k;j++){
    for(t=1;t<=k;t++){
      x=gcd(gcd(i,j),t);
      sum+=x;
    }
  }
}
printf("%d\n",sum);
return 0;
}

Measured memory_bytes: 1728
n = int(input())
inputs = [0,0,0,0,0]
inputs[0] = int(input())

inputs[1] = int(input())

inputs[2] = int(input())

inputs[3] = int(input())

inputs[4] = int(input())

posi = [n,0,0,0,0,0]

min = inputs[0]

for inp in inputs:
	if min > inp:
		min = inp

nn = int(n / min)
if nn != 0:
	if n % min != 0:
		nn += 1
	nn = nn -1

nn = 5 + nn

print(nn)

Measured memory_bytes: 38384
#include <iostream>

using namespace std;

typedef long long ll;

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

		ll cnt0 = 0, cnt1 = 0;
		for (int i = 1; i <= N; i++) {
				if (i % K == 0) cnt0++;
				else if (i % K == (K/2)) cnt1++;
		}

		ll ans0 = cnt0 * cnt0 * cnt0;
		ll ans1 = cnt1 * cnt1 * cnt1;
		if (K % 2) cout << ans0 << endl;
		else cout << ans0 + ans1 << endl;
		return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0, i_l = (int)n; i < i_l; i++)
#define loop(i, a, b) for (int i = a; i < (int)(b); i++)
 
int main() {
    int n;
    cin >> n;
    int v[n];
    int c[n];
    rep (i, n) cin >> v[i];
    rep (i, n) cin >> c[i];
    int total = 0;
    rep (i, n) {
        int d = v[i] - c[i];
        if (d > 0) {
            total += d;
        }
    }
    cout << total << endl;
    return 0;
}

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

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		int M = (int) 1e7 + 10;
		int[] cnt = new int[M];
		for(int i=1;i<M;i++) cnt[i] = 1;
		for(int i=1;i<M;i++){
			for(int j=i+i;j<M;j+=i){
				cnt[j] += 1;
			}
		}
		long ans = 0;
		for(long k=1;k<=N;k++){
			//Console.WriteLine("{0} {1}",
			ans += k * cnt[k];
		}
		Console.WriteLine(ans);
		
	}
	long N;
	public Sol(){
		N = ri();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


Measured memory_bytes: 55888
//
//  main.c
//  GrandContest009_A_MultipleArray
//
//  Created by T.T on 2017/01/22.
//  Copyright © 2017年 T.T. All rights reserved.
//

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//#define DEBUG
#define MAXAB 100000

unsigned long long N=0;
unsigned long long A[MAXAB+1] = {};
unsigned long long B[MAXAB+1] = {};

void load(){
    scanf("%lld", &N);
    
    unsigned long long i;
    //A,Bの添え字は1~なことに注意ß
    for(i=1; i<N+1; i++){
        scanf("%lld %lld", &A[i], &B[i]);
    }
}

//n個目のボタンをc回おす
//void push(unsigned long long n, unsigned long long c){
//    unsigned long long i;
//    for(i=1; i<=n; i++)A[i]+=c;
//}

//ボタン押した回数
unsigned long long count = 0;

//A,Bの要素を与えて、何回ボタン押せば整数倍になるか計算
unsigned long long culc(unsigned long long a, unsigned long long b){
    unsigned long long mul = (a/b)*b;
    
    while(a>mul){
        mul += b;
    }
#ifdef DEBUG
    printf("mul:%llu\n", mul);
#endif
    return mul - a;
}

void solve(){
    unsigned long long i;
    for(i=N; i>=1; i--){
        A[i] += count;
        
        unsigned long long tempcnt = culc(A[i], B[i]);
#ifdef DEBUG
        printf("%llu\n", tempcnt);
#endif
        count += tempcnt;
        //push(i, tempcnt);
    }
    
    printf("%llu\n", count);
}

int main(int argc, const char * argv[]) {
    load();
    solve();
    return 0;
}


Measured memory_bytes: 1664
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
ll mod=1e9+7;

int main(){
  int N,d[50];
  cin>>N;
  for (int i(0);i<N;i++) cin>>d[i];
  int sum(0);
  for (int i(0);i<N;i++){
    for (int j(i+1);j<N;j++){
       sum+=d[i]*d[j];
    }
  }
  cout << sum << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <climits>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <fstream>

using namespace std;
#define TOSTRING(x) #x
#define SZ(x) (int)(x).size()
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REPR(i,n) for(int i=(n)-1;i>=0;i--)
#define ALL(s) (s).begin(), (s).end()
#define so(V) sort(ALL(V))
#define rev(V) reverse(ALL(V))
#define uni(v) v.erase( unique(ALL(v)) , v.end());
#define PAU system("pause")

typedef long long unsigned int llu;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<vb> vvb;
const double EPS = 1e-9;
const int MOD = 1e9 + 7;
const int INF = (1 << 30);
const double PI = acos(-1);

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N;
	cin >> N;
	int K;
	cin >> K;
	ll mul = 0;
	ll mul1 = 0;
	FOR(i,1, N + 1) {
		if (i % K == 0)mul++;
		else {
			if (K % 2 != 0)continue;
			if (i % (K / 2) == 0)mul1++;
		}
	}
	ll ans = mul * mul * mul + mul1 * mul1 * mul1;
	cout << ans << endl;
	PAU;
	return 0;
}


Measured memory_bytes: 504
#pragma region cp-helper
#include <bits/stdc++.h>
using namespace std;
#define AC ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define int long long
#define ll long long
#define ull unsigned long long
#define ii pair<int, int>
#define lll pair<ll, ll>
#define vi vector<int>
#define vvi vector<vi>
#define vl vector<ll>
#define vll vector<lll>
#define vvl vector<vl>
#define vii vector<ii>
#define all(a) a.begin(), a.end()
#define qsort(a) sort(all(a))
#define qsortd(a) sort(all(a), greater<>())
#define qsortf(a, f) sort(all(a), f)
#define pb(n) push_back(n)
#define eb(n) emplace_back(n)
#define pp(a, b) emplace_back(a, b)
#define umap unordered_map
#define uset unordered_set
#define nl '\n'
#define fileio(in, out) freopen(in, "r", stdin); freopen(out, "w", stdout)
#define qmod %mod
#define pls signed
#define give main()
const int mod = 1000000007;

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

#pragma endregion

const int N = 4005;

int n, d, a, b, ans;

pls give {
    AC;
    int n, d;
    cin >> n >> d;
    d *= d;
    for (int i=0; i<n; i++) {
        cin >> a >> b;
        if (a*a + b*b <= d) ans++;
    }
    cout << ans << nl;
}

Measured memory_bytes: 3648
//#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
#include <queue>

using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<n;++i)
#define mod (ll)(1e9+7)
#define FIX(a) ((a)%mod+mod)%mod
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define fi first
#define se second
#define pb push_back
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vint abc(26,100);
    REP(i,n){
        string s;
        cin >> s;
        vint sc(26,0);
        for(char c : s){
            sc[(c-'a')]++;
        }
        REP(i,26){
            abc[i]=min(abc[i],sc[i]);
        }
    }
    string ans="";
    REP(i,26){
        if(abc[i]==100)continue;
        REP(j,abc[i]){
            ans+={(char)('a'+i)};
        }
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
# D - Alter Altar
N = int(input())
c = input()

white = c.count('W')
red = c.count('R')

left = [0, 0]
right = [white, red]
ans = min(white, red)

for i in range(0, N):
	if c[i] == 'W':
		left[0] += 1
		right[0] -= 1
	else:
		left[1] += 1
		right[1] -= 1
	
	count = max(left[0], right[1])
	ans = min(ans, count)

print(ans)

Measured memory_bytes: 9364
#include <iostream>
#include <cstring>
#include <map>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <set>
#include <vector>
#include <queue>
#include <list>
#include <numeric>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <math.h>
#include <stack>
#include <climits>
#include <bitset>
#include <utility>


using namespace std;
typedef long long ll;

//最小公倍数
ll gcd(ll x, ll y) {
  ll tmp = 0;
  if (x < y){
    tmp=x;
    x=y;
    y=tmp;
  }
  while (y > 0) {
    ll r = x % y;
    x = y;
    y = r;
  }
  return x;
}

//最大公倍数
ll lcm(ll x,ll y){
  return x/gcd(x,y)*y;
}

//階乗
ll kaijo(ll k){
    ll sum = 1;
    for (ll i = 1; i <= k; ++i)
    {
        sum *= i;
        sum%=1000000000+7;
    }
    return sum;
}

//for(int i = ; i < ; i++){}

ll lmax(ll s,ll t){
  if(s>t){
    return s;
  }
  else{
    return t;
  }
}

ll lmin(ll s,ll t){
  if(s<t){
    return s;
  }
  else{
    return t;
  }
}


int main(){
  int n,a,b;
  cin>>n>>a>>b;
  a--;
  b--;
  bool change = false;
  if(a>=b){
    swap(a,b);
    change=true;
  }
  int counter = 0;
  while(a+1<b){
    if(counter%2==0){
      // アリスのターン
      a++;
    }
    else{
      b--;
    }
    counter++;
  }
  if((counter%2==1&&!change)||(counter%2==0&&change)){
    cout<<"Alice"<<endl;
  }
  else{
    cout<<"Borys"<<endl;
  }
  return 0;
}


Measured memory_bytes: 256
import sys
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()

S=ni()
K=ni()
S=str(S)

count_one=0
ans_tmp=1
for i in range(len(S)):
  if S[i]=='1':
    count_one+=1
  else:
    ans=S[i]
    break

if K<=count_one:
  print(1)
else:
  print(ans)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define P pair<int,int>
#define PI 3.141592653589793
const int INF = 1001001001;
const ll MX = 1e18;
const int mod = 1000000007;
template<class T> inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}

int main() {
	int d, t, s;
	cin >> d >> t >> s;

	if (d % s == 0) {
		if (d / s <= t) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
	else {
		if (d / s < t) cout << "Yes" << endl;

		else cout << "No" << endl;
	}
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
template<class T> ostream& operator<<(ostream &os, vector<T> V) {
os << "[ "; for(auto v : V) os << v << " "; return os << "]";}
template<class L, class R> ostream& operator<<(ostream &os, pair<L,R> P) {
    return os << "(" << P.first << "," << P.second << ")";}

// #define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cout << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...) 1
#endif
typedef long long ll;
typedef double ld;
#define pll pair<ll,ll>
#define pii pair<int, int>
#define pb push_back
#define mp(x, y) make_pair((x), (y))
#define F first
#define S second
#define I insert
#define vi vector<int>
#define vll vector<ll>
#define vpll vector<pll>
#define all(x) (x).begin(), (x).end()
#define sz(x) (ll)(x).size()
   
const ll Mod = 1e9 + 7;

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); 
    string a , b;
    cin >> a >> b;
    int n = a.size() , m = b.size();

    int dp[n+1][m+1];
    char dir[n+1][m+1];
    memset(dp , 0 , sizeof(dp));

    for(int i = 1 ;i <= n ; i++){
        for(int j = 1 ;j <= m ;j++){
            if(a[i-1] == b[j-1]){
                dp[i][j] = max(dp[i-1][j-1] + 1 , max(dp[i-1][j] , dp[i][j-1]));

                if(dp[i][j] == 1 + dp[i-1][j-1])
                    dir[i][j] = 'O';
                else if(dp[i][j] == dp[i-1][j])
                    dir[i][j] = 'L';
                else
                    dir[i][j] = 'D';
            }
            else{
                dp[i][j] = max(dp[i-1][j] , dp[i][j-1]);
                if(dp[i][j] == dp[i-1][j])
                    dir[i][j] = 'L';
                else
                    dir[i][j] = 'D';
            }
        }
    }
    vector<char> v;
    int i = n , j = m;
    while(i&&j){
        if(dir[i][j] == 'O'){
            v.pb(a[i-1]);
            i--;
            j--;
        }
        else if(dir[i][j] == 'L')
            i--;
        else
            j--;
    }
    reverse(all(v));
    for(auto it : v)
        cout << it;
    cout << endl;


    return 0;
}

Measured memory_bytes: 44288
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;

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

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

// Self settings
// clang-format off
#define MAX_N 100000
#define REP(i, N) for (int i = 0; i < (int)(N); ++i)
#define SLN(i,N) (i == N-1 ? "\n" : " ")
// clang-format on

int main(void)
{
  int X;
  cin >> X;
  if (X == 3 || X == 5 || X == 7) {
    cout << "YES" << endl;
  }
  else {
    cout << "NO" << endl;
  }
  return 0;
}


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

int main(void) {
    int n;
    cin >> n;
    vector<int> mochi(n);
    for (int i = 0; i < n; i++) {
        cin >> mochi.at(i);
    }

    sort(mochi.begin(), mochi.end());
    int same_size = 0;
    for (int i = 0; i < n-1; i++) {
        if (mochi.at(i) == mochi.at(i+1)) {
            same_size++;
        }
    }
    cout << n - same_size << endl;
}

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

int main() {
    int a,b,x;
    cin>>a>>b>>x;
    if(2*x<=a*a*b){
        double c=2.0*x/a/b;
        printf("%.7f\n",atan(b/c)/(2*M_PI)*360.0);
    }else{
        double c=2.0*b-2.0*x/a/a;
        printf("%.7f\n",atan(c/a)/(2*M_PI)*360.0);
    }
}

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

int main(){
    int N, M;
    cin >> N >> M;
    vector< pair<long long, int> > arrA(N);
    for(int i = 0; i < N; i++){
        long long tmp;
        cin >> tmp;
        arrA[i] = make_pair(tmp, 1);
    }

    vector<pair<long long, int> > arrBC(M);
    for(int i = 0; i < M; i++){
        int B = 0;
        long long C = 0;
        cin >> B >> C;
        arrBC[i] = make_pair(C, B);
    }

    // arrAの末尾にarrBCを連結
    arrA.insert(arrA.end(), arrBC.begin(), arrBC.end());
    sort(arrA.begin(), arrA.end(), greater<pair<long long, int> >());

    int cnt = 0;
    long long result = 0;
    int idx = 0;
    while(idx <= N+M-1){
        if(cnt + arrA[idx].second > N){
            result += ((N - cnt) * arrA[idx].first);
            break;
        }
        result += (arrA[idx].second * arrA[idx].first);
        cnt += arrA[idx].second;
        idx++;
    }

    cout << result << endl;
    return 0;
}


Measured memory_bytes: 6528
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
int n;
vector<pair<double,P>>vec;
int main(){
	cin >> n;
	rep(i,n){
		int x,y; cin >> x >> y;
		double deg = atan2((double)(y),(double)(x));
		vec.pb(mp(deg,mp(x,y)));
	}
	sort(vec.begin(),vec.end());
	rep(i,n){
		vec.pb(vec[i]);
	}
	double ans = 0;
	rep(i,2*n) rep(j,2*n){
		if(i > j || j-i+1 > n) continue;
		double sx = 0, sy = 0;
		for(int k=i;k<=j;k++) { sx += vec[k].sc.fi; sy += vec[k].sc.sc; }
		ans = max(ans,sqrt(sx*sx+sy*sy));
	}
	printf("%.12f\n",ans);
}

Measured memory_bytes: 512
#include <numeric>
#include <bits/stdc++.h>
#include <utility>
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <math.h>
#include <string>
#define ll long long
#define ull unsigned long long
#define make(type,x) type x; cin>>x
#define make2(type,x,y) type x,y; cin>>x>>y
#define fr(x,y) for(long long x=0;x<y;x++)
#define makevec(x,y,n) vector <x> y(n); for(ll i=0;i<n;i++) cin>>y[i]
#define M (ll)1000000007
#define MM (ll) 1e8
#define INF (ll) 1e18

# define IOS ios_base::sync_with_stdio(false); cin.tie(NULL)

using namespace std;

template <typename T>
T modpow(T base, T exp, T modulus) {
  base %= modulus;
  T result = 1;
  while (exp > 0) {
    if (exp & 1) result = (result * base) % modulus;
    base = (base * base) % modulus;
    exp >>= 1;
  }
  return result;
}
bool sortbysec(const pair <ll,ll> &a,const pair <ll,ll> &b){
    return a.second<b.second;
}

struct cmp {
	bool operator() (const pair<int, int> &a, const pair<int, int> &b) const {
		int lena = a.second - a.first + 1;
		int lenb = b.second - b.first + 1;
		if (lena == lenb) return a.first < b.first;
		return lena > lenb;
	}
};


struct c_h {
    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        x ^= FIXED_RANDOM;
        return x ^ (x >> 16);
    }
};

ll calcpow(ll x, ll y)
{
    ll temp;
    if(y == 0)
        return 1;
    temp = calcpow(x, y / 2);
    if (y % 2 == 0)
        return temp * temp;
    else
    {
        if(y > 0)
            return x * temp * temp;
        else
            return (temp * temp) / x;
    }
}
ll gcd(ll a, ll b){
    if(b==0) return a;
    return gcd(b,a%b);

}
ll egcd(ll a, ll b, ll &x,ll &y){
    if(b==0){
        x=1;
        y=0;
        return a;
    }
    ll x1;
    ll y1;
    ll g=egcd(b,a%b,x1,y1);
    x=y1;
    y=x1-y1*(a/b);
    return g;
}


bool isprime(ll a){
bool flag=1;
for(ll i=2;i*i<=a;i++){
    if(a%i==0) {flag=0; break;}
}
return flag;
}
ll dx[2]={1,0};
ll dy[2]={0,1};

int main(){
    IOS;
    make2(ll,k,x);
    if(500*k>=x) cout<<"Yes \n";
    else cout<<"No \n";



    return 0;
}


Measured memory_bytes: 3576
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n, x=0;
	cin >> n; 
    vector<int> a(n+1,0);
    for(int i=1; i<=n; ++i){
        cin >> a[i];
        x += a[i]-a[i/2*2];
    }
    cout << x << " ";
    for(int i=2; i<=n; ++i){
        x=2*a[i-1]-x;
        cout << x << " ";
    }
	cout << endl;
}

Measured memory_bytes: 1664
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,m,n) for(int i=m;i<n;i++)
ll mod=1e9+7;
typedef pair<ll,int> P;

ll mod_pow(ll x,ll n){
    if(n==0) return 1;
    ll res=mod_pow(x*x%mod,n/2);
    if(n&1) res=res*x%mod;
    return res;
}

int main(){
  int n;
  ll m;
  cin>>n>>m;
  vector<P> res;
  for(int i=2;i*i<=m;i++){
    if(m%i==0) res.push_back(P(i,0));
    while(m%i==0){
      res[res.size()-1].second++;
      m/=i;
    }
  }
  if(m!=1) res.push_back(P(m,1));
  
  ll a[n+30];
  a[0]=1;
  rep(i,1,n+30) a[i]=a[i-1]*i%mod;
  ll b[n+30];
  b[0]=1;
  rep(i,1,n+30) b[i]=mod_pow(a[i],1e9+5);
  
  ll ans=1;
  rep(i,0,res.size()){
    ans=(((ans*a[res[i].second+n-1])%mod*b[n-1])%mod*b[res[i].second])%mod;
  }
  
  cout<<ans<<endl;;
}

Measured memory_bytes: 1792
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<set>
using namespace std;
//	cin>>n>>k;
//	cout<<n<<k<<endl;
//string S[100];

int main(){
	int N;cin>>N;
	int ans=0;
	for (int i=1;i<N+1;i++){
		ans+=i;
	}
	cout<<ans<<endl;

}

Measured memory_bytes: 256