akhauriyash/Code-Regression huggingface dataset:
#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 all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
struct edge{
	int a,b;
	double d;
	edge(int p,int q,double r){a=p,b=q,d=r;}
};
bool comp(const edge &l,const edge &r){
	return l.d<r.d;
}
int par[100];
void init(int N){rep(i,N) par[i]=i;}
int find(int x){
	if(x==par[x]) return x;
	return par[x]=find(par[x]);
}
bool same(int x,int y){
	return find(x)==find(y);
}
void unite(int x,int y){
	x=find(x),y=find(y);
	par[y]=x;
}
double x[100],y[100],z[100],r[100];
int main(){
	while(true){
		int N;
		cin>>N;
		if(N==0) break;
		rep(i,N) cin>>x[i]>>y[i]>>z[i]>>r[i];
		vector<edge> es;
		rep(i,N) rep(j,i){
			double dis=sqrt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j])+(z[i]-z[j])*(z[i]-z[j]))-r[i]-r[j];
			es.pb(edge(i,j,max(dis,0.0)));
		}
		sort(all(es),comp);
		init(N);
		double ans=0;
		for(edge e:es){
			if(same(e.a,e.b)) continue;
			unite(e.a,e.b);
			ans+=e.d;
		}
		printf("%.3f\n",ans);
	}
}

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

int main() {
  int N;
  cin >> N;
  vector<int> cost(N);
  vector<int> value(N);
  for (int i=0; i<N ; i++){
    cin >> value.at(i);
  }
  for (int j=0; j<N ; j++){
    cin >> cost.at(j);
  }
  int check;
  int count = 0;
  for (int k=0; k<N ; k++){
    check = value.at(k) - cost.at(k);
    if (check>0){
      count += check;
    }
  }
  cout << count << endl;
} 

Measured memory_bytes: 256
/*  Bismillahir Rahmanir Rahim  */

#include <bits/stdc++.h>

using namespace std;

typedef pair <int, int> pii;

const int N = 200005;

int n, m, done[N];
int L[N], R[N], ans;
vector <int> lf[N], rf[N];

int get(int st){
	ans = 0;
	int have = 0, flag = 0;
	priority_queue <pii> q;
	memset(done, 0, sizeof(done));
	for(int i = m; i >= 1; --i){
		for(auto u : lf[i]){
			q.push({R[u], u});
		}
		if(i > st) continue;
		if(q.empty()) flag = -1;
		else{
			done[q.top().second] = 1;
			q.pop();	
			++ans;
		}
	}
	for(int i = 1; i <= m; ++i){
		for(auto u : rf[i]){
			have += !done[u];
		}
		if(i <= st) continue;
		if(!have) flag = +1;
		else --have, ++ans;
	}
	return flag;
}

void solve(){
	int lo = 0, hi = m;
	while(lo < hi){
		int mid = (lo + hi) / 2;
		int ok = get(mid);
		if(ok == 0) lo = hi = mid;
		else if(ok == +1) lo = mid + 1;
		else hi = mid - 1;
	}
	get(lo);
	printf("%d\n", n - ans);
}

int main(){
	scanf("%d %d", &n, &m);
	for(int i = 1; i <= n; ++i){
		scanf("%d %d", &L[i], &R[i]);
		lf[ L[i] ].push_back( i );
		rf[ R[i] ].push_back( i );
	}
	solve();
	return 0;
}

Measured memory_bytes: 21224
#include "bits/stdc++.h"
using namespace std;
#define Rep(i,n) for(int i=0;i<(int)(n);i++)
#define For(i,n1,n2) for(int i=(int)(n1);i<(int)(n2);i++)
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define RREP(i,n) for(ll i=((ll)(n)-1);i>=0;i--)
#define FOR(i,n1,n2) for(ll i=(ll)(n1);i<(ll)(n2);i++)
#define put(a) cout<<a<<"\n"
#define all(a)  (a).begin(),(a).end()
#define SORT(a) sort((a).begin(),(a).end())
#define oorret 0
#define oor(x) [&](){try{x;} catch(const out_of_range& oor){return oorret;} return x;}()
#define SZ(x) ((ll)(x).size())
typedef long long ll;
typedef pair<int, int> P;
template<typename T1,typename T2> inline bool chmin(T1 &a,T2 b){if(a>b){a=b;return 1;}return 0;}
template<typename T1,typename T2> inline bool chmax(T1 &a,T2 b){if(a<b){a=b;return 1;}return 0;}

class Modulo{
public:
    ll val;
    static const ll mod = 1e9+7;
    vector<ll> factable = {1};
    vector<ll> invtable = {1};
    ll pro(ll x,ll y){return ((x%mod)*(y%mod))%mod;}
    ll sum(ll x,ll y){return ((x%mod)+(y%mod))%mod;}
    ll dif(ll x,ll y){ll d =((x%mod)-(y%mod))%mod;if(d>=0){return d;}else{return d+mod;}}
    ll quo(ll x, ll y){return pro(x,pow(y,mod-2));}
    ll pow(ll x,ll y){
        if(y<=0){return 1;}
        if(y%2==0){ll d = pow(x,y/2);return ((d%mod)*(d%mod))%mod;}
        else{return (x*pow(x,y-1))%mod;}
    }
    void operator=(ll n){this->val = n%mod;}
    ll operator+(ll n){return sum(this->val,n);}
    ll operator-(ll n){return dif(this->val,n);}
    ll operator*(ll n){return pro(this->val,n);}
    ll operator/(ll n){return quo(this->val,n);}
    void operator+=(ll n){this->val = sum(this->val,n);}
    void operator-=(ll n){this->val = dif(this->val,n);}
    void operator*=(ll n){this->val = pro(this->val,n);}
    void operator/=(ll n){this->val = quo(this->val,n);}
    ll fac(ll x){
        //x! mod mod
        if(factable.size()<=x){
            ll s = factable.size();
            FOR(i,s,x+1){
                factable.push_back(pro(i,factable.back()));
                invtable.push_back(quo(1,factable.back()));
            }
        }
        if(x<0) return 1;
        else return factable[x];
    }
    ll facinv(ll x){
        if(invtable.size()<=x){
            ll s = invtable.size();
            FOR(i,s,x+1){
                factable.push_back(pro(i,factable.back()));
                invtable.push_back(quo(1,factable.back()));
            }
        }
        if(x<0) return 1;
        else return invtable[x];
    }
    ll com(ll x,ll y){
        //xCy mod mod = x!/((x-y)!*y!) mod mod
        if(x-y<y)return com(x,x-y);
        return pro(fac(x),pro(facinv(x-y),facinv(y)));
    }
};

