akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <iomanip>
#include <map>
#include <set>
#include <tuple>
#include <unordered_map>
#include <iterator>
#include <string>
#include <limits>

using namespace std;

using i64 = int64_t;
using P = pair<i64, i64>;
i64 mod = 1000000007;
int int_max = 2147483647;
int max_n = 1e5;
using mat2d_t = std::vector<std::vector<int64_t>>;

void dfs(set<std::string>& m, std::string str, char mx, const int N) {
    if (str.size() >= N)  {
        m.insert(str);
        return;
    }

    for (char c=mx; c >= 'a'; --c) {
        string tmp = str + c;
        dfs(m, tmp, c == mx ? (mx+1): mx, N);
    }
}

int main(int argc, char **argv) {
    int n;
    cin >> n;

    set<std::string> ans;

    dfs(ans, "", 'a', n);

    for (auto s : ans) {
        cout << s << endl;
    }

    return 0;
}


Measured memory_bytes: 12416
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/integer/common_factor.hpp>
#include <boost/integer/common_factor_rt.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>

using std::string;
using std::vector;
using std::set;
using std::multiset;
using std::unordered_set;
using std::map;
using std::multimap;
using std::unordered_map;
using std::pair;
using std::cin;
using std::cout;

typedef uintmax_t    ull;
typedef intmax_t     ll;
typedef uint64_t     ul;
typedef uint32_t     ui;
typedef uint8_t      uc;

typedef boost::multiprecision::number<boost::multiprecision::cpp_dec_float<1000>> cpp_dec_float_1000;

constexpr char CRLF = '\n';
constexpr char SPACE = ' ';
constexpr char VECTOR_COUT_SEPARATOR = SPACE;
constexpr ll INF = 1000'000'007;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> std::ostream& operator<< (std::ostream& os, const std::vector<T>& vc) { for(auto it = vc.begin(); it != vc.end(); ++it) { if (std::next(it) == vc.end()) os << *it; else os << *it << VECTOR_COUT_SEPARATOR; } return os; }
template<class T1, class T2> inline std::ostream & operator<< (std::ostream & os, const std::pair<T1, T2> & p) { return os << p.first << ' ' << p.second; }

void solve(void)
{
  int a, b, x; cin >> a >> b >> x;
  auto ans = a <= x && (a + b) >= x;
  
  cout << (ans ? "YES" : "NO") << CRLF;
  return;
}

int main(void)
{
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);

  solve();

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define DEBUG(x) cout << #x << " = " << x << endl
#define pb push_back
using namespace std;
typedef long long ll;


const int MAXN = 100005;

int prs[MAXN];
int prt[MAXN];
int main()
{
    //freopen("input.txt", "r", stdin);
    string s, t;
    cin >> s;
    cin >> t;

    prs[0] = 0;
    for (int i = 0; i < s.size(); i++)
    {
        if (s[i] == 'A')
            prs[i+1] = prs[i] + 1;
        else
            prs[i+1] = prs[i] + 2;
    }

    prt[0] = 0;
    for (int i = 0; i < t.size(); i++)
    {
        if (t[i] == 'A')
            prt[i+1] = prt[i] + 1;
        else
            prt[i+1] = prt[i] + 2;
    }

    int q;
    cin >> q;
    for (int i = 0; i < q; i++)
    {
        int a, b, c, d;
        cin >> a >> b >> c >> d;
        if ( (prs[b] - prs[a-1]) % 3 == (prt[d] - prt[c-1]) % 3 )
            cout << "YES" << endl;
        else
            cout << "NO" << endl;
    }
    return 0;
}



Measured memory_bytes: 1664
#include<bits/stdc++.h>
using namespace std;
int main(){
	long long int n,a,b;
	cin>>n>>a>>b;
	long long int ans=(n/(a+b))*a;
	if(n%(a+b)>=a){
		ans+=a;
	}
	else
	ans=ans+n%(a+b);
	cout<<ans<<endl;
}

Measured memory_bytes: 256
x = gets()
y = x.split()
h = y[0].to_i
w = y[1].to_i

until h == 0 && w == 0
 i = 1
 while i <= h
  k = "#" * w
  puts  k
  i += 1
 end
 puts ""
 x = gets()
 y = x.split()
 h = y[0].to_i
 w = y[1].to_i
end


Measured memory_bytes: 6892
//g++ -std=c++14 test.cpp -o test.out

#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <iomanip>
#include <vector>
#include <queue>
#include <map> 
#include <utility>
#include <limits.h>
#include <bitset>
#include <set>
using namespace std;
 
#define LL long long int
const LL INF = (LL)(1e18)+1;
const int INF_INT = 2147483647-1e6-1;
const LL mod = 1000000007ll;
const int mod_int = 1000000007;

LL K,T;
LL A[100];

LL ans = 0;

void solve(){
	sort(A,A+T,greater<LL>());
	ans = max(0LL,K-2*(K-A[0])-1);
}

