akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;

#define int long long
#define endl "\n"
#define REP(i,a,n) for(int i=a;i<n;++i)
#define RUP(a,b) ((a+b-1)/(b))
#define SORTG(v) sort(v.begin(),v.end(),greater<>())
#define SORT(v) sort(v.begin(),v.end())
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define MOD 1000000007
#define INF LLONG_MAX/3

typedef long long ll;
typedef pair<int,int> Pii;
typedef tuple<int,int,int> Tiii;
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef vector<string> Vs;

template<class T> void chmax(T& a, T b) {if(a<b){a=b;}}
template<class T> void chmin(T& a, T b) {if(a>b){a=b;}}
void YesNo(int a) {if(a){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}}
void YESNO(int a) {if(a){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}}
void AorB(int a,string b,string c) {if(a){cout<<b<<endl;}else{cout<<c<<endl;}}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
void start(){cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);}

signed main(){start();
    int n;
    cin>>n;
    cout<<n%9<<endl;
    return 0;
}

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

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

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

int main()
{
  int n;
  long long ans, c = pow(10, 9) + 7, a = 1, b = 1, d = 1;

  cin >> n;
  for (int i = 0; i < n; i++)
  {
    a = a * 10 % c;
    b = b * 9 % c;
    d = d * 8 % c;
  }

  ans = (a - (2 * b % c) + d) % c;
  if (ans < 0)
    ans += c;
  cout << ans << endl;
}


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

int main(int argc, char const *argv[])
{
	int a,b;
	cin>>a>>b;
	int c=10;
	while (b/c>0)
	{
		c*=10;
	}
	int d=a*c+b;
	for (int i = 0; i*i <= d; ++i)
	{
		if (i*i==d)
		{
			cout<<"Yes\n";
			return 0;
		}
	}
	cout<<"No\n";
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <cmath>
#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() {
  ll N, K;
  cin >> N >> K;
  if (N >= K) N -= K * (N / K);
  cout << min(N, K - N) << endl;
  return 0;
}

Measured memory_bytes: 3108
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
#ifndef FAST_IO
 #define IOS ios_base::sync_with_stdio(false);cin.tie(nullptr);
#endif

#define int long long
#define FILE_IO freopen("input.txt","r",stdin)/#define int long long
#define f first
#define s second
#define endl '\n'
#define all(c) c.begin(),c.end()
#define bp __builtin_popcount
#define debug(x) cerr << #x << " = " << x << endl;

const int MOD = 1e9 + 7;
const int INF = 1000000000;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <typename T>void print(T t){for(auto &it : t)cout<<it<<" ";}
inline int powerexp(int a, int b, int m = MOD){ int res = 1;while(b){if(b&1)res = res * a % m;a = a * a % m,b >>= 1;}return res % m;}
inline int modinv(int a){ return powerexp(a,MOD-2,MOD);}
inline int lcm(int a, int b){ int g = __gcd(a,b);return a/g*b;}
inline int add(int x, int y){ x += y; if (x >= MOD) x -=  MOD; return x;}
inline int mul(int x, int y){ return (x * 1ll * y) % MOD;}
inline int sub(int x, int y){ x -= y; if (x<0) x += MOD; return x ;}

//-------------------< start here >-------------------------// 

void solve(){
    string a, b;
    cin >> a >> b;
    if (a.size() < b.size()) cout << "LESS" << endl;
    else if (a.size() > b.size()) cout << "GREATER" << endl;
    else{
	  if (a < b) cout << "LESS" << endl;
	  else if (a > b) cout << "GREATER" << endl;
	  else cout << "EQUAL" << endl;	
	}
}

