akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;
using ll = long long;

#define all(c) (c).begin(), (c).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second

const ll INF = 1e18;
const ll MOD = 1e9 + 7;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

template <typename T>
inline size_t hashCombine(size_t seed, const T& v) {
    return seed ^ (hash<T>()(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2));
}

namespace std {
template <typename T, typename S>
class hash<pair<T, S>> {
 public:
    size_t operator()(const pair<T, S>& p) const {
        size_t seed = 0;
        seed = hashCombine(seed, p.first);
        seed = hashCombine(seed, p.second);
        return seed;
    }
};
template <typename... Ts>
class hash<tuple<Ts...>> {
 public:
    size_t operator()(const tuple<Ts...>& t) const { return impl<0>(t); }

 private:
    template <size_t Index>
    typename enable_if<Index == tuple_size<tuple<Ts...>>::value, size_t>::type
    impl(const tuple<Ts...>&) const {
        return 0;
    }
    template <size_t Index>
    typename enable_if<Index != tuple_size<tuple<Ts...>>::value, size_t>::type
    impl(const tuple<Ts...>& t) const {
        return hashCombine(impl<Index + 1>(t), get<Index>(t));
    }
};
}

int n, m;
int a, b, c;
int v0;
struct Edge {
    int to, t;
    Edge(int to = 0, int t = 0) : to(to), t(t) {}
};
int update(int v) { return (a * v + b) % c; }
vector<Edge> G[502];
using State = tuple<int, int, int>;
unordered_map<State, ll> dp;
priority_queue<pair<ll, State>> que;

int main() {
    cin >> n >> m;
    rep(i, m) {
        int x, y, t;
        cin >> x >> y >> t;
        G[x].push_back(Edge(y, t));
        G[y].push_back(Edge(x, t));
    }
    cin >> v0;
    cin >> a >> b >> c;
    auto initState = State(1, v0, 0);
    dp[initState] = 0;
    que.push(make_pair(0, initState));

    while (que.size()) {
        auto p = que.top();
        que.pop();
        auto nowCost = p.first;
        auto nowState = p.second;
        auto v = get<0>(nowState);
        auto v1 = get<1>(nowState);
        auto s = get<2>(nowState);
        auto v2 = update(v1);
        if (dp[nowState] < -nowCost) continue;
        // printf("%d %d %d %d\n", v, v1, s, dp[nowState]);

        if (s == 0 && v == n) s = 1;
        rep(i, G[v].size()) {
            auto e = G[v][i];
            ll cost = 1LL * e.t * v1;
            auto nextState = State(e.to, v2, s);
            if (dp.count(nextState) == 0 ||
                dp[nowState] + cost < dp[nextState]) {
                dp[nextState] = dp[nowState] + cost;
                que.push(make_pair(-dp[nextState], nextState));
            }
        }
    }

    ll ans = INF;
    rep(i, 50) {
        auto s = State(1, i, 1);
        if (dp.count(s)) ans = min(ans, dp[s]);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 9476
#include <iostream>
using namespace std;
int n;
int m;
int l[1000000];
int r[1000000];
int inf=1000000;
int sup=0;
int main(){
    cin >> n >> m;
    for(int i=0;i<m;i++){
        cin >> l[i] >> r[i];
    }
    for(int i=0;i<m;i++){
        if(inf > r[i]){
            inf = r[i];
        }
        if(sup < l[i]){
            sup = l[i];
        }
    }
    int ans = inf - sup;
    if(ans < 0){
        ans = 0;
    }
    else{
        ans += 1;
    }
    cout << ans << endl;
}

Measured memory_bytes: 4736
// warm heart, wagging tail,and a smile just for you!
//                                                                     ███████████
//                                                                   ███╬╬╬╬╬╬╬╬╬╬███
//                                                                ███╬╬╬╬╬████╬╬╬╬╬╬███
//                                            ███████████       ██╬╬╬╬╬████╬╬████╬╬╬╬╬██
//                                      █████████╬╬╬╬╬████████████╬╬╬╬╬██╬╬╬╬╬╬███╬╬╬╬╬██
//                               ████████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████████╬╬╬╬╬╬██╬╬╬╬╬╬╬██
//                             ████╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████████╬╬╬╬╬╬╬╬╬╬╬██
//                           ███╬╬╬█╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬███╬╬╬╬╬╬╬█████
//                         ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬████████╬╬╬╬╬██
//                       ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬╬╬╬╬███
//                     ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬██
//                 ████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████╬╬╬╬╬████
//     █████████████╬╬╬╬╬╬╬╬██╬╬╬╬╬████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬██████
//   ████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬██████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██████╬╬╬╬╬╬╬███████████╬╬╬╬╬╬╬╬██╬╬╬██╬╬╬██
// ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████╬╬╬╬╬╬╬╬╬╬╬█╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬██
// ██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬▓▓▓▓▓▓╬╬╬████╬╬████╬╬╬╬╬╬╬▓▓▓▓▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬███
// ██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██████▓▓▓▓▓▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓▓▓▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬█████
// ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████████
//   ███╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██
//       ██████████████  ████╬╬╬╬╬╬███████████████████████████╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████
//                         ███████                           █████  ███████████████████  
//
#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define INF (1LL<<60)
#define fs first
#define sc second
#define int long long
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define RFOR(i,a,b) for(int i = (b-1);i>=(a);--i)
#define REP(i,n)  FOR(i,0,(n))
#define RREP(i,n) RFOR(i,0,(n))
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define RITR(itr,mp) for(auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x)  cout << #x << " = " << (x) << endl;
#define SP << " " << 
#define MSB(x) (63-__builtin_clzll(x))
#define pcnt(x) (__builtin_popcountll(x))
typedef pair<int,int> P;
typedef vector<int> vec;
typedef vector<vector<int>> mat;

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

  int n;
  string s;
  cin >> n >> s;

  set<string> st[3];
  REP(i,n){
    RREP(j,2){
      ITR(itr,st[j]){
        st[j+1].insert(*itr+s[i]);
      }
    }
    string t = s.substr(i,1);
    st[0].insert(t);
  }

  cout << st[2].size() << endl;

  return 0;
}

Measured memory_bytes: 384
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main()
{
    long long int a, b, n, v, i, max, tmp;
    scanf("%lld %lld %lld", &a, &b, &n);
    max=0;
    if (n<b) {
        max=floor(a*n/b);
    }
    else {
        max=floor(a*(b-1)/b);

    }
    printf("%lld\n", max);
    return 0;
}

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

int main(){
  int n;
  string s;
  cin >> s;
  n = s.size();
  vector<int> ans(n);
  
  rep(k,2){
    int cnt = 0;
  	rep(i,n){
      if(s[i] == 'R') cnt++;
      else {
        ans[i] += cnt/2;
        ans[i-1] += (cnt+1)/2;
        cnt = 0;
      }
    }
    
    reverse(s.begin(), s.end());
    reverse(ans.begin(), ans.end());
    
    rep(i,n){
      if(s[i] == 'R') s[i] = 'L';
      else s[i] = 'R';
    }
  }
  
  rep(i, n) cout << ans[i] << " ";
  return 0;
}

Measured memory_bytes: 1024
#include<algorithm>
#include<iostream>
#include<vector>
#include<string>
#include<map>
#include<stack>
#include<queue>
#include<iomanip>
#include<set>
#include<bitset>
#include <cstdio>
#include <cmath>

using namespace std;

typedef long long ll;
#define put(n) cout<<(n)<<"\n"
#define FOR(i,num,N) for(int(i)=(num);(i)<(N);++(i))
#define RFOR(i,num,N) for(int (i)=(num);(i)>(N);--(i))
#define all(v) (v).begin() , (v).end()
#define rall(v) (v).rbegin() , (v).rend()

int main(){
    int X;
    cin>>X;
    switch(X%7){
        case 0 : cout<<"thu\n"; break;
        case 1 : cout<<"fri\n"; break;
        case 2 : cout<<"sat\n"; break;
        case 3 : cout<<"sun\n"; break;
        case 4 : cout<<"mon\n"; break;
        case 5 : cout<<"tue\n"; break;
        case 6 : cout<<"wed\n"; break;
    }
}


Measured memory_bytes: 3068
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int N;
  cin>>N;
  
  
  vector<double> x(N);
  vector<string> u(N);
  
  
  double sum=0;
 
  for(int i=0; i<N;i++){
    cin>>x.at(i)>>u.at(i);
   if(u.at(i)=="JPY"){
     sum+=x.at(i);
     
  }
    else{
     double a=x.at(i)*380000;
      sum+=a;
    }
  }
  cout<<sum<<endl;
}
    
      
      
  


