akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <cstring>
using namespace std;

int n;
vector<int> pos[100010];
int cnt[100010],l[100010],p[100010];

inline void dfs(int v)
{
	cnt[v]=1;
	for(int i=0;i<pos[v].size();i++)
	{
		int cur=pos[v][i];
		if(p[v]==cur) continue;
		l[cur]=l[v]+1;p[cur]=v;
		dfs(cur);
		cnt[v]+=cnt[cur];
	}
}

int main()
{
	cin>>n;
	for(int i=0;i<n-1;i++)
	{
		int a,b;
		cin>>a>>b;
		pos[a].push_back(b);
		pos[b].push_back(a);
	}
	
	dfs(1);
	int sz=(l[n]-1)/2,v=n;
	while(sz--) v=p[v];
	if(cnt[v]>=n-cnt[v]) cout<<"Snuke"; else cout<<"Fennec";
	
	return 0;
}

Measured memory_bytes: 10880
#!ruby -pal
t=[[1989,1,7],[1926,12,24],[1912,7,29],[1868,9,7],[1]]
s=["heisei"+d=" %d"*3,"showa"+d,"taisho"+d,"meiji"+d,"pre-meiji"]
i=t.index{|l|Time.gm(*l)<Time.gm(*$F)}
$F[0]=$F[0].to_i-t[i][0]+1
$_=s[i]%$F

Measured memory_bytes: 6128
#include <iostream>
#include <cstdio>

using namespace std;

char field[8][8];

bool check(int y,int x){
	return 0<=y && y<8 && 0<=x && x<8 && field[y][x];
}

int main(void){
	int i,j,y,x;

	while(cin>>field[0]){
		for(i=1;i<8;i++){
			cin>>field[i];
		}

		for(i=0;i<8;i++){
			for(j=0;j<8;j++){
				field[i][j]-='0';
			}
		}

		for(y=0;y<8;y++){
			for(x=0;x<8;x++){
				if(field[y][x]==1){
					if(check(y+1,x) && check(y+2,x)) cout<<"B"<<endl;
					else if(check(y,x+1) && check(y,x+2)) cout<<"C"<<endl;
					else if(check(y+1,x) && check(y,x+1) && check(y+1,x+1)) cout<<"A"<<endl;
					else if(check(y+1,x) && check(y+1,x-1) && check(y+2,x-1)) cout<<"D"<<endl;
					else if(check(y,x+1) && check(y+1,x+1) && check(y+1,x+2)) cout<<"E"<<endl;
					else if(check(y+1,x) && check(y+1,x+1) && check(y+2,x+1)) cout<<"F"<<endl;
					else if(check(y,x+1) && check(y+1,x) && check(y+1,x-1)) cout<<"G"<<endl;
					y=x=8;
				}
			}
		}
	}
	return 0;
}

Measured memory_bytes: 1136
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        n: usize,
    }
    let mut i = 1;
    while i * i <= n {
        i += 1;
    }
    println!("{}", (i - 1) * (i - 1));
}


Measured memory_bytes: 4352
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int n = Integer.parseInt(sc.nextLine());
		
		for(int i = 0; i < n; i++){
			String str = sc.nextLine();
			
			if(str.matches(">\'(=+)#\\1~")){
				System.out.println("A");
			}else if(str.matches(">\\^(Q=)+~~")){
				System.out.println("B");
			}else{
				System.out.println("NA");
			}
			
		}
		
	}
	
}

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

struct Point{
    double x,y;
};

void koch(int n, struct Point a, struct Point b){
    if(n==0) return;
   struct Point s, t, u;
    double th = M_PI * 60.0 / 180.0; // 度からラジアンへ単位を変換

    s.x=(2.0* a.x + 1.0*b.x) /3.0;
    s.y=(2.0* a.y + 1.0*b.y) /3.0;
    t.x=(1.0* a.x + 2.0*b.x) /3.0;
    t.y=(1.0* a.y + 2.0*b.y) /3.0;
    u.x=(t.x -s.x) * cos(th)- (t.y-s.y) * sin(th) + s.x;
    u.y=(t.x -s.x) * sin(th)+ (t.y-s.y) * cos(th) + s.y;

    koch(n-1, a,s);
    printf("%.8f %.8f\n", s.x, s.y);
    koch(n-1, s,u);
    printf("%.8f %.8f\n", u.x, u.y);
    koch(n-1, u,t);
    printf("%.8f %.8f\n", t.x, t.y);
    koch(n-1, t,b);
}

int main(){
   struct Point a,b;
    int n;
    scanf("%d", &n);

    a.x=0;
    a.y=0;
    b.x=100;
    b.y=0;

 printf("%.8f %.8f\n", a.x, b.y);
    koch(n, a,b);
    printf("%.8f %.8f\n", b.x, b.y);

    return 0;
}



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

int main(void)
{
    int n,m,p[100000],i,ifcorr[100000]={0},wanum[100000]={0},seitou=0,pena=0;
    char s[100000][3];

    scanf("%d %d",&n,&m);
    for ( i = 0; i < m; i++)
    {
        scanf("%d %s",p+i,s[i]);
        p[i]--;
    }

    for ( i = 0; i < m; i++)
    {
        if(strcmp(s[i],"AC")==0) ifcorr[p[i]]=1;
        else if(ifcorr[p[i]]==0) wanum[p[i]]++;
    }

    for ( i = 0; i < n; i++)
    {
        if(ifcorr[i]==1)
        {
            seitou++;
            pena+=wanum[i];
        }
    }

    printf("%d %d",seitou,pena);

    return 0;
}

Measured memory_bytes: 1664
class _Node {
  constructor(key, parent = null, left = null, right = null) {
    this.key = key;
    this.parent = parent;
    this.left = left;
    this.right = right;
  }

