akhauriyash/Code-Regression huggingface dataset:
//
//  main.cpp
//  B - Tap Dance
//
//  Created by Hashizo on 2019/09/15.
//  Copyright © 2019 Hashizo. All rights reserved.
//

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <regex>

using namespace std;

#undef LONG_MAX
#undef LONG_MIN

#define LONG_MAX	9223372036854775807
#define LONG_MIN	(-LONG_MAX  -1)

#define ll long long

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

#define SORT(c) sort((c).begin(), (c).end())
#define REVERSE(v) reverse((v).begin(), (v).end())

int main(int argc, const char * argv[]) {
	string s;
	cin >> s;
	
	string ans = "Yes";

	for(ll i = 0 ; i < s.size() ; i++) {
		if (i % 2 == 0) {
			if ( s[i] == 'L') {
				ans = "No";
				break;
			}
			
		}
		else {
			if ( s[i] == 'R') {
				ans = "No";
				break;
			}
		}
	}
	
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
// https://atcoder.jp/contests/abl/tasks/abl_e

#include <atcoder/all>

#include "algorithm"
#include "bitset"
#include "cmath"
#include "functional"
#include "iomanip"
#include "iostream"
#include "map"
#include "numeric"
#include "queue"
#include "set"
#include "string"
#include "vector"
#define rep(i, to) for (ll i = 0; i < (to); ++i)
#define rep1(i, to) for (ll i = 1; i <= (to); ++i)
#define repf(i, from, to) for (ll i = from; i < (to); ++i)
#define repr(i, from) for (ll i = from - 1; i >= 0; --i)
#define all(vec) vec.begin(), vec.end()
#define unless(cond) if (!(cond))
#define fi first
#define se second
using namespace std;
using namespace atcoder;
using ll = long long;
using ld = long double;
template <typename T>
using V = vector<T>;
using VL = V<ll>;
template <typename T>
using VV = V<V<T>>;
using VVL = VV<ll>;
template <typename T>
using VVV = VV<V<T>>;
template <typename T, typename U>
using P = pair<T, U>;
using PL = P<ll, ll>;
using VPL = V<PL>;
template <typename T>
using asc_pq = priority_queue<T, V<T>, greater<T>>;

template <typename T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}

template <typename T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}

template <typename T>
inline ll len(V<T> arr) {
  return arr.size();
}

struct exit_exception : public std::exception {
  const char* what() const throw() { return "Exited"; }
};

template <typename T>
void drop(T res) {
  cout << res << endl;
  throw exit_exception();
}

const ll INF = 1e18;

void solve();

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

  try {
    solve();
  } catch (exit_exception& e) {
  }

  return 0;
}
#endif

using mint = modint998244353;
const mint inv9 = mint(1) / 9;

// ref:
// https://www.youtube.com/watch?v=D0Op33UL_cA&feature=youtu.be&ab_channel=AtCoderLive

struct S {
  mint x;
  mint w;

  S(mint x = 0, mint w = 1) : x(x), w(w) {}
};

S op(S a, S b) { return S(a.x * b.w + b.x, a.w * b.w); }

S e() { return S(); }

S mapping(ll f, S a) {
  if (f == 0) return a;
  return S((a.w - 1) * inv9 * f, a.w);
}

ll composition(ll f, ll g) {
  if (f == 0) return g;
  return f;
}

ll id() { return 0; }

void solve() {
  ll N, Q;
  cin >> N >> Q;

  lazy_segtree<S, op, e, ll, mapping, composition, id> st(N);

  rep(i, N) st.set(i, S(1, 10));

  rep(i, Q) {
    ll l, r, d;
    cin >> l >> r >> d;
    --l;
    st.apply(l, r, d);
    int res = st.all_prod().x.val();
    cout << res << "\n";
  }
}


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

