akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;
const long long MOD = 998244353;

///mt19937 mt(chrono::high_resolution_clock::now().time_since_epoch().count());
const int N = 300100;
pair<int, int> hor[N];
pair<int, int> ver[N];

void solve() {
        int h, w, m;
        cin >> h >> w >> m;
        set<pair<int, int> > s;
        for (int i = 0; i < N; i++) hor[i].second = ver[i].second = i;
        for (int i = 0; i < m; i++) {
                int a, b;
                cin >> a >> b;
                hor[a].first++;
                ver[b].first++;
                s.insert({a, b});
        }

        sort(hor, hor + N, greater<pair<int, int>>());
        sort(ver, ver + N, greater<pair<int, int>>());
        int ans = 0;
        for (int i = 0; i < 5; i++) {
                int x = hor[i].second;
                for (int j = 0; j < N; j++) {
                        int y = ver[j].second;
                        ans = max(ans, hor[i].first + ver[j].first - (s.count({x, y}) > 0));
                }
        }
        for (int i = 0; i < N; i++) {
                int x = hor[i].second;
                for (int j = 0; j < 5; j++) {
                        int y = ver[j].second;
                        ans = max(ans, hor[i].first + ver[j].first - (s.count({x, y}) > 0));
                }
        }
        cout << ans << endl;


}


int main() {
#ifdef QWERTY
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
#endif
        ios_base::sync_with_stdio(false);


        int t = 1;
//        cin >> t;

        for (int i = 1; i <= t; i++) {
//                cout << "Case #" << i << ": ";
                solve();
        }

        cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
        return 0;
}

Measured memory_bytes: 22424
#include<iostream>
using namespace std;
int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  if((C + B - 1) / B <= (A + D - 1) / D) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 3596
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
using namespace std;
#define pie 3.141592653589793238462643383279
#define mod 1000000007
#define INF 1145141919810364364
#define int long long
#define all(vec) vec.begin(),vec.end()
#define P pair<int,int>

int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x / gcd(x, y)*y;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}

int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2, mod) % mod;
}

int n;
P a[2010];
int d[2010][2010];
int ans;

signed main() {
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> a[i].first;
		a[i].second = i;
	}
	sort(a + 1, a + n + 1);
	reverse(a + 1, a + n + 1);
	for (int i = 1; i <= n; i++) {
		for (int j = 0; j < i; j++) {
			int x = abs(a[i].second - (n - (i - j - 1)));
			d[i][j] = max(d[i][j], d[i - 1][j] + a[i].first*x);
		}
		for (int j = 1; j <= i; j++) {
			int x = abs(a[i].second - j);
			d[i][j] = max(d[i][j], d[i - 1][j - 1] + a[i].first*x);
		}
	}
	for (int i = 0; i <= n; i++)ans = max(ans, d[n][i]);
	cout << ans << endl;
}

Measured memory_bytes: 26272
// {{{
#include <iostream>
#include <iomanip>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <complex>
#include <vector>
#include <list>
#include <set>
#include <unordered_set>
#include <queue>
#include <stack>
#include <map>
#include <unordered_map>
#include <string>
#include <algorithm>
#include <numeric>
using namespace std;

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define FOR(i, a, b) for(ll i = static_cast<ll>(a); i < static_cast<ll>(b); i++)
#define FORR(i, a, b) for(ll i = static_cast<ll>(a); i >= static_cast<ll>(b); i--)
#define REP(i, n) for(ll i = 0ll; i < static_cast<ll>(n); i++)
#define REPR(i, n) for(ll i = static_cast<ll>(n); i >= 0ll; i--)
#define ALL(x) (x).begin(), (x).end()

#define DBG(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl;

using ll = long long;
using ull = unsigned long long;
using P = pair<int, int>;
using LP = pair<ll, ll>;
using IP = pair<int, P>;
using LLP = pair<ll, LP>;

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

constexpr int INF = 100000000;
constexpr ll LINF = 10000000000000000ll;
constexpr int MOD = static_cast<int>(1e9 + 7);
constexpr double EPS = 1e-9;

// template specialization of std::hash for std::pair
namespace std {
template<typename T, typename U>
struct hash<pair<T, U> > {
    size_t operator()(const pair<T, U> &key) const noexcept {
        size_t h1 = hash<T>()(key.first);
        size_t h2 = hash<U>()(key.second);
        return h1 ^ (h2 << 1);
    }
};
} // namespace std

template<typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
    size_t sz = v.size();
    os << "[";
    for (size_t i = 0; i < sz-1; i++) {
        os << v[i] << ", ";
    }
    os << v[sz-1] <<  "]";
    return os;
}

template<typename T>
void printArray(T *arr, size_t sz) {
    cerr << "[";
    for (size_t i = 0; i < sz-1; i++) {
        cerr << arr[i] << ",";
    }
    cerr << arr[sz-1] <<  "]" << endl;
}

static inline ll mod(ll x, ll m)
{
    ll y = x % m;
    return (y >= 0 ? y : y+m);
}

struct Compare {
    //vector<ll> &x_, &y_;
    //Compare(vector<ll> &x, vector<ll> &y): x_(x), y_(y) {}
    //bool operator()(const P &lhs, const P &rhs) {
    //    return x_[lhs.fi]+y_[lhs.se] < x_[rhs.fi]+y_[rhs.se];
    //}
    bool operator()(const int x, const int y) {
        return x < y;
    }
};

// print floating-point number
// cout << fixed << setprecision(12) <<

// }}}

string s, t, u;
int a, b;

void solve()
{
    if (s == u) a--;
    else if (t == u) b--;
    cout << a << " " << b << endl;
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> s >> t >> a >> b >> u;
    solve();
    return 0;
}

// vim:set foldmethod=marker:


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>

using namespace std;

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

int main(){
	int a;
	double b,c;
	while(~scanf("%d,%lf,%lf",&a,&b,&c)){
		if(b/(c*c) >= 25){
			cout << a << endl;
		}
	}
}