int main(){
    cin >> K >> T;
    for(int i=0;i<T;i++) cin >> A[i];
 
    solve();

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

Measured memory_bytes: 256
import java.io.*;
import java.util.*;

public class Main{

	public static void main(String[] args) throws IOException {
		Scanner sc=new Scanner();
		PrintWriter out=new PrintWriter(System.out);
		int n=sc.nextInt(),m=sc.nextInt(),c=sc.nextInt();
		int []b=new int [m];
		for(int i=0;i<m;i++)
			b[i]=sc.nextInt();
		int ans=0;
		while(n-->0) {
			int x=c;
			for(int i=0;i<m;i++)
				x+=sc.nextInt()*b[i];
			if(x>0)
				ans++;
		}
		out.println(ans);
		
		
		out.close();

	}
	static class Scanner
	{
		BufferedReader br;
		StringTokenizer st;
		Scanner(){
			br=new BufferedReader(new InputStreamReader(System.in));
		}
		Scanner(String fileName) throws FileNotFoundException{
			br=new BufferedReader(new FileReader(fileName));
		}
		String next() throws IOException {
			while(st==null || !st.hasMoreTokens())
				st=new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		String nextLine() throws IOException {
			return br.readLine();
		}
		int nextInt() throws IOException{
			return Integer.parseInt(next());
		}
		long nextLong()  throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}
		double nextDouble() throws NumberFormatException, IOException {
			return Double.parseDouble(next());
		}
	}
}


Measured memory_bytes: 23380
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(input())
def pli(a): return "".join(list(map(str, a)))

s = rls()
if(len(s) % 2 == 1):
    s.remove(s[-1])
else:
    s = s[:-2]
for i in range(len(s) // 2):
    if(s[:len(s)//2] == s[len(s)//2:]):
        print(len(s))
        break
    s = s[:-2]

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

const ll infll=9223372036854775806;
const int inf=2147483646;

int main()
{
	//freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
	ios_base::sync_with_stdio(false); cin.tie(0);
	ld t,x;
	cout.precision(18);
	cin>>t>>x;
	cout<<t/x;
	return 0;
}

Measured memory_bytes: 256
#include <queue>
#include <vector>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#define MP make_pair
#define ll long long
#define fi first
#define se second
using namespace std;

template <typename T>
void read(T &x) {
    x = 0; bool f = 0;
    char c = getchar();
    for (;!isdigit(c);c=getchar()) if (c=='-') f=1;
    for (;isdigit(c);c=getchar()) x=x*10+(c^48);
    if (f) x=-x;
}

template<typename F>
inline void write(F x, char ed = '\n') {
    static short st[30];short tp=0;
    if(x<0) putchar('-'),x=-x;
    do st[++tp]=x%10,x/=10; while(x);
    while(tp) putchar('0'|st[tp--]);
    putchar(ed);
}

template <typename T>
inline void Mx(T &x, T y) { x < y && (x = y); }

template <typename T>
inline void Mn(T &x, T y) { x > y && (x = y); }

const int P = 1e9 + 7;
const int N = 400005;
char s[N];
int sum[N], f[N], a[N], m, n;
ll inv[N], fac[N], ans;
template <typename T>
inline void Add(T &x, T y) { x += y, x >= P && (x -= P, 0); }

inline ll C(int n, int m) {
    if (n < m || n < 0) return 0;
    return fac[n] * inv[m] % P * inv[n-m] % P;
}

namespace subtask {
    int main(int lim) {
        if (n & 1) return write(0), 0;
        int pre = 1;
        for (int i = 1;i <= m; i++) if (!a[i]) {
            if ((i - pre) & 1) Mn(lim, i - pre);
            pre = i + 1;
        }
        n >>= 1, lim = (lim + 1) >> 1;
        f[0] = sum[0] = 1;
        for (int i = 1;i <= n; i++) {
            f[i] = sum[i-1] - (i >= lim + 1 ? sum[i - lim - 1] : 0), Add(f[i], P);
            sum[i] = sum[i-1], Add(sum[i], f[i]);
        }
        for (int i = 1;i <= lim; i++)
            Add(ans, 1ll * f[n-i] * i * 2 % P);
        write(ans);
        return 0;
    }
}

int main() {
    read(n), read(m), scanf ("%s", s + 1);
    for (int i = 1;i <= m; i++) a[i] = s[i] == s[1];
    for (int i = 1;i <= m; i++)
        if (!a[i]) return subtask::main((i - 1) | 1);
    if (n == 1) return write(0), 0;
    inv[0] = inv[1] = fac[0] = fac[1] = 1;
    for (int i = 2;i <= n + 2; i++) 
        inv[i] = (P - P / i) * inv[P % i] % P;
    for (int i = 2;i <= n + 2; i++)
        inv[i] = inv[i-1] * inv[i] % P, fac[i] = fac[i-1] * i % P;
    for (int i = 0;i + i <= n; i++) 
        ans += C(n - i, i) + C(n - 2 - i, i);
    write(ans % P);
    return 0;
}


Measured memory_bytes: 7212
w, h, n = gets.chomp.split(" ").map(&:to_i)
mm = Array.new(h){Array.new(w,  true)}
n.times do
  x, y, a = gets.chomp.split(" ").map(&:to_i)
  x -= 1
  y -= 1
  case a
  when 1
    h.times do |i|
      w.times do |j|
        mm[i][j] = false if j <= x
      end
    end
  when 2
    h.times do |i|
      w.times do |j|
        mm[i][j] = false if j > x
      end
    end
  when 3
    h.times do |i|
      if i <= y then
        mm[i] = [false] * w
      end
    end
  when 4
    h.times do |i|
      if i > y then
        mm[i] = [false] * w
      end
    end
  end
end

puts mm.flatten.count{|x| x}


Measured memory_bytes: 3708
def main():
    N=int(input())
    name=[]
    time=[]
    for i in range(N):
        key, t =[i for i in input().split()]
        name +=[key]
        time +=[int(t)]

    X = input()
    ind = name.index(X)
    print(sum(time[ind+1:]))

main()


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define ALL(obj) begin(obj), end(obj)
#define debug(x) cerr << #x << ": " << x << '\n'
using namespace std;
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
template <class T>
bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return 1;
    }
    return 0;
}

using ll = long long;
using ull = unsigned long long;
const int INF = 1e9;
// const int MOD = 1e9 + 7;

using P = pair<ll, ll>;
int main() {
    ll N, T;
    cin >> N >> T;
    vector<ll> t(N);
    for (int i = 0; i < N; i++) {
        cin >> t.at(i);
    }
    ll ans = 0;
    ll s = 0, g = 0;
    for (int i = 0; i < N; i++) {
        if (t[i] <= g) {
            g = t[i] + T;
        } else {
            ans += g - s;
            s = t[i];
            g = t[i] + T;
        }
    }
    ans += g - s;
    cout << ans << endl;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll, ll> Pll;
#define rep(i,n) for(int (i) = 0; (i) < (int)(n); (i)++)
#define debug(var)  do{std::cout << #var << " : ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void err() {cout << -1 << endl;}
#define all(x) (x.begin(), x.end())

const int MOD = 1000000007;
const int INF = 1e9;

#define PI acos(-1);
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};
int ddx[8] = {1,1,1,-1,-1,-1,0,0};
int ddy[8] = {0,1,-1,0,1,-1,1,-1};


int main(){
    string s;
    cin >> s;
    int n = (s[5] - '0') * 10 + s[6] - '0';
    if(n < 5) cout << "Heisei" << endl;
    else cout << "TBD" << endl;
}


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

int main(){

  int N;
  cin >> N;

  int64_t L_b1,L_b2,L;

  if (N == 0)
  {
    L = 2;
  }
  else if (N ==1)
  {
    L = 1;
  }
  else
  {
    L_b1 = 1;
    L_b2 = 2;
    for (int i = 1; i<N; i++)
    {
      L = L_b2 + L_b1;
      L_b2 = L_b1;
      L_b1 = L;
    }
  }
  cout << L << endl;
}

Measured memory_bytes: 3596
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
template<class T> using V = vector<T>;
template<class T> using VV = vector<vector<T> >;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define repb(i, n) for(ll i = (n)-1; i >= 0; i--)
#define repr(i, a, b) for(ll i = (a); i < (b); i++)
#define reprb(i, a, b) for(ll i = (b)-1; i >= (a); i--)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((ll)(x).size())
const ll MOD = 1000000007;
const ll INF = 100000000000000000LL;
const ld EPS = 1e-12L;
const ld PI = 3.1415926535897932385L;
inline ll GCD(ll a, ll b){ return b?GCD(b, a % b):a; }
inline ll LCM(ll a, ll b){ return a/GCD(a, b)*b; }
inline ll powint(ull x, ll y){ ll r=1; while(y){ if(y&1) r*=x; x*=x; y>>=1; } return r; }
inline ll powmod(ll x, ll y, ll m = MOD){ ll r=1; while(y){ if(y&1) r*=x; x*=x; r%=m; x%=m; y>>=1; } return r; }
template<class S, class T>inline bool chmax(S &a, const T &b){ if(a<b) { a=b; return 1; } return 0; }
template<class S, class T>inline bool chmin(S &a, const T &b){ if(b<a) { a=b; return 1; } return 0; }
#ifdef OJ_LOCAL
#include "dump.hpp"
#else
#define dump(...) ((void)0)
#endif

int main(){
    cin.tie(0); ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    string s;
    cin >> s;
    ll n = SZ(s);
    vll cnt(256, 0);
    ll ans = 1;
    rep(i, n){
        if(i >= 1){
            ans += i - cnt[s[i]];
        }
        cnt[s[i]]++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 720
#include<bits/stdc++.h>
#define se second
#define fi first
using namespace std;
const int maxn = 1e6 + 4, mod = 11092019, maxx = 1e6 + 1;
typedef pair<int,int> ii;
typedef pair<long long, long long> ll;
int n, m, d[maxn], dp[maxn], st[maxn*4], ans, f[maxn], wans, w[maxn*4];
vector<int> a[maxn];
vector<ii> V;

void _accepted_by_one_hit_()
{
    #ifdef NTMA
        freopen("abc.inp", "r", stdin);
        freopen("abc.out", "w", stdout);
    #endif
    ios::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
}
int main()
{
    _accepted_by_one_hit_();

    string s; cin >> s;
    if (s[2] == s[3] && s[4] == s[5]) cout << "Yes";
    else cout << "No";  
}

Measured memory_bytes: 24832
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
 
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
 
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;
 
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
 
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
const int MOD = 1000000007;
const char nl = '\n';
const int MX = 100001; //check the limits, dummy
 
int main() 
{
	
	
    int N; 
    cin >> N;
    ll rem = 1;
    ll A[N+1];
    F0R(i, N+1) 
    {
        cin >> A[i];
    }
    F0R(i, N+1) 
    {
        rem -= A[i];
        if (rem < 0) 
        {
            cout << -1 << nl; return 0;
        }
        rem *= 2; 
        if (rem > 1e15) rem = 1e15;
    }
    rem = 0;
    F0R(i, N+1) 
    rem += A[i];
    ll cur = 1;
    ll ans = 0;
    F0R(i, N+1) 
    {
        ans += min(cur, rem);
        cur -= A[i];
        cur *= 2; 
        if (cur > 1e15) cur = 1e15;
        rem -= A[i];
    }
    cout << ans << nl;
	
	return 0;
}



Measured memory_bytes: 4356
#include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <unordered_map>
#include <algorithm>
#include <time.h>
using namespace std;
typedef long long ll;
const int maxn = 100005;
const int mod = 1000000007;

int n,a[maxn];
int val,pos1,pos2,pos[maxn];

void gcd(ll a,ll b, ll& d,ll& x,ll& y){
        if(!b) {d=a;x=1;y=0;}
        else   {	gcd(b,a%b,d,y,x);	y-=a/b*x;}
}

ll inv(ll a,ll n)  { 
        ll d,x,y;	gcd(a,n,d,x,y);
        return d==1?(x%n+n)%(n/d):-1; 
}

ll A[maxn],invA[maxn];

ll c(int x, int y) {
  if (x < y) return 0;
  if (x == y) return 1;
  return A[x]*invA[y]%mod*invA[x-y]%mod;
}

ll ans[maxn];

int main() {
#ifdef suiyuan2009
  freopen("in.cpp","r",stdin);
#endif
  cin>>n;
  A[0]=1,invA[0]=inv(A[0],mod);
  for(int i=1;i<maxn;i++){
    A[i]=A[i-1]*i%mod;
    invA[i]=inv(A[i],mod);
  }
  for(int i=1;i<=n+1;i++)cin>>a[i];
  for(int i=1;i<=n+1;i++){
    if(!pos[a[i]])pos[a[i]]=i;
    else {
      val=a[i];
      pos1=pos[a[i]];
      pos2=i;
      break;
    }
  }
  for(int i=1;i<=n+1;i++){
    ll tmp=c(n+1,i);
    int l=pos1-1,r=n+1-pos2;
    int all=l+r;
    tmp=((tmp-c(all,i-1))%mod+mod)%mod;
    ans[i]=tmp;
  }
  for(int i=1;i<=n+1;i++)cout<<ans[i]<<endl;
  return 0;
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define N 4010
#define mod 998244353
using namespace std;
typedef long long ll;
inline int read()
{
	int x=0,f=1; char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1; ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0'; ch=getchar();}
	return x*f;
}
int n,len,pp[5010];
bitset <N+10> T,M,X,C;
inline int gt(bitset <N+10> &s)
{
	for(int i=N;i>=0;i--) if(s[i]) return i;
	return 0;
}
int main()
{
	n=read(); cin >> X; cin >> T;
	for(int i=1;i<n;i++)
	{
		cin >> M; //cout << M << endl;
		while(1)
		{
			if(gt(T)<gt(M)) swap(M,T);
			int tt=gt(M);
			for(int j=gt(T);j>=gt(M);j--) 
				if(T[j]) T^=(M<<(j-tt));
			if(T.none()) {T=M; break;} 
		}
		//cout << T << endl;
	}
	pp[0]=1; for(int i=1;i<=N;i++) pp[i]=(pp[i-1]<<1)%mod;
	int tt=gt(T),Ans=0;
	//cout << T << endl;
	for(int i=N-1;i>=tt;i--)
	{
		if(X[i]) Ans+=pp[i-tt],Ans%=mod;
		if(X[i]!=C[i]) C^=T<<(i-tt);
 	}
 	for(int i=tt;i>=0;i--)
 	{
 		if(X[i]>C[i]) break;
 		if(X[i]<C[i]) {Ans--; break;}
 	}
 	Ans++; cout << (Ans % mod + mod)%mod << endl;
	return 0;
}

Measured memory_bytes: 384
#include<stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
int main(){
	int a;
	scanf("%d",&a);
	if(a>=1000){
		printf("ABD");
	}
	else{
		printf("ABC");
	}

	
		
	return 0;
}

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

using namespace std;
int aa[100];
int main()
{
    int i,a,b,c=0,n;
    char ch;
    cin>>n;
    getchar();
    for(i=0; i<n; i++){
       cin>>ch;
       aa[ch]++;
    }
    for(i=0; i<=127; i++){
        if(aa[i]>0)
            c++;
    }
    if(c==4)
        cout<<"Four"<<endl;
    else if(c==3)
        cout<<"Three"<<endl;
}



Measured memory_bytes: 256
#!/usr/bin/env python3
import collections
N = int(input())
A = list(map(int, input().split()))

T = collections.Counter(A)
hen1 = 0 # 小さい
hen2 = 0 # 大きい
for h, c in sorted(T.items(), key=lambda x:x[0]):
    if c >= 4:
        hen1 = h
        hen2 = h
    elif c >= 2:
        if hen1 >= hen2:
            hen2 = h
        else:
            hen1 = h
print(hen1*hen2)




Measured memory_bytes: 22436
import java.util.*;

public class Main
{
	public static void main(String args[])
	{
		Scanner sc=new Scanner(System.in);
		int a=sc.nextInt();
		
		if(a==1)
		{
			System.out.println("Hello World");
		}
		else
		{
			int b=sc.nextInt();
			int c=sc.nextInt();
			System.out.println(b+c);
		}
	}
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
#define rep(i,j,k) for(int i=j;i<k;i++)
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
LL hako[100100];
int main(){
  int n;
  cin >> n;
  rep(i,0,n)cin >> hako[i];
  int bufa = 0;
  int bufb = 0;
  bool res = true;
  rep(i,0,n){
    if(bufa < hako[i]){
      bufa = hako[i] -1;
    }else{
      bufa = hako[i];
    }
    if(bufb > bufa){
      cout << "No" << endl;
      return 0;
    }else{
      bufb = bufa;
    }
  }
  cout << "Yes" << endl;
	return 0;
}


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

int main(){
  int n;
  cin >> n;
  string s;
  cin >> s;
  int w[n],e[n];
  if(s[0] == 'W'){
    w[0] = 1;
    e[0] = 0;
  }
  else{
    w[0] = 0;
    e[0] = 1;
  }

  for (int i=1;i<n;i++){
    if(s[i] == 'W'){
      w[i] = w[i-1] + 1;
      e[i] = e[i-1];
    }
    else{
      w[i] = w[i-1];
      e[i] = e[i-1] + 1;
    }
  }

  int count = n;
  int m;
  m = e[n-1] - e[0];
  count = min(count,m);
  m = w[n-2];
  count = min(count,m);
  for (int i=1;i<n-1;i++){
    m = w[i-1] + e[n-1] - e[i];
    count = min(count,m);
  }
  cout << count << endl;
  return 0;
}


Measured memory_bytes: 3076
import numpy as np

S = input()
T = input()

F = -np.ones(26,dtype=np.int)
G = -np.ones(26,dtype=np.int)
for i in range(len(S)):
    s = ord(S[i])-ord('a')
    t = ord(T[i])-ord('a')
    if F[s] < 0:
        F[s] = t
    elif F[s] != t:
        print('No')
        exit()

    if G[t] < 0:
        G[t] = s
    elif G[t] != s:
        print('No')
        exit()

print('Yes')

Measured memory_bytes: 13184
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define MP make_pair
#define PB push_back
typedef long long ll;
const int N_MAX=1300000;
bool prime[N_MAX];
int main(){
	int n;
	rep(i,N_MAX)prime[i]=true;
	prime[0]=prime[1]=false;
	rep(i,N_MAX)if(prime[i])for(int j=i*2;j<N_MAX;j+=i)prime[j]=false;
	while(cin>>n,n){
		int i,j;
		for(i=n;!prime[i];i--);
		for(j=n;!prime[j];j++);
		cout<<j-i<<endl;
	}
	return 0;
}

Measured memory_bytes: 2428
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int B[] = new int[N - 1];
		for(int i = 0 ; i < N - 1 ; ++i){
			B[i] = sc.nextInt();
		}
		int A[] = new int[N];
		// B[0] >= Max(A[0] , A[1])
		// B[1] >= Max(A[1] , A[2])
		// B[2] >= Max(A[2] , A[3])		
		// A[0] = B[0]
		// A[1] = Math.min(B[0] , B[1])
		// A[2] = Math.min(B[1] , B[2])
		// A[3] = B[2]
		// 0 , 0 , 10 , 10 , 10, 23
		A[0] = B[0];
		for(int i = 1 ; i < N - 1 ; ++i){
			A[i] = Math.min(B[i - 1], B[i]);
		}
		A[N - 1] = B[N - 2];
		int S = 0;
		for(int a : A) {
			S += a;
		}
		System.out.println(S);		
	}
}


Measured memory_bytes: 21844
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
	int N;

	vector<long> A;
	long a;

	cin >> N;


	for (int i = 0; i<N; i++)
	{

		cin >> a;
		A.emplace_back(a);

	}


	sort(A.begin(), A.end());

	cout << A.at(N - 1) - A.at(0) << endl;


	

	return 0;

}

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

int main(){
  string s;
  cin >> s;
  int ret = 0;
  for(int i=0; i<s.size(); i++){
    int tmp = 0;
    for(int j=i; j<s.size(); j++){
      if(s[j] == 'A' || s[j] == 'C' || s[j] == 'G' || s[j] == 'T') tmp++;
      else break;
    }
    ret = max(ret, tmp);
  }
  cout << ret << endl;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
#define rep(i, begin, n) for (int i = begin; i < n; i++)
#define repe(i, begin, n) for (int i = begin; i <= n; i++)
#define repr(i, begin, n) for (int i = begin; i > begin - n; i--)
#define repre(i, begin, end) for (int i = begin; i >= end; i--)

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

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

const int inf = 1000000007;
const int MOD = 1000000007;
const long long INF = 1000000000000000007;

// -------------------------------------------------------
int N, K;
int x[100], y[100];
Pii p[100];
Pii praw[100];

int csum[100][100];

int cntincluded(int top, int bottom, int right, int left) {
  int topy = p[top].second;
  int bottomy = p[bottom].second;
  int rightx = p[right].first;
  int leftx = p[left].first;

  return csum[rightx][topy] - csum[leftx - 1][topy] -
         csum[rightx][bottomy - 1] + csum[leftx - 1][bottomy - 1];
}

int main() {
  cin >> N >> K;
  rep(i, 0, N) {
    cin >> x[i] >> y[i];
    p[i] = Pii(x[i], y[i]);
    praw[i] = Pii(x[i], y[i]);
  }

  sort(p, p + N);

  rep(i, 0, N) { p[i] = Pii(i + 1, p[i].second); }

  sort(p, p + N, [](Pii &a, Pii &b) { return a.second < b.second; });

  rep(i, 0, N) { p[i] = Pii(p[i].first, i + 1); }

  sort(p, p + N);

  sort(praw, praw + N);

  repe(i, 1, N) {
    repe(j, 1, N) {
      int add = 0;
      if (p[i - 1].second == j) {
        add = 1;
      }
      csum[i][j] = csum[i - 1][j] + csum[i][j - 1] - csum[i - 1][j - 1] + add;
    }
  }

  ll ans = numeric_limits<ll>::max();
  rep(i, 0, N) {
    rep(j, 0, N) {
      rep(k, 0, N) {
        rep(l, k + 1, N) {
          ll top = praw[i].second;
          ll bottom = praw[j].second;
          if (bottom > top) continue;

          ll left = praw[k].first;
          ll right = praw[l].first;
          if (right < left) continue;

          if (cntincluded(i, j, l, k) >= K) {
            chmin(ans, (top - bottom) * (right - left));
          }
        }
      }
    }
  }

  cout << ans << endl;
}


Measured memory_bytes: 3636
#横にn個入力
n, a, b = map(int, input().split())
x = input().split()
x = [int(m) for m in x]

ans = 0
for i in range(1, n):
    k = x[i] - x[i - 1]
    if k * a < b:
        ans += k * a
    else:
        ans += b

print(ans)

Measured memory_bytes: 14252
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
   char s[105];
   cin>>s;
   int n=strlen(s);
   string str1,str2;
   str1=s[0];
   str2=s[n-1];
   cout<<str1<<n-2<<str2;

}


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

//0-indexed                                                       
struct UnionFind {
  vector<int> data;
  UnionFind(int size) : data(size, -1) { }
  //木の根なら-(size of tree) それ以外は木の根のindexが入っている\
。                                                                
  bool unite(int x, int y) {
    x = root(x); y = root(y);
    if (x != y) {
      if (data[y] < data[x]) swap(x, y);
      data[x] += data[y]; data[y] = x;
    }
    return x != y;
  }
  bool same(int x, int y) {
    return root(x) == root(y);
  }
  int root(int x) {
    return data[x] < 0 ? x : data[x] = root(data[x]);
  }
  int size(int x) {
    return -data[root(x)];
  }
};

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

  int n,m;
  cin >> n >> m;
  UnionFind uf(n);
  vector<int> l[m];
  rep(i,n){
    int k;
    cin >> k;
    rep(j,k){
      int lt;
      cin >> lt;
      lt--;
      l[lt].pb(i);
    }
  }
  rep(i,m){
    rep1(j,l[i].size()-1){
      uf.unite(l[i][j],l[i][j-1]);
    }
  }
  if(uf.size(0)==n) cout << "YES" << endl;
  else cout <<"NO" << endl;

  return 0;
    

}


Measured memory_bytes: 4608
N = int(input())
S = input()

# それぞれ違う文字の組み合わせの数
ans = S.count('R')*S.count('G')*S.count('B')

# j-i!=k-jの組み合わせ
for i in range(0, N-2):
    for j in range(i+1, N-1):
        k = j+j-i
        if k < N:
            if S[i] != S[j] and S[i] != S[k] and S[j] != S[k]:
                ans -= 1

print(ans)


Measured memory_bytes: 67988
#include<bits/stdc++.h>
using namespace std;
int main(void){
	int n;
	cin>>n;
	if(n==22)		cout<<"Christmas Eve Eve Eve"<<endl;
	else if(n==23)	cout<<"Christmas Eve Eve"<<endl;
	else if(n==24)	cout<<"Christmas Eve"<<endl;
	else			cout<<"Christmas"<<endl;
	return 0;
}

Measured memory_bytes: 256
a,b = map(int,input().split())

i = int(a / 0.08)


while (1):
    if (a == int(i*0.08) and b == int(i*0.1)):
        print(i)
        break
    if (int(i*0.08) > a):
        print(-1)
        break;
    i += 1



Measured memory_bytes: 38472
a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]
c = [2]
x, y = map(int, input().split())
for i in [a, b, c]:
  if x in i and y in i:
    print("Yes")
    exit()
print("No")

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
 
int main() {
  int N,D;
  cin >> N >> D;
  
  vector<vector<int>> A(N,vector<int>(D));
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < D; j++) {
      cin >> A.at(i).at(j);
    }
  }
  
  int Answer = 0;
  for(int i = 0; i < N; i++) {
    for(int j = i + 1; j < N; j++) {
      int S=0;
      int T=0;
      for(int k = 0; k < D; k++) {
        S = abs(A.at(i).at(k) - A.at(j).at(k));
        T += S * S;
      }
      for(int l = 0; l <= T;l++){
        int L = l * l;
        if(L == T) {
          Answer++;
        }
      }
    }
  }
  cout << Answer << endl;
}

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

