akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
using namespace std;
string ans = "keyence";
int main(){
	string s;
	cin >> s;
	for(int i=0;i<s.size();i++){
		for(int j=i;j<s.size();j++){
			string str = "";
			for(int k=0;k<i;k++){
				str += s[k];
			}
			for(int k=j;k<s.size();k++){
				str += s[k];
			}
			if(str == ans){
				cout << "YES";
				return 0;
			}
		}
	}
	cout << "NO";
	
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<math.h>
using namespace std;

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

    long long  sum=1000000000000;
    for(int i=1; i<=sqrt(n); i++){
        if(n%i==0){
            if(sum > i+(n/i)-2){
                sum = i+(n/i)-2;
            }
        }
    }
    cout<<sum<<endl;
    
    return 0;
}


Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

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

func iScan() int {
	n, _ := strconv.Atoi(Scan())
	return n
}

func fScan() float64 {
	n, _ := strconv.ParseFloat(Scan(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func SScan(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scan()
	}
	return a
}
func iSScan(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = iScan()
	}
	return a
}
func abs(x int) int {
	if x < 0 {
		x = -x
	}
	return x
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}
func sum(a []int) int {
	x := 0
	for _, v := range a {
		x += v
	}
	return x
}

var mod int = 1000000007

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	n := iScan()
	m := n
	x := 0
	for m != 0 {
		x += m % 10
		m /= 10
	}
	if n%x == 0 {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


Measured memory_bytes: 1772
import copy
n,m = map(int,input().split())
lamp = [[]for _ in range(m) ]
for i in range(m):
    s= list(map(lambda x:int(x)-1,input().split()))
    lamp[i] = s[1:]
mod = list(map(int,input().split()))

swiches = [[0 for _ in range(n)]]
for i in range(n):
    swiches2 =[]
    for swich in swiches:
        swiches2.append(swich)
        swich2 = copy.copy(swich)
        swich2[i] = 1
        swiches2.append(swich2)
    swiches = swiches2
ans = 0
for switch in swiches:
    for i,lampi in enumerate(lamp):
        sw_on = 0
        for j in lampi:
            sw_on += switch[j]
        if sw_on%2!=mod[i]:
            break
        else:
            if i==m-1:
                ans +=1
print(ans)
                
        

    

Measured memory_bytes: 3956
// Package main provides
//
// File:  b.go
// Author: ymiyamoto
//
// Created on Tue Dec 25 02:52:55 2018
//
package main

import "fmt"

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

func main() {
	var N int
	var S string
	fmt.Scan(&N, &S)

	ans := 0
	for i := range S {
		first := S[:i]
		second := S[i:]

		m1, m2 := map[byte]bool{}, map[byte]bool{}
		for j := range first {
			m1[first[j]] = true
		}

		for j := range second {
			m2[second[j]] = true
		}

		tmp := 0
		for k := range m1 {
			if m2[k] {
				tmp++
			}
		}
		ans = max(ans, tmp)
	}
	fmt.Println(ans)
}


Measured memory_bytes: 512
/*
 * コンテスト:AtCoder Beginner Contest 154
 * 問題:A問題
 * C++での開発
 */

#include <iostream>
using namespace std;

int main()
{
	string s, t, u;
	int a, b;
	cin >> s >> t >> a >> b >> u;
	if (s == u)
	{
		a--;
	} else
	{
		b--;
	}
	cout << a << " " << b << endl;
}


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

int main () {
    int t;
    int ac = 0, tle = 0, re = 0, wa = 0;
    cin >> t;
    while(t--) {
        string s;
        cin >> s;
        if(s == "AC")
            ac++;
        else if(s == "TLE")
            tle++;
        else if(s == "RE")
            re++;
        else
            wa++;
    }
    cout << "AC x " << ac << '\n';
    cout << "WA x " << wa << '\n';
    cout << "TLE x " << tle << '\n';
    cout << "RE x " << re << '\n';
}


Measured memory_bytes: 3624
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigDecimal;

public class Main {

    public static void main(String[] args) throws Exception {
        //?????????
        final BigDecimal TAX_RATE = new BigDecimal("0.05");

        //?????°?????????????????????????????¨??????
        final int ROUND_UP_FRACTION = 1000;

        //???????????????????????????10???
        int deptLeft = 100000;

        BufferedReader reader = new BufferedReader(new InputStreamReader(
                System.in));
        int countWeeks = Integer.parseInt(reader.readLine());

        //1??±??????????????¨??????????????????????????????????????????????¨??????????
        for (int count = 1; count <= countWeeks; count++) {
            deptLeft = BigDecimal.valueOf(deptLeft)
                    .add(BigDecimal.valueOf(deptLeft).multiply(TAX_RATE))
                    .intValue();

            //1000?????????????????????????????????
            int fraction = deptLeft % ROUND_UP_FRACTION;
            if (fraction != 0) {
                deptLeft = deptLeft + (ROUND_UP_FRACTION - fraction);
            }
        }
        System.out.println(deptLeft);
    }
}

Measured memory_bytes: 16956
#include <memory.h>

#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>

using namespace std;

#define mod 1000000007

int main() {
	int x, y;
	int abc[3];
	cin >> x >> y;
	for (int i = 0; i < 3; i++) {
		cin >> abc[i];
	}
	int pqr[3][100000];
	for (int i = 0; i < 3; i++) {
		for (int j = 0; j < abc[i]; j++) {
			cin >> pqr[i][j];
		}
	}
	for (int i = 0; i < 3; i++) {
		sort(pqr[i], pqr[i] + abc[i]);
		reverse(pqr[i], pqr[i] + abc[i]);
	}
	vector<int> tmp;
	for (int i = 0; i < x; i++) {
		tmp.push_back(pqr[0][i]);
	}
	for (int i = 0; i < y; i++) {
		tmp.push_back(pqr[1][i]);
	}
	for (int i = 0; i < min(x + y, abc[2]); i++) {
		tmp.push_back(pqr[2][i]);
	}
	sort(tmp.begin(), tmp.end());
	reverse(tmp.begin(), tmp.end());
	long long int ans = 0;
	for (int i = 0; i < x + y; i++) {
		ans += tmp[i];
	}
	cout << ans << endl;
}

Measured memory_bytes: 3572
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
    vector<int> a(10);
    for (int i = 0; i < a.size(); ++i) cin >> a[i];
    sort(a.rbegin(), a.rend());
    for (int i = 0; i < 3; ++i) cout << a[i] << endl;
    return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
     
    using namespace std;
     
    int main() {
      int n, m;
      cin >> n >> m;
      if (m < n) for (int i = 0; i < n; ++ i) cout << m;
      if (n <= m) for (int i = 0; i < m; ++ i) cout << n;
    }

Measured memory_bytes: 256
from collections import defaultdict

N = int(input())
A = list(map(int, input().split()))

colorCount = defaultdict(int)

for a in A:
    if a < 400:
        colorCount['a'] += 1
    elif a < 800:
        colorCount['b'] += 1
    elif a < 1200:
        colorCount['c'] += 1
    elif a < 1600:
        colorCount['d'] += 1
    elif a < 2000:
        colorCount['e'] += 1
    elif a < 2400:
        colorCount['f'] += 1
    elif a < 2800:
        colorCount['g'] += 1
    elif a < 3200:
        colorCount['h'] += 1
    else:
        colorCount['z'] += 1

minAns = len(colorCount)
maxAns = minAns
if colorCount['z'] > 0:
    if minAns == 1:
        minAns = 1
        maxAns = colorCount['z']
    else:
        minAns -= 1
        maxAns = maxAns - 1 + colorCount['z']

print(minAns, maxAns)

Measured memory_bytes: 3316
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define debug(x) cerr << "[(" << __LINE__ << ") " << #x << "]: " << (x) << endl;

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

    constexpr ll MOD = 1e9+7;
    int s;
    cin >> s;
    vector<ll> dp(s+1);
    dp[0] = 1;
    for (int i=0; i<s; i++) {
        for (int j=3; i+j<=s; j++) {
            dp[i+j] += dp[i];
            dp[i+j] %= MOD;
        }
    }
    cout << dp[s] << "\n";
}


Measured memory_bytes: 3624
SA = list(input())
SB = list(input())
SC = list(input())

turn = SA.pop(0)
while True:
    if turn == "a":
        try:
            turn = SA.pop(0)
        except:
            print("A")
            break
    elif turn == "b":
        try:
           turn = SB.pop(0)
        except:
            print("B")
            break
    elif turn == "c":
        try:
            turn = SC.pop(0)
        except:
            print("C")
            break


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define vi vector<ll>
#define pi pair<ll,ll>
#define vp vector<pi>
#define mp map<ll,ll>
#define pb push_back
#define endl '\n'
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
struct abc{
    ll idx;
    ll a;
    string b;
};
bool comp(abc a,abc b)
{
    if(a.a==b.a)
    return a.idx<b.idx;
    else
    return a.a<b.a;
}
int32_t main(){
    fast;
    
    ll n,m;
    cin>>n>>m;
    ll a;string b;
    vector<abc> v(m);
    if(m==0)cout<<0<<" "<<0;
    else{
    for(ll i=0;i<m;i++)
    {
    cin>>a>>b;
    v[i].idx=i;
    v[i].a=a;
    v[i].b=b;
    }
    sort(v.begin(),v.end(),comp);
    ll flag=0,ac=0,wa=0;
    if(v[0].b=="AC"){ac++;flag=1;}
    ll pos=0,prev=v[0].a;

    for(ll i=1;i<m;i++)
    {
        if(v[i].a==prev)
        {
            if(v[i].b=="AC" && flag==0)
            {
                flag=1;
                wa=wa+(i-pos);
                ac++;
            }
        }
        else
        {
            flag=0;
            prev=v[i].a,pos=i;
            if(v[i].b=="AC"){ac++;flag=1;}
        }
    }
    
    cout<<ac<<" "<<wa;
}}


Measured memory_bytes: 7296
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int b = in.nextInt();
        if(a + b >= 10){
        	System.out.println("error");
        }else{
        	System.out.println(a+b);
        }
	}

}


