akhauriyash/Code-Regression huggingface dataset:
//------------------------------>> tsukasa_diary's template <<------------------------------//
#include <bits/stdc++.h>
using namespace std;

#define for_(i,a,b) for(int i=(a);i<(b);++i)
#define allof(a) (a).begin(),(a).end()
using lint = long long;
template< typename T > using Vec = vector< T >;

template< typename T > bool inRange(T x, T lb, T ub) { return lb <= x && x < ub; }
template< typename T > bool inRange(T x, T y, T lb, T ub) { return in_range(x, lb, ub) && in_range(y, lb, ub); }
template< typename T > void modAdd(T& a, T b, T mod) { a = (a + b + mod) % mod; }
template< typename T > void modMul(T& a, T b, T mod) { a = (a * b) % mod; }
template< typename T > void minUpdate(T& a, T b) { a = min(a, b); }
template< typename T > void maxUpdate(T& a, T b) { a = max(a, b); }
inline int bitCount(int x) { return __builtin_popcount(x); }
inline int bitCount(lint x) { return __builtin_popcountll(x); }

const int dx[4] = {0,1,0,-1}, dy[4] = {-1,0,1,0};
const int Dx[8] = {0,1,1,1,0,-1,-1,-1}, Dy[8] = {-1,-1,0,1,1,1,0,-1};
const double PI = acos(-1);

//--------------8---------------->> coding space <<-----------------8-------------//



int main() {
	lint L, R;
	cin >> L >> R;
	
	lint ans = 2019;
	for (lint i=L; i<R && ans>0; ++i) for (lint j=i+1; j<=R && ans>0; ++j) {
		ans = min(ans, (i * j) % (lint)2019);
	}
	cout << ans << endl;
}
//--------------8---------------->> coding space <<-----------------8-------------//

Measured memory_bytes: 256
#include<stdio.h>
#include<cmath>
#include<algorithm>
#include<cstring>
using namespace std;
int main(){
	long long int a[200000],n,t,i,j,m,k,sum=0;
	//sum代表普通攻击次数
	scanf("%lld %lld",&n,&k);
	for(i=0;i<n;i++){
		scanf("%lld",&a[i]);
	}
	sort(a,a+n);
	//对a数组从大到小冒泡排序

	//前k个用绝招 ,第k个往后普通攻击
	if(k<n){
		for(i=0;i<n-k;i++){
			sum=sum+a[i];
		}
	}
	printf("%lld",sum);

	return 0;
}


Measured memory_bytes: 1664
using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Numerics;




namespace contest
{

    class contest
    {


        static void Main(string[] args)
        {


            //int n = int.Parse(Console.ReadLine());
            //var input = Console.ReadLine().Split().Select(int.Parse).ToArray();

            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();



            //int n = int.Parse(Console.ReadLine());
            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();



            var num = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int h = num[0];
            int w = num[1];
            var input = new string[h][];
            var ans = "";
            for (int i = 0; i < h; i++)
            {
                input[i] = Console.ReadLine().Split().Select(c=>c).ToArray();
                if(input[i].Contains("snuke"))
                {
                    int ind = Array.IndexOf(input[i] ,"snuke");
                    ans =  (char)(ind + 'A')+ (i + 1).ToString();
                }
            }

            



            Console.WriteLine(ans);
           





            

        }

        

    }


    


    

    
}


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

int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    int mod = 1000000007;
    long long sum = 0;
    for (int i = 0; i < N; i++) {
        cin >> A[i];
        sum += A[i];
        sum %= mod;
    }

    long ans = 0;

    for (int i = 0; i < N; i++) {
        sum -= A[i];
        if (sum < 0) sum += mod;

        ans += A[i] * sum;
        ans %= mod;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3988
#include<bits/stdc++.h>
using namespace std;
bool dp[100001];
int main(){
    int n,k;
    cin>>n>>k;
    int arr[n];
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }

    dp[0]=false;
    for(int i=1;i<=k;i++){
        for(int j=0;j<n;j++){
            if(i>=arr[j]){
                 //   cout<<i<<" "<<arr[j]<<endl;
                if(!dp[i-arr[j]]){
                    dp[i]=true;
                    break;
                }
            }else{
            break;
            }
        }
        //cout<<dp[i]<<" ";
    }
    cout<<((dp[k])?"First":"Second");

}


Measured memory_bytes: 384
#include<stdio.h>
int main(void){
	int a,b,c,cont=3;
  scanf("%d %d %d",&a,&b,&c);
  if(a==b)
    cont = cont -1;
  if(b==c)
    cont = cont -1;
  if(a==c)
    cont = cont-1;
  if(cont ==0)
    cont++;
  printf("%d",cont);
}


Measured memory_bytes: 128
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <map>
#include <climits>
using namespace std;
#define mod (1000000007)
#define ll long long int

int main(void){
  while(true){
    int N,M;
    cin >> N >> M;
    if(N==0){
      break;
    }

    vector<int> cc,xx;
    ll tmp;
    for (size_t i = 0; i < M; i++) {
      cin >> tmp;
      cc.push_back(tmp);
    }
    for (size_t i = 0; i < N; i++) {
      cin >> tmp;
      xx.push_back(tmp);
    }

    vector<vector<ll>> dp;
    dp.assign(N+1, vector<ll>(256, LLONG_MAX/100));
    dp[0][128] = 0;

    for (int i = 0; i < N; i++){
      for (int k = 0; k <= 255 ; k++){
        for (int c: cc){
          if(k+c>=255){
            tmp = 255;
          }else if(k+c <=0){
            tmp = 0;
          }else{
            tmp = k+c;
          }
          //cout << dp[i][k] << ',' << k+c << endl;
          dp[i+1][tmp] = min(dp[i+1][tmp],dp[i][k] + (tmp-xx[i])*(tmp-xx[i]));
        }
        //cout << dp[i][k] << endl;
      }
    }

    ll ans = LLONG_MAX;
    for(auto t: dp[N]){
      ans = min(ans,t);
    }

    cout << ans << endl;
  }
}



Measured memory_bytes: 43812
use std::cmp::*;
const MOD: usize = 1000000007;

fn mod_power(x: usize, n: usize) -> usize {
    let mut ret = 1;
    let mut xx = x;
    let mut nn = n;
    while nn > 0 {
        if nn & 1 > 0 {
            ret = ret * xx % MOD;
        }
        xx = xx * xx % MOD;
        nn = nn >> 1;
    }
    ret
}