//-----------------------------
//comment from here for TOPCODER 
int32_t main(){
   IOS;
   solve();
   //find();
   #ifdef LOCAL_DEFINE
   cerr << "time elapsed " << (double)clock()/CLOCKS_PER_SEC << endl;
   #endif
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
///Welcome to Nasif's Code
#define bug printf("bug\n");
#define bug2(var) cout<<#var<<" "<<var<<endl;
#define co(q) cout<<q<<endl;
#define all(q) (q).begin(),(q).end()
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9+7;
const int MAX = 1e6;
#define pi acos(-1)
#define inf 1000000000000000LL
#define FastRead    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll arr[MAX];
string s;
void recur(int pos,vector<char>v,int sum)
{
    if(pos==4)
    {
        if(sum==7)
        {
            cout<<s[0]<<v[0]<<s[1]<<v[1]<<s[2]<<v[2]<<s[3]<<"=7"<<endl;
            exit(0);
        }
        return;
    }
    v.push_back('+');
    recur(pos+1,v,sum+(s[pos]-48));
    v.pop_back();
    v.push_back('-');
    recur(pos+1,v,sum-(s[pos]-48));

}
int main()
{
    FastRead
    //freopen("output.txt", "w", stdout);

    cin>>s;
    vector<char>v;
    recur(1,v,s[0]-48);
    return 0;
}


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

#define rep(i, n) for(int i = 0;i < n;i++)
#define repr(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)

int main(){
  string s;
  cin>>s;
  int f,e,n=s.size();
  rep(i,n){
    if(s[i]=='A'){
      f=i;
      break;
    }
  }
  repr(i,n-1){
    if(s[i]=='Z'){
      e=i;
      break;
    }
  }
  int ans=e-f+1;
  cout<<ans<<endl;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1e9+7;
const long long INF = 1e15;

int main(){
    int n;
    cin >> n;
    map<string,int> mp;
    for(int i = 0; i < n; i++){
        string s;
        cin >> s;
        mp[s]++;
    }
    cout << "AC x " << mp["AC"] << endl;
    cout << "WA x " << mp["WA"] << endl;
    cout << "TLE x " << mp["TLE"] << endl;
    cout << "RE x " << mp["RE"] << endl;
    return 0;
}

Measured memory_bytes: 3632
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <array>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <utility>
#include <functional>
#include <bitset>
#include <cstdint>

using namespace std;
using i64 = int64_t;
using i32 = int32_t;
template<class T, class U> void init_n(vector<T>& v, size_t n, U x) 
{ v = vector<T>(n, x); }
template<class T> void init_n(vector<T>& v, size_t n) { init_n(v, n, T()); }
template<class T> void read_n(vector<T>& v, size_t n, size_t o = 0) 
{ v = vector<T>(n+o); for (size_t i=o; i<n+o; ++i) cin >> v[i]; }
template<class T> void read_n(T a[], size_t n, size_t o = 0)
{ for (size_t i=o; i<n+o; ++i) cin >> a[i]; }
template<class T> T gabs(const T& x) { return max(x, -x); }
#define abs gabs

i64 n;
vector<vector<i64>> g;

i64 far(i64 u, i64 p) {
  i64 d = 0;
  for (i64 v : g[u]) {
    if (v != p) d = max(d, 1 + far(v, u));
  }
  return d;
}

template<class G>
void dfs(const G& g, i64 u, i64 p, vector<i64>& dist) {
  for (i64 v : g[u]) {
    if (v != p) {
      dist[v] = dist[u] + 1;
      dfs(g, v, u, dist);
    }
  }
}

template<class G>
i64 h(const G& g, i64 u) {
  vector<i64> dist(n + 1), deg(n + 1);
  dfs(g, u, -1, dist);
  for (i64 u = 1; u <= n; ++u) {
    deg[dist[u]] = max(deg[dist[u]], i64(g[u].size()));
  }
  i64 y = g[u].size();
  for (i64 i = 1; i < n; ++i) {
    if (deg[i] >= 2) y *= deg[i] - 1;
  }
  return y;
}

i64 f(i64 u, i64 v) {
  auto z = g;
  z[u].erase(find(begin(z[u]), end(z[u]), v));
  z[v].erase(find(begin(z[v]), end(z[v]), u));
  z[u].push_back(0);
  z[v].push_back(0);
  z[0].push_back(u);
  z[0].push_back(v);
  return h(z, 0);
}

int main() {
  cin >> n;
  init_n(g, n + 2);
  for (i64 i = 0; i < n - 1; ++i) {
    i64 u, v; cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }

  vector<pair<i64, i64>> dg;
  for (i64 u = 1; u <= n; ++u) {
    dg.emplace_back(far(u, -1), u);
  }
  sort(begin(dg), end(dg));

  i64 y = 0, rad = dg[0].first, col, c = dg[0].second, c2 = dg[1].second;
  if (dg[0].first == dg[1].first) {
    col = rad;
    y = f(c, c2);
  } else {
    col = rad + 1;
    y = h(g, c);
    for (i64 v : g[c]) {
      y = min(y, f(c, v));
    }
  }

  cout << col << ' ' << y << '\n';
  return 0;
}


Measured memory_bytes: 256
/*{{{*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#include<assert.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define FOR(I, A, B) for (int I = (A); I <= (B); ++I)
#define FORS(I, S) for (int I = 0; S[I]; ++I)
#define RS(X) scanf("%s", (X))
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define CASET int ___T; scanf("%d", &___T); for(int cs=1;cs<=___T;cs++)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<PII> VPII;
typedef pair<LL,LL> PLL;
typedef vector<PLL> VPLL;
template<class T> void _R(T &x) { cin >> x; }
void _R(int &x) { scanf("%d", &x); }
void _R(LL &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }
template<class T> void _W(const T &x) { cout << x; }
void _W(const int &x) { printf("%d", x); }
void _W(const LL &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template<class T,class U> void _W(const pair<T,U> &x) {_W(x.F); putchar(' '); _W(x.S);}
template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
#ifdef HOME
 #define DEBUG(...) {printf("# ");printf(__VA_ARGS__);puts("");}
#else
 #define DEBUG(...)
#endif
int MOD = 1e9+7;
void ADD(LL& x,LL v){x=(x+v)%MOD;if(x<0)x+=MOD;}
/*}}}*/
const int SIZE = 1e6+10;
int main(){
    int d[6];
    REP(i,6)R(d[i]);
    W((d[4]-d[0]<=d[5])?"Yay!":":(");
    return 0;
}


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

int main(){
  int N; cin >> N;
  int odd = 0;
  int even = 0;
  int even4 = 0;
  bool OK = true;
  for(int i = 0; i < N; i++){
    int a; cin >> a;
    if(a % 2 == 1) odd++;
    else if(a % 4 == 0) even4++;
    else if(a % 2 == 0) even++;
  }
  if(N % 2 == 0){
    if(odd > even4) OK = false;
  }else{
    if(odd > even4 + 1) OK = false;
  }
  if(OK) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 256
MOD = 10**9 + 7
fac = [1,1] # 階乗 n!
inv = [0,1] # 逆元 1/n
finv = [1,1] # 逆元の階乗 (n^-1)! = (1/n)!

def finv_init(n, m):
    for i in range(2, n+1):
        fac.append( (fac[-1] * i ) % m )
        inv.append( (-inv[m%i] * (m//i)) % m )
        finv.append( (finv[-1] * inv[-1]) % m )

def nPr(n, r, m): return fac[n] * finv[n-r] % m

n, m = map(int, input().split())
finv_init(m, MOD)
ans = 0
for d in range(0, n+1):
    a = nPr(m-d, n-d, MOD) * nPr(n, d, MOD) * finv[d] % MOD
    if d & 1: a = -a
    ans += a; ans %= MOD
ans *= nPr(m, n, MOD)
print(ans % MOD)


Measured memory_bytes: 68684
#include<bits/stdc++.h>
#define N 2000009
#define ll long long
#define ld long double
#define ff first
#define ss second
#define inf 1000000005
#define mod 1000000007
using namespace std;
int n, m, u[100009], uu[100009], ans, dp[100009];
vector<int> g[100009], tps;
void tops(int v) {
    u[v] = 1;
    for(int i=0;i<g[v].size();i++) {
        int to = g[v][i];
        if(!u[to])
            tops(to);
    }
    tps.push_back(v);
}
void dfs(int v) {
    uu[v] = 1;
    for(int i=0;i<g[v].size();i++) {
        int to = g[v][i];
        if(!uu[to])
            dfs(to);
        dp[v] = max(dp[v], dp[to] + 1);
        ans = max(ans, dp[v]);
    }
}
int main() {
    cin>>n>>m;
    for(int i=1;i<=m;i++) {
        int x, y;
        cin>>x>>y;
        g[x].push_back(y);
    }
    for(int i=1;i<=n;i++) {
        if(!u[i])
            tops(i);
    }
    reverse(tps.begin(), tps.end());
    for(int i=0;i<tps.size();i++) {
        //cout<<tps[i]<<" ";
        if(!uu[tps[i]])
            dfs(tps[i]);
    }
    cout<<ans;
}


Measured memory_bytes: 16760
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
using ll = long long ;
using P = pair<int,int> ;
using pll = pair<long long,long long>;
constexpr int INF = 1e9;
constexpr long long LINF = 1e17;
constexpr int MOD = 1000000007;
constexpr double PI = 3.14159265358979323846;

int main(){
    int n;
    cin >> n;
    vector<ll> x(n),y(n);
    rep(i,n) cin >> x[i] >> y[i];
    vector<ll> p(n),q(n);
    rep(i,n){
        p[i] = x[i] + y[i];
        q[i] = x[i] - y[i];
    }
    ll ans = 0;
    sort(p.begin(),p.end());
    sort(q.begin(),q.end());
    ans = max(ans,p[n-1]-p[0]);
    ans = max(ans,q[n-1]-q[0]);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 9592
n = gets.to_i
a = gets.chomp.split(" ").map(&:to_i).sort!.reverse!
a << 0 if n%2 == 1
alice = 0
bob = 0
for i in 0..(n-1)/2
  alice += a[i*2]
  bob += a[i*2+1]
end
puts alice - bob

Measured memory_bytes: 1788
#include<bits/stdc++.h>
#define F first
#define S second
#define endl '\n'
#define MP make_pair
#define pb push_back

using namespace std;

typedef pair<int, int> P;
typedef pair<int, P> i_P;
typedef long long LL;

static const int INF = INT_MAX;
static const int MIN = INT_MIN;
static const LL L_INF = LLONG_MAX;
static const int MOD = 1000000000 + 7;
static const int SIZE = 100005;

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

    int n;
    cin >> n;
    int res = 1;
    bool diff;
    int a[SIZE];
    for( int i = 0; i < n; ++i ) cin >> a[i];

    if( n < 3 ) {
        cout << 1 << endl;
        return 0;

    }
    int pos = 1;
    while( pos < n && a[pos] == a[pos - 1] ) ++pos;
    if( pos > n - 2 ) {
        cout << 1 << endl;
        return 0;

    }

    --pos;
    if( a[pos] < a[pos + 1] ) diff = true;
    else diff = false;

    ++pos;
    while( pos < n - 1 ) {
        if( !diff && a[pos] < a[pos + 1] ) {
            ++res;
            ++pos;
            while( pos < n - 1 && a[pos] == a[pos + 1] ) ++pos;
            if( pos < n - 1 && a[pos] < a[pos + 1] ) diff = true;
        } else if( diff && a[pos] > a[pos + 1] ) {
            ++res;
            ++pos;
            while( pos < n - 1 && a[pos] == a[pos + 1] ) ++pos;
            if( pos < n - 1 && a[pos] > a[pos + 1] ) diff = false;

        } else {
            ++pos;

        }
    }
    cout << res << endl;

    return 0;
}



Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int RLEN=1<<18|1;
inline char nc() {
	static char ibuf[RLEN],*ib,*ob;
	(ib==ob) && (ob=(ib=ibuf)+fread(ibuf,1,RLEN,stdin));
	return (ib==ob) ? -1 : *ib++;
}
inline int rd() {
	char ch=nc(); int i=0,f=1;
	while(!isdigit(ch)) {if(ch=='-')f=-1; ch=nc();}
	while(isdigit(ch)) {i=(i<<1)+(i<<3)+ch-'0'; ch=nc();}
	return i*f;
}
 
const int mod=1e9+7;
inline int add(int x,int y) {return (x+y>=mod) ? (x+y-mod) : (x+y);}
inline int dec(int x,int y) {return (x-y<0) ? (x-y+mod) : (x-y);}
inline int mul(int x,int y) {return (LL)x*y%mod;}
inline int power(int a,int b,int rs=1) {
	for(;b;b>>=1,a=mul(a,a)) if(b&1) rs=mul(rs,a);
	return rs;
}
 
const int N=2e5+50, M=8e3+50;
int n,A[N],B[N],fac[M],ifac[M],f[4500][4500];
inline int& F(int a,int b) {return f[a+2003][b+2003];}
inline int C(int a,int b) {return mul(fac[a], mul(ifac[b], ifac[a-b]));}
int main() {
	fac[0]=1;
	for(int i=1;i<M;i++) fac[i]=mul(fac[i-1],i);
	ifac[M-1]=power(fac[M-1],mod-2);
	for(int i=M-2;~i;i--) ifac[i]=mul(ifac[i+1],i+1);
 
	n=rd();
	for(int i=1;i<=n;i++) A[i]=rd(), B[i]=rd(), F(-A[i],-B[i])++;//, cerr<<A[i]<<" "<<B[i]<<endl;
 
	for(int i=-2000;i<=2000;++i)
		for(int j=-2000;j<=2000;++j) {
			F(i,j)=add(F(i,j),F(i-1,j));
			F(i,j)=add(F(i,j),F(i,j-1));
		}
 
	int ans=0;
	for(int i=1;i<=n;i++) ans=add(ans,F(A[i],B[i])), ans=dec(ans,C(2*A[i]+2*B[i],2*B[i]));	cout<<mul(ans,(mod+1)/2);
 
}

Measured memory_bytes: 75008
#include<bits/stdc++.h>
#define int long long


using namespace std;

vector<int>mm[21];

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);


    int n;
    cin>>n;
    vector<int>s;
    int x;
    for (int i = 0; i < n; ++i) {
        cin>>x;
        s.push_back(x);
    }

    sort(s.begin(),s.end());
    std::vector<int>::iterator low1,low2;
    int ans=0;
    for (int i = 0; i < n; ++i) {
        for (int j = i+1; j < n; ++j) {
            low1=lower_bound(s.begin(),s.end(),s[i]+s[j]);
            ans+=(low1-s.begin())-(j+1);
        }
    }
    cout<<ans;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ll long long
using namespace std;
const ll INF = 1e18L + 10;
int main(){
    int n, w;
    cin >> n >> w;
    vector<ll> wt(n), val(n);
    for(int i = 0; i < n; i++)
        cin >> wt[i] >> val[i];
    int sum_val = 0;
    for(int x: val)
        sum_val += x;
    vector <ll> dp(sum_val + 1, INF);
    dp[0] = 0;
    for(int i = 0; i < n; i++)
        for(int j = sum_val - val[i]; j >= 0; j--)
            dp[j + val[i]] = min(dp[j + val[i]], dp[j] + wt[i]);
            //cout << dp[j + val[i] << "acaa\n";
    ll ans = 0;
    for(int i = 0; i <= sum_val; i++)
        if(dp[i] <= w)
            ans = max(ans, (ll)i);
    cout << ans << "\n";
}

Measured memory_bytes: 4024
<?php
$grid = array(
0 => array(0,0,0),
1 => array(0,0,0),
2 => array(0,0,0),
);
for ($i=0;$i<3;$i++){
    $cins = trim(fgets(STDIN));
    $cin = explode(" ",$cins);
    for ($j=0;$j<3;$j++){
        $grid[$i][$j] = $cin[$j];
    }
    
}


for ($i=0;$i<2;$i++){
    for ($j=0;$j<2;$j++){
        if ($grid[$i+1][$j+1] - $grid[0][$j+1] != $grid[$i+1][0] - $grid[0][0]){
            $wrong++;
        }
    }
    
}


for ($i=0;$i<2;$i++){
    for ($j=0;$j<2;$j++){
        if ($grid[$i+1][$j+1] - $grid[$i+1][0] != $grid[0][$j+1] - $grid[0][0]){
            $wrong++;
        }
    }
    
}

if ($wrong != 0){
    echo ("No");
}else{
    echo ("Yes");

}
?>

Measured memory_bytes: 3956
import Control.Applicative
import Data.Bool (bool)

main :: IO ()
main = solve <$> getLine >>= putStrLn

solve :: String -> String
solve s = bool "No" "Yes" $ f s
  where
    f (x:y:ys)
      | x == 'h' && y == 'i' = f ys
      | otherwise = False
    f [_] = False
    f [] = True


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

int main() {
  int a, b;
  int n;

  cin >> a >> b >> n;

  bool ans = false;
  while (n--) {
    int s, t;
    cin >> s >> t;

    if (t <= a || b <= s) continue;
    ans = true;
  }

  cout << ans << endl;
}

Measured memory_bytes: 3096
import math
a = list(map(int, input().split()))
v1 = 360/720
v2 = 360/60
s = a[2] * 60 + a[3]
a1 = v1 *s
a2 = v2 *a[3]
c = abs(a1-a2)
c = c if c<180 else 360-c
l = a[0] **2 + a[1] ** 2 - 2* a[0]*a[1]*math.cos(c/180*math.pi)
print(l ** 0.5)

Measured memory_bytes: 9524
n=int(input())
m=list(map(int,input().split()))
ans=[]
for i in range(n):
  for j in range(n-1-i,-1,-1):
    if not m[j]==j+1:
      continue
    #m[j]==j
    ans.append(j+1)
    m=m[:j]+m[j+1:]
    break
if not len(m)==0:
  print(-1)
else:
  for i in range(n):
    print(ans[n-1-i])
    

Measured memory_bytes: 3060
package main

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

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main() {
	sc.Split(bufio.ScanWords)
	defer out.Flush() // !!!!coution!!!! you must use Fprint(out, ) not Print()
	/* --- code ---*/
	S := next()
	for i, ch := range S {
		if i%2 == 0 && ch == 'L' {
			fmt.Fprintln(out, "No")
			return
		}
		if i%2 == 1 && ch == 'R' {
			fmt.Fprintln(out, "No")
			return
		}
	}
	fmt.Fprintln(out, "Yes")
}

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

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func nextFloat64() float64 {
	a, _ := strconv.ParseFloat(next(), 64)
	return a
}

func nextInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}
func nextFloats(n int) []float64 {
	ret := make([]float64, n)
	for i := 0; i < n; i++ {
		ret[i] = nextFloat64()
	}
	return ret
}
func nextStrings(n int) []string {
	ret := make([]string, n)
	for i := 0; i < n; i++ {
		ret[i] = next()
	}
	return ret
}

// Genericsがないので筋肉で...
// interfaceでの取扱がようわからんし
func containStr(arr []string, target string) bool {
	for _, v := range arr {
		if v == target {
			return true
		}
	}
	return false
}

func PrintOut(src interface{}, joinner string) {
	switch reflect.TypeOf(src).Kind() {
	case reflect.Slice:
		s := reflect.ValueOf(src)
		for idx := 0; idx < s.Len(); idx++ {
			fmt.Fprintf(out, "%v", s.Index(idx))
			if idx < s.Len()-1 {
				fmt.Fprintf(out, "%s", joinner)
			} else {
				fmt.Fprintln(out)
			}
		}
	default:
		fmt.Fprintln(out, "fuck")
	}
}

// mapからkeysとvaluesを返す感じのやつ
// なんかしらんけどmap[interface{}]interface{}しか受け付けない。なんのためのinterface{}やねん
// なので呼ぶときのmapはmap[int]stringとかじゃダメ
func splitKeyValue(m map[interface{}]interface{}) (keys, values []interface{}) {
	switch reflect.TypeOf(m).Kind() {
	case reflect.Map:
		s := reflect.ValueOf(m)
		for _, v := range s.MapKeys() {
			keys = append(keys, v)
			values = append(values, s.MapIndex(v))
		}
	default:
		fmt.Fprintln(out, "fuck")
	}
	return
}


Measured memory_bytes: 640
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include<iomanip>
//#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
typedef long double ld;
ll n, pos, neg;
int main()
{
    double x;
    double n;
    int flag=0;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        if(i%2==1) flag++;
    }
    cout<<fixed<<setprecision(10)<<flag/n;
}


Measured memory_bytes: 256
s = input()
if 'N' in s and 'S' not in s:
    print('No')
elif 'S' in s and 'N' not in s:
    print('No')
elif 'W' in s and 'E' not in s:
    print('No')
elif 'E' in s and 'W' not in s:
    print('No')
else:
    print('Yes')

Measured memory_bytes: 2940
local mma, mmi = math.max, math.min
local mce, mfl = math.ceil, math.floor

local mod = 1000000007
local function bmul(x, y)
  local x0, y0 = x % 31623, y % 31623
  local x1, y1 = mfl(x / 31623), mfl(y / 31623)
  return (x1 * y1 * 14122 + (x1 * y0 + x0 * y1) * 31623 + x0 * y0) % mod
end
local function badd(x, y)
  return (x + y) % mod
end

local function modpow(src, pow)
  local res = 1
  while 0 < pow do
    if pow % 2 == 1 then
      res = bmul(res, src)
      pow = pow - 1
    end
    src = bmul(src, src)
    pow = mfl(pow / 2)
  end
  return res
end

local function modinv(src)
  return modpow(src, mod - 2)
end

local fact = {1}
for i = 2, 1000 do
  fact[i] = bmul(fact[i - 1], i)
end
local factinv = {}
for i = 1, 1000 do
  factinv[i] = modinv(fact[i])
end

local function getComb(n, k)
  if n == k then return 1 end
  return bmul(fact[n], bmul(factinv[k], factinv[n - k]))
end

local n, a, b, c, d = io.read("*n", "*n", "*n", "*n", "*n")
local rem = {}
local remalt = {}
for i = 1, n do
  rem[i] = 0
  remalt[i] = 0
end
rem[n] = 1

local function calc(ia, ic)
  local ret = 1
  for i = 0, ic - 1 do
    ret = bmul(ret, getComb((ic - i) * ia, ia))
  end
  return bmul(ret, factinv[ic])
end

local ans = 0
for ia = a, b do
  local src = (ia - a) % 2 == 0 and rem or remalt
  local dst = (ia - a) % 2 == 0 and remalt or rem
  for i = 1, n do dst[i] = src[i] end
  local cmin = c
  local cmax = mmi(d, mfl(n / ia))
  for ic = cmin, cmax do
    local v = ic * ia
    local z = calc(ia, ic)
    ans = badd(ans, bmul(src[v], z))
    for i_n = v + 1, n do
      dst[i_n - v] = badd(dst[i_n - v], bmul(src[i_n], bmul(z, getComb(i_n, i_n - v))))
    end
  end
end
print(ans)


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

using namespace std;

#define int long long
#define ar array
#define vt vector
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define sz(x) (int)(x).size()

#define F_OR(i, a, b, s) for (int i=(a); (s)>0?i<(b):i>(b); i+=(s))
#define F_OR1(e) F_OR(i, 0, e, 1)
#define F_OR2(i, e) F_OR(i, 0, e, 1)
#define F_OR3(i, b, e) F_OR(i, b, e, 1)
#define F_OR4(i, b, e, s) F_OR(i, b, e, s)
#define GET5(a, b, c, d, e, ...) e
#define F_ORC(...) GET5(__VA_ARGS__, F_OR4, F_OR3, F_OR2, F_OR1)
#define FOR(...) F_ORC(__VA_ARGS__)(__VA_ARGS__)
#define EACH(x, a) for (auto& x: a)
const int M = 1e9 + 7;

template<class T>
bool umin(T &a, const T &b) {
    return b < a ? a = b, 1 : 0;
}

template<class T>
bool umax(T &a, const T &b) {
    return a < b ? a = b, 1 : 0;
}

template<class A>
void read(vt<A> &v);

template<class A, size_t S>
void read(ar<A, S> &a);

template<class T>
void read(T &x) {
    cin >> x;
}

void read(double &d) {
    string t;
    read(t);
    d = stod(t);
}

void read(long double &d) {
    string t;
    read(t);
    d = stold(t);
}

template<class H, class... T>
void read(H &h, T &... t) {
    read(h);
    read(t...);
}

template<class A>
void read(vt<A> &x) {
    EACH(a, x)read(a);
}

template<class A, size_t S>
void read(array<A, S> &x) {
    EACH(a, x)read(a);
}

string to_string(char c) {
    return string(1, c);
}

string to_string(bool b) {
    return b ? "true" : "false";
}

string to_string(const char *s) {
    return string(s);
}

string to_string(string s) {
    return s;
}

string to_string(vt<bool> v) {
    string res;
    FOR(sz(v))res += char('0' + v[i]);
    return res;
}

template<size_t S>
string to_string(bitset<S> b) {
    string res;
    FOR(S)res += char('0' + b[i]);
    return res;
}

template<class T>
string to_string(T v) {
    bool f = 1;
    string res;
    EACH(x, v) {
        if (!f)
            res += ' ';
        f = 0;
        res += to_string(x);
    }
    return res;
}

template<class A>
void write(A x) {
    cout << to_string(x);
}

template<class H, class... T>
void write(const H &h, const T &... t) {
    write(h);
    write(t...);
}

void print() {
    write("\n");
}

template<class H, class... T>
void print(const H &h, const T &... t) {
    write(h);
    if (sizeof...(t))
        write(' ');
    print(t...);
}

template<class T, class U>
void vti(vt<T> &v, U x, size_t n) {
    v = vt<T>(n, x);
}

template<class T, class U>
void vti(vt<T> &v, U x, size_t n, size_t m...) {
    v = vt<T>(n);
    EACH(a, v)vti(a, x, m);
}


int modpow(int x, int p) {
    if (!p) return 1;
    int val = modpow(x, p / 2);
    val = (val * val) % M;
    if (p & 1) val = (val * x) % M;
    return val;
}

int inverse(int x) {
    return modpow(x, M - 2);
}

void solve() {
    string s;
    read(s);
    
    write(s[0]);
    write(s.size() - 2);
    write(s.back());
}

int32_t main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    
    int tt = 1;
    //read(tt);
    FOR(tt) {
        //write("Case #", i + 1, ": ");
        solve();
        
    }
    
}


Measured memory_bytes: 3724
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace MyProgram
{
    public class Program
    {	
        public static void Main(string[] args)
        {
            string s1 = Console.ReadLine();
            string s2 = Console.ReadLine();
            
            s1 = s1.PadLeft(s2.Length, '0');
            s2 = s2.PadLeft(s1.Length, '0');

            bool equal = true;
            for(int i = 0 ; i < s1.Length ; i++)
            {
                if(s1[i] > s2[i])
                {
                    Console.WriteLine("GREATER");
                    equal = false;
                    break;
                }
                else if(s1[i] < s2[i])
                {
                    Console.WriteLine("LESS");
                    equal = false;
                    break;
                }
            }
            if(equal) Console.WriteLine("EQUAL");
        }
    }
}

Measured memory_bytes: 13140
#include <bits/stdc++.h>
using namespace std;
#define _MACRO(_1, _2, _3, NAME, ...) NAME
#define _repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define _rep(i,n) _repl(i,0,n)
#define rep(...) _MACRO(__VA_ARGS__, _repl, _rep)(__VA_ARGS__)
#define pb push_back
#define all(x) begin(x),end(x)
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#ifdef LOCAL
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
void _dbg(string){cerr<<endl;}
template<class H,class... T> void _dbg(string s,H h,T... t){int l=s.find(',');cerr<<s.substr(0,l)<<" = "<<h<<", ";_dbg(s.substr(l+1),t...);}
template<class T,class U> ostream& operator<<(ostream &o, const pair<T,U> &p){o<<"("<<p.first<<","<<p.second<<")";return o;}
template<class T> ostream& operator<<(ostream &o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}
#else
#define dbg(...) {}
#endif

int n;
double dp[303][303][303];
bool visited[303][303][303];

double solve(int i, int j, int k){
  if(visited[i][j][k]) return dp[i][j][k];
  else if(i==0 && k==0 && j==0) return 0;

  if(i>0) dp[i][j][k] += (solve(i-1,j,k) + 1) * i;
  if(j>0) dp[i][j][k] += (solve(i+1,j-1,k) + 1) * j;
  if(k>0) dp[i][j][k] += (solve(i,j+1,k-1) + 1) * k;

  dp[i][j][k] += n - i - j - k;
  dp[i][j][k] /= (i+j+k);

  visited[i][j][k] = true;
  return dp[i][j][k];
}

int main(){
  cin>>n;

  vector<int> c(3);
  rep(i,n){
    int d;
    cin>>d;
    d--;
    c[d]++;
  }

  printf("%.9f\n", solve(c[0], c[1], c[2]));

  return 0;
}


Measured memory_bytes: 243968
#include <bits/stdc++.h>
#define REP(i, n) for (long long i = 0; i < (long long)n; i++)
//#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using Vl = vector<ll>;
using vi = vector<int>;
using Graph = vector<vi>;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  // std::cout << std::fixed << std::setprecision(15); //"for float-base
  // problem"
  ll X;
  cin >> X;
  REP(i, 1e3) {
    for (ll j = -1e3; j <= 1e3; j++) {
      if (pow(i, 5) - pow(j, 5) == X) {
        cout << i << " " << j << endl;
        return 0;
      }
    }
  }
  cout << "Not found" << endl;
  return -1;
}

Measured memory_bytes: 4112
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,N) for(int i = 0;i < (int)(N);i++)
int main(){
 long double l;
  cin>>l;
 long double ans=(l*l*l)/27;
  cout<<fixed<<setprecision(20)<<ans<<endl;
}





Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <limits.h>
#include <cinttypes>
#include <string.h>
#include <bits/stdc++.h>

