akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#define dlog(str) cout << "====" << str << endl;
#else
#define dlog(str)
#endif
#define INF 999999999
#define MOD 1000000007
#define REP(i, n) for(int i = 0, i##_l = (n); i < i##_l; i++)
#define FOR(i, s, e) for(int i = s, i##_l = (e); i < i##_l; i++)
#define LLI long long int
#define _min(a,b) ((a<b)?a:b)
#define _max(a,b) ((a<b)?b:a)
#define chmax(a, b) a = _max(a, b)
#define chmin(a, b) a = _min(a, b)
#define bit(a, shift) ((a>>shift)&1))
#define pm(a) ((a)?1:-1)
#define SORT(v) sort(v.begin(),v.end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
// int 2.14E±9    lli 9.2E±18    double 1.7E±380

int main()
{
	cout << fixed << setprecision(10);
	int k;
	cin >> k;


	vector<LLI> nums;
	queue<LLI> q;

	FOR(i, 1, 10)
	{
		q.push(i);
	}

	while (true)
	{
		if (100100 < nums.size())break;
		LLI num = q.front();
		q.pop();
		nums.push_back(num);
		LLI n1 = num % 10;
		if (0 < n1)q.push(num * 10 + n1 - 1);
		q.push(num * 10 + n1);
		if (n1 < 9)q.push(num * 10 + n1 + 1);
	}
	SORT(nums);

	cout << nums[k - 1];
	return 0;
}

Measured memory_bytes: 2676
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  cin>>n;
  vector<int> d;
  vector<int> a(101,0);
  for(int i=0;i<n;i++){
    int c;
    cin>>c;
    a.at(c)=1;
  }
  int sum=accumulate(a.begin(),a.end(),0);
  cout<<sum<<endl;
}


Measured memory_bytes: 256
#62a
x,y = map(int, input().split())

group = [[1,3,5,7,8,10,12],[4,6,9,11],[2]]

for i in range(3):
    if x in group[i]:
        x = i
        break
for i in range(3):
    if y in group[i]:
        y = i
        break

if x == y:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3060
from functools import reduce

n, k = map(int, input().split())
a = list(map(int, input().split()))

mod = 10 ** 9 + 7
if n == k:
    print(reduce(lambda ac, v: ac * v % mod, a, 1))
    exit()

a.sort(key=lambda v: abs(v), reverse=True)
if len(list(filter(lambda v: v < 0, a))) == n and k % 2 == 1:
    print(reduce(lambda ac, v: ac * v % mod, a[n - k :], 1))
    exit()

ans = 1
mn = 0
for v in a[:k]:
    if v < 0:
        mn += 1
    ans *= abs(v)
    ans %= mod

if mn % 2 == 0:
    print(ans)
    exit()

mnp, mnn = 0, 0
for v in a[k - 1 :: -1]:
    if mnp != 0 and mnn != 0:
        break
    elif mnp == 0 and v > 0:
        mnp = v
    elif mnn == 0 and v < 0:
        mnn = v
mxp, mxn = 0, 0
for v in a[k:]:
    if mxp != 0 and mxn != 0:
        break
    elif mxp == 0 and v > 0:
        mxp = v
    elif mxn == 0 and v < 0:
        mxn = v
x, y = mxp, mnn
if mnp != 0 and mxn * mnn > mxp * mnp:
    x, y = mxn, mnp
ans *= pow(abs(y), mod - 2, mod)
ans %= mod
ans *= abs(x)
ans %= mod
print(ans)


Measured memory_bytes: 116084
// A - Connection and Disconnection
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

ll f(const string &S){//文字列の操作回数を求める
	ll c = 0;
	for(int i=1; i < S.size(); ++i)
		if(S[i-1] == S[i]){ c++; i++; }
	return c;
}

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

	ll s1 = f(S);//K=1 のときの操作回数
	ll s2 = f(S+S);//K=2 のときの操作回数
	ll s3 = f(S+S+S);//K=3 のときの操作回数

	ll d1 = s2 - s1;//K=2 と K=1 の操作回数の差分
	ll d2 = s3 - s2;//K=3 と K=2 の操作回数の差分
	ll d = d1 + d2;

	ll ans = 0;
	//繰り返し K <= 3 までは計算済み
	if(K < 2) ans = s1;
	else if(K < 3) ans = s2;
	else if(K < 4) ans = s3;
	else{
		//ここからは等差数列の問題
		if(d1 == d2) ans = s1 + d1 * (K-1);
		else
			if(K % 2) ans = s1 + d * ((K+2-1)/2-1);//(k/2):roundup
			else ans = s2 + d * (K/2-1);
	}
	cout<< ans <<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <stdlib.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <math.h>
#include <string>
#include <map>
#include <cstdlib>
using namespace std;

typedef long long ll;

int main()
{
    ll L,R;
    cin >> L >> R;
    ll ans=3000;
    for(ll l=L; l<min(R, L+2019); l++){
        for(ll r=l+1; r<=min(R, l+2020); r++){
            ll tmp=l*r%2019;
            ans=min(ans, tmp);
        }
    }
    cout << ans << endl;


    return 0;
}

Measured memory_bytes: 256
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


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


def lcm(a, b):
    return a * b // gcd(a, b)


def resolve():
    n = int(input())
    A = list(map(int, input().split()))

    L = 1
    for i in range(n):
        L = lcm(L, A[i])

    res = 0
    for i in range(n):
        res += (L - 1) % A[i]

    print(res)


if __name__ == '__main__':
    resolve()


Measured memory_bytes: 3316
h,w=[int(i) for i in input().split()]

masu=[]
for i in range(h):
    masu.append(list(input()))

def top(i,j):
    ans=0
    if i==0:
        pass
    else:
        check=masu[i-1][max(0,j-1):min(w,j+2)]
        ans+=check.count("#")
    return ans

def bottom(i,j):
    ans=0
    if i==h-1:
        pass
    else:
        check=masu[i+1][max(0,j-1):min(w,j+2)]
        ans+=check.count("#")
    return ans

def side(i,j):
    ans=0
    check=masu[i][max(0,j-1):min(w,j+2)]
    ans+=check.count("#")
    return ans
    
def mawari(i,j):
    taishou=masu[i][j]
    if taishou==".":
        return str(top(i,j)+bottom(i,j)+side(i,j))
    else:
        return "#"

answer=[]
for i in range(h):
    gyou=[]
    for j in range(w):
        gyou.append(mawari(i,j))
    answer.append("".join(gyou))
    
