akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll GCD(ll x,ll y){
    if(y == 0) return x;
    else return GCD(y,x%y);
}

int main() {
    int n;
    cin >> n;
    int x[n],y[n],a[n];
    for(int i = 0;i < n;i++){
        cin >> x[i] >> y[i];
        a[i] = i;
    }
    
    double ans = 0;
    double cnt = 0;
    
    do{
        cnt++;
        for(int i = 0;i < n-1;i++){
            double xSum = pow(x[a[i]]-x[a[i+1]],2);
            double ySum = pow(y[a[i]]-y[a[i+1]],2);
            ans += sqrt(xSum+ySum);
        }
    }while(next_permutation(a,a+n));
    cout <<setprecision(10)<< ans / cnt << endl;
}



Measured memory_bytes: 256
#define _LIBCPP_DEBUG 0
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll MOD = 1e9 + 7;

int main(void){

    int N; cin>>N;
    vector<pair<ll,ll>> task(N);

    for (int i = 0; i < N; ++i) {
        ll A,B; cin>>A>>B;
        task[i].first = B;
        task[i].second = A;
    }
    sort(task.begin(), task.end());

    ll now=0;
    for (int i = 0; i < N; ++i) {
        now += task[i].second;
        if(now > task[i].first) {
            cout<<"No"<<endl;
            return 0;
        }
    }
    cout<<"Yes"<<endl;
    return 0;
}

Measured memory_bytes: 3328
#include "bits/stdc++.h"
#define fi first
#define se second
#define all(x) x.begin(), x.end()
using namespace std;
using ull = unsigned long long;
using ll = long long;
constexpr int I_INF = INT_MAX;
constexpr ll L_INF = LLONG_MAX;

struct __INIT {
    __INIT() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(15);
    }
} __init;

int main(){
    int N, K, X, Y;
    cin >> N >> K >> X >> Y;
    if(N <= K) cout << X * N << endl;
    else cout << X * K + (N - K) * Y << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define deb(x) cout<<#x<<"="<<x<<endl;
#define endl '\n'
// #define M 1000000007
#define int long long
#define INF 1e18
#define max_n 1000000

using namespace std;

ll p(ll n, ll k, ll M)
{
	if (k == 0)return 1;
	ll x = p(n, k / 2, M) % M;
	if (k % 2 == 0) return ((x % M) * (x % M)) % M;
	else return ((((x % M) * (x % M)) % M) * n) % M;
}

void solve()
{
	ll n;
	cin >> n;
	string s;
	cin >> s;
	ll ones = 0;
	ll pre[n + 1];
	for (int i = 0; i <= n; ++i)
	{
		if (i == 0)
			pre[i] = 0;
		else pre[i] = pre[i % (__builtin_popcount(i))] + 1LL;
	}

	for (int i = 0; i < n; ++i)
	{
		ones += (s[i] - '0');
	}
	ll m1 = ones + 1;
	ll m2 = ones - 1;
	if (m2 <= 0)m2 = 1;
	ll v1 = 0, v2 = 0;
	for (int i = 0; i < n; ++i)
	{
		if (s[n - i - 1] == '1')
		{v1 += p(2, i, m1); v2 += p(2, i, m2);}
		v1 %= m1, v2 %= m2;
	}
	// deb(v1)deb(v2)deb(ones)
	for (int i = 0; i < n; ++i)
	{
		ll temp = ones;
		if (s[i] == '1')
		{
			temp--;
			if (temp == 0)
			{
				cout << 0 << endl; continue;
			}
			ll val = (v2 - p(2, n - i - 1, m2) + m2) % m2;
			cout << pre[val] + 1 << endl;
		}
		else
		{
			temp++;
			ll val = (v1 + p(2, n - i - 1, m1) + m1) % m1;
			cout << pre[val] + 1 << endl;
		}
	}
}

int32_t main()
{
	IOS
	ll T = 1;
	// cin>>T;
	for (ll i = 1; i <= T; ++i)
	{
		// cout<<"Case #"<<i<<": ";
		solve();
	}
	return 0;
}

Measured memory_bytes: 5296
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
	int n, i, a[210];
	cin >> n;
	n *= 2;
	for (i = 0; i < n; ++i) {
		cin >> a[i];
	}
	sort(a, a + n);
	int b = 0, c = 0;
	for (i = 0; i < n; i += 2) {
		b += a[i];
	}
	for (i = 1; i < n - 1; i += 2) {
		c += a[i];
	}
	//c += a[0];
	cout << max(b, c) << endl;
	return 0;
}

Measured memory_bytes: 3556
#include<bits/stdc++.h>
using namespace std;
int main(){
    long long m, n;
    cin >> n >> m;
    if(m == 0 && n == 0){
		cout << "0";
	}
    else{
        --n; --m;
        cout << n * m;
    }
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Equal_Total_Scores
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                string cmd = Console.ReadLine();
                if (cmd.Equals("0 0")) break;
                string[] temp= cmd.Split(' ');
                int n = int.Parse(temp[0]);
                int m = int.Parse(temp[1]);
                List<int> input = new List<int>();
                for (int i = 0; i < n + m; ++i)
                {
                    input.Add(int.Parse(Console.ReadLine()));
                }
                int sum = 0;
                foreach (int item in input)
                {
                    sum += item;
                }
                List<int> ans = new List<int>();
                if (sum % 2 != 0) Console.WriteLine(-1);
                else 
                {
                    int nSum = 0;
                    for (int i = 0; i < n; ++i) nSum += input[i];
                    int mSum = 0;
                    for (int i = n; i < n + m; ++i) mSum += input[i];
                    for (int i = 0; i < n; ++i)
                    {
                        for (int j = n; j < n + m; ++j)
                        {
                            if (nSum - input[i] + input[j] == mSum - input[j] + input[i])
                            {
                                ans.Add(input[i]);
                                ans.Add(input[j]);
                            }
                        }
                    }
                    if (ans.Count == 0) Console.WriteLine(-1);
                    else 
                    {
                        if (ans.Count > 2)
                        {
                            int min = 200;
                            int idx = 0;
                            for (int i = 0; i < ans.Count; i+=2)
                            {
                                if (ans[i] + ans[i + 1] < min)
                                {
                                    min = ans[i] + ans[i + 1];
                                    idx = i;
                                }
                            }
                            Console.WriteLine(ans[idx] + " " + ans[idx + 1]);
                        }
                        else Console.WriteLine(ans[0] + " " + ans[1]);
                    }

                }
            }
        }
    }
}



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