#define countof(a) (sizeof(a)/sizeof(*a))

#define vi vector<int>
#define vvi vector<vector<int> >
#define pi pair<int,int>
#define fi first
#define se second

#define FOR(var, to)          for (register s64 var = 0; var < (s64)to; var++)
#define FROMTO(var, from, to) for (register s64 var = from; var <= (s64)to; var++)

#define INIT(var) FOR(i,countof(var)) var[i] = 0
#define INPUT(var) FOR(i,countof(var)) var[i] = ri()

#define SORT(v) qsort(v,countof(v),sizeof(*v),int_less)
#define SORTT(v) qsort(v,countof(v),sizeof(*v),int_greater)

#define MOD 1000000007
#define INF (1 << 30)

typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;
typedef int8_t s8;
typedef int16_t s16;
typedef int32_t s32;
typedef int64_t s64;

using namespace std;

static inline int ri() {
  int a;
  scanf("%d", &a);
  return a;
}

static inline s64 rs64() {
  s64 a;
  scanf("%" SCNd64, &a);
  return a;
}

static inline void wi(int a) {
  printf("%d", a);
}

static inline void wu64(u64 a) {
  printf("%" PRIu64, a);
}

static inline void ws64(s64 a) {
  printf("%" PRId64, a);
}

int int_less(const void *a, const void *b) {
  return (*((const int*)a) - *((const int*)b));
}
int int_greater(const void *a, const void *b) {
  return (*((const int*)b) - *((const int*)a));
}

