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

using namespace std;
using ll = long long;


int main()
{
	int n;
	cin >> n;
	int cnt = 0;
	for(int i = 0; i < n; i++) {
		int a; cin >> a; cnt += (a % 2);
	}
	cout << (cnt & 1 ? "NO" : "YES") << endl;
}	

Measured memory_bytes: 256
//code by lynmisakura.wish to be accepted!
#include<bits/stdc++.h>
using namespace std;

typedef long long ll;

ll qp(ll a, ll b) { ll ans = 1; do { if (b & 1)ans = 1ll * ans*a; a = 1ll * a*a; } while (b >>= 1); return ans; }
ll qp(ll a, ll b, ll mo) { ll ans = 1; do { if (b & 1)ans = 1ll * ans*a%mo; a = 1ll * a*a%mo; } while (b >>= 1); return ans; }
//素因数分解 O(√n)
map<ll,ll>prime_factor(ll n){
    map<ll,ll> res;
    for(ll i = 2;i * i <= n;i++){
        while(n % i == 0){
            ++res[i];
            n /= i;
        }
    }
    if(n != 1) res[n] = 1LL;
    return res;
}
int main(void){
  string a,b;cin >> a >> b;
  string n = a + b;
  int N;
  for(int i = 0;i < n.size();i++){
    N += qp(10,n.size()-1-i) * (n[i] - '0');
  }
  auto m = prime_factor(N);
  for(auto i : m){
    if(i.second %2 != 0){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}


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

int powcalc(int a){
    if (1 <= a && 10 >=a){
        int i = a + pow(a,2) + pow(a,3);
        return i;
    }
    else {
        return 1;
    }
}

int main(void){
    int a;
    scanf("%d",&a);
    printf("%d\n", powcalc(a));
    return 0;
}

Measured memory_bytes: 2532
S_str = input()
S = int(S_str, 2)
S_len = len(S_str)

if S_len % 2 :
	E = '1' + '01'*(S_len//2)
else :
	E = '10'*(S_len//2)

E = int(E, 2)
num = format(S ^ E, 'b').count('1')
ans = min(num, S_len - num)
print(ans)

Measured memory_bytes: 3316
#coding:utf-8
#1_11_B 2015.4.20
class Dice:
    def __init__(self,ary):
        self.top = ary[0]
        self.south = ary[1]
        self.east = ary[2]
        self.west = ary[3]
        self.north = ary[4]
        self.bottom = ary[5]

    def roll_n(self):
        self.top , self.south , self.bottom , self.north = self.south , self.bottom , self.north , self.top

    def roll_e(self):
        self.top , self.west , self.bottom , self.east = self.west , self.bottom , self.east , self.top

    def twist(self):
        self.north , self.west , self.south , self.east = self.east , self.north , self.west , self.south

dice = Dice(input().split())
for i in range(int(input())):
    top,south = input().split()
    while dice.top != top or dice.south != south:
        dice.roll_n()
        if dice.top == top:
            while dice.south != south:
                dice.twist()
        elif dice.south == south:
            while dice.top != top:
                dice.roll_e()
    print(dice.east)

Measured memory_bytes: 6740
#include<iostream>
int main(){
	int n, k, x = 1, smallx = 0;
	std::cin >> n >> k;

	for (int lp1 = 0; lp1 < n; lp1++) {
		x += k;
	}
	smallx = x;
	x = 1;
	for (int lps = 1; lps < n + 1; lps++) {
		for (int lp = 0; lp < lps; lp++) {
			x *= 2;
		}
		for (int lp1 = 0; lp1 < n - lps; lp1++) {
			x += k;
		}
		if (smallx > x) {
			smallx = x;
		}
		x = 1;
	}
	std::cout << smallx << std::endl;
	return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#include<bits/stdc++.h>
using namespace std;
string s, t;
int const MAXN=3100;
bool done[MAXN][MAXN];
int memo[MAXN][MAXN], back[MAXN][MAXN];
int dp(int i, int j){
	if(i==s.length() || j==t.length()){
		back[i][j]=-1;
		return memo[i][j]=0;	
	}
	if(done[i][j]) return memo[i][j];
	done[i][j]=true;
	int s1=dp(i+1,j), s2=dp(i,j+1);
	if(s1>s2){
		memo[i][j]=s1;
		back[i][j]=1;
	}
	else{
		memo[i][j]=s2;
		back[i][j]=2;
	}
	if(s[i]==t[j]){
		int s3=1+dp(i+1,j+1);
		if(s3>memo[i][j]){
			memo[i][j]=s3;
			back[i][j]=3;
		}
	} 
	return memo[i][j];
}
int main(){
	cin>>s>>t;
	dp(0,0);
	string res="";
	int op=back[0][0];
	int i=0, j=0;
	while(op!=-1){
		if(op==3){
			res+=s[i];
			i++;
			j++;
		}
		if(op==2) j++;
		if(op==1) i++;
		op=back[i][j];
	}
	cout<<res;
}

Measured memory_bytes: 84864
#include <iostream>
#include <vector>
using namespace std;
const int nil = -10;

typedef vector<vector<pair<int, int>>> graph;
graph G;
vector<int> color;
vector<bool> seen;

void dfs (int now) {
    seen[now] = true;
    for (auto i: G[now]) {
        if (seen[i.first]) continue;
        else {
            if (i.second) {
                color[i.first] = 1 - color[now];
            } else {
                color[i.first] = color[now];
            }
            dfs(i.first);
        }
    }
}

int main() {
    int n;
    cin >> n;
    G.resize(n);
    color.resize(n);
    seen.resize(n, false);
    for (int i=0; i<n-1; ++i) {
        int u, v, w;
        cin >> u >> v >> w;
        u--; v--;
        G[u].push_back(make_pair(v, w%2));
        G[v].push_back(make_pair(u, w%2));
    }
    color[0] = 0;
    dfs(0);
    for (int i=0; i<n; ++i) {
        cout << color[i] << endl;
    }
}

Measured memory_bytes: 8192
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int K = sc.nextInt();
		sc.close();
		int a = K/2;
		int b = 0;
		if(K%2==0) {
			b = K/2;
		}else{
			b = K/2 + 1;
		}
		System.out.println(a*b);
	}

}

Measured memory_bytes: 35676
#from numpy import*
#from scipy import*
from collections import* #defaultdict Counter deque appendleft
from fractions import gcd
from functools import* #reduce
from itertools import* #permutations("AB",repeat=2) combinations("AB",2) product("AB",2) groupby
from operator import mul
from bisect import* #bisect_left bisect_right
from heapq import* #heapify heappop heappushpop
from math import factorial,pi
from copy import deepcopy
import sys
#input=sys.stdin.readline  #危険！基本オフにしろ！
sys.setrecursionlimit(10**6)


def main():
    print(input().swapcase())
if __name__ == '__main__':
    main()


Measured memory_bytes: 6864
#include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <cassert>
#include <numeric>
#include <functional>
#include <cassert>
//#include <numeric>
#pragma warning(disable:4996) 
 
typedef long long ll;
typedef unsigned long long ull;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF  9223300000000000000
#define LINF2 1223300000000000000
#define INF 2140000000
const long long MOD = 1000000007;
//const long long MOD = 998244353;

using namespace std;
 
vector<int> a;
vector<vector<int> > g;  // to
vector<vector<int> > vsave;
vector<int>   v;
vector<int>   ans;

void dfs(int par, int curr)
{
    int posi = 0;
    if (v.empty()) {
        v.push_back(a[curr]);
        posi = 0;
    }
    else {
        int k = lower_bound(v.begin(), v.end(), a[curr]) - v.begin();
        if (k == (int)v.size()) {
            v.push_back(a[curr]);
            posi = k;
        }
        else {
            vsave[k].push_back(v[k]);
            v[k] = a[curr];
            posi = k;
        }
    }
    ans[curr] = (int)v.size();

    int i;
    for (i = 0; i < (int)g[curr].size(); i++) {
        int next = g[curr][i];
        if (par == next) continue;

        dfs(curr, next);
    }

    if (!vsave[posi].empty()) {
        v[posi] = vsave[posi].back();
        vsave[posi].pop_back();
    }
    else {
        assert(posi == (int)v.size() - 1);
        v.pop_back();
    }

    return;
}

void solve()
{
    int n;
    scanf("%d", &n);
    a.resize(n);
    int i;
    for (i = 0; i < n; i++) {
        scanf("%d", &a[i]);
    }

    g.resize(n);
    vsave.resize(n);
    ans.resize(n);
    for(i=0; i<n-1; i++) {
        int p, q;
        scanf("%d%d", &p, &q); p--; q--;
        g[p].push_back(q);
        g[q].push_back(p);
    }
    
    dfs(-1, 0);

    for (i = 0; i < n; i++) {
        printf("%d\n", ans[i]);
    }

    return;
}

int main(int argc, char* argv[])
{
#if 1
    solve();
#else
    int T;
    scanf("%d", &T);
    int t;
    for(t=0; t<T; t++) {
        //printf("Case #%d: ", t+1);
        solve();
    }
#endif
    return 0;
}



Measured memory_bytes: 35500
#!/usr/bin/perl

use strict;
use warnings;

my $s = <STDIN>;
chomp $s;
my %weekday = ( SUN=>7,
                MON=>6,
                TUE=>5,
                WED=>4,
                THU=>3,
                FRI=>2,
                SAT=>1);
print $weekday{$s};

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

using namespace std;

long long inf=1000000007;

long long modpow(long long n,long long p,long long mod);

int main(){
	long long n;
	cin>>n;
	set<long long> s;
	map<long long,long long> m;

	for(long long i=0;i<n;i++){
		long long hoge;
		cin>>hoge;
		m[hoge]++;
		s.insert(hoge);
	}

	string ans="No";

	if(s.size()==1 && m.count(0)){
		ans="Yes";
	}else if(n%3==0){
		if(s.size()==2 && m[0]*2==m[*next(s.begin())]) ans="Yes";
		if(s.size()==3){
			long long x=*s.begin();
			x^=*next(s.begin());
			x^=*next(s.begin(),2);
			if(x==0 && m[*s.begin()]==m[*next(s.begin())] && m[*next(s.begin())]==m[*next(s.begin(),2)]) ans="Yes";
		}
	}

	cout<<ans<<endl;

	return 0;
}

long long modpow(long long n,long long p,long long mod){
	if(p==0) return 1;
	if(p%2==0) return (modpow(n,p/2,mod)*modpow(n,p/2,mod))%mod;
	if(p%2==1) return (modpow(n,p-1,mod)*n)%mod;
	cerr<<"ERROR"<<endl;
	return 1;
}


Measured memory_bytes: 12052
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
#include <iomanip>
using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define PB_VEC(Itr1,Itr2) (Itr1).insert((Itr1).end(),(Itr2).begin(),(Itr2).end())
#define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end())
#define BOUND(Itr,val) lower_bound((Itr).begin(),(Itr).end(),(val))
typedef long long ll;


int main(){
    
    double i;
    vector<double> a;
    while(cin>>i){
        a.push_back(i);
    }
    
    sort(a.begin(),a.end());
    
    cout<<fixed<<setprecision(10)<<a[a.size()-1]-a[0]<<endl;
    
    return 0;
}

Measured memory_bytes: 3212
N, M = map(int, input().split())
ans = 0
if N == 1 and M == 1:
    ans = 1
elif N == 2 or M == 2:
    ans = 0
elif N == 1 or M == 1:
    ans = max(N, M) - 2
else:
    ans = (N - 2) * (M - 2)
print(ans)


Measured memory_bytes: 2940
#include <iostream>
#include <stdlib.h>
#include <string>
#include <math.h>
#include<algorithm>

using namespace std;

int main(void)
{
    string s,t;
    int ns,nt;
    cin >> s;
    cin >> t;
    ns = s.length();
    nt = t.length();
    if (ns < nt)
    {
        cout << "UNRESTORABLE";
        return 0;
    }
    int i;
    for (i = ns-nt ; i >= 0; i--)
    {
        string test1;
        test1.assign(s,i,i+nt);
        int j;
        int flag = 0;
        for (j = 0;j < nt;j++)
        {
            if (test1[j] != t[j])
            {
                if (test1[j] != '?')
                 flag = 1;
            }
        }
        if (flag == 0)
        {
            int k;
            for (k = 0; k < i;k++)
             if (s[k] == '?')
              cout << 'a';
             else
              cout << s[k];
            for (k = 0; k < nt;k++)
             cout << t[k];
            if (ns > nt)
             for (k = i+nt ;k < ns; k++)
              {
              if (s[k] == '?')
               cout << 'a';
              else 
               cout << s[k];
              }
            return 0;
        }
    }
    cout << "UNRESTORABLE";
    return 0;
}

Measured memory_bytes: 256
import           Control.Exception (assert)

main :: IO ()
main = do
  n <- readLn
  s <- getLine
  assert (length s == n) $
    putStrLn $ fromBool $ solve s

fromBool :: Bool -> String
fromBool False = "No"
fromBool True  = "Yes"

solve :: String -> Bool
solve s = length (filter (== 'R') s) > length (filter (== 'B') s)


Measured memory_bytes: 508
n=int(input())
v=list(int(x) for x in input().split())
c=list(int(y) for y in input().split())
e=[]
for i in range(n):
	if (v[i]-c[i])>0:
		e.append(v[i]-c[i])
ans=sum(e)
print(ans)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
 
#define TRACE
 
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif
 
#define ll long long  
#define ld long double
#define all(v) v.begin(),v.end()
#define pb push_back
#define S second
#define F first
#define die() return 0;
 
 
#define md          1000000007
#define fmd         998244353 
#define M           2000011
#define N            18
ll exp(ll a,ll b){if(b<0)return 0;ll r=1;while(b){if(b&1)r=r*a%md,r%=md;a=a*a%md;b/=2;}return r;}
ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}
ll F[M],IV[M];

ll chose(ll n,ll k){
	if(k>n)return 0;
	ll r=F[n];r=r*IV[k];r%=md;r=r*IV[n-k]%md;return r%md;
}
int solve(){
    ll n,i,j,k,m,x,y,z;
    string s;
    cin>>k>>s;
    n=s.size();

    ll ans=exp(26,k+n);
    ans%=md;
    ll p=0;
    for(i=0;i<n;++i){
    	ll left=chose(n+k,i);
    	left=left*exp(25,k+n-i)%md;
    	p=p+left%md;p%=md;
    }
    ans=(ans-p+md)%md;
    cout<<ans<<"\n";


    
 
 
 
 
 
    // trace(f(2,2));
 
 
 
	die();
 
}
void prec(){
	F[0]=IV[0]=1;
	for(int i=1;i<M;++i){
		F[i]=F[i-1]*i%md,F[i]%=md;
		IV[i]=IV[i-1]*exp(i,md-2)%md,IV[i]%=md;
	}
} 
 
int main(){
 
 
#ifndef ONLINE_JUDGE
    double _tBeg=clock();
#endif
 
     
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
 
    int t;
    t=1;;
    prec();
    // cin>>t;
 
    while(t--){
 
        solve();
    }
 
 
 
 
 
 
#ifndef ONLINE_JUDGE
    double _tEnd=clock();
    // printf("\ntotal time %.6f\n",(_tEnd-_tBeg)/CLOCKS_PER_SEC);
#endif
 
    die();
}

Measured memory_bytes: 35488
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) {
		FastScanner scan = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		int a = scan.nextInt(), b = scan.nextInt(), c = scan.nextInt(), x = scan.nextInt();
		int res = 0;
		for(int i = 0; i <= a; i++) {
			for(int j = 0; j <= b; j++) {
				for(int k = 0; k <= c; k++) {
					if(500*i+100*j+50*k == x) res++;
				}
			}
		}
		out.println(res);
		out.close();
	}
	
	static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner() {
			try	{
				br = new BufferedReader(new InputStreamReader(System.in));
				st = new StringTokenizer(br.readLine());
			} catch (Exception e){e.printStackTrace();}
		}

		public String next() {
			if (st.hasMoreTokens())	return st.nextToken();
			try {st = new StringTokenizer(br.readLine());}
			catch (Exception e) {e.printStackTrace();}
			return st.nextToken();
		}

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

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

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

		public String nextLine() {
			String line = "";
			if(st.hasMoreTokens()) line = st.nextToken();
			else try {return br.readLine();}catch(IOException e){e.printStackTrace();}
			while(st.hasMoreTokens()) line += " "+st.nextToken();
			return line;
		}

		public int[] nextIntArray(int n) {
			int[] a = new int[n];
			for(int i = 0; i < n; i++) a[i] = nextInt();
			return a;
		}

		public long[] nextLongArray(int n){
			long[] a = new long[n];
			for(int i = 0; i < n; i++) a[i] = nextLong();
			return a;
		}

		public double[] nextDoubleArray(int n){
			double[] a = new double[n];
			for(int i = 0; i < n; i++) a[i] = nextDouble();
			return a;
		}

		public char[][] nextGrid(int n, int m){
			char[][] grid = new char[n][m];
			for(int i = 0; i < n; i++) grid[i] = next().toCharArray();
			return grid;
		}
	}

}

