akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
  
struct point{
  ll x,y;
};
  
ll w,h,v,t,x,y,p,q;
ll R,H,W;
point o,O;
  
point calc(ll X,ll Y){
  ll dx=abs(X-O.x),dy=abs(Y-O.y);
  point res;
  
  if(dx%2==0)res.x=p;
  else res.x=w-p;
  
  if(dy%2==0)res.y=q;
  else res.y=h-q;
  
  res.x+=X*w;
  res.y+=Y*h;
  return res;
}
  
ll search(ll Y){
  ll l=0,r=W,m;
  while(l<r){
    m=(l+r)/2;
    point d=calc(m,Y);
    ll dist= (d.x-o.x)*(d.x-o.x) + (d.y-o.y)*(d.y-o.y);
    if( dist <= v*t*v*t  || o.x< d.x ){
      r=m;
    }else{
      l=m+1;
    }
  }
  return l;
}
  
ll search2(ll Y){
  ll l=0,r=W,m;
  while(l<r){
    m=(l+r)/2;
    point d=calc(m,Y);
    ll dist= (d.x-o.x)*(d.x-o.x) + (d.y-o.y)*(d.y-o.y);
    if( dist <= v*t*v*t || d.x < o.x ){
      l=m+1;
    }else{
      r=m;
    }
  }
  return l;
}
  