int main() {
    int a = ri();
    int b = ri();
    int c = ri();
    int d = ri();
    cout << (min(a,b)+min(c,d)) << endl;
 return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
struct Fast {Fast() {std::cin.tie(0); ios::sync_with_stdio(false);}} fast;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vll = vector<long long>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define mp make_pair
#define MOD 1000000007

int main() {
    int a, b, c, d, e, k;
    cin >> a >> b >> c >> d >> e >> k;
    cout << (e - a > k ? ":(" : "Yay!") << endl;
}



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


using namespace std;


int main() {
    char a, b; cin >> a >> b;

    int na = a - '0';
    int nb = b - '0';

    string sa = "";
    for (int i=0; i<nb; i++) sa += a;
    string sb = "";
    for (int i=0; i<na; i++) sb += b;

    vector<string> ss = {sa, sb};
    sort(ss.begin(), ss.end());

    cout << ss[0] << endl;
    return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<vector>
using namespace std;
int main() {
	int n;
	cin >> n;
	vector<string> s(n);
	for (int i = 0; i < n; i++) {
		cin >> s[i];
	}
	for (int i = 0; i <n; i++) {
		if (i > 0) {
			if (s[i - 1][s[i - 1].size() - 1] != s[i][0]) {
				cout << "No" << endl;
				return 0;
			}
			for (int j = 0; j < i; j++) {
				if (s[i] == s[j]) {
					cout << "No" << endl;
					return 0;
				}
			}
		}
	}
	cout << "Yes" << endl;
	return 0;
}


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

using namespace std;

int main()
{
    double N,K;
    cin >> N >> K;

    double p = 0;

    for(double i=1; i<=N; i++)
    {
        double temp = 1.0 / N ;
        int point = i;
        while(point < K){
            temp *= 0.5;
            point *= 2;
        }
        p += temp;
    }

    cout << fixed << setprecision(12) << p << endl;

    return 0;
}

Measured memory_bytes: 3744
#include<bits/stdc++.h>
using namespace std;
int main(){
	int tc; tc=1;
	while(tc--){
		int a,b,c; cin>>a>>b>>c;
		if(a == b) cout<<c;
		if(a == c) cout<<b;
		if(b == c) cout<<a;
		cout<<endl;
	}
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,s,n) for(ll i = s; i < n; i++)
typedef long long ll;
const ll maxn = 100005;
ll N, W;
ll d[105][maxn];
ll w[maxn];
ll v[maxn];
ll dp(ll a, ll b){
	if(d[a][b]!=-1)return d[a][b];
	ll ans = 0;
	if(w[a]<=b)ans = max(ans, dp(a-1, b-w[a])+v[a]);
	ans = max(ans, dp(a-1, b));
	return d[a][b] = ans;
}


int main(){
	cin>>N>>W;
	rep(i,1,N+1)cin>>w[i]>>v[i];
	memset(d,-1,sizeof d);
	rep(i,0,W+1) d[0][i] = 0;
	cout<<dp(N,W)<<endl;
}

Measured memory_bytes: 82304
#include <stdio.h>
#include <string.h>
#define min(p,q)((p)<(q)?(p):(q))

int dp[10010];
int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	for(int i=1;i<10005;i++)dp[i]=2e9;
	while(n--){
		int v,w;
		scanf("%d%d",&v,&w);
		for(int i=10000-v;i>=0;i--)dp[i+v]=min(dp[i+v],dp[i]+w);
	}
	for(int i=10000;i>=0;i--)if(dp[i]<=m){
		printf("%d\n",i);
		return 0;
	}
}


Measured memory_bytes: 2112
import math
n = int(input())
scores = 0
for a in range(1, n+1):
    for b in range(1, n+1):
        gcd_ab = math.gcd(a, b)
        for c in range(1, n+1):
            score = math.gcd(gcd_ab, c)
            scores += score
print(scores)

Measured memory_bytes: 9180
#include<iostream>
#include<math.h>
#include<stdlib.h>
#include<string>
#include<limits.h>
#include<utility>
#include<vector>
#include<tuple>
#include<algorithm>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i,n) for(int i=0;i<n;i++)
#define ALL(A) A.begin(),A.end()
bool comparator(P a, P b) {
	return a.first / a.second < b.first / b.second;
}

int main() {
	int h1, m1, h2, m2;
	ll k;
	cin >> h1 >> m1 >> h2 >> m2 >> k;
	if (m1 > m2) {
		m2 += 60;
		h2--;
	}
	ll ans = (h2 - h1) * 60 + (m2 - m1)-k;
	cout << ans << endl;
}

Measured memory_bytes: 3160
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<string>
#include<vector>
#include<map>  
#include<set>
#include<iterator>
#include<list>
#include<utility>
#include<numeric>
#include<cstdlib>
#include<queue>
#include<stack>
#include<bitset>
//#include<bits/stdc++.h>

#define PI  2*acos(0.0)
#define pb push_back


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


int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0), cout.tie(0);