for i in answer:
    print(i)

Measured memory_bytes: 3064
#include<stdio.h>
int main(){
int N,x,y;
scanf("%d",&N);
if(N>=10 && N<=99){
x= N/10;
y=N%10;
if(x==9 || y==9){
    printf("Yes\n");
}
else{
    printf("No\n");
}
}
return 0;
}


Measured memory_bytes: 1660
local mod = 998244353
local function badd(x, y) return (x + y) % mod end
local function bmul(x, y) return (x * y) % mod end
local a, b = io.read("*n", "*n")
local c, d = io.read("*n", "*n")
local dp = {}
for i = 1, c do
  dp[i] = {}
  for j = 1, d do
    dp[i][j] = 0
  end
end
dp[a][b] = 1
for ia = a, c do
  for ib = b, d do
    if ia == a then
      if ib == b then
      else
        dp[a][ib] = bmul(dp[a][ib - 1], a)
      end
    elseif ib == b then
      dp[ia][b] = bmul(dp[ia - 1][b], b)
    else
      local v1 = bmul(dp[ia][ib - 1], ia)
      local v2 = bmul(dp[ia - 1][ib], ib)
      local v3 = bmul(dp[ia - 1][ib - 1], bmul(ia - 1, ib - 1))
      v3 = mod - v3
      dp[ia][ib] = badd(v1, badd(v2, v3))
    end
  end
end
print(dp[c][d])


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