int main() {
	int n; cin >> n;
	vector<int>a(n); for (auto&& x : a)cin >> x;
	int ans = 1e9;
	for (int cur = -100, tmp; cur <= 100; cur++) {
		tmp = 0; for (auto&& x : a)tmp += (x - cur) * (x - cur);
		ans = min(ans, tmp);
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 998244353LL
#define pow DCXISSOHANDSOME

ll pow[20][16384],fac[10010],ifac[10010];
ll f[210][10010],h1[32768],h2[32768];
int n,m;

inline int rd()
{
	int x=0;char ch=getchar();
	for (;ch<'0'||ch>'9';ch=getchar());
	for (;ch>='0'&&ch<='9';ch=getchar()) x=x*10+ch-'0';
	return x;
}

inline ll pls(const ll &x,const ll &y) { return (x+y<mod)?x+y:x+y-mod; }
inline ll mns(const ll &x,const ll &y) { return (x-y<0)?x-y+mod:x-y; }
inline ll ksm(ll x,ll y) { ll res=1;for (;y;y>>=1,x=x*x%mod) if (y&1) res=res*x%mod;return res; }
inline ll C(const int &x,const int &y) { return (x<0||y<0||x<y)?0:fac[x]*ifac[y]%mod*ifac[x-y]%mod; }

inline void pre_gao()
{
	fac[0]=1;
	for (int i=1;i<=10000;i++) fac[i]=fac[i-1]*i%mod;
	ifac[10000]=ksm(fac[10000],mod-2);
	for (int i=9999;~i;i--) ifac[i]=ifac[i+1]*(i+1)%mod;
	for (int w=2,hh=1;w<=16384;w<<=1,hh++)
	{
		ll now=ksm(3,(mod-1)/w);
		pow[hh][0]=1;
		for (int j=1;j<(w>>1);j++) pow[hh][j]=pow[hh][j-1]*now%mod;
	}
}

inline void ntt(ll *a,int n,int on)
{
	static int rev[32768];
	for (int i=1;i<n;i++) rev[i]=(rev[i>>1]>>1)|((i&1)?(n>>1):0);
	for (int i=1;i<n;i++) if (i<rev[i]) swap(a[i],a[rev[i]]);
	for (int w=2,hh=1;w<=n;w<<=1,hh++) for (int k=0;k<n;k+=w) for (int j=k;j<k+(w>>1);j++)
	{
		ll u=a[j],t=a[j+(w>>1)]*pow[hh][j-k]%mod;
		a[j]=pls(u,t);a[j+(w>>1)]=mns(u,t);
	}
	if (on==-1)
	{
		reverse(a+1,a+n);
		ll Inv=ksm(n,mod-2);
		for (int i=0;i<n;i++) a[i]=a[i]*Inv%mod;
	}
}

int main()
{
	n=rd();m=rd();pre_gao();
	for (int i=1;i<=n;i++) f[1][i]=1;
	int len=1;
	for (;len<=n*2;len<<=1);
	for (int i=2;i<=m;i++)
	{
		for (int j=0;j<=n;j++) h1[j]=f[i-1][j]*ifac[j]%mod;
		memset(h1+n+1,0,sizeof(ll)*(len-n-1));
		h2[0]=0;
		for (int j=1;j<=n;j++) h2[j]=ifac[j+2];
		memset(h2+n+1,0,sizeof(ll)*(len-n-1));
		ntt(h1,len,1);ntt(h2,len,1);
		for (int j=0;j<len;j++) h1[j]=h1[j]*h2[j]%mod;
		ntt(h1,len,-1);
		for (int j=1;j<=n;j++) f[i][j]=pls(h1[j]*fac[j+2]%mod,f[i-1][j]*pls(C(j+1,2),1)%mod);
		for (int j=1;j<=n;j++) f[i][j]=pls(f[i][j],1);
	}
	ll ans=0;
	for (int i=1;i<=n;i++) ans=pls(ans,f[m][i]*C(n,i)%mod);
	printf("%lld\n",pls(ans,1));
	return 0;
}

Measured memory_bytes: 18304
import java.util.*;
import java.lang.*;
import java.io.*;

public class Main{
    public static void main(String[] args) throws IOException{
        FastReader in = new FastReader();
        FastWriter out = new FastWriter();
        int x = in.nextInt();
        char[] s = in.nextLine().toCharArray();
        for (int i = 0; i < s.length; i++){
            if ((int)s[i]+x > 90){
                int a = ((int)s[i])-26+x;
                out.p((char)a);
            }else{
                out.p((char)(((int)s[i])+x));
            }
        }
        out.pl();
        out.close();
    }
}
class FastReader{ 
    BufferedReader br; 
    StringTokenizer st; 
    public FastReader() { 
        br = new BufferedReader(new InputStreamReader(System.in)); 
    } 
    String next(){ 
        while (st == null || !st.hasMoreElements()) { 
            try{ 
                st = new StringTokenizer(br.readLine()); 
            }catch (IOException  e){ 
                e.printStackTrace(); 
            } 
        } 
        return st.nextToken(); 
    } 
    int nextInt(){ 
        return Integer.parseInt(next()); 
    } 
    long nextLong(){ 
        return Long.parseLong(next()); 
    } 
    double nextDouble(){ 
      return Double.parseDouble(next()); 
    } 
    String nextLine(){ 
        String str = ""; 
        try{ 
            str = br.readLine(); 
        } 
        catch (IOException e){ 
            e.printStackTrace(); 
        } 
        return str; 
    } 
}
class FastWriter{
    PrintWriter out;
    FastWriter(){
        out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
	out.flush();
    }
    void pl(Object o){
        out.write(o.toString());
	    out.write("\n");
        out.flush();
    }
    void pl(){
        out.write("\n");
    }
    void p(Object o){
        out.write(o.toString());
    }
    void close(){
        out.flush();
        out.close();
    }  
}


Measured memory_bytes: 34548
S = input()
f=0
for i in range(len(S)):
    if i%2==0 and S[i]=="L":
        print("No")
        f+=1
        break
    if i%2==1 and S[i]=="R":
        print("No")
        f+=1
        break
if f==0:
    print("Yes")

Measured memory_bytes: 3060
#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 a, b;
    cin >> a >> b;
    int ans = 6 - a - b;
    cout << ans << endl;
    return 0;
}

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

int N, A, B;
int t;

int main(void){
	cin >> N >> A >> B;
	int cnt = 0;
	for(int i = 1; i <= N; i++){
		cin >> t;
		if(t < A || B <= t) cnt++;
	}
	cout << cnt << endl;
	return 0;
}


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

using namespace std;

#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 REP(i, n) for(int i = 0; i < (n); ++i)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOREACH(x, a) for(auto &(x) : (a))
#define VECCIN(x)                                                              \
    for(auto &youso_ : (x)) cin >> youso_
#define mp make_pair
#define bitcnt __builtin_popcount
#define All(a) (a).begin(), (a).end()
template <typename T = long long> inline T IN() {
    T x;
    cin >> x;
    return (x);
}
inline void CIN() {}
template <class Head, class... Tail>
inline void CIN(Head &&head, Tail &&... tail) {
    cin >> head;
    CIN(move(tail)...);
}
#define CINT(...)                                                              \
    int __VA_ARGS__;                                                           \
    CIN(__VA_ARGS__)
#define LCIN(...)                                                              \
    ll __VA_ARGS__;                                                            \
    CIN(__VA_ARGS__)
#define SCIN(...)                                                              \
    string __VA_ARGS__;                                                        \
    CIN(__VA_ARGS__)
#define Yes(a) cout << (a ? "Yes" : "No") << "\n"
#define YES(a) cout << (a ? "YES" : "NO") << "\n"

typedef long long ll;
typedef vector<int> V;
typedef vector<ll> VL;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
typedef priority_queue<int> PQ;
typedef priority_queue<int, V, greater<int>> PQG;

const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;

map<ll, ll> primefact(ll n) {
    map<ll, ll> res;
    for(ll i = 2; i * i <= n; i++) {
        while(n % i == 0) {
            res[i]++;
            n /= i;
        }
    }
    if(n != 1) res[n] = 1;
    return res;
}

ll N, C, K;
VL T;

int main() {
    cin >> N >> C >> K;
    T.resize(N);
    VECCIN(T);
    sort(All(T));
    ll wait = 0, arr = 0, cnt = 0;
    REP(i, N) {
        if(wait) {
            if(T[i] > arr + K) {
                cnt++;
                arr = T[i];
                wait = 0;
            }
            wait++;
            if(wait == C) {
                cnt++;
                wait = 0;
            }
        } else {
            arr = T[i];
            if(C == 1) {
                cnt++;
                wait = 0;
            } else {
                wait = 1;
            }
        }
    }
    if(wait) cnt++;
    cout << cnt << "\n";
    return 0;
}


Measured memory_bytes: 1024
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <random>
#include <iterator>

using namespace std;

#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(v) reverse((v).begin(),(v).end())
#define ANS(ans) cout<<(ans)<<endl;
#define UNIQUE(v) (v).erase(unique((v).begin(), (v).end()), (v).end());
typedef vector<int> VI;
typedef pair<int, int> P;

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

struct MyStruct {
	int a, b;
};

bool comp(const MyStruct& s, const MyStruct& t) {
	if (s.b != t.b)
		return s.b < t.b; //syoujunn
	return s.a > t.a;
}


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

	VI a(n + 1);
	REP(i, n + 1) {
		cin >> a[i];
	}

	VI b(n);
	REP(i, n) {
		cin >> b[i];
	}

	long long ans = 0;

	REP(i,n) {
		int defeated = min(b[i], a[i]);
		a[i] -= defeated;
		b[i] -= defeated;
		ans += defeated;

		if (b[i] > 0) {
			int d = min(b[i], a[i + 1]);
			a[i + 1] -= d;
			ans += d;
		}

	}

	ANS(ans);
	return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair< ll, ll > Pi;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep2(i,n) for(int i=1;i<=(n);i++)
#define rep3(i,i0,n) for(int i=i0;i<(n);i++)
#define pb push_back
#define mod 1000000007
const ll INF = 1LL << 60;
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; }
ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}
#define all(x) x.begin(), x.end()
#define mp make_pair
bool compare(Pi a, Pi b) {
    if(a.first != b.first){
        return a.first < b.first;
        
    }else{
        return a.second < b.second;
    }
}


