akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
const int N = 190, M = 16;
int n, m, sum[N][N], dp[M + 1][N][N][N];
char a[N][N];
int main()
{
    scanf("%d%d", &n, &m);
    for(int x = 0; x < n; x++)
        scanf("%s", a[x]);
    for(int x = 0; x < n; x++)
        for(int y = 0; y < m; y++)
            sum[x + 1][y + 1] = sum[x + 1][y] + sum[x][y + 1] - sum[x][y] + (a[x][y] == '#' ? 1 : 0);
    for(int x = 0; x <= n; x++)
    {
        for(int ya = 0; ya <= m; ya++)
        {
            for(int yb = ya + 1; yb <= m; yb++)
            {
                int lo = x, hi = n + 1;
                while(lo + 1 < hi)
                {
                    int mid = lo + hi >> 1;
                    int black = sum[x][ya] - sum[mid][ya] - sum[x][yb] + sum[mid][yb];
                    if(black == 0 || black == (mid - x) * (yb - ya))
                        lo = mid;
                    else
                        hi = mid;
                }
                dp[0][x][ya][yb] = lo;
            }
        }
    }
    for(int t = 1; t <= M; t++)
    {
        for(int x = 0; x <= n; x++)
        {
            for(int ya = 0; ya <= m; ya++)
            {
                for(int yb = ya + 1; yb <= m; yb++)
                {
                    int &d = dp[t][x][ya][yb];
                    d = dp[t - 1][dp[t - 1][x][ya][yb]][ya][yb];
                    for(int y = ya + 1; y < yb; y++)
                    {
                        int e = dp[t - 1][x][ya][y];
                        if(d >= e)
                            break;
                        d = max(d, min(e, dp[t - 1][x][y][yb]));
                    }
                }
            }
        }
    }
    int ans = M;
    for(int t = 0; t <= M; t++)
        if(dp[t][0][0][m] >= n)
            ans = min(ans, t);
    printf("%d\n", ans);
    return 0;
}

Measured memory_bytes: 455296
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef map<int, int> mii;
typedef map<char,int> mci;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<pair<int,int>> vii;
typedef vector<char> vc;
typedef vector<vc> vcc;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define F first
#define S second
#define in insert
#define mina(a,b) (a)=min((a),(b));
#define maxa(a,b) (a)=max((a),(b));
const int INF = 1e9 + 7;
void solve(){
    int n,m; cin>>n>>m;
    vii v(n);
    for(int i = 0; i < n; i++) {
        int a,b; cin>>a>>b;
        v[i]={a,b};
    }
    sort(all(v));
    ll ans=0;
    for(int i = 0; i < n; i++) {
        ans+=(ll)min(m,v[i].S)*(ll)v[i].F;
        m-=min(m,v[i].S);
    }
    cout<<ans;
}
int main(){
    int T=1;
    //cin>>T;
    for(int i = 0; i < T; i++) solve(); 
}

Measured memory_bytes: 1024
S = gets.chomp
T = gets.chomp

match = false

(S.size - T.size).downto(0) do |i|
  str = S[i...(i + T.size)]
  match = 0.upto(T.size - 1).all? {|j| str[j] == '?' || str[j] == T[j] }

  if match
    0.upto(T.size - 1) do |j|
      S[i + j] = T[j]
    end
    break
  end
end

if match
  puts S.gsub('?', 'a')
else
  puts 'UNRESTORABLE'
end

Measured memory_bytes: 1788
D, G = map(int, input().split())
p = [0 for _ in range(D)]
c = [0 for _ in range(D)]
for i in range(D):
    p[i], c[i] = map(int, input().split())

score_sum = [0 for _ in range(D)]
for i in range(D):
    score_sum[i] = (i + 1) * 100 * p[i] + c[i]