Measured memory_bytes: 0
open Array
let () =
  let rec make_list n = if n = 0 then [0] else n :: make_list (n-1) in
  let n,m = Scanf.scanf "%d %d\n" @@ fun a b -> a, b in
  let h = init n @@ fun _ -> Scanf.scanf "%d " @@ fun d -> d in
  let arr = make n 0 in
  for i = 1 to m do
    Scanf.scanf "%d %d\n" @@ fun x y ->
    let a = x-1 in let b = y-1 in 
    arr.(a) <- (max h.(b) arr.(a)); arr.(b) <- (max h.(a) arr.(b))
  done;
  print_int
    (List.fold_left (fun i v -> if h.(v) > arr.(v) then i+1 else i) 0 (make_list (n-1)))

Measured memory_bytes: 11252
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define ll long long int
#define ld long double
#define vi vector<int>
#define vl vector<ll>
#define v2i vector<vector<int>>
#define v2l vector<vector<ll>>
#define ppi pair<int,int>
#define vpi vector<ppi>
#define ppl pair<ll,ll>
#define all(x) x.begin(),x.end()
#define ii int,int 
#define ff first    
#define ss second
#define forn(i,a,b) for(int i=a;i<b;i++)
#define forr(i,a,b) for(int i=a;i>=b;i--)
#define forv(i,m) for(auto i : m)
#define imx INT_MAX
#define imn INT_MIN
#define inf LONG_MAX
#define minf LONG_MIN
#define endl "\n"
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define sze size()
#define rvs reverse 
#define itr iterator 
#define pre cout<<fixed<<setprecision(10);
#define umap unordered_map
#define uset unordered_set
#define pi 3.141592653589793
const ll infinity = 9e18;

/*
#define MODM(a,b,md) ((a%md)*(b%md))%md
#define MODA(a,b,md) ((a%md)+(b%md))%md
#define ull unsigned long long int
#define si short int
*/

/*
bool compare(int a,int b) {return a > b;}
bool compare1(ppi a,ppi b) {return a.ff > b.ff;}
bool compare2(ppi a,ppi b) {return a.ss < b.ss;}
ll Npower(ll a,ll b) {ll product = 1; while(b){if(b&1){product = product*a;}a = a*a;b = b>>1;} return product;}
ll power(ll a,ll b,ll md) {ll product = 1; while(b){if(b&1){product = MODM(product,a,md);}a = MODM(a,a,md);b = b>>1;} return product%md;}
bool isprime(ll n){if(n < 2) return 0; ll i = 2; while(i*i <= n){if(n%i == 0) return 0; i++;} return 1;}
ll GCD(ll a,ll b) {return b==0 ? a:GCD(b,a%b);}
ll LCM(ll a,ll b) {return (a/GCD(a,b))*b; }
*/

int main()
{
    fast
    pre

        
    int n;
    cin>>n;

    if(n%2==0)
    {
        cout<<0.500000;
        return 0;
    }

    cout<<(double)(n+1)/((double)2*n);












    return 0;
}

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

using namespace std;
using ll = long long;
using ld = long double;
using pi = pair<ll, ll>;

int n, m;
vector<int> E[100005];
bool V[100005];
void input() {
    cin >> n >> m;
    for (int i = 0; i < m; i++) {
        int x, y;
        cin >> x >> y;
        E[x].push_back(y);
        E[y].push_back(x);
    }
}

int D[100005];
int P[100005][20];
void dfs1(int x) {
    V[x] = 1;
    for (int i = 1; i < 20; i++)
        P[x][i] = P[P[x][i - 1]][i - 1];
    for (int i : E[x]) {
        if (V[i]) continue;
        P[i][0] = x;
        D[i] = D[x] + 1;
        dfs1(i);
    }
}

int lca(int x, int y) {
    if (D[x] < D[y]) swap(x, y);
    for (int i = 20; i--; ) {
        if ((D[x] - D[y] >> i) == 1) {
            x = P[x][i];
        }
    }
    if (x == y) return x;
    for (int i = 20; i--; ) {
        if (P[x][i] != P[y][i]) {
            x = P[x][i];
            y = P[y][i];
        }
    }
    return P[x][0];
}

int S[100005];
set<pi> rev;
void dfs2(int x) {
    V[x] = 0;
    for (int i : E[x]) {
        if (V[i]) {
            dfs2(i);
            S[x] += S[i];
            if (S[i] % 2 == 1) {
                rev.emplace(x, i);
            }
        }
    }
}

int O[100005];
void calc() {
    if (m % 2 == 1) {
        cout << -1;
        return;
    }
    dfs1(1);
    vector<int> odd;
    for (int i = 1; i <= n; i++) {
        for (int j : E[i]) {
            if (D[i] < D[j]) O[i]++;
        }
        if (O[i] % 2 == 1) {
            odd.push_back(i);
        }
    }
    for (int i = 0; i < odd.size(); i += 2) {
        int x = odd[i], y = odd[i + 1];
        S[x]++;
        S[y]++;
        S[lca(x, y)] -= 2;
    }
    dfs2(1);
    for (int i = 1; i <= n; i++) {
        for (int j : E[i]) {
            if (D[i] < D[j]) {
                if (rev.count(pi(i, j)) == 1) {
                    cout << j << ' ' << i << '\n';
                }
                else {
                    cout << i << ' ' << j << '\n';
                }
            }
        }
    }
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    input();
    calc();
    return 0;
}

Measured memory_bytes: 25720
def task():
	a=input().split()
	b=int(a[0])
	c=int(a[1])
	if(b>=13):
		print(c)
	elif(b>5):
		print(int(c/2));
	else:
		print(0);		
t=1
while(t>0):
		task()
		t-=1


Measured memory_bytes: 2940
table1 = {"'"=>"000000", ","=>"000011", "-"=>"10010001", "."=>"010001",
  "?"=>"000001", "A"=>"100101", "B"=>"10011010", "C"=>"0101", "D"=>"0001",
  "E"=>"110", "F"=>"01001", "G"=>"10011011", "H"=>"010000", "I"=>"0111",
  "J"=>"10011000", "K"=>"0110", "L"=>"00100", "M"=>"10011001",
  "N"=>"10011110", "O"=>"00101", "P"=>"111", "Q"=>"10011111", "R"=>"1000",
  "S"=>"00110", "T"=>"00111", "U"=>"10011100", "V"=>"10011101",
  "W"=>"000010", "X"=>"10010010", "Y"=>"10010011", "Z"=>"10010000", " "=>"101"}
