akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <stdbool.h>

int A[100010];

bool binarySearch(int A[], int n, int t) {
	int left = 0, right = n;
	while (right != left) {
		int mid = (right + left) / 2;
		if (A[mid] == t) {
			return true;
		}
		else if (A[mid] > t) {
			right = mid;
		}
		else if (A[mid] < t) {
			left = mid + 1;
		}
	}
	return false;
}


int main() {
	int n, q, t, sum = 0;
	scanf("%d", &n);
	for (int i = 0; i < n; ++i) scanf("%d", &A[i]);

	scanf("%d", &q);
	for (int i = 0; i < q; ++i) {
		scanf("%d", &t);
		sum += binarySearch(A, n, t);
	}

	printf("%d\n", sum);
}



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

int p[400000], q[400000];

template<class T,class comp>
class SegTree{
public:
	int n;
	T dat[MAX],def;
	void init(int n_,T d){
		def=d;
		n=1;while(n<n_)n*=2;
		for(int i=0;i<2*n-1;i++)dat[i]=def;
	}
	void update(int k,T a){
		k+=n-1;dat[k]=a;
		while(k){
			k=(k-1)/2;
			dat[k]=min(dat[k*2+1],dat[k*2+2]);
		}
	}
	T query(int a,int b,int k,int l,int r){
		if(a>=b||r<=a||b<=l)return def;
		if(a<=l&&r<=b)return dat[k];
		T vl=query(a,b,k*2+1,l,(l+r)/2);
		T vr=query(a,b,k*2+2,(l+r)/2,r);
		if(comp()(vl,vr))return vl;
		return vr;
	}
	T query(int a,int b){
		return query(a,b,0,0,n);
	}
};
SegTree<P,less<P>>t[2];

struct st{
	int l,r;
	bool operator<(const st&b)const{
		return t[l%2].query(l,r)>t[b.l%2].query(b.l,b.r);
	}
};
int main() {
	int n; scanf("%d", &n);
	t[0].init(n,P(INT_MAX,0)); t[1].init(n,P(INT_MAX,0));
	rep(i, n) {
		scanf("%d", &p[i]);
		t[i % 2].update(i, P(p[i], i));
	}
	priority_queue<st>que;
	que.push({0,n});
	int d=0;
	while(!que.empty()){
		st p=que.top();que.pop();
		P a=t[p.l%2].query(p.l,p.r);
		P b=t[!(p.l%2)].query(a.second+1,p.r);
		q[d++]=a.first;q[d++]=b.first;
		if(p.l<a.second)que.push({p.l,a.second});
		if(a.second+1<b.second)que.push({a.second+1,b.second});
		if(b.second+1<p.r)que.push({b.second+1,p.r});
	}
	rep(i, n) {
		if (i)printf(" ");
		printf("%d", q[i]);
	}
	puts("");
}


Measured memory_bytes: 16764
#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define rep(i,n) for (int i=0;i<(int)(n);i++)
#define codefor int test;scanf("%d",&test);while(test--)
#define yn(ans) cout<<(ans?"Yes":"No")<<endl
#define YN(ans) cout<<(ans?"YES":"NO")<<endl
#define umap unordered_map
#define uset unordered_set
using namespace std;
using ll = long long;
//入力系
void scan(int& a){scanf("%d",&a);}
void scan(long long& a){scanf("%lld",&a);}
template<class T> void scan(T& a){cin>>a;}
template<class T> void scan(vector<T>& vec){for(auto&& it:vec)scan(it);}
void in(){}
template <class Head, class... Tail> void in(Head& head, Tail&... tail){scan(head);in(tail...);}
//出力系
void print(int& a){printf("%d",a);}
void print(long long& a){printf("%lld",a);}
void print(double& a){printf("%.15lf",a);}
template<class T> void print(T& a){cout<<a;}
template<class T> void print(vector<T>& vec){if(vec.empty())return;print(vec[0]);for(auto it=vec.begin();++it!= vec.end();){putchar(' ');print(*it);}}
void out(){putchar('\n');}
template<class T> void out(T& t){print(t);putchar('\n');}
template <class Head, class... Tail> void out(Head& head, Tail&... tail){print(head);putchar(' ');out(tail...);}
//デバッグ系
template<class T> void dprint(T& a){cerr<<a;}
template<class T> void dprint(vector<T>& vec){if(vec.empty())return;cerr<<vec[0];for(auto it=vec.begin();++it!= vec.end();){cerr<<" "<<*it;}}
void debug(){cerr<<endl;}
template<class T> void debug(T& t){dprint(t);cerr<<endl;}
template <class Head, class... Tail> void debug(Head& head, Tail&... tail){dprint(head);cerr<<" ";debug(tail...);}

int main(){
    vector<int> vec(3);
    in(vec);
    sort(all(vec));
    out(vec);
}


Measured memory_bytes: 3180
#include <iostream>
#include <unordered_set>
#include <cstdint>
#include <vector>
#include <string>
#include <climits>
#include <set>
#include <algorithm>
#include <math.h>
#include <iomanip>
#include <numeric>
using namespace std;

int main()
{
	long long a, b;
	cin >> a >> b;
	cout << lcm(a, b);
}

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

using namespace std;

const int N = 100005;

int n;
int root[2];
int par[N];
int nchild[N];
int dis[N];
bool inpath[N];
vector<int> G[N];
vector<int> path;

void dfs(int u, int p, int t) {
	if (dis[root[t]] < dis[u]) root[t] = u;
	par[u] = p, nchild[u] = 1;
	for (auto v : G[u]) if (v != p) {
		dis[v] = dis[u] + 1, dfs(v, u, t), nchild[u] += nchild[v];
	}
}

vector<int> solve() {
	int id = 0;
	vector<int> res;
	for (auto u : path) {
		int tmp = ++id;
		for (auto v : G[u]) {
			if (!inpath[v]) res.push_back(++id);
		}
		res.push_back(tmp);
	}
	return res;
}

