akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<string>
#include<cmath>
#include<ctime>
#include<cassert>
#include<queue>
#include<map>
#include<set>
#include<vector>
#include<bitset>
#define rint register int
#define debug(x) cerr<<#x<<"="<<x<<endl
#define fgx cerr<<"-------------"<<endl
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
int b[1000000],f[1000000],s[1000000];
struct interval
{	int l,r;
}t[1000000];
inline bool cmp(interval xx,interval yy){return xx.l==yy.l?xx.r<yy.r:xx.l<yy.l;}
struct node
{	int l,r,mn1,mn2;
}a[1000000];
void build(int l,int r,int o)
{	a[o].l=l; a[o].r=r; a[o].mn1=a[o].mn2=1000000000;
	if(l==r) return;
	int mid=(l+r)>>1;
	build(l,mid,o+o); build(mid+1,r,o+o+1);
}
int query1(int l,int r,int o)
{	if(r<l) return 1000000000;
	if(a[o].l==l&&a[o].r==r){return a[o].mn1;}
	int mid=(a[o].l+a[o].r)>>1;
	if(r<=mid) return query1(l,r,o+o);
	else if(l>mid) return query1(l,r,o+o+1);
	else return min(query1(l,mid,o+o),query1(mid+1,r,o+o+1));
}
int query2(int l,int r,int o)
{	if(r<l) return 1000000000;
	if(a[o].l==l&&a[o].r==r){return a[o].mn2;}
	int mid=(a[o].l+a[o].r)>>1;
	if(r<=mid) return query2(l,r,o+o);
	else if(l>mid) return query2(l,r,o+o+1);
	else return min(query2(l,mid,o+o),query2(mid+1,r,o+o+1));
}
inline void update(int o){a[o].mn1=min(a[o+o].mn1,a[o+o+1].mn1);a[o].mn2=min(a[o+o].mn2,a[o+o+1].mn2);}
void ins(int pos,int k1,int k2,int o)
{	if(a[o].l==pos&&a[o].r==pos)
	{a[o].mn1=min(a[o].mn1,k1);a[o].mn2=min(a[o].mn2,k1+k2);return;}
	int mid=(a[o].l+a[o].r)>>1;
	if(pos<=mid) ins(pos,k1,k2,o+o);
	else ins(pos,k1,k2,o+o+1);
	update(o);
}
int main()
{	int n,q,num=0; cin>>n;
	for(rint i=1;i<=n;i++) scanf("%d",&b[i]),num+=b[i];
	cin>>q;
	for(rint i=1;i<=q;i++) scanf("%d%d",&t[i].l,&t[i].r);
	memset(f,0,sizeof(f));
	f[0]=num;
	for(rint i=1;i<=n;i++) s[i]=s[i-1]+(b[i]==0?1:-1);
	sort(t+1,t+q+1,cmp);
	build(0,n,1); ins(0,f[0],s[0],1);
	for(rint i=1;i<=q;i++)
	{	//debug(query1(0,t[i].l-1,1));debug(query2(t[i].l,t[i].r,1));debug(s[t[i].r]);
		f[i]=min(query1(0,t[i].l-1,1)+s[t[i].r]-s[t[i].l-1],query2(t[i].l,t[i].r,1)+s[t[i].r]);
		ins(t[i].r,f[i],-s[t[i].r],1);
		//debug(f[i]);
	}
	int minn=1000000000;
	for(rint i=0;i<=q;i++) minn=min(minn,f[i]);
	cout<<minn<<endl;
	return 0;
}


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

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

    int k;
    cin >> k;
    long long a[k];
    for (int i = 0; i < k; ++i) {
        cin >> a[i];
    }

    long long next[2] = { 2, 2 }; // min, max
    for (int i = k - 1; i >= 0; --i) {
        if (next[1] / a[i] * a[i] < next[0]) {
            cout << "-1\n";
            return 0;
        }
        next[0] = ((next[0] - 1) / a[i] + 1) * a[i];
        next[1] = (next[1] / a[i] + 1) * a[i] - 1;
    }

    printf("%lld %lld\n", next[0], next[1]);

    return 0;
}


