akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<vector>

#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

using namespace std;
using i64 = int64_t;

constexpr i64 INF = 1010000000000000017LL;

#define _overload3(_1,_2,_3,name,...) name
#define repi(i,start,end) for(int i=(int)(start);i<(int)(end);++i)
#define _rep(i,n) repi(i,0,n)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define rrep(i,start,end) for(int i=(int)(start);i>(int)(end);--i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()

#define v(T) vector<T>
#define vv(T) v(v(T))
#define vvv(T) v(v(v(T)))
typedef v(int) vi;

#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >

template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}

template<typename T> ostream &operator<<(ostream &os, const vector< T > &v){
  rep(i,v.size()) os << v[i] << (i + 1 != v.size() ? " " : "");
  return os;
}
template<typename T> istream &operator>>(istream &is, vector< T > &v){
  for(T &in : v) is >> in;
  return is;
}

void Main()
{
  int D;
  cin >> D;

  v(int) C(26);
  cin >> C;

  v(v(int)) S(D, v(int)(26));
  cin >> S;

  v(int) T(D);
  v(int) X(26, 0);

  rep(i, D) {
    i64 tmp = -1 * INF;
    rep(j, 26) {
      if(S[i][j] - C[j] * (X[j] + 1) > tmp) {
        T[i] = j + 1;
      }
    }
    cout << T[i] << "\n";
    rep(j, 26) {
      if(T[i] - 1 == j){
        X[j] = 0;
      }
      else{
        X[j]++;
      }
    }
  }
}

int main()
{
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  Main();
}

Measured memory_bytes: 3728
N,M = map(int,input().split())
AB = [tuple(map(int,input().split())) for i in range(M)]

class UnionFind:
    def __init__(self,N):
        self.parent = [i for i in range(N)]
        self._size = [1] * N
        self.count = 0
    def root(self,a):
        if self.parent[a] == a:
            return a
        else:
            self.parent[a] = self.root(self.parent[a])
            return self.parent[a]
    def is_same(self,a,b):
        return self.root(a) == self.root(b)
    def unite(self,a,b):
        ra = self.root(a)
        rb = self.root(b)
        if ra == rb: return
        if self._size[ra] < self._size[rb]: ra,rb = rb,ra
        self._size[ra] += self._size[rb]
        self.parent[rb] = ra
        self.count += 1
    def size(self,a):
        return self._size[self.root(a)]

uf = UnionFind(N)
t = N*(N-1)//2
ans = [t]
for a,b in reversed(AB):
    a,b = a-1,b-1
    if uf.is_same(a,b):
        ans.append(t)
    else:
        t -= uf.size(a) * uf.size(b)
        ans.append(t)
        uf.unite(a,b)
print(*ans[::-1][1:], sep='\n')

Measured memory_bytes: 26216
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=200005;
string s;
ll n,dp[maxn],a[maxn],cnt[maxn],vis[maxn],ans=0,p;
vector<int>v;
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin>>n>>p;
	cin>>s;
	int len=n;
	dp[len]=0;
	int res=1;
	if(p==2||p==5) {
		for(int i=0; i<len; i++) {
			if((s[i]-'0')%p==0) {
				ans+=(i+1);
			}
		}
		cout<<ans<<endl;
	} else {
		for(int i=len-1; i>=0; i--) {
			a[i]=(s[i]-'0');
			dp[i]=(dp[i+1]+a[i]*res)%p;
			res=(res*10)%p;
			cnt[dp[i]]++;
		}
		for(int i=0; i<p; i++) {
			ans+=cnt[i]*(cnt[i]-1)/2;
		}
		cout<<ans+cnt[0]<<endl;
	}
	return 0;
}

Measured memory_bytes: 4884
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n) ;i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
using ll=long long;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define MOD  1000000007
const ll INF=1e18;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b){ a = b; return 1; } return 0; }



int main(int argc, char const *argv[]) {
  int n;
  string s;
  cin >> n >> s;
  if(n%2){
    cout << "No" << endl;
    return 0;
  }
  else{
    rep(i,n/2){
      if(s[i]!=s[n/2+i]){
        cout << "No" << endl;
        return 0;
      }
    }
  }
  cout << "Yes" << endl;
  return 0;
}


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

