akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define LOCAL
using namespace std;
template <typename A, typename B>
ostream& operator <<(ostream& out, const pair<A, B>& a) {
out << "(" << a.first << "," << a.second << ")";
return out;
}
template <typename T, size_t N>
ostream& operator <<(ostream& out, const array<T, N>& a) {
out << "["; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
return out;
}
template <typename T>
ostream& operator <<(ostream& out, const vector<T>& a) {
out << "["; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
return out;
}
template <typename T, class Cmp>
ostream& operator <<(ostream& out, const set<T, Cmp>& a) {
out << "{"; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "}";
return out;
}
template <typename U, typename T, class Cmp>
ostream& operator <<(ostream& out, const map<U, T, Cmp>& a) {
out << "{"; bool first = true;
for (auto& p : a) { out << (first ? "" : ", "); out << p.first << ":" << p.second; first = 0;} out << "}";
return out;
}
#ifdef LOCAL
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
#else
#define trace(...) 42
#endif
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
cerr << name << ": " << arg1 << 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...);
}
#define rep(i,n) for(int i=0; i<(n); i++)
using ll = long long;
#define int long long
using P = pair<int,int>;
//#########################################
signed main(){
    int n;cin >> n;
    vector<int> a(n),b(n);
    rep(i,n)cin >> a[i] >> b[i];
    sort(a.begin(),a.end());
    sort(b.begin(),b.end());
    if(n%2){
        cout << b[n/2] - a[n/2] + 1<< endl;
    }
    else{
        cout << (b[n/2] + b[n/2-1]) - (a[n/2] +a[n/2-1]) +1 << endl;

    }
    
    return 0;
}

Measured memory_bytes: 6364
n,m = map(int,input().split())
H = list(map(int,input().split()))
x = [[] for _ in range(n)]
for i in range(m):
    a,b = map(int,input().split())
    x[a-1].append(H[b-1])
    x[b-1].append(H[a-1])
cnt = 0
for i in range(n):
    if len(x[i])==0:
        cnt += 1
    elif H[i] > max(x[i]):
        cnt += 1
print(cnt)

Measured memory_bytes: 23044
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		if (n == 1){
			System.out.println("Hello World");
		} else {
			int a = sc.nextInt();
			int b = sc.nextInt();
			System.out.println(a + b);
		}
	}
}