table2 = {"00000"=>"A", "00001"=>"B", "00010"=>"C", "00011"=>"D", "00100"=>"E",
  "00101"=>"F", "00110"=>"G", "00111"=>"H", "01000"=>"I", "01001"=>"J",
  "01010"=>"K", "01011"=>"L", "01100"=>"M", "01101"=>"N", "01110"=>"O",
  "01111"=>"P", "10000"=>"Q", "10001"=>"R", "10010"=>"S", "10011"=>"T",
  "10100"=>"U", "10101"=>"V", "10110"=>"W", "10111"=>"X", "11000"=>"Y",
  "11001"=>"Z", "11010"=>" ", "11011"=>".", "11100"=>",", "11101"=>"-",
  "11110"=>"'", "11111"=>"?"}

$<.readlines.each do |line|
  line.chomp!
  text = ""
  line.each_char {|c| text += table1[c]}
  l = text.length % 5
  text += "0" * (5 - l) if l > 0
  
  result = ""
  until text.empty?
     result += table2[text[0, 5]]
     text = text[5..-1]
  end
  puts result
end


Measured memory_bytes: 7344
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

//多少反省

int N, M;
vector<int> V[100001];
vector<ll> D1[100001], D2[100001];
map<int, ll> dp[100001];
map<int, int> BB[100001];
int C[100001];

ll dfs(int A, int B) {
	if (dp[A][B]) return dp[A][B];

	int k = V[A].size();
	if (B == 0) {
		D1[A].pb(1);
		D2[A].pb(1);
		for (int i = 0; i < k; i++) {
			D1[A].pb(dfs(V[A][i], A));
		}
		for (int i = 0; i < k; i++) {
			D2[A].pb(D1[A][k - i]);
			D2[A][i + 1] = D2[A][i + 1] * D2[A][i] % M;
		}
		for (int i = 0; i < k; i++) {
			D1[A][i + 1] = D1[A][i + 1] * D1[A][i] % M;
		}
		C[A] = 1;
		return D1[A][k];
	}
	else if (C[A]) {
		return dp[A][B] = (D1[A][BB[A][B] - 1] * D2[A][k - BB[A][B]] + 1) % M;
	}
	else {
		ll kuro = 1;
		for (int i = 0; i < k; i++) {
			if (V[A][i] == B) continue;
			kuro = kuro * dfs(V[A][i], A) % M;
		}
		return dp[A][B] = (kuro + 1) % M;
	}
}


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


	cin >> N >> M;
	rep(i, N - 1) {
		int x, y;
		cin >> x >> y;
		V[x].pb(y);
		BB[x][y] = V[x].size();
		V[y].pb(x);
		BB[y][x] = V[y].size();
	}

	pair<int, int> E[100001];
	rep(i, N) E[i] = mp(V[i + 1].size(), i + 1);
	sort(E, E + N);
	reverse(E, E + N);

	ll kotae[100001];
	rep(i, N) {
		kotae[E[i].second] = dfs(E[i].second, 0) % M;
	}
	rep1(i, N) co(kotae[i]);

	Would you please return 0;
}

Measured memory_bytes: 75520
import java.util.*;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.util.Arrays;
import java.util.List;
import java.util.ArrayList;
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Collections;
import java.awt.Point;


public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int s = Integer.parseInt(br.readLine());
        int[] a = new int[1000001];
        a[1] = s;
        
        for (int i = 2; i < 1000001; i++) {
            if (a[i-1]%2==0) {
                a[i] = a[i-1]/2;
            }
            else {
                a[i] = 3*a[i-1]+1;
            }
        }
        
        for (int i = 2; i < 1000001; i++) {
            for (int j = i-1; 0 < j; j--) {
                if (a[i] == a[j]) {
                    System.out.println(i);
                    return;
                }
            }
        }
        
        
    }
}



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

void push();
int pop();

int top,S[1000];

int main(){

  char s[100];
  int x,y;
  
  top = 0;


  while( scanf("%s",s) != EOF) {
    if( s[0] == '+' ) {
      x = pop();
      y = pop();

      push(x+y);

    }else if (s[0] == '-'){

        y = pop();
	x = pop();
	
      push(x-y);

    }else if(s[0]  == '*'){

        x = pop();
	y = pop();
	
      push(x*y);

    }else{
      push(atoi(s));
    }
  }
      

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

  return 0;

}

void push(int p){
  
  S[++top] = p;

}

int pop() {

  top--;

  return S[top+1];

}

Measured memory_bytes: 548
#include<math.h>
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define    ll   long long int
#define    py   printf("Yes\n")
#define    pn   printf("No\n")
#define    in   cin>>
using namespace std;