int main() {
	int n;
	while (cin >> n&&n != -1) {
		stack<int>s;
		while (n >= 4) {
			s.push(n % 4);
			n /= 4;
		}
		s.push(n);
		int a = s.size();
		for (int i = 0;i < a;i++) {
			cout << s.top();
			s.pop();
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 3052
#include<bits/stdc++.h>
using namespace std;
#define f first 
#define s second 
#define int long long
#define pb push_back
#define mp make_pair
#define pi pair<int , int>
set<pi> st;
void factorize(long long n) 
{ 
    int count = 0; 
  
    // count the number of times 2 divides  
    while (!(n % 2)) { 
        n >>= 1; // equivalent to n=n/2; 
        count++; 
    } 
  
    // if 2 divides it 
    if (count) 
    st.insert({2 , count});
        // cout << 2 << "  " << count << endl; 
  
    // check for all the possible numbers that can  
    // divide it 
    for (long long i = 3; i <= sqrt(n); i += 2) { 
        count = 0; 
        while (n % i == 0) { 
            count++; 
            n = n / i; 
        } 
        if (count) 
        st.insert({i , count});
            // cout << i << "  " << count << endl; 
    } 
  
    // if n at the end is a prime number. 
    if (n > 2) 
    st.insert({n , 1});
        // cout << n << "  " << 1 << endl; 
} 
int32_t main(){
     int n;
     cin>>n;
     factorize(n);
     int ans = 0;
     int rem = 0;
     for(auto it:st){
           int sum =  it.second;
        //   cout<<"sum : "<<sum;
           int val = sqrtl(sum);
        //   cout<<" val : "<<val<<endl;
           while((val*(val+1))/2 <= sum){
               val++;
           }
           val--;
          ans += val;
     }
     cout<<ans<<endl;
}

Measured memory_bytes: 3676
import java.util.*;
public class Main 
{
	public static void main(String[] args) 
	{
		Scanner stdIn = new Scanner(System.in);
		while(stdIn.hasNext())
		{
			double a = stdIn.nextDouble();
			double sum = 0;
			for(int i = 0; i < 10; ++i)
			{
				sum += a;
				if(i % 2 == 0)
				{
					a *= 2;
				}
				else
				{
					a /= 3;
				}
			}
			System.out.println(sum);
		}
	}
}

Measured memory_bytes: 12000
//Author - Rahil Malhotra
#include <bits/stdc++.h>
using namespace std;
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define int long long
#define double long double

int32_t main()
{
    IOS
    int n,m,d;
    cin>>n>>m>>d;
    cout<<fixed<<setprecision(12);
    if(d==0)
        cout<<(m-1)*1.0/n;
    else
        cout<<2.0*(m-1)*(n-d)/n/n;
}

Measured memory_bytes: 3692
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define mod 1000000007
#define pb push_back
#define ff first
#define ss second
#define mp make_pair
#define all(x) x.begin(),x.end()
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);
using namespace std;



int main() 
{
    fastio
    ll i,j,x;
    
    //map<string,ll>m;
    ll n;
    cin>>n;
    ll ac=0,wa=0,tle=0,re=0;
    
    for(i=0;i<n;i++)
    {
        string s;
        cin>>s;
        if(s=="AC")
        ++ac;
        else if(s=="RE")
        ++re;
        else if(s=="TLE")
        ++tle;
        else if(s=="WA")
        ++wa;
    }
    
    cout<<"AC x "<<ac<<'\n';
    
    cout<<"WA x "<<wa<<'\n';
    cout<<"TLE x "<<tle<<'\n';
    cout<<"RE x "<<re<<'\n';
    
}


Measured memory_bytes: 3616
import sys
input = sys.stdin.readline

N, K = map(int, input().split())
x = list(map(int, input().split()))
ans = 10**18

for i in range(N-K+1):
    if x[i]<x[i+K-1]<0:
        ans = min(ans, -x[i])
    elif 0<x[i]<x[i+K-1]:
        ans = min(ans, x[i+K-1])
    else:
        ans = min(ans, -2*x[i]+x[i+K-1], -x[i]+2*x[i+K-1])

print(ans)

Measured memory_bytes: 58608
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPS(I, a, b) for (int i = (a); i < (b); ++i)
using namespace std;
using ll = long long;
typedef pair<int, int> P; 

int main() {
  int n;
  cin >> n;
  cout << (n)*(n) << endl;
  
}


Measured memory_bytes: 3596
#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n, i, sum=0;
    int a[1000], b[1000], c[1000];
    scanf("%d", &n);
    for(i=1; i<=n; i++){
		scanf("%d", &a[i]);
    }
    for(i=1; i<=n; i++){
		scanf("%d", &b[i]);
		sum+=b[i];
    }
    for(i=1; i<n; i++){
		scanf("%d", &c[i]);
    }

    for(i=1; i<n; i++){
		if(a[i+1]-a[i]==1)
			sum+=c[a[i]];
    }

    printf("%d", sum);

    return 0;
}


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

using namespace std;

int X;
int main()
{
	cin >> X;
	int a1 = (X/500)*1000;
	X %= 500;
	int a2 = (X / 5) * 5;
	cout << a1+a2 << endl;
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(void)
{
	int v[10];
	int sum=0;
	int i;
	
	for(i=0;i<10;i++)
	scanf("%d",&v[i]);
	
	for(i=0;i<10;i++)
	sum+=v[i];
	
	printf("%d\n",sum);
	
	return 0;
}

Measured memory_bytes: 600
#include <stdio.h>
#include <stdlib.h>


int main(void){
	int n;
	char *s;
	
	scanf("%d%*c",&n);
	int Wsum[n];
	int Esum[n];
	int i;
	s=(char *)calloc(n,sizeof(char));
	for(i=0;i<n;i++){
		scanf("%c",&s[i]);
	}
	//printf("s[0] = %c s[1] = %c s[2] = %c\n",s[0],s[1],s[2]);
	for(i=0;i<n;i++){
		Wsum[i] = 0;
		Esum[i] = 0;
	}
	
	if( s[0] =='E'){
		Esum[0] = 1;
		Wsum[0] = 0;
	}else{
		Esum[0] = 0;
		Wsum[0] = 1;
	}	
	for(i=1;i<n;i++){
		if(s[i]=='E'){
			Esum[i] += Esum[i-1]+1;
			Wsum[i] = Wsum[i-1];
		}else{
			Esum[i] = Esum[i-1];
			Wsum[i] = Wsum[i-1] + 1;
		}
	}
	int min = Esum[n-1]-Esum[0];
	for(i=1;i<n;i++){
		int cc = 0;
		cc += Wsum[i-1];
		cc += Esum[n-1] - Esum[i];
		if( min > cc ){
			min = cc;
		}
	}
	printf("%d",min);
	free(s);
	return 0;
}

Measured memory_bytes: 2816
#include <bits/stdc++.h>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,n1,n2) for(int i=n1;i<n2;i++)
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
typedef pair<int,int> Pi;
typedef long long int ll;
const int INF=(ll)(1<<30)-1;
const ll INFl=(ll)9223372036854775807;
const int MAX=10000;
const ll MOD=(ll)1e9+7;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a, b)*b;}
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};

ll n;

ll check(ll k){
	ll ans=1;
	while(k/10>0){
		k/=10;
		ans++;
	}
	return ans;
}