int main()
{
    int n,k;cin>>n>>k;
    vector<int> x(n);
    int i;
    for(i=0;i<n;i++)cin>>x.at(i);
    int ch;
    int ans=1e9;
    for(ch=0;ch<n-k+1;ch++)
    {
        int left=x.at(ch);
        int right=x.at(ch+k-1);
        if(left>=0)
        {
            if(ans>right)ans=right;
        }
        else if(right<=0)
        {
            if(ans>abs(left))ans=abs(left);
        }
        else
        {
            if(ans>abs(left)+right+min(abs(left),right))ans=abs(left)+right+min(abs(left),right);
        }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 640
#include<stdio.h>
#include<stdlib.h>
#include<limits.h>
 
 
 
int n,cost;
int A[1001],B[1001];
int L[501],R[502];
 
 
void merge(int left,int mid,int right){
  int i,j,n1=mid-left,n2=right-mid;
  for(i=0;i<n1;i++) L[i]=A[left+i];
  L[n1]=INT_MAX;
  for(i=0;i<n2;i++) R[i]=A[mid+i];
  R[n2]=INT_MAX;
  int l=0,r=0;
  for(i=left;i<right;i++){
    if(L[l]<=R[r]){
      A[i]=L[l];
      l++;
    }
    else{
      A[i]=R[r];
      r++;
    }
  }
}
 
 
void m_sort(int left,int right){
  int mid;
  if( left+1 >= right) return;
  mid=(left+right)/2;
  m_sort(left,mid);
  m_sort(mid,right);
  merge(left,mid,right);
}
 
 
void swap(int a,int b,int *C){
  int swap;
  swap=C[a];
  C[a]=C[b];
  C[b]=swap;
}
 
 
 
 
 
 
   
  
   
 
int main(){
  scanf("%d",&n);
  int i,j;
  int cnt,sum,min,start,x;
  int C[1001]={};
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
    B[i]=A[i];
  }
  m_sort(0,n);
  for(i=0;i<n;i++){
    if(A[i]==B[i]) C[i]=1;
  }
  cost=0;
  for(i=0;i<n;i++){
    if(C[i]!=1){
      C[i]=1;
      cnt=0;
      sum=0;
      min=B[i];
      x=i;
      while(1){
        for(j=0;j<n;j++){
          if(B[x]==A[j]){
            C[j]=1;
            cnt++;
            sum+=B[j];
            if(min > B[j]) min=B[j];
            x=j;
            break;
          }
        }
        if(x==i) break;
      }
      sum-=min;
      if( (cnt -1)*min > (cnt -1)*A[0]+2*(min +A[0])) cost+=sum+(cnt-1)*A[0]+2*(min +A[0]);
      else cost+=sum+(cnt-1)*min;
    }
  }
  printf("%d\n",cost);
  return 0;
}

Measured memory_bytes: 1840
#include <stdio.h>

int main(void) {
    int i, tmp, max;
    int count[101] = {0};

    while( scanf("%d",&tmp) != EOF ) {
        count[tmp]++;
    }

    max = 0;
    for(i = 1; i < 101; i++ ) {
        if(max < count[i]) {
            max = count[i];
        }
    }

    for(i = 1; i < 101; i++ ) {
        if(count[i] == max ) {
            printf("%d\n",i) ;
        }
    }

    return 0;
}

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

long long int N, M, a[101010], A;
unordered_map<long long, long long> m;

int main(){
    cin >> N >> M;
    m[0] = 1;
    for(int i = 1; i <= N; ++i){
        cin >> a[i];
        a[i] += a[i - 1];
        a[i] %= M;
        A += m[a[i]]++;
    }
    cout << A << endl;
    return 0;
}


Measured memory_bytes: 4108
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.Map.Entry;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<Long, Long> an = new HashMap<Long, Long>();
        for (int i = 0; i < n; i++) {
            long k = sc.nextLong();
            if (an.containsKey(k)) {
                an.put(k, an.get(k)+1);
            } else {
                an.put(k, 1L);
            }
        }

        List<Long> l1 = new ArrayList<Long>();
        List<Long> l2 = new ArrayList<Long>(); // 正方形
        for (Entry<Long, Long> e : an.entrySet()) {
            if (e.getValue() >= 2) {
                l1.add(e.getKey());
            }
            if (e.getValue() >= 4) {
                l2.add(e.getKey());
            }
        }

        Collections.sort(l1);
        Collections.sort(l2);

        int s1 = l1.size();
        int s2 = l2.size();
        if (s1 < 1 && s2 < 1) {
            System.out.println(0);
            System.exit(0);
        }

        long a = 0;
        if (s1 == 1) {
            a = l1.get(s1-1) * l1.get(s1-1);
        } else if (s1 >= 2) {
            a = l1.get(s1-2) * l1.get(s1-1);
        }
        long b = 0;
        if (s2 > 0) {
            b = l2.get(s2-1) * l2.get(s2-1);
        }

        System.out.println(Math.max(a, b));
    }

}

Measured memory_bytes: 62500
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 999999999
#define m0(x) memset(x,0,sizeof(x))
#define fill(x,y) memset(x,y,sizeof(x))
#define p(x) cout<<x<<endl;
#define pe(x) cout<<x<<" ";
//#define int long long


