akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 10007;
static const int INF = 1 << 25;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { -1, 0, 1, 0,  1, -1,  1, -1 };
static const int dy[] = { 0, -1, 0, 1 , 1,  1, -1, -1 };

VI pm;
int n;

int main() {
	vector<bool> is_pm( 10000000, true );
	for ( int i = 3; i * i <= 10000000; i += 2 ) {
		if ( is_pm[ i ] ) {
			for ( int j = i * i; j < 10000000; j += i ) {
				is_pm[ j ] = false;
			}
		}
	}
	while ( ~scanf("%d", &n) && n ) {
		if ( n % 2 == 0 ) {
			n--;
		}
		for ( int i = n; i >= 13; i -= 2 ) {
			if ( is_pm[ i ] && is_pm[ i - 2 ] && is_pm[ i - 6 ] && is_pm[ i - 8 ] ) {
				printf( "%d\n", i );
				break;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 2320
#include <bits/stdc++.h>
#define ll long long
#define f(i, a, b) for(ll i=a; i<b; i++)
#define fr(i,a,b) for(ll i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define LB lower_bound
#define UB upper_bound
#define endl "\n"
using namespace std;

bool sortbysec(const pair<ll,ll> &a, 
              const pair<ll,ll> &b) 
{ 
    return (a.second < b.second); 
} 

ll maxSubArraySum(ll a[], ll size) 
{ 
    ll max_so_far = INT_MIN, max_ending_here = 0; 
  
    for (ll i = 0; i < size; i++) 
    { 
        max_ending_here = max_ending_here + a[i]; 
        if (max_so_far < max_ending_here) 
            max_so_far = max_ending_here; 
  
        if (max_ending_here < 0) 
            max_ending_here = 0; 
    } 
    return max_so_far; 
} 

ll findSubarraySum(ll arr[], ll n, ll sum = 0) 
{
    unordered_map<ll, ll> prevSum;
    ll res = 0;
    ll currsum = 0;
    for (ll i = 0; i < n; i++)
    {
        currsum += arr[i];
        if (currsum == sum) res++;
        if (prevSum.find(currsum - sum) != prevSum.end()) res += (prevSum[currsum - sum]);
        prevSum[currsum]++;
    }
    return res; 
} 
ll gcd(ll a, ll b) 
{ 
    if (a == 0) 
        return b; 
    return gcd(b % a, a); 
} 
  
ll powmp(ll x, ll y, ll p) 
{ 
    ll res = 1;     x = x % p;   
    while (y > 0) 
    {  
        if (y & 1)  res = (res*x) % p; 
        y = y>>1; 
        x = (x*x) % p;   
    } 
    return res; 
} 

int main()
{
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
    ll n;cin>>n;
    n%=10;
    if(n==2 || n==4 || n==5 || n==7 || n==9) cout<<"hon";
    else if(n==0 || n==1 || n==6 || n==8) cout<<"pon";
    else cout<<"bon";
}


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

struct UnionFind {
	vector<int> par;

	UnionFind(int N) : par(N,-1) {}

	int root(int x) {
		if (par[x] < 0) return x;
		return par[x] = root(par[x]);
	}

	bool unite(int x, int y) {
		x = root(x);
		y = root(y);
		if (x == y) return false;
		if (par[x] > par[y]) swap(x, y);
		par[x] += par[y];
		par[y] = x;
		return true;
	}

	bool same(int x, int y) {
		int rx = root(x);
		int ry = root(y);
		return rx == ry;
	}

	int size (int x) {
		return -par[root(x)];
	}
};

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

	UnionFind tree(N);
	rep(i,M){
		int a, b;
		cin >> a >> b;
		a--; b--;
		tree.unite(a, b);
	}

	int ans = 0;
	rep(i,N) ans = max(ans, tree.size(i));
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 4044
#include <stdio.h>

int main(void)
{
	int num1 = 0;
	int num2 = 0;
	
	scanf("%d %d", &num1, &num2);
	printf("%d %d\n", num1 * num2, 2 * num1 + 2 * num2);
	
	return (0);
}

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

int main(){
    string s;
    cin >> s;
    int cnt = 700;
    if(s[0] == 'o') cnt += 100;
    if(s[1] == 'o') cnt += 100;
    if(s[2] == 'o') cnt += 100;
    cout << cnt << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <cmath>
using namespace std;
 
#define coutv(v) for (int i = 0; i < (v).size(); ++i) cout << v[i] << ' '; cout << endl;
#define coutvv(v) for (int i = 0; i < (v).size(); ++i) {for (int j = 0; j < (v[i]).size(); ++j) cout << v[i][j] << ' '; cout << endl;}
#define debugv(v) {for (int i = 0; i < (v).size(); ++i) cerr << v[i] << ' '; cerr << endl;}
#define debugvv(v) {for (int i = 0; i < (v).size(); ++i) {for (int j = 0; j < (v[i]).size(); ++j) cerr << v[i][j] << ' '; cerr << endl;}}
#define TC int TESTCASE; cin >> TESTCASE; while (TESTCASE--)
typedef long long ll;
 


int main() {
	int n;
	cin >> n;
	cout << n * n;
	
}
 


Measured memory_bytes: 3640
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#include<string>
#define MOD 1000000007
typedef long long ll;
using namespace std;

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    ll n;cin >> n;
    ll ans = 0;
    for(ll i = 0;i<=n;i++){
        if(i % 3 != 0 && i % 5 != 0) ans += i;
    }
    cout << ans <<endl;
    return 0;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
using namespace std;
typedef long long ll;
const long long INF = 1LL << 60;
const int MAX_N = 110;
const int MAX_V = 100100;
ll dp[MAX_N][MAX_V];

int main() {
    int n,W;
    cin>>n>>W;
    vector<int> w(n),v(n);
    rep(i,n) cin>>w[i]>>v[i];
    rep(i,MAX_N)rep(j,MAX_V) dp[i][j]=INF;
    dp[0][0]=0;
    
    rep(i,n){
        for(int j=0; j<100100; j++){
            if(j-v[i]>=0){
                chmin(dp[i+1][j], dp[i][j - v[i]] + w[i]);
            }
            chmin(dp[i+1][j],dp[i][j]);
        }
    }
    ll ans = 0;
    rep(j,100100){
        if(dp[n][j]<=W) ans = j;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 86272
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int[] A = new int[N];
        int[] B = new int[N - 1];
        for (int i = 0; i < N - 1; i++) {
            B[i] = Integer.parseInt(sc.next());
        }

        int ans = 0;
        ans += B[0];
        ans += B[N - 2];
        for (int i = N - 2; i >= 0; i--) {
            if (i > 0) {
                int min = Math.min(B[i], B[i - 1]);
                ans += min;
            }
        }
        System.out.println(ans);
    }

}


Measured memory_bytes: 21844
// Nihesh Anderson - knandy

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

using namespace __gnu_pbds;
using namespace std;

typedef long long ll;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

vector<ll> v;
ll n;

vector<ll> d[200005];
ll mark[200005];

int main(){
	ios_base::sync_with_stdio(false);
	memset(mark,-1,sizeof(mark));
	cin>>n;
	ll cur = 0;
	for(ll i=0;i<n;i++){
		ll temp;
		cin>>temp;
		if(mark[temp-1] == -1){
			d[cur].push_back(temp);
			mark[temp] = cur;
			cur++;
		}
		else{
			d[mark[temp-1]].push_back(temp);
			mark[temp] = mark[temp-1];
			mark[temp-1] = -1;
		}
		v.push_back(temp);
	}
	ll maxi=-1;
	for(ll i=0;i<cur;i++){
		maxi = max(maxi, (ll)d[i].size());
	}
	cout<<n-maxi<<endl;
	return 0;
}

Measured memory_bytes: 14320
#include <iostream>
#include <string>
using namespace std;
int main(void){
    string a,s;
    a = "abcdefghijklmnopqrstuvwxyz";
    cin >> s;
    int l = s.length();
    
    for(int i=0; i<26; i++){
        int b = 0;
        for(int j=0; j<l; j++){
            if(s[j]==a[i]){
                b++;
            }
        }
        if(b==0){
           cout << a[i] << endl;
           break;
        }
        else{
            if(i==25){
                cout << "None" << endl;
            }
        }
    }
}

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

using namespace std;

#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define pb emplace_back
#define ll long long
#define ld long double

const int INF = 2e9 + 1;
const ll INFLL = 1e18 + 1;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int h, w, k;
    cin >> h >> w >> k;
    vector<string> a(h);
    for (auto &c : a) {
        cin >> c;
        for (auto &l : c) l -= '0';
    }
    int ans = INF;
    for (int mask = 0; mask < (1 << (h - 1)); mask++) {
        vector<int> ind;
        for (int i = 0; i < h - 1; i++) {
            if (mask & (1 << i)) ind.pb(i);
        }
        ind.pb(h - 1);
        vector<vector<int>> sum(ind.size());
        int i = 0;
        bool f = true;
        for (int p = 0; p < (int)ind.size(); p++) {
            int c = ind[p];
            for (int j = 0; j < w; j++) {
                int now = 0;
                for (int l = i; l <= c; l++) now += a[l][j];
                sum[p].pb(now);
                if (now > k) f = false;
            }
            i = c + 1;
        }
        if (!f) continue;
        vector<int> lol(ind.size());
        int cnt = 0;
        for (int j = 0; j < w; j++) {
            bool f = false;
            vector<int> kek;
            for (int l = 0; l < (int)ind.size(); l++) {
                kek.pb(sum[l][j]);
                if (kek[l] + lol[l] > k) f = true;
            }
            if (f) {
                lol = kek;
                cnt++;
            } else {
                for (int l = 0; l < (int)ind.size(); l++) lol[l] += kek[l];
            }
        }
        ans = min(ans, cnt + (int)ind.size() - 1);
    }
    cout << ans;
    return 0;
}


Measured memory_bytes: 3656
H, W = map(int, input().split())
sy, sx = map(lambda x: int(x) - 1, input().split())
gy, gx = map(lambda x: int(x) - 1, input().split())
maze = [input() for _ in range(H)]
seen = [[-1] * W for _ in range(H)] 
from collections import deque

def bfs(maze, seen, sy, sx, gy, gx):
    queue = deque()
    queue.append([sy, sx, 0])
    while queue:
        y, x, c = queue.popleft()
        if seen[y][x] > -1:
            continue
        seen[y][x] = c
        if seen[gy][gx] > -1:
            return c
        for i in range(-2, 3):
            for j in range(-2, 3):
                if (i == -1 and j == 0) or (i == 1 and j == 0) or (i == 0 and j == -1) or (i == 0 and j == 1):   
                    dy = y + i
                    dx = x + j
                    if dy < 0 or H <= dy or dx < 0 or W <= dx or seen[dy][dx] > -1:
                        continue
                    if maze[dy][dx] == '#':
                        continue
                    queue.appendleft([dy, dx, c])
                dy = y + i
                dx = x + j
                if dy < 0 or H <= dy or dx < 0 or W <= dx or seen[dy][dx] > -1:
                    continue
                if maze[dy][dx] == '#':
                    continue
                queue.append([dy, dx, seen[y][x] + 1])
    return -1

print(bfs(maze, seen, sy, sx, gy, gx))


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

namespace AtTest.ABC_129
{
    class B
    {
        static void Main(string[] args)
        {
            Method(args);
        }

        static void Method(string[] args)
        {
            int n = ReadInt();
            int[] ws = ReadInts();
            int[] sums = new int[n];
            sums[0] = ws[0];
            for(int i = 1; i < n; i++)
            {
                sums[i] = sums[i - 1] + ws[i];
            }

            int min = int.MaxValue;
            for(int i = 0; i < n; i++)
            {
                min = Min(min, Abs(sums[n - 1] - sums[i] * 2));
            }

            var sw = new System.IO.StreamWriter(OpenStandardOutput()) { AutoFlush = false };
            SetOut(sw);

            // Write output here
            WriteLine(min);
            Out.Flush();
        }

        private static string Read() { return ReadLine(); }
        private static char[] ReadChars() { return Array.ConvertAll(Read().Split(), a => a[0]); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }
    }
}


Measured memory_bytes: 11220
<?php
$s = trim(fgets(STDIN));
$t = trim(fgets(STDIN));

$sLen = strlen($s);
$tLen = strlen($t);

if(($sLen + 1) !== $tLen) {
  echo "No\n";
  exit();
}

if(substr($t, 0, $sLen) !== $s) {
  echo "No\n";
  exit();
}

echo "Yes\n";

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

void Main() {
  int n;
  cin >> n;
  int p[n];
  for (int i = 0; i < n; i++) {
    cin >> p[i];
  }

  int cnt = 0;
  for (int i = 2; i < n; i++) {
    if ((p[i - 2] > p[i - 1] && p[i - 1] > p[i]) || (p[i] > p[i - 1] && p[i - 1] > p[i - 2])) cnt++;
  }
  cout << cnt << endl;
}

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);
  Main();
  return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    long long n,c;
    cin >> n >> c;
    long long w[n],v[n];
    for(int i=0;i<n;i++) cin >> w[i] >> v[i];
    long long dp[n+1][c+1];
    for(int i=0;i<c+1;i++) dp[0][i]=0;
    for(int i=0;i<n+1;i++) dp[i][0]=0;
    for(int o=1;o<n+1;o++)
    {
        for(int i=1;i<c+1;i++)
        {
            if(w[o-1]<=i) dp[o][i]=max(dp[o-1][i-w[o-1]]+v[o-1],dp[o-1][i]);
            else dp[o][i]=dp[o-1][i];
        }
    }
    cout << dp[n][c] << endl;
    return 0;
}


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

using namespace std;

typedef long long ll;
const ll INF = 1LL<<60;

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

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

ll modpow(ll a, ll n, ll mod) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}

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

  int N;
  cin >> N;
  ll A, B;
  cin >> A >> B;
  
  vector<ll> X(N);
  for(int i = 0; i < N; i++) cin >> X[i];

  ll ans = 0;
  for(int i = 0; i < N-1; i++){
    ans += min(B, A * (X[i+1]-X[i]));
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 1024
#include <math.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <queue>
#include <map>
#include <utility>
#include <iomanip>
using namespace std;

#define ll long long

void solve()
{
    ll N;
    cin >> N;
    vector<string> S(N);
    map<string, ll> mp;
    ll count = 0;
    for (ll i = 0; i < N; i++)
    {
        cin >> S.at(i);
        if (mp[S.at(i)] == (ll)NULL)
        {
            mp[S.at(i)] = 1;
            count++;
        }
    }
    cout << count << endl;

    return;
}

int main()
{
    solve();
    return 0;
}


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

namespace Algorithm
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var line = Console.ReadLine().Split().Select(s => int.Parse(s)).ToArray();

            var total = 1;
            var max = line[0];

            for (var i = 1; i < n; i++)
            {
                if (max <= line[i])
                {
                    total++;
                    max = line[i];
                }
            }

            Console.WriteLine(total);
        }

    }
}