int main(){
    int n;
    cin >> n;
    Modulo m;
    //m.val = 1;
    put(m.fac(n));
    return 0;
}


Measured memory_bytes: 2036
import sys
import math
from collections import deque
from collections import defaultdict

def main():
    h = int(sys.stdin.readline())
    time = 0
    while(h != 0):
        h = h // 2
        time += 1
    print(pow(2,time)-1)
    return 0

if __name__ == "__main__":
    main()

Measured memory_bytes: 3316
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n,m,i,k=0,a[200000],sum=0;
    cin>>n;
    k = n/2;
    i = 2;
    if(n==1)
    {
        cout<<1;
    }
    else
    {
    while(i<=k)
    {
        sum = sum+i;
        i = i*2;
    }
    sum = sum*2;
    cout<<sum+3;
    }
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define EPS (1e-7)
#define INF (1e9)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
const double PI = acos(-1);
const ll MOD = 1000000007;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
 
template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
///////////////////////////////////////////////////////////////

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    ll Q,H,S,D,N; cin >> Q >> H >> S >> D >> N;
    ll p = min({4LL*Q,2LL*H,S});
    if (2*p <= D) cout << p*N << endl;
    else cout << D*(N/2LL) + p*(N%2LL) << endl; 
}


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

//repetition
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

//container util
#define all(x) (x).begin(),(x).end()

//typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;

//const value
//const ll MOD = 1e9 + 7;
//const int dx[] = {0,1,0,-1};//{0,0,1,1,1,-1,-1,-1};
//const int dy[] = {1,0,-1,0};//{1,-1,0,1,-1,0,1,-1};

//conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
inline ll toLL(string s) {ll v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
bool prime[(int)2e5 + 10];
VI p;
void makePrime(){
  memset(prime,true,sizeof(prime));
  prime[0] = false;
  prime[1] = false;
  for(int i = 2; i * i <= 2*1e5; i++) {
    if(prime[i] == false) continue;
    int x = 2;
    while(x*i <= (int)2*1e5){
      prime[x*i] = false;
      x++;
    }
  }
  for(int i = 0; i * i <= 2*1e5+10000; i++){
    if(prime[i]) p.push_back(i);
  }
  //rep(i,p.size())cout << p[i] << endl;
  //cerr << p.size() << endl;

}
long long gcd( long long m, long long n ){
    if ( n == 0) return m;
    return gcd(n,m%n);
  }//最大公約数

  long long lcm( long long m, long long n ){
  // 引数に０がある場合は０を返す
  if ( ( 0 == m ) || ( 0 == n ) ) return 0;

  return ((m / gcd(m, n)) * n); // lcm = m * n / gcd(m,n)
}//最小公倍数

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  VLL a(n+1);
  FOR(i,1,n+1) cin >> a[i];
  vector<ll> dp(n+1,0);
  VI ans(n+1,0);
  makePrime();
  int m = 0;
  for(int i = n; i>=1; i--){
    int x = 2;
    ll cnt = 0;
    while(x*i <= n){
      cnt += ans[i*x];
      x++;
    }

    if(cnt % 2 == a[i]) ans[i] = 0;
    else{
      ans[i] = 1;
      m++;
    }


  }

  cout << m << endl;
  if(m != 0){
    FOR(i,1,n+1){
      if(ans[i] == 1) cout << i << " ";
    }
    cout << endl;
  }

  return 0;
}


Measured memory_bytes: 4992
#include <bits/stdc++.h>
using namespace std;
const int maxN = 26;
char s[maxN + 10];
int n, ans[maxN + 10];
bool vis[maxN + 10];

void Dfs(int p, bool lim) {
    if (!lim) {
        for (int i = 1; i < p; ++i) printf("%c", ans[i] + 'a');
        exit(0);
    }
    if (p > n) lim = 0;
    int minV = lim ? s[p] - 'a' : 0;
    for (int i = minV; i < 26; ++i)
        if (!vis[i]) {
            vis[i] = 1; ans[p] = i;
            Dfs(p + 1, lim && i == minV);
            vis[i] = 0;
        }
}

int main() {
    scanf("%s", s + 1);
    n = strlen(s + 1);
    Dfs(1, 1);
    printf("-1");
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
	int n,k,s;
	cin>>n>>k>>s;
	for(int i=1;i<=k;i++) cout<<s<<" ";
	for(int i=k+1;i<=n;i++) {
		if(s==1e9) cout<<1<<" ";
		else cout<<s+1<<" ";
	}
	cout<<endl;
	return 0;
}

Measured memory_bytes: 1280
#include<stdio.h>   

int main(void)     

{     

char str[1010];     

int i,sum;     

scanf("%s",str);     

while(str[0]!='0'){     

i=0;     

sum=0;     

while(str[i]){     

sum+=str[i]-'0';     

i++;     

}     

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

scanf("%s",str);     

}     

return 0;     

}

Measured memory_bytes: 536
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<utility>
#include <functional>
#include <set>
#include <map>
#include <queue>
#include <cmath>
#include <stack>

using namespace std;


int main() {
	
	string s;
	
	cin >> s;
	cout << s.substr(0, 5) << ' ' << s.substr(6, 7) << ' ' << s.substr(14);
}

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

public class Main{

	public static void main(String[] args) throws IOException {
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String info = br.readLine();
		String[] order = info.split(" ");
		int[] numbers = new int[]{Integer.parseInt(order[0]), Integer.parseInt(order[1])};
		
		if(numbers[0]==numbers[1]) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}
}


Measured memory_bytes: 21844
MOD = 10 ** 9 + 7
INF = 10 ** 10
import sys
sys.setrecursionlimit(100000000)
dy = (-1,0,1,0)
dx = (0,1,0,-1)