int main(){
  cin>>w>>h>>v>>t>>x>>y>>p>>q;
  R=v*t;
  W=(v*t/w+1LL)*4;
  H=(v*t/h+1LL)*4;
  O.x=W/2;
  O.y=H/2;
  o.x=O.x*w+x;
  o.y=O.y*h+y;
  
  
  
  ll ans=0;
  for(ll i=0;i<=H;i++){
    ll a=search(i);
    ll b=search2(i);
    point d=calc(a,i);
    ll dist= (d.x-o.x)*(d.x-o.x) + (d.y-o.y)*(d.y-o.y);
    d=calc(b,i);
    ll dist2= (d.x-o.x)*(d.x-o.x) + (d.y-o.y)*(d.y-o.y);
    d=calc(b-1,i);
    ll dist3= (d.x-o.x)*(d.x-o.x) + (d.y-o.y)*(d.y-o.y);
    d=calc(a-1,i);
    ll dist4= (d.x-o.x)*(d.x-o.x) + (d.y-o.y)*(d.y-o.y);
  
    if(dist <= v*t*v*t && v*t*v*t<dist2)

    ans+=(b-a);
      
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//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; }

/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
*/

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

    vector<int> color(N+1, 0);
    for(int i=1; i<=N; i++) cin >> color[i];

    int field[H+1][W+1];

    int pos = 1;
    for(int i=1; i<=H; i++){
        if(i%2 == 1){
            for(int j=1; j<=W; j++){
                field[i][j] = pos;
                color[pos]--;
                if(color[pos] == 0) pos++;
            }
        }
        if(i%2 == 0){
            for(int j=W; j>=1; j--){
                field[i][j] = pos;
                color[pos]--;
                if(color[pos] == 0) pos++;
            }
        }
    }

    for(int i=1; i<=H; i++){
        for(int j=1; j<=W; j++){
            if(j != 1) cout << " ";
            cout << field[i][j];
        }
        cout << endl;
    }
}

Measured memory_bytes: 384
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
int main(){
  int N;
  cin >> N;
  vector<ll> A(N);

  for(int i = 0;i < N;i++)cin >> A[i];

  if(N < 3)cout << 1 << endl;
  else{

    vector<ll> B(N-1);
    for(int i = 0;i < N-1;i++)B[i] = A[i+1] - A[i];

    int now = 0;
    int ans = 0;

    for(int i = 0; i < N-1;i++){
      if((now > 0 && B[i] < 0) || (now < 0 && B[i] > 0)){
        now = 0;
        ans++;
      }
      else if(B[i] != 0)now = B[i];
    }

    cout << ans + 1 << endl;

  }


}


Measured memory_bytes: 1792
package main

import (
	"fmt"
)

func main() {
	var p, q, r int
	fmt.Scan(&p, &q, &r)

	min := p + q
	if q+r < min {
		min = q + r
	}
	if r+p < min {
		min = r + p
	}
	fmt.Println(min)
	return
}


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

int main(){
  int A, B;
  string S;
  cin >> A;
  cin >> B;
  cin >> S;
  string nlist = "0123456789";
  // get Ath letter of S and check whether S.at(A) is - or not
  if (S.size() != A+B+1){
    cout << "No" << endl;
    return 0;
  }
  for (int i=0; i<S.size(); ++i){
    if (i == A){
      if (S.at(i) != '-'){
        cout << "No" << endl;
        return 0;
      }
    }
    else{
      if (nlist.find(S.at(i)) == string::npos){
        cout << "No" << endl;
        return 0;
      }
    }
  }
  cout << "Yes" << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <algorithm>
#define R register
#define IN inline
#define gc getchar()
#define W while
#define ll long long
#define MX 300050
#define mod 1000000007
template <class T>
IN void in(T &x)
{
    x = 0; R char c = gc;
    W (!isdigit(c)) c = gc;
    W (isdigit(c))
    x = (x << 1) + (x << 3) + c - 48, c = gc;
}
short go[8][2] = {{2, 1}, {4, 3}, {6, 5}, {3, 3}, {7, 1}, {2, 1}, {2, 2}, {4, 4}};//打表转移
ll dp[MX][8];
char buf[MX];
int len;
int main(void)
{
    scanf("%s", buf + 1);
    len = std::strlen(buf + 1);
    dp[0][0] = 1; 
    R int j;
    for (R int i = 0; i < len; ++i)
    {
        for (j = 0; j <= 7; ++j)
        {
            if(buf[i + 1] != '0') dp[i + 1][go[j][1]] += dp[i][j], dp[i + 1][go[j][1]] %= mod;
            if(buf[i + 1] != '1') dp[i + 1][go[j][0]] += dp[i][j], dp[i + 1][go[j][0]] %= mod;
        }
    }
    printf("%d\n", (dp[len][1] + dp[len][3]) % mod);
}

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

int main() {
    int N;
    cin >> N;
    int64_t a = 0, b = 1;
    for(int i=0; i<N; i++){
        int q, x;
        cin >> q >> x;
        if(q == 1){
            a *= x;
            b *= x;
        }else{
            a += (q==2 ? x : -x);
        }
    }
    cout << -a << " " << b << endl;
    return 0;
}


Measured memory_bytes: 3104
n,m = map(int,input().split())
l = []
for i in range(m):
    l.append(list(map(int,input().split())))
ans = -1
if n == 1:
    for i in range(10):
        i = str(i)
        flag = True
        for j in range(m):
            if i[l[j][0]-1] != str(l[j][1]) :
                flag = False
        if flag:
            ans = int(i)
            break
else:
    for i in range(10**(n-1),10**n):
        i = str(i)
        flag = True
        for j in range(m):
            if i[l[j][0]-1] != str(l[j][1]) :
                flag = False
        if flag:
            ans = int(i)
            break
print(ans)

Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <math.h>
#include <string>
#include <algorithm>

using namespace std;

typedef struct station {
	int c;
	int s;
	int f;
};

int main() {
	vector<station> data;
	int n;
	cin >> n;
	station k;
	for (int i = 0; i < n-1; i++) {
		cin >> k.c >> k.s >> k.f;
		data.push_back(k);
	}
	for (int i = 0; i < n-1; i++) {
		int now = data[i].s;
		for (int j = i; j < n - 1; j++) {
			now += data[j].c;
			if (j < n - 2) {
				if (now <= data[j+1].s)
					now = data[j+1].s;
				else {
					int k;
					for (k = data[j+1].s; now > k; k += data[j+1].f) {
					}
					now = k;
				}
			}
		}
		cout << now << endl;
	}
	cout << "0" << endl;
}

Measured memory_bytes: 256
n = gets.to_i
prime = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47]
exp = [0]*15
2.upto(n) do |v|
  prime.each_with_index do |a,i|
    while (v % a == 0)
      exp[i] += 1
      v /= a
    end
  end
end

v,w,x,y,z = 0,0,0,0,0
exp.each do |e|
  v += 1 if e >= 74
  w += 1 if e >= 24
  x += 1 if e >= 14
  y += 1 if e >= 4
  z += 1 if e >= 2
end

ans = 0
ans += v
ans += w * (z-1)
ans += x * (y-1)

if y >= 3
  ans += y * (y-1) * (y-2) /2
end
if y >= 2 && z > 0
  ans += y * (y-1) * (z-y) /2
end
p ans

Measured memory_bytes: 1788
#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 ll INF = ll(1e18)+1;

int main() {
  int n; ll k;
  cin >> n >> k;
  vector<ll> a(n);
  rep(i,n) cin >> a[i];
  sort(a.begin(), a.end());
  ll l = -INF, r = INF;
  while (l+1 < r) {
    ll x = (l+r)/2;
    bool ok = [&]{
      ll tot = 0;
      rep(i,n) {
        if (a[i] < 0) {
          int l = -1, r = n;
          while (l+1<r) {
            int c = (l+r)/2;
            if (a[c]*a[i] < x) r = c; else l = c;
          }
          tot += n-r;
        } else {
          int l = -1, r = n;
          while (l+1<r) {
            int c = (l+r)/2;
            if (a[c]*a[i] < x) l = c; else r = c;
          }
          tot += r;
        }
        if (a[i]*a[i] < x) tot--;
      }
      tot /= 2;
      return tot < k;
    }();
    if (ok) l = x; else r = x;
  }
  cout << l << endl;
  return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <cstring>
#include <algorithm>

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

int const MAX_N = (123456+10)*2;
int ps[MAX_N/2];
bool isp[MAX_N+1];
int p_cnt = 0;
void es(){
    rep(i,MAX_N) isp[i]=true;
    isp[0]=isp[1]=false;
    ps[p_cnt++] = 2;
    isp[2]=true;
    for(int i=4; i<MAX_N; i+=2) isp[i]=false;
    for(int i=3; i<MAX_N; i+=2){
        if(!isp[i]) continue;
        ps[p_cnt++] = i;
        for(int j=i+i; j<MAX_N; j+=i){
            isp[j] = false;
        }
    }
}

int main(){
    es();
    int n;
    while(cin>>n, n){
        auto it1 = upper_bound(ps,ps+p_cnt,n+n);
        auto it2 = lower_bound(ps,ps+p_cnt,n);
        if(*it2==n) ++it2;
        // for(auto it = it2; it!=it1; ++it){
        //     cout << *it << " ";
        // }
        cout << it1 - it2 << endl;
    }
}

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


int main(){
  int n;
  cin>>n;
  vector<vector<pair<int,int>>> g(n);
  rep(i,n-1){
    int u,v,w;
    cin>>u>>v>>w;
    u--; v--;
    g[u].pb({v,w});
    g[v].pb({u,w});
  }
  
  vector<int> dist(n,-1);
  queue<int> que;
  
  dist[0]=0;
  que.push(0);
  
  while(!que.empty()){
    int x=que.front();
    que.pop();
    
    for(auto nx:g[x]){
      if(dist[nx.first]!=-1) continue;
      dist[nx.first]=(dist[x]+nx.second)%2;
      que.push(nx.first);
    }
  }
  rep(i,n){
    if(dist[i]==0) cout<<0<<endl;
    else cout<<1<<endl;
  }
}
  

Measured memory_bytes: 6784
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;

#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define range(i,a,n) for(int i=(a);i<(n);i++)

#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI 3.1415926535897932384

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};

template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S acm(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
void YN(bool b){cout<<(b?"YES":"NO")<<"\n";}
void Yn(bool b){cout<<(b?"Yes":"No")<<"\n";}
void yn(bool b){cout<<(b?"yes":"no")<<"\n";}

ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s;a=0;} return os;}

string abcd;

void solve(int n){
	vl k(n);
	rep(i,n)cin>>k[i];
	string s;
	cin>>s;
	rep(i,s.size()){
		int c=(char)s[i]-'a';
		if(c<0)c=(char)s[i]-'A'+26;
		c=(c+52-k[i%k.size()])%52;
		s[i]=abcd[c];
	}
	cout<<s<<"\n";
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	rep(i,26)abcd.push_back((char)('a'+i));
	rep(i,26)abcd.push_back((char)('A'+i));
	while(cin>>n,n)solve(n);
}


