akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0; i<(n); i++)
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; }

int main(){
    int n;
    float ans;
    cin>>n;
    rep(i,n){
        float x;
        string u;
        cin>>x>>u;
        if (u=="BTC") x*=380000;
        ans+=x;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
#define ld long double
#define vi vector<int>
#define umap unordered_map
#define pii pair<int, int>
#define vpii vector<pii>
#define uset unordered_set
#define frw(i, a, b) for(int i = (a); i < (b); i++)
#define bck(i, a, b) for(int i = (a); i > (b); i--)
#define T() int testcases; cin >> testcases; frw(TC, 1, testcases + 1)
#define tez ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define fi first
#define se second
#define pow asdihagsiduh
#define pub push_back
#define in insert
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define sz(a) (int)(a.size())
#define sq(a) ((a) * (a))

#define trace(...) ZZ(#__VA_ARGS__, __VA_ARGS__)
template<typename Arg1> 
void ZZ(const char* name, Arg1&& arg1){
    cerr << name << " = " << arg1 << endl;
}
template<typename Arg1, typename... Args>
void ZZ(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << " = " << arg1;
    ZZ(comma, args...);
}

//console o/p without variable names
#define trace1(...) ZZZ(__VA_ARGS__)
template<typename Arg1>
void ZZZ(Arg1&& arg1){
    cerr << arg1 << endl;
}
template<typename Arg1, typename... Args>
void ZZZ(Arg1&& arg1, Args&&... args){
    cerr << arg1 << ' ';
    ZZZ(args...);
}

signed main(){
    tez
    char c; cin >> c;
    cout << ++c;
}

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

int main() {
    int N;
    cin >> N;
    vector<int> H(N);
    for (int i = 0; i < N; ++i) cin >> H[i];
    
    for (int i = 1; i < N; ++i) {
        if (H[i - 1] < H[i]) --H[i];
    }
    bool judge = true;
    for (int i = 1; i < N; ++i) {
        if (H[i - 1] > H[i]) judge = false;
    }
    if (judge) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


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

using namespace std;

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

    vector<pair<int, int>> a(m);

    for(int i = 0; i < m; i++) {
        cin >> a[i].first >> a[i].second;
    }

    sort(a.begin(), a.end());

    vector<pair<int, int>> b(n);

    for(int i = 0; i < n; i++) {
        b[i].first = b[i].second = i;
    }

    for(int i = 0; i < m; i++) {
        int y = a[i].second - 1;

        b[y].second = b[y + 1].second;
        b[y + 1].first = b[y].first;
    }

    for(int i = 0; i < n; i++) {
        cout << b[i].second - b[i].first + 1 << " \n"[i + 1 == n];
    }
}


Measured memory_bytes: 5212
n = gets.to_i
s = gets.chomp

alphabets = []
('A'..'Z').each do |alphabet|
  alphabets << alphabet
end

str = []
s.length.times do |i|
  index = alphabets.index(s[i]) + n
  index -= 26 if index >= 26
  str << alphabets[index]
end

puts str.join

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

using ll = long long;

const int mod = 1000000007;
const int INF = 1000000000;
const double EPS = 1e-9;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, A;
    cin >> N >> A;
    vector<int> x(N);
    int K = A;
    for (int i = 0; i < N; ++i) {
        cin >> x[i];
        K = max(K, x[i]);
    }
    K = A;
    vector<vector<vector<ll>>> dp(N + 1, vector<vector<ll>>(N + 1, vector<ll>(K * N + 1, 0)));
    dp[0][0][0] = 1;
    for (int j = 0; j < N + 1; ++j) {
        for (int k = 0; k < N + 1; ++k) {
            for (int s = 0; s < K * N + 1; ++s) {
                if (x[j - 1] > s && j >= 1) {
                    dp[j][k][s] = dp[j - 1][k][s];
                }
                if (x[j - 1] <= s && j >= 1 && k >= 1) {
                    dp[j][k][s] = dp[j - 1][k][s] + dp[j - 1][k - 1][s - x[j - 1]];
                }
            }   
        }
    }
    ll ans = 0;
    for (int i = 1; i <= N; ++i) {
        ans += dp[N][i][i * A];
    }
    cout << ans << endl;
}


Measured memory_bytes: 52224
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
typedef vector<double> VD;
typedef vector<VD> VVD;

template<typename T> void chmin(T &a, T b) { if (a > b) a = b; }
template<typename T> void chmax(T &a, T b) { if (a < b) a = b; }

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }

int main() {
    ll l, r;
    cin >> l >> r;
    if (r - l >= 5000){
        cout << 0 << endl;
        return 0;
    }

    ll ans = 1e9;
    FOR(x,l,r) FOR(y,x+1,r){
        chmin(ans, ((ll)x * y) % 2019);
    }
    cout << ans << endl;
    return 0;
}


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

const int N = 110005;

int n, val[N];
vector<int> edge[N];
int num[N];

void DFS(int t);

int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; ++i) {
    int x;
    scanf("%d", &x);
    edge[x].push_back(i);
  }
  DFS(1);
  printf("%d\n", val[1]);
  return 0;
}

void DFS(int t) {
  int cnt = 0;
  for (int i = edge[t].size() - 1; i >= 0; --i) DFS(edge[t].at(i));
  for (int i = edge[t].size() - 1; i >= 0; --i) num[++cnt] = val[edge[t].at(i)];
  sort(num + 1, num + cnt + 1);
  for (int i = 1; i <= cnt; ++i) 
    val[t] = max(val[t], num[i] + cnt - i + 1);
}


Measured memory_bytes: 12544
#include<stdio.h>

int main(void)
{
  int a, b, r, ta, tb;

  while ( scanf( "%d %d", &a, &b ) != EOF ) {
    ta = a;
    tb = b;
    while( ( r = a % b ) != 0 ) {
      a = b;
      b = r;
    }
    r = b;
    a = ta;
    b = tb;
    
    while( a - b != 0) {
    	if ( a < b)
    		a += ta;
    	else
    		b += tb;
    }
    printf( "%d %d\n", r, a );
  }

  return 0;
}

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

