akhauriyash/Code-Regression huggingface dataset:
#ifndef LOCAL
#pragma GCC optimize("O3")
#endif
#include "bits/stdc++.h"
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

typedef long long ll;

int mod;

const int nax = 305;
int C[nax][nax];

int main() {
	int n, k;
	cin >> n >> k >> mod;
	for(int i = 0; i < nax; ++i) {
		C[i][0] = C[i][i] = 1;
		for(int j = 1; j < i; ++j)
			C[i][j] = (C[i-1][j] + C[i-1][j-1]) % mod;
	}
	vector<vector<int>> e(n + 1, vector<int>(k)), E(n + 1, vector<int>(k));
	for(int i = 0; i < k; ++i) e[1][i] = 1;
	for(int len = 2; len <= n; ++len) {
		for(int i = k - 1; i >= 0; --i) E[len-1][i] = (e[len-1][i] + (i == k - 1 ? 0 : E[len-1][i+1])) % mod;
		for(int v = 0; v < k; ++v)
			for(int left = 1; left < len; ++left) if(v != k - 1)
				//~ for(int big = v + 1; big < k; ++big)
				e[len][v] = (e[len][v] + (ll) E[left][v+1] * e[len-left][v] % mod * C[len-2][left-1]) % mod;
	}
	vector<vector<int>> dp(n + 1, vector<int>(k)), DP(n + 1, vector<int>(k));
	for(int i = 0; i < k; ++i) dp[1][i] = 1;
	for(int len = 2; len <= n; ++len) {
		for(int i = k - 1; i >= 0; --i) DP[len-1][i] = (dp[len-1][i] + (i == k - 1 ? 0 : DP[len-1][i+1])) % mod;
		for(int v = 0; v < k; ++v)
			for(int left = 1; left < len; ++left) {
				ll tmp = (ll) e[left][v] * DP[len-left][0] % mod * C[len-2][left-1];
				if(v != k - 1) tmp += (ll) E[left][v+1] * dp[len-left][v] % mod * C[len-2][left-1];
				dp[len][v] = (dp[len][v] + tmp) % mod;
				continue;
				dp[len][v] = (dp[len][v] + 0) % mod;
				if(v != k - 1)
					dp[len][v] = (0) % mod;
				if(0)for(int other = 0; other < k; ++other) {
					//~ dp[len][v] = (dp[len][v] + (ll) e[left][v] * dp[len-left][other] % mod * C[len-2][left-1]) % mod;
					if(other > v)
						dp[len][v] = (dp[len][v] + (ll) e[left][other] * dp[len-left][v] % mod * C[len-2][left-1]) % mod;
				}
			}
	}
	int answer = 0;
	debug() << imie(dp[n][0]) imie(dp[n][1]);
	debug() << imie(e[n][0]) imie(e[1][1]);
	for(int i = 0; i < k; ++i) answer = (answer + dp[n][i]) % mod;
	printf("%d\n", answer);
}


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

#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef long long ll ;
typedef long double ld ;

const ll MOD = 998244353, INF = 1E9 + 5 ;
const double PI = 2 * acos(0.0) ;
const long double EPS = 1.0E-14 ;

ll dp[105][100005], arrW[105], arrC[105] ;

int main()
{
    ll n, w, ans = 0 ;
    cin >> n >> w ;
    for (int i = 1; i <= n; i++) {
        scanf("%lld %lld", &arrW[i], &arrC[i]) ;
    }
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= w; j++) {
            if (j < arrW[i]) {
                dp[i][j] = max(dp[i - 1][j], (ll)0) ;
            }
            else {
                dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - arrW[i]] + arrC[i]) ;
                ans = dp[i][j] ;
            }
        }
    }
    cout << ans ;

    return 0 ;
}


Measured memory_bytes: 79488
#include <iostream>

#define MAX 1000

using namespace std;

int main(){

	int a[MAX][MAX] , b[MAX];
	int n , m;
	int c[MAX] = {0};
	
	cin >> n >> m;
	
	for(int i = 1; i <= n; i++){
		for(int j = 1; j <= m; j++){
			cin >> a[i][j];
		}
	}
	
	for(int i = 1; i <= m; i++){
		cin >> b[i];
	}
	
	for(int i = 1; i <= n; i++){
		for(int j = 1; j <= m; j++){
			c[i] += a[i][j] * b[j];
		}
	}
	
	for(int i = 1; i <= n; i++){
		cout << c[i] << endl;
		}
		
		return 0;
}


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

int N,k;
int arr[100005],dp_min[100005];
std::vector<int> dp[100005];
std::vector<int> dp_int[100005];

int calc_dist(int idx){
	// printf("%d %d\n",idx,std::min(dp[idx][0],dp[idx][1]) );
	if(dp_min[idx] == -1){
		int temp;
		for (int i = 1; i <= k ; ++i)
		{
			// printf("idx:%d i:%d\n",idx,i);
			if(idx-i < 0)
				break;

			else if(idx-i == 0)
				temp = std::abs(arr[idx] - arr[0]);

			else
				temp = calc_dist(idx-i) + std::abs(arr[idx]-arr[idx-i]);

			dp[idx].push_back(temp);

			if(dp_min[idx] == -1)
				dp_min[idx] = i-1;

			else if(dp[idx][dp_min[idx]] >= temp)
				dp_min[idx] = i-1;
		}

	}
	// printf("idx: %d min_idx:%d val::%d\n",idx,dp_min[idx],dp[idx][dp_min[idx]]);
	return dp[idx][dp_min[idx]];

}


int main(){

	scanf("%d %d",&N, &k);
	for (int i = 0; i < N; ++i){
		scanf("%d",&arr[i]);
		dp_min[i] = -1;
	}
		
	printf("%d\n",	calc_dist(N-1));	

}

Measured memory_bytes: 66560
#include <iostream>
#include <string>

using namespace std;

