akhauriyash/Code-Regression huggingface dataset:
/*⠄⢰⣧⣼⣯⠄⣸⣠⣶⣶⣦⣾⠄⠄⠄⠄⡀⠄⢀⣿⣿⠄⠄⠄⢸⡇⠄⠄
⠄⠄⠄⣾⣿⠿⠿⠶⠿⢿⣿⣿⣿⣿⣦⣤⣄⢀⡅⢠⣾⣛⡉⠄⠄⠄⠸⢀⣿⠄
⠄⠄⢀⡋⣡⣴⣶⣶⡀⠄⠄⠙⢿⣿⣿⣿⣿⣿⣴⣿⣿⣿⢃⣤⣄⣀⣥⣿⣿⠄
⠄⠄⢸⣇⠻⣿⣿⣿⣧⣀⢀⣠⡌⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠿⠿⣿⣿⣿⠄
⠄⢀⢸⣿⣷⣤⣤⣤⣬⣙⣛⢿⣿⣿⣿⣿⣿⣿⡿⣿⣿⡍⠄⠄⢀⣤⣄⠉⠋⣰
⠄⣼⣖⣿⣿⣿⣿⣿⣿⣿⣿⣿⢿⣿⣿⣿⣿⣿⢇⣿⣿⡷⠶⠶⢿⣿⣿⠇⢀⣤
⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣽⣿⣿⣿⡇⣿⣿⣿⣿⣿⣿⣷⣶⣥⣴⣿⡗
⢀⠈⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠄
⢸⣿⣦⣌⣛⣻⣿⣿⣧⠙⠛⠛⡭⠅⠒⠦⠭⣭⡻⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃⠄
⠘⣿⣿⣿⣿⣿⣿⣿⣿⡆⠄⠄⠄⠄⠄⠄⠄⠄⠹⠈⢋⣽⣿⣿⣿⣿⣵⣾⠃⠄
⠄⠘⣿⣿⣿⣿⣿⣿⣿⣿⠄⣴⣿⣶⣄⠄⣴⣶⠄⢀⣾⣿⣿⣿⣿⣿⣿⠃⠄⠄
⠄⠄⠈⠻⣿⣿⣿⣿⣿⣿⡄⢻⣿⣿⣿⠄⣿⣿⡀⣾⣿⣿⣿⣿⣛⠛⠁⠄⠄⠄
⠄⠄⠄⠄⠈⠛⢿⣿⣿⣿⠁⠞⢿⣿⣿⡄⢿⣿⡇⣸⣿⣿⠿⠛⠁⠄⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⠉⠻⣿⣿⣾⣦⡙⠻⣷⣾⣿⠃⠿⠋⠁⠄⠄⠄⠄⠄⢀⣠⣴
⣿⣿⣿⣶⣶⣮⣥⣒⠲⢮⣝⡿⣿⣿⡆⣿⡿⠃⠄⠄⠄⠄⠄⠄⠄⣠⣴⣿*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
#define ll long long
#define ii pair<ll,ll>
#define iii pair<ii,ll>
#define fi first
#define se second
#define endl '\n'
#define debug(x) cout << #x << " is " << x << endl;

#define rep(x,start,end) for(auto x=(start)-((start)>(end));x!=(end)-((start)>(end));((start)<(end)?x++:x--))
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()

ll MAX(ll a){return a;}
ll MIN(ll a){return a;}
template<typename... Args>
ll MAX(ll a,Args... args){return max(a,MAX(args...));}
template<typename... Args>
ll MIN(ll a,Args... args){return min(a,MIN(args...));}

#define indexed_set tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>

mt19937 rng(chrono::system_clock::now().time_since_epoch().count());

int n,k;
int arr[100005];

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	cin>>n>>k;
	rep(x,0,n) cin>>arr[x];
	
	sort(arr,arr+n);
	
	int ans=0;
	rep(x,0,k) ans+=arr[x];
	
	cout<<ans<<endl;
}


Measured memory_bytes: 3660
#include <stdio.h>
#include <string>
#include <iostream>
#include <iomanip>
#include <map>
#include <algorithm>
#include <vector>
using namespace std;

int main(void) {
	int n,a,b;
	cin >> n >> a >> b;
	string rank;
	cin >> rank;
	for(int i=0; i<n; i++){
		if(rank[i]=='a'){
			if(a+b>0){
				cout << "Yes" << endl;
				a--;
			}else cout << "No" << endl;
		}else if(rank[i]=='b'){
			if(a+b>0 && b>0){
				cout << "Yes" << endl;
				b--;
			}else cout << "No" << endl;
		}else {
			cout << "No" << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 896
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>

using namespace std;
#define rep(i, s, e) for (int(i) = (s); (i) <= (e); ++(i))

int main()
{
	int a, b, ans;
	cin >> a >> b;
	ans = max(a, b) + max(max(a, b) - 1, min(a, b));
	cout << ans << endl;
}

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

#define x first
#define y second
#define ndl '\n'
#define mp make_pair
#define up_b upper_bound
#define low_b lower_bound
#define sz(x) (int)x.size()
#define bit __builtin_popcount
#define all(x) x.begin(),x.end()
#define show(x) cout<<(#x)<<" is "<<(x)<<endl

using namespace std;
using namespace __gnu_pbds;

template<typename T> using indexed_set=tree <T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef pair<int,ll> pil;
typedef pair<ll,int> pli;
typedef vector<vector<int>> matrix;

const ll INF=1e18+123;
const ld EPS=1e-9;
const int inf=1e9+123;
const int MOD=1e9+7;
const int N=5e5+123;
const int M=1e6+123;
const int dx[]={0,0,1,-1};
const int dy[]={1,-1,0,0};

int a[N];

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin>>n;
    n+=n;
    for(int i=1;i<=n;i++)cin>>a[i];
    sort(a+1,a+1+n);
    int ans=0;
    for(int i=1;i<=n;i+=2)ans+=a[i];
    cout<<ans;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char>cvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
int main()	{
  int n;
  cin>>n;
  vector<int>a(n+1),b(n);
  rep(i,n+1) cin>>a[i];
  rep(i,n) cin>>b[i];
  ll ans=0;
  rep(i,n){
    int p=min(a[i],b[i]);
    a[i]-=p;
    b[i]-=p;
    ans+=p;
    int q=min(a[i+1],b[i]);
    a[i+1]-=q;
    b[i]-=q;
    ans+=q;
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 1024
import java.util.Scanner;

public class Main {

	public static int n;
	public static int[] A;
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt();
		A = new int[n];
		for(int i = 0; i < n; i++){
			A[i] = scan.nextInt();
		}

		int q = scan.nextInt();

		for(int y = 0; y < q; y++){
			System.out.println(isSolve(0,scan.nextInt()) ? "yes" : "no");
		}
	}

	public static boolean isSolve(int i, int m){
		if(m == 0) return true;
		if(i >= n) return false;

		return isSolve(i + 1, m) || isSolve(i + 1, m - A[i]);

	}
}

Measured memory_bytes: 26752
#include<bits/stdc++.h>
#define rep(i,m) for(long long i=0; i<m; i++)
#define per(i,m) for(long long i=m-1; i>=0; i--)
#define FOR(i,n,m) for(long long i=n; i<m; i++)
#define ROF(i,n,m) for(long long i=n-1; i>=m; i--)
#define all(x) (x).begin(),(x).end()
#define EPS (1e-7)
#define INF (1e18)
#define PI (acos(-1))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
typedef pair<ll, ll> LP;

ll POW(ll x,ll n){
  if(n==0)return 1;
  if(n%2==0)return POW(x*x%MOD,n/2);
  return x*POW(x,n-1)%MOD;
}

ll gcd(ll u, ll v) {
  ll r;
  while (0 != v) {
    r = u % v; u = v; v = r;
  }
  return u;
}
 
ll KAI(ll m)
{
  if(m<0) return 0;
  if(m==0) return 1;
  return m*KAI(m-1)%MOD;
}
 
ll extGCD(ll a, ll b, ll &x, ll &y) {
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    ll d = extGCD(b, a%b, y, x);
    y -= a / b * x;
    return d;
}
 
inline ll mod(ll a, ll m) {
    return (a % m + m) % m;
}
 
ll modinv(ll a) {
    ll x, y;
    extGCD(a, MOD, x, y);
    return mod(x, MOD);
}
 
ll COM(ll m,ll n)
{
  if(m<n) return 0;
  if(n<0) return 0;
  if(n==0) return 1;
  if(m==n) return 1;
  return KAI(m)%MOD*modinv(KAI(n)%MOD*KAI(m-n)%MOD)%MOD;
}

ll DEC(ll x,ll m,ll n)
{
  return x%POW(m,n+1)/POW(m,n);
}

ll keta(ll x,ll n)
{
  if(x==0)return 0;
  return keta(x/n,n)+1;
}

ll DIV(ll x,ll n)
{
  if(x==0)return 0;
  return x/n+DIV(x/n,n);
}


int main()
{
  string s;
  char c[120];
  ll a,x;
  cin >> s;
  a=s.length();
  x=0;
  rep(i,a)c[i]=s[i];
  rep(i,a-6)if(c[i]=='k'&&c[i+1]=='e'&&c[i+2]=='y'&&c[i+3]=='e'&&c[i+4]=='n'&&c[i+5]=='c'&&c[i+6]=='e')x=1;
  if(c[0]=='k'&&c[1]=='e'&&c[2]=='y'&&c[3]=='e'&&c[4]=='n'&&c[5]=='c'&&c[a-1]=='e')x=1;
  if(c[0]=='k'&&c[1]=='e'&&c[2]=='y'&&c[3]=='e'&&c[4]=='n'&&c[a-2]=='c'&&c[a-1]=='e')x=1;
  if(c[0]=='k'&&c[1]=='e'&&c[2]=='y'&&c[3]=='e'&&c[a-3]=='n'&&c[a-2]=='c'&&c[a-1]=='e')x=1;
  if(c[0]=='k'&&c[1]=='e'&&c[2]=='y'&&c[a-4]=='e'&&c[a-3]=='n'&&c[a-2]=='c'&&c[a-1]=='e')x=1;
  if(c[0]=='k'&&c[1]=='e'&&c[a-5]=='y'&&c[a-4]=='e'&&c[a-3]=='n'&&c[a-2]=='c'&&c[a-1]=='e')x=1;
  if(x==1)printf("YES");
  else printf("NO");
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int (i)=0;(i)<(n);(i)++)
using ll = long long;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, n) cin >> a[i];

  bool yes = true;

  rep(i, n) {
    if(a[i]%2==0) {
      if(a[i]%3!=0&&a[i]%5!=0) {
        yes = false;
        break;
      }
    }
  }

  if(yes) cout << "APPROVED" << endl;
  else cout << "DENIED" << endl;
}

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

struct TTree
{
private:
	struct TNode
	{
	public:
		int Id;
		TNode* Parent;
		TNode* LChild;
		TNode* RChild;
		TNode(int Value)
		{
			Id = Value;
			Parent = NULL;
			LChild = NULL;
			RChild = NULL;
		}
	};
	TNode* Root;
	void Delete(const TNode* Node)
	{
		if(Node == NULL) return;
		Delete(Node->LChild);
		Delete(Node->RChild);
		delete Node;
	}
	void InorderOutput(const TNode* Node)
	{
		if(Node == NULL) return;
		InorderOutput(Node->LChild);
		cout << ' ' << Node->Id;
		InorderOutput(Node->RChild);
	}
	void PreorderOutput(const TNode* Node)
	{
	    if(Node == NULL) return;
	    cout << ' ' << Node->Id;
	    PreorderOutput(Node->LChild);
	    PreorderOutput(Node->RChild);
	}
	void Insert(TNode* z)
	{
	    assert(z != NULL);
		TNode* y = NULL;
		TNode* x = Root;
		while(x != NULL){
			y = x;
			if(z->Id < x->Id){
				x = x->LChild;
			}else{
				x = x->RChild;
			}
		}
		z->Parent = y;
		if(y == NULL){
			Root = z;
		}else if(z->Id < y->Id){
			y->LChild = z;
		}else{
			y->RChild = z;
		}
	}
	bool Find(TNode* Node, int Value)
	{
		if(Node == NULL) return false;
		if(Node->Id == Value){
			return true;
		}else if(Node->Id > Value){
			if(Find(Node->LChild, Value)){
				return true;
			}
		}else{
			if(Find(Node->RChild, Value)){
				return true;
			}
		}
		return false;
	}
public:
	TTree()
	{
		Root = NULL;
	}
	~TTree()
	{
		Delete(Root);
	}
	void Insert(int Id)
	{
		Insert(new TNode(Id));
	}
	void Find(int Id)
	{
		bool IsExist = Find(Root, Id);
		if(IsExist){
			cout << "yes" << endl;
		}else{
			cout << "no"  << endl;
		}
	}
	void Print()
	{
		InorderOutput(Root);
		cout << endl;
		PreorderOutput(Root);
		cout << endl;
	}
};

int main()
{
	int n;
	cin >> n;
	TTree Tree;
	for(int i = 0; i < n; i++){
		string Command;
		cin >> Command;
		if(Command == "insert"){
			int Id;
			cin >> Id;
			Tree.Insert(Id);
		}else if(Command == "find"){
			int Id;
			cin >> Id;
			Tree.Find(Id);
		}else{
			Tree.Print();
		}
	}
	return 0;
}

Measured memory_bytes: 21748
def partition(A, p, r):
    x = A[r]
    i = p - 1
    for j in range(p, r):
        if A[j] <= x:
            i += 1
            tmp = A[i]
            A[i] = A[j]
            A[j] = tmp
    tmp = A[i+1]
    A[i+1] = A[r]
    A[r] = tmp
    return A, i+1
n = int(input())
A = list(map(int, input().split(' ')))
parted_A, idx = partition(A, 0, n-1)
str_parted_A = list(map(str, parted_A))
str_parted_A[idx] = "[{}]".format(str_parted_A[idx])
print(" ".join(str_parted_A))


Measured memory_bytes: 16588
//<MIHIR KHAMBHATI/>
 
#include<bits/stdc++.h>
using namespace std;
 
#define mod 1000000007
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);
#define deb(x) cout<<"\n"<<#x<<"="<<x<<"\n";
#define deb2(x,y) cout<<"\n"<<#x<<"="<<x<<"\n"<<#y<<"="<<y<<"\n";
#define ideb int _p_;cin>>_p_;
typedef long long int ll;
typedef unsigned long long int ull;

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

cout<<fixed<<setprecision(10)<<((n/2+n%2)/(double)n);
}

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

int main(){
  int n;
  cin >> n;
  if(n == 1){
    cout << "Hello World";
  }else{
    int a,b;
    cin >> a >> b;
    cout << a+b;
  }
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
typedef long long ll;

/*sortの仕方
 * ■ string s の場合
 * 昇順: sort(s.begin(), s.end())
 * 降順:  sort(s.rbegin(), s.rend())
 *
 * ■ int a[N] の場合
 * 昇順: sort(a, a+N)
 * 降順: 不明
 */

