akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <algorithm>
#include <cassert>
#include <limits>
#include <numeric>
#include <type_traits>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <functional>
#include <utility>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <complex>

using namespace std;

typedef long long ll;
typedef vector<ll> vl;
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define REP(i,n)  FOR(i,0,n)
ll gcd(ll a, ll b) {
	if(a == 0){
		return b;
	} else if (b == 0){
		return a;
	} else {
	  if(a < b) return gcd(b, a);
	  ll r;
	  while ((r=a%b)) {
	    a = b;
	    b = r;
	  }
	  return b;
	}
}
int main(){
	string a, b;
	cin >> a >> b;
	if(a == "H"){
		if(b == "H"){
			cout << "H" << endl;
		} else {
			cout << "D" << endl;
		}
	} else {
		if(b == "H"){
			cout << "D" << endl;
		} else {
			cout << "H" << endl;
		}
	}
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int n,ans,a[10001],tmp;
int right(int p,int cr){
  int r=p,x=1;
  while(r+1<n&&a[r+1]==cr)r++,x++;
  if(x>=4) return 1;
  else return 0;
}
int left(int p,int cl){
  int l=p,x=1;
  while(l-1>=0&&a[l-1]==cl)l--,x++;
  if(x>=4) return 1;
  else return 0;
}
int mid(int pl,int pr,int cl,int cr){
  int l=pl,r=pr,x=2;
  if(pl==pr)x--;
  while(l-1>=0&&a[l-1]==cl)l--,x++;
  while(r+1<n&&a[r+1]==cr)r++,x++;
  if(x>=4) return 1;
  else return 0;
}
int ch(int p){
  int l=p,r=p,c=1;
  while(1){
    if(l<0&&r>=n||!c)break;
    c=0;
    int pl=a[l],pr=a[r];
    if(l>=0&&r<n&&a[l]==a[r]){
      if(mid(l,r,a[l],a[r])){
        while(l-1>=0&&a[l-1]==pl)l--,c++;
        while(r+1<n&&a[r+1]==pr)r++,c++;
        l--;r++;
      }
    }
    else if(r>=n){
      if(left(l,a[l])){
        while(l-1>=0&&a[l-1]==pl)l--,c++;
        l--;
      }
    }
    else if(l<0){
      if(right(r,a[r])){
        while(r+1<n&&a[r+1]==pr)r++,c++;
        r++;
      }
    }
  }
  return abs(l+1-0)+abs(n-r);
}
int main(){
  while(cin>>n,n){
    ans=114514;
    r(i,n)cin>>a[i];
    r(i,n)r(j,3){
      tmp=a[i];
      a[i]=j+1;
      ans=min(ans,ch(i));
      a[i]=tmp;
    }
    cout<<min(ans,n)<<endl;
  }
}

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

int num(int x){
	int ret=0;
  for(int i=1;i*i<x;i++){
  if(x%i==0)ret++;
  }
  return ret;
}

int main(){
	int n;cin>>n;
  int ans=0;
  for(int i=1;i<=n;i+=2){
  if(num(i)==4)ans++;
  }
  cout<<ans<<endl;
}

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

int main() {
  int N;
  cin >> N;
  vector<vector<int>> A(2+1, vector<int>(N+1));
  for (int i = 1; i <= 2; i++) for (int j = 1; j <= N; j++) cin >> A[i][j];
  for (int i = 1; i <= 2; i++) for (int j = 1; j <= N; j++) A[i][j] += A[i][j - 1];
  int ans = 0;
  for (int i = 1; i <= N; i++) ans = max(A[1][i] - A[1][0] + A[2][N] - A[2][i - 1], ans);
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define REP(i, a, b) for(int i = (a); i <= (b); i++)
#define PER(i, a, b) for(int i = (a); i >= (b); i--)
#define rep(i, a, b) for(int i = (a); i < (b); i++)
#define all(S) (S).begin(), (S).end()
#define pb push_back
#define mk make_pair
#define S second
#define F first
typedef long long ll;
typedef long double lf;
typedef pair<int, int> ii;
const int MOD = 1e9+7;
const int MAX =  2e5+5;
int N, ans, sum, a[MAX];

int main(int argc, char ** argv) {
	scanf("%d", &N);
	rep(i, 0, N) scanf("%d", a+i);
	rep(i, 0, N) sum = (sum+a[i])%MOD;
	rep(i, 0, N) {
		sum = (sum-a[i]+MOD)%MOD;
		ans = (ans+1LL*sum*a[i])%MOD;
	}
	printf("%d\n", ans);
	return 0;
}


Measured memory_bytes: 4588
# include <bits/stdc++.h>
# define sz(x) (int)((x).size())
# define F first
# define S second
# define pb push_back
# define ub upper_bound
# define lb lower_bound
# define all(x) x.begin(), x.end()
# define pqueue priority_queue
# define mset multiset
# define umap unordered_map
# define Speed() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
# define rep(i,n) for(int i=0;i<n;++i)
# define forn(i,n) for(int i=1;i<=n;++i)
# define lr(i,l,r) for(int i=l;(l>r?i>=r:i<=r);(l>r?--i:++i))

using namespace std;

template<class T> void umin(T &a,T b){a=min(a,b);}
template<class T> void umax(T &a,T b){a=max(a,b);}

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const int dx[]={1,0,-1,0,-1,-1,1,1},dy[]={0,1,0,-1,-1,1,-1,1}; 
const int mod = 1e9+7;
const ll N = 1e5+4;

ll n,ans;

void calc(ll x,ll a,ll b,ll c){
	if(x>n)return;
	if(a && b && c)ans++;
	calc(x*10+3,1,b,c);
	calc(x*10+5,a,1,c);
	calc(x*10+7,a,b,1);
}

void solve(){
	cin>>n;
	calc(0,0,0,0);
	cout<<ans;
}

int main(){
	Speed();
	int T=1; 
	//cin>>T;	
	while(T--)
		solve();
	return 0;
}

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

using namespace std;

int main() {
  int64_t H, W;
  cin >> H >> W;
  if (H == 1 || W == 1) {
    cout << 1 << endl;
    return 0;
  }

  int64_t h_even = (H + 1) / 2;
  int64_t h_odd = H - h_even;
  int64_t w_even = (W + 1) / 2;
  int64_t w_odd = W - w_even;
  cout << h_even * w_even + h_odd * w_odd << endl; 
  return 0;
}


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

#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define mp make_pair
#define pb push_back
#define fst first
#define snd second
typedef long long ll;
typedef pair<int,int> pii;

const int maxn=55;
int n;
int a[maxn],b[maxn];
bool dp[maxn];
vector<int>ans;

bool check(int i,int x){
	rep(j,51)dp[j]=0;
	dp[a[i]]=true;
	rep(p,int(ans.size())){
		rep(j,51)if(dp[j])dp[j%ans[p]]=true;
	}
	for(int p=x-1;p>=1;p--){
		rep(j,51)if(dp[j])dp[j%p]=true;
	}
	return dp[b[i]];
}

int main(){
	scanf("%d",&n);
	rep(i,n)scanf("%d",&a[i]);
	rep(i,n)scanf("%d",&b[i]);
	bool ok=true;
	rep(j,n)if(!check(j,51))ok=false;
	if(!ok){
		puts("-1");
		return 0;
	}
	for(int i=50;i>=1;i--){
		bool ok=true;
		rep(j,n)if(!check(j,i))ok=false;
		if(!ok)ans.pb(i);
	}
	ll res=0;
	rep(i,int(ans.size()))res+=(1LL<<ans[i]);
	printf("%lld\n",res);
	return 0;
}

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

int main(){
    int m, f, r;
    while(1){
        cin >> m >> f >> r;
        if(m == -1 && f == -1 && r == -1){
            break;
        }
        else if(m + f >= 80){
            cout << "A" << endl;
        }
        else if(65 <= m + f && m + f < 80){
            cout << "B" << endl;
        }
         else if((50 <= m + f && m + f < 65) || r >= 50){
            cout << "C" << endl;
        }
         else if(30 <= m + f && m + f < 50 && (m != -1 && f != -1)){
            cout << "D" << endl;
        }
         else if(30 > m + f || (m == -1 || f == -1)){
            cout << "F" << endl;
        }
    }
}


Measured memory_bytes: 3032
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll,ll>;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
const ll INF = 1LL<<60;
const int mod  = 998244353;

struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll a,b,c,d;cin>>a>>b>>c>>d;

    vector<vector<mint>> dp(c,vector<mint>(d,0));
    dp[a-1][b-1]=1;
    for(int i=a-1; i<c; i++){
        for(int j=b-1; j<d; j++){
            if(i==a-1){
                if(j==b-1)continue;
                dp[i][j]=dp[i][j-1]*a;
            }else{
                if(j==b-1)dp[i][j]=dp[i-1][j]*b;
                else{
                    dp[i][j]=dp[i][j-1]*(i+1)+dp[i-1][j]*(j+1)-dp[i-1][j-1]*i*j;
                }
            }
        }
    }
    cout<<dp[c-1][d-1].x<<endl;

    /*for(auto arr:dp){
        for(auto x:arr){
            cout<<x.x<<" ";
        }
        cout<<endl;
    }*/

    return 0;
}

Measured memory_bytes: 73612
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys
import string

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

H, W = list(map(int, sys.stdin.readline().split()))
S = np.array([list(sys.stdin.readline().rstrip()) for _ in range(H)])

counts = np.zeros((H + 2, W + 2), dtype=int)
for h in range(H):
    for w in range(W):
        if S[h][w] == '#':
            counts[h][w] += 1
            counts[h + 1][w] += 1
            counts[h + 2][w] += 1
            counts[h][w + 1] += 1
            counts[h + 2][w + 1] += 1
            counts[h][w + 2] += 1
            counts[h + 1][w + 2] += 1
            counts[h + 2][w + 2] += 1
c = counts[1:-1, 1:-1].astype(str)
c[S == '#'] = '#'
print('\n'.join(map(lambda r: ''.join(r), c)))


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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

map<ll, ll> prime_factorize(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] = 1;
    return res;
}