ll n;
cin>>n;
while(n--)
{
	cout<<"ACL";
}

cout<<"\n";










	
	
	return 0;
	
	
}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
#define ALL(a) a.begin(), a.end()
#define fi first
#define se second
#define mp make_pair
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;

ll N,M,H,W,K,Q,A,B;
string S;
//const ll MOD = 998244353;
const ll MOD = (1e+9) + 7;
const ll INF = 1LL << 60;
typedef pair<ll,ll> P;


int main(){
    mat sum(410, vec(401,0));
    //sum[a][c] = 0 + 1^c + ... + a^c
    //sum[B][c] - sum[A-1][c]で使う
    reps(i,1,410){
        ll temp = 1;
        rep(j,401){
            sum[i][j] = temp;
            (temp *= i)%=MOD;
        }
    }
    rep(j,401){
        reps(i,1,410) (sum[i][j] += sum[i-1][j])%=MOD;
    }
    ll C;
    cin>>N>>C;
    vec a(N), b(N);
    rep(i,N) cin>>a[i];
    rep(i,N) cin>>b[i];
    mat dp(N + 1, vec(C + 1,0));
    dp[0][0] = 1;
    rep(i,N){
        rep(j,C + 1){
            rep(k, j + 1){
                (dp[i+1][j] += dp[i][j - k] * ((sum[b[i]][k] - sum[a[i] - 1][k] + MOD)%MOD))%=MOD;
            }
        }
    }
    /*rep(i,N+1){
        rep(j,C+1) cout<<dp[i][j]<<' ';
        cout<<endl;
    }*/
    cout<<dp[N][C]<<endl;
}