int main() {
  string s;
  cin >> s;
  bool flag = true;
  int count = 0;
  int counts = 0;
  for(int i = 0; i < s.size(); i++) {
    if(i >= 2 && i <= s.size()-2) {
      if(s[i] == 'C') {
        count++;
      }
    }
    if(s[i] >= 'a' && s[i] <= 'z') {
      counts++;
    }
  }
  if(s[0] != 'A' || count != 1 || counts != s.size()-2) {
    flag = false;
  }
  if(flag == true) {
    cout << "AC";
  }else {
    cout << "WA";
  }
  return 0;
}

Measured memory_bytes: 888
import java.util.Scanner;

class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();
        if (a < b && b < c){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
}


Measured memory_bytes: 26284
package main

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

var (
	sc = bufio.NewScanner(os.Stdin)
	wtr = bufio.NewWriter(os.Stdout)
)

func scanInt() int {
	sc.Scan()
	a,_ := strconv.Atoi(sc.Text())
	return a
}

func scanInts(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ { res[i] = scanInt() }
	return res
}

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

func printInts(a ...int) {
	for i, e := range a {
		fmt.Fprint(wtr, e)
		if i != len(a)-1 {
			fmt.Fprint(wtr, " ")
		}
	}
	fmt.Fprintln(wtr)
	wtr.Flush()
}

func main() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 10000), 100000000)

	s,t := scanText(), scanText()

	n := len(s)
	ss := s+s

	next := make([][]int, 26)

	for i := 0; i < 26; i++ {
		next[i] = make([]int, 2*n+1)
		index := strings.Index(ss, string('a'+i))+1
		j := 0
		for index != -1 {
			next[i][j] = index
			index--
			j++
			if index == 0 {
				index = strings.Index(ss[j:], string('a'+i))+1
			}
		}
	}

	// fmt.Println(t)

	// for i := 0; i < 26; i++ {
	// 	fmt.Print(string('a'+i)+":")
	// 	fmt.Println(next[i])
	// }

	p := int64(0)
	for _, e := range t {
		index := next[e-'a'][p%int64(n)]
		if index == 0 {
			p = -1
			break
		}
		p+=int64(index)
	}

	fmt.Println(p)

	
}


Measured memory_bytes: 44416
#include <iostream>
#include <array>
#include <algorithm>
#include <vector>
#include <bitset>
#include <set>
#include <unordered_set>
#include <cmath>
#include <complex>
#include <deque>
#include <iterator>
#include <numeric>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
#include <functional>
#include <cassert>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define ALL(v) v.begin(),v.end()
template < class T > inline bool chmax(T& a, T b) {if (a < b) { a=b; return true; } return false; }
template < class T > inline bool chmin(T& a, T b) {if (a > b) { a=b; return true; } return false; }
#define DEBUG_VLL(vec) for(int sz=0;sz<int(vec.size());sz++) std::cerr<<vec[sz]<<(sz==vec.size()-1?'\n':' ');

const long long MOD = 1000000007;
const long long HIGHINF = (long long)1e18;
const int INF = (int)1e9;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll h, w; cin >> h >> w;
    if (h == 1 || w == 1) cout << 1 << '\n';
    else {
        ll hw = h * w;
        if (hw & 1) hw++;
        hw /= 2;
        cout << hw << '\n';
    }
    return 0;
}


Measured memory_bytes: 3644
#include <bits/stdc++.h>
#define forn(i, n) for (int i = 0; i<(int)n; ++i)
#define forr(i, t, n) for (int i = t; i<n; ++i)
#define rmod(x, y) (((x%y)+y)%y)
#define pb push_back
#define emp emplace_back
#define ppb pop_back
#define len(v) int(v.size())
#define all(v) (v).begin(),(v).end()
#define ri(x) scanf("%d",&(x))
#define rii(x,y) scanf("%d %d",&(x),&(y))
#define riii(x,y,z) scanf("%d %d %d",&(x),&(y),&(z))
#define rl(x) scanf("%lld",&(x))
#define rll(x,y) scanf("%lld %lld",&(x),&(y))
#define rlll(x,y,z) scanf("%lld %lld %lld",&(x),&(y),&(z))
using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll,ll> pll;
void fastio(){ios_base::sync_with_stdio(false); cin.tie(0);}

const long double PI = acos(-1);
const long long MOD = 1000000000 +7;
const int maxn = 1024;

int main() {
	int a, b, c;
	riii(a, b, c);
	if (a+b+c>=22) puts("bust");
	else puts("win");
	
	
	return 0;
}

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

using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using LL = long long;
using VL = vector<LL>;
using VVL = vector<VL>;
using PLL = pair<LL, LL>;
using VS = vector<string>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))

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

#define FF first
#define SS second

#define DUMP(x) cout<<#x<<":"<<(x)<<endl
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}
template<class T>
istream& operator>>(istream& is, vector<T>& xs){
  for(auto& x: xs)
	is >> x;
  return is;
}
template<class S, class T>
ostream& operator<<(ostream& os, const pair<S,T>& p){
  return os << p.FF << " " << p.SS;
}
template<class T>
ostream& operator<<(ostream& os, const vector<T>& xs){
  for(unsigned int i=0;i<xs.size();++i)
	os << (i?" ":"") << xs[i];
  return os;
}
template<class T>
void maxi(T& x, T y){
  if(x < y) x = y;
}
template<class T>
void mini(T& x, T y){
  if(x > y) x = y;
}


const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;

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

  int N;
  string S, T;
  cin >> N >> S >> T;

  VI cnt1(26), cnt2(26);
  for(char c: S)
	cnt1[c-'a']++;
  for(char c: T)
	cnt2[c-'a']++;

  SORT(cnt1);
  SORT(cnt2);

  int ans = 0;
  REP(i,26) ans += abs(cnt1[i] - cnt2[i]);

  cout << ans/2 << endl;

  return 0;
}



Measured memory_bytes: 3364
n=int(input())
a,b,c,d=0,0,0,0
for i in range(n):
    s=input()
    if s=='AC':
        a=a+1
    elif s=='WA':
        b=b+1
    elif s=='TLE':
        c=c+1
    else:
        d=d+1
print('AC','x',a)
print('WA','x',b)
print('TLE','x',c)
print('RE','x',d)


