akhauriyash/Code-Regression huggingface dataset:
#define _GLIBCXX_DEBUG
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <sstream>
#include <stack>
#include <random>
#include <utility>
#include <map>
#include <set>
#include <vector>
#include <queue>
#include <bitset>
#include <sstream>

using namespace std;

#define REP(i, x) for (int i = 0; i < (x); i++)
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define mp make_pair
#define MOD 1'000'000'007
using vi = vector<int>;
using vvi = vector<vi>;
using ll = long long;
ll gcd(ll a, ll b)
{
    return b ? gcd(b, a % b) : a;
}
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

int main(int argc, const char *argv[])
{
    int n, k, c;
    string s;
    cin >> n >> k >> c >> s;
    vi m(k);
    vi ans;

    string::iterator sfi = s.begin();
    for (int l = 0; sfi < s.end() && l < k; sfi++)
    {
        if (*sfi == 'o')
        {
            m[l] = sfi - s.begin();
            sfi += c;
            l++;
        }
    }
    string::iterator sbi = s.end();
    for (int l = k - 1; sbi >= s.begin() && l >= 0; sbi--)
    {
        if (*sbi == 'o')
        {
            if (m[l] == sbi - s.begin())
            {
                ans.push_back(sbi - s.begin());
            }
            sbi -= c;
            l--;
        }
    }
    sort(all(ans));
    for (int i : ans)
    {
        cout << i + 1 << endl;
    }

    return 0;
}


Measured memory_bytes: 3448
/*
　　　  ∧＿∧　やあ
　　 （´・ω・｀)　　　　　/　　　　　ようこそ、バーボンハウスへ。
　　 ／∇y:::::＼　　　 [￣]　　　　　このテキーラはサービスだから、まず飲んで落ち着いて欲しい。
　　 |:⊃:|:::::|　　　|──|
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|　うん、「また」なんだ。済まない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|￣　  仏の顔もって言うしね、謝って許してもらおうとも思っていない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣／|
　　　　∇　∇　∇　∇　　　／.／|　　　でも、この提出を見たとき、君は、きっと言葉では言い表せない
　　　　┴　┴　┴　┴　／ ／　  |　　　「ときめき」みたいなものを感じてくれたと思う。
￣￣￣￣￣￣￣￣￣￣|／　　  |　　　殺伐としたコンテストの中で、そういう気持ちを忘れないで欲しい
￣￣￣￣￣￣￣￣￣￣　　　　 |　　　そう思って、この提出を投げたんだ。
　　　(⊆⊇)　(⊆⊇)　(⊆⊇)　　|
　    ||　　 ||　　||　　|　　　 じゃあ、判定を聞こうか。
　　.／|＼　／|＼ ／|＼
*/

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define fst first
#define snd second
#define ALL(obj) (obj).begin(),(obj).end()
#define debug(x) cerr << #x << " -> " << x << " (line:" << __LINE__ << ")" << '\n';
#define debugpair(x, y) cerr << "(" << #x << ", " << #y << ") -> (" << x << ", " << y << ") (line:" << __LINE__ << ")" << '\n';
typedef long long lint;
typedef priority_queue<int> p_que;
typedef priority_queue<int, vector<int>, greater<int>()> p_que_rev;
const int INF = INT_MAX;
const lint LINF = LLONG_MAX;
const int MOD = 1000000000 + 7;
const double EPS = 1e-9;
const double PI = acos(-1);
const int di[]{0, -1, 0, 1, -1, -1, 1, 1};
const int dj[]{1, 0, -1, 0, 1, -1, -1, 1};

int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    string s;
    cin >> s;
    int ans = 700;
    for (int i=0; i<3; ++i){
        if(s[i] == 'o'){
            ans += 100;
        }
    }
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 760
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <tuple>
#include <cassert>
#include <functional>
#include <set>
#include <deque>
#include <list>
using namespace std;
typedef long long ll;
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
const int INF = 1<<29;
#define LNF __LONG_LONG_MAX__
const ll MOD = 1000000007;
const int MAX = 200000;

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;
}
// 法mでのaの逆元を計算
long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
//最大公約数
long long gcd(long long x, long long y){
    if(y==0) return x;
    else return gcd(y,x%y);
}
//最小公倍数
long long lcm(long long x, long long y){
    return x / gcd(x, y) * y;
}
// nが大きく,kが10^7程度の時の二項係数
long long com[200005];
void combination(long long n,long long k){
    com[0] = 1;
    for(int i=1;i<=k;i++){
        com[i] = (com[i-1]*(n-i+1)%MOD)*modinv(i,MOD)%MOD;
    }
}

int main(){
    int K,X; cin >> K >> X;
    int a=X-K+1;
    if(K==1){
        cout << X << endl;
        return 0;
    }
    for(int i=a;i<X+K;i++){
        cout << i << " ";
    }
    return 0;
}


Measured memory_bytes: 3608
#pragma GCC optimize(3)
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/priority_queue.hpp>
#define MAXN 100005
#define MAXH 405
#define INF 1000000000
#define MOD 1000000007
#define F first
#define S second
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef pair<int,int> P;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
typedef __gnu_pbds::priority_queue<int,greater<int>,pairing_heap_tag> pq;
int n,h,a[MAXN],b[MAXN],c[MAXN],d[MAXN];
int indeg[MAXH],outdeg[MAXH];
bool vis[MAXH];
vector<int> G[MAXH];
void add_edge(int u,int v)
{
    outdeg[u]++;indeg[v]++;
    G[u].push_back(v);G[v].push_back(u);
}
bool dfs(int v)
{
    bool f=indeg[v]!=outdeg[v];
    vis[v]=true;
    for(auto to:G[v]) if(!vis[to]) f|=dfs(to);
    return f;
}
int main()
{
    scanf("%d%d",&n,&h);
    for(int i=1;i<=n;i++) 
    {
        scanf("%d%d%d%d",&a[i],&b[i],&c[i],&d[i]);
        int l,r;
        if(c[i]==0) l=a[i]; else l=-c[i];
        if(d[i]==0) r=-b[i]; else r=d[i];
        add_edge(l+h,r+h);
    }
    bool f=true;
    for(int i=0;i<=h;i++) if(outdeg[i]>indeg[i]) f=false;
    for(int i=h+1;i<=2*h;i++) if(indeg[i]>outdeg[i]) f=false;
    memset(vis,false,sizeof(vis));
    for(int i=0;i<=2*h;i++) if((indeg[i]||outdeg[i])&&!vis[i]) f&=dfs(i);
    if(f) puts("YES"); else puts("NO");
    return 0;
}



Measured memory_bytes: 3328
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <vector>
#include <stack>
#include <climits>
#include <utility>
#include <cmath>