int main() {
	ios::sync_with_stdio(false);
	cin >> n;
	for (int i = 0; i < (n - 1); ++i) {
		int u, v; cin >> u >> v;
		G[u].push_back(v), G[v].push_back(u);
	}
	root[0] = 1;
	for (int i = 0; i < 2; ++i) {
		dis[root[0]] = 0, dfs(root[0], root[0], 0);
	}
	dis[root[0]] = 0, dfs(root[0], root[0], 1);
	int cur = root[1];
	while (cur != root[0]) {
		path.push_back(cur), inpath[cur] = 1, cur = par[cur];
	}
	path.push_back(root[0]), inpath[root[0]] = 1;
	// for (auto u : path) cout << u << ' '; cout << '\n';
	for (auto u : path) {
		for (auto v : G[u]) {
			if (!inpath[v] && nchild[v] > 1) {
				cout << -1; return 0;
			}
		}
	}
	vector<int> vec0 = solve();
	reverse(path.begin(), path.end());
	vector<int> vec1 = solve();
	if (vec0 > vec1) swap(vec0, vec1);
	for (auto i : vec0) cout << i << ' ';
}

Measured memory_bytes: 16632
/*  -*- coding: utf-8 -*-
 *
 * a.cc: A - Password
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

/* typedef */

/* global variables */

/* subroutines */

/* main */

int main() {
  int n;
  scanf("%d", &n);

  printf("%d\n", n * n * n);
  return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#include <iostream>
#include <iomanip>
#include <istream>
#include <ostream>
#include <sstream>
#include <iterator>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <bitset>
#include <utility>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <ctime>
#include <cctype>
#include <cstdlib>
#define IINF 100000000
#define INF 300000000000000000
#define MOD 1000000007
#define mod 1000000007
#define REP(i, a, n) for (ll i = a; i < (ll)(n); i++)
#define REPE(i, a, n) for (ll i = a; i <= (ll)(n); i++)
#define Endl endl
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define mmax(x,y)(x>y?x:y)
#define mmin(x,y)(x<y?x:y)
#define chmax(x,y) x=mmax(x,y)
#define chmin(x,y) x=mmin(x,y)
#define all(x) (x).begin(),(x).end()
#define siz(x) (ll)(x).size()
#define PI acos(-1.0)
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef pair<int,int>Pin;
typedef pair<ll,ll>Pll;
template<class T> using V=vector<T>;
long long GCD(long long a, long long b) {return b?GCD(b,a%b):a;}
long long LCM(long long a, long long b) {return a/GCD(a,b)*b;}
int dx[4]={-1,0,1,0};
int dy[4]={0,-1,0,1};
int ddx[8]={-1,0,1,0,1,1,-1,-1};
int ddy[8]={0,-1,0,1,1,-1,1,-1};
ll cmp(pair<ll,ll>a,pair<ll,ll> b){
        if(a.se!=b.se)
        return a.se<b.se;
        else
        return a.fi<b.fi;
}
//----------------------------------------------------------------------

//----------------------------------------------------------------------
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    //-------------------------------  
    //ll begin_time=clock();
    //-------------------------------
    ll n;cin>>n;
    set<ll>A;
    for(ll i=0;i<n;i++){
        ll a;cin>>a;
        A.insert(a);
    }
    ll m;cin>>m;
    set<ll>B;
    for(ll i=0;i<m;i++){
        ll b;cin>>b;
        B.insert(b);
    }
    set<ll>c;
    set_difference(all(A),all(B),inserter(c,c.begin()));
    for(auto it=c.begin();it!=c.end();it++){
        cout<<*it<<endl;
    }
    //-------------------------------  
    //ll end_time=clock();cout<<"time="<<end_time-begin_time<<"ms"<<endl;
    //-------------------------------
    return 0;
}
//----------------------------------------------------------------------





































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

#define int long long
#define ct(n) cout << n << endl;
#define cts(n) cout << n << " ";
#define cte cout << endl;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define repo(i,o,n) for(int i=o;i<n;i++)
#define repm(i,n) for(int i=n-1;i>=0;i--)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define sperase(v,n) (v).erase(remove(all(v), n), (v).end());
#define vdelete(v) (v).erase(unique(all(v)), (v).end());
#define vcopy(v1,v2) copy((v1).begin(), (v1).end(), back_inserter((v2)));
#define pb(n) push_back(n);

int n,k,x,ans;

main() {
    cin >> n >> k;
    rep(i,n) {
        cin >> x;
        ans += min(x,abs(k-x))*2;
    }
    ct(ans)
}

Measured memory_bytes: 256
use proconio::input;
use std::collections::BTreeMap;
use std::cmp::Reverse;

fn main() {
    input! {
        n: usize,
        mut h: usize,
        ab: [(usize, usize); n],
    }

    let mut map = BTreeMap::new();

    for (a, b) in ab {
        if let Some(val) = map.get_mut(&Reverse(a)) {
            *val = h;
        } else {
            map.insert(Reverse(a), h);
        }

        if let Some(val) = map.get_mut(&Reverse(b)) {
            *val += 1;
        } else {
            map.insert(Reverse(b), 1);
        }
    }

    let mut count = 0;

    'o: for (Reverse(key), val) in map.into_iter() {
        for _ in 0..val {
            if h <= key {
                count += 1;
                break 'o;
            } else {
                count += 1;
                h -= key;
            }
        }
    }

    println!("{}", count);
}


Measured memory_bytes: 5652
#define _USE_MATH_DEFINES // for C++  
#include "bits/stdc++.h"
#define NUM 1000000007
#define int long long

using namespace std;

signed main()
{
    ios::sync_with_stdio(false);

    int n;
    cin >> n;
    vector<int> v(n);
    vector<int> ans(n - 1);
    int sum = 0;
    for (size_t i = 0; i < n; i++)
    {
        int tmp;
        cin >> tmp;
        sum += tmp;
        v[i] = sum;
    }
    for (size_t i = 0; i < n - 1; i++)
    {
        ans[i] = abs(v[i] - (v.back() - v[i]));
    }
    cout << *min_element(ans.begin(), ans.end()) << endl;
}

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

int main()
{
  string s;
  int cnt = 0;
  cin >> s;

  if (s[0] != 'A')
  {
    cout << "WA" << endl;
    return 0;
  }

  for (int i = 1; i < s.length(); i++)
  {
    if (i > 1 && i < s.length() - 1)
    {
      if (s[i] == 'C')
      {
        if (cnt == 0)
        {
          cnt = 1;
          continue;
        }
        else
        {
          cout << "WA" << endl;
          return 0;
        }
      }
    }
    if (s[i] - '0' >= 17 && s[i] - '0' <= 42)
    {
      cout << "WA" << endl;
      return 0;
    }
  }
  if (cnt == 0)
  {
    cout << "WA" << endl;
    return 0;
  }

  cout << "AC" << endl;
}