using namespace std;


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




ll gcd(ll x, ll y) {
	ll m = max(x, y), n = min(x, y);
	if (m%n == 0)return n;
	else return gcd(m%n, n);
}
ll lcm(ll x, ll y) {
	return x / gcd(x, y)*y;
}

ll myPow(ll x, ll n, ll m) {
	if (n == 0)
		return 1;
	if (n % 2 == 0)
		return myPow(x * x % m, n / 2, m);
	else
		return x * myPow(x, n - 1, m) % m;
}

ll pow2(ll a, ll n) {//aのn乗を計算します。
	ll x = 1;
	while (n > 0) {//全てのbitが捨てられるまで。
		if (n & 1) {//1番右のbitが1のとき。
			x = x * a;
		}
		a = a * a;
		n >>= 1;//bit全体を右に1つシフトして一番右を捨てる。
	}
	return x;
}

long long nCr(int n, int r) {
	if (r > n / 2) r = n - r; // because C(n, r) == C(n, n - r)
	long long ans = 1;
	int i;

	for (i = 1; i <= r; i++) {
		ans *= n - r + i;
		ans /= i;
	}

	return ans;
}


const int MOD = 1000000007;

bool arr[1050000];
int sosuu[100010];
void Eratosthenes() {
	ll N = 1050000;
	int c = 0;
	for (int i = 0; i < N; i++) {
		arr[i] = 1;
	}
	for (int i = 2; i < sqrt(N); i++) {
		if (arr[i]) {
			for (int j = 0; i * (j + 2) < N; j++) {
				arr[i *(j + 2)] = 0;
			}
		}
	}

	for (int i = 2; i < N; i++) {
		if (arr[i]) {
			sosuu[c] = i;
			//cout << sosuu[c] << " ";
			c++;
		}
	}
	//cout << endl;
	//cout << c << endl;
}


vector<int> graph[100010];
int color[100010];
bool visited[100010][10];
int v[100010], d[100010], c[100010];

void func(int d, int v, int c) {
	if (d == 0) {
		if(!visited[v][0])color[v] = c;
		visited[v][0] = true;
	}
	else {
		if (!visited[v][d - 1]) {
			func(d - 1, v, c);
			for(int i=0;i<=d-1;i++)visited[v][i] = true;
		}
		for (auto x : graph[v]) {
			if (!visited[x][d - 1]) {
				func(d - 1, x, c);
				for (int i = 0; i <= d - 1; i++)visited[x][i] = true;
			}
		}
	}
}
int T[100010];
int main() {
	int N, C, K;
	cin >> N >> C >> K;
	REP(i, N)cin >> T[i];
	int cnt = 1;
	int ans = 1;
	SORT(T, N);
	int t = T[0] + K;
	FOR(i,1, N) {
		if (cnt < C) {
			if (T[i] <= t) {
				cnt++;
			}
			else {
				cnt = 1;
				t = T[i]+K;
				ans++;
			}
		}
		else {
			cnt = 1;
			ans++;
			t = T[i]+K;
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 4736
#![allow(unused, non_snake_case, dead_code)]
#![macro_use]

use std::cmp::*;
use std::collections::*;
use std::mem::*;
use std::num::*;
use std::ops::*;

const Mod: isize = 1000000007;
fn nCk(a: i64, b: i64) -> i64 {
    if a < b {
        return 0.into();
    }
    let mut a: i64 = a.into();
    let mut r: i64 = 1.into();
    for d in 1..(b + 1) {
        // O(b)
        r *= a;
        a -= 1;
        r /= d;
    }
    r
}
fn main() {
    let (r, w) = (std::io::stdin(), std::io::stdout());
    let mut sc = IO::new(r.lock(), w.lock());
    // ======================================================= //
    let S: String = sc.read();
    let mut A: Vec<char> = S.chars().collect();
    A.reverse();

    let mut map: Vec<usize> = vec![0; 2019];
    let mut tens: usize = 1;
    let mut s: usize = 0;
    let mut now: usize = 0;

    map[0] += 1;
    for (i, c) in A.iter_mut().enumerate() {
        let num = c.to_digit(10).unwrap() as usize;
        now = num * tens + now;
        now %= 2019;

        map[now] += 1;
        tens *= 10;
        tens %= 2019;
    }

    let mut ans: usize = 0;
    for i in 0..2019 {
        if (map[i] > 0) {
            ans += (map[i] * (map[i] - 1)) / 2;
        }
    }
    sc.write(ans);
}
// ============================================================ //
pub struct IO<R, W: std::io::Write>(R, std::io::BufWriter<W>);
impl<R: std::io::Read, W: std::io::Write> IO<R, W> {
    pub fn new(r: R, w: W) -> Self {
        Self(r, std::io::BufWriter::new(w))
    }
    pub fn write<S: ToString>(&mut self, s: S) {
        use std::io::Write;
        self.1.write(s.to_string().as_bytes()).unwrap();
    }
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .0
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r' || b == b'\t')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r' && b != b'\t')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 3128
package main

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

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

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

func getInts(N int) []int {
	ret := make([]int, N)
	for i := 0; i < N; i++ {
		ret[i] = getInt()
	}
	return ret
}

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

// min, max, asub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

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

func asub(a, b int) int {
	if a > b {
		return a - b
	}
	return b - a
}

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

func lowerBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] >= x
	})
	return idx
}

func upperBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] > x
	})
	return idx
}

func main() {
	sc.Split(bufio.ScanWords)
	sc.Buffer([]byte{}, 1000000)
	_, A, B := getInt(), getInt(), getInt()
	d := B - A - 1
	if d%2 == 0 {
		out("Borys")
		return
	}
	out("Alice")
	return
}


Measured memory_bytes: 1776
import math
 
A,B,H,M = map(int,input().split())
s = 60*H+M
a = s*0.5
b = M*6
theta = 0
 