void Main() {
    ll N;
    cin >> N;
    cout << N << ": ";
    auto res = prime_factorize(N);
    vector<ll> ans;
    for (P p : res) {
        rep(j, p.second) {
            ans.push_back(p.first);
        }
    }
    rep(i, ans.size()) {
        if (i != ans.size() - 1) {
            cout << ans[i] << ' ';
        } else {
            cout << ans[i] << '\n';
        }
    }
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}



Measured memory_bytes: 3208
#include <bits/stdc++.h>
#include <math.h>
#define ALL(a)    a.begin(), a.end() 
#define rep(i, K, N)  for(long long int i = K; i < N; i++)
#define ll long long int
using namespace std;



int main() {
ll N, Ans = 0;cin >> N;
vector<ll> V(N);

rep(i, 0, N){cin >> V[i];}

sort(ALL(V));reverse(ALL(V));

if(N%2 == 1)Ans += V[N/2];

rep(i, 0, N/2){Ans += 2*V[i];}

Ans -= V[0];

cout << Ans;

}

Measured memory_bytes: 4840
#include <iostream>
#include <vector>
#include <queue>
#include <limits>

using namespace std;


template<typename W>
struct range_edge_graph {
    int n;
    struct edge { int to; W weight;};
    vector<vector<edge>> g;

    range_edge_graph(int n) : n(n) {
        g.resize(3*n);
        for (int i = 1; i < n; ++i) {
            int cl = i<<1|0, cr = i<<1|1;
            add_edge(i, cl, 0);
            add_edge(i, cr, 0);
            add_edge(cl+2*n, i+2*n, 0);
            add_edge(cr+2*n, i+2*n, 0);
        }
    }

    // map [3n, 4n) -> [n, 2n)
    void add_edge(int u, int v, W w) {
        if (3*n <= u) u -= 2*n;
        g[u].push_back({v, w});
    }

    // from [l1, r1) to [l2, r2)
    void add_edge(int l1, int r1, int l2, int r2, W w) {
        int idx = g.size();
        for (l1 += n, r1 += n; l1 < r1; l1 >>= 1, r1 >>= 1) {
            if (l1 & 1) add_edge((l1++)+2*n, idx, 0);
            if (r1 & 1) add_edge((--r1)+2*n, idx, 0);
        }
        vector<edge> node;
        for (l2 += n, r2 += n; l2 < r2; l2 >>= 1, r2 >>= 1) {
            if (l2 & 1) node.push_back({l2++, w});
            if (r2 & 1) node.push_back({--r2, w});
        }
        g.push_back(node);
    }