Measured memory_bytes: 9176
def main():
    N = int(input())

    ans = [0] * (10**4 + 1)
    for i in range(1, 101):
        for j in range(1, 101):
            for k in range(1, 101):
                tmp = i**2 + j**2 + k**2 + i*j + j*k + k*i
                if tmp < 10**4 + 1:
                    ans[tmp] += 1

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


if __name__ == "__main__":
    main()


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

int main() {
	vector<int>cube(3); for (auto&& x : cube)cin >> x;
	sort(cube.begin(), cube.end());
	long long ans = 0;
	if (cube[2] % 2 != 0) {
		ans = (long long)cube[0] * cube[1] * (cube[2] % 2 != 0 ? cube[2] / 2 + 1 : cube[2] / 2);
		ans -= (long long)cube[0] * cube[1] * (cube[2] / 2);
	} 
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

//std::cout << std::fixed << std::setprecision(10)
constexpr long long MOD = 1000000007;

int main()
{
  int N, D;
  std::cin >> N >> D;
  int ans = 0;
  for (int i = 0; i < N; i += 2 * D + 1)
    ++ans;
  std::cout << ans << std::endl;
  return 0;
}



Measured memory_bytes: 256
n,m=map(int,input().split())
pre=[[] for _ in range(n)]
for _ in range(m):
    p,y=map(int,input().split())
    pre[p-1].append([y,_,p])
for p in range(n):
    pre[p].sort(key=lambda x:x[0])
    for i in range(len(pre[p])):
        pre[p][i].append(i)
lis=[]
for i in pre:
    for j in i:
        lis.append(j)
lis.sort(key=lambda x:x[1])
for i in lis: print("{:06}{:06}".format(i[2],i[3]+1))

Measured memory_bytes: 46560
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <numeric>

using namespace std;
#define repp(i,a,b) for(int i = (int)(a) ; i < (int)(b) ; ++i)
#define reppe(i,a,b) for(int i = (int)(a) ; i <= (int)(b) ; ++i)
#define repm(i,a,b) for(int i = (int)(a) ; i > (int)(b) ; --i)
#define repme(i,a,b) for(int i = (int)(a) ; i >= (int)(b) ; --i)

typedef long long ll;

long long GCD(long long a, long long b){if(b==0)return a;return GCD(b,a%b);}

int main() {
    int H, W; cin >> H >> W;
    map<char, int> m;
    repp(i,0,H) {
        repp(j,0,W) {
            char c; cin >> c;
            ++m[c];
        };
    }
    bool can = true;
    
    if (H%2 == 0 && W%2 == 0) {
        for (auto x:m) can &= x.second%4 == 0;
    } else if (H%2 == 0 && W%2 == 1) {
        int count2 = 0;
        for (auto x:m) {
            if (x.second % 2 == 1) can = false;
            else if (x.second%4 == 2) ++count2;
            else can &= x.second % 4 == 0;
        }
        can &= count2 <= H / 2;
    } else if (H%2 == 1 && W%2 == 0) {
        int count2 = 0;
        for (auto x:m) {
            if (x.second % 2 == 1) can = false;
            else if (x.second%4 == 2) ++count2;
            else can &= x.second % 4 == 0;
        }
        can &= count2 <= W / 2;
    } else {
        int count1 = 0;
        int count2 = 0;
        for (auto x:m) {
            if (x.second%2 == 1) {
                ++count1;
                if (x.second > 1 && (x.second - 1) % 4 == 2) ++count2;
            } else if (x.second%4 == 2) ++count2;
            else can &= x.second % 4 == 0;
        }
        can &= (count2 <= (H + W - 2) / 2) && (count1 == 1);
    }

    if (can) cout << "Yes" << endl;
    else cout << "No" << endl;
}


Measured memory_bytes: 256
fn gcd(a: u64, b: u64) -> u64 {
    if b == 0 {
        a
    } else {
        gcd(b, a % b)
    }
}

fn lcm(a: u64, b: u64) -> u64 {
    (a / gcd(a, b)) * b
}

fn main() {
    let s = std::io::stdin();
    let mut sc = Scanner { stdin: s.lock() };
    let n = sc.read();
    let ans = (0..n).fold(1, |a, _| lcm(a, sc.read()));
    println!("{}", ans);
}

// Thanks, kenkoooo(https://kenkoooo.hatenablog.com/entry/2019/05/07/101033)
pub struct Scanner<R> {
    stdin: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}

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

bool solve(int X, int Y, const vector<int>& x, const vector<int>& y) {
  int max_x = *max_element(x.begin(), x.end());
  int min_y = *min_element(y.begin(), y.end());
  for (int i = -100; i <= 100; ++i) {
    if (X < i && i <= Y && max_x < i && i <= min_y) {
      return true;
    }
  }
  return false;
}

int main() {
  int N, M, X, Y;
  cin >> N >> M >> X >> Y;
  vector<int> x(N);
  vector<int> y(M);
  for (int i = 0; i < N; ++i) {
    cin >> x.at(i);
  }
  for (int i = 0; i < M; ++i) {
    cin >> y.at(i);
  }
  bool ans = solve(X, Y, x, y);
  if (ans) {
    cout << "No War" << endl;
  } else {
    cout << "War" << endl;
  }
}


Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	int n,c,x,i,z,k;
	
	scanf("%d %d",&n,&c);
	z=0;
	for(i=0;i<c;i++){
			scanf("%d",&x);
			z+=x;
	}
	n++;
	k=z/n;
	if(z%n!=0){ 
		k++;
	}
	printf("%d\n",k);
	return 0;
}


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

int n;
string s;
int main() {
	int i;
	cin >> s;
	n = s.size();
	s = '.' + s;
	if(s[1]!='1' || s[n]!='0') return puts("-1")*0;
	for(i=1; i<=n/2; i++) if(s[i] != s[n-i]) return puts("-1")*0;
	for(i=n-1; i; i--) {
		printf("%d %d\n", i, n);
		if(s[i]=='1') n = i;
	}
	return 0;
}

Measured memory_bytes: 1660
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>


using namespace std;


long long f(long long a, long long b)
{
  string x=to_string(a), y=to_string(b);
  return max(x.length(), y.length());
}


