akhauriyash/Code-Regression huggingface dataset:
// Best practice

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file 
#include <ext/pb_ds/tree_policy.hpp> 
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <functional> // for less 

#define int         long long
#define pb          emplace_back
#define pf          emplace_front
#define all(a)      (a).begin(),(a).end()
#define rall(a)     (a).rbegin(),(a).rend()
#define x           first
#define y           second
#define endl        '\n'
#define tezz        ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std;
using namespace __gnu_pbds; 
 
typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> pbds; 

#define fbo find_by_order
#define ook order_of_key

signed main() {
   tezz
   
      int h,n;
      cin >> h >> n;
      int hh=h+10000;
      vector<int> hel(n),point(n);
      
      for(int i=0; i<n; i++){
          cin >> hel[i] >> point[i];
      }
      
      vector<int> dp(hh+1,INT_MAX);
      dp[0]=0;
      
      for(int i=0; i<n; i++){
          for(int j=hel[i]; j<=hh; j++){
              dp[j] = min(dp[j] , dp[j-hel[i]]+point[i]);
          }
      }
  
      int mm=INT_MAX;
      for(int i=h; i<=hh; i++)mm=min(mm,dp[i]);
      cout << mm << endl;
  
   return 0;
}




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

using namespace std;

int main(){
    int n, ans = 0;
    string a, b, c;
    cin >> n >> a >> b >> c;
    for (int i = 0; i < n; ++i){
        if (a[i] != b[i] && b[i] != c[i] && c[i] != a[i]){
            ans += 2;
        }
        else if ((a[i] == b[i] && b[i] != c[i]) || (a[i] != b[i] && b[i] == c[i]) ||(a[i] == c[i]) && (b[i] != c[i])){
            ans += 1;
        }
}
    cout << ans;
    return 0;
}

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

int main()
{
    int n, count = 1, next = 1;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++)
    {
        cin >> a.at(i);
    }

    while (count <= n)
    {
        if (a.at(next - 1) == 2)
        {
            cout << count << endl;
            return 0;
        }
        else
        {
            next = a.at(next - 1);
            count++;
        }
    }
    cout << -1 << endl;
}

Measured memory_bytes: 640
fn read<T: std::str::FromStr>(
    stdin_lock: &mut std::io::StdinLock,
    buf: &mut Vec<u8>,
    delimiter: u8,
) -> T {
    buf.clear();
    let l = std::io::BufRead::read_until(stdin_lock, delimiter, buf).unwrap();
    buf.truncate(l - 1); // remove delimiter
    let s = unsafe { std::str::from_utf8_unchecked(&buf) };
    s.parse().unwrap_or_else(|_| panic!("read"))
}

fn main() {
    let stdin = std::io::stdin();
    let mut stdin_lock = stdin.lock();
    let mut buf: Vec<u8> = Vec::new();
    let n: usize = read(&mut stdin_lock, &mut buf, b'\n');
    let mut av = vec![0i32; n];
    for i in 0..n - 1 {
        av[i] = read(&mut stdin_lock, &mut buf, b' ');
    }
    av[n - 1] = read(&mut stdin_lock, &mut buf, b'\n');

    let max_a = av.iter().max().unwrap();
    let min_a = av.iter().min().unwrap();
    let ans = (max_a - min_a).abs();
    println!("{}", ans);
}


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

int main(){

  int a[5], b[5];

  for(int i=0;i<4;i++) cin >> a[i];
  for(int i=0;i<4;i++) cin >> b[i];

  int k = 0, s = 0;
  for(int i=0;i<4;i++){
    k += a[i];
    s += b[i];
  }

  cout << max(k,s) << endl;
}

Measured memory_bytes: 1160
#include<stdio.h>
#define N 100
#define WHITE 0
#define GRAY 1
#define BLACK 2
 
void dfs(void);
void visit(int);
 
int G[N][N],n;
int d[N],f[N],color[N],time;
 
int main(){
   int i,j,k,u,v;
  scanf("%d",&n);
  for(i = 0; i < n; i++){
    for(j = 0; j < n; j++){
      G[i][j] = 0;
    }
  }
  for(i = 0; i < n; i++){
    scanf("%d%d",&u,&k);
    u--;
    for(j = 0; j < k; j++){
      scanf("%d",&v);
      v--;
      G[u][v] = 1;
    }
  }
  dfs();
  return 0;
}
  void dfs(){
    int u;
    for(u = 0; u < n; u++) color[u] = WHITE;
    time = 0;
    for(u =0 ; u < n; u++){
      if(color[u] == WHITE) visit(u);
    }
    for( u = 0; u < n; u++){
      printf("%d %d %d\n",u+1,d[u],f[u]);
    }
  }
  void visit(int u){
    int v;
    color[u] = GRAY; 
    d[u] = ++time;
    for(v = 0; v < n; v++){
      if(G[u][v] == 0) continue;
      if(color[v] == WHITE){
    visit(v);
      }
    }
    color[u] = BLACK;
    f[u] = ++time;
  }

Measured memory_bytes: 636
S = input()

ans = 'WA'

if S[0] == 'A' and S[2:-1].count('C') == 1:
    for s in S:
        if (not (s == 'A' or s == 'C')) and not s.islower():
            break
    else:
        ans = 'AC'

print(ans)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
template<class t> inline t read(t &x){
	x=0;char c=getchar();bool f=0;
	while(!isdigit(c)) f|=c=='-',c=getchar();
	while(isdigit(c)) x=(x<<1)+(x<<3)+(c^48),c=getchar();
	if(f) x=-x;return  x;
}
template<class t> inline void write(t x){
	if(x<0){putchar('-'),write(-x);}
	else{if(x>9)write(x/10);putchar('0'+x%10);}
}

const int N=3e4+5;
int n,a[N],ans,nxt[N][10];
bool mp[1000];

signed main(){
	read(n);
	for(int i=1;i<=n;i++) scanf("%1d",&a[i]);
	for(int i=0;i<=9;i++) nxt[n+1][i]=nxt[n+2][i]=n+1;
	for(int i=n;i;i--){
		for(int j=0;j<=9;j++){
			if(a[i]==j) nxt[i][j]=i;
			else nxt[i][j]=nxt[i+1][j];
		}
	}
	for(int i=1;i+2<=n;i++){
		int x=a[i];
		for(int y=0;y<=9;y++) if(nxt[i+1][y]<=n){
			for(int z=0;z<=9;z++) if(nxt[nxt[i+1][y]+1][z]<=n){
				if(!mp[x*100+y*10+z]){
					ans++;
					mp[x*100+y*10+z]=1;
				}
			}
		}
	}
	write(ans);
}

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

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define vec vector
#define pb push_back
#define ll long long
#define MOD 100000007
#define MAX 1000000000000