def calc(i, g):
    if g <= 0:
        return 0
    if i == D:
        return 10 ** 7
    
    x = calc(i + 1, g)
    y = p[i] + calc(i + 1, g - score_sum[i])
    upper_sum = sum(score_sum[i + 1:])
    if 100 * (i + 1) * p[i] + upper_sum < g:
        z = 10 ** 7
    else:
        z = sum(p[i + 1:]) + max(0, (g - upper_sum + 100 * (i + 1) - 1) // (100 * (i + 1)))
    return min(x, y, z)


def solve():
    ans = calc(0, G)
    print(ans)


if __name__ == '__main__':
    solve()


Measured memory_bytes: 3064
using System;
using System.Collections.Generic;
using System.Linq;
using static Input;

public class Prog
{
    public struct Pair { public int x, y; public Pair(int x, int y) { this.x = x; this.y = y; } }
    public static void Solve()
    {
        int H = NextInt();
        int W = NextInt();
        string[] map = Enumerable.Range(0, H).Select(v => NextString()).ToArray();
        int sum = map.Sum(v => v.Count(u => u == '.'));
        int min = 0;
        int[] dx = { 1, 0, -1, 0 };
        int[] dy = { 0, 1, 0, -1 };
        int[,] cost = new int[H, W];
        for (int i = 0; i < H; i++)
            for (int j = 0; j < W; j++) cost[i, j] = INF;
        cost[0, 0] = 1;
        Queue<Pair> Q = new Queue<Pair>();
        Q.Enqueue(new Pair(0, 0));
        while (Q.Count() != 0)
        {
            Pair p = Q.Dequeue();
            for (int i = 0; i < 4; i++)
            {
                int nx = p.x + dx[i];
                int ny = p.y + dy[i];
                if (nx < 0 || W <= nx || ny < 0 || H <= ny) continue;
                if (map[ny][nx] == '.' && cost[p.y, p.x] + 1 < cost[ny, nx])
                {
                    cost[ny, nx] = cost[p.y, p.x] + 1;
                    Q.Enqueue(new Pair(nx, ny));
                }
            }
        }
        Console.WriteLine(Math.Max(sum - cost[H - 1, W - 1], -1));
    }
    public static void Main()
    {
        var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
        Console.SetOut(sw);
        Solve();
        Console.Out.Flush();
    }
}

public class Input
{
    public const long MOD = 1000000007;
    public const int INF = 1000000007;
    private static Queue<string> q = new Queue<string>();
    private static void Confirm() { if (q.Count == 0) foreach (var s in Console.ReadLine().Split(' ')) q.Enqueue(s); }
    public static int NextInt() { Confirm(); return int.Parse(q.Dequeue()); }
    public static long NextLong() { Confirm(); return long.Parse(q.Dequeue()); }
    public static string NextString() { Confirm(); return q.Dequeue(); }
    public static double NextDouble() { Confirm(); return double.Parse(q.Dequeue()); }
    public static int[] LineInt() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
    public static long[] LineLong() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
    public static string[] LineString() { return Console.ReadLine().Split(' ').ToArray(); }
    public static double[] LineDouble() { return Console.ReadLine().Split(' ').Select(double.Parse).ToArray(); }
}


Measured memory_bytes: 13396
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repr(i, n) for(int i = ((int)(n) - 1); i >= 0; i--)
#define repn(i, n) for(int i = 1; i <= (int)(n); i++)
#define reprn(i, n) for(int i = ((int)(n)); i > 0; i--)
#define all(x) (x).begin(), (x).end()
#define LARGE_PRIME_NUM 1000000007
typedef long long ll;

#include <iostream>
#include <array>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <numeric>
#include <cmath>

using namespace std;

int main() {
	int a, p;
	cin >> a >> p;
	cout << (a * 3 + p) / 2 << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll mod=1000000007;
vector<ll> a[200007],b(200007,0);

void dfs(ll n,ll v,ll p)
{
    b[n]+=v;
    for(auto k:a[n])
    {
        if(k!=p)
        {
            dfs(k,b[n],n);
        }
    }
}

int main() {
	ll i,j,k,l,m,n,t;
	t=1;
	while(t--)
	{
		cin>>n>>m;
		for(i=0;i<n-1;i++)
		{
			cin>>j>>k;
			a[j].push_back(k);
			a[k].push_back(j);
		}
		while(m--)
		{
		    cin>>j>>k;
		    b[j]+=k;
		}
		dfs(1,0,0);
		for(i=1;i<=n;i++)
		{
		    cout<<b[i]<<' ';
		}
	}
	return 0;
}

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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> Pi;
typedef vector<ll> Vec;
typedef vector<int> Vi;
typedef vector<string> Vs;
typedef vector<P> VP;
typedef vector<vector<ll>> VV;
typedef vector<vector<int>> VVi;

#define REP(i, a, b) for(ll i=(a); i<(b); i++)
#define PER(i, a, b) for(ll i=(a); i>=(b); i--)
#define rep(i, n) REP(i, 0, n)
#define per(i, n) PER(i, n, 0)
const ll INF=1e18+18;
const ll MAX=100005;
const ll MOD=1000000007;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define YES(n) cout << ((n) ? "YES" : "NO") << endl;
#define ALL(v) v.begin(), v.end()
#define rALL(v) v.rbegin(), v.rend()
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a,b)
#define Each(a,b) for(auto &a :b)
#define REPM(i, mp) for (auto i = mp.begin(); i != mp.end(); ++i)
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define dbgmap(mp) cerr << #mp << ":"<<endl; for (auto i = mp.begin(); i != mp.end(); ++i) { cerr << i->first <<":"<<i->second << endl;}
#define dbgarr(n,m,arr) rep(i,n){rep(j,m){cerr<<arr[i][j]<<" ";}cerr<<endl;}
#define dbgdp(n,arr) rep(i,n){cerr<<arr[i]<<" ";}cerr<<endl;
#define dbgmint(n,arr) rep(i,n){cerr<<arr[i].x<<" ";}cerr<<endl;
#define out(a) cout<<a<<endl
#define out2(a,b) cout<<a<<" "<<b<<endl
#define vout(v) rep(i,v.size()){cout<<v[i]<<" ";}cout<<endl
#define Uniq(v) v.erase(unique(v.begin(), v.end()), v.end())
#define fi first
#define se second

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

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

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

// vector
template<typename T>
ostream &operator<<(ostream &s, const vector<T> &v) {
    int len=v.size();
    for(int i=0; i<len; ++i) {
        s<<v[i];
        if(i<len-1) s<<"	";
    }
    return s;
}

// 2 dimentional vector
template<typename T>
ostream &operator<<(ostream &s, const vector<vector<T> > &vv) {
    int len=vv.size();
    for(int i=0; i<len; ++i) {
        s<<vv[i]<<endl;
    }
    return s;
}

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

    ll n,k;
    cin>>n>>k;
    ll ans=0;
    while(n){
        n /= k;
        ans++;
    }
    cout<<ans<<endl;
    return  0;
}


Measured memory_bytes: 256
import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    val sc: Scanner = new Scanner(System.in)
    val n: Int = sc.nextLine.toInt


    def go(n: Int, acc: Double): Double = {
      if (n == 0) acc
      else {
        val Array(value, unit) = sc.nextLine.split(" ")
        if (unit == "JPY") go(n - 1, acc + value.toDouble)
        else go(n - 1, acc + value.toDouble * 380000.0)
      }
    }

    println(go(n, 0.0))
  }
}

Measured memory_bytes: 25648
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)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $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!{
        a: u64,
        b: u64,
    }
    println!("{}", if b % a == 0 { a + b } else { b - a });
}


Measured memory_bytes: 4352
S = input()
T = input()

min_ch = 9999999
for i in range(0, len(S) - len(T) + 1):
    s = S[i:i+len(T)]
    ch = 0
    for j in range(len(T)):
        if T[j] != s[j]:
            ch += 1

    if ch < min_ch:
        min_ch = ch

print(min_ch)


Measured memory_bytes: 8980
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
const int N=1e5+5;
typedef long long ll;
ll dp[N][3];
int main(){
    int n;
    scanf("%d",&n);
    int a[3];
    for(int i=1;i<=n;i++){
        for(int j=0;j<3;j++) scanf("%d",a+j);
        dp[i][0]=max(dp[i-1][1],dp[i-1][2])+a[0];
        dp[i][1]=max(dp[i-1][0],dp[i-1][2])+a[1];
        dp[i][2]=max(dp[i-1][0],dp[i-1][1])+a[2];
    }
    ll ans=0;
    for(int i=0;i<3;i++) ans=max(ans,dp[n][i]);
    cout<<ans;
}


Measured memory_bytes: 2560
n,k = map(int,input().split())