int main(){
	cin>>n;
	ll ans=check(n);
	for(ll i=2;i*i<=n;i++){
		if(n%i!=0)continue;
		ll t=max(check(i),check(n/i));
		ans=min(ans,t);
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>

long long dp[100005],arr[100005],n;

long long min(long long a,long long b) {return (a<b?a:b);}

long long solve(long long index)
{
  if(index<0) return (long long)1000000009;
  if(index==0) return 0;
  if(dp[index]!=-1) return dp[index]; 
  else return  dp[index]=min(solve(index-1)+fabs(arr[index-1]-arr[index]),solve(index-2)+fabs(arr[index-2]-arr[index]));
}

int main()
{
  long long ans;
  scanf("%lld",&n);
  for(int i=0;i<n;i++)
    scanf("%lld",&arr[i]);
  for(int i=0;i<100005;i++) dp[i]=-1;
  ans=solve(n-1);
  printf("%lld",ans);
  return 0;
}


Measured memory_bytes: 4096
#include<iostream>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<limits>
#include<sstream> 
#include<unordered_map>      

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;

const int inf = numeric_limits<int>::max() >> 2;
const ll linf = numeric_limits<ll>::max() >> 2;
const ull ulinf = numeric_limits<ull>::max() >> 2;
const double pi = acos(-1);
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const int dx8[8]={-1,0,1,-1,1,-1,0,1};
const int dy8[8]={-1,-1,-1,0,0,1,1,1};

#define p_queue(i) priority_queue<i> 
#define rp_queue(i) priority_queue<i, vector<i>, greater<i>> 
#define umap(i,j) unordered_map<i,j>
#define P(p) cout<<(p)<<endl
#define PS(p) cout<<(p)<< " "
#define PN cout << endl
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rrep(i,m,n) for(int i = (n-1); i >= (int)(m); i--)
#define inrep(n,a) for(int i = 0; i < (int)(n); i++)cin >> a[i];
#define mod(i) ((i)%(ll)(1e9 + 7))
#define divm(a,b) (mod(a * modpow((ll)b,(ll)(1e9+5))))
#define rsort(a,b,c) sort(a, b, greater<c>())
#define vsort(v) sort(v.begin(), v.end())
#define rvsort(v,c) sort(v.begin(), v.end(), greater<c>()) 
#define ft first
#define sd second
#define pb push_back
#define it insert
#define sz(x) ((int)(x).size())
#define lb(a,n,k) (lower_bound(a,a+n,k) - (a)) 
#define vlb(a,k)  (lower_bound(a.begin(),a.end(),k) - a.begin())
#define ub(a,n,k) (upper_bound(a,a+n,k) - (a)) 
#define vub(a,k)  (upper_bound(a.begin(),a.end(),k) - a.begin())
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define ret return

/*
ll modpow(ll i,ll j){ ll tmp=1; while(j){ if(j%2)tmp=mod(tmp*i);i=mod(i*i);j/=2;}return tmp;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
*/

/*
vector<string> split(const string &str, char sep){
    vector<string> v;
    stringstream ss(str);
    string buffer;
    while( getline(ss, buffer, sep) ) {
        v.push_back(buffer);
    }
    return v;
}
*/

/*
ll ncr[100][100];
ll nCr(int n, int r){if(n==r) ret ncr[n][r] = 1; if(r==0) ret ncr[n][r] = 1; if(r==1) ret ncr[n][r] = n;if(ncr[n][r]) ret ncr[n][r]; ret ncr[n][r] = nCr(n-1,r) + nCr(n-1,r-1);}

ll npr[100][100]={};
ll nPr(int n,int r){if(npr[n][r])ret npr[n][r];if(r==0)ret npr[n][r] = 1;if(r==1)ret npr[n][r] = n;ret npr[n][r] = n * nPr(n-1,r-1);}

ll nHr(int n,int r){ret nCr(n+r-1,r);}
*/

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



int main(){
    
    int a,b,c;
    cin >> a >> b >> c;
    set<int> s;
    s.it(a);s.it(b);s.it(c);
    
    if(sz(s) == 2)Yes;
    else No;
    return  0;
}


Measured memory_bytes: 256
bingo = []
for i in range(3):
  row = [int(j) for j in input().split()]
  bingo.append(row)
ans = "No"
n = int(input())
for i in range(n):
  lot = int(input())
  for j in range(len(bingo)):
    for k in range(len(bingo[j])):
      if bingo[j][k] == lot:
      	bingo[j][k] = -1
    if sum(bingo[j]) == -3:
  	  ans = "Yes"
if (bingo[0][0] + bingo[1][1] + bingo[2][2]) == -3:
  ans = "Yes"
if (bingo[0][2] + bingo[1][1] + bingo[2][0]) == -3:
  ans = "Yes"
if (bingo[0][0] + bingo[1][0] + bingo[2][0]) == -3:
  ans = "Yes"
if (bingo[0][1] + bingo[1][1] + bingo[2][1]) == -3:
  ans = "Yes"
if (bingo[0][2] + bingo[1][2] + bingo[2][2]) == -3:
  ans = "Yes"
print(ans) 

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

int main() {
    int64_t N;
    cin >> N;
    N %= 10;
    if (N == 2 || N == 4 || N == 5 || N == 7 || N == 9) {
        cout << "hon" << endl;
    } else if (N == 0 || N == 1 || N == 6 || N == 8) {
        cout << "pon" << endl;
    } else {
        cout << "bon" << endl;
    }
}

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


int n;
ll ans;
string s;
// s t r i n g  : n = 6  
//0 1 2 3 4 5    

// 1 2 5  : n = 3
//0 1 2 3

//i文字目までで、（前回のプラスj）合計sum
void dfs(int i,int j,ll sum){
  if(i == n){
    ll num = ( i-j >= 1 ? stoll(s.substr(j,i-j)) : 0 );
    sum += num;
    ans += sum;
    //cout << sum << endl; 
    return;
  }else{
    dfs(i+1,j,sum);
    ll num = ( i-j >= 1 ? stoll(s.substr(j,i-j)) : 0 );
    dfs(i+1,i,sum + num);
  }
}

signed main(){
  cin >> s;
  
  n = s.size();
  
  dfs(1,0,0);
  
  //cout << endl;
  cout << ans << endl;
  return 0;
}

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

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

Measured memory_bytes: 256
char t1[301],t2[301];p1,p2,d;Skip(char*tree,int*pp){int h=0;do{if(tree[*pp]=='(')h++;if(tree[*pp]==')')h--;if(d)putchar(tree[*pp]);++*pp;}while(h);}R(d){if(t1[p1]=='('&&t2[p2]=='('){putchar('(');p1++,p2++;R();putchar(',');p1++,p2++;R();putchar(')');p1++,p2++;}else{if(t1[p1]=='(')Skip(t1,&p1);if(t2[p2]=='(')Skip(t2,&p2);}}main(){char o[2];for(;~scanf("%s%s%s",o,t1,t2);){p1=p2=0;d=*o=='u';R();puts("");}}

Measured memory_bytes: 0
import sys
 
BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001
 
 
S = str(input())
P = str(input())
 
is_ok = False
 
for i in range(len(S)):
    FLG = True
    for k in range(len(P)):
        if S[(i+k)%(len(S))] != P[k]:
            FLG = False
            break
 
    if FLG == True:
        is_ok = True
        break
 
if is_ok == True:
    print("Yes")
else:
    print("No")


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

#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
using namespace std;

int main()
{
    ll n;
    cin >> n;
    // vector<int> p(n);
    // rep(i, n) cin >> p[i];
    ll res = 1;
    ll tmp;
    cin >> tmp;
    ll mi = tmp;
    rep(i, n-1) {
        cin >> tmp;
        if (mi < tmp) continue;
        res++;
        mi = tmp;
    }

    cout << res << endl;
    
    return 0;
}


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

int main(){
    string a,b,c;
    char s[3];
    cin >> a >> b >> c;
    s[0] = a[0] - 0x20;
    s[1] = b[0] - 0x20;
    s[2] = c[0] - 0x20;
    for(int i=0;i<3;i++){
        cout << s[i];
    }
    cout << endl;
    return 0;
}

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

#define rep(X,N) for(ll X = 0LL; X < (N); X++)
#define PI (acos(-1.0))
#define MODN 1000000007
#define MODN2 998244353
#define ALL(V) (V).begin(),(V).end()
#define INT_MAX_HALF (INT_MAX / 2)
#define EPS (1e-10)

using namespace std;
typedef long long ll;

int main(){

    /*
    a,b,c
    b+c,a+c,a+b
    2a+b+c, 2b + a + c, 2c + a + b
    2a+3b+3c, 3a+2b+3c
    */

    ll a,b,c,k;
    cin >> a >> b >> c >> k;

    if(k % 2 == 0){
        cout << a - b << endl;
    }else{
        cout << b - a << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, w;
  char a[100][100];
  bool hu[100], wu[100];
  cin >> h >> w;
  for(int i = 0; i < 100; i++) {
    hu[i] = wu[i] = false;
  }
  for (int i = 0; i < h; i++) {
    cin >> a[i];
    for(int j = 0; j < w; j++) {
      if (a[i][j] == '#') {
        wu[j] = true;
        hu[i] = true;
      }
    }
  }
  for (int i = 0; i < h; i++) {
    if (hu[i]) {
      for (int j = 0; j < w; j++) {
        if (wu[j]) {
          cout << a[i][j];
        }
      }
      cout << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 256
class MaxHeapInt(object):
    def __init__(self, val, idx):
        self.val = val
        self.idx = idx

    def __lt__(self, other): return self.val > other.val
    def __eq__(self, other): return self.val == other.val
    def __str__(self): return str(self.val)


def resolve():
    import heapq
    from collections import defaultdict
    N = int(input())
    SS = []
    SP = defaultdict(list)
    for i in range(N):
        S, Pt = input().split()
        P = int(Pt)
        heapq.heappush(SS, S)
        heapq.heappush(SP[S], MaxHeapInt(P, i + 1))
    while len(SS) > 0:
        S = heapq.heappop(SS)
        while len(SP[S]) > 0:
            print(heapq.heappop(SP[S]).idx)


resolve()


Measured memory_bytes: 3420
#include <iostream>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
    int n,m;
    int a[105];
    bool flag=true;
    int ans;
    cin>>n>>m;
    for(int i=0;i<m;i++) cin>>a[i];
    if(m==1) {cout<<a[m-1]-1; return 0;}
   for(int i=m-1;flag;i--)
    {
        sort(a,a+m);
        if(a[m-2]==0) {ans=max(a[m-1]-1,0); flag=false;}
        else {a[m-1]--; a[m-2]--;}
    }
    cout<<ans;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define MODV 1000000007
#define INF INT_MAX // 2147483647
#define INFLL LLONG_MAX // 9223372036854775807
#define rep(i, n) for(ll i=0, i##_len=(ll)(n); i<i##_len; i++)
#define repf(i, n) for(ll i=1, i##_len=(ll)(n+1); i<i##_len; i++)
#define per(i, n) for(ll i=((ll)(n))-1; i>=0; i--)
#define perf(i, n) for(ll i=((ll)(n)); i>0; i--)
#define all(v) v.begin(), v.end()
#define endl "\n"
#define vi vector<ll>
#define vvi vector<vector<ll>>
#define Yes() cout << "Yes" << endl
#define YES() cout << "YES" << endl
#define No() cout << "No" << endl
#define NO() cout << "NO" << endl
#define Init() std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout<<fixed<<setprecision(15);
template<class T>bool chmax(T &a, const T &b){ if(a<b){ a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b){ if(b<a){ a=b; return 1; } return 0; }
using namespace std;

int main(){
    Init();
    ll d, n; cin >> d >> n;
    d = pow(100, d);
    if(n == 100) n++;
    cout << n*d << endl;
}

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

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

int main() {
    long long X;
    cin >> X;
    
    long long total = 100;
    int Counter = 0;
    for (int i = 0; total < X; i++) {
        total += total/100;
        Counter += 1;
    }
    cout << Counter << endl;
}


Measured memory_bytes: 3640
D,G=map(int,input().split())
pc=[list(map(int,input().split())) for _ in range(D)]
lis=[]
for i in range(2**D):
    a=("0"*D+bin(i)[2:])[-D:]
    ans=[0,0]
    for j in range(D):
        if a[j]=="1":
            ans[0]+=pc[j][0]
            ans[1]+=pc[j][1]+(j+1)*100*pc[j][0]
    if ans[1]<G:
        for j in range(D-1,-1,-1):
            if a[j]=="0":
                p=(G-ans[1]-1)//((j+1)*100)+1
                if p<pc[j][0]:
                    ans[0]+=p
                    ans[1]+=p*(j+1)*100
                else:
                    ans=[0,0]
                break
    lis.append(ans)
print(min([a[0] for a in lis if a[1]>=G]))

Measured memory_bytes: 3188
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define int long long
#define inf 1000000007
#define LINF 1000000000000000007mope
#define ll long long
using namespace std;
map<int,int> mope;
signed main(){
	int d;
	cin>>d;
	if( d%9 != 0 ){
		cout<<0<<endl;
		return 0;
	}
	for(int i=0;i<=9;i++){
		for(int j=0;j<=9;j++){
			mope[i-j]++;
		}
	}
	int ans = 0;
	for(int i=2;i<=18;i++){ // i digits;
		vector<int> p10;
		p10.pb(1);
		for(int j=2;j<=i;j++){
			p10.pb( p10[p10.size()-1] * 10);
		}
		vector<int> v;
		for(int j=0;j<p10.size()/2;j++){
			v.pb( p10[i-1-j] - p10[j] );
		}
		int mx = 1<<(v.size()); // 0 small 1 big
		for(int j=0;j<mx;j++){
			int bt = j;
			int cur = 0;
			int pat = 1;
			for(int k=0;k<v.size();k++){
				int ch = bt%2; bt /= 2;
				int dif = d - cur;
				int nxt = abs(dif) / v[k];
				nxt = nxt + ch;
				if( dif < 0 ) nxt = -nxt;
				cur = cur + nxt * v[k];
				if( k == 0 && nxt >= 0 ) pat *= max(0LL,mope[nxt]-1);
				else pat *= mope[nxt];
			}
			if( d == cur ){
				if( i%2 == 0 )ans += pat;
				else ans += pat*10;
			}
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
// #include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; i++)

int main()
{
  int n;
  cin >> n;
  int w[n+10];
  int sum = 0;

  rep(i, n)
  {
    cin >> w[i];
    sum += w[i];
  }
  int mi = 1000000;
  int cnt = 0;
  rep(i, n)
  {
    cnt+= w[i];
    mi = min(mi,abs(sum-2*cnt));
  }
  cout << mi << endl;
  return 0;
}


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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

const int INF=1001001001001001001ll;

int dp[222222][5];

signed main(){
    int L;
    cin>>L;
    vint A(L);rep(i,L)cin>>A[i];

    fill_n(*dp,222222*5,INF);
    rep(i,5)dp[0][i]=0;
    rep(i,L){
        chmin(dp[i+1][0],dp[i][0]+A[i]);
        chmin(dp[i+1][1],dp[i][1]+A[i]%2+(A[i]==0)*2);chmin(dp[i+1][1],dp[i+1][0]);
        chmin(dp[i+1][2],dp[i][2]+(A[i]+1)%2);chmin(dp[i+1][2],dp[i+1][1]);
        chmin(dp[i+1][3],dp[i][3]+A[i]%2+(A[i]==0)*2);chmin(dp[i+1][3],dp[i+1][2]);
        chmin(dp[i+1][4],dp[i][4]+A[i]);chmin(dp[i+1][4],dp[i+1][3]);
    }
    cout<<dp[L][4]<<endl;
    return 0;
}

Measured memory_bytes: 10496
import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		long []A = new long[4];
		String S = sc.next();
		String ans;
		for(int i = 0; i<4;i++){
			A[i]=S.charAt(i)-'0';
		}
		
		
		for(int i = 0;i<(1<<3); i++){
			ans = "" + S.charAt(0);
			long sum = A[0];
			for(int j = 0;j<3;j++){
				if((1&i>>j)==1){
					sum += A[j+1];
					ans += "+" +S.charAt(j+1);
				}else{
					sum -= A[j+1];
					ans += "-" +S.charAt(j+1);
				}
				
			
			}
			if(sum == 7){
				System.out.println(ans + "=7");
				break;
			}
		}
	
	
	}


}






Measured memory_bytes: 21844
s=input()
if "N" in s and "S" in s and "W" in s and "E" in s:
    print("Yes")
elif "N" in s and "S" in s:
    print("No" if "W" in s or "E" in s else "Yes")
elif "W" in s and "E" in s:
    print("No" if "N" in s or "S" in s else "Yes")
else:
    print("No")  

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  vector<double> x(n);
  vector<double> y(n);
  for(int i=0;i<n;i++)
    cin>>x.at(i)>>y.at(i);
  double a=0;
  for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
      a+=sqrt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]))/n;
  cout<<fixed<<setprecision(16);
  cout<<a<<endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <utility>

using namespace std;

int main() {

	int n;
	scanf("%d", &n);

	set<string> v;
	for (int i = 0; i < n; ++i) {
		char s[10];
		scanf("%s", s);
		char c[3];
		scanf("%s", c);
		string q(c);

		if (!strcmp(s, "insert")) {
			v.insert(q);
		} else {
			set<string>::iterator it = v.find(q);
			if (it != v.end()) {
				cout << "yes" << endl;
			} else {
				cout << "no" << endl;
			}
		}
	}

	return 0;
}

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

struct SegR
{
	int value[1<<19],base=1<<18;
	SegR()
	{
		for(int i=0;i<(1<<19);i++)
			value[i]=1e9;
	}
	void add(int p,int v)
	{
		p+=base-1;
		value[p]=v;
		for(p/=2;p;p/=2)
			value[p]=min(value[p*2],value[p*2+1]);
	}
	void del(int p)
	{
		p+=base-1;
		value[p]=1e9;
		for(p/=2;p;p/=2)
			value[p]=min(value[p*2],value[p*2+1]);
	}
	int rangeMin(int s,int e)
	{
		int ans=1e9;
		for(s+=base-1,e+=base-1;s<=e;s/=2,e/=2)
		{
			if(s&1) ans=min(ans,value[s++]);
			if(!(e&1)) ans=min(ans,value[e--]);
		}
		return ans;
	}
} R;

struct SegL
{
	int value[1<<19],base=1<<18;
	SegL()
	{
		for(int i=0;i<(1<<19);i++)
			value[i]=0;
	}
	void add(int p,int v)
	{
		p+=base-1;
		value[p]=v;
		for(p/=2;p;p/=2)
			value[p]=max(value[p*2],value[p*2+1]);
	}
	void del(int p)
	{
		p+=base-1;
		value[p]=0;
		for(p/=2;p;p/=2)
			value[p]=max(value[p*2],value[p*2+1]);
	}
	int rangeMax(int s,int e)
	{
		int ans=0;
		for(s+=base-1,e+=base-1;s<=e;s/=2,e/=2)
		{
			if(s&1) ans=max(ans,value[s++]);
			if(!(e&1)) ans=max(ans,value[e--]);
		}
		return ans;
	}
} L;

int a[200001];

int main()
{
	int n;
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%d",&a[i]);
    for(int i=1;i<=n;i++)
		R.add(a[i],i);
	long long ans=0;
	for(int i=1;i<=n;i++)
	{
		R.del(a[i]);
		if(i>1) L.add(a[i-1],i-1);
		int now=a[i];
		int RR = min(R.rangeMin(1,now-1)-1,n);
		int LL = max(L.rangeMax(1,now-1)+1,1);
		ans += (RR-i+1)*1ll*(i-LL+1)*a[i];
	}
	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 5120
def solve():
  s = input()
  hoge = len(s) // 2
  bit = 0
  if s[0:hoge] == s[-hoge:len(s)][::-1]:
    bit += 1
  n = hoge
  if s[0:hoge][0:hoge] == s[0:hoge][-hoge:len(s)][::-1]:
    bit += 1
  hoge = (len(s) + 3) // 2 - 1
  ss = s[hoge:len(s)]
  huga = len(ss) // 2
  if ss[0:huga] == ss[-huga:len(ss)][::-1]:
    bit += 1
  if len(s) == 3:
    bit = 3
  if bit == 3:
    print("Yes")
  else:
    print("No")
  return 0

if __name__ == "__main__":
  solve()

Measured memory_bytes: 3064
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy, copy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

x = INT()

ans = x//11 * 2
x %= 11

if x == 0:
	print(ans)
else:
	ans += x//6
	x %= 6
	if x == 0:
		print(ans)
	else:
		print(ans+1)

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

using namespace std;
using int64 = long long;

constexpr int DEBUG = 0;

constexpr int64 P = 998244353;

struct FiniteField {
 private:
  int64 x;
 public:
  FiniteField(int64 x) : x(x) {
    if (x > P || x < 0) { cerr << "Invalied FiniteField!" << endl; exit(1); }
  }
  FiniteField() : x(0) {}
  int64 Value() const { return x; }
  inline FiniteField operator+(FiniteField o) const {
    FiniteField r(*this); r += o; return r;
  }
  inline FiniteField operator-(FiniteField o) const {
    FiniteField r(*this); r -= o; return r;
  }
  inline FiniteField operator* (FiniteField o) const {
    FiniteField r(*this); r *= o; return r;
  }
  inline FiniteField operator/ (FiniteField o) const {
    FiniteField r(*this); r /= o; return r;
  }
  inline void operator+= (FiniteField o) { x = (x + o.x) % P; }
  inline void operator-= (FiniteField o) { x = (x + P - o.x) % P; }
  inline void operator*= (FiniteField o) { x = (x * o.x) % P; }
  void operator/=(FiniteField o) {
    int64 p = P - 2; while (p) { if (p % 2) { *this *= o; } o *= o; p /= 2; }
  }
};

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

  int n;
  cin >> n;

  vector<FiniteField> factorials(n + 1);
  vector<FiniteField> inverse_factorials(n + 1);

  factorials[0] = inverse_factorials[0] = 1;
  for (int i = 1; i <= n; i++) {
    factorials[i] = factorials[i - 1] * i;
    inverse_factorials[i] = FiniteField(1) / factorials[i];
  }

  vector<FiniteField> two_powers(n + 1);
  two_powers[0] = 1;
  for (int i = 1; i <= n; i++) {
    two_powers[i] = two_powers[i - 1] * 2;
  }

  FiniteField z = 0;
  for (int k = n / 2 + 1; k <= n; k++) {
    z += factorials[n] * inverse_factorials[k] * inverse_factorials[n - k]
        * two_powers[n - k];
  }
  
  FiniteField ans = 1;
  for (int i = 0; i < n; i++) {
    ans *= 3;
  }
  ans -= z * 2;
  cout << ans.Value() << endl;
}

Measured memory_bytes: 234624
#include <algorithm>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;

#define rep(i, n) for(ll i = 0; i < n; i++)
#define REP(i, n) for(ll i = 1; i < n + 1; i++)
#define PI 3.14159265359
#define EPS 0.0000000001
#define MOD 1000000007
//cout << std::fixed << std::setprecision(15) << y << endl;


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

    ll r = 0, b = 0;
    rep(i, S.size()){
        if(S[i] == '0'){
            r++;
        }else{
            b++;
        }
    }

    cout << min(r, b) * 2 << endl;

    return 0;
}

Measured memory_bytes: 3692
#include<stdio.h>
#include<stdlib.h>

#define MOD 1000000007

int main(void) {
  int i, j, n, m, t;
  int *brk;
  int *d;

  scanf("%d", &n);
  d = malloc(sizeof(int) * (n + 1));
  for (i = 0; i < n; i++) d[i] = 0;

  scanf("%d", &m);
  brk = malloc(sizeof(int) * m);

  for (i = 0; i < m; i++) {
    scanf("%d", &t);
    d[t] = - 1;
  }

  d[0] = 1;
  for (i = 1; i <= n; i++) {
    if (d[i] < 0) {
      d[i] = 0;
      continue;
    }
    d[i] += d[i - 1];
    d[i] %= MOD;
    if (i >= 2) {
      d[i] += d[i - 2];
      d[i] %= MOD;
    } 
  }

  printf("%d\n", d[n]);
}


Measured memory_bytes: 512
import math

n = int(input())
List = [list(map(int, input().split())) for i in range(n)]
dis_list = []
for i in range(n):
    for j in range(n):
        if i != j:
            z = (List[i][0]-List[j][0])**2 + (List[i][1]-List[j][1])**2
            dis = math.sqrt(z)
            dis_list.append(dis)
print(sum(dis_list)/n)

Measured memory_bytes: 38256
#include <bits/stdc++.h>
using namespace std;
 
int main(){
    int h,w;
    cin >> h >> w;
    string x[h][w];
    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            cin >> x[i][j];
        }
    }
    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            if(x[i][j] == "snuke"){
                cout << (char)(j + 'A') << i+1 << endl;
            }
        }
    }
    return 0;
}


