akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>

using namespace std;

int main()
{
  int N;
  cin >> N;
  int p = 0, w = 0, g = 0, y = 0;
  for( int i=0;i<N;i++ )
    {
      string S;
      cin >> S;
      if( S == "P")
	p = 1;
      else if( S == "W")
	w = 1;
      else if( S == "G")
	g = 1;
      else if( S == "Y")
	y = 1;	
    }

  if( p+w+g+y == 4)
    cout << "Four" << endl;
  else
    cout << "Three" << endl;
}


Measured memory_bytes: 256
process.stdin.resume();
process.stdin.setEncoding('utf-8');
process.stdin.on('data', function(chunk) {


 var inputs = chunk.toString().trim().split('\n').map(Number);
    for (var i = 0; i < inputs.length; i++) {
        if (inputs[i] === 0) {
            break;
        }
        console.log('Case ' + (i + 1) + ': ' + inputs[i]);
    }

});

Measured memory_bytes: 20640
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;

class AtCoder
{
    const int MOD = 1000000007;
    public void Slove()
    {
        var a = int.Parse(Console.ReadLine());
        Console.WriteLine(a * a * 3);
    }
    static void Main()
    {
        var ac = new AtCoder();
        ac.Slove();
    }
}

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

using namespace std;

#define ALL(x) x.begin(), x.end()
#define MOD ((int)1e9+7)

typedef long long int lld;
typedef pair<int, int> pii;

const int maxn = 3000;

double dp[maxn][maxn];
double p[maxn];

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

	int n = 0;
	cin >> n;

	for (int i = 0; i < n; i++) {
		cin >> p[i];
	}

	dp[0][0] = p[0];
	dp[0][1] = 1 - p[0];

	for (int i = 1; i < n; i++) {
		dp[i][0] = dp[i - 1][0] * p[i];
	}

	for (int i = 1; i < n; i++) {
		for (int j = 1; j <= i + 1; j++) {
			dp[i][j] = dp[i - 1][j - 1] * (1 - p[i]) + dp[i - 1][j] * p[i];
		}
	}

	double ans = 0;
	
	for (int i = 0; i < ceil((double)n / 2); i++) {
		ans += dp[n - 1][i];
	}
	
	cout << fixed;
	cout.precision(15);
	cout << ans << endl;
	
}

Measured memory_bytes: 68992
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
#include <functional> // for less
/*
#pragma GCC optimize ("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
*/

#define FASTIO ios::sync_with_stdio(0); cin.tie(0);
#define show(x) cout << #x << " = " << x << "\n"
#define mem( a , b ) memset( a , b , sizeof a )
#define popcnt(x) __builtin_popcount(x)
#define all(x) x.begin() , x.end()
#define mod(x,m) ((x%m + m )%m)
#define SZ(a) (int)a.size()
#define ll  long long
#define ld  long double
#define vii vector  <ll>
#define dqi deque   <ll>
#define sii set     <ll>
#define vpi vector  <pii>
#define mii map     <ll,ll>
#define pii pair    <ll,ll>
#define pi  pair    <int,int>
#define pb  push_back
#define F   first
#define S   second
#define L   length()
#define OO  (ll)1e18
#define lSOne(x)(x&-x)
#define EPS 1e-20
using namespace std;
using namespace __gnu_pbds;
void ONLINE__JUDGE();

template<typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag,
tree_order_statistics_node_update>;

pii swapii( pii pr ){ return { pr.S , pr.F }; }
ll binEXP( ll x , ll pw , ll MOD = LLONG_MAX );
int dx[] = {  0 ,  0 , -1 , +1 , -1 , +1 , -1 , +1 };
int dy[] = { -1 , +1 ,  0 ,  0 , -1 , +1 , +1 , -1 };

const ll MOD = 1e9 + 7;
const ll MAX = 2e5 + 9;

string s , t;
//sii adj[120];
vii adj[30];

bool stop(){
    vector<bool> vis (30 , 0);
    for ( char i : s ){
        vis[ i - 'a' ] = 1;
    }
    for ( char i : t ){
        if ( !vis[ i - 'a' ] ) return 1;
    }
    return 0;
}

int main(){
    FASTIO //ONLINE__JUDGE();

    cin >> s >> t;
    if ( stop() ){
        return cout << -1 , 0;
    }

    for ( int i = 0; i < (int)s.L; ++i ){
        //adj[ s[i] ].insert( i );
        adj[ s[i] - 'a' ].pb( i );
    }

    ll l = 0 , r = 0 , cnt = 0; bool ok = 1;
    while ( r < t.L ){
        if ( adj[ t[r] - 'a' ].empty() ){
            return cout << -1 , 0;
        }
        auto it = upper_bound( all(adj[ t[r] - 'a' ]) , l + (ok ? -5 : 0) );
        ok = 0;

        if ( it == adj[ t[r] - 'a' ].end() ){
            //int idx = *adj[ t[r] ].begin();
            int idx = adj[ t[r] - 'a' ][0];
            cnt += s.L - l; l = 0;

            //cout << cnt; exit(0);
            cnt += idx ;
            l = idx; r++;

            //cout << cnt; exit(0);
        }
        else{
            int idx = *it;
            cnt += idx - l;
            l = idx; r++;

            //cout << cnt << " " << l; exit(0);
        }
    }
    cout << cnt + 1;
    return 0;
}

void ONLINE__JUDGE()
{
    #ifndef ONLINE_JUDGE
    freopen( "inp.c"         , "r" , stdin  );
    //freopen( "OutPut.txt"   , "w" , stdout );
    #endif // ONLINE_JUDGE
}

ll binEXP( ll x , ll pw , ll MOD )
{ ll res=1; while(pw>0){ pw%2 ? res *= x : 0; x *= x; x%=MOD; pw /= 2; res%= MOD; } return res%=MOD; }


Measured memory_bytes: 1736
#include <iostream>

 using namespace std;

int main()
{
   int i, h, m, s;
   cin >> i;
   h = i / 3600;
   m = i / 60 - h*60;
   s = i % 60;
   cout << h << ":" << m << ":" << s << endl;

   return 0;
}