    vector<W> dijkstra(int s) {
        s += n;
        vector<W> dist(g.size(), numeric_limits<W>::max());
        dist[s] = 0;
        using P = pair<W, int>;
        priority_queue<P, vector<P>, greater<P>> que;
        que.emplace(0, s);
        while (!que.empty()) {
            P p = que.top();
            que.pop();
            int v = p.second;
            if (dist[v] < p.first) continue;
            for (edge& e : g[v]) {
                if (dist[e.to] > dist[v] + e.weight) {
                    dist[e.to] = dist[v] + e.weight;
                    que.emplace(dist[e.to], e.to);
                }
            }
        }
        vector<W> res(dist.begin() + n, dist.begin() + 2*n);
        return res;
    }
};

int main() {
  	ios::sync_with_stdio(false);
  	cin.tie(nullptr);
    int n, m;
    cin >> n >> m;
    range_edge_graph<long long> g(n);
    for (int i = 0; i < m; ++i) {
        int l, r, w;
        cin >> l >> r >> w;
        l--; r--;
        g.add_edge(l, r+1, l, r+1, w);
    }
    auto dist = g.dijkstra(0);
    cout << (dist[n-1] == numeric_limits<long long>::max() ? -1 : dist[n-1]) << '\n';
}


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

int main()
{
  int n;
  cin >> n;
  vector<long> l(n + 1);
  l.at(0) = 2;
  l.at(1) = 1;
  for (int i = 2; i <= n; i++) {
    l.at(i) = l.at(i - 1) + l.at(i - 2);
  }
  cout << l.at(n) << endl;
}


Measured memory_bytes: 256
#pragma comment(linker, "/stack:20000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")

#include<bits/stdc++.h>
/*#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/detail/standard_policies.hpp>*/

#define sz(s) (int)(s.size())
#define all(s) s.begin(), s.end()
#define rep(a, b, c) for(int a = b; a <= c; ++a)
#define per(a, b, c) for(int a = b; a >= c; --a)
#define _ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

using namespace std;
//using namespace __gnu_pbds;

typedef unsigned long long ull;
typedef long long ll;
/*typedef tree<pair<int, int>, 
null_type, less<pair<int, int>>, 
rb_tree_tag, tree_order_statistics_node_update>
ordered_set;*/
//find_by_order() order_of_key()

const double eps = 1e-7;
const int mod = 1e9+7, MXN = 5e5+17;
const int dx[] = {-1,-1,-1,0,0,0,1,1,1}, dy[] = {-1,0,1,-1,0,1,-1,0,1};

template<typename T>inline bool updmin(T &a, const T &b) {return a > b ? a = b,1 : 0;}
template<typename T>inline bool updmax(T &a, const T &b) {return a < b ? a = b,1 : 0;}

int h, w, n;
map<int, map<int, bool>>was;
map<int, map<int, bool>>used;
int X[MXN], Y[MXN], cnt[15];

int32_t main() { _
#ifdef DanQQQQQ
	freopen(".in","r",stdin);
	freopen(".out","w",stdout);
#endif
	cin >> h >> w >> n;
	rep(i,1,n) {
		cin >> X[i] >> Y[i];
		was[X[i]][Y[i]] = 1;
	}
	rep(i,1,n)
		rep(cx,X[i]-1,X[i]+1)
			rep(cy,Y[i]-1,Y[i]+1) {
				if(cx-1 < 1 || cx+1 > h) continue;
				if(cy-1 < 1 || cy+1 > w) continue;
				if(used[cx][cy]) continue;
				int res = 0;
				rep(j,0,8)
					res += was[cx+dx[j]][cy+dy[j]];
				used[cx][cy] = 1;
				++cnt[res];
			}
	int sum = 0;
	rep(i,0,9) sum += cnt[i];
	cout << (h-2)*1ll*(w-2)-sum << endl;
	rep(i,1,9) cout << cnt[i] << endl;
	return 0;
}

Measured memory_bytes: 235392
#[allow(unused_imports)]
use itertools::Itertools;
#[allow(unused_imports)]
use num::*;
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::*;
#[allow(unused_imports)]
use std::collections::*;

pub struct Graph {
  graph: Vec<Vec<usize>>,
  v: usize,
}

type Edge = (usize, usize);
impl Graph {
  pub const INF: usize = std::usize::MAX;

  pub fn new(edges: &[Edge], v: usize) -> Self {
    let mut graph = vec![Vec::new(); v];
    for &(u, v) in edges {
      graph[u].push(v);
      graph[v].push(u);
    }
    Self { graph, v }
  }

  pub fn new_directed(edges: &[Edge], v: usize) -> Self {
    let mut graph = vec![Vec::new(); v];
    for &(u, v) in edges {
      graph[u].push(v);
    }
    Self { graph, v }
  }

  pub fn add_directed_edge(&mut self, e: Edge) {
    self.graph[e.0].push(e.1);
  }

  pub fn add_edge(&mut self, e: Edge) {
    self.graph[e.0].push(e.1);
    self.graph[e.1].push(e.0);
  }

  pub fn shortest_path(&self, start: usize) -> Vec<usize> {
    let mut visited = std::collections::HashSet::new();
    let mut cost_list = vec![Self::INF; self.v];
    let mut que = std::collections::VecDeque::new();
    cost_list[start] = 0;
    visited.insert(start);
    que.push_back(start);
    while let Some(u) = que.pop_front() {
      for &v in &self.graph[u] {
        if visited.contains(&v) {
          continue;
        }
        visited.insert(v);
        let new_cost = cost_list[u] + 1;
        cost_list[v] = new_cost;
        que.push_back(v);
      }
    }
    cost_list
  }
}

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

  let mut edges = Vec::new();
  for i in 0..n {
    let u = i;
    let v = av[i];
    edges.push((u, v));
  }
  let graph = Graph::new_directed(&edges, n);
  let d = graph.shortest_path(0);
  let mut max = 0;
  let mut max_pos = 0;
  for i in 0..n {
    if d[i] < Graph::INF && d[i] > max {
      max = d[i];
      max_pos = i;
    }
  }
  if k <= max {
    let mut res = 0;
    for i in 0..n {
      if d[i] == k {
        res = i + 1;
        break;
      }
    }
    println!("{}", res);
    std::process::exit(0);
  }

  let rest = k - (max + 1);
  let p = max - d[av[max_pos]] + 1;
  let pos = rest % p + d[av[max_pos]];
  // println!("{} {} {}", rest, p, pos);
  for i in 0..n {
    if d[i] == pos {
      println!("{}", i + 1);
      std::process::exit(0);
    }
  }
}