Measured memory_bytes: 21332
while True:
    n=int(input())
    if n==0:
        break
    a=list(map(int,input().split()))
    sum=0
    for i in range(n):
        sum+=a[i]
    ave=sum/n
    count=0
    for i in range(n):
        if a[i]<=ave:
            count+=1
    print(count)
            


Measured memory_bytes: 6608
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)*}
    };
}

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

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, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (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_imports)]
use std::cmp::{min, max};

fn main() {
    input!{
        x: usize
    }
    if x == 2 {
        println!("2");
        return;
    }
    let mut n = x;
    if n % 2 == 0 {
        n += 1;
    }
    loop {
        let mut f = true;
        let mut m = 3;
        while m * m <= n {
            if n % m == 0 {
                f = false;
                break;
            }
            m += 2;
        }
        if f {
            println!("{}", n);
            return;
        }
        n += 2;
    }
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(long long i=0; i<(n); i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
using ll=long long;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define MOD  1000000007
const ll INF=1e18;
template<class T>void show(vector<T>v){for (int i = 0; i < v.size(); i++){cerr<<v[i]<<" ";}cerr<<endl;}
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b){ a = b; return 1; } return 0; }

const int MAX = 10000;

long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
   fac[0] = fac[1] = 1;
   finv[0] = finv[1] = 1;
   inv[1] = 1;
   for (int i = 2; i < MAX; i++){
       fac[i] = fac[i - 1] * i % MOD;
       inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
       finv[i] = finv[i - 1] * inv[i] % MOD;
   }
}