Measured memory_bytes: 2816
#include <iostream>
#include <string>
#include <stdlib.h>
#define llint long long

using namespace std;

llint n;
llint diff[100005];
string s, t;

int calc(string s)
{
  int h = atoi(s.substr(0, 2).c_str());
  int m = atoi(s.substr(3, 2).c_str());
  int b = atoi(s.substr(6, 2).c_str());
  return h * 3600 + m * 60 + b;
}

int main(void)
{
  while(1){
    cin >> n;
    if(n == 0) break;
    for(int i = 0; i < 100005; i++) diff[i] = 0;
    for(int i = 1; i <= n; i++){
      cin >> s >> t;
      diff[calc(s)]++, diff[calc(t)]--;
    }
    llint ans = diff[0];
    for(int i = 1; i < 100005; i++){
      diff[i] += diff[i-1];
      ans = max(ans, diff[i]);
    }
    cout << ans << endl;
  }
  return 0;
}



Measured memory_bytes: 3908
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int times = sc.nextInt();  //くじ引きを行った回数
		//くじの結果が入る
		List<String> kuji = new ArrayList<String>();

		//くじを行う回数分、結果をkujiに入力する
		for(int i=0 ; i<times ; i++) {
			kuji.add(sc.next());
		}

		//重複を許さないHashSetを宣言
		//resultにkujiの要素を代入
		HashSet<String> result = new HashSet<String>(kuji);

		//.size()で要素数を返す
		System.out.print(result.size());

		sc.close();
	}
}

