akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Numerics;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var vals = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            var a = vals[0];
            var b = vals[1];

            if (a + b == 15) Console.WriteLine("+");
            else if (a * b == 15) Console.WriteLine("*");
            else Console.WriteLine("x");
        }
    }
}


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

int main() {
  int x,y;
  while(true){
   cin >> x >> y;
   if(x==0&&y==0){
     break;
   }
   
   if(x>y){
    swap(x,y);
  }
 
  cout<< x <<" "<< y <<endl;
 }  
  return 0;
  
  
  
}


Measured memory_bytes: 2988
#include <bits/stdc++.h>
#define int long long
#pragma GCC optimize("O3,Ofast,no-stack-protector,unroll-loops,fast-math")
#pragma GCC target("avx,avx2,sse")
using namespace std;

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    string s;
    cin >> s;
    if (s[2] == s[3] && s[4] == s[5]) {
        cout << "Yes" << '\n';
    } else {
        cout << "No" << '\n';
    }

    fflush(stdout);
    return 0;
}


Measured memory_bytes: 3616
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 

#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx2,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

//namespaces
using namespace __gnu_pbds; 
using namespace std;

//MACROS
#define ld long double
#define pb push_back
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define ull unsigned long long 
#define For(i,s,e) for (int i=(s); i<(e); i++)
#define Fod(i,s,e) for (int i=(s); i>=(e); i--)
#define pii pair<ll,ll>
#define f first
#define s second
#define endl "\n"
#define all(container) container.begin(), container.end()
#define mp make_pair
#define int ll

//debug
#define TRACE
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