int alph2int(char character) {
    int x = character - 'a';
    return x;
}


int main(){
    string s;
    cin >> s;

    for(int i=0; i<3; i++){
        if(s[i] == '1'){
            s[i] = '9';
        } else if(s[i] == '9'){
            s[i] = '1';
        }
    }

    cout << s[0] << s[1] << s[2] << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <algorithm>
#include <string>
#define MAXN 100005
using namespace std;
char star[MAXN];
int dp[MAXN];
int main()
{
    memset(dp, 0, sizeof(dp));
    scanf("%s", star);
    int len = strlen(star);
    string a;
    for(int i = 0; i < min(7, len); i++)
    {
        a += star[i];
        if(a == "dream") dp[i] = 1;
        if(a == "dreamer") dp[i] = 1;
        if(a == "erase") dp[i] = 1;
        if(a == "eraser") dp[i] = 1;
    }
    for(int i = 0; i < len; i++)
    {
        if(!dp[i]) continue;
        a.clear();
        for(int j = 1; j <= 7 && i + j < len; j++)
        {
            a += star[i + j];
            if(a == "dream") dp[i + j] = 1;
            if(a == "dreamer") dp[i + j] = 1;
            if(a == "erase") dp[i + j] = 1;
            if(a == "eraser") dp[i + j] = 1;
        }
    }
    if(dp[len - 1]) puts("YES");
    else
        puts("NO");
    return 0;
}


Measured memory_bytes: 896
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] s = new int[n + 1];
        for (int i = 0; i < n; i++) {
            s[i] = sc.nextInt();
        }

        int q     = sc.nextInt();
        int count = 0;
        
        for (int i = 0; i < q; i++) {
            int ti = sc.nextInt();
            s[n]   = ti;
            int j  = 0;
            while (true) {
                if (ti == s[j]) break;
                else j++;
            }
            if (j != n) count++;
        }

        System.out.println(count);
    }
}


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