Measured memory_bytes: 256
H,W,K=gets.chomp.split.map(&:to_i)
c=[]
H.times do |h|
  c[h]=gets.chomp.split('')
end

ans = 0
[0,1].repeated_permutation(H) do |harr|
  [0,1].repeated_permutation(W) do |warr|
    cc = Marshal.load(Marshal.dump(c))
    H.times do |h|
      next if harr[h].zero?

      W.times do |w|
        cc[h][w] = '.'
      end
    end

    W.times do |w|
      next if warr[w].zero?

      H.times do |h|
        cc[h][w] = '.'
      end
    end

    count = 0
    H.times do |h|
      W.times do |w|
        count += 1 if cc[h][w] == '#'
      end
    end

    ans += 1 if count == K
  end
end
p ans


Measured memory_bytes: 14188
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define rep(i,n) for(int i=0;i<n;i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define all(v) v.bigin(),v.end()
#define MAX(a,b) a=a>b?a:b
#define MIN(a,b) a=a<b?a:b
#define R(a) a=sqrt(a)
#define POW(a,b) a=pow(a,b)
#define FAST ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int main(){
    FAST;
    ll n,P,Q;
    ll ans=0;
    cin>>n;
    ll p[n];
    ll q[n];
    ll l=1;
    string s[2];
    rep(i,n){
        cin>>p[n];
        s[0]+=p[n];
    }
    rep(i,n){
        cin>>q[n];
        s[1]+=q[n];
    }
    sort(s,s+2);
    while(s[0]<s[1]){
        next_permutation(s[0].begin(),s[0].end());
        ans++;
    }


    cout<<ans;
    
}



Measured memory_bytes: 3668
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <functional>

using namespace std;
 