bool In_map(ll y,ll x,ll h,ll w){
    if(y<0 || x<0 || y>=h || x>=w){
        return 0;
    }else{
        return 1;
    }
}
const vector<ll> dx{1,0,-1,0};
const vector<ll> dy{0,1,0,-1};


int main() {
    ll N,M;
    cin >>N>>M;
    vector<vector<ll>>G(N,vector<ll>(N));
    rep(i,M){
        ll a,b;
        cin>>a>>b;
        a--;b--;
        G[a][b]=1;
        G[b][a]=1;
    }
    vector<ll>a(N-1);

    rep(i,N-1){
        a[i]=i+1;
    }
    ll ans=0;
    do {
        for (int i = 0; i < N-1; i++) {
            if(i==0){
                if(G[0][a[i]]==0)break;
            }else{
                if(G[a[i-1]][a[i]]==0)break;
            }
            if(i==N-2){
                ans++;
            }
        }
        
    } while(next_permutation(all(a)));
    
    cout <<ans << endl;


    return 0;
    

}

Measured memory_bytes: 3620
//H - Sum of 4 Integers
#include <stdio.h>

int main(void){
    int i,j,k,l,n,sum,count;
    while(scanf("%d",&n)==1){
        sum = count = 0;
        for(i=0;i<=9;i++){
            for(j=0;j<=9;j++){
                for(k=0;k<=9;k++){
                    for(l=0;l<=9;l++){
                        sum = i+j+k+l;
                        if(sum==n)count++;
                        sum = 0;
                    }
                }
            }
        }
        printf("%d\n",count);
    }
}

Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <cctype>
#include <map>
#include <vector>
#include <queue>
#include <list>
#define PI 3.141592653
#define rep(i,a,n) for(int i=a;i<(int)n;++i)
#define SZ(x) ((int)(x).size())	//size() unsigned -> int
#define descSort(a) sort(a.begin(),a.end(),std::greater<int>())

using namespace std;
typedef long long ll;
const ll INF = 1e9 + 7;

int main() {
	int n, k;
	cin >> n >> k;
	vector<ll> x(n);
	rep(i, 0, n) {
		cin >> x[i];
	}
	sort(x.begin(), x.end());
	int ans = 0;
	for (int i = 0;i < n;i += k - 1) {
		if (i == n - 1)break;
		ans++;
	}
	cout << ans << endl;
	return 0;
}

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

#define irep(i,n) for(int i = 0; i < (int)(n); i++)
#define irep2(i,a,n) for(int i = (int)(a); i <= (int)(n); i++)
#define lrep(i,n) for(long long  i = 0; i < (long long)(n); i++)
#define lrep2(i,a,n) for(long long i = (long long)(a); i <= (long long)(n); i++)
#define irrep(i,n) for(int i = (int)(n-1); i > -1; i--)
#define irrep2(i,a,n) for(int i = (int)(n); i >= (int)(a); i--)

typedef long long ll;
typedef std::vector<int> v_int;
typedef std::vector<v_int > v2_int;
typedef std::vector<ll> v_ll;
typedef std::vector<v_ll > v2_ll;
typedef std::vector<std::string> v_string;
typedef std::vector<v_string > v2_string;
typedef std::vector<bool> v_bool;
typedef std::vector<v_bool > v2_bool;
typedef std::pair<ll, ll> pll;
typedef std::pair<int, int> pii;

const double PI = 3.1415926535897932;
const int INF = (int)1e9;
const ll LINF = 1e18;
const ll MOD = 998244353;
const int dr[4] = {1, 0, -1, 0};
const int dc[4] = {0, 1, 0, -1};

using namespace std; 

template<typename T, typename U> inline
ostream& operator<<(ostream &o, pair<T,U> &p)
{
    return o << "{" << p.first << "," << p.second << "}";
}

template<typename T> inline
ostream& operator<<(ostream &os, vector<T> &v)
{
    int len = v.size();
    for(int i = 0; i < len; i++) { 
        os << v[i];
        if(i != len-1) { os << ","; } 
    } 
    return os;
}

template<typename T>
T ModPow(T s, T n)
{
    T res = 1;

    while(n) {
        if (n & 1) { 
            res *= s;
            res %= MOD;
        }
        s *= s;
        s %= MOD;
        n >>= 1;
    }
    return res;
}

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

    v_ll d(n);
    v_ll edge(n+1);
    ll max_d = 0;

    irep(i, n) {
        cin >> d[i];
        edge[d[i]]++;
        max_d = max(max_d, d[i]);
    }

    if(d[0] != 0 || edge[0] != 1) { cout << 0 << endl; return 0; } 
    
    ll ans = 1;

    for(int i = 2; i <= max_d; i++) {
        ans *= ModPow(edge[i-1], edge[i]);
        ans %= MOD;
    }

    cout << ans << endl;
    return 0;
}