def main():
    n,k = map(int,input().split())
    a = list(map(int,input().split()))
    
    cum = [0] * (n + 1)
    dic = {0:1}
    ans = 0
    for i in range(min(n,k - 1)):
        cum[i + 1] = (cum[i] + a[i])%k
        tmp = (cum[i + 1] - i - 1)%k
        if tmp in dic:
            dic[tmp] += 1
        else:
            dic[tmp] = 1

    for v in dic.values():
        ans += v * (v - 1)//2


    for i in range(max(n - k + 1,0)):
        dic[(cum[i] - i)%k] -= 1
        cum[i + k] = (cum[i + k - 1] + a[i + k - 1])%k
        tmp = (cum[i + k] - i - k)%k
        if tmp in dic:
            ans += dic[tmp]
            dic[tmp] += 1
        else:
            dic[tmp] = 1

    print(ans)
if __name__ =='__main__':
    main()   


Measured memory_bytes: 45256
import java.util.*;

public class Main{
	
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
  	String a=String.valueOf(sc.next().charAt(0)).toUpperCase(),b=String.valueOf(sc.next().charAt(0)).toUpperCase(),c=String.valueOf(sc.next().charAt(0)).toUpperCase();
    System.out.println(a+b+c);
  }
}


Measured memory_bytes: 21588
#include<bits/stdc++.h>
using namespace std;
using lli = long long int;
using ld = long double;
using ulli = unsigned long long int;
#define filein freopen ("in.txt", "r", stdin)
#define fileout freopen ("out.txt", "w", stdout)
#define dbg(args...) do {cerr << #args << " : "; debug(args); } while(0)
#define all(v) ((v).begin()),((v).end())
#define size(x) (int) x.size() 
#define pb emplace_back
#define mp make_pair
#define PI 3.14159265
#define mod 1000000007
void debug () {cerr << endl;}
template< class T > T gcd(T a, T b) { return (b != 0 ? gcd<T>(b, a%b) : a); }
template< class T > T lcm(T a, T b) { return (a / gcd<T>(a, b) * b); }
template < typename T, typename ... hello>void debug( T arg, const hello &... rest) {cerr << arg << ' ';debug(rest...);}
int main(){
	ios::sync_with_stdio(false);
    cin.tie(nullptr);
    for(int i = 1;i <= 5;i++){
		int n;
		cin >> n;
		if(n == 0){
			cout<<i<<"\n";
			break;
		}
	}
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
typedef long long ll;
namespace mp = boost::multiprecision;
using Mint = mp::cpp_int;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = int(a); i < int(b); i++)
#define all(v) v.begin(), v.end()
#define uni(v) v.erase(unique(all(v)), v.end())
#define sort_g(v) sort(all(v), greater<int>())
#define dump(x) cerr << #x << ' ' << '=' << ' ' << x << endl

int main() {
    int N, M, C;
    cin >> N >> M >> C;
    vector<int> B(M);
    rep(i, M) cin >> B.at(i);
    vector<int> A(M);

    int cnt = 0;
    rep(i, N) {
        rep(j, M) cin >> A.at(j);
        int sum = 0;
        rep(j, M) {
            sum += A.at(j) * B.at(j);
        }
        sum += C;
        if(sum > 0) cnt++;
    }

    cout << cnt << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <queue>
#include <utility>
#include <algorithm>
#include <numeric>
#include <set>
#include <climits>
#include <map>
#include <cmath>
#include <deque>

using namespace std;

long long a[2000];
int main(){
  int N;
  long long A;
  long long B;
  long long C;
  long long D;

  cin >> N >> A >> B >> C >> D;
  for(int i = 0; i < N; i++){
    long long lower_bound = A + C * i - (N - 1 - i) * D;
    long long upper_bound = A + D * i - (N - 1 - i) * C;
    if(lower_bound <= B && B <= upper_bound){
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;

  
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void)
{
	int n,a,max,min,i;
	long sum;
	
	scanf("%d",&n);
	scanf("%d",&a);
	
	max=min=sum=a;
	i=1;
	while(i<n){
	scanf("%d",&a);
	if(min>a) min=a;
	if(max<a) max=a;
	sum+=a;
	i++;
	}
	printf("%d %d %ld\n",min,max,sum);
	return 0;
}



Measured memory_bytes: 2048
/* おまじない　*/
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
typedef long long ll;
typedef long double ld;
using namespace std;
const ll MOD=pow(10,9)+7;
const ll INF=(1LL<<62);
const ld PI = (ld)acos(-1);
const int dx[4]={0,1,0,-1};
const int dy[4]={1,0,-1,0};
const int ddx[8]={1,0,-1,-1,-1,0,1,1};
const int ddy[8]={1,1,1,0,-1,-1,-1,0};
void init(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
}

ll gcd(ll a,ll b){
    if(a<b)swap(a,b);
    if(a%b==0)return b;
    return gcd(a%b,b);
}
ll lcm(ll a,ll b){
    return a/gcd(a,b)*b;
}

int main() {
    ll A,B,C,D,K,N,M,S,T;
    cin>>N>>M>>K;
    if(N+M+K<22)cout<<"win"<<endl;
    else cout<<"bust"<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define ff first
#define ss second
using namespace std;
using ll = long long;
using vi = vector<int>;
using pii = pair<ll, ll>;
int c[105];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < k; i++) {
    int d;
    cin >> d;
    for (int j = 0; j < d; j++) {
      int x;
      cin >> x;
      c[x]++;
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; i++)
    ans += (c[i] == 0);
  cout << ans << endl;
}

Measured memory_bytes: 3648
#include<bits/stdc++.h>
#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 fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧  
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     
　　　　／　　　＼　 　  |　|     
　　　 /　　 /￣￣￣￣/　　|  
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿  
　 　　　＼/＿＿＿＿/　（u　⊃  
---------------------------------------------------------------------------------------------------*/








int N; string S[101010];
map<char, ll> m;
string march = "MARCH";
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> N;
    rep(i, 0, N) cin >> S[i];
    rep(i, 0, N) m[S[i][0]]++;

    ll ans = 0;
    rep(a, 0, 5) rep(b, a + 1, 5) rep(c, b + 1, 5) ans += m[march[a]] * m[march[b]] * m[march[c]];
    cout << ans << endl;
}

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

#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define pb push_back
#define mod 1000000007
#define mp make_pair
#define fi first
#define se second
#define merge(a,b) a##b //concat a and b
#define mkstr(a) #a  //convert a to string a. a is not variable
#define flush fflush(stdout);
#define debug(x) cout<<#x<<endl;
#define debug1(x) cout<<x<<endl;
#define inf 1e18
#define endl "\n"
#define epsilon 1e-9

typedef long long int ll;
typedef long double   ld;
typedef unsigned long long int ull;

/************************************TEMPLATE**********************************/

ll modpower(ll x,ll y)
{
  ll res=1;
  x=x%mod;
  if(x==0) return 0;
  while(y>0)
  {
    if(y&1)
      res=(res*x)%mod;
    y=y>>1;
    x=(x*x)%mod;
  }
  return res;
}

/*************************************CODE*************************************/

int main()
{
  // freopen("input.txt","r",stdin);
  // freopen("output.txt","w",stdout);
  fastIO
  ll test_case=1;
  //cin>>test_case;
  while(test_case--)  {
    string s;
    cin>>s;
    int sum=0;
    for(int i=0;i<(int)s.length();i++)	{
    	sum+=s[i]-'0';
    }
    if(sum%9==0)
    	cout<<"Yes";
    else
    	cout<<"No";
  }
  return 0;
}


Measured memory_bytes: 3784
import java.util.Scanner;

class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		while (sc.hasNext()) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			System.out.println(Integer.toString(a + b).length());
		}
	}
}

