akhauriyash/Code-Regression huggingface dataset:
import heapq as H

N, M = list(map(int, input().split()))
A = list(map(lambda x: -int(x), input().split()))
H.heapify(A)

for _ in range(M):
    x = H.heappop(A)
    H.heappush(A, int(x / 2))

print(-sum(A))

Measured memory_bytes: 72216
#include<bits/stdc++.h>
using namespace std;
typedef long long  ll ;
typedef double db;
const double pi = 3.141592654;
#define pb         push_back
#define forab(i,a,b)       for(int i=(a);i<=(b);i++)
#define CIN	ios_base::sync_with_stdio(0); cin.tie(0)
#define pcase(z,x)     printf("Case %ld: %lld\n",z,x)
#define nw	 "\n"
#define mod 1000000007

int main(void)
{
	CIN;
	ll tc,l,k,sum=0,x=0,y,z=0,m=1,n=0,ans=0,cnt=0;
	cin>>n;
	map<ll,ll>mp;
	for(ll i=1;i<=n;i++){
		cin>>x;
		mp[i]=x;
		sum+=x;
	}
	cin>>m;
	while(m--){
		cin>>x>>y;
		cout<<sum-mp[x]+y<<nw;
	}

}

Measured memory_bytes: 3624
#include <stdio.h>


int main(void) {

	// 1_1-C Rectangle
	int a,b,s,l;
	scanf("%d %d",&a,&b);
	
	// ??¢???
	s = a * b;

	// ??¨?????????
	l = (a+b) * 2;

	printf("%d %d\n",s,l);
        return 0;
}

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

#define ed cout << "\n";
#define speed                         \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
#define ll long long
#define ffor(i, a, b) for (ll i = (ll)(a); i < (ll)(b); ++i)
#define rep(i, n) ffor(i, 0, n)
#define All(obj) (obj).begin(), (obj).end()
#define INF ((ll)1e9 + 7)
#define c(a) cout << a << "\n";
using namespace std;
const int N = 100005;

int main()
{
    speed;
    cout << fixed << setprecision(6);
    /*start*/
    int n, m;
    cin >> n >> m;
    vector<int> WA(n,0);
    vector<bool> AC(n,false);
    int WAcount = 0;
    int ACcount = 0;
    rep(i, m)
    {
        int a;
        string b;
        cin >> a >> b;
        if(AC[a])continue;
        else{
            if(b=="AC"){
                AC[a] = true;
                ACcount++;
                WAcount += WA[a];
            }else{
                WA[a]++;
            }
        }
    }
    cout << ACcount << " " << WAcount;
    ed;
    return 0;
}

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

#define MAX(X,Y) ((X)>(Y)?(X):(Y))

int main(void){
  long long ans, acc[5001];
  int n;
  
  while (cin >> n){
    if (n==0) break;
    acc[0] = 0;
    for (int i=0; i<n; i++){
      int t;
      cin >> t;
      acc[i+1] = t + acc[i];
    }
    ans = -(1<<31-1);
    for (int i=0; i<n; i++){
      for (int j=0; j<=i; j++){
        int sum = acc[i+1] - acc[j];
        ans = MAX(ans, sum);
      }
    }
    cout << ans << endl;
  }
  return 0;
}


Measured memory_bytes: 3028
n,m,x=[int(x) for x in input().split()]
b=[]
for i in range(n):
    c=[int(x) for x in input().split()]
    b.append(c)

import itertools
l=[]
a=itertools.product(range(2),repeat=n)
for i in a:
    l.append(i)

ans=5000000
e=0

for i in range(2**n):
    skill=[0]*m
    p=0
    for j in range(n):
        if l[i][j]==1:
            p+=b[j][0]
            for k in range(m):
                skill[k]+=b[j][k+1]
    s=min(skill)
    if s>=x:
        e=1
        ans=min(ans,p)
if e==1:
    print(ans)
else:
    print(-1)

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

int main(){
	string s,t;
	cin>>s>>t;
	int a,b;
	cin>>a>>b;
	string u;
	cin>>u;
	if(s.compare(u)==0) cout<<a-1<<" "<<b;
	else cout<<a<<" "<<b-1;
}

Measured memory_bytes: 3604
main(i,z){
	double p=atan2(1,0)*2,r;
	for(;scanf("%lf",&r),r;){
		for(i=0;i<999999;i++){
			z=(int)(p*i);
			if(p-r<z*1.0/i){printf("%d/%d\n",z,i);break;}
			if((z+1)*1.0/i<p+r){printf("%d/%d\n",z+1,i);break;}
		}
	}
	exit(0);
}

Measured memory_bytes: 620
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include <algorithm>
using namespace std;
const int maxn=1e5+10;
int N,A;
struct node
{
	int index,value;
}a[maxn];
bool cmp(node &a,node &b)
{
	return a.value<b.value ;
}
int main()
{
	cin>>N;
	for(int i=1;i<=N;i++)
	{
		cin>>A;
		a[i].index=i;
		a[i].value=A;
	}
	sort(a+1,a+N+1,cmp);
	for(int i=1;i<=N;i++)
	{
		cout<<a[i].index<<" ";
	}
	return 0;
 } 

Measured memory_bytes: 1536
import java.util.Arrays;
import java.util.Scanner;


public class Main {
    static final Scanner sc = new Scanner(System.in);
    static final int MOD = (int) 1E9 + 7;
    
    public static void main(String[] args) {
        int N = nint();
        int[] v = nints(N);
        
        Arrays.sort(v);
        
        double sum = (double) (v[0] + v[1]) / Math.pow(2, N-1);
        
        for (int i = 2; i < N; i++) {
            sum += (double) v[i] / Math.pow(2, N-i);
        }
        
        System.out.println(sum);
    }

    private static long nlong() {
        return sc.nextLong();
    }

    private static int nint() {
        return sc.nextInt();
    }

    private static String nstr() {
        return sc.next();
    }

    private static char[] nsToChars() {
        return sc.next().toCharArray();
    }

    private static long[] nlongs(int n) {
        return nlongs(n, 0, 0);
    }

    private static int[] nints(int n) {
        return nints(n, 0, 0);
    }

    private static int[] nints(int n, int padL, int padR) {
        int[] a = new int[padL + n + padR];
        for (int i = 0; i < n; i++)
            a[padL + i] = nint();
        return a;
    }

    private static long[] nlongs(int n, int padL, int padR) {
        long[] a = new long[padL + n + padR];
        for (int i = 0; i < n; i++)
            a[padL + i] = nlong();
        return a;
    }

    private static String[] nstrs(int n) {
        String[] a = new String[n];
        for (int i = 0; i < n; i++)
            a[i] = nstr();
        return a;
    }