//template
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(a);i>(b);i--)
#define ALL(v) (v).begin(),(v).end()
typedef long long int ll;
const int inf = 0x3fffffff; const ll INF = 0x1fffffffffffffff; const double eps=1e-12;
void tostr(ll x,string& res){while(x)res+=('0'+(x%10)),x/=10; reverse(ALL(res)); return;}
template<class T> inline bool chmax(T& a,T b){ if(a<b){a=b;return 1;}return 0; }
template<class T> inline bool chmin(T& a,T b){ if(a>b){a=b;return 1;}return 0; }
//template end

int dp[10100];

int main(){
   int h,n; scanf("%d%d",&h,&n);
   memset(dp,0x3f,sizeof(dp)); dp[0]=0;
   rep(rot,0,n){
      int a,b; scanf("%d%d",&a,&b);
      rep(i,0,h+1){
         chmin(dp[min(h,i+a)],dp[i]+b);
      }
   }
   printf("%d\n",dp[h]);
   return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MM = 1000000000;
const int MOD = MM + 7;
const int MAX = 510000;
#define rep(i, n) for(ll i=0; i<n; i++)
#define Rep(i, j, n) for(ll i=j; i<n; i++)
#define all(vec) vec.begin(), vec.end()
template<class T> inline bool chmin(T& a, T b) {if(a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if(a < b) {a = b; return true;} return false;}
const ll INF = 1LL << 60;



int main() {
    ll n; cin >> n;
    map<ll, pair<ll, ll>> m;
    Rep(i, 1, n+1) {
        ll a; cin >> a;
        m[i-a].first++;
        m[i+a].second++;
    }
    ll ans = 0;
    for(auto x : m) ans += x.second.first * x.second.second;
    cout << ans << endl;
}


Measured memory_bytes: 26140
/*
????????¢?????¨?????¨
?????? r ???????????¢?????¨?????¨?????????????±???????????????°?????????????????????????????????

Input
??????????????° r ????????????????????????

Output
??¢?????¨?????¨?????????????????????????????§????????£????????????????????????????????????
????????????????°???°?????°??¨??????0.00001 ??\???????????????????????§?????????????????¨????????????
*/
#define _USE_MATH_DEFINES	// Visual C++??§M_PI????????????????????????
#define pi 3.14159265359
//#include <cmath>
#include <iostream>			// ??\????????¢???
#include <math.h>			// Visual C++??§M_PI????????????????????????
#include <iomanip>			// ?????????????????????????°???°?????\???????????°????¨?????????????????????????
int main() {
	double r;
	std::cin >> r;
	std::cout << std::fixed << std::setprecision(10) << r*r*pi << " " << 2*r*pi << std::endl;
	return 0;
}

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

num_of_matches = [6, 2, 5, 5, 4, 5, 6, 3, 7, 6]
dp = ['x'] * (n+8)
dp[0] = ''
for i in range(n+1):
    if dp[i] == 'x':
        continue
    for aa in a:
        x = dp[i + num_of_matches[aa]]
        y = dp[i] + str(aa)
        if x == 'x':
            dp[i + num_of_matches[aa]] = y
        elif len(x) < len(y):
            dp[i + num_of_matches[aa]] = y
        elif len(x) == len(y):
            if x < y:
                dp[i + num_of_matches[aa]] = y
print(dp[n])


Measured memory_bytes: 36048
# Author: cr4zjh0bp
# Created: Sat Mar 14 11:59:04 UTC 2020
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = ni()
print(a[k - 1])

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

int main(){
  int N,K,Q; cin>>N>>K>>Q;

  int score[N];
  for(int i=0;i<N;i++){
    score[i]=K-Q;
  }

  int A;
  for(int i=0;i<Q;i++){
    cin>>A;
    score[A-1]++;
  }

  for(int i=0;i<N;i++){
    if(score[i]>0) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
  }

}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef pair<int,int> P;
constexpr int mod = 1e9+7;
int dp[110][4][4][4];
int main(){
  int n;
  cin >> n;

  dp[0][3][3][3] = 1;

  for (int i = 0; i < n; i++) {
    
    for (int j = 0; j < 4; j++) {
      for (int k = 0; k < 4; k++) {
        for (int l = 0; l < 4; l++) {
          for (int now = 0; now < 4; now++) {
            if (now == 2 && j == 1 && k == 0) continue;
            if (now == 2 && j == 0 && k == 1) continue;
            if (now == 1 && j == 2 && k == 0) continue;
            if (now == 2 && j == 1 && l == 0) continue;
            if (now == 2 && k == 1 && l == 0) continue;
            (dp[i + 1][now][j][k] += dp[i][j][k][l]) %= mod;
          }
        }
      }
    }
  }
  int res = 0;
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      for (int k = 0; k < 4; k++) (res += dp[n][i][j][k]) %= mod; 
    }
  }
  cout << res << endl;
  return 0;
} 