#define mod 1000000007
#define FOR(x,to) for(int x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define long long long
inline int rei(){int x;cin>>x;return x;}
inline long rel(){long x;cin>>x;return x;}
inline string res(){string x;cin>>x;return x;}
//------------------------------------------------------- 
struct Fact{
	vector<long> f;
	vector<long> rf;
	long pow(long N,long K){
		if(K == 0){
			return 1;
		}
		else if(K % 2 == 0){
			long t = pow(N,K/2);
			return t*t%mod;
		}
		else{
			return N*pow(N,K-1)%mod;
		}
	}
	Fact(int N):f(N+1),rf(N+1){
		for(int i=0;i<N+1;i++){
			if(i == 0){
				f[i] = 1;
			}
			else{
				f[i] = (f[i-1]*i)%mod;
			}
		}
		for(int i=N;i>=0;i--){
			if(i == N){
				rf[i] = pow(f[N],mod-2);
			}
			else{
				rf[i] = rf[i+1]*(i+1)%mod;
			}
		}
	}
	long GetFact(int N){
		return f[N];
	}
	long GetPerm(int N,int R){
		return f[N] * rf[N-R] % mod;
	}
	long GetConv(int N,int R){
		return ((f[N]*rf[R])%mod*rf[N-R])%mod;
	}
	long GetRev(int N){
		if(N == 0){
			return 1;
		}
		else{
			return rf[N] * f[N-1] % mod;
		}
	}
};
void Calc(){
	int N = rei();
	int K = rei();
	Fact F(N+30);
	for(int i=1;i<=K;i++){
		long ans = 0;
		for(int j=i-1;j<=i+1;j++){
			long d = 1;
			if(j == i){
				d = 2;
			}
			if(j == 0){
				if(N-K == 0){
					
				}
				else{
					d = 0;
				}
			}
			else if(N-K >= j){
				d *= F.GetConv(N-K-1,j-1);
				d %= mod;
			}
			else{
				d = 0;
			}
			ans += d;
		}
		ans %= mod;
		ans *= F.GetConv(K-1,i-1);
		ans %= mod;
		cout << ans << "\n";
	}
}
int main(int argc,char** argv){
	ios::sync_with_stdio(false), cin.tie(0);
	cout.tie(0); Calc(); return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(k,i,n) for(ll i=k;i<n;++i)
int main(void){
    // Your code here!
    ll n,k,c;
    cin>>n>>k>>c;
    string s;
    cin>>s;
    ll l[k],r[k];
    rep(0,i,k){
        l[i]=-1;
        r[i]=-1;
    }
    ll cl=0,cr=0;
    rep(0,i,n){
        string s0=s.substr(i,1);
        if(cl==0){
            if(s0=="o"){
                l[cl]=i;
                ++cl;
            }
        }else{
            if(cl>=k)break;
            if(l[cl-1]+c<i && s0=="o"){
                l[cl]=i;
                ++cl;
            }
        }
        //cout<<s0<<endl;
        //cout<<l[cl-1]<<endl;
    }
    rep(0,i,n){
        string s0=s.substr(n-1-i,1);
        ll x=n-1-i;
        ll ccr=k-1-cr;
        if(cr==0){
            if(s0=="o"){
                r[ccr]=x;
            //cout<<l[ccr]<<endl;
                ++cr;
            }
        }else{
            if(cr>=k)break;
            if(r[ccr+1]-c>x && s0=="o"){
                r[ccr]=x;
        //cout<<l[ccr]<<endl;
                ++cr;
            }
        }
        //cout<<l[ccr]<<endl;
    }
    rep(0,i,k){
        if(r[i]!=-1 && l[i]!=-1 && r[i]==l[i]){
            cout<<r[i]+1<<endl;
        }
    }
}


Measured memory_bytes: 4996
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
#include <numeric> 
using namespace std; 
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define FORD(i,a,b) for(int i=(a);i>=(b);i--)
inline bool EQ(double a, double b) { return fabs(a-b) < 1e-9; }
const int INF = 1e9 + 5;
typedef long long ll;
inline int two(int n) { return 1 << n; }
inline int test(int n, int b) { return (n>>b)&1; }
inline void set_bit(int & n, int b) { n |= two(b); }
inline void unset_bit(int & n, int b) { n &= ~two(b); }
inline int last_bit(int n) { return n & (-n); }
inline int ones(int n) { int res = 0; while(n && ++res) n-=n&(-n); return res; }
template<class T> void chmax(T & a, const T & b) { a = max(a, b); }
template<class T> void chmin(T & a, const T & b) { a = min(a, b); }
///////////////////////////////////////////////////////////////////////

const int N = 1e5 + 5;

int n, m;
vector<int> edges[N];
vector<bool> seen(N);
vector<int> in_degree(N), dist(N);

void dfs(int u) {
    seen[u] = true;
    for (auto& v : edges[u]) {
        dist[v] = max(dist[v], dist[u] + 1);
        in_degree[v]--;
        if (in_degree[v] == 0) dfs(v);
    }
}

int main() {
    scanf("%d%d", &n, &m);
    for (int i = 0; i < m; ++i) {
        int u, v;
        scanf("%d%d", &u, &v);
        edges[u].push_back(v);
        in_degree[v]++;
    }

    for (int i = 1; i <= n; ++i) if (!seen[i] && in_degree[i] == 0) dfs(i);

    int res = 0;
    for (int i = 1; i <= n; ++i) res = max(res, dist[i]);
    printf("%d\n", res);
}

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

#define fast_cin() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define MAX 1000000
#define ll long long
#define db double
#define str string
#define pb push_back
#define For(i,s,e) for (ll i=(s); i<(e); i++)
#define Forrev(i,s,e) for (ll i=(s); i>=(e); i--)
#define all(v) v.begin(),v.end()

#define vll vector<ll>
#define vs vector<string>
#define mapll map<ll,ll>
#define pll pair<ll,ll>
#define initialise(a, x) memset(a, x, sizeof(a))
#define maxheap priority_queue<ll>
#define minheap priority_queue<ll,vector<ll> ,greater<ll>>

#define ff first
#define ss second
#define endl "\n"
#define mp make_pair
const ll mod=1e9 + 7;

ll takemod(ll a) {
    return ((a%mod)+mod)%mod;
}

ll gcd(ll a, ll b) { 
    if (b == 0) 
        return a; 
    return gcd(b, a % b);        
}

ll fast_exp(ll base, ll expo) {
    ll res=1;
    while(expo>0) {
        if(expo&1) res=(res*base)%mod;
        base=(base*base)%mod;
        expo>>=1;}
    return res;
}

ll modinv(ll a) {
    return takemod(fast_exp(takemod(a), mod-2));
}
const int M=1e5+5;
ll dp[M][13];
ll n;
string s;
ll dpfunc(ll index, ll rem)
{
	if(index==n)
	{
		if(rem==5)
			return 1;
		else
			return 0;
	}
	else
	{
		if(dp[index][rem]!=-1)
			return dp[index][rem];
		else
		{
			if(s[index]!='?')
			{
				ll val=s[index]-'0';
				dp[index][rem]=dpfunc(index+1,(rem*10+val)%13);
			}
			else
			{
				ll ans=0;
				For(i,0,10)
					ans=(ans+dpfunc(index+1,(rem*10+i)%13))%mod;
				dp[index][rem]=ans;
			}
			return dp[index][rem];
		}
	}
}
signed main() 
{
    fast_cin();
    //#ifndef ONLINE_JUDGE
    //freopen("C:/IO/in.txt", "r", stdin);
    //freopen("C:/IO/out.txt", "w", stdout);
    //#endif
	memset(dp,-1,sizeof(dp));
	cin>>s;
	n=s.length();
	cout<<dpfunc(0,0);    
    return 0;    
}

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



int main() {

    double S, D , T ;
     cin >> D >>T >> S ;

     double t = D/S ;
    // cout << t << endl;
        if (t <= T)
            cout <<"Yes" << endl;
         else
              cout << "No" << endl;

    return 0;
}

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

int gcd(int a,int b){

  if(b==0){
    return a;
  }

  return gcd(b,a%b);
}

int main(){

    int w,h,c;

    cin >> w >> h >> c;

    int g = gcd(w,h);

    cout << (w/g * h/g) * c << endl;
    return 0;
}

Measured memory_bytes: 3088
a=[1,6,36,216,1296,7776,46656,9,81,729,6561,59049]
n=int(input())
dp=[0]*(n+1)
dp[0]=0#0円は0通り
for i in range(1,n+1):
    s=[]
    for j in a:
        if i-j<0:
            continue
        s.append(dp[i-j])
    dp[i]=min(s)+1
print(dp[-1])


Measured memory_bytes: 3828
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll x,y,h,H,idx_H;
int main() {
    int N; cin >> N;
    vector<tuple<ll, ll, ll>> A(N);
    for (int i=0; i<N; ++i) {
        cin >> x >> y >> h;
        if (h > 0) idx_H = i;
        A[i] = make_tuple(x,y,h);
    }
    for (int cx = 0; cx<=100; cx++){
        for (int cy=0; cy<=100; cy++){
            H = get<2>(A[idx_H]) + abs(get<0>(A[idx_H])-cx) + abs(get<1>(A[idx_H])-cy);
            bool can = true;
            for (auto a : A) {
                tie(x,y,h) = a;
                if (h != max((H - abs(x-cx) - abs(y-cy)), (ll)0)) can = false;
                // if (h > 0 && h != H - abs(x-cx) - abs(y-cy)) can = false;
                // if (h== 0 && (H - abs(x-cx) - abs(y-cy)) > 0) can = false;
            }
            if (can) {
                cout << cx << " " << cy << " " << H << endl;
                return 0;
            }
        }
    }

}

Measured memory_bytes: 3596
#include<bits/stdc++.h>
using namespace std;
int a[100010],m[100010];
int main(){
	ios::sync_with_stdio(false);
	int n,t;
	cin>>n>>t;
	for(int i=1;i<=n;i++){
		cin>>a[i];
	}
	int mx=0;
	for(int i=n;i>=1;i--){
		if(a[i]>mx){
			mx=a[i];
		}
		m[i]=mx;
	}
	int cnt=0;
	mx=0;
	for(int i=1;i<=n;i++){
		if(m[i]-a[i]>mx){
			mx=m[i]-a[i];
			cnt=1;
		}
		else if(m[i]-a[i]==mx){
			cnt++;
		}
		
	}
	cout<<cnt;
	
}


Measured memory_bytes: 1024
//(・ω・)
#include <stdio.h>
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, atoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <iomanip> //setprecision
#include <limits>
#include <sstream> //istringstream
#include <stdlib.h>
#include <list>
#include <iterator>//std::advance()
using namespace std;

int main(){
    long long a,b;
    cin >> a >> b;
    long long A=a, B=b, ans=1,a1=sqrt(A),b1=sqrt(B);
    for(long long i=2; i*i<=max(A,B); i++){
        if(a%i==0 && b%i==0) ans++;
        if(a%i==0){
            while(a%i==0){
                a/=i;
            }
        }
        if(b%i==0){
            while(b%i==0){
                b/=i;
            }
        }
    }
    if(a==b && a!=1) ans++;
    cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int X = sc.nextInt();
        int T = sc.nextInt();
        int result = 0;
        while(N>0) {
            result+=T;
            N-=X;
        }
        System.out.println(result);
    }
}