// Author: Ashish

int32_t main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int x,y,z;
  cin>>x>>y>>z;
  swap(x,y);
  swap(x,z);
  cout<<x<<' '<<y<<' '<<z;
  

 	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define mem(ar,value) memset(ar,value,sizeof(ar))
#define all(x) x.begin(),x.end()
#define len(s) (int)s.size()
#define mp make_pair
#define pb push_back
#define fi first
#define sc second
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define maxall(v) *max_element(all(v))
#define minall(v) *min_element(all(v))
#define mod 1e9+7
#define limit 200005
#define READ freopen("input.txt","r",stdin)
#define WRITE freopen("output.txt","w",stdout)
#define d1(x) cerr<<__FUNCTION__<<":"<<__LINE__<<": "#x" = "<<x<<endl;
#define d2(x,y) cerr<<__FUNCTION__<<":"<<__LINE__<<": "#x" = "<<x<<" | "#y" = "<<y<<endl;
#define d3(x,y,z) cerr<<__FUNCTION__<<":"<<__LINE__<<": "#x" = "<<x<<" | "#y" = "<<y<<" | "#z" = "<<z;
#define GG {printf("-1"); return 0;}
#define inf 1e9*2
#define y1 asdas
#define ll long long
#define writesize(a) printf("%d\n",len(a));
#define writeall(a) for(int i=0;i<len(a);i++) printf("%d ",a[i]);
int n,m,mpx[limit];
vector <int> ed[limit];
int main()
{
	scanf("%d %d",&n,&m);
	for(int i=1;i<=m;i++)
	{
		int a,b;
		scanf("%d %d",&a,&b);
		ed[a].pb(b);
		ed[b].pb(a);
	}
	for(int i=0;i<len(ed[1]);i++)
	{
		mpx[ed[1][i]]=1;
	}
	for(int i=0;i<len(ed[n]);i++)
	{
		if(mpx[ed[n][i]])
		{
			printf("POSSIBLE");
			return 0;
		}
	}
	printf("IMPOSSIBLE");
}