Measured memory_bytes: 3616
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <cassert>
#include <functional>
#include <set>
#include <cmath>

using namespace std;
#define get(x) if (DEBUG) cout << #x << " : " << x << endl;
#define print(x) if (DEBUG) cout << x << endl;
#define int long long
#define double long double

void fast() {
    ios::sync_with_stdio(false);
    cin.tie(0);
}

const int MAX = (int)1e6;
const long long INF = 1e18;

signed main() {
    fast();
#ifdef DEBUG
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int n;
    cin >> n;
    int dp[n][3];
    for (int i = 0; i < n; ++i) {
        int a, b, c;
        cin >> a >> b >> c;
        if (!i) {
            dp[0][0] = a;
            dp[0][1] = b;
            dp[0][2] = c;
            continue;
        }
        dp[i][0] = max(dp[i - 1][1], dp[i - 1][2]) + a;
        dp[i][1] = max(dp[i - 1][0], dp[i - 1][2]) + b;
        dp[i][2] = max(dp[i - 1][0], dp[i - 1][1]) + c;
    }
    cout << max(dp[n - 1][0], max(dp[n - 1][1], dp[n - 1][2]));


    return 0;
}

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

using namespace std;

#define SZ(x) (int)(x.size())

using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;

template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  char c; cin >> c;
  c++;
  cout << c << endl;



}


Measured memory_bytes: 256
import copy
from collections import deque


def bfs(s, f):
    f[s[0]][s[1]] = 0
    moves = [[1, 0], [-1, 0], [0, 1], [0, -1]]

    q = deque([s])
    while q:
        c = q.popleft()
        for m in moves:
            my, mx = c[0] + m[0], c[1] + m[1]

            if f[my][mx] == ".":
                f[my][mx] = f[c[0]][c[1]] + 1
                q.append([my, mx])
            else:
                continue

    f = sum(f, [])
    return max([x for x in f if type(x) == int])


def main():
    H, W = map(int, input().split())
    field_s = []

    for h in range(H + 2):
        field_s.append(["#"] * (W + 2))
        if 1 <= h <= (H):
            field_s[h][1:-1] = list(map(str, input().rstrip()))

    ans = 0
    for y in range(1, H + 1):
        for x in range(1, W + 1):
            if field_s[y][x] == ".":
                field = copy.deepcopy(field_s)
                ans = max(ans, bfs([y, x], field))

    print(ans)


if __name__ == '__main__':
    main()

Measured memory_bytes: 3444
#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <utility>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cassert>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;

typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<pair<int,int>> vii;
#define sz(a) int((a).size())
#define all(c) (c).begin(), (c).end()

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

const int N = 1000000;
vi primes;

void sieve() {
	vector<bool> flag(N);
	for (int p = 2; p < N; p++) if (!flag[p]) {
		primes.push_back(p);
		for (int x = p + p; x < N; x += p) flag[x] = true;
	}
}

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

	sieve();
	ll a, b;
	scanf("%lld%lld", &a, &b);
	ll g = gcd(a, b);
	//printf("%lld\n", g);

	int ans = 1;
	for (int p : primes) {
		if (p > g) break;
		if (g % p == 0) {
			ans++;
			while (g%p == 0) g /= p;
		}
	}
	if (g > 1) ans++;
	printf("%d\n", ans);
}


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

using namespace std;

int main()
{
    long long n,hr,h,mr,m,s;
    cin>>n;
    hr=n%3600;
    h=n/3600;
    s=hr%60;
    m=hr/60;
    printf ("%lld:%lld:%lld\n",h,m,s);

    return 0;


}



Measured memory_bytes: 3216
N=gets.to_i
VS=gets.split.map(&:to_i)
CS=gets.split.map(&:to_i)

benefits = []

VS.zip(CS).each do |v, c|
  benefits.push(v-c)
end

ans = 0

benefits.each do |bene|
  ans+=bene if bene>=0
end

p ans


Measured memory_bytes: 1788
use proconio::{input, fastout};
use proconio::marker::{Chars};
use proconio::marker::Usize1;
use std::cmp::*;