  getChildrenNumber() {return Number(this.left !== null) + Number(this.right !== null);}

  isLeftChild() {
    if (this.parent === null) return null;
    return this.parent.left === this;
  }

  getLeftOrRight() {return this.isLeftChild() ? 'left' : 'right';}

  getSuccessor() {
    let n;
    if (this.right !== null) {
      n = this.right;
      while (n.left !== null) n = n.left;
    } else {
      n = this.parent;
      while (!n.isLeftChild && n.parent != null) n = n.parent;
    }
    return n;
  }
}

class BinaryTree {
  constructor() {
    this.root = null;
  }

  static get Node() { return _Node; }

   insert(key) {
     if (this.root === null) {
       this.root = new BinaryTree.Node(key);
       return;
     }
     let x = this.root, y;
     let newNode = new BinaryTree.Node(key);
     while (x !== null) {
       y = x;
       x = key < x.key ? x.left : x.right;
     }
     newNode.parent = y;
     y[key < y.key ? 'left' : 'right'] = newNode;
   }


  find(key, n = this.root) {
    if (n === null || n.key === key) return n;
    return this.find(key, n[key < n.key ? 'left' : 'right']);
  }

  delete(key) {
    const n = this.find(key);
    if (n === null) return;
    let leftOrRight = n.getLeftOrRight();
    switch (n.getChildrenNumber()) {
    case 0:
      n.parent[leftOrRight] = null;
      break;
    case 1:
      n.parent[leftOrRight] = n.left || n.right;
      n.parent[leftOrRight].parent = n.parent;
      break;
    default:
      let skey = n.getSuccessor().key;
      this.delete(skey);
      n.key = skey;
    }
  }

  printByIneorder() {
    let str = '';
    const innerFunc = (n) => {
      if (n === null) return;
      innerFunc(n.left);
      str += ` ${n.key}`;
      innerFunc(n.right);
    }
    innerFunc(this.root);
    console.log(str);
  }

  printByPreorder() {
    let str = '';
    const innerFunc = (n) => {
      if (n === null) return;
      str += ` ${n.key}`;
      innerFunc(n.left);
      innerFunc(n.right);
    }
    innerFunc(this.root);
    console.log(str);
  }

  print() {
    this.printByIneorder();
    this.printByPreorder();
  }
}

(function main(){
  const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\n');
  const n = Number(lines.shift());

  const tree = new BinaryTree();
  lines.forEach(function(cmd) {
    switch (cmd.charAt(0)) {
    case 'i': tree.insert(Number(cmd.split(' ')[1])); break;
    case 'f': console.log(tree.find(Number(cmd.split(' ')[1])) ? 'yes' : 'no'); break;
    case 'd': tree.delete(Number(cmd.split(' ')[1])); break;
    default: tree.print();
    }
  });
})();



Measured memory_bytes: 203280
#include <cstdio>
#include <iostream>
#include <bitset>
#include <cmath>
#include <vector>
#include <algorithm>

using namespace std;
typedef long long ll;

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

int main(){
    int a,b;
    cin >> a >> b;
    char t[100][101];
    rep(i,100){
        rep(j,100+1){
            if(j==100) t[i][j] = '\0';
            else if(j==0) t[i][j] = '#';
            else if(i%2==0){
                if(i==0||i==99) t[i][j] = '#';
                else if(j!=99) t[i][j] = '#';
                else t[i][j] = '.';
            }else t[i][j] = '.';
        }
    }
    int aa=1,bb=1;
    rep(i,40){
        if(aa==b) break;
        FOR(j,1,99){
            if(t[i][j-1]=='#'&&t[i][j]=='#'&&t[i][j+1]=='#'){
                aa++;
                t[i][j] = '.';
            }
             if(aa==b) break;
        }
    }
    FOR(i,50,90){
        if(bb==a) break;
        FOR(j,1,99){
            if(t[i][j-1]=='.'&&t[i][j]=='.'&&t[i][j+1]=='.'){
                bb++;
                t[i][j] = '#';
            }
             if(bb==a) break;
        }
    }
    cout << "100 100" << endl;
    rep(i,100) cout << t[i] << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define Hello ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define endl '\n'
int main()
{
    Hello
    ll n, a, b;
    cin >> n >> a >> b;
    ll ans = n / (a + b) * a;
    ans += min(a, n %(a + b));
    cout << ans;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
struct edge {
  int to, cost;
  edge(){}
  edge(int to, int cost):to(to), cost(cost){}
};
#define MAX_N 1000

const int inf = 1<<25;

vector<edge> graph[MAX_N];
int mincost[1<<12][MAX_N];
int S[MAX_N], T[MAX_N];
int n, m, k, p;

int dijkstra() {
  fill(mincost[0], mincost[1<<12], inf);
  typedef tuple<int, int, int> Tpl;
  priority_queue<Tpl, vector<Tpl>, greater<Tpl> > que;
  mincost[0][p] = 0;
  que.emplace(0, p, 0);
  while(que.size()) {
    int cost, now, bit;
    tie(cost, now, bit) = que.top(); que.pop();
    if(bit == (1<<(2*k))-1) return cost;
    for(edge e : graph[now]) {
      int nbit = bit;
      if(S[e.to] != -1) nbit |= 1<<(S[e.to]*2);
      if(T[e.to] != -1 && (bit>>(T[e.to]*2))&1)	nbit |= 1<<(T[e.to]*2+1);
      if(e.cost + cost < mincost[nbit][e.to]) {
	mincost[nbit][e.to] = e.cost + cost;
	que.emplace(mincost[nbit][e.to], e.to, nbit);
      }
    }
  }
  return -1;
}
int main(){
  cin >> n >> m >> k >> p; --p;
  for(int i = 0; i < m; i++) {
    int x, y, w;
    cin >> x >> y >> w; --x, --y;
    graph[x].emplace_back(y, w);
    graph[y].emplace_back(x, w);
  }
  memset(S, -1, sizeof(S));
  memset(T, -1, sizeof(S));
  for(int i = 0; i < k; i++) {
    int s, t;
    cin >> s >> t; --s, --t;
    S[s] = i;
    T[t] = i;
  }
  int ans = dijkstra();
  if(ans == -1) cout << "Cannot deliver" <<endl;
  else cout << ans << endl;
  return 0;
}

Measured memory_bytes: 20632
using System;
using System.Linq;
using System.Collections.Generic;

namespace ABC
{
    class ProgramC
    {
        static void Main(string[] args)
        {
            var inputs = Console.ReadLine().Split(" ");
            var h = int.Parse(inputs[0]);
            var w = int.Parse(inputs[1]);
            var matrix = new char[h, w];

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

            for (var i = 0; i < h; i++)
            {
                var list = Console.ReadLine().ToCharArray();
                for (var j = 0; j < w; j++)
                {
                    matrix[i, j] = list[j];
                }
            }

            for (var i = 0; i < h; i++)
            {
                for (var j = 0; j < w; j++)
                {
                    if (matrix[i, j] != '#') continue;

                    for (var k = 0; k < 4; k++)
                    {
                        var ki = i + dx[k];
                        var kj = j + dy[k];
                        if (ki < 0 || h <= ki) continue;
                        if (kj < 0 || w <= kj) continue;
                        if (matrix[ki, kj] == '#')
                            break;
                        if (k == 3)
                        {
                            Console.WriteLine("No");
                            return;
                        }

                    }
                }
            }

            Console.WriteLine("Yes");
        }
    }
}


Measured memory_bytes: 27276
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <tuple>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr int INF = 2000000000;
constexpr int HINF = INF / 2;
constexpr double DINF = 100000000000000000.0;
constexpr long long LINF = 9223372036854775807;
constexpr long long HLINF = 4500000000000000000;
const double PI = acos(-1);
int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
#define ALL(x)    (x).begin(),(x).end()
#define UNIQ(c)   (c).erase(unique(ALL((c))), end((c)))
#define mp        make_pair
#define eb        emplace_back
#define REP(i, a) for (int i = 0; i < (a); i++)

int n;
int a[101010];
vector<int>b;

int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		b.emplace_back(a[i]);
	}
	sort(ALL(b));
	int ans = 0;
	for (int i = 0; i < n; i++) {
		int c = lower_bound(ALL(b), a[i]) - b.begin();
		if (i % 2 != c % 2)ans++;
	}
	cout << ans / 2 << endl;
}

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