    private static char[][] nsToChars2D(int h, int w) {
        return nsToChars2D(h, w, 0);
    }

    private static char[][] nsToChars2D(int h, int w, int pad) {
        char[][] a2 = new char[h + pad * 2][w + pad * 2];
        for (int i = 0; i < h; i++)
            System.arraycopy(nsToChars(), 0, a2[pad + i], pad, w);
        return a2;
    }
}


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

using namespace std;

struct I{I(){ios::sync_with_stdio(false);cin.tie(0);}}init;

const double eps=1e-10;
int main(){
    int R,C,res=0;
    cin>>R>>C;
    vector<string> f(R);
    for(int i=0;i<R;i++){
        cin>>f[i];f[i]+="..";
    }
    reverse(f.begin(),f.end());
    f.push_back(string(C+2,'.'));
    f.push_back(string(C+2,'.'));
    using T=tuple<int,int>;
    map<double,T> d;
    for(int i=1;i<=R;i++)
        for(int j=1;j<=C;j++){
            auto dd=atan2(i,j);
            if(d.count(dd))d[dd]=min(d[dd],T(i,j));
            else d[dd]=T(i,j);
        }
    vector<int> X(R,C+1);
    vector<int> Y(C,1);
    for(auto &it:d){
        int cross=0;
        if(f[0][0]=='#')cross++;
        int l=0,m=0,r=0;
        int x,y;
        tie(x,y)=it.second;
        double k=y/(double)x;
        for(int i=0;i<R;i++){
            double yy=k*(i+1);
            while(yy+eps<X[i])X[i]--;
            if(yy-eps<X[i]&&X[i]<yy+eps){
                int mask=0;
                if(f[i][X[i]-1]=='#')mask|=1;
                if(f[i][X[i]]=='#')mask|=2;
                if(f[i+1][X[i]-1]=='#')mask|=4;
                if(f[i+1][X[i]]=='#')mask|=8;
                switch(mask){
                case 0:
                case 15:break;
                case 13:
                case 2:r+=2;break;
                case 11:
                case 4:l+=2;break;
                default:cross++;break;
                }

            }
            else{
                if(f[i][X[i]]!=f[i+1][X[i]])cross++;
            }
        }
        k=x/(double)y;
        for(int i=0;i<C;i++){
            double xx=k*(i+1);
            while(xx-eps>Y[i]&&Y[i]<=R)Y[i]++;
            if(xx-eps<Y[i]&&Y[i]<xx+eps)continue;
            if(f[Y[i]-1][i]!=f[Y[i]-1][i+1])cross++;
        }
        //cout<<x<<" "<<y<<endl;
        //if(x==3&&y==8)cout<<cross<<" "<<l<<" " <<r<<endl;
        res=max(res,1+(cross+max({l,r}))/2);
        //cout<<res<<endl;
    }
    cout<<res<<endl;
    return 0;
}

Measured memory_bytes: 17828
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define int ll
#define For(a, b, c) for(int a = b; a <= c; ++a)
#define Ford(a, b, c) for(int a = b; a >= c; --a)
#define All(a, b) for(auto &a : b)
#define Rep(a, b, c) for(int a = b; a < c; ++a)
#define int long long
#define ii pair<int,int>
#define fi first
#define se second
#define pb push_back
#define all(a) a.begin(),a.end()
#define reset(a, b) memset(a, b, sizeof(a))
#define bit(x, i) (x >> (i - 1) & 1ll)
#define onbit(x, i) (x | (1ll << (i - 1)))
#define offbit(x, i) (x & ~(1ll << (i - 1)))
#define bitone(i) __builtin_popcountll(i)
#define bitl(i) __builtin_clz(i)
#define bitr(i) __builtin_ctz(i)
#define vi vector<ll>
/********************************************************

Digvijay Bahadur Singh
MNNIT

*********************************************************/


const int MOD=1e9+7;
const int N = 1e6+100;
/********************************************************************/
                 /* GRAPH*/
//vector<vector<ll>> g;
//vector<bool> vis1,vis2;
/*******************************************************************/
ll power(ll a,ll b)
{
   ll ans =1;
   while(b>0){
   if(b&1) ans = (ans * a);
   a = (a * a);
   b=b>>1;
   }
   return ans;
}

signed main(){
	ios::sync_with_stdio(0); cin.tie(0);cout.tie(0);
  // ifstream cin("a1.in");
  // ofstream cout("a1.out");
	ll T;
 // cin>>T;
  
    T=1;
    
    while(T--)
  {
    ll n;
    cin>>n;
    vi a(n);
    ll mini=INT_MAX,maxi=INT_MIN;
    for(ll i=0;i<n;i++)
    {
      cin>>a[i];
      mini=min(mini,a[i]);
      maxi=max(maxi,a[i]);
    }
    
    ll ans=INT_MAX;
    for(ll i=mini;i<=maxi;i++)
    {
      ll temp=0;
      for(int j=0;j<n;j++)
      {
        temp+=abs(i-a[j])*abs(i-a[j]);
      }
      ans=min(ans,temp);
    }
    cout<<ans<<"\n";



       







  
  }
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
    string  arr[100];
    int h, w;
    cin >> h >> w;
    for (int i = 0; i < h; i++) {
        cin >> arr[i];
    }
    for (int i = 0; i < h; i++) {
        cout << arr[i]<<endl;
        cout << arr[i] << endl;
    }
  
    return 0;
}


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

#define INF 1000000007
#define LINF 1000000000000000007

using namespace std;

typedef long long Int;
typedef pair<Int, Int> P;

Int gcd(Int x, Int y){
	if(y == 0)
		return x;
	return gcd(y, x % y);
}

Int lcm(Int x, Int y){
	return x * y / gcd(x, y);
}

bool sosuu(int x){
	bool b = 1;
	if(x == 1) b = 0;
	for(int i = 2; i * i <= x; i++){
		if(x % i == 0) {
			b = 0;
			break;
		}
	}
	return b;
}

int n, k;

int main(){
	cin >> n >> k;
	int ans = 1;
	
	for(int i = 0; i < n; i++){
		if(k > ans) ans += ans;
		else ans += k;
	}
	
	cout << ans << endl;
	
	return 0;
}

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

int main() {
    ll X , a = 100 , count = 0;
    cin >> X;
    while(a < X){
        a*=1.01;
        a/=1;
        count++;
    }
    cout << count << endl;
}