macro_rules! debug {
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

#[fastout]
fn main() {
    input!{
        n: usize,
        a: usize,
        b: usize,
    }

    println!("{}", min(a*n,b));

}


Measured memory_bytes: 2144
#include<cstdio>
#include<algorithm>
#include<utility>
using namespace std;
typedef long long ll;

ll n,x,b[100000],l[100000],u[100000],ans=100000000000000000,sum=0,right,left,mid,a,q,r,left2,right2,mid2,sum2[100001];
int flag,in[100000];
pair<ll,ll> p[100000];
int main(){
    scanf("%lld %lld",&n,&x);
    for(int i=0;i<n;i++){
        scanf("%lld %lld %lld",&b[i],&l[i],&u[i]);
        p[i]=make_pair((x-b[i])*u[i]+l[i]*b[i],i);
        sum-=l[i]*b[i];
    }
    sort(p,p+n);
    sum2[0]=0;
    for(int i=0;i<n;i++){
        in[p[i].second]=i;
        sum2[i+1]=sum2[i]+p[n-1-i].first;
    }
    for(int i=0;i<n;i++){
        r=x;
        left=0;
        right=n;
        while(left<=right){
            a=sum+l[i]*b[i];
            mid=(left+right)/2;
            q=mid;
            a+=max((r-b[i])*l[i],(r-b[i])*u[i]);
            if(!q||in[i]<n-q){
                a+=sum2[q];
            }
            else{
                a+=sum2[q+1]-p[in[i]].first;
            }
            if(a>=0){
                right=mid-1;
            }
            else{
                left=mid+1;
            }
        }
        q=left;
        left=0;
        right=x;
        while(left<=right){
            a=sum+l[i]*b[i];
            mid=(left+right)/2;
            r=mid;
            a+=max((r-b[i])*l[i],(r-b[i])*u[i]);
            if(!q||in[i]<n-q){
                a+=sum2[q];
            }
            else{
                a+=sum2[q+1]-p[in[i]].first;
            }
            if(a>=0){
                right=mid-1;
            }
            else{
                left=mid+1;
            }
        }
        ans=min(ans,q*x+left);
    }
    printf("%lld\n",ans);
}

Measured memory_bytes: 5248
n = int(input())

for i in range(1, n + 1):
    if i % 3 == 0:
        print(" ", end="")
        print(i, end="")
    else:
        x = i
        while (x):
            if x % 10 == 3:
                print(" ", end="")
                print(i, end="")
                break
            x //= 10
print()



Measured memory_bytes: 6168
#include<iostream>
#include<iomanip>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;

typedef long long ll;

int main(){
  ll n,W;
  cin>>n>>W;
  vector<ll> wl = vector<ll>(n);
  vector<ll> vl = vector<ll>(n);

  for(int i=0;i<n;i++){
    ll w,v;
    cin>>w>>v;
    wl[i] = w;
    vl[i] = v;
  }

  vector<vector<ll>> dp = vector<vector<ll>>(n+1, vector<ll>(W+1, 0));
  for(int wi=1;wi<W+1;wi++){
    for(int i=0;i<n;i++){
      if(wl[i]>wi){
        dp[i+1][wi] = dp[i][wi];
      }else{
        dp[i+1][wi] = max(dp[i][wi], dp[i][wi-wl[i]]+vl[i]);
      }
    }
  }


  cout<<dp[n][W]<<endl;
  return 0;
}


Measured memory_bytes: 80256
#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
//char s1[1005];
//char s2[1005];
int d[1005][1005];
 
int main(){
    string s1,s2;
    cin>>s1>>s2;
    //int l1=strlen(s1);
    //int l2=strlen(s2);
    s1=' '+s1;
    s2=' '+s2;
    int l1=s1.size();
    int l2=s2.size();
    int i,j;
    for( i=1;i<l1;i++)d[i][0]=i;
    for( j=1;j<l2;j++)d[0][j]=j;
    for( i=1;i<l1;i++){
        for( j=1;j<l2;j++){
            if(s1[i]==s2[j]){
                d[i][j]=d[i-1][j-1];
            }else{
                d[i][j]=min(d[i][j-1],min(d[i-1][j],d[i-1][j-1]))+1;
            }
        }
    }cout<<d[l1-1][l2-1]<<endl;
return 0;
}



Measured memory_bytes: 7120
#include<iostream>
#include<cassert>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<math.h>
#include<queue>
#include<deque>
#include<stack>
#include<cstdio>
#include<utility>
#include<set>
#include<list>
#include<cmath>
#include<stdio.h>
#include<string.h>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<bitset>
#include<functional>
#include<iterator>
#include<complex>
#include<fstream>
#include<random>
#include<ctype.h>
#include<stdio.h>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define REP(i, n) FOR(i, 0, n - 1)
#define NREP(i, n) FOR(i, 1, n)
using ll = long long;
using pii = pair<int, int>;
using PII = pair<ll, ll>;
using piii = pair<pii, pii>;
using Pi = pair<int, pii>;
using Graph = vector<vector<int>>;
const int dx[4] = { 0, -1, 1, 0 };
const int dy[4] = { -1, 0, 0, 1 };
bool check(int x, int y) {
	if (0 <= x && x<55 && 0 <= y && y<55)return true;
	else return false;
}
const ll INF = 1e9 + 7;
int gcd(int x, int y) {
	if (x < y)swap(x, y);
	if (y == 0)return x;
	return gcd(y, x%y);
}
void mul(ll a, ll b) {
	a = a * b % INF;
}
using Graph = vector<vector<int>>;

//iの逆元mod inf
long long modinv(long long a, long long m) {
	long long b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
const double PI = 3.14159265358979323846;
const int MAX = 510000;
ll fac[MAX], finv[MAX], inv[MAX];
//テーブルをつくる前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;//mod pにおける1,2,,,nの逆元
	for (int i = 2; i < MAX; ++i) {
		fac[i] = fac[i - 1] * i%INF;
		inv[i] = INF - inv[INF%i] * (INF / i) % INF;
		finv[i] = finv[i - 1] * inv[i] % INF;
	}
}

ll COM(int n, int k) {
	if (n < k)return 0;
	if (n < 0 || k < 0)return 0;
	return fac[n] * (finv[k] * finv[n - k] % INF) % INF;
}
double Euclidean_distance(double x1, double y1, double x2, double y2) {
	return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}

int prime[1001000];//i番目の素数
bool is_prime[1001010];//is_prime[i]がtrueならiは素数
					   //n以下の素数の数を返す
int sieve(int n) {
	int p = 0;
	for (int i = 0; i <= n; ++i) {
		is_prime[i] = true;
	}
	is_prime[0] = false;
	is_prime[1] = false;
	for (int i = 2; i <= n; ++i) {
		if (is_prime[i]) {
			prime[p] = i;
			p++;
			for (int j = 2 * i; j <= n; j += i) {
				is_prime[j] = false;
			}
		}
	}
	return p;
}

//素因数分解
map<int, int>prime_factor(int n) {
	map<int, int>res;
	for (int i = 2; i*i <= n; ++i) {
		while (n%i == 0) {
			++res[i];
			n /= i;
		}
	}
	if (n != 1)res[n] = 1;
	return res;
}


ll powmod(ll a, ll k, ll mod) {
	ll ap = a, ans = 1;
	while (k) {
		if (k & 1) {
			ans *= ap;
			ans %= mod;
		}
		ap = ap * ap;
		ap %= mod;
		k >>= 1;
	}
	return ans;
}
ll invi(ll a, ll mod) {
	return powmod(a, mod - 2, mod);
}
#define PI 3.14159265358979323846  // 円周率
//逆元Aを足したときのmodで割った余りは
//+=invi(A)
//Yで割ることはY^(10^9+7)-2を掛けることは同値
///////////////////////////////////////


int main() {
	int a, b; cin >> a >> b;
	cout << a * b << endl;
	return 0;
}


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

int main()
{
    int N,K;
    while(cin >> N >> K)
    {
        if(N % K == 0)
        {
            cout << "0" << endl;
        }
        else
        {
            cout << "1" << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main (void){
int n;
int i;
int a[10000];
int max;
int min;
long int totall=0;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
max=min=a[0];
for(i=0;i<n;i++){
if(max<a[i]){
max=a[i];
}
if(min>a[i]){
min=a[i];
}
totall=totall+a[i];
}
printf("%d %d %ld\n",min,max,totall);
return 0;
}

Measured memory_bytes: 640
#include <stdio.h>
int main(void){
    double n;
    while(scanf("%lf\n",&n)!=EOF){
        if(n<=48.00){
            printf("light fly\n");
        }
        if(48.00<n&&n<=51.00){
            printf("fly\n");
        }
        if(51.00<n&&n<=54.00){
            printf("bantam\n");
        }
        if(54.00<n&&n<=57.00){
            printf("feather\n");
        }
        if(57.00<n&&n<=60.00){
            printf("light\n");
        }
        if(60.00<n&&n<=64.00){
            printf("light welter\n");
        }
        if(64.00<n&&n<=69.00){
            printf("welter\n");
        }
        if(69.00<n&&n<=75.00){
            printf("light middle\n");
        }
        if(75.00<n&&n<=81.00){
            printf("middle\n");
        }
        if(81.00<n&&n<=91.00){
            printf("light heavy\n");
        }
        if(n>91.00){
            printf("heavy\n");
        }
    }
    
}



Measured memory_bytes: 2040
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <cfloat>

using std::cerr;
using std::cin;
using std::cout;
using std::endl;

using namespace std;
typedef long long int64;

int main(){
  cout << std::fixed << std::setprecision(16);
  cin.tie(nullptr);
  std::ios::sync_with_stdio(false);

  int x;
  cin>>x;
  bool can_buy[100110]={};
  can_buy[0]=true;
  vector<int> price{100,101,102,103,104,105};
  for(int i=0;i<=x;i++){
    if(!can_buy[i]) continue;
    for(auto p:price){
      can_buy[p+i]=true;
    }
  }

  if(can_buy[x]){
    cout<<1<<endl;
  }else{
    cout<<0<<endl;
  }



  return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
 
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
 
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> P;
typedef long long ll;
 
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())
 
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
 
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int INT_INF = 2147483647;
const long long LL_INF = 1LL<<60;
const long long MOD = 1000000007;
 
#define CLR(a) memset((a), 0 ,sizeof(a))
 
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
 
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; }
 
int main(void){
    ll N,K; cin >> N >> K;
    vector<ll> A(N), B(N);
    REP(i,N){
        cin >> A[i];
        B[i] = A[i];
    }
 
    SORT(A);
    SORT(B); REVERSE(B);
 
    ll xl=-1000000000000000000,xr=-xl,X=(xl+xr)/2;
    while(xr-xl>1){
        ll tmp = 0;
        REP(i,N-1){
            if(A[i] < 0){
                ll l=-1, r=N-i-1, n=(l+r)/2;
                while(r-l>1){
                    if(A[i]*B[n] <= X) l = n;
                    else r = n;
                    n = (l+r)/2;
                }
                tmp += r;
            }
            else{
                ll l=i, r=N, n=(l+r)/2;
                while(r-l>1){
                    if(A[i]*A[n] <= X) l = n;
                    else r = n;
                    n = (l+r)/2;
                }
                tmp += max((ll)0,r-i-1);
            }
        }
        if(tmp < K) xl = X;
        else xr = X;
        X = (xl+xr)/2;
    }
    cout << xr << endl;
    return 0;
}

Measured memory_bytes: 3328
import java.util.*;
import java.io.*;
 
public class Main{
  	public static void main(String[] args)throws IOException{
      BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
      int n=Integer.parseInt(br.readLine());
      if(n==7 || n==5 || n==3)
        System.out.println("YES");
      else
        System.out.println("NO");
    }
}

Measured memory_bytes: 21076
#include <bits/stdc++.h>
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,n) FOR(i,0,n)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
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; }
const ll INF = 1e10;
typedef pair<ll,ll> P;

int main() {
    int k,x;
    cin >> k >> x;
    if (500*k >= x) PRINT("Yes");
    else PRINT("No");
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define repr(i,from,to) for(int (i)=(from);(i)<(to);(i)++)
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
// const bool debug=true;
const bool debug=false;
#define DEBUG if(debug==true)
#define vprint(x) for(auto a:(x)) cout << x << endl;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll MOD = 1000000007;

int main(void) {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int m,d;cin>>m>>d;
    int res=0;
    repr(i,1,d+1){
        int d1 = i%10;
        int d10 = i/10;
        if(d1>=2&&d10>=2&&d1*d10<=m){
            res++;
        }
    }
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 256
from operator import mul
from functools import reduce

def cmb(n,r):
  r = min(n-r,r)
  if r == 0: return 1
  over = reduce(mul, range(n, n - r, -1))
  under = reduce(mul, range(1,r + 1))
  return over // under
ans = 0
n,m=map(int,input().split())
if n>1:
  ans += cmb(n,2)
if m>1:
  ans += cmb(m,2)
print(ans)

Measured memory_bytes: 3572
#include "bits/stdc++.h"
// Custom Header {{{
#define ALL(x) x.begin(), x.end()
#define rep(i, s, n)      for(int i(s); i < int(n); ++i)
#define endl '\n'
#ifndef YDK
#define eprintf(...)
#endif
using namespace std;
using i64 = long long;
using pii = pair<i64, i64>;
template<class A, class B>inline bool chmax(A &a, const B &b){return b>a ? a=b,1 : 0;}
template<class A, class B>inline bool chmin(A &a, const B &b){return b<a ? a=b,1 : 0;}
constexpr const int INF  = 0x3f3f3f3f;
constexpr const i64 LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr const int MOD  = int(1e9) + 7;
// }}}

// Library {{{

// }}}

struct FastIO {
    FastIO() { cin.tie(nullptr); ios::sync_with_stdio(false); }
} fastIO_ydk ;

void slv()
{
    static int dp[1005][1005];

    string a, b;
    cin >> a >> b;

    dp[0][0] = 0;
    for (int i = 0; i < a.length(); ++i) {
        for (int j = 0; j < b.length(); ++j) {
            if (a[i] == b[j]) {
                dp[i+1][j+1] = dp[i][j] + 1;
            } else {
                dp[i+1][j+1] = max(dp[i+1][j], dp[i][j+1]);
            }
        }
    }

    cout << dp[a.length()][b.length()] << endl;

    return;
}

signed main()
{
    int n;
    cin >> n;

    for (int i = 0; i < n; ++i) slv();
    return 0;
}



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

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  vector<int> B(N);
  for(int i = 0; i < N; i++) {
    cin >> A.at(i) >> B.at(i);
  }
  bool b = false;
  long long cnt = 0;
  for(int i = 0; i < N;i++) {
    if(A.at(i) == B.at(i)) {
      cnt++;
    }
    else {
      cnt = 0;
    }
    if(cnt >= 3) {
      b = true;
      break;
    }
  }
  if(b) {
    cout << "Yes" << endl; 
  }
  else {
    cout << "No" << endl; 
  }
}


Measured memory_bytes: 3644
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
use std::io::{Write, BufWriter};
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, [ $t:tt ]) => {{
        let len = read_value!($next, usize);
        (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    }};

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused)]
macro_rules! debug {
    ($($format:tt)*) => (write!(std::io::stderr(), $($format)*).unwrap());
}
#[allow(unused)]
macro_rules! debugln {
    ($($format:tt)*) => (writeln!(std::io::stderr(), $($format)*).unwrap());
}