int main()
{
    string a;
    cin >> a;
    std::map<char, int> mp;

    for (int i = 0; i < 4; i++)
    {
        mp[a.at(i)] = mp[a.at(i)] + 1;
    }
    vector<int> vec;

    for (auto itr = mp.begin(); itr != mp.end(); ++itr)
    {
        vec.push_back(itr->second);
    }
    if (vec[0] == 2&& vec[1] == 2)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
}

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

typedef long long ll;

const int MAX_N = 2005;
const ll MOD = 1000000007; 

int n, m, A[MAX_N], B[MAX_N];

ll DP[MAX_N][MAX_N];

int main() {
    cin >> n >> m;
    
    for(int i = 1; i <= n; i++) {
        cin >> A[i];
    }
    
    for(int i = 1; i <= m; i++) {
        cin >> B[i];
    }
    
    for(int i = 1; i <= n; i++) {
        for(int j = 1; j <= m; j++) {
            DP[i][j] = (DP[i - 1][j] + DP[i][j - 1] - DP[i - 1][j - 1] + MOD) % MOD;
            if(A[i] == B[j]) {
                DP[i][j] = (DP[i][j] + DP[i - 1][j - 1] + 1) % MOD;
            }
        }
    }
    
    cout << (DP[n][m] + 1) % MOD;
    
    return 0;
}

Measured memory_bytes: 34960
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<queue>
#include<string>
#include<cstring>
#include<algorithm>
#include<set>
#include<map>

#define REP(i,n) for(int i=0;i<(n);i++)
#define EPS (1e-7)
#define INF (3e9)

using namespace std;
typedef long long int ll;

int N, K, h;
int main(void){
    int count = 0;
    cin >> N >> K;
    REP(i,N){
        scanf("%d",&h);
        if(h>=K) count++;
    }
    cout << count << endl;

    return 0;
}



Measured memory_bytes: 256
#include <cstdio>

typedef long long ll;
#define min(a, b) (((a) < (b)) ? (a) : (b))
#define max(a, b) (((a) > (b)) ? (a) : (b))

inline ll read()
{
    char c = getchar();
    ll ret = 0;
    while (c < '0' || c > '9') c = getchar();
    while (c >= '0' && c <= '9') ret = ret * 10 + c - '0', c = getchar();
    return ret;
}

int n, ans;
char a[105], b[105], c[105];
int main()
{
    scanf("%d%s%s%s", &n, a + 1, b + 1, c + 1);
    int i;
    for (i = 1; i <= n; ++i)
    {
        if (a[i] == b[i] && b[i] == c[i]) continue;
        else if (a[i] == b[i] || b[i] == c[i] || a[i] == c[i]) ++ans;
        else ans += 2;
    }
    printf("%d", ans);
    return 0;
}

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

using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " : " << arg1 << std::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 ll long long int

