akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;//for StringBuilder
class c
{
    static void Main()
    {
        var nd = Array.ConvertAll(Console.ReadLine().Split(), long.Parse);
        long n = nd[0], d = nd[1];
        int ans = 0;
        for (int i = 0; i < n; i++)
        {
            var xy = Array.ConvertAll(Console.ReadLine().Split(), long.Parse);
            long x = xy[0], y = xy[1];
            if (d * d >= x * x + y * y) ans++;
        }
        Console.WriteLine(ans);
    }
}

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> input = new ArrayList<>();
		while(true) {
			int num = sc.nextInt();
			if(num != 0) {
				input.add(num);
			} else {
				break;
			}
		}
		for(int i = 0; i < input.size(); i++) {
			System.out.println("Case " + String.valueOf(i+1) + ": " + input.get(i));
		}
	}

}



Measured memory_bytes: 44684
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>

using namespace std;

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

	int ans = -1;
	for (int i = 0; i < 10000; i++) {
		int x = 0.08 * i;
		int y = 0.1 * i;

		if (x == a && y == b) {
			ans = i;
			break;
		}
	}

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


Measured memory_bytes: 256
#include<iostream>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<limits>
#include<sstream> 
#include<unordered_map>      

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;
typedef vector<int> vi;
typedef vector<ll> vl;

const int inf = numeric_limits<int>::max() >> 2;
const ll linf = numeric_limits<ll>::max() >> 2;
const ull ulinf = numeric_limits<ull>::max() >> 2;
const double pi = acos(-1);
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const int dx8[8]={-1,0,1,-1,1,-1,0,1};
const int dy8[8]={-1,-1,-1,0,0,1,1,1};

#define p_queue(i) priority_queue<i> 
#define rp_queue(i) priority_queue<i, vector<i>, greater<i>> 
#define umap(i,j) unordered_map<i,j>
#define P(p) cout<<(p)<<endl
#define PS(p) cout<<(p)<< " "
#define IN cin >> 
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rrep(i,m,n) for(int i = (m-1); i >= (int)(n); i--)
#define inrep(n,a) for(int i = 0; i < (int)(n); i++)cin >> a[i];
#define mod(i) ((i)%(ll)(1e9 + 7))
#define divm(a,b) (mod(a * modpow((ll)b,(ll)(1e9+5))))
#define rsort(a,b,c) sort(a, b, greater<c>())
#define vsort(v) sort(v.begin(), v.end())
#define rvsort(v) sort(v.begin(), v.end(), greater<c>()) 
#define ft first
#define sd second
#define pb push_back
#define it insert
#define sz(x) ((int)(x).size())
#define lb(a,n,k) (lower_bound(a,a+n,k) - a) 
#define vlb(a,k)  (lower_bound(a.begin(),a.end(),k) - a.begin())
#define ub(a,n,k) (upper_bound(a,a+n,k) - a) 
#define vub(a,k)  (upper_bound(a.begin(),a.end(),k) - a.begin())
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define ret return

ll modpow(ll i,ll j){ ll tmp=1; while(j){ if(j%2)tmp=mod(tmp*i);i=mod(i*i);j/=2;}return tmp;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

vector<string> split(const string &str, char sep){
    vector<string> v;
    stringstream ss(str);
    string buffer;
    while( getline(ss, buffer, sep) ) {
        v.push_back(buffer);
    }
    return v;
}

//ll ncr[100][100];
//ll nCr(int n, int r){if(n==r) ret ncr[n][r] = 1; if(r==0) ret ncr[n][r] = 1; if(r==1) ret ncr[n][r] = n;if(ncr[n][r]) ret ncr[n][r]; ret ncr[n][r] = nCr(n-1,r) + nCr(n-1,r-1);}

//ll npr[100][100]={};
//ll nPr(int n,int r){if(npr[n][r])ret npr[n][r];if(r==0)ret npr[n][r] = 1;if(r==1)ret npr[n][r] = n;ret npr[n][r] = n * nPr(n-1,r-1);}

//ll nHr(int n,int r){ret nCr(n+r-1,r);}

///////////////////////////////////////////////////////////////////////////


int main(){
    
    string s,t;
    cin >> s >> t;

    rrep(i,sz(s)-sz(t)+1,0){
	bool f = 0;
	//	P(i);
	rep(j,0,sz(t)){
	    //  P(s[j+i]);
	    if(s[j+i] != '?' && s[j+i] != t[j]){
		f = 1;
		break;
	    }
	   
	}
	if(f == 0){

	    rep(k,0,sz(t))s[k+i] = t[k];
	    rep(k,0,sz(s)){
		if(s[k] == '?')cout << 'a' ;
		else cout << s[k];
	    }
	    cout << endl;
	    ret 0;
	}
	
    }

    P("UNRESTORABLE");
    return  0;
}


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


def solve(X: int, A: int, B: int):
    print("delicious" if A >= B else "safe" if A + X >= B else "dangerous")


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(X, A, B)


if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int[][] C = new int[3][3];
        for (int i=0; i<3; i++) {
            for (int j=0; j<3; j++) {
                C[i][j] = scan.nextInt();
            }
        }

        int min = C[0][0];
        for (int i=1; i<3; i++) {
            if (C[0][i] < min) min = C[0][i];
        }

        int check;
        for (int a1 = 0; a1 <= min; a1++) {
            int c11 = C[0][0] - a1;
            int a2 = C[1][0] - c11;
            int a3 = C[2][0] - c11;

            boolean flag = true;
            for (int i=1; i<3; i++) {
                check = C[0][i] - a1;
                if (C[1][i] - a2 != check || C[2][i] - a3 != check) {
                    flag = false;
                    break;
                }
            }

            if (flag == true) {
                System.out.println("Yes");
                System.exit(0);
            }
        }

        System.out.println("No");
    }
}


Measured memory_bytes: 23124
// :)
// "Khodaya, be man "Tagwaye setiz" biamooz ta
//  dar anbuh masuliat nalaghzam ..." -Shariati
#include <bits/stdc++.h>

using namespace std;
typedef long long int64;
typedef pair<int,int> pii;
typedef pair<int64,int64> pii64;

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()

const int maxn = 1e5+10;
const int64 MO = 1e9+7;
const int64 IN = 1e18;

int64 dp[maxn];

int N, W;

int main () {
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	fill(dp, dp + maxn, IN); 
	dp[0] = 0;
	// 
	cin >> N >> W;
	for (int i = 0; i < N; i++) {
		int w, v;
		cin >> w >> v;
		for (int t = maxn - 1 - v; t >= 0; t--)
			dp[t + v] = min(dp[t + v], dp[t] + w);
	}
	//
	for (int i = maxn - 1; i >= 0; i--)
		if (dp[i] <= W)
			return cout << i << "\n", 0;
	//
}