Measured memory_bytes: 20444
#include<iostream>
using namespace std;
int main() {
	int W, H, x, y, r;
	cin >> W >> H >> x >> y >> r;
	if (r <= x&&x <= W - r&&r <= y&&y <= H - r) {
		
			cout << "Yes" << endl;
		
	}
	else {
		cout << "No" << endl;
	}
}

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

int main()
{
    string s;
    int a, b;
    cin >> s;
    for (int i = 0; i < s.length(); i++) {
        if (s[i] == 'A') {
            a = i;
            break;
        }
    }
    for (int i = s.length(); i > 0; i--) {
        if (s[i] == 'Z') {
            b = i;
            break;
        }
    }
    cout << (b - a) + 1 << endl;

    return 0;
}


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

#define int				long long
#define FOR( i, m, n )  for( int (i) = (m); (i) < (n); (i)++ )
#define FORE( i, m, n ) FOR( i, m , n + 1 )
#define REP( i, n )     FOR( i, 0, n )
#define REPE( i, n )	FOR( i, 0, n + 1 )
#define REPR( i, m )	for( int (i) = (m); (i) >= 0; (i)-- )
#define REPONE( i, n )	FOR( i, 1, n + 1 )
#define ALL( a )        (a).begin(), (a).end()
#define P				pair<string, int>
#define fi				first
#define se				second

template<class T>bool chmax( T& a, const T& b ) { if( a < b ) { a = b; return 1; } return 0; }
template<class T>bool chmin( T& a, const T& b ) { if( a > b ) { a = b; return 1; } return 0; }

const int INF = 1e9;
const int MOD = 1e9 + 7;
const int MAX_N = 100;

bool G[MAX_N][MAX_N];

signed main() {
	string s; cin >> s;
	int cnt = 0;
	REP( i, s.size() ) {
		if( s[i] == 'o' ) cnt++;
	}

	cout << 700 + cnt * 100 << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>
#include <memory.h>
#include <iomanip>
#include <bitset>
#include <list>
#include <stack>
#include <deque>

using namespace std;

#define mod 1000000007

int main()
{
	int n;
	cin >> n;
	int t[100001] = {}, x[100001] = {}, y[100001] = {};
	for(int i = 1; i <= n; i++){
		cin >> t[i] >> x[i] >> y[i];
	}
	for(int i = 1; i <= n; i++){
		int dt = t[i] - t[i - 1];
		int dx = abs(x[i] - x[i - 1]);
		int dy = abs(y[i] - y[i - 1]);
		if(dx + dy > dt || (dt - (dx + dy)) % 2 == 1){
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
	return 0;
}

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

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

using ll = long long;
using P = pair<int,int>;
using graph = vector<vector<int>>;

const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const ll INF = 1LL<<60;
const ll mod = 1000000007LL;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
ll pow(ll a, ll n, ll m) {
	ll ret = 1LL;
	for (; n > 0LL; n >>= 1LL, a = a * a % m) {
		if (n % 2LL == 1LL) {
			ret = ret * a % m;
		}
	}
	return ret;
}

int main() {
    ll N;
    cin>>N;
    vector<int> v(N+1);
    rep(i,N+1) cin>>v[i];
    map<int,int> m;
    rep(i,N+1) m[v[i]]++;
    int p = -1;
    for(auto x:m){
        if(x.second == 2) p = x.first;
    }
    ll t=-1LL,s=-1LL;
    rep(i,N+1) {
        if(t==-1&&v[i]==p) t = i;
        if(t!=-1&&v[i]==p) s = i;
    }
    ll h = t + (N-s);
    ll A = N+1,B = 1LL; 
    rep(i,N+1){
        ll ans = (A-B)%mod;
        if(ans<0) ans += mod;
        cout<<ans<<endl;
        A = (((A*(N-i))%mod)*pow((ll)i+2LL,mod-2,mod)%mod);
        B = (((B*(h-i))%mod)*pow((ll)i+1LL,mod-2,mod)%mod);
    }
}

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

public class Program
{
    static void Main()
    {
        string[] input = Console.ReadLine().Split(' ');
        int a = int.Parse(input[0]);
        int b = int.Parse(input[1]);
        char[] s = Console.ReadLine().ToCharArray();

        for (int i = 0; i < a; i++)
        {
            if (s[i] == '-')
            {
                Console.WriteLine("No");
                return;
            }
        }
        for (int i = a + 1; i < a + b + 1; i++)
        {
            if (s[i] == '-')
            {
                Console.WriteLine("No");
                return;
            }
        }
        if (s[a] == '-')
            Console.WriteLine("Yes");
        else
            Console.WriteLine("No");
    }
}

Measured memory_bytes: 13140
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rep1(i,n) for(int i=1; i<=(n); ++i)
#define repi(i,a,b) for(int i=a; i<=(b); ++i)
#define rrep(i,n) for(int i=(n-1); i>=0; --i)
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define pb push_back
#define mp make_pair
#define to_s to_string
#define sz(v) (int)v.size()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )
#define pr(x) cout<<(x)<<'\n'
#define debug(x) cout << #x << ": " << (x) << '\n'
#define yes "Yes"
#define no "No"
using namespace std;
using ll = long long;
using Edge = pair<int,long long>;
using Graph = vector<vector<Edge>>;
struct aaa{aaa(){ cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);};}aaaaaaa;
int MOD = 1e9 + 7;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return (a*b)/gcd(a,b);}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

ll dp[51][51];

void init(){
    dp[0][0] = 1;
    rep1(i,50){
        rep(j,51) if(j <= i){
            if(j==0) dp[i][j] = 1;
            else dp[i][j] = dp[i-1][j-1] + dp[i-1][j];
        }
    }   
}

ll N,P;
int main(){
    cin>>N>>P;
    ll tp;
    vector<ll> num(2);
    rep(i,N) cin >> tp, num[tp%2]++;
    ll ans1 = pow(2,num[0]);
    ll ans2 = 0;
    init();
    int i = 0;
    while(i <= num[1]){
        if(!P && i%2 == 0) ans2 += dp[num[1]][i];
        else if(P && i%2) ans2 += dp[num[1]][i];
        i++;
    }
    pr(ans1*ans2);
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
#define inf 1000000000
#define INF 1000000000000000
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define PLL pair<ll,ll>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
#define IN(a,n) rep(i,n){ cin>>a[i]; }
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define PI 3.14159265
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define int ll
void init(){
  cin.tie(0);
  ios::sync_with_stdio(false);
}


int f(string s){
  stack<int> st;

  int i=0;
  int r=0;
  while('0'<=s[i]&&s[i]<='9'){
    r*=10;
    r+=s[i]-'0';
    i++;
  }
  st.push(r);

  while(i<s.size()){
    bool flag=false;
    if(s[i]=='+'){
      flag=true;
    }
    i++;
    r=0;
    while('0'<=s[i]&&s[i]<='9'){
      r*=10;
      r+=s[i]-'0';
      i++;
    }
    int t=st.top(); st.pop();
    if(flag)
      st.push(r+t);
    else
      st.push(r*t);
  }

  return st.top();
}


int g(string s){
  stack<int> st;
  int i=0,r=0;
  while('0'<=s[i]&&s[i]<='9'){
    r*=10;
    r+=s[i]-'0';
    i++;
  }
  st.push(r);

  while(i<s.size()){
    bool flag=false;
    if(s[i]=='*') flag=true;
    i++;
    r=0;
    while('0'<=s[i]&&s[i]<='9'){
      r*=10;
      r+=s[i]-'0';
      i++;
    }
    if(flag){
      int t=st.top(); st.pop();
      st.push(t*r);
    }else
      st.push(r);
  }

  int ans=0;
  while(!st.empty()){
    ans+=st.top();
    st.pop();
  }

  return ans;
}


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

  int a=f(s);
  int b=g(s);

  if(a==n&&b==n){
    cout<<'U'<<endl;
  }else if(a==n){
    cout<<'L'<<endl;
  }else if(b==n){
    cout<<'M'<<endl;
  }else{
    cout<<'I'<<endl;
  }
}



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

int main(){
	string s,f; cin>>s>>f;
	reverse(f.begin(),f.end());
	cout<<(s==f?"YES":"NO")<<endl;
}

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

#define CPP_STR(x) CPP_STR_I(x)
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_STR_I(args...) #args
#define CPP_CAT_I(x,y) x ## y

using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;

using f32 = float;
using f64 = double;

#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) for(i64 i = 1; i <= n; ++i)
#define RREP(i, n) for(i64 i = n - 1; i >= 0 ; --i)
#define RREPS(i, n) for(i64 i = n; i >= 1; --i)

#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))

#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

#define pb push_back
#define mp make_pair
#define F first
#define S second

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }

template<typename T, size_t N>
i64 SIZE(const T (&)[N]) { return static_cast<i64>(N); }


struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;

    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;


int main() {
  i64 W, H, x, y;
  cin >> W >> H >> x >> y;

  cout << (f64)(W * H) / 2 << " ";
  cout << ((x * 2 == W && y * 2 == H) ? 1 : 0) << endl;

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i < (int)(n); i++)
typedef long long ll;
 
int main() {
    ll n,k; cin >> n >> k;
    ll sum = 0;
    vector<ll> H(n);
    rep(i,n){
        cin >> H[i];
        sum += H[i];
    }
    sort(H.rbegin(),H.rend());
    
    rep(i,k){
        sum -= H[i];
        if(sum < 0) break;
    }
    if(sum <= 0) cout << 0 << endl;
    else cout << sum << endl;
}

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

int main() {
  
  int a, b, c;
  cin >> a >> b >> c;
  
  int count = 0;
  for (int i = a; i < b+1; i++) {
    if (c%i == 0) {
      count++;
    }
  }
  cout << count << endl;
 
}


Measured memory_bytes: 3104
#include<iostream>
#include<iomanip>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#include<cctype>
#define P putchar
using namespace std;
int n,m;
inline void thin(string x){cout<<x,P(10),cout<<x,P(10);return;}
signed main()
{
	scanf("%d%d",&n,&m);getchar();string tmp;
	for(register int i(0);i^n;i++){getline(cin,tmp);thin(tmp);}
	return 0;
}

Measured memory_bytes: 256
// D - Candidates of No Shortest Paths

// Warshall-Floyd法で全点対間最短経路の距離を求めた後に
// 頂点 i と頂点 j を結ぶ辺が頂点 s から頂点 t への最短経路に含まれるとき
// min_dist(s, i) + edge(i, j) + min_dist(j, t) = min_dist(s, t)
// であることを利用する解法
// 計算量: O(MN^2) （より計算量の少ない方法あり）

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// const int INF = 2147483647;
// const ll INF = 922337203685477580;
// const ll MOD = 1e9 + 7;

const int N_MAX = 100;
const int M_MAX = 1000;
const ll INF = 1000000;

ll d[N_MAX][N_MAX]; // d[i][j] : 頂点iから頂点jへの最小コスト
int a[M_MAX], b[M_MAX], c[M_MAX]; // 辺の情報

void Warshall_Floyd(ll d[N_MAX][N_MAX], int n) {
	for (int k=0; k<n; k++) {
		for (int i=0; i<n; i++) {
			if (d[i][k] == INF) continue;
			for (int j=0; j<n; j++) {
				if (d[k][j] == INF) continue;
				d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
			}
		}
	}
}

