akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <cmath>
#include <set>
#include <queue>
#include <map>
#include <cstdio>
#include <cstring>
#include <string>
#include <stack>
#include <algorithm>
#include <limits.h>
#include <bits/stdc++.h>
#define fw(x) freopen("x.txt","w",stdout)
#define For(i,a,b,c) for(int i = a;i < b;i+=c)
#define REP(i,n) for(int i = 0;i < n;++i)
#define REP1(i,n) for(int i = 1; i<=n;i++)
#define mem(a,s) memset(a,s,sizeof a)
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL)
#define pf printf
#define sc scanf
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define all(v) v.begin(),v.end()
#define vii vector<int>
#define vll vector<ll>
#define vss vector<string>
#define debug(x)  cout<<#x"="<<(x)<<endl
#define pb push_back


using namespace std;


// moves

//int dx[]= {0,0,1,-1};/*4 side move*/
//int dy[]= {-1,1,0,0};/*4 side move*/
//int dx[]= {1,1,0,-1,-1,-1,0,1};/*8 side move*/
//int dy[]= {0,1,1,1,0,-1,-1,-1};/*8 side move*/
//int dx[]={1,1,2,2,-1,-1,-2,-2};/*knight move*/
//int dy[]={2,-2,1,-1,2,-2,1,-1};/*knight move*/


//big_mod

//ll bigmod(ll a,ll b,ll m)
//{if(b == 0) return 1%m;ll x = bigmod(a,b/2,m);x = (x * x) % m;if(b % 2 == 1) x = (x * a)% m;return x;}
//ll BigMod(ll B,ll P,ll M){ ll R=1%M; while(P>0) {if(P%2==1){R=(R*B)%M;}P/=2;B=(B*B)%M;} return R;} /// (B^P)%M

//ll getBit(ll num, int idx) {return ((num >> idx) & 1ll) == 1ll;}
//ll setBit1(ll num, int idx) {return num or (1ll<<idx);}
//ll setBit0(ll num, int idx) {return num & ~(1ll<<idx);}
//ll flipBit(ll num, int idx) {return num ^ (1ll<<idx);}

const int mod = 1000000007;

    int cost[101];
    int wt[101];
    ll dp[101][100001];
int main()
{
    fast;
    int n, w;
    cin>>n>>w;
    REP1(i, n) cin>>wt[i]>>cost[i];
    REP(i, n+1){
      REP(j, 100001){
        if(j==0) dp[i][j] = 0;
        else if(i==0) dp[i][j] = INT_MAX;
        else{
          if(j>=cost[i]) dp[i][j] = min(dp[i-1][j], dp[i-1][j-cost[i]] + wt[i]);
          else dp[i][j] = dp[i-1][j];
        }
      }
    }
    ll ans = 0;
    REP(i, 100001) if(dp[n][i]<=w) ans = i;
    cout<<ans<<'\n';
    return 0;
}


Measured memory_bytes: 82560
#include<iostream>
int n,a,b,c,ans;
main(){
    std::cin>>n>>a>>b>>c;
    for(n-=2;--n;a=b,b=c,std::cin>>c)ans+=(a<b&&b<c||c<b&&b<a); 
    std::cout<<ans+(a<b&&b<c||c<b&&b<a);
}

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

int main() {
  int N,M,mod=1000000007;
  cin >> N >> M;
  vector<long long> V(N+1,-1);
  for(int i=0;i<M;i++){
    int a;
    cin >> a;
    V[a] = 0;
  }
  
  V[0] = 1;
  if(V[1]==-1) V[1] = 1;
  for(int i=2;i<=N;i++){
    if(V[i]==0) continue;
    V[i] = V[i-1] + V[i-2];
    V[i] %= mod;
  }
  
  cout << V[N] << endl;
  return 0;
}


Measured memory_bytes: 1024
#include<iostream>
#include<string>
#include<cmath>
#include<vector>
#include<algorithm>
using namespace std;

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

	vector<int> ABS;
	for (int i = 0; i < S.length() - 2; i++) {
		string sub = S.substr(i, 3);
		int abssub = abs(753 - stoi(sub));
		ABS.push_back(abssub);
	}

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

	cout << ABS[0] << endl;
	
}





Measured memory_bytes: 256
d = int(input())
clst = list(map(int, input().split()))
s = [list(map(int, input().split())) for _ in range(d)]
last = [0 for _ in range(26)]

def score_minus(d, q):
    minus = 0
    for i, (c, ls) in enumerate(zip(clst, last)):
        if i == d:
            continue
        minus += c * (d - ls)
    return minus
    
ans = 0
for i in range(1, d + 1):
    tmp = -10 ** 10
    for q in range(26):
        tmp_score = s[i - 1][q] - score_minus(i, q)
        if tmp_score > tmp:
            tmp = tmp_score
            max_q = q
    print(max_q + 1)
    last[max_q] = i

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

#define rep(i,n) for(int i=0; i<(n); i++)
#define lep(j,n) for(int j=0; j<(n); j++)
#define reps(i,n) for(int i=1; i<(n); i++)
#define leps(j,n) for(int j=1; j<(n); j++)
#define pii pair<int,int>
#define gsort(x,n) sort((x),(x)+(n),greater<int>())
#define all(x) (x).begin(), (x).end()
#define int long long
#define setout(n,x) setw(n) << setfill(x)
#define Fixed fixed << setprecision(10)
const long long mod = 1000000007;
using namespace std;

#define return(Z) re:(Z)

long long h[10000010],x[10000010],z[10000010];

signed main(){

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

    int a,b;
    cin>>a>>b;

    if((a*b)%2==0) cout<<"Even"<<'\n';
    else cout<<"Odd"<<'\n';
}

Measured memory_bytes: 256
#include <stdio.h>//我们从下表为1的开始
#include <stdlib.h>
int top,stack[500]={0};
void Initial(void)
{
    top=0;
}