ll path(ll x, ll y, ll z)
{
  return abs(x - y) + abs(y - z);
}

int main(void)
{
  int a, b, q;
  cin >> a >> b >> q;

  vec<ll> s(a), t(b);
  rep(i, a) cin >> s[i];
  rep(i, b) cin >> t[i];

  rep(o, q) {
    ll x;
    cin >> x;
    auto its = lower_bound(s.begin(), s.end(), x);
    auto itt = lower_bound(t.begin(), t.end(), x);
    ll sr = its == s.end() ? MAX : *its;
    ll sl = its == s.begin() ? - MAX : *(--its);
    ll tr = itt == t.end() ? MAX : *itt;
    ll tl = itt == t.begin() ? - MAX : *(--itt);

    vec<ll> cand(0);
    cand.pb(path(x, sr, tr));
    cand.pb(path(x, sr, tl));
    cand.pb(path(x, sl, tr));
    cand.pb(path(x, sl, tl));
    cand.pb(path(x, tr, sr));
    cand.pb(path(x, tr, sl));
    cand.pb(path(x, tl, sr));
    cand.pb(path(x, tl, sl));
    cout << *min_element(cand.begin(), cand.end()) << endl;
  }
  return 0;
}


Measured memory_bytes: 2944
# N = int(input())
# A = [int(x) for x in input().split()]
# V = [[0] * 100 for _ in range(100)]

N, K = [int(x) for x in input().split()]
V = [int(x) for x in input().split()]

ans = 0
# 左からl個(0..K)
for l in range(K + 1):
    # 右からはr個(0..K-l)
    for r in range(K - l + 1):
        # N個よりは取れない
        if l + r > N:
            continue
        # 残りの操作数
        d = max(0, K - (l + r))

        # 合計値
        s = sum(V[:l]) + sum(V[N - r:])
        # 手元のマイナス
        neg = filter(lambda x: x < 0, V[:l] + V[N - r:])
        neg = list(neg)
        neg.sort()
        for i in range(d):
            if i < len(neg):
                s -= neg[i]

        # print(s)
        ans = max(ans,s)

print(ans)


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

#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep1(i, n) for (ll i = 1; i < (ll)(n); i++)
#define INF 10000000000
#define MOD 1000000007
using ll = unsigned long long;
using Graph = vector<vector<int>>;

int main(){
    ll N; cin>>N;
    vector<ll> A(N); rep(i,N)cin>>A.at(i);
    sort(begin(A),end(A));
    ll A_MAX = A.at(N-1);
    vector<ll> cnt(A_MAX+1,0);
    for(auto i: A){
        if(cnt[i]!=0){
            cnt[i] = 2;
            continue;
        }
        for(ll j = i; j <= A_MAX; j += i)cnt[j]++;
    }
    ll res = 0;
    for(auto i: A){
        if(cnt[i]==1)res++;
    }
    cout<<res<<endl;
}

