akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
#include<math.h>
int main()
{
    int x,a,b,distance1, distance2;
    scanf("%d %d %d",&x,&a,&b);
    if(x>=1 && x<=1000)
    {
        if(a>=1 && a<=1000)
        {
            if(b>=1 && b<=1000)
            {
                distance1=abs(x-a);
                distance2=abs(x-b);
                if(distance1<distance2)
                {
                    printf("A");
                }
                else printf("B");
            }
        }
    }
}


Measured memory_bytes: 128
//Nihal Mittal - nihal_47
//Strike First , Strike Hard , No Mercy !!

/**⠀⠀⠀⠀⠀⠀⣀⣤⣤⣄⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⣰⣿⣿⣿⣿⠿⠿⣿⣿⣿⣿⣿⣿⣿⣧⢀⠀⠀⠀⠀
⠀⠀⠀⣿⣿⣿⠋⠀⠀⠀⠀⠀⠙⠀⠙⣿⣿⣿⣷⢳⢀⠀⠀⠀
⠀⠀⣠⣿⣿⣿⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⢀
⠀⠀⣸⣿⣿⣿⠸⠀⠀⠀⠒⠒⠒⠐⠀⠀⢿⣿⣿⣿⣿⣿⠀⠀
⠀⣴⣿⣿⣿⡿⠀⠒⣋⣙⡒⢰⠀⠤⣖⠒⢾⣿⣿⣿⣿⣧⠀⠀
⢺⣿⣿⣿⣿⢀⠀⠀⠉⠉⠉⠸⠀⡇⠉⠉⠀⢿⣿⣿⣿⣄⠀⠀
⠀⠙⣿⣿⣧⢻⠀⠀⠀⠀⠀⠠⠀⠰⠀⠀⠀⣸⠸⣿⣿⠿⠰⠀
⠀⠀⠀⠹⣿⣿⣿⣷⠀⡠⠙⣲⣔⣅⢡⣰⣷⣿⣿⣿⣧⠀⠀⠀
⠀⠀⠀⣼⣿⣿⣿⣿⠀⡿⠭⠭⠭⠭⢿⠀⣿⢻⣿⣿⠃⠀⠀⠀
⠀⠀⠀⠙⠛⣿⢻⠹⣿⠐⠙⠛⠟⠉⢀⣴⡟⢿⣿⡏⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⡟⠀⠀⠻⣦⣤⣶⠾⠋⠀⠀⠁⡦⢄⢀⠀⠀⠀
⠀⠀⠀⠀⡠⠁⡇⠑⢄⠀⠀⠀⠀⠀⠀⠔⠀⠀⠁⠀⠀⠀⠉⠁
⠀⠔⠊⠁⠀⠀⣇⠀⠀⠀⠑⡤⠤⢎⠁⠀⠀⡘⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢢⠠⠀⡠⢆⠀⠀⡠⠙⢄⠀⡸⠀
**/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define l long
#define mk make_pair
#define pb push_back
#define in insert
#define se second
#define fi first
#define mod 1000000007
#define watch(x) cout << (#x) << " is " << (x) << "\n"
#define all(v) (v).begin(),(v).end()
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(0);
#define pii pair<int,int>
#define maxn 100005
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 
using namespace std;
using namespace __gnu_pbds;

signed main()
{
    fast;
    
    ll n,k,s,ele,i;
    cin>>n>>k>>s;
    if((n-k)<=s) ele = 1;
    else ele = n-k;
    for(i=1;i<=k;i++)
    {
    	cout<<s<<" ";
    }
    for(i=1;i<=(n-k);i++) cout<<ele<<" ";
}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
#define fol(i,n) for(int i=0;i<n;i++)
#define pb push_back
typedef long long ll;
typedef pair<int,int> P;
typedef vector<P> vip;

int main(){
    int n;cin>>n;
    int a[2][n];
    fol(i,2){
        fol(j,n) cin>>a[i][j];
    }
    a[1][0]+=a[0][0];
    for(int i=1;i<n;++i){
        a[0][i]+=a[0][i-1];
    }
    for(int i=1;i<n;++i){
        a[1][i]+=max(a[0][i],a[1][i-1]);
    }
    cout << a[1][n-1]<<endl;
    return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class Main  implements Runnable {

    public static void main(String[] args) {

        new Thread(null, new Main(), "", 16 * 1024 * 1024).start();

    }

    public void run() {
    	FastScanner sc = new FastScanner(System.in);
		//long n = Long.parseLong(sc.next());
    	//int[] ar = new int[3];
    	//ar[0]=Integer.parseInt(sc.next());
    	//ar[1]=Integer.parseInt(sc.next());
    	//ar[2]=Integer.parseInt(sc.next());
    	//Arrays.parallelSort(ar);
		//int n = Integer.parseInt(sc.next());
		//long k = Long.parseLong(sc.next());
		//int k = Integer.parseInt(sc.next());
		//String s = sc.next();
		//int k = Integer.parseInt(sc.next());
		//int m = Integer.parseInt(sc.next());
		//int x2000 = Integer.parseInt(sc.next());
		//int t = Integer.parseInt(sc.next());
		//int k = 0;
		//int k = Integer.parseInt(sc.next());
		String str = sc.next();
		char c[] = str.toCharArray();
		//char a[][] = new char[n];
		//int atmp[] = new int[h];
		//int max= 0;
		//int blackar[][] = new int[h*w][2];
		//int p=0;
		//ArrayList<Integer> lists = new ArrayList<Integer>();
		//lists = new ArrayList;
		PrintWriter out = new PrintWriter(System.out);
		int ans = 0;
		char prec = 'a';
		for(int i = 0; i < c.length; i++)
		{
			if(prec == c[i])
			{
				ans++;
			}
			prec = c[i];
		}
		if(ans==0)
		{
			out.println("Good");
		}
		else
		{
			out.println("Bad");
		}


		out.flush();
	}

    static class FastScanner {
        private BufferedReader reader = null;
        private StringTokenizer tokenizer = null;
        public FastScanner(String in) {
        	StringReader sr = new StringReader(in);
            reader = new BufferedReader(new BufferedReader(sr));
            tokenizer = null;
        }
        public FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }

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

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

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

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

        public long nextInt() {
            return Integer.parseInt(next());
        }

    }

}

Measured memory_bytes: 21332
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    string a;
    cin >> a;
    for(int i = 0;i < 5;i++){
        cout << a.at(i);
    }
    cout << " " ;
    for(int j = 6;j < 13;j++){
        cout << a.at(j);
    }
    cout << " " ;
    for(int k = 14;k < 19;k++){
        cout << a.at(k);
    }
    cout << endl;
}

