akhauriyash/Code-Regression huggingface dataset:
#atcoder template
def main():
    import sys
    imput = sys.stdin.readline
    #文字列入力の時は上記はerrorとなる。
    #ここにコード
    #input
    X, Y = map(int, input().split())

    #output
    #a + b =  X
    #2*a + 4*b = Y
    if 4*X - Y >= 0 and Y % 2 == 0 and Y - 2*X >= 0:
        print("Yes")
    else:
        print("No")

    #N = 1のときなどcorner caseを確認！
if __name__ == "__main__":
    main()

Measured memory_bytes: 9168
AB = []
for i in range(3):
    a,b = map(int, input().split())
    AB.append((min(a,b),max(a,b)))

AB = sorted(AB)

if 1 in AB[0]:
    tmp = AB
    ne = AB[0][1]
    AB = AB[1:]
else:
    print('NO')
    exit()

a = AB[0][0]
b = AB[0][1]

c = AB[1][0]
d = AB[1][1]

if ne == a or ne == b:
    if ne == a:
        ne = b
    elif ne == b:
        ne = a

    if ne == c or ne == d:
        ans = 'YES'
    else:
        ans = 'NO'

elif ne == c or ne == d:
    if ne == c:
        ne = d
    elif ne == d:
        ne = c

    if ne == a or ne == b:
        ans = 'YES'
    else:
        ans = 'NO'

else:
    ans = 'NO'

print(ans)


Measured memory_bytes: 3064
package main

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

func main() {
	sc := bufio.NewScanner(os.Stdin)
	i := 1
	for sc.Scan() {
		sc.Text()
		x, err := strconv.Atoi(sc.Text())
		if err != nil {
			panic(err)
		}
		if x == 0 {
			break
		}
		fmt.Printf("Case %d: %d\n", i, x)
		i++
	}
}



Measured memory_bytes: 1308
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <array>
#include <queue>
#include <map>
#include <set>
#include <sstream>
#include <stdio.h>
#include <cstdio>
#include <cstring>
#include <math.h>

using namespace std;

#define Rep(i,a,b) for(int i = a; i < b; i++)
#define rep(i,b) Rep(i,0,b)
#define rrep(i,a) for(int i = a; i >= 0; i--)
#define allof(a) (a).begin(), (a).end()

typedef long long ll;
const int inf = 1e9 + 7;
const ll infll = 1ll << 60ll;
const ll mod = 1e9 + 7;
// 0~3までは右左下上 4~7までは斜め
constexpr int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
constexpr int dy[] = { 0, -1, 0, 1, 1, -1, -1, 1 };

/*
// 最大公約数
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}

// 最小公倍数
ll lcm(ll a, ll b) {
	return a * b / gcd(a, b);
}*/

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

	ll n, m;
	cin >> n >> m;

	// 自分の周囲の点の数が重要
	// 奇数の場合は表のまま
	// 偶数の場合は裏になる
	// 4つ角は最大3つ
	// 縦または横が1マスの場合は一つ　←　どちらにしろ奇数で表になる
	// 角以外の端では、最大5つ
	// 1マスの場合は2つ　←　端の数が偶数で裏になる
	// それ以外は8つで裏

	if (n == 1 || m == 1) {
		if (n == m) {
			cout << 1 << endl;
			return 0;
		}
		cout << max(n, m) - 2 << endl;
		return 0;
	}

	// 周囲が完全に囲まれているマスを数える
	cout << (n - 2) * (m - 2) << endl;

	return 0;
}

Measured memory_bytes: 256
fn main() {
    let mut buf = String::new();
    std::io::stdin().read_line(&mut buf).ok();
    let x: usize = buf.trim().parse().unwrap();

    for i in x.. {
        let mut res = true;
        for j in 2..(x as f64).sqrt() as usize {
            if i % j == 0 {
                res = false;
                break;
            }
        }

        if res {
            println!("{}", i);
            return;
        }
    }
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
int n, k;
double p[200005], ac, m;
int main(){
	scanf("%d%d", &n, &k);
	rep(i,n){
		scanf("%lf", p+i+1);
		p[i+1] = (p[i+1] + 1) / 2;
		ac += p[i+1];
		if(i+1 >= k){
			ac -= p[i+1-k];
			m = max(m,ac);
		}
	}
	printf("%.9f\n",m);
}

Measured memory_bytes: 1792
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
#include <string>
#include <set>
#include <bitset>
#include <unordered_map>
#include <cmath>
#include <functional>
#include <map>
#include <cstdlib>
#include <stack>

using namespace std;
using ll = long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
template <class T>
using Vvec = vector<vector<T> >;
using Graph = Vvec<int>;

template <class T>
void debug(T& v)
{
    for(auto& x: v) cout << x << " ";
    cout << endl;
}

ll query(ll v, ll L, int n, Vvec<ll>& dp, vector<ll>& W, vector<ll>& V){
    // cout << v << " " << L << " " << n << "\n";
    if(v <= n) return dp[v][L];
    ll r1 = query(v/2, L, n, dp, W, V);
    if(L-W[v-1]<0) return r1;
    ll r2 = query(v/2, L-W[v-1], n, dp, W, V) + V[v-1];
    return max(r1, r2);
}

int main()
{
    int N, Q;
    cin >> N;
    vector<ll> V(N), W(N);
    for(int i=0; i<N; i++) cin >> V[i] >> W[i];
    cin >> Q;
    vector<ll> v(Q), L(Q);
    for(int i=0; i<Q; i++) cin >> v[i] >> L[i];

    int n = floor(sqrt(N)+1e-5);
    const ll Lmax = 1e5+1;
    Vvec<ll> dp(n+1, vector<ll>(Lmax));
    for(int i=1; i<=n; i++){
        for(int j=0; j<=Lmax; j++){
            dp[i][j] = dp[i/2][j];
            if(j-W[i-1]>=0) dp[i][j] = max(dp[i][j], dp[i/2][j-W[i-1]] + V[i-1]);
        }
    }

    for(int i=0; i<Q; i++){
        cout << query(v[i], L[i], n, dp, W, V) << "\n";
    }
    // for(auto& v: dp){
    //     debug(v);
    // }
}

Measured memory_bytes: 411148
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        RMQAizu solver = new RMQAizu();
        solver.solve(1, in, out);
        out.close();
    }

    static class RMQAizu {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int q = in.nextInt();
            int[] a = new int[n];
            Arrays.fill(a, Integer.MAX_VALUE);
            int[] b = new int[4 * n];

            build(0, 0, n - 1, a, b);
            while (q-- != 0) {
                int o = in.nextInt();
                int l = in.nextInt();
                int r = in.nextInt();

                if (o == 0) {
                    update(0, 0, n - 1, l, r, a, b);
                } else {
                    out.printf("%d\n", query(0, 0, n - 1, l, r, b));
                }
            }
        }

        private void build(int n, int s, int e, int[] a, int[] b) {
            if (s == e) {
                b[n] = a[s];
            } else {
                int m = (s + e) / 2;
                build(2 * n + 1, s, m, a, b);
                build(2 * n + 2, m + 1, e, a, b);

                b[n] = Math.min(b[2 * n + 1], b[2 * n + 2]);
            }
        }

        private void update(int n, int s, int e, int idx, int val, int[] a, int[] b) {
            if (s == e) {
                a[idx] = val;
                b[n] = val;
            } else {
                int m = (s + e) / 2;
                if (idx >= s && idx <= m) {
                    update(2 * n + 1, s, m, idx, val, a, b);
                } else {
                    update(2 * n + 2, m + 1, e, idx, val, a, b);
                }

                b[n] = Math.min(b[2 * n + 1], b[2 * n + 2]);
            }
        }

        private int query(int n, int s, int e, int l, int r, int[] b) {
            if (r < s || e < l) {
                return Integer.MAX_VALUE;
            }

            if (l <= s && e <= r) {
                return b[n];
            } else {
                int m = (s + e) / 2;
                int ml = query(2 * n + 1, s, m, l, r, b);
                int mr = query(2 * n + 2, m + 1, e, l, r, b);

                return Math.min(ml, mr);
            }
        }

    }
}