int main() {
    int n;
    cin >> n;
    int zero = 0;
    int rest = 0;
    int odd = 0;
    for (int i = 1; i <= n; i++) {
        ll x;
        cin >> x;
        if (x % 2 == 1){odd++;continue;
        }
        if ( x % 4 == 0) {
            zero++;
        }else {
            rest++;
        }
    }
    if (rest % 2 == 0) {
        if (odd -1<= zero) {
            cout << "Yes" << endl;
        }else {
            cout << "No" << endl;
        }
    }else {
        if (zero > 0 && odd<= zero) {
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 256
n = int(input())
min = []
max = []
for i in range(n):
  a, b = map(int, input().split())
  min.append(a)
  max.append(b)
min.sort()
max.sort()
if n%2 == 0:
  print((max[n//2] + max[n//2 - 1]) -(min[n//2] + min[n//2 - 1])+ 1)
else:
  print(max[n//2]-min[n//2]+1)

Measured memory_bytes: 25388
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 200000 + 10;

char s[maxn];
int n;
ll Ans;

int main() {
	scanf("%s", s + 1);
	n = strlen(s + 1);
	Ans = 0;
	for(int i = 1, now = 0;i < n;) {
		if(s[i] == 'A') {
			now ++;
		  i ++;
		  continue;
		}
		if(s[i] == 'B' && s[i + 1] == 'C') {
			Ans += now;
			i += 2;
			continue;
		}
		now = 0; i ++;
	}
	printf("%lld\n", Ans);
	return 0;
}

Measured memory_bytes: 384
def main():
    import sys
    sys.setrecursionlimit(10**9)
    input = sys.stdin.readline

    n, k = map(int, input().split())

    mod = 1000000007
    def make_fact(n):
        fact = [1]*(n+1)
        ifact = [1]*(n+1)
        for i in range(1, n+1):
            fact[i] = fact[i-1]*i % mod
        ifact[n] = pow(fact[n], mod-2, mod)
        for i in range(n, 0, -1):
            ifact[i-1] = ifact[i]*i % mod
        return fact, ifact
    fact, ifact = make_fact(n)

    def comb(n, k):
        if k < 0 or k > n: return 0
        return fact[n]*ifact[k]*ifact[n-k] % mod

    ans = 0
    if k > n-1:
        k = n-1
    for i in range(k+1):
        ans = (ans + comb(n, i) * comb(n-1, i))% mod

    print(ans)

main()

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

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

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

    ll N , M ;
    cin >> N >> M ;

    ll l = 1;
    ll r = N;

    rep(i, M){
        ll inpl, inpr;
        cin >> inpl >> inpr;
        l = max(l, inpl);
        r = min(r, inpr);
    }

    cout << max(0LL, (r - l + 1)) << endl;

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


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

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << "\n";
}
template <typename Arg1, typename... Args>
void __f(const char* na, Arg1&& arg1, Args&&... args) {
  const char* c = strchr(na + 1, ',');
  cerr.write(na, c - na) << " : " << arg1 << " , ";
  __f(c + 1, args...);
}
#define endl "\n"
typedef long long LL;
const int mod = 1e9 + 7;
const int inf = 1e9;
const LL INF = 1e18;
const int N = 1e5 + 5;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0); cout.tie(0);
  #ifdef LOCAL
    freopen("input.txt", "r", stdin);
  #endif // LOCAL
  int a, b, c;
  cin >> a >> b >> c;
  if (a == b && a != c) return cout << "Yes" << endl,0;
  if (b == c && a != c) return cout << "Yes" << endl,0;
  if (a == c && b != c) return cout << "Yes" << endl,0;
  cout << "No" << endl;
  return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;cin>>n;int a[n+1],b[n+1];
	for(int i=0;i<=n;i++){
		b[i]=0;
	}
	for(int i=2;i<=n;i++){
		cin>>a[i];b[a[i]]++;
	}
	for(int i=1;i<=n;i++){
		cout<<b[i]<<'\n';
	}
	return 0;
}

Measured memory_bytes: 5200
#include <bits/stdc++.h>
#define ll long long
using namespace std;
 
const int sz = 2e5+5;
ll mod=1e9+7;

// ll ncr(ll n,ll k)
// {
//     ll res=0;
//     for(int i=0;i<k;i++)
//     {
//     }
// }


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    
    int t;
    t=1;
    // cin>>t;
    //sieve();
    // ll pw[1000006];
    // pw[0]=1;
    // for(int i=1;i<1000006;i++)
    // {
    //     pw[i] = (pw[i-1]%mod*2ll)%mod;
    // }
    // cout<<pw[2]<<endl;
    for(int cs=1;cs<=t;cs++)
    {
        
        ll l,r,n;
        cin>>l>>r>>n;
        cout<<r/n-ceil(l/(n*1.0))+1;
        
        
 
    }
    return 0;
} 

Measured memory_bytes: 3800
N = int(input())
arr = list(map(int, input().split()))
renban = list(range(1,N+1))

dp = [[0] * 2 for _ in range(N)]

for i in range(N):
    dp[i][0] = i+1
    dp[i][1] = arr[i]

dp.sort(key=lambda x:x[1])
arr2 = []
for i in range(N):
    arr2.append(dp[i][0])

print(*arr2)


Measured memory_bytes: 75116
n= int(input())
a= list(map(int,input().split()))

c1=0
c2=0
for i in range(len(a)):
  if a[i]%2 == 0:
    c1+=1
    if a[i]%3 == 0 or a[i]%5 == 0:
      c2+=1
if c1 == c2:
  print('APPROVED')
else:
  print('DENIED')

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

int main(){
  int N;
  cin >> N;
  
  for(int i = 0; i < N; i++){
    string S;
    cin >> S;
   
    if(S == "Y"){
      cout << "Four" << endl;
      return 0;
    }
  }
  cout << "Three" << endl;
}

Measured memory_bytes: 3608
#include <stdio.h>
const int o = 4280;
const int base = 1150;

int w;

int main()
{
    while (scanf("%d", &w), w != -1) {
        int ans = base;

        if (w > 30) {
            ans += (w - 30) * 160;
            w = 30;
        }
        if (w > 20) {
            ans += (w - 20) * 140;
            w = 20;
        }
        if (w > 10) {
            ans += (w - 10) * 125;
            w -= 10;
        }

        printf("%d\n", o - ans);
    }

    return 0;
}



Measured memory_bytes: 1920
#include<stdio.h>
int main(){
	int a,b,c,d;
	scanf("%d %d %d %d",&a,&b,&c,&d);
	if((a+b)>(c+d)){
		printf("Left\n");
	}
	if((a+b)<(c+d)){
		printf("Right\n");
	}
	if((a+b)==(c+d)){
		printf("Balanced\n");
	}
	
	return 0;
}


Measured memory_bytes: 128
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: 5048
#include <bits/stdc++.h>
using namespace std;

int main() {
  string S;
  int K;
  cin >> S >> K;
  vector<string> V;

  for (int i = 0; i < S.size(); i++) {
    for (int j = 1; j <= K; j++) {
      V.push_back(S.substr(i, j));
    }
  }

  sort(V.begin(), V.end());
  V.erase(unique(V.begin(), V.end()), V.end());

  cout << V.at(K - 1) << "\n";
}

Measured memory_bytes: 1660
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>
#include <sstream>
#include <fstream>

#define all(c) (c).begin(), (c).end()
#define iter(c) __typeof((c).begin())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define tr(c, i) for (iter(c) i = (c).begin(); i != (c).end(); ++i)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)

using namespace std;
typedef long long unsigned int ll;

int main() {
  int A, B;
  cin >> A >> B;
  if ((A * B) % 2 == 0) {
    cout << "No" << endl;
  }
  else {
    cout << "Yes" << endl;
  }
  return 0;
}


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

int main() {
  int n;
  cin>>n;
  float x;
  vector<float> v(n);
  for(int i=0;i<n;i++) cin>>v[i];
  sort(v.begin(),v.end(),greater<int>());
  while(v.size()!=1) {
    int i=v.size()-1;
    x=v[i]-(v[i]-v[i-1])/2;
    v.pop_back();
    v.pop_back();
    v.push_back(x);
  }
  cout<<v[0];
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define vi vector<int>
#define pb push_back
#define i197 1000000007
#define MAX_N 200002
using namespace std;

typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<Pii,int> Piii;
typedef pair<int,ll> Pil;
typedef pair<ll,ll> Pll;
typedef pair<string,int> Psi;
typedef pair<Psi,int> Psii;

const int inf=1000000000;
struct edge{
	int myc,to,c,cost;
};
struct pos{
	int to,cost,color;
};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};

int main() {
	int n,d;
	int s[160];
	rep(i,160)s[i]=i*i;
	cin>>n>>d;
	int x[10][10];
	rep(i,n){
		rep(j,d)cin>>x[i][j];
	}
	int res=0;
	rep(i,n){
		rep(j,n){
			int dis=0;
			rep(k,d){
				dis+=(x[i][k]-x[j][k])*(x[i][k]-x[j][k]);
			}
			bool flg=false;
			rep(k,159){
				if(s[k+1]==dis)flg=true;
			}
			if(flg)res++;
		}
	}
	cout<<res/2<<endl;
	return 0;
}


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

using namespace std;

int main(int argc, const char *argv[])
{
  int n;
  cin >> n;
  vector<int> a(n);

  bool approved = true;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] % 2 == 0 && a[i] % 3 != 0 && a[i] % 5 != 0) {
      approved = false;
      break;
    }
  }

  cout << (approved ? "APPROVED" : "DENIED") << "\n"; 
  
  return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
#include <algorithm>

using namespace std;

typedef long long LL;
LL dig(LL x) {
	int t = 0;
	do {
		x /= 10;
		t ++;
	} while( x );
	return t;
}

int main() {
	LL n;
//	printf("%d %d %d %d %d %d", dig(0), dig(9), dig(10000), dig(10000000000), dig(123123), dig(12371289));
	scanf("%lld", &n);
	LL s = sqrt(n)+1, ans = (1<<29)+1000;
	for ( LL i = s; i >= 1; i -- ) {
		if(((LL)i*(n/i)) == n) {
			ans = min(ans, max(dig(i), dig(n/i)));
		}
	}
	printf("%lld\n", ans);
	
	return 0;
}

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

using namespace std;

#define endl '\n'
#define fi first
#define se second
#define MOD(n,k) ( ( ((n) % (k)) + (k) ) % (k))
#define forn(i,n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define pb(x) push_back(x)

typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<ii> vii;

const int MX = 100005;
int n, x[MX], k, res = 2e9;

int main () {
	ios_base::sync_with_stdio(0); cin.tie(0);
	
	cin >> n >> k;
	for (int i = 0; i < n; i++) cin >> x[i];

	for (int i = 0; i + k - 1 < n; i++) {
		int a = x[i], b = x[i+k-1];

		if (!a || !b || a < 0 == b < 0)
			res = min(res, max(abs(a), abs(b)));
		else
			res = min(res, 2 * (abs(a) + abs(b)) - max(abs(a), abs(b)));
	}

	cout << res << endl;

	return 0;
}

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

int main() {
  vector<int> groupA = {1,3,5,7,8,10,12};  
  vector<int> groupB = {4,6,9,11};
  bool same =false;
  int x,y;
  cin>>x>>y;
  
  for(int i=0; i<7; i++)
  {
    if (x == groupA.at(i))
  {
      for(int j=i+1; j<7;j++)
      {if(y ==groupA.at(j)){same = true; break;}}
    }
  }
  if(!same){
    for(int i=0; i<4; i++)
  {
    if (x == groupB.at(i))
  {
      for(int j=i+1; j<4;j++)
      {if(y ==groupB.at(j)){same = true; break;}}
    }
  }
  }
  if(same){
  cout<<"Yes"<<endl;}
  else{cout<<"No"<<endl;}
  
  
}


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

using namespace std;


#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define all(i) (i).begin(), (i).end()
#define rall(i) (i).begin(), (i).end(), greater<int>()

#define int long long

#define elif else if
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fst first
#define sec second

template <typename T>
void print(T x)
{
	std::cout << x <<" " ;
}


template <typename T>
void println(T x)
{
	std::cout << x << "\n";
}

signed main(void) {
	int N;
	cin >> N;
	vector <int> A ;
	A.resize(N);

	rep(i, N) {
		cin >> A[i];
	}
	
	double ans = 0;

	rep(i, N) {
		ans += 1 / double(A[i]);
	}
	ans = 1 / ans;
	cout << setprecision(10) << ans << endl;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define MOD 1000000007

int main(){
  int n;
  cin>>n;
  vector<int> v(n);
  for(int i=0;i<n;i++) cin>>v[i];
  sort(v.rbegin(),v.rend());
  int a=0,b=0;
  for(int i=0;i<n;i++){
    if(i%2) b+=v[i];
    else a+=v[i];
  }
  cout<<a-b<<endl;
  return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
n = int(input())
h = list(map(int, input().split()))
print(len([i for i, x in enumerate(h) if (i == 0) or ((i == 1) and (h[0] <= h[i])) or ((i > 1) and (max(h[:i]) <= h[i]))]))


Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rep1(i,n) for(int i=1; i<=(n); ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define sz(v) (int)v.size()
#define pb push_back

using namespace std;
int n;
int main(){
    cin >> n;
    vector<long> A(n);
    rep(i,n) cin >> A[i];
    rep(i,n) A[i] -= i+1;
    sort(ALL(A));
    long mid = A[n/2];
    
    long sum = 0;
    rep(i,n) sum += abs(A[i]-mid);
    cout << sum << endl;
    
    
}


Measured memory_bytes: 1792
/*
 * Author: .-O_O-.
 */
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include<bits/stdc++.h>
using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define pb push_back
#define vi vector<int>
#define rep0(a,b) for(int a=0;a<b;a++)
#define rep1(a,b) for(int a=1;a<=b;a++)
#define repp(a,b,c) for(int a=b;a<c;a++)
#define in insert
#define len length()
#define si size()
#define lb lower_bound
#define ub upper_bound
#define beg begin()
#define en end()
#define f first
#define s second
#define pr(a) cout<<a
#define pr2(a,b) cout<<a<<" "<<b<<"\n"
#define nx cout<<"\n"
#define int long long
// void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
                                                     
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]"<<endl;}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define deb(x...)
#endif
const ll mod = 1000000007;
const ll maxn = 100005;
const ll mm = 1e+18;
void solve()
{
    int n;
    cin>>n;
    int mx=0;
    int f=0;
    rep0(i,n){
        int x,y;
        cin>>x>>y;
        if(x==y){
            f++;
        }
        else{
            mx=max(mx,f);
            f=0;
        }
    }
    mx=max(mx,f);
    if(mx>=3) cout<<"Yes";
    else cout<<"No";
}
signed main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t=1;
    //cin>>t;
    rep1(_i,t){
        //cout<<"Case #"<<_i<<": ";
        solve();
        //nx;
    }
    return 0;
}

Measured memory_bytes: 3656
n, a, b = map(int, input().split())
mod = 10 ** 9 + 7


def comb_mod(n, k, mod):
    numerator = 1
    denominator = 1
    for i in range(k):
        numerator = (numerator * (n - i)) % mod
        denominator = (denominator * (i + 1)) % mod

    return ((numerator % mod) * (pow(denominator, mod - 2, mod) % mod)) % mod


n_c_a = comb_mod(n, a, mod)
n_c_b = comb_mod(n, b, mod)

result = ((pow(2, n, mod) - 1) % mod - n_c_a - n_c_b) % mod
print(result)


Measured memory_bytes: 3316
import java.util.*;

public class Main {
  static int[] list;
    public static void main(String[] args) throws Exception{
      Scanner sc = new Scanner(System.in);
      int a = sc.nextInt();
      int b = sc.nextInt();
      int x = a + b;
      int y = a - b;
      int z = a * b;
      System.out.println(Math.max(x,Math.max(y,Math.max(z,y))));
      
    }
}

Measured memory_bytes: 21844
#include "bits/stdc++.h"

using namespace std;
typedef long long ll;
#define rep(i, j, n) for (int i = j; i < n; i++)
#define out(ans) cout << ans << endl;
const long long mod = 1e9 + 7;

ll gcd(ll a, ll b) {
  while(1) {
    if(a < b) swap(a, b);
    if(!b) break;
    a %= b;
  }
  return a;
}

int main(){

  ll n,X;cin>>n>>X;
  ll x[n+10];rep(i,0,n)cin>>x[i];

  sort(x,x+n);

  if(n==1){
    out(abs(X-x[0]));
    return 0;
  }

  ll l=0,r=0;
  ll num;
  if(X<=x[0])num=x[0]-X;
  else if(x[n-1]<=X)num=X-x[n-1];
  else{
    rep(i,0,n-1){
      if(x[i]<=X&&X<=x[i+1]){
        l=X-x[i];
        r=x[i+1]-X;
        num=gcd(l,r);
        break;
      }
    }
  }

  rep(i,0,n-1){
    num=gcd(num,x[i+1]-x[i]);
  }

  out(num);

  return 0;
}


Measured memory_bytes: 1024
A, B, C, K = list(map(int, input().split()))

ans=0
if A<=K:
    ans+=A
    K-=A

else:
    ans+=K
    print(ans)
    exit()

if B<=K:
    K-=B

else:
    print(ans)
    exit()

if C<=K:
    ans-=C
    print(ans)

else:
    ans-=K
    print(ans)


Measured memory_bytes: 9216
def f_c():
    n, m = map(int, input().split())
    l = []
    for _ in range(m):
        _, *s = map(lambda x: int(x)-1, input().split())
        sb = 0
        for si in s:
            sb |= 1<<si
        l.append(sb)
    *p, = map(int, input().split())

    a, c = 0, 0
    for i in range(1<<n):
        for j, sb in enumerate(l):
            if bin(i&sb).count("1")%2!=p[j]:
                break
            else:
                c += 1
        a = a+1 if c==m else a
        c = 0
    print(a)

if __name__ == "__main__":
    f_c()


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int (i)=0;i<(n);i++)
#define REP(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define MOD 1000000007
#define fcout cout << fixed << setprecision(15)
#define int long long
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)?"YES":"NO")
typedef long long ll;
typedef pair<int, int> P;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a/gcd(a,b)*b;};
int mod(int a,int b){return (a+b-1)/b;};
template<typename A, size_t N, typename T>
void Fill(A(&array)[N],const T &val){std::fill((T*)array,(T*)(array+N),val);}
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;};
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;};