Measured memory_bytes: 3632
///Bismillahir Rahmanir Rahim
#include<bits/stdc++.h>
#define        u64             uint64_t
#define        ll              long long
#define        endl            "\n"
#define        PI              acos(-1)
#define        fi              first
#define        si              second
#define        mkp             make_pair
#define        pb              push_back
#define        set0(arr)       memset(arr, 0, sizeof(arr))
#define        setinf(arr)     memset(arr, 126, sizeof(arr))
#define        all(x)          (x).begin(),(x).end()
#define        sz(v)           ((int)(v).size())
#define        maxm         1000005
#define        IOS             ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
using          pll        =      pair<ll, ll> ;
using          vl         =      vector<ll> ;
using          vpll       =      vector<pll> ;
using          mll        =      map<ll, ll> ;
using          mcl        =      map<char, ll> ;
using          msl        =      map<string,ll> ;
using          sl         =      set<ll> ;
using          sc         =      set<char> ;
using          dl         =      deque<ll> ;
const int N = 1e6+5 ;

ll      mod = 1e9+7 ;
vl      adj[N] ;
vpll    adjc[N] ;
ll      vis[N] ;
ll      arr[N],arr1[N] ;

bitset <maxm>isprime;
vector<long long >primes;
void autop()
{
    isprime.set();
    isprime[0]=isprime[1]=false;
    for(int i=0;i<maxm;i++)
    {
        if(isprime[i])
        {
            primes.push_back(i);
            for(int j=i*2;j<maxm;j+=i)
                isprime[j]=false;
        }
    }
}

int main()
{
    IOS;
    ll a, b, c, d, n, m, p, x, y, z, i, j, k, f = 0, tc, cnt = 0, sum = 0, mul = 1, mi = 1e18, ma = -1e18;
    string   str ;
    char     ch ;
    double   db ;
    ll       l, r ;
    //code
        autop();
        cin>>n;
        for(i=0;i<n;i++) cin>>arr[i];
        mll mp;
        f=0;
        for(k=0;k<n;k++)
        {
               x=arr[k];
             ll num=x;
        for(i=0;primes[i]*primes[i]<=x&&num>1;i++)
        {
           if(num%primes[i]==0){
                     if(mp[primes[i]]==1) f=1;
                     mp[primes[i]]=1;
            while(num%primes[i]==0)
            {
                num=num/primes[i];
            }
           }
        }
        if(num!=1){
             if(mp[num]==1) f=1;
             mp[num]=1;
            }

        }



        if(f==0)
        {
               cout<<"pairwise coprime\n";
               return 0;
        }
         x=__gcd(arr[0],arr[1]);
        for(i=2;i<n;i++)
               x=__gcd(x,arr[i]);
        if(x==1)
               cout<<"setwise coprime\n";
        else
               cout<<"not coprime\n";


    //code
    return 0;
}




Measured memory_bytes: 63600
// RAM RAM

#include <bits/stdc++.h>
#define int long long
#define pb push_back
#define ppb pop_back
#define vi vector<int>
#define mp make_pair
#define arrayin(a,n) for(int i=0;i<n;i++){cin>>a[i];}
#define N 55

using namespace std;

  
int pos(string a){
	int res=0;
    for(int i=0;i<a.length()-1;i++){
    	if(a[i]!=a[i+1])
    		res++;
    }
    return res;
}

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

    string a,b,c;cin>>a>>b>>c;
    cout<<a[0]<<b[0]<<c[0]<<endl;
	return 0;
}

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

static const int N = 4;
static const int N2 = 16;

static const int dx[] = {0,-1,0,1};
static const int dy[] = {1,0,-1,0};
int MDT[N2][N2];

struct Puzzle {
    int f[N2], space, MD;
    int cost;
    bool operator < (const Puzzle& p) const {
	for(int i=0; i<N2; i++) {
	    if( f[i] == p.f[i] ) continue;
	    return f[i] < p.f[i];
	}
	return false;
    }
};

struct State {
    Puzzle puzzle;
    int estimated;
    bool operator < (const State& s) const  {
	return estimated > s.estimated;
    }
};

int getAllMD(Puzzle pz) {
    int sum=0;
    for(int i=0; i<N2; i++) {
	if( pz.f[i] == N2 ) continue;
	sum += MDT[i][pz.f[i]-1];
    }
    return sum;
}

inline void dump(Puzzle& u) {
    for(int i=0; i<N; i++) {
	for(int j=0; j<N; j++)
	    cout << u.f[i*N+j] << " " ;
	cout << endl;
    }
}

int astar(Puzzle s) {
    priority_queue<State> PQ;
    s.MD = getAllMD(s);
    s.cost = 0;
    map<Puzzle, bool> V;
    Puzzle u,v;
    State initial;
    initial.puzzle = s;
    initial.estimated = getAllMD(s);
    PQ.push(initial);

    while( !PQ.empty() ) {
	State st = PQ.top(); PQ.pop();
	u = st.puzzle;
	if( u.MD == 0 ) return u.cost;
	V[u] = true;

	int sx = u.space / N;
	int sy = u.space % N;
	for(int r=0; r<4; r++) {
	    int tx = sx + dx[r];
	    int ty = sy + dy[r];
	    if( tx<0 or ty<0 or tx>=N or ty>=N ) continue;
	    v = u;

	    v.MD -= MDT[tx*N+ty][v.f[tx*N+ty]-1];
	    v.MD += MDT[sx*N+sy][v.f[tx*N+ty]-1];

	    swap(v.f[sx*N+sy], v.f[tx*N+ty]);
	    v.space = tx*N+ty;
	    if( !V[v] ) {
		v.cost++;
		State news;
		news.puzzle = v;
		news.estimated = v.cost + v.MD;
		PQ.push(news);
	    }
	}
    }
    return -1;
}


int main() {
    for(int i=0; i<N2; i++)
	for(int j=0; j<N2; j++)
	    MDT[i][j] = abs(i/N-j/N) + abs(i%N-j%N);

    Puzzle in;

    for(int i=0; i<N2; i++) {
	cin >> in.f[i];
	if(in.f[i] == 0) {
	    in.f[i] = N2;
	    in.space = i;
	}
    }
    cout << astar(in) << endl;
    return 0;
}

Measured memory_bytes: 257664
// -----------------------------------
// Author     : MatsuTaku
// Affiliation: Tokushima University
// Country    : Japan
// Date       : 04/04/2020
// -----------------------------------

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

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

  ll n,k; cin>>n>>k;
  cout << min(n%k, k-n%k) << endl;

  return 0;
}


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