// 二項係数計算
long long COM(int n, int k){
   if (n < k) return 0;
   if (n < 0 || k < 0) return 0;
   return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main(int argc, char const *argv[]) {
  int n, k;
  cin >> n >> k;
  COMinit();
  ll ans = 0;
  for (ll i = 1; i <= k; i++) {
    cout << (COM(n-k+1,i)%MOD)*(COM(k-1,i-1)%MOD)%MOD << endl;
  }
  return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; --i)
#define whole(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
using P = pair<int, int>;
#define debug(var) cerr << "[" << #var << "] " << var << endl
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
const ll mod = 1000000007;
const int dx[] = {-1,0,1,0};
const int dy[] = {0,-1,0,1};


int main(){
    ll x, y;
    cin >> x >> y;
    string ans = "Alice";
    if (abs(x-y)<=1) ans = "Brown";
    
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3636
#include<stdio.h>

int main(){
	int x,y,z;
	int count=0;
	int i ;
	
		scanf("%d%d%d",&x,&y,&z);
	
		for(i = x; i<= y; i++){
			if(z%i == 0 )count++;
		}
		
		printf("%d\n",count);
		
		
		
	
	return 0;
}

Measured memory_bytes: 596
#include <iostream>
using namespace std;
int main()
{
	int n,m,i,j,p[100],q[100],x,c;
	bool f = false;
	while (cin >> n >> m && n && m)
	{
		x = n;
		for (i = 0; i < m; i++)
			p[i] = q[i] = 0;
		for (i = 0; i < n; i++)
		{
			for (j = 0; j < m; j++)
			{
				cin >> p[j];
				if (p[j]) q[j]++;
			}
		}
		for (c = 0; c <= m && x >= 0;)
		{
			for (j = 0; j < m; j++)
			{
				if (q[j] == x)
				{
					q[j] = -1;
					cout << j+1;
					f = true;
					break;
				}
			}
			if (!f)
			{
				x--;
			}
			else
			{
				c++;
				if (c >= m) cout << endl;
				else cout << " ";
				f = false;
			}
		}
	}
}

Measured memory_bytes: 868
#import <stdio.h>
int main(){
    int N;
    scanf("%d",&N);
    int a=0,b=0,c=0;
    for(int i=0;i<N;i++){
        int k;
        scanf("%d",&k);
        switch(k%4) {
            case 0:
                c++;
                break;
            case 2:
                b++;
                break;
            default:
                a++;
                break;
        }
    }
    if ((b==0 && a<=c+1)||(a<=c)) {
        printf("Yes");
        return 0;
    }
    printf("No");
}


Measured memory_bytes: 7116
#pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
inline void rd(long long &x){
  int k;
  int m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
inline void wt_L(char a){
  putchar_unlocked(a);
}
inline void wt_L(long long x){
  int s=0;
  int m=0;
  char f[20];
  if(x<0){
    m=1;
    x=-x;
  }
  while(x){
    f[s++]=x%10;
    x/=10;
  }
  if(!s){
    f[s++]=0;
  }
  if(m){
    putchar_unlocked('-');
  }
  while(s--){
    putchar_unlocked(f[s]+'0');
  }
}
template<class T> inline T GCD_L(T a,T b){
  T r;
  while(a){
    r=b;
    b=a;
    a=r%a;
  }
  return b;
}
template<class T> inline T LCM_L(T a,T b){
  return a/GCD_L(a,b)*b;
}
int main(){
  long long A;
  long long B;
  long long res;
  rd(A);
  rd(B);
  res =LCM_L(A, B);
  wt_L(res);
  wt_L('\n');
  return 0;
}
// cLay varsion 20191214-1

// --- original code ---
// {
//   ll A, B, res;
//   rd(A,B);
//   res = lcm(A,B);
//   wt(res);
// }

Measured memory_bytes: 256
import collections
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

N = int(input())
if N == 1:
  print(0)
else:
  c = collections.Counter(prime_factorize(N))
  ans = 0
  for num in c.values():
    tmp = 0
    for i in range(1,num+1):
      if tmp + i <= num:
        tmp +=i
        ans += 1
      else:
        break
  print (ans)


Measured memory_bytes: 9468
#include<bits/stdc++.h>
#include <queue>
#include <stack>
using namespace std; 
typedef pair<long long int,long long int> pa;
#define resize(A) A.resize(unique(A.begin(), A.end()) - A.begin())
#define pb push_back
#define  MAX 200000
long long int MOD=998244353;
long long int INF=1e18;
/*    :-]  */
 
int main()
{
         ios_base::sync_with_stdio(false); 
         cin.tie(NULL);
         cout.tie(NULL);
         long long int i,j,k=0,l=0,r=0,m=0,n,c,p=0,cnt=0,cnt1=0,x,y,z=0,a,b,low,mid,high,ans=0,maxi=0,mini=INF,t,x1,y1;
         string s,s1;
    cin>>s;
    cin>>s1;
    for(i=0;i<s.size();i++)
    {
        if(s[i]==s1[i])
            cnt++;
    }
 cout<<cnt<<endl;
    
    
}

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


int main() {
    int n,m;
    cin>>n>>m;
    char arr[n+1][m+1];
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++)cin>>arr[i][j];
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            cout<<arr[i][j];
        }
        cout<<endl;
        for(int j=0;j<m;j++)cout<<arr[i][j];
        cout<<endl;
    }



    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> P;
int INF = 1e9+7;
int mod = 100000;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
signed main() {
    int N,M;
    cin >> N >> M;
    vector<P>ab(M);
    for(int i = 0; i < M; i++) {
        cin >> ab[i].first >> ab[i].second;
    }
    sort(ab.begin(),ab.end());
    priority_queue<int,vector<int>,greater<int>> que;
    int ans = 0,now = 0;
    for(int i = 1; i <= N; i++) {
        while(ab[now].first == i) {
            que.push(ab[now].second-1);
            now++;
            if(now == M) {
                goto home;
            }
        }
        if(!que.empty()) {
            int x = que.top();
            if(x == i) {
                ans++;
                while(!que.empty()) {
                    que.pop();
                }
            }
        }
    }
home:;
    if(!que.empty()) {
        ans++;
    }
    cout << ans << endl;
}


Measured memory_bytes: 5384
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef long double ld;
const int inf=1e9+7;
const ll longinf=1LL<<60;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define F first
#define S second

const int mx=1000010;
const ll mod=1e9+7;

int main(){
  ld a,b,h,m;
  cin >> a >> b >> h >> m;
  ld ra = 30.0*h + m/2.0;
  ld rb = 6.0*m;
  ld rd = abs(ra-rb)*M_PI/180.0;
  ld ans = sqrtl(a*a+b*b-2*a*b*cos(rd));
  cout << fixed << setprecision(12) << ans << endl;
  return 0;
}

Measured memory_bytes: 4168
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
#ifdef DEBUG
#define display(x) cerr << #x << " = " << (x) << endl;
#define displaya(a, st, n)\
	{cerr << #a << " = {";\
	for(int qwq = (st); qwq <= (n); ++qwq) {\
		if(qwq == (st)) cerr << ((a)[qwq]);\
		else cerr << ", " << ((a)[qwq]);\
	} cerr << "}" << endl;}
#define displayv(v) displaya(v, 0, (int)(v).size() - 1)
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define display(x) ;
#define displaya(a, st, n) ;
#define displayv(v) ;
#define eprintf(...) if(0) fprintf(stderr, "...")
#endif
template<typename T> bool chmin(T &a, const T &b) { return a > b ? a = b, true : false; }
template<typename T> bool chmax(T &a, const T &b) { return a < b ? a = b, true : false; }
template<typename A, typename B>
ostream& operator << (ostream& out, const pair<A, B> &p) {
	return out << '(' << p.first << ", " << p.second << ')';
}
const int maxN = 200 + 5;
int n;
LL a[maxN];
char s[maxN];

LL b[61];
void clear() {
	memset(b, 0, sizeof(b));
}
bool contains(LL x) {
	for(int i = 60; i >= 0; --i) if(x >> i & 1) {
		if(b[i] == 0) return false;
		else x ^= b[i];
	}
	assert(x == 0);
	return true;
}
void insert(LL x) {
	for(int i = 60; i >= 0; --i) if(x >> i & 1) {
		if(b[i] == 0) {
			b[i] = x; return;
		} else {
			x ^= b[i];
		}
	}
}

int solve() {
	cin >> n;
	for(int i = 1; i <= n; ++i) cin >> a[i];
	cin >> (s + 1);
	
	clear();
	for(int i = n; i >= 1; --i) {
		if(s[i] == '0') insert(a[i]);
		else {
			if(!contains(a[i]))
				return 1;
		}
	}
	return 0;
}

int main() {
#ifndef LOCAL
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
#endif
	int T; cin >> T;
	while(T--) cout << solve() << '\n';
	return 0;
}


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


int main() {
	string s, t;
	cin >> s >> t;
	int ans = 0;
	for (int i = 0; i < s.length(); i++) {
		if (s[i] != t[i]) {
			ans++;
		}
	}

	cout << ans << endl;
}

Measured memory_bytes: 3888
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define INF 1<<30
#define LINF 1LL<<60

typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-9, pi = acos(-1.0);
namespace std {
    bool operator<(const Point &lhs, const Point &rhs) {
        if (lhs.real() < rhs.real() - eps) return true;
        if (lhs.real() > rhs.real() + eps) return false;
        return lhs.imag() < rhs.imag();
    }
}
Point input_point() {ld x, y; cin >> x >> y; return Point(x, y);} // ????????\???
bool eq(ld a, ld b) {return (abs(a - b) < eps);} // ????????????????????????
ld dot(Point a, Point b) {return real(conj(a) * b);} // ??????
ld cross(Point a, Point b) {return imag(conj(a) * b);} // ??????

// ??´????????????
class Line {
public:
    Point a, b;
    Line() : a(Point(0, 0)), b(Point(0, 0)) {}
    Line(Point a, Point b) : a(a), b(b) {}
    Point operator[](const int _num) {
        if (_num == 0)return a;
        else if (_num == 1)return b;
        else assert(false);
    }
};

// ????????????
class Circle {
public:
    Point p;
    ld r;
    Circle() : p(Point(0, 0)), r(0) {}
    Circle(Point p, ld r) : p(p), r(r) {}
};


typedef vector<Point> Polygon;
/* ????????\?????? : ????????±?????? */
bool compY (const Point& a,const Point& b){return a.imag() != b.imag() ? a.imag() < b.imag() : a.real() < b.real();}
ld ClosestPair(int l, int r,const Polygon& poly){
    if(r-l<2)return 1e16;
    int m = (l+r)/2;
    ld res = min(ClosestPair(l, m, poly),ClosestPair(m, r, poly));
    Polygon v;
    for(int i = l; i < r;i++){
        if(abs(poly[i].real() - poly[m].real()) < res)v.push_back(poly[i]);
    }
    
    sort(v.begin(),v.end(),compY);
    
    for(int i = 0; i < (int)v.size();i++){
        for(int j = max(0,i - 10);j < i;j++){
            res = min(res,abs(v[i]-v[j]));
        }
    }
    return res;
}

int main(void) {
    cin.tie(0); ios::sync_with_stdio(false);
    int n ;cin >> n;
    Polygon ps;
    for(int i = 0;i < n;i++) ps.emplace_back(input_point());
    sort(ps.begin(),ps.end());
    cout << fixed << setprecision(20) << ClosestPair(0, n, ps) << endl;
    return 0;
}

Measured memory_bytes: 11732
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		sc.close();
		int k = 0;
		for(int i = 0; i < S.length(); i++) {
			if(S.charAt(i) == '0') {
				k++;
			}else {
				k--;
			}
		}
		System.out.println(S.length() - Math.abs(k));
	}
}