//Templates
template <typename T>
using ordered_set =tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <class T> ostream& operator << (ostream &os, const vector<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T> ostream& operator << (ostream &os, const set<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T, class S> ostream& operator << (ostream &os, const pair<T, S> &v) { os << v.first << ' ' << v.second; return os; }
template <class T, class S> ostream& operator << (ostream &os, const unordered_map<T, S> &v) { for (auto i : v) os << '(' << i.first << "=>" << i.second << ')' << ' '; return os; }

//globals
ll const prime1 = 304933;
ll const prime2 = 15486277;
ll const mod = 1e9+7;
ll const inf = 1e18;
ll const size_1d = 1e6 + 7;
ll const size_2d = 1e3 + 7;

//functions
ll power(ll x, ll y, ll mod = 2e18){ ll ans = 1;x %= mod;while(y){if(y&1)ans = (x * ans) % mod;x = (x * x) % mod;y >>= 1;}return ans;}
ll modInverse(ll a, ll m){ll m0 = m;ll y = 0, x = 1;if (m == 1) return 0;while (a > 1){ ll q = a / m;ll t = m;m = a % m,a = t;t = y;y = x - q * y;x = t;}if(x < 0) x += m0;return x;} 
ll gcdext(ll a,ll b,ll *x = 0, ll *y = 0){if(a == 0){*x = 0;*y = 1;return b;}ll x1,y1;ll gcd1 = gcdext(b%a,a,&x1,&y1);*x = y1 - (b/a)*x1;*y = x1;return gcd1;}
int randomize(){return (rand()%10000);} 

// CODE STARTS HERE

signed main(){
    IOS
    int n;cin >> n;
    string s,t;cin >> s >> t;
    string ans = "";
    for (int i = 0; i < n; ++i)
    {
        ans += s[i];
        ans += t[i];
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;

struct edge {
  int t, c, d;
  edge() {}
  edge(int t, int c, int d): t(t), c(c), d(d) {}
};
  
const int INF = 1 << 30;
int n, m, c, s, g;
int p[20], q[20][50], r[20][50];
int cost[20][20010];
int dis[20][110][110];
int dis2[110];
vector<edge> G[110];

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  while (cin >> n >> m >> c >> s >> g, n) {
    s--; g--;
    fill_n((int*)dis, 20*110*110, INF);
    for (int t = 0; t < c; t++) {
      for (int i = 0; i < n; i++) {
        dis[t][i][i] = 0;
      }
    }
    for (int i = 0; i < 110; i++) {
      G[i].clear();
    }
    for (int i = 0; i < m; i++) {
      int x, y, d, cc;
      cin >> x >> y >> d >> cc;
      x--; y--; cc--;
      dis[cc][x][y] = dis[cc][y][x] = min(dis[cc][x][y], d);
    }
    for (int i = 0; i < c; i++) {
      cin >> p[i];
    }
    for (int i = 0; i < c; i++) {
      for (int j = 0; j < p[i]-1; j++) {
        cin >> q[i][j];
      }
      for (int j = 0; j < p[i]; j++) {
        cin >> r[i][j];
      }
    }
    for (int i = 0; i < c; i++) {
      for (int j = 1, last = 0; j < 20010; j++) {
        cost[i][j] = cost[i][j-1]+r[i][last];
        if (last < p[i]-1 && j == q[i][last]) last++;
      }
    }
    
    for (int t = 0; t < c; t++) {
      for (int k = 0; k < n; k++) {
        for (int i = 0; i < n; i++) {
          for (int j = 0; j < n; j++) {
            if (dis[t][i][k] == INF || dis[t][k][j] == INF) continue;
            dis[t][i][j] = min(dis[t][i][j], dis[t][i][k]+dis[t][k][j]);
          }
        }
      }
    }
    for (int t = 0; t < c; t++) {
      for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
          if (i == j || dis[t][i][j] == INF) continue;
          G[i].emplace_back(j, t, dis[t][i][j]);
        }
      }
    }

    fill_n((int*)dis2, 110, INF);
    dis2[s] = 0;
    priority_queue<pii, vector<pii>, greater<pii>> que;
    que.emplace(0, s);
    while (!que.empty()) {
      int d, cur;
      tie(d, cur) = que.top(); que.pop();
      if (dis2[cur] < d) continue;
      for (edge e : G[cur]) {
        if (dis2[e.t] > dis2[cur] + cost[e.c][e.d]) {
          dis2[e.t] = dis2[cur] + cost[e.c][e.d];
          que.emplace(dis2[e.t], e.t);
        }
      }
    }
    cout << (dis2[g] == INF ? -1 : dis2[g]) << endl;
  }

  return 0;
}


Measured memory_bytes: 8128
#include <cstdio>
#include <cstring>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>

using namespace std;

int main()
{
	int n, h, a, b, ans=0;
	multiset<int> as, bs;
	scanf("%d %d", &n, &h);
	for(int i=0; i<n; i++){
		scanf("%d %d", &a, &b);
		as.insert(a);
		bs.insert(b);
	}
	auto aiend=as.end();
	aiend--;
	int amax=*aiend;
	auto itr=bs.upper_bound(amax);
	if(itr==bs.end()){
		if(h%amax==0){
			ans=h/amax;
		}else{
			ans=h/amax+1;
		}
	}else{
		while(1){
			if(bs.empty()){
				if(h%amax==0){
					ans=ans+h/amax;
				}else{
					ans=ans+h/amax+1;
				}
				break;
			}
			auto biend=bs.end();
			biend--;
			int bmax=*biend;
			if(bmax<=amax){
				if(h%amax==0){
					ans=ans+h/amax;
				}else{
					ans=ans+h/amax+1;
				}
				break;
			}else{
				h=h-bmax;
				ans=ans+1;
				bs.erase(biend);
				if(h<=0){
					break;
				}
			}

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

	return 0;

}

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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;

int main()
{
    string s;
  cin >> s;
  if(s[0] == s[2]){
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < b; i++)
#define all(v) v.begin(), v.end()
const int MOD = 1e9 + 7;
const int INF = 1e9;
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

bool g[50][50];
bool visited[50];
int n, m;

void bfs(int x) {
    queue<int> q;
    q.push(x);
    while (!q.empty()) {
        int now = q.front();
        q.pop();
        visited[now] = true;
        rep(next, 0, n) {
            if (g[now][next] && !visited[next]) {
                q.push(next);
            }
        }
    }
}

int main() {
    cin >> n >> m;
    int a[m], b[m];
    rep(i, 0, m) {
        cin >> a[i] >> b[i];
        a[i]--;
        b[i]--;
        g[a[i]][b[i]] = true;
        g[b[i]][a[i]] = true;
    }

    int ans = 0;
    rep(i, 0, m) {
        g[a[i]][b[i]] = g[b[i]][a[i]] = false;
        rep(i, 0, n) visited[i] = false;
        bfs(0);
        rep(i, 0, n) {
            if (visited[i] == false) {
                ans++;
                break;
            }
        }
        g[a[i]][b[i]] = g[b[i]][a[i]] = true;
    }

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


Measured memory_bytes: 256
#include<stdio.h>
int main(){
    int N, A[200000];
    int i;
    int max,second=0;

    scanf("%d",&N);
    scanf("%d",&A[0]);
    max = A[0];

    for(i=1;i<N;i++){
        scanf("%d",&A[i]);
        if(second < A[i]){
            if(max < A[i]){
                second = max;
                max = A[i];
            }else{
                second = A[i];
            }
        }
    }

    for(i=0;i<N;i++){
        if(A[i]==max){
            printf("%d\n",second);
        }else{
            printf("%d\n",max);
        }
    }

    return 0;
}

Measured memory_bytes: 2304
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define mp make_pair
#define PI pair<int,int>
#define For(i,l,r) for(int i=(int)(l);i<=(int)(r);i++)
#define Rep(i,r,l) for(int i=(int)(r);i>=(int)(l);i--)
#define pb push_back
#define fi first
#define se second
inline char gc(){
    static char buf[100000],*p1=buf,*p2=buf;
    return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
#define gc getchar
inline ll read(){
	ll x = 0; char ch = gc(); bool positive = 1;
	for (; !isdigit(ch); ch = gc())	if (ch == '-')	positive = 0;
	for (; isdigit(ch); ch = gc())	x = x * 10 + ch - '0';
	return positive ? x : -x;
}
inline void write(ll a){
    if(a<0){
    	a=-a; putchar('-');
	}
    if(a>=10)write(a/10);
    putchar('0'+a%10);
}
inline void writeln(ll a){write(a); puts("");}
inline void wri(ll a){write(a); putchar(' ');}
inline ull rnd(){
	return ((ull)rand()<<30^rand())<<4|rand()%4;
}
const int N=2005,inf=1e9;
int l[N],r[N],sz[N],dep[N],sum[N];
char s[N];
vector<int> v[N];
void dfs(int p,int fa){
	r[p]=0; 
	if(s[p]=='1'){sz[p]=1; sum[p]=0;}
	for(auto i:v[p])if(i!=fa){
		dep[i]=dep[p]+1; dfs(i,p); sum[p]+=sum[i]+sz[i]; r[i]+=sz[i]; l[i]+=sz[i]; sz[p]+=sz[i];
		r[p]+=r[i];
	}
	int jb=0,su=0;
	for(auto i:v[p])if(i!=fa)if(!jb||l[i]>l[jb])jb=i;
	for(auto i:v[p])if(i!=fa&&i!=jb)su+=r[i];
	if(su>=l[jb])l[p]=sum[p]%2; else l[p]=l[jb]-su;//cout<<p<<" "<<l[p]<<" "<<r[p]<<" "<<su<<" "<<jb<<endl;
}
int main(){
	//freopen("5.in","r",stdin); freopen("5.out","w",stdout);
	int n=read();
	scanf("%s",s+1);
	For(i,2,n){
		int s=read(),t=read();
		v[s].pb(t); v[t].pb(s);
	}
	int ans=inf;
	//dfs(2,0); return 0;
	For(i,1,n){
		memset(sz,0,sizeof(sz)); memset(sum,0,sizeof(sum));
		dep[i]=0; dfs(i,0);
		if(l[i]==0)ans=min(ans,sum[i]/2);
	}
	cout<<((ans==inf)?-1:ans)<<endl;
}

Measured memory_bytes: 512
import java.io.*;
import java.util.StringTokenizer;

class Line {
	int h,p,q;
	Line(int h,int p,int q) {
		this.h = h;
		this.p = p;
		this.q = q;
	}
	void printLine() {
		System.out.println(this.h+" "+this.p+" "+this.q);
	}
}

class Main {
	public static void main(String args[]) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String buf;

		try {
			while (!(buf = br.readLine()).equals("0 0 0")) {
				StringTokenizer st = new StringTokenizer(buf);
				int n = Integer.parseInt(st.nextToken());
				int m = Integer.parseInt(st.nextToken());
				int a = Integer.parseInt(st.nextToken());
				int temp = 1001;
				int r = a;

				Line lines[] = new Line[m];
				for (int i=0;i<m;i++) {
					st = new StringTokenizer(br.readLine());
					lines[i] = new Line(Integer.parseInt(st.nextToken()),Integer.parseInt(st.nextToken()),Integer.parseInt(st.nextToken()));
				}
				HeightSort(lines,m);
				for (int i=0;i<m;i++) {
					if (temp==lines[i].h&&a!=r) {
						a = r;
						continue;
					}
					a = r;
					if (a==lines[i].p) r = lines[i].q;
					else if (a==lines[i].q) r = lines[i].p;
					temp = lines[i].h;
				}
				System.out.println(r);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public static void HeightSort(Line lines[],int m) {
		for (int i=0;i<m;i++) {
			for (int j=m-1;j>i;j--) {
				if (lines[i].h<lines[j].h) {
					Line temp = new Line(lines[i].h,lines[i].p,lines[i].q);
					lines[i] = lines[j];
					lines[j] = temp;
				}
			}
		}
	}
}

Measured memory_bytes: 61628
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
const long long MAXN = 1e5+5;
vector<pair<pair<long long,long long>,long long>> points;
vector<pair<pair<long long,long long>,long long>> points2;
vector<pair<long long,pair<long long,long long>>> edges;
long long par[MAXN];
long long ans;


long long findpar(long long a){
    if(par[a] == a){
        return a;
    }
    return par[a] = findpar(par[a]);
}
void merge(long long a,long long b){
    a = findpar(a);
    b = findpar(b);
    if(a==b){
        return;
    }
    par[b] = a;
}
int main(){
    long long n;
    cin>>n;
    for(long long i=1;i<=n;i++){
        long long x,y;
        cin>>x>>y;
        points.push_back(make_pair(make_pair(x,y),i));
        points2.push_back(make_pair(make_pair(y,x),i));
    }
    sort(points.begin(),points.end());
    sort(points2.begin(),points2.end());
    for(long long i=1;i<n;i++){
        edges.push_back(make_pair(abs(points[i].first.first-points[i-1].first.first),make_pair(points[i-1].second,points[i].second)));
        edges.push_back(make_pair(abs(points2[i].first.first-points2[i-1].first.first),make_pair(points2[i-1].second,points2[i].second)));

    }
    sort(edges.begin(),edges.end());
    for(long long i=1;i<=n;i++){
        par[i] = i;
    }
    for(auto i:edges){
        long long w = i.first;
       
        long long x = i.second.first;
        long long y = i.second.second;
        
        if(findpar(x)!=findpar(y)){
            merge(x,y);
            ans+=w;
        }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 13860
import java.io.IOException;
import java.util.NoSuchElementException;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws IOException {
        try (
            BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in))) {
            FastScanner fs = new FastScanner();

            final int N = fs.nextInt();
            final int K = fs.nextInt();

            int sm = 0;
            for (int i = 0; i < N; i++) {
                int x = fs.nextInt();
                if (x < Math.abs(K - x)) sm += 2 * x;
                else sm += 2 * Math.abs(K -  x);
            }

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

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() {
        if (hasNextByte()) return buffer[ptr++];
        else return -1;
    }
    private static boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }
    public boolean hasNext() {
        while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;
        return hasNextByte();
    }
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if(b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
            throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() {
        return Double.parseDouble(next());
    }
}


Measured memory_bytes: 22100
import java.util.*;
import static java.lang.Math.*;
import java.math.BigInteger;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int n = sc.nextInt();
		
		// 計算
		String result = "No";
		for(int i = 0; i <= 100/4; i++){
		    for(int j = 0; j <= 100/7; j++){
		        if(n == 4*i + 7*j){
		            result = "Yes";
		            System.out.println(result);
		            return;
		        }
		    }
		}
		
		// 出力
		System.out.println(result);
	}
}


Measured memory_bytes: 23252
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		// game set
		int gameset = sc.nextInt();

		int[][] cardset = new int[UTRummy.CARDPAGE][UTRummy.ONECARDSET];

		// input info
		for (int i = 0; i < gameset; i++) {
			for (int j = 0; j < 2; j++) {
				for (int k = 0; k < 9; k++) {

					if (j == 0) {
						// number info input
						cardset[j][k] = sc.nextInt();
					} else {
						// color info
						String tmpcolor = sc.next();
						int intColor = 0;
						if (tmpcolor.equals("R")) {
							intColor = UTRummy.RED;
						} else if (tmpcolor.equals("G")) {
							intColor = UTRummy.GREEN;
						} else {
							intColor = UTRummy.BLUE;
						}
						// color info input
						cardset[j][k] = intColor;
					}
				}
			}

			UTRummy utr = new UTRummy();
			// getter-setter call
			utr.setCardset(cardset);
			cardset = utr.getCardset();

			//game start
			int intCount = 0;
			intCount = utr.playtheGame(cardset); // ?????????
			//game result
			if (3 <= intCount) {
				System.out.println(1);

			} else {
				System.out.println(0);
			}
		}
	}
}

class UTRummy {

	// declear
	static final int ONECARDSET = 9;
	static final int CARDPAGE = 2;

	// color
	static final int RED = 0;
	static final int GREEN = 1;
	static final int BLUE = 2;

	int[][] Cardset = new int[CARDPAGE][ONECARDSET];

	public UTRummy() {

	}

	public int[][] getCardset() {
		return Cardset;
	}

	public void setCardset(int[][] cardset) {
		this.Cardset = settingcardplay(cardset);
	}

	public int[][] settingcardplay(int[][] card) {

		for (int i = 0; i < 8; i++) {

			for (int j = 0; j < 8 - i; j++) {

				if (card[1][j] > card[1][j + 1]) {
					int temp = card[1][j];
					card[1][j] = card[1][j + 1];
					card[1][j + 1] = temp;

					int temp2 = card[0][j];
					card[0][j] = card[0][j + 1];
					card[0][j + 1] = temp2;
				}
			}
		}

		for (int i = 0; i < 8; i++) {
			for (int j = 0; j < 8 - i; j++) {
				if (card[1][j] == card[1][j + 1] && card[0][j] > card[0][j + 1]) {

					int temp = card[0][j];
					card[0][j] = card[0][j + 1];
					card[0][j + 1] = temp;

				}

			}
		}
		return card;
	}

	public int playtheGame(int[][] cardset) { // ?????????

		int intCount = 0;

		for (int i = 0; i < 7; i++) {

			for (int j = i + 1; j < 8; j++) {

				for (int k = j + 1; k < 9; k++) {
					if (cardset[1][i] == cardset[1][j] && cardset[1][j] == cardset[1][k]) {

						if (cardset[0][i] != 0 && cardset[0][i] == cardset[0][j] - 1
								&& cardset[0][i] == cardset[0][k] - 2) {

							intCount++;
							cardset[0][i] = 0;
							cardset[0][j] = 0;
							cardset[0][k] = 0;
						}
					}
				}
			}
		}

		for (int i = 0; i < 7; i++) {

			for (int j = i + 1; j < 8; j++) {

				for (int k = j + 1; k < 9; k++) {

					if (cardset[1][i] == cardset[1][j] && cardset[1][j] == cardset[1][k]) {
						if (cardset[0][i] != 0 && cardset[0][i] == cardset[0][j] && cardset[0][i] == cardset[0][k]) {

							intCount++;
							cardset[0][i] = 0;
							cardset[0][j] = 0;
							cardset[0][k] = 0;
						}
					}
				}
			}
		}
		return intCount;
	}

}

Measured memory_bytes: 28356
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = "";

		while ((line = br.readLine()) != null) {

			int n = Integer.parseInt(line.substring(0, line.indexOf(' ')));
			int m = Integer.parseInt(line.substring(line.indexOf(' ') + 1));
			if (n == 0 && m == 0)
				break;

			//
			m++;
			int[] wish = new int[m];
			for (int i = 0; i < n; i++) {
				StringTokenizer st = new StringTokenizer(br.readLine());
				for (int j = 1; j < m; j++) {
					if (st.nextToken().equals("1"))
						wish[j]++;
				}
			}
			int[] rank = new int[m];
			rank = Arrays.copyOf(wish, m);
			Arrays.sort(rank);

			//
			StringBuilder sb = new StringBuilder();
			int i1 = -1, i2 = -1;
			for (int i = m - 1; i >= 0; i--) {
				i1 = rank[i];
				if (i1 == i2)
					continue;
				for (int j = 1; j < m; j++) {
					if (wish[j] == i1)
						sb.append(j + " ");
				}
				i2 = i1;
			}
			System.out.println(sb.toString().substring(0, sb.length() - 1));
		}
	}
}

Measured memory_bytes: 30908
#include<cstdio>
#include<cstring>
#include<string>
#include<iostream>
#include<algorithm>

inline void read(int &T) {
	int x=0;bool f=0;char c=getchar();
	while(c<'0'||c>'9'){if(c=='-')f=!f;c=getchar();}
	while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
	T=f?-x:x;
}

int n,k;
bool haved[101];

int main() {
	read(n),read(k);
	for(int i=1,d;i<=k;++i) {
		read(d);
		for(int j=1,x;j<=d;++j) {
			read(x);
			haved[x]=1;
		}
	}
	int ans=0;
	for(int i=1;i<=n;++i) {
		if(!haved[i]) ++ans;
	}
	std::cout<<ans<<'\n';
	return 0;
}

Measured memory_bytes: 3632
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
#include <map>
#include <vector>

using namespace std;

void b_trick_or_treat(void) {
	int n, k;
	cin >> n >> k;
	bool* a;
	int d;
	int l;

	a = (bool*)calloc(n+1, sizeof(bool));
	for (int i = 0; i < k; i++) {
		cin >> d;
		for (int j = 0; j < d; j++) {
			cin >> l;
			a[l] = true;
		}
	}

	int cnt = 0;
	for (int i = 1; i <= n; i++) cnt = a[i] ? cnt : cnt+1;

	cout << cnt << endl;
}

int main()
{
    b_trick_or_treat();

    return 0;
}


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

#define int long long
#define forn(i,a,n) for (int i=a; i<n; i++)

int n;
int cnt[1000001];

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

	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);

	cin>>n;
	forn(i,1,n){
		forn(j,1,sqrt(n)){
			if (i*j>=n) break;
			cnt[i*j]++;
			if (i!=j && i>=sqrt(n)) cnt[i*j]++;
		}
	}
	int res=0;
	forn(i,1,n){
		res+=cnt[i];
	}
	cout<<res<<endl;
	return 0;
}

Measured memory_bytes: 11504
void main() {
	auto S = rs;
	auto res = (S.length - 1) * 9;
	res += (S[0].to!string.to!int - 1);
	if(S[1..$] == '9'.repeat(S.length - 1).array) {
		res += 1;
	}
	res.writeln;
}

// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}


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

using P = pair<int, int>;

bool check(vector<vector<int>> &g) {
    int n = g.size();
    for(int i = 0; i < n; i++) {
        int win = 0, lose = 0;
        for(int j = 0; j < n; j++) {
            if(i == j) {
                continue;
            }
            win += (g[i][j] == 1);
            lose += (g[i][j] == 0);
        }
        if(win > (n / 2) || lose > (n / 2)) {
            return false;
        }
    }
    return true;
}

int dfs(int now, vector<vector<int>> &g, vector<P> &v) {
    int n = g.size();
    int sz = v.size();
    if(now >= sz) {
        // for(int i = 0; i < n; i++) {
        //     for(int j = 0; j < n; j++) {
        //         cerr << g[i][j] << " ";
        //     }
        //     cerr << endl;
        // }
        return (check(g));
    }
    int res = 0;
    int i = v[now].first;
    int j = v[now].second;
    // cerr << i << " " << j << endl;
    if(g[i][j] == -1) {
        g[i][j] = 0;
        g[j][i] = 1;
        if(check(g)) {
            res += dfs(now + 1, g, v);
        }
        g[i][j] = 1;
        g[j][i] = 0;
        if(check(g)) {
            res += dfs(now + 1, g, v);
        }
        g[i][j] = g[j][i] = -1;
    } else {
        res += dfs(now + 1, g, v);
    }
    return res;
}

int main() {
    while(true) {
        int n, m;
        cin >> n;
        if(n == 0) {
            break;
        }
        cin >> m;
        vector<vector<int>> g(n, vector<int>(n, -1));
        for(int i = 0; i < m; i++) {
            int x, y;
            cin >> x >> y;
            g[--x][--y] = 1;
            g[y][x] = 0;
        }
        vector<P> v;
        for(int i = 0; i < n; i++) {
            for(int j = i + 1; j < n; j++) {
                // cerr << i << " " << j << endl;
                v.emplace_back(P(i, j));
            }
        }
        cout << dfs(0, g, v) << endl;
    }
}


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

#define MAX_LEN (200000)

using namespace std;

int main(int argc, char *argv[]) {
  // read inputs
  char S[MAX_LEN + 1];
  scanf("%s", S);
  int N = strlen(S);

  // solve
  long cnt_b = 0, ans = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == 'B') {
      cnt_b++;
    } else {
      ans += cnt_b;
    }
  }
  printf("%ld\n", ans);

  return 0;
}


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