int main()
{
  long long n, i, minv=100000000000;

  cin >> n;
  i = 1;
  while (i <= (long long)sqrt((long long)n)){
    if (n%i == 0 && f(i, n/i) < minv) minv = f(i, n/i);
    i++;
  }
  cout << minv << endl;
  
  return 0;
}


Measured memory_bytes: 256
n,m = map(int,input().split())
a_list = [input() for _ in range(n)]
b_list = [input() for _ in range(m)]
for i in range(n-m+1):
    for j in range(n-m+1):
        f = True
        for k in range(m):
            for l in range(m):
                if a_list[i+k][j+l] != b_list[k][l]:
                    f = False
                    break
            if not f:
                break
        if f:
            print('Yes')
            exit()
print('No')

Measured memory_bytes: 3064
from collections import deque


deq = deque()
n = int(input())
for _ in range(n):
    operation = input()
    if operation == "deleteFirst":
        deq.popleft()
    elif operation == "deleteLast":
        deq.pop()
    
    else:
        command, value = operation.split()
        if command == "insert":
            deq.appendleft(int(value))
        elif command == "delete":
            try:
                deq.remove(int(value))
            except ValueError:
                pass

print(*deq)



Measured memory_bytes: 45944
#include <bits/stdc++.h>
#include <stdio.h>
typedef long long int LL;
#define fr(i,p,n) for(LL i=p;i<n;i++)
#define fr1(i,p,n) for(LL i=p;i>=n;i--)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define PI 3.14159265358979323846
#define MOD 1000000007
#define MOD1 998244353
#define INF 1e18
#define precise cout << std::setprecision(10) << std::fixed;

using namespace std;
 
int main()
{
   int n, k;
	cin >> n >> k;
	vector<int> a(n);
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
	}
	for (int i = k; i < n; ++i) {
		cout << (a[i - k] < a[i] ? "Yes" : "No") << endl;
	}
    return 0;
}

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

#define db(x) cerr << #x ": " << (x) << '\n';

#define int long long

using namespace std;

typedef long long ll;

const int oo = 1e18;

vector<int> vect;

void f(string cad)
{
    stringstream s;
    s << cad;
    int num;
    s >> num;
    vect.push_back(num);
    if(cad.size() == 10)return;
    if(cad.back() != '0')f(cad + (char)(cad.back()-1));
    f(cad + (char)(cad.back()));
    if(cad.back() != '9')f(cad + (char)(cad.back()+1));
}

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int K;
    cin >> K;

    for(int i = '0' ; i <= '9' ; i++)
    {
        string cad;
        cad += i;
        f(cad);
    }

    sort(vect.begin(),vect.end());
    vect.resize(unique(vect.begin(),vect.end())-vect.begin());

//    for(auto x : vect)cout << x << " ";

    cout << vect[K] << '\n';

    return 0;
}


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

string t;

long string_length(long now_depth){
    if(now_depth){
        return (t.size() + 1) * string_length(now_depth - 1) + t.size();
    }else{
        return 0;
    }
}

string create_string(long now_depth){
    if(now_depth){
        string ans = "";
        string next_depth_string = create_string(now_depth - 1);
        for(int i = 0; i < t.size(); i++){
            ans += next_depth_string;
            ans.push_back(t[i]);
        }
        return ans + next_depth_string;
    }else{
        return "";
    }
}

int main(){
    string s;
    cin >> s >> t;
    for(int i = 1; true; i++){
        if(string_length(i) > s.size()){
            cout << i - 1 << endl;
            return 0;
        }
        string this_string = create_string(i);
        int this_string_pointer = 0;
        for(int j = 0; j < s.size() && this_string_pointer < this_string.size(); j++){
            if(this_string[this_string_pointer] == s[j]){
                this_string_pointer++;
            }
        }
        if(this_string_pointer < this_string.size()){
            cout << i - 1 << endl;
            return 0;
        }
    }
}



Measured memory_bytes: 3516
#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;
}


Measured memory_bytes: 3640
# region header
import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**6)
INF = float('inf')
MOD = 10 ** 9 + 7
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(rs())
def rf(): return float(rs())
def rs_(): return [_ for _ in rs().split()]
def ri_(): return [int(_) for _ in rs().split()]
def rf_(): return [float(_) for _ in rs().split()]
def divisors(n, sortedresult=True):
    div = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            div.append(i)
            if i != n // i:
                div.append(n//i)
    if sortedresult:
        div.sort()
    return div
# endregion
H, W = ri_()
S = [rs_() for _ in range(H)]
for i in range(H):
    for j in range(W):
        if S[i][j] == 'snuke':
            print('ABCDEFGHIJKLMNOPQRSTUVWXYZ'[j] + str(i + 1))

Measured memory_bytes: 64748
#include<stdio.h>
#include<string.h>
#define FOR(i,a,b) for(int i=a;i<b;i++)
int main(){
	char O[51],E[51];
	scanf("%s %s",O,E);

	FOR(i,0,strlen(E)){
		printf("%c%c",O[i],E[i]);
	}
	if(O[strlen(E)] != '\0') printf("%c\n",O[strlen(E)]);
}

Measured memory_bytes: 128
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	static Scanner sc = new Scanner(System.in);
	private static final int MASS = 10;
	private static final int[] dx = {0, 0,-1, 1,-1,-1, 1, 1, 0, 0,-2, 2};
	private static final int[] dy = {-1, 1, 0, 0,-1, 1,-1, 1,-2, 2, 0, 0};

	public static void main(String[] args) {

		int map[][] = new int[MASS][MASS];
		int count = 0;
		int max = 0;

		for(int $ = 0; $ < MASS; $++) {
			Arrays.fill(map[$], 0);
		}

		while(sc.hasNext()) {
			String[] text = sc.next().split(",");
			int x = Integer.parseInt(text[0]);
			int y = Integer.parseInt(text[1]);
			int ink = Integer.parseInt(text[2]);

			//???????????????????????°???????????????1????????????
			map[x][y]++;

			//???????????????????????°???????????????1????????????
			for(int $ = 0; $ < ink * 4; $++) {
				int mx = x + dx[$];
				int my = y + dy[$];
				if(mx >= 0 && mx < MASS && my >= 0 && my < MASS) {
					map[mx][my]++;
				}
			}
		}

		//????????¨????????¨?????????????????¨????????????????????°??????
		for(int $ = 0; $ < MASS; $++) {
			for(int i = 0; i < MASS; i++) {
				if(map[$][i] == 0) {
					count++;
				}
				max = Math.max(max, map[$][i]);
			}
		}

		System.out.println(count);
		System.out.println(max);
	}
}