Measured memory_bytes: 256
#pragma region include
#include <stdio.h>
#include <string>
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <map>
#include <set>
#pragma endregion
using namespace std;

#pragma region 定数
#define INF_VAL (2147483647 - 1)
#define INF_VAL_MINUS -INFVAL
#pragma endregion

#pragma region マクロ
// 配列の長さを取得する(ただし関数内ではポインタサイズに注意)
#define SIZE_OF_ARRAY(array) sizeof(array) / sizeof(*array)

// for文
#define forn(i, size) for (long long(i) = 0; (i) < (size); (i)++)
#define for0(size) for (long(i) = 0; (i) < (size); (i)++)

// ソート
#define Sort(array, length) sort(array, array + length)
#define SortDESC(array, length) sort(array, array + length, greater<>())

// 配列の最大値、最小値取得
#define MAX_OF_ARRAY(array, length) *max_element(array, array + length)
#define MIN_OF_ARRAY(array, length) *min_element(array, array + length)

// 結果出力系
#define YES                    \
    {                          \
        cout << "YES" << endl; \
        return 0;              \
    }
#define NO                    \
    {                         \
        cout << "NO" << endl; \
        return 0;             \
    }
#define Yes                    \
    {                          \
        cout << "Yes" << endl; \
        return 0;              \
    }
#define No                    \
    {                         \
        cout << "No" << endl; \
        return 0;             \
    }
#pragma endregion

#pragma region Utility
#pragma region 配列要素の合計値を取得
template <typename T>
T getSum(T array[], int length)
{
    T sum = 0;
    for (int i = 0; i < length; i++)
    {
        sum += array[i];
    }
    return sum;
}
#pragma endregion

#pragma region ToString(int)
string ToString(int i)
{
    char buffer[1000];
    sprintf(buffer, "%d", i);
    return string(buffer);
}
#pragma endregion

#pragma region 10進数からN進数(<= 10) へ変換
string convertToN(long n, int base)
{
    string ans = "";
    while (n != 0)
    {
        int temp = n % base; // 1桁取得
        ans = ToString(temp) + ans;
        n /= base;
    }
    return ans;
}
#pragma endregion
#pragma endregion

int main()
{
    // 標準入力から値を取得
    string S;
    cin >> S;

    string ans = "";
    for0(S.size())
    {
        ans += "x";
    }

    // 結果出力
    printf("%s\n", ans.c_str());
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int gcd(int x,int y){
    if(x>y)swap(x,y);
    for(int i=x; i >= 1; i--){
        if(i == 1)return 1;
        else if( x % i  == 0 && y % i == 0)return i;
        //最大公約数、lcm = x*y/gcd 僕のVSCではgcd関数が使えませんでした(泣)だれか教えてください。
    }
}
typedef long long ll;

int main(){ 
    int n,k,q;
    cin >> n >> k>>q;
    vector<int>a(q);
    for(int i=0;i<q;i++)cin >> a[i];
    vector<int>man(n);
    for(int i=0;i<q;i++)a[i]--;
    for(int i=0;i<n;i++)man[i] = k;
    for(int i=0;i<q;i++){
        man[a.at(i)] +=1;
    }
    for(int i=0;i<n;i++){
        man[i] -= q;
        if(man[i] <= 0)cout<<"No"<<endl;
        else cout << "Yes" << endl;
    }
    
}

Measured memory_bytes: 1408
#![allow(unused_imports)]
use proconio::{input, fastout};
use proconio::marker::*;

#[fastout]
fn main() {
    input! {
    mut n: i64,
    }
    if n == 0 {
        print!("0");
        return
    }
    let mut d = vec![];
    while n != 0 {
        d.push(n % -2);
        n /= -2
    }
    for i in 0..d.len() {
        if d[i] == -1 {
            d[i] = 1;
            inc(&mut d, i + 1);
        }
    }
    for i in (0..d.len()).rev() {
        print!("{}", d[i]);
    }
}

fn inc(d: &mut Vec<i64>, t: usize) {
    if d.len() <= t {
        d.push(1);
        return
    }
    if d[t] < 1 {
        d[t] += 1;
        return
    } else {
        d[t] = 0;
        inc(d, t + 1);
        inc(d, t + 2);
    }
}



Measured memory_bytes: 2120
#include <iostream>
#include <cassert>
#include <climits>
#include <bitset>
#include <stack>
#include <queue>
#include <iomanip>
#include <limits>
#include <string>
#include <cmath>
#include <set>
#include <map>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string.h>
#include <tuple>

using namespace std;

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

long long int INF = 3e18;
double Pi = 3.1415926535897932384626;

vector<ll> G[500005];
vector<P> tree[500010];
priority_queue <ll> pql;
priority_queue <P> pqp;
//big priority queue
priority_queue <ll,vector<ll>,greater<ll> > pqls;
priority_queue <P,vector<P>,greater<P> > pqps;
//small priority queue
//top pop

int dx[8]={1,0,-1,0,1,1,-1,-1};
int dy[8]={0,1,0,-1,1,-1,-1,1};
char dir[] = "DRUL";
//ll bit[500005];
//↓,→,↑,←


#define p(x) cout<<x<<endl;
#define el cout<<endl;
#define pe(x) cout<<(x)<<" ";
#define ps(x) cout<<fixed<<setprecision(25)<<x<<endl;
#define pu(x) cout<<(x);
#define pd(x) cerr<<"//"<<(x)<<endl;
#define re(i,n) for(i=0;i<n;i++);
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define deba(x) cout<< #x << " = " << x <<endl


ll mod = 1000000007;
ll rui(ll number1,ll number2){
    if(number2 == 0){
        return 1;
    }else{
        ll number3 = rui(number1,number2 / 2);
        number3 *= number3;
        number3 %= mod;
        if(number2%2==1){
            number3 *= number1;
            number3 %= mod;
        }
        return number3;
    }
}
ll gcd(ll number1,ll number2){
    if(number1 > number2){
        swap(number1,number2);
    }
    if(number1 == 0 || number1 == number2){
        return number2;
    }else{
        return gcd(number2 % number1,number1);
    }
}
void YES(bool condition){
    if(condition){
        p("YES");
    }else{
        p("NO");
    }
    return;
}
void Yes(bool condition){
    if(condition){
        p("Yes");
    }else{
        p("No");
    }
    return;
}

ll n,m,num,sum,ans,a,b,c,d,e,f,g,h,i,j,k,w,ok,ng,l,q;
ll x[500005],y[500005],z[500005];
char s[500005],t[500005];
bool flag,dame;


int main(){
    cin >> n;
	for(i=1;i<=n;i++){
		cin >> x[i];
	}
	z[0] = 1;
	for(i=1;i<=n;i++){
		if(x[i] == x[i-1]){
			z[i] = z[i-1];
		}else if(y[x[i]] == 0){
			z[i] = z[i-1];
		}else{
			z[i] = z[i-1] + z[y[x[i]]];
		}
		y[x[i]] = i;
		z[i] %= mod;
		//p(z[i]);
	}
	p(z[n]);

	return 0;
}

Measured memory_bytes: 35456
//#include <bits/stdc++.h>
#include <iostream>
#include <map>
#include <cmath>
#include <ios>
#include <iomanip>
#include <algorithm>
#include <queue>
#include <numeric>
//#include <windows.h>
using namespace std;
template<class T> using V = vector<T>;
template<class T> using VV = V<V<T>>;
template<class T> using VVV = V<VV<T>>;
template<class T> using G = greater<T>;
template<class T1, class T2> using P = pair<T1, T2>;
using I = int;
using D = double;
using B = bool;
using C = char;
using S = string;
using LL = long long;
using LD = long double;
using ULL = unsigned long long;
using PII = P<I, I>;
using VPII = V<PII>;
using PLL = P<LL, LL>;
using VPLL = V<PLL>;
using VI = V<I>;
using VVI = VV<I>;
using VLL = V<LL>;
using VVLL = VV<LL>;
using VC = V<C>;
using VVC = VV<C>;
using VS = V<S>;
using VVS = VV<S>;
using VB = V<B>;
using VVB = VV<B>;
#define REP(type, i, n) for (type i = 0; i < (type)(n); ++i)
#define REP2(type, i, m, n) for (type i = (m); i < (type)(n); ++i)
#define REPR(type, i, n) for (type i = (n)-1; i >= 0; --i)
#define REPR2(type, i, m, n) for (type i = (n)-1; i >= (m); --i)
#define REPx(x, a) for(auto x : a)
#define ALL(a) a.begin(), a.end()
#define SORT(a) sort(ALL(a))
#define SORTR(a, type) sort(ALL(a), G<type>())
#define REVERSE(a) reverse(ALL(a))
#define SIZE(a) ((int)(a).size())
#define bit_search(bit, n) REP(LL, bit, 1LL<<(n))
#define bit_check(bit, i) ((bit>>(i)) & 1)
#define setpre(n) fixed << setprecision((n))
#define UNIQUE(a) do {SORT(a); (a).erase(unique(ALL(a)), (a).end());} while(0)
#define MAX(a) *max_element(ALL(a))
#define MIN(a) *min_element(ALL(a))
#define bisect_left(a, x) lower_bound(ALL(a), (x)) - a.begin()
#define bisect_right(a, x) upper_bound(ALL(a), (x)) - a.begin()
#define INPUT(a) REPx(&x, a) cin >> x;
#define INPUTP(a) REPx(&x, a) cin >> x.first >> x.second;
#define OUTPUT_PERMUTATION(n) do{VI v(n); iota(ALL(v), 1); do{REPx(x, v) cout << x << " "; ENDL} while(next_permutation(ALL(v)));} while(0);
#define MAKE_PERMUTATION(n, PER) do{VVI a(fact(n), VI(n)); int idx = 0; VI v(n); iota(ALL(v), 1); do{REP(roop, n) a[idx][roop] = v[roop]; idx++;} while(next_permutation(ALL(v))); PER = a;} while(0); // int fact(), VVI PERを宣言しておく、n=10が限界(500 ms)
#define ENDL cout << endl;

template<class T> using PRIORITY_QUEUE = priority_queue< T, V<T>, G<T> >;

template<class T> inline bool chmin(T &a, T b){if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T &a, T b){if (a < b) {a = b; return true;} return false;}

const int INF = 2e9;
const LL MOD = 1e9 + 7;

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  VI h(N);
  INPUT(h);
  VI dp(N, INF);
  dp[0] = 0;
  REP2(int, i, 1, N)
  {
    chmin(dp[i], dp[i-1]+abs(h[i]-h[i-1]));
    if (i-2 >= 0) chmin(dp[i], dp[i-2]+abs(h[i]-h[i-2]));
  }
  cout << dp[N-1] << endl;

  return 0;
}