Measured memory_bytes: 24052
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <unordered_map>

template <class T>
inline void read(T &x)
{
    x = 0;
    int f = 0;
    char ch = getchar();
    while (!isdigit(ch))    { f |= ch == '-'; ch = getchar(); }
    while (isdigit(ch))     { x = (x << 1) + (x << 3) + (ch ^ 48); ch = getchar(); }
    x = f ? -x : x;
    return;
}

std::unordered_map<int, int> mp;
int n;

int main()
{
    read(n);
    for (int i = 1, x; i <= n; ++i) 
    {
        read(x);
        ++mp[x];
        if (mp[x] > 1)  
        {
            std::cout << "NO" << std::endl;
            return 0;
        }
    }
    std::cout << "YES" << std::endl;
    return 0;
}

Measured memory_bytes: 8520
#include<iostream>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<utility>
#include<algorithm>
using namespace std;
#define int long long
#define vel vector<int>
#define vvel vector<vel>
#define vvvel vector<vvel>
#define veb vector<bool>
long long rui(long long a, long long n, long long p) {
	if (n == 0) { return 1; }
	int x = rui(a, n / 2, p);
	x = (x*x) % p;
	if (n % 2 == 1) {x = (x*a) % p;}
	return x;
}
signed main() {
	int n; cin >> n;
	vel c(n);
	for (int i = 0; i < n; i++) {
		cin >> c[i];
	}
	int p = 1000; p *= p * p; p += 7;
	vel qc(1,c[0]);
	for (int i = 1; i < n; i++) { if (c[i] != c[i - 1]) { qc.push_back(c[i]); } }
	c = qc;
	n = c.size();
	vel dp(n + 1, 1);
	vel counter(20 * 10000 + 1, 0);
	for (int i = 1; i <= n; i++) {
		dp[i] = dp[i - 1];
		dp[i] += counter[c[i - 1]]; dp[i] = dp[i] % p;
		counter[c[i - 1]] += dp[i - 1]; counter[c[i - 1]] = counter[c[i - 1]] % p;
	}
	cout << dp[n] << endl;
	return 0;
}

Measured memory_bytes: 7108
"use strict";

const main = (input) => {
    const spi = input.split('\n');
    let [a,b,c,k] = spi[0].split(' ').map(e => Number(e));

    let ans = 0;

    const ak = Math.min(a, k);
    ans = ak;
    k -= Math.min(a, ak);

    if (k > 0)
        k -= Math.min(b, Math.min(b, k));

    if (k > 0) {
        const ck = Math.min(c, k);
        ans -= ck;
    }

    console.log(ans);
};

main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 29676
#include<iostream>
#include<queue>
using namespace std;
typedef long long ll;
priority_queue<int,vector<int>,less<int> > red,gre,cls;//大顶堆 
priority_queue<int,vector<int>,greater<int> >ans;//小顶堆 
int main(){
	int x,y,a,b,c,t;
	cin>>x>>y>>a>>b>>c;
	for(int i=0;i<a;i++){
		cin>>t;
		red.push(t);
	}
	for(int i=0;i<b;i++){
		cin>>t;
		gre.push(t);
	}
	for(int i=0;i<c;i++){
		cin>>t;
		cls.push(t);
	}
	for(int i=0;i<x;i++){
		t = red.top();
		red.pop();
		ans.push(t); 
	}
	for(int i=0;i<y;i++){
		t = gre.top();
		gre.pop();
		ans.push(t); 
	}
	for(int i=0;i<c;i++){
		if(ans.top()<cls.top()){
			t = cls.top();
			cls.pop();
			ans.pop();
			ans.push(t);
		}
	}
	ll res=0;
	while(!ans.empty()){
		res += ans.top();
		ans.pop();
	}
	cout<<res<<endl; 
}

Measured memory_bytes: 2552
import java.util.*;
import java.io.*;
import java.text.*;
public class Main{
    //SOLUTION BEGIN
    //Into the Hardware Mode
    void pre() throws Exception{}
    void solve(int TC) throws Exception{
        int n = ni(), ans = 0;
        int[] p = new int[n];
        for(int i = 0; i< n; i++)p[i] = ni()-1;
        for(int i = 1; i< n-1; i++)
            if(p[i-1]+p[i+1]+p[i] - Math.max(p[i-1], Math.max(p[i], p[i+1])) - Math.min(p[i-1], Math.min(p[i], p[i+1])) == p[i])ans++;
        
        pn(ans);
    }
    //SOLUTION END
    void hold(boolean b)throws Exception{if(!b)throw new Exception("Hold right there, Sparky!");}
    long IINF = (long)1e18, mod = (long)1e9+7;
    final int INF = (int)1e9, MX = (int)2e5+5;
    DecimalFormat df = new DecimalFormat("0.00000000000");
    double PI = 3.141592653589793238462643383279502884197169399, eps = 1e-6;
    static boolean multipleTC = false, memory = false;
    FastReader in;PrintWriter out;
    void run() throws Exception{
        in = new FastReader();
        out = new PrintWriter(System.out);
        //Solution Credits: Taranpreet Singh
        int T = (multipleTC)?ni():1;
        pre();for(int t = 1; t<= T; t++)solve(t);
        out.flush();
        out.close();
    }
    public static void main(String[] args) throws Exception{
        if(memory)new Thread(null, new Runnable() {public void run(){try{new Main().run();}catch(Exception e){e.printStackTrace();}}}, "1", 1 << 28).start();
        else new Main().run();
    }
    long gcd(long a, long b){return (b==0)?a:gcd(b,a%b);}
    int gcd(int a, int b){return (b==0)?a:gcd(b,a%b);}
    int bit(long n){return (n==0)?0:(1+bit(n&(n-1)));}
    void p(Object o){out.print(o);}
    void pn(Object o){out.println(o);}
    void pni(Object o){out.println(o);out.flush();}
    String n()throws Exception{return in.next();}
    String nln()throws Exception{return in.nextLine();}
    int ni()throws Exception{return Integer.parseInt(in.next());}
    long nl()throws Exception{return Long.parseLong(in.next());}
    double nd()throws Exception{return Double.parseDouble(in.next());}