signed main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    
    int n;
    cin >> n;
    set<string> st;
    rep(i, n) {
        string s;
        cin >> s;
        st.insert(s);
    }
    cout << st.size() << endl;
    return 0;
}

Measured memory_bytes: 19200
#include <bits/stdc++.h>
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define all(x) x.begin(), x.end()

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
typedef long long ll;

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

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

void solve(){	
  string str;cin>>str;
  int sz = (int)str.size() - 1;
  if(str[sz] == 's')
    str += "es";
  else
    str +="s";
  cout<<str<<endl;
}

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  //int t; cin >> t;
  //while(t--) solve();
  //
  solve();
  return 0;
}


Measured memory_bytes: 3664
#include <iostream>
#include <cstdio>

#define CMAX 30
#define MAXN 500
#define MAX 250000000

using namespace std;

typedef long long ll;

ll A[MAXN+1][MAXN+1];
ll B[CMAX+1][CMAX+1];
ll C[3][CMAX+1];
ll D[3][CMAX+1];
int N, CN;



int main()
{
  ll ans = MAX;

  cin >> N >> CN;
  for ( int i = 1; i <= CN; ++i ) for ( int j = 1; j <= CN; ++j ) scanf("%ld", &B[i][j]);
  for ( int i = 1; i <= N; ++i ) for ( int j = 1; j <= N; ++j ) scanf("%ld", &A[i][j]);
  for ( int i = 1; i <= N; ++i ) {
    for ( int j = 1; j <= N; ++j ) ++C[(i+j)%3][A[i][j]];
  }


  /*
  cout << "cmatrix\n";
  for ( int i = 0; i < 3; ++i ) {
    for ( int j = 1;  j <= CN; ++j ) cout << C[i][j] << " ";
    cout << endl;
  }
  */

  for ( int i = 0; i < 3; ++i ) {
    for ( int j = 1; j <= CN; ++j ) {
      for ( int k = 1; k <= CN; ++k ) D[i][j] += C[i][k]*B[k][j];
    }
  }

  /*
  cout << "dmatrix\n";

  for ( int i = 0; i < 3; ++i ) {
    for ( int j = 1;  j <= CN; ++j ) cout << D[i][j] << " ";
    cout << endl;
  }
  */

  for ( int i = 1; i <= CN; ++i ) {
    for ( int j = 1; j <= CN; ++j ) {
      if ( j == i ) continue;
      for ( int k = 1; k <= CN; ++k ) {
        if ( k == i || k == j ) continue;
        ll tmp = D[0][i]+D[1][j]+D[2][k];
        if ( ans > tmp ) ans = tmp;
      }
    }
  }

  cout << ans << endl;
}