int solve(vector<int> v){
int n=v.size();
int cost[n];
cost[0]=0;
cost[1]=cost[0]+abs(v[1]-v[0]);
for(int i=2;i<n;i++){
    cost[i]=min(cost[i-1]+abs(v[i]-v[i-1]),cost[i-2]+abs(v[i]-v[i-2]));
}
return cost[n-1];
}
int main() {
   int n;
   cin>>n;
   vector<int> v;
   while(n--){
       int k;
       cin>>k;
       v.push_back(k);
   }
   cout<<solve(v)<<endl;
   return 0;
}

Measured memory_bytes: 4568
#include <iostream>
#include <vector>
#include <queue>
#include <string>
#include <algorithm>
#include <utility>
#include <climits>
#include <cstring>
#include <cstdio>
#include <cmath>

using namespace std;

const int INF = 1000001000;
#define REP(var, count) for(int var=0; var<count; var++)

int D;
double V[10];

double interpolate(int n, int E) {
	double sum = 0.0;
	REP(k, D+3) {
		if ( k == n ) { continue; }
		if ( k == E ) { continue; }
		double v = V[k];
		REP(i, D+3) {
			if ( i == n ) { continue; }
			if ( i == E ) { continue; }
			if ( i == k ) { continue; }
			v *= (double)(n - i) / (double)(k - i);
		}
		
		sum += v;
	}
	
	return sum;
}