Measured memory_bytes: 3548
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#define rep(i,n) for(int (i) = 0, i_len = n; (i) < (i_len); ++(i))
#define repp(i,n) for(int (i) = 1, i_len = n; (i) <= (i_len); ++(i))
#define per(i,n) for(int (i) = n-1; (i) >= 0; --(i))
#define perr(i,n) for(int (i) = n; (i) > 0; --(i))
#define sz(x) ((int)(x).size())
#define popcnt __builtin_popcount
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).begin(),(v).end(),greater<>()
#define debug(x) cerr << #x << ':' << x << '\n'
#define Pi 3.1415926535
#define MOD 1000000007;
using namespace std;
using ll = long long;
using pint = pair<int,int>;
using itn = int;
using vint = vector<int>;
template<class T,class S> inline bool chmax(T& a, S b){if(a<b){a = b; return true;} return false;}
template<class T,class S> inline bool chmin(T& a, S b){if(a>b){a = b; return true;} return false;}
template<class T> T gcd(T a, T b){return b?gcd(b,a%b):a;}
template<class T> T lcm(T a, T b){return a*b/gcd(a,b);}
void yes(){cout << "Yes" << '\n';}
void no(){cout << "No" << '\n';}

int solve(){
    string s, t; cin >> s >> t;
    if(s == t.substr(0,s.size())) yes();
    else no();


    return 0;
}

