akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <ctime>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <numeric>
#include <cassert>
using namespace std;
static const double EPS = 1e-10;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define all(a) a.begin(),a.end()
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define SS stringstream
#define DBG1(a) rep(_X,sz(a)){printf("%d ",a[_X]);}puts("");
#define DBG2(a) rep(_X,sz(a)){rep(_Y,sz(a[_X]))printf("%d ",a[_X][_Y]);puts("");}
#define bitcount(b) __builtin_popcount(b)
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)

#define delete(a,n) a.erase(remove(all(a),n),a.end())
template<typename T, typename S> vector<T>& operator<<(vector<T>& a, S b) { a.push_back(b); return a; }
template<typename T> void operator>>(vector<T>& a, int b) {while(b--)if(!a.empty())a.pop_back();}
bool isprime(int n){ if(n<2)return false;  for(int i=2;i*i<=n;i++)if(n%i==0)return false;  return true;} 
ll b_pow(ll x,ll n){return n ? b_pow(x*x,n/2)*(n%2?x:1) : 1ll;}
string itos(int n){stringstream ss;ss << n;return ss.str();}

int dp[3000][3000];
int main(){
	dp[0][0] = 1;
	for(int i = 0 ; i < 2500 ; i++){
		for(int j = 0 ; j < 2500 ; j++){
			dp[i+1][j] += dp[i][j];
			dp[i+1][j+1] += dp[i][j];
			dp[i+1][j] %= 100000007;
			dp[i+1][j+1] %= 100000007;
		}
	}
	ios_base::sync_with_stdio(false);
	int r,c,y1,x1,y2,x2;
	cin >> r >> c >> y1 >> x1 >> y2 >> x2;
	
	if( x1 == x2 && y1 == y2 ){
		cout << 1 << endl;
		return 0;
	}
	int rd = (y1<=y2?y2-y1:r-y1+y2)+(x1<=x2?x2-x1:c-x1+x2);
	int ld = (y1<=y2?y2-y1:r-y1+y2)+(x1>=x2?x1-x2:x1+c-x2);
	
	int ru = (y1>=y2?y1-y2:r-y2+y1)+(x1<=x2?x2-x1:c-x1+x2);
	int lu = (y1>=y2?y1-y2:r-y2+y1)+(x1>=x2?x1-x2:x1+c-x2);
	
	int mi = min( min(rd,ld) , min(ru,lu) );
	
	long long ans = 0;
	if( mi == rd ){
		int a = (y1<=y2?y2-y1:r-y1+y2);
		int b = (x1<=x2?x2-x1:c-x1+x2);
		ans += dp[a+b][a];
	}
	if( x1 != x2 && mi == ld ){
		int a = (y1<=y2?y2-y1:r-y1+y2);
		int b = (x1>=x2?x1-x2:x1+c-x2);
		ans += dp[a+b][a];
	}
	if(y1 != y2 &&  mi == ru ){
		int a = (y1>=y2?y1-y2:r-y2+y1);
		int b = (x1<=x2?x2-x1:c-x1+x2);
		ans += dp[a+b][a];
	}
	if(y1 != y2 && x1 != x2 && mi == lu ){
		int a = (y1>=y2?y1-y2:r-y2+y1);
		int b = (x1>=x2?x1-x2:x1+c-x2);
		ans += dp[a+b][a];
	}
	cout << ans%100000007 << endl;
	
}

Measured memory_bytes: 31896
/*
  AtCoder Beginner Contest 079
  B - Lucas Number

  方針
    順番通りに実行すればよい。

  実装
    long longにすることに気をつける。
*/

#include<iostream>
using namespace std;

int N;

int main() {
  scanf("%d", &N);

  long long L0 = 2, L1 = 1;
  for (int i = 2; i <= N; ++i) {
    long long L2 = L0 + L1;
    L0 = L1;
    L1 = L2;
  }

  printf("%lld\n", L1);
  return 0;
}

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

int n, m;
int res1, res2, res;
string S;

int solveme(int P) {
	long long x[10];
	int p, q;
	x[0] = 1;
	x[1] = 10;
	for (int i = 2; i < 10; i++) {
		x[i] = x[i - 1] + ((long long)pow(10, i) - (long long)pow(10, i - 1))*i;
	}
	for (int i = 0; i < 10; i++) {
		if (x[i + 1] > P) {
			p = (P - x[i]) / (i + 1) + (int)pow(10, i);
			q = (P - x[i]) % (i + 1);
			break;
		}
	}
	return p * 10 + q;
}

int main() {
	while (true) {
		S = "";
		cin >> n >> m;
		if (n == 0 && m == 0) { break; }
		res = solveme(n);
		res1 = res / 10;
		res2 = res % 10;
		for (int i = res1; i < res1 + 100; i++)
		{
			S += to_string(i);
		}
		cout << S.substr(res2, m) << endl;
	}
}

Measured memory_bytes: 3268
#include <bits/stdc++.h>
#define rep(i, z, n) for(ll i = z; i < n; i++)
#define all(v) v.begin(), v.end()
typedef long long ll;
using namespace std;
int number[200010]={};

int main(){
  ll n;
  cin >> n;
  rep(i, 0, n-1){
    int temp;
    cin >> temp;
    number[temp-1]++;
  }
  rep(i,0,n){
    cout << number[i] << endl;
  }
  return 0;
}


Measured memory_bytes: 4384
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>

using namespace std;

long long solver(long long n){
	if(n % 2){
		return (n % 4 == 1)? 1 : 0;
	} else {
		return (n % 4 == 2) ? 1 ^ n : n;
	}
}

