akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

typedef long long ll;

#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define INF 10e12
#define MOD 1000000000 + 7
#define MX 51000
#define all(x) (x).begin(), (x).end()
#define MAX(x) *max_element(all(x))
#define MIN(x) *min_element(all(x))

using namespace std;

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N, M;
    cin >> N >> M;
    vector<ll> vec(N);
    rep(i, N) cin >> vec[i];
    ll total = accumulate(all(vec), 0);
    sort(all(vec), greater<ll>());
    ll ans = 0;
    rep(i, N)
    {
        if (4 * vec[i] * M >= total)
            ans++;
        else
            break;
    }

    if (ans >= M)
        cout << "Yes\n";
    else
        cout << "No\n";
}


Measured memory_bytes: 3600
if __name__ == '__main__':
    s = input().rstrip().split(' ')
    N, K = int(s[0]), int(s[1])
    s = input().rstrip().split(' ')
    A = [int(elem) for elem in s]

    route_until_loop = []
    route_dict = {}
    loop = []
    pos = 0
    count = 0
    while True:
        route_until_loop.append(pos)
        route_dict[pos] = count
        count += 1
        # go next
        pos = A[pos]-1
        if pos in route_dict.keys():
            break;

    loop = route_until_loop[route_dict[pos]:]
    route_until_loop = route_until_loop[:route_dict[pos]]

    #print(route_until_loop)
    #print(loop)

    if K < len(route_until_loop):
        print(route_until_loop[K]+1)
    else:
        K -= len(route_until_loop)
        print(loop[K%len(loop)]+1)

Measured memory_bytes: 59544
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
//INSERT ABOVE HERE
signed main(){
  Int n,k;
  cin>>n>>k;
  vector<Int> v;
  for(Int i=1;i*i<=n;i++){
    if(n%i) continue;
    v.emplace_back(i);
    v.emplace_back(n/i);
  }
  sort(v.begin(),v.end());
  v.erase(unique(v.begin(),v.end()),v.end());
  Int m=v.size();

  const Int MOD = 1e9+7;
  auto mod_pow=[&](Int b,Int x){
    Int res=1;
    while(x){
      if(x&1) res=res*b%MOD;
      b=b*b%MOD;
      x>>=1;
    }
    return res;
  };
  //Int inv=mod_pow(2,MOD-2);
  
  Int ans=0;
  vector<Int> dp(m);
  for(Int i=0;i<m;i++){
    dp[i]=mod_pow(k,(v[i]+1)/2);
    for(Int j=0;j<i;j++)
      if(v[i]%v[j]==0) dp[i]+=MOD-dp[j];
    dp[i]%=MOD;
    if(v[i]&1) ans+=dp[i]*v[i]%MOD;
    else ans+=dp[i]*(v[i]/2)%MOD;
    ans%=MOD;
    //cout<<v[i]<<":"<<dp[i]<<endl;
  }
  
  cout<<ans<<endl;
  return 0;
}


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


signed main(){
    int A,B;
    cin>>A>>B;
    int C=B*2+1;
    if(A%C==0){
        cout <<A/C<<endl;
    }
    else{
        cout <<A/C+1<<endl;
    }
}



Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();

		int result = b + Math.min(a + b + 1, c);

		System.out.println(result);
	}
}


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

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL) ;
                                              
    string s ; 
    cin >>s ; 
    string res = "No" ; 
    for(int i = 0 ;i < 3 ; ++i)
    {
    	if(s[i] == '7')
    		res = "Yes" ; 

    }
    cout << res ; 
}    


















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