using namespace std;

int main(){
    int n;
    cin >> n;
    string S, T;
    cin >> S >> T;
    string U = "";
    for (int i = 0; i < n; i++){
        U += S[i];
        U += T[i];
    }

    cout << U << endl;
}

Measured memory_bytes: 256
S_temp = input()
S = [c for c in S_temp]
count = [0] * (len(S)+1)
count[0] = 0
for i in range(len(S)):
  if S[i] == 'A' or S[i] == 'C' or S[i] == 'G' or S[i] == 'T':
    count[i+1] = count[i] + 1
print(max(count))

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
typedef pair<ll,ll> P;
typedef priority_queue<P,vector<P>,greater<P>> P_queue;

const ll MOD=998244353;
const ll mod=1000000007;
const ll INF=1e15;
const double PI=3.1415926535897932;
vec dx={1,0,-1,0};
vec dy={0,1,0,-1};

#define REP(i,a,b) for(int i=(int)a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define mp make_pair
#define ALL(a) a.begin(),a.end()
#define SORT(a) sort(ALL(a))
#define U_ERASE(V) V.erase(unique(ALL(V)), V.end());
#define ADD(a,b) a=(a+b)%mod


int main(){
    double A,B,H,M; cin>>A>>B>>H>>M;
    double a,b;
    b=M*PI/30;
    a=(H+M/60)*PI/6;
    //cout<<a<<' '<<b<<endl;
    a=abs(a-b);
    double ans=A*A+B*B-2*A*B*cos(a);
    double BIG=10000, SMALL=0;
    while(BIG>SMALL+0.00000000001){
        double MID=(BIG+SMALL)/2;
        if(MID*MID>ans) BIG=MID;
        else SMALL=MID;
    }
    cout<<setprecision(15)<<SMALL<<endl;


}

Measured memory_bytes: 4188
#define _GLIBCXX_DEBUG
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <iterator>
#include <numeric>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define mp make_pair
#define pb push_back
#define FI first
#define SE second
#define FOR(i,a,b) for(int (i)=((int)a); (i)<((int)b); (i)++) // [a,b)
#define REP(i,N) FOR((i), 0, ((int)N)) // [0,N)
#define INF (1 << 30)
#define icin(x) int x; cin >> x
#define lcin(x) ll x; cin >> x
#define dcin(x) double x; cin >> x
#define scin(s) string s; cin >> s 
#define all(v) (v).begin(),(v).end()
#define vsz(v) ((int)(v).size())
#define vcin(v,N) vi v(N); REP(i,N) cin >> v[i] // 配列にも使用可能
#define vcinl(v,N) vl v(N); REP(i,N) cin >> v[i]
#define vmax(v) *max_element(all(v)) // 遅い？いつか書き直す
#define vmin(v) *min_element(all(v))
#define vidx(v,it) distance((v).begin(),(it))
#define vsum(v) accumulate(all(v),0)
#define vsumr(v,a,b) accumulate((v).begin()+(a),(v).begin()+(b),0) //[a,b)
#define vfnd(v,val) find(all(v),val) // itrを返す。存在しない場合v.end()を返す
#define vcnt(v,val) count(all(v),val)
#define vrep(v,it) for(auto it=(v).begin(); it != (v).end(); ++it)
#define IOS ios_base::sync_with_stdio(0); cin.tie(0) // IOS;で高速化

// デバッグ用
// dbg(...) printfと同様に使用可能 
// trc(var) (変数名)=(値)と表示
// stopif(val) 条件分が真の時に止まる
// vdbg(v) vの中身を表示
#ifdef LOCAL
    #define dbg(...) fprintf(stderr, __VA_ARGS__)
    #define trc(var) cout << #var << "=" << var << endl;
    #define trc2(v) cout << #v << "={"; 
    #define stopif(val) assert( !(val) )
    #define vdbg(v) vector_debug(v)
#else
    #define dbg(...) 1
    #define trc(var) 1
    #define trc2(v) 1
    #define stopif(val) 1
    #define vdbg(v) 1
#endif

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector< vector<int> > vvi;
int gcd(int a, int b){if(a>b) swap(a,b); return a==0 ? b : gcd(b%a,a);}
ll gcd(ll a, ll b){if(a>b) swap(a,b); return a==0 ? b : gcd(b%a,a);}
template<typename C> inline void vector_debug(vector<C> v){trc2(v);ostream_iterator<C> o(cout,",");copy(all(v),o);cout<<"}"<<endl;}
template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }

// icin(x) ... int x; cin >> x;
// vcin(A,N),vcinl vi(vl) Aを宣言してcinで初期化

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

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

using namespace std;

vector<int> factors(int n)
{
	vector<int> res;
	for (int i = 2; i * i <= n; i++)
	{
		if (n % i) continue;
		res.push_back(i);
		while(n % i == 0)
		{
			n /= i;
		}
	}
	if (n != 1)
	{
		res.push_back(n);
	}
	return res;
}

void solve()
{
	int n;
	cin >> n;
	vector<int> ps = factors(n);
	int s = ps.size(), ans = n;
	for (int bit = 1; bit < (1 << s); bit++)
	{
		int f = 1, k = (__builtin_popcount(bit) % 2) * 2 - 1;
		for (int i = 0; i < s; i++)
		{
			if (bit >> i & 1)
			{
				f *= ps[i];
			}
		}
		//cout << f << endl;
		ans -= n / f * k;
	}
	cout << ans << endl;
}

int main()
{
	solve();
	//cout << "yui(*-v・)yui" << endl;
	return 0;
}