int main(){
    cin.tie(0);
    cout << fixed << setprecision(10);
    ios::sync_with_stdio(false);
    solve();
    return 0;
}


Measured memory_bytes: 3656
#include <iostream>
#include <algorithm>
#include <string>
#include <bits/stdc++.h>
using namespace std;

int main() {
    int n, x; cin >> n;
    set<int>st;
    for(int i = 0; i < n; i++){
        cin >> x;
        st.insert(x);
    }
    int sz = st.size();
    if(sz == n) cout << "YES" << endl;
    else cout << "NO" << endl;
    
	return 0;
}

Measured memory_bytes: 9600
r, c = map(int, input().split())
L, tl = [], []
for i in range(r):
    L.append(list(map(int, input().split())))
    L[i].append(sum(L[i]))
for i in range(c+1):
    tl.append(sum(l[i] for l in L))
L.append(tl)
for i in range(r+1):
    print(' '.join(str(x) for x in L[i]))


Measured memory_bytes: 5700
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

	Scanner sca = new Scanner(System.in);
	
	int a = sca.nextInt();
	int b = sca.nextInt();
	int c = sca.nextInt();
	
	boolean a_b = (a == 5 || a == 7);
	boolean b_b = (b == 5 || b == 7);
	boolean c_b = (c == 5 || c == 7);
	
	String answer = "YES";
	
	if(a_b && b_b && c_b) {
		if(a + b + c == 17) {
			answer = "YES";
		}
		else {
			answer = "NO";
		}
	}
	else {
		answer = "NO";
	}
	
	System.out.println(answer);
	sca.close();
	}
}