Measured memory_bytes: 3128
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string S;
  string s1 = "SSS";
  string s2 = "SSR";
  string s3 = "SRS";
  string s4 = "RSS";
  string s5 = "RSR";
  string s6 = "RRR";
  string s7 = "SRR";
  string s8 = "RRS";
  cin >> S;
 if (S == s1) {
  cout << "0" << endl;
 }else if (S == s2) {
  cout << "1" << endl;  
 }else if (S == s3) {
  cout << "1" << endl;  
 }else if (S == s4) {
  cout << "1" << endl;  
 }else if (S == s5) {
  cout << "1" << endl;  
 }else if (S == s6) {
  cout << "3" << endl;  
    }else if (S == s7) {
  cout << "2" << endl;  
    }else if (S == s8) {
  cout << "2" << endl;  
}
}

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

int main() {
  int N,J,I;
  cin >> N ;
  J = ( N - ( N / 1000 ) * 1000 ) % 111 ;
  I = ( N - N % 10 ) % 1110;
  if ( J == 0 ) {
    cout << "Yes" << endl;
  }
  else if ( I == 0) {
    cout << "Yes" << endl;
  }
  else
    cout << "No" << endl;
}

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

int main() {
  int N, X, c = 0, D = 0;
  cin >> N >> X;
  int L[N];
  
  for (int k = 0; k < N; k++)
    cin >> L[k];
  
  for (int i = 1; D <= X && i <= N + 1; i++) {
    D += L[i - 1]; //Di+1 = Di + Li
    c = i;
  }
  
  cout << c;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
using ll  = long long;
const int nax = 1e5+5;
vector<int>adj[nax];
int height[nax];



int main()
{
    int n,m;
    cin>>n>>m;
    for(int i=0;i<n;i++){
        ll h;cin>>h;
        height[i+1]=h;
    }
    for(int i=0;i<m;i++){
        int a,b;
        cin>>a>>b;
        if(height[b]>height[a]){
            adj[a].push_back(b);
        }
        else if(height[a]>height[b]){
            adj[b].push_back(a);
        }
        else{
            adj[a].push_back(b);
            adj[b].push_back(a);
        }
    }
    ll ans = 0;

    for(int i=1;i<=n;i++){

            if(adj[i].empty())ans++;

    }
    cout<<ans;

    return 0;
}


Measured memory_bytes: 8164
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int c1 = sc.nextInt();
		int c5 = sc.nextInt();
		int c10 = sc.nextInt();
		int c50 = sc.nextInt();
		int c100 = sc.nextInt();
		int c500 = sc.nextInt();
		int sum = 0;
		sum = c1 * 1 + c5 * 5 + c10 * 10 + c50 * 50 + c100 * 100 + c500 * 500;
		if(sum >= 1000){
			System.out.println("1");
		} else{
			System.out.println("0");
		}
		sc.close();
	}

}

Measured memory_bytes: 17356
//abc120_d.cpp
//Mon Jun  3 21:59:38 2019

#include <iostream>
#include <string>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <math.h>
#include <set>
#define INTINF 2147483647
#define LLINF 9223372036854775807
using namespace std;
using ll=long long;
typedef pair<int,int> P;
//Union-Find木
int par[100000]; //親
int treerank[100000]; //木の深さ
ll nodenum[100000];

//n要素で初期化
void init(int n){
	for (int i=0;i<n;i++){
		par[i] = i;
		treerank[i] = 0;
		nodenum[i] = 1;
	}
}

//木の根（親）を見つける
int find (int x){
	if (par[x] == x){
		return x;
	} else {
		return par[x] = find(par[x]);
	}
}

//xとyの属する集合の併合
void unite(int x, int y){
	x = find(x);
	y = find(y);
	if (x == y) {
		return;
	} 

	if (treerank[x] < treerank[y]){
		par[x] = y;
		nodenum[y] += nodenum[x];
		nodenum[x] = 0;
	} else {
		par[y] = x;
		nodenum[x] += nodenum[y];
		nodenum[y] = 0;
		if (treerank[x] == treerank[y]){
			treerank[x]++;
		}
	}
}

int main(){
	ll n,m;
	cin >> n >> m;

	P bridge[m];
	for (int i=0;i<m;i++){
		cin >> bridge[i].first >> bridge[i].second;
		bridge[i].first--;
		bridge[i].second--;
	}

	init(n);

	ll ans[m];
	fill(ans,ans+m,0);
//	if (n%2==0){
//		ans[m-1] = n/2;
//		ans[m-1] = ans[m-1]*(n-1);
//	}else{
//		ans[m-1] = (n-1)/2;
//		ans[m-1] = ans[m-1]*n;
//	}
	ans[m-1] = n*(n-1)/2;
	for (int i=m-1;i>=1;i--){
		if (find(bridge[i].first)==find(bridge[i].second)){
			ans[i-1] = ans[i];
		}else{
			ans[i-1] = ans[i]-nodenum[find(bridge[i].first)]*nodenum[find(bridge[i].second)];
			unite(bridge[i].first,bridge[i].second);
		}
//		for (int j=0;j<n;j++){
//			cout << nodenum[j] << " ";
//		}
//		printf("\n");
	}

	for (int i=0;i<m;i++){
		cout << ans[i] << endl;
	}
//	printf("%.4f\n",ans);
}

Measured memory_bytes: 4480
#include <iostream>
#include <string>
#include <vector>
#include <ios>
#include <iomanip>
#include <stack>
#include <queue>
#include <algorithm>

#define REP(i, n) for(int i = 0;i < n;i++)

using namespace std;

const int INF = 100000000;