fn solve() {
    let out = std::io::stdout();
    let mut out = BufWriter::new(out.lock());
    macro_rules! puts {
        ($($format:tt)*) => (write!(out,$($format)*).unwrap());
    }
    input! {
        n: i64, k: i64,
        s: chars,
    }
    let mut a = 0;
    let mut cur = '+';
    for c in s {
        if cur != c {
            a += 1;
        }
        cur = c;
    }
    puts!("{}\n", n - max(1, a - 2 * k));
}

fn main() {
    // In order to avoid potential stack overflow, spawn a new thread.
    let stack_size = 104_857_600; // 100 MB
    let thd = std::thread::Builder::new().stack_size(stack_size);
    thd.spawn(|| solve()).unwrap().join().unwrap();
}


Measured memory_bytes: 8572
n=int(input())
lis=list(map(int,input().split(' ')))
node=[0,abs(lis[1]-lis[0])]+[0]*(n-2)
for i in range(2,n):
    x=abs(lis[i]-lis[i-1])+node[i-1]
    y=abs(lis[i]-lis[i-2])+node[i-2]
    node[i]=min(x,y)
print(node[-1])

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

using namespace std;
#define ll long long int

int main()
{
   ll t;
   t = 1;	
  // cin t;
   while(t--){
         ll n;
         cin >> n;
         ll a[n];
         map < int , int > count;
         for(int i =0 ; i < n ; i++)
         {
             cin >> a[i];
             count[ i + 1 - a[i]]++;
         }    
         ll ans = 0;
         for(int i = 0; i < n;i ++)
         {
             count[ i + 1 - a[i]]--;
             ans += count[i + 1 + a[i]];
         }
         cout << ans << endl;
   }
}


