akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long int
#define ld long double
#define pb push_back
#define pll pair<ll, ll> 
#define tri pair<pll, ll>
#define vl vector<ll> 
#define vvl vector< vector<ll> > 
#define vlp vector< pair<ll, ll> >
#define vllp vector<pair<pll, ll> > 
#define mll map<ll, ll> 
#define rep(i,a)  for(ll i=0; i< a; i++)
#define rep1(i,a)   for(ll i = 1; i< a; i++)
#define foi(i, a, b)    for(ll i = a; i<b ; i++)
#define fod(i, a, b)    for(ll i = a; i>=b ; i--)
#define mp make_pair
#define all(v)  (v).begin(), (v).end()
#define fst first
#define sec second
#define ff first.first
#define fs first.second
#define max3(a, b, c)   max(max(a, b), c)
#define min3(a, b, c)   min(min(a, b), c)
#define MAX 1000001
#define MOD 1000000007
// #define MOD 998244353
#define endl "\n"
#define INF (ll)1e18
#define s(v) (ll)v.size()
#define e(v) v.empty()
#define bscount(x) __builtin_popcountll(x)
// #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

using namespace std;
// using namespace __gnu_pbds;

ll gcd(ll a, ll b){if(b==0)return a;return gcd(b, a%b);}
ll cpow(ll a, ll b, ll M){ll ans = 1;while(b){if(b&1) ans = ans*a%M; b/=2;a=a*a%M;}return ans;}
void ingraph(vvl& graph, ll m){ll x, y;rep(i, m){cin>>x>>y;x--, y--;graph[x].pb(y);graph[y].pb(x);}}
ll modify(ll n){ll res = n;res%=MOD;res+=MOD;res%=MOD;return res;}
ll fexp(ll a, ll b) {return cpow(a, b, MOD);}
ll cinv(ll a, ll p){return cpow(a, p-2, p);} 
ll inverse(ll a)    {return cinv(a, MOD);}

int main(){
    // #ifndef ONLINE_JUDGE
    //     freopen("../input.txt", "r", stdin);
    //     freopen("../output.txt", "w", stdout);
    // #endif
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    ll t;
    // cin>>t;
    t = 1;
    while(t--){
    	ll n;
    	cin>>n;
    	ll ans = 0;
    	ll cpy = n;
    	while(cpy){ans++; cpy/=2;}
    	rep1(i, n+1){
    		foi(j, i+1, n+1){
    			rep(k, ans){
    				if((i & (1LL<<k)) != (j & (1LL<<k)))	{cout<<k+1<<" ";break;}
    			}	
    		}cout<<endl;
    	}
    }
}

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

using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;
#define fr(i,a,b) for(ll i=a; i<b; i++)
#define rf(i,a,b) for(ll i=a; i>=b; i--)
#define pb push_back
#define mp make_pair
#define show(a) for(auto el:a)cout<<el<<" "
#define ff first
#define ss second
#define pairv vector<pair<ll,ll>>
#define vec vector <ll> 
#define all(a) a.begin(),a.end()
#define fam(v,i) for(auto i=v.begin();i!=v.end();i++)
#define fai(v,i) for(auto i : v)
#define mo 1000000007
#define nn cout<<"\n";
ll pow1(ll n,ll p)
{
if(p==0) return 1;
ll x=pow1(n, p/2);
x=(x*x)%mo;
if(p%2==0)
return x;
else
return (x*n)%mo;
}
bool sortbysec(const pair<ll,ll> &a, 
const pair<ll,ll> &b) 
{ 
return (a.second < b.second); 
} 
bool compare(const pair<ll, ll>&p1, const pair<ll,ll>&p2)
{
if(p1.ff < p2.ff) return true;
if(p1.ff == p2.ff) return p1.ff < p2.ss;
return false;
}


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
 
        string s;
        cin>>s;
        ll n=s.size();
        if(s[n-1]=='s')
        {
            cout<<s<<"es";
        }
        else
        cout<<s<<"s";
        
        nn
   
    
     return 0;
}


Measured memory_bytes: 3624
#include <stdio.h>

int main(){
	int A,B;
	int result;
	scanf("%d %d",&A,&B);
	result=A+B;
	if(result<A-B){
		result=A-B;
	}
	if(result<A*B){
		result=A*B;
	}
	printf("%d", result);
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>  
using namespace std;  
#define INF 0x3f3f3f3f  
typedef long long ll;  
const int N =  100010;  
const int mod = 1e9 + 7;
#define FI first
#define SE second
typedef pair<int, int>pii;

ll num[N];
bool vis[N];

int main()  
{  
  // freopen("in.txt","r",stdin);
   int n, m;
   num[1] = 1;
   for (int i = 2; i <= 100000; i++)
   	num[i] = (num[i-1]*i)%mod;
   while (cin >> n >> m)
   {
   	if (abs(n - m) > 1)
   	{
   		puts("0");
   		continue;
   	}
   	ll ans = n == m?2:1;
   	ans *= num[n];
   	ans%=mod;
   	ans *= num[m];
   	ans%=mod;
   	cout<<ans<<endl;
   }
   
   return 0;  
}  

Measured memory_bytes: 1024
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
const int mx=1e9;
inline int read(){
	int x=0,f=1;
	char c=getchar();
	while(c<'0'||c>'9'){
		if(c=='-')f=-1;
		c=getchar();
	}
	while(c>='0'&&c<='9'){
		x=(x<<1)+(x<<3)+c-'0';
		c=getchar();
	}
	return x*f;
}
int n,k,s;
int main(){
	n=read(),k=read(),s=read();
	for(int i=1;i<=k;++i){
		printf("%d ",s);
	}
	for(int i=k+1;i<=n;++i){
		printf("%d ",s==mx?mx-1:s+1);
	}
	printf("\n");
	return 0;
}



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

using namespace std;

int main() {
	int t = 1; 
	//cin>>t;
	while (t--) {
		float D, T, S;
		cin>>D>>T>>S;
		if (D/S <= T) cout<<"Yes";
		else cout<<"No";
		
	}
}

Measured memory_bytes: 3708
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin >> n;
	vector<int> a(n);
	for(int i = 0; i<n;i++) {
		cin >> a[i];
		a[i] /= 400;
	}
	sort(a.begin(),a.end());
	int count =1,vari=0;
	int now=a[0];
	for(int i = 1; i<n;i++) {
		if(a[i] >= 8) {
			vari = n-i;
			break;
		}
		if(now==a[i])
			continue;
		count++;
		now = a[i];
	}
	int max = count + vari;
	cout << count << " " << max << endl;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <array>
#include <algorithm>
#include <utility>
#include <numeric>
#include <deque>
#include <stack>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cmath>
#include <limits>
#include <cassert>
#include <bitset>
#include <list>
#include <iomanip>
#include <cctype>
#include<chrono>
#include<random>

#define for0(i, N)    for (long long i = 0  ; i <  (N); ++i)
#define for1n(i, N)   for (long long i = 1  ; i <= (N); ++i)
#define for1(i, N)    for (long long i = 1  ; i <  (N); ++i)
#define forn(i, N)    for (long long i = 0  ; i <= (N); ++i)
#define forx(i, N, x) for (long long i = (x); i <  (N); ++i)
#define forl(i, N, x, a) for (long long i = (x), a = 0; a < (N);    \
                              i = (i + 1) % (N), ++a)