Measured memory_bytes: 3092
#include <stdio.h>
#include <iostream>
#include <string>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
int main()
{
    int n;
    cin >> n;
    if (n % 1000 == 0) {
        cout << 0 << endl;
    }
    else {
        cout << 1000 - (n % 1000) << endl;
    }
    return 0;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef vector<ll> vel;
typedef vector<int> vei;
typedef vector<char> vec;
typedef vector<string> ves;
typedef vector<vector<int>> ve_vei;
typedef vector<vector<char>> ve_vec;
typedef vector<vector<string>> ve_ves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define fs first
#define sc second
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)

int main(){
    int K,S; cin >> K >> S;
    int cnt = 0;
    rep(i,K+1) {
        rep(j,K+1) if(0<= S-i-j and S-i-j <= K) cnt++;
    }
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 256
parseInt(x::String) = parse(Int, x)
parseInt(x::SubString{String}) = parse(Int, x)
parseInt(x::Char) = parse(Int, x)
parseInt(x::Float64) = trunc(Int, x)
parseFloat(x::String) = parse(Float64, x)
parseFloat(x::Int) = trunc(Float64, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)

function main()
    x=parseInt(readline())
    ans=1
    for i in 2:parseInt(sqrt(x))+1
        num=1
        while true
            num*=i
            if num>x
                num=div(num,i)
                break
            end
        end
        ans=max(num,ans)
    end
    println(ans)
end
main()

Measured memory_bytes: 111040
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <limits.h>    
#define inf 100000000
#define INF 9223372036854775807
#define EPS 1e-10
#define sq(n) ((n)*(n))
#define rep(i,n) for(i=0;i<n;i++)
#define rev(i,n) for(i=n-1;i>=0;i--)
#define sort(a,n) qsort(a,n,sizeof(TYPE),cmp)
#define sort_r(a,n) qsort(a,n,sizeof(TYPE),cmp_r);
#define chsort(s,n) qsort(s,n,sizeof(char),cmp)
#define chsort_r(s,n) qsort(s,n,sizeof(char),char_cmp_r);
#define TYPE int
#define MEMSET(a) memset(a,0,sizeof(a))
int mod=(int)1e09+7;

int in(void){
    int i;scanf("%d",&i);
    return i;
}
long long llin(void){
    long long i;scanf("%lld",&i);
    return i;
}
double din(void){
    double i;scanf("%lf",&i);
    return i;
}
void chin(char s[]){
    scanf("%s",s);
}
void print(int a){
    printf("%d\n",a);
}
void llprint(long long a){
    printf("%lld\n",a);
}
void dprint(double a){
    printf("%.10f\n",a);
}
void print2(int a,int b){
    printf("%d %d\n",a,b);
}
long long max(long long a,long long b){
    return a>b?a:b;
}
long long min(long long a,long long b){
    return a<b?a:b;
}
int cmp(const void *a,const void *b){
    return *(TYPE *)a-*(TYPE *)b;
}
int cmp_r(const void *a,const void *b){
    return *(TYPE *)b-*(TYPE *)a;
}
int char_cmp(const void *a,const void *b){
    return strcmp((char *)a,(char *)b);
}
int char_cmp_r(const void *a,const void *b){
    return strcmp((char *)b,(char *)a);
}
void swap(int *a,int *b){
    int t=*a;
    *a=*b;
    *b=t;
}
long long gcd(long long x,long long y){
    return x%y?gcd(y,x%y):y;
}
long long lcm(long long x,long long y){
    return x/gcd(x,y)*y;
}

// write codes below this
// when you use 'sort',
// make sure TYPE macro is correct
int w[3*100000],e[3*100000];
char s[3*100000];
int main(void){
    int n=in(),i,j,ans=inf,ec=0,wc=0;
    chin(s);
    rep(i,n)if(s[i]=='E')ec++;
    rep(i,n){
        if(s[i]=='E'){
            e[i]=--ec;
            w[i]=wc;
        }
        else{
            e[i]=ec;
            w[i]=wc++;
        }
    }
    rep(i,n)ans=min(ans,e[i]+w[i]);
    print(ans);
    return 0;
}

Measured memory_bytes: 2816
S=[]
H=[]
C=[]
D=[]
count=0
for i in range(1,14):
    S.append(i)
    H.append(i)
    C.append(i)
    D.append(i)

n=(int)(input())
while True:
    if count==n:
        break
    k,num=(input().split())
    num=int(num)
    if k=='S':
        S.remove(num)
    elif k=='H':
        H.remove(num)
    elif k=='C':
        C.remove(num)
    elif k=='D':
        D.remove(num)
    count=count+1

if len(S)!=0:
    for j in range(len(S)):
        print("S {0}".format(S[j]))
if len(H)!=0:
    for j in range(len(H)):
        print("H {0}".format(H[j]))
if len(C)!=0:
    for j in range(len(C)):
        print("C {0}".format(C[j]))
if len(D)!=0:
    for j in range(len(D)):
        print("D {0}".format(D[j]))
    


Measured memory_bytes: 5612
from math import sqrt
import sys
sdin = sys.stdin.readline

q = int(sdin())
ab = []
for i in range(q):
    ab.append(tuple(map(int, sdin().split())))

for a, b in ab:
    if a == b or a == b-1:
        print(2*a - 2)
        
    else:
        if not (sqrt(a*b) - int(sqrt(a*b))):
            c = int(sqrt(a*b) - 1)
        else:
            c  = int(sqrt(a*b))
        
        if c*(c+1) >= a*b:
            print(2*c - 2)
        else:
            print(2*c - 1)
            
            

Measured memory_bytes: 3064
/*
If you want to aim high, aim high
Don't let that studying and grades consume you
Just live life young
******************************
What do you think? What do you think?
1st on Billboard, what do you think of it
Next is a Grammy, what do you think of it
However you think, I’m sorry, but shit, I have no fcking interest
*******************************
I'm standing on top of my Monopoly board
That means I'm on top of my game and it don't stop
til my hip don't hop anymore
https://www.a2oj.com/Ladder16.html
*******************************
300iq as writer = Sad!
*/
import java.util.*;
import java.io.*;
import java.math.*;

   public class Main
   {
      public static void main(String hi[]) throws Exception
      {
         BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));
         StringTokenizer st = new StringTokenizer(infile.readLine());
         int N = Integer.parseInt(st.nextToken());
         int[] arr = new int[N];
         st = new StringTokenizer(infile.readLine());
         for(int i=0; i < N; i++)
            arr[i] = Integer.parseInt(st.nextToken());
         Arrays.sort(arr);
         int res = 0;
         for(int a=0; a < N; a++)
            for(int b=a+1; b < N; b++)
               for(int c=b+1; c < N; c++)
               {
                  if(arr[a] == arr[b] || arr[a] == arr[c] || arr[b] == arr[c]);
                  else
                  {
                     if(arr[a]+arr[b] > arr[c])
                        res++;
                  }
               }
         System.out.println(res);
      }
   }