Measured memory_bytes: 1024
#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<algorithm>
#include<iostream>
#include<cstring>
#include<fstream>
#include<bitset>
#include<cstdio>
#include<string>
#include<vector>
#include<cmath>
#include<queue>
#include<stack>
#include<map>
#include<set>
#define INF 0X3F3F3F3F
#define N 100005
#define M 200005
#define LL long long
#define ULL unsigned long long
#define FF(i, a, b) for(int i = a; i <= b; ++i)
#define RR(i, a, b) for(int i = a; i >= b; --i)
#define FJ(i, a, b) for(int i = a; i < b; ++i)
#define SC(x) scanf("%d", &x)
#define SCC(x, y) scanf("%d%d", &x, &y)
#define SCCC(x, y, z) scanf("%d%d%d", &x, &y, &z)
#define SS(x) scanf("%s", x)
#define PR(x) printf("%d\n", x)
#define CL(a, x) memset(a, x, sizeof(a))
#define _P fd[rt]
#define _L fd[rt << 1]
#define _R fd[rt << 1 | 1]
#define MID int mid = ((l + r) >> 1)
#define lson rt<<1 ,l, mid
#define rson rt<<1 | 1, mid + 1, r
#define VI vector<int>
#define db double
#define PII pair<int, int>
#define PLL pair<unsigned long long, unsigned long long>
#define MP make_pair
#define PB push_back
#define IN freopen("in.txt", "r", stdin)
#define OUT freopen("out.txt", "w", stdout)
using namespace std;
inline void II(int &n){char ch = getchar(); n = 0; bool t = 0;
for(; ch < '0'; ch = getchar()) if(ch == '-') t = 1;
for(; ch >= '0'; n = n * 10 + ch - '0', ch = getchar()); if(t) n =- n;}
inline void OO(int a){if(a < 0) {putchar('-'); a = -a;}
if(a >= 10) OO(a / 10); putchar(a % 10 + '0');}
const double EPS = 1e-8;
int sgn(double x){return (x > EPS) - (x < -EPS);}
int n;
int f[4][N], a[4][N];
int main(){
    //IN;
    SC(n);
    FF(i, 1, n) SC(a[1][i]);
    FF(i, 1, n) SC(a[2][i]);
    f[1][1] = a[1][1];
    f[2][1] = a[1][1] + a[2][1];
    FF(i, 1, n){
        f[1][i] = f[1][i - 1] + a[1][i];
        f[2][i] = max(f[2][i - 1], f[1][i]) + a[2][i];
    }
    printf("%d\n", f[2][n]);
    return 0;
}


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

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  if (A + B > C + D) cout << "Left" << endl;
  else if (A+B == C+D) cout << "Balanced" << endl;
  else cout << "Right" << endl;
}