Measured memory_bytes: 157696
#include <bits/stdc++.h>
using namespace std;
const int N = 1000+5;

int n, k, a[N];

int main() {
    scanf("%d%d", &n, &k);
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    sort(a+1, a+n+1);
    int ans = 0;
    for (int i = 1; i <= k; i++) ans += a[i];
    printf("%d\n", ans);
    return 0;
}


Measured memory_bytes: 3824
#include <bits/stdc++.h>
#define all(x) begin(x), end(x)
#define dbg(x) cerr << #x << " = " << x << endl
#define _ << ' ' <<
using namespace std;
using ll = long long;
using vi = vector<int>;


int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    cout << n * (n + 1) / 2;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <map>

using namespace std;

int main()
{
	string a, b, c;
	cin >> a >> b >> c;
	cout << a[0] << b[0] << c[0] << endl;
	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n,m) for(int i=n;i<(int)(m);i++)
#define rrep(i,n,m) for(int i=((int)(n)-1);i>=m;i--)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
const int MOD=1000000007;
using namespace std;
int main(){
    ll n,k;
    cin>>n>>k;
    if(k%2==0) cout<<(ll)(pow(n/k,3)+pow((n+(k/2))/k,3))<<endl;
    else cout<<(ll)pow(n/k,3)<<endl;
}


Measured memory_bytes: 256
//package abc127.B;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner scan = new Scanner(System.in);
		
		int r = scan.nextInt();
		int d = scan.nextInt();
		int x = scan.nextInt();
		
		for (int i = 0; i < 10; i++) {
			x *= r;
			x -= d;
			System.out.println(x);
		}
		
	}

}


Measured memory_bytes: 21844
#include<bits/stdc++.h>
#define gc getchar()
#define ll long long
#define pb push_back
#define mk make_pair
#define rint register int
using namespace std;
inline int read(){char ch=gc;int w=1,s=0;while(!isdigit(ch)){if(ch=='-') w=-1;ch=gc;};while(isdigit(ch)){s=s*10+ch-'0';ch=gc;} return w*s;}
int f[2020][2020],Sum1[4040][2020],Sum2[4040][2020],pos1[2020],pos2[2020];
int N;
struct node{
	int c,x;
}a[1000100];
int main()
{
//	freopen("magolor.in","r",stdin);
//	freopen("magolor.out","w",stdout);
	N=read();
	for(rint i=1;i<=(N<<1);++i)
	{
		char s[10];int x;scanf("%s",s+1);
		x=read();
//		if(s[1]=='A') a[i].c=1;
//		else a[i].c=2;
//		a[i].x=x;
		for(rint j=i;j<=(N<<1);++j)
		{
			if(s[1]=='W')
			Sum1[j][x-1]++,pos1[x]=i;
			if(s[1]=='B')
			Sum2[j][x-1]++,pos2[x]=i;
		}
	}
//	for(rint i=1;i<=(N<<1);++i){
//		if(a[i].c==1)
//		{
//			for(rint j=1;j<=i;++j)
//			{
//				
//			}
//		}
//	}
	for(rint i=1;i<=(N<<1);++i)
	{
//		for(rint j=0;j<=N;++j) Sum1[i][j]+=Sum1[i-1][j],Sum2[i][j]+=Sum2[i-1][j];
		for(rint j=N;j>=0;--j) Sum1[i][j]+=Sum1[i][j+1],Sum2[i][j]+=Sum2[i][j+1];
	}
//	for(rint i=1;i<=(N<<1);++i){
//		for(rint j=0;j<=N;++j) cout<<i<<" "<<j<<" "<<Sum1[i][j]<<" "<<Sum2[i][j]<<"\n";
//	}
	memset(f,0x3f,sizeof(f));
	f[0][0]=0;
	for(rint i=0;i<=N;++i)
	{
		for(rint j=0;j<=N;++j)
		{
			if(i==0&&j==0) continue;
			else 
			{
				if(!j)f[i][j]=f[i-1][j]+Sum1[pos1[i]-1][i]+Sum2[pos1[i]-1][j];
				if(!i)f[i][j]=f[i][j-1]+Sum1[pos2[j]-1][i]+Sum2[pos2[j]-1][j];
				if(i>0&&j>0)f[i][j]=min(f[i-1][j]+Sum1[pos1[i]-1][i]+Sum2[pos1[i]-1][j],f[i][j-1]+Sum1[pos2[j]-1][i]+Sum2[pos2[j]-1][j]);
			}
		}
	}cout<<f[N][N];
	return 0;
}