Measured memory_bytes: 25728
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define all(v) v.begin(),v.end()
#define repf(i,a,b) for(ll i=a;i<b;i++)
#define repb(i,a,b) for(ll i=a;i>=b;i--)
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define mod 1000000007
#define MOD 998244353 

using namespace std;
using namespace __gnu_pbds;

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

ordered_set<ll> ods;

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

ll power(ll a, ll n, ll m)
{
    ll ans=1;
    while(n)
    {
        if(n&1) ans=(ans*a)%m;
        n>>=1;
        a=(a*a)%m;
    }
    return ans;
}

ll invmod(ll a, ll m)
{
    return power(a,m-2,m);
}

void solve(ll t)
{
    // cout<<"Case #"<<t<<":\n";
    ll r;
    cin>>r;
    ld PI=6.28318530717958623200/2;
    ld ans=2*PI*r;
    cout<<fixed<<setprecision(6)<<ans<<endl;
}

int main()
{
    IOS;
    ll t;
    // cin>>t;
    t=1;
    ll tt=1;
    while(t--)
    {
        solve(tt);
        tt++;
    }
}     


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

void iS(int x[],int y){
    for(int i=1;i<y;i++){
        int v = x[i];
        int j = i-1;
        while(j>=0&&x[j]>v){
            x[j+1] = x[j];
            j--;
        }
        x[j+1]=v;
        for(int r=0;r<y;r++){
            if(r != y-1){
                cout << x[r] << " " ;
            }else{
                cout << x[r] << endl;
            }
        }
    }
}

int main(){
    int n;
    int a[100];
    cin >> n;
    for(int i=0;i<n;i++){
        int b;
        cin >> b;
        a[i] = b;
    }
    for(int i=0;i<n;i++){
        if(i != n-1){
            cout << a[i] << ' ';
        }else{
            cout << a[i] << endl;
        }
    }
    iS(a,n);
    
}



Measured memory_bytes: 3100
#include <iostream>
  
using namespace std;  
  
// 入力  
int a, b;  
  
void solve()  
{  
    int res = 0;  
  
    a += b;  
  
    for (; a; a /= 10)  
        res++;  
  
    cout << res << endl;  
}  
  
int main()  
{  
    while (cin >> a >> b)  
        solve();  
  
    return 0;  
} 

Measured memory_bytes: 1160
#include "bits/stdc++.h"

using namespace std;
using ll = long long int;

int main()
{
    ll a, b, n;
    cin >> a >> b >> n;

    ll x = min(b - 1, n);
    ll ans = (a * x) / b - a * (x / b);
    cout << ans << endl;
}

Measured memory_bytes: 3580
#include <bits/stdc++.h>
using namespace std;
int main(){
  int a;
  string op;
  int b;
  
  cin >> a;
  cin >> op;
  cin >> b;
  
  if (op == "+"){
    cout << a+b << endl;
  }
  else{
    cout << a-b << endl;
  }
}

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <queue>
#include <cstring>
#include <string>
#include <stack>
#include <map>
#include <set>
#include <cmath>
#include <iomanip>
#include <ctime> 
using namespace std;

#define pb push_back
#define All(a) a.begin(), a.end()
#define met(a, b) memset(a, b, sizeof(a))
#define rep1(i, l, r) for(int i = l; i <= r; ++i)
#define rep2(i, l, r) for(int i = l; i < r; ++i) 
#define per(i, r, l) for(int i = r; i >= l; --i)
typedef long long ll;
typedef double db;
typedef long double ldb;
const int NIL = -1;
const int oo = 0x3f3f3f3f;
const ll INF = 2e18;
const db eps = 1e-8;
const db PI = acos(-1.0);

inline int read(void)
{
	int x = 0, f = 1; char ch = getchar();
	while(ch < '0' || ch > '9')	{ if(ch == '-') f = -1; ch = getchar(); } 
	while(ch >= '0' && ch <= '9') {	x = (x << 1) + (x << 3) + ch - '0';	ch = getchar();	}
	return x * f;
}

inline void write(int x)
{
	if(x < 0) { putchar('-'); x = -x; }
    if(x >= 10) write(x/10); 
	putchar(x%10+'0'); 
}

int main(void)
{
	int n = read();
	int a = n / 2, b = n / 2;
	if(n&1) b++;
	printf("%d", a * b); 
	
	return 0;
} 

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rp(i,n) for(int i=0;i<n;i++)
#define rep(i,m,n) for(int i=m;i<=n;i++)
#define lrp(i,n) for(long long i=0;i<n;i++)
#define lrep(i,m,n) for(long long i=m;i<=n;i++)
#define ll long long
#define sort(a) sort(a.begin(),a.end())
#define reverse(a) reverse(a.begin(),a.end())
#define vi vector<int>
#define vl vector<long long>
#define pb push_back
int abs(int a,int b){
    return (a>b?a-b:b-a);
}

int main(){
    ll n;
    cin >> n;
    vl a(n);
    lrp(i,n){
        cin >> a.at(i);
    }
    sort(a);
    vl b;
    lrp(i,n-1){
        ll cnt=1;
        if(a.at(i)==a.at(i+1)){
            b.pb(a.at(i));
            while(i<n-1&&a.at(i)==a.at(i+1)){
                i++;
                cnt++;
            }
            if(cnt>=4){
                b.pb(a.at(i));
            }
        }
    }
    sort(b);
    cout << (b.size()>=2?b.at(b.size()-1)*b.at(b.size()-2):0) << endl;
    
    return 0;
}



Measured memory_bytes: 1660
package main

import (
	"fmt"
)