int IsEmpty(void)
{
    return top==0;
}
int IsFull(void)
{
    return top>500;
}
void push(int x)
{
    if(IsFull())printf("UP OVERFLOW");
    top++;
    stack[top]=x;
}
int pop()
{
    if(IsEmpty())printf("LOW OVERFLOW");
    top--;
    return stack[top+1];
}
#if 0
int main() {
    int a, b;
    char ch = '0' ;
    scanf("%c",&ch);
    Initial();
    while (ch != '\n') {
        if (ch == '+') {
            a = pop();
            b = pop();
            push(a + b);
        } else if (ch == '-') {
            a = pop();
            b = pop();
            push(a - b);
        } else if (ch == '*') {
            a = pop();
            b = pop();
            push(a * b);
        } else if (ch != ' ')
            push(ch - '0');
        scanf("%c",&ch);
//        printf("%d\n",pop());
        printf("%d\n",stack[top]);

    }
    printf("%d\n",pop());
    return 0;
}

#elif 1
int main()
{
    char s[100];
    int a,b;
    Initial();
    while(scanf("%s",s)!=EOF)
    {
        if(s[0]=='+')
        {
            a=pop();
            b=pop();
            push(a+b);
        }
        else if (s[0]=='-')
        {
            b=pop();
            a=pop();
            push(a-b);
        }
        else if (s[0]=='*')
        {
            a=pop();
            b=pop();
            push(a*b);
        }
        else push(atoi(s));
    }
    printf("%d\n",pop());
    return 0;
}
#endif


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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)

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

    int ans = 0;
    
    rep(i, s.length()){
        if(s[i] != t[i]) ++ans;
    }
    cout << ans << endl;
    return 0;    
}




Measured memory_bytes: 3864
n, m = map(int, (input().split()))
a = {int(input()) for i in range(m)}
mod = 10 ** 9 + 7
 
x = 1 if 1 not in a else 0
dp = [1, x] + [0] * (n - 1)
 
for i in range(2, n + 1):
    if i in a:
        continue
    dp[i] = (dp[i - 1] + dp[i - 2])
 
print(dp[-1] % mod)

Measured memory_bytes: 460004
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int[] h = new int[n];
        for (int i = 0; i < n; i++) {
            h[i] = sc.nextInt();
        }

        int[] dp = new int[n];
        Arrays.fill(dp, Integer.MAX_VALUE);
        dp[0] = 0;
        for (int i = 1; i < n; i++) {
            for (int j = 1; j <= k; j++) {
                if (i - j < 0) {
                    continue;
                }
                dp[i] = Math.min(dp[i], dp[i - j] + Math.abs(h[i] - h[i - j]));
            }
        }
        System.out.println(dp[n - 1]);
    }
}


Measured memory_bytes: 49116
#include<bits/stdc++.h>
long long mod=1'000'000'007;
void add_eq(long long&x, long long y){x+=y;if(mod<=x)x-=mod;}
void sub_eq(long long&x, long long y){x-=y;if(x<0)x+=mod;}
void mul_eq(long long&x, long long y){x=x*y%mod;}
long long pow(long long a, long long b){
    long long ans=1;
    for(;b;b/=2){
        if(b&1ll)ans=ans*a%mod;
        a=a*a%mod;
    }
    return ans;
}
long long inverse(long long a){return pow(a,mod-2);}
int main(){
    int n,k;std::cin>>n>>k;
    k--;
    std::vector<long long>a(n);
    for(int i=0;i<n;i++)std::cin>>a.at(i);
    std::sort(a.begin(),a.end());
    for(long long&x:a)if(x<0)x+=mod;
    long long ans=0,coeff=1;
    for(int i=k;i<n;i++){
        add_eq(ans,coeff*a.at(i)%mod);
        mul_eq(coeff,i+1);
        mul_eq(coeff,inverse(i-k+1));
    }
    std::reverse(a.begin(),a.end());
    coeff=1;
    for(int i=k;i<n;i++){
        sub_eq(ans,coeff*a.at(i)%mod);
        mul_eq(coeff,i+1);
        mul_eq(coeff,inverse(i-k+1));
    }
    std::cout<<ans<<std::endl;
}



Measured memory_bytes: 1024
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>

using LL = long long;
const int kN = 100000 + 5;
int belong[kN];
std::vector<int> vec[kN];
int n, m;
LL offset[kN];

void combine(int l, int r, int d)
{
    if (vec[belong[l]].size() < vec[belong[r]].size()) {
        std::swap(l, r);
        d = -d;
    }
    LL delta = offset[l] + d - offset[r];
    int br = belong[r];
    for (int x : vec[br]) {
        offset[x] += delta;
        belong[x] = belong[l];
        vec[belong[l]].emplace_back(x);
    }
    std::vector<int>().swap(vec[br]);
}

int main()
{
    scanf("%d%d", &n, &m);
    for (int i = 0; i < n; ++ i) {
        vec[i].emplace_back(i);
        belong[i] = i;
    }
    bool flag = true;
    for (int i = 0; i < m; ++ i) {
        int l, r, d;
        scanf("%d%d%d", &l, &r, &d); -- l; -- r;
        if (belong[l] != belong[r]) {
            combine(l, r, d);
        } else {
            if (offset[r] - offset[l] != d) flag = false;
        }
    }
    for (int l = 0; l < n; ++ l) if (belong[l] == l) {
        LL lbound = 1e9 + 1, rbound = -1;
        for (int x : vec[l]) {
            lbound = std::min(lbound, offset[x]);
            rbound = std::max(rbound, offset[x]);
        }
        if (rbound - lbound > (int)1e9 + 1) flag = false;
    }
    puts(flag ? "Yes" : "No");
}


Measured memory_bytes: 8160
import java.io.*;
import java.util.*;

public class Main {
    public static final long mod = (long)1e9+7;
    public static final long INF = Long.MAX_VALUE/2;
    public static final int inf = Integer.MAX_VALUE/2;

    static void solve(InputReader in, PrintWriter out){
        int n = in.ni();
        long ans = 0;
        for (int i = 1; i <= n; i++) {
            if(i%3!=0&&i%5!=0)ans+=i;
        }
        out.println(ans);
    }