Measured memory_bytes: 1024
#include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>
#include <memory.h>
#include <iomanip>
#include <bitset>
#include <list>
#include <stack>
#include <deque>

using namespace std;

#define mod 1000000007

int main()
{
	int n, k;
	cin >> n >> k;
	if(n / 2 + n % 2 >= k) cout << "YES" << endl;
	else cout << "NO" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <bits/stdc++.h>
#include <stdlib.h>
#include <stdio.h>
#include <functional>
using namespace std;

int main() {
  int N,M;
  cin >> N;
  vector<string> vecN(N);
  for(int i = 0; i<N;i++){
      cin >> vecN.at(i);
  }
  cin >> M;
  vector<string> vecM(M);
  for(int i = 0; i<M;i++){
      cin >> vecM.at(i);
  }
  
  vector<int> count(N,0);
  for(int i = 0;i<N;i++){
      for(int j =0;j<N;j++){
          if(vecN.at(i) == vecN.at(j)){
              count.at(i)++;
          }
      }
      for(int j = 0; j < M ;j++){
          if(vecN.at(i) == vecM.at(j)){
              count.at(i) -= 1;
          }
      }
  }
  std::sort(count.begin(), count.end());
  int ans;
  ans = max(count.at(N-1) , 0);
  cout << ans << endl;
}


Measured memory_bytes: 256
x = list(map(int, input().split()))
y = list(map(int, input().split()))
z = list(map(int, input().split()))

a = (sum(x) + sum(y) + sum(z)) / 3
b = x[0] + y[1] + z[2]
c = x[1] + y[2] + z[0]
d = x[2] + y[0] + z[1]

if a == b == c == d:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 3064
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <stack>
#include <functional>

#ifdef LOCAL
    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
    #define eprintf(...) 42
#endif

#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; ++i)
#define repp(i, m, n) for(ll i = m, i##_len = (n); i < i##_len; ++i)
#define reprev(i, n) for(ll i = (n-1LL); i >= 0; --i)
#define all(x) (x).begin(), (x).end()
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; }
template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int,int> P;
typedef long double ld;

int mod (int a, int b) {
	return ((a % b) + b) % b;
}
int main(void)
{
	string s, t;
	cin >> s >> t;
	int x[2][100001] = {}, y[2][100001] = {};
	rep (i, s.size()) {
		int tmp = (s[i] == 'A');
		x[0][i + 1] = x[0][i] + tmp;
		x[1][i + 1] = x[1][i] + (!tmp);
		// eprintf("%d/%d ", x[0][i + 1], x[1][i + 1]);
	}
	// eprintf("\n");
	rep (i, t.size()) {
		int tmp = (t[i] == 'A');
		y[0][i + 1] = y[0][i] + tmp;
		y[1][i + 1] = y[1][i] + (!tmp);
		// eprintf("%d/%d ", y[0][i + 1], y[1][i + 1]);
	}
	// eprintf("\n");
	int q;
	cin >> q;
	rep (i, q) {
		int a, b, c, d;
		cin >> a >> b >> c >> d;
		int xx[2], yy[2];
		rep (j, 2) {
			xx[j] = x[j][b] - x[j][a - 1];
		}
		rep (j, 2) {
			yy[j] = y[j][d] - y[j][c - 1];
		}
		eprintf("%d %d -> %d %d\n", xx[0], xx[1], yy[0], yy[1]);
		if (mod(yy[0] - xx[0], 3) == mod(yy[1] - xx[1], 3)) {
			cout << "YES\n";
		} else {
			cout << "NO\n";
		}
	}
	return 0;
}

Measured memory_bytes: 2432
parseInt(x) = parse(Int, x)
parseBigInt(x) = parse(BigInt, x)
parseFloat(x) = parse(Float64, x)
parseBigFloat(x) = parse(BigFloat, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)

function main()
    n=parseInt(readline())
    a=parseMap(split(readline()))
    b=parseMap(split(readline()))
    amari=sum(a)-sum(b)
    if amari<0
        println(-1)
    else
        ans=n
        dif=[0 for i in 1:n]
        for i in 1:n
            if a[i]>=b[i]
                dif[i]=a[i]-b[i]
            else
                dif[i]=1<<32 # 適当な大きい数
            end
        end
        sort!(dif)
        for i in dif
            if amari>=i
                ans-=1
                amari-=i
            else
                break
            end
        end
        println(ans)
    end
end
main()

Measured memory_bytes: 128136
#include<bits/stdc++.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
	string s;
	char let;
	int n =0;
	cin>>s;
	string::size_type idx;
	for(let='a';let<='z';let++)
	{
		idx=s.find(let);
		if(idx== string::npos)
		{
			n = 1;
			cout<<let<<endl;
			break;
		}
	}
	if(n==0)
	{
		cout<<"None"<<endl; 
	}
	return 0;
	 
}


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

int main(){
    int N;
    int v[101],w[101];
    int W;
    int dp[101][10001];
    cin >> N >> W;
    for(int i=0;i<N;i++){
        cin >> v[i] >> w[i];
    }

    for(int i=0;i<101;i++) for(int j=0;j<10001;j++) dp[i][j]=0;

    for(int i=0;i<N;i++){
        for(int j=0;j<=W;j++){
            if(j-w[i]>=0){
                dp[i+1][j] = max(dp[i][j],dp[i][j-w[i]]+v[i]);
            }else{
                dp[i+1][j] = dp[i][j];
            }
        }
    }

    cout << dp[N][W] << endl;
}

Measured memory_bytes: 5108
n = int(input())
S = [list(input()) for _ in range(n)]
T = {}
for c in S[0]:
    T[c] = S[0].count(c)
for s in S:
    for t in T:
        if T[t] <= s.count(t):
            continue
        else:
            T[t] = s.count(t)

ans = sorted(T)
for a in ans:
    print(a*T[a], end='')
print()


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

#define int long long 
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define INF 1e9+1
#define N 100005
int mx=0;

int n,m;
int dp[N];
vector<int> adj[N];
bool vis[N];