func main() {
	var N, K int
	fmt.Scan(&N, &K)
	x := make([]int, N)
	for i := 0; i < N; i++ {
		fmt.Scan(&x[i])
	}

	ans := 1000000000
	for i := 0; i <= N-K; i++ {
		l := x[i]
		r := x[i+K-1]
		v1 := abs(l) + abs(r-l)
		v2 := abs(r) + abs(l-r)
		ans = min(min(v1, v2), ans)
	}
	fmt.Println(ans)
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}


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


int main()
{
    string a,b;
    cin>>a>>b;
    int l1,l2;
    l1=a.size();
    l2 = b.size();
    int i,j;

    for(i=0,j=l2-1;i<l1;j--,i++)
        if(a[i]!=b[j])
        break;

    if(i==l1)
        puts("YES");
    else
        puts("NO");


}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,K;cin>>N>>K;
  vector<int> p(N);
  double ans,now=0;
  for(int i=0;i<N;i++)cin>>p[i];
  for(int i=0;i<K;i++)now+=p[i]+1;
  ans=now;
  for(int i=0;i<(N-K);i++){
    now+=p[i+K]-p[i];
    ans=max(ans,now);
  }
  ans/=2;
  cout<<fixed<<setprecision(10)<<ans<<endl;
}

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


int main() {

  long long int in;
  cin >> in;

  long long int x = in / 100;
  long long int y = in % 100;


  if ( x == 0 || x > 12 ) {
    if ( y == 0 || y > 12 ) {
      cout << "NA" << endl;
    } else {
      cout << "YYMM" << endl;
    }
  } else {
    if ( y == 0 || y > 12 ) {
      cout << "MMYY" << endl;
    } else {
      cout << "AMBIGUOUS" << endl;
    }
  }

  return 0;

}


Measured memory_bytes: 256
import java.util.Scanner;
import java.util.stream.Stream;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str  = sc.nextLine();
        int val = Integer.parseInt(str);
        String moji = sc.nextLine();
        sc.close();

        if(val >= 3200){
            System.out.println(moji);
        }else{
            System.out.println("red");
        }
    }
}

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

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

    vector<pair<pair<string,int>,int>> S(N);


    for(int i = 0; i < N; i++)
    {
        cin >> S.at(i).first.first >> S.at(i).first.second;
        S.at(i).second = i;
        S.at(i).first.second = 100 - S.at(i).first.second;
    }

    sort(S.begin(),S.end());

    for(int i = 0; i < N; i++)cout << S.at(i).second + 1 << endl;
    return 0;
}

Measured memory_bytes: 256
n, a, b = map(int, input().split())
s = input()
A = 0
B = 0
for i in range(len(s)):
    if s[i] == "a":
        if A + B < a + b:
            print("Yes")
            A += 1
        else:
            print("No")
    elif s[i] == "b":
        if A + B < a + b and B < b:
            print("Yes")
            B += 1
        else:
            print("No")
    else:
        print("No")

Measured memory_bytes: 9208
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <string>
#define N 120
using namespace std;

string s[N];

int main(void)
{
    int n, l;
    int i;

    ios::sync_with_stdio(false);

    cin >> n >> l;
    for(i = 0; i < n; i ++)
        cin >> s[i];
    sort(s, s + n);
    for(i = 0; i < n; i ++)
        cout << s[i];

    return 0;
}

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

#define debug(x) {cerr << #x << " = " << x << '\n';}
#define PR(a, n) {cerr << #a << " = "; for (int _=1; _<=n; ++_) cerr << a[_] << ' '; cerr << '\n';}
#define PR0(a, n) {cerr << #a << " = "; for (int _=0; _<n; ++_) cerr << a[_] << ' '; cerr << '\n';}
#define FILE_NAME "data"


const int MAXN = 100002;


int n, a[MAXN], degIn[MAXN];


void readInput() {
    cin >> n;

    for (int i = 1; i <= n; ++i)
        cin >> a[i];
}


bool check(vector<int> candidate) {
    for (int i = 1; i < n; ++i) {
        if (candidate[i] == a[candidate[i - 1]])
            return false;
    }

    return true;
}


void solve() {
    if (n == 2) {
        puts("-1");
        return;
    }

    for (int i = 1; i <= n; ++i) {
        degIn[i] = n - 1;
    }

    for (int i = 1; i <= n; ++i) {
        --degIn[a[i]];
    }

    set<int> lexiOrder;
    set<pair<int, int> > degOrder;
    for (int i = 1; i <= n; ++i) {
        lexiOrder.insert(i);
        degOrder.insert({degIn[i], i});
    }

    int offset = 0;
    vector<int> res;
    while (lexiOrder.size() > 3) {
        auto minDegIn = degOrder.begin();
        auto seMinDegIn = degOrder.begin();
        ++seMinDegIn;

        int cur;
        if (minDegIn->first - offset == 0) {
            res.push_back(minDegIn->second);
            cur = res.back();
            degOrder.erase(minDegIn);
            lexiOrder.erase(res.back());
        }
        else {
            if (res.empty() || *lexiOrder.begin() != a[res.back()]) {
                cur = *lexiOrder.begin();
            }
            else {
                auto tmp = lexiOrder.begin();
                ++tmp;
                cur = *tmp;
            }

            res.push_back(cur);
            lexiOrder.erase(cur);
            degOrder.erase({degIn[cur], cur});
        }

        degOrder.erase({degIn[a[cur]], a[cur]});
        ++degIn[a[cur]];
        ++offset;
        degOrder.insert({degIn[a[cur]], a[cur]});
    }

    for (auto x : lexiOrder) {
        res.push_back(x);
    }

    while (!check(res)) {
        next_permutation(res.end() - 3, res.end());
    }

    for (auto x : res)
        cout << x << ' ';
    cout << '\n';
}


int main() {
    #ifdef GLASSES_GIRL
        freopen(FILE_NAME".in", "r", stdin);
    #endif

    readInput();
    solve(); 
}


Measured memory_bytes: 11760
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan=new Scanner(System.in);
		
		int a=scan.nextInt();
		int b=scan.nextInt();
		int c=scan.nextInt();
		int counter=0;
		
		for(int i=a;i<=b;i++){
			if(c%i==0){
				counter++;
			}
		}
		System.out.println(counter);
		scan.close();
	}
}

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i < (int)(n); i++)
typedef long long ll;