using namespace std;
typedef long long ll;

#define rep(i,n,m) for(int  i=n;i<=m;i++)
#define per(i,n,m) for(int i=n;i>=m;i--)
inline void scan(int&x){scanf("%d", &x);};inline void scan(ll&x){scanf("%lld",&x);};inline void scan(double&x){scanf("%lf",&x);};inline void scan(string&x){const char *str;scanf("%s",str);x = string(str);};inline void scan(char&ch){scanf("%c",&ch);};
inline void print(const int&x){printf("%d ",x);};inline void print(const ll&x) {printf("%lld ",x);};inline void print(const double&x) {printf("%lf ",x);};inline void print(const string&x){ const char *str=x.c_str();printf("%s ",str);};inline void print(const char&x) {printf("%c ",x);};
inline void println(const int&x){printf("%d\n",x);};inline void println(const ll&x) {printf("%lld\n",x);};inline void println(const double&x) {printf("%lf\n",x);};inline void println(const string&x){const char *str=x.c_str();printf("%s\n",str);};inline void println(const char&x) {printf("%c\n",x);};
inline void scanarray(int*a,int n){rep(i,0,n-1)scan(a[i]);};inline void scanarray(double*a, int n){rep(i,0,n-1)scan(a[i]);};
inline void printarray(int*a,int n){rep(i,0,n-2){print(a[i]);}println(a[n-1]);}inline void printarray(double*a, int n){rep(i,0,n-2){print(a[i]);} println(a[n-1]);};
inline void copyarray(int*a,int n,int*b){rep(i,0,n-1)b[i]=a[i];};inline void copyarray(double*a, int n, double*b){rep(i,0,n-1)b[i]=a[i];};
/*
scan, print, println    : int, ll, double, string, char
scanarray, printarray   : int, double
copyarray               : int to int, double to double
(*)scanarrayはすべての入力の型が同一でないとバグるので注意。 2 5.3 9 8　とかはダメ
stringについては入出力の際はchar*で行い、コード中で便利のためにstringを使えるようにしている
*/
const ll MaxN = 2000000;
ll A[MaxN];
int n;

void countingsort(int *A, int *B, int k) {
    int C[k];
    rep(i,0,k) {
        C[i] = 0;
    }
    rep(i,0,n-1) {
        C[A[i]]++;
    }
    rep(i,1,k) {
        C[i] = C[i] + C[i-1];
    }
    per(i,n-1,0) {
        B[C[A[i]]-1] = A[i];
        C[A[i]]--;
    }
    
}

int main() {
    //template
    
    scan(n);
    int a[n];
    int b[n];
    scanarray(a,n);
    
    int max=a[0];
    rep(i,0,n-1) {
        if(a[i] > max) max = a[i];
    }
    countingsort(a,b,max);
    
    printarray(b,n);
    

    return 0;
}




Measured memory_bytes: 18808
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
using namespace std;
typedef pair<int,int> P;
typedef long long int lnt;
lnt n,s,b,root;

lnt aq(lnt n,lnt i)
{
	if(n==0) return 0;
	return n%i+aq(n/i,i);
}

int main()
{
	cin>>n>>s;
	if(n<s){
		cout<<-1<<endl;
		return 0;
	}
	if(n==s) {
		cout<<n+1<<endl;
		return 0;
	}
	root=floor(sqrt(n))+2;
	for(lnt i=2;i<root;i++){
		if(aq(n,i)==s) {
			cout<<i<<endl;
			return 0;
		}
	}
	const lnt INF=0xfffffffffff;
	lnt ans=INF;
	for(lnt i=1;i<root;i++){
		if((n-s)%i==0){
			b=(n-s)/i+1;
			if(aq(n,b)==s) ans=min(ans,b);
		}
	}
	if(ans==INF) cout<<-1<<endl;
	else cout<<ans<<endl;
}

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

dis = [0] * n
for i in range(1,n):
  dis[i] = a[i] - a[i-1]
  
dis[0] = k - a[-1] + a[0]

print(sum(dis) - max(dis))

Measured memory_bytes: 25840
import java.util.*;
import java.io.PrintWriter;
import static java.lang.Integer.*;
import static java.lang.Long.*;
import static java.lang.Math.*;
import static java.lang.System.*;

public class Main {
	public static final int AB = 26;
	public static void main(String[] args) {
		long i=0,j=0,k=0;
		Scanner sc = new Scanner(in);
		long n = parseLong(sc.next());
		long m = parseLong(sc.next());
		sc.close();
		long a=0;
		if(n>=m/2) {
			a=m/2;
		} else {
			a=n+(m-(n*2))/4;
		}
		out.println(a);
	}
}


Measured memory_bytes: 23380
#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <math.h>
#include <algorithm> // sort

#define REP(i, n) for (long long i = 0; i < (n); i++) 
typedef long long ll;
static const ll INF = 1000000000000000000LL;
using namespace std;

const int MOD = 1000000007;

//h,n,w
int main(){
    ll N;


    cin >> N;
    ll res = 0;
    for(ll i = 1; i * i <= N; ++i)
    {
        ll n = N - i;
        //ll k = n / i;
        if(n % i == 0 &&  n/i > i)
        {
            res += n / i;

            //cout << n << " " << i << endl;
        }
    }
//999999‬ * 
    //1あまり1 
    //2あまり2
    //3あまり3

    cout << res << endl;

    return 0;    
}


Measured memory_bytes: 256
r_num, c_num = gets.split.map(&:to_i)

row_sum = Array.new(r_num) { 0 }
col_sum = Array.new(c_num) { 0 }

r_num.times do |i|
  row = gets.split.map(&:to_i)
  row_sum[i] = row.inject(&:+)

  print "#{row.join(' ')} #{row_sum[i]}\n"

  row.each_with_index do |col, index|
    col_sum[index] += col
  end
end

puts "#{col_sum.join(' ')} #{row_sum.inject(&:+)}"

Measured memory_bytes: 8860
#[allow(unused_imports)]
use {
    itertools::Itertools,
    proconio::{fastout, input, marker::*},
    std::cmp::*,
    std::collections::*,
    std::io::Write,
    std::ops::*,
};