bool outlier(int E) {
	REP(i, D+3) {
		if ( i == E ) { continue; }
		double p = interpolate(i, E);
		if ( fabs( p - V[i] ) > 0.1 ) { return false; }
	}
	
	return true;
}

int main(void) {
	
	while(true) {
		cin >> D;
		if ( D == 0 ) { break; }
		
		REP(i, D+3) {
			cin >> V[i];
		}
		REP(i, D+3) {
			if ( outlier(i) ) {
				cout << i << endl;
			}
		}
	}
	
	return 0;
}



Measured memory_bytes: 3208
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using Graph=vector<vector<int>>;

int main(){
  vector<char> c(3);
  for(int i=0;i<3;i++){
    cin>>c.at(i);
  }
  sort(c.begin(),c.end());
  if(c.at(0)=='a'&&c.at(1)=='b'&&c.at(2)=='c'){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
}


Measured memory_bytes: 256
n, x = gets.split.map(&:to_i)
a = gets.split.map(&:to_i)

a.sort!
count = 0
a.each do |i|
	if 0 <= x && x < i
		puts count
		exit
	end
	x -= i
	count += 1
end
if 0 < x
	puts n-1
	exit
elsif 0 == x
	puts n
	exit
end

Measured memory_bytes: 1788
#include <stdio.h>
using namespace std;
int n, m, i, j, k, x, y, ans;
struct ren{
	int su;
}a[105];
int main(){
	scanf("%d%d", &n, &k);
	for(i=1; i<=n; i++){
		a[i].su = 0;
	}
	for(i=1; i<=k; i++){
		scanf("%d", &x);
        for(j=1; j<=x; j++){
			scanf("%d", &y);
			a[y].su++;
		}
	}
	for(i=1; i<=n; i++){
		if(a[i].su == 0) ans++;
	}
	printf("%d", ans);
	return 0;
}

Measured memory_bytes: 1728
def decrease(A,N):
    t = 0
    while(1):
        if max(A) <= N -1: break
        else:
            for i in range(N): A[i] = A[i] + 1
            i = A.index(max(A))
            A[i] = A[i] - N - 1
            t += 1
    return t


if __name__ == '__main__':
    K = int(input())
    p,q = K // 50, K % 50
    A = [i for i in range(50)]
    N = 50
    A = [a + p for a in A]
    for i in range(q):
        A = [a - 1 for a in A]
        A[i] += N + 1

    print(len(A))
    A = [str(a) for a in A]
    print(" ".join(A))

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

#define MAXX 1024

int min(int a, int b){
	return a > b ? b : a;
}
int max(int a, int b){
	return a < b ? b : a;
}

int LCS(char* a, char* b){
	int al = 0, bl = 0;
	for (int i = 0; i < MAXX; i++){
		if (a[i] == '\0') al = i;
		if (b[i] == '\0') bl = i;
		if (al != 0 && bl != 0) break;
	}
	vector< vector<int> > table(al, vector<int>(bl, 0));
	for (int i = 0; i < al + bl - 1; i++){
		for (int j = max(i - al + 1, 0); j <= min(bl - 1, i); j++){
			if (a[i - j] == b[j]){
				if (i - j == 0 || j == 0){
					table[i - j][j] = 1;
				}
				else{
					table[i - j][j] = table[i - j - 1][j - 1] + 1;
				}
			}
			else{
				if (i - j == 0 && j == 0){
					table[i - j][j] = 0;
				}
				else if (i - j == 0 && j != 0){
					table[i - j][j] = table[i - j][j - 1];
				}
				else if (i - j != 0 && j == 0){
					table[i - j][j] = table[i - j - 1][j];
				}
				else{
					table[i - j][j] = max(table[i - j - 1][j], table[i - j][j - 1]);
				}
			}
		}
	}
	return table[al-1][bl-1];
}

int main(){
	int n, dum;
	scanf("%d", &n);
	char a[MAXX], b[MAXX];
	for (int i = 0; i < n; i++){
		scanf("%s", &a);
		scanf("%s", &b);
		printf("%d\n", LCS(a, b));
	}

	return 0;
}


Measured memory_bytes: 6936
#include <bits/stdc++.h>
#include <map>
#include <set>
#include <vector>
#include <algorithm>
#include <iostream>

#include <bitset>
#include <cassert>
#include <queue>
#include <random>
#include <stack>
#include <iomanip>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)n;i++)
#define repf(i, a, b) for (int i = (int)a; i < (int)b;i++)
#define repv(x, arr) for (auto& x:arr)
#define all(v) (v).begin(), (v).end()
#define vec(name, num) vector<ll> name((num), 0);
#define mp(a,b) make_pair(a,b)
#define op(i) cout << (i) << endl;
#define F first
#define S second

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;

const ll mod = 1e9 + 7;


int main(){
    ll N, M;
    cin >> N >> M;
    ll ans = 0;
    ans = min(N, M / 2);
    N -= ans;
    M -= 2 * ans;
    ans += M / 4;
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
//#include <utility>
#include <set>
#include <iostream>
//#include <memory>
#include <string>
#include <vector>
#include <algorithm>
//#include <functional>
#include <sstream>
//#include <deque>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
//#include <cctype>
#include <cstring>
//#include <ctime>
#include <iterator>
#include <bitset>
//#include <numeric>
//#include <list>
//#include <iomanip>

#if __cplusplus >= 201103L
#include <array>
#include <tuple>
#include <initializer_list>
#include <unordered_set>
#include <unordered_map>
#include <forward_list>

#define cauto const auto&
#else

#endif

using namespace std;


namespace{
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
    v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
    stringstream ss;
    ss << f;
    ss >> t;
}


#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define F first
#define S second
#define mkp make_pair
#define RALL(v) (v).rbegin(),(v).rend()


#define MOD 1000000007LL
#define EPS 1e-8
static const int INF=1<<24;

void mainmain(){
  int n;
  cin>>n;
  ll a=LLONG_MAX-3,b=-LLONG_MAX+3,c=0;
  rep(i,n){
    ll t;
    cin>>t;
    a=min(a,t);
    b=max(b,t);
    c+=t;
  }  
  cout<<a<<" "<<b<<" "<<c<<endl;
}



}
main() try{
    mainmain();
}
catch(...){
}

Measured memory_bytes: 1172
#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<utility>
#include<iomanip>
#include<map>
#include<queue>
#include<cmath>
#include<cstdio>

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

using namespace std;
using ll =long long;
using P = pair<int,int>;

int main(int argc, const char * argv[]) {
    
    double N;
    cin >> N;
    
    double c=0;
    for(int i=1; i<=N; i++){
        if(i % 2 == 1) c++;
    }
    
    cout << fixed << setprecision(10) << c / N << endl;
    
    return 0;
}


Measured memory_bytes: 3120
def ji(tup):
  return(tup[1])


n=int(input())
a=list(map(int, input().split()))

b=[]
for i in range(1,n+1):
  b.append((i,a[i-1]))

b.sort(key=ji)
for key in range(n):
  print(b[key][0],end=" ")


Measured memory_bytes: 19156
#include<bits/stdc++.h>
using namespace std;
#define int long long
template <class Q>
void clearQueue(Q & q) {
    q = Q();
}
void solve(){
	int n;cin>>n;
	int a,b,c;
	int dp[n][3];
	for(int i=0;i<n;i++){
		cin>>a>>b>>c;
		if(i==0){
			dp[i][0]=a;
			dp[i][1]=b;
			dp[i][2]=c;
		}
		else{
			dp[i][0]=max(dp[i-1][1],dp[i-1][2])+a;
			dp[i][1]=max(dp[i-1][0],dp[i-1][2])+b;
			dp[i][2]=max(dp[i-1][1],dp[i-1][0])+c;
		}
	}
	cout<<max({dp[n-1][0],dp[n-1][2],dp[n-1][1]});
}
int32_t main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);cout.tie(NULL); 
	int T=1;
	// cin>>T;
	while(T--){
		solve();
	}
	return 0;
}