Measured memory_bytes: 26148
#include<iostream>
#include<cmath>
#include<string>
#include<algorithm>
#include <iomanip> 
#include<sstream>
#include <map>
using namespace std;
int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    int n,m;
    while (cin >> m>>n)
    {
        int a;
        while (n--)
        {
            cin >> a;
            m = m - a;
        }
        if (m > 0) cout << "No" << '\n';
        else cout << "Yes" << '\n';
    }
}


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

#define MAX_N 100000
#define LOG_MAX_N 17

using namespace std;

struct Edge
{
    int to, color, cost;
};

struct Query
{
    int x, y, u, v;
};

int N, Q;
vector<Edge> G[MAX_N];
vector<Query> queries;

int __par[MAX_N][LOG_MAX_N + 1];
int __depth[MAX_N];

void __dfs( int u, int p, int dep )
{
    __par[u][0] = p;
    __depth[u] = dep;

    for ( auto e : G[u] )
    {
        if ( e.to == p ) continue;
        __dfs( e.to, u, dep + 1 );
    }
}

int par( int w, int i )
{
    for ( int n = 0; i && n <= LOG_MAX_N; n++ )
    {
        if ( i & 1 ) w = __par[w][n];
        i >>= 1;
    }
    return w;
}

int lca( int a, int b )
{
    if ( __depth[a] < __depth[b] )
        b = par( b, __depth[b] - __depth[a] );
    else
        a = par( a, __depth[a] - __depth[b] );

    if ( a == b ) return a;

    for ( int i = LOG_MAX_N; i >= 0; i-- )
    {
        int pa = par( a, 1 << i );
        int pb = par( b, 1 << i );

        if ( pa == pb ) continue;

        a = pa;
        b = pb;
    }

    return par( a, 1 );
}