Measured memory_bytes: 13268
#pragma region head
    #include <bits/stdc++.h>
    using namespace std;
    using ll = long long;
    using vi = vector<int>;
    using vll = vector<ll>;
    using pi = pair<int, int>;
    using pll = pair<ll,ll>;
    template <class T> using vv = vector<vector<T>>;
    #define rep(i,n) for(int i = 0; i < (int)(n); i++)
    #define repi(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
    const int INF = 1002003004;
    const ll LINF = 1002003004005006007ll;
    struct preprocess{preprocess()
    {cin.tie(nullptr);ios::sync_with_stdio(false);cout<<fixed<<setprecision(20);}}____;
#pragma endregion head

#pragma region library
    
#pragma endregion library

const int MAX_N = 100005;
vi ans(MAX_N);
vv<pi> to(MAX_N);
void dfs(int u,int c, int p=-1){
    ans[u]=c;
    for(auto pr:to[u]){
        int v = pr.first,w=pr.second;
        if(v==p) continue;
        dfs(v,(c+w%2)%2,u);
    }
    
}
int main(){
    int n;
    cin >> n;
    rep(i,n-1){
        int u,v,w;cin >> u >> v >> w;
        u--; v--;
        to[u].emplace_back(v,w);
        to[v].emplace_back(u,w);
    }
    dfs(0,0);
    rep(i,n) cout << ans[i] << '\n';
    
}