Measured memory_bytes: 2808
n=int(input())
l=list(map(int,input().split()))
a,b=max(l),min(l)
if a-b>1:
    ans="No"
elif a==b:
    if a<=n//2 or a==n-1:
        ans="Yes"
    else:
        ans="No"
else:
    if 2*a-n<=l.count(b)<=b:
        ans="Yes"
    else:
        ans="No"
print(ans)

Measured memory_bytes: 13964
#include<bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i = 0; i < N; i++)
#define cou(x) cout << x << endl
using vi = vector<int>;
using vvi = vector<vi>;

int main() {

    cin.tie(0);
    ios::sync_with_stdio(false);
        
    int N, X, Y;
    cin >> N >> X >> Y;
    vvi graph(N);
    graph[X - 1].push_back(Y - 1);
    graph[Y - 1].push_back(X - 1);

    rep(i, N - 1) {
        graph[i].push_back(i + 1);
        graph[i + 1].push_back(i);
    }
    queue<int> seen;

    vi dist(N, -1);
    vi cnt(N, 0);

    rep(i, N) {
        seen.push(i);
        dist[i] = 0;
        while (seen.size()) {
            int v = seen.front(); seen.pop();
            for (auto x : graph[v]) {
                if (dist[x] != -1) continue;
                seen.push(x); dist[x] = dist[v] + 1;
                cnt[dist[x] - 1]++;
            }
        }
        dist.assign(N, -1);
    }
    rep(i, N - 1) {
        cou(cnt[i] / 2);
    }
}