Measured memory_bytes: 256
(defun solver ()
  (let* ((n (read)) (d (make-array n :fill-pointer 0)) (count 1))
    (loop repeat n do
          (vector-push (read) d))
    (sort d #'<)
    (loop for i from 0 to (- n 2) do
          (when (< (aref d i) (aref d (1+ i)))
            (incf count)))
    (format t "~a~%" count)))

(solver)

Measured memory_bytes: 16740
#include "bits/stdc++.h"
using namespace std;
#define FAST ios_base::sync_with_stdio(false); cin.tie(0);
#define LLINF (long long) 1e18//1234567890987654321
#define INF 1234567890
#define pb push_back
#define ins insert
#define f first
#define s second	
#define db 0
#define EPS (1e-7)    //0.0000001 the value
#define PI (acos(-1))
#define MAXN 300006
#define MAXK 26
#define MAXX 15000006
#define ll long long int
#define ld long double
#define rep0(kk, l1, l2)for(ll kk = l1; kk < l2; kk++)
#define rep1(kk, l1, l2)for(ll kk = l1; kk <= l2; kk++)
#define foritr(itr, A) for(set<ll>::iterator itr = A.begin(); itr != A.end(); itr++)
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());    //can be used by calling rng() or shuffle(A, A+n, rng)
#define FOR(ii, ss, ee) for(ll ii = ss; ii < ee; ii++)
#define cr(x) cerr << #x << " = " << x << "\n";
#define crA(x, A) cerr << #x << " = " << A[x] << "\n";
#define spacing if(db)cout << " ";
#define mmst(x, v) memset((x), v, sizeof ((x)));
#define bg(ms) (*ms.begin())
#define ed(ms) (*prev(ms.end(), 1))
#define addedge(a, b, c, v) v[(a)].pb(pi((b), (c))); v[(b)].pb(pi((a), (c)))
#define ph push
#define btinpct(x) __builtin_popcountll(x)
#define p2(x) (1LL<<(x))
#define all(x) (x).begin(), (x).end()
#define lbd(x, y) lower_bound(all(x), y)
#define ubd(x, y) upper_bound(all(x), y)
typedef pair <ll, ll> pi;
typedef pair <ll, pi> spi;
typedef pair <pi, pi> dpi;
inline ll rand(ll x, ll y) { ++y; return (rng() % (y-x)) + x; } //inclusivesss
string A;
bool can = 0;
ll n;
bool solve(ll x, ll y)
{
	assert(x <= y); string s="";
	FOR(i,0,n)
	{
		if(i >= x && i <= y) continue;
		s += A[i];
	}
	return s == "keyence";
}
int main()
{
	cin >> A;
	n = A.length();
  can = solve(-1,-1);
	FOR(i,0,n)
	{
		FOR(j,i,n)
		{
			can = can or solve(i, j);
		}
	}
	cout << (can ? "YES\n" : "NO\n") << '\n';
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define dump(x) cout << x << endl
typedef int64_t Int;

using namespace std;
using Graph = vector<vector<Int>>;

const double pi = M_PI;
const Int MOD = 1000000007;

int main() {
    int N, M;
    cin >> N >> M;

    vector<pair<int, string>> ps;
    vector<bool> is_ACed(N, false), will_be_AC(N, false);
    for (int i = 0; i < M; i++) {
        int p;
        string s;
        cin >> p >> s;
        ps.push_back({p, s});
        if (s == "AC") {
            will_be_AC[p] = true;
        }
    }

    int AC = 0, WA = 0;

    for (int i = 0; i < M; i++) {
        if (!is_ACed[ps[i].first]) {
            if (ps[i].second == "AC") {
                AC++;
                is_ACed[ps[i].first] = true;
            } else {
                if (will_be_AC[ps[i].first]) {
                    WA++;
                }
            }
        }
    }

    cout << AC << ' ' << WA << endl;

    return 0;
}

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

typedef long long ll;
const int INF = 1e9;
const ll LINF = 1e18;
const int mod = 1e9+7;

#define pi pair<int,int>
#define pl pair<lld,lld>

#define dump(x) cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define SANKOU(n,a,b) cout << ((n) ? (#a) : (#b) ) << endl

#define mem0(x) memset(x,0,sizeof(x))
#define fillnum(x,n) fill(begin(x),end(x),n)
#define asort(x) sort(x.begin(),x.end())
#define dsort(x,t) sort(x.begin(),x.end(),greater<t>())
#define vuniq(x) x.erase(unique(x.begin(), x.end()), x.end())

#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)

int main() {
    ll M,D;
    cin >> M >> D;
    ll cnt = 0;
    for (ll i = 1; i <= M; i++) {
        for (ll j = 1; j <= D; j++) {
            ll d1 = j%10;
            ll d10 = j/10;
            if(d1 >= 2 && d10 >= 2 && d1 * d10 == i){
                cnt++;
            }
        }
    }
    cout << cnt << endl;
}

Measured memory_bytes: 3588
#include<iostream>
using namespace std;
int main(){
	int n;
	while(true){
	cin>>n;
	if(n==0)break;
	int w,h,s,t;
	bool table[200][200]={{0},{0}};
	cin>>w>>h;
	for(int i=0;i<n;i++){
		int x,y;
		cin>>x>>y;
		table[y][x]=1;
	}
	cin>>s>>t;
	int ans=0,cnt=0;
	for(int i=1;i<=w-s+1;i++){
		for(int j=1;j<=h-t+1;j++){
			cnt=0;
			for(int ii=i;ii<i+s;ii++){
				for(int jj=j;jj<j+t;jj++){
				if(table[jj][ii]==1)cnt++;
				}
			}
		ans=max(ans,cnt);
		}
	}
	cout<<ans<<endl;
	}
	return 0;
}

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

// #define int long long
#define rep(i, n) for (long long i = (long long)(0); i < (long long)(n); ++i)
#define reps(i, n) for (long long i = (long long)(1); i <= (long long)(n); ++i)
#define rrep(i, n) for (long long i = ((long long)(n)-1); i >= 0; i--)
#define rreps(i, n) for (long long i = ((long long)(n)); i > 0; i--)
#define irep(i, m, n) for (long long i = (long long)(m); i < (long long)(n); ++i)
#define ireps(i, m, n) for (long long i = (long long)(m); i <= (long long)(n); ++i)
#define SORT(v, n) sort(v, v + n);
#define REVERSE(v, n) reverse(v, v+n);
#define vsort(v) sort(v.begin(), v.end());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) long long(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vs = vector<string>;
using vpll = vector<pair<ll, ll>>;
using vtp = vector<tuple<ll,ll,ll>>;
using vb = vector<bool>;

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

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

ll n,m;
ll h[100100];
vll G[100100];

signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  cin>>n>>m;
  rep(i,n) cin>>h[i];
  
  rep(i,m){
    ll a,b; cin>>a>>b; a--,b--;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  
  vb ok(n,true);
  vb visited(n);
  ll ans=0;
  
  rep(ki,n){
    visited[ki]=true;
    queue<ll> q;
    q.emplace(ki);
    while(!q.empty()){
      ll v=q.front(); q.pop();
      for(auto nv: G[v]){
        if(visited[nv]) continue;
        if(h[v]<h[nv]){
          ok[v]=false;
        }else if(h[v]>h[nv]){
          ok[nv]=false;
        }else{
          ok[v]=ok[nv]=false;
        }
      }
    }
  }
  
  rep(i,n){
    if(ok[i]){
      ans++;
      // cout<<i<<endl;
    }
  }
  
  cout<<ans<<endl;
  
}

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


void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}