ls = [[int(x) for x in input().split()] for _ in range(n)]

ls = sorted(ls,key= lambda x:x[0])

cnt = 0
now = 0

for i in range(n):
    cnt += ls[i][1]
    now = ls[i][0]
    if cnt >= k:
        print(now)
        exit()
    

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

using namespace std;

#define rep(i,n) for (int i = 0; i < (n); ++i)
#define INF 1e9
#define MOD 1000000007

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

void solve() {
  int n, m;
  cin >> n >> m;
  int d[n][n] = {}; // important!!
  rep(i,m) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    d[a][b] = 1;
    d[b][a] = 1;
  }

  vector<int> v(n);
  rep(i,n) v[i] = i;
  int ans = 0;

  do {
    bool b = true;
    if (v[0] != 0) break;
    for(int i = 0; i < n - 1; i++) {
      if (!d[v[i]][v[i+1]]) {
        b = false;
      }
    }
    if(b) ans++;
  } while (next_permutation(v.begin(), v.end()));

  cout << ans << endl;
}

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

Measured memory_bytes: 256
// In The Name Of God
#include<bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define mp make_pair
#define pb push_back
#define int long long
#define ll long long
#define for2(a,b,c) for(int (a) = (b); (a) < (c); (a)++)
#define setp cout << fixed << setprecision(15)
#define endl "\n"
#define minit(a,b) a = min(a,b)
#define maxit(a,b) a = max(a,b)
#define PII pair<int,int>
#define Vec vector<int>
#define error(x) cerr << #x << " = " << (x) << endl;
#define all(x) (x).begin() , (x).end()



int32_t main(){
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    vector<int> v;
    int n; cin >> n;
    vector<int> a(n);
    for2(i,0,n) cin >> a[i],v.pb(a[i]);
    sort(all(v));
    int med = (n-1)/2;
    for2(i,0,n){
        if(v[med] >= a[i]) cout << v[med+1] << endl;
        else cout << v[med] << endl;
    }
    return 0;
}


Measured memory_bytes: 5488
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int K = Integer.parseInt(sc.next());   
        int[] h = new int[N];
        long[] sum = new long[N];
        
        h[0] = Integer.parseInt(sc.next());
        h[1] = Integer.parseInt(sc.next());
        sum[0] = 0;
        sum[1] = (max(h[0], h[1]) - min(h[0], h[1]));  
        
        if(N > 2) {
            for(int i = 2; i < N; i++) {
                h[i] = Integer.parseInt(sc.next());
                long saitan = 0;
                for(int j = i - K; j < i; j++) {
                    if(j < 0) {
                        j = 0;
                    }
                    if(j == 0 || j == i - K) {
                        saitan = max(h[i], h[j]) - min(h[i], h[j]) + sum[j];
                        continue;
                    }
                    
                    if(max(h[i], h[j]) - min(h[i], h[j]) + sum[j]  < saitan) {
                        saitan = max(h[i], h[j]) - min(h[i], h[j]) + sum[j];
                    }
                }
                sum[i] = saitan;
            }
        }
        System.out.println(sum[N-1]);
    }
    
    public static int max(int a, int b) {
        if(a >= b) {
            return a;
        }else {
            return b;
        }
    }
    
    public static int min(int a, int b) {
        if(a >= b) {
            return b;
        }else {
            return a;
        }
    }
}

Measured memory_bytes: 48620
import math
n,d=map(int,input().split())
x=[]
cnt=0

for i in range(n):
    x.append(list(map(int,input().split())))

for i in range(n):
    for j in range(i+1,n):
        dis=0
        for k in range(d):
            dis+=(x[i][k]-x[j][k])**2
            
        if math.sqrt(dis)==int(math.sqrt(dis)):
            cnt+=1
        
print(cnt)

Measured memory_bytes: 9048
/* # */

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <deque>
#include <map>
#include <iomanip>
#include <functional>
#include <cassert>
#include <cstdio>
#include <cmath>
#include <cstdint>
#include <cstring>
//#pragma warning(disable:4996)

using namespace std;


/** Type Define **/
typedef long long int           ll;
typedef pair<int, int>          pii;
typedef pair<ll, ll>            pll;
typedef vector<string>          vs;
typedef vector<bool>            vb;
typedef vector<int>             vi;
typedef vector<long long>		vl;
typedef vector<vi>              vvi;
typedef vector<vl>				vvl;
typedef vector<char>            vch;
#define		it(x)  x.begin() 
#define		all(x)  x.begin(), x.end()
#define		pb(x)   push_back(x)
constexpr int           inf = 0x3f3f3f3f;
constexpr long long 	INF = 9123456789123456789;
constexpr long long     MOD = 1000000007LL;
/*************************************************/

void sol() {
	ll a, b, n;
	// f(x + B) = f(x) so, actually f(x) = floor(Ax/B)
	cin >> a >> b >> n;
	
	ll x = min(b-1, n);
	cout << (a*x)/b <<'\n';
}              
               
int main() {
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(12);
    cin.tie(nullptr);
	sol();
    return 0;
}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
 
using namespace std;
 
#define x first
#define y second
#define mp make_pair
#define pb push_back
#define sqr(a) ((a) * (a))
#define sz(a) int(a.size())
#define all(a) a.begin(), a.end()
#define forn(i, n) for(int i = 0; i < int(n); i++) 
#define fore(i, l, r) for(int i = int(l); i < int(r); i++)
 
typedef long long li;
typedef long double ld;
typedef pair<int, int> pt;
 
template <class A, class B> ostream& operator << (ostream& out, const pair<A, B> &a) {
	return out << "(" << a.x << ", " << a.y << ")";
}
 
template <class A> ostream& operator << (ostream& out, const vector<A> &v) {
	out << "[";
	forn(i, sz(v)) {
		if(i) out << ", ";
		out << v[i];
	}
	return out << "]";
}
 
mt19937 rnd(time(NULL));
 
const int INF = int(1e9);
const li INF64 = li(1e18);
const int MOD = INF + 7;
const ld EPS = 1e-9;
const ld PI = acos(-1.0);

const int N = 510;

int n, k;
int a[N];
 
bool read() {
	if (scanf("%d%d", &n, &k) != 2)
		return false;
	forn(i, n) scanf("%d", &a[i]);
	return true;
}