Measured memory_bytes: 81664
import sys
import numpy as np
n, k = [int(i) for i in sys.stdin.readline().split()]
a_ls = [int(i) for i in sys.stdin.readline().split()]
f_ls = [int(i) for i in sys.stdin.readline().split()]
a_ls.sort(reverse=True)
f_ls.sort()
a_sum = sum(a_ls)
a_ls = np.array(a_ls)
f_ls = np.array(f_ls)
minimum = 0
maximum = (a_ls * f_ls).sum()
def check(x):
    """
    :param x:
    :return: x以下で可能か
    """
    return a_sum - np.minimum(a_ls, x // f_ls).sum() <= k
while True:
    center = (maximum + minimum) // 2
    if check(center):
        if maximum == center:
            res = center
            break
        maximum = center
    else:
        if minimum == center:
            if check(maximum):
                res = maximum
                break
            else:
                res = minimum
        minimum = center
print(res)

Measured memory_bytes: 43548
//! Framework <https://github.com/vain0x/procon>

#![allow(non_snake_case)]
#![allow(unused_imports)]

use std::collections::*;

pub struct Scan(Box<dyn Iterator<Item = &'static str>>); // '

impl Scan {
    fn new() -> Self {
        let mut buf = String::new();
        let read_line = move || {
            std::io::stdin().read_line(&mut buf).unwrap();
            Box::leak(buf.split_off(0).into_boxed_str()).split_whitespace()
        };
        Scan(Box::new(std::iter::repeat_with(read_line).flatten()))
    }

    pub fn word<T: std::str::FromStr>(&mut self) -> T {
        self.0.next().unwrap().parse().ok().unwrap()
    }

    pub fn list<T: std::str::FromStr>(&mut self, len: usize) -> Vec<T> {
        std::iter::repeat_with(|| self.word()).take(len).collect()
    }
}

const M: usize = 100_001;

fn main() {
    let mut scan = Scan::new();

    let N = scan.word::<usize>();
    let A = scan.list::<usize>(N);
    let Q = scan.word::<usize>();

    let mut freq = vec![0; M];
    let mut total = 0;
    for &a in &A {
        freq[a] += 1_usize;
        total += a;
    }

    for _ in 0..Q {
        let b = scan.word::<usize>();
        let c = scan.word::<usize>();

        let bn = freq[b];
        freq[c] += bn;
        freq[b] = 0;
        total -= bn * b;
        total += bn * c;
        println!("{}", total);
    }
}

/*

2
1 100000
3
3 4
100000 1
1 100000

*/


Measured memory_bytes: 7832
#include <stdio.h>

int main(void) {
    int A, B;

    scanf("%d %d", &A, &B);

    if (A >= 13) {
        printf("%d\n", B);
    } else if (6 <= A && A <= 12) {
        printf("%d\n", B / 2);
    } else {
        printf("%d\n", 0);
    }

    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <fstream>
#include <vector>
#include <deque>
#include <set>
#include <map>
#include <unordered_map>
#include <list>
#include <array>
#include <cstdlib>
#include <stack>
#include <string>
#include <queue>
#include <chrono>
#include <functional>
#include <limits>
#include <cmath>
#include <algorithm>
#include <random>
#include <regex>
#include <tuple>
#include <utility>
#include <bitset>
#include <complex>
#include <iomanip>
#include <ostream>
#include <sstream>
#include <ctime>
using namespace std;
#define for0(i, n) for(int i = 0; i < n; i++)
#define for1(i, n) for(int i = 1; i <= n; i++)
#define pb push_back
#define mp make_pair
#define all(v) v.begin(), v.end()
#define V vector<int>
#define VP vector<pair<int, int> >
#define FASTIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define index INDEX
#ifndef ONLINE_JUDGE
#define print(x) PRINT(x, #x)
template<typename T> inline const void PRINT(T VARIABLE, const string& NAME) {
	cerr << NAME << " = " << fixed << VARIABLE << "\n";
}
#else
#define print(x) 0 
#endif
#ifdef RAND_MAX
#undef RAND_MAX
#endif
#define RAND_MAX 999999937 
int generate_random() {
	const int MAX_RANDOM = (int)1e6;
	mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
	return uniform_int_distribution<int>(0, MAX_RANDOM)(rng);
}
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const ll INFLL = 2 * (ll)1e18 + 100;
#define int ll
#ifdef int 
const int INFINT = INFLL;
#else
const int INFINT = 2 * (int)1e9 + 100;
#endif
const double PI = atan(1) * 4;
const double EPS = 1e-6;
const int SEED = (int)1e3 + 7;
const int MOD = (int)1e9 + 7;
const int NMAX = (int)1e6 + 5;

VP tree[NMAX];

int color[NMAX];
void dfs(int nod, int p, int dist)
{
	if (dist % 2 == 0) color[nod] = 0;
	else color[nod] = 1;
	for (auto i : tree[nod]) if (i.first != p) dfs(i.first, nod, dist + i.second);
}

int32_t main() {
#ifndef ONLINE_JUDGE
	double START_PROGRAM = clock();
#endif
	srand(time(0));
	cout << setprecision(20) << fixed;
	FASTIO;
	int n;
	cin >> n;
	for1(i, n - 1)
	{
		int a, b, c;
		cin >> a >> b >> c;
		tree[a].pb({ b, c });
		tree[b].pb({ a, c });
	}
	dfs(1, 0, 0);
	for1(i, n) cout << color[i] << '\n';







#ifndef ONLINE_JUDGE
	double END_PROGRAM = clock();
	double ELAPSED_TIME = (END_PROGRAM - START_PROGRAM) / CLOCKS_PER_SEC;
	cerr << "\n\nElapsed Time: " << ELAPSED_TIME * 1000 << "\n";
	system("pause");
#endif
	return 0;
}







Measured memory_bytes: 33152
#define rep(i, a, b) for(int i = a; i < (int)(b); i++)
#include <bits/stdc++.h>

typedef long long ll;
using namespace std;
template<class T> inline void chmax(T &a, const T &b) {if(a < b) a = b;}
template<class T> inline void chmin(T &a, const T &b) {if(a > b) a = b;}
const long long INF = 1LL<<60;
const long long MOD = (ll)1e9+7;
// const long long MOD = (ll)1e6+3;
const long long MAX = (ll)1e5+10;


int main(void) {
   ll N;
   cin>>N;
   ll ans = 0;
   if (N%2) ans = 0;
   else {
      N /= 2;
      while (1) {
         N /= 5;
         ans += N;
         if (N==0) break;
      }
   }
   cout<<ans<<endl;

   return 0;
}

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

bool a[10000000];
int main()
{
	int b, c;
	while (cin >> b >> c, b | c) {
		memset(a, true, sizeof(a));
		for (;; b++) {
			if (a[b]) {
				if (c) { c--; 
				for (int e = b * 2; e < 10000000; e += b) {
					a[e] = false;
				}
				}
				else {
					cout << b << endl;
					break;
				}
			}
		}
	}
}

Measured memory_bytes: 12796
import kotlin.math.*
import java.util.*

const val MOD = 1_000_000_007L

fun readI() = readLine()!!.toInt()
fun readL() = readLine()!!.toLong()
fun readD() = readLine()!!.toDouble()
fun readIs() = readLine()!!.split(' ').map(String::toInt)
fun readLs() = readLine()!!.split(' ').map(String::toLong)
fun readDs() = readLine()!!.split(' ').map(String::toDouble)

fun main(args: Array<String>) {
  val (x, y) = readIs()
  val a = y - 2 * x
  val b = x - a / 2
  println(if (0 <= a && 0 <= b && a % 2 == 0) "Yes" else "No")
}


Measured memory_bytes: 36524
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 2e5 + 10;
#define fi first
#define se second
#define pb push_back
#define wzh(x) cerr<<#x<<'='<<x<<endl;
int n,a[N];
int main() 
{
  	ios::sync_with_stdio(false);
  	cin>>n;
  	for(int i=1;i<=n;i++)
  		cin>>a[i];
  	sort(a+1,a+1+n,greater<int>());
	long long ans=a[1];
  	int f=n-2,l=2;
  	while(f>0)
  	{
    	ans+=a[l];
    	f--;
		if(!f)
			break;
    	ans+=a[l];
		f--;
		l++;
  	}
  	cout<<ans<<'\n';
  	return 0;
}

Measured memory_bytes: 4404
#include <iostream>

using namespace std;

int main()
{
    int n, w, h;
    cin >> n >> w >> h;
    if (h % max(n, w) == 0)
    {
        cout << h / max(n, w);
    }
    else
    {
        cout << h / max(n, w) + 1;
    }

    return 0;
}


Measured memory_bytes: 256
/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <bits/stdc++.h>

using namespace std;

const int mod = 1e9+7;

int main()
{
    int t=1;
    //cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        
        vector<int> arr(n);
        for(int i=0;i<n;i++)
        {
            cin>>arr[i];
        }
        
        long long suf[n];
        suf[n-1]=arr[n-1];
        
        for(int i=n-2;i>=0;i--)
        {
            suf[i]=(suf[i+1]+arr[i])%mod;
        }
        
        long long res=0;
        
        for(int i=0;i<n;i++)
        {
            if(i!=n-1)
            {
                res=(res+(arr[i]*suf[i+1])%mod)%mod;
            }
        }
        
        cout<<res<<endl;
    }
    return 0;
}


Measured memory_bytes: 5620
#0,7,5,3で選んでくる
x=[0,7,5,3]
a=[]
k=0

def new_num(c):
    global x
    d=0
    for i in range(9):
        d+=(10**i)*x[c[i]]
    return d

for i0 in range(4):
    for i1 in range(4):
        for i2 in range(4):
            for i3 in range(4):
                for i4 in range(4):
                    for i5 in range(4):
                        for i6 in range(4):
                            for i7 in range(4):
                                for i8 in range(4):
                                    l1=new_num([i0,i1,i2,i3,i4,i5,i6,i7,i8])
                                    l2=str(l1)
                                    if ("3" in l2) and ("5" in l2) and ("7" in l2) and ("0" not in l2):
                                        a.append(l1)
a.sort()
co=0
n=int(input())
for i in a:
    if i<=n:
        #print(i)
        co+=1
    else:
        break
print(co)


Measured memory_bytes: 4272
#include"bits/stdc++.h"
using namespace std;
struct _ { ios_base::Init i; _() { cin.sync_with_stdio(0); cin.tie(0);cout<<fixed<<setprecision(10); } } ___;
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}

#define pii pair<int,int>
#define ff first
#define ss second
#define endll '\n'

using ll = long long int;

int main()
{
    ll n,m;cin>>n>>m;
    ll sum = 0;
    while(m--)
    {
        ll a;cin>>a;
        sum+=a;
    }
    if(sum>n) cout<<-1<<endll;
    else cout<<abs(sum-n)<<endll;
}



Measured memory_bytes: 3656
#include <iostream>

typedef long long ll;

int main(){
   int N, P;
   std::cin >> N >> P;
   int A[N];
   int odd = 0;
   for(int i=0; i<N; ++i){
      std::cin >> A[i];
      if(A[i]%2==1) ++odd;
   }
   if(odd>0){
      ll ans = 1;
      for(int i=0; i<N-1; ++i)
	 ans *= 2;
      std::cout << ans << std::endl;
      return 0;
   }else{
      if(P==1){
	 std::cout << 0 << std::endl;
	 return 0;
      }
      ll ans = 1;
      for(int i=0; i<N; ++i)
	 ans *= 2;
      std::cout << ans << std::endl;
      return 0;

   }

   
	
   return -1;
}


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

const int maxn=1000005;
typedef long long ll;
const ll inf=1ll<<60;
int n,x[maxn],nxt[maxn],fst[maxn],to[maxn],from[maxn],fa[maxn],tot=1;
ll dis[maxn],w[maxn];

void addedge(int *fst,int u,int v,ll c){
	nxt[++tot]=fst[u];fst[u]=tot;to[tot]=v;w[tot]=c;
}

struct node{
	int u;
	ll d;
};
bool operator<(const node&x,const node&y){
	return x.d>y.d;
}
priority_queue<node>q;

struct edge{
	int u,v;
	ll w;
}e[maxn];
bool operator<(const edge&x,const edge&y){
	return x.w<y.w;
}
int find(int x){return !fa[x]?x:fa[x]=find(fa[x]);}

int main(){
	scanf("%d",&n);
	for(int i=1;i<=2*n;i++)dis[i]=inf;
	for(int i=1;i<=n;i++){
		scanf("%d",x+i);
		addedge(fst,i,i+n,x[i]);
		addedge(fst,i+n,i,x[i]);
		dis[i+n]=0;
		from[i+n]=i;
		q.push((node){i+n,0});
	}
	for(int i=1,u,v,c;i<n;i++){
		scanf("%d%d%d",&u,&v,&c);
		addedge(fst,u,v,c),addedge(fst,v,u,c);
	}
	while(!q.empty()){
		node t=q.top();q.pop();
		if(dis[t.u]!=t.d)continue;
		for(int i=fst[t.u];i;i=nxt[i])
			if(dis[to[i]]>t.d+w[i])
				from[to[i]]=from[t.u],q.push((node){to[i],dis[to[i]]=t.d+w[i]});
	}
	for(int i=2;i<=tot;i++)
		e[i]=(edge){from[to[i^1]],from[to[i]],dis[to[i^1]]+dis[to[i]]+w[i]};
	sort(e+2,e+1+tot);
	ll ans=0;
	for(int i=2;i<=tot;i++){
		int s=find(e[i].u),t=find(e[i].v);
		if(s!=t)fa[s]=t,ans+=e[i].w;
	}
	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 52328
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			int x = sc.nextInt();

			if (x < 3) {
				System.out.println("1");
				return;
			}

			int y = (int)Math.sqrt(x);
			int result = y * y;
			for (int i = 2; i <= y; i++) {
				int tmp = i;
				while(tmp <= x){
					tmp *= i;
				}
				tmp /= i;

				if (result < tmp) {
					result = tmp;
				}
			}

			System.out.println(result);
		}
	}
}