ll hako[200000];
int main()
{
  int n,t,a;
  int ans;
  in n>>t>>a;
  int h[n];
  int cc=1<<30;
  for(int i=1;i<=n;i++){
    in h[i];
    int d=(t*1000-h[i]*6)-a*1000;
    if(d<0)d=-d;
    if(cc>d)cc=d,ans=i;
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 256
# coding: utf-8

import sys
input = sys.stdin.readline

def f(N, A, K):
    dp = [0] * (K + 1)
    for i in range(K + 1):
        for x in A:
            if i < x:
                break
            if not dp[i - x]:
                dp[i] = 1
                break
    return(dp[K])

ans = [ "Second", "First" ]
n, k = map(int, input().split()) # 1 <= n <= 100, 1 <= k <= 10^5
a = list(map(int, input().split()))
print(ans[f(n, a, k)])


Measured memory_bytes: 3828
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#include<string>
#define MOD 1000000007
typedef long long ll;
using namespace std;

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    int k;
    string s;
    cin >> k >> s;
    if((int)s.size() <= k) cout << s << endl;
    else{
        for(int i=0;i<k;i++){
            cout << s[i];
        }
        cout << "..." << endl;
    }
    return 0;
}


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

int n;
string s, t;

bool simulate(int start, int wide, char left, char right) {
    int l, r;
    l = r = start;
    int can_move_L, can_move_R; //後手の補正できる回数
    can_move_L = can_move_R = 0;

    for (int i = 0; i < n; ++i) {
        //先手
        if (s[i] == right) r++;
        else if (s[i] == left) l--;
        if (l < 1 || r > wide) { //区間がはみ出た場合
            if (l < 1 && r < wide && can_move_R > 0) { //右にずらす
                l++, r++;
                can_move_R--;
            } else if (r > wide && l > 1 && can_move_L > 0) { //左にずらす
                l--, r--;
                can_move_L--;
            } else {
                return false;
            }
        }

        //後手
        if (t[i] == right) {
            if (l < r) l++;
            else can_move_R++;
        } else if (t[i] == left) {
            if (l < r) r--;
            else can_move_L++;
        }
    }
    return true;
}

int main() {
    int h, w, sr, sc;
    cin >> h >> w >> n >> sr >> sc >> s >> t;
    if (simulate(sr, h, 'U', 'D') && simulate(sc, w, 'L', 'R')) cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}


Measured memory_bytes: 776
n = STDIN.gets.to_i
n.times do
  tubeB = []
  tubeC = []

  balls = STDIN.gets.chop!.split(/ /)
  balls.each_with_index do |b, i|
    b = b.to_i

    topB = tubeB[tubeB.length - 1] || 0
    topC = tubeC[tubeC.length - 1] || 0

    if topB < b
      tubeB.push(b)
    elsif topC < b
      tubeC.push(b)
    else
      puts "NO"
      break
    end

    if i == balls.length - 1
      puts "YES"
    end
  end
end

Measured memory_bytes: 2372
using System;

class Program
{
    static void Main(string[] args)
    {
        var n = int.Parse(Console.ReadLine());
        var a = Array.ConvertAll(Console.ReadLine().Split(), long.Parse);

        long x = 0;
        long sum_x = 0;
        for (int i = 0; i < n; i++)
        {
            sum_x += a[i];
            if (i % 2 == 0)
            {
                if (sum_x <= 0)
                {
                    x += 1 - sum_x;
                    sum_x = 1;
                }
            }
            else
            {
                if (0 <= sum_x)
                {
                    x += 1 + sum_x;
                    sum_x = -1;
                }
            }
        }

        long y = 0;
        long sum_y = 0;
        for (int i = 0; i < n; i++)
        {
            sum_y += a[i];
            if (i % 2 == 1)
            {
                if (sum_y <= 0)
                {
                    y += 1 - sum_y;
                    sum_y = 1;
                }
            }
            else
            {
                if (0 <= sum_y)
                {
                    y += 1 + sum_y;
                    sum_y = -1;
                }
            }
        }

        Console.WriteLine(Math.Min(x, y));
    }
}


Measured memory_bytes: 27228
# from math import factorial,sqrt,ceil,gcd
# from itertools import permutations as permus
# from collections import deque,Counter
import re
# from functools import lru_cache # 簡単メモ化 @lru_cache(maxsize=1000)
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# import networkx as nx
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix
# from scipy.special import comb

# slist = "abcdefghijklmnopqrstuvwxyz"
S = input()

if S[:7] == "keyence" or S[-7:]=="keyence":
    print("YES")
    exit()
else:
    ans = "NO"
    for i in range(1,7):
        front = "keyence"[:i]
        back = "keyence"[i:]
        if S[:i] == front and S[-len(back):]==back:
            print("YES")
            exit()
    print(ans)
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(ans))


Measured memory_bytes: 3188
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
#define owo(i,a, b) for(int i=(a);i<(b); ++i)
#define uwu(i,a, b) for(int i=(a)-1; i>=(b); --i)
#define senpai push_back
#define ttgl pair<int, int>
#define ayaya cout<<"ayaya~"<<endl
using namespace std;
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<ttgl, null_type,less<ttgl>, rb_tree_tag,tree_order_statistics_node_update>*/
 
using ll = long long;
using ld = long double;
const ll MOD = 1000000007;
const ll root = 62;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
ll binpow(ll a,ll b){ll res=1;while(b){if(b&1)res=(res*a)%MOD;a=(a*a)%MOD;b>>=1;}return res;}
ll modInv(ll a){return binpow(a, MOD-2);}
const double PI = acos(-1);
const double eps = 1e-6;
const int INF = 0x3f3f3f3f;
const int NINF = 0xc0c0c0c0;
const ll INFLL = 0x3f3f3f3f3f3f3f3f;
const ll NINFLL = 0xc0c0c0c0c0c0c0c0;
const int mxN = 3001;
ll dp[mxN][mxN][4];
int r, c, L;
int n;
vector<pair<ll, ll>> vals[mxN];
int main() {
    //freopen("file.in", "r", stdin);
    //freopen("file.out", "w", stdout);
    mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
    cin.tie(0)->sync_with_stdio(0);
    cin>>r>>c;
    cin>>n;
    int a, b, d;
    owo(i, 0, n) {
        cin>>a>>b>>d;
        vals[a].senpai({b, d});
    }
    owo(i, 0, mxN) {
      sort(vals[i].begin(), vals[i].end());
    }
    owo(rr, 1, r+1) {
        int idx = 0;
        owo(cc, 1, c+1) {
            uwu(k, 4, 0) {
                dp[rr][cc][k] = max(dp[rr][cc-1][k], dp[rr][cc][k]);
                owo(kk, 0, 4) {
                    dp[rr][cc][k] = max(dp[rr][cc][k], dp[rr-1][cc][kk]);
                }
                if(k<3&&(idx<vals[rr].size()&&vals[rr][idx].first==cc)) {
                    //cout<<rr<<" "<<cc<<" "<<(k+1)<<" "<<dp[rr][cc][k+1]<<" "<<dp[rr][cc][k]<<" "<<vals[rr][idx].second<<"\n";
                    dp[rr][cc][k+1] = max(dp[rr][cc][k+1], dp[rr][cc][k] + vals[rr][idx].second);
                }
            }
            /*owo(k, 0, 4) {
                cout<<rr<<" "<<cc<<" "<<k<<" "<<dp[rr][cc][k]<<"\n";
            }*/
            if(idx<vals[rr].size()&&vals[rr][idx].first==cc)idx++;
        }
    }
    ll ans = 0;
    owo(i, 0, 4) {
      ans = max(ans, dp[r][c][i]);
    }
    cout<<ans<<"\n";
    return 0;
}

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

using namespace std;