Measured memory_bytes: 1024
#include <stdio.h>
#include <string.h>
#include <ctype.h>
//#include <DEBUG.h>
#define LL long long
#define NNNN 1000000
LL eh[NNNN],ev[NNNN],en[NNNN],vsize,esize;
LL del[NNNN],deg[NNNN],color[NNNN];
LL f[NNNN],vis[NNNN],maxx;
#define max(a,b) (((a)>(b))?(a):(b))
int legal(char ch)
{
	if (ch=='W') {return 2;}
	if (ch=='B') {return 1;}
	return 0;
}
void DFS(LL root)
{
	LL i,j;
	del[root]=1;
	deg[root]-=1;
	for (i=eh[root];i>0;i=en[i])
	{
		j=ev[i];
		if (del[j]==0) {deg[j]-=1;}
		if ((color[j]==0)&&(del[j]==0)&&(deg[j]==1))
		{
			DFS(j);
		}
	}
}
void DFS2(LL root,LL sf)
{
	LL i,j;
	vis[root]=1;
	f[root]+=sf-2;
	for (i=eh[root];i>0;i=en[i])
	{
		j=ev[i];
		if (del[j]!=0) {continue;}
		if (vis[j]==0)
		{
			DFS2(j,f[root]);
		}
	}
}
LL DFS3(LL root)
{
	LL i,j,max1,max2,k;
	vis[root]=1;max1=(LL)0-(LL)0x7FFFFFFF;max2=(LL)0-(LL)0x7FFFFFFF;
	for (i=eh[root];i>0;i=en[i])
	{
		j=ev[i];
		if (del[j]!=0) {continue;}
		if (vis[j]==0)
		{
			k=DFS3(j);
			if (k>max1) {max2=max1;max1=k;}
			else {max2=max(max2,k);}
		}
	}
	if (f[root]>max1) {max2=max1;max1=f[root];}
	maxx=max(maxx,max1+max2-2*f[root]+(((deg[root])&1)!=color[root])*2);
	maxx=max(maxx,max1-f[root]+(((deg[root])&1)!=color[root])*2);
	//printf("%lld %lld %lld %lld\n",max1,max2,root,maxx);
	return max1;
}
int main()
{
	//freopen("in.in","r",stdin);
	LL i,j,k,a,b,c,root;
	char ch;
	scanf("%lld",&vsize);esize=vsize-1;
	memset(eh,0,sizeof(*eh)*(vsize+1));*ev=1;
	memset(deg,0,sizeof(*deg)*(vsize+1));
	memset(del,0,sizeof(*del)*(vsize+1));
	for (i=1;i<=esize;i++)
	{
		scanf("%lld%lld",&a,&b);
		ev[++(*ev)]=b;en[*ev]=eh[a];eh[a]=*ev;
		ev[++(*ev)]=a;en[*ev]=eh[b];eh[b]=*ev;
		deg[a]+=1;deg[b]+=1;
	}
	//print64(deg,vsize);
	for (i=1;i<=vsize;i++)
	{
		RE:scanf("%c",&ch);
		if (legal(ch)==0) {goto RE;}
		color[i]=legal(ch)-1;
	}
	//print64(deg,vsize);
	for (i=1;i<=vsize;i++)
	{
		if ((del[i]!=0)||(color[i]==1)) {continue;}
		if (deg[i]==1)
		{
			//printf("%lld\n",deg[i]);
			DFS(i);
		}
	}
	//print64(deg,vsize);
	root=0;
	for (i=1;i<=vsize;i++)
	{
		if (deg[i]==1) {root=i;break;}
	}
	for (i=1;i<=vsize;i++)
	{
		f[i]=(((deg[i]-1)&1)!=color[i])*2;
		//printf("%lld\n",f[i]);
	}
	memset(vis,0,sizeof(*vis)*(vsize+1));
	DFS2(root,0);
	for (i=1;i<=vsize;i++)
	{
		//printf("%lld\n",f[i]);
		if (del[i]==1) {continue;}
		f[i]=(LL)0-f[i];
		//printf("%lld\n",f[i]);
	}
	memset(vis,0,sizeof(*vis)*(vsize+1));
	maxx=(LL)0-(LL)0xFFFFFFFFF;
	DFS3(root);
	a=0;
	for (i=1;i<=vsize;i++)
	{
		if (del[i]!=0) {continue;}
		a+=deg[i]+((deg[i]&1)!=color[i]);
	}
	//printf("%lld %lld\n",a,maxx);
	if (maxx>0)
	{
		a-=maxx;
	}
	printf("%lld\n",a);
	return 0;
}

Measured memory_bytes: 28160
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.UncheckedIOException;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author mikit
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        LightScanner in = new LightScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        APrefixAndSuffix solver = new APrefixAndSuffix();
        solver.solve(1, in, out);
        out.close();
    }

    static class APrefixAndSuffix {
        public void solve(int testNumber, LightScanner in, PrintWriter out) {
            int n = in.ints();
            String s = in.string(), t = in.string();
            for (int i = 0; i <= n; i++) {
                if (t.startsWith(s.substring(i))) {
                    out.println(n + i);
                    return;
                }
            }
        }

    }

    static class LightScanner {
        private BufferedReader reader = null;
        private StringTokenizer tokenizer = null;

        public LightScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
        }

        public String string() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new UncheckedIOException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int ints() {
            return Integer.parseInt(string());
        }

    }
}



Measured memory_bytes: 23380
#include <cstdint>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>

int main(void)
{
  int64_t A, B, C;
  std::cin >> A >> B >> C;

  auto check = [&](){
    int64_t value = A;
    int64_t start = value % B;
    int64_t mod = start;
    while (true) {
      if (mod == C) return "YES";
      value += A;
      mod = value % B;
      if (mod == start) break;
    }
    return "NO";
  };

  std::cout << check() << std::endl;

  return 0;
}



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