/*atcoder*/


Measured memory_bytes: 1792
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n = int(readline())
a = [0] + list(map(int,readline().split()))
data = list(map(int,read().split()))

links = [[] for _ in range(n+1)]
it = iter(data)
for ai,bi in zip(it,it):
    links[ai].append(bi)
    links[bi].append(ai)

links[0].append(1)
links[1].append(0)

tp = []
parent = [-1] * (n+1)
stack = [0]
while(stack):
    i = stack.pop()
    for j in links[i]:
        if(parent[i]==j):
            continue
        parent[j] = i
        stack.append(j)
        tp.append(j)

tp = tp[::-1]
come = [[] for _ in range(n+1)]

for i in tp:
    if(len(come[i])==0):
        # print(i)
        # print(parent[i])
        # print(a[i])
        # print(come[parent[i]])
        # print('--')
        come[parent[i]].append(a[i])
        continue

    up = 2*a[i] - sum(come[i])
    if(up < 0)|(max(up,max(come[i])) > a[i]):
        print('NO')
        exit()
    come[parent[i]].append(up)

# print(come)

if(len(come[1]) > 1)&(come[0][0] == 0):
    print('YES')
elif(len(come[1]) == 1)&(come[0][0] == a[1]):
    print('YES')
else:
    print('NO')

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


int main(void)
{

	unsigned long ii,x,i, t, sum=0, total=0, n, flag=0;
	unsigned long tt[200000]; //, tt2[200000];
	
	scanf("%lu %lu", &n, &t );
	for(i=0; i<n; i++){
		scanf(" %lu", &tt[i]);
	}

	for(i=0; i<n-1; i++){
		if((tt[i+1] - tt[i] ) < t ) {
			total = total + (tt[i+1] - tt[i]);
		}else {
			total = total + t;
		}
	
	}
	
	total = total + t;
	
	printf("%lu\n", total);
	
	//getchar();
	//getchar();
	return 0;
}

Measured memory_bytes: 1664
<?php

$million = pow(10, 6);
$arr = array(0, 0) + array_fill(2, $million - 1, 1);
for ($i = 2, $len = sqrt($million); $i <= $len; $i++) {
    if (!$arr[$i]) {
        continue;
    }

    for ($j = $i, $len2 = $million / $i; $j <= $len2; $j++) {
        $arr[$i * $j] = 0;
    }
}
$primes = array_keys(array_filter($arr, function ($val) {
    return $val;
}));

while (($line = trim(fgets(STDIN))) !== '') {
    sscanf($line, '%d', $n);
    $cnt = 0;
    foreach ($primes as $i => $m) {
        if ($n < $m) {
            break;
        }
        $cnt++;
    }
    echo $cnt, PHP_EOL;
}

Measured memory_bytes: 194672
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    vector<pair<int,int>> vec(n);
    for(int i=0;i<n;i++)
    {
        cin>>vec[i].first>>vec[i].second;
    }
    for(int i=2;i<n;i++)
    {
        bool isAns=true;
        for(int j=0;j<=2;j++)
        {
            if(vec[i-j].first!=vec[i-j].second)
            {
                isAns=false;
                break;
            }
        }
        if(isAns)
        {
            cout<<"Yes\n";
            return 0;
        }
    }
    cout<<"No\n";
    return 0;
}

Measured memory_bytes: 3596
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
#define  ll long long
#define  ull unsigned long long
#define  ul unsigned long
#define all(v) v.begin(),v.end()
#define sz(n) (int)n.size()
#define pb(s) push_back(s);
#define format(n) fixed<<setprecision(n)
#define finl "\n"
#define Mohammed_Atef_Hassan fast();
#define INF LLONG_MAX
#define PI acos(-1)
#define clr(dp,n) memset(dp,n,sizeof dp)
#define ex(n) return cout<<n<<finl,0;
#define N (int)1e6+10
int dx[] = { 0, 1, 0, -1, 1, 1, -1, -1 };
int dy[] = { 1, 0, -1, 0, 1, -1, 1, -1 };
void fast() {

	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL); cout.tie(NULL);

#ifdef ONLINE_JUDGE
	//	freopen("palindrome.in", "r", stdin);

	//freopen("palindrome.out", "w", stdout);
#endif
#ifndef ONLINE_JUDGE
	//freopen("9000000.txt", "r", stdin);

	//freopen("ConsoleApplication1.zip", "w", stdout);
#endif
}
ll arr[N];
int main()
{
	Mohammed_Atef_Hassan
		int n,k;
	cin >> n>>k;
	for (int i = 1; i <=n; i++)
		cin >> arr[i];
	sort(arr+1, arr + n+1);
	ll mn = LLONG_MAX;
	for (int i =k; i <=n; i++)
		mn = min(mn, arr[i] - arr[i - k+1]);
	ex(mn);
}

Measured memory_bytes: 1024
import sys
import re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B = MAP()

def euclid(a, b):
    if a < b:
        a, b = b, a
    while a % b != 0:
        a, b = b, a % b
    return b

print(A * B // euclid(A, B))


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

int mod = 1'000'000'007;
long long modpow(long long x, long long y){
    if (y == 0) return 1;
    if (y % 2) return x * modpow(x, y - 1) % mod;
    long long res = modpow(x, y / 2);
    return res * res % mod;
}

int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    vector<int> b(n);
    b = a;
    vector<int> cnt(1e6 + 1, 0);
    for (int i = 0; i < n; i++){
        for (int j = 2; j * j <= a[i]; j++){
            int z = 0;
            while (a[i] % j == 0){
                z++;
                a[i] /= j;
            }
            cnt[j] = max(cnt[j], z);
        }
        cnt[a[i]] = max(cnt[a[i]], 1);
    }
    long long tmp = 1;
    for (int i = 2; i < 1e6 + 1; i++){
        tmp *= modpow(i, cnt[i]);
        tmp %= mod;
    }
    long long ans = 0;
    for (int i = 0; i < n; i++){
        ans += tmp * modpow(b[i], mod - 2) % mod;
        ans %= mod;
    }
    cout << ans << endl;
}

Measured memory_bytes: 4224
import std.stdio;