Measured memory_bytes: 23252
#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <set>
#include <bitset>
#include <string>
#include <vector>
#include <queue>
#include <functional>
#include <cstdio>

using std::endl;

#define ll long long int
#define FOR(a, s, n) for(int a = s; a < n; ++a)
#define LEP(a, n) for(int a = 0; a < n; ++a)
#define INF 1145141919810
#define MOD 1000000007
#define OUT std::cout
#define IN std::cin
#define itn int
#define fro for
#define sdt std
#define asn ans

ll N, P;

int main()
{

	IN >> N >> P;

	OUT << (N + P) / 2 + (N + P) % 2 << endl;

	return 0;
}

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

class Procon
{
    public Procon() { }
    static void Main(string[] agrs)
    {
        new Procon().Do();
    }

    Scanner cin;

    public void Do()
    {
        cin = new Scanner();
        string S = cin.nextString();
        if (S.IndexOf("a") < 0)
        {
            Console.WriteLine("No");
            return;
        }
        if (S.IndexOf("b") < 0)
        {
            Console.WriteLine("No");
            return;
        }
        if (S.IndexOf("c") < 0)
        {
            Console.WriteLine("No");
            return;
        }
        Console.WriteLine("Yes");
    }
}

class Scanner
{
    string[] s;
    int i;
    int max_i;

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