int main()
{
    double a,b,x;
    cin >> a >> b >> x;
    if(a*a*b/2>=x){
        cout << fixed << setprecision(10) << atan( a*pow(b,2)/2/x )/M_PI*180 << endl;
    }
    else{
        cout << fixed << setprecision(10) << atan( 2*( b/a-x/pow(a,3) ) )/M_PI*180 << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<functional>
#include<math.h>

#define rep(i,n) for(ll i=0;i<(n);i++)
typedef long long ll;
using namespace std;

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

	int m = n % 10;

	string s;
	if (m == 3) s = "bon";
	if (m == 0 || m == 1 || m == 6 || m == 8) s = "pon";
	if (m == 2 || m == 4 || m == 5 || m == 7 || m == 9) s = "hon";
	cout << s << endl;

	return 0;
}

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

#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef complex<double> point;
#define xx real()
#define yy imag()

#define REP(i, a, b) for(int i = (a); i < (int)(b); i++)
#define REPN(i, a, b) for(int i = (a); i <= (int)(b); i++)
#define FA(it, x) for(__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)
#define SZ(x) (int)(x).size()
#define BE(x) (x).begin(), (x).end()
#define SORT(x) sort(BE(x))
#define _1 first
#define _2 second

#define x1 gray_cat_x1
#define y1 gray_cat_y1

template<class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

#define file "I1"

const double EPS = 1e-9;
const double PI = acos(-1.);
const int INF = 1e9;
const ll MOD = 1e9 + 7;

const int MAXN = 2e5 + 5;

int v[MAXN];

void solve(){
	int n;
	scanf("%d", &n);
	REPN(i, 1, n) {
		scanf("%d", &v[i]);
	}
	ll sum = 0ll;
	REPN(i, 1, n + 1) {
		sum += abs(v[i] - v[i - 1]);
	}
	REPN(i, 1, n) {
		ll val = sum - abs(v[i] - v[i - 1]) - abs(v[i] - v[i + 1]) + abs(v[i + 1] - v[i - 1]);
		printf("%lld\n", val);
	}
}   

int main(){

    //freopen(file".in", "r", stdin); freopen(file".out", "w", stdout);
    int t = 1;
    //cin >> t;
    while(t--){
        solve();    
    }
}


Measured memory_bytes: 1664
r, c = map(int, input().split())
table = [[int(x) for x in input().split()] for _ in range(r)]
for row in table:
    row.append(sum(row))
ex_lst = []
for col in zip(*table):
    ex_lst.append(sum(col))
table.extend([ex_lst])

for row in table:
    print(*row)


Measured memory_bytes: 6248
#include <iostream>
#include <string>
using namespace std;
int main() {
    string s, t, u;
    int a, b;
    cin >> s >> t >> a >> b >> u;

    if (u == s)
        a--;
    else
        b--;
    cout << a << " " << b << "\n";
    return 0;
}


Measured memory_bytes: 256
#include<cstdio>

int n;

int isPrime(int x){
	int i;
	if(x<2) return 0;
	else if(x==2) return 1;
	if(x%2==0) return 0;
	for(i=3;i*i<=x;i+=2){
		if(x%i==0) return 0;
	}
	return 1;
}

int main(void){
	scanf("%d", &n);
	printf("%d:", n);
	for(int i = 2; i * i <= n; i++){
		//printf("present i's value is %d\n", i);
		while(1){
			if(isPrime(i) == false || n % i != 0) break;
			printf(" %d", i);
			n /= i;
		}
	}
	if(n != 1) printf(" %d", n);
	printf("\n");
	return 0;
}

Measured memory_bytes: 2712
import java.util.*;

public class Main {
    public static void main(final String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long k = sc.nextLong();
        Map<Integer, Long> map = new TreeMap<>();
        for (int i = 0; i < n; i++) {
            int key = sc.nextInt();
            long value = sc.nextLong();
            long count = map.getOrDefault(key, 0L);
            map.put(key, value + count);
        }

        for (Map.Entry<Integer, Long> e : map.entrySet()) {
            if (k > e.getValue()) {
                k -= e.getValue();
            } else {
                System.out.println(e.getKey());
                return;
            }
        }
    }
}

Measured memory_bytes: 63624
import java.util.*;

public class Main {
    private static long solve(int N, int[] a) {
      long[][] sum = new long[N][N];
      long[][] cost = new long[N][N];
      
      for (int e = 0; e < N; e++)
        for (int s = e; s >= 0; s--){
          sum[s][e] = e > 0 ? sum[s][e-1]+a[e]: a[e];
          cost[s][e] = e == s ? 0: Long.MAX_VALUE;
          for (int m = s; m < e; m++){
            long c = sum[s][m]+sum[m+1][e]
              +cost[s][m]+cost[m+1][e];
            cost[s][e] = Math.min(cost[s][e], c);
          }
        }
      
      return cost[0][N-1];
    }
  
    public static long run(Scanner scanner) {
        int N = scanner.nextInt();
        int[] a = new int[N];
        for (int i=0; i < N; i++) a[i] = scanner.nextInt();

        return solve(N, a);
    }

    public static void main(String[] args) {
        try (Scanner scanner = new Scanner(System.in)) {
            System.out.println(run(scanner));
        }
        //Tests.run();
    }
}

Measured memory_bytes: 24532
local read = setmetatable({}, {__index = function(t, k) local a = {} for i=1,#k do table.insert(a, '*'..string.sub(k, i, i)) end local r = io.read local u = table.unpack or unpack return function() return r(u(a)) end end})
read.N = function(N) local t={} for i=1,N do t[i]=read.n() end return t end
string.totable = function(s) local t={} local u=string.sub for i=1,#s do t[i] = u(s, i, i) end return t end
string.split = function(s) local t={} for w in string.gmatch(s, "[^%s]+") do table.insert(t, w) end return (table.unpack or unpack)(t) end
----
-- returns (b^n) % m
local function modpow(b, n, m)
    if n == 0 then
        return 1
    elseif n % 2 == 0 then
        -- be careful about overflow of b*b
        return modpow(b * b % m, n//2, m)
    else
        return b * modpow(b, n - 1, m) % m
    end
end
local function make_mod_nCr(max, m)
    -- Create n! table
    local mfac = {}
    mfac[0] = 1
    for i=1,max do
        mfac[i] = mfac[i-1] * i % m
    end
    -- Create (n!)^(-1) table
    -- (n!)^(-1) ≡ (n!)^(m - 2)  <mod m>
    local invmfac = {}
    invmfac[max] = modpow(mfac[max], m - 2, m)
    for i=max,1,-1 do
        -- ((a-1)!)^(-1) ≡ a * (a!)^(-1)  <mod m>
        invmfac[i-1] = i * invmfac[i] % m
    end
    -- returns nCr % m
    local function mod_nCr(n, r)
        -- nCr ≡ n! * (r!)^(-1) * ((n-r)!)^(-1)  <mod m>
        local a = mfac[n] * invmfac[r] % m
        a = a * invmfac[n-r] % m
        return a
    end
    return mod_nCr
end
----
local MOD = math.floor(10^9) + 7
local mod_nCr = make_mod_nCr(math.floor(10^6) + 1, MOD)
local X, Y = read.nn()
if (X/2) <= Y and Y <= 2*X then
    if (X+Y) % 3 == 0 then
        local num = (X+Y) // 3 + 1
        local basex = (X+Y) // 3
        local fromL = X - basex + 1
        print(mod_nCr(num-1, fromL-1))
    else
        print(0)
    end
else
    print(0)
end



Measured memory_bytes: 50136
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        
        System.out.println(n*a>b?b:n*a);
    }
}


Measured memory_bytes: 21844
#include<stdio.h>
char c;
int N, A, i;
int main(void){
	c=getchar();
	while(c!=10){N=N*10+(c-'0'); c=getchar();}
	for(i=0; i<N; i++){
		c=getchar();
		while(c!=10){A=c; c=getchar();}
		if(A%2){
			printf("first\n");
			return 0;
		}
	}
	printf("second\n");
	return 0;
}


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

typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;
#define MP make_pair
#define PB push_back
#define X first
#define Y second

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for(int i = (b) - 1; i >= (a); --i)
#define ALL(a) a.begin(), a.end()
#define SZ(a) (int)((a).size())
#define FILL(a, value) memset(a, value, sizeof(a))
#define debug(a) cout << #a << " = " << a << endl;

const double PI = acos(-1.0);
const LL INF = 1e9 + 47;
const LL LINF = INF * INF;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	
	int n;
	cin >> n;
	VI a(n);
	int N= n;
	FOR(i, 0, N) cin>> a[i];
	int ans = 0;
	FOR(i, 0, N) FOR(j, i + 1, N) ans += a[i] * a[j];
	cout << ans;
	return 0;
}



Measured memory_bytes: 256
// clang-format off
#include <bits/stdc++.h>

#define mp make_pair
#define fst first
#define snd second
#define forn(i,n) for (int i = 0; i < int(n); i++)
#define forn1(i,n) for (int i = 1; i <= int(n); i++)
#define popcnt __builtin_popcount
#define ffs __builtin_ffs
#define ctz __builtin_ctz
#define clz __builtin_clz
#define all(a) (a).begin(), (a).end()
 
using namespace std;

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pli = pair<ll,int>;
using pil = pair<int,ll>;
using pll = pair<ll,ll>;
template <typename T> using vec = vector<T>;
using vi = vec<int>;
using vl = vec<ll>;
template <typename T> using que = queue<T>;
template <typename T> using deq = deque<T>;

template <typename T> T id(T b) {return b;};
template <typename T> void chmax(T &x, T y) {if (x < y) x = y;}
template <typename T> void chmin(T &x, T y) {if (x > y) x = y;}
template <typename S, typename K> bool contains(S &s, K k) { return s.find(k) != s.end(); }
void fastio() { ios_base::sync_with_stdio(false); cin.tie(nullptr); }
constexpr ll TEN(int n) { if (n == 0) return 1LL; else return 10LL*TEN(n-1); }
// clang-format on

const int MAX_N = 1000, MAX_H = 10000;
int h, n;
int a[MAX_N];
int b[MAX_N];
int dp[MAX_H + 1];

int main() {
    fastio();

    cin >> h >> n;
    forn(i, n) {
        cin >> a[i] >> b[i];
    }

    fill_n(dp, h + 1, INT_MAX);
    dp[h] = 0;
    for (int i = h; i > 0; i--) {
        if (dp[i] == INT_MAX) continue;
        forn(j, n) {
            chmin(dp[max(0, i - a[j])], dp[i] + b[j]);
        }
    }

    cout << dp[0] << endl;

    return 0;
}

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

int main(void){
    ll N, K;
    ll p[1000];
    cin >> N >> K;
    rep(i, N){cin >> p[i];}

    sort(p, p + N);

    ll ans = 0;
    rep(i, K){
        ans += p[i];
    }

    cout << ans << endl;
}


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

int main(void) {
  int N, M;
  map<string, int> mp;
  cin >> N;
  vector<string> s(N);
  for (int i = 0; i < N; i++) {
    cin >> s[i];
    // if (mp.find(s[i]) == mp.end()) mp[s[i]] = 0;
    // else 
      mp[s[i]]++;
  }
  cin >> M;
  vector<string> t(M);
  for (int i = 0; i < M; i++) {
    cin >> t[i];
    // if (mp.find(t[i]) == mp.end()) mp[t[i]] = 0;
    // else
      mp[t[i]]--;
  }

  int ret = 0;
  for (auto m : mp) {
    ret = max(ret, m.second);
  }
  cout << ret << endl;

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define MOD 1000000007
//for(int i=0; i<n; ++i)
using namespace std;
#define ll long long
#define all(c) c.begin(), c.end()
#define watch(x) cout << (#x) << " is " << (x) << endl

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

    string s;
    cin >> s;

    if (s == "Sunny")
        cout << "Cloudy";
    if (s == "Cloudy")
        cout << "Rainy";
    if (s == "Rainy")
        cout << "Sunny";
    cout << 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 P(x) cout << (x) << "\n"

#define MOD 1e9+7
#define PI acos(-1.0)
#define ll long long
//---------------------------

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

  // ifstream in("input.txt");
  // cin.rdbuf(in.rdbuf());

  char buf[9];
  REP(i,9)cin>>buf[i];
  cout << buf[0] << buf[4] << buf[8] << "\n";
  return 0;
}


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

int main() {
    string s;
    cin >> s;
    int n = s.size() + 1;

    vector<int> a(n, 0);

    for (int i = 0; i < s.size(); i++) {
        if (s.at(i) == '<') {
            a.at(i + 1) = max(a.at(i + 1), a.at(i) + 1);
        }
    }

    for (int i = s.size() - 1; i >= 0; i--) {
        if (s.at(i) == '>') {
            a.at(i) = max(a.at(i), a.at(i + 1) + 1);
        }
    }

    long long sum = 0;
    for (int i = 0; i < a.size(); i++) {
        sum += a.at(i);
    }
    cout << sum << endl;
}


Measured memory_bytes: 2820
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
//#define int long long
template<typename T> inline bool chmax(T& a,T b) { if (a < b) { a = b; return true; } return false; }
template<typename T> inline bool chmin(T& a,T b) { if (a > b) { a = b; return true; } return false; }

int main() {
    int w[2], s[2], e, f;
    cin >> w[0] >> w[1] >> s[0] >> s[1] >> e >> f;
    w[0] *= 100; w[1] *= 100;
    int suger[3500] = {0};
    for (int i = 0; i <= 3100; i++) {
        chmax(suger[i+s[0]], suger[i] + s[0]);
        chmax(suger[i+s[1]], suger[i] + s[1]);
    }
    double ca = 0;
    int ans1 = 0, ans2 = 0;
    for (int s = 0; s <= f; s++) for (int t = 0; t <= f; t++) {
        int water = s*w[0] + t*w[1];
        if (water > f) continue;
        int su = min(f-water, suger[(water/100)*e]);
        double con = (double)(100*su)/(water+su);
        if (chmax(ca, con)) {
            ans1 = water+su;
            ans2 = su;
        }
    }
    if (ca == 0) ans1 = w[0];
    cout << ans1 << " " << ans2 << endl;
    return 0;
}

Measured memory_bytes: 256
/**
*    created: 03.07.2020 02:18:27
**/
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// using bint = boost::multiprecision::cpp_int;
using namespace std;
#define int long long
#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++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define pcnt(bit) __builtin_popcountll(bit)
template<class T> bool chmax(T &a, const T &b) {if (a < b) {a = b; return 1;} return 0;}
template<class T> bool chmin(T &a, const T &b) {if (b < a) {a = b; return 1;} return 0;}
const long double pi = acos(-1.0);
const int INF = 1LL << 60;
const int MOD = 1000000007;
// const int MOD = 998244353;

signed main() {

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

    int n;
    cin >> n;
    map<int,int> mp;
    rep(i,n) {
        int t;
        cin >> t;
        mp[t]++;
    }
    int ans = 0;
    for (auto p : mp) {
        if (p.first < p.second) ans += p.second - p.first;
        else if (p.first > p.second) ans += p.second;
    }
    cout << ans << endl;
    return 0;
}

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

using ll = long long;

const int INF = 1001001001;
const ll INF_LL = 1001001001001001001LL;

int main(void){
  int n; cin >> n;
  vector<int> p(n); rep(i,n) cin >> p[i];
  sort(p.begin(),p.end());
  p[n-1] /= 2;

  int ans = 0;
  rep(i,n) ans+=p[i];
  cout << ans << endl;
  
  return 0;
}


Measured memory_bytes: 3608
#include <fstream>
#include <iostream>
#include <vector>
#include <cstring>
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define Nmax 1000005
#define INF 1000000000
#define MOD 1000000007
 
using namespace std;

int main()
{
    
    // #ifndef ONLINE_JUDGE
    //     freopen ("data.in","r",stdin);
    //     freopen ("E.out","w",stdout);
    // #endif
    cin.sync_with_stdio( false );

    int tests=1;
    // cin>>tests;
    while(tests--)
    {
   		ll n,i,j,k;
   		cin>>n;
   		vector<ll>a(n+1),nodes(n+1,0);
   		for(i=0;i<=n;i++) cin>>a[i];
   		if(a[0]>1) {cout<<-1; return 0;}
   		if(a[0]==1)
   		{
   			bool flag=true;
   			for(i=1;i<=n;i++)
   			{
   				if(a[i]!=0) flag=false;
   			}
   			if(flag) cout<<1;
   			else cout<<-1;
   			return 0;
   		}

   		nodes[n]=a[n];
   		ll next=nodes[n];
   		bool flag=true;
   		for(i=n-1;i>=0;i--)
   		{
   			nodes[i]=next+a[i];
   			next=nodes[i];
   		}

   		nodes[0]=1;
   		next=2LL;
   		for(i=1;i<=n;i++)
   		{
   			if(a[i]>next) {flag=false;break;}
   			if(nodes[i]>next) nodes[i]=next;
   			next=(nodes[i]-a[i])*2LL;
   		}
   		if(nodes[n]!=a[n]) flag=false;
   		
   		if(!flag) cout<<-1;
   		else
   		{
   			ll sum=0;
   			for(i=0;i<=n;i++) sum+=nodes[i];
   			cout<<sum;
   		}

   	}
    	return 0;
    
}

Measured memory_bytes: 4840
#include <bits/stdc++.h>
#include <algorithm>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<(n);++i)
#define all(x) (x).begin(), (x).end()
#define PB(x) push_back(x)
#define MP(x,y) make_pair(x,y)
using namespace std;
typedef long long ll;
 
int main() {

    int k;
    cin >> k;
    if(k%2==0) {
        cout<<(k/2)*(k/2)<<endl;;
    }
    else {
        cout<<((k+1)/2)*(k/2)<<endl;
    }

 return 0;
}

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

#define MAX 100000
#define INF (1<<29)

typedef struct{
  char mark;
  int num;
} Card;

int getMarkNumber(char);
void swap(Card*,Card*);
int partition(int,int,Card*);
void quickSort(int,int,Card*);
void merge(int,int,int,Card*);
void mergeSort(int,int,Card*);

int main(){
  int n,i,isStable;
  Card A[MAX],B[MAX];

  scanf("%d\n",&n);
  for(i = 0 ; i < n ; i++){
    scanf("%c%d\n",&A[i].mark,&A[i].num);
    B[i] = A[i];
  }
  quickSort(0,n-1,A);
  mergeSort(0,n,B);
  isStable = 1;
  for(i = 0 ; i < n ; i++){
    if(A[i].mark != B[i].mark || A[i].num != B[i].num){
      isStable = 0;
      break;
    }
  }
  printf("%s\n",(isStable ? "Stable" : "Not stable"));
  for(i = 0 ; i < n ; i++){
    printf("%c %d\n",A[i].mark,A[i].num);
  }
  return 0;
}

int getMarkNumber(char x){
  if(x == 'S'){ return 0; }
  if(x == 'H'){ return 1; }
  if(x == 'C'){ return 2; }
  return 3;
}

void swap(Card *a,Card *b){
  Card tmp = *a;
  *a = *b;
  *b = tmp;
}

int partition(int l,int r,Card *A){
  int x = A[r].num,i = l,j;
  for(j = l ; j < r ; j++){
    if(A[j].num <= x){
      swap(&A[i++],&A[j]);
    }
  }
  swap(&A[i],&A[r]);
  return i;
}

void quickSort(int l,int r,Card *A){
  int q;
  if(l < r){
    q = partition(l,r,A);
    quickSort(l,q-1,A);
    quickSort(q+1,r,A);
  }
}

void merge(int left, int mid, int right,Card *B){
  int n1 = mid - left,n2 = right - mid,i,j,k;
  Card L[n1+1],R[n2+1];
 
  for(i = 0 ; i < n1 ; i++){
    L[i] = B[left + i];
  }
  for(i = 0 ; i < n2 ; i++){
    R[i] = B[mid + i];
  }
  L[n1] = R[n2] = (Card){'#',INF};
  for(i = 0,j = 0,k = left ; k < right ; k++){
    if(L[i].num <= R[j].num){
      B[k] = L[i++];
    }else{
      B[k] = R[j++];
    }
  }
}
 
void mergeSort(int left,int right,Card *B){
  int mid;
  if(left + 1 < right){
    mid = (left + right) / 2;
    mergeSort(left,mid,B);
    mergeSort(mid,right,B);
    merge(left,mid,right,B);
  }
}


Measured memory_bytes: 4012
#include <iostream>

using namespace std;

int main(){
  long long n;
  cin >> n;
  if(n%2==1){
    cout << 0;
  }else{
    long long x=n/10, y=0;
    while(x!=0){
      y+=x;
      x/=5;
    }
    cout << y;
  }
}

Measured memory_bytes: 3636
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;

#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a, ll b){return a/gcd(a,b)*b;}




int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  ll N ; cin >> N;
  ll K ; cin >> K;
  vector<pair<ll,ll> >ab;
  rep(i,N){
    ll a,b; cin >> a >> b ;
    ab.pb(mp(a,b));
  }
  sort(all(ab));

  
  rep(i,ab.size()){
    K-=ab[i].second;
    if(K<= 0) {cout << ab[i].first << endl; return 0;}
  }
  
  
  //cout << fixed << setprecision(16) << ans << endl;
  return 0;
}