Measured memory_bytes: 12784
#include<bits/stdc++.h>
using namespace std;
#define ll unsigned long long
#define io ios_base::sync_with_stdio(false); cin.tie(NULL);
#define pb push_back
#define endl '\n'
#define mod 1000000007
#define inf 1000000000000000000
#define pii pair<int, pair<int, int>>
const double pi = acos(-1);
const int sz = 1000002;
int n, m, w, h,s;

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





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

int main()
{
  int a, b;
  cin >> a >> b;
  if(a % b) cout << 1 << endl;
  else cout << a % b << endl;
  return 0;
}


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

int main() {
  int a,b,h,m;
  cin >> a >> b >> h >> m;
  double th=abs(6*m-(60*h+m)/2.0);
  double pi = 3.141592653589793;
  double the=(th*pi)/180;
  double ansb=pow(a,2)+pow(b,2)-2*a*b*cos(the);
  double ans = pow(ansb,0.5);
  cout << fixed << setprecision(15) << ans << endl;
}




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

int main() {
	string S;
	ll result = 0;

  cin >> S;
	// 0000 0001 を S.length() - 1 分左へシフト 
  repeat(i, 1 << ( S.length() - 1 )){
    ll sum = 0;
    ll a = S[0] - '0'; // 数値へ変換

    repeat(j, (S.length() - 1)){
      if( i & (1 << j) ){ // iと 1をjビット分左にシフトした値で ビット積演算
        sum += a;
        a = 0;
      }
      a = a * 10 + S[j + 1] - '0';
    }
    sum += a;
    result += sum;
  }
  cout << result << endl;
	return 0;
}