    public string nextString()
    {
        if (i >= s.Length)
        {
            s = Console.ReadLine().Split(' ');
            max_i = s.Length;
            i = 0;
            if (max_i == 0)
            {
                return "";
            }
            return s[i++];
        }
        else
        {
            return s[i++];
        }
    }

    public int nextInt()
    {
        return int.Parse(nextString());
    }


    public long nextLong()
    {
        return long.Parse(nextString());
    }

    public double nextDouble()
    {
        return double.Parse(nextString());
    }

    public string[] arrayString()
    {
        return Console.ReadLine().Split(' ');
    }

    public int[] arrayInt()
    {
        string[] str = Console.ReadLine().Split(' ');
        int[] array = new int[str.Length];
        for (int i = 0; i < str.Length; i++)
        {
            array[i] = int.Parse(str[i]);
        }
        return array;
    }

    public long[] arrayLong()
    {
        string[] str = Console.ReadLine().Split(' ');
        long[] array = new long[str.Length];
        for (int i = 0; i < str.Length; i++)
        {
            array[i] = long.Parse(str[i]);
        }
        return array;
    }

    public double[] arrayDouble()
    {
        string[] str = Console.ReadLine().Split(' ');
        double[] array = new double[str.Length];
        for (int i = 0; i < str.Length; i++)
        {
            array[i] = double.Parse(str[i]);
        }
        return array;
    }
}

