akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <vector>
#include <string.h>

#define minn(a,b) (a<=b?a:b)

int n;
int p[1005];
std::vector<int> down[1005];
int want[1005];

int other[1005];        // one colour is satisfied, find minimal amount of other colour
bool bad=0;

void dfs(int u)
{
    /*if (down[u].empty()) {
        other[u][0]=1;
        return;
    }*/
    // knapsack stuff
    int min1[5005];
    int min2[5005];
    memset(min1,0x3f,sizeof min1);
    min1[0]=0;
    for (int v:down[u]) {
        dfs(v);
        memset(min2,0x3f,sizeof min2);
        // can add (want[v],other[v]) or (other[v],want[v])
        for (int i=want[v]; i<=want[u]; i++) {
            min2[i]=minn(min2[i],min1[i-want[v]]+other[v]);
        }
        for (int i=other[v]; i<=want[u]; i++) {
            min2[i]=minn(min2[i],min1[i-other[v]]+want[v]);
        }
        for (int i=0; i<=want[u]; i++) min1[i]=min2[i];
    }
    // get answers
    for (int i=0; i<=want[u]; i++) {
        //printf("%d %d is %d\n",u,i,min1[i]);
        other[u]=minn(other[u],min1[i]);
    }
    if (other[u]==0x3f3f3f3f) bad=1;
    //printf("%d can %d\n",u,other[u]);
}

int main()
{
    #ifdef NOT_DMOJ
    freopen("data.txt","r",stdin);
    #endif // NOT_DMOJ
    scanf("%d",&n);
    for (int i=2; i<=n; i++) {
        scanf("%d",p+i);
        down[p[i]].push_back(i);
    }
    for (int i=1; i<=n; i++) {
        scanf("%d",want+i);
    }
    memset(other,0x3f,sizeof other);
    dfs(1);
    if (bad) printf("IM");
    printf("POSSIBLE\n");
}


Measured memory_bytes: 17152
while 1:
    try:
        n=raw_input()
        ans=''
        f=t=0
        for i in n:
            if i!='@' and f==0:
                ans+=i
            elif i=='@':
                f=1
            elif f==1 and t==0:
                t=int(i)
            else:
                ans+=i*t
                f=0
                t=0
        print ans

    except:
        break
exit()

Measured memory_bytes: 6284
#include <stdio.h>

static const int MAX = 2000;

void trace(int A[], int N)
{
    for (int i = 0; i < N; i++)
    {
        printf("%d", A[i]);
        if (i < N - 1)
        {
            printf(" ");
        }
    }
    printf("\n");
}

void insertionSort(int A[], int N)
{
    int i, j, v;

    for (int i = 1; i < N; i++)
    {
        v = A[i];
        int j = i - 1;

        // その要素の左隣と比べて、
        // 左隣のほうが大きかったら、左隣の要素を1個右にずらす
        while (j >= 0 && A[j] > v)
        {
            // ずらす
            A[j + 1] = A[j];
            // さらに左隣と比較する
            j--;
        }

        // 空いたポジションにA[i]の値を入れる
        A[j + 1] = v;

        // 途中結果の出力
        trace(A, N);
    }
}

int main()
{
    int R[MAX], n;

    // 入力を受け取る
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
    {
        scanf("%d", &R[i]);
    }

    // 初期状態を出力
    trace(R, n);
    // ソートの実行
    insertionSort(R, n);

    return 0;
}


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

using namespace std;

#define rep(i, n) for(int i = 0; i < n; i++)
#define MOD 1000000007
#define el endl
typedef long long ll;
typedef long double ld;