Measured memory_bytes: 35592
while 1 do
  n,m=gets.split().map!{|i|i.to_i}
  if n==0&&m==0 then break end
  a=gets.split().map!{|i|i.to_i}
  a.slice!(n..a.length)
  a.sort
  max=-1
  n.times do |i|
    (i+1).upto(n-1) do |j|
      s=a[i]+a[j]
      if s<=m&&s>max then
        max=a[i]+a[j]
      end
    end
  end
  if max==-1 then puts "NONE"
  else puts max
  end
end



Measured memory_bytes: 7068
#include <bits/stdc++.h>
#define ri register
#define int long long
#define E (n+1)
using namespace std; const int N=200010;
inline int read()
{
    int s=0, w=1; ri char ch=getchar();
    while(ch<'0'||ch>'9') { if(ch=='-') w=-1; ch=getchar(); }
    while(ch>='0'&&ch<='9') s=(s<<3)+(s<<1)+(ch^48), ch=getchar();
    return s*w;
}
int n,a[66];
char s[13];
signed main()
{
    n=read();
    for(ri int i=0;i<n;i++)
    {
        cin>>s;
        if(s[0]=='M') a[0]++;
        if(s[0]=='A') a[1]++;
        if(s[0]=='R') a[2]++;
        if(s[0]=='C') a[3]++;
        if(s[0]=='H') a[4]++;
    }
    int res=0;
    for(ri int i=0;i<5;i++)
    {
        for(ri int j=i+1;j<5;j++)
        {
            for(ri int k=j+1;k<5;k++) res+=a[i]*a[j]*a[k];
        }
    }
    printf("%lld\n",res);
    return 0;
}

Measured memory_bytes: 3724
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;

//#define int long long
using bll = boost::multiprecision::cpp_int;
using ll = long long;
//constexpr int INF = 1e9;//INT_MAX=(1<<31)-1=2147483647
constexpr ll INF = (ll)1e18;//(1LL<<63)-1=9223372036854775807
constexpr ll MOD = (ll)1e9 + 7;
constexpr double EPS = 1e-9;
constexpr int dx[4]={1,0,-1,0};
constexpr int dy[4]={0,1,0,-1};
#ifdef LOCAL_ENV
	#define debug(var) std::cout<<#var" = "<<var<<std::endl
#else
	#define debug(var)
#endif
#define p(var) std::cout<<var<<std::endl
#define rep(i, n)   for(ll i=0, i##_length=(n); i< i##_length; ++i)
#define repeq(i, n) for(ll i=1, i##_length=(n); i<=i##_length; ++i)
#define all(a) (a).begin(), (a).end()
#define PI (acos(-1))
template<typename T> inline T power(T x, T n){ return n ? power(x*x%MOD,n/2)*(n%2?x:1)%MOD : 1; }
template<typename T> inline T gcd(T a, T b) { return b ? gcd(b,a%b) : a; }
template<typename T> inline T lcm(T a, T b) { return a / gcd(a,  b) * b; }
template<typename T1, typename T2>inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template<typename T1, typename T2>inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
template<typename T1, typename T2> ostream& operator<<(ostream& s, const pair<T1, T2>& p) {return s << "(" << p.first << ", " << p.second << ")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
	for (int i = 0, len = v.size(); i < len; ++i){
		s << v[i]; if (i < len - 1) s << "\t";
	}
	return s;
}
template<typename T> ostream& operator<<(ostream& s, const vector< vector<T> >& vv) {
	for (int i = 0, len = vv.size(); i < len; ++i){
		s << vv[i] << endl;
	}
	return s;
}
template<typename T1, typename T2> ostream& operator<<(ostream& s, const map<T1, T2>& m) {
	s << "{" << endl;
	for (typeof(m.begin()) itr = m.begin(); itr != m.end(); ++itr){
		s << "\t" << (*itr).first << " : " << (*itr).second << endl;
	}
	s << "}" << endl;
	return s;
}

/*-----8<-----8<-----*/