    class FastReader{
        BufferedReader br;
        StringTokenizer st;
        public FastReader(){
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastReader(String s) throws Exception{
            br = new BufferedReader(new FileReader(s));
        }

        String next() throws Exception{
            while (st == null || !st.hasMoreElements()){
                try{
                    st = new StringTokenizer(br.readLine());
                }catch (IOException  e){
                    throw new Exception(e.toString());
                }
            }
            return st.nextToken();
        }

        String nextLine() throws Exception{
            String str = "";
            try{   
                str = br.readLine();
            }catch (IOException e){
                throw new Exception(e.toString());
            }  
            return str;
        }
    }
}

Measured memory_bytes: 21204
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
''' 
------------------------
author : iiou16
------------------------
'''
# import itertools

def main():
    N = int(input())
    # seq = list(itertools.permutations(ll))
    # print(seq)
    # modsum = []
    # for s in seq:
    #     tmp = []
    #     for i in range(len(s)):
    #         tmp.append((i+1) % s[i])
    #     modsum.append(sum(tmp))
    # print(max(modsum))

    # i+1になるように並び替えたときが一番大きくなる
    # ex 4のときは(2,3,4,1)とすればあまりが(1,2,3,0)
    print(N * (N-1) // 2)

if __name__ == '__main__':
    main()

Measured memory_bytes: 2940
//
// Created by Myabu on 2020/01/28.
//

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <utility>
#include <math.h>
#include <stack>
#include <queue>
#include <cstdio>
#include <numeric>
#include <iomanip>

using namespace std;


int main(void){
    int A,B,C,D;
    cin>>A>>B>>C>>D;

    cout<<min(A,B)+min(C,D)<<endl;


    return 0;
}

Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

class Main{

	static int N;
	static int M;
	static 		ArrayList<ArrayList<Integer>> map;
	static boolean[] used;
	static int f = 0;
	static int s = 0;

	static int mindis = 1000000000;
	static ArrayList<Integer> saitan;




	public static void main(String[] args) {


		Scanner sc = new Scanner(System.in);			//文字の入力
		int[] data = new int[3];
		for(int i = 0;i <3;i++){
			data[i] = sc.nextInt();
		}
		Arrays.sort(data);
		System.out.println(data[0]+data[1]);
		
	}

}




Measured memory_bytes: 24020
#include<cstdio>
#include<iostream>
#include <string>
#include<algorithm>
using namespace std;

int main()
{
    int a,b;
    cin >> a >> b;
    
    if(a==b)
    {
        cout << a+b;
    }
    else if(a>b)
    {
        cout << a + a-1;
    }
    else if(b>a)
    {
        cout << b + b-1;
    }
    
    
}




Measured memory_bytes: 3104
//#pragma GCC optimize ("-O3","unroll-loops")
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<unordered_map>
#include<unordered_set>
#include<time.h>
#include <random>

using namespace std;

#define REP(i, n) for(int i = 0;i < n;++i)
#define REPR(i, n) for(int i = n-1;i >= 0;--i)
#define FOR(i, m, n) for(int i = m;i < n;++i)
#define FORR(i, m, n) for(int i = m-1;i >= n;--i)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end())
#define ll long long
#define pb(a) push_back
#define print(x) cout<<(x)<<'\n'
#define pe(x) cout<<(x)<<" "
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define lb(v,n) lower_bound(v.begin(), v.end(), n)
#define ub(v,n) upper_bound(v.begin(), v.end(), n)
#define int long long
#define all(x) (x).begin(), (x).end()
#define print_space(v) REP(i,v.size())cout << v[i] << ((i == v.size() - 1) ? "\n" : " ")

template<typename T1, typename T2> inline void chmin(T1 & a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
typedef pair<int, int>P;
const int MOD = 998244353; const int MAX = 200020;
const double pi = acos(-1); const double EPS = 1e-12;
const ll INF = 1e18;


bool comp(const P & p1, const P & p2) {
	if (p1.second == p2.second)return p1.first < p2.first;
	else return p1.second < p2.second;
}
void solve() {
	int N; cin >> N;
	vector<P>v(N);
	vector<int>A(N), B(N);
	REP(i, N) {
		cin >> A[i];
	}
	REP(i, N) {
		cin >> B[i];
		v[i] = { A[i],B[i] };
	}
	sort(all(v), comp);
	//print("here");
	VSORT(A);
	VSORT(B);
	REP(i, N) {
		if (A[i] > B[i]) {
			print("No"); return;
		}
	}
	REP(i, N - 1) {
		if (A[i + 1] <= B[i]) {
			print("Yes"); return;
		}
	}
	//print("here");
	set<P>st;
	vector<int>vec(N);
	REP(i, N) {
		st.insert({ v[i].first,i });
		vec[i] = v[i].first;
	}
	REP(i, N - 1) {
		auto itr = st.begin();
		P now = *itr;
		//pe(now.first);
		//print(now.second);
		if (now.second <= i) {
			print("Yes"); return;
		}
		int id = now.second;
		st.erase(itr);
		int val = vec[i];
		auto itr2 = st.find({ val,i });
		vec[id] = val;
		st.erase(itr2);
		st.insert({ val,id });
	}
	print("No");
}


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

	solve();
}




Measured memory_bytes: 10368
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T, class U> using Pa = pair<T, U>;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;

const int MAX = 500001, MS = 2;
const ll mod[] = {999999937LL, 1000000007LL}, base = 9973;
struct rolling_hash {
    //全て開区間であることに注意
    int n;
    vector<ll> hs[MS], pw[MS];
    rolling_hash(){}
    rolling_hash(const string &s) {
        n = s.size();
        for (int i = 0; i < MS; i++) {
            hs[i].assign(n+1,0);
            pw[i].assign(n+1,0);
            hs[i][0] = 0;
            pw[i][0] = 1;
            for (int j = 0; j < n; j++) {
                pw[i][j+1] = pw[i][j]*base%mod[i];
                hs[i][j+1] = (hs[i][j]*base+s[j])%mod[i];
            }
        }
    }
    ll hash(int l, int r, int i) { return ((hs[i][r]-hs[i][l]*pw[i][r-l])%mod[i]+mod[i])%mod[i]; }
    bool match(int l1, int r1, int l2, int r2) {
        bool ret = 1;
        for (int i = 0; i < MS; i++) ret &= hash(l1,r1,i)==hash(l2,r2,i);
        return ret;
    }
    bool match(int l, int r, ll h[]) {
        bool ret = 1;
        for (int i = 0; i < MS; i++) ret &= hash(l,r,i)==h[i];
        return ret;
    }
};

int main(){
    string S;
    cin >> S;
    int N = S.size();
    rolling_hash hash(S);
    vec<int> L(N+1,1),R(N+1,1);
    int mi = N;
    for(int i=1;i<=N;i++){
        bool ok = true;
        for(int j=i;i+j<=N;j+=i){
            bool y = hash.match(0,i,j,j+i);
            ok &= y;
            L[i+j] &= !ok;
        }
        if(ok && N%i==0){
            mi = min(mi,i);
        }
        ok = true;
        for(int j=N-2*i;j>=0;j-=i){
            bool y = hash.match(N-i,N,j,j+i);
            ok &= y;
            R[j] &= !ok;
        }
    }
    if(mi==1){
        cout << N << "\n";
        cout << 1 << "\n";
        return 0;
    }else if(mi==N){
        cout << 1 << "\n";
        cout << 1 << "\n";
        return 0;
    }
    int ans = 0;
    for(int i=1;i<N;i++){
        ans += L[i] && R[i];
//        cerr << L[i] << " " << R[i] << "\n";
    }
    cout << 2 << "\n";
    cout << ans << "\n";
}

Measured memory_bytes: 23552
use std::io::{stdin, Read};

fn main() {
    let mut s = String::new();
    stdin().read_line(&mut s).unwrap();
    let t = s.trim().parse::<i64>().unwrap();
    if t < 30 {
        println!("No");
    } else {
        println!("Yes");
    }
}


Measured memory_bytes: 2124
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <stdbool.h>
#include <math.h>
#include <time.h>
#define ll long long
#define min(a, b) ((a) > (b) ? (b) : (a))
#define max(a, b) ((a) > (b) ? (a) : (b))
#define miin(a, b, c) min((a), min((b), (c)))
#define maax(a, b, c) max((a), max((b), (c)))
#define mod 1000000007

int a,b,n,m,h[111111],nyaa[111111], nyan=0;

main(){
    scanf("%d%d", &n, &m);
    for(int i=0; i<n; i++){
        scanf("%d", &h[i]);
        nyaa[i] = 1;
    }
    for(int i=0; i<m; i++){
        scanf("%d%d", &a, &b);
        a--;b--;
        nyaa[a] *= (h[a] > h[b]);
        nyaa[b] *= (h[b] > h[a]);
    }
    for(int i=0; i<n; i++){
        nyan += nyaa[i];
    }
    printf("%d\n", nyan);
    return 0;
}

Measured memory_bytes: 2512
#include <bits/stdc++.h>
 
#define ll long long
using namespace std;
void solve()
{
    int N;
    cin>>N;
    string s;
    vector<pair<int,int>> A(N);
    for(auto &a: A)
    {
        cin>>s;
        ll x = 0;
        int num = 0;
        bool dec = false;
        for(char c: s)
        {
            if(c=='.')
                dec=true;
            else
            {
                if(dec)
                    ++num;
                x*=10;
                x+=c-'0';
            }
        }
        while(num!=9)
        {
            x*=10;
            ++num;
        }
        a.first=a.second=0;
        //cerr<<x<<endl;
        while(x%2==0)
        {
            x/=2;
            ++a.first;
        }
        while(x%5==0)
        {
            x/=5;
            ++a.second;
        }
    }
    sort(A.begin(), A.end());
    //for(auto a: A)
        //cerr<<a.first<<" "<<a.second<<endl;
    vector<int> B(19,0);
    int curr = N-1;
    ll ans = 0;
    for(int i=0; i<N; ++i)
    {
        while(curr>=0 && A[curr].first+A[i].first>=18)
        {
            int z = min(A[curr].second,18);
            ++B[z];
            --curr;
        }
        for(int j=max(0,18-A[i].second); j<=18; ++j)
            ans+=B[j];
    }
    for(int i=0; i<N; ++i)
        if(A[i].first>=9 && A[i].second>=9)
            --ans;
    ans/=2;
    cout<<ans<<endl;
}
 
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
        solve();
 
		
	return 0;
}

Measured memory_bytes: 4760
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e5;
const ll mod=1e9+7;
int main()
{
    int n;
    while(cin>>n)
    {
        if(n<1200)
        {
            puts("ABC");
        }
        else if(n<2800)
        {
            puts("ARC");
        }
        else
        {
            puts("AGC");
        }
    }
    return 0;
}

Measured memory_bytes: 256
//
// ?????????
//
#include <stdio.h>

int main(){
        long  a, b;
        char line[30];

        fgets(line, sizeof(line), stdin );
        sscanf(line, "%ld %ld", &a, &b );

        printf("%ld %ld %lf\n", a / b, a % b, (double)a / (double)b );


        return 0;
}

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

#define fast ios_base::sync_with_stdio(false),cin.tie(NULL)
#define ldb long double 
#define db double
#define int long long

#define fr first
#define se second
#define lb lower_bound 
#define ub upper_bound 
#define pb push_back
#define mpr make_pair

#define pi pair<int,int>
#define pdb pair<db,db>
#define pldb pair<ldb,ldb>

#define vi vector<int>
#define vdb vector<db>
#define vldb vector<ldb>
#define vpi vector< pi >

#define mi map<int,int>
#define mdb map<db,db>
#define mldb map<ldb,ldb>


#define forr(a,b) for (int i = (a); i < (b); ++i)
#define rrof(a,b) for (int i = (b)-1; i >= (a); --i)

#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)

const int md = 1e9+7;
const int MX = 2e5+5;
const int INF = 1e18; 
const ldb PI = 4*atan((ldb)1);

int power_md(int a,int n)
{
 int res=1;
 while(n)
{
 if(n%2)
  res=(res%md*a%md)%md;
  a=(a%md*a%md)%md;
  n/=2;
}
res%=md;
return res;
}

int power(int a,int n)
{
 int res=1;
 while(n)
{
 if(n%2)
  res*=a;
  a=a*a;
  n/=2;
}
return res;
}

int abst(int a)
{
 return ((a<0)?(-1*a):(a));
}

class cmp_set{
public:
	bool operator() (int a, int b){
		return a > b;
	}
};

vector<string> vec_splitter(string s) {
	s += ',';
	vector<string> res;
	while(!s.empty()) {
		res.push_back(s.substr(0, s.find(',')));
		s = s.substr(s.find(',') + 1);
	}
	return res;
}
void debug_out(
vector<string> __attribute__ ((unused)) args,
__attribute__ ((unused)) int idx, 
__attribute__ ((unused)) int LINE_NUM) { cerr << endl; } 
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
	if(idx > 0) cerr << ", "; else cerr << "Line(" << LINE_NUM << ") ";
	stringstream ss; ss << H;
	cerr << args[idx] << " = " << ss.str();
	debug_out(args, idx + 1, LINE_NUM, T...);
}
#ifdef XOX
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
#else
#define debug(...) 42
#endif