#define int long long

long double constexpr pi = 3.141592653589793;

template<class T>
constexpr T sigma1(T i, T n){
    return (n - i + 1) * (i + n) / 2;
}

template<class T>
constexpr T sigma2(T i, T n){
    return (i == 1 ? n * (n + 1) * (2 * n + 1) / 6 :
            sigma2(1, n) - sigma2(1, i - 1));
}

template<class T>
constexpr T sigma3(T i, T n){
    if (i == 1) {
        auto temp = sigma1(i, n);
        return temp * temp;
    }
    return sigma2(1, n) - sigma2(1, i - 1);
}

template<size_t i>
std::bitset<i> operator++(std::bitset<i> b, signed){
    static_assert(i <= 64, "Cannot cast 64bit int.");
    return b = (unsigned long long)b + 1;
}

template<size_t i>
std::bitset<i> operator++(std::bitset<i> b){
    static_assert(i <= 64, "Cannot cast 64bit int.");
    auto temp = b;
    b++;
    return temp;
}

template<size_t i>
std::bitset<i> operator--(std::bitset<i> b, signed){
    static_assert(i <= 64, "Cannot cast 64bit int.");
    return b = (unsigned long long)b - 1;
}

template<size_t i>
std::bitset<i> operator--(std::bitset<i> b){
    static_assert(i <= 64, "Cannot cast 64bit int.");
    auto temp = b;
    b--;
    return temp;
}

long long constexpr inf = std::numeric_limits<long long>::max();

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef priority_queue<ll> pq;
typedef priority_queue<ll,vector<ll>, greater<ll>> pql;
typedef stack<ll> stk;
typedef queue<ll> qu;
typedef pair<ll, ll> pll;
typedef map<ll, ll> mll;
typedef unordered_map<ll, ll> umll;
typedef set<ll> sll;
typedef unordered_set<ll> usll;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef vector<vector<ll>> vvll;


signed main(void){
    cin.tie(0); ios::sync_with_stdio(false);cout<<fixed<<setprecision(10);
    int n;
    cin >> n;

    cout << (1000 - (n - n / 1000 * 1000) == 1000 ? 0 : 1000 - (n - n / 1000 * 1000)) << "\n";


    return 0;
}


Measured memory_bytes: 3644
import re
s = input()
ans = [-1] * (len(s) + 1)
if s[0] == '<':
    ans[0] = 0
    diff = 1
    while (0 <= diff -1 < len(s)):
        if (s[diff - 1] == '>'):
            break
        ans[diff] = max(ans[diff], ans[diff - 1] + 1)
        diff += 1
        
if s[len(s) - 1] == '>':
    t = len(s)
    ans[t] = 0
    diff = -1
    while (0 <= t + diff < len(s)) & (s[t + diff] == '>'):
        ans[t + diff] = max(ans[t + diff], ans[t + diff + 1] + 1)
        diff -= 1

match = []
for i in range(len(s)):
    if s[i:i+2] == '><':
        match.append(i)

for i in match:
    ans[i + 1] = 0
    diff = 1
    while (0 <= i + 1 - diff < len(s)):
        if s[i - diff + 1] == '<':
            break
        ans[i + 1 - diff] = max(ans[i + 1 - diff], ans[i - diff + 2] + 1)
        diff += 1
    diff = 1
    while (0 <= i + diff < len(s)):
        if s[i + diff] == '>':
            break
        ans[i + 1 + diff] = max(ans[i + 1 + diff], ans[i + diff] + 1)
        diff += 1
print(sum(ans))

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

int main(){
    int n;
    cin >> n;
    vector<int> h(n);
    rep(i,n) cin >> h[i];
    int now = 0;
    int ans = 0;
    rep(i,n-1){
        if(h[i] >= h[i+1]) now++;
        else{
            ans = max(now, ans);
            now = 0;
        }
    }
    ans = max(ans, now);
    cout << ans << endl;
}

Measured memory_bytes: 3752
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

    static String S;
    static int W;

    public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);
        S = sc.next();
        W = sc.nextInt();

        System.out.println( solve() );
    }

    static String solve() {
        StringBuilder b = new StringBuilder();
        for (int i = 0; i < S.length(); i++) {
            if( i % W == 0 ) {
                b.append(S.charAt(i));
            }
        }
        return b.toString();
    }

    @SuppressWarnings("unused")
    static class FastScanner {

        private BufferedReader reader;
        private StringTokenizer tokenizer;

        FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }

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

        String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }

            return tokenizer.nextToken("\n");
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }
}



Measured memory_bytes: 21332
#include<bits/stdc++.h>
using namespace std;
int main(){
  string o,e;
  cin >> o >> e;
  int i;
  for(i=0;i<e.size();i++){
    cout << o.at(i) << e.at(i);
  }
  if(o.size()>e.size()){
    cout << o.at(o.size()-1);
  }
}

Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <numeric>
#include <algorithm>
#include <iomanip>
#define _USE_MATH_DEFINES
#include <cmath>
#include <math.h>
#include <stdio.h>
#include <tuple>

#define rep(i,m,n) for(int i=(m);i<(n);++i)
#define rem(i,m,n) for(int i=(m);i>(n);--i)
#define MOD 1000000007

using namespace std;

using ll = long long int;
using std::swap;

vector<int> v;
vector<int> w;
//vector<long long int> vll;
//vector<long long int> wll; 
//vector<vector<int>> vec(50,vector<int>(4,0));
//vector<vector<int>> vec;

	