void main() {
	uint a, b;

	readf(" %s %s", &a, &b);

	foreach (i;b * 10..(b + 1) * 10) {
		if (i * 8 / 100 == a) {
			writeln(i);
			return;
		}
	}
	writeln("-1");
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		//
		Scanner sc = new Scanner(System.in);
		
		int num1 = sc.nextInt();
		int num2 = sc.nextInt();
		int ans = num1 * num2;
		if(num1 > 9 || num2 > 9) {
			System.out.println(-1);
		} else {
			System.out.println(ans);
		}
		// Scannerクラスのインスタンスをクローズ
		sc.close();
	}
}

Measured memory_bytes: 23124
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;

int l,r;
char s[1000005];
int main()
{
	int i;
	cin>>(s+1);
	l=r=-1;
	for(i=2;i<=strlen(s+1)&&l==-1;i++)
		if(s[i]==s[i-1]) l=i-1,r=i;
		else if(i!=1&&s[i]==s[i-2]) l=i-2,r=i;
	cout<<l<<" "<<r; 
	return 0;
}

Measured memory_bytes: 384
#include<stdio.h>
int main(void){
	int x[10000];
	int t,m=0;
	for(t=0;t<10000;t++){
		scanf("%d",&x[t]);
		if(x[t]==0){
			break;
		}
		m++;
	}
	for(t=0;t<m;t++){
		printf("Case %d: %d\n",t+1,x[t]);
	}
	return 0;
}


Measured memory_bytes: 1992
import sys
input = sys.stdin.readline
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''

X, Y, Z, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

ans = []
tmp = []

for i in A:
	for j in B:
		tmp.append(i + j)
		
tmp.sort(reverse=True)

for i in range(min(K, len(tmp))):
	for j in C:
		ans.append(tmp[i] + j)
		
ans.sort(reverse=True)

for i in range(K):
	print(ans[i])


Measured memory_bytes: 151856
#include<stdio.h>
int main(void){
   
    char enki[]="ATCG";
    char b;
  
    scanf("%c", &b);
    
     if(b == enki[0]) printf("%c", enki[1]);
     if(b == enki[1]) printf("%c", enki[0]);
     if(b == enki[2]) printf("%c", enki[3]);
     if(b == enki[3]) printf("%c", enki[2]);
  
   
 return 0;
}

Measured memory_bytes: 128
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
#define rep(i,a,b) for (int i = (a); i < (b); i++)
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
typedef complex<double> com;
const int mod = 1e9 + 7;
const int MOD = 998244353;
const int inf = 2e9;



int main() {
	int n, k; cin >> n >> k;
	int b = 0;
	rep(i, 0, 1 << n) if(i!=k)b ^= i;
	if (k != 0 && k != b) {
		printf("-1"); return 0;
	}
	if (k == 0) {
		rep(i, 0, 1 << n) printf("%d %d ", i, i);
	}
	else {
		printf("%d ", k);
		rep(i, 0, 1 << n) {
			if (i != k) printf("%d ", i);
		}
		printf("%d ", k);
		rep(i, 0, 1 << n) {
			int idx = (1 << n) - 1 - i;
			if (idx != k) printf("%d ", idx);
		}
	}
	return 0;
}


Measured memory_bytes: 1792
#include <stdio.h>
#include <math.h>

typedef struct {
  double x,y;
}Point;

void koch(int n,Point a,Point b){
  if(n==0)return;
  Point s,t,u;
  double th=M_PI*60.0/180.0;

  s.x=(2.0*a.x+1.0*b.x)/3.0;
  s.y=(2.0*a.y+1.0*b.y)/3.0;
  t.x=(1.0*a.x+2.0*b.x)/3.0;
  t.y=(1.0*a.y+2.0*b.y)/3.0;
  u.x=(t.x-s.x)*cos(th)-(t.y-s.y)*sin(th)+s.x;
  u.y=(t.x-s.x)*sin(th)+(t.y-s.y)*cos(th)+s.y;
  koch(n-1,a,s);
  printf("%.8f %.8f\n",s.x,s.y);
  koch(n-1,s,u);
  printf("%.8f %.8f\n",u.x,u.y);
  koch(n-1,u,t);
  printf("%.8f %.8f\n",t.x,t.y);

  koch(n-1,t,b);
  
}
int main(){
  Point a,b;
  int n;
  scanf("%d",&n);

  a.x=0;
  a.y=0;
  b.x=100;
  b.y=0;

  printf("%.8f %.8f\n",a.x,a.y);
  koch(n,a,b);
  printf("%.8f %.8f\n",b.x,b.y);

  return 0;
}



Measured memory_bytes: 1996
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
fn main() {
    input!{
        a: u64,
        b: u64,
        x: u64,
    };
    println!(
        "{}",
        if a == 0{b/x + 1} else{b/x - (a-1)/x}
    );
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin>>N;
if(N==1){
    cout<<1;
    return 0;
}
long long L[N];
L[0]=2;
L[1]=1;
long long sum=0;
for(int i=2;i<=N;i++){
    L[i]=(L[i-1]+L[i-2]);
    if(i==N)cout << fixed << setprecision(0) <<L[i]<<endl;
}
return 0;
}


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

using namespace std;

int main() {
    int n;
    cin >> n;
    long long hi[1000][2];
    for (int i = 0; i < n; i++) cin >> hi[i][0] >> hi[i][1];
    for (int i = 0; i < n - 1; i++) {
        long long x = max((hi[i][0] + hi[i + 1][0] - 1) / hi[i + 1][0], (hi[i][1] + hi[i + 1][1] - 1) / hi[i + 1][1]);
        hi[i + 1][0] *= x;
        hi[i + 1][1] *= x;
    }
    cout << hi[n - 1][0] + hi[n - 1][1] << endl;
    return 0;
}

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