#define fo(i, n) for(int i=0; i<n; i++)
#define Fo(i, k, n) for(int i=k; i<n; i++)
#define w(x)  int x; cin>>x; while(x--)
#define watch(x) cout << (#x) << " is " << (x) << "\n"
#define watch2(x,y) cout <<(#x)<<" is "<<(x)<<" and "<<(#y)<<" is "<<(y)<<"\n"
#define watch3(x,y,z) cout <<(#x)<<" is "<<(x)<<" and "<<(#y)<<" is "<<(y)<<" and "<<(#z)<<" is "<<(z)<<"\n"
#define watch4(x,y,z,q) cout <<(#x)<<" is "<<(x)<<" and "<<(#y)<<" is "<<(y)<<" and "<<(#z)<<" is "<<(z)<<" and "<<(#q)<<" is "<<(q)<<"\n"
#define MOD 1000000007
#define INF 1000000007;
#define F first
#define S second
#define pb(x) push_back(x);


#define ll  long long
#define all(c) (c).begin(),(c).end()
#define endl "\n"

typedef vector<int> vl;
typedef vector< vl > vvl;
typedef pair< int, int> pll;
typedef map< int, int> mll;


#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif





void c_p_c()
{
#ifndef ONLINE_JUDGE
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}
void parray(int a[],int n){
    for(int i=0;i<n;i++){
    cout<<a[i]<<" ";
    }
    cout<<endl;
}

int main() {
    int i,n,m,c=0,k,sum=0;
    c_p_c();
    // cin>>n>>m;
 	cin>>n;
 	int a[n+1]={0};
 	Fo(i,1,n+1) cin>>a[i];
 	// parray(a,n+1);
// _element(a,a+n)-*min_element(a,a+n)<<endl;
 	int visisted[n+1]={0};
 	i=1;
 	while(1){
 		// cout<<a[i]<<endl;
 		// break;
 		if(visisted[i]==0){
 			visisted[i]=1;
 			if(i==2){
 				cout<<c<<endl;
 				break;
 			}
 			i=a[i];
 			c++;
 			



 		}else{
 			cout<<-1<<endl;
 			break;
 		}
 	}



 
  	
 	return 0;

   }

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

int main(void){
    int a = 0, b = 0, c = 0, x = 0; 
    int ans = 0;

    scanf("%d%d%d%d", &a, &b, &c, &x);

    for(int i = 0; i <= a; i++){
        for(int j = 0; j <= b; j++){
            for(int k = 0; k <= c; k++){
                if(x == i * 500 + j * 100 + k * 50){
                    ans++;
                }
            }
        }
    }
    printf("%d\n", ans);

    return 0;

} 


Measured memory_bytes: 256
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
typedef long long int ll;

using namespace std;

bool rangeCheck(int num){
	if(num >= 0 && num <= 20)return true;
	else{
		return false;
	}
}

int main(){

	int N;
	scanf("%d",&N);

	ll table[N][21];

	for(int i = 0; i < N; i++){
		for(int k = 0; k < 21; k++)table[i][k] = 0;
	}

	ll number[N];
	for(int i = 0; i < N; i++)scanf("%lld",&number[i]);

	table[0][number[0]] = 1;

	for(int i = 1; i < N-1; i++){
		for(int k = 0; k <= 20; k++){
			if(rangeCheck(k-number[i]) == true)table[i][k] += table[i-1][k-number[i]];
			if(rangeCheck(k+number[i]) == true)table[i][k] += table[i-1][k+number[i]];
		}
	}

	printf("%lld\n",table[N-2][number[N-1]]);

    return 0;
}

Measured memory_bytes: 2760
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef string str;
using P = pair<int, int>;
const ll inf =1e9;
const ll mod = 1e9+7;

struct edge{
    int to;
    int cost;
};
using graph = vector<vector<edge>>;

int main(){
    int n; cin >> n;
    vector<ll> a(n);
    for(int i=0; i<n; i++){
        cin >> a[i];
    }
    sort(a.begin(), a.end());
    bool same = false;
    for(int i=0; i<n-1; i++){
        if(a[i] == a[i+1]){
            same = true;
            break;
        }
    }
    if(same){
        cout << "NO" << endl;
    }else{
        cout << "YES" << endl;
    }
}

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

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef vector<pdd> vdd;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define mem(a,b) memset(a, b, sizeof(a) )
#define all(x) (x).begin(),(x).end()
#define INF 1000000000000
#define MOD 1000000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

inline void normal(ll &a) { a %= MOD; (a < 0) && (a += MOD); }
inline ll modMul(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a*b)%MOD; }
inline ll modAdd(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a+b)%MOD; }
inline ll modSub(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; }
inline ll modInverse(ll a) { return modPow(a, MOD-2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }

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

int main(){
    int x,a,b;cin>>x>>a>>b;
    x-=a;
    cout<<x%b<<endl;
}

Measured memory_bytes: 3572
#include <stdio.h>

int main(){

  int S[10000],T[10000];

  int i,N1,N2,Q,l,k;

  scanf("%d",&N1);

  for(i=0;i<N1;i++){
    scanf("%d",&S[i]);
  }

  scanf("%d",&N2);

  for(i=0;i<N2;i++){
    scanf("%d",&T[i]);
  }

  int count=0;

  
  for(l=0;l<N2;l++){
    for(k=0;k<N1;k++){
      
      if(S[k]==T[l]){
	count++;
	break;
      }
    }
  }

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

    return 0;

  }



Measured memory_bytes: 2108
#include <stdio.h>
#include <stdlib.h>

struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};
typedef struct node * Node;
#define NIL NULL