Measured memory_bytes: 384
#include <stdio.h>

int main(void)
{
  int a, b, c;
  scanf("%d %d %d", &a, &b, &c);

  if(a, b, c >= 0 && a, b, c <= 100)
  {
    if (a < b && b < c)
    {
      printf("Yes\n");
    }
    else
    {
      printf("No\n");
    }
  }
}



Measured memory_bytes: 2120
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;



int main(){
  int h,w,m;
  cin >> h >> w >> m;
  vi a(h),b(w);
  vector<P> c;
  rep(i,m){
    int x,y;
    cin >> x >> y;
    a[x-1]++;b[y-1]++;
    c.push_back(make_pair(x,y));
  }
  int m1=0,m2=0,n1=0,n2=0;
  vi p(h,0),q(w,0);
  rep(i,h) m1=max(m1,a[i]);
  rep(i,h) if(m1==a[i]){p[i]++;n1++;}
  rep(i,w) m2=max(m2,b[i]);
  rep(i,w) if(m2==b[i]){q[i]++;n2++;}
  sort(c.begin(),c.end());
  //cout << n1 << n2 << "\n";
  ll ans=n1;
  ans*=n2;
  for(auto k:c){
    //cout << ans;
    if(p[k.first-1]==1 and q[k.second-1]==1) ans-= 1;
  }
  if(ans==0) cout << m1+m2-1;
  else cout << m1+m2; 
  return 0;
}

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