int main(){
  int R;
  cin >> R;
  if (R < 1200) {
    cout << "ABC" << endl;
    return 0;
  }
  if (R < 2800) {
    cout << "ARC" << endl;
    return 0;
  }
  cout << "AGC" << endl;
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdlib>
#include<cstring>
#include<stack>
#include<queue>
#include<algorithm>
#include<vector>
#include<math.h>
#include<bitset>
#include<iomanip>
#include<numeric>
using namespace std;

typedef stack<int> IntStack;
typedef queue<int> IntQueue;

const double pi = 3.141592653589793;


//最大公約数
template<class T> T gcd(T a, T b)
{
	while (true)
	{
		T r;
		if (a%b == 0) return b;
		else
		{
			r = a % b;
			a = b;
			b = r;
		}
	}
}
//最小公倍数
template<class T> T lcm(T a, T b)
{
	return a / gcd(a, b)*b;
}
//文字0~9をint型0~9に変換
int char_to_int(char c)
{
	if (c == '0') return 0;
	if (c == '1') return 1;
	if (c == '2') return 2;
	if (c == '3') return 3;
	if (c == '4') return 4;
	if (c == '5') return 5;
	if (c == '6') return 6;
	if (c == '7') return 7;
	if (c == '8') return 8;
	if (c == '9') return 9;
	else return -1;
}
//a^b mod MODを計算
long long int ModPower(long long int a, long long int b, long long int MOD)
{
	if (b == 0) return 1;
	else if (b % 2 == 0)
	{
		long long int d = ModPower(a, b / 2, MOD);
		return (d*d) % MOD;
	}
	else
	{
		return (a*ModPower(a, b - 1, MOD)) % MOD;
	}
}
//nCr mod MODを計算
long long int ModCombi(long long int n, long long int r, long long int MOD)
{
	if (n == 0 || r == 0) return 1;

	long long int Kn = 1, Kr = 1, Knr = 1;

	long long int temp = 1;
	for (long long int i = 1; i <= n; i++)
	{
		temp *= i;
		temp %= MOD;
		if (i == n) Kn = temp;
		if (i == r) Kr = temp;
		if (i == n - r) Knr = temp;
	}

	long long int x = ModPower(Kr, MOD - 2, MOD);
	long long int y = ModPower(Knr, MOD - 2, MOD);

	long long int ans;
	ans = Kn * x;
	ans %= MOD;
	ans *= y;
	ans %= MOD;

	return ans;
}
//int型10進数をord桁のstring型2進数に変換する
string binary(int x, int ord)
{
	int y;
	string ans = "";
	for (int i = 0; i < ord; i++)
	{
		y = x / (int)pow(2, ord - 1 - i);
		y %= 2;
		if (y == 0) ans += "0";
		else ans += "1";
	}

	return ans;
}
//ord桁のstring型2進数をint型10進数に変換する
int rep_binary(string x, int ord)
{
	int res = 0;
	for (int i = 0; i < ord; i++)
	{
		if (x[i] == '1') res += (int)pow(2, ord - 1 - i);
	}
	return res;
}


/*ここまでテンプレ*//*ここまでテンプレ*//*ここまでテンプレ*//*ここまでテンプレ*/



int main()
{
	int a;
	char s[15];
	cin >> a >> s;

	if (a >= 3200) cout << s << endl;
	else cout << "red" << endl;

	return 0;
}


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

int main() {
    char W[16];
    scanf("%s", W);
    char buf[1024];
    int i = 0; // ith char of tword
    char end[1024];
    int count = 0;
    while (true) {
        
        end[i] = '\0';
        if (strcmp(end, "END_OF_TEXT") == 0) {
            break;
        }

        char c = getchar();

        // if c is lowercase
        if (c >= 'a' && c <= 'z') {
            buf[i] = c;
            end[i] = c;
            i++;
        }

        // if c is uppercase
        else if (c >= 'A' && c <= 'Z') {
            buf[i] = c + 'a' - 'A';
            end[i] = c;
            i++;
        }

        // if c is '-' or '_'
        else if (c == '-' || c == '_') {
            buf[i] = c;
            end[i] = c;
            i++;
        }

        else {
            buf[i] = '\0';
            end[i] = '\0';
            i = 0;
            if (strcmp(buf, W) == 0) {
                count++;
            }
        }
    }
    printf("%d\n", count);
    return 0;
}


Measured memory_bytes: 2728
#include <bits/stdc++.h>
using namespace std;
#define M 1000000007
#define ll long long 
#define pb push_back
#define fo(i,N) for(int i = 0 ; i < N ; i++)
#define foo(i,x,N) for (int i = x; i < N ; i++)
#define fill(a,val) memset(a,val,sizeof(a))
#define fastio()  ios_base::sync_with_stdio(false); cin.tie(NULL);
#define endl '\n'
#define ff first
#define ss second
#define MAX 1234567
#define pii pair<int,int> 
#define pll pair<ll,ll> 
#define inf 1e9+1
#define all(a) a.begin(),a.end()

double dp[3000][1501];
vector <double> p(3000);
int n;

double solve(int i,int x)
{
  if ( x == 0)
  return 1;

  if ( i == 0)
  return 0;

  if ( dp[i][x] > -0.9)
  return dp[i][x];


  return dp[i][x] = (p[i]*solve(i-1,x-1)) + ((1-p[i])*solve(i-1,x)); 

}

int main()
{  
   cin >> n;
   foo(i,1,n+1)
   cin >> p[i];

   fill(dp,-1);
   

   cout << fixed << setprecision(10) << solve(n,(n+1)/2) << endl;
}



Measured memory_bytes: 35584
// ALDS1_10_A.cpp
// Dynamic Programming - Fibonacci Number

#include <iostream>
using namespace std;

int fib(int n) {
    if (n == 0 || n == 1)
        return 1;
    int pre = 1;
    int curr = 1;
    int next = 1;
    while (n-- > 1) {
        next = pre + curr;
        pre = curr;
        curr = next;
    }
    return next;
}

int main()
{
    int n;
    cin >> n;
    int res = fib(n);
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 3100
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        n: usize,
        xus: [(f64, String); n]
    }
    let mut answer = 0f64;
    for (x,u) in xus {
        if u == "JPY" {
            answer += x;
        } else if u == "BTC" {
            answer += x * 380000f64;
        }
    }
    println!("{}", answer);
}


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

using namespace std;

const int di[4] = {-1, 0, 1, 0};
const int dj[4] = {0, 1, 0, -1};

int main() {
  int n, m;
  cin >> n >> m;
  int a, b;
  cin >> a >> b;
  --a; --b;
  int c, d;
  cin >> c >> d;
  --c; --d;
  vector<vector<bool>> s(n, vector<bool>(m));
  for (int i = 0; i < n; i++) {
    string foo;
    cin >> foo;
    for (int j = 0; j < m; j++) {
      s[i][j] = (foo[j] == '#');
    }
  }
  vector<vector<int>> dist(n, vector<int>(m, -1));
  dist[a][b] = 0;
  deque<pair<int, int>> que;
  que.emplace_front(a, b);
  while (!que.empty()) {
    auto v = que.front();
    que.pop_front();
    int i = v.first;
    int j = v.second;
    for (int it = 0; it < 4; it++) {
      int ti = i + di[it];
      int tj = j + dj[it];
      if (0 <= ti && ti < n && 0 <= tj && tj < m && (dist[ti][tj] == -1 || dist[i][j] < dist[ti][tj]) && !s[ti][tj]) {
        dist[ti][tj] = dist[i][j];
        que.emplace_front(ti, tj);
      }
    }
    for (int d1 = -2; d1 <= 2; d1++) {
      for (int d2 = -2; d2 <= 2; d2++) {
        int ti = i + d1;
        int tj = j + d2;
        if (0 <= ti && ti < n && 0 <= tj && tj < m && (dist[ti][tj] == -1 || dist[i][j] + 1 < dist[ti][tj]) && !s[ti][tj]) {
          dist[ti][tj] = dist[i][j] + 1;
          que.emplace_back(ti, tj);
        }
      }
    }
  }
  cout << dist[c][d] << '\n';
}


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