constexpr ll N_MAX = 10000000000000000;

ll N;

void input() {
	scanf("%lld", &N);
}

void solve() {
	string S=to_string(N);
	vector<vector<ll>> dp(20, vector<ll>(2,0));
	
	int v=S[0]-'0';
	dp[0][0]=v;
	dp[0][1]=v-1;

	rep(i,S.size()-1){
		v=S[i+1]-'0';
		dp[i+1][0]=dp[i][0]+v;
		if(v==0)dp[i+1][1]=dp[i][1]+9;
		else dp[i+1][1]=max(dp[i][1]+9, dp[i][0]+v-1);
	}
	
	printf("%lld\n", max(dp[S.size()-1][0],dp[S.size()-1][1]));
}

signed main() {
	input();
	solve();
	return 0;
}


Measured memory_bytes: 256
#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>;

int main() {
    int n, m;
    cin >> n >> m;
    int a[n];
    rep(i,n) {
        cin >> a[i];
    }
    sort(a, a+n);
    vector<P> p;
    rep(i,m) {
        int b, c;
        cin >> b >> c;
        p.push_back(make_pair(c, b));
    }
    sort(p.begin(), p.end(), greater<>());
    p.push_back(make_pair(0, 1));
    int i = 0;
    int j = 0;
    int64_t ans = 0;
    int b, c;
    int count_b = 0;
    while (true) {
        c = p[j].first;
        b = p[j].second;
        if (a[i] < c && count_b < b) {
            ans += p[j].first;
            count_b++;
            i++;
        }
        else {
            ans += a[i];
            i++;
        }
        if (count_b == b) {
            j++;
            count_b = 0;
        }
        if (i == n) break;
    }
    cout << ans << endl;
}

Measured memory_bytes: 1784
#pragma region includes, macros
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <map>
#include <set>
#include <list>
#include <unordered_set>
#include <unordered_map>
#include <stdlib.h>

using namespace std;

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

template<class T>
const T INF = numeric_limits<T>::max();
template<class T>
const T SINF = numeric_limits<T>::max() / 10;
static const i64 MOD = 1000000007;

//int dx[5] = {-1,0,0,0,1}, dy[5] = {0,-1,0,1,0};
//int dx[8] = {-1,0,1,1,1,0,-1,-1}, dy[8] = {1,1,1,0,-1,-1,-1,0};
//int dx[9] = {-1,0,1,1,1,0,-1,-1,0}, dy[9] = {1,1,1,0,-1,-1,-1,0,0};

struct edge {
    i64 from, to, cost;
    edge(i64 to, i64 cost) : from(-1), to(to), cost(cost) {}
    edge(i64 src, i64 to, i64 cost) : from(src), to(to), cost(cost) {}
};

// 多重vectorを可変引数テンプレートで http://beet-aizu.hatenablog.com/entry/2018/04/08/145516
template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }

template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
    return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}

template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T& t, const V& v) { t = v; }

template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T& t, const V& v) {
    for (auto& e : t) fill_v(e, v);
}
//

#pragma endregion

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

int main() {
    i64 n, k;
    cin >> n >> k;
    if(2 * k - 1 <= n) cout << "YES" << endl;
    else cout << "NO" << endl;
}


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

struct edge{ int to,cap,rev; };

vector<edge> G[MAX_V];
bool used[MAX_V];

void add_edge(int from, int to, int cap) {
  G[from].push_back((edge){to,cap,G[to].size()});
  G[to].push_back((edge){from,0,G[from].size()-1});
}

int flow_dfs(int v, int t, int f){
  if(v == t) return f;
  used[v] = true;
  for(int i=0;i<(int)G[v].size();i++){
    edge &e = G[v][i];
    if(!used[e.to] && e.cap > 0){
      int d = flow_dfs(e.to,t,min(f,e.cap));
      if(d > 0){
        e.cap-= d;
        G[e.to][e.rev].cap += d;
        return d;
      }
    }
  }
  return 0;
}

int max_flow(int s,int t){
  if(s == t) return INF;
  int flow = 0;
  while(1){
    memset(used,0,sizeof(used));
    int f = flow_dfs(s,t,INF);
    if(f == 0) break;
    flow += f;
    if(flow >= INF)return INF;
  }
  return flow;
}



int main(){
  char mp[100][100];
  int w,h;
  cin>>h>>w;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      cin>>mp[i][j];
    }
  }

  int s=2*h*w,t=s+1;
  int nx[4] = {0,1,0,-1},ny[4] = {-1,0,1,0};
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if(mp[i][j] == 'X'){
        add_edge(s,i*w+j,INF);
        add_edge( i*w+j , i*w+j+h*w , INF );
      }
      else add_edge( i*w+j , i*w+j+h*w , 1 );
      for(int k=0;k<4;k++){
        int ni=i+ny[k],nj=j+nx[k];
        if(ni<0 || ni>=h || nj<0 || nj>=w) add_edge(i*w+j+w*h,t,INF);
        else add_edge(i*w+j+w*h,ni*w+nj,INF);
      }
    }
  }

  int ans = max_flow(s,t);
  if(ans == INF) cout<<-1<<endl;
  else cout<<ans<<endl;

  return 0;
}


Measured memory_bytes: 3968
#include <stdio.h> 
 #include <math.h> 
 #define MAX 1000 
 
 
 int main(){ 
     int n; 
     int i, j=0, sum; 
     int score[MAX]; 
     double ave, tmp; 
     double dev[MAX]; 
 
 
     while(1){ 
         scanf("%d", &n); 
         if(n==0)break; 
         sum=0; 
         for(i=0;i<n;i++){ 
             scanf("%d", &score[i]); 
             sum+=score[i]; 
         } 
         ave=(double)sum/(double)n; 
         tmp=0.0; 
         for(i=0;i<n;i++){ 
             tmp+=pow(score[i]-ave, 2); 
         } 
         dev[j++]=sqrt(tmp/(double)n); 
     } 
     for(i=0;i<j;i++){ 
         printf("%f\n", dev[i]); 
     } 
     return 0; 
 } 



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

int main(){
	int n;
	cin >> n;
	int h[n];
	for(int i=0;i<n;i++){cin >> h[i];}
	int ans=0;
	int maxans=0;
	
	for(int i=n-1;i>0;i-=1){
		if(h[i]<=h[i-1]){
			ans += 1;
			if(ans>maxans){
				maxans = ans;
			}
		}
		else{ans = 0;}	
	}
	
	cout << maxans << endl;
		
	return 0;
}
	