Measured memory_bytes: 2420
s = list(str(input()))
ans = False
if 'C' in s:
    c_index = s.index('C')
    for i in range(len(s)):
        char = s[len(s) - i - 1]
        if char == 'F':
            f_index = len(s) - i - 1
            if c_index < f_index:
                ans = True
if ans:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define ll long long
#define mod 1000000007
#define pb push_back
#define pi pair<int, int>
#define pll pair<ll, ll>
#define inf 1000000000000000000
using namespace std;

int n, maxi;
int a[16][16];

ll dp[65536], sub_sum[65536];

ll get_sum(int next){
	vector<int> v;
	ll sum = 0;
	for(int num = 1, pos = 0; num <= maxi, pos < n; num <<= 1, pos++){
		if((next & num)){
			v.pb(pos);
		}
	}
	for(int i = 0; i < v.size(); i++){
		for(int j = i + 1; j < v.size(); j++){
			sum += a[v[i]][v[j]];
		}
	}
	return sum;
}

ll fun(int cur){
	if(dp[cur] != inf){
		return dp[cur];
	}
	dp[cur] = 0;
	int rem = maxi ^ cur;
	for(int next = maxi; next != 0; next--){
		next = (rem & next);
		if(next == 0){
			break;
		}
		ll sum = sub_sum[next] + fun(cur | next);
		dp[cur] = max(dp[cur], sum);
	}
	return dp[cur];
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin>>n;
	maxi = (1 << n) - 1;
	int i, j;
	for(i = 0; i < n; i++){
		for(j = 0; j < n; j++){
			cin>>a[i][j];
		}
	}
	for(i = 0; i < maxi; i++){
		dp[i] = inf;
	}
	for(i = 0; i <= maxi; i++){
		sub_sum[i] = get_sum(i);
	}
	dp[maxi] = 0;
	cout<<fun(0)<<endl;
	return 0;
}