signed main(void)
{
	int n, k, ans;
	cin >> n >> k;
	int x[n];
	rep(i, n) cin >> x[i];
	ans = 0;
	rep(i, n)
		ans += min(x[i] * 2, abs(k - x[i]) * 2);
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(void) {

	int N, count, i;

	cin >> N;

	count = 0;
	for (i = 1; i <= N; i++) {
		if (i % 2 == 1) count += 1;
	}
	cout << (double)count / N << endl;
	return 0;

}

Measured memory_bytes: 256
#include<stdio.h>
int main (void){
int a;
int b;
scanf("%d",&a);
scanf("%d",&b);
if(a < b) {
printf("a < b\n");
}
else if(a > b){
printf("a > b\n");
}
else if (a == b){ 
printf("a == b\n");
}
return 0;
}

Measured memory_bytes: 580
require 'prime'
require 'set'
require 'tsort'
include Math
ALP = ('a'..'z').to_a
INF = 0xffffffffffffffff
def max(a,b);              a > b ? a : b                              end
def min(a,b);              a < b ?  a : b                             end
def swap(a,b);             a, b = b, a                                end
def gif;                   gets.to_i                                  end
def gff;                   gets.to_f                                  end
def gsf;                   gets.chomp                                 end
def gi;                    gets.split.map(&:to_i)                     end
def gf;                    gets.split.map(&:to_f)                     end
def gs;                    gets.chomp.split.map(&:to_s)               end
def gc;                    gets.chomp.split('')                       end
def pr(num);               num.prime_division                         end
def pr?(num);              Prime.prime?(num)                          end
def digit(num);            num.to_s.length                            end
def array(s,ini=nil);      Array.new(s){ini}                          end
def darray(s1,s2,ini=nil); Array.new(s1){Array.new(s2){ini}}          end
def rep(num);              num.times{|i|yield(i)}                     end
def repl(st,en,n=1);       st.step(en,n){|i|yield(i)}                 end

a,b,c = gi
m = max(max(a,b),c)
m += 1 if 3 * m % 2 != (a+b+c) % 2
puts  (3 * m - (a+b+c))/2


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

int main(){
    int n, a[4][3][10] = {};
    cin >> n;
    for(int i = 0 ; i < n ; i++){
        int b, f, r, v;
        cin >> b >> f >> r >> v;
        a[b - 1][f - 1][r - 1] += v;
    }
    for(int i = 0 ; i < 4 ; i++){
        for(int j = 0 ; j < 3 ; j++){
            for(int k = 0 ; k < 10 ; k++){
                cout << " " << a[i][j][k];
            }
            cout << endl;
        }
        if(i != 3) cout << "####################" << endl;
    }
    return 0;
}


Measured memory_bytes: 3076
#include<stdio.h>
int main(void){
	int L,A,B,C,D,a,b,c;
	scanf("%d%d%d%d%d",&L,&A,&B,&C,&D);
	a=A/C;
	if(A%C!=0){a++;}
	b=B/D;
	if(B%D!=0){b++;}
	if(a>b){
	c=L-a;
	}else{
	c=L-b;
	}
	printf("%d\n",c);
	return 0;
}

Measured memory_bytes: 596
///Bismillahir Rahmanir Rahim
#include "bits/stdc++.h"

#define                           ll                          long long
#define                           int                         ll
#define                           fi                          first
#define                           si                          second
#define                           mp                          make_pair
#define                           pb                          push_back
#define                           pi                          pair<ll,ll>
#define                           clr(x)                      memset(x,0,sizeof(x));
#define                           f(i,l,r)                    for(int i=l;i<=r;i++)
#define                           rf(i,r,l)                   for(int i=r;i>=l;i--)
#define                           done(i)                     cout<<"done = "<<i<<endl;
#define                           show(x,y)                   cout<<x<<" : ";for(auto z:y)cout<<z<<" ";cout<<endl;
#define                           fast                        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

using namespace std;

const ll inf=1e18;
const int mod=1e9+7;
const int M=200005;
map<string,int>cnt;
set<string>s;
string ss[M];
int mx=0;
 main()

{
    fast
    int n;
    cin>>n;
    f(i,1,n)
    {
       cin>>ss[i];
       cnt[ss[i]]++;
       mx=max(mx,cnt[ss[i]]);
    }
    f(i,1,n)
    {
        if(cnt[ss[i]]==mx)s.insert(ss[i]);
    }
    for(auto x:s)
    {
        cout<<x<<endl;
    }
    return 0;

}





































Measured memory_bytes: 41140
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
typedef pair<ll, ll> P;

int main(int argc, char const *argv[]) {
    int n,m;
    cin >> n >> m;
    vector<ll> a(n);
    vector<P> b(m);
    REP(i,n) cin >> a[i];
    REP(i,m) {
        ll x, y; cin >> x >> y;
        b.push_back({y, x});
    }
    sort(a.begin(), a.end());
    sort(b.begin(), b.end(), greater<>());
    ll ans = 0ll;
    int now = 0;
    REP(i,m) {
        auto itr = upper_bound(a.begin(), a.end(), b[i].first);
        ll dist = itr-a.begin(); ll ff = b[i].first; ll se = b[i].second;
        ll hoge = min((ll)b[i].second, dist-now);
        // hoge = max(0ll, hoge-now);
        if (hoge <= 0) hoge = dist-now;
        // printf("i = %d now = %d hoge = %lld ans = %lld\n", i, now, hoge, ans);
        if (hoge <= 0) break;
        ans += (b[i].first*hoge);
        // printf("i = %d now = %d hoge = %lld ans = %lld\n", i, now, hoge, ans);
        now += hoge;
    }
    for (int i = now; i < n; ++i) {
        ans += a[i];
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 5632
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
#define F first
#define S second
#define pb push_back
#define mp make_pair

const int MOD = 1000000007;
const int N = 1e5 + 18;



int32_t main()
{
    ios_base::sync_with_stdio(false); cin.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#endif
    int t = 1;
    //cin >> t;
    while (t--) {

        int cntAC(0), cntWA(0), cntRE(0), cntTLE(0);
        int n;
        cin >> n;
        for (int i = 0; i < n; i++) {
            string s;
            cin >> s;
            if (s == "AC")
                cntAC++;
            else if (s == "WA")
                cntWA++;
            else if (s == "TLE")
                cntTLE++;
            else
                cntRE++;
        }
        cout << "AC x " << cntAC << endl;
        cout << "WA x " << cntWA << endl;
        cout << "TLE x " << cntTLE << endl;
        cout << "RE x " << cntRE;
    }
    return 0;

}



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

struct Node {
    int key;
    struct Node *right, *left, *parent;
};
typedef struct Node Node;

Node *root, *NIL;

void insert(int k) {
    Node *y = NIL;
    Node *x = root;
    Node *z;
    
    z = (Node *)malloc(sizeof(Node));
    z->key   = k;
    z->left  = NIL;
    z->right = NIL;
    
    while(x != NIL) {
        y = x;
        if(z->key < x->key) {
            x = x->left;
        } else {
            x = x->right;
        }
    }
    
    z->parent = y;
    if(y == NIL) {
        root = z;
    } else {
        if( z->key < y->key) {
            y->left = z;
        } else {
            y->right = z;
        }
    }
}

void inorder(Node *u) {
    if(u == NIL) return;
    inorder(u->left);
    printf(" %d",u->key);
    inorder(u->right);
}
void preorder(Node *u) {
    if(u == NIL) return;
    printf(" %d",u->key);
    preorder(u->left);
    preorder(u->right);
}
    
int main(void) {
    int n, i, x;
    char com[16];
    scanf("%d",&n);
    
    for(i=0;i<n;i++) {
        scanf("%s",com);
        if(!strcmp(com,"insert")) {
            scanf("%d",&x);
            insert(x);
        } else if(!strcmp(com,"print")) {
            inorder(root);
            printf("\n");
            preorder(root);
            printf("\n");
        }
    }

    return 0;
}

/*
8
insert 30
insert 88
insert 12
insert 1
insert 20
insert 17
insert 25
print
*/


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

#define int long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x) cout << #x << " = " << (x) << endl;
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define SP << " " <<

typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;
typedef vector<ll> vec;
typedef vector<P> pvec;
typedef vector<vector<ll>> vvec;
typedef vector<vector<P>> pvvec;
typedef priority_queue<ll> PQI;
typedef priority_queue<P> PQP;
typedef priority_queue<ll,vector<ll>,greater<ll>> PQIG;
typedef priority_queue<P,vector<P>,greater<P>> PQPG;

const vector<int> dx = {0, -1, 0, 1, 1, 1, -1, -1};
const vector<int> dy = {1, 0, -1, 0, 1, -1, 1, -1};
constexpr int MOD = (1000000007);
// const int MOD = (998244353);
// const int INF = (1 << 30); // 1073741824
const int INF = (1LL << 60); // 1152921504606846976
const double EPS = (1 >> 30);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return 1;} return 0;}
template<class T> inline T ceil(T a, T b) {return T((a + b - 1) / b);}
template<class T> inline T round(T a, T b) {return T(a / b);}
template< typename T1, typename T2 > istream &operator>>(istream &is, pair< T1, T2 > &p) { is >> p.first >> p.second; return is; }
template <class T> inline void out(T &a) { bool flag=true; for(auto&x:a){if(flag) {flag=false;} else{ cout << ' '; } cout<<x; } cout << endl; }



//----------------------------------------------------------------
int nmax=200000; // 2*(10^5)
vvec g(nmax);





void solve()
{
    
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    while(a>0||c>0){
        c-=b;
        if(c<=0) break;
        a-=d;
    }
    if(a<=0){
        cout<<"No"<<endl;
    }
    else if(c<=0){
        cout<<"Yes"<<endl;
    }
    
}
//-----------------------------------------------------------------

signed main(){ ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(15);
    int repeat = 1;
    // cin >> repeat;
    while(repeat--) solve();
}

Measured memory_bytes: 7816
#include<bits/stdc++.h>
using namespace std;
#define int               long long
#define pb                push_back
#define ppb               pop_back
#define pf                push_front
#define ppf               pop_front
#define all(x)            (x).begin(),(x).end()
#define uniq(v)           (v).erase(unique(all(v)),(v).end())
#define sz(x)             (int)((x).size())
#define fr                first
#define sc                second
#define pii               pair<int,int>
#define loop(i,a,b)        for(int i=a;i<b;i++)
#define mem1(a)           memset(a,-1,sizeof(a))
#define mem0(a)           memset(a,0,sizeof(a))
#define ppc               __builtin_popcount
#define ppcll             __builtin_popcountll
#define br                break
#define con               continue

template<typename T1,typename T2>istream& operator>>(istream& in,pair<T1,T2> &a){in>>a.fr>>a.sc;return in;}
template<typename T1,typename T2>ostream& operator<<(ostream& out,pair<T1,T2> a){out<<a.fr<<" "<<a.sc;return out;}
template<typename T,typename T1>T amax(T &a,T1 b){if(b>a)a=b;return a;}
template<typename T,typename T1>T amin(T &a,T1 b){if(b<a)a=b;return a;}
 
const long long INF=1e18;
const int32_t M=1e9+7;
const int32_t MM=998244353;

priority_queue<pii, vector<pii>, greater<pii> >q;
signed main(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output1.txt","w",stdout);
	#endif
    ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
    float d,t,s;
    cin>>d>>t>>s;
    if(d/s<=t)
        cout<<"Yes"<<endl;
    else 
        cout<<"No"<<endl;
 
}

Measured memory_bytes: 3736
//#pragma comment(linker, "/STACK:102400000,102400000")
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define X first
#define Y second
#define MAXN 200010

char s[MAXN];
int nxt[MAXN][26];
int d[200], mx[MAXN];

int main()
{
	//freopen("input", "r", stdin);
	//freopen("output", "w", stdout);
	
	scanf("%s", s + 1);
	int n = strlen(s + 1);
	for (int i = 0; i < 26; ++i)
		nxt[n + 1][i] = n + 1;
	for (int i = n; i >= 1; --i)
	{
		for (int j = 0; j < 26; ++j)
			nxt[i][j] = nxt[i + 1][j];
		nxt[i][s[i] - 'a'] = i;
		mx[i] = 1e9;
		bool flag = true;
		for (int j = 'a'; j <= 'z'; ++j)
			if (d[j] < d[s[i]])
			   flag = false;
        d[s[i]] += flag;
        for (int j = 'a'; j <= 'z'; ++j)
        	mx[i] = min(mx[i], d[j]);
	}
	int len = mx[1] + 1, pre = 0;

	while(len)
	{
		for (char j = 'a'; j <= 'z'; ++j)
		{
			if (nxt[pre + 1][j - 'a'] == n + 1 || mx[nxt[pre + 1][j - 'a'] + 1] < len - 1)
  			{
                printf("%c", j);
             	pre = nxt[pre + 1][j - 'a'];
             	len--;
            	break;
			} 
		}
	} 
	printf("\n");
	return 0;
}

Measured memory_bytes: 21504
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define enld '\n'
#define rep(i,n) for(int i=0; i<(n); i++)
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("Ofast")
constexpr ll INF = 1e18;
constexpr int inf = 1e9;
constexpr ll mod = 1000000007;
constexpr ll mod2 = 998244353;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[6] = {1, 0, -1, 0,1,1};
const int dy[6] = {0, 1, 0, -1,1,-1};
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; }
// ---------------------------------------------------------------------------

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int N,K;
    cin >> N >> K;
    vector<int> A(N);
    for(int i=0; i<N; i++){
        cin >> A[i];
        A[i]--;
    }
    vector<int> S(N+1,0);
    for(int i=0; i<N; i++){
        S[i+1] = (S[i] + A[i])%K;
    }
    queue<int> que;
    map<int,int> mp;
    ll ans = 0;
    for(int i=0; i<=N; i++){
        ans += mp[S[i]];
        mp[S[i]]++;
        que.push(S[i]);
        if(que.size() == K){
            mp[que.front()]--;
            que.pop();
        }
    }
    cout << ans << enld;
    return 0;
}