int main() {
	int N, M;
	cin >> N >> M;

	// 自分自身への最小コストを0、それ以外をINFで初期化
	for (int i=0; i<N; i++) {
		for (int j=0; j<N; j++) {
			d[i][j] = ((i == j) ? 0 : INF);
		}
	}

	for (int i=0; i<M; i++) {
		cin >> a[i] >> b[i] >> c[i];
		a[i]--;
		b[i]--;
		d[a[i]][b[i]] = c[i];
		d[b[i]][a[i]] = c[i];
	}

	Warshall_Floyd(d, N);

	// 条件を満たす辺の数をカウント
	int ans = 0;
	for (int i=0; i<M; i++) {
		bool is_included = false; // 最短経路に含まれるかどうか
		for (int s=0; s<N; s++) {
			for (int t=0; t<N; t++) {
				if (d[s][a[i]] + c[i] + d[b[i]][t] == d[s][t]) {
					is_included = true;
				}
			}
		}

		if (!is_included) ans++;
	}

	cout << ans << endl;

	return 0;
}


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

using namespace std;

// Problem https://atcoder.jp/contests/abc072/tasks/arc082_a
// Reference https://atcoder.jp/contests/arc082/submissions/1688401
// comment X を決めると Greedy にすべて決まります
// comment from https://qiita.com/drken/items/fd4e5e3630d0f5859067#%E7%AC%AC-9-%E5%95%8F--abc-049-c---daydream-300-%E7%82%B9

int solver(int allNum,vector<int> elem){
    int result=0;
    static int maxSize=100000;
    vector<int> box(maxSize+1,0);
    for(int j=0;j<elem.size();j++){
        int inbox;
        inbox=elem.at(j);
        box.at(inbox)++;
    }
    for(int j=1;j<maxSize;j++){
        int xsum;
        xsum=box.at(j-1)+box.at(j)+box.at(j+1);
        if(result<xsum){
            result=xsum;
        }
    }
    return result;
}


int main(void){
    int answer=0;
    int N;
    cin >> N;
    vector<int> Ai(N);

    for(int j=0;j<N;j++){
        cin >> Ai.at(j);
    }
    answer = solver(N,Ai);
    cout << answer << endl;
}

Measured memory_bytes: 1408
N,K=map(int,input().split())
A=list(map(int,input().split()))

mod=10**9+7

B=[]
for i in range(N):
    l=0
    r=0
    for j in range(i):
        if A[i]>A[j]:
            l+=1

    for k in range(i,N):
        if A[i]>A[k]:
            r+=1
    B.append([l,r])

ans=0
for i in range(N):
    ans+=B[i][0]*(K-1)*K//2+B[i][1]*K*(K+1)//2
ans%=mod

print(ans)

Measured memory_bytes: 9248
N = int(input())
list = list(input().split())

flag = 1
count = 0
while flag == 1:
  flag = 0
  for i in range(N - 1, 0, -1):
    if int(list[i]) < int(list[i - 1]):
      tmp = list[i]
      list[i] = list[i - 1]
      list[i - 1] = tmp
      count += 1
      flag = 1
print(' '.join(list))
print(count)



Measured memory_bytes: 5596
#include<bits/stdc++.h>
using namespace std;
#define fine cout<<"fine"<<endl;
#define ll long long int
#define pb push_back
#define FASTIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
const ll inf=(ll)2e18;
const int mod=1e9+7;
bool overflow(ll a,ll b){
    if (a <= (inf+b-1)/b) return false;
    return true;
}
int main(){
FASTIO;
ll n,d,a,i,x,h,total=0;
cin>>n>>d>>a;
vector<pair<ll,ll> > v(n);
for(i=0;i<n;i++){
    cin>>x>>h;
    v[i]={x,h};
}
sort(all(v));
ll pref[n+1];
memset(pref,0,sizeof(pref));
ll sum=0;
int start=0,last=0;
while(start<n){
    while(last<n&&v[start].ff+2*d>=v[last].ff)
        last++;
    last--;
    //cout<<start<<" "<<last<<endl;
    sum+=pref[start];
    h=max((ll)0,v[start].ss-sum);
    ll moves=h/a+(h%a>0);
    total+=h/a+(h%a>0);
    pref[last+1]-=moves*a;
    sum+=moves*a;
    start++;
}
cout<<total<<endl;
}


Measured memory_bytes: 4992
import copy

def calcAbs(a, i):
	return abs(a[i+1] - a[i-1]) - (abs(a[i] - a[i-1]) + abs(a[i+1] - a[i]))

def main():
	n = int(input())
	a = list(map(int, input().split()))
	a.insert(0, 0)
	a.insert(len(a), 0)
	#a.append(0)

	total = 0
	for j in range(len(a)-1):
		total += abs(a[j+1] - a[j])

	for i in range(1, n+2-1):
		ans = total + calcAbs(a, i) 

		print(ans)


main()


Measured memory_bytes: 14688
//#include <boost/multiprecision/cpp_dec_float.hpp>
//#include <boost/multiprecision/cpp_int.hpp>
#include <stdio.h>
#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#include <algorithm>
#include <bitset>
#include <iomanip>
using namespace std;
//namespace mp = boost::multiprecision;
//using llll = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
//using Real = mp::number<mp::cpp_dec_float<1024>>;
using ll = long long;
const double EPS = 1e-10;
const ll MOD = 7+(1e+9);

int main(){
  //cout<<fixed<<setprecision(10);
  ll n,ans=0;
  string s;
  cin>>n>>s;
  for(ll i=0;i<n-2;i++){
    ll f=1;
    for(ll j=0;j<3;j++){
      if(s[i+j]!='A'+j)f=0;
    }
    if(f)ans++;
  }
  cout<<ans<<endl;
}


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

int dp[101000];
int n,k;
int h[101000];

int main(){
	cin>>n>>k;
	for(int i=1;i<=n;++i) cin>>h[i];
	memset(dp,0x7f7f7f7f,sizeof(dp));
	dp[1]=0;
	for(int i=2;i<=n;++i) {
		for(int j=i-1;j>=1&&j>=i-k;j--)
			dp[i]=min(dp[i],dp[j]+abs(h[i]-h[j]));
	}
	cout<<dp[n]<<"\n";
	return 0;
}