Measured memory_bytes: 22868
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<utility>
#include<array>
#include<cassert>
#include<list>

using namespace std;

#define SPEEDY cin.tie(0);ios::sync_with_stdio(false);

#define REP(i,n) for(int i=0;i<(n);i++)
#define ARREP(i,n,X) for(int i=0;i<(n);i++)cin>>X[i]
#define FOR(i,X,n) for(int i=(X);i<(n);i++)
#define EREP(i,n) for(int i=1;i<=n;i++)

#define DEB(X) if(mode==1)cout<< #X <<": "<<X<<" ";
#define DEB2(X) if(mode==1)cout<<X<<" ";
#define ARDEB(i,X) if(mode==1)cout<< #X <<"["<<i<<"]: "<<X[i]<<" ";
#define FORDEB(n,X) if(mode==1)for(int i=0;i<(n);i++)ARDEB(i,X)
#define END if(mode==1)cout<<endl;

typedef long long int ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
#define ALL(X) X.begin(),X.end()
struct edge{int to,cost;};
struct P2{int x,y;};
//struct edge{int from,cost,to;};

const int MOD7=1000000007;
const int INF=100000000;
int mode=0;

int main(){
	int n,a[2000],b[2000],ans=0;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i]>>b[i];
	}
	REP(i,n){
		ans+=b[i]-a[i]+1;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES 
#include<iomanip> 
#include<cmath>  
#include<iostream>
#include<fstream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<bitset>
#include<map>
#include<unordered_map>
#include<set>
#include<unordered_set>
#include<queue>
#include<deque>
#include<stack>
using namespace std;
typedef long long ll;
#define repi(i,a,b) for(ll i = (ll)(a) ; i < (ll)(b) ; i++)
#define repd(i,a,b) for(ll i = (ll)(a) ; i > (ll)(b) ; i--)
#define rd(x) cin >> x
#define wr(x)  cout << x
#define wrln(x) cout << x << endl
const ll MAX_10p5 = 100010;
const ll MAX_10p9 = 1000000010;
const ll MAX_10p18 = 1000000000000000010;
const ll MOD = 1000000007;
const ll m4x[4] = { 1,0,-1,0 };
const ll m4y[4] = { 0,1,0,-1 };
const ll m8x[8] = { 1,1,0,-1,-1,-1,0,1 };
const ll m8y[8] = { 0,1,1,1,0,-1,-1,-1 };
const ll m9x[9] = { 1,1,0,-1,-1,-1,0,1,0 };
const ll m9y[9] = { 0,1,1,1,0,-1,-1,-1,0 };

struct edge {
	ll to, cost;
	bool operator<(const edge& right) const {
		return cost == right.cost ? to < right.to : cost < right.cost;
	}
};
struct point {
	ll x, y;
	bool operator<(const point& right) const {
		return x == right.x ? y < right.y : x < right.x;
	}
};

///////////////////////////////////////////////////////////////////////////////////////



int main() {
	ll n, m, ans = 0;
	cin >> n >> m;
	if (n == 1 && m == 1) ans = 1;
	else if (n == 2 || m == 2) ans = 0;
	else if (n == 1 || m == 1) ans = max(n - 2, m - 2);
	else ans = (n - 2)*(m - 2);
	wrln(ans);
	return 0;
}


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

using namespace std;

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

const int INF_32 = -1 + (1 << 30);

template<class Abel> struct D_Graph {
	int V,E;
	bool **exist;
	vector<vector<pair<int,Abel>>> adj;
	vector<vector<pair<int,Abel>>> adj_inv;
	
	D_Graph(int V_size = 0) { init(V_size); }
	
	void init(int V_size) {
		V = V_size, E = 0;
		
		/*exist = (bool**)malloc(sizeof(bool*) * (V + 1));
		for(int i = 0; i <= V; ++i){
			exist[i] = (bool*)malloc(sizeof(bool) * (V + 1));
			fill(exist[i],exist[i] + V + 1,0);
		}*/
		
		adj.clear(); 
		adj_inv.clear();
		adj.resize(V + 1);
		adj_inv.resize(V + 1);
		adj[0].resize(V);
		for(int i = 1; i <= V; ++i){
			adj[0][i - 1] = {i,0};
			//exist[0][i] = 1;
			//adj[i].reserve(min(V,1000));
			//adj_inv[i].reserve(min(V,1000));
		}
	}
	
	int deg_out(int v) { return adj[v].size(); }
	
	int deg_in(int v) { return adj_inv[v].size(); }
	
	bool is_leaf(int v) { return deg_out(v) == 0; }
	
	bool is_root(int v) { return deg_in(v) == 0; }
	
	void add_edge(int from, int to, Abel cost = 1) {
		adj[from].push_back({to,cost});
		adj_inv[to].push_back({from,cost});
		//exist[from][to] = 1;
		++E;
	}
	
	void sort_edge(){
		for(int i = 0; i <= V; ++i) sort_edge(i);
	}
	
	void sort_edge(int v){
		sort(begin(adj[v]),end(adj[v]));
		sort(begin(adj_inv[v]),end(adj_inv[v]));
	}
	
	void dijkstra(vector<Abel> &dist, int src, Abel dist_max = INF_32){
		dist.clear();
		dist.resize(V + 1);
		fill(begin(dist),end(dist),dist_max);
		priority_queue<pair<Abel,int>,vector<pair<Abel,int>>,greater<pair<Abel,int>>> que;
		que.push({0,src});
		while(!que.empty()){
			int d = que.top().first;
			int v = que.top().second;
			que.pop();
			if(dist[v] <= d) continue;
			dist[v] = d;
			for(auto e : adj[v]) que.push({e.second + d,e.first});
		}
	}
	
	/*bool is_cyclic(){
		vector<int> s;
		return !tsort(s);
	}
	
	bool tsort(vector<int> &seq, bool idx_ord = 0) {
		seq.clear();
		seq.reserve(V + 1);
		
		vector<int> in(V + 1);
		for(int i = 0; i <= V; ++i) in[i] = deg_in(i);
		
		stack<int> rt;
		rt.push(0);
		
		while(!rt.empty()){
			int r = rt.top();
			rt.pop();
			for(auto e : adj[r]){
				int v = e.first;
				if(r) --in[v];
				if(!in[v]){
					rt.push(v);
					if(idx_ord){
						auto pos = begin(seq);
						bool det = 0;
						for(auto i = begin(seq); i < end(seq); ++i){
							if(!det && v > *i) ++pos;
							else det = 1; 
							if(exist[*i][v]){
								pos = i + 1;
								det = 0;
							}
						}
						seq.insert(pos,v);
					}else{
						seq.push_back(v);
					}
				}
			}
		}
		
		if(seq.size() == V) return 1;
		return 0;
	}*/
};


int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	int V,E,r;
	cin>>V>>E>>r;
	D_Graph<int> G(V);
	int s,t,d;
	rep(i,E){ cin>>s>>t>>d; G.add_edge(++s,++t,d); }
	vector<int> dist;
	G.dijkstra(dist,++r);
	rep(i,V){ if(dist[i + 1] < INF_32) cout<<dist[i + 1]<<'\n'; else cout<<"INF\n"; }
}