Measured memory_bytes: 12032
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt();
		int W=in.nextInt();
		int[] w=new int[n];
		long[] v=new long[n];
		for (int i=0;i<n;++i) {
			w[i]=in.nextInt();
			v[i]=in.nextLong();
		}
		long[] dp=new long[W+1];
		for (int i=0;i<n;++i)
			for (int j=W;j>=w[i];--j)
				dp[j]=Math.max(dp[j],dp[j-w[i]]+v[i]);
		System.out.println(dp[W]);
	}
}

Measured memory_bytes: 23252
#include <cstdio>
#include <memory.h>
#include <cstring>
#include <vector>
#include <deque>
#include <cstdlib>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cassert>
#include <functional>
#include <iostream>
#include <set>
#include <list>
#include <map>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
using namespace std;

typedef long long ll;
typedef unsigned long long llu;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<int, ll> pil;
typedef pair<string, int> psi;
const ll MOD = 1e9 + 7;
const long double PI = 3.141592653589793238462643383279502884197;

priority_queue<int, vector<int>, greater<int> > pq;
vector<int> v;

int mat[50][50];
int ans[50][50];
int n;

void cal(int a[][50], int b[][50]) {
	int temp[50][50] = { 0 };

	for (int i = 0; i < n; i++)
		for (int j = 0; j < n; j++)
			for (int k = 0; k < n; k++)
				temp[i][j] = (temp[i][j] + (ll)a[i][k] * b[k][j]) % MOD;

	memcpy(a, temp, sizeof(temp));
}