Node root;

Node treeMinimum(Node x){
  while(x->left != NIL) x = x->left;
  return x;
}

Node treeMaximum(Node x){
  while(x->right != NIL) x=x->right;
  return x;
}

Node treeSearch(Node u, int k) {
  if(u == NIL || k== u->key) return u;
  if(k < u->key ) return treeSearch(u->left,k);
  else return treeSearch((u->right), k);
}

Node treeSuccessor(Node x){
  Node y;
  if(x->right != NIL) return treeMinimum(x->right); //case 1

  y=x->parent;
  while (y != NIL && x == y->right) {
    x = y;
    y = y->parent;
  }
  return y; //case2
}

void treeDelete(Node z){
  Node y; // node to be deleted
  Node x; // child of y

  if(z->left == NIL || z->right == NIL) y=z;
  else y=treeSuccessor(z);

  if(y->left != NIL) x=y->left;
  else x=y->right;

  if(x != NIL) x->parent = y->parent;
  if(y->parent == NIL)
    root = x;
  else if(y == y->parent->left)
    y->parent->left = x;
  else y->parent->right = x;

  if(y != z) z->key = y->key;
}

void insert(int k) {
  Node y = NIL;
  Node x = root;
  Node z;

  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;
  while(x!=NIL) {
    y=x;
    if(z->key < x->key) x=x->left;
    else x= x->right;
    z->parent = y;
  }
    
    if(y==NIL) root = z;
    else if(z->key<y->key) y->left = z;
    else y->right = z;
  
}

void inorder(Node u,int n){
  //static int count=0;
  if(u != NIL) {
    inorder(u->left,n);
    //if(count < n) {
      printf(" %d",u->key);
      //count++;
      //} else printf("%d",u->key);
    inorder(u->right,n);
  }
}

void preorder(Node u,int n) {
  //static int count=0;
  if(u==NIL) {
    return ;
  }
  //if(count < n) {
    printf(" %d",u->key);
    //count++;
    //} else printf("%d",u->key);
  preorder(u->left,n);
  preorder(u->right,n);
}

int main(){
  int n, i, x;
  char com[20];
  scanf("%d", &n);

  for ( i = 0; i < n; i++ ){
    scanf("%s", com);
    
    if ( com[0] == 'f' ){
      scanf("%d", &x);
      Node t = treeSearch(root, x);
      if ( t != NIL ) printf("yes\n");
      else printf("no\n");
      
    } else if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
      
    } else if ( com[0] == 'p' ){
      inorder(root,n);
      printf("\n");
      preorder(root,n);
      printf("\n");
      
    } else if ( com[0] == 'd' ){
      scanf("%d", &x);
      treeDelete(treeSearch(root, x));
    }
  }

  return 0;
}



Measured memory_bytes: 20432
#include<bits/stdc++.h>
using namespace std;
string s;
int ans;
bool check(string S){
	int V=S.size();
	int Q=V/2;
	if(V%2==1) return 0;
	bool ok=1;
	for(int i=0;i<Q;i++)
		if(S[i]!=S[Q+i])
			ok=0;
	return ok;
} 
int main(){
	cin>>s;
	int n=s.size();
	for(int i=1;i<n-1;i++){
		string S;
		S="";
		for(int j=0;j<i;j++) S+=s[j];
		if(check(S)) ans=i;
	}
	printf("%d",ans);
}

Measured memory_bytes: 256
#!/usr/bin/perl
#= CPAN mocules =====================================================#
use strict;				# strictモード
use warnings;			# 警告有効

#= Global values ====================================================#
#= Local routines ===================================================#
sub main(){
	my $in = <>;chomp $in;
	my ($n, $m) = split(/ /, $in);
	my @table = (
		[ 1, 1, 1],
		[ 1, 1,-1],
		[ 1,-1, 1],
		[ 1,-1,-1],
		[-1, 1, 1],
		[-1, 1,-1],
		[-1,-1, 1],
		[-1,-1,-1],
	);

	my @score = (
		[],
		[],
		[],
		[],
		[],
		[],
		[],
		[],
	);
	
	foreach (1 .. $n){
		$in = <>;chomp $in;
		my @xyz = split(/ /, $in);
		foreach (0 .. 7){
			my $sum =
				($xyz[0] * $table[$_]->[0]) + 
				($xyz[1] * $table[$_]->[1]) + 
				($xyz[2] * $table[$_]->[2]);
			push(@{$score[$_]}, $sum);
		}
	}

	foreach (0 .. 7){
		@{$score[$_]} = sort {$b <=> $a} @{$score[$_]};
	}

	my @sum = (0) x 8;
	foreach (0 .. 7){
		for (my $i = 0; $i < $m; $i++){
			$sum[$_] += $score[$_]->[$i];
		}
	}

	@sum = sort {$b <=> $a} @sum;
	print $sum[0];

	return 0;
}

#----- 実行 -----#
exit( main() );




Measured memory_bytes: 1024
import java.util.Scanner;
class Main
 {
   public static void main(String[] args)
      {
      Scanner sc = new Scanner(System.in);
      while(true){
      int a = sc.nextInt();
      char op = sc.next().charAt(0);
      int b = sc.nextInt();
      int ans = 0;
      if(op == '+')ans = a + b;
      if(op == '-')ans = a - b;
      if(op == '*')ans = a * b;
      if(op == '/')ans = a / b;
      if(op == '?')break;
      System.out.println(ans);
                  }
      }
 }


Measured memory_bytes: 26180
L = input()
N = len(L)

mod = 10**9 + 7

dp = [[0]*(N+1) for _ in range(2)]
dp[1][0] = 1

for i in range(1, N+1):
    c = L[i-1]
    if c == '1':
        dp[1][i] = 2*dp[1][i-1] % mod
        dp[0][i] = (3*dp[0][i-1] + dp[1][i-1]) % mod
    else:
        dp[1][i] = dp[1][i-1]
        dp[0][i] = 3*dp[0][i-1] % mod

print((dp[0][-1] + dp[1][-1]) % mod)


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