int main() {
std::vector<int> v = {11,
  31,
  41,
  61,
  71,
  101,
  131,
  151,
  181,
  191,
  211,
  241,
  251,
  271,
  281,
  311,
  331,
  401,
  421,
  431,
  461,
  491,
  521,
  541,
  571,
  601,
  631,
  641,
  661,
  691,
  701,
  751,
  761,
  811,
  821,
  881,
  911,
  941,
  971,
  991,
  1021,
  1031,
  1051,
  1061,
  1091,
  1151,
  1171,
  1181,
  1201,
  1231,
  1291,
  1301,
  1321,
  1361,
  1381,
  1451};

  int n,i;
  std::cin >> n;

  for (i = 0; i < n - 1; i++) {
      std::cout << v[i] << " ";
  }
  std::cout << v[i] << std::endl;

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main()
{
  int a;
  string s;
  cin >> a >> s;
  if (a >= 3200) {
    cout << s << endl;
  } else {
    cout << "red" << endl;
  }
  return 0;
}

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


int main()
{
    string s;
    cin>>s;
    int k;
    cin>>k;
    for(int i=0;i<s.length();i++){
        if(s[i]=='a')   continue;
        if(k>= ('z'-s[i]+1)){
            k -= ('z'-s[i]+1);
            s[i] = 'a';
        }
    }
    k = k%26;
    while(k>0){
        s[s.length()-1]++;
        if(s[s.length()-1] > 'z') s[s.length()-1] = 'a';
        k--;
    }
    cout<<s<<endl;
    return 0;
}


Measured memory_bytes: 512
N = int(input())
AB = [list(map(int,input().split())) for i in range(N)]
AB.sort(key=lambda x: x[1])
t = 0
ans = 'Yes'
for i in range(N):
    t += AB[i][0]
    if t > AB[i][1]:
        ans = 'No'
print(ans)

Measured memory_bytes: 53600
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <stdio.h>
using namespace std;

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
typedef long long ll;

int main() {
	int N,A[100010],sign = 0,ans = 0;
	cin >> N;
	REP(i, N) { 
		cin >> A[i];
		if (i > 0) {
			if (A[i] - A[i - 1] > 0) {
				if (sign < 0) {
					ans++;
					sign = 0;
				}
				else if (sign == 0) {
					sign = 1;
				}
			}
			else if (A[i] - A[i - 1] < 0) {
				if (sign > 0) {
					ans++;
					sign = 0;
				}
				else if (sign == 0) {
					sign = -1;
				}
			}
		}
	}
	cout << ++ans << endl;
	return 0;
}


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

int main(void){
  int m[50]={0};
  int f[50]={0};
  int r[50]={0};
  int count=0;
  char Achievement[50]; //成績

  while(1)
  {
    int sum;
    scanf(" %d %d %d",&m[count],&f[count],&r[count]);
    if(m[count]==-1&&f[count]==-1&&r[count]==-1){break;}
    sum=m[count]+f[count];
    //printf("%d\n",sum);

    if(m[count]==-1||f[count]==-1){
      Achievement[count]='F';
    }
    else if(sum<80&&sum>=65){
      Achievement[count]='B';
    }
    else if(sum<65&&sum>=50){
      Achievement[count]='C';
    }
    else if(sum<50&&sum>=30){
      if(r[count]>=50){
        Achievement[count]='C';
      }
      else{
        Achievement[count]='D';
      }
    }
    else if(sum>=80){
      Achievement[count]='A';
    }
    else if(sum<30){
      Achievement[count]='F';
    }
    count++;
    if(count==49){break;}
  }
  for(int i=0;i<count;i++){
    printf("%c\n",Achievement[i]);
  }
}



Measured memory_bytes: 2104
#include<bits/stdc++.h>
using namespace std;
int s[1000000];
int ss[1000000];
int main()
{
    int a,b,c,d,e,f,k=0,p=0;
    scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f);
    for(int x=0;x<=f/a;x+=100)
        for(int y=0;y<=f/b;y+=100)
        if((x*a+y*b)<f) s[k++]=x*a+y*b;
    sort(s,s+k);
    int ma=s[k-1]/100;
    for(int x=0;x<=ma*e/c+1;x++)
        for(int y=0;y<=ma*e/d+1;y++)
        {
            int kk=c*x+d*y;
            if((s[0]+kk)>f) continue;
            ss[p++]=c*x+d*y;
        }
    sort(ss,ss+p);
    p=unique(ss,ss+p)-ss;
    int xx=0,yy=0;
    for(int i=0;i<k;i++)
    {
        int aa=s[i];
        for(int j=0;j<p;j++)
        {
            int bb=ss[j];
            if(bb>(e*aa/100)) continue;
            if((aa+bb)>f) continue;
            if(!xx&&!yy) xx=aa,yy=bb;
            else
            {
                if((xx+yy)*bb>yy*(aa+bb))
                    xx=aa,yy=bb;
            }
        }
    }
    printf("%d %d\n",xx+yy,yy);
}


Measured memory_bytes: 3200
#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

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

#define MOD 1000000007
#define REP(i, N) for (int i = 0; i < N; ++i)
#define REP1(i, N) for (int i = 1; i <= N; ++i)
#define RREP(i, N) for (int i = N - 1; i >= 0; --i)
#define ALL(a) a.begin(), a.end()

int main() {
  while (true) {
    string g;
    cin >> g;
    if (g == "#") {
      return 0;
    }
    int y, m, d;
    cin >> y >> m >> d;
    if ((y == 31 && 4 < m) || 31 < y) {
      g = "?";
      y -= 30;
    }
    cout << g << " " << y << " " << m << " " << d << endl;
  }
  return 0;
}


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

const int N = 3e5 + 5;
map<pair<int,int>, int> mpp;
int h, w, m;
int x[N], y[N];

int main() {
	
	cin >> h >> w >> m;
	vector<pair<int,int>> v(m);  
	for(int i=0;i<m;i++)
	{
		cin>>v[i].first>>v[i].second;
		x[v[i].first]++;
		y[v[i].second]++;
		mpp[{v[i].first, v[i].second}]=1;
	}
	
	int ma_x = *max_element(x+1, x+h+1);
	int ma_y = *max_element(y+1, y+w+1);
	
	vector<int>fx,fy;
	for(int i=1;i<=h;i++) if(x[i]==ma_x) fx.push_back(i);
	for(int i=1;i<=w;i++) if(y[i]==ma_y) fy.push_back(i);
	
	int ans=0;
	for(int i:fx)
	{
		for(int j:fy)
		{
			int z=0;
			if(mpp[{i,j}]) z=1;
			ans=max(ans, x[i]+y[j]-z);
			if(z==0)
			{
				cout<<ans;
				return 0;
			}
		}
	}
	cout<<ans;
	return 0;
}

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

using namespace std;

