akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/integer/common_factor.hpp>
#include <boost/integer/common_factor_rt.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>

using std::string;
using std::vector;
using std::set;
using std::multiset;
using std::unordered_set;
using std::map;
using std::multimap;
using std::unordered_map;
using std::pair;
using std::cin;
using std::cout;

using boost::multiprecision::cpp_int;
using cpp_dec_float_1000 = boost::multiprecision::number<boost::multiprecision::cpp_dec_float<1000, boost::int128_type>>;

typedef uintmax_t    ull;
typedef intmax_t     ll;
typedef uint64_t     ul;
typedef uint32_t     ui;
typedef uint8_t      uc;

constexpr char CRLF  = '\n';
constexpr char SPACE = ' ';
constexpr char VECTOR_COUT_SEPARATOR = SPACE;
constexpr ll INF = 1000'000'007;
constexpr int MOD = 1000'000'007;

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; }
template<class T> std::ostream& operator<< (std::ostream& os, const std::vector<T>& vc) { for(auto it = vc.begin(); it != vc.end(); ++it) { if (std::next(it) == vc.end()) os << *it; else os << *it << VECTOR_COUT_SEPARATOR; } return os; }
template<class T1, class T2> inline std::ostream & operator<< (std::ostream & os, const std::pair<T1, T2> & p) { return os << p.first << ' ' << p.second; }
template<class T> T modinv(T a, T m) { T b = m, u = 1, v = 0; while (b) { T t = a / b; a -= t * b; boost::swap(a, b); u -= t * v; boost::swap(u, v); } u %= m; if (u < 0) u += m; return u; }
template<class T> inline bool isSosuu(const T& n) { if (n == T(1)) { return false; } for (T i = 2; i*i <= n; ++i) { if (n % i == 0) { return false; } } return true; }
template<class T> vector<vector<T>> split (const vector<T>& S, T delim) { vector<vector<T>> ret{}; vector<T> buff{}; for (auto c : S) { if (c == delim) { if (!buff.empty()) ret.push_back(buff); buff.clear(); } else { buff.push_back(c); } } if (!buff.empty()) ret.push_back(buff); return ret; }
template<class T> inline void printYesNo(const T& t) { cout << (t ? "Yes" : "No") << CRLF; }
template<class T = int64_t> T modpow(T N, T P, T M) { T ret{1}; N %= M; while (P) { if (P & 0x01) { ret *= N; ret %= M; } P >>= 1; N *= N; N %= M; } return ret; }

/** code for assert debug begin */
int gErr = 0;
#define ASSERT(p) if(!(p)){ gErr = 1; }else{ ; }
/** code for assert debug end */

struct Tmp
{
public:
  int N;
  Tmp(int N)
  : N(N)
  {}
};

void solve(void)
{
  int S, W; cin >> S >> W;
  auto ans = W >= S;
  cout << (ans ? "unsafe" : "safe") << CRLF;
  return;
}

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

  solve();

  return 0;
}


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

int main() {

  string s;
  cin >> s;
  
  if(s.size() % 2 >= 1) {
    cout << "No" << endl;
    return 0;
  }
  int tmp = 0;
  for(int i = 0; i < s.size()-1; i++) {
    if(s.at(i) == 'h') {
      if(s.at(i+1) == 'i') {
        tmp++;
      }
    }
  }
  if(tmp == s.size() / 2) {
    cout << "Yes" << endl;
    return 0;
  } else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
// 생각을 하는 시간이 오래걸리는게 아니라 
// 헷갈려하는 시간이 가장 시간을 좀먹는다.
// 엄청나게 시간이 빨리간다. 차라리 노가다를 해서 명쾌하게 만드는게 가장 빠른 방법이다.

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <iostream>
#include <vector>


using namespace std;

char str[200];
int n;

long long dy0[200][10];
long long dy1[200][10];

int d(int a, int b, int c) {
	if (a == 0) return 0;
	if (a == 1) return dy1[b][c];
	if (c > 0) {
		return d(1, b, c) + ((long long)a - 1) * dy0[b][c - 1];
	}
	else {
		return 0;
	}
}

//~ using namespace __gnu_pbds; 
#define mp make_pair
#define endl '\n'
typedef long long ll;

const int INF = 1e9 + 5;
const ll lim = (ll)3e16;
const int N = 1e6 + 5;
const int mod = 1e9 + 7;
const ll oo = 1e18 + 5;

//~ typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

int check(string s, int k) {
	ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(0);
	int n = (int)s.size();
	vector<vector<vector<ll>>> dp(n + 5, vector<vector<ll>>(k + 5, vector<ll>(2)));
	dp[0][0][0] = 1;
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < 2; ++j) {
			for (int cnt = 0; cnt < k + 1; ++cnt) {
				int pre_num;
				if (j) pre_num = 9;
				else pre_num = s[i] - '0';
				for (int dig = 0; dig <= pre_num; ++dig) {
					dp[i + 1][cnt + (dig != 0)][j || dig < pre_num] += dp[i][cnt][j];
				}
			}
		}
	}
	//	cout << dp[n][k][0] + dp[n][k][1];
	return dp[n][k][0] + dp[n][k][1];
}





int main(void) {
	int result = scanf("%s %d", str, &n);
	
	dy0[0][0] = 1;
	dy1[0][1] ++;
	for (int i = 1; i <= 150; i++) {
		dy0[i][0] = 1;
		for (int j = 1; j <= 4; j++) {
			dy0[i][j] = dy0[i - 1][j] + 9 * dy0[i - 1][j - 1];
			dy1[i][j] = dy0[i][j];
		}
		dy1[i][1] ++;
	}


//	for (int k = 1; k <= 1000000; k++) {
//		n = 2;
//		sprintf(str, "%d", k);
		int len = strlen(str);

		int dap = 0;
		int n2 = n;
		for (int i = 0; i < len; i++) {
			if (n2 < 0) break;
			dap += d(str[i] - '0', len - i - 1, n2);
			if (str[i] != '0') n2--;
		}


//		int cval = check(str);
		printf("%d\n", dap);
//		printf("%d\n\n", check(string(str), n));
//		if (dap != cval) {
//			printf("error");
//			break;
//		}
//	}
	return 0;
}



Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main()
{
    char a, b;
    cin >> a >> b;
    if(a == 'H'){
        if(b == 'H') cout << 'H' << endl;
        else         cout << 'D' << endl;
    }
    else{
        if(b == 'H') cout << 'D' << endl;
        else         cout << 'H' << endl;
    }
    return 0;
}