Measured memory_bytes: 256
/* 
	Author: ankrypt
*/


#include <bits/stdc++.h>

using namespace std;

#define MOD 1000000007
#define ll long long int
#define u64 unsigned long long int

string S = "";
string T = "";

int main() {
	cin >> S;
	cin >> T;
	ll cnt = 0;
	for(int i = 0; i < S.size(); i++) {
		if(S[i] == T[i]) {
			cnt++;
		}
	}
	printf("%lld\n", cnt);
	
	return 0;
}
/*
	Powered by Buggy Plugin
*/


Measured memory_bytes: 256
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>

#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define vi vector<int>
#define VS vector<string>
#define all(x) x.begin(),x.end()
#define mp make_pair
#define pb push_back

using namespace std;



int main(){
	int n;
	while(cin >> n, n){
		int a = 0, b = 0;
		for(int i=0; i < n; i++){
			int in, in2;
			cin >> in >> in2;
			if(in < in2) b += in+in2;
			else if(in > in2) a += in+in2;
			else {
				a += in;
				b += in2;
			}
		}
		cout << a << " " << b << endl;
	}
}

Measured memory_bytes: 1160
from collections import deque
dq = deque([1,2,3,4,5,6,7,8,9])
ans = []
while dq:
    p = dq.popleft()
    ans.append(p)
    if p <= 323456666:
        q = p % 10
        if not q in [0,9]:
            for i in range(-1,2):
                dq.append(10*p+q+i)
        else:
            if q == 9:
                dq.append(10*p+8)
                dq.append(10*p+9)
            else:
                dq.append(10*p)
                dq.append(10*p+1)