Measured memory_bytes: 22044
def gcd(a,b):
    while(b):
        a, b = b, a%b
    return a

n, x = (int(i) for i in input().split(" "))
xn = (int(i) for i in input().split(" "))

nums = [abs(xi-x) for xi in xn]

b = nums[0]
for v in nums[1:]:
    b = gcd(b,v)

print(b)


Measured memory_bytes: 14252
n,m = map(int,raw_input().split())
a = map(int,raw_input().split())
a = sorted(a, reverse=True)
votes = sum(a)
yes = True
for i in xrange(m):
  if a[i]*4*m < votes:
    yes = False
if yes:
  print "Yes"
else:
  print "No"

Measured memory_bytes: 2568
a,b,c,d = map(int, input().split())
array = []
array.append(a*c)
array.append(b*d)
array.append(a*d)
array.append(b*c)
if (a <= 0 and b >= 0) or (c <= 0 and d >= 0):
    array.append(0)
print(max(array))

Measured memory_bytes: 9180
/* author   : mpily :-()
title : Competing.cpp
time :Sat May 30 13:38:34 2020

*/
#include<bits/stdc++.h>
using namespace std;
void solve(){
	int n;
  	cin >> n;
	vector<int64_t>temp(n);
	for(int i = 0; i < n; ++i){
		cin >> temp[i];
		if(temp[i] == 0){
			cout << 0;
			return;
		}
	}
	
  	int64_t ans  = 1;
	double tans = 1.0;
  	int64_t mx = 1e18;
  	for(int i = 0; i < n; ++i){
	      	tans*=(long double)temp[i];
		if(tans > mx){
			cout << -1;
			return;
		}
		else ans*=temp[i];
		if(ans > mx){
			cout << -1;
			return;
		}
        }
	cout << ans;
	
}
int main(){
	int t;
	t = 1;
	while(t--){
		solve();
		cout << "\n";
	}
	return 0;
}

Measured memory_bytes: 4052
def abs(n)
    return (n > 0) ? n : -n
end

def sgn(n)
    return (n >= 0) ? "" : "-"
end

while line = gets
  a, b, c, d, e, f = line.split.map(&:to_f)
  x = ((c*e - b*f) / (a*e - b*d) * 1000).round(0)
  y = ((-c*d + a*f) / (a*e - b*d) * 1000).round(0)
  xs = sgn(x)
  ys = sgn(y)
  xa = abs(x)
  ya = abs(y)
  printf "%s%d.%03d %s%d.%03d\n", xs, xa / 1000, xa % 1000, ys, ya / 1000, ya % 1000
end

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

using namespace std;

int main() {
  int n;
  cin >> n;
  int a, a_min, a_max;
  cin >> a;
  a_max = a;
  a_min = a;

  for ( int i = 0; i < n - 1; i++ ) {
    int b;
    cin >> b;
    a_max = max(a_max, b);
    a_min = min(a_min, b);
  }
  cout << a_max - a_min << endl;
  return 0;
}

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