Measured memory_bytes: 21844
#include <iostream>
#include <stdio.h>
#include <string>

struct Node {
    int key;
    Node *parent, *left, *right;
};

Node *root, *NIL;
int n;

void insert(int val) {
    Node *x = root;
    Node *y = NIL;
    Node *z;
    
    z = new Node();
    z->key = val;
    z->left = NIL;
    z->right = NIL;
    
    while (x != NIL) {
        y = x;
        if (x->key > val) {
            x = x->left;
        } else if (x->key <= val) {
            x = x->right;
        }
    }
    
    z->parent = y;
    if (y == NIL) {
        root = z;
    } else if (y->key > z->key) {
        y->left = z;
    } else if (y->key <= z->key) {
        y->right = z;
    }
    
}

Node * Find(Node *u, int val) {
    while (u != NIL) {
        if (u->key == val) return u;
        
        if (u->key > val) {
            u = u->left;
        } else if ( u->key <= val ) {
            u = u->right;
        }
    }
    return u;
}

void inorder(Node *u) {
    if (u == NIL) return;
    
    inorder(u->left);
    printf(" %d", u->key);
    inorder(u->right);
}

void preorder(Node *u) {
    if (u == NIL) return;
    
    printf(" %d", u->key);
    preorder(u->left);
    preorder(u->right);
}