Measured memory_bytes: 8448
#include<bits/stdc++.h>
#define ff first
#define ss second
using namespace std;
typedef long long ll;

ll n;
ll ans = 0;

int main(){
    cin >> n;
    ans = n;
    for(int i = 0; i <= n; i++){
        ll cnt = 0;
        ll prt = i;
        while(prt > 0){
            cnt += prt%6;
            prt /= 6;
        }

        prt = n-i;
        while(prt > 0){
            cnt += prt%9;
            prt /= 9;
        }
        ans = min(ans, cnt);

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


Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] L = new int[N];
        int sum = 0;
        
        for(int i = 0; i < N; i++){
            L[i] = sc.nextInt();
        }
        Arrays.sort(L);
        
        for(int i = 0; i < N - 2; i++){
            for(int j = i + 1; j < N - 1; j++){
                for(int k = j + 1; k < N; k++){
                    if(L[i] + L[j] > L[k]){
                        sum++;
                    }else{
                        break;
                    }
                }
            }
        }
        
        System.out.println(sum);
    }
}

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

int main() {
	string s; cin >> s;
	int n = (int)s.size();
	if(s[0] == 'A' && islower(s[1]) && islower(s[n - 1])) {
		int cnt = 0; char c = ' ';
		FOR(i,2,n - 1) if(s[i] < 'a') {
				cnt++;
				c = s[i];
		}
		if(cnt == 1 && c == 'C') cout << "AC" << endl;
		else cout << "WA" << endl;
	} else cout << "WA" << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#include<cctype>
#define F(a,b,c) for(register int (a)(b);(a)<=(c);(a)++)
using namespace std;
int n;
map<int,int> m;
vector<int> v;
signed main()
{
	scanf("%d",&n);int tmp,ans(0);
	F(i,1,n){scanf("%d",&tmp);if(!m[tmp]){v.push_back(tmp);};m[tmp]++;}
	F(i,0,v.size()){ans+=(m[v[i]]-((m[v[i]]>=v[i])*v[i]));}
	printf("%d",ans);
	return putchar(10),0;
}

Measured memory_bytes: 5112
#include <iostream>
#include <string>
int main(){
  std::string s;
  int n;
  std::cin>>n,std::cin.get();
  for(;n;n--){
    getline(std::cin,s);
    int pos=0;
    while(pos=s.find("Hoshino",pos),pos!=std::string::npos){
      s.replace(pos,7,"Hoshina");
      pos+=7;
    }
    std::cout<<s<<std::endl;
  }
  return 0;
}

Measured memory_bytes: 0
import java.util.Scanner;

class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        long a = sc.nextLong();
        long b = sc.nextLong();
        long x = sc.nextLong();
        long sum = 0;
        
        sum = (b / x) - (a / x);
        if (a % x == 0) {
            sum++;
        }
        System.out.println(sum);
    }
}