Measured memory_bytes: 13280
#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <stack>
#include <iomanip>


using namespace std;

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define REPO(i, n) for(int i = 1;i <= n;i++)
#define ll long long
#define INF 1999999999
#define MINF -1999999999
#define INF64 1999999999999999999
#define ALL(n) n.begin(),n.end()
#define MOD 1000000007

ll n, s[8], ya = 0, ans = 0;
int main() {
	cin >> n;
	REP(i, n) {
		ll a; cin >> a;
		if (a >= 3200)ya++;
		else s[a / 400]++;
	}
	REP(i, 8) if (s[i] > 0)ans++;
	cout << max(ans,1ll) << " " << ans + ya<< endl;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii =  pair<int, int>;
using pll =  pair<long long, long long>;
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007LL;
constexpr long long INF = 1000000000LL;
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }


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

    ll ans;
    if(n < b){
        ans = (a * n)/ b;
    } else{
        ans = (a * (b-1)) / b;
    }
    cout << ans << ln;
}


Measured memory_bytes: 3592
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <complex>
#include <cassert>
#define double long double
#define rep(i, n) for (i = 0; i < n; i++)
using namespace std;
typedef complex<double> Point;

const double PI = 3.14159265358979323;

double cross(Point a, Point b) {
	return a.real() * b.imag() - a.imag() * b.real();
}

double dot(Point a, Point b) {
	return a.real() * b.real() + a.imag() * b.imag();
}

bool isOn(Point s, Point e, Point p) {
	if (cross(e - s, p - s) != 0) return false;
	return dot(p - s, p - e) <= 0;
}

int n;
Point p[100];

bool isInTriangle(int id) {
	int i, j, k;
	for (i = 0; i < n; i++) {
		if (i == id) continue;
		for (j = i + 1; j < n; j++) {
			if (j == id) continue;
			for (k = j + 1; k < n; k++) {
				if (k == id) continue;
				if (cross(p[j] - p[i], p[k] - p[i]) == 0) continue;
				if (isOn(p[i], p[j], p[id])) { return true; }
				if (isOn(p[j], p[k], p[id])) { return true; }
				if (isOn(p[k], p[i], p[id])) { return true; }
				double a = cross(p[j] - p[i], p[id] - p[i]);
				double b = cross(p[k] - p[j], p[id] - p[j]);
				double c = cross(p[i] - p[k], p[id] - p[k]);
				if (a < 0 && b < 0 && c < 0) { return true; }
				if (a > 0 && b > 0 && c > 0) { return true; }
			}
		}
	}
	return false;
}

signed main() {
	int i, j, k;
	
	cin >> n;
	rep(i, n) {
		int x, y;
		cin >> x >> y;
		p[i] = Point((double)x, (double)y);
	}
	
	rep(i, n) {
		if (isInTriangle(i)) { cout << 0 << endl; continue; }
		
		vector<Point> vs;
		rep(j, n) {
			if (j == i) continue;
			//p[i] -- p[j]の垂直2等分線の向きを考える.
			Point mul = (p[j] - p[i]) * Point(0, 1);
			Point mid = (p[i] + p[j]) * (double)0.5;
			if (cross(mul, p[i] - mid) < 0) {
				mul *= (-1);
			}
			//単位化しておく
			mul /= abs(mul);
			vs.push_back(mul);
		}
		
		double minDot = 1;
		for (j = 0; j < (int)vs.size(); j++) {
			for (k = j + 1; k < (int)vs.size(); k++) {
				double score = dot(vs[j], vs[k]);
				minDot = min(minDot, score);
			}
		}
		//内積から角度を出す -> ここで内積を逆転させて、argcosする
		if (minDot < -1) minDot = -1;
		double rad = acos(minDot);
		double ans = (PI - rad) / (2.0 * PI);
		printf("%.20Lf\n", ans);
	}
	return 0;
}

Measured memory_bytes: 256
#!/usr/bin/python3
# -*- coding:utf-8 -*-

MAX = 10**9 + 7

def pow_mod_p(n, k, p):
  x = 1
  while k:
    if k % 2 == 1:
      x *= n
      x %= p
    n **= 2
    n %= p
    k >>= 1
  return x

def comb_mod_p(n, k, p):
  x = 1
  for ik in range(k):
    x *= ((n-ik) * pow_mod_p(ik+1, p-2, p))
    x %= p
  return x


def main():
  n, a, b = map(int, input().strip().split())
  sum = pow_mod_p(2, n, MAX) - 1
  sum = sum - comb_mod_p(n, a, MAX) - comb_mod_p(n, b, MAX)
  print(sum % MAX)


if __name__=='__main__':
  main()

Measured memory_bytes: 42780
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int max = *max_element(a, a + n);
  int min = *min_element(a, a + n);
  cout << max - min << endl;
  return 0;
}

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

int main() {
  int A , B , C , D ;
  cin >> A >> B >> C >> D;

if( A + B > C +D ){
    cout << "Left" << endl;
}

if( A+B == C + D){
    cout << "Balanced" << endl;
}

if( A+B < C+D){
    cout << "Right" << endl;
}

}

Measured memory_bytes: 256