if abs(a-b)<=180:
    theta = abs(a-b)
else:
    theta = 360- abs(a-b)

C=(A*A)+(B*B)-(2*A*B)*math.cos(math.radians(abs(a-b)))
print(math.sqrt(C))

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

#define For(i, j, k) for (int i = j; i <= k; i++)

using namespace std;

const int N = 110;
const double PI = acos(-1);

int n;
int X[N], Y[N];
double ang[N];

int main() {

	scanf("%d", &n);
	For(i, 1, n) scanf("%d%d", &X[i], &Y[i]);
	For(i, 1, n) {
		int c = 0;
		For(j, 1, n) if (i ^ j)
			ang[c++] = atan2(Y[j] - Y[i], X[j] - X[i]);
		sort(ang, ang + c);

		double mx = 0;
		ang[c] = ang[0] + 2 * PI;
		For(j, 0, c - 1) mx = max(mx, ang[j + 1] - ang[j]);
		mx -= PI;
		if (mx < 0) mx = 0;
		printf("%.10lf\n", mx / (2 * PI));
	}

	return 0;
}

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

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

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define ALL(v) (v.begin(),v.end())
#define COUT(x) cout<<(x)<<"\n"

int main(){
    int n;cin >>n;
    vector<int> a(n);
    REP(i,n)cin >> a[i];
    ll ans = 0;
    sort(a.begin(),a.end());
    reverse(a.begin(),a.end());
    ans += a[0];
    int tes = 2,count = 0;
    for(int i=1;i<n;){
        if(tes==n)break;
        count++;
        tes++;
        ans += a[i];
        if(count%2==0){
            count = 0;
            i++;
        }
    }
    COUT(ans);
}

Measured memory_bytes: 4060
#include<bits/stdc++.h>
#define ll 	long long
#define pb push_back
#define mp make_pair
using namespace std;

int main()
{
ll n; cin>>n;
ll a[100+9];
ll taka=1000;
for(ll i=0;i<n;i++) cin>>a[i];

for(ll i=0;i<n-1;i++)
{
ll jj=0;
        if (a[i] < a[i + 1]) 
		jj = taka / a[i];
		
       taka+= (a[i + 1]-a[i])*jj;
}

cout<<taka<<endl;
    return 0;
}


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

int main(void) {
    int n;
    std::vector<int> v(3, 0);

    int max_length;
    std::cin >> n;

    for (int i = 0; i < n; i++) {
        std::cin >> v[0] >> v[1] >> v[2];
        std::sort(v.begin(), v.end());
        if (v[2]*v[2] == v[0]*v[0] + v[1]*v[1]) {
            std::cout << "YES" << std::endl;
        } else {
            std::cout << "NO" << std::endl;
        }
    }
    return 0;
}

Measured memory_bytes: 2984
#include <iostream>
#include <cmath>
#include <string>
#include <vector>
// #include <algorithm> // to use min_element

using namespace std;

int test(int N){
	vector<int>  numlst;
	int m;
	while (N>0){
		m = N%10; 
		numlst.push_back(m);
		N /=10;
	}
	int i=0,j=numlst.size()-1;
	bool check =false;
	while(i<=j){
		if (numlst[i] != numlst[j])  check = true;
		i++;j--;
	}
	if (check){
		return 0;
	}else{
		return 1;
	}
}


int main(){
	int a, b;
	cin >>a >> b;
	int i, j, count=0;
	for (i=a;i<=b;i++) count +=test(i);
	cout << count;
return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("trapv")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,sse,sse2,fma,tune=native")
#include<bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define pb push_back
#include <x86intrin.h>
#define pb push_back
using namespace std;
using ll = long long;
using pi = pair<int, int>;
using vi = vector<int>;
const int maxn = 5005, mod = 998244353;
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	string s;
	cin >> s;
	cout << string(s.size(), 'x');
}


Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
using namespace std;

typedef istringstream ISS;
typedef ostringstream OSS;
typedef vector<string> VS;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef pair <int, int> II;
typedef vector <II> VII;
template<class T> T gcd( T a, T b ) {
    return !b ? a : gcd( b, a % b );
}
template<class T> T lcm( T a, T b ) {
    return a / gcd( a, b ) * b;
}
template<class T> string print_v( vector<T> v ) {
    OSS oss;
    for ( typename vector<T>::iterator it_i = v.begin(); it_i != v.end(); ++it_i ) {
        oss << *it_i << ", ";
    }
    return oss.str();
}



const int SIZE = 1002;
const int NONE = INT_MAX / 3;
int dp[SIZE][SIZE];

int main() {
    int n;
    while ( cin >> n ) {
        VII P(n);
        for ( int i = 0; i < n; ++ i ) {
            cin >> P[i].second >> P[i].first;
        }
        sort( P.begin(), P.end() );
        VI A(n), B(n);
        for ( int i = 0; i < n; ++ i ) {
            A[i] = P[i].second;
            B[i] = P[i].first;
        }

        fill( (int*)dp, (int*)dp + SIZE * SIZE, NONE );
        dp[0][0] = 0;
        for ( int i = 0; i < n; ++ i ) {
            for ( int j = 0; j <= n; ++ j ) {
                dp[i+1][j] = dp[i][j];
                int solvedTime = dp[i][j-1] + A[i];
                if ( j > 0 && solvedTime <= B[i] ) {
                    dp[i+1][j] = min( dp[i][j], solvedTime );
                }
            }
        }
        int res = 0;
        for ( int i = 1; i <= n; ++ i ) {
            if ( dp[n][i] != NONE ) {
                res = i;
            }
        }
        cout << res << endl;
    }
    return 0;
}

Measured memory_bytes: 0
def get( s ):
    sum=0
    s = sorted(s) 
    for i in range(len(s)):
        sum += int(ord(s[i])*(1<<(i*5)))
    return sum

S=[]
n =int(input())
for i in range(n):
    S.append(input())