Measured memory_bytes: 68764
#include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<set>
#include<string>
#include<string.h>
#include<complex>
#include<math.h>
using namespace std;
typedef long long int llint;
typedef vector<int> vint;
typedef vector<llint> vllint;
typedef vector<pair<int, int>> vpint;
typedef vector<pair<llint, llint>> vpllint;
#define rep(i,n) for(int i=0;i<n;i++)
#define yes(ans) if(ans)cout<<"yes"<<endl;else cout<<"no"<<endl;
#define Yes(ans) if(ans)cout<<"Yes"<<endl;else cout<<"No"<<endl;
#define YES(ans) if(ans)cout<<"YES"<<endl;else cout<<"NO"<<endl;
#define POSSIBLE(ans) if(ans)cout<<"POSSIBLE"<<endl;else cout<<"IMPOSSIBLE"<<endl;

class UnionFind {
public:
	//親の番号を格納する。親だった場合は-(その集合のサイズ)
	vector<int> Parent;

	//作るときはParentの値を全て-1にする
	//こうすると全てバラバラになる
	UnionFind(int N) {
		Parent = vector<int>(N, -1);
	}

	//Aがどのグループに属しているか調べる
	int root(int A) {
		if (Parent[A] < 0) return A;
		return Parent[A] = root(Parent[A]);
	}