Measured memory_bytes: 640
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		
		int n = scanner.nextInt();
		int a[] = new int[n];
		
		for (int i = 0; i < n; i++) {
			a[i] = scanner.nextInt();
		}
		
		scanner.close();
		
		for (int i = 1; i < n; i++) {
			for (int k = 0; k < n - 1; k++) {
				System.out.print(a[k] + " ");
			}
			System.out.println(a[n - 1]);
			
			int v = a[i];
			int j = i - 1;
			
			while (j >= 0 && a[j] > v) {
				a[j + 1] = a[j];
				j--;
			}
			a[j + 1] = v;
		}
		
		for (int k = 0; k < n - 1; k++) {
			System.out.print(a[k] + " ");
		}
		System.out.println(a[n - 1]);
	}
} 



Measured memory_bytes: 31336
N = gets.to_i
h = {}
N.times do
  a = gets.to_i
  if h.key?(a)
    h[a] += 1
  else
    h[a] = 1
  end
end
num = 0
h.each do |_k, v|
  num += 1 if v.odd?
end
puts num


Measured memory_bytes: 19144
using System;
using System.Collections.Generic;
using System.Linq;
using static Input;

public class Prog
{
    private const int INF = 1000000007;
    public static void Main()
    {
        int N = NextInt();
        int[] A = LineInt();
        long ans = A[0];
        for (int i = 1; i < N; i++) {
            ans = GCD(ans, A[i]);
        }
        Console.WriteLine(ans);
    }
    public static long GCD(long a, long b)
    {
        if (a < b) GCD(b, a);
        long d = a % b;
        while (b != 0)
        {
            d = a % b;
            a = b;
            b = d;
        }
        return a;
    }
}

public class Input
{
    private static Queue<string> q = new Queue<string>();
    private static void Confirm() { if (q.Count == 0) foreach (var s in Console.ReadLine().Split(' ')) q.Enqueue(s); }
    public static int NextInt() { Confirm(); return int.Parse(q.Dequeue()); }
    public static long NextLong() { Confirm(); return long.Parse(q.Dequeue()); }
    public static string NextString() { Confirm(); return q.Dequeue(); }
    public static double NextDouble() { Confirm(); return double.Parse(q.Dequeue()); }
    public static int[] LineInt() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
    public static long[] LineLong() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
    public static string[] LineString() { return Console.ReadLine().Split(' ').ToArray(); }
    public static double[] LineDouble() { return Console.ReadLine().Split(' ').Select(double.Parse).ToArray(); }
}

Measured memory_bytes: 21728
def main():
    n, k = map(int, input().split())
    h_list = [int(input()) for _ in range(n)]
    h_list.sort(reverse=True)

    min_diff = 10 ** 9

    for i in range(n - k + 1):
        diff = h_list[i] - h_list[i + k - 1]
        if diff < min_diff:
            min_diff = diff

    print(min_diff)


if __name__ == "__main__":
    main()


Measured memory_bytes: 76308
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define ll long long
#define imfor(i, n) for(int i = 0; i < n; i++)
using namespace std;
ll MOD = 1000000007;

int main() {
    char w[110];
    char a[26];
    fill(a, a + 26, 0);
    cin >> w;
    imfor(i, strlen(w)) {
        a[w[i] - 'a'] += 1;
    }
    int f = 0;
    imfor(i, 26) {
        if (a[i] % 2 == 1) {
            f = 1;
            break;
        }
    }
    if (f == 0) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define REP(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define all(a) (a).begin(),(a).end()
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
const int INF=1e9;
int main(){
  ll n,k;
  ll a[100100];
  while(cin>>n>>k&&(n||k)){
    REP(i,n)cin>>a[i];
    ll sum=0,ans=0;
    REP(i,n){
      if(i<k){
        sum+=a[i];
      }else{
        ans=max(ans,sum);
        sum-=a[i-k];
        sum+=a[i];
        ans=max(ans,sum);
      }
    }
    cout<<ans<<endl;
  }
}

Measured memory_bytes: 1936
#include <stdio.h>

int main(void)
{
	int money=100000,i,n;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		money=money*1.05;
		if(money%1000){
			money=money/1000+1;
			money=money*1000;}
	}
	printf("%d\n",money);
	return 0;
}

Measured memory_bytes: 1712
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
using LL = long long;
const LL LINF = 1e18;
using namespace std;
#define COUT(v) cout<<(v)<<endl
#define CIN(n)  int(n);cin >> (n)
#define LCIN(n) LL(n);cin >> (n)
#define SCIN(n) string(n);cin >> (n)
#define YES(n) cout<<((n)? "YES" : "NO")<<endl
#define Yes(n) cout<<((n)? "Yes" : "No")<<endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) <<endl

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)

#define FOREACH(x,a) for(auto& (x) : (a) )

#define ALL(obj) (obj).begin(),(obj).end()

#define P pair<LL,LL>
#define I vector<int>
#define S set<int>
#define pb(v) push_back(v)
#define V vector
#define rt return
#define rmsame(a) sort(ALL(a)),a.erase(unique(ALL(a)), a.end())

typedef string::const_iterator State;
class PalseError {};
class Edge{
public:
    LL from,to,value;
    Edge(LL a,LL b,LL c){
        from = a;
        to = b;
        value = c;
    }
    Edge(LL a,LL b){
        from = a;
        to = b;
    }
};
class SegmentTreeOfRMQ{
private:
    std::vector<LL> dat;
    int N;

public:
    void init(int n){
        int s = 1;
        while(s < n){
            s*=2;
        }
        dat = std::vector<LL>(s,INT_MAX);
        N = n;
    }
    void update(int i,int x){
        i += N-1;
        dat[i]=x;
        while(i > 0){
            i = (i-1)/2;
            dat[i] = min(dat[i * 2 + 1], dat[i * 2 + 2]);
        }
    }
    int query(int a , int b, int k,int l, int r){
        if(r <= a || b <= l)return INT_MAX;
        if(a <= l && r <= b)return dat[k];
        else{
            int vl = query(a,b,k*2+1,l,(l+r)/2);
            int vr = query(a,b,k*2+2,(l+r)/2,r);
            return min(vl,vr);
        }
    }
};