int dfs(int u){
    if(dp[u]!=-1) return dp[u];
    dp[u]=0;
    //vis[u]=true;
    for(auto v:adj[u]){
        

            dp[u]=max(dp[u],1+dfs(v));
        }
        
    
    return dp[u];
}
int32_t main(){
    cin>>n>>m;
    
    while(m--){
        int u,v;
        cin>>u>>v;
        adj[u].pb(v);
        //adj[v].pb(u);
    }
    memset(dp,-1,sizeof(dp));
    for(int i=1;i<=n;i++){
        if(dp[i]==-1) dfs(i);
    }
    /*for(auto i:adj){
        cout<<i.ff<<"->";
        for(auto j:i.ss) cout<<j<<" ";
        cout<<endl;
    }*/
    int mx=0;
    //cout<<endl;
    //for(int i=1;i<=n;i++) cout<<dp[i]<<" ";
    //cout<<endl;
    //cout<<endl;
    for(int i=1;i<=n;i++) mx=max(mx,dp[i]);
    cout<<mx<<endl;
}

Measured memory_bytes: 7808
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define ll              long long
#define pb              push_back
#define ppb             pop_back
#define endl            '\n'
#define mii             map<ll,ll>
#define pii             pair<ll,ll>
#define vi              vector<ll>
#define vs              vector<string>
#define all(a)          (a).begin(),(a).end()
#define F               first
#define S               second
#define sz(x)           ((ll)x.size())
#define hell            (1000000007)
#define inf             ((ll)5e18 + 5)
#define PI              ((double)3.14159265358979323844)
#define DECIMAL(n)      cout << fixed << setprecision(n);
#define rep(i,a,b)      for (ll i=a;i<b;i++)
#define repr(i,a,b)     for (ll i=a-1;i>=b;i--)
#define bitcount(a)     (ll)__builtin_popcount(a)
#define lbnd            lower_bound
#define ubnd            upper_bound
#define mp              make_pair
#define ios             ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ordered_set     tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define trace(...)      __f(#__VA_ARGS__, __VA_ARGS__)

template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    std::cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');std::cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}

using namespace std;
using namespace __gnu_pbds;

/*----------------------Graph Moves----------------*/
//const int fx[]={+1,-1,+0,+0};
//const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*------------------------------------------------*/

//primes for hashing 937,991,1013,1409,1741



void solve() {
    ll n;
    cin>>n;
    mii m;
    rep(i,0,n){
        string s;
        cin>>s;
        if (s=="AC"){
            m[1]++;
        }
        else if (s=="WA"){
            m[2]++;
        }
        else if (s=="TLE"){
            m[3]++;
        }
        else m[4]++;
    }
    cout<<"AC x "<<m[1]<<endl;
    cout<<"WA x "<<m[2]<<endl;
    cout<<"TLE x "<<m[3]<<endl;
    cout<<"RE x "<<m[4]<<endl;
}

signed main() {
    ios
    ll test=1;
    //cin>>test;
    while (test--) solve();
    return 0;
}

Measured memory_bytes: 3644
k = int (input())