int ans;

void check(int m) {
	vector<int> cur;
	forn(i, n) cur.pb(a[i] % m);
	sort(all(cur));
	int suml = 0, sumr = 0;
	forn(i, n) sumr += (m - cur[i]) % m;
	//cerr << m << endl;
	forn(i, n) {
		//cerr << suml << " " << sumr << endl;
		if (suml % m == sumr % m && max(suml, sumr) <= k) {
			ans = max(ans, m);
			return;
		}
		suml += cur[i];
		sumr -= (m - cur[i]) % m;
	}
	if (suml % m == 0 && suml <= k)
		ans = max(ans, m);
}

void solve() {
	ans = 0;
	int sum = 0;
	forn(i, n) sum += a[i];
	for (int i = 1; i * i <= sum; i++) {
		if (sum % i == 0) {
			check(i);
			check(sum / i);
		}
	}
	printf("%d\n", ans);
}
 
int main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
 
	int tt = clock();
 
#endif
 
	cerr.precision(15);
	cout.precision(15);
	cerr << fixed;
	cout << fixed;
	
#ifdef _DEBUG
	while (read()) {	
#else
	if (read()) {
#endif
		solve();
 
#ifdef _DEBUG
	cerr << "TIME = " << clock() - tt << endl;
	tt = clock();
#endif
 
	}
}

Measured memory_bytes: 256
import sys

n=int(input())

if n==1:
    print("Yes")
    print(2)
    print("1 1")
    print("1 1")
    exit()

def sss(n):
    if n==2:
        return [[1,2],[1,3],[2,3]]
    N=n*(n+1)//2
    ss=[[i for i in range(N-n+1,N+1)]]
    j=N-n+1
    for i in sss(n-1):
        i.append(j)
        ss.append(i)
        j+=1

    return ss
    

ok=0
for i in range(1000):
    if n == (i+2)*(i+3)//2:
        ok=1
        k = i+3
        gen = k-1
        break

# n= k+1 C 2


if ok==0:
    print("No")

else:
    print("Yes")
    print(k)
    
    for i in sss(gen):
        print(*([len(i)]+i))




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

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

	int K, X;
	cin >> K >> X;
	for (int i = max(X - K+1, -1000000); i < X + K; i++) {
		cout << i << " ";
	}
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vb = vector<bool>;
using vc = vector<char>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using pii = pair<int, int>;
#define fix10 cout << fixed << setprecision(10);
#define rep(i,n) for(int i=0; i<(int)(n);i++)
#define MOD 1000000007

int main(){
  int n;
  string s;
  cin >> n >> s;
  int ans = 1;
  rep(i,n-1){
    if(s.at(i) != s.at(i+1)) ans++;
  }
  cout << ans << endl;
}


Measured memory_bytes: 512
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result


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

odd = 0
even = 0
for i in range(N):
    if A[i] % 2 == 0:
        even += 1
    else:
        odd += 1
        
ans = 0
for i in range(P, odd+1, 2):
    ans += cmb(odd, i)
    
ans *= 2 ** even

print(ans)