int dp[100005][2];
int n;
int arr[100005];

int fun(int i,int prev)
{
    if(i==n)
    {
        if(prev==0)
         return arr[n];
         else
          return (-arr[n]);
    }
    if(dp[i][prev]!=-1)
     return dp[i][prev];
    int res=-1e15;
    if(prev==0)
    {
      res=max(res,fun(i+1,0)+arr[i]);
      res=max(res,fun(i+1,1)-arr[i]);  
    }
    else
    {
      res=max(res,fun(i+1,0)-arr[i]);
      res=max(res,fun(i+1,1)+arr[i]);  
    }
    return dp[i][prev]=res;
}

int32_t main()
{
    fast;
    memset(dp,-1,sizeof(dp));
    cin>>n;
    for(int i=1;i<=n;i++)
     cin>>arr[i];
    int res=fun(1,0);
    cout<<res<<"\n";
    return 0;
}

Measured memory_bytes: 7296
# coding: utf-8

import sys
import math
import collections
import itertools
INF = 10 ** 13
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def lcm(x, y) : return (x * y) // math.gcd(x, y)
def I() : return int(input())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def LS() : return input().split()
def RS(N) : return [input() for _ in range(N)]
def LRS(N) : return [input().split() for _ in range(N)]
def PL(L) : print(*L, sep="\n")
def YesNo(B) : print("Yes" if B else "No")
def YESNO(B) : print("YES" if B else "NO")