int main(){
    int n, l;
    cin >> n >> l;
    int sum = n * (n - 1) / 2 + l * n;
    int a;
    if(l >= 0){
        a = sum - l;
    }
    else if(-1 * n + 1 <= l){
        a = sum;
    }
    else{
        a = sum - (l + n - 1);
    }
    cout << a << endl;
}

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

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

  ll num[101] = {};
  for (int i = 1; i <= N; i++) {
    int x = i;
    for (int j = 2; j <= i; j++) {
      while (x % j == 0) {
        x /= j;
        num[j]++;
      }
    }
  }

  int ans = 0;
  for (int i = 2; i <= 100; i++) {
    for (int j = 2; j <= 100; j++) {
      if (i == j) continue;
      for (int k = j + 1; k <= 100; k++) {
        if (i == k) continue;
        if (num[i] >= 2 && num[j] >= 4 && num[k] >= 4) ans++;
      }
    }
  }

  for (int i = 2; i <= 100; i++) {
    for (int j = 2; j <= 100; j++) {
      if (i == j) continue;
      if (num[i] >= 24 && num[j] >= 2) ans++;
    }
  }

  for (int i = 2; i <= 100; i++) {
    for (int j = 2; j <= 100; j++) {
      if (i == j) continue;
      if (num[i] >= 14 && num[j] >= 4) ans++;
    }
  }

  for (int i = 2; i <= 100; i++) {
    if (num[i] >= 74) ans++;
  }

  cout << ans << endl;
}


Measured memory_bytes: 256
/*
  author: ruruvuvu
  GitHub account: colon-ku

  created at: 2020-01-04 13:39:00
*/

#include <bits/stdc++.h>
using namespace std;

#define all(x) (x).begin(),(x).end()
#define rep(x, y) for (int x = 0; x < y; x++)
#define MOD 1000000007

typedef long long LL;
typedef long double LD;

bool compare_by_b(pair<int, int> a, pair<int, int> b)
{
    if (a.second != b.second) {
        return a.second < b.second;
    } else {
        return a.first < b.first;
    }
}

ostringstream oss_global;
string s_global = oss_global.str();

int main()
{
    int n, k;
    cin >> n >> k;
    vector<int> x(n);
    for (int i = 0; i < n; i++)
        cin >> x[i];

    int ans = INT_MAX;
    for (int l = 0; l < n - k + 1; l++) {
        int r = l + k - 1;
        int ltime, rtime;
        ltime = abs(x[l]) + abs(x[r] - x[l]);
        rtime = abs(x[r]) + abs(x[r] - x[l]);

        ans = min({ans, ltime, rtime});
    }

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


Measured memory_bytes: 768
#include <cstdio>
#include <cmath>
#include <cstdlib>
using namespace std;

int main() {
    int t;
    scanf("%d",&t);
    int s=0,sx=0,sy=0;
    while (t--) {
        int tx,x,y;
        scanf("%d%d%d",&tx,&x,&y);
        if((tx-s-abs(x-sx)-abs(y-sy))<0||(tx-s-abs(x-sx)-abs(y-sy))%2==1)
            break;
        s=tx;
        sx=x;
        sy=y;
    }
    t++;
    if(t)
        printf("No\n");
    else
        printf("Yes\n");
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int k;
ll dp[105][100005];

ll foo(int i, vector<pair<int, ll> > &v, int n, int w)
{

    if (i >= n || w==0)
        return 0;

    if(dp[i][w]!=-1) return dp[i][w];
    
     ll mx=INT_MIN;

     if(w>=v[i].first){
       
        ll  l = v[i].second + foo(i+1,v,n,w-v[i].first);
        ll r = foo(i+1,v,n,w);
        return dp[i][w]=max(l,r);

     }
     else{

         return dp[i][w]=foo(i+1,v,n,w);

     }

}
int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int n;
    cin >> n;
    cin >> k;
    int a[n];

    memset(dp, -1, sizeof(dp));
    vector<pair<int, ll> > v(n);
    for (int i = 0; i < n; i++)
    {
        int x, y;
        cin >> x >> y;
        v[i] = make_pair(x, y);
    }

    long long mx = INT_MIN;

    ll x;

        x = foo(0, v, n, k);

        mx = max(x, mx);
    
    cout << mx << "\n";
}

Measured memory_bytes: 82304
#include <stdio.h>
#include <string.h>
int main(){
    char s[100000];
    int i,j;
    scanf("%s",s);
    //printf("%c\n",s[1]);
    for(i=0;i<strlen(s);i+=2){
        printf("%c",s[i]);
    }
    printf("\n");
    return 0;
}

Measured memory_bytes: 256
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <cmath>
#define _GLIBCXX_DEBUG // check []
#define DIVISOR 1000000007

using namespace std;
typedef pair<int,int> pii;
typedef pair<int64_t, int64_t> pII;

template<typename T>
void cins(vector<T>& arr) { for(T& e: arr) cin >> e; }

#ifdef DEBUG
#define debug(fmt, ...) \
    printf("[debug: %s] " fmt, __func__, __VA_ARGS__)
#define ps(arr) \
    debug("size %ld: ", arr.size()); \
    for(auto e: arr) cout << e << " "; \
    cout << endl;
#else
#define debug(fmt, ...)
#define ps(arr)
#endif


int main(void) {
    int64_t num;
    cin >> num;
    int64_t num_2 = sqrt(0.5 + num);
    int64_t sum = 0;
    for(int i = 1; i <= num_2; i++) {
        if(num%i) continue;
        int64_t m = num/i - 1;
        if(m <= i) continue;
        debug("%ld\n", m);
        sum += m;
    }
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 3660
var input=require("fs").readFileSync("/dev/stdin","utf8");

input=input.split(" ");
var a=(input[0]);
var b=(input[1]);
var d=a/b;
var r=parseInt(a%b);
var f=a/b;

console.log(Math.floor(d)+" "+r+" "+f.toFixed(8));


Measured memory_bytes: 15392
function myin(){return require("fs").readFileSync("/dev/stdin", "utf8").trim();}
function myout(t){console.log(t);}//standard output
function myerr(t){console.error(t);}//standard error
//[no]param
//0:何もしない  1:数値へ変換  2:半角SPで分割  3:改行で分割  4:半角SPで分割し、数値配列へ
//5:改行で分割し、数値配列へ  6:1文字に分割  7:1文字に分割し、数値配列へ
function myconv(i,no){switch(no){case 0:return i;case 1:return parseInt(i);case 2:return i.split(" ");case 3:return i.split("\n");case 4:return i.split(" ").map((a)=>Number(a));case 5:return i.split("\n").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));}}
function Main(input) {
  input = myconv(input,3);
  var N = myconv(input[0],1);
  var list = myconv(input[1],4);
  var output = 0;
  for(var i = 0; i < N; i++){
    var tmp = list[i];
    while(tmp % 2 == 0){
          output++;
      tmp /= 2;
    }
  }
  myout(output);
}
Main(myin());