#[allow(unused_macros)]
macro_rules! debug { ($($e:expr),*) => { #[cfg(debug_assertions)] $({ let (e, mut err) = (stringify!($e), std::io::stderr()); writeln!(err, "{} = {:?}", e, $e).unwrap() })* }; }

struct UnionFind {
    n: usize,
    par: Vec<usize>,
    rank: Vec<usize>,
}
impl UnionFind {
    fn new(n: usize) -> Self {
        UnionFind {
            n,
            par: (0..n).collect(),
            rank: vec![1; n],
        }
    }
    fn unite(&mut self, x: usize, y: usize) {
        if self.same(x, y) {
            return;
        }
        let rx = self.par[x];
        let ry = self.par[y];
        if self.rank[rx] > self.rank[ry] {
            self.par[ry] = rx;
            self.rank[rx] += self.rank[ry];
        } else {
            self.par[rx] = ry;
            self.rank[ry] += self.rank[rx];
        }
    }
    fn same(&mut self, x: usize, y: usize) -> bool {
        self.root(x) == self.root(y)
    }
    fn root(&mut self, x: usize) -> usize {
        if self.par[x] == x {
            x
        } else {
            self.par[x] = self.root(self.par[x]);
            self.par[x]
        }
    }
    #[allow(dead_code)]
    fn size(&mut self, x: usize) -> usize {
        let r = self.root(x);
        self.rank[r]
    }
    #[allow(dead_code)]
    fn sizes(&mut self) -> Vec<usize> {
        let mut s = vec![];
        for x in 0..self.n {
            if x == self.root(x) {
                s.push(self.rank[x]);
            }
        }
        s
    }
}

#[fastout]
fn main() {
    input! {
        n: usize,
        m: usize,
        ab: [(Usize1, Usize1); m]
    }
    let mut uf = UnionFind::new(n);
    for (a, b) in ab {
        uf.unite(a, b);
    }
    let mut set = std::collections::BTreeSet::<usize>::new();
    for i in 0..n {
        set.insert(uf.root(i));
    }
    println!("{}", set.len() - 1);
}


Measured memory_bytes: 6264
#include <bits/stdc++.h>
#define rep(i,n) for (int (i) = 0; (i) < (n); i++)
#define ll long long
using namespace std;
int main() {
  int a,b,c; cin >>a>>b>>c;
  int ans = 0;
  for(int i = a; i<=b;i++){
    if(i % c == 0){
      ans++;
    }
  }
  cout << ans;
}

Measured memory_bytes: 3592
#include <bits/stdc++.h>
typedef long long LL;
using namespace std;

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

  LL ans = 0;
  for (LL i = 1; i * i <= n; i ++) {
    if ((n - i) % i == 0 && (n - i) / i > i) ans += (n - i) / i;
  }

  cout << ans << endl;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
class Main
{
	public static void main(String[] args)throws IOException
	{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		double r= Double.parseDouble(reader.readLine());
		System.out.printf("%6f %6f",r*r*Math.PI,r*2*Math.PI);		
		
		
	}
}

Measured memory_bytes: 24684
#include <iostream>

using namespace std;

int main(void) {
    int N;
    cin >> N;
    for(int i=0; i<=25; i++) {
        for(int j=0; j<15; j++) {
            if(4*i+7*j == N) {
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 384
//shara's here
//SPEEEEEEEEEED IS KEEEEEEEEEEY
//REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAD
#include <bits/stdc++.h>
using namespace std;
typedef string s;
typedef long long ll;
typedef long double ld;
#if !defined(ONLINE_JUDGE)
#include "C:\debug.hpp"
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
#define pb push_back
#define ins insert
#define vl vector<ll>
#define speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
int main(){
    s ss;
    cin >> ss;
    if(ss[0]=='7'||ss[1]=='7'||ss[2]=='7'){
        cout << "Yes" << endl;
    }
    else cout << "No" << endl;

































return 0;}
/*
███████████████████████████████████████████████████
███████████████████████████████████████████████████
██████████████████████████████████▀████████████████
██████████████████████████████████░▀███████████████
██████████████████████████████▌███░░░▀▀████████████
██▀████████████████████▐██████░▐██░░░░░░▀▀█████████
██░████████████████████▐█████▌░██▌▄░░░░▄▄░▄████▀███
█▌░███████████████████▀░█████░░░█░░░▄████░░███▀▐███
█▌░▐██████████████████░░████▌░░░▀░░▀███▀▀░▐███▄████
██░▀██████████████▌▐█▐▄▄████▌░░░░░░░░░░░░░▌████████
███░███████████████▀░▄▄██▀█▐░░░░░░░░░░░░░░▐████████
███▄░██████████████▄░░░░░░▀▀▀░░░░░░░░░░░░░█▐███████
████▄░██████████████████▄▄▄▄▄▄▐▄░░░░░░░░░░░████████
█████▄█████████████████▀▀▀▀▀▀░░░░░░░░░░░░░░████████
████████████████████████▄░░░░░░░░░░░░░░░▄░░████████
██████████████████████████▄▄▄░░░░░░░░░▄█░▄█████████
████████████████████████████████▄░░░░██▄███▀░░▀████
█████████████████████████████▀█████▄███▀▀▀░░▄▄░████
████████████████████████████▀░░▀░░▀▀░░░░▄▄▄██▀░░▀▀█
███████████████████████████▌░░░░░░░░░░░███████░░░▄█
███████████████▄░▀████████▀░░░░░░▀░░░░███████▌░░░██
███▄▄████████████▄░▀██████▄░░░░░█░░░░████████░░░▀▀
░▀█████████████████▄░▀█████░░░░██░░░░▀██████░░░░░▄█
▐█▄▀█████████████████▄░▀████░░░██▌░░░▐████▀░░░░▄███
▐███▄▀▀█████████████████▄░▀▀░░░░▀██▌▄█▀▀░░░▄▄██████
▀▀▀▀▀░░░▀▀▀▀▀░░░▀▀▀▀▀▀▀▀▀▀▀░░░░░░░▀▀░░░░░░▀▀▀▀▀▀▀▀▀
*/


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

typedef long long ll;
#define fore(i,ii,iii) for(int i=ii;i<iii;i++)
#define mset(a,b) memset(a,b,sizeof(a))

const int N=3005;
ll n,dp[N][N],dp2[N][N],MOD=1e9+7;
string s;

ll solve(int i,int j) {
  if(i==n-1)return 1;
  if(dp2[i][j]!=-1)return dp2[i][j];
  ll r=0;
  if(s[i]=='>'){fore(k,1,j)r=(r+solve(i+1,k))%MOD;}
  else{fore(k,j,n-(i+1)+1)r=(r+solve(i+1,k))%MOD;}
  //cout<<"c: "<<i<<" "<<j<<" : "<<r<<endl;
  return dp2[i][j]=r;
}
ll it() {
  fore(i,1,n+1)dp[n-1][i]=1;
  for(int i=n-2;i>=0;i--) {
    for(int j=1;j<=n;j++) {
      if(s[i]=='>')dp[i][j]=(dp[i+1][j-1]-dp[i+1][0]+MOD)%MOD;
      else dp[i][j]=(dp[i+1][n-(i+1)]-dp[i+1][j-1]+MOD)%MOD;
      //cout<<i<<" "<<j<<" : "<<dp[i][j]<<endl;
    }
    for(int j=1;j<=n;j++)dp[i][j]=(dp[i][j-1]+dp[i][j])%MOD;
  }
  return dp[0][n];
}

int main() {
  ios::sync_with_stdio(false);
  //mset(dp2,-1);
  cin>>n>>s;
  cout<<it()<<endl;
  //ll r=0;
  //fore(i,1,n+1)r=(r+solve(0,i))%MOD;
  //cout<<r<<" "<<it()<<endl;
}

Measured memory_bytes: 71680
#include<stdio.h>
#include<stdlib.h>

long long int search(char str[], char sear,int n) {
	int i;
	int num = 0;

	for (i = 0;i < n;i++) {
		if (str[i] == sear) {
			num++;
		}
	}
	return num;
}

int main() {
	int i, j, k, f = 0, n, t, m;
	int a, b, c, d, e;
	int z;
	long long int x, y;
	char s[1100000];
	long long int b0[30];
	char a0[30];
	y = 10 * 10 * 10 * 10 * 10 * 10 * 10 * 10 * 10 + 7;

	scanf("%d", &n);
	scanf("%s", s);

	i = 0;
	a0[i] = 'a';
	b0[i] = search(s, a0[i],n) + 1;
	i++;
	a0[i] = 'b';
	b0[i] = search(s, a0[i],n) + 1;
	i++;
	a0[i] = 'c';
	b0[i] = search(s, a0[i],n) + 1;
	i++;
	a0[i] = 'd';
	b0[i] = search(s, a0[i],n) + 1;
	i++;
	a0[i] = 'e';
	b0[i] = search(s, a0[i],n) + 1;
	i++;
	a0[i] = 'f';
	b0[i] = search(s, a0[i],n) + 1;
	i++;
	a0[i] = 'g';
	b0[i] = search(s, a0[i],n) + 1;
	i++;
	a0[i] = 'h';
	b0[i] = search(s, a0[i],n) + 1;
	i++;
	a0[i] = 'i';
	b0[i] = search(s, a0[i],n) + 1;
	i++;
	a0[i] = 'j';
	b0[i] = search(s, a0[i],n) + 1;
	i++;
	a0[i] = 'k';
	b0[i] = search(s, a0[i],n) + 1;
	i++;
	a0[i] = 'l';
	b0[i] = search(s, a0[i],n) + 1;
	i++;
	a0[i] = 'm';
	b0[i] = search(s, a0[i],n) + 1;
	i++;
	a0[i] = 'n';
	b0[i] = search(s, a0[i],n) + 1;
	i++;
	a0[i] = 'o';
	b0[i] = search(s, a0[i],n) + 1;
	i++;
	a0[i] = 'p';
	b0[i] = search(s, a0[i],n) + 1;
	i++;
	a0[i] = 'q';
	b0[i] = search(s, a0[i],n) + 1;
	i++;
	a0[i] = 'r';
	b0[i] = search(s, a0[i],n) + 1;
	i++;
	a0[i] = 's';
	b0[i] = search(s, a0[i],n) + 1;
	i++;
	a0[i] = 't';
	b0[i] = search(s, a0[i],n) + 1;
	i++;
	a0[i] = 'u';
	b0[i] = search(s, a0[i],n) + 1;
	i++;
	a0[i] = 'v';
	b0[i] = search(s, a0[i],n) + 1;
	i++;
	a0[i] = 'w';
	b0[i] = search(s, a0[i],n) + 1;
	i++;
	a0[i] = 'x';
	b0[i] = search(s, a0[i],n) + 1;
	i++;
	a0[i] = 'y';
	b0[i] = search(s, a0[i],n) + 1;
	i++;
	a0[i] = 'z';
	b0[i] = search(s, a0[i],n) + 1;


	x = 1;

	for (i = 0;i < 26;i++) {
		x = x * b0[i]%y;
	}


	x = x - 1;
	x = x % y;

	printf("%lld", x);

	return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <iomanip>


using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;

#define rep(i, a, b) for (int i=a; i<(b); i++)
#define rp(i, a) for (int i=0; i<(a); i++)
#define repd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define rpd(i,a) for (int i = (a)-1; i >= 0; i--)

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define shandom_ruffle random_shuffle

const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 100001; //check the limits, dummy


int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    cout << std::setprecision(9);
    cout << std::fixed;

    ll x;
    cin >> x;
    cout << 24 + 24 - x <<endl;

    return 0;
}

// read the question correctly (ll vs int)
// template by super1 derived from bqi343


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

signed main() {
  int n; cin >> n;
  ll ans[90];
  ans[0] = 2; ans[1] = 1;

  for(int i = 2; i <= n; i++) {
    ans[i] = ans[i-1] + ans[i-2];
  }

  cout << ans[n] << endl;
}


Measured memory_bytes: 256
Module Program
  Sub Main
    Dim s=GetInts()
    Array.Sort(s)
    Dim a=s(0),b=s(1),c=s(2)
    Dim ans=If(a=b,c,a)
    Console.WriteLine(ans)
  End Sub
  
  '/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
  Function Gets() As String()
    Gets = Console.ReadLine().Split(" "c)
  End Function
  Function GetInts() As Integer()
    Dim s = Gets(), r(UBound(s)) As Integer
    For i As Integer=0 To UBound(s): r(i)=s(i): Next i
    GetInts = r
  End Function
End Module

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

using namespace std;

#define ll long long
#define PI 3.14159265358979323846264338327950L

long double A,B,H,M;

void solve(){

    cin >> A >> B >> H >> M;

    // 6 grad pro min   30 grad por hour

    long double arc = 6*M-(30*H+(6*M)/12);
    arc = abs(arc);
    //cout << "arc : " << arc << " cos: " << cos(arc * PI / 180.0) << endl;

    long double  ans = (A*A+B*B)- (long double)(2*A*B * cos(arc * PI / 180.0));

    cout << setprecision(20) << sqrt(ans) << endl;

}





int main(){

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

    solve();

}

Measured memory_bytes: 4164
#include<iostream>
using namespace std;
int main() {
	int m, f, b;
	cin >> m >> f >> b;
	if (m+f >= b) {
		if (m >=b) {
			cout << 0 << endl;
		}
		else {
			cout << b - m << endl;
		}
	}
	else {
		cout << "NA" << endl;
	}
}


Measured memory_bytes: 3112
# -*- coding: utf-8 -*-
"""
Created on Sun May  3 20:56:48 2020
"""

import sys
#import numpy as np

sys.setrecursionlimit(10 ** 9)
#def input():
#    return sys.stdin.readline()[:-1]
mod = 10**9+7

X = int(input())

for i in range(-1000,1001):
    for j in range(-1000,1001):
        if pow(i,5) - pow(j,5) == X:
            print(i,j)
            sys.exit()



Measured memory_bytes: 9096
import sys
from collections import Counter
MOD = 10 ** 9 + 7
n, *a = map(int, sys.stdin.read().split())

def main():
  c = Counter(a)
  if n & 1:
    if c.get(0, 0) != 1:
      print(0); return
  for i in range(1 + (n & 1), n, 2):
    if c.get(i, 0) != 2:
      print(0); return 
  print(pow(2, n // 2, MOD))

if __name__ ==  '__main__':
  main()

Measured memory_bytes: 14196
#include<bits/stdc++.h>
using namespace std;
int deg[1001];
int main()
{
	long long k,a,b;
	scanf("%lld%lld%lld",&k,&a,&b);
	if(b-1<=a)
		printf("%lld\n",k+1);
	else
	{
		long long tot=k+1;
		
		long long sum=b-a;
		k-=a-1; 
		long long ans=sum*(k/2ll);
		ans+=k%2ll;
		printf("%lld\n",max(tot,ans+a));
	}
	return 0;
}

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

#define watch(x) cerr << (#x) << ": " << (x) << endl

typedef long long LL;

const int N = 509;
int n, p[N*N];

int grid[N][N];
int here[N][N];

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

void dfs(int x, int y) {
    int cur = grid[x][y] + here[x][y];
    for(int i = 0; i < 4; ++i) {
        int xx = x + dx[i], yy = y + dy[i];
        if(grid[xx][yy] > cur) {
            grid[xx][yy] = cur;
            dfs(xx, yy);
        }
    }
}

int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> n;
    for(int i = 0; i < n*n; ++i) {
        cin >> p[i];
    }
    
    for(int i = 0; i < n; ++i) {
        for(int j = 0; j < n; ++j) {
            int l = i, r = n-1-i, u = j, d = n-1-j;
            grid[i][j] = min(l, min(r, min(u, d)));
            here[i][j] = 1;
        }
    }

    int ans = 0;

    for(int i = 0; i < n*n; ++i) {
        int cur = p[i]-1, x = cur/n, y = cur%n;
        ans += grid[x][y];
        
        here[x][y] = 0;
        dfs(x, y);
    }

    cout << ans << '\n';
    
    return 0;
}


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

#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define ALL(x) x.begin(),x.end()
#define EPS (1e-8)
#define equals(a,b) (fabs((a)-(b))<EPS)

using namespace std;

typedef long long ll;
const int IINF = INT_MAX;
const ll LLINF = LLONG_MAX;

bool LT(double a,double b) { return !equals(a,b) && a < b; }
bool LTE(double a,double b) { return equals(a,b) || a < b; }

void compute() {

}

int main() {
  string n;
  cin >> n;
  int maxi = 0;
  maxi = ((int)n.size()-1) * 9 + ( n[0] - '0' - 1 );
  int sum = 0;
  rep(i,(int)n.size()) sum += ( n[i] - '0' );
  maxi = max(maxi,sum);
  cout << maxi << endl;
  compute();
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main() {

    char n[2];
    scanf("%s", n);
    
    if(n[0]=='9' || n[1]=='9'){
        printf("Yes");
    }else{
        printf("No");
    }
    

    return 0;
    

}


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

int main()
{
    ll k, a,b,item,temp;
    cin>>k;
    cin>>a>>b;
    if(a%k==0)
    {
        cout<<"OK"<<endl;
        return 0;
    }
    else if(b%k==0)
    {
        cout<<"OK"<<endl;
        return 0;
    }
    item=a/k;
    for(int i=item;k*i<=b;i++)
    {
        if(k*i>=a && k*i<=b)
        {
            cout<<"OK"<<endl;
            return 0;
        }
    }
    cout<<"NG"<<endl;
    return 0;
}


Measured memory_bytes: 3604
#include<bits/stdc++.h>
#define rep(i, n) for(int (i)=0 ;i <(n); ++(i))
#define REP(i,m,n) for(int (i) = (m); (i) <= (n); ++(i))
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)? "YES":"NO")
typedef long long ll;
using namespace std;

int main() {
  string s;
  cin >> s;
  string x = s;
  reverse(s.begin(), s.end());
  yorn(x == s);
  return 0;
}

Measured memory_bytes: 256
N, K = map(int, input().split())
A = list(map(int, input().split()))
dp = [False] * (2 * K + 1)

for i in range(K, 0, -1):
  if all([not dp[i+j] for j in A]):
    dp[i] = True

print("First" if any([dp[i] for i in A]) else "Second")

Measured memory_bytes: 44676
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr int Inf = 1000000010;
constexpr ll INF= 2000000000000000000;
constexpr ll MOD = 1000000007;
const double PI = 3.1415926535897;
typedef pair<int,int> P;

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

ll mod(ll val) {
    ll res = val % MOD;
    if(res < 0) {
        res += MOD;
    }
    return res;
}

// N^P mod M（ただしM == -1の時はmodを取らない）
template<typename T>
T RS(T N, T P, T M){
    if(P == 0) {
        return 1;
    }
    if(P < 0) {
        return 0;
    }
    if(P % 2 == 0){
        ll t = RS(N, P/2, M);
        if(M == -1) return t * t;
        return t * t % M;
    }
    if(M == -1) {
        return N * RS(N,P - 1,M);
    }
    return N * RS(N, P-1, M) % M;
}

int main() {
    int N, K;
    cin >> N >> K;
    vector<int> vec(N);
    for(int i = 0;i < N;i++) {
        cin >> vec.at(i);
    }
    int ng = 0;
    int ok = 1000000000;
    int mid;
    while(ok - ng > 1) {
        mid = (ng + ok) / 2;
        int cnt = 0;
        for(int j = 0;j < N;j++) {
            cnt += (vec.at(j) - 1) / mid;
        }
        if(cnt <= K) {
            ok = mid;
        }
        else {
            ng = mid;
        }
    }
    cout << ok << endl;
}

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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit32(x) (1 << (x))
#define bit64(x) (1ll << (x))
#define sz(v) ((int) v.size())

using namespace std;

using i64 = long long;
using f80 = long double;
using vi32 = vector<int>;
using vi64 = vector<i64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << endl; exit(0); }
inline void no() { cout << "No" << endl; exit(0); }
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> inline void amax(T &x, T y) { x = max(x, y); }
template <typename T> inline void amin(T &x, T y) { x = min(x, y); }
template <typename T> inline T exp(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { each(x, v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }

void solve() {
  int n;
  cin >> n;
  vector<pair<int, int>> xy(n);
  rep(i, n) {
    cin >> xy[i].first >> xy[i].second;
  }
  auto radius = [&](f80 x, f80 y) -> f80 {
    f80 ret = 0;
    rep(i, n) {
      amax(ret, sqrt(pow(x - xy[i].first, 2) + pow(y - xy[i].second, 2)));
    }
    return ret;
  };
  auto rad = [&](f80 x) -> f80 {
    f80 yl = -1000, yr = 1000;
    rep(_, 100) {
      f80 l = yl + (yr - yl) / 3 * 1;
      f80 r = yl + (yr - yl) / 3 * 2;
      if (radius(x, l) > radius(x, r)) {
        yl = l;
      } else {
        yr = r;
      }
    }
    return radius(x, yl);
  };
  f80 xl = -1000, xr = 1000;
  rep(_, 100) {
    f80 l = xl + (xr - xl) / 3 * 1;
    f80 r = xl + (xr - xl) / 3 * 2;
    if (rad(l) > rad(r)) {
      xl = l;
    } else {
      xr = r;
    }
  }
  cout << rad(xl) << endl;
}

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

int main(){
    ll a,b;
    cin >> a;
    if(a<1000) puts("ABC");
    else puts("ABD");
    return 0;
}

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

typedef long long ll;

using vi = vector<int>;
using vl = vector<long long int>;
using vii = vector<vector<int>>;
using vll = vector<vector<long long int>>;



int modd(int a)
{
return a>=0?a:-a;
}


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
   // const int m=1e9+7;
int n;
cin>>n;
vector<string>s(n);
map<string,int>m;
for(int i=0;i<n;i++)cin>>s[i];

for(string x:s)
{
  m[x]++;
}
int count_max=0;
for(auto x:m)
{
count_max=max(count_max,x.second);
}
for(auto x:m)
{
  if(x.second==count_max)cout<<x.first<<"\n";
}


return 0;

}


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

long long s,X,Y,x,y,xkamo,ykamo,sa,keta_n;
vector<long long> enum_div(long long n)//nの約数を列挙
{
    std::vector<long long> ret;
    for(long long i=1 ; i*i<=n ; ++i)
    {
        if(n%i == 0)
        {
            ret.push_back(i);
            if(i!=1 && i*i!=n)
            {
                ret.push_back(n/i);
            }
        }
    }
    return ret;
}
long long keta(long long y){
    long long ans=1;
    for (;y>=10 ; ) {
        y/=10;
        ans++;
    }
    
    return ans;
}
signed main(){
    cin>>s;
     keta_n = keta(s);
    Y=sqrt(s);
    X=sqrt(s);
    double manji=fmod(sqrt(s),1);
    if (manji==0) {
        
    }else if(manji>=0.5){
        X+=1;
        Y+=1;
    }else X+=1;
    long long mokuhyou=abs(s-X*Y);
     xkamo=0;
    vector<long long> yakusuu=enum_div(mokuhyou);
     sa=9999999999;
    for (long long i=0; i<yakusuu.size(); i++) {
        long long ppap=floor(sqrt(mokuhyou));
        long long sa_new=abs(yakusuu[i]-ppap);
        if (sa>sa_new) {
            sa=sa_new;
            xkamo=yakusuu[i];
        }
        
    }
    if(xkamo!=0)ykamo=mokuhyou/xkamo;
    else ykamo=0;
    x=X-xkamo;
    y=Y-ykamo;
    cout<<x<<' '<<0<<' '<<0<<' '<<y<<' '<<X<<' '<<Y<<endl;
}


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

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    
    //good luck kittu!
    int n; cin>>n;
    vector<int> a(n), b(n);
    for(int i = 0; i<n; i++) cin>>a[i]>>b[i];

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

    ll m1, m2;
    if(n&1){
        m1 = a[(n-1)/2];
        m2 = b[(n-1)/2];
    }
    else{
        m1 = a[n/2] + a[-1+n/2];
        m2 = b[n/2] + b[-1+n/2];
    }
    if(m1>m2) swap(m1, m2);
    cout<<m2-m1+1<<"\n";
    return 0;
}


Measured memory_bytes: 4724
import sys
n, x = [int(i) for i in input().split()]
l = [0] + [int(i) for i in input().split()]
for i in range(1, n + 1):
    l[i] += l[i - 1]
ans = 0
for i in range(0, n + 1):
    if l[i] <= x: ans += 1
print(ans)


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

#define NIL -1

typedef struct {
    int parent, *right, *left;
} Node;

int nodenum;
Node *_node;

void Dynamic_Allocation() {
    cin >> nodenum;
    _node = new Node[nodenum + 1];
    for(int i=0; i<nodenum; ++i) {
        _node[i].parent = NIL;
        _node[i].left = _node[i].right = nullptr;
    }
}

void Input() {
    int nodeindex, childnum;
    for(int i=0; i<nodenum; ++i) {
        cin >> nodeindex >> childnum;

        if(!childnum)
        {
            _node[nodeindex].left = nullptr;
            continue;
        }

        else
        {
            _node[nodeindex].left = new int[childnum + 1];
            _node[nodeindex].left[childnum] = NIL;
            for(int j=0; j<childnum; ++j) {
                cin >> _node[nodeindex].left[j];
                _node[_node[nodeindex].left[j]].parent = nodeindex;
            }
        }
    }
}

int recdepth(int index) {
    int depth = 0;
    while(_node[index].parent != NIL) {
        ++depth;
        index = _node[index].parent;
    }
    return (depth);
}

string recnodetype(int index) {
    if(_node[index].parent == NIL)
        return ("root");
    
    else if(_node[index].left == nullptr)
        return ("leaf");
    
    else
        return ("internal node");
}

void childrenOutput(int index) {
    if(_node[index].left == nullptr)
        return ;

    int i = 0;
    while(_node[index].left[i] != NIL) {
        if(i)
            cout << ", ";
        
        cout << _node[index].left[i];
        ++i;
    }
}

void Output() {
    for(int i=0; i<nodenum; ++i) {
        cout << "node " <<  i << ": ";
        cout << "parent = " << _node[i].parent << ", ";
        cout << "depth = " << recdepth(i) << ", ";
        cout << recnodetype(i) << ", ";
    
        cout << "[";
            childrenOutput(i);
        cout << "]" << endl;
    }
}



int main(void) {
    Dynamic_Allocation();
    Input();
    Output();
    return 0;
}


Measured memory_bytes: 6144
#include<stdio.h>
int main()
{
    int A[100][100];
    int B[100][100];
    int C[100][100];
    int m,n,i,j,k,sum=0;
    scanf("%d %d",&n,&m);
    for(i=0;i<n;i++)
    {
        for(j=0;j<m;j++)
        {
            scanf("%d", &A[i][j]);
        }
    }
    for(i=0;i<m;i++)
    {
            scanf("%d", &B[i][0]);
    }
     for (i=0;i<n;i++) {
      for (j=0;j<1;j++) {
            sum = 0;
        for (k=0;k<m;k++) {
          sum = sum+A[i][k]*B[k][j];
        }
        C[i][j] = sum;
      }
    }
    for (i=0;i<n;i++) {
        printf("%d\n",C[i][0]);
      }

  return 0;
}



Measured memory_bytes: 2072
#include<iostream>
#include<vector>
#include<queue>
#include<algorithm>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)
#define pb         push_back

int solve(string  a,int g,int k,int step){
  int now = 0;
  int n = a.size();
  rep(i,n-1){
    int tstep=step;
    if (i == k)tstep=step+1;
    int next=(now+tstep)%a.size();
    if (a[next] == 'G')g--;
    a.erase(a.begin()+next);
    
    if (g == 0)return a.size();
    
    now=next%a.size();
  }
  return a[0] == 'B'?1:0;
}


main(){
  int te;
  cin>>te;
  while(te--){
    int n;string in;
    cin>>n>>in;
    n--;
    int g = count(in.begin(),in.end(),'G');
    int ans =0;
    rep(i,in.size()){
      ans=max(ans,solve(in,g,i,n));
    }
    cout << ans << endl;
  }
  return false;
}

Measured memory_bytes: 928
#include <iostream>
using namespace std;
int main(void){
    
    int A, B, C;
    cin >> A >> B >>C;
    
    int max_music = B / A;
    
    if(max_music >= C){
        cout << C << endl;
    }
    else{
        cout << max_music << endl;
    }
    
    
}


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

using namespace std;

char a[7];

int main()
{
    int x;
    long long ans = 0;
    cin >> x;
    ans = 1LL * 1000 * (x / 500);
    x %= 500;
    ans += 1LL *  5 * (x / 5);
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ALL(obj) (obj).begin(),(obj).end()
#define sortall(obj) sort(ALL(obj))
#define revall(obj) reverse(ALL(obj))
#define SortRevAll(obj) revall(sortall(obj))
typedef string str;
typedef long long ll;
#define V vector
#define P pair
#define M map
#define fst(a) a.first
#define snd(a) a.second
#define ins(a) int a;cin >> a
#define lls(a) ll a;cin >> a

#define sts(a) string (a);cin >> a
#define For(i,m,n) for(int i=m;i<n;i++)
#define rep(i,n) For(i,0,n)
#define Forr(i,m,n) for(int i=n-1;i>=m;i--)
#define repr(i,n) Forr(i,0,n)
#define print(a) cout << a << endl
#define Endl cout << endl

int main(){
    ins(n);
    set<int> st;
    rep(i,n){
        ins(a);
        st.insert(a);
    }
    print(st.size());
    return 0;
}


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

typedef bool B;
typedef long double D;
typedef complex<D> P;
typedef vector<P> VP;
typedef struct {P s,t;} L;
typedef vector<L> VL;
typedef struct {P c;D r;} C;
typedef vector <C> VC;

const D eps=1.0e-10;
const D pi=acos(-1.0);
template<class T> bool operator==(T a, T b){return abs(a-b)< eps;}
template<class T> bool operator< (T a, T b){return a < b-eps;}
template<class T> bool operator<=(T a, T b){return a < b+eps;}
//template<class T> int sig(T r) {return (r==0||r==-0) ? 0 : r > 0 ? 1 : -1;}
template<class T> int sig(T a,T b = 0) {return a < b ? -1 : b > a ? 1 : 0;}
#define X real()
#define Y imag()

D ip(P a, P b) {return a.X * b.X + a.Y * b.Y;}
D ep(P a, P b) {return a.X * b.Y - a.Y * b.X;}
D sq(D a) {return sqrt(max(a, (D)0));}
P vec(L l){return l.t-l.s;}
inline P input(){D x,y;cin >> x >> y; return P(x,y);}
//??\??? ???????????¬????????¨???


// ??? not verify
D toRagian(D degree){ return degree*pi/180.0;}
D ang (P p){return arg(p);}
D ang (P base, P a, P b) {return arg( (b - base) / (a - base) );} // base ??????
P rot (P base, P a, D theta){
	P tar=a-base;return base+polar(abs(tar), arg(tar)+theta );
}

enum CCW{
	LEFT = 1,
	RIGHT = 2,
	BACK = 4,
	FRONT = 8,
	MID = 16,
	ON=FRONT|BACK|MID
};

inline int ccw(P base, P a, P b) {              //???a??¨???b???????????????????????????
	a -= base; b -= base;
	if (ep(a, b) > 0)
		return LEFT;    // counter clockwise
	if (ep(a, b) < 0)
		return RIGHT;   // clockwise
	if (ip(a, b) < 0)
		return BACK;    // b--base--a on line
	if (norm(a) < norm(b))
		return FRONT;   // base--a--b on line
	// otherwise
	return MID;      // base--b--a on line  a??¨b????????????????????????
}

// ????§???¢??????????????? ?????? 2 ?????? 1 ???????????? 0???(???????§???¢??????)
//verify AOJ CGL_3-C
int in_polygon(VP pol,P p){
	int n=pol.size();
	int res=0;
	rep(i,n){
		if(ccw(pol[i],pol[(i+1)%n],p)==MID)
			return 1;
		D vt=(p.Y-pol[i].Y)/(pol[(i+1)%n].Y-pol[i].Y);
		D dx=pol[(i+1)%n].X-pol[i].X;
		if((pol[i].Y<=p.Y)&&(p.Y< pol[(i+1)%n].Y)&&(p.X<pol[i].X+vt*dx))res++;
		if((pol[i].Y> p.Y)&&(p.Y>=pol[(i+1)%n].Y)&&(p.X<pol[i].X+vt*dx))res--;
	}
	return res?2:0;
}

int main(void){
    D x, y;
    while(cin >> x >> y){
        VP pol(3); P p;
        pol[0] = P(x, y);
        rep(i, 2) pol[i + 1] = input();
        p = input();

        string res = in_polygon(pol, p) != 0 ? "YES":"NO";

        cout << res << endl;
    }
    
	return 0;
}

Measured memory_bytes: 1248
#include <cmath>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <functional>
#include <queue>
#include <iostream>
#include <string.h>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <cstdint>
#include <climits>
#include <unordered_set>
#include <sstream>
#include <stack>

using namespace std;

typedef long long int ll;
typedef pair<int,int> pii;
typedef tuple<ll,ll,ll> t3;

using namespace std;
int n,m;

int main()
{
    string vs, t;
    cin >> vs;
    cin >> t;
    int tl = t.size();
    int id = -1;
    for(int i = vs.size()-tl;i >= 0;i--)
    {
        bool ok = true;
        for(int j = 0;j < tl;j++)
        {
            if(vs[i + j] == t[j] || vs[i + j] == '?')
            {
            }
            else
            {
                ok = false;
                break;
            }
        }
        if(ok)
        {
            id = i;
            break;
        }
    }
    if(id < 0)
    {
        cout << "UNRESTORABLE" << endl;
        return 0;
    }
    for(int i = 0;i < id;i++)
    {
        if(vs[i] == '?')
        {
            cout << 'a';
        }
        else
        {
            cout << vs[i];
        }
    }
    cout << t;
    for(int i = id + tl;i < vs.size();i++)
    {
        if(vs[i] == '?')
        {
            cout << 'a';
        }
        else
        {
            cout << vs[i];
        }
    }
    cout << endl;
    
    return 0;
}


Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main()
{
	while(true)
	{
		int t = 0, n = 0, s = 0, f = 0, sum = 0;

		cin >> t;

		if(t == 0)
		{
			return false;
		}

		cin >> n;

		for(int i = 0; i < n; i++)
		{
			cin >> s >> f;

			sum += f - s;
		}

		if(sum >= t)
		{
			cout << "OK" << endl;
		}

		else
		{
			cout << t - sum << endl;
		}
	}
}

Measured memory_bytes: 1164
N, M = [int(i) for i in input().split()]
E = [[] for _ in range(N + 1)]
for _ in range(M):
    a, b = [int(i) for i in input().split()]
    E[a].append(b)
    E[b].append(a)

visited = [False] * (N + 1)
visited[1] = True

def dfs(src, count):
    if count == N:
        return 1
    result = 0
    for dst in E[src]:
        if not visited[dst]:
            visited[dst] = True
            result += dfs(dst, count + 1)
            visited[dst] = False

    return result

print(dfs(1, 1))

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
template<class T,class U> inline bool chmin(T&x,U y){if(x>y){x=y;return true;}return false;}
template<class T,class U> inline bool chmax(T&x,U y){if(x<y){x=y;return true;}return false;}
#define fr(i,n) for(int i=0;i<(n);++i)
#define Fr(i,n) for(int i=1;i<=(n);++i)
#define ifr(i,n) for(int i=(n)-1;i>=0;--i)
#define iFr(i,n) for(int i=(n);i>0;--i)

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int a,b;
    cin>>a>>b;
    cout<<a*b<<endl;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
typedef long double LD; 
typedef long long ll; 
#define int ll 
#define ff(i,a,b) for (int i = a; i < b; i++) 
#define bf(i,a,b) for (int i = a; i >= b; i--) 
#define all(v) v.begin(),v.end() 
#define show(a) for(auto xyz:a)cout<<xyz<<" ";cout<<endl;
#define F first 
#define S second
#define pb push_back
#define mp make_pair
#define lb lower_bound   
#define ub upper_bound
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define one cout<<"-1"<<endl
#define pi 3.141592653589793238
#define mod 1000000007
#define intmx INT_MAX 
#define intmi INT_MIN

void solve(){
    int n;
    cin>>n;
    int a[n];
    ff(i,0,n)
    cin>>a[i];
    int gcd=a[0];
    ff(i,1,n){
        gcd=__gcd(gcd,a[i]);
    }
    int f=1;
    set<int> st;
    ff(j,0,n){
        int x=a[j];
        for(int i=1;i*i<=x;i++){
            if(x%i==0){
                int a=i;
                int b=x/i;
                if(a==b)
                b=1;
                if(a!=1 && st.find(a)!=st.end()){
                    f=0;
                    break;
                }
                if(b!=1 && st.find(b)!=st.end()){
                    f=0;
                    break;
                }
                if(a!=1)
                st.insert(a);
                if(b!=1)
                st.insert(b);
            }
        }
    }
    if(f)
    cout<<"pairwise coprime"<<endl;
    else if(gcd==1)
    cout<<"setwise coprime"<<endl;
    else
    cout<<"not coprime"<<endl;
}
signed main() {
    int t=1;
    //cin>>t;
    while(t--){
        solve();
    }
}


Measured memory_bytes: 58256
/// Bismillahir Rahmanir Rahim
/* Mohammad Morsalin
   Dept of ICE, NSTU
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ll long long
#define pb push_back
#define mp make_pair
#define endl "\n"
#define int long long
#define f0(n) for(int i=0;i<n;i++)
#define ms(x) memset(x,0,sizeof(x))
#define ms2d(x,m,n) memset(x, 0, sizeof(x[0][0]) * m * n)
#define uniq(vec) vec.resize(distance(vec.begin(),unique(vec.begin(),vec.end())))
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define pi pair<int,int>
#define tc(t) int t;cin>>t;while(t--)
#define bits(n) __builtin_popcount(n)
#define maxpq priority_queue<int>
#define minpq priority_queue<int, vector<int>, greater<int> >
#define ins insert
#define ALL(v) v.begin(),v.end()
#define highest(x) numeric_limits<x>::max()
#define lowest(x) numeric_limits<x>::min()
#define Inf INFINITY
#define minv(v) *min_element(v.begin(),v.end())
#define maxv(v) *max_element(v.begin(),v.end())
#define fi first
#define se second
#define PI acos(-1)
#define sz(a) (int)a.size();
#define IOS ios::sync_with_stdio(false);
using namespace std;
int gcd(int a, int b) { if (a == 0) return b; return gcd(b % a, a);}
typedef tree<pair<int, int>,null_type,less<pair<int, int>>,rb_tree_tag,tree_order_statistics_node_update> ordered_multiset;
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1};
int dx4[] = {0, 0, 1, -1};
int dy4[] = {1, -1, 0, 0};
const long long MOD = 1000000007;
double sq(double x) {return x*x;}
template<typename T>inline T Bigmod(T base, T power, T MOD){
    T ret=1;
    while(power)
    {
        if(power & 1)ret=(ret*base)%MOD;
        base=(base*base)%MOD;
        power>>=1;
    }
    return ret;
}

bool sortinrev(const pair<int,int> &a,
               const pair<int,int> &b)
{
       return (a.first > b.first);
}
signed main()
{
    IOS
    int n;
    cin>>n;
    int arr[n];
    int x=0;
    for(int i=0;i<n;i++){
        cin>>arr[i];
        x^=arr[i];
    }
    for(int i=0;i<n;i++){
        int ans=x^arr[i];
        cout << ans << " ";
    }
    cout << endl;
    return 0;
}
///Alhamdulillah



Measured memory_bytes: 5084