int main(){
   int K;
   cin >> K;
   int ans = 0;
   for (int i = 2; i <= K; i+= 2) {
      for (int j = 1; j <= K; j+= 2) {
         ans += 1;
      }
   }
   cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pl;
#define all(a) (a).begin(),(a).end()
#define overload4(_1, _2, _3, _4, name, ...) name
#define rep1(n) for(ll i = 0;i < (n);i++)
#define rep2(i,n) for(ll i = 0;i < (n);i++)
#define rep3(i,a,b) for(ll i = (a);i < (b);i++)
#define rep4(i,a,b,c) for(ll i = (a);i < (b);i += (c))
#define rep(...) overload4(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__)
#define rrep1(n) for(ll i = (n)-1;i >= 0;i--)
#define rrep2(i,n) for(ll i = (n)-1;i >= 0;i--)
#define rrep3(i,a,b) for(ll i = (a)-1;i >= (b);i--)
#define rrep4(i,a,b,c) for(ll i = (a)-1;i >= (b);i -= (c))
#define rrep(...) overload4(__VA_ARGS__, rrep4, rrep3, rrep2, rrep1)(__VA_ARGS__)
#define SHOW(x) cout << #x << ": " << x << endl;
template<class T> ll sumArr(const T& a){ return accumulate(all(a), 0LL);}
template<class T> auto minArr(const T& a){ return *min_element(all(a));}
template<class T> auto maxArr(const T& a){ return *max_element(all(a));}
template<class T> void DEBUG_PRINT(T tmp){cout<<tmp<<endl;}
template<class T1,class... T2> void DEBUG_PRINT(T1 tmp,T2... tmp2){cout<<tmp<<" ";DEBUG_PRINT(tmp2...);}
ll gcd(ll a, ll b){ while(b){ ll c = b; b = a % b; a = c; } return a; }
ll lcm(ll a, ll b){ if(!a || !b) return 0; return a / gcd(a, b) * b; }
const ll INF=1e18,MOD = 1e9+7;
const int iINF = 1e9;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    ll n,k,tmp = 0,ans = 0;
    string s;
    char ch;
    vector<ll>sum_p;
    cin>>n>>k;
    cin>>s;
    ch = s[0];
    rep(i,n - 1)if(s[i] == s[i + 1])ans++;
    rep(i,n){
        if(s[i] != ch){
            sum_p.push_back(tmp);
            tmp = 1;
            ch = s[i];
        }
        else{
            tmp++;
        }
    }
    sum_p.push_back(tmp);
    ll cnt2,cnt1;
    if(sum_p.size() % 2 == 0){
        cnt2 = sum_p.size()/2 - 1;
        cnt1 = 1;
    }
    else{
        cnt2 = sum_p.size()/2;
        cnt1 = 0;
    }
    if(k >= cnt2 + cnt1)ans += cnt2 * 2 + cnt1;
    else ans += k * 2;
    cout<<ans<<endl;
}

Measured memory_bytes: 1480
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using static System.Console;
using static System.Math;

namespace CP
{
    class Atria
    {
        static void Main(string[] args)
        {
            int[] s = ReadLine().Split(' ').Select(int.Parse).ToArray();
            int n = s[0];
            int k = s[1];
            long[] hs = ReadLine().Split(' ').Select(long.Parse).ToArray();
            long ans = 0;
            Array.Sort(hs);
            Array.Reverse(hs);
            for (int i = 0; i < n; i++)
            {
                if (k > 0)
                {
                    k--;
                }
                else
                {
                    ans += hs[i];
                }
            }
            WriteLine(ans);
        }
    }
}

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

int main(){
  int a, b;
  int a_b=0, b_a=0;
  cin >> a >> b;
  for(int i=0;i<b;i++){
    a_b *= 10;
    a_b += a;
  }
  for(int i=0;i<a;i++){
    b_a *= 10;
    b_a += b;
  }
  
  if(a>b)cout << b_a;
  else cout << a_b;
  return 0;
}


Measured memory_bytes: 256
n,m=map(int,input().split())

lists=[[] for _ in range(m+1)]
#lists[i]=i日後にお金を得られる時

for _ in range(n):
    a,b=map(int,input().split())
    #a日後に報酬ｂである
    if 1<=a<=m:
        lists[a].append(b)
    else:
        pass
    
import heapq


heap=[]
heapq.heapify(heap)

ans=0

for i in range(1,m+1):
    for some in lists[i]:
        #i日後にお金を手に入れられる
        heapq.heappush(heap,-some)
    if heap:
        x=heapq.heappop(heap)
        x=x*(-1)
        ans+=x
        
print(ans)

Measured memory_bytes: 18968
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main()
{
  ll h, n;
  cin >> h >> n;
  rep(i, n) {
    ll x;
    cin >> x;
    h -= x;
  }
  if (h > 0) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
  }
  return 0;
}

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

using namespace std;

#define INF 1000000007
#define LINF (1LL << 62)
#define PI 3.14159265358979

typedef long long i64;
typedef pair<i64,i64> P;

inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }

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; }



string s;
int k;
void solve(){
	cin >> k >> s;
	int n = s.size();
	
	if(n <= k) cout << s << endl;
	else cout << s.substr(0,k) << "..." << endl;
}

int main(){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	int t = 1;
	//cin >> t;
	while(t--){
		solve();
	}
	
	return 0;
}

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

int main()
{
    long long a,b,c,k;
    cin>>a>>b>>c>>k;
    long long ans=0;
    if(k <= a){
        cout<<k<<endl;
    }
    else if(k  > a and k <= a+b){
        cout<<a<<endl;
    }
    else{
        ans = a;
        k -= a;
        k -= b;
        ans = a - k;
        cout<<ans<<endl;
    }
}


Measured memory_bytes: 3672
A,B,N = [int(v) for v in input().split()]