void print() {
    inorder(root);
    printf("\n");
    preorder(root);
    printf("\n");
}

int main() {
    int val;
    char moji[10];
    
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
        scanf("%s", moji);
        if (moji[0] == 'i') {
            scanf("%d", &val);
            insert(val);
        } else if (moji[0] == 'p') {
            print();
        } else if (moji[0] == 'f') {
            scanf("%d", &val);
            Node *u = Find(root, val);
            if (u == NIL) printf("no\n");
            else printf("yes\n");
        }
    }
    
    return 0;
}



Measured memory_bytes: 21840
package main

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

func main() {
	stdin := bufio.NewScanner(os.Stdin)
	for stdin.Scan() {
		l := strings.Split(stdin.Text(), " ")
		if l[0] == "0" {
			break
		}
		h, _ := strconv.Atoi(l[0])
		w, _ := strconv.Atoi(l[1])

		tile := make([][]rune, h)
		done := make([][]bool, h)
		for i := 0; i < h; i++ {
			stdin.Scan()
			s := stdin.Text()
			tile[i] = make([]rune, w)
			done[i] = make([]bool, w)
			for j, c := range s {
				tile[i][j] = c
			}
		}
		i, j := 0, 0
		for tile[i][j] != '.' {
			if done[i][j] {
				i = -1
				break
			}
			done[i][j] = true
			switch tile[i][j] {
			case '>':
				j++
			case '<':
				j--
			case '^':
				i--
			case 'v':
				i++
			}
		}
		if i < 0 {
			fmt.Println("LOOP")
		} else {
			fmt.Println(j, i)
		}
	}
}



Measured memory_bytes: 1236
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define MOD1 1000000007
#define MOD2 998244353
#define LIMIT1 200002
#define LIMIT2 500002
typedef long long ll;
typedef long double ld;
typedef const void cv;
#define rep(i,n) for((i)=0;(i)<(n);(i)++)
#define per(i,n) for((i)=(n)-1;(i)>=0;(i)--)
#define max(a,b) ((a)>(b) ? (a) : (b))
#define min(a,b) ((a)<(b) ? (a) : (b))
#define zt(a,b) (max((a),(b))-min((a),(b)))
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll nPr(int n,int r){ll i,result=1;rep(i,r){result*=(ll)(n-i);}return result;}
ll nCr(int n,int r){ll i,result=1;if(n<r) return 0;rep(i,min(r,n-r)){result*=(ll)(n-i);result/=(ll)(i+1);}return result;}
#define nHr(n,r) nCr((int)((n)+(r)+1),(int)(r))
#define sankaku(x) (((x)*((x)+1))/2)
int dx[8]={1,0,-1,0,1,-1,-1,1};
int dy[8]={0,1,0,-1,1,1,-1,-1};
int upint(const void *a, const void *b) { return *(int *)a < *(int *)b ? -1 : *(int *)a > *(int *)b ? 1 : 0; }
int downint(const void *a, const void *b) { return *(int *)a < *(int *)b ? 1 : *(int *)a > *(int *)b ? -1 : 0; }
int upchar(const void* left, const void* right) {return strcmp((char *)left,(char *)right);}
int downchar(const void* left, const void* right) {return strcmp((char *)right,(char *)left);}
ll modpow(ll a, ll n, ll mod) {
    ll res = 1;
    while (n > 0) {
        if (n & 1){
            res *= a; if(mod>=1) res %= mod;
        }
        a *= a; if(mod>=1) a %= mod;
        n >>= 1;
    }
    return res;
}
void initialize(){
    
}
int main(void){
  initialize();
  ll n,m,i,j,k,result=0;
  int a[LIMIT2]={0};
  char s[LIMIT1];
  
  scanf("%lld %lld %lld",&n,&m,&k);
  if(n%2==0||m%2==0||k%2==0){
    result = 0;
  }else{
    result = min(n*m,min(m*k,n*k));
  }
  printf("%lld",result);
  return 0;
}



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

int main(){
  int N, K;
  cin >> N >> K;
  vector<int> H(N);
  for(int i = 0; i < N; ++i) cin >> H[i];
  int ans = 0;
  for(auto h : H)
    ans += (h >= K);
  cout << ans << endl;
}


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

typedef long long ll;
typedef pair<int, int> pi;
#define F first
#define S second
#define PB push_back

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

const int MOD = 1000000007;

// int max = *std::max_element(vec.begin(), vec.end());
// int sum = accumulate(list, list + size, 0);

int main()
{
    ll n, m; cin >> n >> m;
    
    if (n == 1 || m == 1) {
        cout << 1 << endl;
    } else {
        cout << (n * m + 1) / 2 << endl;
    }
} 


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include<cstring>
using namespace std;

int main(void){

    cin.tie(0);
    ios::sync_with_stdio(false);

    string str;
    cin >> str;

    int ans1 = 0;
    int ans2 = 0;
    int a=str.length();

    for(int i=0;i<a;i++){//1start
        if(i%2==0){
            if(str[i] == '1'){
                ans1+=1;
            }
        }else{
            if(str[i] == '0'){
                ans1+=1;
            }
        }
    }
    for(int i=0;i<a;i++){//0start
        if(i%2!=0){
            if(str[i] == '1'){
                ans2+=1;
            }
        }else{
            if(str[i] == '0'){
                ans2+=1;
            }
        }
    }

    if(ans1<ans2){
        cout << ans1;
    }else{
        cout <<ans2;
    }

    return 0;
}

Measured memory_bytes: 512
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>


using namespace std;

int main(){
  int N,H,W;
  cin >> N >> H >> W;
  cout << (N-H+1)*(N-W+1) << endl;
  
  

  return 0;
}