int main(){
    CIN(N);
    LL ruiseki[N+10];
    ruiseki[0]=0;
    REP(a,N){
        LCIN(b);
        ruiseki[a+1]=ruiseki[a]+b;
    }
    map<LL,LL> hoge;
    REP(a,N+1){
        if(hoge.find(ruiseki[a]) == hoge.end()){
            hoge[ruiseki[a]]=1;
        }else{
            hoge[ruiseki[a]]++;
        }
    }
    LL ans = 0;
    for(pair<LL,LL> a : hoge){
        ans += ((a.second*(a.second-1)));
    }
    COUT(ans/2);
    return 0;
}


Measured memory_bytes: 14336
//
// author  : Abhishek
//
#include <bits/stdc++.h>
#include<chrono>

#define ll long long
#define db double
#define deb(x) cout<<#x<<": "<<x<<"\n"
#define all(x) x.begin(),x.end()
#define fo(i, n) for(i=0 ; i<n ; i++)
#define Fo(i, k, n) for(i=k ; i<n ; i++)

using namespace std;
using namespace chrono;

const ll MOD = 1000000007;
const ll N = 300005;  // array size
const ll inf = 10000000000000000;


void print(vector<ll> v) {
    ll i;
    fo(i, v.size())cout << v[i] << " ";
    cout << "\n";
}

void print(vector<pair<ll, ll> > v) {
    ll i;
    fo(i, v.size()) {
        cout << v[i].first << " " << v[i].second << "\n";
    }
}

vector<ll> read(ll n) {
    ll i;
    vector<ll> arr(n, 0);
    fo(i, n)cin >> arr[i];
    return arr;
}

vector<ll> read(ll n, ll k) {
    ll i;
    vector<ll> arr(n + k, 0);
    Fo(i, k, n + k)cin >> arr[i];
    return arr;
}

bool isEven(ll n) {
    return n % 2 == 0;
}

bool isOdd(ll n) {
    return n % 2 != 0;
}


void solve() {
    ll t = 1;
//    cin >> (t);
    while (t--) {

        ll i, j, k, n, m, p, q, x, y, a, b, l, r;
            char ch;
            cin>>ch;
            cout<<char(ch+1);

    }
}

int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
#endif

    auto start = high_resolution_clock::now();

    solve();

    ll i, j, k, n, m, p, q, x, y, a, b, l, r;


    auto stop = high_resolution_clock::now();
    auto duration = duration_cast<microseconds>(stop - start);
#ifndef ONLINE_JUDGE
    cerr << "Time: " << duration.count() / 1000.0 << endl;
#endif


    return 0;
}




Measured memory_bytes: 3564
#include <bits/stdc++.h>
#define all(x) begin(x), end(x)
#define dbg(x) cerr << #x << " = " << x << endl
#define _ << ' ' <<
using namespace std;
using ll = long long;
using vi = vector<int>;

int n, k;
string s;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> n >> k >> s;
    vi v;
    s += 'x';
    int cnt = 0;
    char p = s[0];
    for (int i = 0; i <= n; ++i)
    {
        if (s[i] != p)
            v.push_back(cnt), cnt = 0;

        cnt++;
        p = s[i];
    }
    for (int i = 1; i < v.size(); ++i)
        v[i] += v[i - 1];

    int m = s[0] == '1';
    int sol = 0;
    for (int i = 0; i < v.size(); ++i)
    {
        int r = min((int)v.size() - 1, i + 2 * k - 1 + (m + i) % 2);
        int s = v[r] - (i ? v[i - 1] : 0);
        sol = max(sol, s);
    }
    cout << sol;
}


Measured memory_bytes: 1020
#include <iostream>

int main()
{
	int na, nb;
	std::cin >> na >> nb;
	int a[na][nb], b[nb];
	for (int i=0; i!=na; ++i)
		for (int j=0; j!=nb; ++j)
			std::cin >> a[i][j];
	for (int i=0; i!=nb; ++i)
		std::cin >> b[i];
	for (int i=0; i!=na; ++i) {
		int s = 0;
		for (int j=0; j!=nb; ++j) {
			s += a[i][j]*b[j];
		}
		std::cout << s << '\n';
	}
}

Measured memory_bytes: 3104
#include <array>
#include <iostream>

int main()
{
    std::array<int, 2 * 100000 + 1> sum = {0};
    int n;
    std::cin >> n;

    int tmp;
    for (int i = 0; i < n - 1; ++i)
    {
        std::cin >> tmp;
        ++sum[tmp];
    }

    for (int i = 1; i <= n; ++i)
    {
        std::cout << sum[i] << std::endl;
    }

    return 0;
}


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

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

fn rec(h: usize) -> usize {
    if h == 0 { return 0; }

    1 + 2 * rec(h / 2)
}

fn main() {
    scan!(h; usize);

    println!("{}", rec(h));
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
const int N=2e5+10;
struct E{
	int x,y,nxt,flag;
}mm[N<<2];
int h[N],len,p[N],n,ans[N],cur[N];
bool v[N];
inline int rd(){
	int x=0;int f=1;char s=getchar();
	while(!isdigit(s)) f=(s=='-'?-1:f),s=getchar();
	while(isdigit(s)) x=(x<<1)+(x<<3)+s-'0',s=getchar();
	return x*f;
}

inline void add(int x,int y){
	++len;
	mm[len].x=x;mm[len].y=y;mm[len].nxt=h[x];h[x]=len;
	++len;
	mm[len].x=y;mm[len].y=x;mm[len].nxt=h[y];h[y]=len;
	p[x]++;p[y]++;
	return ;
}
void dfs(int u,int f){
	
	for(int& k=cur[u];k;k=mm[k].nxt){
		int y=mm[k].y;
		if(mm[k].flag||f==y) continue; 
		mm[k].flag=mm[k%2==0?k-1:k+1].flag=1;
		if(v[u] && u<=n && y>n) ans[u]=ans[y]=1; 
		if(v[u] && u>n && y<=n) ans[u]=ans[y]=-1;
		h[u]=mm[k].nxt;
		dfs(y,u);
	}
}
int main(){
//	freopen("t.in","r",stdin);
	n=rd();memset(h,0,sizeof h);
	for(int i=1;i<=n;i++){
		int u=rd();u=max(0,u);
		add(u,i);
	}
	for(int i=1;i<=n;i++){
		int u=rd();u=u==-1?0:(u+n);
		add(u,i+n);
	}
	for(int i=1;i<=2*n;i++){
		if(p[i]%2) v[i]=1;
		else v[i]=0;
	}
	bool flag=true;
	for(int i=1;i<=n;i++)
		if(v[i]!=v[i+n]) flag=0;
	if(flag) printf("POSSIBLE\n");
	else {
		printf("IMPOSSIBLE\n");
		return 0;
	}
	for(int i=1;i<=n;i++)
		if(v[i]) add(i,i+n);//,printf("#%d %d\n",i,i+n);
	for(int i=0;i<=2*n;i++) cur[i]=h[i]; 
	dfs(1,0);
	for(int i=1;i<=n;i++) printf("%d ",ans[i]);printf("\n");
	return 0;
}

Measured memory_bytes: 24192
N,X = map(int,input().split())
daughnut = []
count = N
for _ in range(0,N):
    m = int(input())
    daughnut.append(m)

cheapest = min(daughnut)

X = X - sum(daughnut)

#print(X)

while X >= cheapest:
    X = X -cheapest
    count += 1

print(count)

Measured memory_bytes: 3060
from collections import Counter


def solve(string):
    n, *aqbc = map(int, string.split())
    a, _, bc = aqbc[:n], aqbc[n], aqbc[n + 1:]
    s = sum(a)
    t = Counter(a)
    ans = []
    for b, c in zip(*[iter(bc)] * 2):
        if b in t.keys():
            s += (c - b) * t[b]
            t[b], t[c] = 0, t[b] + t[c]
        ans.append(s)
    return "\n".join(map(str, ans))


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))