Measured memory_bytes: 1280
// Great-circular distance
// Reference: https://ja.wikipedia.org/wiki/大円距離

package main

import (
	"bufio"
	"os"
	"strings"
	"strconv"
	"math"
	"fmt"
)

var scanner = bufio.NewScanner(os.Stdin)
const (
	R = 6378.1
	M = math.Pi/180
)

func main() {
	for scanner.Scan() {
		buf := strings.Split(scanner.Text(), " ")
		input := make([]float64, len(buf))
		for i := range input {
			input[i], _ = strconv.ParseFloat(buf[i], 64)
		}
		if input[0] == -1 && input[1]== -1&&
			input[2] == -1 && input[3] == -1 {
			break
		}
		y1, x1, y2, x2 := input[0], input[1], input[2], input[3]
		a := math.Cos(y1*M)*math.Cos(y2*M)*math.Cos((x1-x2)*M) +
			math.Sin(y1*M)*math.Sin(y2*M)
		fmt.Println(int(R*math.Acos(a)+0.5))
	}
}



Measured memory_bytes: 1088
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <cassert>
#include <random>

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

using namespace std;
typedef long long int ll;
const ll INF = 10000000000;
const double PI = acos(-1);
const ll mod = 1000000007;

set<int> s;

// aとbの最大公約数を求める関数
template <class T>
T gcd(T a, T b) {
    if (b == 0) return a;
    return gcd(b, a % b);
}