Measured memory_bytes: 256
N = int(input())
dict = {}
for i in range(N):
    s = input()
    if not s in dict:
        dict[s] = 0
    dict[s] += 1
    
M = int(input())
for i in range(M):
    t = input()
    if not t in dict:
        dict[t] = 0
    dict[t] -= 1
    
print(max(list(dict.values())+[0]))

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

using namespace std;

int main(void) {
    int n, m, k;
    cin >> n >> m >> k;
    vector<set<int>> isFriend(n + 1);
    vector<int> C(k + 1), D(k + 1);

    for (int i = 0; i < m; i++) {
        int a, b;
        cin >> a >> b;
        isFriend[a].insert(b);
        isFriend[b].insert(a);
    }

    for (int i = 1; i <= k; i++) {
        cin >> C.at(i) >> D.at(i);
    }

    int id = 0;
    vector<int> cc(n + 1, 0);
    for (int root = 1; root <= n; root++) {
        if (cc[root]) continue;
        cc[root] = ++id;
        stack<int> stack;
        stack.push(root);
        while (!stack.empty()) {
            int top = stack.top();
            stack.pop();
            for (int i: isFriend[top]) {
                if (cc[i]) continue;
                cc[i] = id;
                stack.push(i);
            }
        }
    }

    vector<int> cc_size(n + 1, 0);
    for (int i: cc) cc_size[i] += 1;
    vector<int> ans(n + 1, 0);
    for (int i = 1; i <= n; i++) ans[i] = cc_size[cc[i]] - isFriend[i].size() - 1;
    for (int i = 1; i <= k; i++) {
        if (cc[C[i]] == cc[D[i]]) {
            ans[C[i]]--;
            ans[D[i]]--;
        }
    }

    for (int i = 1; i <= n; i++) {
        cout << ans[i] << " ";

    }

    cout << endl;

    return 0;
}


Measured memory_bytes: 16992
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Math;

namespace CSharp
{
    static class Program
    {
        static void Main(string[] args)
        {
            int n, x;
            ReadInt(out n, out x);
            int[] L = ReadIntArray();

            int height = 0;
            int ans = 1;
            foreach (var l in L)
            {
                height += l;
                if (height <= x)
                {
                    ans++;
                }
            }

            Console.WriteLine(ans);
        }

        #region Helpers

        static int[] ReadIntArray() => Console.ReadLine().Split().Select(s => int.Parse(s)).ToArray();
        static long[] ReadLongArray() => Console.ReadLine().Split().Select(s => long.Parse(s)).ToArray();

        static int[] ReadLineIntArray(int count) => Enumerable.Repeat(0, count).Select(_ => int.Parse(Console.ReadLine())).ToArray();
        static long[] ReadLineLongArray(int count) => Enumerable.Repeat(0, count).Select(_ => long.Parse(Console.ReadLine())).ToArray();

        static string ReadString() => Console.ReadLine();
        static int ReadInt() => int.Parse(Console.ReadLine());
        static long ReadLong() => long.Parse(Console.ReadLine());

        static void ReadInt(out int first)
        {
            var array = ReadIntArray();
            first = array[0];
        }

        static void ReadInt(out int first, out int second)
        {
            var array = ReadIntArray();
            first = array[0];
            second = array[1];
        }

        static void ReadInt(out int first, out int second, out int third)
        {
            var array = ReadIntArray();
            first = array[0];
            second = array[1];
            third = array[2];
        }

        static void ReadInt(out int first, out int second, out int third, out int fourth)
        {
            var array = ReadIntArray();
            first = array[0];
            second = array[1];
            third = array[2];
            fourth = array[3];
        }

        static void ReadLong(out long first)
        {
            var array = ReadLongArray();
            first = array[0];
        }

        static void ReadLong(out long first, out long second)
        {
            var array = ReadLongArray();
            first = array[0];
            second = array[1];
        }

        static void ReadLong(out long first, out long second, out long third)
        {
            var array = ReadLongArray();
            first = array[0];
            second = array[1];
            third = array[2];
        }

        static void ReadLong(out long first, out long second, out long third, out long fourth)
        {
            var array = ReadLongArray();
            first = array[0];
            second = array[1];
            third = array[2];
            fourth = array[3];
        }

        #endregion
    }
}

Measured memory_bytes: 13396
#include <stdio.h>
char read[100000];