H=[0]*n
for i in range(n):
    H[i]=get(S[i])

H.sort()
c=0
ans=0
for i in range(n-1):
    if H[i]==H[i+1]:
        c+=1
    else:
        ans += c*(c+1)//2
        c=0
ans += c*(c+1)//2
print(ans)



Measured memory_bytes: 21956
#include <iostream>
#include <stack>
#include <cstring>
#include <string>
using namespace std;
int min(int a , int b){
  if(a>=b){return b;}
  else {return a;}
}

int main()
{     int N; int K ;  cin>>N>>K;
    int arr[N];
    for (int i = 0; i < N; ++i)
     {
       cin>>arr[i];
     } 
     int disarr[N]; 
     for (int i = 0; i < N; ++i)
     {   int first=arr[i]-0;  int second=arr[i]-K;
      if(second<0){second=-second;}
      
       disarr[i]=min(first,second);

       

     }
    int sum=0; 
    for (int i = 0; i < N; ++i)
    {
      sum+=disarr[i];

    }
    cout<<2*sum;
   

   return  0;
}

Measured memory_bytes: 256
import java.util.*;
 
public class Main {
	
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int N = sc.nextInt();
    	int[] T = new int[N+1];
    	for (int i = 1; i <= N; i++) {
    		T[i] = sc.nextInt();
    	}
    	int M = sc.nextInt();
    	StringBuilder sb = new StringBuilder();
    	for (int i = 1; i <= M; i++) {
    		int count = 0;
    		int Dnum = sc.nextInt();
    		int time = sc.nextInt();
    		for (int j = 1; j <= N; j++) {		
    			if (j == Dnum) {
    				count += time;
    			} else {
    				count += T[j];
    			}
    		}
    		sb.append(count + "\n");
    	}
    	System.out.println(sb);
    }
}

Measured memory_bytes: 23252
#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#include<string>
#include<iostream>
#include<vector>
#include<cstdlib>
using namespace std;

using ll = long long; 
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)

signed main() {
  ll h,w,a,b;
    cin>>h>>w>>a>>b;
  FOR(i,0,h){
    string s;
    FOR(j,0,w){
      if(i<b&&j<a) s+='0';
      else if(i>=b&&j>=a) s+='0';
      else s+='1';
    }
    cout<<s<<endl;
  }
}