N, K = LI()
S = input()

nums = []
now = 1
cnt = 0
for s in S:
    if s == str(now):
        cnt += 1
    else:
        now = 1 - now
        nums.append(cnt)
        cnt = 1
if cnt != 0:
    nums.append(cnt)
if now == 0:
    nums.append(0)

C = [0] * (len(nums)+1)
for i in range(len(nums)):
    C[i+1] = C[i] + nums[i]

ans = 0
m = 2 * K + 1
for i in range(0, max(len(nums)-m+1, 1), 2):
    m = min(m, len(nums))
    ans = max(ans, C[i+m] - C[i])

if len(nums) != 1:
    print(ans)
else:
    print(nums[0])


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

int main(){
  int N = 0; //問題数
  cin >> N;
  vector<int> T(N);
  int sum = 0;
  
  for (int i = 0; i < N; i++){
    cin >> T.at(i);
    sum += T.at(i);
  }
  int M = 0;//ドリンク数
  cin >> M;
  vector<int> P(M); 
  vector<int> X(M);
  for (int i = 0; i < M; i++){
    cin >> P.at(i) >> X.at(i);
    cout << sum -T.at(P.at(i)-1) + X.at(i) << endl;
  }
}

Measured memory_bytes: 256
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    from collections import defaultdict, deque

    N, M = map(int, readline().split())

    edge = defaultdict(list)

    for _ in range(M):
        a, b = map(int, readline().split())
        edge[a].append(b)
        edge[b].append(a)

    first = 1
    second = edge[1][0]

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

    que = deque()
    que.append(first)

    path1 = []
    path2 = []

    flag = True

    while flag:
        u = que.popleft()
        path1.append(u)
        flag = False
        for v in edge[u]:
            if not visited[v]:
                visited[v] = True
                que.append(v)
                flag = True
                break

    que = deque()
    que.append(second)
    flag = True

    while flag:
        u = que.popleft()
        path2.append(u)
        flag = False
        for v in edge[u]:
            if not visited[v]:
                visited[v] = True
                que.append(v)
                flag = True
                break

    print(len(path1) + len(path2))
    print(*path1[::-1], *path2)


if __name__ == '__main__':
    main()


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

int main( void )
{
    int a, b;
    cin >> a >> b;
    if ( a == b )
    {
        cout << "Draw";
    }
    else if ( a == 1 )
    {
        cout << "Alice";
    }
    else if ( b == 1 )
    {
        cout << "Bob";
    }
    else if ( a > b )
    {
        cout << "Alice";
    }
    else
    {
        cout << "Bob";
    }

    return 0;
}


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

typedef long long ll;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int k,x;
    cin>>k>>x;
    if(k*500>=x)
    {
        cout<<"Yes"<<endl;
    }
    else
    {
        cout<<"No"<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split(" ")))
ball_count = []
for i in range(0, N):
	ball_count.append(0)

for i in A:
	ball_count[i - 1] += 1

all_pair = 0
for i in ball_count:
	all_pair += i * (i - 1) // 2

for i in A:
	print(all_pair - (ball_count[i - 1] - 1))

Measured memory_bytes: 26012
//@sakshjha
#include<bits/stdc++.h>
using namespace std;
#define ll  long long int
#define ld long double
#define IOS ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pi 3.14159265358979
const ll MOD = 1000000000;
const ll N=100005;
int main()
{
    IOS
    ll r;
    cin>>r;
    ld ans=2.0*pi;
    ans*=r;
    cout<<fixed<<setprecision(5)<<ans;
    return 0;
}


Measured memory_bytes: 3804
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int x = sc.nextInt();
    int a = sc.nextInt();

    if(x < a) {
      System.out.println("0");
    } else if (x >= a) {
      System.out.println("10");
    }
  }
}

Measured memory_bytes: 21972
#include <stdio.h>