Measured memory_bytes: 256
#R,B

N,A,B = map(int, raw_input().split())

#print N,A,B

matmari = A + B

times = N / matmari

#print times , matmari

amari = (N - matmari * times)

if amari > A:
    remain = A
else:
    remain = amari

print (times * A) + remain


Measured memory_bytes: 2568
fun main(args: Array<String>) {

    val (n, m) = readLine()!!.split(' ').map { it.toInt() }

    var ans = 0

    if (n >= 2) {
        ans += nCr(n,2)
    }
    if (m >= 2) {
        ans += nCr(m,2)
    }
    println(ans)
}

fun nCr(n: Int, r: Int):Int {
    var ans = 1
    var bunbo = 1
    val limit = Math.min(r, n-r)
    for (i in 0 until limit) {
        ans *= (n - i)
        bunbo *= (i+1)
    }
    return ans / bunbo
}


Measured memory_bytes: 38164
import collections
n=int(input())
s=list(map(int,input().split()))
if 0 in s:
  print(0)
  quit()
s=collections.Counter(s)
l1=[0]
l2=[]
for x in s:
  if s[x]>2:
    print(0)
    quit()
  elif s[x]>1:
    l2.append(x)
    l2.append(24-x)
  else:
    l1.append(x)
x=len(l1)
an=0
for i in range(2**x):
  memo=[0]*x
  for j in range(x):
    if ((i >> j) & 1):
      memo[j]=l1[j]
    else:
      memo[j]=24-l1[j] 
  ans=12
  memo=memo+l2
  for k in range(len(memo)):
    for m in range(k+1,len(memo)):
      ans=min(ans,min(abs(memo[k]-memo[m]),24-abs(memo[k]-memo[m])))
  an=max(ans,an)
print(an)

Measured memory_bytes: 3316
console.log((args=>{
  const N = args.trim().split``.map(v=>v|0);
  const L = N.length;
  let s = 0;
  for ( let i = 0; i < L; i++ ) s += N[i];
  return (s%9)?'No':'Yes';
})(require('fs').readFileSync('/dev/stdin','utf8')));


Measured memory_bytes: 35524
import sys

sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():
    # 最短経路問題で使われるアルゴリズムの１つ。
    # グラフ上の全ての頂点間の最短経路を探す
    # 負の閉路（辺の重みの和が負になるような閉路）がない限り、負の辺があっても使える。

    # 負の閉路を持つ場合は'NEGATIVE CYCLE'を、そうでない場合には(i,j)成分に
    # 頂点iから頂点jへの最短経路の距離を格納するdist_listをprintする関数
    def warshall_floyd(v_num, dist_lst):
        # 負の閉路を持つか
        negative_cycle_flag = False

        # 頂点iから頂点jへの経路と、頂点kを経由した場合の経路とを比較して
        # よりコストの合計が小さい方を配列に入れる動的計画法
        for k in range(v_num):
            for i in range(v_num):
                for j in range(v_num):
                    # i→k→jがつながっててしかもi→jルートよりもイケてるなら更新
                    if dist_lst[i][k] != INF and dist_lst[k][j] != INF:
                        if dist_lst[i][j] > dist_lst[i][k] + dist_lst[k][j]:
                            dist_lst[i][j] = dist_lst[i][k] + dist_lst[k][j]

        for v in range(v_num):
            # dist_lstに負の数が格納されているとは、
            # グラフが負の閉路を持つことを意味する
            if dist_lst[v][v] < 0:
                negative_cycle_flag = True

        return dist_lst

    H, W = map(int, input().split())
    # 頂点の数と辺の数
    v_num, e_num = 10, 100

    # 配列dist_lst[a][b]には頂点a,b間の辺のコストを入れておき、
    # a=bの時は0を、a,b間の辺が存在しないときはINFを入れておく。
    INF = 10 ** 20
    dist_lst = [[INF] * v_num for _ in range(v_num)]

    costs = [[i for i in list(map(int, input().split()))] for _ in range(10)]
    for s in range(10):
        for t in range(10):
            dist_lst[s][t] = costs[s][t]

    dist_lst = warshall_floyd(v_num, dist_lst)
    wall = [[i for i in list(map(int, input().split()))] for _ in range(H)]
    cnt = 0
    for h in range(H):
        for w in range(W):
            val = wall[h][w]
            if val != -1:
                cnt += dist_lst[val][1]
    print(cnt)


resolve()


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

int main() {
	vector<int> vec(3);

	cin >> vec.at(0) >> vec.at(1) >> vec.at(2);

	sort(vec.begin(), vec.end());

	cout << vec.at(2) - vec.at(0) << endl;

	return 0;
}

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

using namespace std;

#define int long long
#define all(v) (v).begin(), (v).end()
#define resz(v, ...) (v).clear(), (v).resize(__VA_ARGS__)
#define reps(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep(i, n) reps(i, 0, n)

template<class T1, class T2> void chmin(T1 &a, T2 b){if(a>b)a=b;}
template<class T1, class T2> void chmax(T1 &a, T2 b){if(a<b)a=b;}