int main(void){
  scanf("%s",read);
  int i,count;
  for(i=0;read[i+1]!='\0';i++);
  //printf("文字数は%d\n",i+1);
  int length=i+1;
  count=0;
  for(i=0;i<=length/2-1;i++){
    //printf("read[%d]とread[%d]を比較\n",i,length-i-1);
    if(read[i]!=read[length-1-i])
      count++;
    
  }
  
  printf("%d\n",count);
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define PI 3.1415926535897932
#define _GLIBCXX_DEBUG
using namespace std;
int main() {
  
  string S,T;
  cin>>S>>T;
  
  vector<char> x(S.size());
  for(int i=0;i<S.size();i++){
    x[i]=S[i];
  }
  sort(x.begin(),x.end());
  
  vector<char> y(T.size());
  for(int j=0;j<T.size();j++){
    y[j]=T[j];
  }
  sort(y.begin(),y.end());
  reverse(y.begin(),y.end());
  
  if(x<y){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}


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

long long u(long long,long long);

int main(){
    int N;
    long long T[100] = {0};
    long long ll;
    long long temp;

    cin >> N;
    for(int i=0;i<N;i++)
        cin >> T[i];
    
    for(int i=0;i<N-1;i++){
        ll = u(T[i],T[i+1]);
        temp = T[i+1]/ll;
        T[i+1] = T[i]*temp;
    }

    cout << T[N-1];
    return 0;
        
}

long long u(long long a,long long b){
    long long r;
    long long tmp;
    if(a<b){
        tmp = a;
        a = b;
        b = tmp;
    }
    r = a % b;
    while(r!=0){
        a = b;
        b = r;
        r = a % b;
    }
    return b;
}

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

int main(){
    int n, k;
    while(cin >> n >> k, n+k){
        vector<int>s;
        for(int i=0; i < k; i++){
            int num;
            cin >> num;
            s.push_back(num);
        }
        for(int i=0; i < n; i++){
            for(int j=0; j < k; j++){
                int num;
                cin >> num;
                s[j]-=num;
            }
        }
        bool isPossible = true;
        for(int i=0; i < s.size(); i++){
            if(s[i] < 0) isPossible = false;
        }
        if(isPossible) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
}

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

int main() {
  int a, b;
  cin >> a >> b;
  int d = abs(a - b);
  if (d & 1) {
    cout << "IMPOSSIBLE" << endl;
  } else {
    cout << min(a, b) + d / 2 << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;
#define FOR(i,a,n) for(ll i=(ll)a;i<(ll)n;i++)
#define RFOR(i,a,n) for(ll i=(ll)n-1;i >= (ll)a;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,0,n)
#define ALL(v) v.begin(), v.end()
#define bra(first,second) '(' << first << ',' << second << ')'
//constexpr ll MOD = 1000000007;
constexpr ll MOD = 998244353;
ll INF = 6001001001001001001;
long double EPS = 1e-6;
long double PI = 3.141592653589793238;
template<typename T>
void remove(std::vector<T>& vector, unsigned int index){
    vector.erase(vector.begin() + index);
}

using Graph = vector<vector<ll>>;

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

ll H,W,ans=0;
char field[1010][1010];
ll d[1010][1010];

priority_queue<tuple<ll,ll,ll>> Q;

void BFS(){
    while(Q.size()){
        ll y,x,z;
        tie(z,y,x) = Q.top();
        Q.pop();
        field[y][x] = '#';
        rep(i,4){
            ll ny = y + dy[i],nx = x + dx[i];
            if(0 <= ny && ny < H && 0 <= nx && nx < W){
                if(field[ny][nx] == '.' && d[ny][nx] > -z+1){
                    Q.emplace(z-1,ny,nx);
                    d[ny][nx] = d[y][x] + 1;
                }
            }
        }
    }
}


int main(){
   cin >> H  >> W;
   rep(i,1010)rep(j,1010) d[i][j] = INF;
   rep(i,H)rep(j,W){
       cin >> field[i][j];
       if(field[i][j] == '#'){
           Q.emplace(0,i,j);
           d[i][j] = 0;
       }
   }
   BFS();
   rep(i,H) rep(j,W) ans = max(ans,d[i][j]);
   cout << ans << endl;
}

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

//.define
// #define FILE_IN_OUT
#define RET(_x)                       return cout << (_x) << '\n', 0;
#define all(_obj)                     (_obj).begin(), (_obj).end()
#define loop(_n)                      for (int i = 0; i < (_n); ++i)
#define CeilDiv(_dividend, _divider)  (((_dividend) - 1LL + (_divider)) / (_divider))
#define sz(_obj)                      static_cast<int>((_obj).size())
#ifdef SHJ_LOCAL
#define debug(_x)                     std::cerr << (#_x) << " = " << (_x) << '\n' << std::flush;
#else
#define debug(_x)                     {}
#endif
#define endl "\n"
template<typename Tp>
inline void outarr(Tp _begin, Tp _end, const char* _delim = " ") {
    for (Tp current = _begin; current != _end; ++current) {
        std::cout << *current << _delim;
    }
    std::cout << '\n';
}

//.constant
using ll  = long long;
using pii = std::pair<int, int>;
constexpr int INF = 0x3f3f3f3f;
constexpr int MOD = static_cast<const int>(1e9 + 7);

//.data

//.code
int main() {
#ifdef FILE_IN_OUT
    std::ifstream cin ("input.txt",  std::ios::in);
    std::ofstream cout("output.txt", std::ios::out);
#else
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);
#endif

    int n;
    cin >> n;
    for (int i = 1000;; i += 1000) {
        if (i >= n) {
            RET(i - n);
        }
    }

#ifdef FILE_IN_OUT
    cin.close();
    cout.close();
#endif
    return 0;
}

Measured memory_bytes: 3652
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;
using ll = long long;

#define REP(i, a) for (int i = 0; i < (a); ++i)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORR(i, a, b) for (int i = (a)-1; i >= (b); --i)
#define ALL(obj) (obj).begin(), (obj).end()
#define SIZE(obj) (int)(obj).sizeT()
#define YESNO(cond, yes, no) \
    { cout << ((cond) ? (yes) : (no)) << endl; }
#define SORT(list) sort(ALL((list)));
#define RSORT(list) sort((list).rbegin(), (list).rend())
#define ASSERT(cond, mes) assert(cond&& mes)

constexpr int MOD = 1'000'000'007;
constexpr int INF = 1'050'000'000;

template <typename T>
T round_up(const T& a, const T& b) {
    return (a + (b - 1)) / b;
}

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

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

template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
    REP(i, (int)v.size())
    is >> v[i];
    return is;
}

template <typename T>
T clamp(T& n, T a, T b) {
    if (n < a) n = a;
    if (n > b) n = b;
    return n;
}

template <typename T>
static T GCD(T u, T v) {
    T r;
    while (v != 0) {
        r = u % v;
        u = v;
        v = r;
    }
    return u;
}

template <typename T>
static T LCM(T u, T v) {
    return u / GCD(u, v) * v;
}

std::vector<ll> enum_div(ll n) {
    std::vector<ll> ret;
    for (ll i = 1; i * i <= n; ++i) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i != 1 && i * i != n) { ret.push_back(n / i); }
        }
    }
    return ret;
}

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

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