// 約数を列挙する関数
bool CalcDivisor(int n) {
    for (int i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            if (i != 1 && s.count(i)) return false;
            s.insert(i);
            if (i * i != n) {
                if (n/i != 1 && s.count(n / i)) return false;
                s.insert(n / i);
            }
        }
    }
    return true;
}

int main()
{
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];

    int all_gcd = a[0];
    rep(i, n - 1) {
        all_gcd = gcd(all_gcd, a[i + 1]);
    }

    bool is_pair_prime = true;
    rep(i, n) {
        bool is_ok = CalcDivisor(a[i]);
        if (!is_ok) {
            is_pair_prime = false;
            break;
        }
    }

    if (all_gcd == 1) {
        if (is_pair_prime) {
            cout << "pairwise coprime" << endl;
        }
        else {
            cout << "setwise coprime" << endl;
        }
    }
    else {
        cout << "not coprime" << endl;
    }
    return 0;
}


Measured memory_bytes: 7264
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    vector<vector<int>> vec(n,vector<int>(2,0));
    for(int i=0;i<n;i++){
       int a;
       cin>>a;
       for(int j=0;j<2;j++){
           vec.at(i).at(0)=a;
           vec.at(i).at(1)=i+1;
       }
    }
    sort(vec.begin(), vec.end());
    for(int i=0;i<n;i++){
        cout<<vec.at(i).at(1)<<" ";
    }
}

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

template<class T> void vin(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
}

int N;
vector<int> G[201];
int match[201];
bool used[201];

vector<pair<P, int>> red, blue;

void add_edge(int u, int v) {
    G[u].push_back(v);
    G[v].push_back(u);
}

bool dfs(int v) {
    used[v] = true;
    rep(i, G[v].size()) {
        int u = G[v][i], w = match[u];
        if (w < 0 or !used[w] and dfs(w)) {
            match[v] = u;
            match[u] = v;
            return true;
        }
    }
    return false;
}

int bima() {
    int res = 0;
    fill(match, match+201, -1);
    rep(v, N) {
        if (match[v] < 0) {
            fill(used, used+201, false);
            if (dfs(v)) res++;
        }
    }
    return res;
}

int main() {
    cin >> N;
    rep(i, N) {
        int a, b;
        cin >> a >> b;
        pair<P, int> tmp = make_pair(make_pair(a, b), i);
        red.push_back(tmp);
    }
    rep(i, N) {
        int a, b;
        cin >> a >> b;
        pair<P, int> tmp = make_pair(make_pair(a, b), i+N);
        blue.push_back(tmp);
    }
    rep(i, N) {
        rep(j, N) {
            pair<P, int> re = red[i];
            pair<P, int> bl = blue[j];
            P r = re.first, b = bl.first;
            if (r.first < b.first and r.second < b.second) {
                add_edge(re.second, bl.second);
            }
        }
    }
    cout << bima() << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
typedef long long ll;
ll MOD = 1e9+7;

using namespace std;

int inc[100000];
int a[100000];
int de[100000];

int cnt[100001];

int main()
{
	int n;
	int ans=0;
	fill(cnt,cnt+100002,0);
	
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		inc[i]=a[i]+1;
		de[i]=a[i]-1;
	}

	for(int i=0;i<n;i++)
	{
		cnt[a[i]]++;
		cnt[inc[i]]++;
		cnt[de[i]]++;
	}

	int mindex=0;
	for(int i=1;i<100002;i++)
	{
		if(cnt[i]>cnt[mindex])
			mindex=i;
	}
	cout<<cnt[mindex]<<endl;
	return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}