typedef pair<int, int> Pi;
typedef tuple<int, int, int> Ti;
typedef vector<int> vint;

const int inf = 1LL << 55;
const int mod = 1e9 + 7;

signed main()
{
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  string S;
  cin >> S;
  int n = S.size();
  set<char> st;
  rep(i, n) {
    st.insert(S[i]);
  }
  bool f = st.count('N')^st.count('S');
  bool g = st.count('W')^st.count('E');
  cout << (f|g ? "No" : "Yes") << endl;

  return 0;
}


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

using namespace std;

void failure () {
  cout << "NO" << endl;
  exit(0);
}

int swap_bit (int mask, int i, int j) {
  if (i == j) return mask;
  
  int ith = (mask >> i) & 1;
  int jth = (mask >> j) & 1;
  mask -= ith << i;
  mask -= jth << j;

  mask += ith << j;
  mask += jth << i;

  return mask;
}

int blog (int x) {
  return 31 - __builtin_clz(x);
}

int split (int mask) {
  int target = __builtin_popcount(mask) / 2;
  while (__builtin_popcount(mask) != target) {
    mask -= mask & -mask;
  }
  return mask;
}

vector<int> gray (int n, int mask, int a, int b) {
  if (n == 1) return {a, b};

  if (__builtin_popcount(a ^ b) == 1) {
    int dbit = a ^ b;

    mask -= dbit;
    int mid = mask & -mask;
    
    vector<int> l = gray(n - 1, mask, a, mid ^ a);
    vector<int> r = gray(n - 1, mask, mid ^ b, b);
    for (int u : r) {
      l.push_back(u);
    }
    return l;
  }

  // now there are at least 3 different bits in a and b
  int diff = a ^ b;
  int dbit = diff & -diff;
  diff -= dbit;
  mask -= dbit;
  
  int half = diff & -diff;
  vector<int> l = gray(n - 1, mask, a, half ^ a);
  vector<int> r = gray(n - 1, mask, diff ^ half ^ b, b);
  for (int u : r) {
    l.push_back(u);
  }
  return l;
}

int main () {
  int n, a, b;
  cin >> n >> a >> b;

  if (__builtin_popcount(a ^ b) % 2 == 0) {
    failure();
  }

  vector<int> ans = gray(n, (1 << n) - 1, a, b);

  /*
  for (int i = 0; i < (int) ans.size() - 1; i++) {
    if (__builtin_popcount(ans[i] ^ ans[i + 1]) != 1) {
      cerr << "=============== error =======================" << endl;
    }
  }
  */
  
  cout << "YES" << endl;
  for (int i = 0; i < (int) ans.size(); i++) {
    cout << ans[i] << " ";
  }
  cout << endl;
}


Measured memory_bytes: 1648
#include<string>
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<math.h>
#include<unordered_set>
#include<string.h>
#include<unordered_map>
using namespace std;

typedef long long ll;

#define FOR(i,N) for(int i=0;i<N;i++)

ll mod=1e9+7;

ll absll(ll a){
    if(a<0)return -1*a;
    return a;
}

int main() {
    int n,m;
    cin>>n>>m;
    vector<set<int> >v(n+2);
    for(int i=0;i<m;i++){
        int a,b;
        cin>>a>>b;
        v[a].insert(b);
        v[b].insert(a);
    }
    for(int i=1;i<n+1;i++){
        if(v[i].count(1)&&v[i].count(n)){
            cout<<"POSSIBLE"<<endl;
            return 0;
        }
    }
    cout<<"IMPOSSIBLE"<<endl;
    
    
}


Measured memory_bytes: 28416
words = ['A', 'C', 'T', 'G']

S = str(input())

ans = 0
answers = []

for i in range(len(S)):
    if S[i] in words:
        ans += 1
    else:
        answers.append(ans)
        ans = 0

answers.append(ans)

print(max(answers))


Measured memory_bytes: 3060
import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
    	int n = sc.nextInt();
      	int[] a = new int[n];
      	for(int i = 0; i < n; i++){
        	a[i] = sc.nextInt();
        }
      
      	long sum = 0;
      	int dis;

      	for(int i = 0; i < n-1; i++){
        	if(a[i] > a[i+1]){
            	dis = a[i] - a[i+1];
              	sum += dis;
              	a[i+1] += dis;
            }
        }
      
      	System.out.println(sum);
    }
}

Measured memory_bytes: 60112
using System;
using System.Collections.Generic;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;
using static System.Math;
using System.Numerics;
static class Program{
	const int mod=(int)1e9+7;
	static void Main(){
		Sc sc=new Sc();
		var s=sc.Ia;
		Array.Sort(s);
		Console.WriteLine("{0}",s[0]+s[1]);
	}
}

public class Sc{
	public int I{get{return int.Parse(Console.ReadLine());}}
	public long L{get{return long.Parse(Console.ReadLine());}}
	public double D{get{return double.Parse(Console.ReadLine());}}
	public string S{get{return Console.ReadLine();}}
	public int[] Ia{get{return Array.ConvertAll(Console.ReadLine().Split(),int.Parse);}}
	public long[] La{get{return Array.ConvertAll(Console.ReadLine().Split(),long.Parse);}}
	public double[] Da{get{return Array.ConvertAll(Console.ReadLine().Split(),double.Parse);}}
	public string[] Sa{get{return Console.ReadLine().Split();}}
	public object[] Oa{get{return Console.ReadLine().Split();}}
	public int[] Ia2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),int.Parse);}}
	public int[] Ia3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),int.Parse);}
	public int[] Ia3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),int.Parse);}
	public long[] La2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),long.Parse);}}
	public long[] La3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),long.Parse);}
	public long[] La3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),long.Parse);}
	public T[] Arr<T>(int n,Func<T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f();}return a;}
	public T[] Arr<T>(int n,Func<int,T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i);}return a;}
	public T[] Arr<T>(int n,Func<string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(Console.ReadLine().Split());}return a;}
	public T[] Arr<T>(int n,Func<int,string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i,Console.ReadLine().Split());}return a;}
}

Measured memory_bytes: 13268
#include<bits/stdc++.h>
 