Measured memory_bytes: 256
X = int(input())

def binary_search(b):
    l, r = -10 ** 9, 10 ** 9
    while r-l > 1:
        m = (l+r)//2
        x = m**5 - b**5
        if x < X:
            l = m
        else:
            r = m
    return r

for b in range(-10000, 10000):
    a = binary_search(b)
    if a ** 5 - b ** 5 == X:
        print(a, b)
        break


Measured memory_bytes: 68144
def bubblesort(N, A):
    """Do BubbleSort"""
    m = 0
    flag = True
    while(flag):
        flag = False
        for i in range(N-1, 0, -1):
            if (A[i-1] > A[i]):
                tmp = A[i-1]
                A[i-1] = A[i]
                m += 1
                A[i] = tmp
                flag = True
    b = list(map(str, A))
    print(" ".join(b))
    print(m)

A = []
N = int(input())
s = input()
A = list(map(int, s.split()))
bubblesort(N, A)

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

int main()
{
  int K, S;
  cin >> K >> S;
  int ans = 0;
  vector<int> v;
  int x = min(K,S);
  for(int i = 0; i <= x; i++)
    v.push_back(S-i);
  sort(v.begin(),v.end());
  for(int i = 0; i <= x; i++){
    for(int j = 0; j <= min(S-i,K); j++){
      ans += upper_bound(v.begin(),v.end(),i+j)-lower_bound(v.begin(),v.end(),i+j);
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
/*
これを入れて実行
g++ code.cpp
./a.out
 */
 
#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <cmath>
#include <math.h>
#include <tuple>
#include <iomanip>
 
using namespace std;
typedef long long ll;
typedef long double ld;
 
int dy4[4] = {-1, 0, +1, 0};
int dx4[4] = {0, +1, 0, -1};
int dy8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dx8[8] = {0, 1, 1, 1, 0, -1, -1, -1};
 
const long long INF = 1LL << 60;
const ll MOD = 1e9 + 7;
 
bool greaterSecond(const pair<int, int>& f, const pair<int, int>& s){
    return f.second > s.second;
}
 
ll gcd(ll a, ll b){
	if (b == 0)return a;
	return gcd(b, a % b);
}
 
ll lcm(ll a, ll b){
    return a / gcd(a, b) * b;
}
 
ll nCr(ll n, ll r){
    if(r == 0 || r == n){
        return 1;
    } else if(r == 1){
        return n;
    }
    return (nCr(n - 1, r) + nCr(n - 1, r - 1));
}
 
ll nPr(ll n, ll r){
    r = n - r;
    ll ret = 1;
    for (ll i = n; i >= r + 1; i--) ret *= i;
    return ret;
}
 
//-----------------------ここから-----------

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

    int ans = 1;
    char now = s[0];
    for(int i = 1; i < n; i++){
        if(s[i] != now){
            ans++;
            now = s[i];
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 512
import bisect

keys=[]

q=int(input())
d={}

def find(x):
    index=bisect.bisect_left(keys,x)
    if index==len(keys):
        return -1
    if keys[index]==x:
        return index
    else:
        return -1


for _ in range(q):
    query=input().split(" ")
    if query[0]=="0":
        if find(query[1])!=-1:
            pass
        else:
            bisect.insort_left(keys, query[1])
        d[query[1]]=query[2]
    elif query[0]=="1":
        if find(query[1])!=-1:
            print(d[query[1]])
        else:
            print(0)
    elif query[0]=="2":
        while find(query[1])>=0:
            keys.pop(find(query[1]))



Measured memory_bytes: 43176
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;

class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null){
int a=Integer.parseInt(line);
BigInteger x=BigInteger.valueOf(a);
System.out.println(prevProbablePrime(a)+" "+x.nextProbablePrime());
}
}
public static int prevProbablePrime(int a){
a--;
while(true){
BigInteger y=BigInteger.valueOf(a);
if(y.isProbablePrime(16)){
return a;
}
a--;
}
}
}

Measured memory_bytes: 21964
#include <cstdio>
#include <cstring>
int w,h;
int f[22][22];
int dp[22][22];
int dx[] = {-1,0,1};
int solve(int x,int y){
  //printf("(%d,%d) = %d\n",x,y,f[x][y]);
  if(f[x][y] == 1) return 0;
  if(y >= h){
    //puts("OK ... 1");
    return 1;
  }
  if(f[x][y] == 1) return 0;
  if(dp[x][y] >= 0){
    //printf("OK ... %d\n",dp[x][y]);
    return dp[x][y];
  }
  if(f[x][y] == 2){
    //puts("Jump");
    return dp[x][y] = solve(x,y + 2);
  }

  int ret = 0;
  for(int i = 0; i < 3; i++){
    int nx = x + dx[i];
    if(!f[nx][y+1] || (!dx[i] && f[nx][y+1] == 2)){
      ret += solve(nx,y+1);
    }
  }
  return dp[x][y] = ret;
}
int main(void){
  while(1){
    scanf("%d%d",&w,&h); if(!w) break;
    memset(f,-1,sizeof(f));
    memset(dp,-1,sizeof(dp));
    for(int i = 1; i <= h; i++){
      for(int j = 1; j <= w; j++){
	scanf("%d",&f[j][i]);
      }
    }
    int ans = 0;
    for(int j = 1; j <= w; j++){
      ans += solve(j,1);
    }
    printf("%d\n",ans);
  }
}

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

int main(){
    int a[3];
    for(int i = 0; i < 3; i++) cin >> a[i];
    sort(a,a+3,greater<int>());
    if(a[0] == a[1]+a[2]) cout << "Yes" << endl;
    else cout << "No" << endl;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

//INSERT ABOVE HERE
const Int MAX = 5050;
Int solve(Int ga,Int sa,Int ba,Int gb,Int sb,Int bb,Int n){
  using P = pair<Int, Int>;
  vector<P> vt;
  vt.emplace_back(ga,gb);
  vt.emplace_back(sa,sb);
  vt.emplace_back(ba,bb);
  auto comp=[](P a,P b){return a.second*b.first<b.second*a.first;};
  sort(vt.begin(),vt.end(),comp);

  Int res=n;
  tie(ga,gb)=vt[0];
  tie(sa,sb)=vt[1];
  tie(ba,bb)=vt[2];

  for(Int i=0;i<MAX;i++){
    if(i*ga>n) break;
    for(Int j=0;j<MAX;j++){
      Int sum=i*ga+j*sa;
      if(sum>n) break;
      Int k=(n-sum)/ba;
      assert(n-(i*ga+j*sa+k*ba)>=0);
      chmax(res,n-(i*ga+j*sa+k*ba)+(i*gb+j*sb+k*bb));
    }
  }
  return res;
}

signed main(){
  Int n;
  cin>>n;

  Int ga,sa,ba;
  Int gb,sb,bb;
  cin>>ga>>sa>>ba;
  cin>>gb>>sb>>bb;

  Int p=solve(ga,sa,ba,gb,sb,bb,n);
  Int q=solve(gb,sb,bb,ga,sa,ba,p);
  cout<<q<<endl;
  return 0;
}


Measured memory_bytes: 256
N = int(input())
A = sorted([int(input()) for _ in range(N)], reverse=True)
result = 0
if N % 2 == 0:
    k = [2]*((N-2)//2)
    k += [1]
    k += [-1]
    a = [-2]*((N-2)//2)
    k = k+a
    for a, keisu in zip(A, k):
        result += a*keisu
else:
    k = [2]*(N//2-1)
    k += [1]
    k += [1]
    a = [-2]*(N//2)
    k = k+a
    result1 = 0
    for a, keisu in zip(A, k):
        result1 += a*keisu
    k = [2]*(N//2)
    k += [-1]
    k += [-1]
    a = [-2]*(N//2-1)
    k = k+a
    result2 = 0
    for a, keisu in zip(A, k):
        result2 += a*keisu
    result = max(result1, result2)
print(result)

Measured memory_bytes: 8612
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i=0; i<(int)(n); i++)
#define all(x) x.begin(), x.end()
#define mod 1000000007
typedef long long ll;

int main(){
  int n;
  cin >> n;
  vector<ll> vec(n+2);
  vector<ll> dis(n+1);
  vec[0] = 0;
  rep(i, n) cin >> vec[i+1];
  vec[n+1] = 0;
  rep(i, n+1) dis[i] = abs(vec[i+1]-vec[i]);
  ll sum = 0;
  rep(i, n+1) sum += dis[i];
  rep(i, n) cout << sum-dis[i]-dis[i+1]+abs(vec[i+2]-vec[i]) << endl;
  return 0;
}

Measured memory_bytes: 4852
type list = Nil | Node of node
 and node = { key:int; mutable prev : list; mutable next : list };;

let (!^) = function
    Nil -> invalid_arg "invalid"
  | Node n -> n;;

let new_node key = {key=key;prev=Nil;next=Nil};;
let hd = new_node (-1) and
    tl = new_node (-1);;

let () =
  hd.next <- (Node tl);
  ((!^) hd.next).prev <- (Node hd);;

let insert key =
  let c = new_node key in
  c.next <- hd.next;
  ((!^) hd.next).prev <- (Node c);
  hd.next <- (Node c);
  c.prev <- (Node hd)
;;

let print_list () =
  let current_node = ((!^) hd.next) in
  let rec loop node i =
    if node == tl then print_newline ()
    else
      begin
        if i = 1 then print_string " ";
        Printf.printf "%d" (node.key);
        loop ((!^) node.next) 1
      end
  in loop current_node 0
;;

let delete_node node =
  if node == tl then ()
  else
    begin
      ((!^) node.prev).next <- node.next;
      ((!^) node.next).prev <- node.prev
    end
;;

let delete_first () =
  delete_node ((!^) hd.next);;

let delete_last () =
  delete_node ((!^) tl.prev);;

let search_list key =
  let current_node = ((!^) hd.next) in
  let rec loop node =
    if node != tl && node.key != key then
      loop ((!^) node.next)
    else
      node
  in loop current_node
;;

let delete key =
  delete_node (search_list key);;

let split str =
  let rec split_inner ct b=
    if String.length str == ct then [b]
    else
      match str.[ct] with
        ' ' -> b::split_inner (ct+1) ""
      | c -> split_inner (ct+1) (b^(Char.escaped c))
  in split_inner 0 "";;

let () =
  let n = read_int () in
  let rec read = function
      0 -> print_list ()
    | i ->
       let line = read_line ()
                |> split
                |> Array.of_list
       in
       let op = line.(0) in
       if op = "insert" then
         insert (int_of_string line.(1))
       else if op = "delete" then
         delete (int_of_string line.(1))
       else if op = "deleteFirst" then
         delete_first ()
       else if op = "deleteLast" then
         delete_last ()
       ;read (i-1)
  in read n;;

Measured memory_bytes: 78436
#include<bits/stdc++.h>
using namespace std;
int main(){
  string w;int a=0,p;cin>>w;
  p=w.size();
  if(p%2!=0)a++;
  else{
    vector<char> c(p);
    for(int i=0;i<p;i++)c.at(i)=w.at(i);
    sort(c.begin(),c.end());
    for(int j=0;j<p/2;j++){
      if(c.at(j*2)!=c.at(j*2+1)){
        a++;
        break;
      }
    }
  }
  if(a>0)cout<<"No"<<endl;
  else cout<<"Yes"<<endl;
}


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

int main() {
    int a,b;
    char s[11];
    char t[11];
    char u[11];

    scanf("%s %s",s,t);
    scanf("%d %d",&a,&b);
    scanf("%s",u);



    if(strcmp(s,u) == 0) {
        a = a - 1;
    }
    else if(strcmp(t,u) == 0) {
        b = b - 1;
    }

    printf("%d %d\n",a,b);
    return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int main()
{
  string s;
  cin>>s;
  int ans = 0,cnt = 0;
  for(int i=0;i<3;i++){
    if(s[i]=='R')
      cnt++;
    else{
      ans = max(ans,cnt);
      cnt = 0;
    }
  }
  ans = max(ans,cnt);
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 3628
#[allow(dead_code)]
fn main() {
    let (n, a, b) = (i::u(), i::u(), i::u());
    if b < a {
        println!("{}", 0);
        return;
    }
    if n == 1 && a != b {
        println!("{}", 0);
        return;
    }
    let asum = a * (n - 1) + b;
    let bsum = b * (n - 1) + a;
    println!("{}", bsum - asum + 1);
}

#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::{HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::io::*;
#[allow(unused_imports)]
use std::num::*;
#[allow(unused_imports)]
use std::str::*;

#[allow(dead_code)]
mod i {
    use super::*;

    pub fn read<T: FromStr>() -> T {
        stdin()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>()
            .parse::<T>()
            .ok()
            .unwrap()
    }

    pub fn str() -> String {
        read()
    }

    pub fn s() -> Vec<char> {
        str().chars().collect()
    }

    pub fn i() -> i64 {
        read()
    }

    pub fn u() -> usize {
        read()
    }

    pub fn u2() -> (usize, usize) {
        (read(), read())
    }

    pub fn u3() -> (usize, usize, usize) {
        (read(), read(), read())
    }

    pub fn f() -> f64 {
        read()
    }

    pub fn c() -> char {
        read::<String>().pop().unwrap()
    }

    pub fn iv(n: usize) -> Vec<i64> {
        (0..n).map(|_| i()).collect()
    }

    pub fn iv2(n: usize) -> Vec<(i64, i64)> {
        (0..n).map(|_| iv(2)).map(|a| (a[0], a[1])).collect()
    }

    pub fn uv(n: usize) -> Vec<usize> {
        (0..n).map(|_| u()).collect()
    }

    pub fn uv2(n: usize) -> Vec<(usize, usize)> {
        (0..n).map(|_| uv(2)).map(|a| (a[0], a[1])).collect()
    }

    pub fn uv3(n: usize) -> Vec<(usize, usize, usize)> {
        (0..n).map(|_| uv(3)).map(|a| (a[0], a[1], a[2])).collect()
    }

    pub fn fv(n: usize) -> Vec<f64> {
        (0..n).map(|_| f()).collect()
    }

    pub fn cmap(h: usize) -> Vec<Vec<char>> {
        (0..h).map(|_| s()).collect()
    }
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> iint;
typedef pair<ll,ll> llll;
#define ALL(x) (x).begin(),(x).end()
const ll zero = 0;
const ll INF = 3000000000000000000; //10^18
const int inINF = 1000000000; //10^9
const ll MOD = 1000000007; //10^9+7
const ll MOD2 = 998244353;
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

int main(){
    string s;
    cin >> s;
    int x, y;
    cin >> x >> y;
    int n;
    n = 0;
    int L = s.length();
    for (int i = 0; i < L; i++) {
        if(s[i] == 'F'){
            n++;
        }
        else{
            break;
        }
    }
    vector<int> even, odd;
    int tmp = 0;
    bool check = false; //falseのときoddに入れる
    for (int i = n+1; i < L; i++) {
        if(s[i] == 'T'){
            if(check){
                if(tmp != 0){
                    even.push_back(tmp);
                }
            }
            else{
                if(tmp != 0){
                    odd.push_back(tmp);
                }
            }
            tmp = 0;
            check = !check;
        }
        else{
            tmp++;
        }
    }
    if(check){
        if(tmp != 0){
            even.push_back(tmp);
        }
    }
    else{
        if(tmp != 0){
            odd.push_back(tmp);
        }
    }

    int E, O;
    int LE, LO;
    LE = even.size();
    LO = odd.size();
    E = 0; O = 0;
    for (int i = 0; i < LE; i++) {
        E += even[i];
        //printf("%d ", even[i]);
    }
    //printf("\n");
    for (int i = 0; i < LO; i++) {
        O += odd[i];
        //printf("%d ", odd[i]);
    }
    //printf("\n");

    if((abs(E - x + n) % 2 == 1) || (E - x + n < 0)){
        No();
        return 0;
    }
    if((abs(O - y) % 2 == 1) || (O - y < 0)){
        No();
        return 0;
    }

    vector<bool> dp(E+1, false);
    dp[0] = true;
    for (int i = 0; i < LE; i++) {
        for (int j = E; j >= 0; j--) {
            if(j - even[i] >= 0 && dp[j - even[i]] == true){
                dp[j] = true; 
            }
        }
    }
    if(dp[(E - x + n) / 2] == false){
        No();
        return 0;
    }

    dp.resize(O + 1);
    fill(ALL(dp), false);
    dp[0] = true;
    for (int i = 0; i < LO; i++) {
        for (int j = O; j >= 0; j--) {
            if(j - odd[i] >= 0 && dp[j - odd[i]] == true){
                dp[j] = true; 
            }
        }
    }
    if(dp[(O-y) / 2] == false){
        No();
        return 0;
    }

    Yes();
    return 0;


}

Measured memory_bytes: 3644
#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define f first
#define s second
#define pb push_back
#define eb emplace_back
#define mk make_pair
#define mt make_tuple
#define MOD 1000000007
#define fo(i,a,b) for(i=a;i<b;i++)
#define foe(i,a,b) for(i=a;i<=b;i++)
#define all(x) x.begin(), x.end()
#define vi vector<int>
#define vl vector <long long int>
#define pii pair <int,int>
#define pll pair <long long int, long long int>
#define vpii vector< pair<int,int> >
#define vpll vector < pair <long long int,long long int> >
#define boost ios::sync_with_stdio(false); cin.tie(0)
using namespace std;
const int inf = 2e9 + 5;
const ll inf64 = 1e18 + 5;

int main()
{
	boost;
	ll n, i;
	cin >> n;
	
	vector <pll> v(n);
	fo(i, 0, n)
	cin >> v[i].f >> v[i].s;
	
	sort(all(v), [&](const pll &p1, const pll &p2) {return p1.s < p2.s;});
	
	ll mx = -inf, my = -inf, ans = 0;	
	fo(i, 0, n) {
		ll x = v[i].f, y = v[i].s;
		ll c0 = y + x, c1 = y - x;
		ans = max(ans, max(c0 + mx, c1 + my));
		mx = max(mx, -y - x);
		my = max(my, -y + x);
	}
	
	cout << ans;
}


Measured memory_bytes: 6336
#include<iostream>
#include<math.h>

using namespace std;

int main(void){

    int num[3];
    cin >> num[2] >> num[1] >> num[0];

    int sum = 0;
   
    for(int i = 2; i >= 0; i--){
        sum += num[i] * pow(10,i);
    }
   
    if(sum % 4 == 0){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }
   
    return 0;
}

Measured memory_bytes: 512
def isCLKWISE(ph) : return not ((ph[-1][0] - ph[-3][0])*(- ph[-3][1] + ph[-2][1]) - (ph[-2][0] - ph[-3][0])*(- ph[-3][1] + ph[-1][1] ) < 0)
      
def ConvexHullScan(P) :
 P = sorted(P)
 phU = []
 phU.append(P[0])
 phU.append(P[1])
 for p in P[2:] :
  phU.append(p)
  if isCLKWISE(phU) : continue
  while(True) :
   del phU[-2]
   try :
    if isCLKWISE(phU) : break
   except IndexError : break
 phL = []
 phL.append(P[-1])
 phL.append(P[-2])
 for p in P[-3::-1] :
  phL.append(p)
  if isCLKWISE(phL) : continue
  while(True) :
   del phL[-2]
   try:
    if isCLKWISE(phL) : break
   except IndexError : break
 ph = phU + phL[1:-1]
 return ph
  
n = range(int(input()))
P = [[int(x) for x in input().split()] for _ in n]
P = ConvexHullScan(P)
P.reverse()
print(len(P))
idx = min([[x[1][1],x[1][0],x[0]] for x in enumerate(P)])[2]
for p in P[idx:] + P[:idx] : print(p[0],p[1])

Measured memory_bytes: 33284
s = input()
next_word = 'h'
is_correct = False

for word in s:
    if word != next_word:
        print('No')
        exit()
    elif word == next_word:
        if next_word == 'h':
            next_word = 'i'
            is_correct = False
        elif next_word == 'i':
            next_word = 'h'
            is_correct = True

if is_correct:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 2940
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)


class ListNode:
    def __init__(self, val=0, next=None):
        self.val = val
        self.next = next


def main():
    N, K = [int(i) for i in input().split()]
    teleporters = [int(i) for i in input().split()]

    # step1: find loop
    visited = set()
    visited.add(1)
    pos = 1
    loop = [1]
    while True:
        next = teleporters[pos-1]
        if next not in visited:
            pos = next
            visited.add(next)
            loop.append(next)
        else:
            loop_start = loop.index(next)
            break

    init = loop[:loop_start]
    loop = loop[loop_start:]
    if K < len(init):
        return init[K]
    else:
        K = K - len(init)
        return loop[K % len(loop)]


if __name__ == "__main__":
    print(main())


Measured memory_bytes: 32252
a, b, h, m = gets.split.map(&:to_i)

x = (60 * h + m).fdiv(60 * 12) * 360
y = m.fdiv(60) * 360
puts Math.sqrt(a ** 2 + b ** 2 - 2 * a * b * Math.cos((x - y) / 180 * Math::PI))

Measured memory_bytes: 14668
#!/usr/bin/env python3
n = int(input())
a = list(map(int, input().split()))
# 欲しいのは絶対値の和、abs の絶対値、負の数
if len([i for i in a if i < 0]) % 2:
    print(sum([abs(i) for i in a]) - 2 * min([abs(i) for i in a]))
else:
    print(sum([abs(i) for i in a]))


Measured memory_bytes: 14252
#include<bits/stdc++.h>
using namespace std;
int main(){
	int x;
	cin>>x;
	int now=0;
	for(int i=0;i<x;i++){
		now*=10;
		now+=7;
		now=now%x;
		if(now==0){
			cout<<i+1<<endl;
			return 0;
		}
	}cout<<-1<<endl;
}

Measured memory_bytes: 3624
#include <iostream>
#include <cstdio>
#include <iomanip>
#include <string>
#include <cmath>
#include <algorithm>
#include <iomanip> 
#include <cstring>
#include <queue>
#include <stack> 
#include <vector>
#include <map>
#include <set>
using namespace std;
typedef long long ll;
ll a,b,c;
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin >>a >>b >>c;
	ll res;
	if(a+b==c){
		res = a + 2 * b;
	}else if(a + b < c){
		res = a + 2 * b + 1;
	}else{
		res = b + c;
	}
	cout << res <<endl;
	return 0;
}


Measured memory_bytes: 888
#include <bits/stdc++.h>
#define INF 5000000000000000000
#define ll long long
#define pll pair<ll, ll>
using namespace std;

ll N;
string s;
void dfs(ll index, char M)
{
  if (index == N) {
    cout << s << "\n";
    return;
  }
  for (ll i = 0; i <= M - 'a' + 1; ++i) {
    s[index] = (char)('a' + i);
    dfs(index + 1, max(M, (char)('a' + i)));
  }
}

int main()
{
  cin >> N;
  s = "";
  for (ll i = 0; i < N; ++i) {
    s += 'a';
  }
  dfs(1, 'a');
}


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

int main()
{
    int N;
    std::cin >> N;
    std::vector<int> array(N);
    for(int i=0; i<N; i++)
    {
        std::cin >> array[i];
    }

    int ans = 0;
    for(int i=1; i<=N; i++)
    {
        if(i%2 != 0)
        {
            if(array[i-1]%2 != 0) ans++;
        }
    }

    std::cout << ans << std::endl;

    return 0;
}

Measured memory_bytes: 3568
// C++ 14
#include <bits/stdc++.h>
using namespace std;
template <typename T>  ostream& operator<<(ostream& os, const vector<T>& v)  {  os << "[";  for (int i = 0; i < v.size(); ++i) {  os << v[i];  if (i != v.size() - 1)  os << ", ";  }  os << "]";  return os;  }
template <typename T> void print(T v, string s = "\n") { cout << v << s; }
template <typename T> void in(T& v) { cin >> v; }
#define ll long long
#define loop(__x, __start, __end) for(int __x = __start; __x < __end; __x++)

/*
*/
int main() {
  ll n,k; in(n),in(k);
  vector<ll> P(n), C(n);
  loop(i,0,n) in(P[i]),P[i]--;
  loop(i,0,n) in(C[i]);
  
  ll ans = -100000000000000000;
  
  // 開始点を全探索.
  loop(i,0,n) {
    int cur = i;
    vector<ll> acc { 0 }; // ループ中の各ステップの累積和.
    
    // スタート地点iに到達したらループ検知. Pは順列なので必ずスタート地点からループする.
    while (true) {
      ll score = C[P[cur]];
      acc.push_back(acc.back() + score);
      cur = P[cur];
      if (cur == i) break;
    }
    
    int cnt = acc.size()-1;
    
    // kがループの長さ以下の場合、ループ内のk個までしかとれない.
    if (k <= cnt) {
      loop(i,0,k) ans = max(ans, acc[i+1]);
      continue;
    }
    
    // ループの合計が0以下なので、周回する意味がない.
    if (acc.back() <= 0) {
      loop(i,0,cnt) ans = max(ans, acc[i+1]);
    }
    
    // m回完全周回出来る時、m回周回するよりもm-1回周回して残りを部分的にとった方がいい場合がある.
    // なのでまずはm-1回分すべて取る.
    ll score = acc.back() * ((k/cnt) - 1);
    ans = max(ans, score);
    
    // m周回まで進めてその間で最大値を見つける.
    loop(i,0,cnt) {
      ans = max(score + acc[i+1], ans);
    }
    score += acc.back();
    ans = max(ans, score);
    
    // m回の完全周回を過ぎたあと、r回部分的にコマを進められる.
    int r = k%cnt;
    loop(i,0,r) {
      ans = max(score + acc[i+1], ans);
    }
  }
  print(ans);
  return 0;
}


Measured memory_bytes: 3716
#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <string>
#include <string.h>

using namespace std;

int main() {
  int n,m,k[40],a[40][40], num = 0;
  cin >> n >> m;
  for(int i = 0; i < n; i++) {
    cin >> k[i];
    for(int j = 0; j < k[i]; j++)
      cin >> a[i][j];
  }

  for(int x = 1; x <= m; x++) {
    int sum = 0;
    for(int i = 0; i < n; i++) {
      for(int j = 0; j < k[i]; j++) {
        if(a[i][j] == x) sum++;
      }
    }
    if(sum == n) num++;
  }

  cout << num << endl;
}

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

int main() {
    int A,B,C;
    cin >>A>>B>>C;
    int res;

    int M = max({A,B,C});
    int check = 3 * M - (A+B+C);
    if(check % 2 == 0) {
        res = check / 2;
    } else {
        res = (check + 3) / 2;
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    string s;
    cin >> s;
    ll n = s.size();
    vector<ll> ret(n);
    ll now = 0;
    for(ll i = 0; i < n; i++){
        if(s[i] == 'R'){
            now++;
            if(s[i + 1] == 'L'){
                ret[i] += (now + 1) / 2;
                ret[i + 1] = now / 2;
                now = 0;
            }
        }
    }
    now = 0;
    for(ll i = n - 1; i >= 0; i--){
        if(s[i] == 'L'){
            now++;
            if(s[i - 1] == 'R'){
                ret[i] += (now + 1) / 2;
                ret[i - 1] += now / 2;
                now = 0;
            }
        }
    }
    for(ll i = 0; i < n; i++){
        if(i > 0)cout << " ";
        cout << ret[i];
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 1488
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = 0

for i in range(a[0]):
  d = 0
  e = list(map(int,input().split()))
  for j in range(a[1]):
    d+=b[j]*e[j]
  else:
    if d+a[2]>0:
      c+=1
else:
  print(c)

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

int main() {
	string S;
	cin >>S;
	int N;
	N=S.size();
	char s=S[0];
	int c=0;
	char cc='0';
	for(int i=0;i<S.size();i++){
		if(S[i]==cc)c++;
		if (cc=='0')cc='1';
		else cc='0';
	}
	if (c*2>N)c=N-c;
	cout<<c;
}

Measured memory_bytes: 512
Module _20190421

    Sub Main()

        Dim iAntena(5) As Integer
        iAntena(0) = Console.ReadLine()
        Dim iMax As Integer = iAntena(0)
        Dim iMin As Integer = iAntena(0)

        For i As Integer = 1 To 4

            iAntena(i) = Console.ReadLine()

            If iAntena(i) > iMax Then

                iMax = iAntena(i)

            ElseIf iAntena(i) < iMin Then

                iMin = iAntena(i)

            End If

        Next

        Dim iDistance As Integer = Console.ReadLine()

        If iMax - iMin > iDistance Then

            Console.WriteLine(":(")

        Else

            Console.WriteLine("Yay!")

        End If

    End Sub

End Module

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

int baigaesi(int a){
  int n=1;
  if(a == 0)
    return 1;
  else
    for(int i=0;i<a;i++)
      n *= 2;
  return n;
}

int main(){

  int n;

  while(cin >> n){
    int i;
    std::vector<int> an;

    for(i=0;;i++){
      if(n==1){
	an.push_back(1);
	break;
      }
      an.push_back(n%2);
      n /= 2;
    }

    for(int j=0;j<=i;j++){
      if(an[j] == 1){
	cout << baigaesi(j);
	if(j==i) break;
	cout << ' ';
      }
    }
    cout << endl;
  }

  return 0;
}

Measured memory_bytes: 1216
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <cmath>
#include <queue>
#include <deque>
#include <set>
#include <iomanip>
#include <utility>
typedef long long ll;
typedef long double ld;
using namespace std;

int main() {
	string S;
	cin >> S;
	if(S=="AAA" || S=="BBB") cout << "No" << endl;
	else cout << "Yes" << endl;
	return 0;
}

Measured memory_bytes: 256
n = list(map(int,input()))
three = [0]*(len(n)-2)
sa = 1000
for i in range(len(three)):
    three[i] = n[i]*100 + n[i+1]*10 + n[i+2]
    if abs(three[i] - 753) <= sa:
        sa = abs(three[i] - 753)
print(sa)

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

int main(void){
    int N,i;
    int* A,*B;
    scanf("%d",&N);    
    A=(int*)malloc(sizeof(int)*N);
    B=(int*)malloc(sizeof(int)*N);
    for(i=0;i<N;i++){
        scanf("%d",&A[i]);
        B[A[i]-1]=i;
    }
    for(i=0;i<N;i++){
        printf("%d ",B[i]+1);
    }
    free(A);
    free(B);
    return 0;
}

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

using namespace std;
using ll = long long;

template<class T> using V = vector<T>;
template<class T> using VV = V<V<T>>;

#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_V(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl;
#define DEBUG_M(v) cerr<<#v<<endl;for(int i=0;i<v.size();i++){for(int j=0;j<v[i].size();j++) {cerr<<v[i][j]<<" ";}cerr<<endl;}

int main() {
    ll A, B, C, D;
    cin >> A >> B >> C >> D;
    ll E = C * D / __gcd(C, D);
    ll cntE = B / E - (A-1) / E;
    ll cntD = B / D - (A-1) / D;
    ll cntC = B / C - (A-1) / C;
    cout << B - A + 1 - (cntC + cntD - cntE) << endl;

    return 0;
}

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

double to_c(double x) { return x * 45 / atan(1); }

int main() {
    double a, b, x;
    cin >> a >> b >> x;
    // double thd = to_c(atan(b / a));
    double thd = a * b / 2;
    x /= a;
    if (x > thd) {
        printf("%.10f\n", to_c(atan(2 * (a * b - x) / (a * a))));
    } else {
        printf("%.10f\n", to_c(atan(b * b / (2 * x))));
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define SORT(a) sort(a.begin(), a.end())
#define REVERSE(a) reverse(a.begin(), a.end())
#define int long long
#define INF 1000000000000000
using namespace std;

typedef vector<int> vec;
typedef vector<vec> mat;
typedef pair<int, int> Pii;

template<typename T>
void readvec(vector<T> &a);
void readindex(vector<int> &a);



signed main(){

    int N; cin >> N;
    vec A(N); readvec(A);

    vec s(N + 1);
    s[0] = 0;
    REP(i, N) s[i + 1] = s[i] + A[i];

    map<int, int> m;
    REP(i, N + 1) m[s[i]]++;

    int ans = 0;
    for(auto p: m) ans += p.second * (p.second - 1) / 2;

    cout << ans;

    return 0;
}


template<typename T>
void readvec(vector<T> &a){
    REP(i, a.size()){
        cin >> a[i];
    }
}
void readindex(vector<int> &a){
    REP(i, a.size()){
        cin >> a[i];
        a[i]--;
    }
}

Measured memory_bytes: 15872
package main

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

func main() {
	a := getInt()
	op := getString()
	b := getInt()

	var ans int
	if op == "+" {
		ans = a + b
	} else {
		ans = a - b
	}

	fmt.Println(ans)
}

// -----------------------------------------

var scanner = wordScanner()

func wordScanner() *bufio.Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	return sc
}

func getInt() int {
	scanner.Scan()
	i, err := strconv.Atoi(scanner.Text())
	if err != nil {
		panic(err)
	}
	return i
}

func getString() string {
	scanner.Scan()
	s := scanner.Text()
	return s
}


Measured memory_bytes: 640
/**
 * Created by hiramekun at 23:25 on 2019-11-02.
 */
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using vb = vector<bool>;
using P = pair<ll, ll>;
template<typename T> using pq = priority_queue<T>;
template<typename T> using minpq = priority_queue<T, vector<T>, greater<T>>;
template<typename T, typename K> using ump = unordered_map<T, K>;
const ll dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll mod = 1000000007;
const ll inf = ll(1e9);
const ll e5 = ll(1e5);
const ll ll_inf = ll(1e9) * ll(1e9);

#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for(ll i = ll(n - 1); i >= 0; i--)
#define each(i, mp) for(auto& i:mp)
#define eb emplace_back
#define F first
#define S second
#define all(obj) (obj).begin(), (obj).end()

template<class T>
ostream &operator<<(ostream &out, const vector<T> &list) {
    ll n = list.size();
    rep(i, n) out << list[i] << ' ';
    return out;
}

template<class T>
istream &operator>>(istream &in, vector<T> &list) {
    ll n = list.size();
    rep(i, n) in >> list[i];
    return in;
}

template<class T>
ostream &operator<<(ostream &out, const vector<vector<T>> &list) {
    ll n = list.size();
    rep(i, n) out << list[i] << '\n';
    return out;
}

/* ------------- ANSWER ------------- */
/* ---------------------------------- */

void solve() {
    char a, b;
    cin >> a >> b;
    if (a == 'H') {
        cout << (b == 'H' ? 'H' : 'D') << '\n';
    } else {
        cout << (b == 'H' ? 'D' : 'H') << '\n';
    }
}

int main() {
#ifdef MY_DEBUG
    while (true) {
#endif
        solve();
#ifdef MY_DEBUG
    }
#endif
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define dot cout<< setprecision(20)<<endl;
#define vsor(x) sort(x.begin(),x.end());
#define vrev(x) reverse(x.begin(),x.end());
#define rep(i,n) for(int i=0; i<(int)(n);i++)
#define move(i) for(int i=0;i<4;i++)
#define bit(b,n) for(int b=0;b<(1<<(ll)(n));b++)

using namespace std;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
typedef pair<int,int>P;//状態を表すクラスpairの場合、typedefしておくと便利

int main(){
    cout<<setprecision(1000000000000000000)<<endl;
    ll a,b,c,d;
    cin>>a>>b>>c>>d;
    cout<<max(a*c,max(a*d,max(b*c,b*d)))<<endl;
}

Measured memory_bytes: 3616
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp> 
//#include <ext/pb_ds/tree_policy.hpp>
//#include <functional> // for less
//using namespace __gnu_pbds;
using namespace std;
typedef long long  L;

#define max_(x, y) (((x) > (y)) ? (x) : (y))
#define min_(x, y) (((x) < (y)) ? (x) : (y))
#define ___ ios_base::sync_with_stdio(false);cin.tie(NULL);
#define Mx 2000001
#define inf 1e17
const L MOD = 1e9+7;
const double pi = 2 * acos (0.0);

/*------------------------------Graph Moves----------------------------*/
//const int fx[]={+1,-1,+0,+0};
//const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*---------------------------------------------------------------------*/


//typedef tree<L,null_type,less<L>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

L a,b,a1,a2,a3,b1,b2,b3,c,c1,c2,c3,d,d1,d2,d3,d4,d5,e1,e2,e3,f,h,k,l,n,m,m1,m2,n1,n2,o,p1,p2,p3,p4,
q1,q2,q3,q4,r,s,t,x,y,z,sum,mn,flg,flg1,flg2,id1,id2,id3,lim,cost,ans;
char grid[7][7];

void isValid(L r_mask,L c_mask){
    L c1=0;
    for(L i=0;i<r;i++){
        for(L j=0;j<c;j++){
            if(grid[i][j]=='#'){
                if((r_mask&(1<<i))==0LL && (c_mask&(1<<j))==0LL ){
                    c1++;
                }
            }
        }
    }
    if(c1==k){
        ans++;
    }
}
void solve(){
    ans=0;
    L row=1<<r,col=1<<c;
    for(L i=0;i<row;i++){
        for(L j=0;j<col;j++){
            isValid(i,j);
        }
    }
    printf("%lld\n", ans);
}
int main()
{
    scanf("%lld%lld%lld",&r,&c,&k);
    for(L i=0;i<r;i++){
        cin>>grid[i];
    }
    solve();
    return 0;
}
/// empty() lld I64d push_back() top() pop() insert() upper_bound() lower_bound() memset() max() min() scanf continue


Measured memory_bytes: 3816
a=input()
if a=="a" or a=="b" or a=="c" or a=="d" or a=="e" or a=="f" or a=="g" or a=="h" or a=="i" or a=="j" or a=="k" or a=="l" or a=="m" or a=="n" or a=="o" or a=="p" or a=="q" or a=="r" or a=="s" or a=="t" or a=="u" or a=="v" or a=="w" or a=="x" or a=="y" or a=="z":
  print("a")
else:
  print("A")

Measured memory_bytes: 61552
//inlclude before define 
#define _USE_MATH_DEFINES

//include
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<type_traits>
#include<numeric>
#include<assert.h>
//#include<deque>
#include<iomanip>
#include<set>
#include<tuple>
#include<map>
using namespace std;

//typedef
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef pair<int, int> P1;
typedef long long int ll;

//define
#define INF 1e9
#define NUM 1000000007
#define all(x) begin(x), end(x)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define REP(i,a,b) for(int i=int(a);i<int(b);i++)
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))


int main() {
	int n,a,b;
	cin >> n >> a >> b;
	int judge = b - a - 1;
	if (judge % 2 == 0) {
		cout << "Borys" << endl;
	} else {
		cout << "Alice" << endl;
	}
	
}





Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>


using namespace std;

// vector<vector<int>> mat(N, vector<int>(M, 0));


int main(int argc, const char *argv[])
{
  int N;
  cin>>N;

  int K;
  cin>>K;

  string str;
  cin>>str;

  vector<int> vec;

  int count = 0;
  for (int i = 0; i < N; i++)
  {
    count++;

    if( i == N -1)
    {
      vec.push_back(count);
      break;
    }
    if(str[i] != str[i+1])
    {
      vec.push_back(count);
      count = 0;
    }
    else
    {
      
    }

  }

  int sum = 0;
  for (int i = 0; i < vec.size(); i++)
  {
    sum +=vec[i]-1;
  }


  int cat = 2*K;

  if(cat >= vec.size())
  {
    cout<<N-1;
    return 0;
  }
  cout<<cat + sum;
  // int sum = 0;
  // int max = 0;
  // if(cat >= vec.size())
  // {
  //   cout<<N;
  //   return 0;
  // }
  // else
  // {
  //   for (int i = 0; i <= vec.size() - cat ; i++)
  //   {
  //     sum = 0;
  //     for (int j = 0; j < cat; j++)
  //     {
  //       sum +=vec[i+j];
  //     }
  //     max = std::max(max,sum);
  //   }
  // }
  // cout<<max;
  
  
  return 0;
}


Measured memory_bytes: 1020
#include<cstdio>
#include<cstring>
#include<cmath>
#include<bitset>
#include<iostream>
#include<algorithm>
#include<string>
#include<utility>
#include<tuple>
#include<vector>
#include<list>
#include<map>
#include<queue>
#include<stack>
#include<numeric>
#include<functional>
#include<iomanip>

#define IOS ios::sync_with_stdio(false),cin.tie(0)
#define REP(i,n) for(int i = 0;i < n;i++)
#define MEM(a,b) memset(a,b,sizeof(a))

using namespace std;

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

int gcd(int a, int b) {
	if (a < b)swap(a, b);
	int k = a % b;
	if (k == 1)return 1;
	if (k == 0)return b;
	int ans = gcd(b, k);
	return ans;
}

int main() {
	IOS;
	int r;
	cin >> r;
	if (r < 1200) {
		cout << "ABC" << endl;
	}
	else if (r < 2800) {
		cout << "ARC" << endl;
	}
	else {
		cout << "AGC" << endl;
	}
}



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

using namespace std;

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

  vector<int> x(m);
  for(int i = 0; i < m;i++) {
    cin >> x[i];
  }
  sort(x.begin(), x.end());

  vector<int> diff(m-1);
  for (int i = 0; i < m-1; i++) {
    diff[i] = x[i+1] - x[i];
  }
  sort(diff.begin(), diff.end(), greater<int>());

  int ans;
  if (m <= n) {
    ans = 0;
  } else {
    ans = x[m-1] - x[0];
    for (int i = 0; i < n-1; i++) {
      ans -= diff[i];
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 1024
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProCon
{

    class Program
    {

        static void Main(string[] args)
        {
            string[] input1 = Console.ReadLine().Split(' ');
            int X = int.Parse(input1[1]);
            int Y = int.Parse(input1[0]);
            Console.ReadLine();
            string[] input = Console.ReadLine().Split(' ');
            List<int> Result = new List<int>();
            int num = 1;
            foreach( string str in input)
            {
                int i = int.Parse(str);
                for (int j = 0; j < i; ++j)
                {
                    Result.Add(num);
                }
                num++;
            }

            for(int i = 0; i < Y; ++i)
            {
                for(int j = 0; j < X; ++j)
                {
                    Console.Write(Result[i * X + ((i % 2 == 0) ? j : X - j - 1)]);
                    if(j != X - 1)
                    {
                        Console.Write(" ");
                    }
                }
                Console.Write(Environment.NewLine);
            }
        }
    }

}

Measured memory_bytes: 13140
fun main (args:Array<String>){
    var str = readLine()!!
    val strLen = str.length
    var strback = ""
    var count = 0
    //偶数の場合
    if(strLen % 2 == 0) strback += str.takeLast(strLen/ 2)
    // 奇数の場合
    else strback += str.takeLast((strLen - 1) / 2)

    strback = strback.reversed()
    for(i in 0..strback.length-1){
        if(str[i] != strback[i]) count++
    }
    print(count)
}

Measured memory_bytes: 35824