    public static void main(String[] args){
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);
        solve(in, out);
        out.close();
    }
    public static class InputReader{
        private BufferedReader br;
        private StringTokenizer st;
        public InputReader(InputStream is){
            br = new BufferedReader(new InputStreamReader(is));
            st = null;
        }
        public String ns(){
            if(st == null || !st.hasMoreTokens()){
                try{
                    st = new StringTokenizer(br.readLine());
                }catch (Exception e){
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }
        public int ni(){
            return Integer.parseInt(ns());
        }
        public long nl(){
            return Long.parseLong(ns());
        }
        public double nd(){
            return Double.parseDouble(ns());
        }
        public char nc(){
            return ns().toCharArray()[0];
        }
        public int[] ni(int n){
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = ni();
            }
            return a;
        }
        public long[] nl(int n){
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = nl();
            }
            return a;
        }
        public double[] nd(int n){
            double[] a = new double[n];
            for (int i = 0; i < n; i++) {
                a[i] = nd();
            }
            return a;
        }
    }
}

Measured memory_bytes: 32964
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << '\n';
#define CFYN(n) cout << ( (n) ? "YES":"NO") << '\n';
#define OUT(n) cout << (n) << '\n';
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

constexpr int MOD = 1000000007;

int mod(const ll &x){
    return x > 0 ? x % MOD : (x+MOD) % MOD;
}

int modm(const ll &x,const ll &m){
    return (x % MOD) * (m % MOD) % MOD;
}

int modpow(ll x, ll p) {
    int ret = 1;
    while(p > 0) {
        if (p & 1) ret = modm(ret,x);
        x = modm(x,x);
        p >>= 1;
    }
    return ret;
}

// x * modinv(d)
int modd(ll x,ll d) {
    return modm(x,modpow(d,MOD-2));
}

int main(void)
{
    IOS
    constexpr int FACT = 400005;
    int fact[FACT];
    fact[0] = 1;
    FOR(i,1,FACT) fact[i] = modm(fact[i-1],i);
    auto comb = [&](int x,int y) {
    int r = fact[x];r = modd(r,fact[y]);r = modd(r, fact[x-y]);return r;};
    // n種類のものから重複を許してr個配った時の組み合わせ数(重複組み合わせnHr)
    auto multicomb = [&](int n,int r) {return comb(n+r-1,r);};
    
    int n, k;
    cin >> n >> k;
    int ans = 0;
    if (n-1 <= k) ans = multicomb(n,n);
    else {
        REP(i,k+1) ans = mod(ans + modm(comb(n,i) , multicomb(n-i,i)));
    }

    cout << ans << '\n';

    return 0;
}

Measured memory_bytes: 1792
//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
//#include <ext/pb_ds/detail/standard_policies.hpp>
#include<set>
#include<map>
#include <unordered_map>
#include <unordered_set>
#include<list>
#include<iomanip>
#include<cmath>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<complex>
#include<sstream>
#include<iostream>
#include<fstream>
#include<algorithm>
#include<numeric>
#include<utility>
#include<functional>
#include<stdio.h>
#include<assert.h>
#include<memory.h>
#include<bitset>
#include<math.h>
#include <strings.h>



#define f first
#define s second
#define mp make_pair
#define pb push_back
#define lp(i,a,n) for(int i=a;i<=n;++i)
#define lpd(i,a,n) for(int i=a;i>=n;--i)
#define mem(a,b) memset(a,b,sizeof a)
#define all(v) v.begin(),v.end()
#define println(a) cout <<(a) <<endl
#define sz(x) ((int)(x).size())
#define readi(x) scanf("%d",&x)
#define read2i(x,y) scanf("%d%d",&x,&y)
#define read3i(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define mod 1000000007
#define eps 1e-8
#define infi 1000000000
#define infll 1000000000000000000ll
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef set<int> si;
typedef map<int,int> mii;

//const int N = 300002;


int n,k;
int main(){
    
    scanf("%d%d",&n,&k);
    
    ll ans = 0;
    lp(i, k+1, n) {
        int j;
        for(j = i; j <= n ; j += i)
            ans += j - (j-i+k) - !(j-i+k);
        if(n < j-i+k) continue;
        if(n%i)
            ans += n - (j-i+k) + 1 - !(j-i+k);
        else ans += !k;
    }
    
    printf("%lld\n",ans);
    return 0;
}



/*

 5 3
 1 3
 1 5
 3 6
 4 4
 2 6
 1 5 3
 1 5 4
 1 1 1

 */
//freopen("output.txt","w",stdout);
//freopen("input.txt","r",stdin);
//ios::sync_with_stdio(0);cin.tie(0);

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

using namespace std;

int n;
std::vector<int> k[2];
std::vector<int> sum[2];

int main(){
    cin >> n;
    int s = 0;
    for(int i=0;i<n;i++){
        int tmp;
        cin >> tmp;
        k[0].push_back(tmp);
        s += tmp;
        sum[0].push_back(s);
    }
    s = 0;
    for(int i=0;i<n;i++){
        int tmp;
        cin >> tmp;
        k[1].push_back(tmp);
        s += tmp;
    }
    for(int i=0;i<n;i++){
        sum[1].push_back(s);
        s -= k[1][i];
    }

    int m = 0;
    for(int i=0;i<n;i++){
        m = max(m, sum[0][i] + sum[1][i]);
    }

    cout << m << endl;
    return 0;
}


Measured memory_bytes: 384
//clear adj and visited vector declared globally after each test case
//check for long long overflow
//while adding and subs check if mod becomes -ve
//while using an integer directly in a builtin function add ll
//Mod wale question mein last mein if dalo ie. Ans<0 then ans+=mod;

#include <bits/stdc++.h>
#define int long long
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);cout.precision(dbl::max_digits10);
#define pb push_back
#define mod 1000000007 //998244353
#define lld long double
#define mii map<int, int>
#define mci map<char, int>
#define msi map<string, int>
#define pii pair<int, int>
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=x; i<y; i++)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define setbits(x) __builtin_popcountll(x)
#define print2d(dp,n,m) for(int i=0;i<=n;i++){for(int j=0;j<=m;j++)cout<<dp[i][j]<<" ";cout<<"\n";}
typedef std::numeric_limits< double > dbl;
using namespace std;
const long long N=200005, INF=2000000000000000000;
int power(int a, int b, int p)
    {
        if(a==0)
        return 0;
        int res=1;
        a%=p;
        while(b>0)
        {
            if(b&1)
            res=(res*a)%p;
            b>>=1;
            a=(a*a)%p;
        }
        return res;
    }