Measured memory_bytes: 1280
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author champon
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for(ll i=0; i<n; i++)
#define repr(i, s, e) for(ll i=s; i>=e; i--)
#define reps(i, s, e) for(ll i=s; i<=e; i++)
#define inf 1e18
#define all(v) v.begin(),v.end()
#define ceill(a, b) (a+b-1)/b
#define ok cout << "ok" << endl;
#define sp << " " <<
void ans(bool b){ cout << (b ? "Yes" : "No") << endl; }
void ans2(bool b){ cout << (b ? "YES" : "NO") << endl; }
template<typename T> inline bool chmax(T &a, T b){ if(a<b) a=b; return a<b; }
template<typename T> inline bool chmin(T &a, T b){ if(b<a) a=b; return b<a; }
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    fill((T*)array, (T*)(array+N), val);
}
template<typename T> void vdeb(T v){
    cout << "#vector set debug" << endl;
    for(auto vv : v) cout << vv << " ";
    cout << endl;
}
template<typename T1, typename T2> void adeb(T1 arr[], T2 n){
    cout << "#adebug" << endl;
    for(int i=0; i<=n; i++) cout << arr[i] << " ";
    cout << endl;
}
template<typename T1> void mdeb(T1 mp){
    cout << "#map pair debug" << endl;
    for(auto const& m : mp) cout << m.first sp m.second << endl;
}
int dx[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dy[] = {0, 1, 0, -1, 1, -1, -1, 1};


class EDoubleFactorial {
public:
	void solve(std::istream& in, std::ostream& out) {
        ll n;
        in >> n;

        if(n%2==1) {
            out << 0 << endl;
            return;
        }

        ll now = 5;
        ll res = 0;
        while(n >= now){
            res += n / now / 2;
            now *= 5;
        }

        out << res << endl;
	}
};


int main() {
	EDoubleFactorial solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


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

using namespace std;
#define REP(i, a, n) for(int i=a; i<n; i++) 
#define REPd(i, a, n) for(long double i=a; i<n; i++)
#define sortv(v) sort(v.begin(), v.end());
#define sortg(v) sort(v.begin(), v.end(), greater<>());
#define rev(v) reverse(v.begin(), v.end());

int main() {
  long double n, k, p=0, tmp;
  cin >> n >> k;
  tmp=n;
  vector<long double> v(n);
  REPd(i, 0, n) v[i]=i+1;
  REPd(b, 1, 25){
    REPd(a, 0, tmp){
        if(v[a]<k) {
            v[a]=2*v[a];
            continue;
            }
        if(v[a]>=k) {
            p+=(tmp-a)*(powl(0.5, b-1));
            tmp=a; 
            break;
            }
    }
    if(tmp==0) break;
  }
  cout << fixed << setprecision(15);
  cout << p/n << endl;
}

Measured memory_bytes: 1792
#include <iostream>
using namespace std;
int main() {
    int A, B, C, X;
	cin >> A >> B >> C >> X;
	int ans = 0;
	for (int i = 0; i <= A; ++i) {
		for (int j = 0; j <= B; ++j) {
			for (int k = 0; k <= C; ++k) {
				if (500 * i + 100 * j + 50 * k == X) {
					ans++;
					}
			}
		}
	}
	cout << ans << endl;
	
}

Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    H,W,M=mi()

    H_count = [0] * (H+1)
    W_count = [0] * (W+1)
    G = set()
    seenH = set()
    seenW = set()
    for i in range(M):
        h,w=mi()
        H_count[h] += 1
        W_count[w] += 1

        seenH.add(h)
        seenW.add(w)
        G.add((h,w))
    
    Hs = []
    Ws = []
    for i in range(max(H,W)+1):
        if i < len(H_count):
            count = H_count[i]
            if count > 0:
                Hs.append((count,i))

        if i < len(W_count):
            count = W_count[i]
            if count > 0:
                Ws.append((count,i))


    Hs.sort(reverse=True)
    Ws.sort(reverse=True)

    # print(Hs)
    # print(Ws)

    h_count,h = Hs[0]
    w_count,w = Ws[0]

    original = h_count + w_count
    ans = original
    if (h,w) in G:
        # print("a")
        ans -= 1

        i = 1
        sameH = []
        while i < len(Hs) and Hs[i][0] == h_count:
            # print("h")
            h = Hs[i][1]
            i += 1
            sameH.append(h)
        
        i = 1
        sameW = []    
        while i < len(Ws) and Ws[i][0] == w_count:
            w = Ws[i][1]
            i += 1
            sameW.append(w)
           
        max_mass = (len(sameH)+1) * (len(sameW)+1)

        # print(max_mass)
        on_bom_count = 0
        for h,w in G:
            count = H_count[h] + W_count[w]
            if count == original:
                on_bom_count += 1
        
        if max_mass - on_bom_count > 0:
            ans += 1

                
    print(ans)


        
    



if __name__ == "__main__":
    main()

Measured memory_bytes: 192204
#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
typedef long long ll;
const long long INF = 1LL << 60;
int main()
{
    int x, y;
    cin >> x >> y;

    int check[13];
    check[1] = check[3] = check[5] = check[7] = check[8] = check[10] = check[12] = 0;
    check[4] = check[6] = check[9] = check[11] = 1;
    check[2] = 2;

    if (check[x] == check[y]) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
    int n;
    cin >> n;
    bool f = false;
    for(int i = 1; i <= 9; i++){
        for(int j = i; j <= 9; j++){
            if(i * j == n){
                f = true;
                break;
            }
        }
    }

    if(f == true){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }


    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repo(i,n) for(int i = 1; i < (int)(n); i++)
#define pb push_back
#define mp make_pair
#define np next_permutation
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define pi acos(-1.0)
const ll INF = 1LL<<61;
template<class T>bool chmax(T &a, const T &b) { 
  if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) {
  if (b<a) { a=b; return 1; } return 0; }
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }
ll jou(ll N, ll P){if(P==0) return 1;
  if(P%2==0){ll t = jou(N, P/2);return t*t % mod;
  }return (N * jou(N, P-1)) % mod;}  //jou(n,mod-2)で逆元
//intの最大値2147483647 ≒ 2×10^9
//long longの最大値9223372036854775807 ≒ 9×10^18
//'大文字'+=32;    で小文字に
//  cout << fixed << setprecision (20);   小数点以下2０桁まで
//実行時間制約2秒では２×10^8回くらいまで計算できる




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

  vector<int> sosu={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97};
  vector<int> p(25);
  rep(i,25){
    int m=n;
    int cnt=0;
    while(m>0){
      cnt+=m/sosu[i];
      m/=sosu[i];
    }
    p[i]=cnt;
  }

  int nayo=0;
  int niyo=0;
  int juyo=0;
  int yo=0;
  int ni=0;
  rep(i,25){
    if(p[i]>=74) nayo++;
    if(p[i]>=24) niyo++;
    if(p[i]>=14) juyo++;
    if(p[i]>=4) yo++;
    if(p[i]>=2) ni++;
  }

  int ans=0;
  ans+=nayo;
  ans+=niyo*(ni-1);
  ans+=juyo*(yo-1);
  ans+=yo*(yo-1)*(ni-2)/2;

  cout << ans << endl;

}

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

#define S_MAX 100
#define N_MAX 100000
#define M_MAX 200000
#define INF 10000000
#define MOD 1000000007
#define SMAP(a, b) ((a)!=(b))&&((a)^=((b)^=((a)^= (b))))

typedef unsigned long long ull;
typedef   signed long long dll;

int n, m;
int h, w;
int i, j, k;
ull a, b;

ull x[N_MAX];
char s[S_MAX + 1];

typedef struct {
	int in;
	int out;
} twoway;

void deb(){
	return;
}

void solve(){
	ull result = 0;
	int p = 0;


	return;
}

int main (void) {
	char *t;
	bool x[26] = {0};
	scanf("%d%d", &h, &w);
	
	for (i = 0; i < h; i++) {
		scanf("%s", s);
		puts(s);
		puts(s);
	}

	solve();
	return 0;
}




Measured memory_bytes: 128
import java.util.*; import java.io.*; import java.math.*;
public class Main{
	//Don't have to see. start------------------------------------------
	static class InputIterator{
		ArrayList<String> inputLine = new ArrayList<String>(1024);
		int index = 0; int max; String read;
		InputIterator(){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			try{
				while((read = br.readLine()) != null){
					inputLine.add(read);
				}
			}catch(IOException e){}
			max = inputLine.size();
		}
		boolean hasNext(){return (index < max);}
		String next(){
			if(hasNext()){
				return inputLine.get(index++);
			}else{
				throw new IndexOutOfBoundsException("There is no more input");
			}
		}
	}
	static HashMap<Integer, String> CONVSTR = new HashMap<Integer, String>();
	static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
	static PrintWriter out = new PrintWriter(System.out);
	static void flush(){out.flush();}
	static void myout(Object t){out.println(t);}
	static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
	static String next(){return ii.next();}
	static boolean hasNext(){return ii.hasNext();}
	static int nextInt(){return Integer.parseInt(next());}
	static long nextLong(){return Long.parseLong(next());}
	static double nextDouble(){return Double.parseDouble(next());}
	static ArrayList<String> nextStrArray(){return myconv(next(), 8);}
	static ArrayList<String> nextCharArray(){return myconv(next(), 0);}
	static ArrayList<Integer> nextIntArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Integer> ret = new ArrayList<Integer>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Integer.parseInt(input.get(i)));
		}
		return ret;
	}
	static ArrayList<Long> nextLongArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Long> ret = new ArrayList<Long>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Long.parseLong(input.get(i)));
		}
		return ret;
	}
	static String myconv(Object list, int no){//only join
		String joinString = CONVSTR.get(no);
		if(list instanceof String[]){
			return String.join(joinString, (String[])list);
		}else if(list instanceof ArrayList){
			return String.join(joinString, (ArrayList)list);
		}else{
			throw new ClassCastException("Don't join");
		}
	}
	static ArrayList<String> myconv(String str, int no){//only split
		String splitString = CONVSTR.get(no);
		return new ArrayList<String>(Arrays.asList(str.split(splitString)));
	}
	public static void main(String[] args){
		CONVSTR.put(8, " "); CONVSTR.put(9, "\n"); CONVSTR.put(0, "");
		solve();flush();
	}
	//Don't have to see. end------------------------------------------
	static void solve(){//Here is the main function
		ArrayList<Integer> one = nextIntArray();
		int A = one.get(0);
		int B = one.get(1);
		if((B > 0 && A < 0) || A == 0 || B == 0){
			myout("Zero");
		}else if(A > 0 && B > 0){
			myout("Positive");
		}else{
			if((B - A) % 2 == 1){
				myout("Positive");
			}else{
				myout("Negative");
			}
		}
	}
	//Method addition frame start



	//Method addition frame end
}