int __dist[MAX_N];
int __cnum_work[MAX_N];
int __csum_work[MAX_N];
map<int, int> __cnum[MAX_N];
map<int, int> __csum[MAX_N];
vector<int> need[MAX_N];

void dps( int u, int dist )
{
    __dist[u] = dist;

    for ( auto color : need[u] )
    {
        __cnum[u][color] = __cnum_work[color];
        __csum[u][color] = __csum_work[color];
    }

    for ( auto e : G[u] )
    {
        if ( e.to == par( u, 1 ) ) continue;

        __cnum_work[e.color] += 1;
        __csum_work[e.color] += e.cost;

        dps( e.to, dist + e.cost );

        __cnum_work[e.color] -= 1;
        __csum_work[e.color] -= e.cost;
    }
}

int diff_cost_from_root( int to, int color, int newcost )
{
    return __dist[to] + __cnum[to][color] * newcost - __csum[to][color];
}

void init()
{
    __dfs( 0, 0, 0 );

    for ( int i = 0; i < LOG_MAX_N; i++ )
        for ( int w = 0; w < N; w++ ) __par[w][i + 1] = __par[__par[w][i]][i];

    for ( int i = 0; i < N; i++ ) __cnum_work[i] = __csum_work[i] = 0;
}

int main( int argc, char **argv )
{
    cin >> N >> Q;

    for ( int i = 0; i < N - 1; i++ )
    {
        int a, b, c, d;
        cin >> a >> b >> c >> d;

        G[a - 1].push_back( ( Edge ){b - 1, c, d} );
        G[b - 1].push_back( ( Edge ){a - 1, c, d} );
    }

    init();
    queries.resize( Q );

    for ( auto &q : queries )
    {
        cin >> q.x >> q.y >> q.u >> q.v;
        q.u--, q.v--;

        need[q.u].push_back( q.x );
        need[q.v].push_back( q.x );
        need[lca( q.u, q.v )].push_back( q.x );
    }

    dps( 0, 0 );

    for ( auto q : queries )
    {

        int l = lca( q.u, q.v );

        int dl = diff_cost_from_root( l, q.x, q.y );
        int du = diff_cost_from_root( q.u, q.x, q.y );
        int dv = diff_cost_from_root( q.v, q.x, q.y );

        cout << ( du + dv - 2 * dl ) << endl;
    }

    return 0;
}


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