using namespace std;
 
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
 
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(vector<vector<T>> x){cerr<<"\n{"; int f=x.size();for(int i=0;i<f;i++){cerr<<"("; int g=x[i].size(); for(auto j:x[i]){cerr<<j; (--g!=0)?cerr<<",":cerr<<"";}cerr<<")\n";}cerr<<"}";}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void __print(vector<bool> x){cerr<<"{";int f=x.size();for(auto i:x){cerr<<i;(--f !=0)?cerr<<",":cerr<<"";}cerr<<"}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
 
#ifndef ONLINE_JUDGE
#define trace(x...) cerr << "[" << #x << "] = [", _print(x)
#else
#define trace(x...)
#endif
 
template<typename... T>
void read(T&... args) {
    ((cin >> args), ...);
}
 
template<typename... T>
void writ(T&&... args) {
    ((cout << args << " "), ...);
}
#define ull unsigned long long
#define ll long long
#define MOD 1000000007
#define INF (ll)1e18
#define IINF (int)1e9
#define EPS 1e-9
/*
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    In the blazing sun I saw you
    In the shadows hiding from yourself
    When the lights are on I know you
    See you're grey from all the lies you tell 
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
*/

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    map<string,int> mp;
    int n; cin>>n;
    vector<string> vs{"AC","WA","TLE","RE"};
    for(int i=0;i<n;i++){
        string s; cin>>s;
        mp[s]++;
    }    
    for(auto i:vs){
        cout<<i<<" x "<<mp[i]<<endl;
    }
    return 0;
}



Measured memory_bytes: 3616
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC096
{
    class Program
    {
        public static void Main(string[] args)
        {
            /*
            var input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            int a = input[0];
            int b = input[1];
            int x = input[2];
            string result = "NO";
            */

            var str = Console.ReadLine();
            var a = str.ToCharArray();
                        
            var result = ((a[0]!=a[1]) && (a[1] != a[2]) && (a[0] != a[2])) ? "Yes" : "No";

            Console.WriteLine(result);
        }
    }
}

Measured memory_bytes: 13140
#include <bits/stdc++.h>
using namespace std;
#define int long long