int main() {
    int n, max;
    string str, ans;
    cin >> n;
    vector<int> dic(26,0), newDic(26,0);
    cin >> str;
    for(int j = 0; j < str.length(); j++){
        dic[(int)str[j] - 97]++;
    }
    for (int i = 1; i < n; i++ ){
        cin >> str;
        for(int j = 0; j < str.length(); j++){
            newDic[(int)str[j] - 97]++;
        }
        for(int index = 0; index < 26; index++){
            if(dic[index] > newDic[index]){
                dic[index] = newDic[index];
            }
            newDic[index] = 0;
        }
    }
    for(int index = 0; index < 26; index++){
        for(int c = dic[index]; c != 0; c--){
            ans = ans + (char)(index + 97);
        } 
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <math.h>
#include <cmath>
#include <numeric>
#include <iomanip>


#define log(x) cout<<x<<endl
#define pb push_back
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
typedef long long lint;
using namespace std;
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; }
const long long INF = 1LL << 60;


// <<fixed<<setprecision(6)<<


int gcd(lint x, lint y){
  return y==0 ? x:gcd(y,x % y);
}


int digsum(int n) {
  int res = 0;
  while(n > 0) {
    res += n%10;
    n /= 10;
  }
  return res;
}


int dignum(int n) {
  int res = 0;
  while(n > 0) {
    res++;
    n /= 10;
  }
  return res;
}


int stringcount(string s, char c) {
  return count(s.cbegin(), s.cend(), c);
}


int lcm(lint x, lint y){
  return x/ gcd(x, y) * y;
}


int combi(int n, int r){
  int num = 1;
  for(int i = 1; i <= r; i++){
    num = num * (n - i + 1) / i;
  }
  return num;
}


int main(){
  int k,a,b;
  bool is=false;
  cin>>k>>a>>b;
  for(int i=a;a<=b;a++){
    if(a%k==0){
      is=true;
      break;
    }
  }
  if(is){
    cout<<"OK";
  }
  else{
    cout<<"NG";
  }

}

Measured memory_bytes: 3620
#include <iostream>
#include <string.h>
#include <stdlib.h>
#include <math.h>

#define max(a,b) ((a>b)?(a):(b))
#define min(a,b) ((a<b)?(a):(b))

using namespace std;

int main() {
	char s[3000], t[3000];
	cin >> s >> t;

	int S = strlen(s);
	int T = strlen(t);

	int dp[3001][3001];
	for (int i = 0; i <= S; i++) {
		if (i == 0) {
			for (int j = 0; j <= T; j++) {
				dp[i][j] = 0;
			}
			continue;
		}
		dp[i][0] = 0;
		for (int j = 1; j <= T; j++) {
			if (s[i - 1] == t[j - 1]) {
				dp[i][j] = max(dp[i - 1][j - 1] + 1, max(dp[i - 1][j], dp[i][j - 1]));
				continue;
			}
			else {
				dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]);
			}
		}
	}

	int l = dp[S][T] - 1;
	char str[3000] = {};
	int a = S - 1, b = T - 1;

	while (l >= 0) {
		if (dp[a + 1][b + 1] == dp[a + 1][b]) {
			b--;
		}
		else if (dp[a + 1][b + 1] == dp[a][b + 1]) {
			a--;
		}
		else {
			str[l] = s[a];
			a--;
			b--;
			l--;
		}
	}

	cout << str;

	return 0;
}

Measured memory_bytes: 35456
int main
  (){      char
 xxx,       yyy;
scanf       ("%c"
" %c"       ,&xxx    ,        &
yyy)         ;if(    xxx   >yyy
)puts       (">")     ;else if(
 xxx<       yyy)       printf
  ("<"     "\n"       );   else
     printf(         "="    );}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string s;
  cin >> s;

  int win =0;

  for(int i=0; i<=s.length(); i++) {
    if(s[i] == 'o') {
      win++;
    }
  }

(15 - s.length() + win >= 8) ? printf("YES") : printf("NO");
}


Measured memory_bytes: 256
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include<iomanip>

using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
const int inf = 1000000;