int main() {
    int n; cin >> n;
    vector<string> V(n);
    rep(i,n) cin >> V[i];
    sort(V.begin(),V.end());
    V.erase(unique(V.begin(),V.end()),V.end());
    cout << V.size() << endl;
}

Measured memory_bytes: 9600
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = (A); I < (B); ++I)
#define FORR(I,A,B) for(ll I = (B-1); I >= (A); --I)
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define REV(x) (reverse(x.begin(),x.end())) //reverse
ll gcd(ll a,ll b){if(a<b)swap(a,b);if(a%b==0)return b;else return gcd(b,a%b);}
ll lcm(ll a,ll b){ll c=gcd(a,b);return ((a/c)*(b/c)*c);}//saisyo kobaisu
#define NEXTP(x) next_permutation(x.begin(),x.end())
const ll INF=1e18+7;
const ll MOD=1e9+7;


typedef pair<char,int> CI;
bool check1(CI x,CI y,CI z){
	if(x.first!=y.first || y.first!=z.first)return false;
	if(x.second==y.second && y.second == z.second) return true;
	if(x.second+1==y.second && y.second+1==z.second) return true;
	return false;
}
bool check(vector<CI> v){
	return check1(v[0],v[1],v[2])&&check1(v[3],v[4],v[5])&&check1(v[6],v[7],v[8]);
}


int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int T;
	cin >> T;
	FOR(t,0,T){
		vector<CI> cards(9);
		FOR(i,0,9)cin>>cards[i].second;
		FOR(i,0,9)cin>>cards[i].first;
		SORT(cards);
		bool ok = false;
		do{
			if(check(cards))ok=true;
		}while(NEXTP(cards));
		if(ok) cout << 1 << endl;
		else cout << 0 << endl;
	}
}


Measured memory_bytes: 3120
/*  -*- coding: utf-8 -*-
 *
 * c.cc: C - Subarray Sum
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>

using namespace std;

/* constant */

const int MAX_A = 1000000000;

/* typedef */

/* global variables */

/* subroutines */

/* main */

int main() {
  int n, k, s;
  scanf("%d%d%d", &n, &k, &s);

  int t = (s == MAX_A) ? MAX_A - 1 : MAX_A;

  for (int i = 0; i < n; i++) {
    if (i) putchar(' ');
    printf("%d", (i < k) ? s : t);
  }
  putchar('\n');
  return 0;
}


Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string S;
  cin>>S;
  if(S=="SUN")cout<<7<<endl;
  if(S=="MON")cout<<6<<endl;
    if(S=="TUE")cout<<5<<endl;
    if(S=="WED")cout<<4<<endl;
    if(S=="THU")cout<<3<<endl;
   if(S=="FRI")cout<<2<<endl;
   if(S=="SAT")cout<<1<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
    int main(){
        string S, T;
        int x;
            cin >> S;
            cin >> T;
                for(int i = 0; i < 3; i++){
                    if(S.at(i) == T.at(i)){
                        x += 1;
                    }
                }
                    cout << x;
    }

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

/**
 * @author radhakm
 * https://atcoder.jp/contests/dp/tasks/dp_a
 */
public class Main {
    static int[] h;
    static int n;
    static Integer[] dp;
    public static void main(String[] args) {
        InputReader reader = new InputReader(System.in);
        n = reader.nextInt();
        h = new int[n];
        dp = new Integer[n];
        for(int i=0;i<n;i++){
            h[i] = reader.nextInt();
        }
        System.out.println(frogJump(0));
    }

    static int frogJump(int idx){
        if(idx == n-1){
            return 0;
        }
        if(dp[idx]!=null){
            return dp[idx];
        }

        int minCost = Math.abs(h[idx] - h[idx+1]) + frogJump(idx+1);
        if(idx+2<n) {
            int cost = Math.abs(h[idx] - h[idx+2]) + frogJump(idx+2);
            minCost = Math.min(minCost,cost);
        }
        dp[idx] = minCost;
        return minCost;
    }
}

class InputReader {
  public BufferedReader reader;
  public StringTokenizer tokenizer;