Measured memory_bytes: 7756
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define show(x) cout << #x << " = " << x << endl;
using namespace std;
using ll = long long;
using pii = pair<int,int>;
int main(){
    int n,k,q;
    cin >> n >> k >> q;
    vector<int>a(n+1);
    rep(i,n){
        cin >> a[i];
    }
    a[n] = -1;
    int ans = INT_MAX;
    for(auto x:a){
        if(x==-1)break;
        vector<int>b;
        vector<int>c;
        rep(i,n+1){
            if(a[i]>=x){
                b.push_back(a[i]);
            }else{
                sort(b.begin(),b.end());
                rep(j,b.size()-k+1){
                    c.push_back(b[j]);
                }
                b.clear();
            }
        }
        sort(c.begin(),c.end());
        if(c.size()>=q)ans = min(ans,c[q-1]-c[0]);
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
/*
t.me/ivanesipovvpered
*/
#pragma ARCENIY_KIRILLOV_POVELITEL_KROKODILOV
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("no-stack-protector")
//#pragma GCC push_options
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC pop_options
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define rng(a) a.begin(), a.end()
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define rep(i, n) for (int i = 0; i < n; i++)
#define per(i, n) for (int i = n - 1; i > -1; i--)
#define rer(i, x, n) for (int i = x; i < n; i++)
#define int long long
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef long double ld;

const double EPS = 1e-5;
const int mod = 1e9 + 7;
const ll INFLL = 1e18;
const int INF = 1e9;
const int maxn = 2e3 + 3;

ll gcd(ll a, ll b){
    if (b == 0ll)
        return a;
    return gcd(b, a % b);
}

ll lcm(ll a, ll b){
    return (a / gcd(a, b) )* b;
}

bool is_prime(ll a){
    if (a == 2 || a == 3 || a == 5 || a == 7) return true;
    if (a % 2 == 0 || a%3 == 0 || a%5 == 0 || a%7 == 0)
        return false;
    for (ll i = 11; i * i <= a; i += 2){
        if (a % i == 0)
            return false;
    }
    return true;
}

ll binpow(ll a, int n){
    if (a == 0)
        return 1;
    if (a % 2 == 0){
        ll q = binpow(a, n / 2);
        return (q * q)  ;
    }else return (a * binpow(a, n - 1) ) ;
}


istream& operator>>(istream &in, pair<int, int> &p) {
    in >> p.fi >> p.se;
    return in;
}

ostream& operator<<(ostream &out, pair<int, int> &p) {
    out << p.fi << " " << p.se << endl;
    return out;
}



















main(){
    int n;
    cin >> n;
    string s;
    cin >> s;
    int fact = 1;
    for (int i = 2; i <= n; i++) fact = (fact * i)%mod;
    int ans = 1;
    int co = 0;
    bool fl = 1;
    for (int i = 0; i < 2*n; i++){
        if(s[i] == 'B'){
            if(co%2 == 1){
                ans = (ans*co)%mod;
                co--;
            }else co++;
        }else{
            if(co%2 == 0){
                ans = (ans*co)%mod;
                co--;
            }else co++;
        }
        if (co < 0){
            cout << 0;
            return 0;
        }
    }
    if (co > 0){
        cout << 0;
        return 0;
    }
    ans = (ans * fact)%mod;
    cout << ans;
}


Measured memory_bytes: 640
import java.util.*;
import java.io.*;

class Main {

	void solve() {

		int n = inint();
		char[] a = incharar(), b = incharar();
		StringBuilder sb = new StringBuilder();
		for (int i=0; i<n; i++) {
			sb.append(a[i]);
			sb.append(b[i]);
		}
		out.println(sb);
		

	}

	public static Scanner in = new Scanner(System.in);
	public static PrintWriter out = new PrintWriter(System.out);

	public static void main(String[] args) {
		new Main().solve();
		out.flush();
	}

	public int inint() {
		return in.nextInt();
	}

	public long inlong() {
		return in.nextLong();
	}
	
	public String instr() {
		return in.next();
	}

	public int[] inintar(int num) {
		int[] a = new int[num];
		for (int i=0; i<num; i++) {
			a[i] = in.nextInt();
		}
		return a;
	}

	public char[] incharar() {
		return in.next().toCharArray();
	}

}

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

int main()
{
    int n, r;
    cin >> n >> r;
    if (n > 10)
    {
        cout << r << "\n";
    }
    else
    {
        cout << 100 * (10 - n) + r<< "\n";
    }
    return 0;
}


Measured memory_bytes: 256
def main():
  s = list(input())
  #s = input().split()
  #a,b = list(map(int,input().split()))
  #a = [input() for i in range(n)]
  #a = [int(input()) for i in range(n)]
  #a = [input().split() for i in range(n)]
  #a = [list(map(int,input().split())) for i in range(n)]
  ans = 753         
  count = 0
  lis = []
  
  for i in range(len(s)-2):
    a = abs(753 - (int(s[i])*100+int(s[i+1])*10+int(s[i+2])))
    ans = min(a,ans)
  print(ans)
  
if __name__ == '__main__':
  main()

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

int main() {
    int n, tmp, amount = 0;
    scanf("%d", &n);
  	vector<int> arr;
  	for(int i = 0; i < n; i++) {
      	scanf("%d", &tmp);
      	arr.push_back(tmp);
    }
  	sort(arr.begin(), arr.end());
  	n = 0;
  	for(auto tmp: arr) {
      	if (n != tmp) {
			amount++;
            n = tmp;
        }  	
    }
  	cout << amount << endl;
	return 0; 
}

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

int main(){
  string S;
  cin >> S;

  vector<int> cnt(3,0);
  for(int i=0;i<S.size();i++) cnt.at((S.at(i)-'a'))++;
  for(int i=0;i<3;i++){
    int tmp=cnt.at(i)-cnt.at((i+1)%3);
    if(abs(tmp)>1){
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;

  return 0;
}

Measured memory_bytes: 512
using System;
using System.Collections.Generic;

class Program {
  static void Main (string[] args) {
    string str = Console.ReadLine();
    int ans = int.Parse(str);
    string ans_str = "Christmas";
    if (25 - ans != 0) {
      for (int cnt = 0; cnt < 25 - ans; cnt++) {
        ans_str += " Eve";
      }
      Console.WriteLine(ans_str);
    }
    else {
      Console.WriteLine(ans_str);
    }
  }
}

Measured memory_bytes: 11092