Measured memory_bytes: 12716
#include <bits/stdc++.h>
using namespace std;
void __print(int x) {cout << x;}
void __print(long x) {cout << x;}
void __print(long long x) {cout << x;}
void __print(unsigned x) {cout << x;}
void __print(unsigned long x) {cout << x;}
void __print(unsigned long long x) {cout << x;}
void __print(float x) {cout << x;}
void __print(double x) {cout << x;}
void __print(long double x) {cout << x;}
void __print(char x) {cout << '\'' << x << '\'';}
void __print(const char *x) {cout << '\"' << x << '\"';}
void __print(const string &x) {cout << '\"' << x << '\"';}
void __print(bool x) {cout << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cout << '{'; __print(x.first); cout << ','; __print(x.second); cout << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cout << '{'; for (auto &i: x) cout << (f++ ? "," : ""), __print(i); cout << "}";}
void _print() {cout << "\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cout << ", "; _print(v...);}
#define debug(x...) cout << #x << " = "; _print(x)
typedef long long ll; typedef vector<int> vi; typedef vector<ll> vll;
#define rep(i,a,b) for (ll i = (a); i < (b); ++i)
#define per(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define all(x) begin(x), end(x)
#define mp make_pair 
#define pb push_back
#define ff first
#define ss second
#define fast ios_base::sync_with_stdio(NULL);cin.tie(NULL);cout.tie(NULL) 
const int mod = 1e9 + 7, mxn = 1e5 + 1;

int solve(){
	ll a;
	cin>> a;
	ll lcm = (360ll * a) / __gcd(360ll, a);
	ll ans = lcm / a;
	cout<< ans<< "\n";
	return 0;
}
 
int main()
{
    fast;
    int t = 1;
    //cin>> t;
    while(t--){  
        solve();
    }
    return 0;
}
//v.clear(), vis.clear(); vis.resize(n + 1, 0), v.resize(n + 1);
 
/*  inv[1] = 1; // inv is ll
    for(int i=2; i<=mxn; ++i)
        inv[i]=mod-mod/i*inv[mod%i]%mod;*/
        
// lower bound   >=  
// upper bound   >
// vector<int>().swap(vec); //free memory from vec


Measured memory_bytes: 3656
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vs = vector<string>;
using msi = map<string, int>;
using mii = map<int, int>;
using psi = pair<string, int>;
using pii = pair<int, int>;
using vlai = valarray<int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define range(i,s,n) for(int i=s;i<n;i++)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define INF 1E9
#define EPS 1E-9
#define MOD (ll)(1E9+7)
#define PI 3.1415926535897932384

template <class T>ostream &operator<<(std::ostream &o, const vector<T> &v)
{
	rep(i, v.size()) {
		o << (i > 0 ? " " : "") << v[i];
	}
	return o;
}

int main() {
	int n;
	cin >> n;
	vvi a(n, vi(n, 0));
	rep(i, n) {
		int num,m;
		cin >>num >>m;
		rep(i, m) {
			int tmp;
			cin >> tmp;
			a[num - 1][tmp - 1] = 1;
		}
	}
	rep(i, n) {
		rep(j, n) {
			cout << a[i][j]<<(j!=n-1?" ":"\n");
		}
	}
}



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

int main(){
  int H,W;
  string s;
  cin >> H >> W;
  for(int i=0;i<H+2;i++){
    if(i==0|i==H+1){
      for(int j=0;j<W+2;j++){
        cout << "#" ;
      }
      cout << endl;
    }else{
      cout << "#" ;
      cin >> s;
      for(int j=0;j<s.size();j++){
        cout << s[j];
      }
      cout << "#" << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(void){
    double n,count=0;
    int i=0;
    cin >> n;
    
    for(int i=1;i<=n;i++){
        if(i%2==1) count++;
        else count +=0;
    }
    //cout << count << endl;
    cout << setprecision(10) << (double)count/n << endl;
}


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

#define ll long long
#define ld long double
#define pi 3.14159265359

int main(){
    int N, M, X; cin >> N >> M >> X;
    vector<int> C(N);
    vector<vector<int>> A(N, vector<int>(M));
    for (int i = 0; i < N; i++) {
        cin >> C.at(i);
        for (int j = 0; j < M; j++) {
            cin >> A.at(i).at(j);
        }
    }
    int m = 100000000;
    for (int i = 0; i < (1 << N); i++) {
        bool flag = true;
        bitset<12> b(i);
        int Csum = 0;
        vector<int> Asum(M, 0);
        for (int j = 0; j < N; j++) {
            if (b.test(j)) {
                Csum += C.at(N - 1 - j);
                for (int k = 0; k < M; k++) {
                    Asum.at(k) += A.at(N - 1 - j).at(k);
                }
            }
        }
        for (int j = 0; j < M; j++ ) {
            if (Asum.at(j) < X) {
                flag = false;
            }
        }
        if (flag) {
            m = min(m, Csum);
        }
    }
    if (m == 100000000) {
        m = -1;
    }
    cout << m << endl;
}


Measured memory_bytes: 3556
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, e) for (int i = (int)(s); i <= (int)(e); i++)
#define printYesNo(is_ok) puts(is_ok ? "Yes" : "No");
#define SORT(v) sort(v.begin(), v.end());
#define RSORT(v) sort(v.rbegin(), v.rend());
#define REVERSE(v) reverse(v.begin(), v.end());

template <typename T>
void printlnVector(T v)
{
  rep(i, v.size())
  {
    cout << v[i] << endl;
  }
}

template <typename T>
void printVector(T v)
{
  rep(i, v.size())
  {
    cout << v[i] << " ";
  }
  cout << endl;
}

int main()
{
  int N;
  string S;
  cin >> N >> S;
  vector<int> white_count(N + 1), black_count(N + 1);
  rep(i, N)
  {
    if(S[i] == '#')
      black_count[i + 1]++;
    
    if(S[N - i - 1] == '.')
      white_count[i + 1]++;
  }

  rep(i, N)
  {
    black_count[i + 1] += black_count[i];
    white_count[i + 1] += white_count[i];
  }
  REVERSE(white_count);
  int ans = INT32_MAX;
  rep(i, N + 1)
  {
    //cout << black_count[i] << ", " << white_count[i] << endl;
    int score = black_count[i] + white_count[i];
    ans = min(ans, score);
  }

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

Measured memory_bytes: 2180
#include "bits/stdc++.h"
 
using namespace std;
typedef int64_t ll;
typedef vector<int64_t> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<int> vin;
typedef vector<vin> vvin;
typedef vector<vvin> vvvin;
typedef pair<ll,ll> P;
typedef vector<P> vp;
typedef vector<double> vd;
typedef vector<vd> vvd;
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define SIZE(a) int((a).size())
vin r(1400),g(1400),b(1400);
int main(){
  ll n,ans=0,rh=0,gh=0,bh=0;
  cin>>n;
  rep(i,0,n){
    char x;cin>>x;
    if(x=='R'){r[rh]=i+1;rh++;}
    if(x=='G'){g[gh]=i+1;gh++;}
    if(x=='B'){b[bh]=i+1;bh++;}
  }
  vin rr(rh),gg(gh),bb(bh);
  rep(i,0,rh){rr[i]=r[i];}
  rep(i,0,gh){gg[i]=g[i];}
  rep(i,0,bh){bb[i]=b[i];}
  
  rep(i,0,gh){
    rep(j,0,bh){
      ll c,d,e;
      c=binary_search(rr.begin(),rr.end(),(gg[i]+bb[j])/2);
      if((gg[i]+bb[j])%2!=0){c=0;}
      d=binary_search(rr.begin(),rr.end(),2*gg[i]-bb[j]);
      e=binary_search(rr.begin(),rr.end(),2*bb[j]-gg[i]);
      ans+=rh-c-d-e;
    }
  }
  if(n<=2){cout<<0<<endl;}
  else{cout<<ans<<endl;}
}


Measured memory_bytes: 3648
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
using namespace std;
typedef long long ll;

int main(){
    int n;
    cin>>n;
    if(n==1){
        cout<<"Hello World"<<endl;
    }else{
        int a,b;
        cin>>a>>b;
        cout<<a+b<<endl;
    }
}


Measured memory_bytes: 256
# include <bits/stdc++.h>
# define sz(x) (int)((x).size())
# define f first 
# define s second
# define pb push_back
# define ub upper_bound
# define lb lower_bound
# define all(x) x.begin(), x.end()
# define rep(i,n) for(int i=0;i<n;++i)
# define forn(i,n) for(int i=1;i<=n;++i)
# define pqueue priority_queue

using namespace std;

template<class T> void umin(T &a,T b){a=min(a,b);}
template<class T> void umax(T &a,T b){a=max(a,b);}

typedef long long ll;
typedef pair<int,int> pii;

const int mod=1e9+7,N=1e6+3;



void solve(){	
	int a,b;
	cin>>a>>b;
	for(int i=1;i<=1000;++i){
		if(a-(i*(i+1))/2==b-((i+1)*(i+2))/2){
			printf("%d",(i*(i+1))/2-a);
			return;
		}
	}

}

int main(){
 	ios_base::sync_with_stdio(0);
 	cin.tie(0);cout.tie(0);
	int T=1; 
	//cin>>T;	
	while(T--)solve();
}

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

int main()
{
 int n, c;
 cin >> n;
 int p[n];
 c=0;
 for(int i=0;i<n;i++){
   cin >> p[i];
   if(p[i]!=i+1) c+=1;
 }
 if((c==2)||(c==0))	cout << "YES";
 else cout << "NO";
  return 0;
}

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

int main() {
    ll H,W;
    cin >> H>>W;
    if(H ==1 || W == 1){
        cout << 1 << endl;
        return 0;
    }
    vector<ll> ws = {(W+1)/2,W/2};
    ll ans = 0;
    ans += ws[0]*((H+1)/2);
    ans += ws[1]*(H/2);
    
    cout << ans << endl;
}

Measured memory_bytes: 256
# coding: utf-8
import sys
sysread = sys.stdin.readline
from heapq import heappop, heappush

def run():
    # import sys
    # A = list(map(int, sys.stdin.readline().split()))
    # all = sys.stdin.readlines()
    # all = list(map(int, sys.stdin.read().split())
    #N, *A = map(int, open(0))
    #N = int(input())
    N, M, S = list(map(int, sysread().split()))
    to = [[] for _ in range(N+1)]
    max_m = 2500
    for _ in range(M):
        u,m,a,b = list(map(int, sysread().split()))
        to[u].append((m,b,a))
        to[m].append((u,b,a))


    C, D = [0], [0]
    for _ in range(N):
        c,d = list(map(int, sysread().split()))
        C.append(c)
        D.append(d)

    queue = []
    # (time, node, rest-coin)
    if S > max_m: S = max_m
    heappush(queue, (0, 1, S))

    state = [[1<<61] * (max_m+1) for _ in range(N+1)]

    while queue:
        time, node, coin = heappop(queue)
        if state[node][coin] < time: continue
        if coin + C[node] <= max_m and time + D[node] < state[node][coin+C[node]]:
            state[node][coin+C[node]] = time + D[node]
            heappush(queue, (time+D[node], node, coin+C[node]))
        for n_node, n_time, n_coin in to[node]:
            if coin >= n_coin and state[n_node][coin-n_coin] > n_time + time:
                state[n_node][coin - n_coin] = n_time + time
                heappush(queue, (time + n_time, n_node, coin - n_coin))
    for s in state[2:]:
        print(min(s))

if __name__ == "__main__":
    run()

Measured memory_bytes: 26132
N = int(input())
from collections import defaultdict
ans = defaultdict(int)
for a in range(1,101):
  for b in range(1,101):
    for c in range(1,101):
      ans[a**2 + b**2 + c**2 + a*b + a*c + b*c] += 1
for n in range(1,N+1):
  print(ans[n])


Measured memory_bytes: 11956
a, b, arg = gets.split.map(&:to_f)

rarg = arg * Math::PI / 180
s = 0.5 * a * b * Math.sin(rarg)
puts s

c = Math.sqrt(a**2 + b**2 - 2 * a * b * Math.cos(rarg))
puts a + b + c

puts s * 2 / a

Measured memory_bytes: 6188
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define N 100000
typedef long long ll;
int SOD(int a){
	/*各桁の和を求める*/
	int b=0;
	while(a){
		b+=a%10;
		a/=10;
	}
	return b;
}
int main(){
	int n,a,b;
	b=1e5;
	cin>>n;
	for(int i=1;i<(n/2)+1;i++){
		a=SOD(i)+SOD(n-i);
		if(b>a){
			b=a;
		}
	}
	cout<<b<<endl;
	return 0;
}

Measured memory_bytes: 256
import itertools

h,w,k=map(int,input().split())
board=[list(input()) for _ in range(h)]
ans=0
for bit_col in itertools.product(range(2),repeat=h):
  for bit_row in itertools.product(range(2),repeat=w):
    cnt=0
    for i in range(h):
      for j in range(w):
        if bit_col[i]==0 and bit_row[j]==0 and board[i][j]=='#':
          cnt+=1
    if cnt==k:
      ans+=1
print(ans)

Measured memory_bytes: 9116
using System;
using System.Linq;
using System.Numerics;

public class Program
{

    static void Main()
    {
        var maxValue = Enumerable.Repeat(10L, 18).Aggregate((a, b) => a * b);
        Console.ReadLine();
        var product = Console.ReadLine().Split(" ")
                                        .Select(s => long.Parse(s))
                                        .Aggregate((prev, curr) => {
                                            if(prev == 0 || curr == 0)
                                            {
                                                return 0;
                                            }

                                            if(prev == -1)
                                            {
                                                return -1;
                                            }

                                            try
                                            {
                                                var product = checked (prev * curr);
                                                if (product > maxValue)
                                                {
                                                    return -1;
                                                }
                                                return prev * curr;
                                            } 
                                            catch (OverflowException)
                                            {
                                                return -1;
                                            }
                                        });
         Console.Write(product);
    }
}



Measured memory_bytes: 41904
n,k = map(int, input().split())
s = input()
cnt = 0
init = (s[0]=='1')
h=[1]
h_cnt = 0

for i in range(1,n):
    if(s[i]!=s[i-1]):
        h_cnt+=1
        h.append(1)
    else:
        h[h_cnt]+=1

h_cnt+=1

zero_num = 0
ans = 0

if(init): #start with 1
    zero_num = h_cnt//2;
    if(zero_num<=k):
        ans = n
    else:
        sum_0 = sum(h[0:k*2+1])
        ans = sum_0
        h = h +[0,0,0]
        for j in range(0,zero_num-k): #j is 0's order
            sum_0 = sum_0 - h[j*2] - h[j*2+1] + h[(j+k)*2+1] + h[(j+k)*2+2]
            if(ans<=sum_0):
                ans = sum_0

else: #start with 0
    zero_num = h_cnt//2 +1;
    if(zero_num<=k):
        ans = n
    else:
        sum_0 = sum(h[0:k*2])
        ans = sum_0
        h = [0] + h +[0,0,0]
        for j in range(0,zero_num-k):#j is 0's order
            sum_0 = sum_0 - h[j*2] - h[j*2+1] + h[(j+k)*2+1] + h[(j+k)*2+2]
            if(ans<=sum_0):
                ans = sum_0

print(ans)

Measured memory_bytes: 5712
function Main(input){
var N = input.split("\n")[0];
var value = input.split("\n")[1].split(" ");
var a = 0;
var Max_value = value.sort(function(a,b){
  return a - b;
});
for(i=0;i<=(N-1);i++){
  if(i===0){
    a += new Number(Max_value[i]);
  }else if(i===(N-1)){
    a += new Number(Max_value[i])*Math.pow(2,i-1);
    a = a/Math.pow(2,N-1);
  }else{
    a += new Number(Max_value[i])*Math.pow(2,i-1);
  }
}
  console.log(a);
}
  Main(require('fs').readFileSync('/dev/stdin','utf8'));

Measured memory_bytes: 21192
#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>;
const int INF = 1000000001;

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 main() {
  int n, l;
  cin >> n >> l;
  vector<string> s(n);
  rep(i, n){
    cin >> s[i];
  }
  sort(s.begin(), s.end());
  for(auto itr : s){
    cout << itr;
  }
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
    REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
    REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}

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

const int dx4[4] = {1, 0, -1, 0};
const int dy4[4] = {0, 1, 0, -1};

const int dx8[8] = {1,1,0,-1,-1,-1,0,1};
const int dy8[8] = {0,1,1,1,0,-1,-1,-1};

vector< vector<int> > Graph;
vector< int > value;





int main(int argc, const char * argv[]) {
    
   
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    
    string s; cin >> s;
    string ans = "";
    
    
    
    for(int i = 0; 2*i < (int)s.size(); i++) ans+=s[i*2];
    cout << ans << endl;
    
    
    
    
    
}



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

using namespace std;
int main() {
    int n;
    int ans;

    cin >> n;

    for (int i = 1; i <= n; i++) {
        int pow2 = i * i;
        if (pow2 <= n) {
            ans = pow2;
        } else {
            break;
        }
    }

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define LL long long
#define INF 0x7FFFFFFF//or 0x3f3f3f3f ? -Wall
using namespace std;

template<class T> inline
void read(T& x) {
	int f = 1; x = 0;
	char ch = getchar();

	while (ch < '0' || ch > '9')   {if (ch == '-') f = -1; ch = getchar();}
	while (ch >= '0' && ch <= '9') {x = x * 10 + ch - '0'; ch = getchar();}
	x *= f;
}

/*============ Header Template ============*/

const int N = 100000 + 5;
const int mo = 1000000007;

int n;
int a[N], in[N], c[N], l[N], deg[N], vis[N], ch[N], pos[N];
LL f[N];
queue<int> Q;
std::vector<int> zkx;

void Topo() {
	for (int i = 1; i <= n; i++) if (!in[i]) Q.push(i);
	while (!Q.empty()) {
		int x = Q.front(); Q.pop();
		ch[x] = 1;
		if (--in[a[x]] == 0) Q.push(a[x]);
	}
}

int main() {
	read(n);
	for (int i = 1; i <= n; i++) read(a[i]), in[a[i]]++, deg[a[i]]++;
	for (int i = 1; i <= n; i++) if (in[a[i]] > 2) {printf("0\n"); return 0;}
	Topo();
	for (int i = 1; i <= n; i++) if (ch[i] && deg[i] > 1) {printf("0\n"); return 0;}
	for (int i = 1; i <= n; i++)
		if (ch[i] && !deg[i]) {
			int x = i, cnt = 0;
			while (ch[x]) {cnt++; x = a[x];}
			l[x] = cnt;
		}
	//for (int i = 1; i <= n; i++) printf("%d ", l[i]); printf("\n");
	LL ans = 1;
	for (int i = 1; i <= n; i++) if (!ch[i] && !vis[i]) {
			int x = i, cnt = 0; LL tmp = 1;
			zkx.clear();
			while (!vis[x]) {
				vis[x] = 1; cnt++;
				if (l[x]) zkx.push_back(x);
				pos[x] = cnt; x = a[x];
			}
			if (!zkx.size()) {c[cnt]++; continue;}
			//printf("%d\n", cnt);
			zkx.push_back(0); pos[0] = pos[zkx[0]] + cnt; l[0] = l[zkx[0]];
			for (int i = 1; i < zkx.size(); i++) {
				int l1 = l[zkx[i]];
				int l2 = pos[zkx[i]] - pos[zkx[i - 1]];
				if (l1 == l2) continue;
				(tmp *= (l1 < l2 ? 2LL : 0)) %= mo;
			}
			(ans *= tmp) %= mo;
		}
	//printf("%lld\n", ans);
	//for (int i = 1; i <= n; i++) printf("%d ", c[i]); printf("\n");
	for (int k = 1; k <= n; k++) {
		if (!c[k]) continue;
		LL w = (k > 1 && (k & 1) ? 2 : 1);
		f[0] = 1; f[1] = w;
		for (int i = 2; i <= c[k]; i++)
			f[i] = (f[i - 1] * w % mo + f[i - 2] * (i - 1) % mo * k % mo) % mo;
		(ans *= f[c[k]]) %= mo;
	}
	printf("%lld\n", (ans + mo) % mo);
	return 0;
}

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

//template
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(a);i>(b);i--)
#define ALL(v) (v).begin(),(v).end()
typedef long long int ll; typedef pair<ll, ll> P;
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; }
template<typename A,size_t N,typename T>void Fill(A(&array)[N],const T &val){fill((T*)array, (T*)(array+N), val);}
const int inf = 0x3fffffff; const ll INF = 0x3fffffffffffffff;
//template end

int n,m; vector<int> g[610];
double dp[610];
double calc(int v){
    dp[n-1]=0;
    rrep(i,n-2,-1){
        double sum=0,maxx=0; int div=g[i].size();
        for(int nxt:g[i])sum+=dp[nxt],chmax(maxx,dp[nxt]);
        if(i==v&&div>1)div--,sum-=maxx;
        dp[i]=sum/div+1;
    } return dp[0];
}

int main(){
    scanf("%d%d",&n,&m);
    rep(i,0,m){
        int a,b; scanf("%d%d",&a,&b);
        a--; b--; g[a].push_back(b);
    }
    double ans=inf;
    rep(i,0,n)chmin(ans,calc(i));
    printf("%.12f\n",ans);
    return 0;
}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
 
int main() {
	int a, b;
	cin >> a >> b;

	if(a==b)
		cout << "Draw" << endl;		
	else if(a==1)
		cout << "Alice" << endl;
	else if(b==1)
		cout << "Bob" << endl;
	else if(a>b)
		cout << "Alice" << endl;
	else
		cout << "Bob" << endl;
}

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

string s;
vector<char> chars;

bool predicate(char x) {
    return x == '0';
}

int main() {
    cin >> s;
    chars = vector<char>(s.begin(), s.end());
    chars.erase(remove_if(chars.begin(), chars.end(), predicate), chars.end());
    cout << chars.size() << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using lint=int64_t;
using namespace std;

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

	int cnt=0;
	for(int i=0;i<S.size();i++)
	{
		if(S[i]=='x')
			cnt++;
	}

	if(cnt<=7)
		cout << "YES";
	else
		cout << "NO";
	cout << endl;
	return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<(ll)n;++i)
int main(){
  string s;
  cin >> s;
  ll k;
  cin >> k;
  if( count(s.begin(),s.end(),s[0]) == s.size() ){
    cout << s.size()*k/2 << "\n";
    return 0;
  }
  auto func = [&]( string st ){
    ll cnt = 0;
    ll ren = 1;
    for(ll i=1;i<st.size();++i){
      if( st.at(i) == st.at(i-1) ){
        if( i != st.size()-1 ){
          ren++;
        }else{
          ren++;
          cnt += ren/2;
        }
      }else{
        cnt += ren/2;
        ren = 1;
      }
    }
    return cnt;
  };
  
  if( s.front() != s.back() ){
    cout << func(s)*k << "\n";
    return 0;
  }else{
    cout << func(s) + (func(s+s)-func(s))*(k-1) << "\n";
  }
  return 0;
}

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

 
int main()
{
  
  ll t=1,l;
 //  cin>>t;
 

  while(t--)
  {
    ll a,b,c,k;
    cin>>a>>b>>c>>k;
    ll sum =  0 ;
    if(a>k)
    {
      sum = k;
      k = 0;

    }else
    {
      sum = a;
      k-=a;
      
    }

    if(k>0)
    {
      if(b>k)
      {
        sum += 0;
        k = 0;

      }else
      {
        sum += 0;
        k-=b;
        
      }

    }

    if(k>0)
    {
      if(c>k)
      {
        sum -= k;
        k = 0;

      }else
      {
        sum -= c;
        k-=c;
        
      }

    }
    cout<<sum<<endl;

  
   
  }
      
  return 0;
}



/*

  36 151 0 65

*/

// ll val=0,ind;
    // for(ll i=l;i<=r;i++)
    // {
    //   ll func = (x&i)*(y&i);
    //   if(func>val)
    //   {
    //     val = func;
    //     ind = i;
    //   }

    // }

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

using namespace std;

int main()
{
	int n, x, i;
	cin>>n;
	for (i=0; i<n; i++)
	{
		cin>>x;
		if (x % 2 == 1) continue;
		if (x % 3 != 0 && x % 5 != 0) break;
	}
	if (i < n) cout<<"DENIED"<<endl; else cout<<"APPROVED"<<endl;
	return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        
        //set array
        String[] st = br.readLine().split(" ");
        int[] array = new int[n];
        for (int i = 0; i < n; i++){
            int a = Integer.parseInt(st[i]);
            array[i] = a;
        }
        
        int count = selectionSort(array);
        System.out.println(mkArrayString(array));
        System.out.println(count);
    }
    static String mkArrayString(int[] arr){
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < arr.length - 1; i++){
            sb.append(arr[i]);
            sb.append(" ");
        }
        sb.append(arr[arr.length - 1]);
        return sb.toString();
    }
    static int selectionSort(int[] arr){
        //selectionSort and return swapcount
        int swapcnt = 0;
        for (int i = 0; i < arr.length; i++){
            int minj = i;
            for (int j = i; j < arr.length; j++){
                if ( arr[j] < arr[minj]){
                    minj = j;
                }
            }
            swap(arr, i, minj);
            if (i != minj) swapcnt += 1;
        }
        return swapcnt;
    }
    static void swap(int[] arr, int i, int j){
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }
}

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

typedef long long ll;
typedef pair<int, int> P;

#define pb push_back
#define rep(i, a, n) for(int i = (a); i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
#define mod 1e9+7

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

int main() {
  int a[24][60] = {}, co = 0;
  int n, m;
  cin >> n;
  rep(i, 0, n) {
    int b, c;
    cin >> b >> c;
    if(a[b][c]) co++;
    a[b][c] = 1;
  }
  cin >> m;
  rep(i, 0, m) {
    int b, c;
    cin >> b >> c;
    if(a[b][c]) co++;
    a[b][c] = 1;
  }
  rep(i, 0, 24) {
    rep(j, 0, 60) {
      if(!a[i][j]) continue;
      cout << i << ':';
      if(j < 10) cout << 0;
      cout << j;
      co++;
      if(co != n + m) cout << " ";
      else break;
    }
  }
  cout << endl;
}

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

class Matrix {
    friend ostream &operator<<(ostream &, const Matrix &);
    friend istream &operator>>(istream &, Matrix &);
    friend Matrix operator*(const Matrix& mat_lhs, const Matrix& mat_rhs);
public:
    explicit Matrix(int n=1, int m=1);
    vector<long> &operator[](int i) {return val[i];};
    const vector<long> &operator[](int i)const {return val[i];};
private:
    const int row;
    const int col;
    vector<vector<long>> val;
};

Matrix::Matrix(int n, int m):row(n), col(m){
    val.resize(n);
    for(auto &vec : val){
        vec.resize(m, 0);
    }
}

Matrix operator*(const Matrix &mat_lhs, const Matrix &mat_rhs){
    const auto n = mat_lhs.row;
    const auto m = mat_lhs.col;
    const auto l = mat_rhs.col;
    Matrix result(n, l);
    for(int c=0; c!=n; ++c){
        for(int r=0; r!=l; ++r){
            for(int i=0; i!=m; ++i){
                result[c][r] += mat_lhs[c][i] * mat_rhs[i][r];
            }
        }
    }
    return result;
}

ostream &operator<<(ostream &ostrm, const Matrix &mat){
    for(const auto &row: mat.val){
        int i = 0;
        for(const auto &aij:row){
            ostrm << aij;
            if(++i != mat.col) ostrm << ' ';
        }
        ostrm << endl;
    }
    return ostrm;
}

istream &operator>>(istream &istrm, Matrix &mat){
    for(auto &vec : mat.val){
        for(auto &v : vec){
            istrm >> v;
        }
    }
    return istrm;
}

int main(){
    int n, m, l;
    cin >> n >> m >> l;
    Matrix a(n, m);
    Matrix b(m, l);
    cin >> a >> b;
    cout << a * b;
}

Measured memory_bytes: 1404
#include "bits/stdc++.h"
#define ll long long int
#define ld long double
#define fastIO ios_base::sync_with_stdio(false); cin.tie(nullptr)
#define pb push_back

using namespace std;
typedef pair<int, int> pii;

int main() {
    fastIO;
    ll a, b, c, d;
    cin >> a >> b >> c >> d;

    cout << max(a * d, max(b * c, max(b * d, a * c)));
}


Measured memory_bytes: 3648
object Main {

  def main(args: Array[String]): Unit = {
    import scala.io.StdIn._
    var over3200 = 0

    val GRAY = 0
    val BROWN = 1
    val GREEN = 2
    val WATER = 3
    val BLUE = 4
    val YELLOW = 5
    val ORANGE = 6
    val RED = 7
    val OVERED = 8
    val visited = new Array[Boolean](8)

    def rateToColor(rate: Int): Int =
      if (rate <= 399) GRAY
      else if (rate <= 799) BROWN
      else if (rate <= 1199) GREEN
      else if (rate <= 1599) WATER
      else if (rate <= 1999) BLUE
      else if (rate <= 2399) YELLOW
      else if (rate <= 2799) ORANGE
      else if (rate <= 3199) RED
      else OVERED

    val N = readLine().toInt
    val a = readLine().split(" ").map(_.toInt)
    (0 until N).foreach { i =>
      val color = rateToColor(a(i))
      if (color == OVERED)
        over3200 += 1
      else {
        visited(color) = true
      }
    }

    var colors = (0 until 8) count visited // 普通の色数
    // 普通の色数 + min(残り追加できる色数, 3200オーバーの人数)
    val max = colors + over3200
    val min = if (colors == 0 && over3200 >= 1) 1 else colors
    println(s"$min $max")
  }

}

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

int main(){
  string s;
  cin >> s;
  vector<int> bubun;
  string t = "";
  rep(i,s.size()){
    if(s[i]=='A'||s[i]=='G'||s[i]=='C'||s[i]=='T') t += s[i];
    else {
      bubun.push_back(t.size());
      t = "";
    }
  }
  if(t!="") bubun.push_back(t.size());
  sort(bubun.rbegin(),bubun.rend());
  cout << bubun[0] << endl;
}


Measured memory_bytes: 3604
# Bitter Alchemy
# 11:15-
N,x = gets.chomp.split(" ").map(&:to_i)
m = []
count = N
for i in 0..N-1 do
    m[i] = gets.chomp.to_i
    x = x - m[i]
end
count = count + (x / m.min)
puts count

Measured memory_bytes: 1916
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<unordered_map>
#include<string>
#define LL long long
#define li i<<1
#define ri i<<1|1
using namespace std;
inline LL read()
{
    char c=getchar();LL x=0,f=1;
    while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
    while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
    return x*f;
}
LL n; 
int main()
{
	n=read();
	if(n>=30)
		printf("Yes\n");
	else
		printf("No\n");
	return 0;
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define sz(x) (int)x.size()
#define end "\n"
#define all(x) (x).begin(), (x).end()
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define rep(i, n) for(int i =0 ; i < n; ++i)
#define Rep(i,a,b) for(int i=a;i<=b;i++)
#define pii pair < int, int >
typedef vector<int> vi;
typedef  long long ll;
const int inf = int(1e9);
const int mod =1e9+7;
const int N = (int)2e5 + 5;


void solve(){
	char c;
	cin>>c;
	if(c=='u' || c=='a' || c=='e' || c=='y' || c=='i' || c=='o')cout<<"vowel";
	else cout<<"consonant";
}
int main(){
	Red;
	int t=1;
	//cin>>t;
	while(t--)
	solve();
	return 0;
}

Measured memory_bytes: 256
def co(n):
    a = int(1000-n)
    b = int(a//500)
    c = int((a%500)//100)
    d = int((a%100)//50)
    e = int((a%50)//10)
    f = int((a%10)//5)
    g = int((a%5)//1)
    sum = b+c+d+e+f+g
    print(sum)
for i in range(5):
    x = int(input())
    if x == 0:
        break
    co(x)


Measured memory_bytes: 5588
#include<cstdio>
#include<cmath>
#include<vector>
#include<string>
#include<algorithm>

using namespace std;

int main()
{
	string s, t;
	char input[1000];
	int cnt = 0;
	int i;

	scanf("%s", input);
	s = input;
	scanf("%s", input);
	t = input;

	for (i = 0; i < s.size(); i++)
	{
		cnt += (s[i] == t[i]);
	}

	printf("%d\n", cnt);

	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(){
    int x,a,b;
    
    scanf("%d",&x);
    
    if(x==1){
        printf("Hello World\n");
    }
    
    else if(x==2){
        scanf("%d %d",&a,&b);
        printf("%d\n",a+b);
    }
    
    
    return 0;
}

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

int main() {
	string s,t;cin>>s>>t;
	for(int i=0;i<s.size();i++){
		if(s[i]!=t[i]){
			cout<<"No"<<endl;
			return 0;
		}
	}
	cout<<"Yes"<<endl;
	return 0;
}


Measured memory_bytes: 3624
#include <bits/stdc++.h>
#include <cmath>
#include <numeric>
using namespace std;
#define rep(i,a,b) for(int i=(a); i<(b); ++i) // a ≦ i < b 
#define Rrep(i,a,b) for(int i=(a);i>=(b);--i) // reverse repeat. a から b まで減少．
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend() //逆イテレータ
#define RANGE(a,b,c) (a).begin()+b,(a).begin()+c // コンテナ a の 要素 b から c へのイテレータ
#define MOD 1000000007ll
#define INF 1000000000
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef vector<PII> VP;

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

int N; 
string S;
cin >> N >> S;
VI w(N+ 1, 0), b(N+1, 0); // 白の個数と黒の個数の累積和
rep(i, 0, N){
    if (S[i] == '.') {
        w[i+1] = w[i] + 1;
        b[i+1] = b[i];
    }
    else {
        w[i+1] = w[i];
        b[i+1] = b[i] + 1;
    }
}

int mini = INF;

rep(left , 0, N + 1){
    mini = min(mini, b[left] + w[N] - w[left]);
}

cout << mini << "\n";

}

// 境界，出力文字列 チェック



Measured memory_bytes: 2196
#define f(X) for(c=0;c<X;c+=v[p++]);if(c-X)goto L;
n,v[50],s,p,c,a[9];main(){for(;n=atoi(gets(a));){for(p=s=0;p<n;v[++p]=strlen(gets(a)));L:p=++s;f(5)f(7)f(5)f(7)f(7)printf("%d\n",s);}}

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

using ll = long long;
using pii = pair<int, int>;

#define vt          vector
#define sz(x)       (int)(x).size()
#define all(x)      (x).begin(), (x).end()
#define rall(x)     (x).rbegin(), (x).rend()
#define fi          first
#define se          second

signed main() {
    ios::sync_with_stdio(0), cin.tie(0);

    int n;
    cin >> n;
    vt<int> a(n);
    for (int &i : a) cin >> i;
    sort(all(a));

    int idx = 0;
    for (int i = 1; i < n - 1; i++) {
        if (abs(a.back() - a[i] * 2) < abs(a.back() - a[idx] * 2)) {
            idx = i;
        }
    }

    cout << a.back() << ' ' << a[idx];
}


Measured memory_bytes: 3708
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define repeq(i,a,b) for(int i=a;i<=(b);++i)
#define debug(x) cerr<<#x<<": "<<x<<endl
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll n, m;
    cin >> n >> m;
    ll x = (1LL)<<m;
    ll ans = x*(100*n+1800*m);
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<bitset>
#include<vector>
#include<deque>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<iomanip>
#include <functional>
using namespace std;
typedef long long ll;
const int mod = 1000000007;
const int INF = 1 << 30;
const double EPS = 1e-10;
const double pi = 3.14159265359;
//cout << fixed << std::setprecision(9)
//memset(a, 0, sizeof(a));
//--------------------------

string s;
bool used[26];

int main()
{
	cin >> s;
	for (int i = 0;i < s.size();i++) {
		int t = s[i] - 'a';
		if (used[t]) {
			cout << "no" << endl;
			return 0;
		}
		else {
			used[t] = true;
		}
	}

	cout << "yes" << endl;

	return 0;
}


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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ALL(a) begin(a),end(a)
#define COUNTOF(a) (sizeof(a)/sizeof(a[0]))
#define SP << " " <<
#define FMT(a) #a<<":"<<a 
#define FMT2(a,b) #a<<":"<<a<<", "<<#b<<":"<<b 
#define FMT3(a,b,c) #a<<":"<<a<<", "<<#b<<":"<<b<<", "<<#c<<":"<<c 
#define FMT4(a,b,c,d) #a<<":"<<a<<", "<<#b<<":"<<b<<", "<<#c<<":"<<c<<", "<<#d<<":"<<d 
typedef long long ll;
template<class T> istream& operator >> (istream& s, vector<T>& v) {
  for (T& x: v) s >> x;
  return s;
}
inline void Yes(bool f=true){cout<<(f?"Yes":"No")<<endl;}
inline void YES(bool f=true){cout<<(f?"YES":"NO")<<endl;}
#define ANS(a) cout<<a<<endl

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

    int N; cin >>N;

    int ans = 0;
    for (int i = 1; i <= N && i < 1E7; i*=100) {
        ans += min(i*10-1,N) -i + 1;
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
macro_rules! scan_sub {
    ( $itr:ident, $t:ty ) => {
        let mut buf = String::new();
        let $itr = {
            while buf.trim().len() == 0 {
                buf = String::new();
                std::io::stdin().read_line(&mut buf).unwrap();
            }
            buf.split_whitespace().map(|n| n.parse::<$t>().unwrap())
        };
    };
}

macro_rules! scan {
    ( $x:ident; Vec<$t:ty> ) => {
        scan_sub!(itr, $t);
        let $x = itr.collect::<Vec<_>>();
    };
    ( $( $x:ident ),*; $t:ty ) => {
        scan_sub!(itr, $t);
        let mut itr = itr;
        $(
            let $x = itr.next().unwrap();
        )*
    };
}

fn main() {
    scan!(a, b, _c, k; i64);

    let res = if k <= a {
        k
    } else if k <= a + b {
        a
    } else {
        let t = k - (a + b);
        a - t
    };

    println!("{}", res);
}


Measured memory_bytes: 2160
A, B, C, D = [int(i) for i in input().split()]

i = 1
while True :
    if i % 2 == 1:
        C = C - B
        if C <= 0:
            flag = True
            break
    else :
        A = A - D
        if A <= 0:
            flag = False
            break
    i += 1
    
if flag :
    print('Yes')
else :
    print('No')

Measured memory_bytes: 9124
#include<bits/stdc++.h>
namespace ZDY{
	#define Fur(i,x,y) for(int i=x;i<=y;i++)
}using namespace ZDY;using namespace std;
#define N 100011
int a[N],n;
int main(){
	scanf("%d",&n);
	Fur(i,1,n)scanf("%d",&a[i]);
	sort(a+1,a+n+1);
	for(int i=1;i<n;i++)a[n]-=a[i];
	if(a[n]>=0)printf("No\n");
	else printf("Yes\n");
	return 0;
}


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

using namespace std;

int main(){
    int N,T;
    cin >> N >> T;
    
    vector<int> C(N);
    vector<int> T_vec(N);

    for (int i=0;i<N;i++){
        cin >> C[i] >> T_vec[i];
    }

    int min=1000000;
    int ans=-1;
    for (int i=0;i<N;i++){
        if(T>=T_vec[i] && min >= C[i]){
            min=C[i];
            ans=i;
        }
    }
   
    if(ans==-1){
        cout << "TLE" << endl;
    }else{
        cout << C[ans] << endl;
    }
    
    return 0;
}

Measured memory_bytes: 3600
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define INF (1LL<<50)
#define MOD 1000000007

int main(){
    int N,D,A;
    cin >> N >> D >> A;
    vector<pair<int,int>> Mns(N);
    rep(i,N){
        int x,h;
        cin >> x >> h;
        Mns[i] = make_pair(x,h);
    }
    sort(Mns.begin(),Mns.end());
    // 左から順に区間の左端に重なるように選ぶ
    ll diff=0;
    deque<pair<ll,ll>> dq;
    ll ans =0;
    for(int i=0;i<N;i++){
        int now;
        now = Mns[i].first;
        while(dq.size()!=0){
            if(dq.front().first<=now){
                diff-=dq.front().second;
                dq.pop_front();
            }else{
                break;
            }
        }
        ll d = Mns[i].second-diff;
        // cout << "i:" << i << " d:" << d << endl;
        if(d>0){
            ll tmp = (ll)ceil(d*1.0/(A*1.0));
            ans += tmp;
            diff += A*tmp;
            dq.push_back(make_pair(min(now+2*D+1,1000000005),A*tmp));
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3456