Measured memory_bytes: 9268
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, c) for (int i = 0; i < (int)c; i++)
#define all(v) v.begin(), v.end()
using ll = long long;
using P = pair<int, int>;
const int inf = 1000000000; //10^9
const ll MOD = 1e9 + 7;
//加算代入演算子は+=！！！！！
//int 2^31 10^9まで
int main()
{
    int n, m, x;
    cin >> n >> m >> x;
    vector<vector<int>> vec(n, vector<int>(m));
    vector<int> c(n);
    rep(i, n)
    {
        cin >> c[i];
        rep(j, m)
        {
            cin >> vec[i][j];
        }
    }

    int ans = inf;
    for (int bit = 0; bit < (1 << n); bit++)
    { //2^n繰り返す
        int cost = 0;
        vector<int> study(m);
        rep(i, n)
        {
            if (bit & (1 << i))
            { //1が立っていればホニャララ
                cost += c[i];
                rep(j, m)
                {
                    study[j] += vec[i][j];
                }
            }
        }
        bool ok = true;
        rep(i, m)
        {
            if (study[i] < x)
                ok = false;
        }
        if (ok)
            ans = min(ans, cost);
    }
    if (ans == inf)
        cout << -1 << endl;
    else
        cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3624
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdio>
using namespace std;

int main()
{
    int N;
    cin>>N;
    vector<double> x(N), y(N);
    for (int i=0; i<N; i++)
        cin>>x[i]>>y[i];

    auto check = [&](double ox, double oy, double r)
    {
        bool ok = true;
        for (int i=0; i<N; i++)
            if (hypot(ox-x[i], oy-y[i]) > r+1e-6)
                ok = false;
        return ok;
    };

    double ans = 1e10;
    for (int a=0; a<N; a++)
    for (int b=0; b<a; b++)
    for (int c=0; c<b; c++)
    {
        double a2 = (x[b]-x[c])*(x[b]-x[c])+(y[b]-y[c])*(y[b]-y[c]);
        double b2 = (x[c]-x[a])*(x[c]-x[a])+(y[c]-y[a])*(y[c]-y[a]);
        double c2 = (x[a]-x[b])*(x[a]-x[b])+(y[a]-y[b])*(y[a]-y[b]);
        double dena = a2*(b2+c2-a2);
        double denb = b2*(c2+a2-b2);
        double denc = c2*(a2+b2-c2);
        if (dena+denb+denc != 0.0)
        {
            double ox = (x[a]*dena+x[b]*denb+x[c]*denc)/(dena+denb+denc);
            double oy = (y[a]*dena+y[b]*denb+y[c]*denc)/(dena+denb+denc);
            double r = hypot(ox-x[a], oy-y[a]);
            if (check(ox, oy, r))
                ans = min(ans, r);
        }
    }
    for (int a=0; a<N; a++)
    for (int b=0; b<a; b++)
    {
        double ox = (x[a]+x[b])/2;
        double oy = (y[a]+y[b])/2;
        double r = hypot(ox-x[a], oy-y[a]);
        if (check(ox, oy, r))
            ans = min(ans, r);
    }

    printf("%.10f\n", ans);
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int64_t i = 0; i < (n); ++i)
#define repe(i, n) for (int64_t i = 0; i <= (n); ++i)
#define reps(i, s, n) for (int64_t i = (s); i < (n); ++i)
#define repse(i, s, n) for (int64_t i = (s); i <= (n); ++i)
#define repr(i, n) for (int64_t i = (n); i >= 0; --i)
const int64_t inf = (int64_t)1e18;
const int64_t mod = (int64_t)1e9 + 7;

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

  int64_t N, M, C; cin >> N >> M >> C;
  vector<int64_t> b(M);
  rep(i, M) cin >> b[i];
  
  int64_t ans = 0;
  rep(i, N) {
    int64_t tmp = 0;
    rep(j, M) {
      int64_t a; cin >> a;
      tmp += a * b[j];
    }
    if (tmp + C > 0) ans++;
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
	int n;
	int count = 0;
	scanf("%d",&n);
	int arr[n];
	for(int i = 0; i < n; i++)scanf("%d",&arr[i]);
	for(int i = 0; i < n-1; i++){
		int min = i;
		for(int j = i; j < n; j++){
			if(arr[min] > arr[j]){
				min = j;
			}
		}
		if(arr[i] > arr[min]){
			int temp = arr[i];
			arr[i]   = arr[min];
			arr[min]= temp;
			count++;
		}
	}
	printf("%d",arr[0]);
	for(int i = 1; i < n; i++)printf(" %d",arr[i]);
	printf("\n%d\n",count);
	return 0;
}


Measured memory_bytes: 2044
using System;
using System.Linq;

namespace ABC131_C
{
    class Program
    {
        static void Main(string[] args)
        {
            var ABCD = Console.ReadLine().Split().Select(long.Parse).ToArray();
            var A = ABCD[0];
            var B = ABCD[1];
            var C = ABCD[2];
            var D = ABCD[3];

            var fac1 = B / C - (A - 1) / C;
            var fac2 = B / D - (A - 1) / D;
            var fac3 = B / lcm(new long[2] { C, D }) - (A - 1) / lcm(new long[2] { C, D });

            Console.WriteLine(B - (A - 1) - fac1 - fac2 + fac3);
        }

        private static long lcm(long[] t)
        {
            var lcm = t[0];
            for (int i = 1; i < t.Length; i++)
            {
                lcm = lcm / gcd(lcm, t[i]) * t[i];
            }

            return lcm;
        }

        public static long gcd(long x, long y)
        {
            return (y == 0) ? x : gcd(y, (x % y));
        }
    }
}


Measured memory_bytes: 13396
#include <cstdio>
#include <iostream>
using namespace std;
int cnt;
void selection_sort(int *A,int N){
  for(int i=0;i<N;i++){
    int minj=i;
    for(int j=i;j<N;j++){
      if(A[j]<A[minj])minj=j;
    }
    if(i!=minj)cnt++;
    int temp=A[i];
    A[i]=A[minj];
    A[minj]=temp;
   
  }
}
int main(){
  int N;
  int A[101];
  cin >> N;
  for(int i=0;i<N;i++)cin >> A[i];
  selection_sort(A,N);
  for(int i=0;i<N;i++){
    printf("%d",A[i]);
    if(i!=N-1)printf(" ");
  }
  cout << endl;
  cout << cnt << endl;
  return 0;
}

Measured memory_bytes: 3224
import java.util.*;

class Main
{

    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int migi = sc.nextInt();
        int hidari = sc.nextInt();
        int a = 0;
        if (migi < hidari) {
            a = hidari - migi;
        } else if (hidari<migi)
        a=migi-hidari;{
        
        
            System.out.println(a);
        }

    }
}



Measured memory_bytes: 26360
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <fstream>
using namespace std;

int main()
{
	const string w[] = { "apple", "peach" };
	const string t[] = { "_ALE_", "_PEH_" };
//	cut here before submit 
//	freopen("testcase.applepeach", "r", stdin);
	string str = "";
	int i;

	while (getline (cin, str ) ){
		if (str.empty() ){
			break;
		} // end if
		vector <int> dot;
		vector <int> camma;
		int i;
//		str = ' ' + str + ' ';

		while ( str.find ('.') != string::npos ){
			dot.push_back ((int)str.find('.') );
			str.replace (str.find('.'), 1, " " );
		} // end while
		while ( str.find (',') != string::npos ){
			camma.push_back ((int)str.find(',') );
			str.replace (str.find (','), 1, " " );
		} // end while

		// replace words
		for (i = 0; i < 2; ++i){
			while (str.find(w[i]) != string::npos ){
				str = str.replace (str.find(w[i]), w[i].length(),t[i] );
			} // end while
		} // end for
/*
		while (str.find(w[1]) != string::npos ){
			str = str.replace (str.find(w[1]), w[1].length(),t[1] );
		} // end while
*/
		// transform words
		for (i = 0; i < 2; ++i){
			while (str.find(t[i]) != string::npos ){
				str = str.replace (str.find(t[i]), t[i].length(),w[1-i] );
			} // end while
		} // end for

/*
		while (str.find(t[0]) != string::npos ){
			str = str.replace (str.find(t[0]), t[0].length(),w[1] );
		} // end while

		while (str.find(t[1]) != string::npos ){
			str = str.replace (str.find(t[1]), t[1].length(),w[0] );
		} // end while
*/
		if (!dot.empty() ){
			for (i = 0; i < dot.size(); ++i){
				str = str.replace (dot[i], 1, "." );
			} // end for
		} // end if
		if (!camma.empty() ){
			for (i = 0; i < camma.size(); ++i){
				str = str.replace (camma[i], 1, "," );
			} // end for
		} // end if

//		cout << str.substr(1, str.length() - 2) << endl;	
		cout << str << endl;
	} // end loop
		
	return 0;
}

Measured memory_bytes: 0
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <iomanip>
#include <complex>
#include <bitset>

using namespace std;

#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
#if defined(_MSC_VER) || __cplusplus > 199711L
#define aut(r,v) auto r = (v)
#else
#define aut(r,v) __typeof(v) r = (v)
#endif
#define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it)
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset(m,v,sizeof(m))
#define INF 0x3f3f3f3f3f3f3f3fLL
#define SIZE 8080
#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()

typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
typedef pair<int,ll> pill; typedef pair<ll,int> plli; 
typedef pair<double, int> pdi;
template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }
typedef complex<double> P;
ll MOD=1e9+7;
typedef ll Weight;
struct Edge {
	int src, dst;
	Weight weight;
};
bool operator < (const Edge &e, const Edge &f) {
	return e.weight != f.weight ? e.weight > f.weight : // !!INVERSE!!
	e.src != f.src ? e.src < f.src : e.dst < f.dst;
}
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
int N;

int main(){
	cin>>N;
	bool minus=false;
	vector<ll> data,data2;
	ll sum=0;
	char x='+';
	for(int i=0;i<N;i++){
		if(i!=0)cin>>x;
		ll a;
		cin>>a;
		if(x=='-')a=-a;
		data.pb(a);
	}
	for(int i=0;i<N;i++){
		ll a = data[i];
		if(a<0){
			if(data[i-1]<0){
				minus=true;
			}
		}
		if(minus){
			sum+=abs(a);
		}else{
			if(a<0){
				data2.pb(sum);
				sum = 0;
				data2.pb(a);
			}else{
				sum+=a;
			}
		}
	}
	if(sum!=0)data2.pb(sum);
	/*rep(i,data2.size())cout<<data2[i]<<" ";
	cout<<endl;*/
	ll hoge[114514]={0};
	ll hoge2[114514]={0};
	hoge[0]=data2[0];
	ll X=data2[0];
	for(int i=1;i<data2.size();i++){
		hoge[i]=hoge[i-1]+data2[i];
		X = X+abs(data2[i]);
	}
	ll ans = hoge[data2.size()-1];
	for(int i=0;i<data2.size();i++){
		hoge2[i]=X;
		X-=abs(data2[i]);
		
	}
	//cout<<ans<<endl;
	int now=1;
	while(now<data2.size()){
		ans = max(ans,hoge[now]-data2[now+1]+hoge2[now+2]);
		now = now+2;
	}
	cout<<ans<<endl;
}



















Measured memory_bytes: 2932
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int x1 = scanner.nextInt();
        int x2 = scanner.nextInt();
        int x3 = scanner.nextInt();
        int x4 = scanner.nextInt();
        int x5 = scanner.nextInt();

        scanner.close();

        if (x1 == 0) {
            System.out.println(1);
            return;
        }
        if (x2 == 0) {
            System.out.println(2);
            return;
        }
        if (x3 == 0) {
            System.out.println(3);
            return;
        }
        if (x4 == 0) {
            System.out.println(4);
            return;
        }
        if (x5 == 0) {
            System.out.println(5);
            return;
        }
    }
}


Measured memory_bytes: 35796
#include <assert.h>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <functional>
#include <iostream>
#include <string>
#include <array>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <bitset>
typedef long long ll;
typedef unsigned long long ull;

using namespace std;

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

  int H, W, N;
  cin >> H >> W >> N;

  int a[10001] = {};
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }
  int ai = 0;
  int colors[100][101] = {};
  for (int i = 0; i < H; i++) {
    if (i % 2 == 0) {
      for (int j = 0; j < W; j++) {
        if (a[ai] == 0) {
          ai++;
        }
        colors[i][j] = ai + 1;
        a[ai]--;
      }
    } else {
      for (int j = W - 1; j >= 0; j--) {
        if (a[ai] == 0) {
          ai++;
        }
        colors[i][j] = ai + 1;
        a[ai]--;
      }
    }
  }
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      cout << colors[i][j];
      if (j < W - 1) {
        cout << " ";
      }
    }
    cout << endl;
  }
  return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <functional>
using namespace std;

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

    int l[n*2];
    for(int i = 0; i < n*2; i++){
        cin >> l[i];
    }

    sort(l, l+n*2);
    
    int sum = 0;
    for(int i = 0; i < n; i++){
        sum += (min(l[n*2-i*2-1], l[n*2-i*2-2]));
    }
    cout << sum << endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<map>
using namespace std;
long h,w,a,b,c,d,D[10]={0,1,1,0,-1,1,-1,-1},cnt[10],i,j;
map<pair<long,long>,long>m;
main()
{
	cin>>h>>w>>a;
	for(*cnt=(h-2)*(w-2);cin>>a>>b;i++)
		for(j=0;j<9;)
			if((c=a+D[j])>1&(d=b+D[++j])>1&c<h&d<w)cnt[c=m[make_pair(c,d)]++]--,cnt[c+1]++;
	for(i=0;i<10;i++)cout<<cnt[i]<<endl;
}

Measured memory_bytes: 56448
#include<stdio.h>
long long R=1,C=1,H[2000010],N[2000010],ca,cb,a,b;
//評価関数（いまはMIN）
int hyouka(int a,int b){
  if(C<b)return 1;
  if(C<a||b==0)return 0;
  return N[H[a]]<N[H[b]]?1:0;
}
//挿入関数
void hin(long long a){
  int i=C++;
  for(N[H[0]=R]=a;hyouka(0,i/2);i/=2)H[i]=H[i/2];
  H[i]=R++;
}
//取り出す関数
int hout(){
  int rt=H[1],i,j=2,k=H[--C];
  for(i=1;hyouka(i,C);i=j)H[i]=H[j=i*2+1-hyouka(i*2,i*2+1)];
  H[j/2]=k;
  return rt;
}
int main(){
  int n,i,c[200010];
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%lld",&a);
    c[R]=1;
    hin(a);
  }
  for(i=1;i<n;i++){
    ca=c[H[1]];
    a=N[hout()];
    cb=c[H[1]];
    b=N[hout()];//printf("%d %d\n",ca,cb);
    c[R]=cb;
    if(a*2>=b)c[R]+=ca;
    hin(a+b);
  }
  printf("%d\n",c[H[1]]);
  return 0;
}


Measured memory_bytes: 6656
import fractions
N, K = map(int, input().split())
A = list(map(int, input().split()))
# 最小的に最小値が並ぶことになる、最小値スタートが最短
start = A.index(1)
d1 = start - 0
d2 = N-1 - start
n = 0
m = 0
print(fractions.math.ceil((len(A)-1)/(K-1)))