int main(int argc, const char * argv[]) {
  int N, L;
  cin >> N >> L;
  vector<string> vec(N);
  for(int i = 0; i < N; i++) {
    cin >> vec[i];
  }
  
  sort(vec.begin(), vec.end());
  for(auto itr = vec.begin(); itr != vec.end(); itr++) {
    cout << *itr;
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#define N 100000

typedef struct{
  int p,l,r;
} Node;

Node A[N];
int deep;
int sibling(int id){
  if(A[id].p == -1) return -1;
  else if(A[A[id].p].l == id) return A[A[id].p].r;
  else return A[A[id].p].l;
 
}
int degree(int id){
  int deg = 0;
  if(A[id].l != -1 ) deg++;
  if(A[id].r != -1 ) deg++;
  return deg;
}

int height(int id){
  int lheight=0,rheight=0;
  if(A[id].l != -1){
    lheight = height(A[id].l)+1;
  } 
  if(A[id].r != -1){
    rheight = height(A[id].r)+1;
  }
  if(lheight > rheight) return lheight;
  else return rheight;
  
}

int depth(int id){
  if( A[id].p == -1) return 0;
  else{
    deep++;
    depth(A[id].p); 
  }
  return deep;
}

void printType(int id){
  if(A[id].p == -1) printf("root");
  else if(A[id].l != -1 || A[id].r != -1) printf("internal node");
  else printf("leaf");
}

main(){
  int i,n;
  int v,d,c;

  scanf("%d",&n);

  for(i = 0; i < n; i ++){
    A[i].p = -1;
    A[i].l = -1;
    A[i].r = -1;
  }

  for(i = 0; i < n; i ++){
    scanf("%d%d%d",&v,&d,&c);
    if(d != -1)A[d].p = v;
    if(c != -1)A[c].p = v;
    A[v].l = d;
    A[v].r = c;
  }
 
  for(i = 0; i < n; i ++){ 
    deep=0;
    printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, ",i,A[i].p,sibling(i),degree(i),depth(i),height(i));
    printType(i);
    printf("\n");
  }
  return 0;
}

Measured memory_bytes: 608
#include <bits/stdc++.h>
using namespace std;
 
 
int main() {
	long long n,k;
	cin>>n>>k;
	long long dp[n+1][k+1];
	memset(dp,-1,sizeof(dp));
	long long a[n+1];
	for(long long i=1;i<=n;i++){
	    cin>>a[i];
	    
	}for(long long i=0;i<=k;i++){
	    if(i<=a[1])
	        dp[1][i]=1;
	    else 
	        dp[1][i]=0;
	}for(long long i=1;i<=n;i++){
	    dp[i][0]=1;
	}
	for(long long i=2;i<=n;i++){
	    for(long long j=1;j<=k;j++){                      
	        if(j<=a[i]){
	            dp[i][j]=(dp[i][j-1]+dp[i-1][j])%1000000007;
	        }else{
	            dp[i][j]=(dp[i][j-1]-dp[i-1][j-a[i]-1]+dp[i-1][j]+1000000007)%1000000007;
	        }
	    }
	}cout<<dp[n][k];
	
    
}

Measured memory_bytes: 79104
n = int(input())
li = [input() for i in range(n)]

AC_cnt = li.count('AC')
WA_cnt = li.count('WA')
TLE_cnt = li.count('TLE')
RE_cnt = li.count('RE')

print(f'AC x {AC_cnt}')
print(f'WA x {WA_cnt}')
print(f'TLE x {TLE_cnt}')
print(f'RE x {RE_cnt}')

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

#define REP(i, x, n) for (int i = x; i < (int)(n); i++)
#define rep(i, n) REP (i, 0, n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x.size())
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define uniq(x) x.erase(unique(x.begin(), x.end()), x.end())
#define F first
#define S second
#define mp make_pair
#define eb emplace_back

using namespace std;

typedef long long ll;

// const int INF = 1 << 30;
// const ll INF = 1LL << 60;
const int MOD = 1000000007;

ll dp[100000 + 1][3 + 1];

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

  dp[0][0] = 1;

  rep (i, sz(s)) {
    char ch = s[i];
    rep (j, 4) {
      if (ch == '?') dp[i + 1][j] = dp[i][j] * 3 % MOD;
      else dp[i + 1][j] = dp[i][j];
    }
    if (ch == 'A' || ch == '?') dp[i + 1][1] = (dp[i + 1][1] + dp[i][0]) % MOD;
    if (ch == 'B' || ch == '?') dp[i + 1][2] = (dp[i + 1][2] + dp[i][1]) % MOD;
    if (ch == 'C' || ch == '?') dp[i + 1][3] = (dp[i + 1][3] + dp[i][2]) % MOD;
  }

  cout << dp[sz(s)][3] << endl;
}


Measured memory_bytes: 3584
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define F first
#define S second
//-std=c++11
#define print(x) printf("%.12f",x);
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define rep(i, n) for(int i =0 ; i < n; ++i)
#define repr(i, n) for(int i=n-1;i>=0;i--)
#define Rep(i,a,b) for(int i=a;i<=b;i++)
#define Repr(i,a,b) for(int i=a;i>=b;i--)
#define pii pair < int, int >
#define iter ::iterator
#define forit(a) for(it=a.begin();it!=a.end();it++)
typedef vector<int> vi;
typedef  long long ll;
const int inf = int(1e9);
const int mod = inf + 7;
const int N = (int)2e5 + 5;

void solve(){
	int a,b;
	cin>>a>>b;
	cout<<(a==b?"Yes":"No");


}


int main(){
	Red;
	int t=1;
	//cin>>t;
	while(t--)
	solve();
	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)
typedef long long ll;

int main() {
    string A, B, C;
    cin >> A >> B >> C;
    cout << A[0] << B[1] << C[2] << endl;
    return 0;
}


Measured memory_bytes: 256
n, K = gets.split.map &:to_i
D = gets.split.map &:to_i

available_digits = (0..9).to_a - D

while true
    digits = n.to_s.split("").map(&:to_i)
    if (digits - available_digits).empty?
        p n
        exit
    end
    n += 1
end

Measured memory_bytes: 2044
#include<stdio.h>

int main(void){
    register int i;
    int n;
    scanf("%d",&n);
    long a[n];
    for(i = 0;i < n;i++)scanf("%ld",&a[i]);
    long st = 0;
    long ans[n];
    for(i = 0;i < n;i++)st += a[i] * (i % 2 ? -1 : 1);
    st /= 2;
    ans[0] = st;
    for(i = 1;i < n;i++)ans[i] = a[i-1] - ans[i-1];
    for(i = 0;i < n;i++)printf("%ld ",ans[i] * 2);
    return 0;
}

Measured memory_bytes: 2816
#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const double PI=3.14159265358979323846;

int main(){
int a,b;
  cin>>a>>b;
  a>2*b ?
    cout <<a-2*b<<endl
  : cout <<0<<endl;
}

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

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var an = Console.ReadLine().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(x => int.Parse(x)).ToList();
            var max = an.Max();
            var dic = new Dictionary<BigInteger, BigInteger>();

            foreach (var item in an)
            {
                if (dic.ContainsKey(item))
                    dic[item]++;
                else
                    dic.Add(item, 1);
            }
            var data = dic.Where(x => x.Value >= 2).OrderByDescending(x => x.Key).ToList();
            try
            {
                if (data[0].Value >= 4)
                    Console.WriteLine(data[0].Key * data[0].Key);
                else
                    Console.WriteLine(data[0].Key * data[1].Key);
            }
            catch
            {
                Console.WriteLine(0);
            }
            Console.ReadLine();
        }
    }
}


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

#define M 4000000
#define NIL (-1)
#define L 14

char H[M][L];

//文字から数値に変換
int getChar(char ch){
    if (ch == 'A')return 1;
    else if ( ch == 'C')return 2;
    else if ( ch == 'G')return 3;
    else if ( ch == 'T')return 4;
    else return 0;
}

//文字列から数値へ変換して key を生成する
long long getKey(char str[]){
    long long sum = 0, p = 1, i;
    for ( i = 0; i < strlen(str); i++){
        sum += p * getChar(str[i]);
        p *= 5;
    }
    return sum;
}

int h1(int key){ return key % M;}
int h2(int key){ return 1 + (key % (M - 1));}

int find(char str[]){
    long long key, i, h;
    key = getKey(str); // 文字列を数値に変換
    for( i = 0; ; i++){
        h = (h1(key) + i * h2(key)) % M;
        if ( strcmp(H[h], str) == 0) return 1; 
        else if( strlen(H[h]) == 0) return 0; //どのkeyの示すアドレスにも求める文字列が入っていなかった場合0を返す
    }
    return 0;
}

int insert(char str[]){
    long long key, i, h;
    key = getKey(str);
    for( i = 0; ; i++){
        h = (h1(key) + i * h2(key)) % M;
        if ( strcmp(H[h], str) == 0 ) return 1; //同じ記号がすでに入っている場合1を返すのみ(何もしない)
        else if (strlen(H[h]) == 0){  //同じ記号がなくて、初めて何も入っていないアドレスでstrをコピーする
            strcpy(H[h], str);
            return 0;
        }
    }
    return 0;
}

int main(){
    int i, n, h;
    char str[L], com[9];
    for( i = 0; i < M; i++) H[i][0] = '\0';//全ての文字列を初期化する。
    scanf("%d", &n);
    for(i = 0; i < n; i++ ){
        scanf("%s %s", com, str); //より高速な入力　scanf　を使用

        if ( com[0] == 'i' ){
            insert(str);
        }else{
            if(find(str)){
                printf("yes\n");
            }else{
                printf("no\n");
            }
        }
    }
    return 0;
}


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

// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

// forループ
#define REP(i,n) for(ll i=0; i<(ll)(n); ++i)

// 定数宣言
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

// グラフ表現
using Graph = vector<vector<int>>;

// グラフの辺表現
using Edge = map<pair<int,int>,int>;

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

// 最大公約数
ll gcd(ll a,ll b){
   if (a%b == 0) return(b);
   else return(gcd(b, a%b));
}

// 最小公倍数
ll lcm(ll a, ll b){
    return a/gcd(a, b) * b;
}

int main()
{
    cout << fixed << setprecision(15);
    ll a;
    cin >> a;
    cout << a + a*a + a*a*a << endl;
    return 0;
}

Measured memory_bytes: 3564
#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include <iomanip>
#include <sstream>
using namespace std;

int sum_digit(int n){
  if( n == 0 ) return 0;
  else return n%10 + sum_digit(n/10);
}

int main()
{
  int N; cin >> N;
  
  int localmin;
  for(int i = 1; i < N ; i++){
    int sum_of_digits = sum_digit(i) + sum_digit(N-i);
    if(i == 1) localmin = sum_of_digits;
    else localmin = min(localmin,sum_of_digits);
  }
  cout << localmin << endl;
}

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

#define MOD 1000000007
// #define INF 100000000000

using namespace std;
typedef unsigned long long ull;
typedef long long ll;


template <class T>
ostream &operator<<(ostream &o, const vector<T>&obj) {
    o << "["; for (int i = 0; i < (int)obj.size(); ++i) o << (i > 0 ? ", " : "") << obj[i]; o << "]"; return o;
}
template <class T>
ostream &operator<<(ostream &o, const vector<vector<T>>&obj) {
    o << "[" << endl; for (int i = 0; i < (int)obj.size(); ++i) o << "  " << obj[i] << endl; o << "]"; return o;
}
template <class T, class U>
ostream &operator<<(ostream &o, const pair<T, U>&obj) {
    o << "(" << obj.first << ", " << obj.second << ")"; return o;
}
template <class T, class U>
ostream &operator<<(ostream &o, const map<T, U>&obj) {
    o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;
}
template <class T>
ostream &operator<<(ostream &o, const set<T>&obj) {
    o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;
}
template <class T>
ostream &operator<<(ostream &o, const queue<T>&obj) {
    queue<T> obj_cp = obj;
    bool first = true;
    o << "{";
    while (!obj_cp.empty()) { o << (!first ? ", " : "") << obj_cp.front(); obj_cp.pop(); first = false; }
    o << "}"; return o;
}

void print() {
    cout << "\n";
}
template<class Head, class... Body>
void print(Head head, Body... body) {
    cout << head << " ";
    print(body...);
}


int main(int argc, char const *argv[]) {
    int N;
    cin >> N;
    int n = N % 10;
    if (n == 3) {
        cout << "bon" << endl;
    } else if (n == 0 || n == 1 || n == 6 || n == 8) {
        cout << "pon" << endl;
    } else {
        cout << "hon" << endl;
    }

    return 0;
}


Measured memory_bytes: 3648
S = input().split(" ")
n = int(S[0])
k = int(S[1])

arr = []
for i in range(n):
    arr.append(int(input()))


def calculate(n,k,arr):
    arr.sort()

    drr = []

    for i in range(1,n):
        drr.append(arr[i] - arr[i-1])


    s = 0
    j = 0
    sums = []

    for i in range(len(drr) - (k-1) + 1):

        while j < i + k - 1:
            s = s + drr[j]
            j = j + 1
        sums.append(s)
        s = s - drr[i]


    print(min(sums))

calculate(n,k,arr)

Measured memory_bytes: 15600
#include <iostream>
#include <stdio.h>
using namespace std;

struct Grading
{
    int m_m;
    int m_f;
    int m_r;
};

int main(int argc, char *argv[])
{
    Grading grade[50];
    int m, f, r;

    while (1)
    {
        scanf("%d %d %d", &m, &f, &r);
        if (m == -1 && f == -1 && r == -1)
            break;

        if (m == -1 || f == -1)
            printf("%c\n", 'F');
        else if (m + f >= 80)
            printf("%c\n", 'A');
        else if (m + f >= 65)
            printf("%c\n", 'B');
        else if (m + f >= 50)
            printf("%c\n", 'C');
        else if (m + f >= 30)
        {
            if (r >= 50)
            {
                printf("%c\n", 'C');
            }
            else
            {
                printf("%c\n", 'D');
            }
        }
        else
        {
            printf("%c\n", 'F');
        }
    }

    return 0;
}