int main(){
    ll n ;
    cin>>n;
    ll arr[n];
    ll dp[n];
    for(ll i=0;i<n;i++)cin>>arr[i];
    for(ll i=0;i<n;i++)dp[i]=10000000000;
    dp[0]=0;
    for(ll i=0;i<n;i++){
        if(i+1<n){
            dp[i+1]=min(dp[i+1],dp[i]+abs(arr[i]-arr[i+1]));
        }
        if(i+2<n){
            dp[i+2]=min(dp[i+2],dp[i]+abs(arr[i]-arr[i+2]));
        }
    }
    cout<<dp[n-1]<<endl;
}

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

#define rep(i,n) for(int i = 0;i<n;i++)
#define vv(Type, n,m,d)vector<vector<Type>> vv(n, vector<Type>(m, d));

using namespace std;
using ll = long long;

const ll mod = 1e9 + 7;




int main(void) {

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

	int n; cin >> n;
	map<int, int> a;
	bool ok = true;
	rep(i, n) {
		int j; cin >> j;
		a[j] += 1;
		if (ok == true)
			if (a[j] == 2) ok = false;
	}

	if (ok) cout << "YES" << endl;
	else cout << "NO" << endl;

	return 0;
}


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

#define ll long long

using namespace std;
const int MX = 200'000 + 5; // check bounds!

int main() {
    ll n;
    cin >> n;
    ll x = 100;
    for (int i = 1; ; ++i) {
        x += x/100;
        if (x >= n) {
            cout << i;
            break;
        }
    }

    return 0;
}


Measured memory_bytes: 3636
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        sc.close();
        int count = 0, max = 0;
        for (int i = 0; i < 3; i++) {
            if (s.charAt(i) == 'R') {
                count++;
                if (max < count) {
                    max = count;
                }
            } else {
                if (max < count) {
                    max = count;
                }
                count = 0;
            }
        }
        System.out.println(max);
    }
}