Measured memory_bytes: 33272
#include <iostream>
#include <sstream>
#include <stack>
#include <iomanip>
#include <numeric>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <cassert>
#include <map>
#include <set>
#include <vector>
#include <utility>
#include <queue>
#include <cmath>

#define BEGIN(x) x.begin()
#define END(x) x.end()
#define ALL(x) BEGIN(x), END(x)
#define PAIR make_pair
#define VEC(type) vector<type >
#define endl '\n'
#define FIR first
#define SEC second
#define PB push_back
#define SZ(x) ((int)x.size())

#define FOR(i, A, B) for(auto i = (A);i != (B); i++)
#define FORD(i, A, B) for(auto i = (A);i != (B); i--)

#define READRANGE(begin, end) FOR(it, begin, end) cin >> *it
#define READVEC(V) READRANGE(BEGIN(V), END(V))

using namespace std;

typedef long long lint;
typedef pair<int, int> Pii;
typedef pair<int, lint> Pil;
typedef pair<lint, lint> Pll;
typedef pair<lint, int> Pli;

template<class U, class V>
istream& operator >>(istream& in, pair<U, V>& pr) {
    return in >> pr.first >> pr.second;
}

template<class U, class V>
ostream& operator <<(ostream& out, pair<U, V>& p) {
    return out << p.first << " " << p.second;
}

template<class T>
ostream& operator <<(ostream& out, vector<T> vec) {
    for (T& e : vec)
        out << e << " ";
    return out << endl;
}

// ---- BEGIN LIBRARY CODE ----
// ---- END LIBRARY CODE ----
void io_init()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
};

void solveSingleCase(int caseNo)
{
    int N;
    string S;
    cin  >> N >> S;

    int E = 0, east = 0, west = 0, ret = N;
    for (char c : S)
        if (c == 'E')
            E++;

    FOR(i, 0, N) {
        if (S[i] == 'E')
            east++;
        int cnt = west + E - east;
        ret = min(ret, cnt);
        if (S[i] == 'W')
            west++;
    }

    cout << ret << endl;
};

int main(int argc, char **argv)
{
    io_init();

    // Actual program code starts here.
    int T = 1;
    // cin >> T;
    FOR(tcase, 1, T + 1) {
        solveSingleCase(tcase);
    }
    return 0;
};


Measured memory_bytes: 720
import static java.util.Arrays.*;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

	static void tr(Object... os) {
		System.err.println(deepToString(os));
	}

	void solve() {
		int res = 0;

		for (;sc.hasNext();) {
			char[] s = sc.next().toCharArray();
			if (isPalin(s)) res++;
		}
		out.println(res);
	}
	boolean isPalin(char[] s) {
		for (int i = 0; i + i < s.length; i++) {
			if (s[i] != s[s.length - 1 - i]) return false;
		}
		return true;
	}

	public static void main(String[] args) throws Exception {
		new Main().run();
	}

	MyScanner sc = null;
	PrintWriter out = null;
	public void run() throws Exception {
		sc = new MyScanner(System.in);
		out = new PrintWriter(System.out);
		solve();
		out.flush();
		out.close();
	}

	class MyScanner {
		String line;
		BufferedReader reader;
		StringTokenizer tokenizer;

		public MyScanner(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream));
			tokenizer = null;
		}
		public void eat() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					line = reader.readLine();
					if (line == null) {
						tokenizer = null;
						return;
					}
					tokenizer = new StringTokenizer(line);
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
		}
		public String next() {
			eat();
			return tokenizer.nextToken();
		}
		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		public boolean hasNext() {
			eat();
			return (tokenizer != null && tokenizer.hasMoreElements());
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public double nextDouble() {
			return Double.parseDouble(next());
		}
		public int[] nextIntArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++) a[i] = nextInt();
			return a;
		}
	}
}

Measured memory_bytes: 16900
#include<queue>
#include<cctype>
#include<cstdio>
#include<cstring>

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

using namespace std;

const int INF=1<<29;

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

struct Node{
	int x,y,mask;
	Node(int X,int Y,int MA):x(X),y(Y),mask(MA){}
	bool operator<(const Node &i)const{ return true; }
};

int main(){
	for(int w,h;scanf("%d%d",&w,&h),w;){
		char grid[30][31];
		rep(i,h)	scanf("%s",grid[i]);
		int sx,sy;
		int key[128],keynum=0;
		memset(key,-1,sizeof(key));
		rep(i,h)rep(j,w){
			if(grid[i][j]=='@')	sx=j,sy=i;
			if(islower(grid[i][j]) && key[grid[i][j]]==-1){
				key[grid[i][j]]=keynum;
				key[toupper(grid[i][j])]=keynum++;
			}
		}

		int ans=-1;
		int d[30][30][1<<8];
		rep(i,h)rep(j,w)rep(mask,1<<8)	d[i][j][mask]=INF;
		d[sy][sx][0]=0;
		priority_queue< pair<int,Node> > pq;	pq.push(mp(0,Node(sx,sy,0)));
		while(!pq.empty()){
			pair<int,Node> a=pq.top();	pq.pop();
			int x=a.second.x,y=a.second.y,mask=a.second.mask;
			if(d[y][x][mask]<-a.first)	continue;

			if(grid[y][x]=='<'){ ans=d[y][x][mask]; break; }

			rep(i,4){
				int xx=x+dx[i],yy=y+dy[i],nextmask=mask;
				if(0<=xx && xx<w && 0<=yy && yy<h){
					if(grid[yy][xx]=='#')	continue;
					if(isupper(grid[yy][xx]) && (mask&(1<<key[grid[yy][xx]]))==0)	continue;
					if(islower(grid[yy][xx]))	nextmask^=1<<key[grid[yy][xx]];
					if(d[y][x][mask]+1<d[yy][xx][nextmask]){
						d[yy][xx][nextmask]=d[y][x][mask]+1;
						pq.push(mp(-d[yy][xx][nextmask],Node(xx,yy,nextmask)));
					}
				}
			}
		}

		printf("%d\n",ans);
	}

	return 0;
}