Measured memory_bytes: 32732
#include<bits/stdc++.h>
#define fi(i,a,b) for(ll i = a; i < b; i++)
#define fd(i,a,b) for(ll i = a; i >= b; i--)
#define cfi(container,it) for(auto it = container.begin(); it != container.end(); it++)
#define cfd(container,it) for(auto it = container.rbegin(); it != container.rend(); it++)
#define vi vector<int>
#define vll vector<ll>
#define all(v) (v).begin(), (v).end()
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pb push_back

using namespace std;
using ll = long long;
const int MOD = (int) 1e9 + 7;

int n, m, x;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	
	cin>>n>>m>>x;
	vi c(n);
	vector<vi> a(n, vi(m));
	ll ans = 1e15;

	fi(i, 0, n) {
		cin>>c[i];
		fi(j, 0, m) {
			cin>>a[i][j];
		}
	} 

	vi skill(m, 0);
	bool done = false;

	fi(i, 1, (1<<n) + 1) {
		ll cost = 0;
		fi(j, 0, n) {
			if(i & (1<<j)) {
				cost += c[j];
				fi(k, 0, m) {
					skill[k] += a[j][k];
				}
			}
		}

		bool flag = true;
		fi(j, 0, m) {
			if(skill[j] < x)
				flag = false;
			skill[j] = 0;
		}

		if(flag) {
			done = true;
			ans = min(ans, cost);
		}
	}

	cout<<(done ? ans : -1)<<'\n';

	return 0;
}

Measured memory_bytes: 3688
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			if((a==0) && (b==0)) {
				break;
			}
				
			if(a <= b) {
				System.out.printf("%d %d\n", a, b);
			}else {
				System.out.printf("%d %d\n", b, a);
			}
		}

	}
}



Measured memory_bytes: 41620
import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        boolean ans = s.charAt(2)==s.charAt(3)&&s.charAt(4)==s.charAt(5);
        System.out.println(ans?"Yes":"No");

    }

}