int main(){
  int a[4];
  int b[4];

  int h=0, bl=0;

  while( cin>>a[0] ){
    for( int i=1;i<4;i++ )
      cin >> a[i];
    for( int j=0;j<4;j++ )
      cin >> b[j];
    
    h=0; bl=0;
    for( int i=0;i<4;i++ )
      if( a[i]==b[i] )
	h++;
    for( int i=0;i<4;i++ )
      for( int j=0;j<4;j++ )
	if( a[i]==b[j] && i!=j )
	  bl++;
    cout << h << " " << bl << endl;
  }

  return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
#define int long long
inline void read(int &x)
{
	char c=getchar();
	x=0;
	while (c>'9'||c<'0')
		c=getchar();
	while (c>='0'&&c<='9')
	{
		x=x*10+c-'0';
		c=getchar();
	}
}
const int N=100005;
int n,m,a[N],p[N],d[N],ans,x,y;
signed main()
{
	read(n);
	read(m);
	for (int i=1;i<=n;++i)
		read(a[i]);
	for (int i=1;i<n;++i)
	{
		x=a[i];
		y=a[i+1];
		if (x<y)
		{
			p[1]+=(y-x);
			p[x+1]+=x+1;
			p[y+1]-=x+1;
			d[x+1]--;
			d[y+1]++;
		}
		else
		{
			p[1]+=y+1;
			p[y+1]+=m-x-1;
			p[x+1]+=1+x;
			--d[x+1];
			++d[y+1];
			--d[1];
		}
	}
	for (int i=1;i<=m;++i)
	{
		p[i]+=p[i-1];
		d[i]+=d[i-1];
	}
	ans=p[1]+d[1];
	for (int i=2;i<=m;++i)
		ans=min(ans,p[i]+d[i]*i);
	cout<<ans;
	return 0;
}

Measured memory_bytes: 2560
//自称高知能系Vtuberの高井茅乃です。
//Twitter: https://twitter.com/takaichino
//YouTube: https://www.youtube.com/channel/UCTOxnI3eOI_o1HRgzq-LEZw

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

#define INF 1999999999
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define MODA 1000000007 

int main() {
    int ans = 0;
	ll a,b,c,d;
	cin >> a >> b >> c >> d;
	ll e= max(c,d) , f = min(c,d);
	while(f > 0){
		ll temp = e % f;
		e = f;
		f = temp;
	}
	ll gcd = e;
	ll lcm = c / gcd * d;
	ll alc, ald, alcd, bc, bd, bcd;
	alc = (a-1) / c;
	ald = (a-1) / d;
	alcd = (a-1) / lcm;
	bc = b / c;
	bd = b / d;
	bcd = b / lcm;
	
    cout << (b - (bc + bd - bcd))
	 - (a-1 - (alc + ald - alcd)) << endl;
}

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

#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)
#define TO_STRING(VariableName) # VariableName
#define LOG(x) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<endl;
#define LOG2(x,y) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<endl;
#define LOG3(x,y,z) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;
#define LOG4(w,x,y,z) if(DEBUG)cout<<TO_STRING(w)<<"="<<w<<" "<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;

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



void func(long long L, long long R, long long d){

    lli ans = 0;
    REP(i,L,R+1){
        if(i%d==0)ans++;
    }

    cout<<ans<<endl;

}

int main(){
    // cout << fixed << setprecision(5);

    long long L;
    scanf("%lld",&L);
    long long R;
    scanf("%lld",&R);
    long long d;
    scanf("%lld",&d);
    func(L, R, d);
    return 0;
}


Measured memory_bytes: 3756
#include <cstdio>
#include <iostream>
#include <cstring>
#include <ctime>
#define rus register unsigned short
#define rs register short
using namespace std;

const int N = 15;

int G[N][N], dp[N][1 << N], cost[N][1 << N], ss1[1 << N][1 << 5], ss2[1 << N][1 << 5], ss3[1 << N][1 << 5];
int n, m, base1 = (1 << 5) - 1, Base1 = 1 << 5, base2 = (1 << 10) - 1, Base2 = 1 << 10;

inline void upd(int &x, int y) {
  if (x == -1) x = y;
  else x = min(x, y);
}

inline int set_set(int x, int y) {
  return ss1[x][y & base1] + ss2[x][(y >> 5) & base1] + ss3[x][y >> 10];
}

inline int calc(int x, int y) {
  if (x & y) return 0;
  int ret = 0;
  for (rs i = 0; i < n; i ++)
    if (x & (1 << i)) ret += cost[i][y];
  return ret;
}

int main() {
  memset(dp, -1, sizeof dp);
  scanf("%d%d", &n, &m);
  for (int i = 1, x, y, z; i <= m; i ++) {
    scanf("%d%d%d", &x, &y, &z);
    x --; y --;
    G[x][y] = G[y][x] = z;
  }
  int t = 1 << n;
  int st = clock();
  for (rus s = 1; s < t; s ++) {
    for (rs i = 0; i < n; i ++) cost[i][s] = cost[i][s - (s & (- s))];
    for (rs i = 0; i < n; i ++)
      if (s & (1 << i)) {
	for (rs j = 0; j < n; j ++) cost[j][s] += G[i][j];
	break;
      }
  }
  for (rus s = 1; s < t; s ++) {
    for (rus i = 1; i < Base1 && i < t; i ++) ss1[s][i] = calc(s, i);
    for (rus i = Base1, j = 1; i < t && i < Base2; i += Base1, j ++) ss2[s][j] = calc(s, i);
    for (rus i = Base2, j = 1; i < t; i += Base2, j ++) ss3[s][j] = calc(s, i);
  }
  dp[0][1] = 0;
  int in[N], out[N], cntin, cntout;
  for (rus s = 1; s < t; s += 2) {
    rus u = s ^ (t - 1);
    cntin = cntout = 0;
    for (rs i = 0; i < n; i ++) {
      if (s & (1 << i)) in[cntin ++] = i;
      else out[cntout ++] = i;
    }
    for (rs a = 0, i = in[a]; a < cntin; a ++, i = in[a]) {
      if (dp[i][s] == -1) continue;
      for (rs b = 0, j = out[b]; b < cntout; b ++, j = out[b])
	if (!(s & (1 << j)) && G[i][j]) upd(dp[j][s | (1 << j)], dp[i][s] + cost[j][s ^ (1 << i)]);
      for (rus v = u; v; v = (v - 1) & u)
	upd(dp[i][v | s], dp[i][s] + set_set(v, s ^ (1 << i)));
    }
  }
  printf("%d\n", dp[n - 1][t - 1]);
  return 0;
}


Measured memory_bytes: 16384
#include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<cstdio>
#include<unordered_map>
using namespace std;
//---------------------------------------------------
//ライブラリゾーン！！！！
//#define int long long
#define str string
#define rep(i,j) for(int i=0;i<(int)(j);i++)
typedef long long ll;
typedef long double ld;
const long long linf = 4523372036854775807;
const int iinf = 1500000000;
const ll Mod = 1000000007;
const ll gosenchou = 5000000000000000;
short gh[2][4] = { { 0,0,-1,1 },{ -1,1,0,0 } };
struct P {
	ll pos, cost;
};
bool operator<(P a, P b) { return a.cost < b.cost; }
bool operator>(P a, P b) { return a.cost > b.cost; }
struct B {//隣接リスト表現
	ll to, cost;
};
struct E {//辺の情報を入れる変数
	int from, to, cost;
};
bool operator<(E a, E b) {
	return a.cost < b.cost;
}
struct H {
	int x, y;
};
bool operator<(H a, H b) {
	if (a.x != b.x) return a.x < b.x;
	return a.y < b.y;
}
bool operator>(H a, H b) {
	if (a.x != b.x) return a.x > b.x;
	return a.y > b.y;
}
bool operator==(H a, H b) {
	return a.x == b.x&&a.y == b.y;
}
bool operator!=(H a, H b) {
	return a.x != b.x || a.y != b.y;
}
ll gcm(ll i, ll j) {//最大公約数
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcm(j%i, i);
}
ld rad(H a, H b) {
	return sqrt(pow(a.x - b.x, 2.0) + pow(a.y - b.y, 2.0));
}//rad＝座標上の2点間の距離
int ari(int a, int b, int c) {
	return (a + b)*c / 2;
}//等差数列の和
bool suf(ld a, ld b, ld c, ld d) {
	if (b <= c || d <= a) return 0;
	return 1;
}//[a,b),[c,d)
int fact(int i) {
	ll sum = 1;
	for (int j = 2; j <= i; j++)
		sum = (sum* j) % Mod;
	return sum;
}//階乗(正）
 //---------------------------------------------------
 //+++++++++++++++++++++++++++++++++++++++++++++++++++
signed main() {
	int n, sum = 0;
	cin >> n;
	string s = to_string(n);
	for (int i = 0; i < s.size(); i++)
		sum += (int)s[i] - '0';
	cout << (n%sum == 0 ? "Yes\n" : "No\n");
	getchar(); getchar();
}

Measured memory_bytes: 256
/*
	Auther:_Destiny
	time:2020.5.10
*/
#include <bits/stdc++.h>
#define ll long long
#define N 100010
#define M 20

using namespace std;
char s1[M], s2[M];

int main() {
	cin >> s1 >> s2;
	int len = strlen(s1);
	for (int i = 0; i < len; i++)
		if (s1[i] != s2[i]) {
			puts("No");
			return 0;
		}
	puts("Yes");
}

Measured memory_bytes: 3636
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Map;
import java.util.Scanner;
import java.util.HashMap;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        B solver = new B();
        solver.solve(1, in, out);
        out.close();
    }

    static class B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int n = Integer.parseInt(in.next());
            Map<String, Integer> cards = new HashMap<>();
            for (int i = 0; i < n; i++) {
                String tmp = in.next();
                if (cards.containsKey(tmp)) {
                    cards.put(tmp, cards.get(tmp) + 1);
                } else {
                    cards.put(tmp, 1);
                }
            }
            int m = Integer.parseInt(in.next());
            for (int i = 0; i < m; i++) {
                String tmp = in.next();
                if (cards.containsKey(tmp)) {
                    cards.put(tmp, cards.get(tmp) - 1);
                } else {
                    cards.put(tmp, 1);
                }
            }
            int ans = 0;
            for (String key : cards.keySet()) {
                ans = Math.max(ans, cards.get(key));
            }

            // 出力
            out.println(ans);

        }

    }
}