int32_t main()
{
    IOS;
    lld a,b,h,m;
    cin>>a>>b>>h>>m;
    lld pi=3.14159265358979323;
    lld x=(h*30.0)+(m/2.0);
    lld y=m*6.0;
    lld d=abs(x-y);
    d*=(pi/180.0);
    lld z=(a*a)+(b*b)-(2*a*b*cos(d));
    cout<<sqrt(z);
}

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

int main() { 
  ios::sync_with_stdio(0);
  cin.tie(0);
  string s,nick;
  cin>>s;
  for(int i=0;i<3;i++) {
    nick+=s[i];
  }
  cout<<nick<<endl;
  return 0;
}


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

using namespace std;
#define int64 long long

const int nMax = 100010;

int n, m;
int nTest;

void outerInit()
{
    if (ifstream("test.inp")) freopen("test.inp", "r", stdin);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << setprecision(9) << fixed;
}

void enter()
{
    int a, b;
    cin >> a >> b;
    cout << (a <= 8 && b <= 8 ? "Yay!" : ":(");
}

void init()
{
}

void solve()
{
}

int main()
{
    outerInit();

    nTest = 1;
    // cin >> nTest;
    for (int i = 1; i <= nTest; ++i)
    {
        if (i > 1) cout << "\n";
        enter();
        init();
        solve();
    }
}

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

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 998244353
#define fastcin() cin.tie(0);ios::sync_with_stdio(false)

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

int ans[] = {4,4,9,4,7,10,18,5,21,8,16,11,11,19,19,6,14,22,22,9,9,17,17,12,25,12,113,20,20,20,108,7,28,15,15,23,23,23,36,10,111,10,31,18,18,18,106,13,26,26,26,13,13,114,114,21,34,21,34,21,21,109,109,8,29,29,29,16,16,16,104,24,117,24,16,24,24,37,37,11,24,112,112,11,11,32,32,19,32,19,94,19,19,107,107,14,120,27,27,27};

int main(){
	int s;scanf("%d",&s);;printf("%d\n",ans[s-1]);
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int a;
	int i;
	int pasta;
	int juice;
	
	scanf("%d", &a);
	pasta = a;
	for (i = 1; i < 3; i++){
		scanf("%d", &a);
		if (pasta > a){
			pasta = a;
		}
	}
	
	scanf("%d", &a);
	juice = a;
	
	scanf("%d", &a);
	if (juice > a){
		juice = a;
	}
	
	printf("%d\n", pasta + juice - 50);
	
	return (0);
}

Measured memory_bytes: 592
#include <iostream>
#include <vector>

typedef long long ll;

using namespace std;

int main () {
  int n;
  cin >> n;
  vector <ll> a(n);
  for (int i = 0; i < n; i++)
    cin >> a[i];
  for (int i = 0; i < n; i++)
    if (a[i] == 0) {
      cout << 0;
      return 0;
    }
  ll ans = 1;
  for (int i = 0; i < n; i++)
    ans *= a[i];
  ll maxans = 1e18;
  for (int i = 0; i < n; i++)
    maxans /= a[i];
  if (maxans == 0) cout << -1;
  else cout << ans;
  return 0;
}

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


void solve(std::string S){
    rep(i, S.length())
        cout << "x";
    cout <<endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    std::string S;
    std::cin >> S;
    solve(S);
    return 0;
}


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

int main(){
    string aani,bani;
    int n,a,b;

    a=0,b=0;

    cin >> n;

    for(int i=0;i<n;i++){
        cin >> aani >> bani;
        if(aani<bani)b += 3;
        else if(aani>bani)a += 3;
        else{
            a++,b++;
        }
    }

    cout << a <<" " << b << endl;

    return 0;

}


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

int solve(vector<int> arr, int n)
{
  vector<int> dp(n + 1);
  dp[1] = 0;
  for (int i = 2; i <= n; i++)
  {
    int op1 = abs(arr[i] - arr[i - 1]) + dp[i - 1];
    int op2 = (i == 2) ? INT_MAX : abs(arr[i] - arr[i - 2]) + dp[i - 2];
    dp[i] = min(op1, op2);
  }
  return dp[n];
}

int main()
{
  int n;
  cin >> n;
  vector<int> v(n + 1);
  for (int i = 1; i <= n; i++)
    cin >> v[i];
  cout << solve(v, n) << endl;
  return 0;
}

Measured memory_bytes: 3852
import math

# 切り捨て
# math.floor(x)

N = int(input())
 
# Check if the price before tax is X, for X = 1, 2, 3, ..., N
ans = -1
for i in range(1, N + 1):
	if int(i * 1.08) == N:
		ans = i
 
# Print answer
if ans != -1:
	print(ans)
else:
	print(":(")

Measured memory_bytes: 2940
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
if n==1:
    print(a[0]*2)
    exit()
from bisect import bisect_left,bisect_right
#幸福度がx以上がm以上か？
def f(x):
    global n,a
    ret=0
    for i in range(n):
        ret+=(n-bisect_left(a,x-a[i]))
    return ret
l,r=-1,10**6
while l+1<r:
    k=l+(r-l)//2
    if f(k)>=m:
        l=k
    else:
        r=k
#print(l,r)
#print(f(l),f(r))
if f(r)>=m:
    co,ans=0,0
    for i in range(n):
        co+=(n-bisect_right(a,r-a[i]))
        ans+=(n-bisect_right(a,r-a[i]))*a[i]
    print(2*ans+(m-co)*r)
else:
    co,ans=0,0
    for i in range(n):
        co+=(n-bisect_right(a,l-a[i]))
        ans+=(n-bisect_right(a,l-a[i]))*a[i]
    print(2*ans+(m-co)*l)

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

int main(){
  int n;
  cin >> n;
  int c[n], s[n], f[n];
  for(int i = 0; i < n-1; i++) cin >> c[i] >> s[i] >> f[i];
  for(int i = 0; i < n; i++){
    int t = 0;
    for(int j = i; j < n-1; j++){
      if(t < s[j]) t = s[j];
      else if(t % f[j] != 0) t += f[j] - t % f[j];
      t += c[j];
    }
    cout << t << endl;
  }
  return 0;
}