Measured memory_bytes: 1024
//                             In The Name Of Allah
#include <bits/stdc++.h>
#define	ss second
#define ff first
#define use_fast ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define ret(n) return cout << n, 0
#define se(n) cout << setprecision(n) << fixed
#define pb push_back
#define int long long
#define ld long double
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC optimize("no-stack-protector,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std; 

const int N = 2e5 + 100, OO = 1e16 + 7, T = 13, M = 1e9 + 7, P = 6151, SQ = 800, lg = 32;
typedef pair <int, int> pii;

int32_t main() {
	use_fast;
	int n, k;
	cin >> n >> k;
	n %= k;
	cout << min(n, k - n) << endl;
	return 0; 
} 
/*
be carefull :
1- if not solve after 20 min, read again twice
2- after submit read the code again
3- fun with contest
4- ... 
*/

Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
	static char city;
	static int flag;
	
	public static void check(int nn){
		if(nn==0){
			if(city=='A') {city='X'; flag=0;}
			else if(city=='B') {city='Y'; flag=0;}
			else if(city=='X') {flag=2;}
			else if(city=='Y') {city='X'; flag=0;}
			else if(city=='Z') {city='W'; flag=0;}
			else if(city=='W') {city='B'; flag=1;}
		}
		else if(nn==1){
			if(city=='A') {city='Y'; flag=0;}
			else if(city=='B') {city='X'; flag=0;}
			else if(city=='Y') {flag=2;}
			else if(city=='X') {city='Z'; flag=0;}
			else if(city=='Z') {city='B'; flag=1;}
			else if(city=='W') {city='Y'; flag=0;}
		}
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	
		while(true){
			city='A';
			flag=0;
		
			String s = sc.next();
			if(s.equals("#")) break;
			
			for(int i=0; i<s.length(); i++){
				char c = s.charAt(i);
				int n = Integer.parseInt(""+c);
				
				//System.out.println("city:"+ city + " flag:" + flag); 
				
				check(n);
				if(flag==2) break;
			}
			if(flag==1) System.out.println("Yes");
			else System.out.println("No");
		}
		
	}

}

Measured memory_bytes: 17428
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
#define eb emplace_back
#define lb(v,k) (lower_bound(all(v),k)-v.begin())
#define ub(v,k) (upper_bound(all(v),k)-v.begin())
#define fi first
#define se second
#define pi M_PI
#define PQ(T) priority_queue<T>
#define SPQ(T) priority_queue<T,vector<T>,greater<T>>
using ll=long long;
using P=pair<ll,ll>;
using PP=tuple<ll,ll,ll>;
using S=multiset<ll>;
using vi=vector<ll>;
using vvi=vector<vi>;
using vvvi=vector<vvi>;
const ll inf=1001001001001001;
const int INF=1001001001;
const int mod=1000000007;
const double eps=1e-10;
template<class T> bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<class T> void out(T a){cout<<a<<'\n';}
template<class T> void outp(T a){cout<<'('<<a.fi<<','<<a.se<<')'<<'\n';}
template<class T> void outvp(T v){rep(i,v.size())cout<<'('<<v[i].fi<<','<<v[i].se<<')';cout<<'\n';}
template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<'\n';}
template<class T> void outvv(T v){rep(i,v.size())outv(v[i]);}
template<class T> bool isin(T x,T l,T r){return (l)<=(x)&&(x)<=(r);}
template<class T> void YesNo(T b){if(b)out("Yes");else out("No");}
void decimal(int x){cout<<fixed<<setprecision(x);}
ll GCD(ll a,ll b){if(b==0) return a; return GCD(b,a%b);}
ll LCM(ll a,ll b){return(a/GCD(a,b))*(b/GCD(a,b))*GCD(a,b);}
ll POW(ll a,ll b){a%=mod;if(b==0)return 1;if(b&1)return a*POW(a,b-1)%mod;ll k=POW(a,b/2);return k*k%mod;}
vi calc(ll x){vi res;while(x>0){res.eb(x%10);x/=10;}reverse(all(res));return res;}

void solve() {
  int h,a;
  cin>>h>>a;
  if(h%a==0) out(h/a);
  else out(h/a+1);
}

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
}


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

const int INF = 987654321;

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> dp(1 << N);
  for (int i = 0; i < (1 << N); i++) {
    dp[i] = INF;
  }
  dp[0] = 0;
  for (int i = 0; i < M; i++) {
    int a, b;
    cin >> a >> b;
    int bit = 0;
    for (int j = 0; j < b; j++) {
      int c;
      cin >> c;
      c--;
      bit = (bit | (1 << c));
    }
    for (int j = 0; j < (1 << N); j++) {
      if (dp[j] < INF) {
        dp[j | bit] = min(dp[j | bit], dp[j] + a);
      }
    }
  }
  if (dp[(1 << N) - 1] == INF)
    cout << -1 << endl;
  else
    cout << dp[(1 << N) - 1] << endl;
}

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