Measured memory_bytes: 24344
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Stream;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();

        List<Integer> list = new LinkedList<Integer>();

        for(int i=0; i<num; i++){
            list.add(sc.nextInt());
        }

        for(int j=list.size()-1; j>=0; j--){
            if(j == 0){
                System.out.println(list.get(j));
            } else {
                System.out.print(list.get(j) + " ");
            }
        }
    }
}



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

using namespace std;

const int64_t INF = INT64_C(1) << 40;

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

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N, M, P;
  cin >> N >> M >> P;
  vector<vector<pair<int, int>>> G(N);
  for (int i = 0; i < M; i++) {
    int a, b, c;
    cin >> a >> b >> c;
    a--, b--;
    G[a].emplace_back(make_pair(b, c - P));
  }
  vector<int64_t> res(N, -INF);
  res[0] = 0;
  for (int k = 0; k < N; k++) {
    for (int u = 0; u < N; u++) {
      for (auto g : G[u]) {
        int v = g.first, c = g.second;
        if (res[u] == -INF) continue;
        chmax(res[v], res[u] + c);
      }
    }
  }
  vector<bool> loop(N, false);
  for (int k = 0; k < N; k++) {
    for (int u = 0; u < N; u++) {
      for (auto g : G[u]) {
        int v = g.first, c = g.second;
        if (res[u] == -INF) continue;
        if (chmax(res[v], res[u] + c)) loop[v] = true;
        if (loop[u]) loop[v] = true;
      }
    }
  }
  if (loop[N - 1]) {
    cout << -1 << '\n';
  } else {
    cout << max(INT64_C(0), res[N - 1]) << '\n';
  }
  return 0;
}