Measured memory_bytes: 15840
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,x=0,y=0,ba=0;
  while(cin >> n){
    if(n == 0) break;
    int taro[n],hanako[n];
    for(int i=0;i<n;i++){
      cin >> taro[i];
    }
    
    for(int i=0;i<n-1;i++){
      for(int j=0;j<n-i-1;j++){
	if(taro[j] > taro[j+1]){
	  swap(taro[j],taro[j+1]);
	}
      }
    }
    x=0;
    y=0;
    for(int i=1;i<=2*n;i++){
      if(i != taro[x]){
	hanako[y]=i;
	y++;
      } else{
	x++;
      }
    }
    
    /* for(int i=0;i<n;i++){
       cout << hanako[i] << endl;
       }*/
    x=n;
    y=n;
    ba=0;
    while(1){
      if(x == 0 || y == 0) break;
      for(int i=0;i<n;i++){
	if(taro[i] > ba){
	  ba=taro[i];
	  taro[i]=0;
	  x--;
	  i=n;
	} else if(i == n-1){
	  ba=0;
	}
      }
      if(x == 0 || y == 0) break;
      for(int j=0;j<n;j++){
	if(hanako[j] > ba){
	  ba=hanako[j];
	  hanako[j]=0;
	  y--;
	  j=n;
	} else if(j == n-1){
	  ba=0;
	}
      }
    }

    int tasum=0,hasum=0;
    for(int i=0;i<n;i++){
      if(taro[i] != 0){
	tasum++;
      }
      if(hanako[i] != 0){
	hasum++;
      }
    }
    cout << hasum << endl;
    cout << tasum << endl;
  }
  return 0;
}

Measured memory_bytes: 3068
#include <algorithm>
#include <iostream>
#include <string>
#include <random>
#include <cassert>
#include <cstring>
#include <chrono>
#include <set>
#include <map>

using namespace std;

typedef long long ll;

int main()
{
  int n;
  cin >> n;
  vector<ll> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < n - 1; ++i) a[i + 1] += a[i];

  ll result = a.back();

  int l = 0;
  int r = 0;
  for (int m = 1; m < n; ++m) {
    while (l + 1 < m) {
      cerr << l << endl;
      ll curValue = abs(2 * a[l] - a[m]);
      ll nextValue = abs(2 * a[l + 1] - a[m]);
      if (curValue >= nextValue) l++; else break;
    }
    r = max(r, m + 1);
    if (r >= n - 1) break;
    while (r + 1 < n - 1) {
      ll curValue = abs((a[n - 1] - a[r]) - (a[r] - a[m]));
      ll nextValue = abs((a[n - 1] - a[r + 1]) - (a[r + 1] - a[m]));
      if (curValue >= nextValue) r++; else break;
    }
    vector<ll> x = {a[l], a[m] - a[l], a[r] - a[m], a[n - 1] - a[r]};
    sort(x.begin(), x.end());
    result = min(result, x.back() - x[0]);
  }
  cout << result << endl;

  return 0;
}


Measured memory_bytes: 1792
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<map>
#include<string>
#define ls k<<1,l,mid
#define rs k<<1|1,mid+1,r
#define mp(x,y) make_pair(x,y)
#define r(x) read(x)
#define rrr(x,y,z) read(x);read(y);read(z)
#define FOR(i,l,r) for(int i=l;i<=r;i++)
using namespace std;
typedef long long LL;
typedef pair<int,int> pt;
const int N=1e6+5;
const int M=2e3+5;
const int INF=0x7fffffff;
const int mod=1e9+7;
const int bb=18;
const double eps=1e-10;
const double pi=acos(-1);
int n,m;
char str[N];
int f[N];
map<string,int> mm;
vector<string> v;
template<class T>
inline void read(T &x)
{
    char c; x=1;
    while((c=getchar())<'0'||c>'9') if(c=='-') x=-1;
    T res=c-'0';
    while((c=getchar())>='0'&&c<='9') res=res*10+c-'0';
    x*=res;
}
int main()
{
    r(n);
    string ss;
    FOR(i,1,n){
        cin>>ss;
        mm[ss]++;
    }
    map<string,int>::iterator it;
    int maxx=0;
    for(it=mm.begin();it!=mm.end();it++){
        maxx=max(maxx,it->second);
    }
    for(it=mm.begin();it!=mm.end();it++){
        if(it->second==maxx) v.push_back(it->first);
    }
    sort(v.begin(),v.end());
    for(string s:v) cout<<s<<endl;
    return 0;
}


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

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] nkq = Console.ReadLine().Split(' ').Select(str => int.Parse(str)).ToArray();
            int n = nkq[0];
            int k = nkq[1];
            int q = nkq[2];
            List<int> answerdPlayers = new List<int>();
            int[] answerCounter = new int[n];
            for(int i = 0; i < q; i++)
            {
                answerCounter[int.Parse(Console.ReadLine()) - 1]++;
            }

            // Console.WriteLine(string.Join(" ", answerCounter));

            for (int i = 0; i < n; i++)
            {
                Console.WriteLine(answerCounter[i] > (q - k) ? "Yes" : "No");
            }
            
        }

    }
}


Measured memory_bytes: 17884
#include <bits/stdc++.h>
using namespace std;
string s[100],ts;
int num[100],ans=0;
bool flag=false;
int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>s[i]>>num[i];
	}
	cin>>ts;
	for(int i=0;i<n;i++){
		if(flag) ans+=num[i];
		if(s[i]==ts) flag=true;
	}
	cout<<ans;
	return 0;
}

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

int main() {
  string s;
  cin>>s;
  int n = s.size();

  s += 'R';

  int ans[n];
  for(int i=0; i<n; i++) ans[i]=0;

  int rcount = 1;
  int lcount = 0;
  bool now_r = true;
  int tmp = 0;
  for(int i=1; i<n+1; i++) {
    if(now_r) {
      if(s[i]=='R') rcount++;
      else {
        ans[i] += rcount/2;
        ans[i-1] += (rcount+1)/2;
        rcount = 0;
        lcount = 1;
        tmp = i;
        now_r = false;
      }
    }
    else {
      // if(s[i]=='L' && i!=n-1) lcount++;
      if(s[i]=='L') lcount++;
      else {
        // if(i==n-1) lcount++;
        ans[tmp] += (lcount+1)/2;
        ans[tmp-1] += lcount/2;
        lcount = 0;
        rcount = 1;
        now_r = true;
      }
    }
  }

  for(int i=0; i<n-1; i++) {
    cout<<ans[i]<<' ';
  }
  cout<<ans[n-1]<<endl;


  return 0;
}