int main() {
    int n, ans = 0;
    cin >> n;
    string s;
    cin >> s;
    rep(i, n){
        if(s[i] == 'A' && i+2 < n){
            string sub = s.substr(i, 3);
            if(sub == "ABC") ans++;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include"iostream"
#include<stdlib.h>
#include<stdio.h>
#include<time.h>
#include<list>
#include<map>
#include<string>
#include<algorithm> 
#include <queue> 
#include <sstream>
#include <fstream>
#include<cmath>
#define INF 100000000000
#define LL long long
using namespace std;
map<LL , LL> m;
vector<LL> v[100001];
long long N, M, K, ans,P[100000],Y[100000];



int main() {
	cin >> N>>M;
	for (int i = 0; i < M; i++) {
		cin >> P[i]>>Y[i];
		v[P[i]].push_back(Y[i]);
	}
	for (int i = 1; i <= N; i++) {
		sort(v[i].begin(), v[i].end());
	}
	LL a;
	for (int i = 1; i <= N; i++) {
		 a= v[i].size();
		for (LL j = 1; j <=a ; j++) {
			m[v[i][j-1]] = j;
		}
	}
	
	for (int i = 0; i < M; i++) {
		LL a = m[Y[i]];
		printf("%06lld%06lld\n", P[i],a);
	}
	return 0;
}

Measured memory_bytes: 14720
#include <iostream>
#include <set>
#include <queue>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
#include <numeric>
#include <functional>

using namespace std;
#define ALL(x)              (x).begin(),(x).end()
#define REP(i, n)           for (int (i) = 0 ; (i) < (ll)(n) ; ++(i))
#define REPN(i, m, n)       for (int (i) = m ; (i) < (ll)(n) ; ++(i))
#define INF                 (int)2e9
#define MOD                 (1000 * 1000 * 1000 + 7)
#define Ceil(x, n)          (((((x))+((n)-1))/n))
#define CeilN(x, n)         (((((x))+((n)-1))/n)*n)
#define FloorN(x, n)        ((x)-(x)%(n))
#define IsOdd(x)            (((x)&0x01UL) == 0x01UL)
#define IsEven(x)           (!IsOdd((x)))
#define M_PI                3.14159265358979323846
typedef long long           ll;
typedef pair<ll, ll>	    P;

/*-----------------------------------------------------------------------------
　処理
 -----------------------------------------------------------------------------*/
class BinaryIndexedTree {
private:
	int n;
	vector<ll> bit;

public:
	BinaryIndexedTree(int num)
	{
		// 0は番兵
		n = num + 1;
		bit.assign(n + 1, 0);
	}

	// idx is 1-indexed
	void add(int idx, ll val)
	{
		while (idx <= n) {
			bit[idx] += val;
			idx += idx & -idx;
		}
	}

	// [1, idx) idx is 1-indexed
	ll sum(int idx)
	{
		ll sum = 0;
		while (0 < idx) {
			sum += bit[idx];
			idx -= idx & (-idx);
		}
		return sum;
	}
	
	// [a, b) idx is 1-indexed
	ll range(int a, int b)
	{
		return (sum(b) - sum(a));
	}

	// val-th number (val is 0-indexed)
	int lower_bound(ll val)
	{
		int idx = 0;
		int k = 1;
		while (2 * k <= n) {
			k <<= 1;
		}
		for (; 0 < k; k >>= 1) {
			if (idx + k < n && bit[idx + k] < val) {
				val -= bit[idx + k];
				idx += k;
			}
		}
		return idx + 1;
	}
};

int main()
{
	ll N, K;
	cin >> N >> K;
	vector<ll> t(N);
	vector<ll> d(N);
	REP(i, N) {
		cin >> t[i] >> d[i];
		t[i]--;
	};

	vector<P> netaMax(N, { 0, 0 });
	REP(i, N) {
		auto &netaOne = netaMax[t[i]];
		if (netaOne.first < d[i]) {
			netaOne.first = d[i];
			netaOne.second = i;
		}
	}
	sort(netaMax.rbegin(), netaMax.rend());

	ll typeMax = 0;
	REP(i, N) {
		auto netaOne = netaMax[i];
		if (netaOne.first == 0) {
			break;
		}
		d[netaOne.second] = 0;
		typeMax++;
	}
	sort(d.rbegin(), d.rend());

	ll nokoriMax = N - typeMax;
	BinaryIndexedTree bitType(typeMax);
	BinaryIndexedTree bitNokori(nokoriMax);
	REP(i, typeMax) {
		bitType.add(i + 1, netaMax[i].first);
	}
	REP(i, nokoriMax) {
		bitNokori.add(i + 1, d[i]);
	}

	ll ans = 0;
	REPN(i, 1, K + 1) {
		ll ansOne;
		ll typeNum = min(typeMax, (ll)i);
		ll nokoriNum = min(nokoriMax, K - typeNum);
		if (K != typeNum + nokoriNum) continue;

		ansOne = typeNum * typeNum;
		ansOne += bitType.sum(typeNum);
		ansOne += bitNokori.sum(nokoriNum);
		ans = max(ans, ansOne);
	}

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


Measured memory_bytes: 4224
#include<bits/stdc++.h>
using namespace std;
char a[105][105];
int hh[105],ww[105];
int main()
{
    int h,w;
    scanf("%d%d",&h,&w);
    memset(hh,0,sizeof(hh));
    memset(ww,0,sizeof(ww));
    for(int i=0;i<h;i++) scanf("%s",a[i]);
    for(int i=0;i<h;i++)
    {
        int flag=1;
        for(int j=0;j<w;j++)
        {
            if(a[i][j]=='#')
            {
                flag=0;
                break;
            }
        }
        if(flag) hh[i]=1;
    }
    for(int i=0;i<w;i++)
    {
        int flag=1;
        for(int j=0;j<h;j++)
        {
            if(a[j][i]=='#')
            {
                flag=0;
                break;
            }
        }
        if(flag) ww[i]=1;
    }
    for(int i=0;i<h;i++)
    {
        if(!hh[i])
        {
            int flag=1;
            for(int j=0;j<w;j++)
            {
                if(!ww[j]) flag=0,printf("%c",a[i][j]);
            }
            if(!flag) printf("\n");
        }
    }
}


Measured memory_bytes: 256
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<stdio.h>
using namespace std;
int A[1000001],v[200001],ans;
int main(){
  int N;
  scanf("%d",&N);
  for(int i=0;i<N;++i){
    scanf("%d",&v[i]);
    A[v[i]]++;
  }
  for(int i=1;i<1000001;++i){
    if(A[i]){
      for(int j=i<<1;j<1000001;j+=i){
        A[j]=0;
      }
    }
  }
  for(int i=0;i<N;++i){
    ans+=A[v[i]]==1;
  }
  printf("%d\n",ans);
}

Measured memory_bytes: 6420
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
 
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3") 
#pragma GCC optimization ("unroll-loops")
 
// #include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
using namespace __gnu_pbds;
// const ll RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count();
// gp_hash_table<int, int> table;
 
#define ll  long long int
#define vii vector< ll >
#define pb push_back
#define pii pair<ll,ll>
#define ppi pair<pii,ll>
#define all(x) x.begin(),x.end()
#define S second
#define F first
#define ins insert
#define ld long double
#define lp(l,r) for(i=l;i<=r;++i)
 
#define lpj(l,r) for(j=l;j<=r;++j)
#define lpr(l,r) for(i=r;i>=l;--i)
#define lprj(l,r) for(j=r;j>=l;--j)
 
#define swap(a,b){ auto _t=a;a=b,b=_t;}
#define flush() cout.flush()
#define popcount __builtin_popcount
#define die() return 0;
// #define size() 


 
 
#define TRACE
 
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif
 
#define MD          1000000007
#define M 			100011
#define LN             14
#define fftmod      998244353
#define EPS         (double)1e-10
 
ll md=MD;
ll inf=1e18;
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 
 
 
inline ll exp(ll a,ll b){if(a==0&&b==0)return 1ll;if(a==0)return 0ll;ll r=1LL;while(b>0){if(b&1){r=(r%md)*(a%md);r=(r+md)%md;}b/=2;a=(a%md)*(a%md);a=(a+md)%md;}return (r+md)%md;}
ll gcd(ll a,ll b){if(b==0)return a;if(a==0)return b;return gcd(b,a%b);}
inline ll poww(ll a,ll b){ll r=1LL;while(b>0){if(b&1)r=r*a;b/=2;a=a*a;}return (ll)r;}
 
using cd=complex<double>;
const double PI=acos(-1);
 
inline ll rand(ll l,ll r){
    return l+rng()%(r-l+1);
 
}

ll f[M];

vii g[M];
ll get(ll k,ll ch){
	if(k<ch)return 0;
	ll r=1;
	while(ch>0){
		r=r*k%md;r%=md;
		r=r*exp(ch,md-2)%md;r%=md;
		--k;--ch;
	}
	return r;
}

ll go(ll u,ll p,ll k){

	ll r=0;
	ll ans=1ll;
	for(auto v:g[u]){
		if(v==p)continue;
		++r;
		ans=ans*go(v,u,k)%md;
		ans%=md;
	}
	ll pi=get(k-1-(p>0),r)%md;
	pi=pi*f[r]%md;pi%=md;ans=ans*pi%md;
	return ans%md;
}
int main(){
 
     
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
 
 
   // ifstream fin("input.txt");ofstream fout("outut.txt");
    ll t,i,j,m,n,s,z,k,p;string s1,s2;ll q;ll x,y;
    f[0]=1;
    for(i=1;i<M;++i){
    	f[i]=f[i-1]*i%md;f[i]%=md;
    }
    cin>>n>>k;
    lp(1,n-1){
    	cin>>x>>y;
    	g[x].pb(y);g[y].pb(x);
    }
    p=go(1,0,k);
    p=p*k%md;
    cout<<p%md<<"\n";








}



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

int main() {
  long long int n,m,i;
  cin>>n>>m;
  long long int ans;
  if(n==1){
    if(m==1)
      ans=1;
    else if(m==2)
      ans=0;
    else ans=m-2;
  }
  
  else if(m==1){
    if(n==2)
      ans=0;
    else ans=n-2;
  }
  
  else{
    ans=(n-2)*(m-2);
  }
  
  cout<<ans;
  
  
}

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

int main() {
	int N;
	cin >> N;
	vector<long long> L(N + 1);
	L.at(0) = 2, L.at(1) = 1;
	for (int i = 2; i < N + 1; i++) {
		L.at(i) = L.at(i - 1) + L.at(i - 2);
	}

	cout << L.at(N) << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(){
  char arr[3][105];
  for(int i=0;i<3;i++)
    scanf("%s",arr[i]);
  int pp=0,before=0;
  int pointer[3]={0,};
  while(arr[pp][pointer[pp]]){
    before=pp;
    if(arr[pp][pointer[pp]]=='a') pp=0;
    else if(arr[pp][pointer[pp]]=='b') pp=1;
    else pp=2;
    pointer[before]++;
  }
  if(pp==0) printf("A");
  else if(pp==1) printf("B");
  else printf("C");
}


Measured memory_bytes: 128
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<string>
#include<algorithm>
#include<queue>
#include<vector>
#include<set>
#include<map>
using std::cin;using std::cerr;
using std::max;using std::min;
#define N 200005
#define ll long long
#define db double
#define pb push_back
#define dbg1(x) cerr<<#x<<"="<<(x)<<" "
#define dbg2(x) cerr<<#x<<"="<<(x)<<"\n"
int n,a,b,ecnt,last[N],fa[N],flag;ll Max1,Max2,l,r,mid;
struct node
{
	ll x,y;
	friend bool operator<(node t1,node t2) {return t1.x<t2.x||t1.x==t2.x&&t1.y<t2.y;}
};
std::vector<node>S[N],tp;
struct road{int to,v,nex;}e[N];
void adde(int u,int v,int w) {e[++ecnt]=(road){v,w,last[u]},last[u]=ecnt;}
void dfs(int x,ll d=0)
{
	if(d>Max1) Max2=Max1,Max1=d;
	else Max2=max(Max2,d);
	for(int k=last[x];k;k=e[k].nex) dfs(e[k].to,d+e[k].v);
}
void Solve(int x)
{
	if(flag) return;
	int to1=0,to2=0;S[x].clear();
	for(int k=last[x];k;k=e[k].nex)
	{
		to1?to2=e[k].to:to1=e[k].to;
		for(int i=0,sz=S[e[k].to].size();i<sz;i++)
			S[e[k].to][i].x+=e[k].v,S[e[k].to][i].y+=e[k].v;
	}
	if(!to1) return void(S[x].pb({0,0}));
	int sz1=S[to1].size(),sz2=S[to2].size();
	if(sz1>sz2) std::swap(to1,to2),std::swap(sz1,sz2);
	std::reverse(S[to2].begin(),S[to2].end());
	for(int i=0,j=sz2-1;i<sz1;i++)
	{
		for(;~j&&S[to1][i].x+S[to2][j].y>mid;j--);
		if(~j) tp.pb((node){S[to2][j].x,S[to1][i].y});
	}
	std::reverse(S[to1].begin(),S[to1].end());
	std::reverse(S[to2].begin(),S[to2].end());
	for(int i=0,j=sz2-1;i<sz1;i++)
	{
		for(;~j&&S[to1][i].y+S[to2][j].x>mid;j--);
		if(~j) tp.pb({S[to1][i].x,S[to2][j].y});
	}
	if(tp.empty()) return void(flag=1);
	std::sort(tp.begin(),tp.end());
	node tmp;S[x].pb(tmp=tp[0]);
	for(int i=1,sz=tp.size();i<sz;i++) if(tp[i].x>tmp.x&&tp[i].y<tmp.y) tmp=tp[i],S[x].pb(tmp);
	tp.clear();
}
bool Judge()
{
	flag=0;
	for(int i=n;i;i--) Solve(i);
	return !flag;
}
int main()
{
	scanf("%d",&n);
	for(int i=2;i<=n;i++) scanf("%d%d",&a,&b),adde(a,i,b);
	dfs(1);
	for(l=0,r=Max1+Max2;l<r;) mid=l+r>>1,Judge()?r=mid:l=mid+1;
	printf("%lld\n",l);
	return 0;
}

Measured memory_bytes: 32628
//                          **********  YATIN KWATRA  ********** 

//AC bakshi Rabha

#include <bits/stdc++.h>
#define ll                      long long 
#define ull                     unsigned long long 
#define FIO                     ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl                    "\n"
#define fo(i,a,b)               for(int i = a; i<=b ; i++)
#define rfo(i,a,b)              for(int i = a; i>=b ; i--)
#define vii                      vector<int>
#define vll                     vector<ll>
#define pq                      priority_queue
#define uo                      unordered_map                
#define all(v)                  v.begin(),v.end()
#define mp                      make_pair
#define pb                      push_back
#define pob                     pop_back
#define ff                      first
#define ss                      second
#define pii                     pair<int,int> 
#define pll                     pair<long,long>
#define mll                     map<long,long>
#define mii                     map<int,int>
#define vvii                    vector<vii>
#define mod                     1000000007
// #define node                    Node

using namespace std;

void INPUT() {
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif

}


void solve()
{ 
       string s1,s2;
       cin >> s1 >> s2;

       int n = s1.length();
       int m = s2.length();

       if(m<=n)
       {
        cout << "No\n";
        return;
       }

       string st = s2.substr(0,n);
       if(st == s1) cout << "Yes\n";
       else cout << "No\n";
       
}
int main() {
    
    FIO
  //  INPUT();
    
    int t;
    t = 1;
    //cin >> t;
    
    while(t--)
    {
       solve();
    }
    return 0;
}


Measured memory_bytes: 3652
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
ll MOD = 1e9+7;

#define vec     vector<int>
#define vecll   vector<ll>
#define vec2    vector<vector<int>>
#define vec2ll  vector<vector<ll>>
#define vpair   vector<pair<int, int>>
#define vpairll vector<pair<ll, ll>>

#define rep(i,n)         for(ll i=(ll)0; i<(ll)n; i++)
#define REP(i,m,n)       for(ll i=(ll)m; i<(ll)n; i++)
#define arr(var, n)      vec var(n); rep(i,n){cin >> var[i];}
#define arrll(var, n)    vecll var(n); rep(i,n){cin >> var[i];}
#define all(var)         (var).begin(), (var).end()
#define sortall(var)     sort(all(var))
#define mpair(v1, v2)    make_pair(v1, v2)
#define pb(var)          push_back(var)
#define prt(var)         cout << var << "\n"
#define prtd(n, var)     cout << fixed << setprecision(n) << var << "\n"
#define prt2(v1, v2)     cout << v1 << " " << v2 << "\n"
#define prt3(v1, v2, v3) cout << v1 << " " << v2 << " " << v3 << "\n"
#define prtall(var)      rep(i,var.size()){cout << var[i] << " ";} cout << "\n"

//----------------------------------------------------------------

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

  double ans=0.0;
  rep(i,n){
    double x;
    string u;
    cin >> x >> u;
    if(u=="BTC"){
      ans+=x*380000;
    } else {
      ans+=x;
    }
  }

  prtd(6, ans);

}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
 
 
void swap (int *x, int *y) {
  int temp;    
 
  temp = *x;
  *x = *y;
  *y = temp;
}
 
int gcd(int a,int b){
  if(a<b){
    swap(&a,&b);
  }
 
  if(b==0){
    return a;
  }
 
  int r=a%b;
  while(r!=0){
    a = b;
    b = r;
    r = (a%b);
  }
 
  return b;
}
 
/* クイックソート */
int dn(const void*a,const void*b){return*(int*)b-*(int*)a;}
 
 
int modpow(int a,int n,int mod){
  int ans=1;
  while(n>0){
    if(n & 1){
      ans=ans*a%mod;
    }
    a=a*a%mod;
    n/=2;
  }
  return ans;
}
 
int max(int a,int b){
  if(a<b){
    return b;
  }
  else{
    return a;
  }
}
 
int min(int a,int b){
  if(a<b){
    return a;
  }
  else{
    return b;
  }
}
 
void chmax(int *a,int b){
  if(*a < b){
    *a = b;
  }
 
  return;
}
 
void chmin(int *a,int b){
  if(*a > b){
    *a =b;
  }
 
  return;
}
 

int main(void){
  long int h;
  scanf("%ld",&h);
  long int max=0;
  long int d;
  for(int i=0;i<40;i++){
    d=pow(2,i);
    if(h/d>=1){
      max=i;
    }else{
      break;
    }
  }
  long int sum=0;
  for(int i=0;i<max+1;i++){
    sum+=pow(2,i);
  }
  printf("%ld\n",sum);
  return 0;
}

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

int n;
char s[100];

int main(){
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> s[i];
	}
	for (int i = 0; i < n; i++) {
		if (s[i] == 'Y') {
			cout << "Four" << endl;
			return 0;
		}
	}
	cout << "Three" << endl;
	return 0;
}

Measured memory_bytes: 256
n = int(input())
s = {}

for i in range(n):
    inp = str(input())
    if inp in s:
        s[inp] += 1
    else:
        s[inp] = 1

sorted_s = sorted(s, key=s.__getitem__, reverse=True)

print_list = []

for k in s:
    if s[k] == s[sorted_s[0]]:
        print_list.append(k)

for p in sorted(print_list):
    print(p)

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

using namespace std;

#define tr(c, i) for (typeof((c)).begin() i = (c).begin(); i != (c).end(); i++)
#define all(c) (c).begin(), (c).end()
#define sz(a) int((a).size())
#define pb push_back
#define fo(i, n) for (int i = 0; i < n; i++)
#define FO(i, k, n) for(int i = k; i < n; i++)
using vi = vector<int>;
using vvi = vector<vector<int>>;
using ii = pair<int, int>;
using ll = long long;

int mod = 998244353;
ll dp[200004];
int b[11];
int e[11];

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
    memset(dp, 0, sizeof dp);
    int n, k;
    cin >> n >> k;
    fo(i,k)
    {
        cin >> b[i] >> e[i];
    }
    ll mod = 998244353;
    dp[1] = 1;
    ll temp[11] = {0};

    for (int i = 1; i <= n; i++)
    {
        for(int j = 0; j < k; j++){
            int m = e[j];
            int l = b[j];
            int s = i - m - 1;
            int e = i - l ;
            if (s >= 1) 
            {
                temp[j] = (temp[j] - dp[s] + mod)%mod;
            }
            if(e >= 1) temp[j] = (temp[j] + dp[e])%mod;
            dp[i] = (temp[j] + dp[i])%mod;
        }   
    }

    cout << dp[n];

    
    return 0;
}


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


int main(){
  int n; cin >> n;
  vector<int> x(n);
  for (auto &&i : x)
  {
    cin >> i;
  }
  int ans = INT32_MAX;
  for (int i = 1; i <= 100; i++)
  {
    int sum = 0;
    for (auto &&j : x)
    {
      sum += (j - i)*(j - i);
    }
    ans = min(sum, ans);

  }
  
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
//#pragma GCC optimize("O3")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("unroll-loops")
#define pb push_back
#define IOS                                                                    \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(0);                                                                  \
  cout.tie(0);cout<<fixed<<setprecision(16);
#define ll long long int
#define ld long double
#define el '\n'
#define El '\n'
#define PI (ld)3.141592653589793238462643383279502884197169399375105820974944
#define inf (ll)1000000000
#define mod (ll)1000000007
#define mod1 (ll)998244353
#define fo(i, n) for (long long i = 0; i < n; i++)
#define pll pair<ll, ll>
#define ml map<ll,ll>
#define vpl vector<pll>
#define vvl vector<vector<ll> >
#define vvpl vector< vector<pll> >
#define ff first
#define ss second
#define pqueue priority_queue< ll >
#define pdqueue priority_queue< ll,vl ,greater< ll > >
#define mem(a,b) memset(a,b,sizeof(a));
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define sz(a) (ll)a.size()
#define f(i,a,b) for(ll i=a;i<b;i++)
#define fd(i,a,b) for(ll i=a;i>=b;i--)
#define all(a) a.begin(),a.end()
#define vl vector<ll>
//#define x ff
//#define y ss
#define pt(a) for(auto it:a)cout<<it<<" ";cout<<endl;
unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
using namespace std;

// vector
template<class T> istream& operator >> (istream &is , vector<T> &v) { for(T &a : v) is >> a; return is; }
template<class T> ostream& operator << (ostream &os , const vector<T> &v) { for(const T &t : v) os << t<<" "; return os << endl; }
// pair
template<class T, class U> ostream& operator << (ostream &os , const pair<T, U> &v) { return os << v.first << " " << v.second ; }

double gcd(double a, double b) { return a < 0.01 ? b : gcd(fmod(b, a), a); }

long long bpow(long long a, long long b, long long m) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1)

      res = res * a % m;
      a = a * a % m;
      b >>= 1;
  }
  return res;
}