Measured memory_bytes: 22612
#!/usr/bin/env python3
import sys


def solve(A: int, B: int, C: int, K: int):
    if K <= A+B:
        print(min(A,K))
    else:
        print(A - (K - (A+B)))
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(A, B, C, K)

if __name__ == '__main__':
    main()


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

using namespace std;

int smlst, N, M, Q, nr, b[100009], a[100009], pos[100009], need[100009];
bool ap[100009];

void Ans (bool x)
{
    if (x) printf ("Yes\n");
    else printf ("No\n");
    exit (0);
}

int main ()
{
//freopen ("input", "r", stdin);
//freopen ("output", "w", stdout);

scanf ("%d %d %d", &N, &M, &Q);
for (int i=1; i<=Q; i++)
    scanf ("%d", &a[i]);
b[++nr] = a[Q --], pos[b[1]] = 1;
need[1] = N - 1;
while (Q)
{
    int val = a[Q --];
    if (pos[val] != 0)
    {
        int p = pos[val];
        if (need[p]) need[p] --, need[p + 1] ++;
        continue;
    }
    b[++nr] = val, pos[val] = nr;
}
smlst = -1;
for (int i=1; i<=nr; i++)
    if (need[i] > 0)
    {
        smlst = i - 1;
        break;
    }
if (smlst == -1) Ans (1);
for (int i=1; i<=smlst; i++)
    ap[b[i]] = 1;
int j = smlst + 1;
for (int i=1; i<=M; i++)
    if (ap[i] == 0)
    {
        if (j > nr) break;
        if (i != b[j ++]) Ans (0);
    }
Ans (1);
return 0;
}


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

#ifdef LOCAL
#define DEBUG(...) debug(#__VA_ARGS__, __VA_ARGS__);
#else
#define DEBUG(...)
#endif

template<typename T, typename S> ostream& operator << (ostream &os, const pair<T, S> &p) {return os << "(" << p.first << ", " << p.second << ")";}
template<typename C, typename T = decay<decltype(*begin(declval<C>()))>, typename enable_if<!is_same<C, string>::value>::type* = nullptr>
ostream& operator << (ostream &os, const C &c) {bool f = true; os << "["; for (const auto &x : c) {if (!f) os << ", "; f = false; os << x;} return os << "]";}
template<typename T> void debug(string s, T x) {cerr << s << " = " << x << "\n";}
template<typename T, typename... Args> void debug(string s, T x, Args... args) {cerr << s.substr(0, s.find(',')) << " = " << x << " | "; debug(s.substr(s.find(',') + 2), args...);}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    long long n;
    cin >> n;

    unordered_map<long long, int> mp;
    for (long long i=2; i*i<=n; i++)
        while (n % i == 0) {
            n /= i;
            mp[i]++;
        }
    if (n > 1)
        mp[n]++;

    int ret = 0;
    for (auto p : mp) {
        int cnt = 1;
        while (cnt * (cnt + 1) / 2 <= p.second)
            cnt++;
        ret += cnt - 1;
    }

    cout << ret << "\n";

    return 0;
}


Measured memory_bytes: 3604
#include <cstdio>
#include <climits>
#include <cassert>
#include <cmath>
#include <iostream>
#include <string>
#include <algorithm>
#include <numeric>
#include <functional>
#include <tuple>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <vector>
#include <iterator>
#include <regex>

#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
#define FOR(x,xs) for(auto &x: xs)

using namespace std;
typedef long long ll;
typedef pair<int,int> PI;
typedef pair<ll,ll> PL;
typedef vector<int> VI;
typedef vector<ll> VL;

template <class T, template <class, class> class C, class charT = char>
void vdump(const C<T, allocator<T>> &v, const charT* delimiter = ", ",
           ostream &stream = cout) {
  copy(v.begin(), v.end(), ostream_iterator<T>(stream, delimiter));
  stream << endl;
}

const int INF = 2e9;

struct edge {
  int dst;
  int d;
};

struct vtx {
  int x = INF;
  vector<edge> es;
};

bool dfs(vector<vtx> &vs, int a) {
  vtx &v = vs[a];
  FOR(e,v.es) {
    vtx &u = vs[e.dst];
    if(u.x == INF) {
      u.x = v.x + e.d;
      if(!dfs(vs, e.dst)) {
        return false;
      }
    } else {
      if(u.x != v.x + e.d) {
        return false;
      }
    }
  }
  return true;
}

bool solve(vector<vtx> &vs) {
  int n = vs.size();
  REP(i,0,n) {
    if(vs[i].x != INF) {
      continue;
    }
    vs[i].x = 0;
    if(!dfs(vs, i)) {
      return false;
    }
  }
  return true;
}

int main() {
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<vtx> vs(n);
  REP(i,0,m) {
    int l, r, d;
    cin >> l >> r >> d;
    l--;
    r--;
    vs[l].es.push_back({r, d});
    vs[r].es.push_back({l, -d});
  }
  cout << (solve(vs) ? "Yes" : "No") << endl;

  return 0;
}


Measured memory_bytes: 12416
#include<iostream>
#include <set>
#include<string>
#include<vector>
#include<algorithm>