int main() {
	ll k;
	scanf("%d %lld", &n, &k);

	for (int i = 0; i < n; i++)
		for (int j = 0; j < n; j++)
			scanf("%d", &mat[i][j]);

	for (int i = 0; i < n; i++) ans[i][i] = 1;
	while (k) {
		if (k % 2) cal(ans, mat);
		cal(mat, mat);
		k /= 2;
	}

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

	printf("%lld", sum % MOD);
}

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

int main()
{
 	int K,N;
    cin >> K >> N;
    
    int *A = new int[N]; 
    for (int i = 0; i < N; i++) {
      cin >> A[i];
    }
  
    int max_dist = A[0] + (K - A[N-1]);
    for (int i=0; i<N-1; i++) {
      if (A[i+1] - A[i] > max_dist) {
        max_dist = A[i+1]-A[i];
      }
    }
 
    cout << K-max_dist << endl;

    delete [] A;
}

Measured memory_bytes: 1024
n,k,q=map(int,input().split())
a=[]
for i in range(q):
    a.append(int(input()))
import collections
c=collections.Counter(a)
c=list(c.items())
p=[0]*n
for i in c:
    p[i[0]-1]=i[1]
line=1-(k-q)
for i in p:
    if i>=line:
        print('Yes')
    else:
        print('No')

Measured memory_bytes: 14752
import math

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

count = 0

for i in range(0, N):
    minj = i
    for j in range(i, N):
        if A[j] < A[minj]:
            minj = j
    if i != minj:
        count += 1
        temp = A[i]
        A[i] = A[minj]
        A[minj] = temp
    
print(' '.join(map(str, A)))
print(count)

Measured memory_bytes: 7764
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] firstLineArr = sc.nextLine().split(" ");
		String[] secondLineArr = sc.nextLine().split(" ");
		sc.close();
		
		int n = Integer.parseInt(firstLineArr[0]);
		int k = Integer.parseInt(firstLineArr[1]);
		
		int numOfRider = 0;
		
		for(int i = 0; i < n; i++) {
			if(k <= Integer.parseInt(secondLineArr[i])) {
				numOfRider++;
			}
		}
		
		System.out.println(numOfRider);
	}

}


Measured memory_bytes: 35264
import itertools
import sys
import math
import numpy as np
from collections import deque
from itertools import combinations
from functools import reduce
from functools import lru_cache
sys.setrecursionlimit(10**9)

def main():
    A,B = map(int,input().split())
    for x in range(3000):
        if math.floor(x*0.08) == A and math.floor(x*0.1) == B:
            print(x)
            exit()

    print(-1)



if __name__ == "__main__":
  main()


Measured memory_bytes: 21140
#include <iostream>
#include <string>

using namespace std;

bool isPalindromic(int X){
    string str = to_string(X);
    bool isOK = true;
    for(int i = 0; i < str.size(); i++){
        if(str[i] != str[str.size() - i - 1])
            isOK = false;
    }

    return isOK;
}

int main(){
    int A, B;
    int count = 0;

    cin >> A >> B;

    for(int i = A; i < B + 1; i++){
        if(isPalindromic(i))
            count++;
    }

    cout << count;

    return 0;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <vector>
#include <utility>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <tuple>
#include <list>
#include <set>
#include <map>
#include <functional>
#include <cmath>
#include <cstring>
#include <cstdlib>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;

#define xx first
#define yy second
#define $1 first
#define $2 second

void solveCase() {
	ios::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	ll n; cin >> n;
	string s = to_string(n);
	for (int i = 0; i < s.length(); i++) {
		if (s[i] == '7') { cout << "Yes"; return; }
	}
	cout << "No";
}

int main() {

#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
#endif
	solveCase();
}

Measured memory_bytes: 3700
#include <iostream>
#include<bits/stdc++.h>
#include<vector>
#include<string>
#define ll long long
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define vi vector<ll>
#define el printf("\n")

#define s second
#define pb(x) push_back(x)
#define f first
using namespace std;
bool visited[1000005]={0};
vector<ll> mp[1000005];
vector <ll> dist; /// distance dans un arbre
vector<ll> dp(1000005,0);
const long long U=1e8+7;
void dfs(ll s)
{
    visited[s]=true;
    for (int i=0;i<mp[s].size();i++)
    {
        if (visited[mp[s][i]]==false)
        {
            dfs(mp[s][i]);
        }
        dp[s]=max(dp[s],1+dp[mp[s][i]]);
    }
}


    int main()
    {   ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);cout.precision(30);
        IOS;
        ll n,m;
        cin >> n>>m;
        vector<vector<ll>> dp(n+1,vector<ll>(m+1,-1));
        for(int i=1;i<=n;i++)
        {
            for(int j=1;j<=m;j++)
            {
                char c;
                cin >> c;
                if(c=='#')
                {
                    dp[i][j]=0;
                }
            }
        }
        int i;
        for(i=1;i<=n;i++)
        {
            if(dp[i][1]!=0)
            {dp[i][1]=1;}
            if(dp[i][1]==0)
                break;
        }
        for(i;i<=n;i++)
        {
            dp[i][1]=0;
        }
         int j;
        for(j=1;j<=m;j++)
        {
            if(dp[1][j]!=0)
            {dp[1][j]=1;}
            if(dp[1][j]==0)
                break;
        }
        for(j;j<=m;j++)
        {
            dp[1][j]=0;
        }
        for(int i=2;i<=n;i++)
        {
            for(int j=2;j<=m;j++)
            {
                if(dp[i][j]==-1)
                    dp[i][j]=(dp[i-1][j]%1000000007+dp[i][j-1]%1000000007);
            }
        }

        cout << dp[n][m]%1000000007;
        return 0;
    }


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