ll kv;
ll t,n,x,y,h,k,z,p,q,w;
string s,s1,s2;
vvl v;
//vl vis,d;

vvl mul(vvl a,vvl b,ll m=mod){
    ll p=sz(a),q=sz(a[0]),r=sz(b[0]);
    vvl v(p,vl(r,0));
    fo(i,p){
        fo(j,r){
            fo(l,q){
                v[i][j]+=a[i][l]*b[l][j]%m;
                v[i][j]%=m;
            }
        }
    }
    return v;
}

vvl mpow(vvl a, ll b) {
  ll n=sz(a);
  vvl v(n,vl(n,0));
  fo(i,n)v[i][i]=1;
  while (b > 0) {
    if (b & 1)
      v = mul(v,a);
      a = mul(a,a);
      b >>= 1;
  }
  return v;
}

int main() {
    IOS;
    cin>>n>>k;
    fo(i,n){
        vl gg(n);cin>>gg;
        v.pb(gg);
    }
    v=mpow(v,k);
    fo(i,n)fo(j,n)kv+=v[i][j];
    cout<<kv%mod<<el;
    return 0;
}


Measured memory_bytes: 384
import core.bitop, std.algorithm, std.ascii, std.bigint, std.conv,
    std.functional, std.math, std.numeric, std.range, std.stdio, std.string,
    std.random, std.typecons, std.container;