Measured memory_bytes: 256
// Linear search

#include <iostream>
using namespace std;

int main()
{
    int n, S[10000];
    int q, t;
    int count = 0;

    cin >> n;
    for (int i=0; i<n; i++)
        cin >> S[i];

    cin >> q;
    for (int i=0; i<q; i++) {
        cin >> t;
        for (int j=0; j<n; j++) {
            if (t == S[j]) {
                count++;
                break;
            }
        }
    }
    cout << count << endl;
    return 0;
}


Measured memory_bytes: 3096
#include <iostream>
#include <complex>
#include <vector>
#include <map>
#include <algorithm>
#include <utility>
#include <string>
#include <cmath>
#include <bitset>
using namespace std;

#define EPS 1e-7

typedef complex<double> point;
typedef vector<point> polygon;
typedef const point &rpoint;


double cross(rpoint v1, rpoint v2){
	return v1.real() * v2.imag() - v1.imag() * v2.real();
}

//完全に含む。
bool contains(rpoint va1, rpoint va2, rpoint vb){
	if( norm(va1 - vb) < EPS || norm(va2 - vb) < EPS ) return false;
	return abs(abs(vb - va1) + abs(va2 - vb) - abs(va1 - va2)) < EPS;
}

//ここがだめ
bool share(rpoint pa1, rpoint pa2, rpoint pb1, rpoint pb2){
	if( abs(cross(pa2 - pa1, pb1 - pa1)) > EPS ) return false;
	if( abs(cross(pa2 - pa1, pb2 - pa1)) > EPS ) return false;

	if( contains(pa1, pa2, pb1) || contains(pa1, pa2, pb2) || contains(pb1, pb2, pa1) || contains(pb1, pb2, pa2) )
		return true;
	if( contains(pa1, pa2, (pb1 + pb2) * 0.5) )
		return true;
	
	return false;
}

bool adjacent(const polygon &plg1, const polygon &plg2){
	for(int i = 1; i < plg1.size(); ++i){
		for(int j = 1; j < plg2.size(); ++j){
			if( share(plg1[i-1], plg1[i], plg2[j-1], plg2[j]) )
				return true;
		}
	}
	return false;
}

bool adjacentcountry(const vector<polygon> &c1, const vector<polygon> &c2){
	for(int i = 0; i < c1.size(); ++i){
		for(int j = 0; j < c2.size(); ++j){
			if( adjacent(c1[i], c2[j]) ) return true;
		}
	}
	return false;
}

int m;
int adj[10];
int ans;
int color[10];

void paint(int t, int a){
	if( a >= ans ) return;
	if( t == m ){
		ans = a;
		return;
	}

	bool adjclr[11] = {};
	for(int i = 0; i < t; ++i){
		if( (adj[t] >> i) & 1 ){
			adjclr[ color[i] ] = true;
		}
	}

	for(int i = 1; i <= a; ++i){
		if( !adjclr[i] ){
			color[t] = i;
			paint(t + 1, a);
		}
	}
	
	color[t] = a + 1;
	paint(t + 1, a + 1);
	color[t] = 0;
}