struct ToUpper {
    char operator()(char c) {
        return toupper(c);
    }
};

struct ToLower {
    char operator()(char c) {
        return tolower(c);
    }
};

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

    int N;
    string S;
    cin >> N >> S;

    int ans = 0;
    REP(i, 1000) {
        stringstream ss;
        ss.fill('0');
        ss << setw(3) << i;
        string T = ss.str();
        int pos = 0;
        REP(j, N) {
            if (T[pos] == S[j]) pos++;
            if (pos == 3) {
                ans++;
                break;
            }
        }
    }

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

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using namespace std;
using P = pair<int, int>; 
using ll = long long;
using M = map<int, int>;

int main()
{
  ll a, b, c, d;
  cin >> a >> b >> c >> d;
  a--;
  ll y = a - (a / c) - (a / d) + (a / (lcm(c, d)));
  ll x = b - (b / c) - (b / d) + (b / (lcm(c, d)));
  cout << x - y << endl;
        

  return 0;
}

Measured memory_bytes: 3608
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
#define rep(i, n)for(int i=0; i<n; i++)

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

  long long sum = 0;
  int n = 1;
  while(sum < N){
    sum += n;
    n++;
  }
  n--;
  
  int remove;
  int j=0;
  while(1){
    if(sum - j == N)    
      break;
    j++;
  }

  for(int i=1; i<n+1; i++)
    if(i!= j)
      cout<<i<<endl;

  return 0;
}


Measured memory_bytes: 3608
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define MOD 1000000007
#define MOD2 998244353
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long Int;
typedef pair<Int, Int> P;

int to[220000];
bool reached[220000];
int cnt[220000];

int main() {
    int n;
    Int k;
    cin >> n >> k;
    for (int i = 1; i <= n; i++) {
        cin >> to[i];
    }
    int now = 1;
    reached[1] = true;
    Int sumcnt = 0;
    int period = INF;
    while(true) {
        int nex = to[now];
        sumcnt++;
        if (sumcnt == k) {
            cout << nex << endl;
            return 0;
        }
        if (!reached[nex]) {
            reached[nex] = true;
            cnt[nex] = sumcnt;
        }
        else {
            period = sumcnt - cnt[nex];
            now = nex;
            break;
        }
        now = nex;
    }
    k -= sumcnt;
    k %= period;
    rep(i,k) {
        int nex = to[now];
        now = nex;
    }
    cout << now << endl;
}

Measured memory_bytes: 5376
ABCD = list(map(int, list(input())))
ans = ['']*9
for i in range(4):
    ans[i*2] = str(ABCD[i])
for i in range(2**3):
    ret = ABCD[0]
    for j in range(3):
        if (i >> j) % 2 == 1:
            ret += ABCD[j+1]
            ans[j*2 + 1] = '+'
        else:
            ret -= ABCD[j+1]
            ans[j*2 + 1] = '-'
    if ret == 7:
        ans[7] = '='
        ans[8] = '7'
        print(''.join(ans))
        exit(0)


Measured memory_bytes: 3064
/* {{{ Definitions */
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <ios>
#include <utility>
#ifdef _WIN32
#include "debug.hpp"
#endif
using namespace std;

#define rep(i, N)  for(int i = 0; i < (N); i++)
#define reps(i, N) for(int i = 1; i <= (N); i++)
#define repr(i, N) for(int i = (N) - 1; i >= 0; i--)
#define pub push_back

template<typename T> 
void chmax(T &a, T b){ a = max(a, b); };
template<typename T> 
void chmin(T &a, T b){ a = min(a, b); };