Measured memory_bytes: 35804
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<long long,long long>
#define ii pair<int,int>
#define mod 1000000007
#define endl '\n'
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);

ll power(ll a,ll b){
	ll ans=1;
	while(b>0){
		if(b%2!=0){
			ans=(ans*a)%mod;
		}
		a=((a%mod)*(a%mod))%mod;
		b>>=1;
	}
	return ans;
}

void sieve(int n){
	bool prime[n+1];
	memset(prime,true,sizeof(prime));
	for(int p=2;p*p<=n;p++){
		if(prime[p]){
			for(int i=p*p;i<=n;i+=p)
				prime[i]=false;
		}
	}
	for(int p=2;p<=n;p++){
		if(prime[p])
			cout<<p<<" ";
	}
}

int main() {
	IOS;
	int t=1;
	//cin>>t;
	while(t--){
		int h,w,m;
		cin>>h>>w>>m;
		int a[h+1],b[w+1];
		fill(a,a+h+1,0);
		fill(b,b+w+1,0);
		set<pair<int,int>> v;
		for(int i=0;i<m;i++){
			int p,q;
			cin>>p>>q;
			v.insert({p,q});
			a[p]++;
			b[q]++;
		}
		int ma1=0,ma2=0;
		for(int i=1;i<=h;i++){
			ma1=max(ma1,a[i]);
		}
		for(int i=1;i<=w;i++){
			ma2=max(ma2,b[i]);
		}
		vector<int> v1,v2;
		for(int i=1;i<=h;i++){
			if(a[i]==ma1)
				v1.push_back(i);
		}
		for(int i=1;i<=w;i++){
			if(b[i]==ma2)
				v2.push_back(i);
		}
		bool flag=false;
		for(auto i:v1){
			for(auto j:v2){
				if(v.count({i,j}))
					continue;
				flag=true;
				break;
			}
			if(flag)
				break;
		}
		if(flag)
			cout<<ma1+ma2;
		else
			cout<<ma1+ma2-1;
	}
	return 0;
}

Measured memory_bytes: 23760
#include <iostream>
#include <fstream>
#include <cmath>  
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <numeric>
#include <functional>
#include <string> 
#include <vector>
#include <bitset>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>

using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;

#define REP(i,n) for(int i = 0; i < int(n); i++)
#define REREP(i,n) for(int i = int(n - 1); i >= 0; i--)
#define FOR(i, m, n) for(int i = int(m);i < int(n);i++)
#define REFOR(i, m, n) for(int i = int(n - 1);i >= int(m);i--)
#define ALL(obj) (obj).begin(),(obj).end()

#define VI vector<int>
#define VVI vector<vector<int>>
#define VVVI vector<vector<vector<int>>>
#define VD vector<double>
#define VVD vector<vector<double>>
#define VVVD vector<vector<vector<double>>>
#define VL vector<ll>
#define VVL vector<vector<ll>>
#define VVVL vector<vector<vector<ll>>>
#define VB vector<bool>
#define VVB vector<vector<bool>>
#define VVVB vector<vector<vector<bool>>>
#define VS vector<string>
#define VVS vector<vector<string>>
#define VVVS vector<vector<vector<string>>>

#define PII pair<int,int>
#define PDD pair<double,double>
#define PLL pair<ll,ll>
#define VPII vector<pair<int,int>>
#define VVPII vector<vector<pair<int,int>>>
#define VVVPII vector<vector<vector<pair<int,int>>>>
#define VPLL vector<pair<ll,ll>>
#define VVPLL vector<vector<pair<ll,ll>>>
#define VVVPLL vector<vector<vector<pair<ll,ll>>>>

const ll MOD = (ll)1e9 + 7; // 998244353
const ll HINF = (ll)1e18;
const ll LINF = (ll)1e9;
const long double PI = 3.1415926535897932384626433;


void YN(bool flag) {
	cout << ((flag) ? "YES" : "NO") << endl;
}

void Yn(bool flag) {
	cout << ((flag) ? "Yes" : "No") << endl;
}

void yn(bool flag) {
	cout << ((flag) ? "yes" : "no") << endl;
}

int main() {
	string s; cin >> s;
	int ans = 0;
	if (s[0] != 'C')ans++;
	if (s[1] != 'O')ans++;
	if (s[2] != 'D')ans++;
	if (s[3] != 'E')ans++;
	if (s[4] != 'F')ans++;
	if (s[5] != 'E')ans++;
	if (s[6] != 'S')ans++;
	if (s[7] != 'T')ans++;
	if (s[8] != 'I')ans++;
	if (s[9] != 'V')ans++;
	if (s[10] != 'A')ans++;
	if (s[11] != 'L')ans++;
	if (s[12] != '2')ans++;
	if (s[13] != '0')ans++;
	if (s[14] != '1')ans++;
	if (s[15] != '6')ans++;
	cout << ans << endl;


	return 0;
}


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

using namespace std;

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

  long long ans = 0;
  for (int i = 1; i <= N; ++i)
  {
    if (i % 3 != 0 && i % 5 != 0) ans += i;
  }

  cout << ans << endl;
}

Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
#define Yes(n) cout << ((n) ? "YES" : "NO") << endl
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort(ALL(V))

vector<string> split(string,string);

//template<typename T>
//void swap(T*,T*);
//char ToUpper (char cX) { return toupper(cX); }

int main()
{
    int x,y,z;
    cin >> x >> y >> z;
    int sum;
    sum = 100 * x + 10 * y + z;
    if(sum % 4 == 0)
    {
        Yes(true);
    }else
    {
        Yes(false);
    }
}