Measured memory_bytes: 3148
class diceClass:
	def __init__(self, valuelist):
		self.valuelist = valuelist
		self.t = valuelist[0]
		self.b = valuelist[5]
		self.n = valuelist[4]
		self.s = valuelist[1]
		self.e = valuelist[2]
		self.w = valuelist[3]

	def throw(self, direction):
		# N,S,W,E
		if direction == 'N':
			self.t, self.s, self.b, self.n = self.s, self.b, self.n, self.t
		elif direction == 'S':
			self.t, self.s, self.b, self.n = self.n, self.t, self.s, self.b
		elif direction == 'W':
			self.t, self.e, self.b, self.w = self.e, self.b, self.w, self.t
		elif direction == 'E':
			self.t, self.e, self.b, self.w = self.w, self.t, self.e, self.b


arrinput = list(map(int, input().split()))
dirinput = input()
dice = diceClass(arrinput)
for s in dirinput:
	dice.throw(s)
print(dice.t)



Measured memory_bytes: 5604
#[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! 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 ; $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, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        n: usize,
        q: usize,
        s: chars,
        td: [(chars, chars); q],
    }

    let pos = |m: i64| -> i64 {
        let mut cur = m;
        for &(ref t, ref d) in td.iter() {
            if cur >= 0 && cur < s.len() as i64 && s[cur as usize] == t[0] {
                if d[0] == 'L' {
                    cur -= 1;
                } else {
                    cur += 1;
                }
            }
        }
        cur
    };

    let l = {
        let mut l = -1;
        let mut r = n as i64;

        while (r - l) > 1 {
            let m = (l + r) / 2;
            if pos(m) < 0 {
                l = m;
            } else {
                r = m;
            }
        }

        l
    };

    let r = {
        let mut l = -1;
        let mut r = n as i64;

        while (r - l) > 1 {
            let m = (l + r) / 2;
            if pos(m) >= n as i64 {
                r = m;
            } else {
                l = m;
            }
        }

        r
    };

    let ans = r - l - 1;

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


Measured memory_bytes: 18684
using System;

namespace B
{
	class Program
	{
		static void Main(string[] args)
		{
			string S = Console.ReadLine();

			string str = S;
			for (int i = 0; i < str.Length; i++)
			{
				if (str[i] != str[str.Length - 1 - i])
				{
					Console.WriteLine("No");
					return;
				}
			}

			str = S.Substring(0,(S.Length - 1) / 2);

			for (int i = 0; i < str.Length; i++)
			{
				if (str[i] != str[str.Length - 1 - i])
				{
					Console.WriteLine("No");
					return;
				}
			}

			str = S.Substring((S.Length + 3) / 2 - 1);

			for (int i = 0; i < str.Length; i++)
			{
				if (str[i] != str[str.Length - 1 - i])
				{
					Console.WriteLine("No");
					return;
				}
			}

			Console.WriteLine("Yes");
		}
	}
}


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

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    int A, B, C, D;
    cin >> A >> B >> C >> D;

    cout << ((A+B) == (C+D) ? "Balanced" : ((A+B) > (C+D) ? "Left" : "Right")) << endl;
    return 0;
}

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

using namespace std;
 
// macro
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define MOD 1000000007
#define M_PI 3.14159265358979323846
#define ll long long
#define ull unsigned long long
#define FOR(i, m, n) for(ll i = m;i < n;i++)
#define SORT(ary) sort(begin(ary), end(ary))
#define VL vector<ll>
#define VVL vector<VL>
#define PL pair<ll, ll>
#define VC vector<char>
#define VVC vector<VC>

// Factorial
// need init
ll factorial_memo[5001];
ll factorial(ll n) {
  factorial_memo[0] = 1;
  if(factorial_memo[n] != -1) return factorial_memo[n];
  factorial_memo[n] = (factorial(n-1) * n) % MOD;
  return factorial_memo[n];
}
 
// Combination(nCr)
// need init
ll nCr_memo[5001][5001];
ll nCr(ll n, ll r) {
  if(r*2 > n) r = n-r;
  if(r == 1) return n;
  if(r == 0) return 1;
  if(nCr_memo[n][r] != -1) return nCr_memo[n][r];
  nCr_memo[n][r] = (nCr(n-1, r) + nCr(n-1, r-1)) % MOD;
  return nCr_memo[n][r];
}

ll dfs(VVL& g, vector<PL>& res, ll v, ll& count, ll from, VL& low, VL& pre) {
  pre[v] = count++;
  low[v] = pre[v];
  for(auto to:g[v]) {
    if (pre[to] == -1) {
      low[v] = min(low[v], dfs(g, res, to, count, v, low, pre));
      if(low[to] == pre[to]) res.push_back(make_pair(v, to));
    } else {
      if(from == to) continue;
      low[v] = min(low[v], low[to]);
    }
  }
  return low[v];
}

vector<PL> bridges(VVL& g, ll N) {
  vector<PL> res;
  if (N > 0) {
    VL low(N, -1);
    VL pre(N, -1);
    ll count = 0;
    dfs(g, res, 0, count, -1, low, pre);
  }
  return res;
}

void solve() {
  ll N,A,B;
  cin >> N >> A >> B;
  ll ans = 0;
  VL X(N);
  REP(i, N) cin >> X[i];
  REP(i, N-1) ans += min((X[i+1]-X[i])*A, B);
  cout << ans << "\n";
}



int main() {
  // init
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
}


Measured memory_bytes: 1024
import java.io.*;
import java.util.*;
import java.util.regex.*;


public class Main {

	final static long MOD = 1000000007;
	public static String[] Ws = null;
	public static int wsIndx = 0;
	public static BufferedReader in = null;
	public static long cnt=0;
	public static PrintWriter pw = new PrintWriter(System.out);
	public static void main(String[] args) throws Exception {
		solutionA(args);
		if(in!=null){
			in.close();
		}
		pw.flush();
		pw.close();
	}

	public static void solutionA(String[] args) throws Exception{

		int N = nextInt();
		int R = nextInt();

		if(N>=10) {
			pw.println(R);
		}else {
			pw.println(R+100*(10-N));

		}

	}