int main(){
	long long A, B;
	cin >> A >> B;

	cout << (solver(A - 1) ^ solver(B)) << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#include<cctype>
#define szxb 13
using namespace std;
int a[szxb];
signed main()
{
	scanf("%d%d%d",&a[1],&a[2],&a[3]);sort(a+1,a+4);
	puts(((!((a[1]+a[2])-a[3]))?("Yes"):("No")));
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <numeric>
#include <iomanip>
#include <tuple>

using namespace std;
int a[510][510];

int main(){
   int h,w;
   cin>>h>>w;
   for(int i=0;i<h;i++){
      for(int j=0;j<w;j++)cin>>a[i][j];
   }

   int n=0;
   vector<int> y,x,yy,xx;
   
   for(int i=0;i<h;i++){
      for(int j=0;j<w;j++){
         if(a[i][j]%2!=0){
            if(i==h-1 && j==w-1)break;
            if(j==w-1){
               a[i][j]--;a[i+1][j]++;
               y.push_back(i+1);x.push_back(j+1);
               yy.push_back(i+2);xx.push_back(j+1);
            }
            else{
               a[i][j]--;a[i][j+1]++;
               y.push_back(i+1);x.push_back(j+1);
               yy.push_back(i+1);xx.push_back(j+2);
            }
            n++;
         }
      }
   }
   cout<<n<<endl;
   for(int i=0;i<n;i++){
      cout<<y[i]<<" "<<x[i]<<" "<<yy[i]<<" "<<xx[i]<<endl;
   }

}

   


Measured memory_bytes: 5224
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <array>
#include <queue>
#include <stack>
#include <algorithm>
#include <tuple>
#include <numeric>
#include <type_traits>

template<typename W, typename V>
struct dijkstra_result {
	std::vector<W> distance; // 距離
	std::vector<V> prev; // 「前」の頂点
};

/**
 * ダイクストラ法で、ある頂点から到達可能な頂点までの距離と最短経路を求める
 * 
 * @tparam G グラフを表す型。
 *           グラフ g で頂点 u から v への重み w の辺があることを g[u][v] = w で表す。無向グラフなら g[u][v] = g[v][u] にしておく
 *           G は map<V, map<V, W>> や vector<vector<pair<V, W>>> などが可能
 * @tparam V 頂点番号の型。普通は int にすると思う
 * @tparam W 重みの型。 G から求まるので指定しなくてよい
 */
template<typename G, typename V, typename W = typename std::remove_reference<decltype(std::declval<G>()[0][0])>::type>
dijkstra_result<W, V> dijkstra(/*const*/ G& graph, V start, V num)
{
	using PQT = std::pair<W, V>;

	std::vector<W> distance;
	std::vector<V> prev;
	std::deque<bool> done; // 既に確定している頂点かどうか（覚えておかなくても計算できるが無駄がある）
	std::priority_queue<PQT, std::vector<PQT>, std::greater<PQT>> q;

	distance.resize(num);
	prev.resize(num);
	done.resize(num);

	for (V i = 0; i < num; ++i) {
		distance[i] = std::numeric_limits<W>::max();
	}
	distance[start] = 0;
	q.push({0, start});

	while (!q.empty()) {
		const auto& du = q.top();
		const auto dist = du.first;
		const auto u = du.second;
		q.pop();
		done[u] = true;
		const auto& edges = graph[u];
		for (const auto& vw : edges) {
			const auto v = vw.first;
			const auto w = vw.second;
			if (!done[v]) {
				long updated = dist + w;
				if (distance[v] > updated) {
					distance[v] = updated;
					prev[v] = u;
					q.push({updated, v});
				}
			}
		}
	}

	return {distance, prev};
}

int main()
{
	long N;
	std::unordered_map<long, std::unordered_map<long, long> > E; // src -> {dst -> weight}

	std::cin >> N;
	for (int i = 0; i < N-1; ++i) {
		long u, v;
		long w;
		std::cin >> u >> v >> w;
		--u;
		--v;
		E[u][v] = w;
		E[v][u] = w;
	}

	auto dij_res = dijkstra(E, 0L, N);
	auto& D = dij_res.distance;

	for (long i = 0; i < N; ++i) {
		std::cout << (D[i] % 2) << "\n";
	}
}


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

int main(int argc, char *argv[]) {
	vector<vector<int> > cell_list(10, vector<int>(10, 0));
	const int small_x[4] = {0, 1, 0, -1};
	const int small_y[4] = {-1, 0, 1, 0};
	const int middle_x[4] = {1, 1, -1, -1};
	const int middle_y[4] = {-1, 1, 1, -1};
	const int large_x[4] = {0, 2, 0, -2};
	const int large_y[4] = {2, 0, -2, 0};
	
	while (true) {
		int x, y, size;
		if (EOF == fscanf(stdin, "%d,%d,%d\n", &x, &y, &size)) {
			break;
		}
		// center
		if (x >= 0 && x < 10 && y >= 0 && y < 10) {
			cell_list[y][x]++;
		}
		// small
		for (int i = 0; i < 4; i++) {
			if (x+small_x[i] >= 0 && y+small_y[i] >= 0 &&
				x+small_x[i] < 10 && y+small_y[i] < 10) {
				cell_list[y+small_y[i]][x+small_x[i]]++;
			}
		}
		// middle
		if (size > 1) {
			for (int i = 0; i < 4; i++) {
				if (x+middle_x[i] >= 0 && y+middle_y[i] >= 0 &&
					x+middle_x[i] < 10 && y+middle_y[i] < 10) {
					cell_list[y+middle_y[i]][x+middle_x[i]]++;
				}
			}
			// large
			if (size > 2) {
				for (int i = 0; i < 4; i++) {
					if (x+large_x[i] >= 0 && y+large_y[i] >= 0 &&
						x+large_x[i] < 10 && y+large_y[i] < 10) {
						cell_list[y+large_y[i]][x+large_x[i]]++;
					}
				}
			}
		}
	}
	
	// calc empty cell and max
	int sum_empty = 0, max = 0;
	for (int i = 0; i < 10; i++) {
		for (int j = 0; j < 10; j++) {
			if (cell_list[i][j] == 0) sum_empty++;
			if (cell_list[i][j] > max) max = cell_list[i][j];
		}
	}
	
	// print result
	printf("%d\n%d\n", sum_empty, max);
	return 0;
}

Measured memory_bytes: 0
#include <iostream>
#define mod 1000000007
using namespace std;

long long dif, a, b, n, rez;

long long exp_log(long long b, long long exp)
{
    long long p = 1;
    while (exp)
    {
        if (exp % 2) p = (p * b) % mod;
        exp /= 2;
        b = (b * b) % mod;
    }
    return p;
}

long long inv_mod(long long a)
{
    return exp_log(a, mod - 2);
}

long long comb(long long n, long long k)
{
    long long p1 = 1, p2 = 1;
    for (int i = n - k + 1; i <= n; ++i)
        p1 = (p1 * i) % mod;
    for (int i = 1; i <= k; ++i)
        p2 = (p2 * i) % mod;
    return (p1 * inv_mod(p2)) % mod;
}

int main()
{
    cin >> n >> a >> b;
    rez = exp_log(2, n) - 1;
    dif = (comb(n, a) + comb(n, b)) % mod;
    dif = mod - dif;
    rez = (rez + dif) % mod;
    cout << rez;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
using ll = long long;
#define rep(i, n) for(int i = 0; i < n; i++)
#define repr(i, n) for(int i = n-1; i >= 0; i--)
using namespace std;

int main(){
  string s;
  cin >> s;
  int n = s.size();
  vector<char> st;
  rep(i, n){
    if (st.empty()){
      st.push_back(s[i]);
    }
    else{
      if (st.back() != s[i]) st.pop_back();
      else st.push_back(s[i]);
    }
  }
  cout << n - st.size() << endl;
  
  return 0;
}

Measured memory_bytes: 3756
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define rrep2(ri,x,n) for(int ri = (int)(n-1); ri >= (int)(x); ri--)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;

int main(){
  int n;
  cin >> n;
  vector<int> idx(n);
  rep(i, n){
    int in;
    cin >> in;
    idx.at(in-1) = i;
  }
  int ans = 0, add = 0, bf = 0;
  rep(i, n){
    if(i == 0){
      add++;
    }else{
      if(bf > idx.at(i)){
        ans = max(ans, add);
        add = 1;
      }else{
        add++;
      }
    }
    bf = idx.at(i);
    // cerr << ans << " " << add << endl;
  }
  ans = max(ans, add);
  cout << n-ans << endl;
  return 0;
}

Measured memory_bytes: 4032
#include <bits/stdc++.h>
#define ld long double
#define LL long long
#define Accel ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define Re(a,b) memset(a,b,sizeof a)
#define F first
#define S second
#define MP make_pair
#define PB push_back
#define ALL(X) (X).begin(), (X).end()
#define FOR(I, A, B) for (int I = (A); I <= (B); I++)
#define REP(I, N) for (int I = 0; I < (N); I++)
#define PII pair<int,int>
#define PLL pair<LL,LL>
#define SZ(a) ((int)a.size())
#define endl "\n" 
//#pragma GCC optimize(2)
using namespace std;
//typedef complex<double>C;
//const double PI(acos(-1.0));
//const double eps(1e-8);
//for(int mask=i;mask>0;mask=(mask-1)&i)
//int a[25]= { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97 };
//__gcd, atan2(y,x)=y/x , __int128
//c(n,k)=c(n-1,k-1)+c(n-1,k)
//c(i,r),i for r to n =c(n+1,r+1)
//void add(int x){while(x<N)BIT[x]++,x+=x&-x;}
//int sum(int x){int s=0;while(x){s+=BIT[x];x-=x&-x;}return s;}
//int find(int x){return x==p[x]?x:p[x]=find(p[x]);}
//LL pw(LL a,LL b){LL t=1;for(;b;b>>=1,a=a*a%M)b&1?t=t*a%M:0;return t;}
//log() = ln() , log(x)/log(y)=log(y)-base-x
//INT_MAX 127,INT_MIN 128
//int dw[4][2]={{0,1},{1,0},{0,-1},{-1,0}};
//int dw[8][2]={{0,1},{1,0},{0,-1},{-1,0},{1,1},{1,-1},{-1,1},{-1,-1}};
//cout<<fixed<<setprecision(12)<<ans<<endl;
//__builtin_popcount(mask)
const int N=1e5+10;
const int M=1e9+7;
int a[N];
int b[N];
int c[N];
int n;
int main(){Accel
    cin>>n;
    REP(i,n)cin>>a[i];
    REP(i,n)cin>>b[i];
    REP(i,n)cin>>c[i];
    sort(a,a+n);
    sort(b,b+n);
    sort(c,c+n);
    int l=-1,r=0;
    LL ans=0;
    REP(i,n){
		while(l+1<n&&a[l+1]<b[i])l++;
		while(r<n&&c[r]<=b[i])r++;
		if(l>=0&&r<n){
			//cout<<l<<" "<<r<<endl;
			ans+=1LL*(l+1)*(n-r);
		}
		if(r==n)break;
	}
    cout<<ans<<endl;
}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(x) (x).begin(), (x).end()

#define pb push_back
#define mp make_pair

#define F first
#define S second

using ll = long long;
using namespace std;

void chmin(ll &a, ll b) { if (a > b) a = b; }
void chmax(ll &a, ll b) { if (a < b) a = b; }

const int mod = 1000000007;
const int INF = 1e+9;

int main() {
    int n; cin >> n;
    vector<int> p(n);
    for (int i = 0; i < n; i++) {
        cin >> p[i];
    }

    int ans = 0;
    for (int i = 1; i <= n-2; i++) {
        if ((p[i-1] < p[i] && p[i] < p[i+1]) || (p[i-1] > p[i] && p[i] > p[i+1])) ans++;
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string.h>
#include <numeric>
using namespace std;

int dx[2][6] = {{1, -1, 0, -1, -1, 0}, {1, -1, 0, 0, 1, 1}};
int dy[6] = {0, 0, 1, -1, 1, -1};
int W, H, field[110][110], ans;
bool visited[110][110];

bool check(int x, int y){
	return x >= 0 && y >= 0 && x <= W + 1 && y <= H + 1;	
}

void dfs(int x, int y){
	if(visited[y][x] == true)
		return;
	visited[y][x] = true;
	
	for(int i = 0;  i < 6; ++i){
		int nx = x + dx[y % 2][i];
		int ny = y + dy[i];
		if(check(nx, ny)){
			if(field[ny][nx] == 1)
				ans++;
			else
				dfs(nx, ny);
		}
	}
	return;
}

int main() {
	cin >> W >> H;
	for(int i = 1; i <= H; ++i)
		for(int j = 1; j <= W; ++j)
			scanf("%d", &field[i][j]);
			
	dfs(0, 0);
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1544
/*************************************************************************
 > File Name: C.cpp
 > Author: codecode
 > Mail: 2466734364@qq.com
 > Created Time: 2020.1.26.20:08
 ************************************************************************/
#include<bits/stdc++.h>
#define int long long
using namespace std;
const int maxn=2e5+100;
int n,k,s,h[maxn];
#undef int
int main(){
#define int long long
	cin>>n>>k;
	for(int i=1;i<=n;i++)
		cin>>h[i];
	sort(h+1,h+n+1);
	for(int i=1;i<=n-k;i++)
		s+=h[i];
	cout<<s;
	return 0;
}


Measured memory_bytes: 1792
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Practice
{
    class Program
    {
        private static int ReadAndParseInt()
        {
            return int.Parse(Console.ReadLine());
        }
        private static int[] ReadAndParseIntArr()
        {
            return Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
        }
        private static long ReadAndParseLong()
        {
            return long.Parse(Console.ReadLine());
        }
        private static long[] ReadAndParseLongArr()
        {
            return Array.ConvertAll(Console.ReadLine().Split(' '), long.Parse);
        }
        static void Main(string[] args)
        {
            SolveA(args);
            //SolveB(args);
            //SolveC(args);
            //SolveD(args);


        }
        static void SolveA(string[] args)
        {
            int n = ReadAndParseInt();
            int[] a = ReadAndParseIntArr();
            List<int> sorted = new List<int>(a);
            sorted.Sort();

            int ai = sorted[n - 1];
            // ajを求める、
            int aj = sorted[0];
            for(int i=1;i<n-1;++i)
            {
                // aiPajの差分
                long left = ai - sorted[i-1];
                

                // !の差分
                long right = sorted[i];// 実際はこれにsorted[i]-1  * sorted[i]-2 *....と続く
                if( left > right)
                {

                    aj = sorted[i];
                }
                else
                {
                    // 直前の値が一番だ
                    break;
                }
            }
            Console.WriteLine(ai + " " + aj);
        }
        
    }
}


Measured memory_bytes: 22240
#include <stdio.h>

int main(){
	int a,b,count;
	while(scanf("%d %d", &a, &b) != EOF){
		a = a + b;
		count = 0;
	
		while(a > 0){
			a = a / 10;
			count++;
		}
	
		printf("%d\n", count);
	}
	return 0;
}

Measured memory_bytes: 600
//Radhe Radhe
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    ll n,i;
    string s,u,v;
    cin>>n>>s;
    for(i=0;s[i];i++){
        if(i<n/2)
        u+=s[i];
        else
        v+=s[i];
    }
    if(u==v)
    cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;

    return 0;
}





Measured memory_bytes: 3532
#include <bits/stdc++.h>
#define F first
#define S second
#define X real()
#define Y imag()
using namespace std;
typedef long long ll;
typedef long double ld;

int n;
ll x;
ll a[2020];

ll get(int i){
	multiset<ll> lol;
	for (int j=n-i-1;j<n;j++){
		lol.insert(a[j]);
	}
	ll v=0;
	for (int j=0;j<n;j++){
		int r=(j-i-1+n*2)%n;
		lol.erase(lol.find(a[r]));
		lol.insert(a[j]);
		v+=*lol.begin();
	}
	return v;
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cin>>n>>x;
	for (int i=0;i<n;i++){
		cin>>a[i];
	}
	ll v=1e18;
	for (int i=0;i<n;i++){
		v=min(v, get(i)+(ll)i*x);
	}
	cout<<v<<endl;
}

Measured memory_bytes: 384
#include<iostream>
#include<vector>
#include<cmath>
#include<limits>
#include<algorithm>
#include<string>
using namespace std;
int main(){
    long long int a,b,c;
    cin>>a>>b>>c;
    /*
    long double hoge,hogehoge,hogehogehoge;

    hoge=sqrt(a);
    hogehoge=sqrt(b);
    hogehogehoge=sqrt(c);

    //cout<<hoge<<hogehoge<<hogehogehoge<<endl;

    if(hoge+hogehoge<hogehogehoge){
        cout<<"Yes"<<endl;
    }
    else{
        cout<<"No"<<endl;
    }
    */
   long long int t=c-a-b;
   //cout<<t<<endl;
    if(t>0&&t*t>4*a*b){
        cout<<"Yes"<<endl;
    }
    else{
        cout<<"No"<<endl;
    }   
}

Measured memory_bytes: 256
#include<iostream>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<cstdio>
using namespace std;
long long Read() {
    long long x=0,f=1;
    char c=getchar();
    while(c<'0'||c>'9') {
        if(c=='-')f=-1;
        c=getchar();
    }
    while(c>='0'&&c<='9')x=x*10+c-'0',c=getchar();
    return x*f;
}
int main() {
    char str[10];
    cin>>str;
    int sum=0;
    for(int i=0;i<6;i++){
    	if(str[i]=='1')
    	sum++;
	}
	cout<<sum<<endl;
	return 0;
}

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

namespace ConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            var str = Console.ReadLine();
            var strs = str.Split(' ');
            var N = int.Parse(strs[0]);
            var M = int.Parse(strs[1]);

            var PY = new List<List<int>>();
            for (int i = 0; i < M; i++)
            {
                str = Console.ReadLine();
                strs = str.Split(' ');

                var list = new List<int>();
                list.Add(i);
                list.Add(int.Parse(strs[0]));
                list.Add(int.Parse(strs[1]));
                list.Add(0);

                PY.Add(list);
            }

            PY = PY.OrderBy(py => py[1]).ThenBy(py => py[2]).ToList();

            var prevP = PY[0][1];
            var no = 1;
            for (int i = 0; i < PY.Count; i++)
            {
                if (prevP != PY[i][1])
                {
                    no = 1;
                    prevP = PY[i][1];
                }

                PY[i][3] = no++;
            }

            PY = PY.OrderBy(py => py[0]).ToList();

            foreach (var item in PY)
            {
                Console.WriteLine(item[1].ToString().PadLeft(6, '0') + item[3].ToString().PadLeft(6, '0'));
            }
        }
    }
}


Measured memory_bytes: 37208
import java.util.Scanner;

public class Main {
	public static void main(String[] age){
		double P = Math.PI;
		Scanner sb = new Scanner(System.in);
		double r = sb.nextDouble();
		double s = r*r*P;
		double l = 2*r*P;
		String S = String.format("%.6f",s);
		String L = String.format("%.6f", l);
		System.out.println( S + " " + L);
	}
}

Measured memory_bytes: 28128
#include<bits/stdc++.h>
#include <bitset>
using namespace std;
#define ll long long
#define fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define dcm(a) setprecision(a)<<fixed
#define MOD 1000000007
#define clr(memo, a) memset(memo,a,sizeof(memo))
#define PI acos(-1)
void max_self(int  &a,int   b){
a=max(a,b);
}
int const N=1e5+5;
vector<int> adj[N];
int vis[N];
int indegree[N];
int dist[N];
void dfs(int v){
vis[v]=1;
for(int x:adj[v]){
    max_self(dist[x],dist[v]+1);
    --indegree[x];
    if(indegree[x]==0)
        dfs(x);

}
}
void solve()
{
    int n,m;
    cin>>n>>m;
    while(m--){
        int x,y;
        cin>>x>>y;
        indegree[y]++;
        adj[x].push_back(y);
    }
    for(int i=1;i<=n;i++)
        if(!vis[i]&&indegree[i]==0)
        dfs(i);
        int ans=0;
    for(int i=1;i<=n;i++)
        max_self(ans,dist[i]);
    cout<<ans<<endl;
}
int main()
{
    fast;
    solve();

    return 0;
}


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

using namespace std;

int main(void)
{
    int A, B;

    cin >> A >> B;

    if (10 <= A || 10 <= B)
    {
        cout << "-1" << endl;
    }
    else
    {
        cout << A * B << endl;
    }

    return 0;
}

Measured memory_bytes: 256
K = int(input())
A = list(map(int,input().split()))
A.reverse()
if A[0] != 2:
    print(-1)
    exit()

low, high = 2, 3

for a in A:
    if high < a:
        print(-1)
        exit()
    elif a < low:
        low=(-((-low)//a))*a
        if low > high:
            print(-1)
            exit()
        high=max(low+a-1,high+a-1-high%a)
    else:
        low=a
        if low>high:
            print(-1)
            exit()
        high=low+a-1
print(low,high)

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

int main(){
  int a,b,c,t;
  cin>>a>>b>>c;
  if(a>b){
    t=a;
    a=b;
    b=t;
  }
  if(b>c){
    t=b;
    b=c;
    c=t;
  }
  if(a>b){
    t=a;
    a=b;
    b=t;
  }
  cout<<a<<" "<<b<<" "<<c<<endl;
  return 0;
}

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

#define ff first
#define ss second
#define pb push_back
#define ll long long
#define ull unsigned long long
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define mst(ss,b) memset(ss,b,sizeof(ss));
#define dbg(x) cout << #x << "= " << x << endl;
typedef pair <int, int> pii;
const int inf = 0x3f3f3f3f;
const ll INF = (1LL<<63)-1;
const ll mod = 1e9+7;
const int N = 1e5+5;

int n, m, q;
int vis[N];
vector<int>E[N];
tuple<int, int, int>op[N];
int col[N][15];

//void dfs(int u, int d, int c){ //这种写法不对，不是vis=1就返回
//    if(vis[u])return ;
//    vis[u] = 1;
//    if(!col[u])col[u] = c;
//    for(auto v : E[u]){
//        if(d)dfs(v, d-1, c);
//    }
//}

//void dfs(int u, int d, int c, int fa){
//    col[u] = c;
//    if(!d)return ;
//    for(auto v : E[u]){
//        if(v == fa)continue;
//        dfs(v, d-1, c, u);
//    }
//}

void dfs(int u, int d, int c){
    if(d == -1)return ;
    if(col[u][d])return ;
    col[u][d] = c;
    for(auto v : E[u]){
        dfs(v, d-1, c);
    }
}

int  main(){
    scanf("%d%d", &n, &m);
    for(int i=1; i<=m; i++){
        int u, v;
        scanf("%d%d", &u, &v);
        E[u].pb(v);
        E[v].pb(u);
    }
    scanf("%d", &q);
    int v, d, c;
    for(int i=1; i<=q; i++){
        scanf("%d%d%d", &v, &d, &c);
        op[i] = make_tuple(v, d, c);
    }
    for(int i=1; i<=n; i++)E[i].pb(i);

    for(int i=q; i>=1; i--){
        tie(v, d, c) = op[i];
        dfs(v, d, c);
    }
    for(int i=1; i<=n; i++)printf("%d\n", col[i][0]);
    return 0;
}


//    lower_bound()
//    __builtin_popcount()
//    ios::sync_with_stdio(false);
//    freopen("in.txt","r",stdin);
//    freopen("out.txt","w",stdout);
//    const double eps=1e-12;
//    #pragma comment(linker,"/STACK:102400000,102400000")



Measured memory_bytes: 13560
#include <iostream>
using namespace std;
int main(void){
    int n, m;
    cin>>n>>m;
    if(m>0)
        cout<< (m+n-1+m)*n/2 - (m) <<endl;
    else if (n+m<1)
        cout<< (m+n-1+m)*n/2 - (m+n-1) <<endl;
    else    
        cout<< (m+n-1+m)*n/2<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <map>
#include <cmath>
#include <queue>
#include <utility>
#include <functional>
#include <deque>
#include <cctype>
#include <stack>
#include <bitset>

using ll = long long;
typedef unsigned long long ull;
typedef std::pair<ll, ll>P;

ll min(ll a, ll b) {
	if (a >= b)return b;
	else return a;
}
ll max(ll a, ll b) {
	if (a >= b)return a;
	else return b;
}
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a%b);
}
ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}

const ll Z = 1000000007;
const ll INF = 1 << 30;
const ll INF2 = 9000000000000000000LL;
bool flag = true;
bool fl = true;
int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
std::string abc = "abcdefghijklmnopqrstuvwxyz";
struct edge { ll to, cost; };
double pai = 3.141592653589793;

int main() {
	ll x, y;
	std::cin >> x >> y;
	if (abs(x - y) <= 1)std::cout << "Brown" << std::endl;
	else std::cout << "Alice" << std::endl;
}

Measured memory_bytes: 256
N = STDIN.gets.to_i
A = STDIN.gets.split(' ').map(&:to_i)

def insersion_sort(n, a)
  puts a.join(' ')
  (1..n-1).each do |i|
    v = a[i]
    j = i - 1
    while j >= 0 && a[j] > v
      a[j+1] = a[j]
      j = j - 1
    end
    a[j+1] = v
    puts a.join(' ')
  end
end

insersion_sort(N, A)



Measured memory_bytes: 6880
a, b, m = gets.split(" ").map(&:to_i)
ary_a = gets.split(" ").map(&:to_i)
ary_b = gets.split(" ").map(&:to_i)

ary_c = []
m.times do
  ary_c << gets.split(" ").map(&:to_i)
end

min = ary_a.sort[0] + ary_b.sort[0]

ary_c.each do |x|
  if min > ary_a[(x[0]-1)] + ary_b[(x[1]-1)] - x[2] 
    min = ary_a[(x[0]-1)] + ary_b[(x[1]-1)] - x[2]
  end
end

puts min


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

#define    int               long long int
 #define    bp(x)         __builtin_popcount(x)
#define  ld         long double
 #define  f(i,j,n)            for(int i = j; i <= n; i++)
#define  r(i,n,j)       for(int i = n; i >= j; i--)
 #define  all(container)       container.begin() , container.end()
#define  sz(container)   (int)container.size()
 #define  ff             first
#define  ss             second
 #define  pii      pair <int , int>
#define  sp(x)       setprecision(x)
 #define  endl    "\n"
#define  mod  1000000007
 #define  pb    push_back
#define  mp    make_pair
 #define  T     int ttt; cin >> ttt; while(ttt--)
#define fast ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL);

int power(int x, int y, int p)  
{  
    int res = 1;    
    x = x % p; 
    if (x == 0) return 0; 
    while (y > 0)  
    {     
        if (y & 1)  
            res = (res*x) % p;  
        y = y>>1; 
        x = (x*x) % p;  
    }  
    return res; 
}

int32_t main()
{
    fast
    int a,b,c,d;    cin>>a>>b>>c>>d;
    cout<<max({b*d,a*c,a*d,b*c});
}

Measured memory_bytes: 3652
//author rhythmicankur
                                                                  //god_is_almighty
#pragma GCC optimize("O3")
#pragma GCC target ("sse4")
#include<bits/stdc++.h>
#define f 	first
#define s 	second
#define ll 	int
#define int 	long long
#define ld 	long double
#define pb 	push_back
#define eb 	emplace_back
#define mk 	make_pair
#define vi 	vector<int>
#define pii 	pair<int,int>
#define vpi 	vector<pii>
#define fori(a,b,c) for(register int i=a;i<b;i+=c)
#define ford(a,b,c) for(register int i=a;i>=b;i-=c)
#define 	PI acos(-1)
#define coud(a,b) cout<<fixed << setprecision((b)) << (a)
#define M1 	998244353
#define M2 	1000000007
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
template<typename T> T gcd(T a,T b) { if(a==0) return b; return gcd(b%a,a); } 
#define test4(x,y,z,a) 		cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<"  |  "<<#a<<": "<<a<<endl;
#define test1(x)                cerr<<#x<<": "<<x<<endl
#define test2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define test3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
ll power(ll a,ll b,ll m=M2){ll answer=1;while(b){if(b&1)answer=(answer*a)%m;b/=2;a=(a*a)%m;}return answer;}
using namespace std;
void ctrl()
{
	cout<<"Control\n";
}
signed main()
{	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int n,l;
    cin>>n>>l;
    swap(n,l);
    int s=0;
    int A[n];
    fori(0,n,1)cin>>A[i],s+=A[i];
    if(s<l)
    cout<<"No\n";
    else
    {
        cout<<"Yes\n";
    }
    


return 0;
}

Measured memory_bytes: 1024
n = int(input())
lst = list(map(int, input().split()))
s = sum(lst)
q = int(input())
dic = {}
for i in range(n):
  dic.setdefault(lst[i], 0)
  dic[lst[i]] += 1
for i in range(q):
  b, c = map(int, input().split())
  dic.setdefault(b, 0)
  dic.setdefault(c, 0)
  dic[c] += dic[b]
  s += ((c - b) * dic[b])
  print(s)
  dic[b] = 0

Measured memory_bytes: 94280
#include <iostream>
using namespace std;
int main()
{
    int h, n, a, sum, i;
    i = 0;
    sum = 0;
    cin >> h >> n;
    while (i < n) {
        cin >> a;
        sum += a;
        i++;
    }
    if (sum >= h) {
        cout << "Yes";
    }
    else {
        cout << "No";
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <iomanip>
#include <queue>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;

int N;
priority_queue<double,vector<double>,greater<double>> V;

int main(){
    cin>>N;
    rep(i,N){
        double x;
        cin>>x;
        V.push(x);
    }

    for(int i=0;i<N-1;i++){
        double x=V.top();
        V.pop();
        double y=V.top();
        V.pop();
        V.push((x+y)/2);
    }

    double ans=V.top();

    cout<<ans<<endl;
}

Measured memory_bytes: 256
import std.stdio, std.algorithm, std.conv, std.array, std.string;

void main()
{
    auto n = readln.chomp.to!int;
    auto as = readln.split.to!(int[]);

    int even_cnt;
    int quart_cnt;

    foreach (a; as) {
        if (!(a&1)) {
            ++even_cnt;
            if (!(a&2))
                ++quart_cnt;
        }
    }

    if (quart_cnt >= (n - even_cnt) || (even_cnt == quart_cnt && (n - quart_cnt * 2) == 1))
        writeln("Yes");
    else
        writeln("No");
}

Measured memory_bytes: 4404
#include <iostream>                                                  
#include <string>                                                    
using namespace std;                                                 
                                                                     
int main() {                                                         
  while (true) {                                                     
    string s;                                                        
    cin >> s;                                                        
    if (s=="0") {                                                    
      break;                                                         
    }                                                                
    int ans = 0;                                                     
    for (int i=0; i<s.size(); i++) {                                 
      ans += s[i]-'0';                                               
    }                                                                
    cout << ans << endl;                                             
  }                                                                  
  return 0;                                                          
}                                                                    
                                                                     
         

Measured memory_bytes: 3160
# import sys
# import math
# import itertools
# from collections import deque
# from collections import defaultdict
# import heapq
# import copy
# import bisect
# import numpy as np
# from scipy.special import comb

# def my_input(): return sys.stdin.readline().rstrip()

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

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


def main():
    N, M = map(int, input().split())

    a = [0] * M
    b = [0] * M
    for i in range(M):
        a[i], b[i] = map(int, input().split())

    ans = 0
    for i in range(M):
        uf = UnionFind(N)
        for j in range(M):
            if i == j:
                continue
            uf.union(a[j]-1, b[j]-1)
        if not uf.same(a[i]-1, b[i]-1):
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 41072
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<map>
#include<cstdio>
#include<stack>
#include<queue>
#include<fstream>
#include<deque>
#include<iomanip>
#include <numeric>
#include<tuple>
#include <functional>
//#include<bits/stdc++.h>

using namespace std;
#define ok1 printf("ok1\n");
#define ok2 printf("ok2\n");
#define M 1000000000000000000LL
#define rep(i,n) for(int i=0;i<n;++i)
#define REP(i,s,n) for(int i=(s);i<(n);++i)
#define repr(i,n) for(int i=n-1;i>=0;--i)
#define REPR(i,s,n) for(int i=(s);i>=(n);--(i))
#define all(a) (a).begin(),(a).end()
#define reall(a) (a).rbegin(),(a).rend()
#define pb push_back
#define pf push_front
#define MIN(a,b) a=min((a),(b))
#define MAX(a,b) a=max((a),(b))
#define SIZE(v) (int)v.size()
#define fi first
#define se second
const double pi = acos(-1.0);
typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<char> vc;
typedef vector<double> vd;
typedef vector<bool> vb;
typedef deque<ll> dll;
typedef pair<ll, ll> P;
typedef vector<P> vP;
using Edge = pair<int, ll>;
using Graph = vector<vector<Edge> >;
const ll mod = 1e9 + 7;
ll dx[4] = { 1,0,-1,0 };
ll dy[4] = { 0,1,0,-1 };
template <typename T>
bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
};
template <typename T>
bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
};
void Pvll(vll v) {
	cout << "------------------------------------------------\n";
	rep(i, v.size()) cout << v[i] << " ";
	cout << endl;
	cout << "------------------------------------------------\n";
}
void Pvvll(vvll v) {
	cout << "------------------------------------------------\n";
	rep(i, v.size()) {
		rep(j, v[i].size()) {
			cout << v[i][j] << " ";
		}
		cout << endl;
	}
	cout << "------------------------------------------------\n";
}

void Ps(string s) {
	cout << "------------------------------------------------\n";
	rep(i, s.size()) cout << s[i] << " ";
	cout << endl;
	cout << "------------------------------------------------\n";
}

void Pvs(vs s) {
	cout << "------------------------------------------------\n";
	rep(i, s.size()) {
		rep(j, s[i].size()) {
			cout << s[i][j] << " ";
		}
		cout << endl;
	}
	cout << "------------------------------------------------\n";
}

void Yes(bool x) {
	if (x) cout << "Yes\n";
	else cout << "No\n";
}

void YES(bool x) {
	if (x) cout << "YES\n";
	else cout << "NO\n";
}

void yes(bool x) {
	if (x) cout << "yes\n";
	else cout << "no\n";
}

void Yay(bool x) {
	if (x) cout << "Yay!\n";
	else cout << ":(\n";
}

ll gcd(ll x, ll y)
{
	ll r;
	while ((r = x % y) != 0)
	{
		x = y;
		y = r;
	}
	return y;
}
ll lcm(ll x, ll y)
{
	x /= gcd(x, y);
	y /= gcd(x, y);
	return (x * y);
}



ll  d, n, m, r, l, k, h, w, ans = 0, ret = M;
bool flag = false, flag2 = false, flag3 = false;
string s,t;


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll x, y;
	cin >> s;
	if (s[0] == s[1] || s[1] == s[2] || s[2] == s[3]) cout << "Bad\n";
	else cout << "Good\n";
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <vector>
#include <string>
#include <cmath>
#include <map> 
#include <sstream>
#include <cstdio>
#include <complex>
#include <cstring>
using namespace std;
 
const int MAX= 10000100;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin(),(a).end()
#define ll long long int
#define gcd(a,b) __gcd(a,b)
#define pb(a) push_back(a)
int GCD(int a, int b) {if(!b) return a; return gcd(b, a%b);}
int lcm(int a, int b) {return a*b / gcd(a, b);}

int main(void){
  int a[100],in;
  rep(i,100)a[i] = 0;
  rep(i,3){
    cin>>in;
    a[--in]++;
  }
  in = 0;
  rep(i,100)if(a[i])in++;
  cout<<in<<endl;
  
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int n,len,d[100010],a[100010],b[100010],f[2];
void solve(int x,int y){
	int i;
	for(i=1;i<=len;i++){
		if(abs(x)>abs(y)){
			if(x>0)printf("R"),x-=d[i];
			 else printf("L"),x+=d[i];
		}
		 else{
		 	if(y>0)printf("U"),y-=d[i];
		 	 else printf("D"),y+=d[i];
		 }
	}
	puts("");
}
int main(){
	int i;
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		scanf("%d%d",&a[i],&b[i]);
		f[(a[i]+b[i])%2]=1;
	}
	if(f[0]&&f[1])return puts("-1"),0;
	for(i=30;i+1;i--)d[++len]=1<<i;
	if(f[0])d[++len]=1;
	printf("%d\n",len);
	for(i=1;i<=len;i++)printf("%d ",d[i]);puts("");
	for(i=1;i<=n;i++)solve(a[i],b[i]);
}

Measured memory_bytes: 256
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;

namespace AtCoder.Contest.B
{
	static class Program
	{
		public static void Main(string[] args)
		{
			var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
			Console.SetOut(sw);

			var cin = new Scanner();

			int n = cin.NextInt();
			int m = cin.NextInt();
			var p = new int[m];
            for (int i = 0; i < n; i++)
            {
				int k = cin.NextInt();
				var a = cin.ArrayInt(k);
                for (int j = 0; j < k; j++)
                {
					p[a[j] - 1]++;
                }
            }
			Console.WriteLine(p.Count(x => x == n));

			Console.Out.Flush();
		}
	}

	class Scanner
	{
		string[] s;
		int i;

		char[] cs = new char[] { ' ' };

		public Scanner()
		{
			s = new string[0];
			i = 0;
		}

		public string Next()
		{
			if (i < s.Length) return s[i++];
			string st = Console.ReadLine();
			while (st == "") st = Console.ReadLine();
			s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
			if (s.Length == 0) return Next();
			i = 0;
			return s[i++];
		}

		public int NextInt()
		{
			return int.Parse(Next());
		}

		public int[] ArrayInt(int N, int add = 0)
		{
			int[] Array = new int[N];
			for (int i = 0; i < N; i++)
			{
				Array[i] = NextInt() + add;
			}
			return Array;
		}

		public long NextLong()
		{
			return long.Parse(Next());
		}

		public long[] ArrayLong(int N, long add = 0)
		{
			long[] Array = new long[N];
			for (int i = 0; i < N; i++)
			{
				Array[i] = NextLong() + add;
			}
			return Array;
		}

		public double NextDouble()
		{
			return double.Parse(Next());
		}

		public double[] ArrayDouble(int N, double add = 0)
		{
			double[] Array = new double[N];
			for (int i = 0; i < N; i++)
			{
				Array[i] = NextDouble() + add;
			}
			return Array;
		}
	}
}

Measured memory_bytes: 13268
#include<bits/stdc++.h>
#define rep(i,a) for(int i=0;i<a;i++)
using namespace std;
int main(){
    int h,w;
    cin>>h>>w;
    string s[h];
    rep(i,h){
        cin>>s[i];
    }
    bool ok=true;
    rep(i,h){
        rep(j,w){
            if(s[i][j]=='#'){
                ok=false;
                break;
            }
        }
        if(ok){
            rep(k,w){
                s[i][k]='a';
            }
        }
        ok=true;
    }
    rep(i,w){
        rep(j,h){
            if(s[j][i]=='#'){
                ok=false;
                break;
            }
        }
        if(ok){
            rep(k,h){
                s[k][i]='a';
            }
        }
        ok=true;
    }
    bool ent=false;
    rep(i,h){
        rep(j,w){
            if(s[i][j]=='a') continue;
            cout<<s[i][j];
            if(s[i][j]=='#') ent=true;
        }
        if(ent) cout<<endl;
        ent=false;
    }
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        ArrayList<String[]> list = new ArrayList<String[]>();
        while(true) {
          String line = sc.nextLine();
          String[] linesp = line.split(" ");
          
          if(linesp[0].equals("-1") && linesp[1].equals("-1") && linesp[2].equals("-1")) {
              break;
          }
          list.add(linesp);
        }
      
        for(int i = 0; i < list.size(); i++) {
        int m = Integer.parseInt(list.get(i)[0]);
        int n = Integer.parseInt(list.get(i)[1]);
        int r = Integer.parseInt(list.get(i)[2]);
        if(m == -1 || n == -1) {
            System.out.println("F");
        } else {
            if(m + n >= 80) {
                System.out.println("A");
            } else if(m + n >= 65) {
                System.out.println("B");
            } else if(m + n >= 50) {
                System.out.println("C");
            } else if(m + n >= 30) {
                if(r >= 50) {
                    System.out.println("C");
                }else {
                    System.out.println("D");
                }
            } else {
                System.out.println("F");
            }
        }
        
        }
      
  }
}


Measured memory_bytes: 26372
#include<cstdio>
#include<iostream>
#include<iomanip>
#include<vector>
#include<cmath>
#include<algorithm>
using namespace std;
int main(void){
    vector<int> x(5);
    int k;
    cin >> x[0] >> x[1] >> x[2] >> x[3] >> x[4] >> k;

    if(*max_element(x.begin(),x.end()) - *min_element(x.begin(),x.end()) > k){
      cout << ":(\n";
    }
    else
      cout << "Yay!\n";
    return 0;
}


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
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <math.h>
using namespace std;
#define int long long


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

    int n,a,b; cin >> n >> a >> b;
    string s; cin >> s;

    int jc = 0;
    int fc = 0;

    for(int i = 0;i < n;i ++){
        if(s.at(i) == 'a'){
            if(jc + fc < a + b){
                cout << "Yes" << endl;
                jc ++;
            }else cout << "No" << endl;
        }else if(s.at(i) == 'b'){
            if(jc+fc < a+b && fc < b){
                cout << "Yes" << endl;
                fc ++;
            }else cout << "No" << endl;
        }else cout << "No" << endl;
    }
}