int main(){
  string a,b;
  cin >> a >> b;
  int c = stoi(a+b);
  int d = (c+1)/2;
  for(int i = 1; i<d+1; i++){
    if(c==i*i) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}

Measured memory_bytes: 768
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log,pi
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？


n=ii()

print(2*pi*n)






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

int main()
{ 
  int n;
  vector<string> w(100);
  bool flag = true;

  cin >> n;
  for (int i = 0; i < n; i++)
  {
    cin >> w[i];
    if (i == 0)
      continue;
    if (w[i - 1][w[i - 1].size() - 1] != w[i][0])
      flag = false;
    for (int j = 0; j < i; j++)
    {
      if (w[i] == w[j])
        flag = false;
    }
    if (!flag)
      break;
  }
  cout << (flag ? "Yes" : "No") << endl;
}

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

int main(){
	using ll = long long int ;
	ll h,n ; cin >> h >> n ;
	ll sum = 0 ;
	ll sub ;
	for(int i=0;i<n;i++){
		cin >> sub ;
		sum += sub ;
	}
	if(sum>=h) cout << "Yes" << endl ;
	else cout << "No" << endl ;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int nax = 1e5+5;
const int INF = 1e9+5;


int a[nax];
int b[nax];
int c[nax];
int main(){
	int n, m;
	
	cin >> n >> m;
	vector<vector<int>>dist(n, vector<int>(n, INF));
	for(int i=0; i<m; i++){
		cin >> a[i] >> b[i] >> c[i];
		a[i]--;
		b[i]--;
		dist[a[i]][b[i]] = c[i];
		dist[b[i]][a[i]] = c[i];
	}
	vector<vector<int>>g = dist;
	// using floyd warshall.
	for(int k=0; k<n; k++){
		for(int i=0; i<n; i++){
			for(int j=0; j<n; j++){
				dist[i][j] = min(dist[i][j], dist[i][k]+dist[k][j]);
			}
		}
	}

	int cnt = 0;
	for(int i = 0; i<m; i++){
		if(g[a[i]][b[i]] != dist[a[i]][b[i]]) cnt++;
	}
	cout << cnt << endl;
	return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <algorithm>
 
using namespace std;
 
int main()
{

     
    int n;
    cin >> n;
 
    int* S = new int[n];
 
    for(int i=0; i<n; i++) {
        cin >> S[i];
    }
    sort(S, S+n);
 
    int q, T;
    cin >> q;
    int count = 0;
    for(int i=0; i<q; i++) {
        cin >> T;
        if(binary_search(S, S+n, T)) {
            count++;
        }
    }
    cout << count << endl;
}

Measured memory_bytes: 1240
#include<iostream>
using namespace std;
int main(){
    string a;
    cin >> a;
    if(a =="Sunny"){
        cout << "Cloudy" <<endl;

    }
    else if(a == "Cloudy"){
        cout << "Rainy" <<endl;

    }
    else{
        cout << "Sunny" <<endl;

    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(long long i=0;i<x;i++)
#define repn(i,x) for(long long i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
vector<pair<string,P> >vec;

void solve(long long N){
	cout << N*(N-1)/2 << endl;
}

int main(){	
	long long N;
	scanf("%lld",&N);
	solve(N);
	return 0;
}



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

int main(void){
 
  int N,Y;
  
  cin >> N >> Y;
  
  int x = -1, y = -1, z = -1;
  
  for(int i = 0; i <= N; i++){
    for(int j = 0; j <= N - i; j++){
      int k = N - i - j;
      int total = i * 10000 + j * 5000 + k * 1000;
      if(total == Y){
         x = i;
         y = j;
         z = k;
         break;
      }
    }
  }
  
  cout << x << " " << y << " " << z << endl;
  
  
  return 0;
}


Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

        List<Integer> medianList = new ArrayList<>();
        int temp = 0;
        for (int i = 1; i <= N; i++) {
            temp = sc.nextInt() - i;
            medianList.add(temp);
        }

        Collections.sort(medianList);

        int sub = 0;
        if (N % 2 == 1) {
            sub = medianList.get(N / 2);
        } else {
            sub = ((medianList.get(N / 2 - 1) + medianList.get(N / 2))) / 2;
        }

        long sum = 0;
        for (int i = 0; i < N; i++) {
            sum += Math.abs(medianList.get(i) - sub);
        }

        System.out.println(sum);

        sc.close();

    }
}


Measured memory_bytes: 95196
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=1000000007;
const double PI=3.14159265358979;
const ll INF= pow(10,18);
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  
int main() {
  ll D,G;
  cin >> D >> G;
  vl p(D),c(D);
  rep(i,D){
    cin >> p[i] >> c[i];
  }
  vvl dp(D,vl(D*100,-INF));//dp[i][j]で、(i+1)*100点文台以上で計j問解いた時の得点の最大値とする。
  rep(i,p[D-1]){
    dp[D-1][i]=100*D*i;
  }
  ll sumP=p[D-1];
  dp[D-1][p[D-1]]=100*D*p[D-1]+c[D-1];
  for(ll i=D-2;i>=0;i--){
    sumP+=p[i];
    rep(j,sumP+1){
      if(j<=sumP-p[i]){
        dp[i][j]=dp[i+1][j];
      }
      else{
        dp[i][j]=dp[i+1][sumP-p[i]]+100*(i+1)*(j-sumP+p[i]);
      }
      if(j>=p[i]){
        dp[i][j]=max(dp[i][j],dp[i+1][j-p[i]]+p[i]*(i+1)*100+c[i]);
      }
      else if(sumP-p[i]<j&&j<p[i]){
        dp[i][j]=max(dp[i][j],dp[i+1][sumP-p[i]]+(j-sumP+p[i])*(i+1)*100);
      }
    }
  }
  ll i=0;
  while(dp[0][i]<G){
    i++;
  }
  cout << i << endl;
}

Measured memory_bytes: 384
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define N 2000000
#define pi M_PI

struct node{
    unsigned int key;
    struct node *next;
    struct node *prev;
};
typedef struct node * NodePointer;

NodePointer nil;

void init(){
    nil = malloc(sizeof(struct node));
    nil->next = nil;
    nil->prev=nil;
}

void printList(){
  NodePointer cur = nil->next;
  int isf = 1;
  while(1){
    if ( cur == nil ) break;
    if ( isf == 0)  printf(" ");
    printf("%d", cur->key);
    cur = cur->next;
    isf = 0;
  }
  printf("\n");
}


void deleteNode(NodePointer t){
    NodePointer pr = t->prev,nx=t->next;
    pr->next=nx;
    nx->prev=pr;
    free(t);
}
void deleteFirst(){
    NodePointer t=nil->next;
    if(t==nil) return;
    deleteNode(t);
}
void deleteLast(){
    NodePointer tmp=nil->prev;
    nil->prev=tmp->prev;
    deleteNode(tmp);
}
void delete(int key){
    NodePointer cur = nil->next;

  while(1){
    if(cur==nil) break;
    if(cur->key == (unsigned int)key){
      deleteNode(cur);
      break;
    }
    cur = cur->next;
  }
}
void insert(int k){
  NodePointer x;
  x = malloc(sizeof(struct node));
  x->key = k;
  x->next = nil->next;
  nil->next->prev = x;
  nil->next = x;
  x->prev = nil;
}

int main(){
  int key, n, i;
  int size = 0;
  char com[20];
  int np = 0, nd = 0;
  scanf("%d", &n);
  init();
  for ( i = 0; i < n; i++ ){
    scanf("%s%d", com, &key);
    if ( com[0] == 'i' ) {insert(key); np++; size++;}
    else if ( com[0] == 'd' ) {
      if (strlen(com) > 6){
    if ( com[6] == 'F' ) deleteFirst();
    else if ( com[6] == 'L' ) deleteLast();
      } else {
    delete(key); nd++;
      }
      size--;
    }
  }
  NodePointer cur = nil->next;
 int isf = 1;
  while(1){
    if ( cur == nil ) break;
    if ( isf == 0)  printf(" ");
    printf("%d", cur->key);
    cur = cur->next;
    isf = 0;
  }
  printf("\n");

  return 0;
}



Measured memory_bytes: 32988
#include<iostream>

using namespace std;
int main(){
	
	long q, h, s, d, n;
	long Q, H, S, D,N;
	cin >> q >> h >> s >> d >> n;
	Q = 4 * q;
	H = 2 * h;
	S = s;
	D = d / 2;
	N = n-1;
	if (Q <= H&&Q <= S&&Q <= D){
		cout << n * Q << endl;
		return 0;
	}
	if (H <= Q&&H <= S&&H <= D){
		cout << n * H << endl;
		return 0;
	}
	if (S <= Q&&S <= H&&S <= D){
		cout << n * S << endl;
		return 0;
	}
	if (D <= Q&&D <= S&&D <= H){
		if (n % 2==0){
			cout << n/2*d << endl;
			return 0;
		}
		else{
			if (Q <= H&&Q <= S){
				n = Q;
			}
			if (H <= Q&&H <= S){
				n = H;
			}
			if (S <= Q&&S <= H){
				n = S;
			}
			cout << n+N/2*d  << endl;
		}
	}
	return 0;


}

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

int h[3];
void trans(int a){
	h[0] = a/3600;
	h[1] = (a%3600)/60;
	h[2] = a%60;
}

void disp(){
	for(int i = 0;i < 3;i++){
		if(i)cout << ":";
		if(h[i] < 10)cout << "0";
		cout << h[i];
	}
	cout << endl;
}

int main(){
	while(cin >> h[0] >> h[1] >> h[2]){
		if(h[0] == -1)break;
		int a = 7200 - (h[0]*3600 + h[1]*60 + h[2]);
		trans(a);disp();
		trans(3*a);disp();
	}
	
	return 0;
}

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

#define int long long
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define pb push_back
#define fi first
#define se second
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

int N,M;
int A[111111];
int S[20][111111];
int cnt[20];
int dp[1<<20];

signed main(){
    cin>>N>>M;
    rep(i,N)cin>>A[i],A[i]--;
    rep(i,N){
        S[A[i]][i+1]++;
        cnt[A[i]]++;
    }
    rep(i,M)rep(j,N)S[i][j+1]+=S[i][j];

    fill_n(dp,1<<20,INT_MAX);
    dp[0]=0;
    rep(i,1<<M){
        int s=0;
        rep(j,M)if(i>>j&1)s+=cnt[j];
        rep(j,M){
            if(i>>j&1)continue;
            int tmp=S[j][s+cnt[j]]-S[j][s];
            tmp=cnt[j]-tmp;
            chmin(dp[i|(1<<j)],dp[i]+tmp);
        }
    }

    cout<<dp[(1<<M)-1]<<endl;
    return 0;
}

Measured memory_bytes: 27724
// #include <bits/stdc++.h>
#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<set>
#include<map>
#include<queue>
#define rep(i,n) for(int i=0;i<n;i++)
#define exf(x)	 for(auto&& tmp : x) { cout << tmp << endl; }	// 拡張for
#define PI 3.14159265358979323846264338327950288
const int MOD{ int(1e9 + 7) };	// = 1000000007
const int inf{ 2100000000 };	// = 2100000000 (MAX:2147483647)
typedef long long ll;
using namespace std;

// -------------------------------------------------- //
// ------------------ ここから本編 ------------------ //
// -------------------------------------------------- //

int main(void) {

	int N, K; cin >> N >> K;
	vector<int> H(N); rep(i, N)cin >> H[i];

	sort(H.begin(),H.end(), greater<int>());
	ll ans = 0;
	for (int i = K; i < N; i++) {
		ans += H[i];
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 4040
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define whole(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
using P = pair<int, int>;
#define debug(var) cerr << "[" << #var << "] " << var << endl
#define chmin(x, y) x = min(x, y)
const ll mod = 1000000007;
const int dx[] = {-1,0,1,0};
const int dy[] = {0,-1,0,1};

vector<int> objx[2005];
vector<int> objy[2005];

int main(){
    int h, w;
    cin >> h >> w;
    vector<string> s(h);
    rep(i, h) cin >> s[i];
    rep(i, h) objx[i].push_back(-1);
    rep(j, w) objy[j].push_back(-1);
    rep(i, h) rep(j, w) {
        if (s[i][j]=='#') {
            objx[i].push_back(j);
            objy[j].push_back(i);
        }
    }
    rep(i, h) objx[i].push_back(w);
    rep(j, w) objy[j].push_back(h);
    int ans = 0;
    

    rep(i, h) rep(j, w) {
        if (s[i][j]=='#') continue;
        int x1, x2;
        int y1, y2;
        auto itx = upper_bound(objx[i].begin(), objx[i].end(), j);
        x2 = *itx;
        itx--;
        x1 = *itx;
        auto ity = upper_bound(objy[j].begin(), objy[j].end(), i);
        y2 = *ity;
        ity--;
        y1 = *ity;
        int res = (x2-x1-1) + (y2-y1-1) - 1;
        
        ans = max(res, ans);
    }
    
    
    
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 38528
# coding: utf-8
 
s = input()
n = len(s)
f = 1

ss = s[:(n-1)//2]
for i in range((n-1)//4):
    if not ss[i] == ss[-1*(i+1)]:
        f = 0
        break

tt = s[(n+3)//2-1:]
for i in range((n-1)//4):
    if not tt[i] == tt[-1*(i+1)]:
        f = 0
        break

if ss != tt:
    f = 0

if f:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3064
#include<stdio.h>
int main(void)
{
	int n,a,b,c,d,v=0,w=0,x=0,y=0;
	scanf("%d %d %d %d %d", &n, &a, &b, &c, &d);
	while(v<n||w<n)
	{
		if(v<n)
		{
			v+=a;
			x+=b;
		}
		if(w<n)
		{
			w+=c;
			y+=d;
		}
	}
	if(x>y)
	x=y;
	printf("%d\n", x);
	
	return 0;
}


Measured memory_bytes: 2112
#include<bits/stdc++.h>
using namespace std;
typedef double db;
typedef long long ll;//溢出会变成负值 
typedef long double ldb;
typedef unsigned long long ull;//自动取模2^64
const double pi=acos(-1.0);
const int mod = 1e9+7; // 998244353;
const int inf = 0x7fffffff;//2^31-1
const ll INF = 0x7fffffffffffffff;
const int dx[]={-1,0,1,0},dy[]={0,1,0,-1};
//ll begin_time=clock();    ll end_time=clock();  cout<<"time = "<<end_time-begin_time<<" ms!"<<endl;
//bool operator < (const mmp &a) const{return x<a.x||x==a.x&&y<a.y;}       //map<int,map<int,int> >z;
//map<int,int>::iterator it;for(it=z.begin();it!=z.end();it++)printf("%d %d\n",it->first,it->second);
//ll poww(ll a,ll b){ll s=1;while(b){if(b&1)s=(s*a)%mod;a=(a*a)%mod;b>>=1;}return s%mod;}  //快速幂取模 
//lower_bound(begin,end,num); 第一个>=num的数字  upper_bound(begin,end,num); 第一个>num的数字 返回地址 
//freopen("input.in","r",stdin);     freopen("output.out","w",stdout);      //文件读写提交 
//reverse(s.begin(),s.end());   //反转字符串        floor(); 向下取整  ceil(); 向上取证 
//数轴上n个点移动到同一位置，移动到该组数字的中位数的总距离最短 
bool isPrime(int n){if(n==2||n==3)return 1;if(n%6!=1&&n%6!=5)return 0;
int t=sqrt(n);for(int i=5;i<=t;i+=6)if(n%i==0||n%(i+2)==0)return 0;return 1;}//判断素数 


int main()
{
	ios::sync_with_stdio(false);cin.tie(0);
	ll a,b,c,d,e,f,g,T;  
//	cin>>T;
	//while(T--)
	{
		char x;
		cin>>x; 
		if(x>='a'&&x<='z')cout<<'a'<<endl;
		else cout<<'A'<<endl;
	}
	
}



Measured memory_bytes: 3580
extern crate core;

use std::io::{self, Read};
use std::collections::HashMap;

fn main() {
    let mut input = String::new();
    io::stdin().read_to_string(&mut input).unwrap();
    let output = run(input.trim().to_string());
    println!("{}", output);
}

fn run(input: String) -> String {
    let mut list = input
        .split_whitespace()
        .skip(1)
        .map(|x| x.parse::<i64>().unwrap())
        .fold(HashMap::new(), |mut map, x| {
            let v = map.get(&x).map(|i| i + 1).unwrap_or(1);
            map.insert(x, v);
            map
        })
        .into_iter()
        .flat_map(|(x, y)| {
            if y >= 4 {
                vec![x, x]
            } else if y >= 2 {
                vec![x]
            } else {
                vec![]
            }
        })
        .collect::<Vec<_>>();
    list.sort();
    list.reverse();
    if list.len() >= 2 {
        list[0] * list[1]
    } else {
        0
    }.to_string()
}

macro_rules! tests {
    ($($name:ident: $input:expr=>$output:expr,)*) => {
        mod tests {
            $(
                #[test]
                fn $name() {
                    assert_eq!(super::run($input.to_string()), $output.to_string());
                }
            )*
        }
    }
}

tests! {
    test1: "6
3 1 2 4 2 1" => "2",
    test2: "4
1 2 3 4" => "0",
test3:"10
3 3 3 3 4 4 4 5 5 5"=>"20",
}


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

int main() {
    long long n, d, count = 0;
    cin >> n >> d;
    
    for(int i = 1; i <= n; i++) {
        long long x, y;
        cin >> x >> y;
        if(x*x + y*y <= d*d) count++;
    }
    
    cout << count;
}

Measured memory_bytes: 3596
# print('input >>')
A, B, C = map(int,(input().split()))
K = int(input())

for _ in range(K):
    if B >= C:
        C *= 2
    elif A >= B:
        B *= 2

if A < B and B < C:
    print('Yes')
else:
    print('No')

# print('-----output-----')

Measured memory_bytes: 9140
#include <bits/stdc++.h>
using namespace std;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define all(v) v.begin(),v.end()
#define SZ(v) ((int)v.size())
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define Max(a, b) a = max(a, b)
#define Min(a, b) a = min(a, b)
#define bit(n) (1LL<<(n))
#define bit_exist(x, n) ((x >> n) & 1)
#define Ans(f, y, n) if(f) cout << y << endl; else cout << n << endl;
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v) cout << #v << "=" << endl; REP(i, v.size()){ cout << v[i] << ","; } cout << endl;
#define mdebug(m) cout << #m << "=" << endl; REP(i, m.size()){ REP(j, m[i].size()){ cout << m[i][j] << ","; } cout << endl;}
#define pb push_back
#define f first
#define s second
#define int long long
#define INF 1000000000000000000

using vec = vector<int>;
using mat = vector<vec>;
using Pii = pair<int, int>;
using PiP = pair<int, Pii>;
using PPi = pair<Pii, int>;
using bools = vector<bool>;
using pairs = vector<Pii>;

template<typename T> void readv(vector<T> &a){ REP(i, a.size()) cin >> a[i]; }
void readv_m1(vector<int> &a){ REP(i, a.size()){cin >> a[i]; a[i]--;} }

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

int mod = 1000000007;
//int mod = 998244353;
#define Add(x, y) x = (x + (y)) % mod
#define Mult(x, y) x = (x * (y)) % mod



signed main(){

    int A, B, C; cin >> A >> B >> C;
    Ans(A == B && B == C, "Yes", "No");

    return 0;
}


Measured memory_bytes: 256
import Control.Monad (replicateM)
import Data.List (sortBy,transpose)
import Data.Ord (comparing)

main = do
    [n,m] <- getLine >>= return . map read . words
    if all (==0) [n,m] then return () else do
        studentMarks <- replicateM n (getLine >>= return . map read . words)
            :: IO ([[Int]])
        let
            locationMarks = transpose studentMarks
            locationCounts = map (length . filter (==1)) locationMarks
            locationCountPairs = zip [1..m] locationCounts
            sortedLocations = map fst $
                sortBy (flip (comparing snd)) locationCountPairs

        putStrLn $ unwords $ map show sortedLocations

        main

Measured memory_bytes: 18320
#include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <climits>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <cassert>
#include <unordered_map>

#define _(x) { cout << #x << " = " << x << " "; }

const double E = 1e-8;
const double PI = acos(-1);

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    string s;
    set<string> st;
    while(n--) {
        cin >> s;
        st.insert(s);
    }

    cout << st.size() << '\n';
    return 0;
}



Measured memory_bytes: 19228
using namespace std;

#include <iostream>
#include <vector>
#include <set>
#include <string>
#include <algorithm>
#include <utility>
#include <functional>
#include <queue>
#include <cmath>
#include <numeric>
#include <map>
using namespace std;


int main(void){
	long long int N,M;
    map<pair<string, int>, int> SP;

	cin >> N>>M;

  	vector<vector<int>> s(M);
  vector<int> p(M);
  
  for (auto& i : s) {
    int k;
    cin >> k;
    i.resize(k);
    for (auto& j : i)
      cin >> j;
  }
  for (auto& j : p)
    cin >> j;
  
  int r = 0;
  for (int now = 0; now < (1 << N); now++) {
    int tsum = 0;
    for (int i = 0; i <  s.size();i++){
      int sum = 0;
      tsum += 1;
      for (auto j : s[i]) {
        if ((now >> (j-1)) % 2)
          sum++;
      }
      if (sum % 2 != p[i]) {
        tsum--;
        break;
      }
    }
    if (tsum == M)
      r++;
  }
  cout << r << endl;
	return 0;
}


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

using namespace std;

//#define int long long
#define FOR(i, j, k) for(int i = j; i < k; ++i)g+
#define rep(i, j) FOR(i, 0, j)
#define INF (1 << 30)
#define fi first
#define se second

typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<P, int> Pi;
typedef pair<P, P> PP;

const int MOD = 1e9 + 7;
const int dy[]={0, 0, 1, -1};
const int dx[]={1, -1, 0, 0};

template <class T> void chmin(T& a, const T& b) { a = min(a, b); }
template <class T> void chmax(T& a, const T& b) { a = max(a, b); }

signed main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int a, b, c;
    cin >> a>> b >> c;
    if(a == b) cout << c << endl;
    else if(a == c) cout << b << endl;
    else if(b == c) cout << a << endl;
    return 0;
}

Measured memory_bytes: 256