def make_divisors(n):
	divisors = []
	for i in range(1, int(n**0.5)+1):
		if n % i == 0:
			divisors.append(i)
			if i != n // i:
				divisors.append(n//i)

	# divisors.sort()
	return divisors

a =  make_divisors(k)
a.sort()
c = len(str(k))
for i in a:
	b = k / i
	c = min(c,len(str(max(i,b))))
print (c)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
using i64 = int_fast64_t;
#define rep(i, N) for(int (i) = 0; (i) < (N); (i)++)
#define all(v) (v).begin(), (v).end()
#define eb emplace_back

int main(){
  i64 H, W;
  cin>>H>>W;
  
  i64 ans = (H*W+1) / 2;
  if(H == 1 || W == 1) ans = 1;
  cout << ans << endl;
}


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

int pow(int a, int n) {
    if (n == 0) return 1;
    
    if (n == 1) return a;
    
    if (n % 2 == 0) {
        int half = pow(a, n / 2);
        return half * half;
    }
    else return pow(a, 1) * pow(a, n - 1);
}

int main() {
    int n, m;
    cin >> n >> m;
    int k, si;
    vector<vector<int>> s(m, vector<int>());
    for (int i = 0; i < m; i++)
    {
        cin >> k;
        for (int j = 0; j < k; j++)
        {
            cin >> si;
            s.at(i).push_back(si - 1);
        }
    }
    
    vector<int> p(m);
    for (int i = 0; i < m; i++)
    {
        cin >> p.at(i);
    }

    int maximum = pow(2, n) - 1;
    long long ans = 0;
    for (int bit = 0; bit <= maximum; bit++)
    {
        int lighting = 0;
        for (int i = 0; i < m; i++)
        {
            int cnt = 0;
            for (int j = 0; j < (int)s.at(i).size(); j++)
            {
                if (bit&(1<<s.at(i).at(j))) cnt++;
            }
            if (cnt % 2 == p.at(i)) lighting++;
        }
        if (lighting == m) {
            ans++;
        }
    }
    
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <algorithm>
#include <functional>
#include <cstring>
#include <limits.h>

#define FOR(i,k,n)  for (int i=(k); i<(int)(n); ++i)
#define REP(i,n)    FOR(i,0,n)
#define FORIT(i,c)	for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define SZ(i) ((int)i.size())
#define pb          push_back
#define mp          make_pair
#define mt          make_tuple
#define ALL(X)      (X).begin(),(X).end()
typedef long long LL;

using namespace std;

int n;
vector<LL> v;

int main(void){
    scanf("%d",&n);
    REP(i,3*n){int a;scanf("%d",&a);v.pb((LL)a);}
    sort(ALL(v));
    reverse(ALL(v));
    LL ans=0;
    REP(i,n)ans+=v[i*2+1];
    printf("%lld\n",ans);
     return 0;
}



Measured memory_bytes: 5616
#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<map>
#include<algorithm>
#include<functional>
#include<utility>
#include<cmath>
#include<complex>
#include<iomanip>

using namespace std;

#define REP(i,s,e) for(int i=int(s);i<=int(e);i++)
#define rep(i,n) for(int i=0;i<int(n);i++)
#define pi 3.14159265358979

int main(void){

	int n,x,y,w,h,c,a,b;
	cin >> n;
	rep(i,n){
	cin >> x >> y >> w >> h >> c;

	int cats=0;
	rep(j,c){
	cin >> a >> b;
	if(x<=a && a<=x+w && y<=b && b<=y+h)
	cats++;
	}

	cout << cats << endl;

	}

	return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <numeric>
#include <tuple>
#include <stack>

#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) x.begin(),x.end()
#define print(s) cout << s << endl
typedef long long ll;
using namespace std;

int main() {
    int n; cin >> n;
    int x = 0;
    for(int i = 1; i <= n; i += 2){
        int count = 0;
        for (int j = 1; j <= i ;j++){
            if (i%j == 0) {
                count++;
            }
        }
        if (count == 8) {
            x++;
        }
        count = 0;
    }
    cout << x << endl;
}

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

int main() {
    int L,R,d,result=0;
    cin >> L >> R >> d;

    for (int i = L; i <= R; i++) {
        if (i%d == 0) {
            result++;
        }
    }


    cout << result << endl;

    return 0;
}


Measured memory_bytes: 3628
#include<bits/stdc++.h>
#define watch(x) cout << (#x) << " is " << (x) << endl
typedef long long ll;
using namespace std;
int static fast = [](){
  ios::sync_with_stdio(false);
  cin.tie(0); cout.tie(0); return 0;
}();
// freopen("input.txt", "r", stdin);

int main() {
	int n;
  	cin >> n;
  	cout << n/3 << endl;
    return 0;
}



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

int main(){
ll h,w ;
cin>>h>>w;
char x[h][w];
for(ll i=0; i<h; i++){
    for(ll j=0; j<w; j++)
        cin>>x[i][j];
}
ll dp[h][w];
dp[0][0]=1;
for(ll j=1; j<w; j++){
    dp[0][j]= dp[0][j-1];
    if(x[0][j]=='#')
        dp[0][j]=0;
}
for(ll j=1; j<h; j++){
    dp[j][0]= dp[j-1][0];
    if(x[j][0]=='#')
        dp[j][0]=0;
}

for(int i=1; i<h; i++){
    for(int j=1;j<w; j++){
        if(x[i][j]=='.')
            dp[i][j]= (dp[i-1][j]%power+ dp[i][j-1]%power)%power;
        else
            dp[i][j]=0;
    }
}
cout<< dp[h-1][w-1]<<endl;
return 0;

}


Measured memory_bytes: 9088
#include<cstdio>
#include<cstring>
#include<algorithm>
int n,ans,a[100100];
int main(){
    scanf("%d",&n);
    for(int i=1;i<=n;i++) scanf("%d",&a[i]);
    std::sort(a+1,a+n+1);
    std::reverse(a+1,a+n+1);
    for(int i=1;i<=n;i++)	if(i+1>a[i+1]){
           					 	for(int j=i+1;a[j]==i;j++) ans^=1;
           					 	ans|=(a[i]-i)&1;
           					 	puts(ans? "First":"Second");
           					 	return 0;
        					}
} 

Measured memory_bytes: 512
N, M, C = map(int, input().split())
B = list(map(int, input().split()))

An = []
for i in range(N):
  An.append(list(map(int, input().split())))

cnt = 0
for i in range(N):
  A = An[i]
  
  lineTotal = 0
  for index in range(len(A)):
    lineTotal = lineTotal +  A[index] * B[index]
  
  if lineTotal + C > 0:
    cnt = cnt + 1

print(cnt)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define sz(a)  int((a).size())
#define pb  push_back
#define eb  emplace_back
#define FOR(var,from,to) for(int var=(from);var<=(to);++var)
#define rep(var,n)  for(int var=0;var<(n);++var)
#define rep1(var,n)  for(int var=1;var<=(n);++var)
#define repC2(vari,varj,n)  for(int vari=0;vari<(n)-1;++vari)for(int varj=vari+1;varj<(n);++varj)
#define repC3(vari,varj,vark,n)  for(int vari=0;vari<(n)-2;++vari)for(int varj=vari+1;varj<(n)-1;++varj)for(int vark=varj+1;vark<(n);++vark)
#define ALL(c)  (c).begin(),(c).end()
#define RALL(c)  (c).rbegin(),(c).rend()
#define tr(i,c)  for(auto i=(c).begin(); i!=(c).end(); ++i)
#define mset(arr,val)  memset(arr,val,sizeof(arr))
#define mid(x,y) ((x)+((y)-(x))/2)
#define IN(x,a,b) ((a)<=(x)&&(x)<=(b))
using namespace std;
template<typename T> void Out(T x) { cout << x << endl; }
template<typename T1, typename T2> void Ans(bool f, T1 y, T2 n) { if(f) Out(y); else Out(n); }


int main() {
    int N,a,b;
    int ans=0;
    cin>>N>>a>>b;
    ans=min(a*N,b);
    

    Out(ans);
    return 0;
}

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

using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

#define REP(i, l, n) for(int i=(l), i##_len=(n); i<i##_len; ++i)
#define ALL(x) (x).begin(),(x).end()
#define pb push_back

ll gcd(ll a,ll b){return b ? gcd(b,a%b) : a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

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

char alpha[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};

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

int main(){
    int d; cin >> d;
    cout << "Christmas ";
    REP(i, 0, 25-d){
        cout << "Eve ";
    }
    cout << endl;
}

Measured memory_bytes: 3608
#include<stdio.h>
#define max 100000

int partition(int part[],int start,int end){
  int x,i,j,temp;

  x=part[end];
  i=start-1;

  for(j=start;j<=end-1;j++){
    if(part[j]<=x){
	i+=1;
	//交換
	temp=part[i];
	part[i]=part[j];
	part[j]=temp;
      }
  }
    //交換
      temp=part[i+1];
      part[i+1]=part[end];
      part[end]=temp;
    return i+1;
}
int main(){
  int num,i,kaeriti,part[max];

  scanf("%d",&num);
  for(i=0;i<num;i++){
    scanf("%d",&part[i]);
  }
  //printf("%d",part[num-1]);
  kaeriti=partition(part,0,num-1);
  
  //出力
  for(i=0;i<num-1;i++){
    if(i==kaeriti){
      printf("[%d] ",part[kaeriti]);
	}else{
      printf("%d ",part[i]);
    }
  }
  printf("%d\n",part[num-1]);
  return 0;
}



Measured memory_bytes: 2128
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
set<int>st;
int main() {
	int q;
	cin >> q;
	while (q--) {
		int Q, k;
		cin >> Q >> k;
		if (Q == 0) {
			st.insert(k);
			cout << st.size() << endl;
		}
		else {
			cout << st.count(k) << endl;
		}
	}
	return 0;
}


Measured memory_bytes: 12444
#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize ("-ffloat-store")  
#pragma GCC optimize ("-fno-defer-pop") 
#define all(a) a.begin(),a.end()
#define bs binary_search
#define ll long long int
#define ps push_back
#define fs first
#define sc second
#define mkp make_pair
#define mod 1000000007
ll fl[100001];
ll mx[100001];
ll dfs(vector<ll> vc[],ll i,ll n){
	fl[i]=1;

	if(mx[i]!=-1){
		return mx[i];
	}

	ll j,a=0;
	for(j=0;j<vc[i].size();j++){
		a=max(a,dfs(vc,vc[i][j],n));
	}
    return mx[i]=a+1;
}
int main(){
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	
	ll i,j,k,l,n,m;

	memset(mx,-1,sizeof(mx));

	cin>>n>>m;
	vector<ll> vc[n+1];
	for(i=0;i<m;i++){
		cin>>k>>l;
		vc[k].ps(l);
	}

	for(i=1;i<=n;i++){
		if(fl[i]==0){
			dfs(vc,i,n);
		}
	}

	ll an=0;
	for(i=1;i<=n;i++){
		if(mx[i]>an) an=mx[i];
	}
	cout<<an-1;
	return 0;
}
//ctrl H replace

Measured memory_bytes: 9088
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);

		int X = scan.nextInt();
		int t = scan.nextInt();
		
		if(X>=t){
			System.out.println(X-t);
		} else if (X<t){
			System.out.print(0);
		}
		

	}
}

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

int main()
{
    int A, B;
    cin >> A >> B;

    for (int i=1; i<=3; i++) {
        if (A*B*i%2 == 1) {
            cout << "Yes";
            return 0;
        }
    }
    cout << "No";

    return 0;
}


Measured memory_bytes: 256
#include <cstring>
#include <map>
#include <unordered_map>
#include <string>
#include <list>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <cstdio>
#include <iostream>
#include <set>
#include <unordered_set>
using namespace std;

#define MAX(a,b) (a>b?a:b)
#define MIN(a,b) (a<b?a:b)
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int, int> pii;

int gi() {
    int a;
    scanf("%d", &a);
    return a;
}

ll gli() {
    ll a;
    scanf("%lld", &a);
    return a;
}

char s[20], t[20];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    scanf("%s", s);
    scanf("%s", t);
    int n = strlen(s);
    printf(strncmp(s, t, n) ? "No\n" : "Yes\n");

    return 0;
}