Measured memory_bytes: 2140
/*
                        Author: Ankit Kaul
**********************Code Belongs to Respective Author Only************************************
*/
/*#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")*/
#include <bits/stdc++.h>
#define endl       '\n'
#define PI          3.141592653589
#define jaldi       ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define M           1000000007
#define int         long long int
#define inf         INT_MAX
#define pb          emplace_back
#define pf          emplace_front
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define rall(a)     (a).rbegin(),(a).rend()
using namespace std;
int gcd(int a,int b) { return b == 0 ? a : gcd(b, a % b); }
int power(int x,int n){
    int result=1;
    while(n>0)
        {   if(n % 2 ==1)
            result=(result * x)%M;
            x=(x*x)%M;
            n=n/2;
        }
    return result%M;
}      
bool isPrime(int n)
    {
    if (n <= 1)
        return false;
    if (n <= 3)
        return true;
    if (n % 2 == 0 || n % 3 == 0)
        return false;
    for (int i = 5; i * i <= n; i = i + 6)
        if (n % i == 0 || n % (i + 2) == 0)
            return false;
    return true;
    }
int inv(int a,int m)
{   return power(a,m-2);
}
int lcm(int a,int b)
{   return a*b/(gcd(a,b));
}
signed main()
{   jaldi
    string str;
    cin>>str;
    if(str=="AAA" || str=="BBB")
    cout<<"No";
    else
    cout<<"Yes";
}

Measured memory_bytes: 256
#!/usr/bin/env python3

def solve(S: str):
    stack = []
    N = len(S)
    for i, s in enumerate(S):
        if i == 0:
            stack.append(s)
        else:
            if len(stack) == 0:
                stack.append(s)
            else:
                if s != stack[-1]:
                    tmp = stack.pop()
                else:
                    stack.append(s)
    print(N - len(stack))

# 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)
def main():
    S = str(input())
    solve(S)

if __name__ == '__main__':
    main()


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