Measured memory_bytes: 23892
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T>& V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> >& Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T>& mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }
template<typename T>vector<T> make_v(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>auto make_v(size_t a,Ts... ts){return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type fill_v(T &t,const V &v){t=v;}
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type fill_v(T &t,const V &v){for(auto &e:t) fill_v(e,v);}
/*
 <url:>
 問題文============================================================
 =================================================================
 解説=============================================================
 ================================================================
 */

template<class Type>
Type solve(Type res = Type()){
    int N; cin >> N;
    N%=10;

    map<int,string> mp;
    mp[2] = mp[4] = mp[5] = mp[7] = mp[9] = "hon";
    mp[0] = mp[1] = mp[6] = mp[8] = "pon";
    mp[3] = "bon";

    res = mp[N];
    return res;
}
int main(void) {
    cin.tie(0); ios::sync_with_stdio(false);
    //solve<ll>(0);
    cout << fixed << setprecision(12) << solve<string>() << endl;
    return 0;
}

Measured memory_bytes: 3624
def f(n):
    if n % 2 == 0:
        return n / 2
    else:
        return 3 * n + 1

s = int(input())
st = set([s])

ans = -1
for i in range(2, 1000001):
    s = int(f(s))
    if s in st:
        ans = i
        break
    st.add(s)

print(ans)


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

int main(void) {
  int n; cin >> n;
  int k; cin >> k;
  vector<int> x(n);
  for (int i=0; i<n; i++) {
    cin >> x[i];
  }
  
  int ans = 0;
  
  for (int i=0; i<n; i++) {
    ans += min(x[i], k-x[i]) * 2;
  }
  
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3576
#include <iostream>
#include <vector>
#include <algorithm>
int main(void){
  int A,B,C;
  std::cin>>A >> B >> C;
  std::vector<int> v;
  v.push_back(A);
  v.push_back(B);
  v.push_back(C);
  sort(v.begin(),v.end());
  // 最初の２つが同じかみる
  if(v[0] == v[1]){
    //このときv[1] != v[2]ならok
    if(v[1] != v[2]){
      std::cout << "Yes" << std::endl;
    }else{
      std::cout << "No" << std::endl;
    }
  }else{
    //違うときはv[1] = v[2]
    if(v[1] == v[2]){
      std::cout << "Yes" << std::endl;
    }else{
      std::cout << "No" << std::endl;
    }
  }
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<climits>
#define INF INT_MAX;
void merge(int*, int, int, int);
void mergeSort(int*, int, int);
int cnt=0;
int main(){
  int n;
  std::cin >> n;
  int A[n];
  for(int i=0; i<n; i++) std::cin >> A[i];
  mergeSort(A, 0, n);
  for(int i=0; i<n;i ++){
    std::cout << A[i];
    if(i != n-1) std::cout << " ";
  }
  std::cout << "\n" << cnt << "\n";
  return 0;
}
void merge(int *A, int l, int m, int r){
  int n1=m-l, n2=r-m, i, j, L[n1+1], R[n2+1];
  for(i=0; i<n1; i++) L[i] = A[l+i];
  for(i=0; i<n2; i++) R[i] = A[m+i];
  L[n1] = R[n2] = INF;
  i = j = 0;
  for(int k=l;k<r;k++){
    if(L[i] <= R[j]){
      A[k] = L[i];
      i++;
      cnt++;
    }
    else{
      A[k] = R[j];
      j++;
      cnt++;
    }
  }
}
void mergeSort(int *A, int l, int r){
  int m;
  if(l+1 < r){
    m = (l + r) / 2;
    mergeSort(A, l, m);
    mergeSort(A, m, r);
    merge(A, l, m, r);
  }
}

Measured memory_bytes: 6920
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

#define INFTY 999999999

int count;

void merge(int *A,int left,int mid,int right){
	int n1=(mid-left);
	int n2=(right-mid);
	int *L,*R;
	L=(int*)malloc(sizeof(int)*(n1+1));
	R=(int*)malloc(sizeof(int)*(n2+1));
	for(int i=0;i<n1;i++){
		L[i]=A[left+i];
	}
	for(int i=0;i<n2;i++){
		R[i]=A[mid+i];
	}
	L[n1]=INFTY;
	R[n2]=INFTY;
	int i=0,j=0;
	for(int k=left;k<(right);k++){
		if(L[i]<=R[j]){
			A[k]=L[i];
			i++;
		}else{
			A[k]=R[j];
			j++;
		}
		count++;
	}
}

void mergeSort(int *A,int left,int right){
	int mid;

	if((left+1)<right){
		mid=((left+right)/2);
		mergeSort(A,left,mid);
		mergeSort(A,mid,right);
		merge(A,left,mid,right);
	}
}

int main(){
	int N;
	int *S;

	count=0;

	scanf("%d",&N);
	S=(int*)malloc(sizeof(int)*N);
	for(int i=0;i<N;i++){
		scanf("%d",&S[i]);
	}

	mergeSort(S,0,N);

	for(int i=0;i<N;i++){
		printf("%d",S[i]);
		if(i==(N-1)){
			printf("\n");
		}else{
			printf(" ");
		}
	}
	printf("%d\n",count);
	
	return 0;
}


Measured memory_bytes: 64436
#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <set>
using namespace std;

void solve(){
  unsigned long long int x, y; cin >> x >> y;
  y /= x;
  x /= x;
  unsigned long long int sum = 0;
  while(x <= y){
    x *= 2;
    sum++;
  }
  cout << sum << endl;
  return;
}

int main(){
  solve();
  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

int gcd(int a, int b) {return b == 0 ? a : gcd(b, a % b);}

#define ll int
#define pb push_back
#define ld long double
#define mp make_pair
#define F first
#define S second
#define pii pair<ll,ll> 

using namespace :: std;

const ll maxn=520;
const ll maxm=500*510;

ll x[maxn];
set<ll> st;
ll ans[maxm];
pii y[maxn];

int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);	
	ll n;
	cin>>n;
	for(ll i=1;i<=n;i++){
		cin>>x[i];
		y[i]=mp(x[i],i);
		ans[x[i]]=i;
	}
	sort(y+1,y+n+1);
	ll m=(n*n);
	for(ll i=1;i<=m;i++){
		if(ans[i]==0){
			st.insert(i);
		}
	}
	for(ll i=1;i<=n;i++){
		ll v=y[i].S;
		for(ll j=1;j<v;j++){
			ll e=(*st.begin());
			st.erase(e);
			if(e>y[i].F){
				cout<<"No";
				return 0;
			}
			ans[e]=v;
		}
	}
	for(ll i=n;i>=1;i--){
		ll v=y[i].S;
		for(ll j=1;j<=n-v;j++){
			ll e=(*st.rbegin());
			st.erase(e);
			if(e<y[i].F){
				cout<<"No";
				return 0;
			}
			ans[e]=v;
		}
	}
	

	cout<<"Yes\n";
	for(ll i=1;i<=m;i++){
		cout<<ans[i]<<' ';
	}
}




















Measured memory_bytes: 13824
#include <bits/stdc++.h>
const int INF=1e9;
const int MOD=1e9+7;
//const int MOD=998244353;
const long long LINF=1e18;
using namespace std;
#define int long long
#define fin {cout<<"No"<<endl;return 0;}
//template

//main
signed main(){
  int N;cin>>N;
  std::vector<int> v(N);
  for(int i=0;i<N;i++)cin>>v[i];
  sort(v.begin(),v.end());
  cout<<v[N/2]-v[N/2-1]<<endl;
}


Measured memory_bytes: 1024
#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>

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;

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

typedef boost::multiprecision::number<boost::multiprecision::cpp_dec_float<1000>> cpp_dec_float_1000;

constexpr char CRLF  = '\n';
constexpr char SPACE = ' ';
constexpr char VECTOR_COUT_SEPARATOR = SPACE;
constexpr ll INF = 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; }

void solve(void)
{
  string s; cin >> s;
  set<char> s1{s.begin(), s.begin() + 3};
  set<char> s2{s.begin() + 1, s.end()};

  auto ans = s1.size() == 1 || s2.size() == 1;
  cout << (ans ? "Yes" : "No") << CRLF;
  return;
}

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

  solve();

  return 0;
}


Measured memory_bytes: 256