int main() {
	int N, M;
	int ans = 0;
	cin >> N >> M;
	v.resize(N);
	w.resize(N,1);

	rep(i, 0, N)cin >> v[i];
	rep(i, 0, M) {
		int A, B;
		cin >> A >> B;
		if (v[A - 1] > v[B - 1]) {
			w[B - 1] = 0;
		}
		else if (v[A - 1] < v[B - 1]) {
			w[A - 1] = 0;
		}
		else if(v[A - 1] == v[B - 1]) {
			w[A - 1] = 0;
			w[B - 1] = 0;
		}
	}
	ans = count(w.begin(), w.end(), 1);
	cout << ans << '\n';
	return 0;
}

Measured memory_bytes: 4028
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <random>
#include <chrono>
#include <tuple>
#include <random>

using namespace std;

typedef long long ll;
typedef long double ld;
#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);

const ll SIZE = 1e6 * 2 + 10, INF = 1e9 * 1e9 + 10;

ll a[3];

void find(int left) {
    if (left == 0) {
        if (a[0] < a[1] && a[1] < a[2]) {
            cout << "Yes\n";
            exit(0);
        }
        return;
    }
    for (int i = 0; i < 3; i++) {
        a[i] *= 2;
        find(left - 1);
        a[i] /= 2;
    }
}
int main()
{
    fastInp;

    ll n, k;
    cin >> n >> k;
    vector<ll> vec(n);
    for (int i = 0; i < n; i++) cin >> vec[i];
    for (int i = k; i < n; i++) {
        if (vec[i] > vec[i - k]) {
            cout << "Yes\n";
        } else {
            cout << "No\n";
        }
    }
    return 0;
}

Measured memory_bytes: 4780
/*
 * AOJ 0118 Property Distribution
 * HxW???????????????????????????????¬?????±????????????´?????°
 * H, W <= 100
 */

#include <assert.h>
#include <ctype.h>
#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>

#include <algorithm>
#include <complex>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;

#define SZ(a) (int)(a).size()
#define FOR(i,a,b) for (int i=(a); i<=(b); ++i)
#define REP(i,n) for (int i=0; i<(n); ++i)
#define ALL(c) c.begin(), c.end()
#define CLR(c,n) memset(c, n, sizeof(c))
#define TR(it, c) for(typeof(c.begin()) it = c.begin();it != c.end(); ++it)
#define CONTAIN(it, c) (c.find(it) != c.end())
typedef vector<int> VI;
typedef pair<int, int> PII;
template <class T> void checkmin(T &a, T b) { if (b<a) a=b; }
template <class T> void checkmax(T &a, T b) { if (b>a) a=b; }

int h, w;
char s[104][104];

int dx[4] = { -1, 0, 1, 0 };
void fill(int x, int y, char c) {
  if (x < 0 || x >= h || y < 0 || y >= w) return;
  if (s[x][y] != c) return;
  s[x][y] = '\0';
  REP(dir, 4) fill(x + dx[dir], y + dx[dir^1], c);
}

int main(int argc, char *argv[]) {
  while (scanf("%d %d", &h, &w) == 2 && h + w > 0) {
    REP(i, h) scanf("%s", s[i]);
    int ans = 0;
    REP(i, h) REP(j, w) if (s[i][j]) fill(i, j, s[i][j]), ++ans;
    printf("%d\n", ans);
  }
}

Measured memory_bytes: 1664
#include <bits/stdc++.h>
#include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <random>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define repp(i,n,m) for (int i = m; i < (n); ++i)
#define repl(i,n) for (long long i = 0; i < (n); ++i)
#define reppl(i,n,m) for (long long i = m; i < (n); ++i)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using PL = pair<long long, long long>;
using Pxy = pair<double, double>;
using T = tuple<int, int, bool>;
const int INF = 1001001007;
const int MOD = 1000000007;
//const int MOD = 998244353;
const ll inf = 1e18;
template <typename AT>
void printvec(vector<AT> &ar){
    rep(i,ar.size()-1) cout << ar[i] << " ";
    cout << ar[ar.size()-1] << endl;
}
template <typename Q>
void printvvec(vector<vector<Q>> &ar){
    rep(i,ar.size()){
        rep(j,ar[0].size()-1) cout << ar[i][j] << " ";
        cout << ar[i][ar[0].size()-1] << endl;
    }
}
template <typename S>
bool range(S a, S b, S x){
    return (a <= x && x < b);
}