ans.sort()
#print(ans)
print(ans[int(input())-1])

Measured memory_bytes: 13980
#include <algorithm>
#include <utility>
#include <cstdio>
#include <map>
using ll = long long;
int fa[100005], sz[100005];
ll arr[100005], val[100005];
std::pair<ll, int> app[100005];
std::map<ll, int> idx;
int main()
{
	// freopen("ARC103-F.in", "r", stdin);
	int n;
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		scanf("%lld", arr + i);
		idx[arr[i]] = i;
		app[i] = {arr[i], i};
		sz[i] = 1;
	}
	std::sort(app, app + n);
	for (int i = n - 1; i; i--)
	{
		int u = app[i].second;
		ll dt = n - sz[u] * 2;
		if (dt <= 0 || !idx.count(arr[u] - dt))
		{
			puts("-1");
			return 0;
		}
		fa[u] = idx[arr[u] - dt];
		sz[fa[u]] += sz[u];
		val[fa[u]] += val[u] + sz[u];
	}
	if (val[app[0].second] != arr[app[0].second])
	{
		puts("-1");
		return 0;
	}
	for (int i = n - 1; i; i--)
	{
		int u = app[i].second;
		printf("%d %d\n", fa[u] + 1, u + 1);
	}
	return 0;
}


Measured memory_bytes: 12416
//Optional FAST

//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,fma,abm,mmx,avx,avx2,tune=native")

//Required Libraries

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>

//Required namespaces