def calc(a,b,x):
    return int(((a*x)/B)) - a * int(x/b)

def lcm(a,b):
    if a < b:a,b = b,a
    while a%b != 0:
        a,b = b,a%b
    return b

if B <= N+1:
    print(calc(A,B,B-1))
else:
    print(calc(A,B,N))


Measured memory_bytes: 9140
n, m, x = map(int, input().split())
sL = [0]*m
bL = []
for i in range(n):
    book = list(map(int, input().split()))
    bL.append(book)


def fullS(currentL, index, allP):
    if index >= len(bL):
        if min(currentL) >= x:
            return allP
        else:
            return -1
    else:
        if min(currentL) >= x:
            return allP
        else:
            op1 = fullS(currentL, index+1, allP)
            newP = 0
            newL = []
            for i in range(len(bL[index])):
                if i == 0:
                    newP = allP+bL[index][i]
                else:
                    newL.append(currentL[i-1]+bL[index][i])
            op2 = fullS(newL, index+1, newP)
            if op1 == -1 and op2 == -1:
                return -1
            elif op1 == -1:
                return op2
            elif op2 == -1:
                return op1
            else:
                return min(op1, op2)
                


print(fullS(sL, 0, 0))

Measured memory_bytes: 9084
import java.util.*;
class Main{
    public static void main(String args[]) {
        Scanner scanner = new Scanner(System.in);
        int string = scanner.nextInt();
        if (string <= 9) {
            int a = string;
            string = scanner.nextInt();
            if (string <= 9) {
                int b = string;
                int c = a * b;
                System.out.println(c);

            }
            else{
                System.out.println("-1");
            }
        }
        else {
            System.out.println("-1");
        }
    }
}

Measured memory_bytes: 23892
/**
 Author:mohanr
**/
#include<bits/stdc++.h>
using namespace std;
#define fastinput() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define endl "\n"
#define all(c) c.begin(),c.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define repi(i,a,b) for(int i=a;i<=b;i++)
#define repd(i,n) for(int i=n-1;i>=0;i--)
#define repdi(i,a,b) for(int i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define X first
#define Y second
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
const ll INF=1e18;
const int inf=1e9;
const int mod=1e9+7;
ll powmod(ll a,ll b){
 ll res=1;
 a%=mod;
 for(;b;b>>=1){
  if(b&1) res=res*a%mod;
  a=a*a%mod;
 }
 return res;
}
ll invmod(ll a){
 return powmod(a,mod-2);
}
int main(){
 fastinput();
 ll n;
 cin>>n;
 ll a,b;
 cin>>a>>b;
 ll mi=(a+b>n?a+b-n:0);
 ll ma=min(a,b);
 cout<<ma<<" "<<mi<<endl;
 return 0;
}

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

using namespace std;

int main(){
    string s;
    cin >> s;
    for(int i = 0; i < s.size() - 1; i++){
        if(s[i] == s[i + 1]){
            cout << "Bad" << endl;
            return 0;
        }
    }
    cout << "Good" << endl;
    return 0;
}

Measured memory_bytes: 256
/// sultanov

#include<bits/stdc++.h>
     
#define x first
#define y second
#define pb push_back
#define sz(x) (int) x.size()
 
using namespace std;

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

const int N = 2e5 + 1e2;
const int MOD = 1e9 + 7;
const int INF32 = 1e9 + 1e2;

ll h[N], c[N], dp[N], t[N]; 

void modify(int pos, ll x) {
    for (; pos < N; pos |= pos + 1)
        t[pos] = max(t[pos], x);
}

ll get(int pos) {
    ll res = 0;
    for (; pos >= 0; pos = (pos & (pos + 1)) - 1)
        res = max(res, t[pos]);
    return res;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i) 
        cin >> h[i];
    for (int i = 0; i < n; ++i)
        cin >> c[i];
    ll ans = 0;
    for (int i = 0; i < n; ++i) {
        dp[i] = get(h[i] - 1) + c[i];
        modify(h[i], dp[i]);
        ans = max(ans, dp[i]);
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 6528
import math

#グラフの作成   
def make_list(V,E):
 
    edges = []
    path=[[float("inf")]*E for i in range(V) ]   #ルート作成に必要になる
    
    for i in range(V):
        a=[int(x) for x in str(input()).split()]
        for j in range(len(a)):
            #print("j",j)
            path[i][j]=i
           # if j!= i and a[j]==0:
                #a[j]=2000
                #path[i][j]=-2000
	
        edges.append((a))    #  有効辺グラフ
	

   
     
    return edges ,path


#フロイド・ワーシャル
def warshall_floyd(glath,path):
	
	for k in range(len(glath)):
		for i in range(len(glath)):
			for j in range(len(glath[i])):
				if glath[i][j] > glath[i][k] + glath[k][j]:
                                   glath[i][j] = glath[i][k] + glath[k][j]
                                   path[i][j] = path[k][j]
				#glath[i][j]= min(int(glath[i][j]),int(glath[i][k])+int(glath[k][j]))
				
	return glath,path





H, W = [int(x) for x in str(input()).split()]  #グラフの大きさ 

cost_graph,graph=make_list(10,10)
wall ,wall_graph= make_list(H,W)
    #print(cost_graph)

un_label=[]
for i in wall:
   for j in i: 
            if j !=-1 and j!=1:
                 un_label.append(j)
cost=0
 
all_cost,all_graph=warshall_floyd(cost_graph,graph)
    
   

for i in un_label:
        cost+=all_cost[i][1]

print(cost)

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

using namespace std;

#define ll long long
#define ull unsigned long long
#define PI acos(-1.0)
#define eps 1e-12
#define fi first
#define se second
#define MEM(a,b) memset((a),(b),sizeof(a))
#define mod(x) ((x)%MOD)
#define pii pair<int,int>
#define wz cout<<"-----"<<endl;
const int INF_INT = 2147483647;
const ll INF_LL = 9223372036854775807LL;
const ull INF_ULL = 18446744073709551615Ull;
const ll P = 92540646808111039LL;

const ll maxn = 1e5 + 10, MOD = 1e9 + 7;
const int Move[4][2] = {-1,0,1,0,0,1,0,-1};
const int Move_[8][2] = {-1,-1,-1,0,-1,1,0,-1,0,1,1,-1,1,0,1,1};

inline int read(){
    int x=0,f=1;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();}
    return x*f;
}


void init() {

}