typedef long long ll;
typedef pair<int, int> P;
const int INF = 100000000;
const ll LINF = 10000000000000000;
const int MOD = 1000000007;
/* }}}------------------------------------------- */
int N;
int B[100];
int ans;
void solve(){
	ans += B[0];
	rep(i, N - 2){
		ans += min(B[i], B[i + 1]);
	}
	ans += B[N - 2];
	cout << ans << endl;
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> N;
	rep(i, N - 1) {
		cin >> B[i];
	}
		solve();
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mod 1000000007
#define INF 1e9

int main(){
    int n,a,b;
    string s;
    cin>>n>>a>>b>>s;
    int AB=0,B=0;
    for(int i=0;i<s.size();i++){
        if(s[i]=='a'){
            if(AB<a+b){
                cout<<"Yes"<<endl;
                AB++;
            }
            else cout<<"No"<<endl;
        }
        else if(s[i]=='b'){
            if(AB<a+b && B<b){
                cout<<"Yes"<<endl;
                AB++;
                B++;
            }
            else cout<<"No"<<endl;
        }
        else{
            cout<<"No"<<endl;
        }
    }
}

Measured memory_bytes: 896
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>

using namespace std;

const int INF=1000000000;
char chs[1001];

int main(){
    bool fi=false;
    string str;
    while(getline(cin,str)&&str!=""){
        memset(chs,0,sizeof(chs));
        string ss;
        string tmp;
        if(fi)cout<<endl;
        else fi=true;
        while(getline(cin,tmp)&&tmp!="")str+=tmp;
        while(getline(cin,tmp)&&tmp!="")ss+=tmp;
        int sz=INF;
        int optHead=0;
        int optTail=0;
        int head=0;
        int tail=-1;
        int cnt=0;
        while(tail<(int)str.size()){
            bool ok=true;
            for(int i=0;i<ss.size();i++)if(chs[ss[i]]<=0)ok=false;
            // ツ個サツ催敖づ個氾債暗債つェツ適ツ静伉づ按づァ
            if(ok){
                if(tail-head+1<sz){
                    optHead=head;
                    optTail=tail;
                    sz=tail-head+1;
                    cnt=1;
                }
                else if(tail-head+1==sz)cnt++;
                chs[str[head]]--;
                head++;
            }
            else{
                tail++;
                if(tail<(int)str.size())chs[str[tail]]++;
            }
        }
        cout<<cnt<<endl;
        if(cnt!=0){
            cout<<endl;
            for(int i=optHead;i<optHead+sz;i++){
                int cn=i-optHead+1;
                cout<<str[i];
                if(cn%72==0||i==optHead+sz-1)cout<<endl;
            }
        }
    }
    cout<<endl;
    return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <string.h>

using namespace std;

int main(){
  string s;
  int ans = 0;

  while(true){
    ans = 0;
    cin >> s;
    if( s == "0"){
      break;
    }
    for( int i = 0; i < s.size(); ++i){
      ans += (int)s[i] - (int)'0';
    }
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 3136
#include <bits/stdc++.h>
using namespace std;
#define maxn 2500
char s[maxn];
char ss[maxn];
int main(){
    int ans=0;
    int x1,x2,y1,y2;
    scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
    int dx=x2-x1,dy=y2-y1,x=x1,y=y1;
    while(dx>0 || dy>0){
        if(dx>0){
            dx--;s[++ans]='R';printf("R");
        }
        if(dy>0){
            dy--;s[++ans]='U';printf("U");
        }
    }
    dx=x2-x1,dy=y2-y1;
    if(dx>dy){
        printf("D");
        for(int i=ans-1;i>=1;i--){
            if(s[i]=='R') printf("L");
            if(s[i]=='U') printf("D");
        }
        printf("LUU");
        ss[1]='U';
        for(int i=2;i<=ans;i++){
            printf("%c",s[i]);
            ss[i]=s[i];
        }
        ss[ans+1]='R';
        printf("RDRUULL");
        for(int i=ans+1;i>=1;i--){
            if(ss[i]=='R') printf("L");
            if(ss[i]=='U') printf("D");
        }
        printf("DR");
    }
    else{
        printf("RD");
        for(int i=ans;i>=1;i--){
            if(s[i]=='R') printf("L");
            if(s[i]=='U') printf("D");
        }
        printf("LUU");
        ss[1]='U';
        for(int i=2;i<=ans-1;i++){
            printf("%c",s[i]);
            ss[i]=s[i];
        }
        printf("RULL");
        for(int i=ans-1;i>=1;i--){
            if(ss[i]=='R') printf("L");
            if(ss[i]=='U') printf("D");
        }
        printf("DR");
    }


    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>
#include <algorithm>
#include <set>
#include <string>
#include <queue>

using namespace std;

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

typedef long long ll;

int main(){
    int N;
    int four = 0;
    int odd = 0;
    int two = 0;
    cin >> N;
    rep(i, N){
        int a;
        cin >> a;
        if(a % 4 == 0){
            four ++;
        }else if(a % 2 == 0){
            two ++;
        }

        if(a % 2){
            odd ++;
        }
    }
    string ans = "No";
    if(odd <= four){
        ans = "Yes";
    }

    if(odd == four + 1 && two == 0){
        ans = "Yes";
    }

    if(two == 1 && four == 0){
        ans = "No";
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define int long long
#define pb push_back
#define vi vector<int>
#define usi unordered_set<int> 
#define si set<int>
#define umii unordered_map<int, int> 
#define mii map<int, int>
#define all(a) a.begin(), a.end()
#define vii vector<pair<int, int>>
#define pii pair<int, int>
#define mod (int)(1e9+7)
#define INF INT_MAX
 
 


signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
 
    int n, k; cin >> n >> k;
    int a[n]; for (int i=0; i<n; i++) cin >> a[i];

    int dp[n];
    dp[0] = 0;
    
    for (int i=1; i<n; i++) {
        int mini = INT_MAX;
        for (int j=max(i-k, 0LL); j<i; j++) {
            mini = min(mini, dp[j]+abs(a[i]-a[j]));
        }
        dp[i] = mini;
    }
    cout << dp[n-1];
    return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h> 
using namespace std; 
#define rep(i,a,b)		for(long int i=a;i<=b;i++)
#define MOD 1e9+7

int sumdigi(long long n)
{
	int ans = 0;
	while(n)
		ans+=n%10,n/=10;
	return ans;
}

long long n;
int main() 
{ 
	ios::sync_with_stdio(false);
    cin.tie(NULL);  
    cin>>n;
    int temp = n%sumdigi(n);
   	if(temp)
   		cout<<"No";
   	else
   		cout<<"Yes";
}
	

Measured memory_bytes: 3644
"use strict";
var input=require("fs").readFileSync("/dev/stdin","utf8");
var cin=input.split(/ |\n/),cid=0;
function next(a){return a?cin[cid++]:+cin[cid++];}
function nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}
function nextm(h,w,a){var r=[],i=0;if(a)for(;i<h;i++)r.push(cin.slice(cid,cid+=w));else for(;i<h;i++)r.push(cin.slice(cid,cid+=w).map(a=>+a));return r;}
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill().map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill().map(x=>"+r+")";return eval(r);}
var mod = 1e9+7;

var myOut = main();
if(myOut !== undefined)console.log(myOut);

function main(){
  var n = next();
  var k = next();
  var ans = 0, l = 0, r = 0;
  for(var i = 1; i < k; i++){
    l += i-1;
    r += n-i+1;
  }
  for(; i <= n+1; i++){
    l += i-1;
    r += n-i+1;
    ans += r-l+1;
    ans %= mod;
  }
  return ans;
}

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

using namespace std;

typedef long long ll;
typedef vector<ll> vll;
typedef vector<bool> vb;



const ll INF=10000000000;

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


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

  ll n,k;
  cin >> n >> k;
  if(2*k-1>n) {
    cout << -1 << endl;
    return 0;
  }
  vll a(n),b(n),c(n);
    ll l=(n+1)/2;
    rep(i,0,l) a[i]=k+2*i;
    rep(i,l,n) a[i]=k+1+2*(i-l);
  if(n%2) {
    rep(i,0,l) b[i]=k+3*l-2-i;
    rep(i,l,n) b[i]=k+4*l-3-(i-l);
    rep(i,0,n) c[i]=k+4*l-2+i;
  }
  else {
   rep(i,0,l) b[i]=k+3*l-1-i;
    rep(i,l,n) b[i]=k+4*l-1-(i-l);
    rep(i,0,n) c[i]=k+4*l+i;
  
  }
  
  rep(i,0,n) cout << a[i] << " " << b[i] << " " << c[i] << endl;
  
}


Measured memory_bytes: 4608
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define pb emplace_back
#define mp make_pair
typedef long long ll;
typedef pair<int,int> pint;

int main(){
    int n,ti,xi,yi;
    cin>>n;
    bool flag=true;
    int cx=0,cy=0,pt=0;
    rep(i,n){
        cin>>ti>>xi>>yi;
        int ct=ti-pt;
        int tt=abs(cx-xi)+abs(cy-yi);
        if(ct-tt<0||(ct-tt)%2!=0) flag=false;
        cx=xi,cy=yi,pt=ti;
    }
    if(flag) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}

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

int roundup10(int a) {
    return (a/10) * 10 + (((a%10)>0)? 10: 0);
}

int main(int argc, char const *argv[])
{
    vector<int> x(5,0); int z;
    int minv = 10;
    for (int i=0;i<5;++i) {
        cin >> z;
        x[i] = z;
        if(z%10>0) minv = min(minv, z%10);
    }
    if(minv == 10) minv = 0;
    else minv = minv-10;
    for(int i=0;i<5;++i) {
        x[i] = roundup10(x[i]);
    }
    cout << accumulate(x.begin(),x.end(),0) + minv << endl;
    return 0;
}


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

int main()
{
  int X,Y;
  cin >> X >> Y;
  bool ans = false;
  for(int i = 0;i <= X;i++){
    if(4*i + 2*(X-i) == Y){
      ans = true;
    }
  }
  if(ans) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(ll i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
vi dir = {-1, 0, 1, 0, -1, -1, 1, 1, -1};

int main() {
  ll n;
  cin >> n;
  vector<P> p(n);
  rep(i, n) {
    ll a;
    cin >> a;
    p[i] = {a, i + 1};
  }
  sort(all(p));
  rep(i, n) cout << p[i].second << '\n';
}

Measured memory_bytes: 4640
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <queue>
#include <list>
#include <cmath>
#include <stack>

using namespace std;
typedef long long ll;
using Pll = pair<ll,ll>;

int main() {
    ll N,C;cin >> N >> C;
    vector<vector<ll>> D(C,vector<ll>(C));
    vector<vector<ll>> c(N,vector<ll>(N));
    for(int i=0;i<C;i++){
        for(int j=0;j<C;j++){
            cin >> D[i][j];
        }
    }
    for(int i=0;i<N;i++){
        for(int j=0;j<N;j++){
            cin >> c[i][j];
        }
    }
    ll ans=1LL<<60;
    vector<vector<ll>> num(C,vector<ll>(3));
    for(int i=0;i<C;i++){
        ll tmp=0;
        for(int s=0;s<N;s++){
            for(int t=0;t<N;t++){
                if((s+t)%3==0) num[i][0]+=D[c[s][t]-1][i];
                else if((s+t)%3==1) num[i][1]+=D[c[s][t]-1][i];
                else if((s+t)%3==2) num[i][2]+=D[c[s][t]-1][i];
            }
        }
    }
    for(int i=0;i<C;i++){
        for(int j=0;j<C;j++){
            for(int l=0;l<C;l++){
                if(i==j || j==l || l==i)continue;
                ans=min(ans,num[i][0]+num[j][1]+num[l][2]);
                //cout << num[i][0]+num[j][1]+num[l][2] << endl;
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 2176
#include <iostream>
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
using namespace std;

int main() 
{
  	fast;
	string s;
	cin >> s;
	cout << s.substr(0,5) << " " << s.substr(6,7)<< " " << s.substr(14);
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;

#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
#define pq_pair_tB priority_queue <pair<ll,ll>, vector<pair<ll,ll> > , greater<pair<ll,ll> > > 
#define pq_pair_ts priority_queue <pair<ll,ll> > //第二成分の大きさが関係ない
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}
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 N , K , Q;
vector<ll> A ;

ll check(ll value){
    vector<ll> at;
    vector<ll> result;
    
    rep(i,A.size()){
        if(A[i] >= value){
            at.pb(A[i]);
        }
        else{
            if(at.size() >= K){
                sort(all(at));
                rep(j, at.size() - K +1) result.pb(at[j]);
            }
            at.clear();
        }
    }
    sort(all(result));
    if(result.size() < Q) return 1e10;
    else return result[Q-1] - result[0];

}
    


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

    cin >> N >> K >> Q;
    
    rep(i,N){
        ll inp;
        cin >> inp;
        A.pb(inp);
    }
    A.pb(0);
    
    ll ans = 1e10;
    rep(i, N){
        ll ret = check(A[i]);
        ans = min(ans, ret);
     }

    cout << ans << endl;
    
    //cout << fixed << setprecision(16) << ans << endl;
    return 0;
}


Measured memory_bytes: 384