Measured memory_bytes: 384
#%%
N, M = map(int, input().split())
a = [0] * M
b = [0] * M
for i in range(M):
    a[i], b[i] = map(int, input().split())

path = [[] for _ in range(N)]
for i in range(M):
    path[a[i]-1].append(b[i]-1)
    path[b[i]-1].append(a[i]-1)

import itertools

l = list(itertools.permutations(range(1, N)))

ans = 0

for i in range(len(l)):
    check = 0
    last = 0
    for j in range(len(l[i])):
        if l[i][j] in path[last]:
            last = l[i][j]
            pass
        else:
            check = 1
    if check == 0:
        ans += 1
            
print(ans)

Measured memory_bytes: 3572
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define rep1(i, n) FOR(i, 1, n+1)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; --i)
#define whole(x) (x).begin(),(x).end()
#define rwhole(x) (x).rbegin(), (x).rend()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
#define P pair<int, int>
#define debug(var) cerr << "[" << #var << "] " << var << endl
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define vi vector<int>
#define vl vector<ll>
#define pb push_back
#define eb emplace_back
const ll mod = 1000000007;
const int dx[] = {-1,0,1,0};
const int dy[] = {0,-1,0,1};
const int INF = 1001001001;


int main(){
    int n;
    cin >> n;
    string c;
    cin >> c;
    int ans = INF;
    int nr = 0;
    int nw = 0;
    for (char x: c) {
        if (x=='R') nr++;
        else nw++;
    }
    
    int x1 = 0;
    int x2 = n-1;
    int res = 0;
    while (x1<x2) {
        if (c[x1]=='R') {
            x1++;
            continue;
        }
        if (c[x2]=='W') {
            x2--;
            continue;
        }
        res++;
        x1++;
        x2--;
    }
    chmin(ans, res);
    
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3772
import sys

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


class UnionFind:
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    # 親が同じか判別
    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    # 根を繋ぎ直す
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x

    # 親が同じか判別
    def same(self, x, y):
        return self.find(x) == self.find(y)

    # 連結成分の大きさを返す
    def size(self, x):
        return -self.parents[self.find(x)]


def resolve():
    n, m, k = map(int, input().split())
    uf = UnionFind(n)
    edge = [[] for _ in range(n)]
    for _ in range(m):
        a, b = map(int, input().split())
        uf.union(a - 1, b - 1)
        edge[a - 1].append(b - 1)
        edge[b - 1].append(a - 1)

    block = [[] for _ in range(n)]
    for _ in range(k):
        c, d = map(int, input().split())
        if uf.same(c - 1, d - 1):
            block[c - 1].append(d - 1)
            block[d - 1].append(c - 1)

    res = []
    for i in range(n):
        res.append(uf.size(i) - (len(edge[i]) + 1) - (len(block[i])))
    print(*res)


if __name__ == '__main__':
    resolve()


Measured memory_bytes: 51600
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
#define LL long long
int N, K;
LL L;
int a[200010];
 
bool judge(int x){
    LL cnt = 0;//x以下となる区間を数える
    vector<int> sum = { 0 };//sum[i]には区間[1, i]までのｘ以下の数の個数を保存
    LL r = 0;

	for(int i = 1; i <= N; i++){
        sum.push_back(sum[i - 1]);
        if(a[i] <= x) sum[i]++;
        if(sum[i] - K < 0) continue;

		while(r <= i - K){
			if(sum[r] <= sum[i] - K) r++;
			else break;
		}
        cnt += r;
    }
    return cnt >= L;
}
 
int solve(){
    int lb = 0, ub = N;
    while(ub - lb > 1){
        int mid = (ub + lb) / 2;
        if(judge(mid)){
            ub = mid;
        }else{
            lb = mid;
        }
    }
    return ub;
}
 
void input(){
    cin >> N >> K >> L;
    for(int i = 1; i <= N; i++){
        cin >> a[i];
    }
}
 
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
    input();
    cout << solve() << endl;
    return 0;
}


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

using namespace std;

int main()
{
	int a, b, c, d, n;
	scanf("%d %d %d %d %d", &a, &b, &c, &d, &n);
	b = min(b, 2 * a);
	c = min(c, 2 * b);
	d = min(d, 2 * c);
	printf("%lld", (long long) n / 2 * d + (n & 1) * c);
	return 0;
}

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

// #undef DEBUG  // Uncomment this line to forcefully disable debug print.
#if DEBUG
template <typename T>
void debug(T value) {
  std::cerr << value;
}
template <typename T, typename... Ts>
void debug(T value, Ts... args) {
  std::cerr << value << ", ";
  debug(args...);
}
#define dbg(...)                              \
  do {                                        \
    cerr << #__VA_ARGS__ << ": ";             \
    debug(__VA_ARGS__);                       \
    cerr << " (L" << __LINE__ << ")" << endl; \
  } while (0)
#else
#define dbg(...)
#endif