int main(){
//    freopen("C:\\Users\\Administrator\\Desktop\\in.txt","r",stdin);
//    freopen("C:\\Users\\Administrator\\Desktop\\out.txt","w",stdout);
//    ios_base::sync_with_stdio(0);
    init();
    int n,a,b; cin >>n >> a >>b;
    int aa = min(a, b);
    int bb = a + b - n;
    cout << aa << ' ';
    if (bb > 0) cout << bb;
    else cout <<0;
    cout << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner x = new Scanner(System.in);
		int h = x.nextInt();
		int w = x.nextInt();
		
		StringBuilder sb1 = new StringBuilder("");
		
		while(h != 0 || w != 0 ){
				for(int i = 0 ; i < h ; i++){

			for(int n = 0 ; n < w ; n++){
				sb1.append("#");
			}
			sb1.append("\n");
		}
		sb1.append("\n");
		 h = x.nextInt();
		 w = x.nextInt();
		}
		
		System.out.print(sb1);
		
		
		
	}

}

Measured memory_bytes: 20720
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <complex>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <cstring>

#define REP(i,x) for(int i=0 ; i<(int)(x) ; i++)
#define ALL(x) (x).begin(),(x).end()
#define LL long long

using namespace std;

struct BIT{
    int N;
    vector<LL> data;
    BIT(int N){
        this->N = N;
        data.assign(N+1, 0);
    }
    void add(int i, LL v){
        while(i<=N){
            data[i] += v;
            i += i&-i;
        }
    }
    LL sum(int i){
        LL res = 0;
        while(i>0){
            res += data[i];
            i -= i&-i;
        }
        return res;
    }
};


int main(){
    int N, K;
    cin >> N >> K;
    vector<int> A(N);
    REP(i, N)cin >> A[i];

    vector<LL> B(N+1);
    REP(i, N){
        B[i+1] = B[i] + A[i] - K;
    }
    sort(ALL(B));
    BIT bit(N+1);
    LL res = 0;
    LL thres = 0;
    REP(i, N+1){
        int p = lower_bound(ALL(B), thres) - B.begin() + 1;
        res += bit.sum(p);
        bit.add(p, 1);
        thres += A[i] - K;
    }
    cout << res << endl;

    return 0;
}


Measured memory_bytes: 4224
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i=0; i<(int)(n); i++)
#define FOR(i, r, n) for (int i=(int)(r); i<=(int)(n); i++)
#define all(v) v.begin(), v.end()
#define INF 2147483647
#define INF64 9223372036854775807
#define MOD 1000000007

int main(){

    int x; cin>>x;
    cout << 10-x/200 << endl;

}

Measured memory_bytes: 3620
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll x(string s){
    ll sum=0,tmp=0;
    for(int i=0;i<s.size();i++){
        if(s[i]=='+'){
            sum+=tmp;
            tmp=0;
        }else{
            tmp=tmp*10+s[i]-'0';
        }
    }
    return sum+tmp;
}
int main()
{
        string s;
        cin>>s;
        int len=s.size()-1,a[100]={0};
        ll sum=0;
        while(1){
            string ss;
            for(int i=0;i<len;i++){
                a[i+1]+=a[i]/2;
                a[i]%=2;
            }
            if(a[len]){
                break;
            }
            for(int i=0;i<len;i++){
                ss+=s[i];
                if(a[i]){
                    ss+="+";
                }
            }
            ss+=s[len];
            sum+=x(ss);
            a[0]++;
        }
        cout<<sum<<endl;
        return 0;
}


Measured memory_bytes: 256
import java.util.*;
 
public class Main {
 
  public static void main(String args[]) {
   
    Scanner sc = new Scanner(System.in);
    int cases = sc.nextInt();
    int passed = sc.nextInt();
    
    if ((cases - passed) == 0) {
    	System.out.println("Yes");
    } else {
          System.out.println("No");
    }
 
   
 
    
  }
}

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

int main()
{
	int N;
	double Y = 0.0;
	double x[10] = { 0.0 };
	string u[10];

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

	for (int i = 0; i < 10; i++)
	{
		if (u[i] == "JPY")
		{
			x[i] = (int)x[i];
			Y += x[i];
		}
		else
		{
			Y += x[i] * 380000.0;
		}
	}

	cout << Y << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <array>
#include <algorithm>
#include <vector>
#include <bitset>
#include <set>
#include <unordered_set>
#include <cmath>
#include <complex>
#include <deque>
#include <iterator>
#include <numeric>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
#include <functional>
#include <cassert>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define rep(i, k, n) for (ll i=k; i<(ll)n; ++i)
#define REP(i, n) rep(i, 0, n)
#define ALL(v) v.begin(),v.end()
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; }
#define DEBUG_VLL(vec) REP(sz, vec.size()) std::cerr<<vec[sz]<<(sz==vec.size()-1?'\n':' ');

const long long MOD = 1000000007;
const long long HIGHINF = (long long)1e18;
const int INF = (int)1e9;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a; cin >> a;
    cout << a + a * a + a * a * a << '\n';
    return 0;
}


Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
// d: 現在のケタ数
// val: 現在の値
// all: ここに格納していく (参照型にしておく)
void rec(int d, long long val, vector<long long> &all) {
  
  // 格納
  all.push_back(val);

  // 10 桁だったらそれ以上やらずに打ち切り
  if (d == 10) return;

  // 次の桁へ進む処理
  for(int i = -1; i < 2; i++) {
    int add = (val % 10) + i;
    if(add != -1 && add != 10) rec(d + 1, val * 10 + add, all);
  }
} 

int main() {
  int K; cin >> K;
  vector<long long> all(0);
  for(int i = 1; i < 10; i++) {
   rec(1, i, all);
  }
  sort(all.begin(), all.end());
  cout << all.at(K - 1) << endl;
}