	public static void check() throws Exception{
		if(in == null){
			in = new BufferedReader(new InputStreamReader(System.in));
		}
		if(Ws==null || Ws.length<=wsIndx){
			Ws = in.readLine().split(" ");
			wsIndx=0;
		}
	}
	public static int nextInt()throws Exception{
		check();
		return Integer.parseInt(Ws[wsIndx++]);
	}

	public static long nextLong()throws Exception{
		check();
		return Long.parseLong(Ws[wsIndx++]);
	}

	public static String nextString()throws Exception{
		check();
		return Ws[wsIndx++];
	}

	public static int[] nextInts()throws Exception{
		check();
		int[] tmp = new int[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Integer.parseInt(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static long[] nextLongs()throws Exception{
		check();
		long[] tmp = new long[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Long.parseLong(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static String[] nextStrings()throws Exception{
		check();
		wsIndx=Ws.length;
		return Ws;
	}

}



Measured memory_bytes: 22740
#include<bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
#define LL long long
const int N=2e5+5;

int n,d,a;
pii p[N];
int r[N];
LL ans;

int main()
{
	scanf("%d%d%d",&n,&d,&a);
	for(int i=1;i<=n;i++)
		scanf("%d%d",&p[i].first,&p[i].second);
	sort(p+1,p+n+1);
	int now=1;
	for(int i=1;i<=n;i++)
	{
		p[i].second-=r[i];
		while(now<=n && p[now].first-2*d<=p[i].first) now++;
		if(p[i].second>0)
		{
			int num=(p[i].second+a-1)/a;
			ans+=num;
			r[i]+=num*a;
			r[now]-=num*a;
		}
		r[i+1]+=r[i];
	}
	printf("%lld\n",ans);
	
	return 0;
}

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

using namespace std;

// repetition
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

// container util
#define all(x) (x).begin(), (x).end()

// typedef
typedef long long llint;
typedef unsigned long long ull;
typedef complex<long double> Complex;
typedef pair<int, int> P;
typedef tuple<int, int, int> TP;
typedef vector<int> vec;
typedef vector<vec> mat;

// constant
const int MOD = (int)1e9 + 7;
const int INF = (int)1e9;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};
const double pi = 3.14159265358979323846;

// conversion
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}

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

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

  int n;
  cin >> n;
  map<string, int> mp;
  rep(i, n) {
    string s;
    cin >> s;
    mp[s]++;
  }
  vector<pair<int, string>> ans;
  for (auto& v : mp) {
    ans.emplace_back(v.second, v.first);
  }
  sort(ans.rbegin(), ans.rend());

  // for (auto& v : ans) {
  //   cout << v.first << " " << v.second << endl;
  // }

  int t = ans[0].first;
  int j = 0;
  vector<string> res;
  while (t == ans[j].first) {
    res.emplace_back(ans[j].second);
    t = ans[j].first;
    j++;
  }
  reverse(all(res));
  for (auto& v : res) {
    cout << v << endl;
  }

  return 0;
}

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

#define rep(i,n) for(ll i=0;i<n;++i)
#define all_map(itr,mp) for(auto itr=mp.begin();itr!=mp.end();itr++)
#define ALL(a) (a).begin(),(a).end()
#define chmax(x, y) x = max(x,y);


using namespace std;
using ll  = long long;
using pll = pair<ll, ll>;
ll gcd (ll x, ll y){return y?gcd(y,x%y):x;};

int main(){
  ll a,b;
  cin>>a>>b;
  ll ans=0;
  ll G=gcd(a,b);
  ll g1=G;
  for (ll i=2;i*i<=G;i++){
    if (ans==0 & i*i>g1)break;
    if (g1%i==0){
      ans++;
      while (g1%i==0){
        g1/=i;
      }
    }

  }
  if (g1!=1)ans++;
  cout<<ans+1;

    }

  


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

#define F first
#define S second
#define MP make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define LCM(a, b) (a) / __gcd((a), (b)) * (b)
#define CEIL(a, b) (a)/(b)+(((a)%(b))?1:0)
#define ln '\n'

using namespace std;
using LL = long long;
using ldouble = long double;
using P = pair<int, int>;
using LP = pair<LL, LL>;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1e9 + 7;
static const int SIZE = 200005;

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

vector<LL> Div(LL n) {
    vector<LL> ret;
    for(LL i = 1; i * i <= n; ++i) {
        if(n % i == 0) {
            ret.pb(i);
            if(i * i != n) ret.pb(n / i);
        }
    }
    sort(all(ret));
    return ret;
}

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

    ldouble A, B, H, M;
    cin >> A >> B >> H >> M;

    ldouble h = H * (360 / 12);
    h += M * (ldouble(360 / 12) / 60);
    ldouble m = M * (360 / 60);
    ldouble dif = fabs(h - m);
    if(dif >= 180) dif = 360.0 - dif;

    printf("%.10Lf\n", sqrt(A * A + B * B - (2 * A * B * cos(dif * (M_PI / 180)))));
    return 0;
}



Measured memory_bytes: 4160
x, y = map(int, input().split())
X, Y = 0, 0
l = [4, 6, 9, 11]
if x == 2:
  X = 3
elif x in l:
  X = 2
else:
  X = 1
if y == 2:
  Y = 3
elif y in l:
  Y = 2
else:
  Y = 1
if X == Y:
  print("Yes")
else:
  print("No")

Measured memory_bytes: 3064
N = int(input())
S = list(map(int, input().split()))
INF = 10 ** 10

S.sort()

parents = [S[-1]]
S[-1] = INF
from_here = 1

for _ in range(N):
    checking = from_here
    first = True
    parents.sort(reverse=True)
    for i in parents[:]:
        while True:
            if S[-checking] < i and first:
                parents.append(S[-checking])
                S[-checking] = INF
                from_here = checking + 1
                break
            elif S[-checking] < i:
                parents.append(S[-checking])
                S[-checking] = INF
                break
            else:
                checking += 1
                first = False
            if checking == 2 ** N + 1:
                print('No')
                exit()
else:
    print('Yes')

Measured memory_bytes: 33124
#include<bits/stdc++.h>
#define ll long long
#define inf 0x3f3f3f3f
using namespace std;
const int maxn = 1e5+5;

int main(){
	string s; cin >> s;
	if(s[2] == s[3] && s[4] == s[5]) puts("Yes");
	else puts("No");
}

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

using namespace std;

int main()
{
    int n;

    cin >> n;

    for (int i = 1; i <= 9; i++) {
        if (n % i == 0 && n / i < 10) {
            cout << "Yes" << endl;
            return (0);
        }
    }

    cout << "No" << endl;
}


Measured memory_bytes: 256
package main

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

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

// min, max, asub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func asub(a, b int) int {
	if a > b {
		return a - b
	}
	return b - a
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

func lowerBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] >= x
	})
	return idx
}

func upperBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] > x
	})
	return idx
}

var col []int
var mcol int
var used []bool

func bfs(edge, enum [][]int) {
	q := []int{0}
	for len(q) != 0 {
		v := q[0]
		used[v] = true
		q = q[1:]
		c := 1
		ng := 0
		for _, e := range enum[v] {
			if col[e] != 0 {
				ng = col[e]
				break
			}
		}
		for i, e := range edge[v] {
			if used[e] {
				continue
			}
			if c == ng {
				c++
			}
			mcol = max(mcol, c)
			col[enum[v][i]] = c
			c++
			q = append(q, e)
		}
	}
}

func main() {
	sc.Split(bufio.ScanWords)

	N := getInt()
	node := make([][]int, N)
	enum := make([][]int, N)
	for i := 0; i < N-1; i++ {
		a, b := getInt()-1, getInt()-1
		node[a] = append(node[a], b)
		node[b] = append(node[b], a)
		enum[a] = append(enum[a], i)
		enum[b] = append(enum[b], i)
	}
	col = make([]int, N-1)
	used = make([]bool, N)
	bfs(node, enum)
	w := bufio.NewWriter(os.Stdout)
	defer w.Flush()
	fmt.Fprintln(w, mcol)
	for _, e := range col {
		fmt.Fprintln(w, e)
	}
}


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

inline long long read(){
    long long s = 0, w = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9'){
        if (ch == '-') w = -1;
        ch = getchar();
    }
    while (ch >= '0' && ch <= '9'){
        s = s * 10 + ch - '0';
        ch = getchar();
    }
    return s * w;
}