using namespace std ;
int main () {
int N , M ; cin >> N >> M ;
vector <int > cnt (M , 0);
for ( int i = 0; i < N ; ++ i ) {
int K; cin >> K ;
for ( int j = 0; j < K ; ++ j ) {
int A; cin >> A ; --A ;
++ cnt [ A ];
}
}
int ans = 0;
for ( int i = 0; i < M ; ++ i ) {
if ( cnt [ i ] == N ) {
++ ans ;
}
}
cout << ans << endl ;
}

Measured memory_bytes: 3612
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>

#include <complex>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#define debug(x) cerr << #x << " = " << (x) << endl;


#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 100010


int main(){
  string s;

  cin >> s;

  string t[20] = {"KIHBR","AKIHBR","AKIHABR","AKIHBAR",
                "AKIHABAR","AKIHBAR","AKIHBRA","AKIHABARA",
                "KIHABR","KIHABAR","KIHABARA","KIHBAR", "KIHBARA",
                "KIHBAR", "KIHBARA", "KIHBRA", "KIHBR"};
  
  for(int i=0;i<17;i++){
    if(t[i] == s){
      puts("YES");
      return 0;
    }
  }

  puts("NO");
  return 0;
}



Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        System.out.println(fib(n, new int[n + 1]));
    }

    private static int fib(int n, int[] dp) {
        if (dp[n] != 0) {
            return dp[n];
        }
        int r = 0;
        if (n == 0 || n == 1) {
            r = 1;
        } else {
            r = fib(n - 1, dp) + fib(n - 2, dp);
        }
        dp[n] = r;
        return r;
    }
}

Measured memory_bytes: 26260
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repo(i,n) for(int i = 1; i < (int)(n); i++)
#define pb push_back
#define np next_permutation
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define pi acos(-1.0)
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }
//cout << fixed << setprecision (20);   小数点以下2０桁まで
//intの最大値2147483647 ≒ 2×10^9
//long longの最大値9223372036854775807 ≒ 9×10^18
//'0'+=16;        で大文字に
//'大文字'+=32;    で小文字に
//s[i]-'0'でchar文字→int数に;
//string s = to_string(int数);
//int n = stoi(string文字列)
//実行時間制約2秒では２×10^8回くらいまで計算できる


int main() {
  int n,k;
  string s;
  cin >> n>>s>>k;
  
  char x=s[k-1];
  rep(i,n){
    if(s[i]!=x)s[i]='*';
  }
  
  cout << s << endl;
  
}


Measured memory_bytes: 256
#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <climits>
#include <cassert>

using namespace std;

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

#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

#define F first
#define S second
typedef vector<bool> vb;

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

int main()
{
	map<string, pii> table;
	int m; cin >> m;
	REP(_, m) {
		string name;
		int lb, ub;
		cin >> name >> lb >> ub;
		table[name] = make_pair(lb, ub);
	}
	stack<vb> stack;
	int n; cin >> n;
	REP(_, n) {
		string input; cin >> input;
		vb term(256, false);
		if('0' <= input[0] && input[0] <= '9') {
			int val = toInt(input);
			term[val % 256] = true;
			stack.push(term);
		} else {
			vb a, b;
			switch(input[0]) {
				case '+':
					b = stack.top(); stack.pop(); a = stack.top(); stack.pop();
					REP(i, 256) {
						REP(j, 256) {
							if (a[i] && b[j]) {
								term[(i + j) % 256] = true;
							}
						}
					}
					stack.push(term);
					break;
				case '-':
					b = stack.top(); stack.pop(); a = stack.top(); stack.pop();
					REP(i, 256) {
						REP(j, 256) {
							if (a[i] && b[j]) {
								term[(i - j + 256) % 256] = true;
							}
						}
					}
					stack.push(term);
					break;
				case '*':
					b = stack.top(); stack.pop(); a = stack.top(); stack.pop();
					REP(i, 256) {
						REP(j, 256) {
							if (a[i] && b[j]) {
								term[(i * j) % 256] = true;
							}
						}
					}
					stack.push(term);
					break;
				case '/':
					b = stack.top(); stack.pop(); a = stack.top(); stack.pop();
					REP(i, 256) {
						REP(j, 256) {
							if (a[i] && b[j]) {
								if (j == 0) goto ERROR;
								term[(i / j) % 256] = true;
							}
						}
					}
					stack.push(term);
					break;
				default:
					FOR(i, table[input].F, table[input].S + 1) {
						term[i] = true;
					}
					stack.push(term);
					break;
			}
		}
	}
	cout << "correct" << endl;
	return 0;
ERROR:
	cout << "error" << endl;
	return 0;
}

Measured memory_bytes: 1260