int main(void){
    int A,B;cin>>A>>B;
    int ans=0;
    for(int i=A;i<=B;i++){
        string X=to_string(i);
        int tmp=0;
        for(int l=0;l<2;l++){
            if(X[l]==X[4-l]){
                tmp++;
            }
        }
        if(tmp==2){
            ans++;
        }
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3800
N,A,B,C=map(int,input().split())
ls=[]
for i in range(N):
    s=input()
    ls.append(s)
flag=True
temp=[]
for i in range(N-1):
    s=ls[i]
    if(s=="AB"):
        if(A==0):
            A+=1
            B-=1
            temp.append("A")
        elif(B==0):
            A-=1
            B+=1
            temp.append("B")
        else:
            if("A" in ls[i+1]):
                A+=1
                B-=1
                temp.append("A")
            else:
                A-=1
                B+=1
                temp.append("B")
    elif(s=="AC"):
        if(A==0):
            A+=1
            C-=1
            temp.append("A")
        elif(C==0):
            A-=1
            C+=1
            temp.append("C")
        else:
            if("A" in ls[i+1]):
                A+=1
                C-=1
                temp.append("A")
            else:
                A-=1
                C+=1
                temp.append("C")
    else:
        if(B==0):
            B+=1
            C-=1
            temp.append("B")
        elif(C==0):
            B-=1
            C+=1
            temp.append("C")
        else:
            if("B" in ls[i+1]):
                B+=1
                C-=1
                temp.append("B")
            else:
                B-=1
                C+=1
                temp.append("C")
    if(A<0 or B<0 or C<0):
        flag=False
s=ls[N-1]
if(s=="AB"):
    if(A==0 and B==0):
        flag=False
    elif(A==0):
        temp.append("A")
    else:
        temp.append("B")
elif(s=="AC"):
    if(A==0 and C==0):
        flag=False
    elif(A==0):
        temp.append("A")
    else:
        temp.append("C")
else:
    if(B==0 and C==0):
        flag=False
    elif(B==0):
        temp.append("B")
    else:
        temp.append("C")
if(flag):
    print("Yes")
    for i in range(N):
        print(temp[i])
else:
    print("No")

Measured memory_bytes: 85556
/// kAAzuki Hoshino
/*
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
typedef long long ll;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
//#define inf 1000000000
#define mod 1000000007
#define dmp(x) cerr<<"line "<<__LINE__<<" "<<#x<<":"<<x<<endl
#define fs first
#define sc second
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define mt make_tuple
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){
    return o<<"("<<p.fs<<","<<p.sc<<")";
}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){
    o<<"{";
    for(const T& v:vc) o<<v<<",";
    o<<"}";
    return o;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

 


signed main(){
IOS;
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
  

  int a[5];
  int sum = 0;

  for(int i=1;i<=3;i++){
    cin >> a[i];
    sum+=a[i];
  }      
  if(sum<22){
    cout << "win" << endl; 
  }
  else {
    cout << "bust" << endl;
  }

return 0;
}
///....


Measured memory_bytes: 256
package main

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

// input scanner
var sc = bufio.NewScanner(os.Stdin)

const (
	initialBufSize = 10e4
	maxBufSize     = 10e6
)

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

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func nextInt64() int64 {
	a, _ := strconv.ParseInt(next(), 10, 64)
	return a
}

func nextFloat64() float64 {
	a, _ := strconv.ParseFloat(next(), 64)
	return a
}

func nextInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}
func nextFloats(n int) []float64 {
	ret := make([]float64, n)
	for i := 0; i < n; i++ {
		ret[i] = nextFloat64()
	}
	return ret
}
func nextStrings(n int) []string {
	ret := make([]string, n)
	for i := 0; i < n; i++ {
		ret[i] = next()
	}
	return ret
}

// util
func max(l []int) (int, int) {
	idx := 0
	ans := l[idx]
	for i, n := range l {
		if n > ans {
			idx = i
			ans = n
		}
	}
	return idx, ans
}

func min(l []int) (int, int) {
	idx := 0
	ans := l[idx]
	for i, n := range l {
		if n < ans {
			idx = i
			ans = n
		}
	}
	return idx, ans
}

// main
func main() {
	buf := make([]byte, initialBufSize)
	sc.Buffer(buf, maxBufSize)
	sc.Split(bufio.ScanWords)
	a := []int{1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51}
	k := nextInt()
	fmt.Println(a[k-1])
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
ll a,b,c,i,j,k,l,m,n,ans,tmp,hoge,fuga,piyo;
ll x[200100],y[200100],z[200100];
string s,str;
int main(){
  cin>>k>>a>>b;
  if(b/k-a/k>=1||b%k==0||a%k==0)cout<<"OK";
  else cout<<"NG";
  return 0;
}

Measured memory_bytes: 3652
#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <cmath>
#include <chrono>
using namespace std;


int main(int argc, const char * argv[]) {
    
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int N;
    cin >> N;
    int prev_num;
    cin >> prev_num;
    
    int cnt = 1;
    bool increase = false, ambiguity_flag = true;
    for (int i = 1; i < N; i++) {
        int a;
        cin >> a;
        if (ambiguity_flag) {
            if (prev_num < a) increase = true;
            else if (prev_num > a) increase = false;
            if (prev_num != a) ambiguity_flag = false;
        } else {
            if (increase && prev_num > a) {
                cnt++;
                ambiguity_flag = true;
            } else if (!increase && prev_num < a) {
                cnt++;
                ambiguity_flag = true;
            }
        }
        prev_num = a;
    }
    
    cout << cnt << endl;
    
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#ifndef ONLINE_JUDGE
#define show(a) cout<<""#a""<<" is "<<a<<endl;
#define shw(a,b)cout<<"-->"<<a<<" "<<b<<endl;
#define print(arr,xx)for(int i=0;i<xx;i++)cout<<arr[i]<<" \n"[i==xx-1];
#define here cout<<"here\n";
#define fastio ;
#else
#define show(a)  ;
#define shw(a,b) ;
#define print(arr,xx) ;
#define here
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#endif
int caseno = 0;
#define print_case cout<<"Case "<<++caseno<<": ";
#define fout freopen("output.txt","w",stdout);
#define fin freopen("input.txt","r",stdin);
#define pb push_back
#define pi acos(-1.0)
typedef long long ll;
typedef pair<ll, ll> pll;
typedef vector<vector<int> > vii;
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
void yesno(bool okk) {cout << (okk ? "YES" : "NO") << endl;}
const int primemod = 1000000007;
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
const ll maxsize = 1 * 1000000 + 9;
#define fi first
#define se second
#define inf 1<<25
const double eps = 1e-10;
const int N = 210;
ll n, k, b, m, y;
#define ass(XX) (if(!XX){cout<<-1<<endl;return;})

void solve() {
	cin >> n;
	string ans = "";
	while (n) {
		--n;
		char x = n % 26 + 'a';

		ans = x + ans;
		n /= 26;
	}
	cout << ans << endl;
}

int main() {
#ifndef ONLINE_JUDGE
	fin
	fout
#endif
	///-----
	fastio
	int T;
	T = 1;
	// cin >> T;
	while (T--) {
		// yesno(solve());
		solve();
	}
	///-----
	return 0 ;
}


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

int main()
{
    char* S;
    unsigned int i,N;
    int result=0;

    scanf("%d",&N);
    S = (char*)malloc(N*sizeof(char));
    scanf("%s",S);
    for(i=0;i<N;i++)
    {
        if(S[i]!=S[i+1])
        {
            result++;
        }
    }
    printf("%d",result);

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define mod 1000000007
using namespace std;
typedef long long int ll;
typedef pair<int,int> pi;
typedef pair<int,pi> pii;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int x,y,n,m,a;
    cin>>n>>m>>x>>y;
    for (int i=0;i<n;i++) {
        cin>>a;
        x = max(x,a);
    }
    while (m--) {
        cin>>a;
        y = min(y,a);
    }
    if (x<y) cout<<"No ";
    cout<<"War";
}


Measured memory_bytes: 384
// AOJ 2013: Osaki
// 2017.11.1 bal4u@uu
// 2017.12.30

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct { int t; int a; } T;
T tbl[20005]; int sz; 
char buf[30], *p;
short f[86400];

int in()
{
	int n;
	n = *p++ & 0xf;
	n = 10*n + (*p++ & 0xf);
	p++;
	return n;
}

int cmp(T *a, T *b) { return a->t - b->t; }

int solve1(int n)
{
	int i, h, m, s, ans;
	T *tp;

	tp = tbl, sz = n << 1;
	while (n--) {
		fgets(p=buf, 30, stdin);
		h = in(), m = in(), s = in();
		tp->t = (((((h<<6)+m)<<6)+s)<<1)+1, tp->a = 1;
		tp++;
		
		h = in(), m = in(), s = in();
		tp->t = ((((h<<6)+m)<<6)+s)<<1, tp->a = -1;
		tp++;
	}

	qsort(tbl, sz, sizeof(T), cmp);
	
	ans = s = 0;
	for (i = 0; i < sz; i++) {
		s += tbl[i].a;
		if (s > ans) ans = s;
	}
	return ans;
}

int solve2(int n)
{
	int i, h, m, s, t, ans;

	memset(f, 0, sizeof(f));
	while (n--) {
		fgets(p=buf, 30, stdin);
		h = in(), m = in(), s = in();
		t = ((h*60)+m)*60+s, f[t]++;

		h = in(), m = in(), s = in();
		t = ((h*60)+m)*60+s, f[t]--;
	}

	ans = t = 0;
	for (ans = 0, i = 0; i < 86400; i++) {
		t += f[i];
		if (t > ans) ans = t;
	}
	return ans;
}

int main()
{
	int n;

	while (fgets(buf, 10, stdin) && *buf != '0') {
		n = atoi(buf);
		if (n <= 5000) printf("%d\n", solve1(n));
		else           printf("%d\n", solve2(n));
	}
	return 0;
}

Measured memory_bytes: 2068
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

template<class T>
vector<T> divisor(T n){
    vector<T> ret;
    for(T i = 1; i * i <= n; i++) {
        if(n % i == 0) {
            ret.push_back(i);
            if(i * i != n) ret.push_back(n / i);
        }
    }
    sort(begin(ret), end(ret));
    return(ret);
}


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

template <class L, class R>
ostream& operator<<(ostream& os, pair<L, R> p) {
    return os << "{" << p.first << ", " << p.second << "}";
}


int main() {
    ll n;
    cin >> n;
    auto ans = divisor(n-1);
    for (auto &&i : divisor(n)) {
        if(i == 1) continue;
        ll nn = n;
        while(nn%i == 0) nn /= i;
        if(nn%i == 1) ans.emplace_back(i);
    }
    sort(ans.begin(), ans.end());
    ans.erase(unique(ans.begin(), ans.end()), ans.end());
    cout << ans.size()-1 << "\n";
    return 0;
}

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

using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using vint = vector<int>;
using vvint = vector<vint>;
using vvvint = vector<vvint>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using uint = unsigned int;
using ull = unsigned long long;

template<typename T> using uset = unordered_set<T>;
template<typename T1, typename T2> using umap = unordered_map<T1, T2>;

constexpr int INF = (1 << 30) - 1;
constexpr ll LLINF = 1LL << 60;
constexpr int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr char el = '\n';
constexpr int mod = 1000000007;

template<typename T> T gcd(T a, T b) { return (b ? gcd(b, a % b) : a); }
template<typename T> T lcm(T a, T b) { return (a / gcd(a, b) * b); }
template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) { return (a > b && (a = b, true)); }
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) { return (a < b && (a = b, true)); }

template<typename T>
ostream& operator <<(ostream &os, vector<T> &v) {
	for (auto &u : v) os << u << el;
	return (os);
}

template<typename T>
istream& operator >>(istream &is, vector<T> &v) {
	for (auto &u : v) is >> u;
	return (is);
}

template<typename T1, typename T2>
istream& operator >>(istream &is, pair<T1, T2> &p) {
	return (is >> p.first >> p.second);
}


void Main() {
	string S;
	cin >> S;
	string T = "RUD";
	string U = "LUD";
	bool flag = true;
	for (int i = 0; i < S.size(); i++) {
		if ((i & 1) && U.find(S[i]) == string::npos) flag = false;
		if (!(i & 1) && T.find(S[i]) == string::npos) flag = false;
	}
	cout << (flag ? "Yes" : "No") << endl;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(0);
	cout << fixed << setprecision(20);
	Main();
	return (0);
}


Measured memory_bytes: 256
n,m=map(int,input().split())
a=[]
for i in range(n):
    p=input()
    a.append(p)
b=[]
for i in range(m):
    p=input()
    b.append(p)

def search(h,w):
    for i in range(m):
        if not b[i]==a[h+i][w:w+m]:
            return False
    return True

for i in range(n-m+1):
    for j in range(n-m+1):
        if b[0]==a[i][j:j+m]:
            if search(i,j):
                print("Yes")
                exit()
print("No")

Measured memory_bytes: 62608
var input = '';
var readable = process.stdin;
readable.resume();
readable.setEncoding( 'utf-8' );
readable.on( 'data', function( chunk ) {
  input += chunk;
});

readable.on( 'end', function() {
  var data = input.split( " " ).map( Number );
  var x1 = data[0];
  var y1 = data[1];
  var x2 = data[2];
  var y2 = data[3];
  
  var d = Math.sqrt( Math.pow( x1-x2, 2 )+Math.pow( y1-y2, 2 ) );
  console.log( d );
});

Measured memory_bytes: 15900
from collections import Counter


def main():
    s = list(input())
    Count = Counter(s)
    if "0" not in s or "1" not in s:
        ans = 0
        print(ans)
        exit()
    min_key = min(Count, key=Count.get)
    ans = Count[min_key] * 2
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 4340
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
using Pld = pair<ld, ld>;
using Vec = vector<ll>;
using VecP = vector<P>;
using VecB = vector<bool>;
using VecC = vector<char>;
using VecD = vector<ld>;
using VecS = vector<string>;
using Graph = vector<VecP>;
template <typename T>
using Vec1 = vector<T>;
template <typename T>
using Vec2 = vector<Vec1<T> >;
#define REP(i, m, n) for(ll i = (m); i < (n); ++i)
#define REPN(i, m, n) for(ll i = (m); i <= (n); ++i)
#define REPR(i, m, n) for(ll i = (m)-1; i >= (n); --i)
#define REPNR(i, m, n) for(ll i = (m); i >= (n); --i)
#define rep(i, n) REP(i, 0, n)
#define repn(i, n) REPN(i, 1, n)
#define repr(i, n) REPR(i, n, 0)
#define repnr(i, n) REPNR(i, n, 1)
#define all(s) (s).begin(), (s).end()
#define pb push_back
#define fs first
#define sc second
template <typename T>
bool chmax(T &a, const T b){if(a < b){a = b; return true;} return false;}
template <typename T>
bool chmin(T &a, const T b){if(a > b){a = b; return true;} return false;}
template <typename T>
ll pow2(const T n){return (1LL << n);}
template <typename T>
void cosp(const T n){cout << n << ' ';}
void co(void){cout << '\n';}
template <typename T>
void co(const T n){cout << n << '\n';}
template <typename T1, typename T2>
void co(pair<T1, T2> p){cout << p.fs << ' ' << p.sc << '\n';}
template <typename T>
void co(const Vec1<T> &v){for(T i : v) cosp(i); co();}
template <typename T>
void co(initializer_list<T> v){for(T i : v) cosp(i); co();}
template <typename T>
void ce(const T n){cerr << n << endl;}
void sonic(){ios::sync_with_stdio(false); cin.tie(0);}
void setp(const ll n){cout << fixed << setprecision(n);}
constexpr int INF = 1e9+1;
constexpr ll LINF = 1e18+1;
constexpr ll MOD = 1e9+7;
// constexpr ll MOD = 998244353;
constexpr ld EPS = 1e-11;
const ld PI = acos(-1);

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

	repn(t, n){
		ll ans = 0;
		repn(x, n){
			ll u = t - x * x;
			if (u < 0) break;
			repn(y, x){
				ll v = u - y * y;
				if (v < 0) break;
				repn(z, y){
					ll w = v - z * z;
					if (w < 0) break;
					if (w == x * y + y * z + z * x){
						unordered_map<ll, ll> ump;
						ump[x]++;
						ump[y]++;
						ump[z]++;
						ll tmp = 6;
						for(auto p : ump){
							if (p.sc == 3) tmp /= 6;
							else
								tmp /= p.sc;
						}
						ans += tmp;
					}
				}
			}
		}
		co(ans);
	}

	return 0;
}


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

using namespace std ;

const int MAX = 1e5 + 10 ;

int arr[MAX] ;
int n , k ;
int val[3] ;
string s ;
int dp[MAX][3] ;

bool win(int x , char c)
{
	int y ;
	if(c == 'r')
		y = 0 ;
	else if(c == 's')
		y = 1 ;
	else
		y = 2 ;
	if(x == 0 && y == 1)
		return 1 ;
	if(x == 1 && y == 2)
		return 1 ;
	if(x == 2 && y == 0)
		return 1 ;
	return 0 ;
}

int main()
{
	ios_base::sync_with_stdio(0) ;
	cin.tie(0) ;
	cin>>n>>k ;
	cin>>val[0]>>val[1]>>val[2] ;
	cin>>s ;
	for(int i = 0 ; i < n ; ++i)
	{
		for(int j = 0 ; j < 3 ; ++j)
		{
			if(i != 0)
				dp[i][j] = max(dp[i-1][0] , max(dp[i-1][1] , dp[i-1][2])) ;
			if(win(j , s[i]))
				dp[i][j] += val[j] ;
		}
		if(i >= k)
		{
			for(int j = 0 ; j < 3 ; ++j)
			{
				if(dp[i-k][j] == max(dp[i-k][0] , max(dp[i-k][1] , dp[i-k][2])))
				{
					dp[i][j] -= dp[i-k][j] ;
					if(j == 0)
						dp[i][j] += max(dp[i-k][1] , dp[i-k][2]) ;
					if(j == 1)
						dp[i][j] += max(dp[i-k][0] , dp[i-k][2]) ;
					if(j == 2)
						dp[i][j] += max(dp[i-k][0] , dp[i-k][1]) ;
				}
			}
		}
	}
	int ans = 0 ;
	for(int j = 0 ; j < 3 ; ++j)
		ans = max(ans , dp[n-1][j]) ;
	return cout<<ans<<"\n" , 0 ;
}		

Measured memory_bytes: 1616
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

int main(){
  string s;
  cin >> s;
  int n = s.size();
  int m = 1 << (n - 1);
  long long ans = 0;
  for(int i = 0; i < m; i++){ //２^(n-1) 通りのパターンを覚える。
    long long t = s[0] - '0';
    for(int j = 0 ; j < n; j++){
      if(j == n - 1 || i & 1 << j ){// i bit のフラグをが立っているかどうか。
        ans += t;
        t = 0;
        if(j == n - 1)  break;
      }
    t *= 10;
    t += s[j+1] - '0';
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ld long double
#define int long long
#define fi first
#define se second
using namespace std;
const int N = 2e5 + 12;
const int inf = 2e9;
const int mod = 1e9 + 7;


void run() {
    int i, j, k, n, need, a, b;
    cin >> n;
    int ans = 0;
    for (int i = 1; i <= n; ++i)
        ans += i * (n - i + 1);
    for (i = 1; i < n; ++i) {
        cin >> a >> b;
        ans -= min(a, b) * (n - max(a, b) + 1);
    }
    cout << ans;

}

signed main() {
    #ifdef local
        freopen("input.txt", "r", stdin);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int test;
    run();
}


Measured memory_bytes: 3644
package main

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

func water(l int, r int, h []int) []int {
	for i := l; i < r; i++ {
		h[i] -= 1
	}
	return h
}

func main() {
	var n int
	var s []string
	count := 0
	sc := bufio.NewScanner(os.Stdin)
	if sc.Scan() {
		nt := sc.Text()
		n, _ = strconv.Atoi(nt)
	}
	var h []int
	if sc.Scan() {
		s = strings.Split(sc.Text(), " ")
		for i := 0; i < len(s); i++ {
			hn, _ := strconv.Atoi(s[i])
			h = append(h, hn)
		}
	}

	index := 0
	for {
		l := -1
		r := len(h)
		for i := index; i < n; i++ {
			if l == -1 && h[i] != 0 {
				l = i
				index = i
				continue
			}
			if l != -1 && h[i] == 0 {
				r = i
				break
			}
		}

		if l == -1 {
			break
		}
		h = water(l, r, h)
		count += 1
	}
	fmt.Print(count)
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int mod=1000000007;
signed main(){
  int N,M;
  cin>>N>>M;
  if(abs(N-M)>1){
    puts("0");
    return 0;
  }
  if(N==M){
    int ans=1;
    for(int i=1;i<=N;i++)
      ans=ans*i%mod;
    cout<<ans*ans%mod*2%mod<<endl;
    return 0;
  }
  int ans=1;
  for(int i=1;i<=N;i++)
    ans=ans*i%mod;
  for(int i=1;i<=M;i++)
    ans=ans*i%mod;
  cout<<ans<<endl;
}

Measured memory_bytes: 3640
#include <cstdio>

const int N = 100;

int a[N][N];

int main()
{
#ifdef LOCAL_JUDGE
    freopen("D.in", "r", stdin);
#endif
    int n, m, k;
    scanf("%d%d%d", &n, &m, &k);
    int now = 0, count = 0;
    for (int i = 0; i < n; ++ i) {
        int from = (i & 1) ? m - 1 : 0;
        int to = (i & 1) ? -1 : m;
        int delta = (i & 1) ? -1 : 1;
        for (int j = from; j != to; j += delta) {
            if (count == 0) {
                now ++;
                scanf("%d", &count);
            }
            a[i][j] = now;
            count --;
        }
    }
    for (int i = 0; i < n; ++ i) {
        for (int j = 0; j < m; ++ j) {
            printf("%d%c", a[i][j], " \n"[j == m - 1]);
        }
    }
}

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

typedef vector<int> veci;
typedef pair<int,int> pii;
typedef vector<pii> vecii;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef vector<ll> vecl;
typedef vector<pll> vecll;
#define EPS (1e-9)
#define MOD (1e9+7)
#define fi first
#define se second
#define endl '\n'

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
#ifdef LOCAL_TEST    
    int tcs;
    cin >> tcs;
    while (tcs-->0)
#endif        
{
    int n, m, r;
    cin >> n >> m >> r;

    veci vr(r);
    for (int i=0; i<r; ++i) {
        cin >> vr[i];
        vr[i]--;
    }

    vector<veci> adj(n,veci(n,1e9));
    int a, b, c;
    for (int i=0; i<m; ++i) {
        cin >> a >> b >> c;
        --a, --b;
        adj[a][b] = c;
        adj[b][a] = c;
    }

    for (int k=0; k<n; ++k) {
    for (int i=0; i<n; ++i) {
    for (int j=0; j<n; ++j) {
        if (adj[i][j] > adj[i][k]+adj[k][j]) {
            adj[i][j] = adj[i][k]+adj[k][j];
        }
    }
    }
    }

    sort(vr.begin(), vr.end());
    int min_cost = 1e9;
    do {
        int cost = 0;
        for (int i=0; i<r-1; ++i)
            cost += adj[vr[i]][vr[i+1]];
        min_cost = min(min_cost,cost);
    } while (next_permutation(vr.begin(), vr.end()));

    cout << min_cost << endl;
}}

Measured memory_bytes: 384
#include<stdio.h>
#define NN -1
#define ZZ 0
static const int MAX = 1005;
static const int BB = 2;
static const int GG = 1;
static const int INFTY = (1<<21);

int main(){
  int n, i, j, go, u, v, e;
  int M[MAX][MAX];
  int minv;
  int d[MAX], p[MAX], col[MAX];

  scanf("%d", &n);
  

  for ( i = 0; i< n; i++ ){
    for ( j = 0; j < n; j++ ){
      scanf("%d", &e);
      M[i][j] = (e== -1)?INFTY:e;
    }
  }

  for ( i = 0; i < n; i++ ) {
    d[i] = INFTY;
    p[i] = NN;
    col[i] = 0;
  }

  d[0] = 0;

  while(1){
    minv = INFTY;
    u = NN;
    for ( i = 0; i < n; i++ ){
      if ( minv > d[i] && !col[i] ){
          minv = d[i];
	      u = i;
      }
    }
    
    if ( u == -1 ) break;
    
    col[u] = GG;
    for ( v = 0; v < n; v++ ){
      if ( !col[v] && M[u][v] != INFTY ){
	if ( d[v] > M[u][v] ){
	    p[v] = u;
	  d[v] =  M[u][v];
	  	}
      }
    }
  }

  go = ZZ;

  for ( i = 0; i < n; i++ ){
    if ( p[i] != NN ) {
        go = go + M[i][p[i]];
    }
  }

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

  return 0;
}


Measured memory_bytes: 2140
using System;
using System.Linq;

class Program
{

    public static void Main( )
    {
        int N = int.Parse( Console.ReadLine( ) );
        var A = Console.ReadLine( ).Split( ).Select( int.Parse ).ToArray( );
        var count = new int[ N + 1 ];
        for ( int i = 0; i < N; i++ )
        {
            count[ A[ i ] ]++;
        }

        long total = 0;
        for ( int i = 1; i < count.Length; i++ )
        {
            total += nCm( count[ i ], 2 );
        }

        for ( int i = 0; i < A.Length; i++ )
        {
            int num = A[ i ];
            long reduce = nCm( count[ num ], 2 );
            long add = nCm( count[ num ] - 1, 2 );
            Console.WriteLine( total - reduce + add );
        }

    }

    public static long nCm( int n, int m )
    {
        long numerator = 1;
        for ( int i = n; i > n - m; i-- ) numerator *= i;
        long denominator = 1;
        for ( int i = m; i >= 1; i-- ) denominator *= i;
        return numerator / denominator;
    }


}

Measured memory_bytes: 50244
#include <stdio.h>
#include <stdlib.h>
#define MAX 2000001
#define VMAX 10000


int main(){
   unsigned short *A, *B;
   int C[VMAX+1];
  int n, i, j;

  scanf("%d", &n);

   A = malloc(sizeof(short)*n+1);
   B = malloc(sizeof(short)*n+1);



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

  for(i = 0; i < VMAX+1; i++){
    C[i] = 0;
  }

  for(i = 0 ;i < n;i++){
    C[A[i]]++;
  }

  for(i = 1; i < VMAX+1; i++){
    C[i] = C[i] + C[i-1];
  }

  for(i = n-1; i >= 0; i--){
    B[C[A[i]]-1] = A[i];
    C[A[i]]--;
  }


  
  for(i = 0; i < n ; i++){
 
    if(i == n-1){
      printf("%d\n",B[i]);
      break;
    }
    printf("%d ",B[i]);
  }

  return 0;
}



Measured memory_bytes: 9580
#!/usr/bin/env python3
from collections import deque, Counter
from heapq import heappop, heappush
from bisect import bisect_right

def main():
    X, Y, A, B, C = map(int, input().split())
    p = sorted(list(map(int, input().split())), reverse=True)
    q = sorted(list(map(int, input().split())), reverse=True)
    r = sorted(list(map(int, input().split())), reverse=True)

    now = sum(p[:X]) + sum(q[:Y])
    ans = now
    i = X-1
    j = Y-1

    for k in range(min(C,X+Y)):
        if i < 0:
            now += r[k]-q[j]
            j -= 1
        elif j < 0:
            now += r[k]-p[i]
            i -= 1
        elif p[i] < q[j]:
            now += r[k]-p[i]
            i -= 1
        else:
            now += r[k]-q[j]
            j -= 1
        ans = max(ans,now)
    print(ans)

if __name__ == "__main__":
    main()


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

int main() {
    string s;
    cin >> s;
    string a = s.substr(0,4);
    string b = s.substr(4);
    cout << a << " " << b << "\n";
    return 0;
}

Measured memory_bytes: 256
import numpy as np

A, B = map(int, input().split())

# bins = np.array([i for i in range(A, B+1)], dtype='int64')
if A % 2 == 0:
    if B % 2 == 0:
        # 偶偶
        if ((B - A) / 2) % 2 == 0:
            print(int(bin(B ^ 0), 2))
        else:
            print(int(bin(B ^ 1), 2))
    else:
        # 偶奇
        if ((B - A + 1) / 2) % 2 == 0:
            print(0)
        else:
            print(1)
else:
    if B % 2 == 0:
        # 奇遇
        if ((B-A-1) / 2) % 2 == 0:
            print(int(bin(B ^ A), 2))
        else:
            print(int(bin(B ^ A ^ 1), 2))
    else:
        # 奇奇
        if ((B-A) / 2) % 2 == 0:
            print(A)
        else:
            print(A ^ 1)


Measured memory_bytes: 12388
n,k=map(int,input().split())
lists=list(map(int,input().split()))
GG=[]
sumlist=[0]
a=0
for i in range(len(lists)):
    a+=lists[i]
    sumlist.append(a) 
for i in range(len(sumlist)):
    for j in range(i+1,len(sumlist)):
        
        G=sumlist[j]-sumlist[i]
        GG.append(G)
        
GG=sorted(GG,reverse=True)      
maxi=format(GG[0],"b")
from collections import deque
d=deque()
e=deque()
for j in range(len(GG)):
    d.append(format(GG[j],"b").zfill(len(maxi)))
answer=0
index=0
 
while index!=len(maxi):
    counter=0
    for some in d:
        if some[index]=="1":
            counter+=1
            e.append(some)
    if counter>=k:
        answer+=2**(len(maxi)-1-index)
        d=e
        e=deque()
    elif counter<k:
        d=d
        e=deque()
        
    index+=1
    counter=0
print(answer)


Measured memory_bytes: 144104
#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--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

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

int main(){
	int a, b, c;
	cin >> a >> b >> c;
	if(a+b == c || b+c == a || c+a == b) cout << "Yes\n";
	else cout << "No\n";

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define LLMAX (1ll << 60) - 1
#define INTMAX (1 << 30) - 1
#define MOD 1000000007 
#define NMAX 1000*100+1

#define numberOfSetBits(S) __builtin_popcount(S) // __builtin_popcountl(S) __builtin_popcountll(S)
#define MSET(x,y) memset(x,y,sizeof(x))
#define gcd(a,b) __gcd(a,b)
#define all(x)  x.begin(),x.end()
#define isOn(S, j) (S & (1 << j))
#define endl '\n'
#define setBit(S, j) (S |= (1 << j))
#define clearBit(S, j) (S &= ~(1 << j))
#define toggleBit(S, j) (S ^= (1 << j))
#define print(x)    for(auto it:x) cout<<it<<' '; cout<<endl;
#define printii(x)  for(auto it:x) cout<<it.F<<' '<<it.S<<'\t';  cout<<endl;
#define in(x,n)   for(int e=0;e<n;e++){ll y;cin>>y;x.pb(y);}

#define vi vector<ll>
#define vvi vector<vi>
#define ii pair<ll,ll>
#define pll pair<ll,ll>
#define vii vector<ii>
#define vvii vector<vii>
#define viii vector<pair<ii,ll>>
#define pb push_back
#define F first
#define S second
#define mp make_pair
#define mc(a,b,c) mp(mp(a,b),c)


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,x,t,m,y,z;
    string s;
    cin>>s;
    cout<<s[0]<<s[1]<<s[2];    

    return 0;
}

Measured memory_bytes: 3648
#include <stdio.h>

const int MEIJI_BEGIN = 18680908;//各年号の設定
const int MEIJI_BEGIN_YEAR = 1868;
const int TAISHO_BEGIN = 19120730;
const int TAISHO_BEGIN_YEAR = 1912;
const int SHOWA_BEGIN = 19261225;
const int SHOWA_BEGIN_YEAR = 1926;
const int HEISEI_BEGIN = 19890108;
const int HEISEI_BEGIN_YEAR = 1989;

int judge_era(int era, int year, int month, int day);//年号の判定

void transform_year(int begin_year, int *year);//西暦→和暦への変換

int main(void)
{
    int year, month, day;
    while (scanf("%d %d %d", &year, &month, &day) != EOF) {     
        if (judge_era(HEISEI_BEGIN, year, month, day) == 1) {//平成かの判定
            transform_year(HEISEI_BEGIN_YEAR, &year);
            printf("heisei %d %d %d\n", year, month, day);
        } else if (judge_era(SHOWA_BEGIN, year, month, day) == 1) {//昭和かの判定
            transform_year(SHOWA_BEGIN_YEAR, &year);
            printf("showa %d %d %d\n", year, month, day);
        } else if (judge_era(TAISHO_BEGIN, year, month, day) == 1) {//大正かの判定
            transform_year(TAISHO_BEGIN_YEAR, &year);
            printf("taisho %d %d %d\n", year, month, day);
        } else if (judge_era(MEIJI_BEGIN, year, month, day) == 1) {//明治かの判定
            transform_year(MEIJI_BEGIN_YEAR, &year);
            printf("meiji %d %d %d\n", year, month, day);
        } else {
            printf("pre-meiji\n");
        }
    }
    return 0;
}

int judge_era(int era, int year, int month, int day)
{
    if (era <= year * 10000 + month * 100 + day) {
        return 1;
    } else {
        return 0;
    }
}

void transform_year(int begin_year, int *year)
{
    *year = *year - begin_year + 1;
    return;
}

Measured memory_bytes: 1036
#include<bits/stdc++.h>
#include <math.h>
#include <algorithm>
#include <functional>
#include<iostream>
#include <string>
using namespace std;
typedef long long ll;
#define pb pushback
#define fr(i,n) for(int i=0;i<n;i++)
#define fro(i,j,n) for(int i=j;i<n;i++)
#define ifr(i,n) for(int i=n-1;i>=0;i--)


int main() {
    string a[]={"Sunny","Cloudy","Rainy"};
    string x;
	cin >> x;
    string ans;
    fr(i,3){
      if(a[i]==x)ans=a[(i+1)%3];
    }
      cout << ans << endl;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;

public static partial class Program
{
    public static void Main()
    {
        var s = CRL();
        var ap = s.IndexOf('A');
        var zp = s.LastIndexOf('Z');
        CWL(zp - ap + 1);
    }
}

public static partial class Program
{
    //テンプレここから
    public static int ToInt(this double d) => (int) d;
    public static long ToLong(this double d) => (long) d;
    public static int ToInt(this string str) => int.Parse(str);
    public static long ToLong(this string str) => long.Parse(str);
    public static long[] ToLong(this IEnumerable<string> strs) => strs.Select(x => x.ToLong()).ToArray();
    public static int[] ToInt(this IEnumerable<string> strs) => strs.Select(x => x.ToInt()).ToArray();
    public static long[] ArrayLongs(this string str, char opr = ' ') => str.Split(opr).ToLong();
    public static int[] ArrayInts(this string str, char opr = ' ') => str.Split(opr).ToInt();
    public static string CRL() => Console.ReadLine();
    public static void CWL(object obj) => Console.WriteLine(obj);
    public static long Diff(long a, long b) => Math.Abs(Math.Max(a, b) - Math.Min(a, b));
    public static int Diff(int a, int b) => Math.Abs(Math.Max(a, b) - Math.Min(a, b));
    public static long Sign(this long i) => Math.Sign(i);
    public static bool IsEven(this long i) => i % 2 == 0;
    public static bool IsEven(this int i) => i % 2 == 0;
    public static long[] dx = new long[] {0, -1, 0, 1};
    public static long[] dy = new long[] {-1, 0, 1, 0};
    public static long mod = 1000000007;
    public static string alphabet = "abcdefghijklmnopqrstuvwxyz";
    public static long ToLong(this char c) => c.ToString().ToInt();
    public static long[] Sort(this long[] array) => array.OrderBy(x => x).ToArray();
    public static int[] Sort(this int[] array) => array.OrderBy(x => x).ToArray();
    public static long[] DSort(this long[] array) => array.OrderByDescending(x => x).ToArray();
    public static int[] DSort(this int[] array) => array.OrderByDescending(x => x).ToArray();
    public static string Join(this IEnumerable<string> array, string sep = "") => string.Join(sep, array);
    public static string Join(this IEnumerable<char> array, string sep = "") => string.Join(sep, array);
    public static long GCD(long a, long b) => b == 0 ? a : GCD(b, a % b);

    public static long LCM(long a, long b) => a * b / GCD(a, b);

    //テンプレここまで
}

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

int main() {
  ll a;
  cin >> a;
  string b;
  cin >> b;
  ll b2 = 0;
  rep(i, b.size()) {
     if (b[i] != '.') {
       b2 = 10 * b2 + (b[i] - '0');
     }
  }

  cout << (a * b2) / 100 << endl;

  return 0;
}

/*
1101
0111101101
*/


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

int main()
{
	int l, r, d;
	cin >> l >> r >> d;

	int ans = 0;

	for (int i = l; i <= r; i++)
	{
		if (i % d == 0)
		{
			ans++;
		}
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 3608
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        if(n/10 == 9 || n%10 == 9) {
            System.out.println("Yes");
        }else {
            System.out.println("No");
        }

    }
}


Measured memory_bytes: 22100
#include<stdio.h>
#include<string.h>
#include<math.h>
int main(void)
{
	int a,s,d,f,g,h,j,i,k;
	while(1){
		scanf("%d",&a);
		if(a==0) break;
		d=0;
		f=0;
		for(i=0;i<a;i++){
			scanf("%d",&s);
			if(s>=2) d++;
			if(s>=1) f++;
		}
		if(d<1)	printf("NA\n");
		else printf("%d\n",f+1);
	}
	return 0;
}

Measured memory_bytes: 2732
using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static int N;
    static int M;
    static Cake[] c;

    static void Main()
    {
        /* 入力の受け取り */
        long[] input = Console.ReadLine().Split().Select(long.Parse).ToArray();
        N = (int)input[0];
        M = (int)input[1];
        c = new Cake[N];
        for (int i = 0; i < N; i++)
        {
            input = Console.ReadLine().Split().Select(long.Parse).ToArray();
            c[i] = new Cake(input);
        }

        long ans = 0;
        int[] f = new[] { 1, -1 };

        foreach (var f1 in f)
        {
            foreach (var f2 in f)
            {
                foreach (var f3 in f)
                {
                    long[] s = new long[N];
                    for (int i = 0; i < N; i++)
                        s[i] = c[i].Sum(f1, f2, f3);
                    Array.Sort(s);
                    Array.Reverse(s);
                    long t = 0;
                    for (int i = 0; i < M; i++)
                        t += s[i];
                    ans = Math.Max(ans, t);
                }
            }
        }

        Console.WriteLine(ans);
    }
}

struct Cake
{
    public long x { get; set; }
    public long y { get; set; }
    public long z { get; set; }

    public Cake(long[] inp)
    {
        x = inp[0];
        y = inp[1];
        z = inp[2];
    }

    public long Sum(int f1, int f2, int f3)
    {
        long v = 0;
        v += x * (f1 > 0 ? 1 : -1);
        v += y * (f2 > 0 ? 1 : -1);
        v += z * (f3 > 0 ? 1 : -1);
        return v;
    }
}

Measured memory_bytes: 13524
#include<iomanip>
#include <string>
#include<iostream>
#include<vector>
#include <bits/stdc++.h>
#include <stdio.h>
#include <numeric>
#include<math.h>
#include <ctype.h>
#include <algorithm> // sort
#include <map> // pair
using namespace std;
#define nin(n) int n; cin >> n;
#define kin(k) int k; cin >> k;


int main() {
 int n;
  cin >> n;
  vector<int> vec(n);
  for(int i=0;i<n;i++){
    cin >> vec.at(i);
  }
  int ans=0;
  for(int i=1;i<n-1;i++){
    if(vec.at(i-1)<vec.at(i)&&vec.at(i)<vec.at(i+1)){
      ans++;
    }
    else if(vec.at(i-1)>vec.at(i)&&vec.at(i)>vec.at(i+1)){
      ans++;
    }
  }
  cout << ans << endl;
}

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 <cmath>         // abs
typedef long long ll;
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define mod 1000000007
#define fst first
#define pb push_back

int main()
{
    int N;
    cin >> N;
    vector<int> A(N);
    for (int i = 0; i < N; i++)
    {
        cin >> A[i];
    }
    vector<int> B(N);
    for (int i = 0; i < N; i++)
    {
        cin >> B[i];
    }
    vector<int> C(N - 1);
    for (int i = 0; i < N; i++)
    {
        cin >> C[i];
    }
    int sum = 0;
    for (int i = 0; i < N; i++)
    {
        sum += B[i];
    }
    for(int i = 0; i < N-1; i++){
        if (A[i]+1 == A[i+1]){
            sum += C[A[i]-1];
        }
    }
    cout << sum << endl;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException{

		String strLine ="";
		BufferedReader stdReader =
				new BufferedReader(new InputStreamReader(System.in));

		int i = 0;
		int[] dataSet = new int[50];

		while ( ((strLine = stdReader.readLine()) != null)&&(!(strLine.equals("")))) {
			dataSet[i] = Integer.parseInt(strLine);
			i++;
		}



		for(int j = 0; j < i; j++){
			int cnt = 0;
			//System.out.println("i"+dataSet.length);
			for(int a = 0; a < 10; a++){
				for(int b = 0; b <10 ; b++){
					for(int c = 0; c < 10; c++){
						for(int d = 0; d < 10; d++){

							if((a + b + c + d) == dataSet[j]){
								cnt++;
							}

						}
					}
				}

			}
			System.out.println(cnt);

		}
	}

}

Measured memory_bytes: 24632
#include "bits/stdc++.h"
using namespace std;

int main(){
    int n,k;
    int ans;
    cin >> n >> k;

    ans = (n+1)/k;

    if(ans>=2){
        cout << "YES" << endl;    
    }else{
        cout << "NO" << endl;
    }
    
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    long long N;
    cin >> N;
    long long answer=0;
    for(long long i=1; i*i<N; i++){
        if(N%i==0){
            if(N%(N/i-1)!=0) answer+= N/i-1;
        }
    }
    cout << answer;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define st string
#define ve(i) vector<i>
#define repi(i, m, n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i, n) repi(i, 0, n)
#define each(i, n) for(auto&& i: n)

int main() {
  ll A, B;
  cin >> A >> B;
  cout << 6 - A - B << endl;
}  

Measured memory_bytes: 256