fn combinations(n: usize, k: usize) -> usize {
    if n == 0 && k == 0 {
        return 1;
    }
    if n < k {
        return 0;
    }

    let mut fac = vec![1usize; n + 1];
    let mut ifac = vec![1usize; n + 1];
    for i in 0..n {
        fac[i + 1] = fac[i] * (i + 1) % MOD;
        ifac[i + 1] = ifac[i] * mod_power(i + 1, MOD - 2) % MOD;
    }
    let tmp = ifac[n - k] * ifac[k] % MOD;
    tmp * fac[n] % MOD
}

fn main() {
    let v = read_vec::<usize>();
    let x = v[0];
    let y = v[1];

    if (x + y) % 3 != 0 || max(x, y) / min(x, y) > 2 {
        println!("0");
        return;
    }

    let nx = (x + y) / 3;
    let ny = (nx + y - x) / 2; // ((x - y)*(-1)+nx) / 2
    let ans = combinations(nx, ny) % MOD;
    println!("{}", ans);
}

#[allow(dead_code)]
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}
#[allow(dead_code)]
fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}
#[allow(dead_code)]
fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}
#[allow(dead_code)]
fn yn(result: bool) {
    if result {
        println!("Yes");
    } else {
        println!("No");
    }
}


Measured memory_bytes: 16636
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		boolean canArrive = true;
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			int t1 = 0, t2;
			int x1 = 0, x2;
			int y1 = 0, y2;

			for (int i = 0; i < n; i++) {
				t2 = scanner.nextInt();
				x2 = scanner.nextInt();
				y2 = scanner.nextInt();

				int time = t2 - t1;
				int distance = Math.abs(x2 - x1 + y2  - y1);
				if (distance > time || (distance ^ time & 1) == 1) {
					canArrive = false;
					break;
				}

				t1 = t2;
				x1 = x2;
				y1 = y2;
			}
		}

		if (canArrive) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}

Measured memory_bytes: 85528
macro_rules ! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; input_inner ! { iter , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let s = { use std :: io :: Read ; let mut s = String :: new ( ) ; std :: io :: stdin ( ) . read_to_string ( & mut s ) . unwrap ( ) ; s } ; let mut iter = s . split_whitespace ( ) ; input_inner ! { iter , $ ( $ r ) * } } ; }
macro_rules ! input_inner { ( $ iter : expr ) => { } ; ( $ iter : expr , ) => { } ; ( $ iter : expr , mut $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let mut $ var = read_value ! ( $ iter , $ t ) ; input_inner ! { $ iter $ ( $ r ) * } } ; ( $ iter : expr , mut $ var : ident $ ( $ r : tt ) * ) => { let mut $ var = $ iter . next ( ) . unwrap ( ) . parse ::< usize > ( ) . unwrap ( ) ; input_inner ! { $ iter $ ( $ r ) * } } ; ( $ iter : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ iter , $ t ) ; input_inner ! { $ iter $ ( $ r ) * } } ; ( $ iter : expr , $ var : ident $ ( $ r : tt ) * ) => { let $ var = $ iter . next ( ) . unwrap ( ) . parse ::< usize > ( ) . unwrap ( ) ; input_inner ! { $ iter $ ( $ r ) * } } ; }
macro_rules ! read_value { ( $ iter : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ iter , $ t ) ) ,* ) } ; ( $ iter : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ iter , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ iter : expr , chars ) => { read_value ! ( $ iter , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ iter : expr , usize1 ) => { read_value ! ( $ iter , usize ) - 1 } ; ( $ iter : expr , $ t : ty ) => { $ iter . next ( ) . unwrap ( ) . parse ::<$ t > ( ) . unwrap ( ) } ; }
fn main() {
    input! {
        grid: [[u64; 3]; 3],
    }
    let a1: u64 = 0;
    let b1: u64 = grid[0][0] - a1;
    let b2: u64 = grid[0][1] - a1;
    let b3: u64 = grid[0][2] - a1;
    if (grid[1][0] - b1) == (grid[1][1] - b2)
        && (grid[1][1] - b2) == (grid[1][2] - b3)
        && (grid[2][0] - b1) == (grid[2][1] - b2)
        && (grid[2][1] - b2) == (grid[2][2] - b3)
    {
        println!("Yes");
    } else {
        println!("No");
    }
}


Measured memory_bytes: 4352
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>

using namespace std;

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

inline int toInt(string s) {int v; istringstream sin(s);sin>>v; return v;}

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector< vector<int> > Mat;
typedef tuple<int, int, int, int> T;

const int MOD = (int)1e9+7;
const int INF = (int)1e9;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};

vector<int> sieve_of_eratosthenes(int n) {
    vector<int> primes(n, 0);

    for (int i = 1; i < n; ++i) primes[i] = i;

    for (int i = 2; i*i < n; ++i){
        if (primes[i]){ //  0ならば素数ではない
            for (int j = i*i; j < n; j+=i) primes[j] = 0;   //  iの倍数を0にする
        }
    }

    //primes.erase(remove(all(primes), 0), primes.end());

    return primes;
}

int prime[100001];

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

    int Q;
    cin >> Q;

    vector<int> p = sieve_of_eratosthenes(100001);
    for(int i = 3; i < 100001; i++){
        if(p[i] != 0 && p[(int) (p[i] + 1)/2 ] != 0) prime[i] = prime[i-1] + 1;
        else prime[i] = prime[i-1];
    }

    rep(i, Q){
        int l, r;
        cin >> l >> r;

        cout << prime[r] - prime[l-1] << endl;
    }

    return 0;
}

Measured memory_bytes: 1408
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>

#define REP(i,n) for(long long i=0;i<n;++i)
#define REPR(i,n) for(long long i=n;i>=0;--i)
#define REPI(itr,v) for(auto itr=v.begin();itr!=v.end();++itr)
#define REPIR(itr,v) for(auto itr=v.rbegin();itr!=v.rend();++itr)
#define FOR(i,a,b) for(long long i=a;i<b;++i)
#define SORT(v,n) sort(v, v+n)
#define SORTV(v) sort(v.begin(), v.end())
#define ALL(v) v.begin(),v.end()
#define llong long long
#define INF 999999999
#define SUR 1000000007
#define pb push_back
#define pf push_front
#define MP make_pair
#define SV(v) {for(long long sitr=0;sitr<v.size();++sitr){cin>>v[sitr];}}

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

using namespace std;

typedef pair<int,int> pii;