Measured memory_bytes: 3852
#include <bits/stdc++.h>
using namespace std;
int a[100000];
bool x=false;
int main()
{
	int n;
	a[0]=0;
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
	}
	for(int i=n;i>=1;i--)
	{
		if(a[i-1]-a[i]>1) {x=true; break;}
		if(a[i-1]-a[i]==1) a[i-1]--;
		if(a[i-1]-a[i]<1) continue;
	}
	if(x==true) printf("No");
	else printf("Yes");
	return 0;
 } 

Measured memory_bytes: 640
#include <iostream>
#include <vector>
//#include <string>
#include <algorithm>
#include <math.h>
//#include <queue>
//#include <stack>
//#include <iomanip>

// sometimes used
//#include <set>
//#include <map>
//#include <numeric>
//#include <list>
//#include <deque>
//#include <unordered_map>

//typedef long long LL;
//typedef long double LD;
using namespace std;
 
//#define MOD 1000000007
#define MAX 100100
//#define NIL -1

bool is_unique(int x){
    bool ok=true;
    int max_val=(int)sqrt(x)+1;
    for(int i=2; i<max_val; i++){
        if(x%i==0){
            ok=false;
            break;
        }
    }

    return ok;
}

int main(){
    int q;
    vector<int> l;
    vector<int> r;
    int tmp_l;
    int tmp_r;
    bool ok;
    bool ok_half;
    vector<int> d(MAX, 0);

    cin >> q;

    for(int i=3; i<MAX; i++){
        ok=is_unique(i);
        ok_half=is_unique((i+1)/2);
        //cout << i << " " << ok << " " << ok_half << endl;
        d[i]=d[i-1];
        if(ok==true && ok_half==true){
            d[i]+=1;
        }    
    }

    for(int i=0; i<q; i++){
        cin >> tmp_l >> tmp_r;
        l.push_back(tmp_l);
        r.push_back(tmp_r);
    }

    for(int i=0; i<q; i++){
        cout << d[r[i]]-d[l[i]-1] << endl;
        //cout << d[l[i]-1] << " " << d[r[i]] << endl;
    }

    return 0;
}


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