ulong MAX = 1_000_100, MOD = 1_000_000_007, INF = 1_000_000_000_000;
alias sread = () => readln.chomp();
alias lread(T = long) = () => readln.chomp.to!(T);
alias aryread(T = long) = () => readln.split.to!(T[]);
alias Pair = Tuple!(long, "begin", long, "end");
alias PQueue(T, alias less = "a<b") = BinaryHeap!(Array!T, less);

void main()
{
    long n, k;
    scan(n, k);
    long i;
    while(n)
    {
        n /= k;
        i++;
    }
    writeln(i);
}

void scan(TList...)(ref TList Args)
{
    auto line = readln.split();
    foreach (i, T; TList)
    {
        T val = line[i].to!(T);
        Args[i] = val;
    }
}


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

public class Main {
    public static PrintWriter out;
    public static FastScanner in;

    private void solve() {
        int sx = in.nextInt();
        int sy = in.nextInt();

        int tx = in.nextInt();
        int ty = in.nextInt();

        for(int i=0;i<ty-sy;i++){
            out.print('U');
        }
        for(int i=0;i<tx-sx;i++){
            out.print('R');
        }
        for(int i=0;i<ty-sy;i++){
            out.print('D');
        }
        for(int i=0;i<=tx-sx;i++){
            out.print('L');
        }


        for(int i=0;i<=ty-sy;i++){
            out.print('U');
        }
        for(int i=0;i<=tx-sx;i++){
            out.print('R');
        }
        out.print("DR");
        for(int i=0;i<=ty-sy;i++){
            out.print('D');
        }
        for(int i=0;i<=tx-sx;i++){
            out.print('L');
        }
        out.print('U');
    }