void read_from_cin() {}
template <typename T, typename... Ts>
void read_from_cin(T& value, Ts&... args) {
  std::cin >> value;
  read_from_cin(args...);
}
#define in(type, ...) \
  type __VA_ARGS__;   \
  read_from_cin(__VA_ARGS__);

template <typename T>
void write_to_cout(const T& value) {
  std::cout << value << std::endl;
}
template <typename T, typename... Ts>
void write_to_cout(const T& value, const Ts&... args) {
  std::cout << value << ' ';
  write_to_cout(args...);
}
#define out(...) write_to_cout(__VA_ARGS__);

#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)

using ll = long long;

using namespace std;

int n;
int p[8], q[8];

int count(int a[8]) {
  rep(i,n)dbg(a[i]);
  int x[8];
  rep(i,n)x[i]=i+1;
  int c=0;
  do{
    bool ok=true;
    rep(i,n)if(x[i]!=a[i])ok=false;
    if(ok){
      return c;
    }
    ++c;
  }while(next_permutation(x,x+n));
}

int main() {
  cin>>n;
  rep(i,n)cin>>p[i];
  rep(i,n)cin>>q[i];
  out(abs(count(p) - count(q)));
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int q;
int sv[101];
int tv[101];

int main(void){
	scanf("%d",&q);
	for(int i=0;i<q;i++){
		string s,t;
		cin >> s;
		cin >> t;
		for(int j=0;j<s.size();j++){
			if(s[j]=='0'){
				sv[j]=0;
			}else{
				sv[j]=1;
			}
			if(t[j]=='0'){
				tv[j]=0;
			}else{
				tv[j]=1;
			}
		}
		int ans=0;
		int v=0;
		for(int j=s.size()-1;j>=0;j--){
			bool sa=true;
			for(int k=0;k<s.size();k++){
				if(sv[k]!=tv[k]){
					sa=false;
					break;
				}
			}
			if(sa)break;
			if(sv[j]==1)v=v|1;
			if(tv[j]==1)v=v|2;
			if(v&1){
				if(sv[j-1]==0){
					sv[j]=0;
					sv[j-1]=1;
				}else{
					sv[j-1]=1;
					sv[j]=0;
				}
				ans++;
			}
			if(v&2){
				if(tv[j-1]==0){
					tv[j]=0;
					tv[j-1]=1;
				}else{
					tv[j-1]=1;
					tv[j]=0;
				}
				ans++;
			}
			//printf("%d %d\n",v,ans);
		}
		printf("%d\n",ans);
	}
	return 0;
} 


Measured memory_bytes: 3368
#include <stdio.h>
#include <math.h>

int main() {

  double r;
  double area, circum;

  scanf("%lf", &r);

  area = r * r * M_PI;
  circum = 2 * r * M_PI;

  printf("%lf %lf\n", area, circum);

  return 0;
}

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

int main() {
  int a,b;
  cin >> a >> b;
  
  if(a>b)
    cout<<a+a-1<<endl;
  else if(b>a)
    cout<<b+b-1<<endl;
  else 
    cout<<a+b<<endl;
    
}

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

int main() {
    int X, N;
    std::cin >> X >> N;

    int p;
    std::unordered_set<int> s;
    for (int i = 0; i < N; ++i) {
        std::cin >> p;
        s.insert(p);
    }

    int ans = 0, min = INT32_MAX;
    for (int i = 0; i <= 101; ++i) {
        if (s.count(i) == 0 && std::abs(X - i) < min) {
            ans = i;
            min = std::abs(X - i);
        }
    }

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

    return 0;
}


Measured memory_bytes: 3612
#include<iostream>
#include <bits/stdc++.h>
#include<stdio.h>
#include <stdlib.h>
#include<string>
#include<queue>
#include<algorithm>
#include<math.h>
#include<map>
using namespace std;


int main(){
	map<string,int> mp;
	int N;
	int ans=0;
	string s;
	cin>>N;
	for(int i=0;i<N;i++){
		cin>>s;
		mp[s]++;
	}
	for(auto i=mp.begin();i!=mp.end();i++){
		if(i->second%2==1){
			ans++;
		}
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 12544
#include <stdio.h>
#include<math.h>
int main(void) {
double a,b,c,d;
double e;
scanf("%lf%lf%lf%lf",&a,&b,&c,&d);
e=(a-c)*(a-c)+(b-d)*(b-d);
e=sqrt(e);
printf("%f",e);
  return 0;
}


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

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

  int ans = 0;
  for (int i = 1; i <= n; i++) {
    int j = i;
    int x = 0;
    while (j != 0) {
      x += j % 10;
      j /= 10;
    }
    if (x >= a && x <= b) ans += i;
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long
using namespace std;
const int q=1e9+7;
int n,k,m,sum,Min,Max,s,t,w,x,y;
int a[25010],b[25010],f1[25010][410],f2[25010][410];
int dfs(int x,int y)
{
    int s=1;
    while(y>0)
    {
        if(y%2==1)s=s*x%q;
        x=x*x%q;
		y/=2;
    }
    return s;
}
int xyz(int x)
{
    int s=1;
    for(int i=1;i<=x;i++)s=s*i%q;
    return s;
}
signed main()
{
	cin>>n>>k>>m;
	for(int i=1;i<=m;i++)scanf("%lld",&a[i]);
	sum=(n-m+1)*dfs(k,n-m)%q;
	for(int i=1;i<=m;i++)
	{
		Min=min(Min+1,i-b[a[i]]);
		b[a[i]]=i;
		Max=max(Max,Min);
	}
	if(Max==k)
	{
		cout<<sum;
		return 0;
	}
	if(Max==m)
	{
		f1[0][0]=1;
		for(int i=1;i<=n;i++)
		{
    		s=t=0;
			for(int j=k-1;j>=1;j--)
			{
				s=(s+f1[i-1][j])%q;
                t=(t+f2[i-1][j])%q;
                f1[i][j]=(f1[i][j]+f1[i-1][j-1]*(k-j+1)%q)%q;
                f2[i][j]=(f2[i][j]+f2[i-1][j-1]*(k-j+1)%q)%q;
                f1[i][j]=(f1[i][j]+s)%q;
                f2[i][j]=(f2[i][j]+t)%q;
                if(j>=m) f2[i][j]=(f2[i][j]+f1[i][j])%q;
			}
		}
		w=0;
        for(int i=1;i<=k;i++) w=(w+f2[n][i])%q;
        w=w*xyz(k-m)%q*dfs(xyz(k),q-2)%q;
        cout<<(sum-w+q)%q;
        return 0;
	}
	x=y=0;
    memset(b,0,sizeof(b));
    for(int i=1;i<=m;i++)
    if(b[a[i]]==0)
	{
		x++;
		b[a[i]]=1;
	}
	else break;
    memset(b,0,sizeof(b));
    for(int i=m;i>=1;i--)
    if(b[a[i]]==0)
	{
		y++;
		b[a[i]]=1;
	}
	else break;
    f1[0][x]=f2[0][y]=1;
    for(int i=1;i<=n;i++)
    {
    	s=t=0;
        for(int j=k-1;j>=1;j--)
        {
            s=(s+f1[i-1][j])%q;
            t=(t+f2[i-1][j])%q;
            f1[i][j]=(f1[i][j]+f1[i-1][j-1]*(k-j+1)%q)%q;
            f2[i][j]=(f2[i][j]+f2[i-1][j-1]*(k-j+1)%q)%q;
            f1[i][j]=(f1[i][j]+s)%q;
            f2[i][j]=(f2[i][j]+t)%q;
        }
    }
    for(int i=0;i<=n-m;i++)
    {
    	s=t=0;
        for(int j=1;j<=k-1;j++)
		{
			s=(s+f1[i][j])%q;
			t=(t+f2[n-m-i][j])%q;
		}
        sum=(sum-s*t%q+q)%q;
    }
    cout<<sum;
	return 0;
}

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

using namespace std;
int main(void) {
    int n; cin >> n;
    vector< pair<int,int> > p;

    for(int i = 0; i < n; i++) {
        int ai; cin >> ai;   
        pair<int,int> tmpp(ai,i+1);
        p.push_back(tmpp);
    }
    sort(p.begin(),p.end());
    for(auto v : p) {
        cout << v.second << " ";
    }
    cout << endl;
}


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

int main(void) {
//Nはすぬけ君の数
//Kはお菓子の種類

    int N;
    int K;
    cin >> N >> K;
    int array[N];
    int counter = 0;
    
    for (int i = 0; i < N; i++) {
        array[i] = 0;
    }
    
    
  for (int i = 0; i < K; i++) {
      int okasi_total;
      cin >> okasi_total;
      //cout << okasi_total << "/" << endl;
      vector<int> vec(okasi_total);
      
      for (int j = 0; j < okasi_total; j++) {
          cin >> vec[j];
          //cout << vec[j] << "、";
      }
      //cout << "一区切り" << endl;
  
     
      //1はお菓子を持っている人
      for (int k = 0; k < vec.size(); k++) {
          if (array[vec[k]-1] == 0) {
              array[vec[k]-1] = 1;
          }
      }
  }

  for (int k = 0; k < N; k++) {
      if (array[k] == 1) {
          counter++;
      }
  }
  //cout << counter << endl;
  cout << N-counter << endl;
} 

Measured memory_bytes: 3524
#include<stdio.h>
 
int main(){
    int map[14][14];
    int zero, max, i, j, x, y, ink;

    for(i = 0; i < 14; i++){
        for(j = 0; j < 14; j++){
            map[i][j] = 0;
        }
    }

    while(scanf("%d,%d,%d", &x, &y, &ink) != EOF){
        x += 2;
        y += 2;

        if(ink == 1){
            map[x][y-1]++;
            map[x][y+1]++;
            for(i = (x-1); i < (x+2); i++) map[i][y]++;
        }

        if (ink == 2){
            for(i = (x-1); i < (x+2); i++){
                for(j = (y-1); j < (y+2); j++){
                    map[i][j]++;
                }
            }
        }

        if(ink == 3){
            for(i = (x-1); i < (x+2); i++){
                for(j = (y-1); j < (y+2); j++){
                    map[i][j]++;
                }
            }
            map[x][y-2]++;
            map[x][y+2]++;
            map[x-2][y]++;
            map[x+2][y]++;
        }

        zero = 0;
        max = 0;
        for(i = 2; i < 12; i++){
            for(j = 2; j < 12; j++){
                if(map[i][j] == 0) zero++;
                else if(max < map[i][j]) max = map[i][j];
            }
        }
    }
        printf("%d\n%d\n", zero, max);
    return 0;
}

Measured memory_bytes: 600
#include <stdio.h>

int main(void)
{
	int x1,y1,x2,y2,x3,y3,x4,y4;
	
	scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
	
	x3=x2-(y2-y1);
	y3=y2+(x2-x1);
	
	x4=x3-(x2-x1);
	y4=y3-(y2-y1);
	
	printf("%d %d %d %d\n",x3,y3,x4,y4);
	
	return 0;
}

Measured memory_bytes: 128
n,a,b=map(int,input().split())
ans=0
for i in range(n):
  hoge=1+i
  huga=0
  for j in range(5):
    huga+=hoge%10
    hoge=int(hoge/10)
  
  if(a<=huga and huga<=b):
    ans+=1+i

print(ans)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i,n) for(ll i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define fi first
#define se second

template<typename T> inline bool chmax(T &a, T b){if(a<b){a=b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;}
template<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){int len=d.size();rep(i,len){s<<d[i];if(i<len-1) s<<" ";}return s;}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){int len=d.size();rep(i,len){s<<d[i]<<endl;}return s;}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){s<<"{"<<endl;for(auto itr=m.begin();itr!=m.end();++itr){s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;}s<<"}"<<endl;return s;}

const ll mod=1e9+7;
const ll inf=1e17;
const int INF=1e9;
const double PI=acos(-1);
const double EPS=1e-10;

int main(){
	cin.tie(0);ios::sync_with_stdio(false);
	int h,w,k;
	cin>>h>>w>>k;
	vector<string> s(h);
	vector<vector<int>> g(h,vector<int>(w));
	rep(i,h){
		cin>>s[i];
		rep(j,w){
			g[i][j]=s[i][j]-'0';
		}
	}
	vector<vector<int>> sum(h,vector<int>(w+1,0));
	rep(i,h){
		rep(j,w){
			sum[i][j+1]=sum[i][j]+g[i][j];
		}
	}
	int ans=INF;
	rep(S,1<<(h-1)){
		int m=__builtin_popcount(S);
		map<vector<int>,int> mp;
		int st=0;
		int T=S+(1<<(h-1));
		//cout<<' '<<S<<endl;
		rep(i,h){
			if(1<<i & T){
				vector<int> now;
				FOR(j,st,i+1){
					now.push_back(j);
				}
				mp[now]=0;
				st=i+1;
				//cout<<now<<endl;
			}
		}
		st=0;
		int now=m;
		rep(j,w){
			bool flag=false;
			for(auto itr:mp){
				int cnt=0;
				for(auto x:itr.first){
					cnt+=sum[x][j+1]-sum[x][st];
				}
				if(cnt>k){
					flag=true;
				}
			}
			if(flag){
				if(st==j){
					now=INF;
					break;
				}
				now++;
				st=j;
			}
		}
		//cout<<now<<endl;
		chmin(ans,now);
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 384