int main(){
  string s;
  cin >> s;
  int n = s.length();
  rep(i, n/2) {
 //   cout << s[i] << " " << s[n-1-i] << endl;
    if(s[i] != s[n-1-i]){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << endl;
  
  string half = s.substr(0, s.length()/2);
  rep(i, half.length()/2){
//    cout << s[i] << " "<< s[half.length()-1-i] << endl;
    if(s[i] != s[half.length() - 1 - i]){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << endl;
  cout << "Yes" << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
  int a=0,b=0;
  int c=0,d=0;
  int k=0;
  scanf("%d%d%d%d%d",&a,&b,&c,&d,&k);
  
  int m=(c*60+d)-(a*60+b);
  int r=m-k;
  
  printf("%d",r);
  
  return 0;
}

Measured memory_bytes: 2152
#include <bits/stdc++.h>
#define ALL(A) (A).begin(), (A).end()
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int dx[] = { 0, 1, -1, 0, 1, -1, 1, -1 };  // i<4:4way i<8:8way
int dy[] = { 1, 0, 0, -1, 1, -1, -1, 1 };

const ll mod = 1e9 + 7;
const ll INF = -1 * ((1LL << 63) + 1);
const int inf = -1 * ((1 << 31) + 1);

int main(void){
    string s;
    cin >> s;
    rep(i,s.size()){
        if(s[i] == '?')cout << "D";
        else cout << s[i];
    }
    cout << endl;
}

Measured memory_bytes: 3748
//↓template↓

#include "bits/stdc++.h"
using namespace std;
#define Would
#define you
#define all(n)  n.begin(),n.end()
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
const double pi = acos(-1);
const int SIZE = 1 << 17;
int dx[] = { 1,0,-1,0 }, dy[] = { 0,1,0,-1 }, alp[30];
long long fac[200005], finv[200005], inv[200005];
vector<long long>dij;
struct edge { long long to, cost; };
vector<vector<edge> >G;

long long mod_pow(long long a, long long b) {
	long long res = 1, mul = a;
	for (int i = 0; i < 31; ++i) {
		if (b >> i & 1) {
			res *= mul;
			res %= MOD;
		}
		mul = (mul * mul) % MOD;
	}

	return res;
}

void addedge(int from, int to, int cost) {
	G[from].push_back({ to,cost });
	G[to].push_back({ from,cost });
}

//↑template↑




int imos[100005], ans;
int main() {
	int a, b;
	cin >> a >> b;
	for (int i = 0; i < b; ++i) {
		int n, m;
		cin >> n >> m;
		++imos[n];
		--imos[m + 1];
	}

	for (int i = 1; i < a + 1; ++i) { imos[i] += imos[i - 1]; }

	for (int i = 0; i < a+1; ++i) {
		if (imos[i] == b) { ++ans; }
	}
	cout << ans << endl;
}

Measured memory_bytes: 640
from heapq import*
(N,M),*t=[map(int,s.split())for s in open(0)]
q=[0]*99*M
v=[[]for _ in q]
z=0
for a,b in t:v[a-1]+=[b]
for i in v[:M]:
	for j in i:heappush(q,-j)
	z-=heappop(q)
print(z)

Measured memory_bytes: 736276
#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<map>
#include<tuple>
#include<algorithm>
#include<cmath>
#include<limits>
#include<set>
#include<queue>
using namespace std;
//#define int long  long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }

signed main()
{
	string S;
	cin >> S;
	int ans = 1e5;
	rep(i, S.size() - 2)
	{
		int num = (S[i] - '0') * 100 + (S[i + 1] - '0') * 10 + S[i + 2] - '0';
		ans = min(ans, abs(753 - num));
	}
	cout << ans;
}

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

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
const int INF_N = 1e+9;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

//繰り返し二乗法
ll mod_pow(ll a, ll n, ll m) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%m;
		a = a * a%m; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

//逆元(Eucledean algorithm)
ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 18;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
using mP = pair<modint, modint>;

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




void solve() {
    int N; cin >> N;
    vector<pair<ll, LP>> v;
    rep(i, N){
        ll a, b; cin >> a >> b;
        v.push_back(make_pair(a+b, make_pair(a, b)));
    }
    sort(all(v));
    reverse(all(v));
    ll t=0, k=0;
    rep(i, N){
        if(i%2 == 0){
            t += v[i].second.first;
        }else{
            k += v[i].second.second;
        }
    }

    cout << t - k << endl;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  //cout << fixed << setprecision(10);
  //init_f();
  //init();
  //int t; cin >> t; rep(i, t)solve();
  solve();
//   stop
    return 0;
}


Measured memory_bytes: 8948
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <math.h>
#include <cassert>
#define rep(i,n) for(int i = 0; i < n; ++i )
using namespace std;
using ll = long long;
using P = pair<int,int>;

vector<P> g[100005];
const int INF = 1001001001;
vector<int> x(100005,INF);
bool dfs(int u, int nx = 0){
  if(x[u]==nx) return true;
  if(x[u]!=INF) return false;
  x[u]=nx;

  for(P p:g[u]){
    int v = p.first, d = p.second;
    if(!dfs(v,x[u]+d)) return false;
  }
  return true;
}
int main() {
  int n,m;
  cin >> n >> m;
  rep(i,m){
    int l,r,d;
    cin >> l >> r >> d;
    --l; --r;
    g[l].emplace_back(r,d);
    g[r].emplace_back(l,-d);
  }
  rep(i,n){
    if(x[i]!=INF) continue;
    if(!dfs(i)){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}

Measured memory_bytes: 11008
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
using namespace std;
typedef long long LL;
const int N = 55;
int a,n;
LL c[N][N*N];
int main(){
  scanf("%d%d",&n,&a);
  c[0][0]=1;
  for(int i=1;i<=n;++i){
    int x;scanf("%d",&x);
    for(int j=i;j>=1;--j){
      for(int k=2500;k>=x;--k)
        c[j][k]+=c[j-1][k-x];
    }
  }
  for(int i=1;i<=2500;++i){
    for(int j=1;j<=n;++j)c[j][i]+=c[j][i-1];
  }
  LL ret=0;
  for(int i=1;i<=n;++i){
    int l=i*a;
    ret+=c[i][l]-c[i][l-1];
  }
  cout<<ret<<endl;
  return 0;
}

Measured memory_bytes: 1408
#include <iostream>
#include <string>
#include <stdio.h>
using namespace std;
int main(){
	char c = 'a';
	const char a = 'a';
	bool alp[26];
	int i;
	for (i=0;i<26;i++)alp[i]=false;
 
	while(cin >> c){
		alp[c-a] = true;
	}
	for (i=0;i<26;i++){
		if(alp[i]==false){
			break;
		}
	}
	if(i==26){
		cout << "None";
	}else{
		printf("%c\n",a+i);
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pint = pair<int,  int>;
using pll = pair<ll, ll>;
using edge = pair<int, ll>;
using graph = vector<vector<int>>; 
using WeightedGraph = vector<vector<edge>>;
const ll INF = 1LL << 60;
const int INF32 = 1 << 29;
const ll MOD = 1000000007;

int main() {
  int a,b,k;cin >> a>> b>> k;
  set<int> se;
  for(int i = 0; i < k; ++i){
    if(a+i<=b)se.insert(a+i);
    if(b-i>=a)se.insert(b-i);
  }
  for(auto it : se){
    cout << it << endl;
  }
}


Measured memory_bytes: 256
w,h,n = gets.split.map &:to_i
tile = Array.new(h) { Array.new(w, 0) }
n.times{
    x,y,a = gets.split.map &:to_i
    left = 0; right = w
    top = 0; bottom = h
    if a == 1 then
        right = x
    elsif a == 2 then
        left = x
    elsif a == 3 then
        bottom = y
    else
        top = y
    end

    for i in Range.new(top, bottom-1) do
        for j in Range.new(left, right-1) do
            tile[i][j] = 1
        end
    end
}
count = 0

for i in Range.new(0, h-1) do
    for j in Range.new(0, w-1) do
        if tile[i][j] == 0 then
            count += 1
        end
    end
end

p count


Measured memory_bytes: 1916
#include <bits/stdc++.h>
#define pq priority_queue
#define mp make_pair
#define cauto const auto &

#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())

#define clr(ar, val) memset(ar, val, sizeof(ar))

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

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

using namespace std;

typedef long long int64;
typedef long long lint;
typedef long long lli;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<int, ll> pil;
typedef pair<ll, ll> pll;

const int iinf = 1 << 29;
const long long linf = 1ll << 61;

int t,x;
int main() {
    cin>>t>>x;
    printf("%f\n",(double)t/x);
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
///Welcome to Nasif's Code
#define bug printf("bug\n");
#define bug2(var) cout<<#var<<" "<<var<<endl;
#define co(q) cout<<q<<endl;
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9+7;
const int MAX = 1e6;
#define pi acos(-1)
#define inf 1000000000000000LL
#define FastRead    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
    FastRead
    //freopen("output.txt", "w", stdout);
    ll x,a,b;
    cin>>x>>a>>b;
    x-=a;
    cout<<x%b<<endl;

    return 0;
}


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

const int mod = 1000000007;
const int P = 3232323;

char s[2000010];
char t[2000010];
int n, m, now;
long long h[2000010];
long long power[500010];
vector <int> from[500010];
int in[500010];
queue <int> q;
int dp[500010];

long long MOD(long long x){return x - x / mod * mod;}

void pre_h(){
	power[0] = 1;
	for (int i = 1; i <= m; i++){
		power[i] = MOD(power[i - 1] * P);
	}
	for (int i = 1; i <= now; i++){
		h[i] = MOD(h[i - 1] * P + s[i] - 'a' + 1);
	}
}

long long get_h(int l, int r){
	return MOD(h[r] - MOD(h[l - 1] * power[r - l + 1]) + mod);
}

int main(){
	scanf("%s%s", s + 1, t + 1), n = strlen(s + 1), m = strlen(t + 1), now = n;
	while (now < m){
		for (int i = now + 1; i <= now + n; i++){
			s[i] = s[i - now];
		}
		now += n;
	}
	for (int i = now + 1; i <= now + now; i++){
		s[i] = s[i - now];
	}
	now += now;
	pre_h();
	long long my = 0;
	for (int i = 1; i <= m; i++){
		my = MOD(my * P + t[i] - 'a' + 1);
	}
	for (int i = 1; i <= n; i++){
		if (get_h(i, i + m - 1) == my){
			from[i].push_back((i + m - 1) % n + 1);
			in[(i + m - 1) % n + 1]++;
		}
	}
	for (int i = 1; i <= n; i++){
		if (!in[i]) q.push(i), dp[i] = 0;
	}
	int ans = 0;
	while (!q.empty()){
		int x = q.front(); q.pop();
		for (int i = 0; i < from[x].size(); i++){
			int v = from[x][i];
			in[v]--, dp[v] = max(dp[v], dp[x] + 1);
			ans = max(ans, dp[v]);
			if (!in[v]) q.push(v);
		}
	}
	for (int i = 1; i <= n; i++){
		if (in[i]){
			printf("-1\n");
			return 0;
		}
	}
	printf("%d\n", ans);
	return 0;
}


Measured memory_bytes: 52992
/*
?????????????????\???

????????????????????\??? (priority queue) ??????????´??????????????????£????????????????????? S ?????????????????????????§??????§??????????¬????????????????????????????

    insert(S,k): ?????? S ???????´? k ????????\??????
    extractMax(S): ?????§?????????????????? S ???????´???? S ????????????????????????????????????

????????????????????\??? S ???????????? insert(S,k)???extractMax(S)?????????????????°????????????????????????????????????????????§???????????\??????????´??????´??°??¨?????????????????????????????¨??????????????????
??\???

????????????????????\??? S ???????????°????????????????????????????????????????????????insert k???extract?????????end?????¢?????§???????????????????????????????????????????????§ k ????????\????????´??°?????¨????????????

end???????????\?????????????????????????????????
??????

extract???????????¨??????????????????????????\??? S?????????????????????????????????????????????????????????????????? 
*/

#include <stdio.h>
#include <stdlib.h>
 #define N 2000002
#define NN 10
void Defin(int *, int);

void Defex(int *);

void Defma(int *, int);
 
int num = 0;
 
int main(){
  int i;
  int Arrayt[N];
  char Array[NN];
   
  while(1){

    scanf("%s", Array);

    if(Array[2] == 'd') 
      break;

    else if(Array[0] == 'i'){

      scanf("%d", &Arrayt[0]);

      Defin(Arrayt, Arrayt[0]);
    }
    else Defex(Arrayt);
  }
   
  return 0; 
}
void Defma(int *t, int i){

  int left, right;
  int  large, c;
   
  if( i * 2 + 1 < num + 1) right = i * 2 + 1;
  else right = i;
  if( i * 2 < num + 1) 
    left = i * 2;
  else left = i;
    
  if(left <= num && t[left] > t[i])
    large = left;
  else large = i;
   
  if(right <= num && t[right] > t[large])
    large = right;
   
  if(large != i){

    c = t[i];

    t[i] = t[large];

    t[large] = c;

    Defma(t, large);
  }
}
void Defin(int *arrayt, int z){
  int i,c;
   
  num++;
  i = num;
  arrayt[num] = z;
   
  while(i > 1 && arrayt[i/2] < arrayt[i]){

    c = arrayt[i];

    arrayt[i] = arrayt[i/2];

    arrayt[i/2] = c;
    i /= 2;
  }
}
void Defex(int *arrayt){
   
  printf("%d\n", arrayt[1]);
   
  if(num > 1)
arrayt[1] = arrayt[num];
   
  num--;
   
  if(num > 1) Defma(arrayt, 1);
}

Measured memory_bytes: 5824
#include <bits/stdc++.h>
using i64 = int_fast64_t;
#define repeat(i, a, b) for(int i = (a); (i) < (b); ++(i))
#define rep(i, n) repeat(i, 0, n)

namespace edamat {
// binary gcd
long long gcd(long long _a, long long _b) {
    unsigned long long a = ::std::abs(_a), b = ::std::abs(_b);
    if(a == 0) return b;
    if(b == 0) return a;
    int shift = __builtin_ctzll(a | b);
    a >>= __builtin_ctzll(a);
    do {
        b >>= __builtin_ctzll(b);
        if(a > b) std::swap(a, b);
        b -= a;
    } while(b);
    return (a << shift);
}

template <class T, class U>
T modpow(T x, U n, T md) {
    T r = 1 % md;
    x %= md;
    while(n) {
        if(n & 1) r = (r * x) % md;
        x = (x * x) % md;
        n >>= 1;
    }
    return r;
}

// Miller–Rabin primality test
bool is_prime(long long n) {
    if(n <= 1) return false;
    if(n == 2) return true;
    if(n % 2 == 0) return false;
    long long d = n - 1;
    while(d % 2 == 0) d /= 2;
    for(long long a : {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37}) {
        if(n <= a) break;
        long long t = d;
        long long y = modpow<__int128_t>(a, t, n);
        while(t != n - 1 && y != 1 && y != n - 1) {
            y = __int128_t(y) * y % n;
            t <<= 1;
        }
        if(y != n - 1 && t % 2 == 0) {
            return false;
        }
    }
    return true;
}

// Pollard's rho algorithm
long long pollard_rho_algorithm(long long n) {
    if(is_prime(n)) return n;
    if(n % 2 == 0) return 2;
    int c = 0;
    while(true) {
        c = (3 * c + 1) % 24;  // 適当な線形合同法で乱数もどきを作る
        auto f = [&](long long x) { return (__int128_t(x) * x + c) % n; };
        long long st = 0;
        while(true) {
            st++;
            long long x = st, y = f(x);
            while(true) {
                long long p = gcd((y - x + n), n);
                if(p == 0 || p == n) break;
                if(p != 1) return p;
                x = f(x);
                y = f(f(y));
            }
        }
    }
}

::std::vector<long long> factorize(long long n) {
    if(n == 1) return {};
    long long x = pollard_rho_algorithm(n);
    if(x == n) return {x};
    ::std::vector<long long> le = factorize(x);
    ::std::vector<long long> ri = factorize(n / x);
    le.insert(le.end(), ri.begin(), ri.end());
    return le;
}
}  // namespace edamat

void solve() {
    int t;
    std::cin >> t;
    rep(i, t) {
        i64 n;
        std::cin >> n;
        auto ans = edamat::factorize(n);
        std::sort(begin(ans), end(ans));
        std::cout << ans.size() << " \n"[ans.size() == 0];
        rep(i, ans.size()) std::cout << ans[i] << " \n"[i == ans.size() - 1];
    }
}

void test() {
    int X;
    std::cin >> X;
    for(int i = X; i < 2 * X; i++) {
        if(edamat::is_prime(i)) {
            std::cout << i << std::endl;
            return;
        }
    }
}

int main() {
    // std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    // solve();
    test();
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <functional>
using namespace std;

#define Rep(b, e, i) for(int i = b; i <= e; i++)
#define rep(n, i) Rep(0, n-1, i)
#define MAX 200000
#define MOD 1000000007

typedef long long ll;

//階乗とその逆元
ll fac[MAX+1],facInv[MAX+1];

ll power(ll e, ll x){ //e^x % MOD
    if (x == 0) return 1LL;
    if (x % 2 != 0) return ((power(e, x-1) * e) % MOD);
    ll temp = power(e, x / 2);
    return (temp * temp) % MOD;
}

ll nck(ll n, ll k){
    if (k > n or k < 0) return 0;
    ll temp = (fac[n] * facInv[n-k]) % MOD;
    return ((temp * facInv[k]) % MOD);
}

void fact(void){
    //階乗とその逆元
    fac[0] = facInv[0] = 1; //0! = 1
    //(x!)^(-1) ≡ (x!)^(p-2) (mod p)
    Rep(1, MAX, i) fac[i] = (fac[i-1] * i) % MOD;
    facInv[MAX] = power(fac[MAX], MOD-2);
    Rep(1, MAX-1, i) facInv[MAX-i] = (facInv[MAX-i+1] * (MAX-i+1)) % MOD;
}

void solve(void){
    int n; scanf("%d\n", &n);

    fact();

    int xs[n+1];
    rep(n+1, i) scanf("%d", &xs[i]);
    bool flag[n]; fill(flag, flag + n, false);
    int daburi; int daburi_indices[2];
    rep(n+1, i) {
        if(!flag[xs[i]-1]) flag[xs[i]-1] = true;
        else daburi = xs[i]-1;
    }
    int k = 0;
    rep(n+1, i) if (xs[i]-1 == daburi) daburi_indices[k++] = i;
    int insiders = daburi_indices[1] - daburi_indices[0] + 1;
    Rep(1, n+1, i) {
        printf("%lld\n", (nck(n+1, i) - nck(n+1-insiders, i-1) + MOD) % MOD);
    }
}

int main(void){
  solve();
  return 0;
}


Measured memory_bytes: 4864
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
            int N = Integer.parseInt(reader.readLine());

            String[] array = reader.readLine().split(" ");
            int[] A = new int[N + 1];
            for (int i = 0; i < N + 1; i++) {
                A[i] = Integer.parseInt(array[i]);
            }

            array = reader.readLine().split(" ");
            int[] B = new int[N];
            for (int i = 0; i < N; i++) {
                B[i] = Integer.parseInt(array[i]);
            }

            long ans = 0;
            for (int i = 0; i < N; i++) {
                if (A[i] >= B[i]) {
                    ans += B[i];
                } else {
                    ans += A[i];
                    if (A[i + 1] >= (B[i] - A[i])) {
                        ans += B[i] - A[i];
                        A[i + 1] -= B[i] - A[i];
                    } else {
                        ans += A[i + 1];
                        A[i + 1] = 0;
                    }
                }
            }

            System.out.println(ans);
        }
    }

}


Measured memory_bytes: 51596
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
using namespace std;
#define mod int(1e9+7)
#define rep(i,n) for(int i=0;i<n;i++)
#define reps(i,a,b) for(int i=a;i<=b;i++)
#define repn(i,a,b) for(int i=b-1;i>=a;i--)
#define F first
#define S second
#define pb push_back
#define mk make_pair
typedef long long int ll;

int main()
{ ios_base::sync_with_stdio(false); cin.tie(0);
  string s="CODEFESTIVAL2016",p;
  cin>>p;
  int ans=0;
  rep(i,16) if(s[i]!=p[i]) ans++;
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 256
#! env/bin/local python3
# -*- coding:utf-8 -*-

# -- submit ----

# --- fetch input ---

inputs: list = []
while True:
    try:
        inputs.append(input().strip('\n'))
    except EOFError:
        break

# --- write code below ---

days = int(inputs[0].split(' ')[0])
task_costs = inputs[1].split(' ')
task_costs = [int(t) for t in task_costs]
result = days - sum(task_costs)

print(f'{result if result >= 0 else -1}')


Measured memory_bytes: 9852
#include <iostream>
#include <cstdio>
#include <vector>
#define _USE_MATH_DEFINES
#include <math.h>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <stdlib.h>
#include <functional>
#include <string>
#include <array>
#include <map>
#include <queue>
#include <limits.h>
#include <set>
#include <stack>
#include <random>
#include <complex>
#include <unordered_map>
#include <nmmintrin.h>
#include <chrono>
#define rep(i,s,n) for(int i = (s); (n) > i; i++)
#define REP(i,n) rep(i,0,n)
#define RANGE(x,a,b) ((a) <= (x) && (x) <= (b))
#define DUPLE(a,b,c,d) (RANGE(a,c,d) || RANGE(b,c,d) || RANGE(c,a,b) || RANGE(d,a,b))
#define INCLU(a,b,c,d) (RANGE(a,c,d) && (b,c,d))
#define PW(x) ((x)*(x))
#define ALL(x) (x).begin(), (x).end()
#define MODU 1000000007
#define bitcheck(a,b)   ((a >> b) & 1)
#define bitset(a,b)      ( a |= (1 << b))
#define bitunset(a,b)    (a &= ~(1 << b))
#define MP(a,b) make_pair((a),(b))
#define Manh(a,b) (abs((a).first-(b).first) + abs((a).second - ((b).second))
#define pritnf printf
#define scnaf scanf
#define itn int
#ifdef _MSC_VER
#define __builtin_popcount _mm_popcnt_u32
#define __builtin_popcountll _mm_popcnt_u64
#endif
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a%b);
}
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T &val) {
	std::fill((T*)array, (T*)(array + N), val);
}

struct UnionFind{
	vector<int> data;
	UnionFind (int n) : data(n, -1){}

	void Unite(int a, int b){
		a = root(a), b = root(b);
		if (a == b)return;
		if (data[a] > data[b])
			swap(a,b);
		
		data[b] += data[a];
		data[a] = b;
	}

	bool Find(int a, int b){
		return root(a) == root(b);
	}

	int root(int a){
		return data[a] < 0 ? a : data[a] = root(data[a]);
	}

	int size(int a){
		return -data[root(a)];
	}
};

signed main() {
	int n;

	cin >> n;
	ll ans = 1;
	REP(i, n){
		ans *= 1LL * (i+1);
		ans %= MODU;
	}
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 256
//g++ main.cpp -I /usr/local/include/ac-library
#include<cmath>
//#include <atcoder/all>
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
//using namespace atcoder;
stack<int> st;
queue<int> qu;
priority_queue<int> pq;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rep2(i,n) for(int i=1; i<=(int)(n); i++)
#define mins(x,y) x=min(x,y)
#define maxs(x,y) x=max(x,y)
#define ALL(a) a.begin(), a.end()
typedef set<int> set_t;
typedef set<string> set_g;
typedef complex<double> xy_t;
static const int NIL = -1;
static const int INF = 1000000007;
#define mp make_pair
#define pb push_back
#define sz(x) (int)(x).size()
#define mod 1000000007
//#define mint=modint1000000007
#define reps(i,s,n) for(int i = s; i < n; i++)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
deque<int> deq;
#define fi first
#define se second
//const ll MOD = 998244353;
const ll MOD = (1e+9) + 7;
typedef pair<int, int> P;
typedef vector<ll> vec;
typedef vector<vec> mat;


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

    vector<int> ans;
    if(n == 3) ans = {2, 3, 25};
    else{// n >= 4
        ans = {2, 4, 3, 9};
        n -= 4;

        int k = 1;
        while(n >= 2 && 3 + 12 * k < 30000){
            ans.push_back(3 + 12 * k);
            ans.push_back(9 + 12 * k);
            k += 1;
            n -= 2;
        }
        k = 1;
        while(n >= 2 && 2 + 6 * k < 30000){
            ans.push_back(2 + 6 * k);
            ans.push_back(4 + 6 * k);
            k += 1;
            n -= 2;
        }
        k = 1;
        while(n >= 1){
            ans.push_back(6 * k);
            k += 1;
            n -= 1;
        }
    }

    // output
    n = ans.size();
    for(int i=0; i<n; i++){
        cout << ans[i];
        if(i == n-1) break;
        cout << " ";
    }
    cout << endl;
    return 0;
}


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

namespace ConsoleApp5
{

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

            int N = int.Parse(Console.ReadLine());
            int ans = 0;

            for(int i=1; i<=N; i++)
            {
                if((i.ToString()).Length % 2 == 1)
                {
                    ans++;
                }
            }

            Console.WriteLine(ans);
        }
    }
}

Measured memory_bytes: 13140
#include <iostream>
#include <fstream>
#include <iomanip>
#include <math.h>
#include <limits.h>
#include <algorithm>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <string>
#include <string.h>
#include <sstream>
#include <ctime>

using namespace std;

#define eps 1e-12
#define pi 3.14159265358979323846
#define pb push_back
#define mp make_pair
#define st first
#define nd second
#define bgn begin
#define ll long long
#define ld long double
#define ull unsigned long long
#define ii pair<ll,ll>









ll n, a, res;
map<ll, ll>m;
map<ll, ll>::iterator it;



void solve()
{
	cin >> n;
	cin >> a;
	m[1 + a]++;
	res = 0;
	for(int i = 2; i <= n; i++)
	{
		cin >> a;
		it = m.find(i - a);
		if(it != m.end())
		{
			res += (it->second);
		}
		m[i + a]++;
	}
	cout << res << "\n";
}

int main()
{
	std::ios::sync_with_stdio(0);
	cin.tie(0);
#ifdef localProject
	freopen("in.txt","r",stdin);
#endif
	solve();
	return 0;
}

Measured memory_bytes: 16092
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
  string s;
  cin>>s;
  int n=s.length();
  map<char,int> m;
  for(int i=0;i<26;i++) m['a'+i]=n+i;
  int dp[n+27],nx[n+27];
  memset(dp,0,sizeof(dp));
  memset(nx,0,sizeof(nx));
  for(int i=n-1;i>=0;i--){
    char x='a';
    for(int j=0;j<26;j++)
      if(dp[m[x]]>dp[m['a'+j]]) x='a'+j;
    dp[i]=dp[m[x]]+1;
    nx[i]=m[x];
    m[s[i]]=i;
  }
  for(int i=0;i<26;i++){
    if(m['a'+i]==n){
      cout<<(char)('a'+i)<<endl;
      return 0;
    }
  }
  
  //for(int i=0;i<n;i++)  cout<<i<<" "<<s[i]<<":"<<dp[i]<<" "<<nx[i]<<endl;
  
  string ans;
  char c='a';
  for(int i=0;i<26;i++){
    if(dp[m[c]]>dp[m['a'+i]]) c='a'+i;
  }
  int p=m[c];
  //cout<<p<<endl;
  while(p<n){
    ans+=s[p];
    p=nx[p];
  }
  ans+=(char)('a'+p-n);
  cout<<ans<<endl;
  return 0;
}


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

int main()
{
int A;
int B;

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

	cin >> A;
	cin >> B;

	cout << ( A - 1 ) * ( B - 1 ) << endl;

	return 0;
}


Measured memory_bytes: 256