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


using namespace std;


using ll = long long;


int main() {
    ll N, X, Y;
    cin >> N >> X >> Y;

    vector<ll> cnt(N, 0);
    for (ll i = 1; i < N; i++) {
        for (ll j = i + 1; j <= N; j++) {
            ll len;
            if (i <= X && Y <= j) {
                len = j - i - (Y - X - 1);
            } else if (i <= X && j < Y) {
                ll sc = X - i + 1 + (Y - j);
                len = min(sc, j - i);
            } else if (X < i && Y <= j) {
                ll sc = i - X + 1 + (j - Y);
                len = min(sc, j - i);
            } else if (X < i && j < Y) { 
                ll sc = i - X + 1 + (Y - j);
                len = min(sc, j - i);
            }else {
                len = j - i;
            }
            cnt[len]++;
        }
    }

    for (ll i = 1; i < N; i++) {
        cout << cnt[i] << endl;
    }
}


Measured memory_bytes: 3652
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define dump(x) cout << x << endl
typedef int64_t Int;

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

const double pi = M_PI;
const Int MOD = 1000000007;

bool is_inte(double x) {
    return floor(x) == x;
}

int main() {
    int k, n;
    cin >> n >> k;
    double p[n];
    for (int i = 0; i < n; i++) {
        cin >> p[i];
    }

    double tem = 0, ans = 0;
    for (int i = 0; i < k; i++) {
        tem += p[i];
        ans = tem;
    }
    for (int i = 1; i + k - 1 < n; i++) {
        tem = tem - p[i - 1] + p[i + k - 1];
        ans = max(ans, tem);
    }

    ans = (ans + k) / 2.0;

    cout << fixed << setprecision(10) << ans << endl;

    return 0;
}

Measured memory_bytes: 1792
n, m = map(int, input().split())
l = []
c = 0
for _ in range(n):
    l += [list(map(int, input().split()))]
for i, j in sorted(l, key=lambda x: x[0]):
    if j >= m:
        c += m*i
        print(c)
        exit()
    m -= j
    c += i*j

Measured memory_bytes: 29792
N = int(input())

M = 10**9

x,y = map(int, input().split())
r = (x,y)
l = (x,y)
u = (x,y)
d = (x,y)

for i in range(N-1):
    x,y = map(int, input().split())
    if abs(x-0)+abs(y-0)<abs(l[0]-0)+abs(l[1]-0):
        l = (x,y)
    if abs(x-M)+abs(y-0)<abs(r[0]-M)+abs(r[1]-0):
        r = (x,y)
    if abs(x-0)+abs(y-M)<abs(u[0]-0)+abs(u[1]-M):
        u = (x,y)
    if abs(x-M)+abs(y-M)<abs(d[0]-M)+abs(d[1]-M):
        d = (x,y)

print(max(
    abs(l[0]-r[0])+abs(l[1]-r[1]),
    abs(l[0]-u[0])+abs(l[1]-u[1]),
    abs(l[0]-d[0])+abs(l[1]-d[1]),
    abs(r[0]-u[0])+abs(r[1]-u[1]),
    abs(r[0]-d[0])+abs(r[1]-d[1]),
    abs(u[0]-d[0])+abs(u[1]-d[1]),
))


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

int main()
{
    size_t N, Q;
    cin >> N >> Q;
    atcoder::fenwick_tree<long long> ft(N + 1);

    long long a;
    for (size_t i = 1; i <= N; i++)
    {
        cin >> a;
        ft.add(i, a);
    }

    for (size_t i = 0; i < Q; i++)
    {
        int t;
        cin >> t;
        if (t == 0)
        {
            int p;
            long long x;
            cin >> p >> x;
            p++;
            ft.add(p, x);
        }
        else
        {
            int l, r;
            cin >> l >> r;
            l++;
            r++;
            cout << ft.sum(l, r) << endl;
        }
    }
}


Measured memory_bytes: 8216
#pragma region header
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cctype>
#include <assert.h>
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <math.h>
#include <cstring>
#include <array>
// ===============================================================
//using系
#pragma region header
using namespace std;
using lint = long long;
using ld = long double;
using ulint = unsigned long long;
const int dx[] = { 1,0,-1,0 };
const int dy[] = { 0,1,0,-1 };
constexpr lint mod = 1000000007;
constexpr long double pi = 3.141592653589793238462643383279;
#pragma endregion
// ========================================================================
//define
#define INF (lint)10000000000000000;
#define mod (int)1000000007
#pragma region header
template <class T, class U>
inline bool chmin(T& lhs, const U& rhs) {
	if (lhs > rhs) {
		lhs = rhs;
		return 1;
	}
	return 0;
}
template <class T, class U>
inline bool chmax(T& lhs, const U& rhs) {
	if (lhs < rhs) {
		lhs = rhs;
		return 1;
	}
	return 0;
}
#pragma endregion
#pragma endregion



int main(void) {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int n; cin >> n;
	lint cnt = 0;
	for (int i = 1; i < n; i++) {
		int s = n;
		s -= i;
		lint ans = 0;
		for (int j = 1; j * j <= s; j++) {
			if (s % j == 0) {
				ans++;
				if (j * j != s) ans += 1;
			}
		}
		cnt += ans;
	}
	cout << cnt << endl;

	return 0;
}

Measured memory_bytes: 3644
#include <iostream>
#include <vector>
#include <climits>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <bitset>
#include <utility>
#include <numeric>
#include <queue>
#include <stack>

using ll = long long;
using namespace std;

constexpr int MOD = 1e9 + 7;
constexpr ll MOD_LL = ll(1e9) + 7;