signed main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int N;
    string S, T;
    cin >> N;
    cin >> S >> T;
    for (int i = 0; i < N; i++) {
      cout << S[i] << T[i];
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
int N;

void Search(std::string s, int n) {
  if (s.size() == N) {
    std::cout << s << std::endl;;
    return;
  }
  for (int i = 0; i < n; i++) {
    Search(s+(char)('a'+i), n);
  }
  Search(s+(char)('a'+n), n+1);
}

int main() {
  std::cin >> N;
  Search("a", 1);
}


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

int main() {
    int H, W;
    cin >> H >> W;

    for (int j = 0; j < H+2; j++) {
        cout << '#';
        if (j == 0 || j == H+1) {
            for (int i = 0; i < W; i++) {
                cout << '#';
            }
        }
        else{
            for (int i = 0; i < W; i++) {
                char s;
                cin >> s;
                cout << s; 
            }
        }
        cout << '#' << endl;
    }
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define INF 1e12

#define PB push_back
#define PF push_front
#define fi first
#define se second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vpi vector<pii>
#define vll vector<ll>
#define vpl vector<pll>
#define vvi vector<vector<int>>
#define vvl vector<vector<ll>>
#define mii map<int, int>
#define mci map<char, int>
#define MX(x) *max_element(all(x))
#define MN(x) *min_element(all(x))
#define ios ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define pr_d(x) cout << fixed << setprecision(15) << x << endl
#define ud(c, x) distance(c.begin(), upper_bound(all(c), x))
#define ld(c, x) distance(c.begin(), lower_bound(all(c), x))
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define rep3(i, n) for (int i = (n - 1); i >= 0; --i)
#define rep4(i, a, b) for (int i = (a); i > (b); --i)
#define pb push_back
#define out(x) cout << x << "\n"
bool odd(int i) { return i % 2; }

#define all(v) v.begin(), v.end()
#define size(x) int(x.size())

int gcd(int a, int b) { return __gcd(a, b); }
int lcm(int a, int b) { return a * (b / gcd(a, b)); }
void Yes_No(bool f) {
  if (f)
    printf("Yes\n");
  else
    printf("No\n");
}
void YES_NO(bool f) {
  if (f)
    printf("YES\n");
  else
    printf("NO\n");
}

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

template <typename T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
bool chmin(T& a, const T& b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
//-------------------ここから回答する-----------------------

void solve(void) {
  int n, m;
  cin >> n >> m;
  vvi g(n);
  rep(i, m) {
    int a, b;
    cin >> a >> b, --a, --b, g[a].pb(b), g[b].pb(a);
  }
  queue<int> q;
  vector<int> f(n, -1);
  q.push(0);
  f[0] = 0;
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    for (auto i : g[x])
      if (f[i] == -1) q.push(i), f[i] = f[x] + 1;
  }
  if (f[n - 1] < 3 && f[n - 1] != -1)
    out("POSSIBLE");
  else
    out("IMPOSSIBLE");
}
int main(void) { solve(); }

Measured memory_bytes: 15964
#include <bits/stdc++.h>
using namespace std;
template<class T> void gc(T &x)
{
    char c;
    int s = 0;
    x = 0;

    c = getchar_unlocked();

    if (c == '-') s = 1;
    else if ('0' <= c && c <= '9')  x = c - '0';

    while (true)
    {
        c = getchar_unlocked();

        if (c < '0' || c > '9') break;
        x = x * 10 + (c - '0');
    }

    if (s) x = -x;
}

int main()
{
    int n, p, ans = 0;
    bool read = true;
    gc(n);
    for (int i = 1; i <= n; i++) {
        gc(p);
        if (!read) { read = true; continue; }
        if (read && i == p) { ans++; read = false; }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i<(n);++i)
using namespace std;

int main(){
  string s;
  cin >> s;
  int ans = 0;
  int tmp = 0;
  rep(i,s.size()){
    if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') {
      tmp++;
      if (tmp>ans) ans = tmp;
    }
    else {
     tmp=0;
    }
  }
  cout << ans;
}

Measured memory_bytes: 256
// #define DEBUGGING
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ALL(V) (V).begin(), (V).end()
#define ALLR(V) (V).rbegin(), (V).rend()

template <typename T> using V = vector<T>;
template <typename T> using VV = V<V<T>>;
using ll = int64_t;
using ull = uint64_t;
using PLL = pair<ll, ll>;

template <typename T> const T& var_min(const T &t) { return t; }
template <typename T> const T& var_max(const T &t) { return t; }
template <typename T, typename... Tail> const T& var_min(const T &t, const Tail&... tail) { return min(t, var_min(tail...)); }
template <typename T, typename... Tail> const T& var_max(const T &t, const Tail&... tail) { return max(t, var_max(tail...)); }
template <typename T, typename... Tail> void chmin(T &t, const Tail&... tail) { t = var_min(t, tail...); }
template <typename T, typename... Tail> void chmax(T &t, const Tail&... tail) { t = var_max(t, tail...); }
template <typename T> const T& clamp(const T &t, const T &low, const T &high) { return max(low, min(high, t)); }
template <typename T> void chclamp(T &t, const T &low, const T &high) { t = clamp(t, low, high); }

namespace init__ {

struct InitIO {
    InitIO() {
        cin.tie(nullptr);
        ios_base::sync_with_stdio(false);
        cout << fixed << setprecision(30);
    }
} init_io;

}

#ifdef DEBUGGING
// #include "../debug/debug.cpp"
#include "../../debug/debug.cpp"
#else
#define DEBUG(...) 0
#define DEBUG_SEPARATOR_LINE 0
#endif

template <typename T>
T make_v(T init) { return init; }

template <typename T, typename... Tail>
auto make_v(T init, size_t s, Tail... tail) {
#define rec make_v(init, tail...)
    return V<decltype(rec)>(s, rec);
#undef rec
}

int main() {
    ll N, K, Q;
    cin >> N >> K >> Q;
    V<ll> score(N, K);
    for(ll i = 0; i < Q; i++) {
        ll a;
        cin >> a;
        score[a - 1]++;
    }
    for(auto &&ele : score) {
        ele -= Q;
        if(ele <= 0) cout << "No";
        else cout << "Yes";
        cout << endl;
    }
    return 0;
}


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


long long ara[2000009];
int main()
{
  ios_base :: sync_with_stdio(0);cin.tie(0);cout.tie(0);
 // freopen("in.txt","r",stdin);
long long i,j,n,sum=0;
long long M=1000000007;

scanf("%lld",&n);

for(i=1;i<=n;i++)
{
scanf("%lld",&ara[i]);
sum+=ara[i];
sum%=M;
}
long long total=0;
for(i=1;i<n;i++)
{
 sum-=ara[i];
 if(sum<0) sum+=M;
 total+=(sum*(ara[i]%M))%M;
}
total=(total%M);

printf("%lld\n",total);

  return 0;
}


Measured memory_bytes: 5404
#include<stdio.h>
#include<string.h>

typedef struct{
  char chr;
  int num;
}card;

void BubbleSort(card A[], int N);
void SelectionSort(card A[], int N);



int main(void){
  int n,i,cnt;
	scanf("%d",&n);

	card A[n],B[n];

	for(i=0;i<n;i++){
		scanf(" %c%d",&A[i].chr,&A[i].num);
    B[i]=A[i];
	}

  BubbleSort(A,n);
  SelectionSort(B,n);

  for(i=0;i<n;i++){
    if(A[i].chr!=B[i].chr){
      printf("Not stable\n");
      break;
    }
    if(i==n-1){
      printf("Stable\n");
    }
  }

  return 0;
}

void BubbleSort(card A[], int N){

  int j,i,cnt=0;
  card jump;

  for(j=0;j<N-1;j++){
    for(i=N-1;i>j;i--){
      if(A[i].num<A[i-1].num){
        jump=A[i];
        A[i]=A[i-1];
        A[i-1]=jump;
        cnt++;
      }
    }
  }

  for(i=0;i<N-1;i++){
		printf("%c%d ",A[i].chr,A[i].num);
	}
  printf("%c%d\n",A[i].chr,A[i].num);
  printf("Stable\n");

}

void SelectionSort(card A[], int N){

  int min,i,j,cnt=0;
  card jump;

  for(i=0;i<N;i++){
    min=i;
    for(j=i;j<N;j++){
      if(A[min].num>A[j].num){
        min=j;
      }
    }
    if(i!=min){
      jump=A[i];
      A[i]=A[min];
      A[min]=jump;
      cnt++;
    }
  }
  for(i=0;i<N-1;i++){
		printf("%c%d ",A[i].chr,A[i].num);
	}
  printf("%c%d\n",A[i].chr,A[i].num);
}



Measured memory_bytes: 2092
program sample
    implicit none
  
    integer(8) :: i,j,m,n,x,b,d
    
    integer(8),allocatable :: a(:),y(:)
  
    read(*,*) n
    read(*,*) d,x
    allocate(a(n))
    read(*,*)a
    m=0
    do i=1,n
       m=m+(d-1)/a(i)+1
    end do

    
    write(*,*)m+x
    
    
    stop
end program sample
  



Measured memory_bytes: 2796
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
	ll n; cin>>n;
	vector<ll>a(n);
	for(ll i=0;i<n;i++)
		cin>>a[i];
	sort(a.rbegin(),a.rend());
	ll ret=a[0];
	ll idx=1, cur=1;
	while(idx<n-1){
		ret += a[cur];
		idx++;
		if(idx==n-1) break;
		ret += a[cur];
		idx++;
		cur++;
	}
	cout<<ret<<endl;
	return 0;
}

Measured memory_bytes: 4764
#include<iostream>
#include<cstring>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
#include<vector>
#define ll long long
using namespace std;

struct Edge{
	int from,to;
	Edge(int u,int v):from(u),to(v){
	}
};

vector<Edge>edges;
vector<int>G[1000];
bool done_E[10000],done_N[10000],is[10000];
int pre[10000];

void dfs(int u){
	done_N[u]=true;
	for (int i=0;i<G[u].size();i++){
		Edge& e=edges[G[u][i]];
		if (!done_E[G[u][i]]){
			done_E[G[u][i]]=true;
			for (int j=0;j<G[e.to].size();j++){
				if (edges[G[e.to][j]].to==u){
					done_E[G[e.to][j]]=true;
					break;
				}
			}
			if (done_N[e.to]){
				is[G[u][i]]=true;
				int ite=pre[u];
				while (edges[ite].from!=e.to){
					is[ite]=true;
					ite=pre[edges[ite].from];
				}
				is[ite]=true;
				
			}else {
				pre[e.to]=G[u][i];
				dfs(e.to);
			}
		}
	}
	
}

int main(){
	int n,m;
	cin>>n>>m;
	for (int i=0;i<m;i++){
		int u,v;
		cin>>u>>v;
		edges.push_back(Edge(u,v));
		int m=edges.size();
		G[u].push_back(m-1);
		edges.push_back(Edge(v,u));
		m=edges.size();
		G[v].push_back(m-1);
		
	}
	
	dfs(1);
	int ans=0;
	for (int i=0;i<edges.size();i++){
		if (is[i]) ans++;
	}
	ans=m-ans;
	cout<<ans;
}

Measured memory_bytes: 256
import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    val N = new Scanner(System.in).nextLong()
    println(solve(N))
  }

  def solve(N: Long): Long = {
    val r = N % 11 match {
      case 0 => 0
      case r if r <= 6 => 1
      case _ => 2
    }
    (N / 11) * 2 + r
  }
}


Measured memory_bytes: 25424
#include<iostream>
#include<map>
#include<algorithm>
using namespace std;

int main(){
    int N;
    cin >> N;
    int a[100009];
    map<int, int> point;

    for (int i = 0; i < N; i++){
        cin >> a[i];
        point[a[i]]++;
    }
    int counter = 0;
    for (auto& x:point) {
        if(x.first <= x.second) counter += x.second - x.first;
        else counter += x.second;
    }
    cout << counter << endl;
    return 0;
}