Measured memory_bytes: 44196
#include <bits/stdc++.h>
#include <set>
#include <queue>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++) 
#define reps(i, s, n) for (int i = s; i < (int)(n); i++) 
#define ll long long
#define ld long double
#define repl(i, n) for (ll i = 0; i < (ll)(n); i++) 
#define repsl(i, s, n) for (ll i = s; i < (ll)(n); i++)  
#define outdeb(fir, sec, thr) cout << fir << ":" << sec << ":" << thr << endl

int main()
{
  ll a,b,c,x,y;
  cin >> a >> b >> c >> x >> y;

  if(x < y)
  {
    swap(a, b);
    swap(x, y);
  }

  ll val = 0;
  if(a + b >= 2 * c)
  {
    val += c * 2 * y;
  }
  else
  {
    val += (a + b) * y;
  }
  
  if(a >= 2 * c)
  {
    val += (x-y) * 2 * c;
  }
  else
  {
    val += (x - y) * a;
  }

  cout << fixed << val << endl;

  return 0;
}

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

#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;

int main()
{
    int n;
    cin >> n;
    int dp[n + 1];
    dp[0] = 0;
    for (int i = 1; i <= n; i++)
    {
        dp[i] = i;
        for (int j = 1; j <= n; j *= 6)
            if (i - j >= 0)
                dp[i] = min(dp[i], 1 + dp[i - j]);

        for (int j = 1; j <= n; j *= 9)
            if (i - j >= 0)
                dp[i] = min(dp[i], 1 + dp[i - j]);

        dp[i] = min(dp[i], 1 + dp[i - 1]);
    }

    OP(dp[n]);

    return 0;
}

Measured memory_bytes: 640
// -----------------------------------------------
// Framework <https://github.com/vain0x/procon>
//
// See the bottom of file for solution.
// -----------------------------------------------

#![allow(unused_imports)]
#![allow(non_snake_case)]

use std::cell::RefCell;
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::fmt::{Debug, Display, Formatter, Write as FmtWrite};
use std::io::{stderr, stdin, BufRead, Write};
use std::mem::{replace, swap};
use std::ops::*;
use std::rc::Rc;

/// Print values to standard error if debug mode.
#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), stderr());
            writeln!(err, "\x1B[33m{}\x1B[0m = {:?}", e, $e).unwrap()
        })*
    };
}

/// Read from standard input and parse each word.
/// - `read!(T, U, ..)` parses a line as a tuple of words.
/// - `read![[T]]` parses a line as an array of words.
/// - `read![..; N]` parses `N` lines, using `read!(..)` repeatedly.
#[allow(unused_macros)]
macro_rules! read {
    ([$t:ty] ; $n:expr) =>
        ((0..$n).map(|_| read!([$t])).collect::<Vec<_>>());
    ($($t:ty),+ ; $n:expr) =>
        ((0..$n).map(|_| read!($($t),+)).collect::<Vec<_>>());
    ([$t:ty]) =>
        (rl().split_whitespace().map(|w| w.parse().unwrap()).collect::<Vec<$t>>());
    ($($t:ty),*) => {{
        let buf = rl();
        let mut w = buf.split_whitespace();
        ($(w.next().unwrap().parse::<$t>().unwrap()),*)
    }};
}

/// Read a line from standard input.
#[allow(dead_code)]
fn rl() -> String {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    buf.trim_right().to_owned()
}

// -----------------------------------------------
// Solution
// -----------------------------------------------

fn main() {
    let (H, W) = read!(i64, i64);
    let (h, w) = read!(i64, i64);
    println!("{}", H * W - (h * W + w * H) + h * w)
}


Measured memory_bytes: 4352
n, k = [int(i) for i in input().split()]
H = [int(i) for i in input().split()]

INF = 10 ** 18
DP = [INF] * n
DP[0] = 0

for i in range(n):
    for j in range(1, k+1):
        if i + j >= n:
            break
        DP[i+j] = min(DP[i+j], DP[i] + abs(H[i+j] - H[i]))

print(DP[n-1])

Measured memory_bytes: 52448
import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

H, W, K = map(int, readline().split())
C = np.frombuffer(read(), 'S1').reshape(H, -1)[:, :W]

C = 1 * (C == b'#')

def f(C, x, y):
    rows = [i for i in range(H) if x & (1<<i)]
    cols = [i for i in range(W) if y & (1<<i)]
    D = C[rows][:,cols]
    return D.sum() == K

ans = 0
for x in range(1 << H):
    for y in range(1 << W):
        ans += f(C, x, y)
print(ans)

Measured memory_bytes: 26884
import sys
input = sys.stdin.readline
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''

N, M = map(int,input().split())
q = []
c = [0] * N
A = [[] for i in range(N)]

for i in range(M):
	x, y, z = map(int,input().split())
	x = x - 1
	y = y - 1
	A[x].append(y)
	A[y].append(x)

cost = 0
for i in range(N):
	if c[i] == 0:
		cost += 1
		q.append(i)
		while len(q):
			j = q.pop()
			c[j] = 1
			for k in A[j]:
				if c[k] == 0:
					q.append(k)

print(cost)


Measured memory_bytes: 64560