#define ll					long long
#define vi					vector<int>
#define vii					vector<vi>
#define ALL(s)			(s).begin(),(s).end()
#define pii					pair<int, int>
#define pll					pair<ll, ll>
#define si					set<int>
#define mp					make_pair
#define F						first
#define S						second
#define pb					push_back
#define tc(t)				int t; cin >> t; int t2 = 1; while(t--)
#define _						ios_base::sync_with_stdio(false); cin.tie(NULL); 
const ll MOD =  998244353;
const ll INF = 1<<29;
const ll MAX_N = 1e6 + 7;



ll ncr(int n, int r) 
{ 
    long long p = 1, k = 1; 
  
    if (n - r < r) 
        r = n - r; 
  
    if (r != 0) { 
        while (r) { 
            p *= n; 
            k *= r; 
            long long m = __gcd(p, k); 
            p /= m; 
            k /= m; 
  
            n--; 
            r--; 
        } 
    } 
  
    else
        p = 1; 
  
    return p; 
}
int main() {_
	int a,b;
	cin >> a >> b;
	ll ans = 0;
	
	if(a > 1) {
		ans += ncr(a,2);
		//cout << ans << "\n";
	}
	if(b > 1) {
		ans += ncr(b,2);
	}

	cout << ans << "\n"; 
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#define rep(i, a, n) for(int i = a; i < n; i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main()
{
    int n;
    cin >> n;
    rep(i, 1, 10){
        rep(j, 1, 10){
            if(i * j == n){
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 384
# include "bits/stdc++.h"
using namespace std;
using LL = long long;
using ULL = unsigned long long;
const double PI = acos(-1);
template<class T>constexpr T INF() { return ::std::numeric_limits<T>::max(); }
template<class T>constexpr T HINF() { return INF<T>() / 2; }
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
typedef pair<LL, LL> pii;
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++)if ((n >> i) & 1)cnt++; return cnt; }
int d_sum(LL n) { int ret = 0; while (n > 0) { ret += n % 10; n /= 10; }return ret; }
int d_cnt(LL n) { int ret = 0; while (n > 0) { ret++; n /= 10; }return ret; }
LL gcd(LL a, LL b) { if (b == 0)return a; return gcd(b, a%b); };
LL lcm(LL a, LL b) { LL g = gcd(a, b); return a / g*b; };
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define UNIQUE(wpwpw)        sort(ALL((wpwpw)));(wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define REP(i,upupu)         FOR(i,0,upupu)
# define INIT                 std::ios::sync_with_stdio(false);std::cin.tie(0)
# pragma warning(disable:4996)

int N, root;
vector<int> g[101010];
int depth[101010];
int par[101010][30];

//木の深さを求める
void dfs(int v, int p, int d) {
	par[v][0] = p;
	depth[v] = d;
	for (int i = 0; i<g[v].size(); i++) {
		if (g[v][i] == p)continue;
		dfs(g[v][i], v, d + 1);
	}
}

//par[v][i]:=頂点vから2^i回親をたどった頂点（無かったら-1）
//vの親→par[v][0],vの親の親par[v][1]
//par[v][i+1]=par[par[v][i]]よりpar[~][i]が計算できればpar[~][i+1]も求まる
void fill_table() {
	for (int i = 0; i<19; i++) {
		for (int j = 0; j<N; j++) {
			if (par[j][i] == -1)par[j][i + 1] = -1;
			else par[j][i + 1] = par[par[j][i]][i];
		}
	}
}


//頂点u,vのLCAを求める
int lca(int u, int v) {

	if (depth[u]>depth[v])swap(u, v);
	//深さをそろえるための処理
	for (int i = 19; i >= 0; i--) {
		if (((depth[v] - depth[u]) >> i) & 1) {
			v = par[v][i];
		}
	}

	if (u == v)return u;
	//ダブリング
	for (int i = 19; i >= 0; i--) {
		if (par[u][i] != par[v][i]) {
			u = par[u][i];
			v = par[v][i];
		}
	}
	return par[u][0];
}


int main() {
	cin >> N;
	REP(i, N) {
		int k;
		cin >> k;
		REP(j, k) {
			int c;
			cin >> c;
			g[i].emplace_back(c);
			g[c].emplace_back(i);
		}
	}
	dfs(root, -1, 0);
	fill_table();

	int q;
	cin >> q;
	REP(i, q) {
		int u, v;
		cin >> u >> v;
		cout << lca(u, v) << endl;
	}
	return 0;
}



Measured memory_bytes: 26940
#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define ull unsigned long long
#define vi vector<ll>
#define vvi vector<vi>
#define DBG_N(hoge) cerr<<"!"<<" "<<(hoge)<<endl;
#define DBG cerr<<"!"<<endl;
#define BITLE(n) (1LL<<((ll)n))
#define BITCNT(n) (__builtin_popcountll(n))
#define SUBS(s,f,t) ((s).substr((f)-1,(t)-(f)+1))
#define ALL(a) (a).begin(),(a).end()
using namespace std;
ll rui[111111][30];
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll a,b,c,d,e;
  string s,ss,sss;
  
  cin>>a;
  cin>>s;
  //for(int i=0;i<26;i++){rui[0][i]=1;rui[a+1][i]=1;}
//cout<<"!"<<endl;
  for(int i=0;i<a;i++){
    for(int j=0;j<26;j++)
      if(s[i]-'a'==j)rui[i+1][j]+=rui[i][j]+1;
      else rui[i+1][j]+=rui[i][j];
  }
  ll ans=0;
  for(int i=1;i<=a;i++){
    ll sum=1;
    for(int j=0;j<26;j++){
      if(s[i-1]-'a'!=j){
	sum*=(rui[a][j]-rui[i][j]+1);
	//cout<<sum<<endl;
      }
      //cout<<endl;
      sum%=MOD;
    }
    // cout<<sum<<endl;
    ans+=sum;
    ans%=MOD;
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 25040
#include<bits/stdc++.h>
using namespace std;
#define int long
using pi=pair<int,int>;
#define mp make_pair
signed main(){
  int n,m,r;
  cin>>n>>m>>r;
  vector<int> v(r);
  for(auto& i:v)cin>>i,--i;
  vector<vector<int>> cost(n,vector<int>(n,1e8));
  vector<vector<int>> rcost(r,vector<int>(r,1e8));
  for(int i=0;i<m;++i){
    int a,b,c;
    cin>>a>>b>>c;
    --a;--b;
    cost[a][b]=cost[b][a]=c;
  }
  auto f=[](pi a,pi b){return a.second>b.second;};
  for(int src=0;src<r-1;++src){
    for(int dst=src+1;dst<r;++dst){
      priority_queue<pi,vector<pi>,decltype(f)> que(f);
      vector<bool> vis(n,false);
      que.push(mp(v[src],0));
      while(!que.empty()){
        pi q = que.top(); que.pop();
        if(q.first==v[dst]){
          rcost[src][dst]=rcost[dst][src]=q.second;
          break;
        }
        vis[q.first]=true;
        for(int i=0;i<n;++i){
          if(cost[q.first][i]==1e8 || i==q.first)continue;
          if(!vis[i])que.push(mp(i,q.second+cost[q.first][i]));
        }
      }
    }
  }
  vector<int> order(r);
  for(int i=0;i<r;++i)order[i]=i;
  int factn = 1;
  for(int i=2;i<=r;++i)factn*=i;
  int res=1e9;
  for(int i=0;i<factn;++i){
    int resp=0;
    for(int j=0;j<r-1;++j)resp += rcost[order[j]][order[j+1]];
    res=min(res,resp);
    next_permutation(order.begin(),order.end());
  }
  cout<<res;
}

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

#define fo1(i, n) for (int i = 0; i < n; i++)
#define rep(i, l, r) for (int i = l; i < r; i++)
#define repb(i, r, l) for (int i = r; i > l; i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) int((x).size())
using ll = long long; using vi = vector<int>; using ii = pair<int,int>;
const int oo = 0x3f3f3f3f; const ll OO = ll(oo)*oo;
#ifndef DEBUG
#define endl '\n'
#define debugf(...)
#define debug(...)
#else
#define debugf(...) printf(__VA_ARGS__)
#define debug(...) __VA_ARGS__
#endif
const int N = 300005;
const ll mod =  1000000007;

ll a[N];
ll p2[N];

int nset[61][N];

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

    p2[0] = 1;
    for (int i = 1; i < N; i++)
        p2[i] = (p2[i-1] * 2) % mod;

    int n; cin >> n;
    fo1(i, n) {
        cin >> a[i];
        ll x = a[i];
        int j = 0;
        while (x) {
            if (x & 1) nset[j][i]++;
            j++;
            x >>= 1;
        }
    }

    fo1(i, 61) {
        repb(j, n-1, -1)
            nset[i][j] += nset[i][j+1];
    }

    ll ans = 0;
    fo1(i, n-1) {
        ll x = a[i];
        for (int j = 0; j < 61; j++) {
            if (x & 1) {
                ll k = n - i - 1 - nset[j][i+1];
                ans += (p2[j] * ((k + mod) % mod)) % mod;
                // debugf("Found %lld to flip at bit %d\n", k, j);
            } else {
                ans += (p2[j] * nset[j][i+1]) % mod;
                // debugf("Found %lld not to flip at bit %d\n", nset[j][i+1], j);
            }
            ans %= mod;

            x >>= 1;
        }
    }

    debug (
        fo1(i, n)
            cout << nset[0][i] << ' ';
        cout << endl;
    )

    cout << ans << endl;

    return 0;
%>

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

typedef long long ll;
const int MOD = 1e9 + 7;
typedef vector<ll> vll;
typedef vector<int> vi;
const int maxn = 100 + 10;

int main() {
    int d;
    cin >> d;
    cout << "Christmas";
    for (int i = 0; i < 25 - d; ++i) {
        cout << " Eve";
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int x = sc.nextInt();
    int[] a = new int[N];
    for (int i = 0; i < N; i++) {
      a[i] = sc.nextInt();
    }
    
    Arrays.sort(a);
    
    int ans = 0;
    for (int i = 0; i < N; i++) {
      if (x >= a[i]) {
        x -= a[i];
        ans++;
      }
    }
    if (x > 0 && ans == N) {
      ans--;
    }
    System.out.println(ans);
  }
}

Measured memory_bytes: 21844
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] s = sc.next().toCharArray();
		for(int i = 0; i < s.length; i = i + 2) {
			sb.append(s[i]);
		}
		System.out.println(sb);
	}
}


Measured memory_bytes: 25532
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		while (in.hasNext()) {
			String[] s = in.nextLine().split(",");
			String num = s[0];
			double w = Double.parseDouble(s[1]);
			double h = Double.parseDouble(s[2]);
			if (25 <= w / (h * h)) {
				System.out.println(num);
			}
		}
	}
}