int main() {
    ll n; cin >> n;
    if (n % 2 == 1){
        cout << 0 << endl;
        return 0;
    }
    if (n == 0){
        cout << 0 << endl;
        return 0;
    }
    ll ans = 0;
    ll g = 10LL;
    while (g <= n){
        ans += n / g;
        g *= 5LL;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    M = int(readline())
    
    print(48 - M)
    
    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 9172
#include <bits/stdc++.h>
//#define int long long

using namespace std;
using LL = long long;
using P = pair<int, int>;

#define FOR(i, a, n) for(int i = (int)(a); i < (int)(n); ++i)
#define REP(i, n) FOR(i, 0, n)

#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()

const int INF = (int)1e9;
const LL INFL = (LL)1e19;
const int MOD = 1e9 + 7;

signed main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n, k;
    cin >> n >> k;
    cout << n - k + 1 << endl;
}

Measured memory_bytes: 256
// ~/BAU/ACM-ICPC/Teams/Rampage/MMZA
// ~/sudo apt-get verdict Accpeted
//#include <QCoreApplication>
#include<list>
#include <iostream>
#include <iomanip>
#include<stack>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <string>
#include <assert.h>
#include <ctype.h>
#include <limits.h>
#include <math.h>
#include<cmath>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <bitset>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <fstream>
#include <ostream>
#include<functional>
using namespace std;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef long long ll;
typedef vector<pair<int, int>> vp;
typedef vector<vector<pair<int, int>>> vvp;
typedef unsigned long long ull;
typedef long  double ld;
const ll Mod = 1000000007;
vector<ii> arr;
int main() {
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
#endif
 int n;
 char s[300005];
 scanf("%d %s",&n,&s);
 arr.resize(n);
 int east=0,west=0;
 for(int i=0;i<n;i++){
     if(s[i]=='E')
         east++;
     else west++;
 }
 int totalE=east,totalW=west,ans=INT_MAX,sum=INT_MAX;
 for(int i=0;i<n;i++){
     s[i]=='E'?east--:west--;
     if(s[i]=='E'){
        ans=min(ans,totalW-west+east);
     }
 }
 east=totalE;west=totalW;
 for(int i=n-1;i>=0;i--){
     s[i]=='E'?east--:west--;
     if(s[i]=='W'){
        sum=min(sum,totalE-east+west);
     }
 }

 printf("%d\n",min(ans,sum));









//cout << flush;
    return 0;

}


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

deka = a[0]
mini = a[0]
for i in range(1,n):
  if a[i] > deka:
    deka = a[i]
  if a[i] < mini:
    mini = a[i]

print(abs(deka - mini))

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

int main(){
    int n,a[110],sum,MIN=1e9;
    cin>>n;
    for(int i=0;i<n;i++) cin>>a[i];
    for(int i=-100;i<=100;i++){
        sum=0;
        for(int j=0;j<n;j++) sum+=(i-a[j])*(i-a[j]);
        MIN=min(sum,MIN);
    }
    cout<<MIN<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
int main(void){
    int n,x,ans = 1,tmp = 0;
    cin >> n >> x;
    vector<int> l(n);
    for(int i = 0;i < n;i++){
        cin >> l[i];
        tmp += l[i];
        if(tmp <= x) ans++;
    }
    cout << ans << endl;
    return 0;
}


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

int main() {
    ll A, B = 1, N;
    cin >> N;
    int flag = 0;
    rep(i,N){
        cin >> A;
        B *= A;
        if(B > 1000000000000000000){
            B = 0;
        }
        if(A == 0){
            flag = 1;
        }
    }
    if(B == 0 && flag == 0){
        B = -1;
    }
    cout << B << endl;
    return 0;
}

Measured memory_bytes: 3624
#include <stdio.h>

int main(void)
{
   int n,d,x,a[100],i,j,count=0;

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

   for(i=1;i<=n;i++)
      scanf("%d",&a[i]);

   for(i=1;i<=n;i++){
      for(j=1;j<=d;j=j+a[i]) count++;
   }
   printf("%d",count+x);

   return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define F first
#define S second
#define pb push_back
#define eb emplace_back
#define INF LLONG_MAX
#define PI 3.14159265359
#define sz(c) (int)c.size()
#define len(c) (int)c.length()
#define hcf(a, b) __gcd(a, b)
#define all(c) c.begin(), c.end()
#define vint vector<int>
#define vll vector<ll>
#define vpint vector<pair<int, int>>
#define vpll vector<pair<ll, ll>>
#define tr(con, it) \
    for (auto it = con.begin(); it != con.end(); it++)
#define fr(it, a, b) \
    for (int it = (a); it < (b); it++)
#define present(con, ele) (con.find(ele) != con.end())
#define cpresent(con, ele) (find(all(con), ele) != con.end())
#define maximum(a, b, c) (a > b ? (a > c ? a : c) : (b > c ? b : c))
#define minimum(a, b, c) (a < b ? (a < c ? a : c) : (b < c ? b : c))
typedef long long ll;
typedef long double lf;
typedef unsigned long long lu;
const ll mod = 1e9 + 7;
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s, t;
    cin >> s >> t;
    t = t.substr(0, len(t) - 1);
    if (s == t)
    {
        cout << "Yes\n";
    }
    else
    {
        cout << "No\n";
    }
    return 0;
}

Measured memory_bytes: 3656
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    N = int(input())
    X = tuple(map(int, input().split()))

    ans = 10000000
    for i in range(101):
        s = 0
        for x in X:
            s += (x - i) ** 2
        if ans > s:
            ans = s
    print(ans)

if __name__ == '__main__':
    main()


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

int main(){
  int H,N;
  cin>>H>>N;
  vector<int>A(N);
  for(int i=0;i<N;i++){
    cin>>A.at(i);
  }
  sort(A.begin(),A.end(),greater<int>());
  string ans = "No";
  int total=0;
  for(int i=0;i<N;i++){
    total+=A.at(i);
    if(total>=H){
      ans="Yes";
      break;
    }
  }

  cout<<ans<<endl;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=105;
int n,tot,p,si[N],head[N],nex[N<<1],to[N<<1];
void add(int u,int v){to[++tot]=v;nex[tot]=head[u];head[u]=tot;}
vector<pair<int,int> >vc;
void dfs(int u,int fa,int dep)
{
    p=max(p,dep);
    int deg=0;
    for(int i=head[u];i;i=nex[i])
    {
        int v=to[i];if(v==fa) continue;
        deg++;
        dfs(v,u,dep+1);
    }
    si[dep]=max(si[dep],deg);
}
int main()
{
    scanf("%d",&n);
    for(int i=1;i<n;i++)
    {
        int u,v;scanf("%d%d",&u,&v);
        add(u,v);add(v,u);
        vc.push_back({u,v});
    }
    pair<int,ll>ans={1e9,1e18};
    for(int i=1;i<=n;i++)
    {
        memset(si,0,sizeof(si));
        p=0;
        dfs(i,0,1);
        ll res=1;
        for(int j=1;j<p;j++)
            res*=si[j];
        ans=min(ans,{p,res});
    }
    for(int i=0;i<vc.size();i++)
    {
        memset(si,0,sizeof(si));
        p=0;
        dfs(vc[i].first,vc[i].second,1);
        dfs(vc[i].second,vc[i].first,1);
        ll res=1;
        for(int j=1;j<p;j++)
            res*=si[j];
        ans=min(ans,{p,res*2});
    }
    printf("%d %lld\n",ans.first,ans.second);
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
	float x[4],y[4];
	double line1, line2;
	int N,i;
	scanf("%d",&N);
	
	for(i = 0; i < N; i++){
		scanf("%f %f %f %f %f %f %f %f", &x[0], &y[0], &x[1], &y[1], &x[2], &y[2], &x[3], &y[3]);
		line1 = (y[0]-y[1])/(x[0]-x[1]);
		line2 = (y[2]-y[3])/(x[2]-x[3]);
		if(line1 == line2) printf("YES\n");
		else printf("NO\n");
	}
	
	return 0;
	
}

Measured memory_bytes: 612
import sys
sys.setrecursionlimit(5000000)

def nasu(N, n):
  if N in DP:
    return n + DP[N]
  if N == 0:
    return n
  if N == 1:
    return n + D
  ans = n + D * N
  a = N % 2
  if a == 0:
    ans = min(ans, nasu(N // 2, n + A))
  else:
    if a > 1:
      ans = min(ans, nasu((N - 1) // 2, n + D + A))
    ans = min(ans, nasu((N + 1) // 2, n + D + A))
  b = N % 3
  if b == 0:
    ans = min(ans, nasu(N // 3, n + B))
  else:
    if N > 2:
      ans = min(ans, nasu((N - b) // 3, n + (b * D) + B)) 
    ans = min(ans, nasu((N + (3 - b)) // 3, n + ((3 - b) * D) + B)) 
  c = N % 5
  if c == 0:
    ans = min(ans, nasu(N // 5, n + C))
  else:
    if N > 4:
      ans = min(ans, nasu((N - c) // 5, n + (c * D) + C))
    ans = min(ans, nasu((N + (5 - c)) // 5, n + ((5 - c) * D) + C)) 

  DP[N] = ans - n
  return ans

T = int(input())
M = [list(map(int, input().split())) for _ in range(T)]
for N, A, B, C, D in M:
  DP = {}
  ans = nasu(N, 0)
  print(ans)


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

int main()
{
    int ans = 0;
    char S[100000];
    scanf("%s", S);
    for (int i = 1; i < strlen(S); i++) {
        if (S[i - 1] == '0' && S[i] == '0') {
            S[i] = '1';
            ans++;
        } else if (S[i - 1] == '1' && S[i] == '1') {
            S[i] = '0';
            ans++;
        }
    }
    printf("%d\n", ans);
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;

const int INF = 1001001001;
struct edge{ int from, to, cost; };

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    int dp[100][100];
    vector<edge> ev;
    fill_n((int*)dp, 100 * 100, INF);
    REP(i, 100) dp[i][i] = 0;
    REP(i, m){
        int a, b, c;
        cin >> a >> b >> c;
        a--;
        b--;
        dp[a][b] = c;
        dp[b][a] = c;
        ev.push_back({a, b, c});
    }

    REP(i, n)REP(j, n)REP(k, n)
        dp[j][k] = min(dp[j][k], dp[j][i] + dp[i][k]);

    REP(s, n)for(auto &e : ev){
        if(e.cost == -1) continue;
        if(dp[s][e.to] == dp[s][e.from] + e.cost
            || dp[s][e.from] == dp[s][e.to] + e.cost){
            e.cost = -1;
        }
    }

    int ans = 0;
    for(auto &e : ev)if(e.cost != -1) ans++;
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 384
#include <stdio.h>

int main()
{
	int i, N, count[4] = {};
	char S[4];
	scanf("%d", &N);
	for (i = 1; i <= N; i++) {
		scanf("%s", S);
		if (S[0] == 'A') count[0]++;
		else if (S[0] == 'W') count[1]++;
		else if (S[0] == 'T') count[2]++;
		else count[3]++;
	}
	printf("AC x %d\n", count[0]);
	printf("WA x %d\n", count[1]);
	printf("TLE x %d\n", count[2]);
	printf("RE x %d\n", count[3]);
	fflush(stdout);
	return 0;
}

Measured memory_bytes: 1712
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <vector>
#include <iomanip>
#include <map>
#include <queue>

using namespace std;

#define fori(x) for (int i = 0; i < x; ++i)
#define forj(x) for (int j = 0; j < x; ++j)

typedef long long ll;

const int INF = 2e9 + 5;
const int alength=100100*2;

int main() {
	ll n,d;
	cin>>n>>d;
	d=d*d;
	ll x,y,count=0;
	fori(n){
		cin>>x>>y;
		if(x*x+y*y<=d){
			++count;
		}
	}
	cout<<count;
}

Measured memory_bytes: 3632
a = int(input())
b = int(input())
c = int(input())
x = int(input())
res = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            t = 500*i + 100*j + 50*k
            if t == x:
                res += 1
print(res)


Measured memory_bytes: 2940
#include<bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,int> pli;
const int inf=1e9;
const ll Inf=1e18;
const int N=1e6+10;
const int mod=0;
int gi() {
    int x=0,o=1;char ch=getchar();
    while((ch<'0'||ch>'9')&&ch!='-') ch=getchar();
    if(ch=='-') o=-1,ch=getchar();
    while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
    return x*o;
}
template<typename T> bool chkmax(T &a,T b) { return a<b?a=b,1:0; };
template<typename T> bool chkmin(T &a,T b) { return a>b?a=b,1:0; };
int add(int a,int b) { return a+b>=mod?a+b-mod:a+b; }
int sub(int a,int b) { return a-b<0?a-b+mod:a-b; }
void inc(int &a,int b) { a=(a+b>=mod?a+b-mod:a+b); }
void dec(int &a,int b) { a=(a-b<0?a-b+mod:a-b); }
int n,v,x[N],st[N],l[N][20],r[N][20],f[N],g[N],mn[N],top=0;
int main() {
    cin>>n>>v;
    for(int i=1;i<=n;i++) x[i]=gi();
    while(v) st[++top]=v,v>>=1;
    st[++top]=0;
    reverse(st+1,st+top+1);
    for(int j=1;j<=top;j++) {
        l[1][j]=1;
        for(int i=2;i<=n;i++) l[i][j]=(x[i]-x[i-1]<=st[j])?l[i-1][j]:i;
        r[n][j]=n;
        for(int i=n-1;i;i--) r[i][j]=(x[i+1]-x[i]<=st[j])?r[i+1][j]:i;
    }
    f[0]=0;g[0]=n+1;
    for(int i=1;i<(1<<top);i++) {
        f[i]=0,g[i]=n+1;
        for(int j=1;j<=top;j++)
            if(i>>(j-1)&1) {
                chkmax(f[i],(f[i^(1<<(j-1))]==n)?n:r[f[i^(1<<(j-1))]+1][j]);
                chkmin(g[i],(g[i^(1<<(j-1))]==1)?1:l[g[i^(1<<(j-1))]-1][j]);
            }
    }
    memset(mn,0x3f,sizeof(mn));
    for(int i=0;i<(1<<(top-1));i++) chkmin(mn[f[i]],g[((1<<(top-1))-1)^i]);
    for(int i=n-1;i;i--) chkmin(mn[i],mn[i+1]);
    for(int i=1;i<=n;i++) puts(mn[l[i][top]-1]<=r[i][top]+1?"Possible":"Impossible");
    return 0;
}


Measured memory_bytes: 55680
#include<bits/stdc++.h>
using namespace std;
#define fr(i,n)  for(int i = 0;i<n;++i)
#define fri(i,a,b) for(int i= a;i<=b;++i)
#define fro(i,a,b) for(int i= a;i>=b;--i)
#define debug(P) cout<<#P<<" = "<<P<<endl;
#define fi first
#define se second
#define pb(x) push_back(x)
#define  mp(x,y) make_pair(x,y)
#define endl  "\n"
#define  ii  pair<int,int>
#define  LL  long long
#define  maxm(a,b,c)  max(a,max(b,c))
const int INF = 1e9+7;
int main(){
  int n,m,k;
  cin>>n>>k;
  int a[n];
  int dp[n];
  fr(i,n){
  	cin>>a[i];
  	dp[i] = INF;
  }
  dp[0] = 0;
  dp[1] =  abs(a[1]-a[0]);
  fri(i,2,n-1){
  	 if(i<=k)m = 0;
  	 else m = i-k;
  	 fro(j,i-1,m){
  	dp[i] = min(dp[i],dp[j]+abs(a[i]-a[j]));
  }
  }
cout<<dp[n-1];
}

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

using namespace std;

namespace {
    typedef long long Long;

    Long to_i(const string& s) {
        istringstream is(s);
        Long n; is >> n;
        return n;
    }

    Long P; string s;

    Long extgcd(Long a, Long b, Long& x, Long& y) {
        Long g = a; x = 1LL; y = 0LL;
        if (b != 0LL) {
            g = extgcd(b, a % b, y, x);
            y -= (a / b) * x;
        }
        return g;
    }
    Long inverse(Long v) {
        Long x, y;
        if (extgcd(v, P, x, y) == 1LL) return (x + P) % P;
        return 0;
    }

    bool input() {
        string l; getline(cin, l);
        int x = l.find(":");
        P = to_i(l.substr(0, x));
        if (P == 0) return false;
        string t = l.substr(x + 1, l.size() - (x + 1));
        s.clear();
        for (int i = 0; i < t.size(); i++) {
            if (t[i] != ' ') s.push_back(t[i]);
        }
        return true;
    }

    Long calc(char op, Long a, Long b) {
        //cout << a << op << b << endl;
        if (op == '+') return (a + b) % P;
        if (op == '-') return (a + P - b) % P;
        if (op == '*') return (a * b) % P;
        if (op == '/') {
            if (b == 0) throw("NG");
            return (a * inverse(b)) % P;
        }
        cout << op << endl;
        assert(0);
    }

    Long number(const string& s, int& i) {
        string t;
        while (i < s.size() && isdigit(s[i])) {
            t.push_back(s[i]);
            i++;
        }
        return to_i(t);
    }

    Long expr(const string& s, int&i);
    Long term(const string& s, int& i) {
        Long a;
        if (s[i] == '(') {
            i++;
            a = expr(s, i);
            assert(s[i] == ')');
            i++;
        } else {
            a = number(s, i);
        }
        while (i < s.size() && (s[i] == '*' || s[i] == '/')) {
            char op = s[i]; i++;
            Long b;
            if (s[i] == '(') {
                i++;
                b = expr(s, i);
                assert(s[i] == ')');
                i++;
            } else {
                b = number(s, i);
            }
            a = calc(op, a, b);
        }
        return a;
    }

    Long expr(const string& s, int& i) {
        Long a = term(s, i);
        while (i < s.size() && s[i] != ')') {
            char op = s[i]; i++;
            assert(op == '+' || op == '-');
            Long b = term(s, i);
            a = calc(op, a, b);
        }
        return a;
    }

    void solve() {
        try {
            int i = 0;
            Long ans = expr(s, i);
            cout << s << " = " << ans << " (mod " << P << ")" << endl;
        } catch (char const* msg) {
            cout << msg << endl;
        }
    }
}

int main() {
    while (input()) solve();
    return 0;
}

Measured memory_bytes: 1536
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>

#define CH(N,A,B) (A<=N&&N<B)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define RREP(i,a,b) for(int i=(b-1);a<=i;i--)

using namespace std;

int M, Nmin, Nmax, P[205];

int main() {
  while(1){
    cin>>M>>Nmin>>Nmax;
    if(M==0)break;
    REP(i,0,M){
      cin>>P[i];
    }
    int ans = 0, num = -1;
    for(int i = Nmin-1; i < Nmax; i++){
      if(ans <= P[i] - P[i+1]){
        ans = P[i] - P[i+1];
        num = i+1;
      }
    }
    cout<<num<<endl;
  }
  return 0;
}

Measured memory_bytes: 3104
#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<algorithm>
#include<functional>
#include<utility>
#include<bitset>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<cstdio>

using namespace std;

#define REP(i,n) for(int i=0;i<int(n);i++)
#define foreach(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
typedef pair<int,int> P;
typedef long long ll;

int main(void){

	string x;
	ll a;
	cin >> x >> a;

	int n=x.size();
	ll lr=x[0]-'0';
	int i;
	for(i=1;i<n;i+=2){
		if(x[i]=='+') lr+=x[i+1]-'0';
		if(x[i]=='*') lr*=x[i+1]-'0';
	}

	ll mf=0,q=1;
	if(n==1){
		if(a==x[0]-'0') cout << "U" << endl;
		else cout << "I" << endl;
		return 0;
	}
	for(i=0;i<n;i+=2){
		if(i!=0 && i!=n-1) if(x[i-1]=='*' && x[i+1]=='*') q*=x[i]-'0';
		if((i==0 && x[i+1]=='*') || (x[i-1]=='+' && x[i+1]=='*')) q*=x[i]-'0';
		if((i==n-1 && x[i-1]=='*') || (x[i-1]=='*' && x[i+1]=='+')){
			q*=x[i]-'0'; mf+=q; q=1;
		}

		if(i!=0 && i!=n-1) if(x[i-1]=='+' && x[i+1]=='+') mf+=x[i]-'0';
		if(i==0) if(x[i+1]=='+') mf+=x[i]-'0';
		if(i==n-1) if(x[i-1]=='+') mf+=x[i]-'0';
	}



	if(lr==mf && lr==a) cout << "U" << endl;
	else if(mf==a) cout << "M" << endl;
	else if(lr==a) cout << "L" << endl;
	else cout << "I" << endl;

	return 0;
}

Measured memory_bytes: 1204
n, x, y = map(int, input().split())

d = []
for i in range(n):
    lst = [0 for _ in range(n)]
    temp = i+1
    umeru = 1
    while temp <= n-1:
        lst[temp] = umeru
        umeru += 1
        temp += 1
    temp = i-1
    umeru = 1
    while temp >= 0:
        lst[temp] = umeru
        umeru += 1
        temp -= 1
    d.append(lst)

d[x-1][y-1] = 1
d[y-1][x-1] = 1

lst = [x-1, y-1]
for k in lst:
    for i in range(n):
        for j in range(n):
            d[i][j] = min(d[i][j],d[i][k] + d[k][j])

ans = [0 for _ in range(n)]
for i in range(n):
    for j in range(i+1, n):
        ans[d[i][j]] += 1

for i in range(1, n):
    print(ans[i])

Measured memory_bytes: 79580
#include <bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(i, n) for (i = 0; i < n; i++)
#define Fo(i, k, n) for (i = k; k < n ? i < n : i > n; k < n ? i += 1 : i -= 1)
#define ll long long
#define si(x) scanf("%d", &x)
#define sl(x) scanf("%lld", &x)
#define ss(s) scanf("%s", s)
#define pi(x) printf("%d\n", x)
#define pl(x) printf("%lld\n", x)
#define ps(s) printf("%s\n", s)
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for (auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
typedef pair<int, int> pii;
typedef pair<ll, ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<char> vc;
typedef vector<vc> vcc;
typedef vector<pii> vpii;
typedef vector<pl> vpl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int lim)
{
    uniform_int_distribution<int> uid(0, lim - 1);
    return uid(rang);
}

int mpow(int base, int exp);
void ipgraph(int n, int m);
void dfs(int u, int par);

const int mod = 1'000'000'007;
const int N = 3e5, M = N;
//=======================

vi g[N];
int a[N];

void solve()
{
    ll i, j, n, m;
    fo(i, 5)
    {
        cin >> j;
        if (j == 0)
        {
            cout << i + 1 << endl;
            exit(0);
        }
        else
        {
            continue;
        }
    }
}

int main()
{
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    srand(chrono::high_resolution_clock::now().time_since_epoch().count());

    int t = 1;
    //cin >> t;
    while (t--)
    {
        solve();
    }

    return 0;
}

int mpow(int base, int exp)
{
    base %= mod;
    int result = 1;
    while (exp > 0)
    {
        if (exp & 1)
            result = ((ll)result * base) % mod;
        base = ((ll)base * base) % mod;
        exp >>= 1;
    }
    return result;
}

void ipgraph(int n, int m)
{
    int i, u, v;
    while (m--)
    {
        cin >> u >> v;
        u--, v--;
        g[u].pb(v);
        g[v].pb(u);
    }
}

void dfs(int u, int par)
{
    for (int v : g[u])
    {
        if (v == par)
            continue;
        dfs(v, u);
    }
}


Measured memory_bytes: 10576
#include <bits/stdc++.h>
#define rep(i, start, end) for (long long i = start; i < end; ++i)
#define repreverse(i, start, end) for (long long i = start; i >= end; --i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define len(x) ((long long)(x).size())
#define lcm(a, b) ((a) / __gcd((a), (b)) * (b))
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vllvll = vector<vll>;
using vc = vector<char>;
using pll = pair<ll, ll>;
template<class T> void print1d(T x,ll n=-1){if(n==-1)n=x.size();rep(i,0,n){cout<<x[i]<<' ';}cout<<'\n';}
template<class T> void print2d(T x,ll r=-1,ll c=-1){if(r==-1)r=x.size();if(c==-1)c=x[0].size();rep(i,0,r)print1d(x[i],c);}
template<class T, class U> bool haskey(T mp, U key) { return mp.find(key) != mp.end(); }
template<class T, class U> bool isin(T el, U container) { return find(all(container), el) != container.end(); }
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; }
template<class T> bool even(T n) { return ! (n & 1); }
template<class T> bool odd(T n) { return n & 1; }
template<class T> ll rup(T a, T b) { return a % b ? a / b + 1 : a / b; }
template<class T> ld deg2rad(T deg) { return M_PI * deg / 180.0; }
template<class T> ld rad2deg(T rad) { return 180.0 * rad / M_PI; }
const long double pi = M_PI;
const long long big = 1LL << 50;
const long long inf = 1LL << 60;
const long long mod = 1e9 + 7;
ll intpow(ll a, ll n, ll _mod=numeric_limits<ll>::max()) { ll p=1; while (n) { if (n&1) p=p*a%_mod; a=a*a%_mod; n>>=1; } return p; } 
ll modc(ll a, char op, ll b, ll _mod=mod) { a %= _mod; b %= _mod; ll res = 1; switch(op) {
        case '+': res = (a + b) % _mod; break;
        case '-': res = (a - b) % _mod; break;
        case '*': res = a * b % _mod; break;
        case '/': res = modc(a, '*', modc(b, '^', _mod-2, _mod), _mod); break;
        case '^': res = intpow(a, b, _mod); break;
        case 'P': rep(i, a-b+1, a+1) res = modc(res, '*', i, _mod); break;
        case 'C': res = modc(modc(a, 'P', b, _mod), '/', modc(b, 'P', b, _mod)); break; } if (res < 0) res += _mod; return res; }


int main()
{
        string S;
        cin >> S;
        if (S == "keyence") {
                cout << "YES" << endl;
                return 0;
        }

        rep(i, 1, len(S)) {
                rep(pos, 0, len(S)) {
                        string cp(all(S));
                        // ll mxpos = min(len(S)-1, pos+i);
                        string l(cp.begin(), cp.begin()+pos);
                        ll os = min(pos+i, len(S));
                        string r(cp.begin()+os, cp.end());
                        string res = l + r;
                        // cout << res << endl;
                        if (res == "keyence") {
                                cout << "YES" << endl;
                                return 0;
                        }
                }
        }
        cout << "NO" << endl;
}


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

#define MAX 100000

long int S[MAX];

int binarySearch(int key, int n)
{
	int left, right, mid;
	
	left = 0;
	right = n;
	
	while (left < right) {
		mid = (left + right) / 2;
		if (S[mid] == key) {
			return 0;
		}
		else if (key < S[mid]) {
			right = mid;
		}
		else {
			left = mid + 1;
		}
	}
	return 1;
}


int main()
{
	int n, q;
	long int T[MAX];
	int i, cnt;
	
	cnt = 0;
	
	scanf("%d",&n);
	for (i = 0; i < n; i++) {
		scanf("%ld",&S[i]);
	}
	
	scanf("%d",&q);
	for (i = 0; i < q; i++) {
		scanf("%ld",&T[i]);
	}
	
	for (i = 0; i < q; i++) {
		binarySearch(T[i], n);
		if (binarySearch(T[i], n) == 0) {
			cnt++;
		}
	}
	printf("%d\n",cnt);
return 0;
}


Measured memory_bytes: 2868
#include<stdio.h>
#include<string.h>
#define LEN 100005

typedef struct pp{
  char name[100];
  int t;
}P;

P Q[LEN];
int head=0, tail, n;

void enqueue(P x){
  strcpy(Q[tail].name,x.name);
  Q[tail].t = x.t;
  tail++;
  if(tail == LEN){
    tail = 0; 
  }
}




int main(){
  int elaps = 0, c;
  int i, q;
  P u;
  scanf("%d %d", &n, &q);

  for ( i = 0; i < n; i++){
    scanf("%s", Q[i].name);
    scanf("%d", &Q[i].t);
  }
  tail = n;

  while(tail!=head){
    if(Q[head].t > q){
      elaps += q;
      Q[head].t -= q;
      enqueue(Q[head]);

    }
    else{
      elaps+=Q[head].t; 
      printf("%s %d\n",Q[head].name,elaps);

    }
    head++;
    if(head == LEN){
      head = 0;
    }
  }  
  return 0;
}

Measured memory_bytes: 10768
n = gets.to_i
array = Array.new(n){|i| i = gets.chomp.split}
result = []
array.each do |j|
    if j[1] == 'JPY'
        result << j[0].to_f
    else
        result << (j[0].to_f * 380000.0)
    end
end
puts result.sum

Measured memory_bytes: 14256
y1_list = list(map(int,input().split()))
y2_list = list(map(int,input().split()))
y3_list = list(map(int,input().split()))
L = [y1_list,y2_list,y3_list]
 
a1 = list()
a2 = list()
b1 = list()
b2 = list()
 
for i in range(3):
    a1.append(y1_list[i] - y2_list[i])
    a2.append(y2_list[i] - y3_list[i])
    b1.append(L[i][0] - L[i][1])
    b2.append(L[i][1] - L[i][2])
 
 
if (a1[0] == a1[1] and a1[2] == a1[0])and(b1[0] == b1[1] and b1[2] == b1[0]):
    if (a2[0] == a2[1] and a2[2] == a2[0])and(b2[0] == b2[1] and b2[2] == b2[0]):
        print("Yes")
        
    else:
        print("No")
else:
    print("No")

Measured memory_bytes: 9192
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i,n,t,p,a,b;
    string s;
    cin>>a>>b;
    p=a/b;
    if(a%b!=0){
        p++;
    }
    cout<<p<<endl;

    return EXIT_SUCCESS;
}



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

using namespace std;
#define inf 1000000000
#define unvisited -1
#define visited 1
#define eps 1e-9
#define mp make_pair
#define pb push_back
#define pi acos(-1.0)
#define uint64 unsigned long long
#define FastSlowInput ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define debug if(true)
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;

int main(){
	int n,i,j;
	int a[102];
	scanf("%d",&n);
	int cnt = 0;
	for(i=1;i<=n;i++){
		scanf("%d",&a[i]);
		if (i % 2 == 1){
			if(a[i] % 2 == 1){
				cnt++;
			}
		}
	}

	printf("%d\n",cnt);

	
	return 0;
};

Measured memory_bytes: 3720
#include <iostream>
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <map>
#include <stack>
#include <set>
#include <sstream>
#define IOS                       \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);
#define mod 1000000007
#define eps 1e-6
#define ll long long
#define INF 0x3f3f3f3f
#define MEM(x, y) memset(x, y, sizeof(x))
using namespace std;
int dt[][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}, {0, 0}};
//typedef pair<int, int> P;
//priority_queue<int, vector<int>, greater<int> > q;
struct node
{
    int pos;
    int cnt;
} a[10];
bool cmp(node xx, node yy)
{
    return xx.pos < yy.pos;
}
int main()
{
    //IOS;
    int n, m;
    cin >> n >> m;
    int p[10];
    if (m == 0)
    {
        if (n == 1)
        {
            cout << 0;
            return 0;
        }
        else
        {
            cout << 1;
            for (int i = 1; i <= n - 1; i++)
            {
                cout << 0;
            }
            return 0;
        }
    }
    for (int i = 1; i <= m; i++)
    {
        cin >> a[i].pos >> a[i].cnt;
        p[a[i].pos] = a[i].cnt;
    }
    for (int i = 1; i <= m; i++) //特判重复位
    {
        if (p[a[i].pos] != a[i].cnt)
        {
            cout << -1;
            return 0;
        }
    }
    for (int i = 1; i <= m; i++) //特判0
    {
        if (n != 1 && a[i].pos == 1 && a[i].cnt == 0)
        {
            cout << -1;
            return 0;
        }
    }
    char ans[10];
    MEM(ans, '0');
    sort(a + 1, a + n + 1, cmp);
    for (int i = 1; i <= n; i++)
    {
        ans[a[i].pos] = a[i].cnt + '0'; //cout<<"debug: "<<ans[a[i].pos]<<" "<<a[i].cnt<<endl;
    }
    if (ans[1] == '0'&&n!=1)
    {
        ans[1] = '1';
    }
    for (int i = 1; i <= n; i++)
    {
        cout << ans[i];
    }
}


Measured memory_bytes: 256
S = input()

X = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
     'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
     's', 't', 'u', 'v', 'w', 'x', 'y', 'z']

ans = ''
for x in X:
    if x not in S:
        ans = x
        break
if ans:
    print(ans[0])
else:
    print('None')

Measured memory_bytes: 3188
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>

using ll = long long;

using namespace std;

int main() {
    int n;
    string s;
    cin >> n >> s;
    int ans = 0;
    for (int i=0; i<n-2; i++) {
        if (s.substr(i, 3) == "ABC") ans++;
    }
    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 256