Measured memory_bytes: 5120
open System

let NT = stdin.ReadLine().Split(' ');
let N = NT.[0] |> int;
let T = NT.[1] |> int;

let mutable min = 1000000;
for i in 0..N-1 do
    let ct = stdin.ReadLine().Split(' ');
    let c = ct.[0] |> int;
    let t = ct.[1] |> int;
    if t <= T then
        min <- Math.Min(min, c)


if min = 1000000 then
    "TLE" |> printfn "%s"
else
    min |> printfn "%d"


Measured memory_bytes: 14040
#include <stdio.h>

#define INF 9223372036854775807

int main()
{
    int h,n,a[1000],b[1000],i,j,k;

    scanf("%d %d",&h,&n);
    for (i = 0; i < n; i++)
    {
        scanf("%d %d",&a[i],&b[i]);
    }
    
    long long dp[20020];
    for (i = 0; i < 20020; i++)
    {
        dp[i] = INF;
    }
    
    dp[0] = 0;

    for (i = 0; i < h; i++)
    {
        if(dp[i] == INF)continue;
        for (j = 0; j < n; j++)
        {
            if(dp[i + a[j]] > dp[i] + b[j])dp[i + a[j]] = dp[i] + b[j];
        }
        for (j = 20018; j; j--)if(dp[j] > dp[j + 1])dp[j] = dp[j + 1];
    }
    printf("%lld",dp[h]);
}


Measured memory_bytes: 384
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<stack>
#include<queue>
#include<vector>
#include<algorithm>
#include<string>
#include<iostream>
#include<set>
#include<map>
#include<bitset>

using namespace std;
typedef long long ll;
#define i_7 (ll)(1E9+7)
#define i_5 (ll)(1E9+5)
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    else return c+i_7;
}
typedef pair<int,int> i_i;
typedef pair<ll,ll> l_l;
ll inf=(ll)1E12;/*10^12*/
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}

/////////////////////////////////////////////////////

const ll MAX_N=1<<20;
//セグメント木を持つグローバル配列
ll n,dat[2*MAX_N-1];
//初期化
void init(ll n_){
    //簡単のため要素数を2のべき乗に
    n=1;
    while(n<n_)n*=2;
    //全ての値をinfに
    for(ll i=0;i<2*n-1;i++)dat[i]=(1<<31)-1;
}
//k番目の値(0-indexed)をaに変更
void update(ll k,ll a){
    //葉の節点
    k+=n-1;
    dat[k]=a;
    //登りながら更新
    while(k>0){
        k=(k-1)/2;
        dat[k]=min(dat[k*2+1],dat[k*2+2]);
    }
}
//[a,b)の最小値を求める
//後ろの方の引数は、計算の簡単のための引数
//kは節点の番号、l,rはその節点が[l,r)に対応づいていることを表す。
//従って、[a,b)の最小値を求めたい時はquery(a,b,0,0,n)として呼ぶ
ll query(ll a,ll b,ll k,ll l,ll r){
    //[a,b)と[l,r)が交差しなければinf
    if(r<=a||b<=l)return inf;
    //[a,b)が[l,r)を完全に含んでいれば、この節点の値
    if(a<=l&&r<=b)return dat[k];
    else{
        //そうでなければ、2つの子の最小値
        ll vl=query(a,b,k*2+1,l,(l+r)/2);
        ll vr=query(a,b,k*2+2,(l+r)/2,r);
        return min(vl,vr);
    }
}
/////////////////////////////////////////////////////

int main(){
    ll N,Q;cin>>N>>Q;
    init(N);
    while(Q--){
        int a,b,c;cin>>a>>b>>c;
        if(a==0){
            update(b,c);
        }else{
            cout<<query(b,c+1,0,0,n)<<endl;
        }
    }
    
    return 0;
}



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

using namespace std; //ごめんなさい
using ll=long long;
using ull=unsigned long long;
using pii=pair<int,int>;

#define INF LONG_MAX
#define MOD 1000000007
#define rng(a) a.begin(),a.end()
#define rrng(a) a.end(),a.begin()
#define rep(i,N) for(int i=0;i<N;i++)

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

  ll A,B;
  cin>>A>>B;
  map<ll,ll>MA,MB;
  vector<bool>isprime(1000001,true);
  isprime[0]=false;
  isprime[1]=false;
  for(int i=2;i<=1000000;i++){
    if(isprime[i])for(int j=i+i;j<=1000000;j+=i){
      isprime[j]=false;
    }
  }
  vector<int>prime;
  for(int i=0;i<=1000000;i++){
    if(isprime[i])prime.push_back(i);
  }
  for(auto i:prime){
    while(A%i==0)A/=i,MA[i]++;
  }
  if(A!=1)MA[A]++;
  for(auto i:prime){
    while(B%i==0)B/=i,MB[i]++;
  }
  if(B!=1)MB[B]++;
  ll ans=0;
  for(auto it:MA){
    if(it.second>0&&MB[it.first]>0)ans++;
  }
  cout<<ans+1<<endl;
  return 0;
}


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

#define each(i, c) for (auto& i : c)
#define mkp(a, b) make_pair(a, b)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
const ll MOD = 1e9+7;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << ": " << p.second << ")"; return os; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; each (i, v) os << i << ", "; os << ")"; return os; }
template<typename K, typename V> ostream& operator << (ostream& os, map<K, V> m) { os << "{"; each (i, m) os << i << ", "; os << "}"; return os; }

int main() {
  string s;
  cin >> s;

  map<char, ll> check;
  for (ll i = 0; i < s.size(); ++i) {
    if (check.count(s[i])) {
      cout << -1 << endl;
      return 0;
    }
    check[s[i]] = 1;
  }

  string ans;
  if (s.size() == 26) {
    vector<string> o;
    for (ll i = 0; i < s.size(); ++i) {
      auto alpha = s.substr(i+1);
      string remain;
      for (ll j = 0; j < alpha.size(); ++j) {
        if (alpha[j] > s[i]) remain += alpha[j];
      }
      if (remain.size() == 0) continue;
      sort(remain.begin(), remain.end());
      o.push_back(s.substr(0, i) + remain[0]);
    }
    if (o.size() > 0) {
      sort(o.begin(), o.end());
      ans = o[0];
    }
  } else {
    vector<bool> alpha(26, false);
    for (ll i = 0; i < s.size(); ++i) {
      alpha[s[i]-'a'] = true;
    }

    vector<char> remain;
    for (ll i = 0; i < 26; ++i) {
      if (alpha[i]) continue;
      remain.push_back('a'+i);
    }
    sort(remain.begin(), remain.end());

    ans = s;
    ans += remain[0];
  }

  if (ans == "") ans = "-1";
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 256