using namespace std;

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

	int flagA = 0, flagB = 0;
	int cnt = 0, max = 0;
	char S[100];

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

	for (int i = 1; i < N; i++) {
		cnt = 0;
		for (int j = 'a'; j <= 'z'; j++) {
			flagA = flagB = 0;
			for (int k = 0; k < i; k++) {
				if (S[k] == j) flagA = 1;
			}
			for (int k = i; k < N; k++) {
				if (S[k] == j) flagB = 1;
			}
			if (flagA == 1 && flagB == 1) cnt++;
		}
		if (max < cnt) max = cnt;
	}
	cout << max << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cstdio>
#include <cstring>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <bitset>

typedef long long ll;
typedef unsigned long long ull;
using namespace std;

#define FALSE printf("false\n");
#define TRUE printf("true\n");
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i = 0;i < ((int)(n));++i)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define test(a) cout<<"line:"<<__LINE__<<"["<<(#a)<<": "<<(a)<<"]"<<endl

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

#define SUM(vec) accumulate(all(vec),0LL) // 配列の中身を全部足す
template<typename T>void print(T&& x){cout<<x<<endl;}// 改行付き出力
ll inline digit(ll num){int tmp = 0;while(num){tmp++;num/=10;}return tmp;} // 桁数
template<typename T>inline T digitSum(T num){T sum = 0;while(num){sum+=num%10;num/=10;}return sum;} // 各桁の和
template<typename T>inline T gcd(T a,T b){if(b == 0)return a;return gcd(b,a%b);} // 最大公約数
template<typename T>inline T lcm(T a, T b){T g = gcd(a,b);return a/g*b;} // 最小公倍数
template<typename T>inline T power(T a,T b){T tmp=1;rep(i,b){tmp*=a;}return tmp;} // 累乗
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; }
int ctoi(char c){return c - '0';}

// TODO: write
int main() { 
  string s;cin>>s;
  int ans = 0;
  rep(i,s.size()){
    ans += s[i] != "CODEFESTIVAL2016"[i];
  }
  print(ans);
  return 0;
}

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

#define mp make_pair
#define pb push_back
#define se second
#define fi first

typedef long long ll;
using namespace std;
const int NUM = 1e5 + 5;
const int mod = 998244353;
int INF = 2e9;
pair <int ,int> pinf = {INF, INF};
ll f (ll b, ll n){
    if (n < b)
        return n;
    return n % b + f(b, n / b);
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    ll n, s;
    cin >> n >> s;
    for (ll i = 2; i * i <= n; i++)
        if (f(i, n) == s){
            cout << i;
            return 0;
        }
    ll t = n - s;
    if (s == 1){
        cout << max(n, (ll) 2);
        return 0;
    }
    if (s == n){
        cout << n + 1;
        return 0;
    }
    if (t <= 0){
        cout << -1;
        return 0;
    }
    set <ll> ans;
    for (ll i = 1; i * i <= t; i++){
        if (t % i != 0)
            continue;
        ll b = i + 1;
        ll x = t / i;
        ll y = s - x;
        if (f(b, n) == s){
            ans.insert(b);
        }
        x = i;
        b = t / i + 1;
        y = s - x;
        if (f(b, n) == s){
            ans.insert(b);
        }
    }
    if (ans.size() > 0){
        cout << *ans.begin();
        return 0;
    }
    cout << -1;
    return 0;
}




Measured memory_bytes: 384
function Main(input){
  input = input.split("\n")[0].split(" ");
  const A = parseInt(input[0],10);
  const B = parseInt(input[1],10);
  const C = parseInt(input[2],10);
  const D = parseInt(input[3],10);
  var ans;
  var max_AC;
  var min_BD;

  if(C >= B || D <= A){
    ans = 0;
  }else{
    max_AC = Math.max(A,C);
    min_BD = Math.min(B,D);
    ans = min_BD - max_AC;
  }
  console.log(ans);
}

const fs=require("fs");
Main(fs.readFileSync("/dev/stdin","utf-8"));


Measured memory_bytes: 7372
import java.util.*;

public class Main {
    public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int N = sc.nextInt();
	int[] L = new int[N];
	for (int i=0; i<N; i++) L[i] = sc.nextInt();
	int count = 0;
	for (int i=0; i<=N-3; i++) {
	    for (int j=i+1; j<=N-2; j++) {
		for (int k=j+1; k<=N-1; k++) {
		    if (L[i]!=L[j] && L[j]!=L[k] && L[i]!=L[k])
			if (L[i]+L[j]>L[k] && L[i]+L[k]>L[j] && L[j]+L[k]>L[i])
			    count++;
		}
	    }
	}
	System.out.print(count);
    }
}


Measured memory_bytes: 36284
#include <bits/stdc++.h>
using namespace std;
#define ll          long long int
#define pb          push_back
#define pll         pair<ll,ll>
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define mode        998244353
#define mod         1000000007
#define inf         1000000000000000000LL
#define vl          vector<ll>
#define F           first
#define S           second
#define db          long double
#define sz(x)       (ll)x.size()
#define fix(n)      cout<<fixed<<setprecision(n)
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define all(x)      x.begin(),x.end()
#define mset(x)     memset(x,0,sizeof x)
#define pi          3.14159265358979323

const int N = 1e5+5;
ll n, wt, v[101], w[101], dp[101][N];

void solve()
{
       cin>>n>>wt;
       rep(i,1,n+1) cin>>w[i]>>v[i];
       // dp[i][j] = min wt for which we can have tot value = j after processing i item
       rep(i,1,N) dp[0][i] = inf;
       for(ll i=1; i<=n; i++)
       {
              for(ll j=0; j<N; j++)
              {
                     dp[i][j] = dp[i-1][j];      // not taking this element and having as much value
                     if(v[i]>j) continue;
                     dp[i][j] = min(dp[i][j], dp[i-1][j-v[i]]+w[i]);
              }
       }
       ll ans=0;
       rep(i,0,N) if(dp[n][i]<=wt) ans=i;
       cout<<ans;
}



int main() {
	ll T = 1;
	speed_up
	//cin>>T;
	while(T--)
	    solve();
	return 0;
}