int main() {
	int k; cin >> k;
	int ans;
	if (k%2==0) ans = k*k/4;
	else ans = k/2 * (k/2+1); 
	cout << ans << endl;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
using namespace std;
const long long MAXN=500005,MOD=1e9+7,p=131;
long long hash[MAXN];
long long bitp[MAXN];
char s[MAXN];
long long l[MAXN],r[MAXN],len;
long long Hash(long long x,long long y)
{
	return ((hash[y]-hash[x-1]*bitp[y-x+1])%MOD+MOD)%MOD;
}
bool check()
{
	for(long long i=2;i<=len;i++)
		if(s[i]!=s[i-1])
			return 0;
	return 1;
}
int main()
{
	scanf("%s",s+1);
	len=strlen(s+1);
	if(check())
	{
		printf("%lld\n1\n",len);
		return 0;
	}
	bitp[0]=1;
	for(long long i=1;i<=len;i++)
	{
		hash[i]=(hash[i-1]*p+s[i])%MOD;
		bitp[i]=(bitp[i-1]*p)%MOD;
	}
	for(long long d=1;d<=len;d++)
		for(long long i=2*d;i<=len;i+=d)
			if(Hash(1,i-d)==Hash(d+1,i))
				l[i]=1;
	for(long long d=1;d<=len;d++)
		for(long long i=len-2*d+1;i>=1;i-=d)
			if(Hash(i+d,len)==Hash(i,len-d))
				r[i]=1;
	long long ans=0;
	for(long long i=1;i<=len;i++)
	{
		if(!l[i]&&!r[i+1])
			ans++;
	}
	if(!l[len])
		printf("1\n1\n");
	else
		printf("2\n%lld\n",ans);
}

Measured memory_bytes: 16256
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;;
#define MEM(a,b) memset((a),(b),sizeof(a))
const LL INF = 1e9 + 7;
const int N = 4e2 + 10;
int dp[N][N];
int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	LL s, c;
	cin >> s >> c;
	LL o = min(s, c / 2);
	c -= 2 * o;
	cout << o + c / 4 << endl;
	return 0;
}

Measured memory_bytes: 256
use proconio::marker::Usize1;
fn main() {
    proconio::input! {
        n: usize,
        m: usize,
        h: [i32;n],
        ab: [(Usize1,Usize1);m],
    }
    let mut g = vec![vec![];n];
    for (a,b) in ab {
        g[a].push(b);
        g[b].push(a);
    }
    let mut c=n;
    for i in 0..n {
        for &j in &g[i] {
            if h[i]<=h[j] {
                c-=1;
                break;
            }
        }
    }
    println!("{}",c);
}

Measured memory_bytes: 11916
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll maxn = 1e5 + 5;
const ll maxm = 1e3 + 5;
namespace IO{
    const int SIZE = (1 << 20) + 1;
    char ibuf[SIZE], *iS, *iT, obuf[SIZE],*oS = obuf, *oT = obuf + SIZE - 1;
    char _st[55];
    int _qr = 0;
    inline char gc(){
        return (iS == iT ? iT = (iS = ibuf) + fread(ibuf, 1, SIZE, stdin), (iS == iT ? EOF : *iS++) : *iS++);
    }
    inline void qread(){}
    template<class T1, class ...T2>
    inline void qread(T1 &IEE, T2&... ls){
        register T1 __ = 0, ___ = 1;
        register char ch;
        while(!isdigit(ch = gc())) ___ = (ch == '-') ? -___ : ___;
        do{
            __ = (__ << 1) + (__ << 3) + (ch ^ 48);
        }while(isdigit(ch = gc()));
        __ *= ___;
        IEE = __;
        qread(ls...);
        return ;
    }
    inline void flush(){
        fwrite(obuf, 1, oS - obuf, stdout);
        oS = obuf;
        return ;
    }
    inline void putc_(char _x){
        *oS++ = _x;
        if(oS == oT) flush();
    }
    inline void qwrite(){}
    template<class T1, class ...T2>
    inline void qwrite(T1 IEE, T2... ls){
        if(!IEE) putc_('0');
        if(IEE < 0) putc_('-'), IEE = -IEE;
        while(IEE) _st[++_qr] = IEE % 10 + '0', IEE /= 10;
        while(_qr) putc_(_st[_qr--]);
        qwrite(ls...);
        return ;
    }
    struct Flusher_{~Flusher_(){flush();}}io_flusher;
}
using namespace IO;
ll n, q, s, x, y;
ll a[maxn], cnt[maxn];
int main(){
    cin >> n;
    for(int i = 1;i <= n;i++){
        cin >> a[i];
        s += a[i];
        cnt[a[i]]++;
    }
    cin >> q;
    for(int i = 1;i <= q;i++){
        cin >> x >> y;
        s -= cnt[x] * x;
        s += cnt[x] * y;
        cnt[y] += cnt[x];
        cnt[x] = 0;
        cout << s << endl;
    }
    return 0;
}

Measured memory_bytes: 5076
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int sum = sc.nextInt();
        int h, m, s;
        h = sum/3600;
        m = (sum%3600)/60;
        s = (sum%3600)%60;
        System.out.println(h + ":" + m + ":" + s);
    }
}


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

int nc[100005];

int main(){
	int n,x,ms=0;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>x;
		nc[x+2]++;
	}
	for(int i=1;i<100005;i++) ms=max(ms,nc[i-1]+nc[i]+nc[i+1]);
	cout<<ms<<endl;
	return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
stack<char>s;
int main(void)
{
    int n;
    cin>>n;
    string x;
    cin>>x;
    for(int i=0;i<n;i++)
    {
        if(!s.empty()&&x[i]==')'&&s.top()=='(')
        {
            s.pop();
        }
        else
        {
            s.push(x[i]);
        }
    }
    char ch;
    while(!s.empty())
    {
        ch=s.top();
        if(ch==')')
        {
            x.insert(x.begin(),'(');
        }
        else
        {
            x.push_back(')');
        }
        s.pop();
    }
    cout <<x<<endl;
    return 0;
}