int main(void){
  int a,b,c;
  bool ans=0;
  cin >> a >> b >> c;
  if(a==b && b!=c)  ans=1;
  if(a==c && b!=c)  ans=1;
  if(c==b && a!=c)  ans=1;
  
  if(ans){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  return 0;
}

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


int main(){
    int N,Q,tmp;
    string str;
    list<int> left,right,ans;
    cin >> N;
    cin >> Q;
    cin >> str;

    for(int i=0;i<Q;i++){
        cin >> tmp;
        left.push_back(tmp);
        cin >> tmp;
        right.push_back(tmp);
    }

    // data compleat!----------------------------
    vector<int> t;
    t.push_back(0);
    bool hold_A = false;

    for(int i=0;i<N;i++){
        if (hold_A) {
                hold_A = false;
                if (str[i]=='C') {
                    t.push_back(t[i] + 1);
                    continue;
                }
            }
            t.push_back(t[i]);
            if(str[i]=='A'){
                hold_A = true;
        }
    }

    list<int>::iterator l_itr = left.begin();
    list<int>::iterator r_itr = right.begin();

    for(int i=0;i<Q;i++){
        int sub;
        sub = t[*r_itr] - t[*l_itr];
        l_itr++;
        r_itr++;
        ans.push_back(sub);
    }

    list<int>::iterator ans_itr = ans.begin();

    for(int i=0;i<Q;i++){
        cout << *ans_itr << endl;
        ans_itr++;
    }

    return 0;
}

Measured memory_bytes: 10748
#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <fstream>
using namespace std;

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
typedef long long ll;

typedef pair<int, pair<string, int> > P;

#define INF 1000000000

int main(){
    int n,q;
    while(scanf("%d %d", &n, &q), n|q){
        vector<P> vec;
        rep(i,n){
            int y1,y2;
            char c[20];
            scanf("%s %d %d", c, &y1, &y2);
            string s(c);
            vec.pb(mp(y2, mp(s, y1)));
            vec.pb(mp(y2-y1+1, mp(s,1)));
        }

        sort(all(vec));
        vec.erase(unique(all(vec)), vec.end());

        rep(i,q){
            int query;
            cin>>query;
            P que = mp(query, mp("",0));
            auto itr = lower_bound(all(vec), que);

            const string uk = "Unknown";
            if(itr==vec.end()){
                cout<<uk<<endl;
                continue;
            }
            if(itr->second.second==1){
                if(itr->first == query)
                    cout<<itr->second.first<<" 1"<<endl;
                else
                    cout<<uk<<endl;
            } else {
                itr--;
                int year = query - itr->first +1;
                cout<<itr->second.first<<" "<<year<<endl;
            }

        }

    }

    return 0;
}

Measured memory_bytes: 3332
#include<bits/stdc++.h>
using namespace std;
int main(void){
  string s; cin>>s;
  int res=0,sz=s.size()-1;
  for(int i=0; i<sz; ++i) if(s[i]!=s[sz-i]) ++res,s[i]=s[sz-i];
  cout<<res;
  return 0;
}


Measured memory_bytes: 3592
#include <bits/stdc++.h>
using namespace std;
int main() {
  int S, a, b, c, d;
  cin >> S;
  a = 0;
  b=0;
  c=0;
  d=0;
  while (S - (a+1)*1000 >= 0) {
    a += 1;
  }
   while (S-a*1000-(b+1)*100>= 0) {
    b += 1;
  }
   while (S-a*1000-b*100-(c+1)*10>= 0) {
    c += 1;
  }
    while (S-a*1000-b*100-c*10-(d+1)>= 0) {
    d += 1;
  }
  if (a==b || b==c || c==d) {
    cout << "Bad" << endl;
  }
    else {
      cout << "Good" << endl;
    }
}

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

using ll = long long int;

const int MAX = (int)(1e5 + 5);
const ll INF = (ll)(1e10 + 5);

int c[3 + 5][3 + 5];

int a[3 + 5];
int b[3 + 5];

bool check() {
  for (int i = 1; i <= 3; ++i) for (int j = 1; j <= 3; ++j) {
    if (a[i] + b[j] != c[i][j]) {
      return false;
    }
  }
  return true;
}

int main(void) {
  // Here your code !
  for (int i = 1; i <= 3; ++i) for (int j = 1; j <= 3; ++j) {
    scanf("%d", &(c[i][j]));
  }

  int sum1 = c[1][1] + c[2][1] + c[3][1];
  int sum2 = c[1][2] + c[2][2] + c[3][2];
  int sum3 = c[1][3] + c[2][3] + c[3][3];

  for (a[1] = 0; a[1] <= 100; ++(a[1])) {
    for (a[2] = 0; a[2] <= 100; ++(a[2])) {
      for (a[3] = 0; a[3] <= 100; ++(a[3])) {
        int suma = a[1] + a[2] + a[3];

        if ((sum1 - suma) % 3 != 0) continue;
        b[1] = (sum1 - suma) / 3;

        if ((sum2 - suma) % 3 != 0) continue;
        b[2] = (sum2 - suma) / 3;

        if ((sum3 - suma) % 3 != 0) continue;
        b[3] = (sum3 - suma) / 3;

        for (int i = 1; i <= 3; ++i) for (int j = 1; j <= 3; ++j) {
          if (check()) {
            printf("Yes\n");
            return 0;
          }
        }
      }
    }
  }

  printf("No\n");

  return 0;
}


Measured memory_bytes: 256
import java.util.*;

class Main{
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        int n = stdIn.nextInt();
        int a = stdIn.nextInt();
        int b = stdIn.nextInt();
        
        System.out.println(a*n < b ? a*n : b);
    }
}

Measured memory_bytes: 23764
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int , int> P;
typedef pair<ll, ll> PL;
const int INT_INF = 2147483646;
const ll LL_INF = 9223372036854775807;
 
bool SecondCompare(const pair<int,int> &a,const pair<int,int> &b)
{
       return a.second<b.second;
}
 
bool SecondCompareDes(const pair<int,int> &a,const pair<int,int> &b)
{
       return a.second>b.second;
}
 
const int size = 1e5+10;
ll n,k;
ll a[size];
ll sa[size];

int main(){
    cin >> n >> k;
    for(int i = 0; i < n; i++)  cin >> a[i];

    int co = 0;
    for(ll j = 1; j <= k; j <<= 1)    ++co;


    for(int i = 0; i < n; i++){
        ll ch = 1;
        for(int j = 0; j < co; j++){
            if(ch & a[i]) ++sa[j];
            ch <<= 1;
        }
    }
    ++co;
    //cout << co << endl;

    ll ans = 0;
    for(int j = 0; j < co; j++){
        if(sa[j] <= n/2){
            ans += (1LL<<j);
            if(k < ans){
                ans -= (1LL<<j);
                //break;
            }
        }
    }
    ll mem = ans;
    ans = 0;
    for(int j = co-1; j >= 0; j--){
        if(sa[j] <= n/2){
            ans += (1LL<<j);
            if(k < ans){
                ans -= (1LL<<j);
            }
        }
    }

    ll ans2 = 0;
    for(int i = 0; i < n; i++)  ans2 += (ans ^ a[i]);
    ll mem2 = 0;
    ans = mem;
    for(int i = 0; i < n; i++)  mem2 += (ans ^ a[i]);
    cout << max(ans2,mem2) << endl;

}

Measured memory_bytes: 1024
#include <stdio.h>

int main(){
int k,a,b;
int flag = 0;
scanf("%d",&k);
scanf("%d %d",&a,&b);
	for(int i =a;i<=b;i++){
		if(i%k==0){
			flag = 1;
		}
	
	}
	if(flag == 1){
		printf("OK\n");
	}
	else{
		printf("NG\n");

	}
	return 0;
}

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

using namespace std;

int main(){
	string s;
	cin>>s;
	if(s=="Sunny"){
		cout<<"Cloudy"<<endl;
	}else if(s=="Cloudy"){
		cout<<"Rainy"<<endl;
	}else{
		cout<<"Sunny"<<endl;
	}
	return 0;
}

Measured memory_bytes: 256