Measured memory_bytes: 3224
#include<iostream>
#include<string>
#include<typeinfo>
#include<vector>
#include<algorithm>
#include<map>
#include<iomanip>
typedef long long int ll;
using namespace std;
int main()
{
	string s,t;
	cin >> s >> t;
	string news="", newt="";
	vector<int> abc(128,0);
	for(int i=0; i<s.size(); i++){
		int num=s.at(i);
		abc.at(num)++;
	}
	for(int i='a'; i<='z'; i++){
		for(int j=0; j<abc.at(i); j++){
			char c=i;
			news.push_back(i);
		}
	}
//	cout << news << endl;

	for(int i='a'; i<='z'; i++){
		abc.at(i)=0;
	}
	for(int i=0; i<t.size(); i++){
		int num=t.at(i);
		abc.at(num)++;
	}
	for(int i='a'; i<='z'; i++){
		for(int j=0; j<abc.at(i); j++){
			char c=i;
			newt.push_back(i);
		}
	}
//	cout << newt << endl;
	reverse(newt.begin(),newt.end());
//	cout << newt << endl;

	if(news<newt){
		cout<<"Yes"<<endl;
	}else{
		cout<<"No"<< endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define X first
#define Y second
#define pb emplace_back
#define eb pb
#define rep(X,Y) for(int X=0;X<(Y);++X)
#define reps(X,O,Y) for(int X=O;X<(Y);++X)
#define all(X) (X).begin(),(X).end()

using namespace std;
using ll=long long;
using pii=pair<int,int>;
const ll MOD=1e9+7;

int d=0;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1,0};
int x,y;
vector<pii> cand;
vector<string> mp;
int X=1,Y=1;

int forward(){
	static const string s="RDLU";
	cout<<"? "<<s[d]<<endl;
	string re;
#ifdef NUIP
	cout<<x<<","<<y<<"->"<<x+dx[d]<<","<<y+dy[d]<<endl;
	re=(mp[Y+y+dy[d]][X+x+dx[d]]=='#'?"YES":"NO");
	cout<<re<<endl;
#endif
#ifndef NUIP
	cin>>re;
#endif
	if(re=="YES"){
		x+=dx[d]; y+=dy[d];
		vector<pii> nxt;
		for(pii p:cand)if(mp[p.Y+y][p.X+x]=='#') nxt.eb(p);
		cand=nxt;
		return 1;
	}else{
		vector<pii> nxt;
		for(pii p:cand)if(mp[p.Y+y+dy[d]][p.X+x+dx[d]]=='.') nxt.eb(p);
		cand=nxt;
		return 0;
	}
}

int left(){
	static const string s="RDLU";
	int dd=(d+3)%4;
	cout<<"? "<<s[dd]<<endl;
	string re;
#ifdef NUIP
	re=(mp[Y+y+dy[dd]][X+x+dx[dd]]=='#'?"YES":"NO");
#endif
#ifndef NUIP
	cin>>re;
#endif
	if(re=="YES"){
		x+=dx[dd]; y+=dy[dd];
		d=dd;
		vector<pii> nxt;
		for(pii p:cand)if(mp[p.Y+y][p.X+x]=='#') nxt.eb(p);
		cand=nxt;
		return 1;
	}else{
		vector<pii> nxt;
		for(pii p:cand)if(mp[p.Y+y+dy[dd]][p.X+x+dx[dd]]=='.') nxt.eb(p);
		cand=nxt;
		return 0;
	}
}

int main(){
  ios_base::sync_with_stdio(false);
  cout<<fixed<<setprecision(0);
	int h,w;
	cin>>h>>w;
	vector<string> mp(h,string(w,'.'));
	rep(i,h){
		string s;
		cin>>s;
		mp[i]=s;
	}
	::mp=mp;
	rep(i,h)rep(j,w)if(mp[i][j]=='#') cand.eb(j,i);
	while(forward());
	d=1;
	// cout<<x<<","<<y<<endl;
	while(cand.size()>1){
		left();
		rep(_,4){
			if(forward()) break;
			d=(d+1)%4;
		}
		// for(auto p:cand) cout<<p.X<<","<<p.Y<<";";cout<<endl;
	}
	cout<<"! "<<cand[0].Y<<" "<<cand[0].X<<endl;
  return 0;
}



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

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

#define faster  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

#define sq(x)   (x)*(x)
#define PI      acos(-1.0)
#define all(x) x.begin(),x.end()
#define nl      '\n'

typedef long long int ll;
typedef unsigned long long int  llu;


int main()
{
	faster
	ll n;
	cin>>n;
	ll a[n+2],i,j,ans=0,sum=0;
	ll pre[n+2];
	ll mx=1e9+7;
	for(i=1;i<=n;i++)
	{
		cin>>a[i];
		sum+=a[i];
		sum%=mx;
	}
	for(i=1;i<=n;i++)
	{
		sum-=a[i];
		if(sum<0)sum+=mx;
		ans+=a[i]*sum;
		ans%=mx;
	}
	cout<<ans<<nl;
	return 0;
	//cout<<ans<<nl;
}


Measured memory_bytes: 5176
defmodule Main do
  def main do
    a = IO.read(:line) |> String.trim |> String.to_integer();
    sum = Enum.filter(1..a, fn(x) -> rem(x, 3)!=0 and rem(x, 5)!=0 end)
    IO.puts(Enum.sum(sum))
  end
end

Measured memory_bytes: 75716
#include <bits/stdc++.h>
using namespace std;
#define ll long long 
#define endl "\n"
#define pb push_back
#define f(i,n) for(i=0;i<n;i++)
#define F(i,a,b) for(i=a;a<=b;i++)
#define arr(a,n) for( i=0;i<n;i++)cin>>a[i];
#define fi first
#define se second
#define mp make_pair
#define mod 1000000007
#define YES cout<<"YES"<<endl;
#define Yes cout<<"Yes"<<endl;
#define NO cout<<"NO"<<endl;
#define No cout<<"No"<<endl;
#define yes cout<<"yes"<<endl;
#define no cout<<"no"<<endl;
#define vi vector<ll>
#define ed end()
#define bg begin()
#define sz size()
#define ln length()
#define s() sort(a,a+n);
#define sr() sort(a,a+n,greater<ll>());
#define v()  sort(v.begin(),v.end());
#define vr() sort(v.begin(),v.end(),greater<ll>());
#define mod 1000000007
#define fast() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
ll gcd(ll a, ll b){if(!b)return a;return gcd(b, a % b);}
ll power(ll x,ll y,ll p){ll res=1;x%=p;while(y>0){if(y&1)res=(res*x)%p;y=y>>1;x=(x*x)%p;}return res;}
int main() {
	/*#ifndef ONLINE_JUDGE
	    // for getting input from input.txt
	    freopen("input.txt", "r", stdin);
	    // for writing output to output.txt
	    freopen("output.txt", "w", stdout);
	#endif*/
fast();
//ll  t;cin>>t;while(t--)
{
	 ll a,b,k,x,y;
	cin>>a>>b>>k;
	x=a;
	y=b;
	/*if(k>=a)
	{
		k-=a;
		a=0;
		if(k>0)
		{
			b-
		}
	}*/
	
	 a=max(0*1ll,(a-k));
	k-=x;
	if(k>0)
	     b =max(0*1ll,(b-k));

	cout << a <<" "<<b << endl;
	

}
return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
import java.io.*;

public class Main {
 
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        PrintWriter out=new PrintWriter(System.out);
        int alph[]=new int[26];
         
        while(in.hasNext()) {
            String str=in.nextLine();char C[]=str.toCharArray();
            for(int i=0;i<C.length;i++) {
                if(C[i]>=65 && C[i]<=90)alph[C[i]-65]++;
                else if(C[i]>=97 && C[i]<=122)alph[C[i]-97]++;
            }
        }
         
         
        for(int i=0;i<26;i++) {
            char c=(char)(i+97);
            System.out.println(c+" : "+alph[i]);
        }
        out.flush();
    }
 
}


Measured memory_bytes: 26200
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cassert>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <iomanip>
#include <map>
#include <set>
#include <list>
#include <limits>
#include <numeric>
#include <utility>
#include <deque>
#include <valarray>
#include <unordered_set>
#include <unordered_map>
#include <regex>
#include <array>
#include <bitset>
#include <complex>
#include <string>
#include <tuple>

using namespace std;
using ll = long long;
const int INF = 1e9;
const ll MOD = 1e9 + 7;

int main()
{
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  if ((a + b) > (c + d)) cout << "Left" << endl;
  else if ((a + b) < (c + d)) cout << "Right" << endl;
  else cout << "Balanced" << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define fi first
#define se second
#define rep(i,s,n) for(int i = s;i<n;i++)
#define rrep(i,s,n) for(int i = (n)-1;i>=(s);i--)
#define all(v) (v).begin(),(v).end()
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0)
typedef long long ll;
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
const ll MOD=998244353,INF=1ll<<60;
int dx[]={0,0,1,-1};
int dy[]={-1,1,0,0};
typedef pair<int,pint>P2;
typedef vector<vint>vvint;

int H,W;
string s[505];

signed main() {
    IOS();
    cin>>H>>W;
    rep(i,0,H){
        cin>>s[i];
    }
    
    
    vector<vector<char>> R(H,vector<char>(W,'.'));
    vector<vector<char>> B(H,vector<char>(W,'.'));
    rep(i,0,H){
        rep(j,0,W){
            if(s[i][j]=='#'){
                R[i][j]=B[i][j]='#';
            }else if(j==0){
                R[i][j]='#';
            }else if(j==W-1){
                B[i][j]='#';
            }else if(i%2){
                B[i][j]='#';
            }else{
                R[i][j]='#';
            }
        }
    }
    
    rep(i,0,H){
        rep(j,0,W){
            cout<<R[i][j];
        }
        cout<<endl;
    }
    cout<<endl;
    rep(i,0,H){
        rep(j,0,W){
            cout<<B[i][j];
        }
        cout<<endl;
    }
    
    /*rep(i,0,H){
        rep(j,0,W){
            if(R[i][j]=='#'&&B[i][j]=='#'){
                cout<<'#';
            }else{
                cout<<'.';
            }
        }
        cout<<endl;
    }
    */
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    return 0;
}

Measured memory_bytes: 1536
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#define rep(i,n) for(int (i) = 0; (i) < (n); ++(i))
#define _Pi 3.1415926535
#define _MOD = 1e9+7;
using namespace std;
typedef long long ll;

int main(){
    int s1;
    cin >> s1;
    int s2 = s1%100;
    s1 /= 100;
    bool yymm = false, mmyy = false;
    if((int)s2 > 0 && (int)s2 < 13){
        yymm = true;
    }
    if((int)s1 > 0 && (int)s1 < 13){
        mmyy = true;
    }

    if(yymm && mmyy) cout << "AMBIGUOUS" << endl;
    else if(!yymm && !mmyy) cout << "NA" << endl;
    else if(yymm) cout << "YYMM" << endl;
    else cout << "MMYY" << endl;

    return 0;
}


Measured memory_bytes: 384
#define NDEBUG
NDEBUG


#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <memory>
#include <queue>
#include <random>

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


using namespace std;

// TC_REMOVE_BEGIN
/// caide keep
bool __hack = std::ios::sync_with_stdio(false);
/// caide keep
auto __hack1 = cin.tie(nullptr);
// TC_REMOVE_END


// Section with adoption of array and vector algorithms.


namespace template_util {
    

    constexpr int bytecount(uint64_t x) {
        return x ? 1 + bytecount(x >> 8) : 0;
    }

    template<int N>
    struct bytetype {
        
    };

    
    /// caide keep
    template<uint64_t N>
    struct minimal_uint : bytetype<bytecount(N)> {
    };
}


template<class T>
T next(istream& in) {
    T ret;
    in >> ret;
    return ret;
}


void solve(istream& in, ostream& out) {
    int n = next<int>(in);
    int q = next<int>(in);
    vector<int> deg(n);
    while (q--) {
        int a = next<int>(in) - 1;
        int b = next<int>(in) - 1;
        ++deg[a];
        ++deg[b];
    }
    FOR(i, n) {
        if (deg[i] % 2 == 1) {
            out << "NO\n";
            return;
        }
    }
    out << "YES\n";
}


int main() {
    solve(cin, cout);
    return 0;
}



Measured memory_bytes: 640
#include<stdio.h>
int main(){
  int a[5] = {0};
  int b = 0;
  for(int i=0;i<5;i++){
    scanf("%d ",&b);
    a[i]=b;
  }
  for(int i=0;i<5;i++){
    if(a[i]==0){
      printf("%d",i+1);
    }
  }
}

Measured memory_bytes: 2116
#include <bits/stdc++.h> 
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define size_of_array(array) (sizeof(array)/sizeof(array[0]))
#define max 100005
using ll =long long;
using namespace std;
using Graph=vector<vector<int>>;

int main(){
    char s[4],op[3];
    cin>>s;
    rep(i,pow(2,3)){
        int ans=s[0]-'0';
        rep(j,3){
            if((i>>(2-j))&1){
                ans-=(s[j+1]-'0');
                op[j]='-';
            }else{
                ans+=(s[j+1]-'0');
                op[j]='+';
            }
        }
        if(ans==7){
            cout<<s[0]<<op[0]<<s[1]<<op[1]<<s[2]<<op[2]<<s[3]<<"=7"<<endl;
            return 0;
        }
    }
    return 0;
}

Measured memory_bytes: 256
/*
LANG:C++
PROB:

*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
#include <iostream>
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)


using namespace __gnu_pbds;
using namespace std;


typedef tree<int, null_type, less<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    ordered_set;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;
typedef unsigned long long ui64;

template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }
const int mod=1000000007;
  i64 poww(i64 a, i64 b)
  {
    a%=mod;
    i64 res=1;
    while(b)
      {
if(b&1)res=res*a%mod;

      a=a*a%mod;
      b/=2;

      }
      return res;
  }
  i64 inv(i64 a)
  {
    return poww(a,mod-2);
  }


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

    // ifstream fin(".in");
    // ofstream fout(".in");

int n,m;
cin>>n>>m;
vi h(n+1);
for1(i,n)cin>>h[i];
vector<vector<int>>g(n+1);
for1(i,m)
{
int x,y;
cin>>x>>y;
g[x].pb(y);
g[y].pb(x);
}
int cnt=0;
for1(i,n)
{
  bool is=true;
  forn(j,g[i].size())
  {
    if(h[g[i][j]]>=h[i])is=false;
  }
  if(is)cnt++;
}
cout<<cnt;

    return 0;
  }


Measured memory_bytes: 8724
#include <bits/stdc++.h>
#define ll long long
using namespace std;
map<int,int>mapp;
vector<int>vec;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
int n,m;
cin>>n>>m;
    for (int i=0;i<m;i++){
        int a,b;
        cin>>a>>b;
        if (a>b)
            swap(a,b);
        if (a==1)
        vec.push_back(b);
        if (b==n)
        mapp[a]=1;
    }
for(int i=0;i<vec.size();i++){
    if (mapp[vec[i]])
        return cout<<"POSSIBLE",0;
}
cout<<"IMPOSSIBLE";
return 0;
}


Measured memory_bytes: 9976