Measured memory_bytes: 256
N,Q=map(int,input().split())
S=input()
Sum=[0,0]
for i in range(1,N):
    if S[i-1]=='A'and S[i]=='C':
        Sum.append(Sum[-1]+1)
    else:
        Sum.append(Sum[-1])
for i in range(Q):
    l,r=map(int,input().split())
    print(Sum[r]-Sum[l])

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


int main(){
    int Ans=0;
    string S  ;
    cin >>  S ;
    int h[26]={};
    REP(i,S.size()){
        h[S[i]-'a']++;
    }
    REP(i,26){
        if(h[i]>=2){
            cout << "no" << endl;
            return 0;
        }
    }
    
    cout << "yes" << endl;
    return 0;
}


Measured memory_bytes: 256
a,b,c,d=map(int,input().split())
if a<=c<=b<=d:
  print(b-c)
elif c<=a<=d<=b:
  print(d-a)
elif a<=c<=d<=b:
  print(d-c)
elif c<=a<=b<=d:
  print(b-a)
else:print(0)

Measured memory_bytes: 38384
#include <stdio.h>
#include <string.h>
int main()
{
    char t[100000],a[50000];
    int i,j=0;
    gets(t);
    for(i=0;t[i];i++)
        if((i+3)%2==1)
            a[j++]=t[i];
    a[j]='\0';
    puts(a);
    return 0;
}


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

#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define repp(i, n, m) for(int (i) = (n); (i) < (m); (i)++)
#define repn(i, n) for(int (i) = 1; (i) <= (n); (i)++)
#define repr(i, n) for(int (i) = (n-1); (i) >= 0; (i)--)
#define all(x) (x).begin(), (x).end()
#define lint long long
#define ulint unsigned long long
#define ldou long double
#define fi first
#define se second
#define setpre(x) std::cout << fixed << setprecision(x)
#define ii(x) int x; cin >> (x)
#define ii2(x, y) int x, y; cin >> (x) >> (y)
#define ii3(x, y, z) int x, y, z; cin >> (x) >> (y) >> (z)
#define out(x) cout << (x) << endl
#define outs(x) cout << (x) << " "
#define yn(x) cout << ((x)?("Yes"):("No")) << endl
#define YN(x) cout << ((x)?("YES"):("NO")) << endl
#define bit_c(x) __builtin_popcountll(x)

inline void logger(){ std::cout << " [LOGGER] " << endl; }
template<typename A, typename... B>
void logger(const A& a, const B&... b){
    cout << a << " , "; logger(b...);
}

typedef pair<lint, lint> P;
const lint MOD = 1000000007;
const lint MOD9 = 998244353;
const lint INF = MOD * MOD;
const int MAX = 200005;

/* ...o(^-^)o... */

int main(){
    int n, m; cin>>n>>m;
    vector<lint> h(n);
    vector<int> to[MAX];
    rep(i, n) cin >> h[i];
    rep(i, m){
        int a,b; cin>>a>>b; a--; b--;
        to[a].push_back(b); to[b].push_back(a);
    }

    int ans = 0;
    rep(i, n){
        bool ok=true;
        for(int j: to[i]){
            if(h[i]<=h[j]){
                ok = false; break;
            }
        }
        if(ok) ans++;
    } out(ans);
}


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

namespace ABC79_A
{
    class Program
    {
        static void Main(string[] args)
        {

            var n =Console.ReadLine();
            for (int i = 0; i < n.Length-2; i++)
            {
                if(n[i] == n[i + 1] && n[i+1] == n[i + 2])
                {
                    Console.WriteLine("Yes");
                    return;
                }
            }

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


Measured memory_bytes: 11092
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Convert;
using static System.Math;
//using static System.Globalization.CultureInfo;

class Program
{
    static void Main(string[] args)
    {
        var num = Input.num;
        var ar = Enumerable.Repeat(0, num).Select(v => Input.num).ToArray();
        var list = new List<int>() { ar[0] };
        for(var i = 1; i < num; i++)
        {
            if (list[list.Count - 1] < ar[i]) list.Add(ar[i]);
            else list[Search.LowerBound(list.ToArray(), ar[i])] = ar[i];
        }
        WriteLine(list.Count());
    }
}

public class Input
{
    public static string read => ReadLine();
    public  static int[] ar => Array.ConvertAll(read.Split(' '), int.Parse);
    public  static int num => ToInt32(read);
    public  
static long[] arL => Array.ConvertAll(read.Split(' '), long.Parse);
    public  static long numL => ToInt64(read);
    public static int[][] twodim(int num)
        => Enumerable.Repeat(0, num).Select(v => ar).ToArray();
    public static long[][] twodimL(int num)
        => Enumerable.Repeat(0, num).Select(v => arL).ToArray();
    public  const string Alfa = "abcdefghijklmnopqrstuvwxyz";
    public  const int MOD = 1000000007;
}

public class Search
{
    public static int UpperBound<T>(T[] array,T value)
        where T:IComparable<T>
    {
        var low = 0;
        var high = array.Length;
        while (high > low)
        {
            var mid = (high + low) / 2;
            if (array[mid].CompareTo(value) == 1) high = mid;
            else low = mid + 1;
        }
        return low;
    }

    public static int LowerBound<T>(T[] array,T value)
        where T : IComparable<T>
    {
        var low = 0;
        var high = array.Length;
        while (high > low)
        {
            var mid = (high + low) / 2;
            if (array[mid].CompareTo(value) != -1) high = mid;
            else low = mid + 1;
        }
        return low;
    }
}



Measured memory_bytes: 39220
#include <iostream>
//#include <set>
//#include <map>
//#include <iomanip>
//#include <algorithm>
//#include <numeric>
//#include <queue>
//#include <stack>
//#include <math.h>
//#include <vector>
#include <string>
//#include <list>
//#include <deque>
//#include <unordered_map>
typedef long long LL;
//typedef long double LD;
using namespace std;
 
//#define MOD 1000000007
//#define MAX 100100
//#define NIL -1

int main() {
    string n;
    bool ans=false;
    cin >> n;
    for(int i=0; i<n.size(); i++){
        if(n[i]=='7'){
            ans = true;
        }
    }

    if(ans==true){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 3604