int main(){

  llong n, T;
  cin >> n >> T;
  vector<llong> v(n);
  SV(v);

  llong ans = 0;
  for(int i = 0; i < n; ++i){
    if(i != n - 1){
      if(v[i] + T < v[i+1]){
        ans += T;
      }else{
        ans += v[i+1] - (v[i]);
      }
    }else{
      ans += T;
    }
  }

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



Measured memory_bytes: 1792
import java.util.Scanner;

public class Main {

    public static void main(String[] args){
		Scanner scan = new Scanner(System.in);

		double r = scan.nextDouble();//r = ??????
		double men = (double)r * r *  3.14159265358979323846264338327950288;
		double ensyu = (double)r * 2 * 3.14159265358979323846264338327950288;

		System.out.println(String.format("%f %f", men, ensyu));
        scan.close();
    }

}

Measured memory_bytes: 28212
#include<cstdio>
#include<iostream>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<cstring>

const int Max = 1e5;

using namespace std;

int main(){
	char a[Max], b[Max];
	int i, j = 0;
	while(~scanf("%s", a)){
		getchar();
		scanf("%s", b);
		getchar(); 
		int n;
		int stra = strlen(a), strb = strlen(b);
		if(stra > strb) n = 1;
		if(stra < strb) n = -1;
		if(stra == strb){
			for(i = 0, j = 1; i < stra; i++){
				if(a[i] > b[i])  { n = 1; j = 0; break; }
				if(a[i] < b[i])  { n = -1; j = 0; break; }
			}
		}
		if(j) n = 0;
		if(n == 1) cout << "GREATER" << endl;
		if(n == 0) cout << "EQUAL" << endl;
		if(n == -1) cout << "LESS" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <queue>
#include <cstdio>
#include <map>
#include <set>
#include <utility>
#include <stack>
#include <cstring>
#include <cmath>
#include <vector>
using namespace std;
typedef long long ll;
int num[100005];
int main()
{
#ifdef LOCAL
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#endif // LOCAL
    char str[105];
    int T;
    scanf("AtCoder%sContest",str);
    printf("A%cC",str[0]);

    return 0;
}


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

int const MOD=1000000007;
int main(){
	std::ios::sync_with_stdio(0);std::cin.tie(0);
	int n,n_operation;std::cin>>n>>n_operation;

	std::vector<int> acm;acm.reserve(n+1);acm.resize(n); // suffix sum accumulation
	for(int& x:acm){
		char c;std::cin>>c;
		x=c-'0';
	}
	for(int i=n-1;i--;)
		acm[i]+=acm[i+1];
	acm.push_back(0);

	auto const sum=[&](int l,int r){return acm[l]-acm[r];};


	std::vector<std::pair<int,int>> ops;ops.reserve(n_operation+1);
	for(int _=n_operation;_--;){
		int l,r;std::cin>>l>>r;--l;
		if(!ops.empty()){
			if(ops.back().first==l){
				ops.back().second=std::max(ops.back().second,r);
				continue;
			}
			else if(ops.back().second>=r)
				continue;
		}
		ops.push_back({l,r});
	}

	ops.push_back({n,n});

	n_operation=-1;

	auto const l=[&](int x){return ops[x].first;};
	auto const r=[&](int x){return ops[x].second;};

	std::vector<std::vector<int>> dp(ops.size());
	// dp[i][n] = number of states of the sequence [0,l(i)] after i steps with sum n

	dp[0].resize(n+1);
	dp[0][sum(0,l(0))]=1;


	std::vector<std::vector<int>> binom(n+1);
	binom[0].assign(1,1);
	for(unsigned i=1;i<binom.size();++i){
		binom[i].resize(i+1);
		std::copy(begin(binom[i-1]),end(binom[i-1]),begin(binom[i]));
		std::transform(begin(binom[i-1]),end(binom[i-1]),++begin(binom[i]),++begin(binom[i]),[](int a,int b){
				a+=b;
				if(a>=MOD)a-=MOD;
				return a;
				});
	}


	for(int i=1;i<(int)ops.size();++i){
		dp[i].resize(n+1);

		int const mid=std::min(r(i-1),l(i));
		int const tmp2=sum(0,r(i-1));
		int const tmp3=l(i)>r(i-1)?sum(r(i-1),l(i)):0;

		int const* const binom_tmp_4=binom[mid-l(i-1)].data();
		int const* const dp_i_1=dp[i-1].data();

		for(int x=0;x<=n;++x){
			// x = sum [0,l(i)] after i steps

			int ans=0;
			if((x-tmp3)<=tmp2&&tmp2-(x-tmp3)<=r(i-1)-mid){
				for(int y_=std::max((x-tmp3)-mid+l(i-1),0)-x;y_<=-tmp3;++y_){
					ans=(ans+(int64_t)dp_i_1[y_+x]*binom_tmp_4[-tmp3-y_])%MOD;
				}
			}
			dp[i][x]=ans;
		}
	}

	std::cout<<dp[ops.size()-1][sum(0,n)]<<'\n';
}


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

using namespace std;

int k, a, b, c;
long long ans;

int main()
{
	ios::sync_with_stdio(false);
	cin >> a >> b >> c;
	int g = max(a, max(b, c));
	ans = g;
	cin >> k;
	for (int i = 1; i <= k; i++) ans *= 2;
	cout << ans + a + b + c - g << endl;
	return 0;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;

public class Main {
    static MyReader in = new MyReader();

    public static void main(String[] args) {
        char[] S = new char[500001];
        int n = in.read(S);

        IntQueue q = new IntQueue(n + 2);
        if (S[0] == '>') {
            q.push(0);
        }

        char c = S[0];
        for (int i = 0, j = 0; i <= n; i++) {
            if (S[i] == c) {
                j++;
            } else {
                q.push(j);
                j = 1;
                c = S[i];
            }
        }

        if (S[n - 1] == '<') {
            q.push(0);
        }

        long ans = 0;
        while (!q.isEmpty()) {
            long up = q.pop();
            long down = q.pop();
            ans += Math.max(up, down) + up * (up - 1) / 2 + down * (down - 1) / 2;
        }

        System.out.println(ans);
    }
}

class IntQueue {
    final int MAX;
    int[] array;
    int head = 0;
    int tail = 0;
    int count = 0;

    IntQueue(int N) {
        MAX = N;
        array = new int[N];
    }

    void push(int n) {
        array[tail++] = n;
    }

     int pop() {
        return array[head++];
    }

    boolean isEmpty() {
        return head == tail;
    }
}

class MyReader extends BufferedReader {
    char[] cbuf = new char[1024];
    int head = 0;
    int tail = 0;

    MyReader() {
        super(new InputStreamReader(System.in));
    }

    char next() {
        if (head == tail) {
            try {
                tail = super.read(cbuf, 0, cbuf.length);
            } catch (IOException e) {
                e.printStackTrace();
            }
            head = 0;
        }
        return cbuf[head++];
    }

    int i() {
        int k = next() - '0';
        boolean minus = k == -3;
        int n = minus ? 0 : k;
        while (0 <= (k = next() - '0') && k <= 9) n = 10 * n + k;
        return minus ? -n : n;
    }

    int[] ii(final int N) {
        int[] a = new int[N];
        for (int j = 0; j < a.length; j++) a[j] = i();
        return a;
    }

    long l() {
        int k = next() - '0';
        boolean minus = k == -3;
        long n = minus ? 0 : k;
        while (0 <= (k = next() - '0') && k <= 9) n = 10 * n + k;
        return minus ? -n : n;
    }

    char[] s(final int N) {
        char[] s = new char[N];
        for (int i = 0; i < N; i++) {
            s[i] = next();
        }
        next();
        return s;
    }

    public int read(char[] cbuf) {
        int i;
        char c;
        for (i = 0; (c = next()) != ' ' && c != '\n'; i++) cbuf[i] = c;
        return i;
    }

    public String readLine() {
        try {
            return super.readLine();
        } catch (IOException e) {
            return null;
        }
    }
}


Measured memory_bytes: 37900
#include<bits/stdc++.h>
using namespace std;
inline void rd(int &x){
  int k, m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
inline void wt_L(char a){
  putchar_unlocked(a);
}
inline void wt_L(const char c[]){
  int i=0;
  for(i=0;c[i]!='\0';i++){
    putchar_unlocked(c[i]);
  }
}
int main(){
  int A, B;
  rd(A);
  rd(B);
  if(A%2==B%2 && B%2==1){
    wt_L("Yes");
    wt_L('\n');
  }
  else{
    wt_L("No");
    wt_L('\n');
  }
  return 0;
}
// cLay varsion 20190715-1

// --- original code ---
// {
//   int A, B;
//   rd(A,B);
//   wt( if[A%2==B%2==1, "Yes", "No"] );
// }


Measured memory_bytes: 256
#include <iostream>
#include <iterator>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <numeric>
#include <iomanip>
#include <limits>

using namespace std;

int main(){

    int ans=0;

    int a,b;

    cin>>a>>b;

    bool check=false;

    for(int i=1;i<=10000;i++){
        if(a==(int)(i*0.08) && b==(int)(i*0.1)){
            ans=i;
            check=true;
            break;
        }
    }

    if(check){
        cout<<ans<<endl;
    }
    else{
        cout<<-1<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#define  boost ios_base::sync_with_stdio(false);cin.tie(NULL);
#define ull unsigned long long
#define d1(x) cout<<#x<<" "<<x<<endl;
#define d2(x,y) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<endl;
#define d2i(x,y,i) cout<<#x<<i<<" "<<x<<" "<<#y<<i<<" "<<y<<endl;

#define fr(i,l,r) for(ll i=l;i<r;i++)
#define mems(a,x) memset(a,x,sizeof(a))
#define mod 1000000007
#define ff first
#define ss second
#define pb(x) push_back(x)
#define vll vector<ll>
#define pbp(x,y) push_back(make_pair(x,y))
#define  mat vector<vector<ll>>
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ll n,m,q;
ll a[51][4];

ll ans=0;
void find1(ll k,ll p,vector<ll>&vv,ll m){

    if(k==0){
//for(int kkk:vv)
 //           cout<<kkk<<" ";
  //        cout<<endl;
        ll u,v;
        ll kk=0;
      for(int i=0;i<q;i++){
        u=a[i][0],v=a[i][1];
        u--,v--;
      //  d2(vv[v]-vv[u],a[i][2])
        if((vv[v]-vv[u])==a[i][2]){
            kk+=a[i][3];
          //  d1(kk)
        }
      }
      ans=max(ans,kk);
      return ;
    }
    if(p>m)
    return ;
    for(ll i=p;i<=m;i++){
    vv.pb(i);
    find1(k-1,i,vv,m);
    vv.pop_back();
    }
}
void solve(){

    cin>>n>>m>>q;

    fr(i,0,q)
    cin>>a[i][0]>>a[i][1]>>a[i][2]>>a[i][3];
    //ll ans=0;
    vll v;
    find1(n,1,v,m);
    cout<<ans;
}


int main(){
   ll t=1;
   //cin>>t;
   while(t--){
    solve();
    cout<<endl;
   }
}


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

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int N;
    cin>>N;
    vector<int>A(N);
    vector<int>B(N);
    vector<int>C(N-1);
    int X;
    for(int i=0;i<N;i++){
        cin>>X;
        --X;
        A[i]=X;
    }
    for(int i=0;i<N;i++){
        cin>>X;
        B[i]=X;
    }
    for(int i=0;i<N-1;i++){
        cin>>X;
        C[i]=X;
    }
    int total=0;
    total+=B[A[0]];
    for(int i=1;i<N;i++){
        if(A[i]-A[i-1]==1){
            total+=C[A[i-1]];
        }
        total+=B[A[i]];
    }
    cout<<total;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#ifdef tester
    #include "stuff/prettyprint.hpp"
#endif
using namespace std;

#define iosx ios_base::sync_with_stdio(false);cin.tie(0);cout.precision(20)
#define hell 1000000007LL
#define INF 1000000000000000LL
#define MOD 1000000007LL
#define hmap unordered_map
#define hset unordered_set
#define PQ priority_queue
#define F first
#define S second
#define lld long double
#define ll long long
#define all(C) begin(C),end(C)
#define tr(C,it,cond) for(auto it = begin(C); cond and it!=end(C); ++it)
#define rep(i,a,b) for(ll i = (a); i < (b); ++(i))
#define pb push_back
#define vi vector<ll>
#define pii pair<ll,ll>
#define exists(V,ele) (V).find((ele)) != (V).end()
#define index(V, ele) distance(V.begin(), find(all(V), ele))
#define whats(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {} template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
#ifdef tester 
    cerr << *it << " = " << a << endl;	err(++it, args...); 
#endif 
}
struct mycmp {
    bool operator() (const pii& a, const pii& b) const {
        return a.S-a.F > b.S - b.F;
    }
};

#define N 100010
ll t,n,k,m,q,d;


ll cal(ll a, ll b)
{
    ll c = a/2;
    if(a+c > b*c)
         return (ll)(a+c-b*c);
    ll x = (ll)ceil(b*c*1.0/(a+c));
    return max((a+c)*x-b*c, (b-x)*(a-2*c));
}
ll cal2(ll a, ll b)
{
    ll c = (ll)ceil(a/2.0);
    if(a+c > b*c) return 1e9;
    ll x = b*c/(c+a);
    return max((ll)(b*c-x*(a+c)), (ll)((b-x)*(2*c-a)));
}
ll cal3(ll a, ll b)
{
    double x = floor(b/3.0);
    double y = ceil(b/3.0);
    return (ll)(y*a-x*a);
}

// vim cli: !g++ -Dtester sol.cpp ; ./a.out ; rm a.out
int main() { iosx;
    //cin>>t;while(t--){
    cin>>q>>d;
    ll a,b;
    a=max(q,d), b=min(q,d);

    if (a%3==0 or b%3==0)
        cout<<0;
    else
		cout<<min(cal(a, b), min(cal(b, a), min(cal2(a, b), min(cal2(b, a), min(cal3(a, b), cal3(b, a))))));
    //}
    // whats(t,v);
    return 0;
}

Measured memory_bytes: 256
import fractions
a,b,c,d=map(int,input().split())
total=b-a+1
cdiv=b//c-(a-1)//c
ddiv=b//d-(a-1)//d
CDdiv=(c*d)//fractions.gcd(c,d)
cddiv=b//(CDdiv)-(a-1)//(CDdiv)
print(total-cdiv-ddiv+cddiv)

Measured memory_bytes: 10500
#include <cstdio>
#include <string>
#include <iostream>
#include <math.h>
#include <map>
#include <vector>

using namespace std;
#define ASCII 48

int main() {
	int r, init, D;
	cin >> r >> D >> init;

	int x = init;
	for (int i = 0; i < 10; i++) {
		x = r * x - D;
		cout << x << endl;;
	}
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#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 INF 1e9
#define ALL(v) v.begin(), v.end()
#define downque(que)  priority_queue<ll> que;
#define upque(que) priority_queue<ll, vector<int>, greater<int>> que;
typedef long long ll;

int main(){
  int a,b; cin>>a>>b;
  int res=a-2*b;
  if(res<0)res=0;
  cout<<res<<endl;


}

Measured memory_bytes: 256
import java.util.*;

class Main {

	public static void main(String args[]){
		Scanner in = new Scanner(System.in);
		for(;;){
			int n = in.nextInt();
			if( n == 0 ) return ;
			for(int i=0; i<n; i++){
				int pm = in.nextInt(),
					pe = in.nextInt(),
					pj = in.nextInt();
				if(pm==100 || pe==100 || pj == 100)
					System.out.println("A");
				else if(pm + pe >= 180)
					System.out.println("A");
				else if(pm + pe + pj >= 240)
					System.out.println("A");
				else if(pm + pe + pj >= 210)
					System.out.println("B");
				else if(pm + pe + pj >= 150 && (pm >= 80 || pe >= 80))
					System.out.println("B");
				else
					System.out.println("C");
			}
		}
	}

}

Measured memory_bytes: 12000
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define INFTY 2000000000

typedef struct{//x is value , y is pattern
    int x;
    char y[2];
}Trump;

int partition( Trump A[], int k, int r );
void quickSort( Trump A[], int p, int r );
void merge( Trump A[], int left, int mid, int right );
void MergeSort( Trump A[], int left, int right );
void swap( Trump *a, Trump *b );

//-----------------------------------------------------------------
int main(){
    int i, n, flag = 0;
    Trump A[100000], B[100000];

    //input and copy A to B
    scanf("%d", &n);
    for( i=0; i<n; i++){
	scanf("%s %d", A[i].y, &A[i].x);
	B[i] = A[i];
    }

    //sort
    quickSort( A, 0, n-1 );
    MergeSort( B, 0, n );
    
    //compare A and B
    for( i=0; i<n; i++ ){
	if( strcmp( A[i].y, B[i].y ) != 0 ) flag = 1;
    }

    //print
    if( flag == 0 ) printf("Stable\n");
    else printf("Not stable\n");
    for( i=0; i<n; i++ ) printf("%s %d\n", A[i].y, A[i].x);

    return 0;
}
     
//-------------------------------------------------------------------
void swap( Trump *a, Trump *b ){
    Trump tmp;

    tmp = *a;
    *a = *b;
    *b = tmp;
    
    return ;
}
    
int partition( Trump A[], int p, int r ){
    int i, j, x;

    x = A[r].x;
    for(i = p-1, j = p; j<r; j++){
	if(A[j].x <= x){
	    i++;
	    swap( &A[j], &A[i] );
	}
    }
    swap( &A[i+1], &A[r] );
    return i+1;
}

void quickSort( Trump A[], int p, int r ){
    int q;

    if ( p < r ){
	q = partition( A, p, r );
	quickSort( A, p, q-1 );
	quickSort( A, q+1, r );
    }
    return ;
}

//-------------------------------------------------------------------
void merge( Trump A[], int left, int mid, int right ){
    Trump *L, *R;
    int n1 = mid - left;
    int n2 = right - mid;
    int i, j, k;
    // allocate the memory for merge
    L = malloc(sizeof(Trump) * (n1+1)); //left side
    R = malloc(sizeof(Trump) * (n2+1)); //right side

    // substitute the value of A-array for each divided array 
    for (i = 0; i<n1; i++)
	L[i] = A[left + i];
    for (i = 0; i<n2; i++)
	R[i] = A[mid + i];
    //as sentinels
    L[n1].x = INFTY;
    R[n2].x = INFTY;
    //sort
    i = 0;
    j = 0;
    for (k = left; k<right; k++){
	if (R[j].x == INFTY){
	    A[k] = L[i];
	    i++;
	}
	else if (L[i].x == INFTY){
	    A[k] = R[j];
	    j++;
	}
	else if (L[i].x <= R[j].x){
	    A[k] = L[i];
	    i++;
	}
	else if (L[i].x > R[j].x){ 
	    A[k] = R[j];
	    j++;
	}
    }
    free(L);
    free(R);
    return ;
}

void MergeSort( Trump 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);
    }
    return ;
}



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

using namespace std;


int main(void){
    long long A,B,C,K;

    cin>>A>>B>>C>>K;

    if(A >= K){
        cout<<K<<endl;
    }else if(A+B >= K){
        cout<<A<<endl;
    }else if(A+B+C >= K){
        long long tmp=A-(K-(A+B));
        cout<<tmp<<endl;
    }


    return 0;
}



Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repe(i, n) for (int i = 0; i <= (int)(n); i++)
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define ANS cout << ans << endl
#define all(a) a.begin(),a.end()
#define SORT(a) sort(all(a))
#define REVERSE(a) reverse(all(a))
#define int ll
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORe(i, m, n) for(int i = m;i <= n;i++)
#define VIin(a) for(int i=0; i<a.size(); i++) cin >> a[i]
#define OUT(a) cout << a << endl
typedef vector<int> VI;
typedef vector<VI> VVI;
const int MOD=1e9+7;
const long long INF = 1LL << 60;
/*最大公約数*/int gcd(int x, int y) { return y ? gcd(y,x%y) : x;}
/*最小公倍数*/int lcm(int a, int b) { int g = gcd(a, b); return a / g * b; }
/*素数判定*/int isPrime(int n){if(n<2){return 0;}for(int i=2; i*i<=n; i++){if(n%i==0){return 0;}}return 1;}
/*約数列挙*/vector<int> getDivisor(int n){vector<int> v; for(int i=1; i*i<=n; i++){if(n%i==0){v.push_back(i);if(i!=n/i){v.push_back(n/i);}}}sort(v.begin(),v.end()); return v;}
//----------------------------------------------
ll pow(long long a, long long b, ll mod){
    if(b == 0) return 1;
    if(b % 2 == 0){
        ll d = pow(a,b/2,mod);
        return (d*d)%mod;
    }else return a%mod*pow(a,b-1,mod)%mod;
}
ll bi(long long a,long long b,ll mod){
    if(b > a) return 0;
    if(a == b || b == 0) return 1;
    long long p = 1,q = 1;
    for(long long i = a; i >= a-b+1; i--) p = p*i%mod;
    for(long long i = b; i >= 1; i--) q = q*i%mod;
    return p*pow(q,mod-2,mod)%mod;
}
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int x,y; cin >> x >> y;
    if((x+y)%3){
        OUT(0);
        return 0;
    }else{
        int k = (x+y)/3;
        if(x < k||2*k < y){
            OUT(0);
            return 0;
        }else if(y < k||2*k < y){
            OUT(0);
            return 0;
        }else{
            OUT(bi(k,abs(x-k),MOD));
        }
    }

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    //freopen("input.txt","r",stdin);
    int n,m;
    cin>>n>>m;
    if(n==m) 
    {
    	while(n--) cout<<m;
	}
	else if(n>m)
	{
		while(n--) cout<<m;
	}
	else
	{
		while(m--) cout<<n;
	}
	cout<<"\n";
	return 0; 
}

Measured memory_bytes: 256
while 1:
 n=int(input())
 if n==0:break
 a=1;s='123456'
 for _ in[0]*n:
  s=[s[int(e)]for e in{'N':"152304",'E':"310542",'W':"215043",'S':"402351",'R':"024135",'L':"031425"}[input()[0]]]
  a+=int(s[0])
 print(a)


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

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

const int INF=1e9;
const int MOD=1e9+7;

int main(){
    ll k,a,b; cin >> k >> a >> b;
    ll ans;
    if(a+1<b){
        ll cnt=a-1;
        k-=cnt;
        ans=(k/2)*(b-a)+k%2+a;
    }else{
        ans=k+1;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3588
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <stdio.h>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <utility>
#include <tuple>
#include <math.h>
#include <set>
#include <map>
using namespace std ;
using ll = long long ;
using ld = long double ;
using vll = vector<ll> ;
using vvll = vector<vll> ;
using vc = vector<char> ;
using vvc = vector<vc> ;
using vb = vector<bool> ;
using vvb = vector<vb> ;
using pll = pair<ll,ll> ;
#define all(v) v.begin(),v.end() 
const ll INF = 1e18 ;
const ll mod = 1e9+7 ;
const double pie = acos(-1); 
vll dx4 = {-1,0,1,0} ;
vll dy4 = {0,-1,0,1} ;
vll dx8 = {-1,0,1,1,1,0,-1,-1} ;
vll dy8 = {-1,1,-1,0,1,1,1,0} ; 

void fix_cout(){cout << fixed << setprecision(20) ; }
ll gcd(ll a,ll b){if(b==0) return a ; return gcd(b,a%b) ; }
ll lcm(ll a,ll b){return a/gcd(a,b)*b ; }
void chmax(ll &a,ll b){if(a<b) a = b ; }
void chmin(ll &a,ll b){if(a>b) a = b ; }

int main(){
	ll h,w ; cin >> h >> w ;
	vvc g(h+2,vc(w+2,'x')) ;
	for(int i=1;i<=h;i++) for(int j=1;j<=w;j++) cin >> g.at(i).at(j) ;
	vvb use(h+2,vb(w+2,true)) ;
	ll ans = 0 ;
	ll black,white ;
	queue<int> q ;
	for(int i=1;i<=h;i++){
		for(int j=1;j<=w;j++){
			if(use.at(i).at(j)){
				q.push(i) ;
				q.push(j) ;
				use.at(i).at(j) = false ;
				black = white = 0 ;
				while(!q.empty()){
					int y = q.front() ;
					q.pop() ;
					int x = q.front() ;
					q.pop() ;
					char c = '.'^'#'^g.at(y).at(x) ;
					if(c=='.') black++ ;
					if(c=='#') white++ ;
					for(int k=0;k<4;k++){
						int ny = y+dy4.at(k) ;
						int nx = x+dx4.at(k) ;
						if(use.at(ny).at(nx)&&g.at(ny).at(nx)==c){
							q.push(ny) ;
							q.push(nx) ;
							use.at(ny).at(nx) = false ;
						}
					}
				}
				ans += black*white ;
			}
		}
	}
	cout << ans << endl ;
}

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

int n, m, road[51];

int main() {
    int a, b;
    cin >> n >> m;
    for (int i = 0; i < m; ++i) {
        cin >> a >> b;
        a--; b--;
        road[a]++;
        road[b]++;
    }

    for (int i = 0; i < n; ++i) cout << road[i] << endl;

    return 0;
}


Measured memory_bytes: 256
import java.math.BigInteger;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner s=new Scanner(System.in);
		while(s.hasNext()){
			BigInteger a = BigInteger.valueOf(s.nextInt());
			BigInteger b = BigInteger.valueOf(s.nextInt());
			BigInteger g = a.gcd(b);
			BigInteger l = a.multiply(b).divide(g);
			System.out.println(g+" "+l);
		}	
	}	
}

Measured memory_bytes: 0
from collections import Counter

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

d = Counter(A)
l = list(d.values())
X = 0
for i in l:
  X += i*(i-1)/2
for i in A:
  x = X
  a = d[i]
  if a != 1:
    x -= a*(a-1)/2
  if a > 1:
    x += (a-1)*(a-2)/2  
  print(int(x))


Measured memory_bytes: 26780
# -*- coding: utf-8 -*-
n = int(input())
a = list(map(int, input().split()))
m = 1000005

count = 0
cnt = [0] * m
for i in range(n):
  if cnt[a[i]] == 0:
    for j in range(a[i], m, a[i]):
      cnt[j] += 1
  else:
    cnt[a[i]] = 2
for i in range(n):
  if cnt[a[i]] == 1:
    count += 1
print(count)

Measured memory_bytes: 103964
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String a = scan.next();
        scan.close();

        if (a.equals("ARC")) {
            System.out.println("ABC");
        } else {
            System.out.println("ARC");
        }

    }
}


Measured memory_bytes: 35672
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define F(i,a,b) for(int i=a;i<b;i++)
#define RF(i,a,b) for(int i=a;i>b;i--)
#define mp(a,b) make_pair(int a,int b)
#define ll long long
const int mxn=1e5+10,mxm=4e5+10,modl=1e9+7;
int nm,n,m,p,t,ans,sum;
int a[mxn],b[mxn],h[mxn];
//string s[mxn];
//bool in[mxn][mxn];
//int tr[][2]={{0,-1},{-1,0},{0,+1}};
//struct pos{
//    int x,y;
//    bool operator < (const pos b)const{
//        return h[x][y]>h[b.x][b.y];
//    }
//};
bool cmp(string a,string b){
    return a+b<b+a;
}
int main(){
    ios_base::sync_with_stdio(false);
//    freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
//    cin>>nm;
//    string s,s1,s2;char c;
    while(cin>>n>>m>>p){
//        priority_queue<int,vector<int>,greater<int>>q;
        t=mxn;
        F(i,1,n+1){
            cin>>a[i];
            if(a[i]<t) t=a[i];
        }
        ans=t;
        F(i,1,m+1){
            cin>>b[i];
            if(b[i]<t) t=b[i];
        }
        ans+=t;
        F(i,0,p){
            int x,y,z;
            cin>>x>>y>>z;
            ans=min(ans,a[x]+b[y]-z);
        }
        cout<<ans;
    }
    return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include<iomanip>
#include <cmath>
#include <climits>
#include <algorithm>
#include <stdio.h>
using namespace std;

bool dp[100001];
int a[100];

int main(){
    int N;
    int K;

    cin >> N >> K;

    for(int i = 0; i < N; i++){
        cin >> a[i];
    }
    for(int i = 0; i < K + 1; i++){
        dp[i] = false;
        for(int j = 0; j < N; j++){
            if(i - a[j] >= 0){
                if(!dp[i - a[j]]){
                    dp[i] = true;
                }
            }
        }
    }

    if(dp[K]){
        cout << "First" << endl;
    } else{
        cout << "Second" << endl;
    }

    return 0;

}

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

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

    int H, W, K; cin >> H >> W >> K;
    vector<string> S(H);
    for (int i = 0; i < H; i++) cin >> S[i];

    auto f = [](int n) {
        int res = 0;
        while (n) {
            res += n & 1;
            n >>= 1;
        }
        return res;
    };

    vector<int> v(H);
    int ans = H * W;
    for (int i = 0; i < 1 << H-1; i++) {
        bool flag = false;
        vector<int> c(H);
        int res = f(i);
        for (int j = 0; j < W; j++) {
            bool b = false;
            int now = 0;
            vector<int> d(H);
            for (int k = 0; k < H-1; k++) {
                if (S[k][j] == '1') {
                    now++;
                    if (now > K) flag = true;
                }
                if (i & 1 << k) {
                    if (c[k] + now > K) {
                        if (!b) res++;
                        b = true;
                    }
                    d[k] = now;
                    now = 0;
                }
            }
            if (S[H-1][j] == '1') {
                now++;
                if (now > K) flag = true;
            }
            if (flag) break;
            if (c[H-1] + now > K) {
                if (!b) res++;
                b = true;
            }
            d[H-1] = now;
            if (b) c = d;
            else {
                for (int k = 0; k < H; k++) c[k] += d[k];
            }
        }
        if (flag) continue;
        ans = min(ans, res);
    }
    cout << ans << "\n";
}

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

template <class T>
bool INRANGE(T x, T a, T b) { return a <= x && x <= b; }
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;
}

#define REP(i, n) for (int i = 0; i < (n); ++i)
#define RREP(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define RFOR(i, a, b) for (int i = (a); i >= (b); --i)
#define ALL(v) (v).begin(), (v).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
                      << " " << __FILE__ << endl;

typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vi> vvi;
typedef pair<int, int> pii;


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

    int N;
    cin >> N;
    vi a(N), b(N), c(N);

    REP(i, N) cin >> a[i];
    REP(i, N) cin >> b[i];
    REP(i, N) cin >> c[i];

    sort(ALL(a));
    sort(ALL(c));

    ll ans = 0;
    for(int i=0;i<N;i++){
        ll key = b[i];
        auto pos_a = lower_bound(ALL(a),key);
        ll x = distance(a.begin(),pos_a);
        auto pos_c = upper_bound(ALL(c),key);
        ll y = distance(pos_c,c.end());
        ans+= (x*y);
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 1408
n, m = map(int, input().split())
arr = [0] + list(map(int, input().split()))
g = [[] for _ in range(n + 1)]
for _ in range(m):
    a, b = map(int, input().split())
    g[a].append(b)
    g[b].append(a)

ans = 0
for i in range(1, n + 1):
    for j in g[i]:
        if arr[j] >= arr[i]:
            break
    else:
        ans += 1

print(ans)


Measured memory_bytes: 29132
//============================================================================
// Name        : c.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include<vector>
using namespace std;

int main() {
	int n,m;cin>>n>>m;
	vector<int> k(m);
	vector<vector<int>> s;
	for(int j=0;j<m;j++){
		cin>>k[j];
		vector<int> v(k[j]);
		for(int i=0;i<k[j];i++){
			cin>>v[i];
		}
		for(int i=0;i<k[j];i++){
//			cout<<v[i]<<endl;
		}
		s.push_back(v);
	}
//	for(auto x:s){
//		for(auto y:x){
//			cout<<y<<' ';
//		}cout<<endl;
//	}cout<<endl;
	vector<int> p(m);
	for(int i=0;i<m;i++){
		cin>>p[i];
	}
	int ans=0;
	int idx=1<<n;
	for(int i=0;i<idx;i++){
		vector<int> sw(n);
		int tempi=i;
		for(int j=0;j<n;j++){
			sw[j]=tempi%2;
			tempi/=2;
		}
		int flag=1;
		for(int j=0;j<m;j++){
			int count=0;
			for(auto y:s[j]){
//				cout<<"y="<<y<<endl;
				count+=sw[y-1];
			}
			count%=2;
//			cout<<"count="<<count<<endl;
//			cout<<"p[j]="<<p[j]<<endl;
			if(count!=p[j]){
				flag=0;
			}
		}
		ans+=flag;
//		cout<<"flag="<<flag<<endl;
//		for(auto x:sw){
//			cout<<x;
//		}cout<<endl;
	}
	cout<<ans<<endl;

	return 0;
}

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

using namespace std;

typedef long long lli;
typedef double lld;
typedef vector<lli> vll;
typedef vector<bool> vbl;
typedef vector<double> vdl;
typedef vector<vector<lli>> mat;
typedef vector<vdl> mad;
typedef unordered_map<lli,unordered_map<lli,lli>> graph;
typedef complex<double> cmp;
typedef vector<cmp> vcl;

lli l;
vll a;
mat dp;

int main(){
  cin >> l;
  a = vll(l+1);
  for(lli i = 1;i <= l;i++) cin >> a[i];
  dp = mat(l+1, vll(5, 0));
  for(lli i = 1;i <= l;i++){
    dp[i][0] = dp[i-1][0]+a[i];
    dp[i][1] = min({dp[i-1][0]+a[i], dp[i-1][1]+(a[i] == 0 ? 2 : a[i]%2)});
    dp[i][2] = min({dp[i-1][0]+a[i], dp[i-1][1]+(a[i] == 0 ? 2 : a[i]%2), dp[i-1][2]+(a[i]+1)%2});
    dp[i][3] = min({dp[i-1][0]+a[i], dp[i-1][1]+(a[i] == 0 ? 2 : a[i]%2), dp[i-1][2]+(a[i]+1)%2, dp[i-1][3]+(a[i] == 0 ? 2 : a[i]%2)});
    dp[i][4] = min({dp[i-1][0]+a[i], dp[i-1][1]+(a[i] == 0 ? 2 : a[i]%2), dp[i-1][2]+(a[i]+1)%2, dp[i-1][3]+(a[i] == 0 ? 2 : a[i]%2), dp[i-1][4]+a[i]});
  }
  // for(lli i = 0;i <= l;i++){
  //   for(lli j = 0;j < 5;j++){
  //     cout << dp[i][j] << " ";
  //   }
  //   cout << endl;
  // }
  cout << dp[l][4] << endl;
}


Measured memory_bytes: 15872
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
#define ln '\n'
//constexpr long long MOD = 1000000007LL;
constexpr long long MOD = 998244353LL;
typedef long long ll;
typedef unsigned long long ull; 
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
template<class T, class U> inline bool chmax(T &a, U b) { if (a < b) { a = b; return true;} return false; }
template<class T, class U> inline bool chmin(T &a, U b) { if (a > b) { a = b; return true;} return false; }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

int N,M;
vector<int> G[101010],H[101010],ans[101010];
int dist[101010];
bool seen[101010],check[101010];
int dfs(int v, int pv) {
    if (check[v]) {
        ans[v].emplace_back(pv);
        return 1;
    }
    int cnt = 0;
    for (auto nv : H[v]) {
        cnt += dfs(nv,v);
    }
    check[v] = 1;
    if (v==0) return cnt;
    if (cnt&1) {
        ans[pv].emplace_back(v);
        return 0;
    } else {
        ans[v].emplace_back(pv);
        return 1;
    }
}
int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    cin >> N >> M;
    rep(i,M) {
        int u,v; cin >> u >> v;
        --u; --v;
        G[u].emplace_back(v);
        G[v].emplace_back(u);
    }

    rep(i,N) dist[i] = -1;
    dist[0] = 0;
    queue<int> que;
    que.emplace(0);
    while (!que.empty()) {
        int v = que.front(); que.pop();
        seen[v] = 1;
        for (auto nv : G[v]) {
            if (dist[nv] != -1) {
                if (!seen[nv]) H[v].emplace_back(nv);
                continue;
            }
            dist[nv] = dist[v]+1;
            H[v].emplace_back(nv);
            que.emplace(nv);
        }
    }

    if (dfs(0,-1)&1) {
        cout << -1 << ln;
        return 0;
    }
    rep(i,N) {
        for (auto nv : ans[i]) cout << nv+1 << " " << i+1 << ln;
    }
}

Measured memory_bytes: 19968
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;

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

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;

const ll MOD = (ll)1e9 + 7;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    VI prime_table;
    prime_table.push_back(2);
    ll hash[1001] = {};
    hash[2]++;
    FOR(i, 3, n){
        bool is_prime = true;
        for(auto p : prime_table){
            int i_temp = i;
            while(i_temp % p == 0){
                i_temp /= p;
                hash[p]++;
                is_prime = false;
            }
            if(is_prime && p == prime_table.back()){
                prime_table.push_back(i);
                hash[i]++;
            }
        }
    }



    ll ans = 1;
    FOR(i, 2, n){
        if(hash[i] != 0){
            ans = ans * (hash[i] + 1) % MOD;
        }
    }
    cout << ans << "\n";

    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<algorithm>
#include<string.h>
#include<set>
#include<queue>
#include<string>
#include<sstream>
#include<iostream>
#include<sstream>
#include<stack>
#include<map>
#include<vector>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<math.h>
#include <cassert>
using namespace std;
typedef long long ll;
#define mod 1000000007
#define MAXN 1200

int main()
{
	int n, m;
	cin >> n >> m;
	if (n <= 5)printf("0");
	else if (n <= 12)printf("%d", m / 2);
	else printf("%d", m);
}


Measured memory_bytes: 256