int main() {
  int N;
  cin >> N;
  bool a=false;
  for(int i=1;i<=9;i++){
    if(N%i==0&&N/i<=9){
      a=true;
      break;
    }
  }
  if(a){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define uli unsigned long long int
#define INF 99999999999
#define rep(i,m,n) for(lli i = m;i < n;i++)
#define rrep(i,m,n) for(lli i=m-1;i>=n;i--)
#define pb(n) push_back(n)
#define UE(N) N.erase(unique(N.begin(),N.end()),N.end());
#define Sort(n) sort(n.begin(), n.end())
#define Rev(n) reverse(n.begin(),n.end())
#define Out(S) cout << S << endl
#define NeOut(S) cout << S
#define HpOut(S) cout << setprecision(150) << S << endl
#define Vec(K,L,N,S) vector<L> K(N,S)
#define DV(K,L,N,M,S) vector<vector<L>> K(N,vector<L>(M,S))
#define TV(K,L,N,M,R,S) vector<vector<vector<L>>> K(N,vector<vector<L>>(M,vector<L>(R,S)))
#define pint pair<lli,lli>
#define paf(L,R) pair<L,R>
#define mod 1000000007
#define MAX 5100000
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
vector<bool>prime_table(int n){
  vector<bool>prime(n+1,1);
  if(n>=0)prime[0]=0;
  if(n>=1)prime[1]=0;
  for(int i=2;i*i<=n;i++){
    if(!prime[i])continue;
    for(int j=i+i;j<=n;j+=i){
      prime[j]=0;
    }
  }
  return prime;
}
int main(){
  lli A,B,C,D,E,F,N,M,K,L,R,X,Y,H,W,sum=0,num=0,flag=0;string S,T;
  cin >> N;
  num=2;
  auto P=prime_table(55555);
  while(N>0){
    if(P[num]&&num%5==1){
      Out(num);
      N--;
      num++;
    }
    else num++;
  }
}

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

using namespace std;

#define intt long long
#define FAST ios_base::sync_with_stdio(0); cin.tie(0);

int main() {

	FAST;

	int x;
	cin >> x;
	if (x >= 1800) {
		cout << 1 << '\n';
	}
	else if (x >= 1600) {
		cout << 2 << '\n';
	}
	else if (x >= 1400) {
		cout << 3 << '\n';
	}
	else if (x >= 1200) {
		cout << 4 << '\n';
	}
	else if (x >= 1000) {
		cout << 5 << '\n';
	}
	else if (x >= 800) {
		cout << 6 << '\n';
	}
	else if (x >= 600) {
		cout << 7 << '\n';
	}
	else {
		cout << 8 << '\n';
	}
	return 0;
}

Measured memory_bytes: 3648
/*In the name of Allah*/
#include <bits/stdc++.h>
using namespace std;
#define MAX 200011
#define inf 2000000111
#define mod 998244353
#define ll long long

int bit[2][MAX + 10];

struct P
{
	ll x,y;
}a[MAX];

ll up[2][MAX],down[2][MAX];

void upd(ll i,bool b){
	if(b == 1) i = MAX - i;
	for(; i <= MAX; i += (i&(-i))){
		bit[b][i]++;
	}
}

ll get(ll i,bool b){
	ll ans = 0;
	if(b == 1) i = MAX - i;
	for(; i > 0 ; i -= (i&(-i))){
		ans += bit[b][i];
	}
	return ans;
}

ll qpow (ll x,ll y){
	if(y < 0)return 0;
	if(y == 0)return 1;
	ll temp = qpow(x,y/2);
	temp = (temp * temp)%mod;
	if(y&1)
		return (temp * x)%mod;
	return temp;
}

bool cmpx(P x, P y){return x.x < y.x;}
bool cmpy(P x, P y){return x.y < y.y;}

int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int n;
	cin>>n;
	for(int i = 0; i < n ; i++)cin>>a[i].x>>a[i].y;


	sort(a,a+n,cmpy);
	a[0].y = 1;
	for(int i = 1; i < n ; i++)a[i].y = a[i - 1].y +  1;

	sort(a,a+n,cmpx);
	a[0].x = 1;
	for(int i = 1 ;i < n ; i++)a[i].x = a[i - 1].x  + 1;	


	ll ans = 0;
	for(int i = 0; i < n ; i++){
		up[0][i] = get(a[i].y ,1);
		down[0][i] = get(a[i].y ,0);
		upd(a[i].y ,1);
		upd(a[i].y ,0);
	}
	memset(bit,0,sizeof bit);

	for(int i = n -1 ; i >= 0; i -- ){
		up[1][i] = get(a[i].y ,1);
		down[1][i] = get(a[i].y ,0);
		upd(a[i].y, 1);
		upd(a[i].y, 0);
	}

	for(int i = 0; i < n ; i++){
		// cout<<down[0][i]<<" "<<up[0][i]<<" "<<down[1][i]<<" "<<up[1][i]<<endl;
		ll temp = 0;
		temp += qpow(2,down[0][i]+up[0][i]);
		temp += qpow(2,down[0][i]+down[1][i]);
		temp += qpow(2,up[0][i]+up[1][i]);
		temp += qpow(2,down[1][i]+up[1][i]);
		temp -= qpow(2,down[0][i]);
		temp -= qpow(2,down[1][i]);
		temp -= qpow(2,up[0][i]);
		temp -= qpow(2,up[1][i]);

		temp = (temp + 4LL *  mod) %mod;		
		ans += (qpow(2,n) - temp + mod)%mod;

	}
	cout<<(ans - n + mod)%mod<<" ";
	return 0;
}


Measured memory_bytes: 11264
#include <iostream>
#include <utility>
#include <map>
#include <algorithm>
#define P pair<long long,char> // 数字・種類
using namespace std;

map<char,int> mp; // 文字 -> 配列のインデックス
P p[5];

bool checkF(){
  for( int i=1;i<5;i++ )
    if( p[i-1].second!=p[i].second )
      return false;
  return true;
}
bool checkS(){
  if( p[0].first==1 ){
    if( p[4].first==13 || p[4].first==5){
      for( int i=2;i<5;i++ )
	if( p[i-1].first+1 != p[i].first ) return false;
    }else      return false;
  }else{
    for( int i=1;i<5;i++ )
      if( p[i-1].first+1 != p[i].first ) return false;
  }
  return true;
}

int n2,n3;
void countP(){
  n2=0; n3=0;
  for( int i=0;i<3;i++ )
    if( p[i].first==p[i+1].first &&
	p[i].first==p[i+2].first ){
      n3=1;
      if( i==0 && p[3].first==p[4].first ) n2=1;
      if( i==2 && p[0].first==p[1].first ) n2=1;
      return ;
    }
  for( int i=1;i<5;i++ )
    if( p[i-1].first==p[i].first ){
      n2++; i++;
    }
}

int yaku(){ // ペアがないときは-1
  sort( p,p+5 );

  /*
  for( int i=0;i<5;i++ )
    cout << " " << p[i].first << p[i].second;
  cout << endl;
  */

  for( int i=0,j;i<2;i++ ){
    for( j=0;j<4;j++ )
      if( p[i].first != p[i+j].first ) break;
    if( j==4 ) return 6; // フォーカード
  }

  countP();
  if( n3==1 && n2==1 ) return 5; // フルハウス

  bool isF = checkF();  // フラッシュ
  bool isS = checkS();  // ストレート
  if( isF ){
    if( isS ){
      if( p[0].first==1 && p[1].first==10 )
	return 8; // ロイヤルストレートフラッシュ
      return 7; // ストレートフラッシュ
    }
    return 4; // フラッシュ
  }

  if( isS )   return 3; // ストレート
  if( n3==1 ) return 2; // スリーカード  
  if( n2==2 ) return 1; // ツーペア
  if( n2==1 ) return 0; // ワンペア

  return -1; // ブタ
}

int main(){
  int n;
  int fc[4][13], yc[9];


  for( int i=2;i<=9;i++ )   mp[ '0'+i ] = i;
  mp[ 'A' ] = 1;  mp[ 'T' ] = 10;
  mp[ 'J' ] = 11; mp[ 'Q' ] = 12;
  mp[ 'K' ] = 13;
  mp[ 'S' ] = 0; mp[ 'C' ] = 1;
  mp[ 'H' ] = 2; mp[ 'D' ] = 3;

  bool fff=false;
  while( cin>>n ){
    if( fff ) cout << endl;
    else fff=true;

    for( int i=0;i<4;i++ )
      for( int j=0;j<13;j++ )
	cin >> fc[i][j];
    for( int i=0;i<9;i++ )
      cin >> yc[i];

    while( n-- ){
      char num, kind;
      long long fCost=0;
      for( int i=0;i<5;i++ ){
	cin >> num >> kind;
	p[i] = P( mp[num],kind );
	fCost += fc[ mp[kind] ][ mp[num]-1 ];
      }
      long long yInd = yaku(), yCost=0;
      if( yInd>=0 ) yCost = yc[yInd];
      long long ans = fCost * yCost;
      cout << ans << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 916
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main() {
	int n, p = -1,i,X,Y; cin >> n;
	int x[105], y[105], h[105];
	for (i=0;i<n;i++) {
		cin >> x[i] >> y[i] >> h[i];
		if (h[i] != 0)p = i;
	}
	for (X = 0; X <= 100; X++) {
		for (Y = 0; Y <= 100; Y++) {
			int H = abs(x[p] - X) + abs(y[p] - Y) + h[p];
			if (H <= 0)continue;
			bool flag = 1;
			for (i = 0; i < n; i++)
				if (h[i] != max(H - abs(X - x[i]) - abs(Y - y[i]), (int)0))flag = 0;
			if (flag) {
				cout << X << ' ' << Y << ' ' << H << endl;
				cin >> n;
				return 0;
			}
		}
	}
}

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

int n,tot,fst[N],pnt[N<<1],nxt[N<<1],fa[N],dgr[N],son[N]; double f[N],g[N];
void add(int x,int y){
	pnt[++tot]=y; nxt[tot]=fst[x]; fst[x]=tot;
}
void dfs1(int x){
	int i,y; son[x]=0;
	for (i=fst[x]; i; i=nxt[i]){
		y=pnt[i];
		if (y!=fa[x]){
			fa[y]=x; dfs1(y);
			f[x]+=f[y]+1; son[x]++;
		}
	}
	if (son[x]) f[x]/=son[x];
}
void dfs2(int x){
	int i,y; double sum=g[x];
	for (i=fst[x]; i; i=nxt[i]){
		y=pnt[i];
		if (y!=fa[x]) sum+=f[y]+1;
	}
	for (i=fst[x]; i; i=nxt[i]){
		y=pnt[i];
		if (y!=fa[x]){
			if (x==1 && dgr[x]==1) g[y]=1;
				else g[y]=(sum-f[y]-1)/(dgr[x]-1)+1;
			dfs2(y);
		}
	}
}
int main(){
	scanf("%d",&n);
	int i,x,y;
	for (i=1; i<n; i++){
		scanf("%d%d",&x,&y);
		add(x,y); add(y,x); dgr[x]++; dgr[y]++;
	}
	dfs1(1); dfs2(1);
	for (i=1; i<=n; i++) printf("%.12f\n",f[i]*son[i]/dgr[i]+g[i]*(dgr[i]-son[i])/dgr[i]);
	return 0;
}


Measured memory_bytes: 12928
# coding: utf-8
# Your code here!


N, A, B, C = map(int, input().split())

take = []
INF = 10 ** 18

for _ in range(N) : 
    tmp = int(input())
    take.append(tmp)
    
def dfs(i, a, b, c) : 
    if i == N : return abs(A-a) + abs(B-b) + abs(C-c) -30 if min(a, b, c) > 0 else INF
    
    ret0 = dfs(i+1, a, b, c)
    ret1 = dfs(i+1, a + take[i], b, c) + 10
    ret2 = dfs(i+1, a, b + take[i], c) + 10
    ret3 = dfs(i+1, a, b, c + take[i]) + 10
        
    return(min(ret0, ret1, ret2, ret3))
        
print(dfs(0, 0, 0, 0))

Measured memory_bytes: 3316
//******\\
||udc321||	 
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<queue>
#include<map>
#include<set>
#include<fstream>
#define ll long long
#define fr(e,r,v) for(int e=r;e<v;e++)
#define bc(e,r,v) for(int e=r;e>v;e--)
#define all(n) (n.begin(),n.end())
#define ft first
#define sd second
#define pb push_back
#define lb lower_bound
#define mpr make_pair
#define db  double
using namespace std;
ll mod=1000000007;
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int main()
{
	 double d,t,m;
	 cin>>d>>t>>m;
	 if(d/t>m){cout<<"No"<<endl;}
	 else{cout<<"Yes"<<endl;}
	}


Measured memory_bytes: 3724
// 5/13 過去問ガリガリ
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
using Graph = vector<vector<int>>;

int main() {
    int H, A;
    cin >> H >> A;

    if (H % A == 0) cout << H / A << endl;
    else cout << H / A + 1 << endl;

    // cout << "Hello Wold" << endl;
}


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

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

    vector<int> L(M), R(M);

    vector<int> p(Q), q(Q);

    for (int i = 0; i < M; i++)
    {
        int l, r;
        cin >>l >> r;
        L[i] = l;
        R[i]= r;
    }
    
    for (int i = 0; i < Q; i++)
    {
        int pin, qin;
        cin >> pin >> qin;
        p[i] = pin;
        q[i] = qin;
    }

    vector<vector<int>> trains(N+1, vector<int>(N+1,0));

    for (int i = 0; i < M; i++)
    {
        trains[L[i]][R[i]]++;
    }

    vector<vector<int>> C(N+1, vector<int>(N+1,0));

    for (int i = 1; i <= N; i++)
    {
        for (int j = 1; j <= N; j++){
            C[i][j] = C[i][j-1] + trains[i][j];
        }
    }

    for (int i = 0; i < Q; i++)
    {
        int sum = 0;
        for (int j = p[i]; j <= q[i]; j++)
        {
            sum += C[j][q[i]] - C[j][p[i]-1];
        }
        cout << sum << endl;
    }

    return 0;
}


Measured memory_bytes: 7756
import sys

n,m,l = map(int, input().split())

a = [[0 for x in range(m)] for y in range(n)]
b = [[0 for x in range(l)] for y in range(m)]
c = [[0 for x in range(l)] for y in range(n)]

for i in range(n):
	arr = list(map(int, input().split()))
	for j in range(m):
		a[i][j] = arr[j]

for i in range(m):
	arr = list(map(int, input().split()))
	for j in range(l):
		b[i][j] = arr[j]

for i in range(n):
	for j in range(l):
		sum = 0
		for k in range(m):
			sum += a[i][k] * b[k][j]
		c[i][j] = sum
		
for i in range(n):
	for j in range(l):
		sys.stdout.write(str(c[i][j]))
		if j != l - 1:
			sys.stdout.write(' ')
	print()



Measured memory_bytes: 7068
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string a;
    cin>>a;
    for(int i=0;i<3;i++)
    	if(a[i]=='7')
    	{
	  		cout<<"Yes"<<endl;
	  		return 0;
    	} 
	cout<<"No"<<endl;  	    
    return 0;
}

Measured memory_bytes: 3584
#include<stdio.h>
int main(void) {
	char s[3];
	scanf("%c%c%c", &s[0],&s[1],&s[2]);
	if (s[0] =='7' || s[1] =='7' || s[2] == '7') printf("Yes");
	else { printf("No");
	}
 
	return 0;
}

Measured memory_bytes: 2088
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound, __gcd, count, find, next_permutation
#include <bitset>    // bitset
#include <deque>     // deque
#include <iomanip>   // setprecsion
#include <iostream>  // cout, endl, cin
#include <map>       // map
#include <queue>     // queue, priority_queue
#include <set>       // set
#include <stack>     // stack
#include <string>    // string, to_string, stoi
#include <tuple>     // tuple, make_tuple
#include <utility>   // pair, make_pair
#include <vector>    // vector

#include <cassert> // assert
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <cmath>  // abs, sin, cos, tan
#include <ctime> // clock

// __builtin_popcountll

using namespace std;
using Graph = vector<vector<int>>;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rrep(i, n) for (ll i = (n - 1); i >= 0; --i)
#define blank(ans) cout << (ans) << " ";
#define mp(p, q) make_pair(p, q)
#define mt(p, q, r) make_tuple(p, q, r)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef string str;

typedef vector<ll> vll;
typedef vector<ld> vd;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<str> vs;
typedef vector<vector<ll>> vvll;
typedef vector<vector<ld>> vvd;
typedef vector<vector<bool>> vvb;
typedef vector<vector<char>> vvc;
typedef vector<vector<str>> vvs;
typedef vector<pair<ll, ll>> vpll;
typedef vector<tuple<ld, ll, ll>> vtll;

const ld PI = acos(-1.0);
const ll MAX = 9000000000000000000;
const ll MIN = -9000000000000000000;
const ld DMAX = 4500;
const ld DMIN = -4500;
const ll MOD = 1000000007;

template <typename T>
void fin(T a)
{
  cout << a << endl;
  exit(0);
}

void Main()
{
  ll n; cin >> n;
  ll T = 0, X = 0, Y = 0;
  vll t(n), x(n), y(n);
  ll d = 0;
  rep(i, n)
  {
    cin >> t[i] >> x[i] >> y[i];
    T = t[i] - T;
    X = x[i] - X;
    Y = y[i] - Y;
    if(T >= abs(X + Y)&&abs(T - abs(X + Y)) % 2 == 0){}
    else d++;
    T = t[i];
    X = x[i];
    Y = y[i];
  }
  if(d != 0) fin("No");
  fin("Yes");
  return;
}

//前処理
int main()
{
  int ti = clock();
  srand((unsigned)time(NULL));
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(20); //高精度少数表示
  //cout << setfill('0') << internal << setw(4); //0埋め４桁
  Main();
  //cout << 1.0 * (clock() - ti) / CLOCKS_PER_SEC << endl; // 実行時間計測
  return 0;
}

Measured memory_bytes: 2560
#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <math.h>
#include <cmath>
#include <queue>
#include <stack>
#include <list>
#include <functional>
#include <numeric>
#include <iostream>
#include <string>
#include <time.h>
#include <bitset>

using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }

string S;

int main() {

	cin >> S;

	if (S[1] == 'B')
		cout << "ARC" << endl;
	else
		cout << "ABC" << endl;

	return 0;
}


Measured memory_bytes: 3620
#include <bits/stdc++.h>
#define ll long long
#define INF 999999999
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

typedef pair<int,int>P;
typedef pair<ll,ll>pl;

const int MAX_N = 40;

ll N,W;
ll v[MAX_N];
ll w[MAX_N];
vector<pl> x,y;

void func(int si,int ti,vector<pl> &x){
  int size=ti-si;
  rep(bit,1<<size){
    pl p=pl(0,0);
    for(int i=0;i<size;i++){
      if(bit>>i&1){
        p.first+=w[si+i];
        p.second+=v[si+i];
      }
    }
    x.push_back(p);
  }
}
  
int main(){
  cin>>N>>W;
  for(int i=0;i<N;i++)cin>>v[i]>>w[i];
    
  func(0,N/2,x);
  sort(x.begin(),x.end());
  func(N/2,N,y);
  sort(y.begin(),y.end());
    
  ll target=0,maxm=-(1LL<<60),ans=0;
    
  for(int i=(int)x.size()-1;i>=0;i--){
    pl p=x[i];
    while(target<(int)y.size() && p.first+y[target].first <=W ){
      maxm=max(maxm,y[target].second);
      target++;
    }
    ans=max(ans,maxm+p.second);
  }
  
  cout<<ans<<endl;
  return 0;
}

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

int main(){
    string S;
    cin >> S;
    bool judge = true;
    for(int i = 0; i < S.length() - 1; i++){
        if(S[i] == S[i + 1]) judge = false;
    }
    cout << (judge ? "Good" : "Bad") << endl;
}

Measured memory_bytes: 384
#include <iostream>
#include <map>
using namespace std;
using ll = long long;

int main() {
  int N;
  cin >> N;
  map<ll, int> ns;
  ll a;
  for(int i = 0; i < N; ++i) {
    cin >> a;
    ns[a]++;
  }
  ll ans = 0;
  for(auto n : ns) {
    if(n.second % 2 == 1) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 6528
import itertools
n=int(input())
stickl=[]
stickl=input().split()
      
li=list(itertools.combinations(range(n), 3))
count=0
for i in li:
  a=i[0]
  b=i[1]
  c=i[2]
  d=int(stickl[a])
  e=int(stickl[b])
  f=int(stickl[c])
  m=max(d,e,f)
  if d==e or e==f or f==d:
    continue
  if d+e+f>2*m:
    count+=1
print(count)

Measured memory_bytes: 20592
#include<bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define For(i,a,b) for(long long i=a;i<b;i++)
#define pb push_back
using namespace std;
typedef long long ll;
ll power(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;}
ll mcd(ll a,ll b){
    if(b>a)swap(a,b);
    if(b==0)return a;
    else return mcd(b,a%b);
}
ll n,m,k;
bool esprimo(ll n){
ll s=0;
for(ll i=1;i*i<=n;i++){
    if(n%i==0){s++;}}
if(s>=2){return false;}
return true;
}
vector<vector<ll>> ady;
ll vis[200005];
ll bfs(ll v){
vis[v]++;
queue<ll> q;
q.push(v);
ll c=1;
while(!q.empty()){
    v=q.front();
    q.pop();
    for(ll  i=0;i<ady[v].size();i++){
        if(vis[ady[v][i]]==0){
            vis[ady[v][i]]++;
            q.push(ady[v][i]);
            c++;
        }
    }

}
return c;
}
int main(){
    //    cout<<fixed<<setprecision(2);
//cin.tie(0); cout.tie(0); ios_base::sync_with_stdioy(0);
 cin>>n>>m;
 memset(vis,0,sizeof vis);
    ady.resize(n+1);
    for(int i=0;i<m;i++){
        ll x,y;
        cin>>x>>y;
        ady[y].pb(x);
        ady[x].pb(y);
    }
    ll ans=0;
    for(int i=1;i<=n;i++){
        if(vis[i]==0){
            vis[i]++;
            ll x=bfs(i);
                ans=max(x,ans);

        }

    }
    cout<<ans<<endl;

}


Measured memory_bytes: 18408