    private void runIO() {
        in = new FastScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));
        solve();
        out.close();
    }
    private static class FastScanner {
        BufferedReader bufferedReader;
        StringTokenizer stringTokenizer;

        private FastScanner() {
            bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        }

        private String next() {
            if (stringTokenizer == null || !stringTokenizer.hasMoreElements()) {
                try {
                    stringTokenizer = new StringTokenizer(bufferedReader.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return stringTokenizer.nextToken();
        }

        private int nextInt() {
            return Integer.parseInt(next());
        }

        private long nextLong() {
            return Long.parseLong(next());
        }

        private String nextLine() {
            String ret = "";
            try {
                ret = bufferedReader.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return ret;
        }
    }

    public static void main(String[] args) {
        new Main().runIO();
    }
}


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

a.sort(reverse=True)

higher = a[p-1]
for i in range(p,n):
    if(a[i] == a[i-1]):
        higher += a[i]
        continue

    if(a[p-1]- a[i] > m):
        print(i)
        exit()

    if(higher - a[i]*(i-p+1) > min(n-v,i-p+1)*m):
        print(i)
        exit()

    higher += a[i]

print(n)

Measured memory_bytes: 62576
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <complex>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;

#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 100010

/* UnionFind */

struct UnionFind{
  vector<int> data, tree_size;
  UnionFind(int s):data(s,-1),tree_size(s,1) {}
  
  int root(int x){
    //debug(x);
    if(data[x]==-1) return x;
    return data[x]=root(data[x]);
  }
  
  bool set(int x,int y){
    x=root(x);
    y=root(y);
    if(x==y) return false;
    data[y]=x;
    tree_size[x] += tree_size[y];
    tree_size[y] = 0;
    return true;
  }
  
  bool check(int x,int y){
    x=root(x);
    y=root(y);
    return x==y;
  }
  
  int size(int x){
    return tree_size[root(x)];
  }
  
};


int n, m, k;
int u[SIZE], v[SIZE], w[SIZE], l[SIZE];

int check(int x){
  vector<pair<int,int> > vec;
  int sum = 0;

  for(int i=0;i<m;i++){
    vec.push_back({(w[i] + x * !l[i])*2 + l[i], i});
  }

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

  int counter = 0, Acounter = 0;
  UnionFind uf(n);
  
  for(int i=0;i<m;i++){
    if(uf.set(u[vec[i].second], v[vec[i].second])){
      counter++;
      Acounter += !l[vec[i].second];
    }
  }
  
  if(counter == n-1)
    return Acounter;
  else
    return -1;
}

int make(int x){
  vector<pair<int,int> > vec;
  int sum = 0;

  for(int i=0;i<m;i++){
    vec.push_back({(w[i] + x * !l[i])*2 + l[i], i});
  }

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

  int counter = 0, Acounter = 0;
  int limit = k;
  UnionFind uf(n);
  
  for(int i=0;i<m;i++){
    if(limit <= 0 && !l[vec[i].second]) continue;
    if(uf.set(u[vec[i].second], v[vec[i].second])){
      counter++;
      Acounter += !l[vec[i].second];
      sum += w[vec[i].second] + x * !l[vec[i].second];
      //limit -= !l[vec[i].second];
    }
  }

  assert(counter == n-1);
  
  return sum;
}

bool solve(){
  
  scanf("%d%d%d", &n, &m, &k);
  if(n == 0) return false;
  
  for(int i=0;i<m;i++){
    char c;
    scanf("%d%d%d %c", u+i, v+i, w+i, &c);
    u[i]--; v[i]--;
    l[i] = c - 'A';
    //debug(u[i]); debug(v[i]);
    assert(u[i] < n && v[i] < n);
  }

  int L = -200, R = 200;

  //cerr << check(L,0) << "-" <<  check(R+1,0) << endl;
  //cerr << check(L,1) << "-" <<  check(R+1,1) << endl;
  
  if(check(L) == -1 || (k < check(R) || check(L) < k)){
    puts("-1");
    return true;
  }
  
  while(L < R){
    int mid = (L+R+1)/2;

    if(check(mid) < k){
      R = mid - 1;
    }else{
      L = mid;
    }
  }

  //debug(L * k);
  
  int res = make(L);

  //debug(res);
  
  cout << res - L * k<< endl;

  return true;
}

int main(){
  while(solve());
  
  return 0;
}



Measured memory_bytes: 3192
//============================================================================
// Name        : JOI.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <math.h>
#include <stdio.h>
#include <vector>
using namespace std;
typedef long long ll;
ll A,B;
int main() {

	cin>>A>>B;
	int C,D,E,F;
	ll total=0;
	for(int i=A;i<B+1;i++){
		C=i/10000;
		D=i/1000%10;
		E=i%100/10;
		F=i%10;
		if(C==F&&D==E)total++;
	}

	cout<<total<<endl;
	return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<ctime>
#include<cstdlib>
#define cmax(a,b) (a<(b)?a=(b),1:0)
#define cmin(a,b) (a>(b)?a=(b),1:0)
#define dmin(a,b) ((a)<(b)?(a):(b))
#define dmax(a,b) ((a)>(b)?(a):(b))
#define regsiter register
#define CL fclose(stdin),fclose(stdout)
namespace io
{
	int F()
	{
		int n=0,F=1;
		char ch;
		while((ch=getchar())!='-'&&(ch<'0'||ch>'9'));
		ch=='-'?F=0:n=ch-'0';
		while((ch=getchar())>='0'&&ch<='9')n=(n<<1)+(n<<3)+ch-'0';
		return F?n:-n;
	}
	long long G()
	{
		long long n=0,F=1;
		char ch;
		while((ch=getchar())!='-'&&(ch<'0'||ch>'9'));
		ch=='-'?F=0:n=ch-'0';
		while((ch=getchar())>='0'&&ch<='9')n=(n<<1)+(n<<3)+ch-'0';
		return F?n:-n;
	}
}
int f[111111];
int min[111111],max[111111];
struct edge
{
	int to;
	int next;
}e[333333];
int pe=111111;
void insert(int a,int to)
{
	e[pe]=(edge){to,e[a].next};
	e[a].next=pe++;
}
int V[111111],P[111111];
int fa[111111],siz[111111];
void dfs(int o)
{
	if(~f[o])siz[o]=1;
	for(register int p=e[o].next;p;p=e[p].next)
		if(e[p].to!=fa[o])
		{
			fa[e[p].to]=o;
			dfs(e[p].to);
			siz[o]+=siz[e[p].to];
		}
}
void dfs2(int o)
{
	if(~f[o])min[o]=max[o]=f[o];
	for(register int p=e[o].next;p;p=e[p].next)
		if(siz[e[p].to]&&e[p].to!=fa[o])
		{
			dfs2(e[p].to);
			cmax(min[o],min[e[p].to]-1);
			cmin(max[o],max[e[p].to]+1);
			if(min[o]>max[o])puts("No"),exit(0);
		}
}
void dfs3(int o)
{
	for(register int p=e[o].next;p;p=e[p].next)
		if(e[p].to!=fa[o])
		{
			if(siz[e[p].to]==0)f[e[p].to]=f[o]+1;
				else if(f[o]+1>=min[e[p].to]&&f[o]+1<=max[e[p].to])f[e[p].to]=f[o]+1;
						else if(f[o]-1>=min[e[p].to]&&f[o]-1<=max[e[p].to])f[e[p].to]=f[o]-1;
								else puts("No"),exit(0);
			dfs3(e[p].to);
		}
}
int main()
{
	int n=io::F();
	for(register int i=1;i<n;++i)
	{
		int u=io::F(),v=io::F();
		insert(u,v);
		insert(v,u);
	}
	memset(min,199,sizeof(min));
	memset(max,63,sizeof(max));
	memset(f,-1,sizeof(f));
	int K=io::F();
	for(register int i=1;i<=K;++i)
	{
		V[i]=io::F(),P[i]=io::F();
		f[V[i]]=P[i];
	}
	dfs(V[1]);
	dfs2(V[1]);
	dfs3(V[1]);
	puts("Yes");
	for(register int i=1;i<=n;++i)
		printf("%d\n",f[i]);
	return 0;
}




Measured memory_bytes: 8704
# coding: utf-8
a,b,c,d=map(int,input().split())

if abs(a-c)<=d:
    print("Yes")
else:
    if a<b<c and c-b<=d and b-a<=d:
        print("Yes")
    elif c<b<a and a-b<=d and b-c<=d:
        print("Yes")
    else:
        print("No")



Measured memory_bytes: 2940
N = int(input())
a = list(map(int, input().split()))

ans = []
count = 0
for i in range(0,N):
    if i == 0:
        count = 1
    elif i == N-1:
        if a[i] == a[i-1]:
            count += 1
            ans.append(count)
        else:
            ans.append(count)
            count = 1
            ans.append(count)
    else:
        if a[i] == a[i-1]:
            count += 1
        else:
            ans.append(count)
            count = 1
        
an = 0
for i in range(len(ans)):
    an += ans[i]//2

print(an)

Measured memory_bytes: 3064
/**
 * @brief 8クイーン問題を扱う
 *
 * @date 2016/02/29 ~ 2016/03/03
 */



//****************************************
// 必要なヘッダファイルのインクルード
//****************************************

#include <iostream>
#include <vector>



//****************************************
// 構造体の定義
//****************************************

/**< @brief 8クイーン問題を扱う盤面を表す */
struct board {
    using array1D = std::vector<int>;      /**< int型の1次元配列 */
    using array2D = std::vector<array1D>;  /**< int型の2次元配列 */

    const int N{8};                /**< マスの数 */
    const int FREE{0}, NOFREE{1};  /**< クイーンが配置できるか否か */

    array1D row;    /**< row[x]がNOFREEならば行xは被襲撃位置 */
    array1D col;    /**< col[x]がNOFREEならば列xは被襲撃位置 */
    array1D dpos;   /**< dpos[x]がNOFREEならば左下の列xは被襲撃位置 */
    array1D dneg;   /**< dneg[x]がNOFREEならば右下の列xは被襲撃位置 */
    
    array2D state;  /**< 盤面の状態  */

    board() : row(N, FREE), col(N, FREE),
              dpos(2 * N - 1, FREE), dneg(2 * N - 1, FREE),
              state(N, array1D(N, FREE)) { }

    /**< 盤面の状態を印刷する */
    void print()
    {
        for (int y = 0; y < N; y++) {
            for (int x = 0; x < N; x++) {
                if (state[y][x] && row[y] != x) { return; }
            }
        }
        for (int y = 0; y < N; y++) {
            for (int x = 0; x < N; x++) {
                std::cout << ((row[y] == x) ? "Q" : ".");
            }
            std::cout << std::endl;
        }
    }

    /**< @brief 座標(x, y)にQueenを配置する */
    void move(int x, int y)
    {
        row[y] = x;
        col[x] = dpos[y + x] = dneg[y - x + N - 1] = NOFREE;
    }

    /**< @brief 座標(x, y)からQueenを取り除く */
    void undo(int x, int y)
    {
        row[y] = col[x] = dpos[y + x] = dneg[y - x + N - 1] = FREE;
    }

    /**< @brief 座標(x, y)にQueenを配置可能かどうか調べる */
    bool canMove(int x, int y)
    {
        return !(col[x] || dpos[y + x] || dneg[y - x + N - 1]);
    }

    /**
     * @brief 再帰的に盤面を探索し、Queenが配置できる場所を探す
     * @param 探索対象のy座標
     */
    void visit(int y)
    {
        // Queenの配置に成功した
        if (y >= N) { print(); return; }
    
        for (int x = 0; x < N; x++) {
            // 座標(x, y)が配置不可能な場合、continue
            if (!canMove(x, y)) { continue; }
       
            move(x, y);    // 座標(x, y)にQueenを配置する
               
            visit(y + 1);  // 次の行へ再帰

            undo(x, y);    // 座標(x, y)からQueenを取り除く
        }
    }

    /**< @brief 座標(x, y)にQueenを初期段階で配置する */
    void initqueen(int x, int y)
    {
        state[y][x] = true;
    }
};



//****************************************
// 関数の定義
//****************************************

int main()
{
    using namespace std;
    board B;

    int k; cin >> k;
    for (int i = 0; i < k; i++) {
        int r, c; cin >> r >> c;
        B.initqueen(c, r);
    }

    B.visit(0);

    return 0;
}

Measured memory_bytes: 3152
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<climits>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<numeric>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i = m; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a)  (a).rbegin(),(a).rend()
#define PI 3.14159265359
typedef long long LL;

template<class T> inline void chmax(T& a, T b) { if (a < b) { a = b; } }
template<class T> inline void chmin(T& a, T b) { if (a > b) { a = b; } }
template<class T> void print_vector(vector<T> vec) {
	cout << "[ ";
	for (int i = 0; i < vec.size(); i++) {
		cout << vec[i] << " ";
	}
	cout << "]" << endl;
}
template<class T> void print_pair_vector(vector<pair<T, T> > vec) {
	cout << "[ ";
	for (int i = 0; i < vec.size(); i++) {
		cout << "(" << vec[i].first << "," << vec[i].second << ") ";
	}
	cout << "]" << endl;
}

const int INF = 1 << 30;

int main(void) {
	int N, T;
	cin >> N >> T;

	int min_cost = INF;
	rep(i,N) {
		int c, t;
		cin >> c >> t;

		if (T >= t) {
			chmin(min_cost,c);
		}
	}

	if (min_cost == INF) {
		cout << "TLE" << endl;
	}
	else {
		cout << min_cost << endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi   = vector<int>;
using vll  = vector<ll>;
using vc   = vector<char>;
using vvll  = vector<vll>;
using vvi  = vector<vi>;
using vvc  = vector<vc>;
using vb   = vector<bool>;
using vvb  = vector<vb>;
using pii  = pair<int,int>;
using vpii = vector<pii>;
using posteriority_queue = priority_queue<int, vi, greater<int>>;


int main() {
   for (int i = 0; i < 5; i++) {
       int tmp;
       cin >> tmp;
       if (tmp == 0) {
           cout << i+1;
           break;
       }
   }
}


Measured memory_bytes: 3592
def main():
    a, b, c, d = map(int, input().split())

    ans = float('inf') * -1
    for i in [a, b]:
        for j in [c, d]:
            ans = max(ans, i * j)

    if (a < 0 and 0 < b):
        ans = max(ans, 0)
    if (c < 0 and 0 < d):
        ans = max(ans, 0)
    print(ans)


if __name__ == "__main__":
    main()



Measured memory_bytes: 9152
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define SORT(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
int main()
{
	while(1)
	{
		int ans=0;
		int h,w;
		int c[505][505];
		char f[505][505];
		memset(c,0,sizeof(c));
		for(int i=0;i<505;i++)
		{
			for(int j=0;j<505;j++)
			{
				f[i][j]='\0';
			}
		}
		cin >> h >> w;
		if(h==0&&w==0)break;
		for(int i=0;i<h;i++)
		{
			for(int j=0;j<w;j++)
			{
				cin >> f[i][j];
			}
		}
		for(int i=0;i<h;i++)
		{
			for(int j=0;j<w;j++)
			{
				if(f[i][j]=='*')continue;
				int x=0;
				while(f[i][j+x]=='.')x++;
				c[i][j]=x;
			}
		}
		/*for(int i=0;i<h;i++)
		{
			for(int j=0;j<w;j++)
			{
				cout << c[i][j] << ' ';
			}
			cout << endl;
		}*/
		for(int i=0;i<h;i++)
		{
			for(int j=0;j<w;j++)
			{
				int mi=INF;
				for(int k=1;k<h-i+1;k++)
				{
					mi=min(mi,c[i+k-1][j]);
					ans=max(ans,k*mi);
				}
			}
		}
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 2412
/*
DP (l1, l2) = 
| 1 + DP (l1-1, l2-1) if l1th char and l2th char are same
| max ( DP (l1-1 ,l2), DP (l1, l2-1) ) if they are not
*/

#include <bits/stdc++.h>

using namespace std;

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

    vector<vector<int> > dp(a.size() + 1, vector<int> (b.size() + 1, 0));

    for (int i = 1; i <= a.size(); i++) {
        for (int j = 1; j <= b.size(); j++) {
            if (a[i-1] == b[j-1]) {
                dp[i][j] = dp[i-1][j-1] + 1;
            } else {
                dp[i][j] = max(dp[i-1][j], dp[i][j-1]);
            }
        }
    }

    int i = a.size(), j = b.size();
    string answer = "";

    while (i && j) {
        if (a[i-1] == b[j-1]) {
            answer = a[i-1] + answer;
            i--; j--;
        } else {
            if (dp[i-1][j] > dp[i][j-1]) {
                i--;
            } else {
                j--;
            }
        }
        continue;
    }

    // cout << dp[a.size()][b.size()] << endl;
    cout << answer << endl;
    return 0;
}

Measured memory_bytes: 35584
import scala.io.StdIn

object Main extends App {
  val n0 = StdIn.readLine
  val n = n0.toInt
  val digits = n0.toCharArray
  var summed = 0
  digits.foreach(d => summed = summed + d.asDigit)
  val r = if (n % summed == 0) {
    "Yes"
  } else {
    "No"
  }
  println(r)
}

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

int main(){
    int A, B, C;
    cin >> A >> B >> C;
    if( A ==B && B == C ) cout << "Yes\n";
    else cout << "No\n";

    return 0;    
}

Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
using namespace std;
#define N 1000300
struct City{
	int P,Y,idx;
	bool operator < (const City &B) const {return Y<B.Y;}
}C[N/10];
int sw[N],No[N];char ans[123000][20];
int main()
{
	for (int i=1;i<=1000000;++i) sw[i]=sw[i/10]+1;
	int n,m,tmp,P,Y;
	scanf("%d%d",&n,&m);
	for (int i=1;i<=m;++i)
	{
		scanf("%d%d",&C[i].P,&C[i].Y);
		C[i].idx=i;
	}
	sort(C+1,C+1+m);
	for (int i=1;i<=m;++i)
	{
		++No[C[i].P];
		tmp=C[i].P;
		for (int j=6;j;--j,tmp/=10) ans[C[i].idx][j]=tmp%10+'0';
		tmp=No[C[i].P];
		for (int j=12;j>=7;--j,tmp/=10) ans[C[i].idx][j]=tmp%10+'0';
	}
	for (int i=1;i<=m;++i) puts(ans[i]+1);
	return 0;
}

Measured memory_bytes: 10624
#include <iostream>
#include <vector>

using namespace std;
using ll = long long;

#define in(v) cin>>v;
#define out(v) cout<<v<<"\n"
template<typename T>T gcd(T a, T b){return b?gcd(b,a%b):a;}

int MAX_N_SQRT = 1e6;
int main() {
  cin.tie(0); ios::sync_with_stdio(false);
  ll A, B;
  cin >> A >> B;

  ll g = gcd(A, B);
  ll G = g;
  ll ans = 1;
  for (ll i = 2; i * i <= G; ++i) {
    if (g % i == 0) {
      while (g % i == 0) {
        g /= i;
      }
      ++ans;
    }
  }
  if (g > 1)
    out(ans+1);
  else
    out(ans);

  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
using namespace std;
const int MAXN = 1000;
int n;
int d[MAXN];
int f[MAXN];
int t;
void solve(int current,vector<vector<int> > &g){
  if(d[current] > 0)return;
  t++;
  d[current] = t;
  
  for(int next:g[current]){
    solve(next,g);
  }
  t++;
  
  f[current] = t;
}

int main(){
  cin >> n;
  vector<vector<int> > g(n+1);
  for(int i = 1;i <= n;i++){
    int u,k;
    cin >> u >> k;
    for(int j = 0;j < k;j++){
      int v;
      cin >> v;
      g[i].push_back(v);
    }
  }
  for(int i = 1;i <= n;i++){
    solve(i,g);
  }
  for(int i = 1;i <= n;i++){
    cout << i << ' ' << d[i] << ' ' << f[i] << endl;
  }
}

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

int main(void){
    string s;
    cin >> s;
    bool res = false;
    if(s[2] == s[3] && s[4] == s[5])  res = true;
    cout << ((res)? "Yes":"No") << endl;
    return 0;
}

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

int main() {
    int N;
    int a;
    cin >> N;
    vector<int> A(N,0);

    for(int i = 0; i < N-1; i++){
        cin >> a;
        A.at(a - 1) += 1;
    }
    for(int i = 0; i < N; i++){
        cout << A.at(i) << endl;
    }
}


Measured memory_bytes: 4052
// Contest: AtCoder Beginner Contest 179 (https://atcoder.jp/contests/abc179)
// Problem: C: A x B + C (https://atcoder.jp/contests/abc179/tasks/abc179_c)


// region boilerplate
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <chrono>
#include <cstdint>
#include <deque>
#include <exception>
#include <forward_list>
#include <functional>
#include <initializer_list>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#if __cplusplus >= 201703L
#   include <optional>
#   include <string_view>
#   include <variant>
#endif

using namespace std;

#if __cplusplus >= 201703L
#   define all(a)      begin(a),end(a)
#   define sz(x)       ((int)size(x))
#else
#   define all(a)      (a).begin(),(a).end()
#   define sz(x)       ((int)(x).size())
#endif

#define rep(a, b)      for(int a = 0; a < (b); ++a)
#define reps(a, b, c)  for(int a = (b); a < (c); ++a)
#define trav(a, b)     for(auto& a : b)

using ll = long long;
using ld = long double;
using u64 = uint64_t;
using u32 = uint32_t;

using pi = pair<int, int>;
using pl = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vpi = vector<pi>;

#if __cplusplus >= 201703L
#   define MAYBE_UNUSED [[maybe_unused]]
#else
#   define MAYBE_UNUSED
#endif

MAYBE_UNUSED static constexpr int INF = (int)1e9 + 5;
MAYBE_UNUSED static constexpr ll INFL = (ll)1e18 + 5;
MAYBE_UNUSED static mt19937 rng((u32)chrono::duration_cast<chrono::nanoseconds>(chrono::high_resolution_clock::now().time_since_epoch()).count());
//endregion

const int N = 1'000'005;
int sieve[N], divs[N];

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

    reps(i, 2, N) {
        if (sieve[i])
            continue;
        sieve[i] = i;
        for (ll j = (ll)i * i; j < N; j += i)
            if (!sieve[j])
                sieve[j] = i;
    }

    divs[1] = 1;
    reps(i, 2, N) {
        int p = sieve[i];
        int j = i, e = 0;
        while (j % p == 0)
            j /= p, ++e;
        divs[i] = divs[j] * (e + 1);
    }

    int n; cin >> n;
    ll res = 0;
    for (int ab = 1; ab < n; ++ab)
        res += divs[ab];

    cout << res << '\n';
    return 0;
}


Measured memory_bytes: 11464