Measured memory_bytes: 256
// ######      ###      #######    #######    ##     #     #####        ###     ##### //
// #     #    #   #          #        #       # #    #    #     #      #   #     ###  //
// #     #   #     #        #         #       #  #   #   #       #    #     #    ###  //
// ######   #########      #          #       #   #  #   #           #########    #   //
// #     #  #       #     #           #       #    # #   #    ####   #       #    #   //
// #     #  #       #    #            #       #     ##   #    #  #   #       #        //
// ######   #       #   #######    #######    #      #    #####  #   #       #    #   //

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double lld;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> ppl;
#define ain(a,n) for(ll i=0;i<(n);++i)	cin>>(a)[i];
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define loop(i,n) for(ll i=0;i<(n);++i)
#define FOR(i,a,b) for(ll i=(a);i<=(b);++i)
#define FORD(i,a,b) for(ll i=(a);i>=(b);--i)
#define cases ll T=0;cin>>T;while(T--)
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define END "\n"
#define pb push_back
#define mp make_pair
#define go(c,itr) for(auto itr=(c).begin(); itr!=(c).end(); ++itr)
#define back(c,itr) for(auto itr=(c).rbegin(); itr!=(c).rend(); ++itr)
#define PI 3.14159265359
#define inf 9e18
#define MOD 1000000007
#define MODU 998244353
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define MAXN 200005
const string alpha = "abcdefghijklmnopqrstuvwxyz";
const ll N = 1005;
const long double epsilon = 1e-9;
ll binexp(ll a, ll b, ll m) {
	a %= m;
	ll res = 1;
	while (b > 0) {
		if (b & 1)
			res = res * a % m;
		a = a * a % m;
		b >>= 1;
	}
	return res;
}
ll modinvfermat(ll a, ll m)
{
	return binexp(a, m - 2, m);
}
void task(bool flag)
{
	if (flag)
		cout << "YES\n";
	else
		cout << "NO\n";
}
ll lcm(ll a, ll b)
{
	return ((1LL * a * b) / (__gcd(a, b)));
}

signed main() {

	fast
	ll n;
	cin >> n;
	ll vertex_contribution = 0, edge_contribution = 0;
	FOR(i, 1, n)
	{
		vertex_contribution += i * (n - i + 1);
	}
	loop(i, n - 1)
	{
		ll l, r;
		cin >> l >> r;
		if (l > r)
			swap(l, r);
		edge_contribution += l * (n - r + 1);
	}
	cout << vertex_contribution - edge_contribution << END;




	return 0;
}


Measured memory_bytes: 3680
#include<bits/stdc++.h>
using namespace std;
#define LL long long
const int maxn = 2e5 + 10;
LL ans;
int n, a[maxn];

int main() {
	scanf("%d", &n);
	for (int i = 1; i <= n; ++i)
		scanf("%d", &a[i]);
	for (int i = 2; i <= n; ++i) {
		if (a[i - 1] > a[i]) {
			ans += a[i - 1] - a[i];
			a[i] = a[i - 1];
		}
	}
	cout << ans;
	return 0;
}

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

int main(){
	int N;
  	cin >> N;
	pair<int,int> P[N];
	for(int i=0;i<N;i++) cin >> P[i].first >> P[i].second ;
	//double a[N][N-1]={0};
  //cout << P[N-1].second << endl;
	double sum = 0;

	for(int i=0;i<N-1;i++){
		for(int j=i+1;j<N;j++){
			double x,y;
			x = P[i].first - P[j].first;
			y = P[i].second - P[j].second;
          //cout << x << y << endl;
          //cout << sqrt(x*x + y*y) << endl;
			sum += sqrt(x*x + y*y);			
		}
	}
  //cout << sum << endl;
	sum *= 4;
	sum /= N*2;
	cout << fixed << setprecision(10) << sum << endl;
}

Measured memory_bytes: 256
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
using i64 = int64_t;

__attribute__((constructor)) static void init()
{
    ios::sync_with_stdio(false);
    std::cin.tie(0);
}

int main()
{
    int n, k;
    cin >> n >> k;
    vector<int> snuke(n, 0);
    for (int i = 0; i < k; i++) {
        int d;
        cin >> d;
        for (int j = 0; j < d; j++) {
            int a;
            cin >> a;
            snuke[a - 1]++;
        }
    }

    int sum = count(all(snuke), 0);

    cout << sum << "\n";
}


Measured memory_bytes: 3660
#include <stdio.h>

int main(void){
  int  column[110][110] = {0}, n, k, o, i, j, v;

  scanf("%d", &o);
  for (i = 1; i <= o; i++) {
    scanf("%d", &n);
    scanf("%d", &k);
    for (j = 1; j <= k; j++) {
      scanf("%d", &v);
      column[n][v] = 1;
    }
  }

  for (i = 1; i <= o; i++) {
    for (j = 1; j <= o; j++) {
      printf("%d", column[i][j]);
      if (j < o) {
        printf(" ");
      }
      else {
        printf("\n");
      }
    }
  }

  return 0;
}



Measured memory_bytes: 2148
#include <bits/stdc++.h>
#pragma GCC optimize("O3")

#define fi first
#define se second
#define vi vector<int>
#define vpi vector<pair<int,int>>
#define vll vector<ll>
#define vpll vector<pair<ll,ll>>
#define endl '\n'

#define si(v) int((v).size())
#define all(v) (v).begin(), (v).end()
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i) 
#define rep2(i, n, m) for (ll i = n; i <= (ll)(m); ++i)
#define rep3(i, n, m) for (ll i = n; i >= (ll)(m); --i)

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

using ll = long long;
using ld = long double;
using namespace std;

constexpr ll MOD = 1000000007;

signed main()
{
  cout << fixed << setprecision(20);
  ios::sync_with_stdio(false);
  cin.tie(0);

  int t, x; cin >> t >> x;
  
  cout << (ld)t / x << endl;

  return (0);
}


Measured memory_bytes: 3784
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 ) *} } ;}
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 ) *} } ;}
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" ) } ;}

fn main() {
   input! {
      n: usize,
      k: usize,
      a: [usize; n]
   }

   let mut m = std::collections::BTreeMap::new();
   for a in a {
      let mut flag = false;
      match m.get_mut(&a) {
         Some(v) => *v += 1,
         None => flag = true,
      }
      if flag {
         m.insert(a, 1);
      }
   }
   let mut ap: Vec<_> = m.iter().map(|(_, v)| *v).collect();
   ap.sort();
   let mut ans = 0;
   let mut del = 0;
   while ap.len()-del > k {
      ans += ap[del];
      del += 1;
   }
   println!("{}", ans);
}


Measured memory_bytes: 10492