Measured memory_bytes: 848
#include<bits/stdc++.h>
#include<cmath>
using namespace std;
typedef long long int ll;
typedef unsigned long long ull;
#define inf  100000000000000000
# define M_PI           3.14159265358979323846  /* pi */
vector<vector<bool>> aria;
vector<vector<int>> dist;
ll mo=1e9+7;
int main(){
    int n,m;
    cin>>n>>m;
    aria=vector<vector<bool>>(n,vector<bool>(m,0));
    for(int i=0;i<n;i++)
    for(int j=0;j<m;j++){
        char c;
        cin>>c;
        if(c=='#')
        aria[i][j]=1;
    }
    dist=vector<vector<int>> (n,vector<int>(m,0));
    dist[0][0]=1;
    for(int i=0;i<n;i++)
        for(int j=0;j<m;j++){
            if(i>0 && !aria[i][j])
                dist[i][j]+=dist[i-1][j];
            if(j>0 && !aria[i][j])
                dist[i][j]+=dist[i][j-1];
                dist[i][j]%=mo;


        }
    cout<<dist[n-1][m-1];

    return 0;
}


Measured memory_bytes: 4352
import java.util.*;
import java.io.*;
public class Main{
  public static void main(String[] args) {
    Scanner sc=new Scanner(System.in);
    String str1 = sc.nextLine();
    int len = str1.length();
    int counta = 0;
    int countb = 0;
    for(int i= 0; i < len; i++) {
      if(counta > 0 && countb > 0) 
            break;
      if(str1.charAt(i) == 'A') {
        counta += 1;
      }
      else {
        countb += 1;
      }
    }
    System.out.println((counta > 0 && countb > 0) ? "Yes" : "No");
  }
}


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

int main(int argc, const char * argv[]) {
    long long n, k;
    long long a, b;
    pair<long long, long long> p;
    vector<pair<long long, long long>> v;
    long long cnt, ans;
    
    cin >> n >> k;
    
    for (int i = 0; i < n; i++) {
        //入力
        cin >> a >> b;
        
        p.first = a;
        p.second = b;
        
        v.push_back(p);
    }
    sort(v.begin(), v.end());
    
    
    cnt = 0;
    for (int i = 0; ; i++) {
        cnt += v[i].second;
        if (cnt>=k) {
            ans = v[i].first;
            break;
        }
    }
    cout << ans << endl;
    
    return 0;
}


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

int main(){
	int n, m, c, b[22], a[22][22],i,k,sum=0,ans=0;
	cin >> n >> m >> c;
	for (i = 0; i < m; i++) {
		cin >> b[i];
	}
	for (k = 0; k < n; k++) {
		for (i = 0; i < m; i++) {
			cin >> a[k][i];
			sum += (a[k][i] * b[i]);
		}
		sum += c;
		if (sum > 0) {
			ans++;
		}
		sum = 0;
	}
	cout << ans << endl;

}

Measured memory_bytes: 256