Measured memory_bytes: 21332
#pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
#if __cplusplus >= 201103L
#include <chrono>
using namespace std::chrono;
#endif
using namespace std;
#define ll long long
#define ull unsigned long long
#define pii pair<int, int>
#define pb push_back
#define fi first
#define se second
#ifdef LOCAL
#define prln(x) (cout << #x << ' ' << x << endl)
#define pr(x) (cout << #x << ' ' << x << ' ' )
#define prv(x) (cout << x << ' ')
#else
#define prln(x) 
#define pr(x)
#define prv(x)
#endif
#define clr(x) memset((x), 0, sizeof((x)))
#define clr1(x) memset((x), -1, sizeof((x)))
#define endl "\n"
#define pi acos(-1)
#define rep(i, st, ed) for (int i = (st); i <= (ed); ++i)
#define rep0(i, st, ed) for (int i = (st); i < (ed); ++i)
#define per0(i, st, ed) for (int i = (st); i > ed; --i)
#define per(i, st, ed) for (int i = (st); i >= ed; --i)
#define chmin(a, b) (a = a > b ? b : a)
#define chmax(a, b) (a = a < b ? b : a)
template<class T> void _sf(T &x) {cin >> x;}
void _sf(int &x) {scanf("%d", &x);}
void _sf(ll &x) {scanf("%lld", &x);}
void _sf(double &x) {scanf("%lf", &x);}
void _sf(char &x) {scanf(" %c", &x);}
void _sf(char *x) {scanf("%s", x);}
void sf() {}
template <class T, class...U> void sf(T & head, U&... tail) { _sf(head); sf(tail...);}
template <class T> void out(const T &val) { cout << val << endl; }
const int mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;

int read() {
    int x = 0, f = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9') {
        if (ch == '-') f = -1;
        ch = getchar();
    }
    while (ch >= '0' && ch <= '9') {
        x = x * 10 + ch - '0';
        ch = getchar();
    }
    return x * f;
}


int main(){
    #ifdef LOCAL
        freopen("in.txt", "r", stdin);
        freopen("out.txt", "w", stdout);
        #if __cplusplus >= 201103L
        auto start = steady_clock::now();
        #endif
    #endif
    int a = read(), b = read(), c = read();
    if (a + b + c >= 22) puts("bust");
    else puts("win");
    #ifdef LOCAL
        #if __cplusplus >= 201103L
        auto end = steady_clock::now();
        duration<double> time_span = duration_cast<duration<double>>(end - start);;
        printf("Total time: %.6fs\n", time_span.count());
        #endif
    #endif
    return 0;
}

Measured memory_bytes: 256