Measured memory_bytes: 17148
N, P = map(int, input().split())

import sys

if N == 1:
    print(P)
    sys.exit()
if P == 1:
    print(1)
    sys.exit()

from collections import Counter
import math

def trial_division(n):
    #素因数を格納するリスト
    factor = []
    #2から√n以下の数字で割っていく
    tmp = int(math.sqrt(n)) + 1
    for num in range(2,tmp):
        while n % num == 0:
            n //= num
            factor.append(num)
    #リストが空ならそれは素数
    if not factor:
        return 'prime number'
    else:
        factor.append(n)
        return factor

flist = trial_division(P)
# print(flist)
fc = Counter(flist)
ans = 1

for num, count in fc.items():
    while count >= N:
        ans *= num
        count -= N

print(ans)

Measured memory_bytes: 9464
use std::vec::Vec;
use std::cmp::*;
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>().split_whitespace().map(|e| e.parse().ok().unwrap()).collect()
}

fn read_touple<T: std::str::FromStr + Copy>() -> (T, T, T, T, T) {
  let v: Vec<T> = read_vec();
  assert_eq!(v.len(), 5);
  (v[0], v[1], v[2], v[3], v[4])
}

fn main() {
    let (x, y, a, b, c) = read_touple::<usize>();
    let mut p: Vec<usize> = read_vec();
    let mut q: Vec<usize> = read_vec();
    let mut r: Vec<usize> = read_vec();
    p.sort_by(|a, b| b.cmp(&a));
    q.sort_by(|a, b| b.cmp(&a));
    for i in 0..x {
      r.push(p[i]);
    }

    for i in 0..y {
      r.push(q[i])
    }

    r.sort_by(|a, b| b.cmp(&a));
    let mut ans = 0;
    for i in 0..x+y {
      ans += r[i];
    }
    println!("{}", ans);
}