Measured memory_bytes: 79232
#include<stdio.h>
int main(void) {
  int A,B,C,D,E,F;
  scanf("%d",&A);
  scanf("%d",&B);
  scanf("%d",&C);
  scanf("%d",&D);
  if(A>=B){
    E = B;
  }else{
    E = A;
  }
  if(C>=D){
    F = D;
  }else{
    F = C;
  }
  E = E + F;
  printf("%d",E);
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
  int n;cin>>n;
  vector<int> a;
  for(int i = 0; n*2 > i; i++){
    int tmp;cin>>tmp;
    a.push_back(tmp);
  }
  sort(a.begin(),a.end());
  int ans=0;
  for(int i = 0; n*2 > i; i+=2){
    ans+=a[i];
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T> using vec = vector<T>;
template<class T> using vvec = vector<vec<T>>;
using R = double;
using P = complex<R>;
#define x real()
#define y imag()
const R eps = 1e-9,PI = acos(-1);

bool equal(R a,R b){return abs(b-a)<eps;}
bool equal0(R a){return equal(a,0.0);}

P operator*(const P& p,const R& d){
    return P(p.x*d,p.y*d);
}

istream &operator>>(istream& is,P& p){
    R a,b;
    is >> a >> b;
    p = P(a,b);
    return is;
}

ostream &operator<<(ostream& os,P& p){
    os << fixed << setprecision(10) << p.real() << " " << p.imag();
}
//内積
double dot(P a,P b) {return (conj(a)*b).real();}
//外積
double cross(P a,P b) {return (conj(a)*b).imag();}

struct L{
    P a,b;
    L(P a,P b):a(a),b(b){}
    L(R A,R B,R C){
        if(equal(A,0)) a = P(0,C/B),b = P(1,C/B);
        else if(equal(B,0)) b = P(C/A,0),b = P(C/A,1);
        else a = P(0,C/B),b = P(C/A,0);
    }
};

//pをbに射影
P projection(P p,P b) {return b*dot(p,b)/norm(b);}

//pとp1 to p2 に射影
P projection(L l,P p){
    p -= l.a; l.b -= l.a;
    P proj = projection(p,l.b);
    return l.a+proj;
}

struct S:L{
    S(P a,P b):L(a,b){}
};

//点の回転方向を判定
int ccw(P& p0,P p1,P p2){
    p1 -= p0,p2 -= p0;
    if(cross(p1,p2)>eps) return 1; //"COUNTER_CLOCKWISE"
    if(cross(p1,p2)<-eps) return -1; //"CLOCKWISE"
    if(dot(p1,p2)<0) return 2; //"ONLINE_BACK"
    if(norm(p1)<norm(p2)) return -2; //"ONLINE_FRONT"
    return 0; //"ON_SEGMENT"
}

bool is_parallel(L l1,L l2){
    return equal0(cross(l1.b-l1.a,l2.b-l2.a));
}

bool is_orthogonal(L l1,L l2){
    return equal0(dot(l1.b-l1.a,l2.b-l2.a));
}

//pをlに関して対称移動
P reflection(L l,P p){
    P pj = projection(l,p);
    return 2.0*pj-p;
}

//pがl上にあるか
bool is_online(L& l,P& p){
    return abs(ccw(l.a,l.b,p))!=1;
}

bool is_onsegment(S& s,P& p){
    return ccw(s.a,s.b,p)==0;
}

//線分の交差判定
bool intersect(S s,S t){
    return ccw(s.a,s.b,t.a)*ccw(s.a,s.b,t.b)<=0 && ccw(t.a,t.b,s.a)*ccw(t.a,t.b,s.b)<=0;
}

int main(){
    int Q;
    cin >> Q;
    for(int i=0;i<Q;i++){
        P p1,p2,p3,p4;
        cin >> p1 >> p2 >> p3 >> p4;
        cout << intersect(S(p1,p2),S(p3,p4)) << endl;
    }
}


Measured memory_bytes: 3284
#include <bits/stdc++.h>
using namespace std;
//#include <atcoder/all>
//using namespace atcoder;
using ll=long long;
using Graph=vector<vector<pair<int,int>>>;
#define MOD 1000000007
#define INF 1000000000

//gcd(a,b)=a*x-byの解(x1,y1)を返す
// or 1=a*x-byの解、解がなければ(0,0)を返す。
//一般解 (x,y)=(b/gcd(a,b)*t+x1,a/gcd(a,b)*t+y1)
pair<ll,ll> solve(ll a,ll b){
  vector<ll> p,q,r,d;
  p.push_back(a);
  q.push_back(b);
  d.push_back(a/b);
  r.push_back(a%b);
  ll i=0;
  while(r[i]>0){
    p.push_back(q[i]);
    q.push_back(r[i]);
    d.push_back(q[i]/r[i]);
    r.push_back(q[i]%r[i]);
    i++;
  }
  ll gcd=q[i];
  if(q[i]!=1)return make_pair(0,0);
  i--;
  ll aa=1;
  ll bb=1;
  ll cc=0;
  while(i>0){
    i--;
    ll tmp=-bb*d[i+1]-cc;
    cc=-aa;
    aa=tmp;
    bb=tmp;
  }
  ll t;
  if(aa>0){
    t=aa/(b/gcd);
  }else{
    t=(-aa)/(b/gcd)+1;
  }
  return make_pair(aa+(b/gcd)*t,bb*d[i]+cc+(a/gcd)*t);
}

int main(){
  ll N;
  cin>>N;
  ll i=1;
  vector<ll> divd1;
  while(i*i<=N){
    if(N%i==0){
      divd1.push_back(i);
      divd1.push_back(N/i);
    }
    ++i;
  }

  int n=divd1.size();
  ll ans=2*N;
  if(N==1){
    cout<<1<<endl;
    return 0;
  }
  for(int i=0;i<n;++i){
    ll x=divd1[i];
    ll y=N/x;
    pair<ll,ll> a;
    a=solve(y,2*x);
    if(a.second>0){
      ans=min(ans,2*x*a.second);
    }
    a=solve(2*x,y);
    if(a.second>0){
      ans=min(ans,y*a.second);
    }
    a=solve(2*y,x);
    if(a.second>0){
      ans=min(ans,x*a.second);
    }
    if(x>1){
      a=solve(x,2*y);
      if(a.second>0){
        ans=min(ans,2*y*a.second);
      }
    }

  }
  cout<<ans<<endl;
}


Measured memory_bytes: 3752
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
MOD = 10**9+7

s = input()
s = s.replace("eraser","").replace("erase","").replace("dreamer","").replace("dream","")
if len(s) == 0:
    print("YES")
else:
    print("NO")

Measured memory_bytes: 3548
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <queue>
#include <stack>
#include <stdlib.h>
using namespace std;
#define rep(i,n) for (int i = 0; i <n; i++) 
#include <math.h>
#include <bits/stdc++.h>
using namespace std;

using namespace std;
int main(){
    long long int l,r,k=2019;
    std::cin >> l>>r;
    long long int t=2019;
    if(r-l>=2018)std::cout << 0 << std::endl;
    else{
        for(int i=l;i<r;i++){
            for(int j=i+1;j<=r;j++){
                k=((i%2019)*(j%2019))%2019;
                t=min(t,k);
            }
        }
        std::cout << t << std::endl;
    }
}


Measured memory_bytes: 256
N, M, X = map(int, input().split())
C = [0] * N
A = [[0] * M] * N
price_min = float('inf')

for i in range(N):
    stdin = list(map(int, input().split()))
    C[i] = stdin[0]
    A[i] = stdin[1:]

for i in range(2 ** N):
    is_read = [True] * N
    price = 0
    skill = [0] * M

    for j in range(N):
        if((i >> j) & 1):
            is_read[j] = False

    for k in range(N):
        if is_read[k] == True:
            price += C[k]

            for l in range(M):
                skill[l] += A[k][l]

    if min(skill) >= X:
        price_min = min(price_min, price)

print(price_min if price_min != float('inf') else '-1')

Measured memory_bytes: 9148
#include <bits/stdc++.h> // Integer Product, by Errichto
using namespace std;
int main() {
    int n;
    scanf("%d", &n);
    map<pair<int,int>, int> cnt;
    for(int rep = 0; rep < n; ++rep) {
        double x;
        scanf("%lf", &x);
        long long i = llround(x * 1e9);
        int two = 0, five = 0;
        while(i % 2 == 0) {
            two++;
            i /= 2;
        }
        while(i % 5 == 0) {
            five++;
            i /= 5;
        }
        ++cnt[{two,five}];
    }
    long long answer = 0;
    for(auto p1 : cnt) {
        for(auto p2 : cnt) {
            if(p1.first.first+p2.first.first >= 18 && p1.first.second+p2.first.second >= 18) {
                if(p1 < p2) {
                    answer += (long long) p1.second * p2.second;
                }
                else if(p1 == p2) {
                    answer += (long long) p1.second * (p1.second - 1) / 2;
                }
            }
        }
    }
    printf("%lld\n", answer);
}


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

public class Main {
    
    public static void main(String[] args) {
        Main main = new Main();
        main.solv();
    }
    
    private int[] memo = new int[45];
    private void solv() {
        Scanner input = new Scanner(System.in);
        System.out.println(fib(input.nextInt()));
    }
    int fib(int n) {
        if (n == 0 || n == 1) return 1;
        if (memo[n] != 0) return memo[n];
        memo[n] = fib(n-1)+fib(n-2);
        return memo[n];
    }
    void swap(int[] A, int x, int y) {
        int temp = A[x];
        A[x] = A[y];
        A[y] = temp;
    }
    
}

class Scanner {
    BufferedReader r;
    StreamTokenizer st;
    
    public Scanner(InputStream in) {
        r = new BufferedReader(new InputStreamReader(in));
        st = new StreamTokenizer(r);
    }
    
    public String next() {
        nextToken();
        return st.sval;
    }
    
    public Integer nextInt() {
        nextToken();
        return (int)st.nval;
    }
    
    private int nextToken() {
        int token = st.TT_EOF;
        try {
            token = st.nextToken();
        } catch (IOException e) {
        }
        return token;
    }
}

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

#define ll long long int
#define str string
#define ALL(a)  (a).begin(),(a).end()
#define P pair<ll,ll>

using Graph = vector<vector<int>>;

const int dy[] = { 0, 0, 1, -1 }, dx[] = { 1, -1, 0, 0 };
ll INFL = 1ll << 60, INF = 1 << 30, mod = 1e9 + 7, Min = INFL, Max = -1;
ll a, b, c, n, sum, A[500010], B[500000], rui[500000]; bool dp[100200];
str S; bool check = false;	vector<ll> v;
ll food[] = { 100,101,102,103,104,105 };

int main() {
	//Code Line


	cin >> n;

	for (int i = 0; i < n + 106; i++) {
		dp[i] = false;
	}

	dp[0] = true;

	for (int i = 0; i < n; i++) {
		for (int j = 0; j < 6; j++)if (dp[i])dp[i + food[j]] = true;
	}

	if (dp[n])cout << 1 << endl;
	else cout << 0 << endl;

	return 0;
}


Measured memory_bytes: 384
#include<stdio.h>
#include<string.h>
#define NMAX 100
#define KMAX 25
int matrix[NMAX*2][NMAX], match[NMAX], visit[NMAX];
int Dfs(int, int);
int main(void)
{
  int i, x, y, e, s, t, maxflow = 0;
  scanf("%d %d %d", &x, &y, &e);
  for (i = 0; i < y; i++) match[i] = -1;
  for (i = 0; i < e; i++) {
    scanf("%d %d", &s, &t);
    matrix[s][t] = 1;
  }
  for (i = 0; i < x; i++) {
    memset(visit, 0, sizeof(int) * x);
    if (Dfs(i, y)) maxflow++;
  }
  printf("%d\n", maxflow);
}

int Dfs(int v, int ysize)
{
  int i;
  visit[v] = 1;
  for (i = 0; i < ysize; i++) {
    int w = match[i];
    if (!matrix[v][i]) continue;
    if (w < 0 || !visit[w] && Dfs(w, ysize)) {
      match[i] = v;
      return 1;
    }
  }
  return 0;
}


Measured memory_bytes: 2108
package main

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

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

func scanString() string   { sc.Scan(); return sc.Text() }
func scanRunes() []rune    { return []rune(scanString()) }
func scanInt() int         { a, _ := strconv.Atoi(scanString()); return a }
func scanInt64() int64     { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }
func scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }

func scanInts(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = scanInt()
	} 
	return res
}

func debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

//•*¨*•.¸¸♪main•*¨*•.¸¸♪(　-ω-)ノ　(　・ω・)
func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 10000), 1001001)

	a := scanInt()
	b := scanInt()
	c := scanInt()
	d := scanInt()

	if (a+d-1)/d >= (c+b-1)/b {
		fmt.Fprintln(wr, "Yes")
	} else {
		fmt.Fprintln(wr, "No")
	}
}


Measured memory_bytes: 1760
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)
#define MAX_V 100005


int main(void){
	ll SPACE[8] = {1,1,2,3,5,8,13,21};
	int h, w, k;
	cin>>h>>w>>k;
	ll dp[105][12];
	rep(i,105){
		rep(j,12){
			dp[i][j] = 0;
		}
	}
	dp[0][1] = 1;
	rep(i,h){
		reps(j,w){
			dp[i][j] %= MOD;
			dp[i+1][j-1] += (dp[i][j]*SPACE[j-3+1]*SPACE[w-j-1+1])%MOD;
			dp[i+1][j] += (dp[i][j]*SPACE[j-2+1]*SPACE[w-j-1+1])%MOD;
			dp[i+1][j+1] += (dp[i][j]*SPACE[j-2+1]*SPACE[w-j-2+1])%MOD;
		}
	}
	cout<<dp[h][k]%MOD<<endl;
	return 0;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define maxn 100005
int a[maxn];
long long b[maxn],sum1,sum2;
int main(){
	int n;scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d",a+i),sum1+=a[i];
	for(int i=3;i<=n;i+=2){
		b[i]=b[i-2]+(a[i-1]-a[i-2])*2;
	}
	b[2]=b[n]+(a[1]-a[n])*2;
	for(int i=4;i<=n;i+=2){
		b[i]=b[i-2]+(a[i-1]-a[i-2])*2;
	}
	for(int i=1;i<=n;i++)sum2+=b[i];
	sum1=(sum1-sum2)/n;
	for(int i=1;i<=n;i++)printf("%d ",b[i]+sum1);
	return 0;
}

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

char a[10][10]{};
int b,c;
void f(int d,int e){
	a[d][e]='.';
if(d+1==b&&e+1==c)return;
if(a[d+1][e]=='#'&&d+1<b){f(d+1,e);}
else if(a[d][e+1]=='#'&&e+1<c)f(d,e+1);
return;
}
signed main(){
cin>>b>>c;
for(int d=0;d<b;d++){
	for(int e=0;e<c;e++)cin>>a[d][e];
}
bool s=false;
f(0,0);
for(int x=0;x<b;x++){
	for(int y=0;y<c;y++)if(a[x][y]=='#')s=true;
}
if(s)puts("Impossible");
else puts("Possible");
}

Measured memory_bytes: 256
input_2 = input()
import itertools
n = list(itertools.product([0,1], repeat=3))
for comb in n:
    result = int(input_2[0])
    for i,x in enumerate(comb):
        if x==0:
            result += int(input_2[i+1])
        else:
            result -= int(input_2[i+1])
    if result==7:
        print(input_2[0],str(comb[0]).replace("0","+").replace("1","-"),
              input_2[1],str(comb[1]).replace("0","+").replace("1","-"),
              input_2[2],str(comb[2]).replace("0","+").replace("1","-"),
              input_2[3],"=7",sep="")
        break

Measured memory_bytes: 3064
s = input()
n = len(s)
i = 1
now = s[0]
ans = 1
while i < n:
    if s[i] == now:
        if i == n-1:
            break
        now = s[i] + s[i+1]
        i += 2
    else:
        now = s[i]
        i += 1
    ans += 1
    #print(now)

print(ans)

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

using namespace std;

using vi = vector<int>;
using ll = long long;

int main() {
	ios::sync_with_stdio(false); cin.tie(nullptr);
	int T = 1;

	//cin >> T;

	for (int t = 0; t < T; t++) {
		int x;

		cin >> x;
		
		cout << !!!x << endl;
		
	}

	return 0;
}



Measured memory_bytes: 3632
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <vector>

using namespace std;

int N;

long long int A[100001];

bool check(long long int min_A){
	
	int index1, index2, index3;
	
	index1 = 0;
	index2 = 0;
	index3 = 0;
	
	long long int sum1, sum2, sum3;
	
	sum1 = 0;
	sum2 = 0;
	sum3 = 0;
	
	for(int i = 0; i < N; i++){
		sum1 += A[i];
		if(sum1 >= min_A){
			index2 = i + 1;
			break;
		}
	}
	
	for(int i = index2; i < N; i++){
		sum2 += A[i];
		if(sum2 >= min_A){
			index3 = i + 1;
			break;
		}
	}
	
	for(int i = index3; i < N; i++){
		sum3 += A[i];
	}
	
	if(index2 == 0 || index3 == 0){
		return false;
	}
	
	while(true){
		if(sum3 >= min_A){
			break;
		}
		
		while(true){
			if(sum3 >= min_A){
				break;
			}
			sum3 += A[index1];
			sum1 -= A[index1];
			index1++;
			if(index1 == N){
				return false;
			}
		}
		while(true){
			if(sum1 >= min_A){
				break;
			}
			sum1 += A[index2];
			sum2 -= A[index2];
			index2++;
			if(index2 == N){
				return false;
			}
		}
		while(true){
			if(sum2 >= min_A){
				break;
			}
			sum2 += A[index3];
			sum3 -= A[index3];
			index3++;
			if(index3 == N){
				return false;
			}
		}
	}
	return true;
}

long long int binary_search_2(long long int lef, long long int rig){
	long long int middle = (lef + rig) / 2;
	//cout << middle << " ";
	if(rig - lef <= 1){
		if(check(rig)){
			return rig;
		}else{
			return lef;
		}
	}
	if(check(middle)){
		lef = middle;
	}else{
		rig = middle;
	}
	return binary_search_2(lef, rig);
}


int main(){
	
	cin >> N;
	
	for(int i = 0; i < N; i++){
		cin >> A[i];
	}
	long long int rig_max = 100000000000000;
	
	long long int ans = binary_search_2(0, rig_max);
	
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 3912