int main(void){
  vector<int> a(3, 0), b(3, 0);
  for(int i = 0; i < 3; i++){
    for(int j = 0; j < 3; j++){
      int c;
      cin >> c;
      a[i] += c;
      b[j] += c;
    }
  }
  if(!(a[0] % 3 == a[1] % 3 && a[1] % 3 == a[2] % 3)){
    cout << "No" << endl;
    return 0;
  }
  for(int &aa : a) aa /= 3;
  int g = *min_element(a.begin(), a.end());
  for(int &aa : a){
    aa -= g;
  }
  int s = accumulate(a.begin(), a.end(), 0);
  for(int &bb : b){
    bb -= s;
    if(bb < 0){
      cout << "No" << endl;
      return 0;
    }
  }
  if(!(b[0] % 3 == b[1] % 3 && b[1] % 3 == b[2] % 3)){
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<map>
#include<cmath>
using namespace std;
const long long INF=1e10,N=1e5+500;
int prime[3000],p[3000],prime_cnt;
void prework(int n)
{
    for(int i=2;i<=n;i++)
    {
        if(!p[i])prime[++prime_cnt]=i;
        for(int j=1;j<=prime_cnt&&i*prime[j]<=n;j++)
        {
            int x=i*prime[j];p[x]=1;
            if(i%prime[j]==0)break;
        }
    }
}
int n;
map<long long,int>mp;
pair<long long,long long>tmp[N];
long long sqr(int x){return 1ll*x*x;}
int main()
{
    prework(2154);int ans=0;
    scanf("%d",&n);int tn=0;
    for(int i=1;i<=n;i++)
    {
        long long w;
        scanf("%lld",&w);
        long long prod=1,iprod=1;
        for(int j=1;j<=prime_cnt&&1ll*prime[j]*prime[j]*prime[j]<=w&&iprod<=INF;j++)
        {
            if(w%prime[j])continue;
            int t=0;
            while(w%prime[j]==0)w/=prime[j],++t;
            t%=3;
            if(!t)continue;
            prod*=prime[j];iprod*=prime[j];
            if(t==2)prod*=prime[j];else if(iprod<=INF)iprod*=prime[j];
        }
        prod*=w;
        if(w!=1&&iprod<=INF)
        {
            if(sqr((int)sqrt(w))==w)iprod*=(int)sqrt(w);
            else if(w<=100000)iprod*=1ll*w*w;else iprod=INF+1;
        }
        if(iprod<=INF)
        {
            if(!mp[prod])tmp[++tn]=make_pair(prod,iprod);
            ++mp[prod];
        }
        else ++ans;
    }
    for(int i=1;i<=tn;i++)
    {
        if(tmp[i].first==1)ans++;
        else ans+=max(mp[tmp[i].first],mp[tmp[i].second]),mp[tmp[i].first]=mp[tmp[i].second]=0;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 15168
package main

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

var (
	sc = bufio.NewScanner(os.Stdin)
	buf = make([]byte, 1000)
)

func scanText() string{
	sc.Scan()
	return sc.Text()
}

func scanTextArray(n int) []string {
	out := make([]string, n)
	for i, v := range(strings.Split(scanText(), "")) {
		out[i] = v
	}
	return out
}

func scanInt() int {
	out, e := strconv.Atoi(scanText())
	if e != nil {
        panic(e)
    }
	return out
}

func scanIntArray(n int) []int {
	out := make([]int, n)
	for i, v := range(strings.Split(scanText(), " ")) {
		num, e := strconv.Atoi(v)
		if e != nil {
			panic(e)
		}
		out[i] = num
	}
	return out
}
//  template end

func main() {
	sc.Buffer(buf, 10000)
	cnt := 0
	for _, v := range scanText() {
		if v == '2' {
			cnt++
		}
	}
	fmt.Println(cnt)

}

Measured memory_bytes: 640
#!/usr/bin/env python3
import sys


def solve(N: int, A: int, B: int, C: int, D: int, E: int):
    print(-(-N // min(A, B, C, D, E)) + 4)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    D = int(next(tokens))  # type: int
    E = int(next(tokens))  # type: int
    solve(N, A, B, C, D, E)


if __name__ == '__main__':
    main()


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

int main (){
	char A[11],B[11],C[11];
	scanf("%s %s %s", &A, &B, &C);
	strlen (A),(B);
	
	if(A[strlen(A)-1] == B[0] && B[strlen(B)-1] == C[0]){
		printf("YES\n");
	}
	else{
		printf("NO\n");
	}
	
	return 0;
}

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

int main()
{
  int n;
  int r;
  int in;
  
  cin >> n >> r;
  if (n >= 10)
    in = r;
  else 
    in = r + 100 * (10 - n);
  
  cout << in << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <iomanip>
#include <queue>
#include <deque>
#include <map>
#include <unordered_map>
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define repr(e,x) for(auto& e:x)
using namespace std;
typedef long long ll;
typedef long double ld;
//typedef pair<ll,ll> P;
//ll const INF=1001001001;
//ll const INF=1001001001001001001;
ll const MOD=1000000007;

int N;
int A[200000];
int B[200000];

int main(){
    cin>>N;
    rep(i,N) cin>>A[i]>>B[i];

    sort(A,A+N);
    sort(B,B+N);

    int ans=0;
    if(N&1){
        ans=B[N/2]-A[N/2]+1;
    }else{
        int ma=A[N/2-1]+A[N/2];
        int mb=B[N/2-1]+B[N/2];
        ans=mb-ma+1;
    }

    cout<<ans<<endl;
}

Measured memory_bytes: 5204
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

static const double EPS = 1e-8;
static const double PI = 4.0 * atan(1.0);
static const double PI2 = 8.0 * atan(1.0);

#define REP(i,n)	for(int i=0;i<(int)n;++i)
#define ALL(c)		(c).begin(),(c).end()
#define CLEAR(v)	memset(v,0,sizeof(v))
#define MP(a,b)		make_pair((a),(b))
#define ABS(a)		((a)>0?(a):-(a))
#define FOR(i,s,n)	for(int i=s;i<(int)n;++i)

int main(int argc, char **argv) {
	string s;
	cin >> s;
	int n = s.length();
	int res = n;
	FOR(ch, 'a', 'z' + 1) {
		int cnt = 0, temp = 0;
		REP(i, n) {
			if (s[i] == ch) {
				temp = max(temp, cnt);
				cnt = 0;
			}
			else {
				++cnt;
			}
		}
		temp = max(temp, cnt);
		res = min(res, temp);
	}
	cout << res << endl;
	return 0;
}


Measured memory_bytes: 256
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, K = mapint()
Hs = list(mapint())

lis = [1 if a>=K else 0 for a in Hs]
print(sum(lis))

Measured memory_bytes: 89380
using System;
class Program
{
  static void Main()
  {
    string S = Console.ReadLine();
    string ch1 = "", ch2 = "";
    int ct1 = 0, ct2 = 0;
    string ans = "Yes";
    
    for (int i = 0; i < 4; i++)
    {
      string s = S.Substring(i, 1);
      if (ch1 == "")
      {
        ch1 = s;
        ct1 = 1;
      }
      else if (ch1 == s)
      {
        if (ct1 == 1)
          ct1 = 2;
        else
          ans = "No";
      }
      else if (ch2 == "")
      {
        ch2 = s;
        ct2 = 1;
      }
      else if (ch2 == s)
      {
        if (ct2 == 1)
          ct2 =2;
        else
          ans = "No";
      }
      else
        ans = "No";
      
      if (ans == "No")
        break;
    }
    
    Console.WriteLine(ans);
  }
}

Measured memory_bytes: 13140
import std.stdio, std.string, std.conv;
import std.array, std.algorithm, std.range;

void main()
{
    foreach(_;0..readln().chomp().to!int())
    {
        bool f=true;
        auto a=int.min, b=a;
        foreach(v;readln().split().map!(to!int))
            if(v>a) a=v;
            else if(v>b) b=v;
            else{ f=false; break; }
        writeln(f?"YES":"NO");
    }
}

Measured memory_bytes: 1060
#include <stdio.h>
#include <ctype.h>

int main() {
	
	char a[256];
	int n, k;
	scanf("%d %d", &n, &k);
	scanf("%s", a);
	a[k-1] = (char)tolower(a[k-1]);
	printf("%s", a);
	return 0;
}

Measured memory_bytes: 128
import math
from math import gcd,pi,sqrt
INF = float("inf")

import sys
sys.setrecursionlimit(10**6)
import itertools
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]


def main():
    import statistics
    n = i_input()
    l = i_list()
    ml = min(l)
    Ml = max(l)
    ol = statistics.median(l)

    L = l.copy()

    L.remove(ml)
    pol = statistics.median(L)
    L.append(ml)

    L.remove(Ml)
    mol = statistics.median(L)
    L.append(Ml)

    ans = []

    for i in l:
        if i >= ol:
            ans.append(mol)
        else:
            ans.append(pol)

    for i in ans:
        print(i)



if __name__=="__main__":
    main()


Measured memory_bytes: 34176
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
typedef long long ll;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define ios ios_base::sync_with_stdio(0) ; cin.tie(0) ; cout.tie(0)
#define so sizeof
#define pb push_back
#define cl clear() ;
#define vl vector<ll>
#define sz size()
#define len length()
#define emp empty()
#define el endl;cout.flush()
#define be begin()
#define fi first
#define se second
#define br break
#define en end()
#define ro return 0
#define eb emplace_back
#define con continue
#define ms(x) memset(x , 0, so x)
#define all(x) (x).be , (x).en
#define acc(x) accumulate((x).be , (x).en , 0ll)
#define forn(i,a,b) for(ll i=a;i<=b;++i)
#define rng_58 mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define vll vector<pair<ll,ll> >
#define pll pair<ll,ll>
#define plll pair<ll,pair<ll,ll>>
#define plvl pair<pair<ll,ll> ,ll>
#define mp make_pair
#define trace3(a,b,c) cerr <<"a is " << a << " b is " << b << " c is " << c << el;
#define trace4(a,b,c,d) cerr <<"a is " << a << " b is " << b << " c is " << c <<" d is " << d << el ;
#define trace5(a,b,c,d,e) cerr <<"a is " << a << " b is " << b << " c is " << c <<" d is " << d << " e is " << e << el;
#define trace6(a,b,c,d,e,f) cerr <<"a is " << a << " b is " << b << " c is " << c <<" d is " << d << " e is " << e << " f is " << f << el ;

int main()
{
    ios;
    ll n ;
    cin >> n ;
    cout << 3 * n * n << el ;
    ro ;
}































Measured memory_bytes: 256
import java.util.Scanner;


public class Main {

	static int[] memo=new int[100];
	static int fib(int n) {
		if (memo[n]!=0) return memo[n];
		if (n==0||n==1) return memo[n]=1;
		return (memo[n-1]=fib(n-1))+(memo[n-2]=fib(n-2));
	}

	static int fibDp(int n) {
		int[] dp=new int[n+1];
		dp[0]=1;
		dp[1]=1;
		for (int i=2;i<=n;i++) {
			dp[i]=dp[i-1]+dp[i-2];
		}
		return dp[n];
	}
	
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		System.out.println(fibDp(scan.nextInt()));
	}

}

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

// input
int N;
vector<int> x, y;


void input() {
    cin >> N;
    x = y = vector<int>(N);
    rep(i, N) cin >> x[i] >> y[i];
}


struct UnionFind {
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(int n) : par(n) { //最初は全てが根であるとして初期化
        for(int i = 0; i < n; i++) par[i] = i;
    }

    int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) { // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    }

    bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};

int main() {
    input();
    UnionFind uf(N);
    set<P> ylist;
    vector<T> w;
    rep(i, N) {
        ylist.insert(P(y[i], i));
        w.push_back(tuple(x[i], y[i], i));
    }
    sort(w.begin(), w.end());
    set<int> s;
    for (T t : w) {
        int x_, y_, i;
        tie(x_, y_, i) = t;
        ylist.erase(P(y_, i));
        if (s.count(i)) continue;
        s.insert(i);
        auto itr = ylist.upper_bound(P(y_, i));
        while (itr != ylist.end()) {
            int j = itr->second;
            uf.unite(i, j);
            s.insert(j);
            itr++;
        }
    }
    map<int, int> m;
    rep(i, N) m[uf.root(i)]++;
    rep(i, N) cout << m[uf.root(i)] << endl;
}


Measured memory_bytes: 32348