using namespace std;
using namespace __gnu_pbds;

//Required defines

#define endl '\n'

#define READ(X) cin>>X;
#define READV(X) long long X; cin>>X;
#define READAR(A,N) long long A[N]; for(long long i=0;i<N;i++) {cin>>A[i];}
#define rz(A,N) A.resize(N);
#define sz(X) (long long)(X.size())
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define FORI(a,b,c) for(long long a=b;a<c;a++)
#define FORD(a,b,c) for(long long a=b;a>c;a--)

//Required typedefs

typedef tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
typedef tree<long long,null_type,greater<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set1;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<long long,long long> pll;

//Required Constants

const long long inf=(long long)1e18;
const long long MOD=(long long)(1e9+7);
const long long INIT=(long long)(1e6+1);
const long double PI=3.14159265358979;

// Required random number generators

// mt19937 gen_rand_int(chrono::steady_clock::now().time_since_epoch().count());
// mt19937_64 gen_rand_ll(chrono::steady_clock::now().time_since_epoch().count());

//Required Functions

ll power(ll x,ll y) 
{ 
    if (y == 0) 
        return 1; 
    ll p = power(x, y/2) % MOD; 
    p = (p * p) % MOD; 
  
    return (y%2 == 0)? p : (x * p) % MOD; 
}
ll modInverse(ll a) 
{ 
   return power(a,MOD-2); 
   
}

//Work

int main()
{
    #ifndef ONLINE_JUDGE
    if (fopen("INPUT.txt", "r"))
    {
        freopen ("INPUT.txt" , "r" , stdin);
        //freopen ("OUTPUT.txt" , "w" , stdout);
    }
    #endif
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    clock_t clk;
    clk = clock();
//-----------------------------------------------------------------------------------------------------------//

    READV(N);
    ll ans=0;
    ll carry=0;
    FORI(i,0,N)
    {
        READV(X);
        if(carry && X)
        {
            X--;
            ans++;
        }
        carry=X%2;
        ans+=X/2;
    }
    cout<<ans<<endl;

//-----------------------------------------------------------------------------------------------------------//


    clk = clock() - clk;
    cerr << fixed << setprecision(6) << "Time: " << ((double)clk)/CLOCKS_PER_SEC << endl;

    return 0;
}

Measured memory_bytes: 3808
#include <iostream>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <vector>
#include <map>
#include <list>
#include <stack>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <queue>
#define pr(num) cout << num << endl
#define max(a, b) ((a)>(b) ? (a):(b))
#define min(a, b) ((a)<(b) ? (a):(b))
#define INF 1000000000000000000
#define MOD 1000000007LL
#define MAX 100005
using namespace std;
typedef long long ll;
typedef pair<ll, ll> PA;
typedef map<ll, ll> Map;

ll N;
ll ans=0;

ll digit(ll n) {
    ll res=0;
    while(n>0) {
        res++;
        n/=10;
    }
    
    return res;
}

void dfs(ll s) {
    if(s>N) return;
    
    ll cnt[11]={};
    ll d=digit(s);
    
    for(ll i=0; i<d; i++) {
        cnt[s/(ll)pow(10, d-1-i)%10]++;
    }
    
    if(cnt[3]>0 && cnt[5]>0 && cnt[7]>0) ans++;
    
    for(ll i=3; i<=7; i+=2) {
        dfs(s*10+i);
    }
    
}


int main(void) {
    cin >> N;
    
    dfs(0);
    
    pr(ans);
    
}

Measured memory_bytes: 512
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.InputStream;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.math.MathContext;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Objects;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Random;
import java.util.Scanner;
import java.util.Set;
import java.util.Stack;
import java.util.TreeMap;
import java.util.TreeSet;

import static java.util.Comparator.*;

public class Main {
    public static void main(String[] args) {
        PrintWriter out = new PrintWriter(System.out);
        Solver solver = new Solver(System.in, out);
        solver.solve();
        out.close();
    }
}
class Solver {
	Scanner sc;
	PrintWriter out;
    public Solver(InputStream in, PrintWriter out) {
    	sc = new Scanner(in);
    	this.out = out;
    }
    // ======================================================================
    public void solve() {
    	int N = ni();
    	int R = ni();
    	if(N >= 10)		out.println(R);
    	else			out.println((R + 100 * (10 - N)));
    }
    // ------------------------------------------
    // 入力
    // ------------------------------------------
    public int ni() {
    	return sc.nextInt();
    }
    public long nl() {
    	return sc.nextLong();
    }
    public String ns() {
    	return sc.next();
    }
    public char[] nc() {
    	return sc.next().toCharArray();
    }
    public int[] ndi(int N) {
    	int[] ans = new int[N];
    	for (int i = 0; i < N; i++) {
			ans[i] = ni();
		}
    	return ans;
    }
    public long[] ndl(int N) {
    	long[] ans = new long[N];
    	for (int i = 0; i < N; i++) {
			ans[i] = nl();
		}
    	return ans;
    }
    public String[] nds(int N) {
    	String[] ans = new String[N];
    	for (int i = 0; i < N; i++) {
			ans[i] = ns();
		}
    	return ans;
    }
    public char[][] ndc(int N) {
    	char[][] ans = new char[N][];
    	for (int i = 0; i < N; i++) {
			ans[i] = nc();
		}
    	return ans;
    }
    public int[][] nddi(int N, int S) {
    	int[][] ans = new int[N][S];
    	for (int i = 0; i < N; i++) {
			for (int j = 0; j < S; j++) {
				ans[i][j] = ni();
			}
		}
    	return ans;
    }
}


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

int main()
{
    ll n, m;
    cin >> n >> m;
    vector<ll> a(m), b(m);
    for(int i = 0; i < m; i++)
    {
        cin >> a[i] >> b[i];
    }

    vector<vector<ll>> edges(n);
    for(int i = 0; i < m; i++)
    {
        edges[a[i] - 1].push_back(b[i] - 1);
        edges[b[i] - 1].push_back(a[i] - 1);
    }

    vector<ll> prev(n);
    vector<ll> d(n);
    for(int i = 0; i < n; i++)
    {
        prev[i] = -1;
        d[i] = LLONG_MAX;
    }
    d[0] = 0;

    queue<ll> q;
    q.push(0);
    while(q.size() > 0)
    {
        ll node = q.front();
        q.pop();

        for(auto it = edges[node].begin(); it != edges[node].end(); it++)
        {
            ll nextNode = *it;
            if(d[nextNode] > d[node] + 1)
            {
                d[nextNode] = d[node] + 1;
                prev[nextNode] = node;
                q.push(nextNode);
            }
        }
    }

    bool isTrue = true;
    for(int i = 1; i < n; i++)
    {
        if(prev[i] == -1)
        {
            isTrue = false;
            break;
        }
    }

    if(isTrue)
    {
        cout << "Yes" << endl;
        for(int i = 1; i < n; i++)
        {
            cout << prev[i] + 1 << endl;
        }
    }
    else
    {
        cout << "No";
    }

    return 0;
}