int main(){
    string s;
    cin >> s;
    int n = s.size();
    for (int i = 0; i < (n - 1) / 2; i++){
        if (s[i] != s[n-i-1]){
            cout << "No" << endl;
            return 0;
        }
    }
    int _n = (n-1) / 2;
    for (int i = 0; i < _n / 2; i++){
        if (s[i] != s[_n-i-1]){
            cout << "No" << endl;
            return 0;
        }
    }
    for (int i = (n+3)/2-1; i < n; i++){
        if (s[i] != s[n-i-1]){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

//INSERT ABOVE HERE
signed main(){
  Int n;
  cin>>n;
  vector<Int> as(n);
  for(Int i=0;i<n;i++) cin>>as[i];
  set<Int> ss(as.begin(),as.end());
  cout<<((Int)ss.size()==n?"YES":"NO")<<endl;
  return 0;
}


Measured memory_bytes: 11136
#include<vector>
#include<cmath>
#include<map>
#include<cstdlib>
#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<set>
#include<stack>
#include<bitset>
#include<functional>
#include<ctime>
#include<queue>
#include<deque>
#include<complex>
#include<cassert>
using namespace std;
#define pb push_back
#define pf push_front
typedef long long lint;
typedef complex<double> P;
#define mp make_pair
#define fi first
#define se second
typedef pair<int,int> pint;
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
//問題文および制約はちゃんと確認しよう！
//サイズは10^5じゃなくて2×10^5とかかもしれないし、重要な制約・条件を見落としているかも
//とりあえずサンプルを読んでから解法を考えよう？
#define N 262144
int dat[2][N*2+10];
int inf=1000000000;
int query(int a,int b,int id,int k=0,int l=0,int r=N){
	if(r<=a || b<=l) return -inf;
	if(a<=l && r<=b) return dat[id][k];
	int vl=query(a,b,id,k*2+1,l,(l+r)/2);
	int vr=query(a,b,id,k*2+2,(l+r)/2,r);
	return max(vl,vr);
}
void update(int id,int k,int a){
	k+=N-1;
	dat[id][k]=a;
	while(k>0){
		k=(k-1)/2;
		dat[id][k]=max(dat[id][k*2+1],dat[id][k*2+2]);
	}
	return;
}
int a[N];
bool hi[N];int n;
bool ok(int hx,int hy,int nx,int ny,int nh){
	//cout<<hx<<hy<<nx<<ny<<nh<<endl;
	//x側でやる場合
	int target=ny+nh-nx;
	if(target>=0 && query(hx+1,n+10,(target&1))>=target) return true;
	//y側でやる場合
	target=nx+nh-ny;
	if(target>=0 && query(hy+1,n+10,(target&1))>=target) return true;
	return false;
}
int main()
{
	cin>>n;
	rep(i,n) cin>>a[i];
	int h=0,nh=0;
	rep(i,n){
		if(a[i]>h) hi[i]=true,h=a[i],nh++;
	}
	rep(i,N*2+5) dat[0][i]=dat[1][i]=-inf;
	update(0,n+5,0);
	for(int i=n-1;i>=0;i--){
		if(hi[i]){
			update(0,a[i],query(a[i]+1,n+10,0)+2);
			update(1,a[i],query(a[i]+1,n+10,1)+2);
		}
		else{
			update(0,a[i],query(a[i]+1,n+10,1)+1);
			update(1,a[i],query(a[i]+1,n+10,0)+1);
		}
	}
	//REP(i,1,n+1) cout<<query(i,i+1,0)<<" "<<query(i,i+1,1)<<endl;
	int hx=0,hy=0,nx=0,ny=0;
	if(!ok(hx,hy,nx,ny,nh)){
		cout<<-1<<endl;return 0;
	}
	string out="";
	rep(i,n){
		//cout<<hx<<hy<<nx<<ny<<nh<<endl;
		update(0,a[i],-inf);update(1,a[i],-inf);
		//setx
		int nhx=max(hx,a[i]),nnx=nx+(a[i]>hx);
		nh-=hi[i];
		if(ok(nhx,hy,nnx,ny,nh)){
			out+="0";hx=nhx;nx=nnx;
		}
		else{
			out+="1";ny+=(a[i]>hy);hy=max(hy,a[i]);
		}
	}
	cout<<out<<endl;
}


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

using namespace std;

string ord = "aiueo";

string f(string s, int k) {
  string res = "";
  res += s[0];
  for (int i = 0; i < s.size(); i++) {
    if (ord.find(s[i]) == string::npos) continue;
    res += s[i + 1];
  }
  return res.substr(0, k);
}

int main(void) {
  int n;
  while (cin >> n, n) {
    vector<string> s(n);
    for (int i = 0; i < n; i++) {
      cin >> s[i];
    }

    for (int i = 1; i <= 50; i++) {
      set<string> st;
      for (int j = 0; j < n; j++) {
        st.insert(f(s[j], i));
      }
      if (st.size() == n) {
        cout << i << endl;
        break;
      }
      if (i == 50) {
        cout << -1 << endl;
      }
    }
  }

  return 0;
}


Measured memory_bytes: 3032
#include <bits/stdc++.h>
using namespace std;
int main(){
  int a,b;
  cin >> a >> b;
  if((a + b) % 2 == 0){
    cout << (a + b) / 2 << endl;
  }else{
    cout << (a + b) / 2 + 1 << endl;
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <regex>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
using namespace std;

const int MAX = 200000;
const long long INF = 1 << 30;

int main() {
	int N;
	long long A[MAX];
	long long sum[MAX];

	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
		if (i == 0)sum[i] = A[i];
		else sum[i] = sum[i - 1] + A[i];
	}

	long long ans = INF;
	int left = 0;
	int right = 2;
	long long p, q, r, s;

	for (int i = 1; i < N - 1; i++) {

		if (i >= right)right++;

		p = sum[left];
		q = sum[i] - sum[left];
		r = sum[right] - sum[i];
		s = sum[N - 1] - sum[right];

		while (left + 1 < i) {
			long long np = sum[left + 1];
			long long nq = sum[i] - sum[left + 1];

			if (abs(p - q) < abs(np - nq))break;

			p = np;
			q = nq;
			left++;
		}

		while (right + 1 < N) {
			long long nr = sum[right + 1] - sum[i];
			long long ns = sum[N - 1] - sum[right + 1];

			if (abs(r - s) < abs(nr - ns))break;

			r = nr;
			s = ns;
			right++;
		}

		ans = min(max(p, max(q, max(r, s))) - min(p, min(q, min(r, s))), ans);

	}
	
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 3328
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
int mi=1000000007;
ll rec(vector<string>&v,ll n,ll m,vector<vector<ll>>&dp )
{
    if(dp[n][m]!=-1)
    {
        return dp[n][m];
    }
    else
    {
    if(v[n][m]=='#')
    {
        return 0;
    }
	if(n==0 ||m==0)
	{
	    if(n==0)
	    {
	        for(int i=0;i<m;i++)
	        {
	            if(v[0][i]=='#')
	            {
	                return 0;
	            }
	        }
	    }
	    if(m==0)
	    {
	        for(int i=0;i<n;i++)
	        {
	            if(v[i][0]=='#')
	            {
	                return 0;
	            }
	        }
	    }
		return 1;
	}
	
	int u=rec(v,n-1,m,dp);
	int l=rec(v,n,m-1,dp);

	return dp[n][m]=(u+l)%mi;
    }
}
int main()
{
	vector<string>v;
	ll n,m;
	cin>>n>>m;
	for(int i=0;i<n;i++)
	{
		string s;
		cin>>s;
		v.push_back(s);
	}
	vector<vector<ll>>dp(n,vector<ll>(m,-1));
	
	cout<<rec(v,n-1,m-1,dp)<<endl;
}

Measured memory_bytes: 12212
#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
#include <algorithm>


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

Measured memory_bytes: 256
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main {
	long N,M;
	public void solve() {
		N = nextLong();
		M = nextLong();

		long ans = 0;
		ans = Math.min(N, M/2);
		M -= ans * 2;
		ans += M / 4;
		out.println(ans);

	}
	public static void main(String[] args) {
		out.flush();
		new Main().solve();
		out.close();
	}

	/* Input */
	private static final InputStream in = System.in;
	private static final PrintWriter out = new PrintWriter(System.out);
	private final byte[] buffer = new byte[2048];
	private int p = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (p < buflen)
			return true;
		p = 0;
		try {
			buflen = in.read(buffer);
		} catch (IOException e) {
			e.printStackTrace();
		}
		if (buflen <= 0)
			return false;
		return true;
	}

	public boolean hasNext() {
		while (hasNextByte() && !isPrint(buffer[p])) {
			p++;
		}
		return hasNextByte();
	}

	private boolean isPrint(int ch) {
		if (ch >= '!' && ch <= '~')
			return true;
		return false;
	}

	private int nextByte() {
		if (!hasNextByte())
			return -1;
		return buffer[p++];
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = -1;
		while (isPrint((b = nextByte()))) {
			sb.appendCodePoint(b);
		}
		return sb.toString();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}
}

Measured memory_bytes: 23124
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define INF 1000000000
int main(){
cin.tie(0);
ios::sync_with_stdio(false);

	string s;
	cin>>s;
	int co=0;
	REP(i,3){
		if(s[i]=='o')co++;
	}
	cout<<700+co*100<<endl;
	
	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner( System.in );
		int count = sc.nextInt();
		
		int min		= 1000000;
		int max		= -1000000;
		long calc	= 0;
		
		for(int i = 0; i < count; i++) {
			int a = sc.nextInt();
			
			calc += a;
			
			if( a > max ) {
				max = a;
				
			}
			if ( a < min ) {
				min = a;
			}
				
		}
		System.out.println(min+" "+max+" "+calc);
		
	}
}

Measured memory_bytes: 31896
//AtCoder 
#include <bits/stdc++.h>
using namespace std;
using lli=int64_t;

int main() {
#if LOCAL&0
    std::ifstream in("input.txt");
    std::cin.rdbuf(in.rdbuf());
#endif
    string st[3];
    int pt[3]={};
    for(auto&&s:st){
        cin>>s;
    }
    int who=0;
    while(pt[who] < st[who].size()){
        auto s = st[who];
        who=s[pt[who]++]-'a';
    }
    cout<<(char)('A'+who)<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<int> p(n);
  for(int i=0; i<n; i++){
    cin >> p.at(i);
  }
  sort(p.begin(),p.end());
  p.at(n-1) = p.at(n-1)/2;
  int sum=0;
  for(int i=0; i<n; i++){
    sum += p.at(i);
  }
  cout << sum << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <fstream>
#include <vector>
#include <bitset>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>

using namespace std;

typedef long long ll;

const int MAXN = 605;
const ll MOD = 1000000007;

int n,m;
int match[MAXN];

ll ans;
ll fac[MAXN];
ll f[MAXN][MAXN];

int main()
{
	scanf("%d%d",&n,&m);
	n <<= 1;
	for (int u,v,i = 1;i <= m;i++)
	{
		scanf("%d%d",&u,&v);
		match[u] = v;
		match[v] = u;
	}
	fac[0] = 1;
	for (int i = 2;i <= n;i += 2)
		fac[i] = fac[i - 2] * (i - 1) % MOD;
	for (int len = 2;len <= n;len += 2)
		for (int i = 1,j = len;j <= n;i++,j++)
		{
			bool ok = 1;
			for (int k = i;k <= j;k++)
				if (match[k] && (match[k] < i || match[k] > j))
				{
					ok = 0;
					break;
				}
			if (!ok)
				continue;
			int cnt = 0;
			for (int k = i;k <= j;k++)
			{
				cnt += !match[k];
				if (~cnt & 1)
					(f[i][j] -= fac[cnt] * f[k + 1][j]) %= MOD;
			}
			(f[i][j] += fac[cnt]) %= MOD;
			(ans += f[i][j] * fac[n - 2 * m - cnt]) %= MOD;
		}
	printf("%lld\n",(ans + MOD) % MOD);
	return 0;
}

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

#define print(x) cerr << #x << " is " << x << endl;
#define int long long int
#define ll long long
#define vi vector<int>
#define vvi vector<vector<int>>
#define vpi vector<pair<int, int>>
#define all(v) (v).begin(), (v).end()
#define pii pair<int, int>
#define pb push_back
#define eb emplace_back
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define out cout << fixed << setprecision(12) <<

const int N = 2e5 + 10;
const int mod = 1e9 + 7;

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

    int n;
    cin>>n;
    int sum=0;
    for(int i=1;i<=n;++i){
        if(i%3 and i%5 and i%15)
            sum+=i;
    }
    cout<<sum;
    return 0;
}

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

const int N = 2e5 + 5;
const int mod = 1e9 + 7;
int pre[N], a[N];
int main() {
    // ios::sync_with_stdio(false);
    // cin.tie(0);
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
        pre[i] = (pre[i - 1] + a[i]) % mod;
    }
    int ans = 0;
    for (int i = 2; i <= n; i++) {
        ans = (1LL * pre[i - 1] * a[i] + 1LL * ans) % mod;
    }
    cout << ans % mod << "\n";
    return 0;
}

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




int main(){
  int a,b,c;
  cin>>a>>b>>c;
  bool f=true;
  if(a==b &&c==b) f=false;
  if(a!=b && b!=c && a!=c) f=false;
  if(f)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}

Measured memory_bytes: 256
<?php
  fscanf(STDIN, "%d %d", $m,$n);
function gcd($m, $n){
    if($n > $m) list($m, $n) = array($n, $m);
     
    while($n !== 0){
        $tmp_n = $n;
        $n = $m % $n;
        $m = $tmp_n;
    }
    return $m;
}
echo  $m * $n / gcd($m, $n); 
?>

Measured memory_bytes: 3828
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
using namespace std;
using ll = long long;
using P = pair<int,int>;
template <class T> void chmin(T &a, const T &b) noexcept { if (b < a) a = b; }
template <class T> void chmax(T &a, const T &b) noexcept { if (a < b) a = b; }
void debug_out() { cout << "\n"; }
template <class T, class... Args>
void debug_out(const T &x, const Args &... args) { cout << x << " "; debug_out(args...);}
#ifdef _DEBUG
  #define debug(...) debug_out(__VA_ARGS__)
#else
  #define debug(...) 
#endif

const int mod = 1000000007;
// const int mod = 998244353;
struct mint {
  ll x;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
  bool operator==(const mint rhs) const { return x == rhs.x; }
  bool operator!=(const mint rhs) const { return x != rhs.x; }
};
istream& operator>>(istream& is, mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}


int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);
  int n;
  cin >> n;
  vector<ll> a(n),b(n);
  ll suma = 0,sumb = 0;
  rep(i,n) {
    cin >> a[i];
    suma += a[i];
  }
  rep(i,n) {
    cin >> b[i];
    sumb += b[i];
  }
  ll k = sumb - suma;
  if (k < 0) {
    cout << "No\n";
    return 0;
  }
  ll cntb = 0, cnta = 0;
  rep(i,n) {
    if (a[i] > b[i]) cntb += a[i]-b[i];
  }
  rep(i,n) {
    if (a[i] < b[i]) cnta += (b[i] - a[i] + 1)/2;
  }
  debug(cnta, cntb);
  if (k >= cntb && k >= cnta) cout << "Yes\n";
  else cout << "No\n";
  return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <string>
#include <ctype.h>
#include <cstdlib>
#include <cmath>
#include <stack>
#include <map>
#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;

int main()
{
    int n;
    cin >> n;
    vector<pair<int,int>> d(n);
    for (int i = 0; i < n; i++)
    {
        cin >> d[i].first >> d[i].second;
    }
    for (int i = 0; i < n; i++)
    {
        if (d[i].first == d[i].second && d[i+1].first == d[i+1].second && d[i+2].first == d[i+2].second)
        {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
}

Measured memory_bytes: 3596
#include <cstdio>
#include <cstring>
#include <algorithm>
#define rep(i,j,k) for (i=j;i<=k;i++)
#define down(i,j,k) for (i=j;i>=k;i--)
using namespace std;
const int N=2005;
int n,x,i,j,s,m,fa,fb,ans;
int ls[N*3],rs[N*3],pre[N],suf[N],a[N*3],b[N*3];
char ss[N],tt[N];
void updata(int l,int r,int s,int m) {
	ans=min(ans,l*2+r+abs(r-s)+m);
}
int main()
{
//	freopen("shift.in","r",stdin);
//	freopen("shift.out","w",stdout);
	scanf("%s%s",ss+1,tt+1);
	n=strlen(ss+1);
	rep(i,1,n) a[i]=a[i+n]=a[i+2*n]=ss[i]-'0';
	rep(i,1,n) b[i]=b[i+n]=b[i+2*n]=tt[i]-'0';
	rep(i,1,n) fa|=a[i],fb|=b[i];
	if (!fb) { if (fa) printf("-1\n"); else printf("0\n"); return 0;}
	rep(i,1,n*3) if (b[i]) ls[i]=0; else ls[i]=ls[i-1]+1; 
	down(i,n*3,1) if (b[i]) rs[i]=0; else rs[i]=rs[i+1]+1;
	s=n+1; ans=n*3;
	rep(x,0,n-1) {
		m=0;
		rep(i,0,n) pre[i]=suf[i]=0;
		rep(i,n+1,n*2)
		if (a[i]^b[i+x])
		{
			m++; if (!ls[i]) continue;
			pre[ls[i]-1]=max(pre[ls[i]-1],rs[i]);
			suf[rs[i]-1]=max(suf[rs[i]-1],ls[i]);
		}
		down(i,n-1,0) pre[i]=max(pre[i],pre[i+1]);
		down(i,n-1,0) suf[i]=max(suf[i],suf[i+1]);
		rep(i,0,n-1) {
			updata(i,pre[i],x,m);
			updata(i,suf[i],n-x,m);
		}
	}
	printf("%d\n",ans);
	return 0;
}

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

vector<vector<int> > E(100);
bool visited[100];

int solve(const int v)
{
  int res = 0;
  visited[v] = true;
  for (vector<int>::iterator it = E[v].begin(); it != E[v].end(); ++it) {
    if (!visited[*it]) {
      visited[*it] = true;
      res = max(res, solve(*it)+1);
      visited[*it] = false;
    }
  }
  visited[v] = false;
  return res;
}

int main()
{
  int n;
  while (scanf("%d", &n)) {
    if (n == 0)
      break;

    for (int i = 0; i < 100; ++i)
      E[i].clear();

    for (int i = 0; i < n; ++i) {
      int a, b;
      scanf("%d %d", &a, &b);
      --a;
      --b;
      E[a].push_back(b);
      E[b].push_back(a);
    }

    int ans = 0;
    memset(visited, false, sizeof(visited));
    for (int i = 0; i < 100; ++i)
      ans = max(ans, solve(i));

    printf("%d\n", ans+1);
  }
  return 0;
}

Measured memory_bytes: 816
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N; cin >> N;
  string S,T; cin >> S >> T;
  string ans = "";
  
  for(int i = 0; i < N; ++i){
    ans += S.at(i);
    ans += T.at(i);
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<cmath>
#define SZ(x) ((int)x.size())
#include<vector>
#include<set>
#include<map>
#define ll long long
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define pb push_back
#include<string>
#include<cctype>
#include<queue>
#define ii pair<int,int>
#include <sstream>
#define lli long long int
#define pairs pair<int,int>
#define mod 1000000007
const double PI = 3.141592653589793238460;
typedef std::complex<double> Complex;
typedef std::valarray<Complex> CArray;
using namespace std;
ll pows(ll a,ll n,ll m)
{
	ll res=1;
	while(n)
	{
	if(n%2!=0)
	{
		res=(res*a)%m;
		n--;
		}
		else
		{
			a=(a*a)%m;
			n=n/2;
			}	
	}
	return res%m;
}
ll  gcd(ll a,ll b)
{
	if(b==0)
	return a;
	else 
	return gcd(b,a%b);
}
bool isprime(ll n)
{
	if(n==1)
	{
		return false;
	}
	for(ll i=2;i*i<=n;i++)
	{
		if(n%i==0)
		{
			return false;
		}
	}
	return true;
}
bool istrue(string s)
{
	int i=0;
	int j=s.size()-1;
	while(i<j)
	{
	if(s[i]==s[j])
	{
		i++;
		j--;
		}
		else
		{
			return false;
			}	
	}
	return true;
}

int main()
{
   ios::sync_with_stdio(false);
	 cin.tie(0);
    cout.tie(0);
ll a,b;
cin>>a>>b;
ll cnt=1;
ll p=gcd(a,b);
if(p==1)
{
	cout<<1<<endl;
	return 0;
}
if(p==2)
{
	cout<<2<<endl;
	return 0;
}
for(ll i=2;i*i<=p;i++)
{
if(p%i==0)
{
	cnt++;
	while(p%i==0)
	{
		p=p/i;
	}
}
}
if(p>1)
{
	cnt++;
}
cout<<cnt<<endl;
}



Measured memory_bytes: 3652