Measured memory_bytes: 4148
#define _USE_MATH_DEFINES
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <cstdio>
#include <complex>
#include <numeric>
#include <string.h>
#include <random>
#include <cmath>
#define rep(i,n) for (int i = 0; i < (int)n; i++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<pi, pi> pp;
typedef pair<ll, ll> pl;
double PI = 3.141592653589793238462643383279;
const double EPS = 1e-9;
const ll MOD = 1000000007;
const int inf = 1 << 30;
const ll linf = 1LL << 60;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    cout << (N-1)/2 << endl;
}

Measured memory_bytes: 256
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset

using namespace std;

int main() {

	int count = 0;
	char n[4],m[4] ;


	cin >> n >> m;

	for (int i=0; i < 3;i++) {
		if (n[i] == m[i])count++;
	}

	cout << count << endl;

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <stdio.h>
#include <vector>
#include <stack>
#include <queue>
#define N 500000
#define NIL 2000000001
using namespace std;

int n;

void swap(int *,int *);
void maxHeapify(int [],int);
void buildMaxHeap(int []);

int main(){
	int heap[N];
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>heap[i];
	}
	buildMaxHeap(heap);
	for(int i=1;i<=n;i++){
		cout<<" "<<heap[i];
	}
	cout<<endl;
	return 0;
}

void maxHeapify(int a[],int i){
	int l=2*i;
	int largest;
	int r=2*i+1;
	if( l <= n && a[l]>a[i]) largest=l;
	else largest=i;

	if(r<=n && a[r]>a[largest]) largest=r;

	if(largest!=i){
		swap(&a[i],&a[largest]);
		maxHeapify(a,largest);
	}
}

void buildMaxHeap(int a[]){
	for(int i=n/2;i>=1;i--) maxHeapify(a,i);
}


void swap(int *a,int *b){
	int w=*a;
	*a=*b;
	*b=w;
}

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

int main() 
{
	int antenas[5];
	
	for(int i = 0;i<5;i++)
	{
		cin >> antenas[i];
	}
	
	int k;
	cin >> k;
	
	for(int i = 0;i < 4;i++)
	{
		for(int j = i + 1;j < 5;j++)
		{
			if(antenas[j] - antenas[i] > k)
			{
				cout << ":(";
				return 0;
			}
		}
	}
	
	cout << "Yay!";
	
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define SZ(x) ((int)x.size())
#define FOR(i,a,b) for (int i=a;i<=b;++i)
#define FORD(i,a,b) for (int i=a;i>=b;--i)
using namespace std;
typedef long long LL;
typedef pair<int,int> pa;
typedef vector<int> vec;
void getint(int &v){
    char ch,fu=0;
    for(ch='*'; (ch<'0'||ch>'9')&&ch!='-'; ch=getchar());
    if(ch=='-') fu=1, ch=getchar();
    for(v=0; ch>='0'&&ch<='9'; ch=getchar()) v=v*10+ch-'0';
    if(fu) v=-v;
}
int w,h,A,B,n,m,tmp1[1000010],ts,tmp2[1000100],re[500010],ans[1111][1111];
bool cmp(int x,int y){
	return (re[x]>re[y]);
}
int main(){
	cin>>h>>w>>A>>B;
	n=h,m=w;
	FOR(i,1,n){
		FOR(j,1,m)
			if ((i<=B)^(j<=A)) printf("1"); else printf("0");
		puts("");
	}
	return 0;
}

Measured memory_bytes: 1280
n = int(input())

as_ = map(int, input().strip().split())


def color(rate):
    if rate < 400:
        return 0
    elif rate < 800:
        return 1
    elif rate < 1200:
        return 2
    elif rate < 1600:
        return 3
    elif rate < 2000:
        return 4
    elif rate < 2400:
        return 5
    elif rate < 2800:
        return 6
    elif rate < 3200:
        return 7
    else:
        return 8


colors = [0] * 8
num_expert = 0
for a in as_:
    c = color(a)
    if c == 8:
        num_expert += 1
    else:
        colors[c] += 1

num_colors = len([True for c in colors if c > 0])
min_colors = max(num_colors, 1)
max_colors = num_colors + num_expert


print(min_colors, max_colors)


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

using namespace std;
#define MAXN 200000
#define MOD 1000000007
#define rint register int
#define gc() getchar()
inline int read(rint ans = 0, rint sgn = ' ', rint ch = gc())
{
	for(; ch < '0' || ch > '9'; sgn = ch, ch = gc());
	for(; ch >='0' && ch <='9';(ans*=10)+=ch-'0', ch = gc());
	return sgn-'-'?ans:-ans;
}
struct D{int x,y; D(){} D(int _x, int _y){x=_x,y=_y;}}A[MAXN+5], S[MAXN+5]; int f[MAXN+5], s[MAXN+5], n;
inline bool cmpx(D a, D b){return a.x^b.x?a.x<b.x:a.y<b.y;} inline bool cmpy(D a, D b){return a.y^b.y?a.y<b.y:a.x<b.x;}
int main()
{
	n = read(); for(rint i = 1; i <= n; A[i].x = read(), A[i].y = read(), i++); sort(A+1,A+n+1,cmpy); for(rint i = 1; i <= n; A[i].y = i, i++); sort(A+1,A+n+1,cmpx); for(rint i = 1; i <= n; A[i].x = i, i++);
	for(rint i = 1, w = 0; i <= n; S[i].y = w = max(w,A[i].y), i++); for(rint i = n, w = n; i; S[i].x = w = min(w,A[i].y), i--); sort(S+1,S+n+1,cmpy); S[n+1].x = S[n+1].y = n+1, f[0] = s[0] = 1;
	for(rint i = 1, j = 0; i <= n+1; f[i] = s[i-1]+MOD-(j?s[j-1]:0), f[i]<MOD?:f[i]-=MOD, s[i] = s[i-1]+f[i], s[i]<MOD?:s[i]-=MOD, i++) for(; j<i&&S[j].y<S[i].x-1; j++); printf("%d\n",f[n+1]); return 0;
}

Measured memory_bytes: 4992