Measured memory_bytes: 2420
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#include <set>
#include <stack>
#include <vector>
typedef long long ll;
typedef unsigned long long ull;
typedef long double LD;
using namespace std;
const int INF = 2147483647;
const int INF2 = 0x3f3f3f3f;
const ll INF64 = 1e18;
const double INFD = 1e30;
const double EPS = 1e-9;
const double PI = acos(-1);
const int MOD = 998244353;
template <typename T>
inline T read() {
    T X = 0, w = 0;
    char ch = 0;
    while (!isdigit(ch)) {
        w |= ch == '-';
        ch = getchar();
    }
    while (isdigit(ch)) X = (X << 3) + (X << 1) + (ch ^ 48), ch = getchar();
    return w ? -X : X;
}
const int MAXN = 2005;
int n, m, k;
int dr[4] = {1, 0, -1, 0};
int dc[4] = {0, 1, 0, -1};
int dr2[8] = {1, 1, 1, -1, -1, -1, 0, 0};
int dc2[8] = {1, 0, -1, 1, 0, -1, 1, -1};
int CASE = 1;
int main() {
#ifdef LOCALLL
    freopen("in", "r", stdin);
    freopen("out", "w", stdout);
#endif
    int n;
    cin >> n;
    cout << (n / 500 * 1000) + (n % 500) / 5 * 5 << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll t,n,k,a,b,c,p,q,r,s,x,y,z;
    cin>>a>>b>>c>>x>>y;
    s=x*a+y*b;
    if(x<y)
    {
        p=(x+x)*c+(y-x)*b;
        t=min(s,p);
        z=(y+y)*c;
        k=min(t,z);
    }
    else if(x>y)
    {
        q=(y+y)*c+(x-y)*a;
        t=min(s,q);
        z=(x+x)*c;
        k=min(t,z);
    }
    else if(x==y)
    {
        r=(x+x)*c;
        k=min(s,r);
    }
    cout<<k<<endl;
    return 0;
}


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

int H,W;
int dx[] = {-1,1,0,0},dy[] = {0,0,-1,1};
int v[110][110] = {{0}};
char G[110][110];

bool in(int x, int y){
	return 0<=x && x<=W && 0<=y && y<=H;
}
void dfs(int n,int m){
	v[n][m] = 1;
	char s = G[n][m];
	//cout << s << endl;
	for(int i=0;i<4;i++){
		int x = n+dx[i],y = m+dy[i];
		if(in(x,y) && v[x][y]!=1 && G[x][y]==s) dfs(x,y);
	}
}

int main(){
	while(cin >> H >> W && H>0){
		for(int i=0;i<H;i++){
			for(int j=0;j<W;j++){
				cin >> G[i][j];
			}
		}
		int ans = 0;
		for(int i=0;i<H;i++){
			for(int j=0;j<W;j++){
				if(v[i][j]!=1){
					dfs(i,j);
					ans++;
				}
			}
		}
		cout << ans << endl;
		for(int i=0;i<110;i++){
			for(int j=0;j<110;j++){
				v[i][j] = 0;
			}
		}
	}
}


Measured memory_bytes: 3568
#include <iostream>
#include <string>
using namespace std;
int main(int argc, char* argv[])
{
	int N;
	string S,T;
	cin>>N;
	cin>>S;
	cin>>T;
	string ST;
	for (int i=0;i<N;i++){
		ST+=S[i];
		ST+=T[i];
	}
	cout<<ST<<endl;
	return 0;
}

Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

////////////////////////////////////////
///        templates                 ///
////////////////////////////////////////

var sc = bufio.NewScanner(os.Stdin)

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

var rdr = bufio.NewReaderSize(os.Stdin, 1000000)

func readBigLine() string {
	buf := make([]byte, 0, 1000000)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func strSprit(str string) []string {
	cols := strings.Split(str, " ")
	return cols
}

func parseInt(str string) int {
	n, _ := strconv.Atoi(str)
	return n
}

func intSprit(str string) []int {
	strs := strSprit(str)
	cols := make([]int, len(strs))
	for i, v := range strs {
		cols[i] = parseInt(v)
	}
	return cols
}

////////////////////////////////////////
///        end templates             ///
////////////////////////////////////////

func main() {
	line := nextLine()

	n := parseInt(line)

	var t, b int
	t, n, b = n/100, n%100/10, n%10

	if t != n || t != b {
		if t < n || t < b {
			t++
		}
	}

	fmt.Println(t*100 + t*10 + t)
}


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

using namespace std;

int main(){
	int n;
	cin >> n;
	vector<int> a(n);
	vector<int> b(n);
	int c[10000] = {0};
	for(int i=0;i<n;++i){
		cin >> a[i];
	}
	for(int i=0;i<n;++i){
		c[a[i]]++;
	}
	for(int i=1;i<10000;++i){
		c[i] = c[i] + c[i-1];
	}
	for(int j=n-1;j>=0;--j){
		b[c[a[j]]-1] = a[j];
		c[a[j]]--;
	}
	for(int i=0;i<n;++i){
		cout << b[i];
		if(i!=n-1)cout << " ";
		else cout << "\n";
	}
}


Measured memory_bytes: 18296
S=input()
if S=="RRR":
    print(3)
elif S=="RRS" or S=="SRR":
    print(2)
elif S=="SSS":
    print(0)
else:
    print(1)





        




    









        

    









    

        




    















    



    





    






        






    
















        


























            
    


    


    
    














    


    














Measured memory_bytes: 9008
def func(n):
    if n % 2 == 0:
        return n // 2
    else:
        return 3 * n + 1
s = int(input())
a = []
a.append(s)
for i in range(2,1000001):
    a.append(func(a[i - 2]))
    for j in range(len(a) - 2):
        if a[j] == a[i - 1]:
            print(i)
            exit()


Measured memory_bytes: 3060
#include <bits/stdc++.h>
typedef long long ll;
#define MOD 1000000007

using namespace std;

int main(){
    ll X,Y,A,B,C;
    cin >> X >> Y >> A >> B >> C;
    vector<ll> p,q,r,s;
    for (int i = 0; i < A; i++)
    {
        ll a; cin >> a;
        p.push_back(a);
    }
    for (int i = 0; i < B; i++)
    {
        ll a; cin >> a;
        q.push_back(a);
    }
    for (int i = 0; i < C; i++)
    {
        ll a; cin >> a;
        r.push_back(a);
    }
    sort(p.begin(),p.end(),greater<ll>());
    sort(q.begin(),q.end(),greater<ll>());
    sort(r.begin(),r.end(),greater<ll>());

    for (int i = 0; i < X; i++)
    {
        s.push_back(p[i]);
    }
    for (int i = 0; i < Y; i++)
    {
        s.push_back(q[i]);
    }
    sort(s.begin(),s.end());
    int i = 0;
    for (int i = 0; i < min(X+Y,C); i++)
    {
        if(s[i] < r[i]) s[i] = r[i];
    }
    ll ans = 0;
    for (int i = 0; i < X+Y; i++)
    {
        ans += s[i];
    }
    cout << ans << endl;
    
}

Measured memory_bytes: 4724