int main(void) {
	int n, m, X, Y;
	cin >> n >> m >> X >> Y;
	
	vector<int> x(n), y(m);
	for(int i = 0; i < n; ++i) {
		cin >> x[i];
	}
	
	for(int i = 0; i < m; ++i) {
		cin >> y[i];
	}
	
	int maxX = *max_element(x.begin(), x.end());
	int minY = *min_element(y.begin(), y.end());
	bool yes = false;
	
	if( maxX < minY ) {
		for(int i = maxX + 1; i <= minY; ++i) {
			if( i > X && i <= Y ) {
				yes = true;
				break;
			}
		}
	}
	
	if( yes ) cout << "No War" << endl;
	else cout << "War" << endl;
	
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define ll long long
#define dd double
#define pb push_back
#define ff first
#define ss second
#define Mp make_pair
const ll Mod=1000000007;
const ll INF=999999999999999999;
const ll NN=(ll)(1e6+5);
ll min(ll x,ll y){if(x<y) return x;return y;}
ll max(ll x,ll y){if(x>y) return x;return y;}
ll power(ll x,unsigned ll y) 
{ 
    if (y==0) 
        return 1; 
    else if (y%2==0) 
        return power(x,y/2)*power(x,y/2); 
    else
        return x*power(x,y/2)*power(x,y/2); 
}
ll hcf(ll a,ll b) 
{ 
    if(b==0) 
        return a; 
    return hcf(b,a%b);  
}
ll n;
vector <ll> v;
// map <pair<ll,pair<ll,ll>>,ll> dp;
// ll func(ll ind,ll money,ll stock)
// {
//     if(ind==n-1)
//      return money+stock*v[ind];
//     if(dp[{ind,{money,stock}}])
//      return dp[{ind,{money,stock}}];
//     return dp[{ind,{money,stock}}]=max(func(ind+1,money-((money/v[ind])*v[ind]),stock+(money/v[ind])),func(ind+1,(money+stock*v[ind]),0)); 
// }
int main()
{
   fio;
   /*#ifndef ONLINE_JUDGE 
    	freopen("input.txt", "r", stdin); 
    	freopen("output.txt", "w", stdout); 
    	freopen("error.txt", "w", stderr); 
   #endif*/
   ll TT=1;
   //cin>>TT;
   while(TT--)
   {
       cin>>n;
       v.resize(n);
       ll stock=0,money=1000,last=n,i;
       for(auto &u:v)
        cin>>u;
       //ll ans=func(0,1000,0);
       for(i=0;i<n-1;i++)
       {
           //cout<<v[i+1]<<" "<<v[i]<<"\n";
           if(v[i+1]>v[i])
           {
               //cout<<"yo\n";
               stock+=money/v[i];
               money-=(v[i]*stock);
               last=i;
               break;
           }
       }
       //cout<<last<<"\n";
       for(i=last+1;i<n;i++)
       {
           if(v[i]<=v[i-1]&&v[i]<v[i+1])
           {
               stock+=money/v[i];
               money-=(money/v[i])*v[i];
               last=i;
           }
           else if(v[i]>=v[i-1]&&((v[i]>v[i+1])||(v[i]==n-1)))
           {
               money+=stock*v[i];
               stock=0;
               last=i;
           }
       }
       if(stock)
        money+=stock*v[n-1];
       cout<<money;
   }
}

Measured memory_bytes: 3584
N = int(input())
if N == 26:
    print('z')
    exit()
elif N == 702:
    print('zz')
    exit()
elif N == 18278:
    print('zzz')
    exit()
elif N == 475254:
    print('zzzz')
    exit()
elif N == 12356630:
    print('zzzzz')
    exit()
elif N == 321272406:
    print('zzzzzz')
    exit()
elif N == 8353082582:
    print('zzzzzzz')
    exit()
elif N == 217180147158:
    print('zzzzzzzz')
    exit()
elif N == 5646683826134:
    print('zzzzzzzzz')
    exit()
elif N == 146813779479510:
    print('zzzzzzzzzz')
    exit()
L = [26**i for i in range(0,12)]
for i in range(1,11):
    L[i] += L[i-1]
a = 0
while N // L[a] >= 1:
    a += 1
A = []
for i in range(a):
    A.append(N % 26)
    if N % 26 == 0:
        N = (N//26)-1
    else:
        N = N // 26
d = {}
d[0] = 'z'
for i in range(1,27):
    d[i] = chr(96+i)
ans = ''
for i in range(-1,-len(A)-1,-1):
    ans += d[A[i]]
print(ans)

Measured memory_bytes: 62192
#
# abc128 c
#

import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """2 2
2 1 2
1 2
0 1"""
        output = """1"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """2 3
2 1 2
1 1
1 2
0 0 1"""
        output = """0"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """5 2
3 1 2 5
2 2 3
1 0"""
        output = """8"""
        self.assertIO(input, output)


def resolve():
    N, M = map(int, input().split())
    S = [list(map(int, input().split())) for _ in range(M)]
    P = list(map(int, input().split()))

    ans = 0
    for bit in range(1 << N):
        m = 0
        for i in range(M):
            t = 0
            for j in range(1, S[i][0]+1):
                if bit & (1 << (S[i][j]-1)):
                    t += 1
            if t % 2 != P[i]:
                break
            else:
                m += 1
        if m == M:
            ans += 1
    print(ans)


if __name__ == "__main__":
    # unittest.main()
    resolve()


Measured memory_bytes: 16336
// F - Range Set Query

#include<cstdio>
#include<map>
#include<algorithm>
#include<cstring>
using namespace std;

const int Maxn = 5e5+10;

int N,Q;
int color[Maxn];
pair<int,int> query[Maxn];
int idx[Maxn];
int res[Maxn];
int c[Maxn];
int pre[Maxn];

inline int lowbit(int x) {
    return x & -x;
}

void add(int x,int k){
    while(x <= N) {
        c[x] += k;
        x += lowbit(x);
    }
}

int get(int x){
    int ans = 0;
    while(x >= 1) {
        ans += c[x];
        x = x - lowbit(x);
    }
    return ans;
}


int main(){
    //freopen("in","r",stdin);
    scanf("%d%d",&N,&Q); 
    for(int i = 1; i <= N;i++){
        scanf("%d",&color[i]);
    }
    for(int i = 1;i <= Q;i++){
        int l,r; 
        scanf("%d%d",&l,&r);
        query[i].first = l, query[i].second = r;
        idx[i] = i;
    }
    sort(idx+1,idx+Q+1,[](const int& l,const int& r)->bool{
        return query[l].second < query[r].second;
    });
    int q = 1;
    memset(c,0,sizeof(c));
    memset(pre,-1,sizeof(pre));
    for(int i = 1;i <= N;i++){
        add(i,1);
        if(pre[color[i]] > 0){
            add(pre[color[i]],-1);
        }
        pre[color[i]] = i;
        while(q <= Q && query[idx[q]].second == i) {
            res[idx[q]] = get(query[idx[q]].second) - get(query[idx[q]].first-1);
            q++;
        } 
    }
    for(int i = 1;i <= Q;i++){
        printf("%d\n",res[i]);
    }
}

Measured memory_bytes: 17312
#include <iostream>
#include <string>
#include <algorithm>
 
using namespace std;
 
int main()
{
    string s;
    getline(cin, s);
    transform(s.begin(), s.end(), s.begin(), ::toupper);
    string t = s.substr(s.find(" ") + 1);

    if ((s[s.find(" ") - 1] == s[s.find(" ") + 1]) && (t[t.find(" ") - 1] == t[t.find(" ") + 1])){
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using V = vector<int>;
using VV = vector<V>;
using VVV = vector<VV>;
using VL = vector<ll>;
using VVL = vector<VL>;
using VVVL = vector<VVL>;
template<class T> using VE = vector<T>;
template<class T> using P = pair<T, T>;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define REP(i,k,n) for(int i=(k);i<(n);i++)
#define all(a) (a).begin(),(a).end()
#define output(x,y) cout << fixed << setprecision(y) << x << 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; }
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; }
const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
ll upper = MOD + MOD;
ll under = -upper;
ll UPPER = MOD * MOD;
ll UNDER = -UPPER;
const long double pi = 3.141592653589793;
int main() {
	ll n, k;
	cin >> n >> k;
	ll ans = k;
	k--;
	rep(i, n - 1) ans *= k;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < (int)n; i++)
#define REPvec(itr, mp) for(auto itr = mp.begin();itr != mp.end(); itr ++)
#define all(x) x.begin(), x.end()
#define MOD 1000000007//1e9+7
using namespace std;
typedef long long ll;
typedef vector<bool>    vecbool;
typedef vector<int>     vecint;
typedef vector<ll>      vecll;
typedef vector<string>  vecstr;
typedef vector<vecint>  vec2int;
typedef vector<vecbool> vec2bool;
int dx[4] {-1,+1, 0, 0};
int dy[4] { 0, 0,-1,+1};
int main()
{
  int n; cin >> n;
  string s; cin >> s;
  map<char, ll> mp;
  REP(i,n){
    mp[s[i]]++;
  }
  for(char c = 'a'; c <= 'z'; c++){
    mp[c] ++;
  }
  ll ans = 1;
  for(char c = 'a'; c <= 'z'; c++){
    ans *= mp[c];
    ans %= MOD;
  }
  if(ans == 0){
    ans = MOD-1;
  }else{
    ans -= 1;
  }
  cout << ans << endl;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
int flip[2],mv[2];
vector <int> vec[2];
bool vis[1000100];
int a[1000100],b[1000100],c[1000100],go[1000100];
int work(vector <int> &vec)
{
	//for (int i=0;i<vec.size();i++) cout<<vec[i]<<' ';cout<<"\n\n";
	int ans=0;
	memset(vis,0,sizeof(vis));
	for (int i=0;i<vec.size();i++) if (!vis[i])
	{
		int now=i;
		while (!vis[now])
		{
			vis[now]=true;
			ans++;
			now=vec[now];
		}
		ans--;
	}
	return ans&1;
}
int main()
{
	int n;scanf("%d",&n);
	for (int i=1;i<=n;i++) scanf("%d",&a[i]);
	for (int i=1;i<=n;i++) scanf("%d",&b[i]);
	for (int i=1;i<=n;i++) scanf("%d",&c[i]);
	for (int i=1;i<=n;i++)
	{
		if ((a[i]+1==b[i])&&(b[i]+1==c[i])) {go[i]=c[i];}
		else if ((c[i]+1==b[i])&&(b[i]+1==a[i])) {flip[i&1]^=1;go[i]=a[i];}
		else {printf("No\n");return 0;}
		
		if (((go[i]/3)&1)!=(i&1)) {printf("No\n");return 0;}
		vec[i&1].push_back((go[i]/3-1)/2);
	}
	mv[0]=work(vec[0]);mv[1]=work(vec[1]);
	puts(((mv[0]==flip[1])&&(mv[1]==flip[0]))?"Yes":"No");
}

Measured memory_bytes: 13692
N = int(input())
Dic = {}
total = 0
for i in range(N):
    s = ' '.join(sorted(list(input())))
    if (s in Dic):
        Dic[s] += 1
    else:
        Dic[s] = 1
    total += Dic[s] -1
#Dic[abc] = 1
print(total)




Measured memory_bytes: 18532
import java.util.Scanner;

public class Main {

    public static void main(String[] args) { 
        Scanner scanner = new Scanner(System.in);
        int x = scanner.nextInt();
        int y = scanner.nextInt();
        int z = scanner.nextInt();

        if (x < y && y < z) System.out.println("Yes");
        else System.out.println("No");
    }
}

Measured memory_bytes: 26028
#include<iostream>
#include<cstdio>
using namespace std;
#define ll long long
ll A,B,ans;
int main()
{
	cin>>A>>B;
	if(A==B){puts("1");return 0;}
	int k=60;
	for(;~k;--k)
	{
		if((A>>k&1)^(B>>k&1))break;
		if(A>>k&1)A^=1ll<<k,B^=1ll<<k;
	}
	int l=k-1;
	while((~l)&&!(B&(1ll<<l)))--l;
	ll L=(!~l)?B:((1ll<<k)+(1ll<<(l+1))-1);
	ll R=(1ll<<k)+A;
	ans=(1ll<<(k+1))-A;
	if(L+1<R)ans-=R-L-1;
	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<vector>
using namespace std;

#define ll long long

#define debug_message 0
#define debug if (debug_message)

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

int i,t,j;
int n,m,nt,cnt;
string s,s1,s2;

int main(){
	cin>>s;
	
	for (i=1; i<sz(s); ++i){
		if (s[i]!=s[i-1]) {
			++cnt;
		}
	}
	
	printf("%d\n",cnt);
	
	return 0;
}
/*

*/

Measured memory_bytes: 3836
#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
#define rep(i,s,n)for(int i = s;i<n;i++)
#define repe(i,s,n)for(int i = s;i<=n;i++)
using namespace std;
typedef long long ll;
static const ll MOD = 1000000007;// 1e9 + 7;

vector<ll> v1, v2, v3, v4;

int main(){
	ll N, W; cin >> N >> W;
	ll w1;
	ll w,v;
	rep(i,0,N){
		if (i == 0) {
			cin >> w1 >> v;
			v1.push_back(v);
		}
		else {
			cin >> w >> v;
			if (w == w1) {
				v1.push_back(v);
			}
			else if (w == w1 + 1) {
				v2.push_back(v);
			}
			else if (w == w1 + 2) {
				v3.push_back(v);
			}
			else if (w == w1 + 3) {
				v4.push_back(v);
			}
		}
	}
	sort(v1.begin(), v1.end());
	reverse(v1.begin(), v1.end());
	sort(v2.begin(), v2.end());
	reverse(v2.begin(), v2.end());
	sort(v3.begin(), v3.end());
	reverse(v3.begin(), v3.end());
	sort(v4.begin(), v4.end());
	reverse(v4.begin(), v4.end());

	ll MAXV = 0;
	repe(i, 0, v1.size()) {
		repe(j, 0, v2.size()) {
			repe(k, 0, v3.size()) {
				repe(l, 0, v4.size()) {
					ll sum = 0;
					ll cnt = 0;
					for (vector<ll>::iterator it1 = v1.begin(); it1 != v1.end(); it1++) {
						if(cnt++ <i)	sum += *it1;
					}
					cnt = 0;
					for (vector<ll>::iterator it1 = v2.begin(); it1 != v2.end(); it1++) {
						if(cnt++ <j)	sum += *it1;
					}
					cnt = 0;
					for (vector<ll>::iterator it1 = v3.begin(); it1 != v3.end(); it1++) {
						if(cnt++ <k)	sum += *it1;
					}
					cnt = 0;
					for (vector<ll>::iterator it1 = v4.begin(); it1 != v4.end(); it1++) {
						if(cnt++ <l)	sum += *it1;
					}
					if (i*w1 + j*(w1+1) + k*(w1+2) + l*(w1+3) <= W)	MAXV = max(MAXV, sum);
				}
			}
		}
	}
	cout << MAXV << endl;

	return 0;
}

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

int n, m, x[200005], y[200005], mn[1005], mx[1005];
vector<int> g[1005];
bool bs[1005][1005], ans[200005];

void dfs(int u, bool *bs) {
	if (bs[u]) return;
	bs[u] = true;
	for (int e : g[u]) dfs(y[e], bs);
}
void dfs(int u, int *bel, int what, int ban) {
	if (bel[u] || u == ban) return;
	bel[u] = what;
	for (int e : g[u]) dfs(y[e], bel, what, ban);
}

int main() {
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= m; ++i) {
		scanf("%d%d", x + i, y + i);
		g[x[i]].push_back(i);
	}
	for (int i = 1; i <= n; ++i)
		dfs(i, bs[i]);
	for (int i = 1; i <= n; ++i) {
		memset(mn, 0, sizeof mn);
		memset(mx, 0, sizeof mx);
		for (int e : g[i]) dfs(y[e], mn, e, i);
		reverse(g[i].begin(), g[i].end());
		for (int e : g[i]) dfs(y[e], mx, e, i);
		for (int e : g[i])
			if (mn[y[e]] != mx[y[e]]) ans[e] = 1;
	}
	for (int i = 1; i <= m; ++i) {
		ans[i] ^= bs[y[i]][x[i]];
		puts(ans[i] ? "diff" : "same");
	}
	return 0;
}


Measured memory_bytes: 5504
#define _CRT_SECURE_NO_WARNINGS
#include <cassert>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
ll MOD = 1000000007LL;


bool eq(char a, char b) {
	return a=='?' || b=='?' || a==b || a==0 || b==0;
}

const int SZ = 2033;
char A[SZ], B[SZ], C[SZ];
int LA, LB, LC;

bool arr1[SZ*8], arr2[SZ*8], arr3[SZ*8];
bool *AB, *BC, *AC;

void process(char*S, char*T, bool *shift) {
	int LS = strlen(S);
	int LT = strlen(T);
	for (int sh=-LS; sh<=LT; sh++) {
		bool ok = true;
		for (int i=0; i<LS && ok; i++) if (0 <= sh+i && sh+i < LT)
			ok = eq(S[i], T[sh+i]);
		shift[sh] = ok;
	}
}


int main() {
	cin >> A >> B >> C;
	LA = strlen(A);
	LB = strlen(B);
	LC = strlen(C);

	memset(arr1, true, sizeof(arr1));
	memset(arr2, true, sizeof(arr2));
	memset(arr3, true, sizeof(arr3));
	AB = arr1 + SZ*4;
	BC = arr2 + SZ*4;
	AC = arr3 + SZ*4;


	process(A, B, AB);
	process(B, C, BC);
	process(A, C, AC);

	int ans = 1e9;
	for (int ab=-4000; ab<=4000; ab++) for (int bc=-4000; bc<=4000; bc++) {
		if (AB[ab] && BC[bc] && AC[ab+bc]) {
			int a = max(LA, max(-ab+LB, -ab-bc+LC)) - min(0, min(-ab, -ab-bc));
			ans = min(a, ans);
		}
	}


	cout << ans << endl;


	return 0;
}

Measured memory_bytes: 384
def numOfYaku(arg):
    ret = 0
    for i in range(1, arg + 1):
        if arg % i == 0:
            ret += 1
    return ret

a = int(input())
ans = 0
for j in range(1, a + 1):
    if numOfYaku(j) == 8 and j % 2 ==1 : ans += 1
print(ans)


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

int main() {
	int n;
	scanf("%d", &n);
	ll x = 1, y = 1;
	while (n--) {
		int a, b;
		scanf("%d%d", &a, &b);
		ll p = (x + a - 1) / a, q = (y + b - 1) / b;
		ll z = max(p, q);
		x = z * a, y = z * b;
	}
	printf("%lld\n", x + y);
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <map>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <queue>

using namespace std;

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = n;i >= m;i--)
#define REPO(i, n) for(int i = 1;i <= n;i++)
#define ll long long
#define INF 999999999
#define MINF -999999999
#define ALL(n) n.begin(),n.end()

bool isPrime(int a)
{
	int i, iLimit;
	// 1 は素数でない
	if (a == 1) return false;

	// 2 から √a を超えない整数までループ処理
	iLimit = (int)sqrt(a);
	for (i = 2; i <= iLimit; i++) {
		// 途中割り切れたらブレーク
		if (a % i == 0) break;
	}

	// 最後までループしきったら
	// 約数がなかったということで素数と判定
	if (i == iLimit + 1) {
		return true;
	}
	else {
		return false;
	}
}


int main() {
	int n,count = 0;
	cin >> n;
	for (int i = 3; count < n; i += 10) {
		if (isPrime(i)) {
			count++;
			cout << i << " ";
		}
	}
	cout << endl;
}


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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
//#pragma GCC optimize ("-O3") 
#ifdef YANG33
#include "mydebug.hpp"
#else
#define DD(x) 
#endif
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  2019/03/22  Problem: ABC 051 D / Link: http://abc051.contest.atcoder.jp/tasks/abc051_d  ----- */


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

	LL N, M; cin >> N >> M;
	vector<LL>a(M), b(M), c(M);
	for (int i = 0; i < M; ++i) {
		cin >> a[i] >> b[i] >> c[i];
		a[i]--, b[i]--;
	}
	VVL d(N, VL(N, LINF));
	FOR(i, 0, M) {
		d[a[i]][b[i]] = d[b[i]][a[i]] = min(d[a[i]][b[i]], c[i]);
	}
	FOR(i, 0, N) {
		d[i][i] = 0;
	}
	
	FOR(k, 0, N)FOR(i, 0, N)FOR(j, 0, N)d[i][j] = min(d[i][j], d[i][k] + d[k][j]);

	LL ans = 0LL;
	FOR(i, 0, M) {
		bool use = 0;
		FOR(j, 0, N) {
			use |= (d[j][a[i]] + c[i] == d[j][b[i]]);
			use |= (d[j][b[i]] + c[i] == d[j][a[i]]);
		}
		if (!use)ans++;
	}
	
	
	cout << (ans) << "\n";

	return 0;
}


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

using namespace std;

int main (){
	int n, a, b;
	
	cin >> n >> a >> b;
	
	n -= a;
	
	if(n > 0){
		cout << n % b << '\n';
	}else{
		cout << 0 << '\n';
	}
	
	return 0;
}

Measured memory_bytes: 256
use std::io::Read;

fn main() {
    let mut buf = String::new();

    // 標準入力から全部bufに読み込む
    std::io::stdin().read_to_string(&mut buf).unwrap();

    // 行ごとのiterが取れる
    let mut iter = buf.split_whitespace();
    let n: u64 = iter.next().unwrap().parse().unwrap();
    let result = (1..n + 1).fold(1, |acc, num| (acc * num) % 1000000007);
    println!("{}", result);
}


Measured memory_bytes: 4352
W,H,N=map(int,input().split())
a,b,c,d=0,W,0,H

for i in range(N):
  x,y,A=map(int,input().split())
  if A==1:
    a=max(a,x)
  if A==2:
    b=min(b,x)
  if A==3:
    c=max(c,y)
  if A==4:
    d=min(d,y)
  
print(max(0,b-a)*max(0,d-c))

Measured memory_bytes: 9016
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <math.h>
using namespace std;

int main() {

	string alphabet = "abcdefghijklmnopqrstuvwxyz";

	string c;
	cin >> c;

	char ans = alphabet[alphabet.find(c) + 1];

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = ll(1e18) +1;




// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    ll N,K;
    cin >> N >> K;
    vector<ll> num(N);
    for(int i=0;i<N;i++){
        cin >>num[i];
    }
    sort(num.begin(),num.end());

    ll r=INF;
    ll l=-INF;
    while(l+1<r){
        ll x = (r+l)/2;
        ll sum =0;
        ll start = -1;
        ll end = N;
        // cerr << "x=" << x << endl;
        for(int i=0;i<N;i++){
            ll inL=-1;
            ll inR=N;
            ll temp=0;
            while(inL+1<inR){
                ll inMid = (inL+inR)/2;
                if(num[i]<0){
                    if(num[inMid]*num[i]<x){
                        inR=inMid;
                    }else{
                        inL=inMid;
                    }
                    temp=N-inR;
                }else{
                    if(num[inMid]*num[i]<x){
                        inL=inMid;
                    }else{
                        inR=inMid;
                    }
                    temp=inR;
                }
            }
            if(num[i] * num[i] <x){
                temp--;
            }
            sum+=temp;
        }
        sum /=2;
        // cerr  <<"x=" << x <<"sum="<< sum << endl;
        if(sum <K){
            l =x;
        }else{
            r=x;
        }
       
    }
    cout << l <<endl;
    return 0;
}


Measured memory_bytes: 1920
#include <iostream>

using namespace std;

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, max, min, buf;
    cin >> N;
    cin >> buf;
    max = buf;
    min = buf;
    for (int i = 0; i< (N-1); i++){
        cin >> buf;
        if(buf > max){
            max = buf;
        }
        if(buf < min){
            min = buf;
        }
    }
    cout << max - min << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <iomanip>
//#include <string.h>
#include <bits/stdc++.h>
#define INF 999999999
using namespace std;
#define ll long long
#define boost ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
bool vis[100000]={0};
int main()
{
    boost;
    ll n , m;
    while(cin >>n>>m){
            ll sum=1;
        if(abs(n-m)>=2)
        {
            cout<<0<<endl;
            continue;
        }
        else if(n==m){
            for(ll i=1;i<=n;i++){
                    ll in=1;
                    in =i*i%1000000007;
                sum=sum*in%1000000007;
            }
            sum*=2;
                sum%=1000000007;
        }
        else {
            if(n>m){
                for(ll i=1;i<=n;i++)
                    sum=sum*i%1000000007;
                for(ll i=1;i<=m;i++)
                    sum=sum*i%1000000007;
            }
            else {
                for(ll i=1;i<=m;i++)
                    sum=sum*i%1000000007;
                for(ll i=1;i<=n;i++)
                    sum=sum*i%1000000007;
            }
        }
        cout<<sum<<endl;
    }

    return 0;

}


Measured memory_bytes: 256
n = int(input())
C = []
for i in range(n):
    cmd, str = input().split()
    C.append([cmd, str])

def Dictionary(C):
    D = {}
    for i in range(n):
        if C[i][0] == 'insert':
            D[C[i][1]] = i
        else:
            if C[i][1] in D: #辞書型だと検索が高速
                print("yes")
            else:
                print("no")
Dictionary(C)



Measured memory_bytes: 230024
#include<iostream>
using namespace std;
int main() {
  int a,b,cnt=0;
  cin >> a >> b;
  for(int i=a; i<=b; i++){
    int w,x,y,z;
    w = i%10;
    x = i/10%10;
    y = i/1000%10;
    z = i/10000%10;
    if(w == z && x == y){
      cnt++;
    }
  }
  cout << cnt << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define int long long
using namespace std;
typedef vector<int>   vint;
typedef pair<int,int> pint;

int calc(int k){
    int res=0;
    while(k>0){ 
        res+=k%10; 
        k/=10; 
    }
    return res;
}

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

    int ans=0;
    for(int i=1;i<=N;i++){
        int sum=calc(i);
        if(A<=sum and sum<=B) ans+=i;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define ll long long
#define M 1000000007

#define rep(i,l,r)for(ll i=(l);i<(r);i++)

ll pre,now,ans;
char s[99];
int main(){
	scanf("%*d%s",s);
	int n=strlen(s);
	ll pos;
	if(s[0]==s[1]){
		pre=1;
		ans=6;
		pos=2;
	}else{
		pre=0;
		ans=3;
		pos=1;
	}
	while(pos<n){
		if(s[pos]==s[pos+1]){
			if(pre==1)ans=ans*3%M;
			else ans=ans*2%M;
			pos+=2;
			pre=1;
		}else{
			if(pre==0)ans=ans*2%M;
			pos+=1;
			pre=0;
		}
	}
	printf("%lld\n",ans);
	return 0;
}
	

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

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

template<class T> inline bool chmax(T& a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
struct Unionfind {
    vector<int> par;
    vector<int> sizes;

    Unionfind(int n) : par(n), sizes(n, 1) {
        for(int i = 0; i < n; ++i) par[i] = i;
    }

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

    void unite(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        if(rx == ry) return;
        if(sizes[x] < sizes[y]) swap(x, y);
        par[ry] = rx;
        sizes[rx] += sizes[ry];
    }

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

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

};

const int MOD = 1e9+7;

ll modpow(int x, int times) {
    ll res = 1;
    for(int i = 0; i < times; ++i) {
        res = (res * x) % MOD;
    }
    return res;
}

int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);

    int n;
    cin >> n;

    ll ans = modpow(10, n) - modpow(9, n) - modpow(9, n);

    while(ans < 0) ans += MOD;
    ans = (ans + modpow(8, n)) % MOD;

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

Measured memory_bytes: 3648
#include<bits/stdc++.h>
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define forn(i,n,m) for(int (i)=(n);i<=(int)(m);(i)++)
#define push_back pb
#define make_pair mp
using namespace std;
typedef long long ll;
typedef long double ld;
int a,b;
int main(){
	cin>>a>>b;
	for(int i=b-a+1;i<=b+a-1;i++)
		cout<<i<<' ';
	return 0;;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long in;
typedef pair<in,in> ii;
#define F first
#define S second
#define sqr(x) (x)*(x)
#define pb(x) push_back(x)
#define sz(x) (in)x.size()
#define MAX(a,b) a = max(a,b)
#define MIN(a,b) a = min(a,b)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define rep(i,x,y) for(in i=x;i<(y);++i)
#define per(i,x,y) for(in i=y;i>=(x);--i)
#define IOS ios_base::sync_with_stdio(0);cin.tie(0)
/* start */


int main()
{
      IOS;
      in n,a,b;
      cin >> n >> a >> b;
      in check = max(a,b)-min(a,b);
      if(check%2 == 0)
      {
            cout << check/2 << "\n";
      }     
      else
      {
            in ans1 = min(a,b)-1; 
            if(max(a,b)-ans1 > 2)
            {
                  in cura = 1, curb = max(a,b)-ans1;
                  ans1++;
                  curb--;
                  ans1+=(curb-cura)/2;
            }
            else ans1++;


            in ans2 = n-max(a,b);
            
            if(min(a,b)+ans2 < n-1)
            {
                  in curb = n, cura = min(a,b)+ans2;
                  ans2++;
                  cura++;
                  ans2+=(curb-cura)/2;
            }
            else ans2++;

            cout << min(ans1,ans2) << "\n";
      }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
typedef long long       ll;
#define pb                emplace_back
#define mp                make_pair
#define all(a)            (a).begin(), (a).end()
#define clr(a,h)          memset(a, (h), sizeof(a))
#define F first
#define S second
#define forr(i, b, e)     for (int i = b; i < e; i++)
int faster_in(){int r=0,c;for(c=getchar();c<=32;c=getchar());if(c=='-') return -faster_in();for(;c>32;r=(r<<1)+(r<<3)+c-'0',c=getchar());return r;}

using namespace std;
//using namespace __gnu_pbds;

typedef pair<int, int>  ii;
typedef vector<int>     vi;
typedef vector<ii>      vii;
typedef vector<ll>      vll;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
const int INF = int(1e9 + 7);
const double EPS = 1e-9;
const double PI = acos(-1);
#define tam 100056
#define offset 10000000
typedef pair<int,short> par;
const int MOD=1e9+7;
ll vx[tam],vy[tam],sumx[tam],sumy[tam];
void MODUL(ll &num)
{
    num%=MOD;
    num+=MOD;
    num%=MOD;
}
int main()
{
    std::ios::sync_with_stdio(false); cin.tie(0);
    int n,m;
    cin>>n>>m;
    forr(i,0,n)
    {
        cin>>vx[i];
    }    
    forr(i,0,m)
    {
        cin>>vy[i];
    }
    
    ll ant=0;
    for(int i=m-1;i>=0;i--)
    {
        sumy[i]=ant+vy[i];
        MODUL(sumy[i]);
        ant=sumy[i];
        //cout<<sumy[i]<<' ';
    }
    //cout<<endl;
    ant=0;
    for(int i=n-1;i>=0;i--)
    {
        sumx[i]=ant+vx[i];
        MODUL(sumx[i]);
        ant=sumx[i];
        //cout<<sumx[i]<<' ';
    }
    //cout<<endl;
    ll toty,respuesta,totx;
    toty=respuesta=0;
    forr(i,0,m)
    {
        toty+=sumy[i]-(m-i)*vy[i];
        MODUL(toty);
    }
    
    forr(i,0,n)
    {
        totx=sumx[i]-(n-i)*vx[i];
        MODUL(totx);
        respuesta+=(toty*totx)%MOD;
        MODUL(respuesta);
    }
    respuesta+=MOD;respuesta%=MOD;
    cout<<respuesta<<"\n";
}
// PLUS ULTRA!

Measured memory_bytes: 3328
import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int m = Integer.parseInt(sc.next());
    if(n == m){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
}

Measured memory_bytes: 22608
#include <iostream>
#include <string>

int main()
{
    std::string S;
    std::cin >> S;

    bool bad = false;
    for (int i = 0; i < 3; i++) {
        if (S[i] == S[i+1]) {
            bad = true;
            break;
        }
    }

    std::cout << ((bad)?"Bad":"Good") << std::endl;

    return 0;
}

Measured memory_bytes: 256
class Factorization:	
	def __init__(self):
		# privateなインスタンス変数を作成
		self.__factors = dict()
		self.__n = 0
	
	
	def get_factors(self, n):
		# [summary] 素因数分解した結果を、辞書([素因数, 指数]...)で返す
		self.__factors.clear()
		self.__n = n
		
		if n < 2:
			# 2より小さい数の場合、素因数分解できない
			return { n:1 }
		else:
			self.__factorization()
			
			return self.__factors
	
	
	def get_divisors(self, n):
		# [summary] 約数をリストに列挙
		self.__factors.clear()
		self.__n = n
		
		if n < 2:
			return [1]
		else:
			self.__factorization()
			divisors = [1]
			
			for k, v in self.__factors.items():
				import copy
				copy_ = copy.deepcopy(divisors)
								
				for i in range(1, v + 1):
					for c in copy_:
						divisors.append(c * (k ** i))
			
			return divisors

				
	def count_divisors(self, n):
		# [summary] 約数の個数を返す
		self.__factors.clear()
		self.__n = n
		
		if n < 2:
			return 1
		else:
			self.__factorization()
			count = 1
			
			for v in self.__factors.values():
				count *= v + 1
			
			return count
	

	def	__factorization(self):
		# [summary]素因数分解した結果を、インスタンス変数に格納
		
		# 2,3,5で、割れなくなるまで割り続ける
		# (末尾に2,3,5のつく数は素数でないことが明白なので
		# 後続の処理で素数のリストに入れないように、先に処理する)
		self.__divide_with(2)
		self.__divide_with(3)
		self.__divide_with(5)
			
		# 平方根以下の素数で総当たりで試し割りする
		# (実際は、素数らしき数)
		import math
		sqrt_ = math.floor(math.sqrt(self.__n))
			
		primes = [7, 11, 13, 17, 19, 23, 29, 31]
		i = 0
		is_break = False
			
		while self.__n > 1:
			for p in primes:
				if p + i <= sqrt_:
					self.__divide_with(p + i)
				else:
					# 試し割りする数が平方根を超えたら、ループを抜ける
					is_break = True
						
					# 1が素因数に追加されることを防止
					if self.__n > 1:
						self.__factors.setdefault(self.__n, 1)
				
			if is_break:
				break
			else:
				i += 30
	
	
	def __divide_with(self, d):
		count = 0
		
		while self.__n % d == 0:
			self.__n //= d
			count += 1
		
		if count > 0:
			self.__factors.setdefault(d, count)


n = int(input())
lib = Factorization()
ans = 0

for i in range(1, n + 1, 2):
	divisors = lib.get_divisors(i)
	
	if len(divisors) == 8:
		ans += 1

print(ans)


Measured memory_bytes: 3444
#include<bits/stdc++.h>
#define endl '\n'
#define ll 'long long'

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

	int x1, x2, x3, x4, x5;
	cin >> x1 >> x2 >> x3 >> x4 >> x5;
	if (x1 == 0) cout << "1";
	else if (x2 == 0) cout << "2";
	else if (x3 == 0) cout << "3";
	else if (x4 == 0) cout << "4";
	else if (x5 == 0) cout << "5";
}

Measured memory_bytes: 3596
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
using ll = long long;
#define rep(i,n) for (int i = 0; i<(n) ; i++);

int main() {
	int k, n;
	cin >> k >> n;
	vector<int> a(n);
	for (int i = 0; i < n; i++)cin >> a.at(i);
	sort(a.begin(), a.end());
	vector<int> b(n);
	for (int i = 1; i < n; i++) {
		b.at(i-1) = a.at(i) - a.at(i - 1);
	}
	b.at(n - 1) = k - a.at(n-1) + a.at(0);
	sort(b.begin(), b.end());
	int p = b.at(n - 1);
	cout << k - p << endl;

	return 0;
}

Measured memory_bytes: 1920
#include <bits/stdc++.h>
using namespace std;
main(){
  int N;
  cin >> N;
  int sum=0;
  string ans="No";
  for(int i=0;i<30;i++){
    for(int j=0;j<30;j++){
      sum=4*i+7*j;
      if(sum==N) ans="Yes";
    }
  }
  cout << ans << endl;
}

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

int main() {
  int N, A, O;
  cin >> N >> A;
  O=N%500;
  if (O<=A) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


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

int main() {
	ios::sync_with_stdio(false);
	string S;
	cin >> S;

	int cnt = 0;
	for (int i = 0; i < S.size(); i++) {// 10101010
		if (i%2) {
			if (S.at(i) == '1') {
				cnt++;
			}
		}
		else {
			if (S.at(i) == '0') {
				cnt++;
			}
		}
	}

	if (cnt > (S.size()/2)) {
		cnt = S.size() - cnt;
	}

	cout << cnt << "\n";

	return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const ll mo = 1000000007;
ll mypow(ll a, ll b)
{
  ll res = 1;
  a %= mo;
  while (b)
  {
    if (b & 1)
      res = res * a % mo;
    a = a * a % mo;
    b >>= 1;
  }
  return res;
}
const ll MAX = 510000;
const ll MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit()
{
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (ll i = 2; i < MAX; i++)
  {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}
long long COM(ll n, ll k)
{
  if (n < k)
    return 0;
  if (n < 0 || k < 0)
    return 0;
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
vector<ll> factorial(ll n)
{
  vector<ll> fac;
  fac.push_back(1);
  for (ll i = 1; i < n + 10; i++)
  {
    fac.push_back((fac[i - 1] * i) % mo);
  }
  return fac;
}
int main()
{
/* 
https://onlinejudge.u-aizu.ac.jp/courses/library/7/DPL/5
ボール      箱	      入れ方に制限なし 箱の中身は1つ以下 箱の中身は1つ以上
区別できる   区別できる  1            2             3
区別できない  区別できる  4            5             6
区別できる   区別できない 7            8             9
区別できない  区別できない 10          11            12
*/
ll n , k ;
cin >> n >> k ;
auto mod = [](ll modx) {modx%=mo;modx+=mo;modx%=mo;return modx; };
COMinit();
vector<ll> fac = factorial(100000);
/* 
//1
cout << mypow(k,n) << endl;
 */
/* 
//2
cout << (COM(k,n)*fac[n])%mo << endl;
 */

//3
ll t=0;
rep(i,k+1){
  t=mod(t+mypow(-1,k-i)*COM(k,i)*mypow(i,n));
}
cout << t << endl;

return 0;
}


Measured memory_bytes: 15872
#include<iostream>
#include <algorithm>
#include <cstdlib>
#include<string>
using namespace std;
int main(){
  int a,b,c;
  cin >> a >> b >> c;

  if (a<b && b<c){
    cout << "Yes" <<endl;
  }
  else{
    cout << "No" <<endl;
  }
}



Measured memory_bytes: 3096
#include <stdio.h>

#include <algorithm>
#include <cmath>
#include <iostream>
#include <numeric>
#include <queue>
#include <stack>
#include <string>
#include <vector>
typedef long long ll;
const ll BIGMOD = 1e9 + 7;
using namespace std;

int n, x, y;

int Distance(int i, int j) {
  int ngo1 = abs(i - j);
  int ngo2 = abs(x - i) + abs(y - j) + 1;
  int ngo3 = abs(x - j) + abs(y - i) + 1;

  // cout << "i:" << i << " j:" << j << " 1:" << ngo1 << " 2:" << ngo2
  //      << " 3:" << ngo3 << endl;

  return min(min(ngo1, ngo2), min(ngo2, ngo3));
}

int main() {
  cin >> n >> x >> y;
  int* arr = new int[n + 1]{0};
  for (int i = 1; i <= n - 1; ++i) {
    for (int j = i + 1; j <= n; ++j) {
      arr[Distance(i, j)] += 1;
    }
  }
  for (int i = 1; i < n; ++i) {
    cout << arr[i] << endl;
  }

  return 0;
}

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

#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define PI (acos(-1))

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;

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

signed main()
{
  string s,t; cin>>s>>t;
  vi start(26, -1);
  vi goal(26, -1);
  rep(i,s.size()){
    int a=s[i]-'a';
    int b=t[i]-'a';
    
    if(start[a]!=-1||goal[b]!=-1){
      if(start[a]!=b||goal[b]!=a){
        cout<<"No"<<endl;
        return 0;
      }
    }
    start[a]=b;
    goal[b]=a;
  }

  cout<<"Yes"<<endl;
  
}


Measured memory_bytes: 776
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		scan.close();
		System.out.println(s.charAt(0) == s.charAt(1) && s.charAt(0) == s.charAt(2)? "No":"Yes");
	}
}

Measured memory_bytes: 23764
#include <iostream>
#include <iomanip>
#include <vector>
#include <valarray>
#include <map>
#include <set>
#include <list>
#include <queue>
#include <stack>
#include <bitset>
#include <utility>
#include <numeric>
#include <algorithm>
#include <functional>
#include <complex>
#include <string>
#include <sstream>

#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cmath>

using namespace std;

#define all(c) c.begin(),c.end()
#define repeat(i,n) for(int i=0;i<static_cast<int>(n);i++)
#define debug(x) #x << "=" << (x)
#define dump(x) cerr << debug(x) << " (L:" << __LINE__ << ")"<< endl

typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<string> vs;

template<typename T>
ostream& operator<<(ostream& os, const vector<T>& vec){
    os << "[";
    for(int i = 0; i < vec.size(); i++){
        os << vec[i] << ",";
    }
    os << "]";
    return os;
}

template<typename T>
T input(){
    T t;
    cin >> t;
    return t;
}

template<typename T>
vector<T> input(const int N){
    vector<T> v(N);
    repeat(i,N) cin >> v[i];
    return v;
}

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

long long lcm(long long a, long long b){
    return (a / gcd(a, b)) * b;
}

long long mul(const long long& a, const long long& b, const long long& mod) {
    return ((a % mod) * (b % mod)) % mod;
}

long long power(const long long& x, const long long& y, const long long& mod) {
    if (y == 0) {
        return 1;
    } else if (y == 1) {
        return x % mod;
    } else {
        long long value = power(x, y / 2, mod);
        if (y % 2 == 0) {
            return mul(value, value, mod);
        } else {
            return mul(value, value, mod) * x % mod;
        }
    }
}

long long div(const long long& a, const long long& b, const long long& mod) {
    return mul(a, power(b, mod - 2, mod), mod);
}

map<long long, long long> factorials;
long long factorial(const long long& n, const long long& mod) {
    if (n == 0 || n == 1) {
        return 1;
    }
    if (factorials[n] != 0) {
        return factorials[n];
    }
    factorials[n] = n * factorial(n - 1, mod) % mod;
    return factorials[n] % mod;
}

long long combination(const long long& n, const long long& x, const long long& mod) {
    long long numerator = 1;
    long long denominator = 1;
    repeat(i, x) {
        numerator *= (n - i) % mod;
        numerator %= mod;
        denominator *= (i + 1) % mod;
        denominator %= mod;
    }
    return div(numerator, denominator, mod);
}

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

    map<int, int> numbers;
    int number;
    repeat (i, N) {
        cin >> number;
        numbers[number] += 1;
    }

    map<int, int>::iterator itr = numbers.begin();
    std::priority_queue<int, std::vector<int>, std::greater<int> > min_queue;
    for (; itr != numbers.end(); itr++) {
        min_queue.push(itr->second);
    }

    int count = 0;
    while (K < min_queue.size()) {
        count += min_queue.top();
        min_queue.pop();
    }
    cout << count << endl;
    return 0;
}

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

int main(){
  int n,m;
  cin >> n;
  vector<string> s(n);
  for(int i = 0;i < n;i++){
    cin >> s.at(i);
  }
  cin >> m;
  vector<string> t(m);
  for(int i = 0;i < m;i++){
    cin >> t.at(i);
  }
  sort(s.begin(),s.end());
  
  vector<string> src;
  src.push_back(s.at(0));
  int num = 0;
  for(int i = 0;i < n;i++){
    if(src.at(num) != s.at(i)){
      src.push_back(s.at(i));
      num++;
    }
  }

  vector<int> sN(src.size());
  vector<int> tM(src.size());
  for(int i = 0;i < src.size();i++){
    for(int j = 0;j < n;j++){
      if(src.at(i) == s.at(j)){
        sN.at(i)++;
      }
    }
    for(int h = 0;h < m;h++){
      if(src.at(i) == t.at(h)){
        tM.at(i)++;
      }
    }
  }
  int maxW = 0;
  for(int i = 0;i < src.size();i++){
    if(sN.at(i) - tM.at(i) > maxW){
      maxW = sN.at(i) - tM.at(i);
    }
  }

  if(maxW > 0){
    cout << maxW << endl;
  }else{
    cout << 0 << endl;
  }
  
  return 0;
}

Measured memory_bytes: 256