Measured memory_bytes: 5924
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#define rep(i, start, end) for (int i = (int)start; i < (int)end; ++i)
#define rrep(i, start, end) for (int i = (int)start - 1; i >= end; --i)
#define iter(i, c) for (auto i = (c).begin(); i != (c).end(); ++i)
#define riter(i, c) for (auto i = (c).rbegin(); i != (c).rend(); ++i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
using namespace std;
using ll = long long;

void dfs(const vector<vector<int>>& graph, vector<int>& color, int node, int now_color) {
    color[node] = now_color;
    rep(i, 0, graph[node].size()) {
        if (color[graph[node][i]] >= 0) {
            continue;
        }
        dfs(graph, color, graph[node][i], now_color);
    }
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vector<int> X(N), Y(N);
    rep(i, 0, N) {
        cin >> X[i] >> Y[i];
        --X[i], --Y[i];
    }
    vector<vector<int>> graph(202020);
    rep(i, 0, N) {
        graph[X[i]].push_back(Y[i] + 101010);
        graph[Y[i] + 101010].push_back(X[i]);
    }
    vector<int> color(202020, -1);
    int now_color = 0;
    rep(node, 0, 202020) {
        if (color[node] < 0) {
            dfs(graph, color, node, now_color);
            ++now_color;
        }
    }
    vector<ll> xcnt(now_color, 0), ycnt(now_color, 0);
    rep(node, 0, 202020) {
        if (node < 101010) {
            ++xcnt[color[node]];
        }
        else {
            ++ycnt[color[node]];
        }
    }
    ll ans = -N;
    rep(c, 0, now_color) {
        ans += xcnt[c] * ycnt[c];
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 14208
#include<cstdio>
#include<map>
#include<queue>
#include<vector>
#include<cstring>
#include<algorithm>
using namespace std;
const int Maxn=1e5;
const int INF=0x3f3f3f3f;
struct Edge {
    int to,cost;
    Edge(int a,int b){to=a,cost=b;}
};
vector<Edge> G[8*Maxn+5];
void AddEdge(int u,int v,int w) {
    G[u].push_back(Edge(v,w));
    G[v].push_back(Edge(u,w));
}

int dist[8*Maxn+5];
bool vis[8*Maxn+5];
void SPFA(int s) {
    memset(dist,0x3f,sizeof dist);
    memset(vis,false,sizeof vis);
    queue<int> q;

    q.push(s);
    vis[s]=true,dist[s]=0;

    while(!q.empty()) {
        int u=q.front();
        q.pop();vis[u]=false;

        for(int i=0;i<G[u].size();i++) {
            int v=G[u][i].to,w=G[u][i].cost;
            if(dist[v]>dist[u]+w) {
                dist[v]=dist[u]+w;
                if(!vis[v]) {
                    vis[v]=true;
                    q.push(v);
                }
            }
        }
    }
}

map<pair<int,int>,int> P;
int cnt;
int Getid(int u,int c) {
    if(P.find(make_pair(u,c))!=P.end())
        return P[make_pair(u,c)];
    return P[make_pair(u,c)]=++cnt;
}

int N,M;
int main() {
    #ifdef LOACL
    freopen("in.txt","r",stdin);
    freopen("out.txt","w",stdout);
    #endif
    scanf("%d %d",&N,&M);
    cnt=N;
    for(int i=1;i<=M;i++) {
        int u,v,c;
        scanf("%d %d %d",&u,&v,&c);
        int t1=Getid(u,c);
        int t2=Getid(v,c);
        AddEdge(t1,t2,0);
        AddEdge(u,t1,1);
        AddEdge(v,t2,1);
    }
    SPFA(1);
    if(dist[N]==INF)puts("-1");
    else printf("%d\n",dist[N]/2);
    return 0;
}


Measured memory_bytes: 66432
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#define rep(i, n) for(int i=0;i<(int)n;i++)
#define PI acos(-1)
#define fast_io ios_base::sync_with_stdio(false) ; cin.tie(0); cout.tie(0);
ll mod=1e9+7;


int main(){
    fast_io

    string n;
    cin>>n;

    int s=n.size();
    string str="";

    rep(i,s) str+='9';

    int res=0;
    for(char c='0';c<='9';c++){
        str[0]=c;
        if(str<=n){
            int num=0;
            for(int j=0;j<str.size();j++){
                num+=(int)(str[j] - '0');
            }
            if(res<num) res=num;
        }
    }
    cout<<res<<endl;
    return 0;
}

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

using namespace std;

int main() {
	int N;
    int a[110];
    
    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> a[i];
    }

    sort(a, a+N, greater<int>());
    int Alice = 0;
    int Bob = 0;

    
     for (int i = 0; i < N; i++) {
         if (i%2==0) {
             Alice += a[i];
         }
         else {
             Bob += a[i];
         }
     }
    cout << Alice - Bob << endl;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <array>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>
#include <random>
#include <ctime>

using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 29;
const int MOD = 1e9 + 7;

int main() {
  int n, k, m;
  scanf("%d%d%d", &n, &k, &m);
  vector<int> cnt(n);
  for (int i = 0; i < m; ++i) {
    int x;
    scanf("%d", &x);
    --x;
    cnt[x]++;
  }
  for (int i = 0; i < n; ++i) {
    int cur = k - m + cnt[i];
    puts(cur <= 0 ? "No" : "Yes");
  }
  return 0;
}


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

int main() {
    int H, N; cin >> H >> N;
    vector<int> A(N), B(N);
    for(int i=0; i<N; ++i) cin >> A[i] >> B[i];

    long long const INF = 1001001001001001001;
    vector<long long> dp(H + 10001, INF);
    dp[0] = 0;
    for(int v=0; v<dp.size(); ++v) {
        for(int i=0; i<N; ++i) {
            if(A[i] > v) continue;
            dp[v] = min(dp[v], dp[v - A[i]] + B[i]);
        }
    }

    long long res = INF;
    for(int v=H; v<dp.size(); ++v) {
        res = min(res, dp[v]);
    }
    cout << res << '\n';
}

Measured memory_bytes: 384
#if __has_include("noamoa_atcoder_lib.h")
#include "noamoa_atcoder_lib.h"
#else
#include <bits/stdc++.h>
#define endl '\n'
#define all(x) (x).begin(),(x).end()
namespace atcoder {
	using namespace std;
	using ll = long long;
	using intv = vector<int>;
	using charv = vector<char>;
	using boolv = vector<bool>;
	using floatv = vector<float>;
	using doublev = vector<double>;
	using stringv = vector<string>;

	constexpr ll MOD  = 1000000007;
	constexpr ll MOD9 = 1000000009;

	template<typename T>
	void sort(vector<T>& v){
		sort(all(v));
	}
	template<typename T>
	void sortInv(vector<T>& v){
		sort(all(v), greater<T>());
	}

	template<typename T>
	T sum(const vector<T>& v){
		T ret = 0;
		for(const auto& e : v) ret += e;
		return ret;
	}

	template<typename T>
	inline vector<T>& operator+=(vector<T>& v, const T& e){
		v.push_back(e);
		return v;
	}

	template<typename T>
	void in(vector<T>& v){
		for(auto& e : v) cin >> e;
	}

	template<typename T>
	istream& operator>>(istream &stream, vector<T>& v){
		for(auto& e : v) stream >> e;
		return stream;
	}

	template<typename T>
	void out(const vector<T>& v){
		for(const auto& e : v) cout << e << ' ';
		cout << endl;
	}

	template<typename T>
	void outln(const vector<T>& v){
		for(const auto& e : v) cout << e << endl;
	}

	void init(){
		cin.tie(nullptr);
		ios::sync_with_stdio(false);
		cout << fixed << setprecision(15);
	}
}
using namespace atcoder;
#endif

int main(){
	init();

	double R;cin>>R;
	cout <<(acos(-1)*R*2);
}

Measured memory_bytes: 3808
#include<iostream>
#include<cstring>
using namespace std;
struct Point{
	int l,r,sign;
	Point()
	{
		l=-1000000,r=1000000,sign=2;
	}
	Point(int _l,int _r,int _sign)
	{
		l=_l;
		r=_r;
		sign=_sign;
	}
	Point operator +(const Point &A) const
	{
		Point ret;
		ret.l=max(l,A.l);
		ret.r=min(r,A.r);
		if(sign==2||A.sign==3)
			ret.sign=A.sign;
		else if(A.sign==2||sign==3)
			ret.sign=sign;
		else if(sign==A.sign)
			ret.sign=sign;
		else
			ret.sign=3;
		if(ret.l>ret.r)
			ret.sign=3;
		if(ret.l==ret.r&&ret.sign<2&&ret.sign%2!=ret.l%2)
			ret.sign=3;
		return ret;
	}
};
struct Edge{
	int to,next;
}e[202020];
int cnt=0,head[101010];
void add(int u,int v)
{
	cnt++;
	e[cnt].to=v;
	e[cnt].next=head[u];
	head[u]=cnt;
}
Point a[101010];
bool vis[101010];
int ans[101010];
void dfs(int x)
{
	vis[x]=1;
	for(int i=head[x];i!=0;i=e[i].next)
	{
		int to=e[i].to;
		if(!vis[to])
		{
			dfs(to);
			Point ret=a[to];
			ret.l--;
			ret.r++;
			if(ret.sign<2)
				ret.sign^=1;
			a[x]=a[x]+ret;
		}
	}
}
void dfs2(int x)
{
	vis[x]=1;
	for(int i=head[x];i!=0;i=e[i].next)
	{
		int to=e[i].to;
		if(!vis[to])
		{
			if(a[to].l<=ans[x]-1&&ans[x]-1<=a[to].r)
				ans[to]=ans[x]-1;
			else
				ans[to]=ans[x]+1;
			dfs2(to);
		}
	}
}
int main()
{
	ios::sync_with_stdio(false);
	int n,k;
	cin>>n;
	for(int i=1;i<=n-1;i++)
	{
		int u,v;
		cin>>u>>v;
		add(u,v);
		add(v,u);
	}
	cin>>k;
	for(int i=1;i<=k;i++)
	{
		int v,p;
		cin>>v>>p;
		a[v].l=p;
		a[v].r=p;
		a[v].sign=p%2;
	}
	dfs(1);
	if(a[1].sign==3)
		cout<<"No"<<endl;
	else
	{
		cout<<"Yes"<<endl;
		memset(vis,0,sizeof(vis));
		if(a[1].sign==2)
			ans[1]=a[1].l;
		else if(a[1].sign%2==a[1].l%2)
			ans[1]=a[1].l;
		else
			ans[1]=a[1].l+1;
		dfs2(1);
		for(int i=1;i<=n;i++)
			cout<<ans[i]<<endl;
	}
	return 0;
}

Measured memory_bytes: 9216
use proconio::input;

fn main() {
    input!{
        k: u32,
    }

    let mut ans = 0;

    for a in 1 .. (k+1) {
        for b in 1 .. (k+1) {
            let gcd_a_b = gcd(a, b);
            for c in 1 .. (k+1) {
                ans += gcd(gcd_a_b, c);
            }
        }
    }

    println!("{}", ans);
}

fn gcd(x: u32, y: u32) -> u32 {
    fn _gcd(x: u32, y:u32) -> u32 {
        if x == 0 {
            y
        } else {
            _gcd(y % x, x)
        }
    }

    if x < y {
        _gcd(y, x)
    } else {
        _gcd(x, y)
    }
}


Measured memory_bytes: 2168