	//自分のいるグループの頂点数を調べる
	int size(int A) {
		return -Parent[root(A)];//親をとってきたい
	}

	//AとBをくっ付ける
	bool connect(int A, int B) {
		//AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
		A = root(A);
		B = root(B);
		if (A == B) {
			//すでにくっついてるからくっ付けない
			return false;
		}

		//大きい方(A)に小さいほう(B)をくっ付けたい
		//大小が逆だったらひっくり返しちゃう。
		if (size(A) < size(B)) swap(A, B);

		//Aのサイズを更新する
		Parent[A] += Parent[B];
		//Bの親をAに変更する
		Parent[B] = A;

		return true;
	}
};

bool check(int a, int b) {
	return a > b;
}

int main() {
	int n;
	cin >> n;
	int ans = 0;
	while (n > 0) {
		ans += n % 10;
		n /= 10;
	}
	if (ans == 1) {
		ans *= 10;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <tuple>
#include <vector>
#include <string>
#include <queue>
#include <cmath>
#include <set>
#include <map>
#include <cassert>

using namespace std;
using ll = long long;

int main()
{
    double x;
    cin >> x;
    if(x == 1){
        cout << 0 << endl;
    }else{
        cout << 1 << endl;
    }
    return 0;
}

Measured memory_bytes: 3696
fn main() {
    let s = std::io::stdin();
    let mut sc = Scanner { stdin: s.lock() };
    let r: u64 = sc.read();
    println!("{}", 3 * r * r);
}

pub struct Scanner<R> {
    stdin: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n')
            .take_while(|&b| b != b' ' && b != b'\n')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 4352
#include<iostream>
using namespace std;
int main()
{
	long long int a,b,k;
	cin>>a>>b>>k;
if(k<=a) {
a=a-k;
}
else{
	
	k=k-a;
	a=0;
	if(k<=b) b=b-k;
	else{
		b=0;
	}
}
cout<<a<<" "<<b<<endl;
}
	

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
using namespace std;
int main(void) {
  string s;
  cin >> s;
  int n = (int)(s.length());
  int ans = n;
  for (int i = 1; i < n; i++) {
    if (s[i] != s[i - 1]) {
      ans = min(ans, max(i, n - i));
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 512
/*{{{*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#include<assert.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define FOR(I, A, B) for (int I = (A); I <= (B); ++I)
#define FORS(I, S) for (int I = 0; S[I]; ++I)
#define RS(X) scanf("%s", (X))
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define CASET int ___T; scanf("%d", &___T); for(int cs=1;cs<=___T;cs++)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<PII> VPII;
typedef pair<LL,LL> PLL;
typedef vector<PLL> VPLL;
template<class T> void _R(T &x) { cin >> x; }
void _R(int &x) { scanf("%d", &x); }
void _R(LL &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }
template<class T> void _W(const T &x) { cout << x; }
void _W(const int &x) { printf("%d", x); }
void _W(const LL &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template<class T,class U> void _W(const pair<T,U> &x) {_W(x.F); putchar(' '); _W(x.S);}
template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
#ifdef HOME
 #define DEBUG(...) {printf("# ");printf(__VA_ARGS__);puts("");}
#else
 #define DEBUG(...)
#endif
int MOD = 1e9+7;
void ADD(LL& x,LL v){x=(x+v)%MOD;if(x<0)x+=MOD;}
/*}}}*/
const int SIZE = 1e6+10;
int main(){
    int K,X;
    R(K,X);
    W((K*500>=X)?"Yes":"No");
    return 0;
}


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

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

    int n;
    cin >> n;
    vector<long long> A(n);
    for(int i = 0; i < n; i++){
        cin >> A[i];
    }

    vector<long long> B(n + 1, 0);
    map<long long, long long> mp;
    mp[0]++;
    for(int i = 1; i < n + 1; i++){
        B[i] = A[i - 1] + B[i - 1];
        mp[B[i]]++;
    }

    long long ans = 0;
    for(auto x : mp){
        ans += (x.second * (x.second - 1)) / 2;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 15872
#include<iostream>
#include<iomanip>
#include<math.h>
#include<algorithm>
#include<utility>
#include<queue>
#include<string.h>
#include<string>
#include<set>
#include<map>
#include<unordered_map>
#include<functional>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll INF=2e18;
const ll MOD=1e9+7;

ll N,D,A;
P xh[200010];
set<ll> pointVec;
map<ll,ll> damage;
int main(){
    cin>>N>>D>>A;
    for(ll i=0;i<N;i++){
        cin>>xh[i].first>>xh[i].second;
        pointVec.insert(xh[i].first);
    }
    sort(xh,xh+N);
    ll pre=0;
    ll ans=0;
    for(ll i=0;i<N;i++){
        ll x=xh[i].first;
        ll h=xh[i].second;
        if(i>0)damage[x]+=damage[pre];
        h-=damage[x];
        if(h>0){
            damage[x]+=((h-1)/A+1)*A;
            auto it=pointVec.upper_bound(x+2*D);
            if(it!=pointVec.end()){
                damage[*it]-=((h-1)/A+1)*A;
            }
            ans+=((h-1)/A+1);
        }
        pre=x;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 25216
#include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);

signed main() {
	vector<int> v(4); rep(i, 0, 4) { cin >> v[i]; }
	sort(v.begin(), v.end());
	if (v[0] == v[1] && v[2] == v[3])cout << "yes" << endl;
	else cout << "no" << endl;
	return 0;
}

Measured memory_bytes: 3160