int main(){
	int n;
	while( cin >> n, n != 0 ){
		map<string,int> nametbl;

		vector<vector<polygon> > country(10);
		
		string name;
		int x, y;
		for(int i = 0; i < n; ++i){
			cin >> name;
			int number = nametbl.insert( make_pair(name, nametbl.size()) ).first->second;
			
			polygon plg;
			while( cin >> x, x != -1 ){
				cin >> y;
				plg.push_back( point(x, y) );
			}
			
			plg.push_back( plg[0] );
			country[number].push_back(plg);
		}
		
		m = nametbl.size();
		country.resize(m);

		fill(adj, adj + 10, 0);

		for(int i = 0; i < m - 1; ++i){
			for(int j = i + 1; j < m; ++j){
				if( (adj[i] >> j) & 1 ) continue;

				if( adjacentcountry(country[i], country[j]) ){
					adj[i] |= 1 << j;
					adj[j] |= 1 << i;
				}
			}
		}

/*
cout<<"adj\n";
for(int i = 0; i < m; ++i){
	cout<<'\t'<<i<<": "<<bitset<10>(adj[i])<<'\n';
}
*/

		ans = 10;
		fill(color, color + 10, 0);
		color[0] = 1;

		paint(1, 1);

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

Measured memory_bytes: 1264
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0; i<(n); i++)
int cnt_digits(ll n){
  int digits = 0;
  while(n>0){
    n /= 10;
    digits++;
  }
  return digits;
}
int main() {
  ll n;
  cin >> n;
  int ans = cnt_digits(n);
  for(int a=1; a<=100000; a++){
    if(n%a!=0) continue;
    ll b = n/a;
    int cur = max(cnt_digits(a),cnt_digits(b));
    if(ans>cur){
      ans = cur;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <atcoder/segtree>
#include <iostream>
#include <vector>

using namespace std;
using namespace atcoder;

int op(int a, int b) { return max(a, b); }

int e() { return -1; }

int target;

bool f(int v) { return v < target; }

int main() {
    int n, q;
    cin >> n >> q;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }

    segtree<int, op, e> seg(a);

    for (int i = 0; i < q; i++) {
        int t;
        cin >> t;
        if (t == 1) {
            int x, v;
            cin >> x >> v;
            x--;
            seg.set(x, v);
        } else if (t == 2) {
            int l, r;
            cin >> l >> r;
            l--;
            cout << seg.prod(l, r) << endl;
        } else if (t == 3) {
            int p;
            cin >> p >> target;
            p--;
            cout << seg.max_right<f>(p) + 1 << endl;
        }
    }
}


Measured memory_bytes: 6168
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC125B
{
    class Program
    {
        static void Main(string[] args)
        {
            
            string[] ss = Console.ReadLine().Split(' ');
            int a = int.Parse(ss[0]);
            string b = Console.ReadLine();
            if (a % 2 != 0)
                Console.WriteLine("No");
            else if (b == b.Substring(0, a / 2) + b.Substring(0, a / 2))
                Console.WriteLine("Yes");
            else
                Console.WriteLine("No");
            Console.ReadKey();
            

        }
    }
}

Measured memory_bytes: 13140
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define vlli vector<ll>
#define vi vector<int>
#define vs vector<string>
#define vplli vector< pair< ll,ll> >
#define plli pair< ll,ll >
#define vps vector< pair< string, string> >
#define vpi vector< pair< int, int> >
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define fast ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define forn(i,a,n) for(ll i=a;i<n;i++)
#define forr(i,n,a) for(ll i=n-1;i>=a;i--)
#define scan(arr,a,n) for(int i=(a);i<(n);i++)cin>>(arr)[i];
#define print(arr,a,n) for(int i=(a);i<(n);i++)cout<<(arr)[i]<<' ';

const ll inf = 1e18;

ll add(ll x, ll y) {ll res = x + y; return (res >= mod ? res - mod : res);}
ll mul(ll x, ll y) {ll res = x * y; return (res >= mod ? res % mod : res);}
ll sub(ll x, ll y) {ll res = x - y; return (res < 0 ? res + mod : res);}
ll power(ll x, ll y) {ll res = 1; x %= mod; while (y) {if (y & 1)res = mul(res, x); y >>= 1; x = mul(x, x);} return res;}
ll mod_inv(ll x) {return power(x, mod - 2);}

int main(){
	fast;
	ll a, b, k;
	cin>>a>>b>>k;
	map<ll, ll> m;
	forn(i, a, min(b+1, a+k)){
		if(m[i] == 0){
			cout<<i<<" ";
			m[i]++;
		}
	}
	forn(i, max(a,b-k+1), b+1){
		if(m[i] == 0){
			cout<<i<<" ";
			m[i]++;
		}
	}
	
	cout<<endl;
}

Measured memory_bytes: 3580
#include <cstdio>
#include <cstring>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <string>
#include <set>
#include <queue>
using namespace std;
#define mem(a,n) memset(a,n,sizeof(a))
#define pb(x) push_back(x)
typedef long long LL;
typedef unsigned long long ull;
const int mod=1e9+7;
const double eps=1e-6;
const int INF=0x3f3f3f3f;
const int N=1e5+5;
set<int>st;
int main()
{
    int n;
    while(~scanf("%d",&n))
    {
        st.clear();
        int x;
        for(int i=0;i<n;i++)
        {
            scanf("%d",&x);
            if(!st.count(x)) st.insert(x);
            else st.erase(x);
            //printf("  %d\n",st.size());
        }
        printf("%d\n",st.size());
    }
    return 0;
}

/*
9
1 2 4 9 5 8 7 3 6
5
1 4 3 5 2
8
1 2 4 3 5 6 8 7
*/


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

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

    int n, page;
    cin>>n;

    if( n % 2 == 0)
    {
        page = n / 2;
    }
    else
    {
        page = (n / 2) + 1;
    }
    
    cout<<page<<endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
#include<stdio.h>
#include<string.h>
#include <bitset>

using namespace std;
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000
#define DEBUG_OUT true
#define ALL(x) (x).begin(),(x).end()

// int DP[MEM_SIZE][MEM_SIZE] = {0};
// int GMEM[MEM_SIZE][MEM_SIZE] = {0};
template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return; std::cout << e <<" ";}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){std::cout<< e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class... Ts> void DEBUG(T d, Ts... e){if(DEBUG_OUT == false)return;DEBUG(d);DEBUG(e...);};
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

//FUNCTION

void solve(void)
{
  int N,Z,W;
  cin>>N>>Z>>W;
  vector<int> vec (N,0);
  for (int i = 0; i < N; i++)
  {
    cin>>vec[i];
  }
  if(N == 1)
  {
    cout<<abs(vec[0] - W)<<endl;
    return;
  }
  cout<<max(abs(vec[N-1] - vec[N-2]),abs(vec[N-1] - W))<<endl;;

  
  return;
}

int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();

  return 0;
}


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

using namespace std;

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


Measured memory_bytes: 3632
s = int(input())

exist = set()
cnt = 1

while True:
    if s not in exist:
        exist.add(s)
        if s % 2 == 0:
            s //= 2
        else:
            s = 3 * s + 1
        cnt += 1
    else:
        print(cnt)
        exit()


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

long dp[110][15];

int main() {
	int H, W, K; cin >> H >> W >> K;
	dp[0][1]=1;
	int fib[15];
	fib[0]=1, fib[1]=1;
	for(int i=2; i<11; ++i) fib[i]=fib[i-1]+fib[i-2];
	for(int i=1; i<=H; ++i){
	    for(int j=1; j<=W; ++j){
	        for(int t=-1; t<2; ++t){
	            dp[i][j]=(dp[i][j]+dp[i-1][j+t]*fib[j-1-t*(t-1)/2]*fib[W-j-t*(t+1)/2])%1000000007;
	        }
	    }
	}
	cout << dp[H][K] << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#include "debug.h"
#else
#define debug(x...)
#endif
#define int long long
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define loop(i,c) for(auto i=(c).begin();i!=(c).end();i++)
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define F first
#define S second
const int mod =  1000000007;

void solving() {
	int n;
	cin >> n;
	string s;
	while (n >= 1) {
		n--;
		int x = n % 26;
		char ch = ('a' + x);
		debug(x, ch);
		if (ch == '`') {
			ch = 'z';
		}
		s = ch + s;
		n -= x;
		n /= 26;
	}
	cout << s << endl;
}

int32_t main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	// int t{}; cin >> t; while (t--)
	solving();

	return 0;
}

Measured memory_bytes: 3608
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<functional>
#include<string.h>
#include<vector>
#include<map>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<list>
#include<queue>
#include<deque>
#include<string>
#include<random>
#include<stack>
#include<limits.h>
using namespace std;

signed main() {
	string a; cin >> a;
	string b;
	for (char c : a) {
		if (c != 'x')b += c;
	}
	for (int i = 0; i < b.length() / 2; i++) {
		if (b[i] != b[b.length() - i - 1]) { puts("-1"); return 0; }
	}
	int sum = 0;
	vector<int>V;
	for (char i : a) {
		if (i == 'x')sum++;
		else {
			V.push_back(sum); sum = 0;
		}
	}
	V.push_back(sum);
	int ans = 0;
	for (int i = 0; i < V.size() / 2; i++) {
		ans += abs(V[i]-V[V.size() - i - 1]);
	}
	cout << ans << endl;
}

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

#define rep(i, n) for (int i = 0; i < n; ++i)
#define ALL(a) (a).begin(), (a).end()
#define rALL(a) (a).rbegin(), (a).rend()
#define SZ(x) ((int)(x).size())
using ll = long long;
using P = pair<ll, ll>;
using llP = pair<ll, ll>;
using DoP = pair<double, double>;
const int di[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dj[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int INF = 1 << 29;
const ll INF64 = 1ll << 62;
const int mod = 1000000007;
//const int mod = 998244353;

template <class T>inline bool chmin(T &a, const T b)
{
  if (a > b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>inline bool chmax(T &a, const T b)
{
  if (a < b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>inline void line_out(const vector<T> vec) {
  int n = SZ(vec);
  rep(i, n) {
    cout << vec[i];
    //if(i < n-1) cout << " ";
  }
  cout << endl;
  return;
}

struct mint
{
  ll x; // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a)
  {
    if ((x += a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator-=(const mint a)
  {
    if ((x += mod - a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator*=(const mint a)
  {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const
  {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const
  {
    mint res(*this);
    return res -= a;
  }
  mint &operator++()
  {
    if ((x += 1) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator--()
  {
    if ((x += mod - 1) >= mod)
      x -= mod;
    return *this;
  }
  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;
  }
};


ll modpow(ll a, ll n) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}
int main()
{
  int n, k;
  cin >> n >> k;
  vector<mint> num(k+1);
  for(int i = k; i > 0; --i) {
    num[i] = modpow(k/i, n);
    for(int j = 2; j*i <= k; ++j) num[i] -= num[j*i];
  }
  mint ans = 0;
  for(int i = 1; i <= k; ++i) ans += (num[i]*i);
  cout << ans.x << endl;
}

Measured memory_bytes: 4056
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
 
using namespace std;
 
int main() {
long long int h, w;
scanf("%lld %lld", &h, &w);
if((h==1)||(w==1))
    printf("1");
else
printf("%lld", (h*w+1)/2);
 
 
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define PB push_back
#define SP << " " <<

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;

__attribute__((constructor))
void initial(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed <<setprecision(15);
}


int main(void){
	int x, y, z;
    cin >> x >> y >> z;
    cout << z SP x SP y << endl;
    return 0;
}


Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const int INF = 1000000000;

int main() {
    int X, N;
    cin >> X >> N;
    map<int,bool>mp;
    for (int i=0; i<N; i++){
        int pi;
        cin >> pi;
        mp[pi] = true;
    }
    int ans = INF;
    for (int i=0; i<=110; i++){
        if (!mp[i]){
            if (abs(i-X) < abs(ans-X)){
                ans = i;
            }
        }

    }
    cout << ans << endl;
    
}

Measured memory_bytes: 3612
// C++ program to count the Minimum number of
// increasing subsequences
#include <bits/stdc++.h>
using namespace std;

const int N = 1e5 + 5;

int MinimumNumIncreasingSubsequences(int arr[], int n)
{
	multiset<int> last;

	// last element in each increasing subsequence
	// found so far
	for (int i = 0; i < n; i++) {

		// here our current element is arr[i]
		multiset<int>::iterator it = last.lower_bound(arr[i]);

		// iterator to the first element larger
		// than or equal to arr[i]
		if (it == last.begin())

			// if all the elements in last larger
			// than or to arr[i] then insert it into last
			last.insert(arr[i]);

		else {
			it--;

			// the largest element smaller than arr[i] is the number
			// before *it which is it--
			last.erase(it); // erase the largest element smaller than arr[i]
			last.insert(arr[i]); // and replace it with arr[i]
		}
	}
	return last.size(); // our answer is the size of last
}

// Driver program
int main()
{
    int n;
    int a[N];
    scanf("%d" , &n);
    for(int i = 0 ; i < n ; i ++){
        scanf("%d" , &a[i]);
    }
	cout << MinimumNumIncreasingSubsequences(a, n) << endl;;
	return 0;
}


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

int main(){
  int n;
  cin>>n;
  vector<long long>a(n);
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  bool at=false;
  int nu=0;
  while(1){
    for(int i=0;i<n;i++){
      if(a[i]%2!=0){
        at=true;
      }
    }
    if(at) break;
    nu++;
    for(int i=0;i<n;i++){
      a[i]/=2;
    }    
  }
  cout<<nu<<endl;
}
  


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <sstream>

using namespace std;
typedef long long ll;

ll d[10000001];

int main() {
	cin.sync_with_stdio(0); cin.tie(0); cout.tie(NULL);

	ll ans = 0;
	int n; cin >> n;
	for (int i = 2; i <= n; i++) {
		for (int j = i; j <= n; j += i) {
			d[j] += 1;
		}
	}
	
	for (int i = 1; i <= n; i++) {
		ans += i * (ll)(d[i] + 1);
	}
	cout << ans << '\n';


}

Measured memory_bytes: 81356
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

int main()
{
    char s[4];
    int flag1=0,flag2=0,flag3=0;
    cin >> s;
    for(int i=0;i<strlen(s);i++){
        if(s[i]=='a'){
            flag1=1;
        }else if(s[i]=='b'){
        flag2=1;
        }else if(s[i]=='c'){
        flag3=1;
        }
    }
    if(flag1 && flag2 && flag3){
        printf("Yes\n");
    }else{
    printf("No\n");
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long lint;
#define FOR(i, o, n) for (auto i = (o); (i) < (n); ++(i))
#define REP(i, n) FOR(i, 0, n)
#define REPR(i, n) for (auto i = (n)-1; (i) >= 0; --i)
#define REPI(itr, v) for (auto itr = v.begin(); itr != v.end(); ++itr)
#define REPIR(itr, v) for (auto itr = v.rbegin(); itr != v.rend(); ++itr)
#define fi first
#define se second
#define ll long long
#define V2(name, h, w) vector<vector<int> > name((h), vector<int>(w));
int main(){
	int N; cin >> N;
	cout << N*800 - N/15*200 << endl;
}


Measured memory_bytes: 256
#include <algorithm>
#include <boost/optional.hpp>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <limits>
#include <list>
#include <numeric>
#include <queue>
#include <sstream>
#include <string>
#include <tuple>
#include <type_traits>
#include <utility>
#include <vector>

#define REP(i, n) for(int i = 0, i##_MACRO = (n); i < i##_MACRO; i++)
#define RANGE(i, a, b) for(int i = (a), i##_MACRO = (b); i < i##_MACRO; i++)
#define EACH(e, a) for(auto&& e : a)
#define ALL(a) (a).begin(), (a).end()
#define AALL(a, n) (a), ((a) + (n))
#define FILL(a, n) memset((a), n, sizeof(a))
#define FILLZ(a) FILL(a, 0)
#define MODNUM (static_cast<int>(1e9 + 7))
#define MOD(x) ((x) % MODNUM)

using namespace std;

using ll = long long;
using VI = vector<int>;
using VI2D = vector<vector<int>>;

const int INF = 2e9;
const double EPS = 1e-10;
const double PI = acos(-1.0);

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

template <typename T>
int sign(T x) {
	return x < 0 ? -1 : x > 0 ? 1 : 0;
}

template <>
int sign(double x) {
	return x < -EPS ? -1 : x > EPS ? 1 : 0;
}

template <typename T>
T square(T x) {
	return x * x;
}

inline int toInt(string s) {
	int v;
	istringstream sin(s);
	sin >> v;
	return v;
}

int main() {
	int a, b;
	scanf("%d\n%d", &a, &b);
	printf("%d\n", 6 - (a + b));
	return 0;
}

Measured memory_bytes: 256
S = input()

remove_count = 0
# while(True) :
#     S = S.replace("10","X").replace("01","X")
#     current_count = S.count("X")
#     if (current_count == 0) :
#         break
#     remove_count += current_count
#     S = S.replace("X","")
# print(remove_count * 2)
print(min(S.count("1"), S.count("0") )* 2)

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

typedef long long ll;
typedef unsigned long long ull;
typedef double D;
typedef complex<D> P;
#define X real()
#define Y imag()
const D eps=1e-8;
const D inf=1e12;
const D PI=acos(-1);

#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcountll

#define INF 1e16
#define mod 1000000007

struct C{
  P p; D r;
  C(const P& p,D r):p(p),r(r){}
};

enum RELATION{SAME=1,CONTAINED=2,OVER=4,NO_CROSS=8,ONE_CROSS=16,ONE_CONTAINED_CROSS=32,ONE_OVER_CROSS=64,TWO_CROSS=128};
int cRel(C c1, C c2) {
  D d=abs(c1.p-c2.p);
  D dr1=c1.r-c2.r,dr2=c2.r-c1.r;
  D ar=c1.r+c2.r;
  if(d<eps&&c1.r==c2.r)return SAME;
  if(d<dr1)return OVER;
  if(d<dr2)return CONTAINED;
  if(d==dr1)return ONE_OVER_CROSS;
  if(d==dr2)return ONE_CONTAINED_CROSS;
  if(d==ar)return ONE_CROSS;
  if(d>ar)return NO_CROSS;
  return TWO_CROSS;
}

void crosspointCC(const C& c1,const C& c2,P& p1,P& p2){
  D x1=c2.p.X-c1.p.X,y1=c2.p.Y-c1.p.Y;
  D r1=c1.r,r2=c2.r;
  D a=(x1*x1+y1*y1+r1*r1-r2*r2)/2.0;
  p1=P(((a*x1+y1*sqrt((x1*x1+y1*y1)*r1*r1-a*a))/(x1*x1+y1*y1))+c1.p.X,((a*y1-x1*sqrt((x1*x1+y1*y1)*r1*r1-a*a))/(x1*x1+y1*y1))+c1.p.Y);
  p2=P(((a*x1-y1*sqrt((x1*x1+y1*y1)*r1*r1-a*a))/(x1*x1+y1*y1))+c1.p.X,((a*y1+x1*sqrt((x1*x1+y1*y1)*r1*r1-a*a))/(x1*x1+y1*y1))+c1.p.Y);
}

ll N,K;
vector<ll> Xp,Yp,L;

bool ok(double T){
	vector<double> R(N);
	rep(i,N){
		R[i]=T/(double)L[i];
	}
	vector<P> cands;
	rep(i,N)rep(j,i){
		P p1,p2;
		C c1=C(P(Xp[i],Yp[i]),R[i]);
		C c2=C(P(Xp[j],Yp[j]),R[j]);
		int r=cRel(c1,c2);
		if(r!=ONE_OVER_CROSS&&r!=ONE_CONTAINED_CROSS&&r!=ONE_CROSS&&r!=TWO_CROSS)continue;
		crosspointCC(C(P(Xp[i],Yp[i]),R[i]),C(P(Xp[j],Yp[j]),R[j]),p1,p2);

		cands.push_back(p1);
		cands.push_back(p2);
	}
	rep(i,N){
		cands.push_back(P(Xp[i],Yp[i]));
	}
	rep(i,cands.size()){
		ll cnt=0;
		rep(j,N){
			if(pow(Xp[j]-cands[i].X,2)+pow(Yp[j]-cands[i].Y,2)<R[j]*R[j]+eps)cnt++;
		}
		if(cnt>=K)return true;
	}
	return false;
}

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

  cin>>N>>K;
  Xp.resize(N); Yp.resize(N); L.resize(N);

  rep(i,N){
  	cin>>Xp[i]>>Yp[i]>>L[i];
  }

  double lb=0,ub=1e9;
  rep(_,100){
  	double mid=(lb+ub)/2.0;
  	if(ok(mid)) ub=mid;
  	else lb=mid;
  }
  printf("%.10f\n", lb);

  return 0;
}


Measured memory_bytes: 384