  public InputReader(InputStream stream) {
    reader = new BufferedReader(new InputStreamReader(stream), 32768);
    tokenizer = null;
  }

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

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

Measured memory_bytes: 53120
#include<stdio.h>
int i;
char s[11],t[12];
int main(){
    scanf("%s%s",s,t);
    for(i=0;s[i]!='\0';i++){
        if(s[i]!=t[i]){puts("No");return 0;}
    }
    puts("Yes");
    return 0;
}

Measured memory_bytes: 1608
package main

import (
	"fmt"
)

func main() {
	var a, b, c string
	fmt.Scan(&a, &b, &c)
	if string(a[len(a)-1]) == string(b[0]) && string(b[len(b)-1]) == string(c[0]) {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


Measured memory_bytes: 512
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    a,b,c = map(int, input().split())
    if max(a,b,c) == a+b+c-max(a,b,c):
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Measured memory_bytes: 3316
#include<cstdio>
#include<algorithm>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

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

int h,w;
char B[20][20];

// ツタツイツδ?セツーツδ仰づ個湘ョツ陛ア
int n;
int id[8],val[8],s[8],g[8];
int val_sum[1<<8];

int dp[101][20][20][1<<8];
int dfs(int t,int y,int x,int S){
	int &res=dp[t][y][x][S];
	if(res!=-1) return res;

	if(t==100) return res=val_sum[S];

	int S_next=S;
	rep(i,n) if(s[i]<=t && t<g[i] && (S&1<<i)==0){ // i ツ氾板姪堋づ個タツイツδ?セツーツδ?
		bool ok=false; // ツ療猟静堋マツスツづ可渉、ツ品 id[i] ツつェツつ?づゥツつゥツづ?つ、ツつゥ
		rep(k,4){
			int yy=y+dy[k],xx=x+dx[k];
			if(0<=yy && yy<h && 0<=xx && xx<w && B[yy][xx]==id[i]+'0') ok=true;
		}
		if(ok) S_next|=1<<id[i];
	}

	res=0;
	rep(k,4){
		int yy=y+dy[k],xx=x+dx[k];
		if(0<=yy && yy<h && 0<=xx && xx<w && B[yy][xx]=='.'){
			res=max(res,dfs(t+1,yy,xx,S_next));
		}
	}
	return res;
}

int main(){
	for(;scanf("%d%d",&w,&h),w;){
		rep(i,h) rep(j,w) scanf(" %c",B[i]+j);
		scanf("%d",&n);
		rep(i,n) scanf("%d%d%d%d",id+i,val+i,s+i,g+i);

		rep(S,1<<n){
			val_sum[S]=0;
			rep(i,n) if(S&1<<i) val_sum[S]+=val[i];
		}

		int px,py;
		rep(i,h) rep(j,w) if(B[i][j]=='P') B[i][j]='.', px=j, py=i;

		rep(t,101) rep(i,h) rep(j,w) rep(S,1<<n) dp[t][i][j][S]=-1;
		printf("%d\n",dfs(0,py,px,0));
	}

	return 0;
}

Measured memory_bytes: 40000
solver::Int->Int->Int
solver m n =(maximum.concat.(map (\i->filter (\j->j*n<=m) [div m i,i])).(filter (\i->mod m i ==0)).(takeWhile (\i-> i^2 <=m))) [1..]

main::IO()
main=do
  (n:m:[])<-(return.(map read).words)=<<getLine
  print (solver m n)

Measured memory_bytes: 508
/* ****revpro**** */
// #pragma GCC target ("avx2")
// #pragma GCC optimization ("O3")
// #pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define endl     '\n'
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll)x.size()
#define hell        1000000007
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define repr(i,a,b) for(ll i=b-1;i>=a;i--)    
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define mii      map<ll,ll>
using namespace std;

#define TIME        cerr << "\nTime elapsed: " << setprecision(5) <<1000.0 * clock() / CLOCKS_PER_SEC << "ms\n";
#define FAST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define N  100005
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;  
#define ordered_set tree<double, null_type,less<double>, rb_tree_tag,tree_order_statistics_node_update> 
void solve()
{
 ll a[3];
 rep(i,0,3) cin>>a[i];
 swap(a[0],a[1]);
 swap(a[0],a[2]);
 rep(i,0,3) cout<<a[i]<<' '; 
}
signed main()
{
  
    /***********************************/
    unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
    mt19937_64 generator (seed);
    /***********************************/
 
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int TESTS=1;
//  cin>>TESTS;
  while(TESTS--)
  {
    solve();
    
  }
  TIME
  return 0;
}

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

ll top(int x) {
	return 1 << (31 - __builtin_clz(x));
}

int main()
{
	int N;
	cin >> N;
	vector<ll> A(N);
	map<ll, int> mp;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
		mp[A[i]] += 1;
	}
	sort(A.rbegin(), A.rend());
	int res = 0;
	for (int i = 0; i < N; i++) {
		if ((A[i] & (A[i] - 1)) == 0) {
			res += mp[A[i]] / 2;
			mp.erase(A[i]);
		}
		else {
			ll val = top(A[i]) * 2 - A[i];
			int cnt = min(mp[A[i]], mp.count(val) ? mp[val] : 0);
			res += cnt;
			if (mp.count(val)) mp[val] -= cnt;
			mp.erase(A[i]);
		}
	}
	cout << res << endl;
	return 0;
}


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

int main()
{
    double x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    double distance = sqrt(pow(x1-x2, 2.0) + pow(y1-y2, 2.0));
    cout << fixed << setprecision(15) << distance << endl;
}


Measured memory_bytes: 3264
<?php
  $n = trim(fgets(STDIN));
  $h = explode(" " , trim(fgets(STDIN)));
  $min = $h[0];
  if($min > 0){
    $min--;
  }
  
  for($i=1; $i<$n; $i++){
    if($min <= $h[$i]){
      if($min == $h[$i]){
        $min = $h[$i];
      }else{
        $min = $h[$i]-1;
      }
    }else{
      echo "No\n";
      exit;
    }
  }
  echo "Yes\n";

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

int main() {
  long a, b, c, x, y;
  cin>>a>>b>>c>>x>>y;
  long ans = 1e10;
  for (int i=0; i<=max(2*x, 2*y); i+=2) {
    int na = max(x - i / 2, 0l);
    int nb = max(y - i / 2, 0l);
    ans = min(a * na + b * nb + c * i, ans);
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 384
function Main(input) {
    input = input.split("\n");
    var m = input[0].split(" ").map(Number);
    input.shift();
    var arr = new Array(35).fill(0);
    input.forEach(function(val){
        var mem = val.split(" ").map(Number);
        mem.shift();
        mem.forEach(function(p){
            arr[p]++;
        });
    })
    var ans = 0;
    arr.forEach(function(val){
      if(val==m[0]) ans++;  
    })
    console.log(ans);
}Main(require("fs").readFileSync("/dev/stdin","utf8").trim());


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

#include <boost/range/adaptors.hpp>
#include <boost/range/combine.hpp>
#include <boost/range/irange.hpp>

using namespace std;
using namespace boost;
using namespace boost::adaptors;

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

    cout << 8 - (n - 400) / 200 << endl;
}

Measured memory_bytes: 3632
#include<cstdio>
#include<algorithm>
using namespace std;
int gi(){
	int x=0,w=1;char ch=getchar();
	while ((ch<'0'||ch>'9')&&ch!='-') ch=getchar();
	if (ch=='-') w=0,ch=getchar();
	while (ch>='0'&&ch<='9') x=(x<<3)+(x<<1)+ch-'0',ch=getchar();
	return w?x:-x;
}
int main(){
	long long a=gi(),b=gi(),c=gi();
	printf("%lld\n",min(b+c,a+b+b+1));
	return 0;
}


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

#define ll long long

using namespace std;

int main()
{
  int n;
  cin>>n;
  string s,t,p="";
  cin>>s>>t;
  for(int i=0; i<n; i++){
      p+=s[i];
      p+=t[i];
      

  }
cout<<p<<endl;

}


Measured memory_bytes: 256