Measured memory_bytes: 21204
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int INF=1001001001;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(){
    ll K; cin >> K;
    if (K%2==1){
        cout << 0 << endl;
        return 0;
    }
    
    ll ans=0;
    for (ll i=10; i<=K; i*=5){
        ans+=K/i;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cstring>
#include <iostream>
#define MAXN 5010
#define MOD 1000000007
int head[MAXN], to[MAXN << 1], next[MAXN << 1], tot = 0;
inline void $(int u, int v) {
    next[tot] = head[u], to[tot] = v, head[u] = tot++;
    next[tot] = head[v], to[tot] = u, head[v] = tot++;
}
int n, size[MAXN], sf[MAXN], root, rnt;
void G(int x, int fa) {
    size[x] = 1;
    for (int i = head[x]; ~i; i = next[i]) {
        if (to[i] == fa) continue;
        G(to[i], x);
        size[x] += size[to[i]];
        sf[x] = std::max(sf[x], size[to[i]]);
    }
    sf[x] = std::max(sf[x], n - size[x]);
    if (sf[x] < sf[root])
        root = x, rnt = 1;
    else if (sf[x] == sf[root])
        rnt = 2;
}
long long frc[MAXN], inv[MAXN], f[2][MAXN];
inline long long fpow(long long x, int p) {
    long long r = 1;
    while (p) {
        if (p & 1) (r *= x) %= MOD;
        (x *= x) %= MOD;
        p >>= 1;
    }
    return r;
}
inline long long C(int n, int m) {
    return frc[n] * inv[m] % MOD * inv[n - m] % MOD;
}
int main() {
    frc[0] = 1;
    for (int i = 1; i < MAXN; i++) frc[i] = frc[i - 1] * i % MOD;
    inv[MAXN - 1] = fpow(frc[MAXN - 1], MOD - 2);
    for (int i = MAXN - 1; i; i--) inv[i - 1] = inv[i] * i % MOD;
    std::cin >> n;
    memset(head, -1, sizeof(head));
    for (int i = 1; i < n; i++) {
        int u, v;
        std::cin >> u >> v;
        $(u, v);
    }
    sf[root = 0] = n + 1;
    G(1, 0);
    if (rnt > 1) {
        std::cout << frc[size[1] >> 1] * frc[size[1] >> 1] % MOD << std::endl;
        return 0;
    }
    G(root, 0);
    int now = 0, pre = 1;
    f[pre][0] = 1;
    for (int i = head[root]; ~i; i = next[i]) {
        memset(f[now], 0, sizeof(f[now]));
        for (int j = 0; j <= n; j++) {
            for (int k = 0; k <= size[to[i]]; k++)
                (f[now][j + k] += f[pre][j] * C(size[to[i]], k) % MOD *
                                  C(size[to[i]], k) % MOD * frc[k] % MOD) %=
                    MOD;
        }
        std::swap(pre, now);
    }
    long long ans = 0;
    for (int i = 0; i <= n; i++)
        (ans -= f[pre][i] * (i & 1 ? 1 : -1) * frc[n - i]) %= MOD;
    std::cout << ((ans += MOD) %= MOD) << std::endl;
    return 0;
}

Measured memory_bytes: 640
program main
      read(*,*) i, j
      if (mod(i,3).eq.0) then
        write(*,*) "Possible"
      else if (mod(j,3).eq.0) then
        write(*,*) "Possible"
      else if (mod(i+j,3).eq.0) then
        write(*,*) "Possible"
      else
        write(*,*) "Impossible"
      end if
      end


Measured memory_bytes: 256
#include <iostream>

using namespace std;
int H; int N; int arr[100000]; int temp;

int main()
{
    cin >> H;
    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> temp;
        H -= temp;
    }

    if (H <= 0)
        cout << "Yes";
    else
        cout << "No";

    return 0;
}


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

int cnt[100010];

int main(){
    int n; cin>>n;
    int a[100010];
    for(int i=1;i<=n;i++)cin>>a[i];
    int crt=1,psh=0;
    while(1){
        psh++;
        if(a[crt]==2){
            cout<<psh<<endl;
            return 0;
        }
        if(cnt[a[crt]]){
            cout<<-1<<endl;
            return 0;
        }
        cnt[a[crt]]=1;
        crt=a[crt];
    }
}


Measured memory_bytes: 1024
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
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()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
if N % 2 == 0:
    print(N)
else:
    print(2 * N)

Measured memory_bytes: 5144
# B
N = int(input())
dct = {'AC': 0, 'WA': 0, 'TLE': 0, 'RE': 0}
for i in range(N):
    s = input()
    dct[s] += 1

for k, v in dct.items():
    print(str(k) + ' x ' + str(v))

Measured memory_bytes: 69880
#include "bits/stdc++.h"

#define REP(i,num) for(int i=0;i<(num);++i)
#define LOOP(i) while(i--)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto pitr=c.begin();pitr!=c.end();++pitr){cout<<*pitr;if(next(pitr,1)!=c.end())cout<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

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

	auto S=in<string>();
	string T;
	int N=S.size();

	int left=0,right=N-1;
	int A=0;
	while(right-left>0){
		if(S[left]==S[right]){
			left++;
			right--;
		}
		else if(S[left]=='x'){
			A++;
			left++;
		}
		else if(S[right]=='x'){
			A++;
			right--;
		}
		else{
			out(-1);
			return 0;
		}
	}
	out(A);
	return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 25, M = 1e6 + 25, oo = 1e9+7, mxmsk = 1 << 16;
const long long OO = 1e18+25;
    
#define f first
#define s second

int n, m;
int main() {
    scanf("%d",&n);
    for(int i=1; i<10; i++) 
        if(n/i < 10 && n%i == 0)
        {
            printf("Yes\n");
            return 0;
        }
    printf("No");
    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cctype>
#include<cstring>
const int maxn=1010,mod=1000000007;
int n,m;
long long k;
char s[maxn][maxn];
int p,q,r;
bool ta,tb;
struct Matrix {
	int a[2][2];
	void cls() {
		memset(a,0,sizeof a);
	}
}c;
Matrix operator * (const Matrix &a,const Matrix &b) {
	c.cls();
	for(register int i=0;i<2;++i)for(register int k=0;k<2;++k)for(register int j=0;a.a[i][k]&&j<2;++j)
	b.a[k][j]?c.a[i][j]=(c.a[i][j]+1ll*a.a[i][k]*b.a[k][j])%mod:0;
	return c;
}
Matrix f,x;
int pw(register int x,register long long y) {
	register int s=1;
	for(;y;y>>=1,x=1ll*x*x%mod)y&1?s=1ll*s*x%mod:0;
	return s;
}
void pw(register long long y) {
	for(;y;y>>=1,x=x*x)if(y&1) f=f*x;
}
int main() {
	scanf("%d%d%lld",&n,&m,&k);
	for(register int i=0;i<n;++i)scanf("%s",s[i]);
	if(!k) return puts("1"),0;
	--k;
	for(register int i=0;i<n;++i)for(register int j=0;j<m;++j)p+=s[i][j]=='#';
	for(register int i=0;i<n;++i)if(s[i][0]=='#'&&s[i][m-1]=='#') ta=1,++q;
	for(register int i=0;i<m;++i)if(s[0][i]=='#'&&s[n-1][i]=='#') tb=1,++q;
	if(ta&&tb) return puts("1"),0;
	if(!ta&&!tb) return printf("%d\n",pw(p,k)),0;
	f.a[0][0]=f.a[1][1]=1;
	if(ta) for(register int i=0;i<n;++i)for(register int j=1;j<m;++j)r+=s[i][j]=='#'&&s[i][j-1]=='#';
	else for(register int i=1;i<n;++i)for(register int j=0;j<m;++j)r+=s[i][j]=='#'&&s[i-1][j]=='#';
	x.a[0][0]=p,x.a[0][1]=r,x.a[1][1]=q;
	pw(k);
	printf("%d\n",(f.a[0][0]-f.a[0][1]+mod)%mod);
	return 0;
}

Measured memory_bytes: 1152
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;  
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
#define ll long long int 
#define fi first
#define se second
#define pb push_back
#define pob pop_back
#define mp make_pair
#define pll pair<ll,ll>
#define vll vector<ll>
#define mll map<ll,ll>
#define mod 1000000007
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
#define pqmin priority_queue<ll,vector<ll>,greater<ll>>
#define pqmax priority_queue<ll>
using namespace std;
ll power(ll a,ll n){
	if(n==0)
	  return 1;
	if((n%2)==0)
	  return (power((a*a),n/2));
	else
	  return (a*(power((a*a),n/2)));    
}
     vll g[100001];
vll vis(100001);
void dis(ll r)
{
if(vis[r]==-1)
vis[r]=r;


     for(int i=0;i<g[r].size();i++)
     {
     	if(vis[g[r][i]]==-1)
     	{
     		vis[g[r][i]]=vis[r];
     		dis(g[r][i]);
		 }
	 }
	 return ;
}

int main()
 {
     IOS;
     ll n,m;
     cin>>n>>m;
     ll x,y;
     for(int i=0;i<m;i++)
     {
     	cin>>x>>y;
     	g[x].pb(y);
     	g[y].pb(x);
	 }
	  for(int i=1;i<=n;i++)
	  {
	  	vis[i]=-1;
	  }
	 
	 for(int i=1;i<=n;i++)
	 {
	 	if(vis[i]==-1)
	 	{
	 		dis(i);
		 }
	 }
	  mll mp;
	  for(int i=1;i<=n;i++)
	  {
	  	mp[vis[i]]++;
	  }
	  cout<<mp.size()-1<<endl;
	return 0;
}




Measured memory_bytes: 11616
#include<bits/stdc++.h>
using namespace std;
#define all(a)  (a).begin(),(a).end()
typedef long long ll;
ll mod=1000000007;

int main() {
  ll n; cin >> n;
  vector<pair<ll, ll>> v;
  for (ll i=0; i < n;++i){
    ll a,b; cin >> a >> b;
    v.push_back(make_pair(a, b));
  }
  sort(all(v), [](pair<ll, ll>& a, pair<ll, ll>& b){return a.second < b.second;});
  bool ispossible = true;
  ll sum = 0;
  for (ll i=0; i < n;++i){
    sum += v[i].first;
    if(v[i].second < sum){
      ispossible = false;
      break;
    }
  }
  if(ispossible) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 6384
k=input()

ln=[1,2,3,4,5,6,7,8,9]
i=0
while len(ln)<100001:
    if ln[i]%10==0:
        ln.append(ln[i]*10)
        ln.append(ln[i]*10+1)
    elif ln[i]%10!=9:
        ln.append(ln[i]*10+ln[i]%10-1)
        ln.append(ln[i]*10+ln[i]%10)
        ln.append(ln[i]*10+ln[i]%10+1)
    else:
        ln.append(ln[i]*10+8)
        ln.append(ln[i]*10+9)
    i+=1

# print ln
# print ln[9]
print ln[k-1]

Measured memory_bytes: 38636
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <string>
#include <set>
#include <math.h>
#include <map>
#include <stack>
using namespace std;
static const int INF = 1e9+7;
// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, a, b) for (int i =a; i < b; i++)
#define all(a) a.begin(), a.end()
#define PI 3.14159265359

int main(){
    int h, w; cin >> h >> w;
    string input[h][w];
    rep(i, h){
        string c;
        cin >> c;
        rep(j, 2){
            cout << c << endl;
        }
    }
    return 0;
}


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

using namespace std;

int charToInt(char c) {
  if (c == 'a') return 0;
  if (c == 'b') return 1;
  if (c == 'c') return 2;
}

int main() {
  int turn, countA, countB, countC, i, j, k, A[100], B[100], C[100];
  string tmp;

  countA = countB = countC = 0;
  getline(cin, tmp);
  for (i = 0; i < tmp.length(); i++) {
	A[i] = charToInt(tmp[i]);
	countA++;
  }
  getline(cin, tmp);
  for (i = 0; i < tmp.length(); i++) {
	B[i] = charToInt(tmp[i]);
	countB++;
  }
  getline(cin, tmp);
  for (i = 0; i < tmp.length(); i++) {
	C[i] = charToInt(tmp[i]);
	countC++;
  }

  turn = 0; // Alice = 0, Bob = 1, Charlie = 2
  i = j = k = 0;
  while (i <= countA && j <= countB && k <= countC) {
	switch(turn) {
	  case 0:
		turn = A[i];
		i++;
		break;
	  case 1:
		turn = B[j];
		j++;
		break;
	  case 2:
		turn = C[k];
		k++;
		break;
	  default:
		printf("Should not reach here.\n");
	}
  }

  if (i > countA) printf("A\n");
  if (j > countB) printf("B\n");
  if (k > countC) printf("C\n");
  
  return 0;
}

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

vector<vector<int> > v;
vector<int> A;
priority_queue<int> pq;
int sum=0;

void dfs(int a){
  sum+=A.at(a);
  for(int i=0;i<v.at(a).size();i++){
    dfs(v.at(a).at(i));
  }
  pq.push(sum);
  sum-=A.at(a);
}

int main(){
  int N;
  cin >> N;
  v.resize(N*2);
  A.resize(N*2);
  for(int i=0;i<2*N;i++){
    cin >> A.at(i);
  }
  for(int i=0;i<N-1;i++){
    v.at(i).push_back(i+1);
    v.at(i).push_back(i+N);
  }
  v.at(N-1).push_back(2*N-1);
  for(int i=N;i<2*N-1;i++){
    v.at(i).push_back(i+1);
  }
  dfs(0);
  cout << pq.top() << endl;
  return 0;
}


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

int main(void){
    
    ll n;
    double a[109]={};
    double t=0;
    
    cin >> n;
    
    for(ll i=1; i<=n; i++){
        
        cin >> a[i];
        t += 1/a[i];
        
    }
    
    printf("%.8f", 1/t);
    
    return 0;
    
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
using namespace std;
int main()
{
	long long n,a;
	vector<long long> l;
	cin >> n;
	for(int i=0;i<n+1;i++){
		if(i==0)
			l.push_back(2);
		else if(i==1)
			l.push_back(1);
		else
		{
			a=l[i-1]+l[i-2];
			l.push_back(a);
		}
	}
	cout << l[n] << endl;
	return 0;
}


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

#define REPR(i,n) for(int i=(n); i >= 0; --i)
#define FOR(i, m, n) for(int i = (m); i < (n); ++i)
#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define ALL(a)  (a).begin(),(a).end()
#define endl "\n"

template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
int gcd(int a,int b){return b?gcd(b,a%b):a;}
typedef long long ll;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}

void solve() {
    string S;
    cin >> S;
    string s1,s2;
    REP(i,S.size()/2) {
        if(S[i]!=S[S.size()-1-i]){
            cout << "No" << endl;
            return;
        }
    }
    REP(i,S.size()/2) {
        s1.push_back(S[i]);
    }
    FOR(i,(S.size()/2)+1,S.size()) {
        s2.push_back(S[i]);
    }

    cerr << s1 << endl;
    cerr << s2 << endl;

    REP(i,s1.size()/2) {
        if(s1[i]!=s1[s1.size()-1-i]){
            cout << "No" << endl;
            return;
        }
    }
    REP(i,s2.size()/2) {
        if(s2[i]!=s2[s2.size()-1-i]){
            cout << "No" << endl;
            return;
        }
    }
    cout << "Yes" << endl;
}

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


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

class Program
{
	static void Main(string[] args)
	{
		var inputs = Console.ReadLine().Split(' ').Select(i => int.Parse(i)).ToList();

		// 最大公約数を求める
		int a;
		int b;
		int r;
		if (inputs[0] >= inputs[1])
		{
			a = inputs[0];
			b = inputs[1];
		}
		else
		{
			a = inputs[1];
			b = inputs[0];
		}

		r = a % b;
		while (r != 0)
		{
			a = b;
			b = r;
			r = a % b;
		}

		// Cが最大公約数の倍数かどうかで判断
		if(inputs[2]%b == 0)
			Console.WriteLine("YES");
		else
			Console.WriteLine("NO");
	}
}


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

#define rep3(i, s, n ,a) for (int i = (s); i < (int)(n); i+=a)
#define rep2(i, s, n) rep3(i, s, n, 1)
#define rep(i, n) rep2(i, 0, n)

int main(){
    int k, limit=0, cnt=0, flag=1;
    stack<pair<int, int>> lunlun;
    list<int> answer;
    cin >> k;
    while(flag){
        rep2(i, 1, 10){
            lunlun.push(make_pair(i, limit));
            int answer_dig=limit+1;
            while(!lunlun.empty()){
                int num = lunlun.top().first;
                int depth = lunlun.top().second;
                lunlun.pop();
                if(depth==0){
                    cnt++;
                    //cout << cnt << endl;
                }

                rep(j, depth-answer_dig+1){
                    answer.pop_back();
                }
                answer.push_back(num);
                answer_dig = depth;

                if(cnt==k){
                    int size = answer.size();
                    rep(j, size){
                        cout << answer.front();
                        answer.pop_front();
                    }
                    cout <<  endl;
                    flag = 0;
                    break;
                }else{
                    if(depth!=0){
                        if(num==0){
                            lunlun.push(make_pair(1, depth-1));
                            lunlun.push(make_pair(0, depth-1));
                        }else{
                            if(num==9){
                                lunlun.push(make_pair(9, depth-1));
                                lunlun.push(make_pair(8, depth-1));
                            }else{
                                lunlun.push(make_pair(num+1, depth-1));
                                lunlun.push(make_pair(num, depth-1));
                                lunlun.push(make_pair(num-1, depth-1));
                            }
                        }
                    }
                }
            }
            answer.clear();
            if(flag==0){
                break;
            }
        }
        limit++;
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl 	"\n"

typedef vector< ll > 	vi;
typedef vector< vi > 	vvi;
typedef pair< ll,ll > 	ii;
#define pb 		push_back
#define all(c) 		(c).begin(),(c).end()
#define tr(c,i) 	for(typeof((c).begin() i = (c).begin(); i != (c).end(); i++)
#define present(c,x) 	((c).find(x) != (c).end())

#define MOD 	1000000007
#define INF 	(int)1e9
#define MEM(a, b) memset(a , (b), sizeof(a))

int main()
{	 ios_base::sync_with_stdio(false);
	 cin.tie(NULL);
	
	ll n,k,q;
	cin>>n>>k>>q;
	
	ll a[n];
	 MEM( a, 0);
	
	for(ll i=0; i<n; i++)
		a[i]=k;
	/*for(ll i=0; i<n; i++)
		cout<<a[i]<<" ";
	cout<<endl;
*/
	ll count[n];
	MEM(count, 0);
	ll x;
	for(ll i=0; i<q; i++)
	{
		cin>>x; count[x-1]++;
	}

/*	for(ll i=0; i<n; i++)
		cout<<count[i]<<" ";
	cout<<endl;

*/	for(ll i=0; i<n; i++)
	{
		if( a[i] - (q-count[i] ) > 0)
			cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}

	return 0;
}

Measured memory_bytes: 2176
#include <iostream>
#include <vector>
#include <cmath>
#include <string>

using namespace std;

int main() {
    int ans = 0;
    string s;
    cin >> s;
    for (int i=0; i<4; i++){
        if (s[i]=='+'){
            ans++;
        }else{
            ans--;
        }
    }
    cout << ans << "\n";
    return 0;
}

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

#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<limits.h>

using namespace std;

struct BC{
  long b,c;
};
bool comp(const BC &b, const BC &c){
  return b.c > c.c;
}
int main(){
  long n,m,sum = 0;
  long ii;
  vector<long> a,b,c,arr;
  vector<BC> bc;
  cin >> n >> m;
  a.resize(n);
  arr.resize(pow(10,5)+1);

//  for(ii=0;ii<=pow(10,5);ii++){
//    arr[ii] = 0;
//  }
  for(ii=0;ii<n;ii++){
    cin >> a[ii];
    sum += a[ii];
  }
  sort(a.begin(),a.end());

  for(ii=0;ii<n;ii++){
    //cout << a[ii] << endl;
  }

  b.resize(m);
  c.resize(m);
  bc.resize(m);
  for(ii=0;ii<m;ii++){
    //cin >> b[ii] >> c[ii];
    cin >> bc[ii].b >> bc[ii].c;
  }
  sort(bc.begin(),bc.end(),comp);

//  for(ii=0;ii<m;ii++){
//    cout << bc[ii].c << endl;
//  }
  long cur,max;
  cur = sum;
  max = sum;
  long jj,pos=0;

  for(ii=0;ii<m;ii++){

    for(jj=0;jj<bc[ii].b;jj++){
      //cout << bc[ii].c << endl;
      if(a[pos] < bc[ii].c){
	a[pos] = bc[ii].c;
	pos++;
      }
      else{
	break;
      }
    }
  }
  sum = 0;
  for(ii=0;ii<n;ii++){
    sum += a[ii];
  }
  cout << sum << endl;
  return 0;
}


Measured memory_bytes: 4992
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<string>
#include<cstring>
#include<algorithm>
#include<vector>
#include<map>
#include<iomanip>
#include<queue>

using namespace std;

typedef long long ll;
typedef std::pair<int, int> ipair;
const int MAX_V = 200010;
const int MAX_LOG_V = 18;
vector<ipair> G[MAX_V];
int parent[MAX_LOG_V][MAX_V];
int depth[MAX_V];
vector<int> eulerT;
 
ll ans[MAX_V];
bool used[MAX_V];
template<class T> class TREE {
 
   public:
      int k = 0;
      T distance[MAX_V];
      int begin[MAX_V * 2];
      int end[MAX_V * 2];
 
      // vertex, parent, depth, distance
      void dfs(int v, int p, int d, T l) {
         parent[0][v] = p;
         if (p != -1 && !used[v]) {
            ans[v] += ans[p];
            used[v] = true;
         }
         depth[v] = d;
         distance[v] = l;
         begin[v] = k;
         eulerT.push_back(v);
         k++;
         for (auto& g : G[v]) {
            if (g.first != p) {
               dfs(g.first, v, d + 1, l + g.second);
               eulerT.push_back(v);
               k++;
            }
         }
         end[v] = k;
      }
 
      void init(int V, int root) {
         dfs(root, -1, 0, 0);
         for (int k = 0; k + 1 < MAX_LOG_V; k++) {
            for (int v = 0; v < V; v++) {
               if (parent[k][v] < 0) parent[k + 1][v] = -1;
               else parent[k + 1][v] = parent[k][parent[k][v]];
            }
         }
      }
 
      int lca(int u, int v) {
         if (depth[u] > depth[v]) swap(u, v);
         for (int k = 0; k < MAX_LOG_V; k++) {
            // if k th digit of depth[v] - depth[u] is 1
            if ((depth[v] - depth[u]) >> k & 1) {
               v = parent[k][v];
            }
         }
         if (u == v) return u;
         for (int k = MAX_LOG_V - 1; k >= 0; k--) {
            if (parent[k][u] != parent[k][v]) {
               u = parent[k][u];
               v = parent[k][v];
            }
         }
         return parent[0][u];
      }

      T dist2(int u, int v) {
         return distance[u] + distance[v] - 2 * distance[lca(u, v)];
      }
};

int main() {
   int N, Q;
   cin >> N >> Q;
   int a, b;
   for (int i = 0; i < N - 1; i++) {
      cin >> a >> b;
      a--;
      b--;
      G[a].push_back(ipair(b, 1));
      G[b].push_back(ipair(a, 1));
   }


   memset(used, 0, sizeof(used));
   memset(ans, 0, sizeof(ans));
   int p;
   ll x;
   for (int q = 0; q < Q; q++) {
      cin >> p >> x;
      p--;
      ans[p] += x;
   }
   TREE<int> tree;
   tree.init(N, 0);
   
   for (int i = 0; i < N; i++) {
      cout << ans[i] << endl;
   }

   return 0;
}


Measured memory_bytes: 42612
#include <algorithm>
#include <deque>
#include <iostream>
#include <map>
#include <math.h>
#include <string.h>
#include <vector>

using namespace std;
int main() {
    int A, B, T;
    cin >> A >> B >> T;
    cout << (T / A) * B << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
 
using namespace std;
long long mod=1e9+7;
long long INF=1e7;
double EPS = 1e-12;
const long long lim = 2e5+100;
typedef long long int lld;
typedef long long ll;

#define rep(i,a,n) for(long long int i = (a); i <= (n); ++i)
#define mset(a, v) memset(a, v, sizeof(a))
#define Error(x...) { cout << "(" << #x << ")" << " = ( "; printIt(x); }
template <typename T1> void printIt(T1 t1) { cout << t1 << " )" << endl; }
template <typename T1, typename... T2>
void printIt(T1 t1, T2... t2) { cout << t1 << " , "; printIt(t2...); }
 
 
#define popcount __builtin_popcountll
 
ll powP(ll x, ll y) {
    ll ans = 1, po = x % mod;
    while(y > 0) {
        if(y & 1) ans = ans * po % mod;
        y >>= 1; po = po * po % mod;
    }
    return ans;
}


vector<ll> Ans, Adj[lim];
ll Array[lim], C[lim],dp[600][600];
pair<ll,ll> P[lim];

ll dfs(ll node,ll par) {
    ll countA=1;
    for(auto i: Adj[node]) {
        if(i!=par) {
            ll val = dfs(i,node);
            countA+= val;
            Ans.push_back(val);
        }
    }
    return countA;
}

int main(){

    ios::sync_with_stdio(0);
    cin.tie(0);

    #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
    
    lld T,i,p,j,l,e,r,b,c,k,m,q,a,d,w,x,y,u,v,z,t,curr,prev,sum=0,val,countA=0,indicator=0,pos,h,minA,maxA,type,n,ans=0,left,right;
    string A,B;
    cin>>a>>b>>c;
    cout<< ((a+b-1)/b)*c<<endl;

    return 0;
}
    


Measured memory_bytes: 8308
#pragma GCC optimize("Ofast")
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define PI 3.141592
#define LL_INF 9000000000000000000
#define LL_MINF -9000000000000000000
#define INT_INF 2000000000
#define INT_MINF -2000000000
#define all(a) (a).begin(), (a).end()
#define fi first
#define se second
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

int main(){
    int A, B, C;
    cin >> A >>  B >> C;
    bool flag = false;
    for(int num = A; num <= A * B; num+=A){
        if(num % B == C) flag = true;
    }
    if(flag) puts("YES");
    else puts("NO");
}


Measured memory_bytes: 3612
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new java.util.Scanner(System.in);
        int n = scan.nextInt();
        boolean a = true;
        for(int i = 0; i <= 9; i++){
            for(int j = 0; j <= 9; j++){
                if(n == i * j){
                    System.out.println("Yes");
                    a = false;
                    System.exit(0);
                }
            }
        }
        System.out.println("No");
    }
}

Measured memory_bytes: 21844
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
const ll inf = numeric_limits<ll>::max()/3;

int main(void){
  int num[3][3];
  for(int i = 0;i < 3;++i){
    for(int j = 0;j < 3;++j){
      cin >> num[i][j];
    }
  }
  for(int i = 0;i < 3;++i){
    for(int j = 0;j < 3;++j){
      for(int k = 1;k < 3;++k){
        int calc1 = num[i][k] - num[i][k-1];
        int calc2 = num[j][k] - num[j][k-1];
        if(calc1 != calc2){
          cout << "No" << endl;
          return 0;
        }
      }
    }
  }
  for(int i = 0;i < 3;++i){
    for(int j = 0;j < 3;++j){
      for(int k = 1;k < 3;++k){
        int calc1 = num[k][i] - num[k-1][i];
        int calc2 = num[k][j] - num[k-1][j];
        if(calc1 != calc2){
          cout << "No" << endl;
          return 0;
        }
      }
    }
  }
  cout << "Yes" << endl;
  return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	B
# CreatedDate:  2020-06-13 21:03:30 +0900
# LastModified: 2020-06-13 21:09:41 +0900
#


import os
import sys
#import numpy as np
#import pandas as pd


def main():
    a,v=map(int,input().split()) #oni
    b,w=map(int,input().split()) #escape
    t = int(input())
    sub=abs(a-b)
    if v<=w:
        print('NO')
        return 
    if sub>t*(v-w):
        print("NO")
        return
    print("YES")



if __name__ == "__main__":
    main()


Measured memory_bytes: 9180
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <functional>
#include <bitset>
#include <cassert>
#include <random>
using namespace std;
using ll = long long;



int main() {
	int n; cin >> n;
	vector<int> p(n);
	for (int i = 0; i < n; i++) cin >> p[i];
	int m = 1e9;
	int ans = 0;
	for (int i = 0; i < n; i++) {
		if (p[i] < m) ans++;
		m = min(m, p[i]);
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;
     
int main() {
  std::string s;
  cin >> s;
        
  char cary[10]; 
  s.copy(cary, 10);
  
  int a[10] = {};
  
  int cnt = 0;
  int temp = 0;
  for (int i = 0; i<10;i++){  
      if (cary[i]=='A' || cary[i]=='C' || cary[i]=='G' || cary[i]=='T') {
        cnt += 1;
      }
      else {
        if (temp <= cnt){
          temp = cnt;
        }
        cnt = 0;
      }
    }
  
  cout << max(temp,cnt) << endl;    
    
 
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i ++)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i ++)
#define MP make_pair

using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
const int MOD = 998244353;

int p1, cnt = 3;
int b0[35], b1[35], b2[65];

vector<pair<PII, PII> > S;

void add(int ret, int a, int b)
{
	S.push_back(MP(MP(0, ret), MP(a, b)));
}

void cmp(int ret, int a, int b)
{
	S.push_back(MP(MP(1, ret), MP(a, b)));
}

void mul(int ret, int a, int b)
{
	cmp(cnt, a, b);
	cmp(cnt + 1, b, a);
	add(ret, cnt, cnt + 1);
	cmp(ret, ret, a);
	cnt += 2;
}

void gen_1(int x)
{
	add(x, 0, 1);
	cmp(x, cnt, x);
}

void convert(int x, int ret[])
{
	add(x, x, p1);
	int cur = cnt ++;
	for(int i = 29; i >= 0; i --) {
		add(cur, cur, cur);
		add(cnt, cur, p1);
		rep(j, i) add(cnt, cnt, cnt);
		cmp(ret[i], cnt, x);
		cnt ++;
		add(cur, cur, ret[i]);
	}
}

void output()
{
	printf("%d\n", (int)(S.size()));
	rep(i, S.size()) {
		printf("%c %d %d %d\n", "+<"[S[i].first.first], S[i].second.first, S[i].second.second, S[i].first.second);
	}
}

int main()
{
	p1 = cnt ++;
	rep(i, 30) b0[i] = cnt ++;
	rep(i, 30) b1[i] = cnt ++;
	rep(i, 60) b2[i] = cnt ++;
	
	gen_1(p1);;
	convert(0, b0);
	convert(1, b1);
	
	rep(i, 30) rep(j, 30) {
		int cur = cnt ++;
		mul(cur, b0[i], b1[j]);
		add(b2[i + j], b2[i + j], cur);
	}
	
	rep(i, 60) {
		rep(j, i) add(b2[i], b2[i], b2[i]);
		add(2, 2, b2[i]);
	}
	
	output();
	return 0;
}

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

#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define repn(i, n) for(int (i) = 1; (i) <= (n); (i)++)
#define repr(i, n) for(int (i) = (n-1); (i) >= 0; (i)--)
#define all(x) (x).begin(), (x).end()
#define lint long long
#define ulint unsigned long long
#define fi first
#define se second
#define setpre(x) cout << fixed << setprecision(x)
#define ii(x) int x; cin >> (x)
#define ii2(x, y) int x, y; cin >> (x) >> (y)
#define ii3(x, y, z) int x, y, z; cin >> (x) >> (y) >> (z)
#define out(x) cout << (x) << endl
#define yn(x) cout << ((x)?("Yes"):("No")) << endl
#define YN(x) cout << ((x)?("YES"):("NO")) << endl
#define bit_c(x) __builtin_popcountll(x)

inline void logger(){ cout << endl; }
template<typename A, typename... B>
void logger(const A& a, const B&... b){
    cout << a << " , ";
    logger(b...);
}

typedef pair<lint, lint> P;
const lint MOD = 1000000007;
const lint MOD9 = 998244353;
const lint INF = MOD * MOD;
const int MAX = 100005;

/* ...o(^-^)o... */

int main(){
    int n; cin >> n;
    vector<lint> va, vb;
    rep(i, n){
        lint x; cin >> x; va.push_back(x);
    }
    rep(i, n){
        lint x; cin >> x; vb.push_back(x);
    }

    lint ans = 0;
    repr(k, 29){
        rep(i, n) vb[i] %= (1LL << (k+1));
        sort(all(vb));

        lint s1 = (1LL << k), t1 = s1*2, s2 = s1*3, t2 = s1*4;
        lint count = 0;
        rep(i, n){
            va[i] %= (1LL << (k+1));
            auto itr1 = lower_bound(all(vb), s1 - va[i]);
            auto itr2 = lower_bound(all(vb), t1 - va[i]);
            auto itr3 = lower_bound(all(vb), s2 - va[i]);
            auto itr4 = lower_bound(all(vb), t2 - va[i]);
            count += (itr2 - itr1);
            count += (itr4 - itr3);
        }
        if(count & 1) ans += (1LL << k);
    }
    out(ans);
    return 0;
}

Measured memory_bytes: 4848
import java.util.*;
 
public class Main {
    public static void main(String[] args) {	
	Main main = new Main();
    	main.solveB();
    }
    
    private void solveB() {
    	Scanner sc = new Scanner(System.in);
	int a = sc.nextInt();
        int b = sc.nextInt();
        int n = b - a;
        int c = 0;

        for (int i = 0; i<= n; i++){
	    c += i;
}

    	System.out.println(c-b);
    }
}


Measured memory_bytes: 21844
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main(void) {
	int i, ok = true;
	vector<int> d(26, 0);
	string s;
	cin >> s;
	for (i = 0; i < s.size(); i++)
		d[s[i] - 'A']++;
	for (i = 0; i < 26; i++) {
		if (d[i] != 0 && d[i] != 2) {
			ok = false;
			break;
		}
	}
	if (ok)
		printf("Yes\n");
	else
		printf("No\n");
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define SaveTime ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back 
#define eb emplace_back
#define mx *max_element
#define mi *min_element
#define fn for(int i =0 ;i <n;i++)
#define fn1 for( int i =1;i<=n;i++)
#define fm for(int j =0 ;j <m;j++)
#define fm1 for(int j =1;j<=m;j++)
#define fi first
#define se second
#define MOD 1000000007
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
const int N = 1e6+5;
const int INF = 1e18L;
int ncr(int n,int r){if(n<r)return 0;int p=1,k=1;if(n-r<r)r=n-r;if(r!=0){while(r){p*=n;k*=r;int g=__gcd(p, k);p/=g;k/=g;n--;r--;}}else p=1;return p;}
#define pi acos(-1)
int ar[N];
int tree[2*N];
int dp[N];
int bit[N];
signed main(){
 
	SaveTime;
	int T=1;
	// cin >> T;
	while(T--){
		int n, k ,q;
		cin >> n >> k >> q;
		for(int i=0;i<n;i++){
			dp[i]=-1*q;
		}
		while(q--){
			int idx;
			cin >> idx;
			idx--;
			dp[idx]++;
		}
		fn{
			dp[i]+=k;
			if(dp[i]<=0)cout<<"No\n";
			else
				cout<<"Yes\n";
		}
	
	}
	
	return 0;
}


Measured memory_bytes: 4736
from collections import deque
n=int(input())
ab=[list(map(int,input().split())) for i in range(n-1)]
lines=[[] for i in range(n)]
for a,b in ab:
  lines[a-1].append(b-1)
q=deque([0])
color=[0]*n
while q:
  x=q.popleft()
  c=1
  for y in lines[x]:
    if c==color[x]:
      c+=1
    color[y]=c
    c+=1
    q.append(y)
print(max(color))
for i in range(n-1):
  print(color[ab[i][1]-1])

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

void zero (int x1,int x2,int x3,int x4,int x5)
{
if(x1==0)
  cout<<"1";
  if(x2==0)
  cout<<"2";
 if(x3==0)
  cout<<"3";
  if(x4==0)
  cout<<"4";
  if(x5==0)
  cout<<"5";
   
}

int main()
{
  int a,b,c,d,e;
  cin>>a>>b>>c>>d>>e;
  zero(a,b,c,d,e);
  return 0;
}

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

int main(){
	int r, c, a[105][105];
	cin >> r >> c;
	for(int i=1; i<=r; i++)
		for(int j=1; j<=c; j++)
			cin >> a[i][j];
	for(int i=1; i<=r; i++){
		a[i][c+1] = 0;
		for(int j=1; j<=c; j++)
			a[i][c+1] += a[i][j];
	}
	for(int j=1; j<=c+1; j++){
		a[r+1][j] = 0;
		for(int i=1; i<=r; i++)
			 a[r+1][j] += a[i][j];
	}
	for(int i=1; i<=r+1; i++){
		for(int j=1; j<c+1; j++)
			cout << a[i][j] << " ";
		cout << a[i][c+1] << endl;
	} 
	return 0;
}


Measured memory_bytes: 3140
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
ll mod=1e9+7;
int main()
{
	ll i,j,k,m,n,t;
	cin>>n;
	ll ar[n];
	for(i=0;i<n;i++)
	cin>>ar[i];
	ll suf[n];
	suf[n-1]=ar[n-1];
	for(i=n-2;i>=0;i--)
	{
		suf[i]=suf[i+1]+ar[i];
	}
	ll ans=0;
	for(i=0;i<n-1;i++)
	{
		ll x=ar[i]*(suf[i+1]%mod);
		x%=mod;
		ans+=x;
		ans%=mod;
	}
	cout<<ans;
}

Measured memory_bytes: 6756
#include<bits/stdc++.h>
using namespace std;
int ans = INT32_MAX, temp;
int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int N, C;
    cin >> N >> C;
    int D[C][C];
    for (int i = 0; i < C; i++) {
        for (int j = 0; j < C; j++) {
            cin >> D[i][j];
        }
    }
    map<int, int> M[3];
    int c;
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
            cin >> c;
            M[(i+j)%3][c-1]++;
        }
    }
    int i[3];
    for (i[0] = 0; i[0] < C; i[0]++) {
        for (i[1] = 0; i[1] < C; i[1]++) {
            if (i[0] == i[1]) continue;
            for (i[2] = 0; i[2] < C; i[2]++) {
                if (i[0] == i[2] || i[1] == i[2]) continue;
                temp = 0;
                for (int l = 0; l < 3; l++) {
                    for (auto &m : M[l]) {
                        temp += D[m.first][i[l]]*m.second;
                    }
                }
                ans = min(temp, ans);
            }
        }
    }
    printf("%d\n", ans);
    return 0;
}

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

int main() {
  string S;
  cin >> S;
  
  if ( S == "SUN" ) {
    cout << 7 << endl; 
  }
  else if ( S == "MON" ) {
    cout << 6 << endl; 
  }
  else if ( S == "TUE" ) {
    cout << 5 << endl; 
  }
  else if ( S == "WED" ) {
    cout << 4 << endl; 
  }
  else if ( S == "THU" ) {
    cout << 3 << endl; 
  }
  else if ( S == "FRI" ) {
    cout << 2 << endl; 
  }
  else {
    cout << 1 << endl; 
  }
}


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

using namespace std;
using ll = long long;
using ld = long double;

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

    char a[100][100];

    for (int i = 0; i < H; ++i) {
        string s;
        cin >> s;
        for (int j = 0; j < W; ++j) {
            a[i][j] = s[j];
        }
    }


    for (int i = 0; i < H; ++i) {
        bool flag = true;
        for (int j = 0; j < W; ++j) {
            if (a[i][j] == '#') {
                flag = false;
                break;
            }
        }
        if (flag) {
            for (int j = 0; j < W; ++j) {
                a[i][j] = 'o';
            }
        }
    }
    for (int j = 0; j < W; ++j) {
        bool flag = true;
        for (int i = 0; i < H; ++i) {
            if (a[i][j] == '#') {
                flag = false;
                break;
            }

        }
        if (flag) {
            for (int i = 0; i < H; ++i) {
                a[i][j] = 'o';
            }
        }

    }

    for (int i = 0; i < H; ++i) {
        string s;
        for (int j = 0; j < W; ++j) {
            if (a[i][j] != 'o') {
                s += a[i][j];
            }
        }
        if (s != "") {
            cout << s << endl;
        }
    }


}


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

int main(){
    int n, x;
    cin >> n >> x;
    vector<int> L(n);
    for (int i = 0; i < n; i++) cin >> L[i];
    vector<long long> acc(n+1, 0);
    for (int i = 0; i < n; i++) acc[i + 1] = acc[i] + L[i];
    for (int i = 0; i <= n; i++){
        if (acc[i] > x){
            cout << i << endl;
            exit(0);
        }
    }
    cout << n + 1 << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long 
using namespace std;
const int maxn=1e5+5;
int a[maxn];
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    if(n==1){
      cout<<"a"<<endl;
      return 0;
    }
    string ans="";
    while(n){
      
      ans+=('a'+(n-1)%26);

      n=(n-1)/26;
    }
    reverse(ans.begin(),ans.end());
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3624
#include <iostream>
#include <iomanip>
#include <utility>
#include <cmath>
#include <random>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <algorithm>
using namespace std;

#define rep(i,n) for(int i = 0; i<n; ++i)
#define REP(i,n) for(int i = 1; i<=n; ++i)
#define all(x) begin(x),end(x)
typedef long long ll;
typedef pair<int,int> ip;
typedef pair<ll,ll> lp;
const int inf = 1001001000;
const ll INF = 1LL<<60;
const int MOD = (int)1e9 + 7;

int main(){
	int N;
	cin>>N;
	vector<lp> t(N);
	rep(i,N)cin>>t[i].second>>t[i].first;
	bool ans = true;
	ll sum = 0LL;
	sort(all(t));
	rep(i,N){
		sum += t[i].second;
		if(sum > t[i].first){
			ans = false;
			break;
		}
	}
	cout<<((ans)?"Yes":"No")<<endl;
	return 0;
}

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

using namespace std;

using ll = long long;
using ld = long double;

using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vs = vector<string>;
using vld = vector<ld>;
using vvld = vector<vld>;

typedef pair<ll, ll> P;

#define bit(n) (1LL << (n))

//#define int long long

#define all(v) v.begin(), v.end()

#define rep(i, n) for (ll i = 0; i < n; i++)
#define REP(i, n) for (ll i = 1; i < n; i++)

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORm(i, m) for (auto i = m.begin(); i != m.end(); i++)

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

#define mod (ll)(1e9 + 7)
// #define mod (998244353ll)

const long long INF = 1LL << 60;

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);

  ll n;
  cin >> n;

  vll t(n + 1), x(n + 1), y(n + 1);
  REP(i, n + 1) {
    cin >> t[i] >> x[i] >> y[i];
  }

  rep(i, n) {
    ll dx = abs(x[i + 1] - x[i]);
    ll dy = abs(y[i + 1] - y[i]);
    ll dt = t[i + 1] - t[i];

    if ((dx + dy) > dt || (dt - dx - dy) % 2 == 1) {
      cout << "No" << endl;
      return 0;
    }
  }

  cout << "Yes" << endl;

  return 0;
}


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

int main(){
  int n; cin>>n;
  vector<int> a(n);
  double x=0;
  for(int i=0;i<n;i++){
    cin>>a.at(i);
  }
  sort(a.begin(),a.end());
  x+=a.at(0);
  for(int i=1;i<n;i++){
    x=(x+a.at(i))/2;
  }  
  
  cout<<x<<endl;
}
  
    
    


Measured memory_bytes: 256
n=int(input())
a=[input() for i in range(n)]
count=0
ca=0
cb=0
cc=0
for i in a:
    count+=i.count('AB')
    if i[0]=='B':cb+=1
    if i[-1]=='A':ca+=1
    if i[0]=='B' and i[-1]=='A':cc+=1
ans=count+min(ca,cb)
if max(ca,cb)==cc and cc!=0:ans-=1
if len(a)==1:ans=a[0].count('AB')
print(ans)

Measured memory_bytes: 3700
using System;

class CommonRacoon
{
    static void Main(string[] args)
    {     
       var input = Console.ReadLine().Split(' ');
        var strength = int.Parse(input[0]);
        var times = int.Parse(input[1]);

        var damage = Console.ReadLine().Split(' ');
        var output = "No";

        for(var i = 0;i < times; i++)
        {
            strength -= int.Parse(damage[i]);
            if(strength <= 0)
            {
                output = "Yes";
                break;
            }
        }

        Console.WriteLine(output);
    }
}

Measured memory_bytes: 16480
def find_bill_combination(n, y):
	q, mod = divmod(y, 10000)
	if n * 10000 > y > (n - 1) * 10000 + 5000:
		return '-1 -1 -1'
	else:
		if q == n and mod == 0:
			return '{} 0 0'.format(q)
		else:
			for a in range(q + 1):
				b = int((y - 1000 * n - 9000 * a) / 4000)
				c = int((5000 * n - y + 5000 * a) / 4000)
				if a + b + c == n and a >= 0 and b >= 0 and c >= 0 and 10000 * a + 5000 * b + 1000 * c == y:
					return '{} {} {}'.format(a, b, c)
			else:
				return '-1 -1 -1'


def main():
	n, y = [int(x) for x in input().split(' ')]
	print(find_bill_combination(n, y))


if __name__ == '__main__':
	main()


Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <map>

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

int main(){
    int a,b,h;
    cin >>a >> b >> h;
    cout << (a+b)*h/2  << endl;


    return 0;
}

Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var A, B int
	fmt.Scan(&A, &B)
	if A == 1 {
		A = 14
	}
	if B == 1 {
		B = 14
	}
	if A == B {
		fmt.Println("Draw")
	} else if A > B {
		fmt.Println("Alice")
	} else {
		fmt.Println("Bob")
	}
}


Measured memory_bytes: 512