Measured memory_bytes: 14356
#define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f
#include <cstdio>
#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>
 
using namespace std;
 
typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P > PP;

int dp[1200000];
      
int main(){
  memset(dp,0,sizeof(dp));
  for(int S=0;S<=(1<<20)-1;S++){
    int sum = 0;
    for(int i=0;i<20;i++){
      if(S & (1<<i)){
        sum += (i+1);
      }
    }
    dp[S] = sum;
  }
  int upper,num_of_elements,target_sum;
  while(~scanf("%d %d %d",
               &upper,
               &num_of_elements,
               &target_sum)){
    if(upper == 0 
       && num_of_elements == 0 
       && target_sum == 0) break;

    int res = 0;
    for(int S=0;S<=(1<<upper)-1;S++){
      if(__builtin_popcount(S) != num_of_elements) continue;
      if(dp[S] != target_sum) continue;
      res++;
    }
    printf("%d\n",res);
  }
}

Measured memory_bytes: 5888
#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)  //  repマクロ
#define leng(n) (int)(log10(n)+1)  //  桁数leng
#define INF 9223372036854775807 //  巨大数INF
using namespace std;

signed main() {
  int N;
  cin>> N;
  vector<int> L(N);
  rep(i, N) cin >> L[i];
  
  int sum = 0, m = 0;
  rep(i, N) {
    if (L[i] > m) m = L[i];
    sum += L[i]; 
  }
  sum -= m;
  if(m < sum) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define FOR(i,l,r) for(i=l;i<r;i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define P pair<ll,ll>
#define F first
#define S second
signed main(){
  int N,K,i,j;cin>>N>>K;
  vector<int>A(N);
  REP(i,N)cin>>A.at(i);
  REP(i,K){
    vector<int>B(N,0),L(N+1,0),R(N+1,0);
    REP(j,N){
      L.at(max(0,j-A.at(j)))++;
      R.at(min(N,j+A.at(j)+1))++;
    }
    int b=L.at(0);
    REP(j,N){
      B.at(j)=b;
      b+=L.at(j+1)-R.at(j+1);
    }
    REP(j,N)A.at(j)=B.at(j);
    sort(ALL(B));
    if(B.at(0)==N)break;
  }
  cout<<A.at(0);
  REP(i,N-1)cout<<" "<<A.at(i+1);
  cout<<endl;
  return 0;
}

Measured memory_bytes: 6420
#include <iostream>
#include <vector>
#include <cmath>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <map>

using namespace std;

int main(int argc, const char * argv[]) {

    int ac = 0, tle = 0, wa = 0, re = 0;
    
    int a;
    
    cin >> a;
    
    string s[a];
    
    for(int i=0; i<a; i++)
    {
        cin >> s[i];
        
        if(s[i] == "AC") ac++;
        else if(s[i] == "WA") wa++;
        else if(s[i] == "TLE") tle++;
        else if(s[i] == "RE") re++;
    }
    
    cout << "AC x " << ac << endl;
    cout << "WA x " << wa << endl;
    cout << "TLE x " << tle << endl;
    cout << "RE x " << re << endl;

    
}


Measured memory_bytes: 6716
/*input
101
*/
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
string s[10001];
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	string s;
	cin>>s;
	int cnt=0;
	cnt+=s[0]=='1'?1:0;
	cnt+=s[1]=='1'?1:0;
	cnt+=s[2]=='1'?1:0;
	cout<<cnt<<endl;

}

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

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

Measured memory_bytes: 256
first = sorted(list(input('')))
second = sorted(list(input('')), reverse=True)
length = len(first) < len(second)

result = False
check_equal = False
for (f, s) in zip(first, second):
  check_equal = (s == f)
  if not check_equal:
    result = (f < s)
    break

if (length and check_equal) or result:
  print('Yes')
else:
  print('No')


Measured memory_bytes: 3060
n,m=map(int,input().split())
s=input()
t=input()

if s[0]!=t[0]:
    print(-1)
    exit()

def gcd(a,b):
    while b:
        a,b=b,a%b
    return a

num=gcd(n,m)

if num==1:
    ans=n*m

else:
    ans=n*m//num
    check1=n//num
    check2=m//num
    for i in range(1,num):
        if s[i*check1]==t[i*check2]:
            continue
        else:
            print(-1)
            exit()
print(ans)

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

int getNum(int m)
{
    int sum=0;
    while(m!=0)
    {
        sum+=(m%10);
        m/=10;
    }
    return sum;
}
int main()
{
    int m,n,i,k;
    while(cin>>m)
    {
        if(m%getNum(m)==0){
            cout<<"Yes"<<endl;
        }
        else cout<<"No"<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    int n,a,b,c;
    scanf("%d",&n);
    a=n/100;
    b=(n%100)/10;
    c=(n%100)%10;
    if(a==7 || b==7 || c==7)
        printf("Yes");
    else
        printf("No");
    return 0;
}


Measured memory_bytes: 1728
/*------------------------------------
........Bismillahir Rahmanir Rahim....
..........created by Abdul Aziz.......
------------------------------------*/
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <unordered_map>
#include <queue>
#define   mod  998244353
#define   int  long long 
#define   ld   long double
#define   pb   push_back
#define   vi  vector<int> 
#define   dbg(x)  cerr << #x << " = " << x << '\n'
#define   sz(x)  (int)x.size()
#define   all(a) (a.begin(),a.end())
#define   ff   first
#define   ss   second
#define   pii  pair<int,int> 
#define   lcm(a,b) (a*b)/__gcd(a,b) 
using namespace std;

inline void solve(){
    map <int,int> in;
    int n,m,ans=0; cin>>n>>m;
    int a[m],dis[m-1];
    for (int i=0;i<m;i++) cin>>a[i];
    sort(a,a+m); 
    for (int i=1;i<m;i++) 
        in[(a[i]-a[i-1])]++; 
    ans = a[m-1]-a[0]; 
    n--;
    for (auto it=in.rbegin();it != in.rend();it++){
        if (it->ss >= n) {
            ans -= it->ff*n;
            break;
        }
        else {
            ans -= it->ss*it->ff;
            n -= it->ss;
        }
    }
    cout << ans << endl;
}

signed main()
{
    int n=1; // cin>>n;
    while (n--) solve();
    return 0;
}


Measured memory_bytes: 4200
/*
 *
 *   Author     : Amit Kumar
 *   Date    	: June 26, 2019
 * 
 */

#include <bits/stdc++.h>

//#define FAST_INPUT_OUTPUT
//#define MORE_THAN_ONE_TESTCASE // COMMENT IT

#define vi vector<int>
#define vl vector<long long>
#define mii map<int , int>
#define mll map<long long , long long>
#define msi map<string , i>
#define msl map<string , long long>
#define umii unordered_map<int,int>
#define umll unordered_map<long long ,long long>
#define umsi unordered_map<string , int>
#define umsl map<string , long long> 
#define si set<int>
#define sl set<long long>
#define pii pair<int , int >
#define psi pair<string,int>
#define psl pair<string , long > 
#define pll pair<long long , long long>
#define vpii vector<pii>
#define vpll vector<pll>
#define vpsi vector<psi>
#define vpsl vector<psl>
#define pqi priority_queue<int>
#define pql priority_queue<long long>
#define ub upper_bound
#define lb lower_bound
#define bint long long int
#define ff first
#define ss second
#define all(x) x.begin(),x.end()
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define iv(v) for(auto &i:v){cin>>i;}
#define ov(v) for(auto i:v){cout<<i<<" ";}cout<<endl;
#define ovn(v) for(auto i:v){cout<<i<<endl;}
#define euv(v) for(auto i:v){cerr<<i<<" ";}cerr<<endl;
#define eovn(v) for(auto i:v){cerr<<i<<endl;}
#define os(s) for(auto itr:s){cout<<itr<<" ";}cout<<endl;
#define osn(s) for(auto itr:s){cout<<itr<<endl;}
#define eos(s) for(auto itr:s){cerr<<itr<<" ";}cerr<<endl;
#define eosn(s) for(auto itr:s){cerr<<itr<<endl;}
#define rep(x) for(auto i=0 ; i<(x); ++i)
#define _rep(a,b) for(auto i=(a); i<(b); ++i)
#define endl '\n'
using namespace std;




auto SOLUTION_FUNCTION( void ) ->void {

    // your solution goes here 
    int n , k;
    cin>>n>>k;

    int lim = ((n-2) * (n-1)) /2;
    if( k > lim){
        puts("-1");
        return;
    }
    
    int ans = n-1 + lim - k;
    cout<<ans<<endl;
    for(int i=2; i<=n; ++i)
        cout<<"1 "<<i<<endl;

    ans-= (n-1);

    int i=1; 
    while(ans>0){
        ++i;
        for(int j=i+1; j<=n && ans ; ++j){
            cout<<i<<" "<<j<<endl;
            --ans;
        }
    }

    return ;
}




int main(void){
#ifdef FAST_INPUT_OUTPUT
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cout<<setprecision(10);
    cout<<fixed;
    cout<<boolalpha;
#endif
#ifdef MY_LOCAL_PROJECT
    freopen("ein","r",stdin);
    freopen("eout","w",stdout);
#endif
    int testcase = 1;


#ifdef MORE_THAN_ONE_TESTCASE
    cin>>testcase;
#endif
    
    while(testcase--){
        SOLUTION_FUNCTION();
    }

#ifdef MY_LOCAL_PROJECT
    cout<<"Time : "<<1.0*(double)clock()/CLOCKS_PER_SEC<<endl;
#endif
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>    
//#include <ext/pb_ds/assoc_container.hpp> 
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//using namespace __gnu_pbds; 
#define fastio() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb  push_back
#define show(x) cout<<(#x)<<" : "<<x<<endl;
#define ll  long long
#define ld  long double
#define fill(a,val) memset(a,val,sizeof(a))
#define mp  make_pair
#define ff  first
#define ss  second
#define pii pair<ll,ll>
#define sq(x) ((x)*(x))
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define endl "\n"
#define int long long 
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
const ll MOD     = 1000*1000*1000+7;
const ll INF     = 1ll*1000*1000*1000*1000*1000*1000 + 7;
const ll MOD2    = 998244353;
const ll N       = 1000 * 100 + 10;
const ll N2      = 70;
const ld PI  = 3.141592653589793;
//template<class T> using oset=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
ll gcd(ll a, ll b){if(!b)return a;return gcd(b, a % b);} 
ll power(ll x,ll y,ll p = LLONG_MAX ){ll res=1;x%=p;while(y>0){if(y&1)res=(res*x)%p;y=y>>1;x=(x*x)%p;}return res;}
ll lcm(ll a , ll b){return (a*b)/gcd(a,b);}

signed main()
{
    fastio();
    //cout<<fixed<<setprecision(20);
    //CHECK for LONG LONG and LONG DOUBLE
    /*comment for all except cc/cf    
    #ifndef ONLINE_JUDGE    
           freopen("input.txt","r",stdin);
           freopen("output.txt","w",stdout);
    #endif//*/
    int s,w;
    cin>>s>>w;
    cout<<((w >= s) ? "unsafe" : "safe");

    printclock;
    return 0;
}


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

#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using P = pair<int, int>;

const ll LINF = 1001002003004005006LL;
const int INF = 1001001001;

const int mod = 1000000007;

int main() {
    int n; cin >> n;
    string s; cin >> s;
    vector<int> v(n);
    vector<ll> cnt(3);
    rep(i,n) {
        if (s[i]=='R') v[i]=0;
        if (s[i]=='G') v[i]=1;
        if (s[i]=='B') v[i]=2;
    }
    rep(i,n) ++cnt[v[i]];
    ll ans = cnt[0]*cnt[1]*cnt[2];
    rep(j,n) {
        rep(i,j) {
            int k = j+(j-i);
            if (k<n) {
                if (v[i]==v[j]) continue;           
                if (v[k]==v[j]) continue;           
                if (v[i]==v[k]) continue;    
                --ans;       
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3632
#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 FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll mod2 = 998244353;
const int INF = 1000000005;

int main() {
  int a, b;
  cin >> a >> b;
  cout << max(0, a - 2 * b) << endl;

  
  return 0;
}

Measured memory_bytes: 256