int main(void)
{
  int gyo, retu;
  int i, j;
  int Agyoretu[101][101];
  int bgyoretu[101];
  int tmp = 0;
  int answer[101] = {0};

  scanf("%d %d", &gyo, &retu);


  
  for(i = 0;i < gyo;i++){
    for(j = 0;j < retu;j++){
      scanf("%d ", &Agyoretu[i][j]);
    }
  }

  for(i = 0;i < retu;i++){
    scanf("%d ", &bgyoretu[i]);
  }
 
  for(i = 0;i < gyo;i++){
    tmp = 0;
    for(j = 0;j < retu;j++){
      tmp += Agyoretu[i][j] * bgyoretu[j];
    }
    answer[i] = tmp;
  }

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

  return 0;
}

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

    void solve() {
        ll n;
        cin >> n;
        ll a[n];
        for(ll i = 0; i < n; i++) cin >> a[i];
        ll sum = 0, cnt = 0, sum1=0,cnt1=0;
        for(ll i = 0; i < n; i++){
            sum+=a[i];
            if(i%2 == 0){
                if(sum > 0) continue;
                else cnt += (1-sum), sum = 1;
            } else {
                if(sum < 0) continue;
                else cnt += (sum+1), sum = -1;
            }
        }
        for(ll i = 0; i < n; i++){
            sum1+=a[i];
            if(i%2 == 1){
                if(sum1 > 0) continue;
                else cnt1 += (1-sum1), sum1 = 1;
            } else {
                if(sum1 < 0) continue;
                else cnt1 += (sum1+1), sum1 = -1;
            }
        }
        cout << min(cnt1, cnt) << endl;
    }

    int main() {
      cin.sync_with_stdio(0); cin.tie(0);
      cin.exceptions(cin.failbit);
      //ll ti;   cin >> ti;  while(ti--)
      solve();
      return 0;
    }


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin>>s;
  string t=s;
  reverse(s.begin(),s.end());
  int count=0;
  for(int i=0;i<s.size();i++){
    if(t.at(i)!=s.at(i))
      count++;
  }
  cout<<count/2<<endl;
}

Measured memory_bytes: 256
#include "iostream"
#include "algorithm"
using namespace std;

int main() {
	int n,sum=0,ave;
	int a[100];
	int ans[2];
	ans[0] = 0;
	ans[1] = 0;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		sum += a[i];
	}
	ave = sum / n;
	for (int i = 0; i < n; i++) {
		ans[0] += (a[i] - ave)*(a[i] - ave);
	}
	for (int i = 0; i < n; i++) {
		ans[1] += (a[i] - (ave + 1))*(a[i] - (ave + 1));
	}
	sort(ans, ans + 2);
	cout << ans[0] << endl;
	return 0;
}

Measured memory_bytes: 256
import java.io.*;

public class Main {
    public static void main(String[] args) {
        int n;
        int m;


        try (InputScanner is = new InputScanner(System.in)) {
            n = is.ni();
            m = is.ni();
        }
        if(n== m){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }

    //-------------------------------------------------------------------
    public static class InputScanner implements Closeable {
        private final BufferedReader br;
        private String[] element;
        private int elementIndex;

        public InputScanner(InputStream is) {
            this.br = new BufferedReader(new InputStreamReader(is));
        }

        public String next() {
            return this.nextElement();
        }

        //next int
        public int ni() {
            return Integer.parseInt(this.nextElement());
        }

        //next long
        public long li() {
            return Long.parseLong(this.nextElement());
        }

        //next int array
        public int[] nia(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = this.ni();
            }
            return arr;
        }

        private void readLine() {
            try {
                this.element = this.br.readLine().split("\\s");
            } catch (IOException e) {
                e.printStackTrace();
            }
            this.elementIndex = 0;
        }

        private String nextElement() {
            if (!hasElement()) {
                this.readLine();
            }
            return this.element[this.elementIndex++];
        }

        private boolean hasElement() {
            return this.element != null && this.element.length > this.elementIndex;
        }

        @Override
        public void close() {
            if (this.br != null) {
                try {
                    this.br.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
//-------------------------------------------------------------------
}


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

int main(void){
  
  int A, B, nowNum, time = 1;
  cin >> A;
  cin >> B;
  nowNum = A;
  
  if(B == 1){
    cout << 0 << endl;
  }
  else{
    while(B > nowNum){
      nowNum += (A - 1);
      time++;
    }
    cout << time << endl;
  }
  
  return 0;
}

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


int main(){
  string S, T;
  cin >> S >> T;

  if (T.substr(0,S.size())==S && T.size()==S.size()+1){
    cout << "Yes" << endl;
  }
  else cout << "No" << endl; 
}
 

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
int n,a[1000100],vis[1000100];
int v[1000100],pws,primes[78498],tot;
int ihateabc[100100],too;
void linear(int N){
	memset(v,0,sizeof(v));
	tot=0;
	for(int i=2;i<=N;i++){
		if(v[i]==0){v[i]=i;primes[tot]=i;tot++;}
		for(int j=0;j<tot;j++){
			if(primes[j]>v[i]||primes[j]>(N/i)) break;
			v[i*primes[j]]=primes[j];
		}
	}
}
int main(){
	#ifdef FILIN
		#ifndef DavidDesktop
			freopen(FILIN,"r",stdin);
			freopen(FILOUT,"w",stdout);
		#endif
	#endif
	linear(1000);
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	int go=a[1];
	for(int i=1;i<=n;i++) go=__gcd(a[i],go);
	if(go!=1){
		puts("not coprime");
		return 0;
	}
	pws=0;
	sort(a+1,a+n+1);
	for(int i=2;i<=n;i++){
		if(a[i]==a[i-1]&&a[i]!=1){
			puts("setwise coprime");
			return 0;
		}
	}
	too=0;
	for(int i=1;i<=n;i++){
		if(a[i]!=a[i-1]&&a[i]!=1){
			too++;
			ihateabc[too]=a[i];
		}
	}
	n=too;
	for(int i=1;i<=too;i++) a[i]=ihateabc[i];
	reverse(a+1,a+n+1);
	if(n>78498){
		puts("setwise coprime");
		return 0;
	}
	for(int i=1;i<=n;i++){
		for(int j=0;j<tot;j++){
			if(primes[j]*primes[j]>a[i]) continue;
			if(a[i]%primes[j]==0){
				if(vis[primes[j]]){
					puts("setwise coprime");
					return 0;
				}
				vis[primes[j]]=1;
				while(a[i]%primes[j]==0)
					a[i]/=primes[j];
			}
		}
		if(a[i]!=1){
			if(vis[a[i]]){
				puts("setwise coprime");
				return 0;
			}
			vis[a[i]]=1;
		}
	}
	puts("pairwise coprime");
	return 0;
}


Measured memory_bytes: 12272