Measured memory_bytes: 16724
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <math.h>
#include <numeric>
#include <complex>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <bitset>
#include <functional>
#include <assert.h>
using ll=long long;
#define int ll
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define eb emplace_back
#define all(x) x.begin(),x.end()
#define SZ(x) ((int)x.size())
#define fi first
#define se second
const int INF = 1e15;
const int MOD = 1e9+7;
using namespace std;

template<class T> using vc=vector<T>;
template<class T> using vvc=vc<vc<T>>;

using pi=pair<int,int>;
using vi=vc<int>;

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

signed main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout<<fixed<<setprecision(20);

    int N; cin >> N;
    int A[N]; rep(i,N) cin >> A[i];
    int sum=0;
    rep(i,N) {
        sum+=A[i];
        sum%=MOD;
    }
    int ans=0;
    rep(i,N) {
        sum-=A[i];
        if(sum<0) sum+=MOD;
        ans+=(A[i]*sum)%MOD;
        ans%=MOD;
    }
    cout << ans << endl;
}


Measured memory_bytes: 5216
#include <iostream>
#define REP(i,n) for(int i = 0; i < (n); i++)

using namespace std;

char mp[10][10];

int main()
{
  int H, W;
  cin >> H >> W;
  REP(i, H) REP(j, W) cin >> mp[i][j];

  int y = 0, x = 0;
  bool flag = true;
  mp[0][0] = '.';
  while (1) {
    if (y == H-1 && x == W-1) break;
    if (x+1 < W && mp[y][x+1] == '#') {
      mp[y][x+1] = '.';
      x++;
    } else if (y+1 < H && mp[y+1][x] == '#') {
      mp[y+1][x] = '.';
      y++;
    } else {
      flag = false;
      break;
    }
  }
  REP(i, H) {
    REP(j, W) {
      if (mp[i][j] == '#') {
        flag = false;
        break;
      }
    }
  }
  if (flag) cout << "Possible" << endl;
  else cout << "Impossible" << endl;

  return 0;
}

Measured memory_bytes: 256
#import<bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long LL;
typedef struct{int x;int y;}H;
LL a,b,i,j,k,m,n,s,sz,t,u,pv[100005],vi[100005],w[100005],x[100005],z[100005];
H e[200040];
int C(H a,H b){return a.x<b.x;}
void dfs(int v,int r)
{
	w[v]=r;
	vi[v]=1;
	for(int i=pv[v];i<pv[v+1];i++)
	{
		if(!vi[e[i].y])dfs(e[i].y,r);
	}
}
main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin>>n>>m>>k;
	for(;i<m;i++)
	{
		cin>>e[i].x>>e[i].y;
		e[i+m].x=e[i].y;
		e[i+m].y=e[i].x;
		x[e[i].x]++;
		x[e[i].y]++;
	}
	sz=2*m;
	sort(e,e+sz,C);
	for(i=0;++i<sz;)
	{
		if(e[i].x>e[i-1].x)
		{
			for(j=e[i-1].x;j++<e[i].x;)
			{
				pv[j]=i;
			}
		}
	}
	for(j=e[sz-1].x;j++<n+1;)pv[j]=sz;
	for(i=0;i++<n;)
	{
		if(!w[i])
		{
			dfs(i,++u);
		}
	}
	for(i=0;i++<n;)
	{
		z[w[i]]++;
	}
	for(i=0;i++<k;)
	{
		cin>>a>>b;
		if(w[a]==w[b])
		{
			x[a]++;
			x[b]++;
		}
	}
	for(i=0;i++<n;)cout<<z[w[i]]-1-x[i]<<' ';
}

Measured memory_bytes: 7168
def D_11(x):
    n = x[0]  # 整数の数
    a = x[1:]  # 数列
    M = 10**9 + 7  # 求めた解の剰余をこれで取る

    s = set()
    result = [x for x in a if x in s or s.add(x)]
    # for x in a:
    # if x in s:
    #     result.append(x)
    # s.add(x) と同じ書き方
    index = [i for i, x in enumerate(a) if x == result[0]]
    l = index[0] + 1
    r = index[1] + 1

    # フェルマーの小定理を用いてコンビネーションを効率よく計算
    factrial = [1] * (n + 2)
    for k in range(1, n + 2):
        factrial[k] = (factrial[k - 1] * k) % M

    fact_inv = [1] * (n + 2)
    fact_inv[n + 1] = pow(factrial[n + 1], M - 2, M)
    for k in range(n, -1, -1):
        fact_inv[k] = (fact_inv[k + 1] * (k + 1)) % M
    # Mについて等式[(n-1)!]^(-1)=(n!)^(-1)*nの剰余を取ると
    # [(n-1)!]^(M-2)%M = [(n!)^(M-2)*n]%M になるからという感じ？ 

    def nCr(n, r, M):
        if n < 0 or r < 0 or n < r:
            return 0
        else:
            return (factrial[n] * fact_inv[r] * fact_inv[n - r]) % M

    for k in range(1, n + 2):
        print((nCr(n + 1, k, M) - nCr((l - 1) + (n + 1 - r), k - 1, M)) % M)

n = int(input())
l = [int(i) for i in input().split()]
x = [n] + l
D_11(x)

Measured memory_bytes: 21668
#include <iostream>
#include <set>
#include <cassert>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include <map>

using namespace std;

int main() {
	int n;
	int k;
	cin >> n >> k;
	string s;
	cin >> s;
	vector<int> parity;
	int o = 0, z = 0;
	for (int i = 0; i < n-1; ++i) {
		if (s[i] == s[i + 1]) {
			parity.push_back(1);
			o++;
		}
		else {
			parity.push_back(0);
			z++;
		}
	}
	cout << o + min(z, k * 2) << endl;
	return 0;
}

Measured memory_bytes: 1020