akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
using Graph = vector<vector<int>>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define Rep(i, k, n) for (int i = k; i < (int)(n); i++)
#define RRep(i, k, n) for (int i = k; i > (int)(n); i--)
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define ALL(a)  (a).begin(),(a).end()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
const int MOD = 1000000007;
const double PI = acos(-1); //3.14~
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

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

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
a = {}
N = int(input())
for i in range(N):
    a[i+1] = (int(input()))

light = 1
count = 0
while count < N:
    
    light = a[light]
    count += 1

    if light == 2:
        print(count)
        break

    if count == N-1:
        print(-1)
        break


Measured memory_bytes: 17892
alphabet=['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
z=input()
for i in range(26):
  if z==alphabet[i]:
    print(alphabet[i+1])
 
  

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

using namespace std;

int n,x;
long long ans;
map<int,int> mp;

int main(){
    scanf("%d",&n);
    for (int i=1;i<=n;i++){scanf("%d",&x); mp[x]++;}
    for (map<int,int>::iterator i=mp.begin();i!=mp.end();i++)
        if (i->second>=i->first) ans+=i->second-i->first;
        else ans+=i->second;
    printf("%lld\n",ans);

    return 0;
}


Measured memory_bytes: 4736
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
//#define int long long

template <class T>
bool INRANGE(T x, T a, T b) { return a <= x && x <= b; }
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 (a > b){ a = b; return 1;}return 0;}
template <class T>
void printv(vector<T> v) {for (T t : v) {cout << t << " ";}cout << '\n';}

#define REP(i, n) for (int i = 0; i < (n); ++i)
#define RREP(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define RFOR(i, a, b) for (int i = (a); i >= (b); --i)
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
                      << " " << __FILE__ << endl;

typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vi> vvi;
typedef pair<int, int> pii;

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

    int N, A, B;
    cin >> N >> A >> B;
    cout << min(N*A,B) << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>

void solve() {
    int n;
    std::cin >> n;
    std::cout << (n + 1) / 2 << std::endl;
}

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

    solve();

    return 0;
}


Measured memory_bytes: 256
n,m,l = map(int,input().split())
a = [list(map(int,input().split())) for _ in range(n)]
b = [list(map(int,input().split())) for _ in range(m)]

[print(*x) for x in [[sum(j*k for j,k in zip(x,y)) for y in zip(*b)]for x in a]]



Measured memory_bytes: 7004
#include<bits/stdc++.h>
using namespace std;
int main(){
  string a,b,c;
  cin>>a>>b>>c;
  if(a[a.size()-1]==b[0]&&b[b.size()-1]==c[0]){
    cout<<"YES"<<endl;
  }
  else cout<<"NO"<<endl;
  return(0);
}


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

#ifdef NON_SUBMIT
#define TEST(n) (n)
#else
#define TEST(n) ((void)0)
#endif

using namespace std;

vector<long long> S, NS;
long long PS[1001];

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	TEST(freopen("input.txt", "r", stdin));
	TEST(freopen("output.txt", "w", stdout));
	TEST(freopen("debug.txt", "w", stderr));
	int N, K;
	long long f, ans = 0;
	cin >> N >> K;
	for (int i = 1; i <= N; i++) {
		cin >> PS[i];
		PS[i] += PS[i - 1];
		for (int j = 0; j < i; j++) S.push_back(PS[i] - PS[j]);
	}
	sort(S.begin(), S.end(), greater<long long>());
	for (f = 1; f <= S[0]; f <<= 1);
	for (f >>= 1; f; f >>= 1) {
		NS.clear();
		for (auto s : S) {
			if (s&f) NS.push_back(s);
		}
		if (NS.size() >= K) ans |= f, S = NS;
	}
	cout << ans << '\n';
	return 0;
}

Measured memory_bytes: 6384
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
using namespace std;
int a[100005],d[100005];
int main()
{
	int n,i;
	memset(a,0,sizeof(a));
	scanf("%d",&n);
	for(i = 1;i <= n;i++)
		scanf("%d",&a[i]);
	d[n] = 0;
	d[n - 1] = abs(a[n] - a[n - 1]);
	for(i = n - 2;i > 0;i--)
	{
		d[i] = min(d[i + 1] + abs(a[i] - a[i + 1]),d[i + 2] + abs(a[i] - a[i + 2]));
	}
	printf("%d\n",d[1]);
	return 0;
}

Measured memory_bytes: 896
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <array>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cstdint>
#include <cassert>
#include <random>

using namespace std;
using i64 = int64_t;
using i32 = int32_t;
template<class T, class U> void init_n(vector<T>& v, size_t n, U x) 
{ v = vector<T>(n, x); }
template<class T> void init_n(vector<T>& v, size_t n) { init_n(v, n, T()); }
template<class T> void read_n(vector<T>& v, size_t n, size_t o = 0) 
{ v = vector<T>(n+o); for (size_t i=o; i<n+o; ++i) cin >> v[i]; }
template<class T> void read_n(T a[], size_t n, size_t o = 0)
{ for (size_t i=o; i<n+o; ++i) cin >> a[i]; }
template<class T> T gabs(const T& x) { return max(x, -x); }
#define abs gabs

struct P {
  double x, y;
};

i64 n;
vector<P> ps;
int main() {
  cin >> n;
  for (i64 i = 0; i < n; ++i) {
    double x, y;
    cin >> x >> y;
    if (x != 0 || y != 0)
      ps.push_back({x, y});
  }

  double pi = atan2(+0.0, -1.0);
  cerr << pi << endl;
  double ans = 0;
  for (i64 a = 0; a < 100000; ++a) {
    double w = 2.0 * pi * (double(a) / 100000);
    i64 dx = 0, dy = 0;
    for (auto p : ps) {
      double rx = cos(w) * p.x - sin(w) * p.y,
             ry = sin(w) * p.x + cos(w) * p.y;
      if (rx > 0) {
        dx += p.x;
        dy += p.y;
      }
    }
    ans = max(ans, hypot(double(dx), double(dy)));
  }
  printf("%.13f\n", ans);
  return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ldb = long double;
using pa = pair < ll, ll >;
using vec = vector < ll >;
#define pb push_back
#define po pop_back
#define mp make_pair
#define mt make_tuple
#define F  first
#define S  second
#define f(i,x,n) for(ll i=x;i<n;i++) 
#define unique_sort(x) sort(all(x)), x.resize(distance(x.begin(), unique(all(x))))
#define all(c) c.begin(),c.end()
#define str string
#define edl "\n"
#define add insert
#define cot continue
#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL)
const int MOD = 1e9 + 7, INF = INT_MAX, N = 1e5 + 10;
const double PI = acos(-1);
const ll LINF = LLONG_MAX;

vec q(300001,0);
int main() 
{

 fast();
  

  ll n;
  cin>>n;
  n--;
  ll s=(n)*(n+1)/2;
  cout<<s;


 
  cerr << "Time taken: " << int((clock() * 1000.) / CLOCKS_PER_SEC) << "ms\n";
    return 0;
}
 

Measured memory_bytes: 2560
n=int(input())
S=list(map(int,input().split()))
q=int(input())
T=list(map(int,input().split()))
cnt=0
for i in range(q):
    l=0
    r=n-1
    while l<=r:
        mid = (l+r)//2 
        guess = S[mid]
        if guess == T[i]:
            cnt=cnt+1
            break
        if guess > T[i]:
            r=mid-1
        if guess < T[i]:
            l=mid+1

print(cnt)
        



Measured memory_bytes: 16704
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const double EPS=1e-9;
const double PI=acos(-1.0);
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
double ABS(double a){return max(a,-a);}
long long p[110000];
long long sum[110000];
long long ssum[110000];
long long ks1[110000];
long long ks2[110000];

long long fact[110000];
long long inv[110000];
long long finv[110000];
long long C(long long a,long long b){
	assert(a>=b);
	return fact[a]*finv[b]%mod*finv[a-b]%mod;
}
int main(){
	int a;scanf("%d",&a);
	fact[0]=finv[0]=inv[1]=1;
	for(int i=2;i<110000;i++){
		inv[i]=(mod-(mod/i)*inv[mod%i]%mod)%mod;
	}
	for(int i=1;i<110000;i++){
		fact[i]=fact[i-1]*i%mod;
		finv[i]=finv[i-1]*inv[i]%mod;
	}
	for(int i=0;i<a;i++)scanf("%lld",p+i);
	for(int i=0;i<a;i++){
		sum[i+1]=(sum[i]+p[i])%mod;
	}
	for(int i=0;i<=a;i++){
		ssum[i+1]=(ssum[i]+sum[i])%mod;
	}
	for(int i=1;i<a;i++){
		ks1[i]=fact[i-1]*C(a,i+1)%mod*fact[a-i-1]%mod*i%mod;
	}
	long long ret=0;
	for(int i=1;i<a;i++){
		ret=(ret+ks1[i]*sum[i])%mod;
		ret=(ret+ks1[i]*(mod+sum[a]-sum[a-i]))%mod;
	}
	ret=(ret+sum[a]*fact[a])%mod;
	for(int i=1;i<a-1;i++){
		ks2[i]=2*fact[i]*C(a,i+2)%mod*fact[a-i-2]%mod;
	}
	for(int i=1;i<a-1;i++){
		ret=(ret+ks2[i]*(mod*2+(ssum[a]-ssum[i+1])-(ssum[a-i]-ssum[1])))%mod;
	}
	printf("%lld\n",ret);
}

Measured memory_bytes: 6912
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAXL 10

int main(void){
    /* code */
    char s[MAXL + 1], s_copy[3 + 1];
    int num, diff_753, diff_753_min = 10101010;
    scanf("%s", s);
    for(int i = 0; i <= strlen(s) - 3; i++){
        //printf("i = %d, %c\n", i, s[i]);
        for(int j = 0; j < 3; j++){
            s_copy[j] = s[i + j];
        }
        num = atoi(s_copy);
        diff_753 = (num > 753)? num - 753 : 753 - num;
        
        if(diff_753 < diff_753_min) diff_753_min = diff_753;

        if(diff_753_min == 0) break;
    }
    //i = atoi(s);
    //printf("i = %d\n", i);
    printf("%d\n", diff_753_min);
    return 0;
}


Measured memory_bytes: 128
#include <iostream>

using namespace std;

int main(void) {
    int N, a, b, c, x[10];
    cin >> N;
    for (; N--; ) {
        bool ok = true;
        for (int i = 0; i < 10; i++) {
            cin >> x[i];
        }
        b = c = 0;
        for (int i = 0; i < 10; i++) {
            a = x[i];
            if (a < b && a < c) {
                ok = false;
                break;
            } else if (a < b) {
                c = a;
            } else if (a < c) {
                b = a;
            } else if (b < c) {
                c = a;
            } else {
                b = a;
            }
        }
        if (ok) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}

Measured memory_bytes: 1152
#include<stdio.h>
#include<iostream>
using namespace std;
int a[3][105];
int dp[3][105];
int digui(int x,int y)
{
	if(dp[x][y]!=0)
		return dp[x][y];
	if(x==1&&y==1)
		return dp[1][1]=a[1][1];
	else if(x==1)
		return dp[1][y]=digui(1,y-1)+a[1][y];
	else if(y==1)
		return dp[x][1]=digui(x-1,1)+a[x][1];
	else
		return dp[x][y]=max(digui(x-1,y),digui(x,y-1))+a[x][y];
}
int main()
{
	int n;
	scanf("%d",&n);
	for(int i=1;i<=2;++i)
		for(int j=1;j<=n;++j)
			scanf("%d",a[i]+j);
	printf("%d\n",digui(2,n));
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
///////////////////////////////////////////
const long long int INF = 1LL<<60;
const long long int Mod = 1000000007;
using ll = long long int; using ci = const int;
using vi = vector<int>;  using Vi = vector<long long int>;
using P = pair<int, int>;  using PLL = pair<ll, ll>;
using matrix = vector<vector<ll>>;
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define rp(i,N) for(ll i = 0; i < (ll)N; i++)
#define repi(i,a,b) for(ll i = ll(a); i < ll(b); ++i)
template<class T>bool chmax(T &former, const T &b) { if (former<b) { former=b; return true; } return false; }
template<class T>bool chmin(T &former, const T &b) { if (b<former) { former=b; return true; } return false; }
template<class T>T sqar(T x){ return x*x; }//sqrt(x)は平方根;
#define Sort(v) std::sort(v.begin(), v.end(), std::greater<decltype(v[0])>()) //降順でVをソート
#define p_queue(v) priority_queue<v, vector<v>, greater<v> >
template<class T> inline void princ(T x){cout<<x<<" ";}; 
template<class T> inline void print(T x){cout<<x<<"\n";};
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
///////////////////////////////////////////////////////////////////////////////////

int digit[50];
void solve(){
    int n;
    cin >> n;
    if(n==0){
        print(0);
        return;
    }
    bool plus=true;
    if(n<0) {
        plus=false;
        n=-n;
    }
    int ctr=0;
    while(n>0){
        if(n&1){
            digit[ctr]=1;
        }
        ctr++;
        n/=2;
    }
    if(plus){
        for(ll i=ctr-1; i>0; i--){
            if(i&1){
                if(digit[i]==1) digit[i+1]++;
            }
        }
        repi(i,1,45){
            while(digit[i]>1){
                digit[i+1]++;
                digit[i+2]++;
                digit[i]-=2;
            }
        }
    }
    else{
        for(ll i=ctr-1; i>=0; i--){
            if(i%2==0){
                if(digit[i]==1) digit[i+1]++;
            }
        }
        repi(i,1,45){
            while(digit[i]>1){
                digit[i+1]++;
                digit[i+2]++;
                digit[i]-=2;
            }
        }
    }
    bool start=false;
    for(ll i=38;i>=0;i--){
        if(!start&&digit[i]==0) continue;
        if(!start&&digit[i]==1){
            start=true;
            cout << digit[i];
            continue;
        }
        cout << digit[i];
    }
    cout << endl;
    return;
}
int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    std::cout<<std::fixed<<std::setprecision(30);
    solve();
    return 0;
}

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

// template {{{  0 
// using {{{ 1
using ll = long long int;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vii = vector<pii>;
using vll = vector<pll>;
// }}} 1
// definition {{{ 1
// scaning {{{ 2
#define Scd(x) scanf("%d", &x)
#define Scd2(x,y) scanf("%d%d", &x, &y)
#define Scd3(x,y,z) scanf("%d%d%d", &x, &y, &z)
#define Scll(x) scanf("%lld", &x)
#define Scll2(x,y) scanf("%lld%lld", &x, &y)
#define Scll3(x,y,z) scanf("%lld%lld%lld", &x, &y, &z)
#define Scc(c) scanf("%c", &c);
#define Scs(s) scanf("%s", s);
#define Scstr(s) scanf("%s", &s);
// }}} 2
// constants {{{ 2
#define EPS (1e-7)
#define INF (2e9)
#define PI (acos(-1))
// }}} 2
// systems {{{ 2
#define Repe(x,y,z) for(ll x = z; x < y; x++)
#define Rep(x,y) Repe(x,y,0)
#define RRepe(x,y,z) for(ll x = y-z-1; x >= 0; x--)
#define RRep(x,y) RRepe(x,y,0)
// }}} 2
// output {{{ 2
#define YesNo(a) (a)?printf("Yes\n"):printf("No\n")
#define YESNO(a) (a)?printf("YES\n"):printf("NO\n")
// }}} 2
// }}} 1
// input {{{ 1
// }}} 1
// }}} 0

int main() {

    int N;
    Scd(N);
    printf ("%d\n", (N-1)/2 );

    return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<climits>
#include<vector>
#include<utility>//pair
#include<cmath>//abs,sqrt
#include<cstring>
#include<map>
#include<string>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define prin(arg) cout<<arg<<"\n"
#define prin2(arg1,arg2) cout<<arg1<<" "<<arg2<<"\n"
#define fill(arg,n) memset(arg,n,sizeof(arg))
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
const int INF=1e+9;
const ll INFLL=1e+17;
int main(){
  string s;
  cin>>s;
  map<char,int> mp;
  int n=s.size();
  rep(i,n){
    mp[s[i]]++;
  }
  bool f=true;
  for(auto ite=mp.begin();ite!=mp.end();ite++){
    if(ite->second>1){
      f=false;
      break;
    }
  }
  if(f) prin("yes");
  else prin("no");

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>

auto factorize( int n )
{
	std::vector< std::pair<int, int> > res;

	for ( int i = 2; i <= n; i++ )
	{
		if ( ( n % i ) == 0 )
		{
			int cnt = 0;
			while ( ( n % i ) == 0 )
			{
				n /= i;
				cnt++;
			}

			res.emplace_back( std::make_pair( i, cnt ) );
		}
	}

	return ( res );
}

auto comb( int n, int r )
{
	std::vector<std::vector<long long> > v( n + 1, std::vector<long long>( n + 1, 0 ) );
	for ( int i = 0; i < v.size(); i++ )
	{
		v[i][0] = 1;
		v[i][i] = 1;
	}

	for ( int j = 1; j < v.size(); j++ )
	{
		for ( int k = 1; k < j; k++ )
		{
			v[j][k] = v[j - 1][k - 1] + v[j - 1][k];
		}
	}

	return ( v[n][r] );
}

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

	std::vector<int> v;
	std::map<int, int> m;

	for ( int i = 2; i <= N; i++ )
	{
		auto tmp = factorize( i );

		for ( auto &&it : tmp )
		{
			m[it.first] += it.second;
		}
	}

	// 約数を75個持つためには、
	// N!の素因数x, y, z...がp^n, q^m, r^l...の時、
	// 数列An = n, m, l, ...と定義すると、
	// (n + 1以下) * (m + 1以下) * (l + 1以下) ... = 75
	// となる組み合わせを全て求めればOK
	// 75 = 3 * 5^2 なので、約数は 1, 3, 5, 15, 25, 75の6個ある
	//
	// 74 以上のものを一つだけ選ぶ
	// 24 以上のものを一つ、2以上のものを一つ選ぶ
	// 14 以上のものを一つ、4以上のものを一つ選ぶ
	// 4以上のものを2つ、2以上のものを一つ選ぶ
	//
	// 以上の組み合わせが、求める全組み合わせになる
	int counter = 0;
	int A[] = { 3, 5, 15, 25, 75, 9999999 };
	std::map<int, std::vector<int> > mm;
	for ( int i = 4; i >= 0; --i )
	{
		for ( auto &&it : m )
		{
			if ( it.second >= ( A[i] - 1 ) )
			{
				mm[A[i]].emplace_back( it.first );
			}
		}
	}

#if 0
	std::cout << N << "!" << std::endl;
	for ( auto &&it : m )
	{
		std::cout << it.first << "^" << it.second << std::endl;
	}
	for ( auto &&it : mm )
	{
		std::cout << it.first << ":" << it.second.size() << std::endl;
	}
#endif

	// 75 * 1
	counter += mm[75].size();

	// 25 * 3
	counter += ( mm[25].size() ) * ( mm[3].size() - 1 );

	// 15 * 5
	counter += ( mm[15].size() ) * ( mm[5].size() - 1 );

	// 5 * 5 * 3
	counter += comb( mm[5].size(), 2 ) * ( mm[3].size() - 2 );

	std::cout << counter << std::endl;

	return ( 0 );
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define all(v) v.begin(), v.end()
#define MOD 1000000007
const int INF = 1LL<<30;

vector<vector<int>> G;
vector<ll> ans;

void dfs(int cu,int pa=-1){
    for(auto to : G[cu]){
        if(pa==to) continue; // 逆流防止
        ans[to]+=ans[cu];
        dfs(to,cu);
    }
}

int main(){
    int n,q;
    cin>>n>>q;
    
    G.resize(n);
    rep(i,n-1){
        int a,b;
        cin>>a>>b;
        a--,b--;
        G[a].push_back(b);
        G[b].push_back(a);      
    }

    ans.resize(n);
    rep(i,q){
        int p,x;
        cin>>p>>x;
        p--;
        ans[p]+=x;
    }

    dfs(0);
    rep(i,n){
        cout<<ans[i]<<" ";
    }
    cout<<endl;
}

Measured memory_bytes: 25084
/*
[abc114] D - 756
*/

#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;

int N;

ll solve() {
    map<int, int> fac;
    for (int i = 1; i <= N; i++) {
        int n = i;
        for (int j = 2; j * j <= n; j++) {
            while (n % j == 0) {
                n /= j;
                fac[j]++;
            }
        }
        if (n > 1) {
            fac[n]++;
        }
    }

    map<int, int> cnt;
    for (auto& kv : fac) {
        for (int c : {3, 5, 15, 25, 75}) {
            if (kv.second >= c - 1) {
                cnt[c]++;
            }
        }
    }

    ll ans = 0;
    ans += cnt[75];
    ans += cnt[3] * cnt[25] - cnt[25];
    ans += cnt[5] * cnt[15] - cnt[15];
    ans += (cnt[3] * cnt[5] * (cnt[5] - 1) - 2 * cnt[5] * (cnt[5] - 1)) / 2;

    return ans;
}

int main() {
    cin >> N;

    cout << solve() << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int main(){
	string N;
	cin >> N;
	int ja = 0;
	for (int i = 0; i < N.size(); i++) {
		if (N[i] == '7') {
			cout << "Yes" << endl;
			ja += 7;
			break;
		}
	}
	if (ja < 7) {
		cout << "No" << endl;
	}
	
}

Measured memory_bytes: 3552
def is_palindrome(s):
    n = len(s)
    for i in range(int(n / 2)):
        if s[i] != s[-i - 1]:
            return False
    return True

s = input()

all_s = is_palindrome(s)

n = len(s)
top_s = is_palindrome(s[: int((n - 1) / 2)])
bottom_s = is_palindrome(s[- int((n - 1) / 2):])

print("Yes" if all([all_s, top_s, bottom_s]) else "No")

Measured memory_bytes: 3064
import math
d, g = map(int, input().split())
p = [0] * d
c = [0] * d
 
for i in range(d):
    p[i], c[i] = map(int, input().split())

min_cost = 10**9
for i in range(2**d):
    count = 0
    score = 0
    use_list = []
    for bit in range(d):
        if i & 2 ** bit > 0:
            use_list.append(bit + 1)
            count += p[bit]
            score += (bit + 1) * 100 * p[bit] + c[bit]
    if score < g:
        p_i = max(set(range(1, d+1)) - set(use_list))
        p_count = math.ceil((g - score) / (p_i * 100))
        if p_count <= p[p_i - 1]:
            count += p_count
            score += p_count * (p_i * 100)
    if score >= g:
        min_cost = min(min_cost, count)
print(min_cost)

Measured memory_bytes: 42972
use std::io::*;
use std::str::FromStr;

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

#[allow(dead_code)]
struct UnionFind {
    parent: Vec<i32>,
}

#[allow(dead_code)]
impl UnionFind {
    fn new(n: usize) -> UnionFind {
        UnionFind {
            parent: vec![-1; n],
        }
    }
    fn root(&mut self, x: usize) -> usize {
        let p = self.parent[x];
        return if p < 0 {
            x
        } else {
            self.parent[x] = self.root(p as usize) as i32;
            self.parent[x] as usize
        };
    }
    fn union_set(&mut self, x: usize, y: usize) -> bool {
        let mut x = self.root(x);
        let mut y = self.root(y);
        if x == y {
            return false;
        }
        if self.parent[y] < self.parent[x] {
            std::mem::swap(&mut x, &mut y);
        }
        self.parent[x] += self.parent[y];
        self.parent[y] = x as i32;
        true
    }
    fn find_set(&mut self, x: usize, y: usize) -> bool {
        self.root(x) == self.root(y)
    }
    fn size(&mut self, x: usize) -> usize {
        let r = self.root(x);
        -self.parent[r] as usize
    }
}

#[test]
fn union_find() {
    let mut ufind = UnionFind::new(10);
    assert!(ufind.root(0) == 0);
    assert!(ufind.size(3) == 1);
    assert!(ufind.union_set(1, 2));
    assert!(!ufind.union_set(1, 2));
    ufind.union_set(2, 3);
    let r = ufind.root(3);
    assert!(r == 1 || r == 2 || r == 3);
    assert!(ufind.size(3) == 3);
}

fn main() {
    let n = read::<usize>();
    let mut points = vec![(0, 0, 0); n];
    for i in 0..n {
        points[i].0 = read::<i64>();
        points[i].1 = read::<i64>();
        points[i].2 = i;
    }
    let mut edges = vec![];
    for _ in 0..2 {
        points.sort();
        for i in 0..n - 1 {
            let d = (points[i + 1].0 - points[i].0).abs();
            let from = points[i].2;
            let to = points[i + 1].2;
            edges.push((d, from, to));
        }
        for i in 0..n {
            let t = points[i].0;
            points[i].0 = points[i].1;
            points[i].1 = t;
        }
    }
    edges.sort();
    let mut ans = 0;
    let mut ufind = UnionFind::new(n);
    for &(cost, from, to) in edges.iter() {
        if ufind.union_set(from, to) {
            ans += cost;
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 17628
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

//conversion
//------------------------------------------
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();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1000000007;

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

//myfuncs
//素数判定
template<class T> inline T isPrime(T x) {
	bool ret = true;
	if (x < 2) {
		ret = false;
	}
	for (LL i = 2; i <= sqrt(x); i++) {
		if (x%i == 0) {
			ret = false;
		}
	}
	return ret;
}

//Union Find
struct UnionFind {
	vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

	UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
		for(int i = 0; i < N; i++) par[i] = i;
	}

	int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
		if (par[x] == x) return x;
		return par[x] = root(par[x]);
	}

	void unite(int x, int y) { // xとyの木を併合
		int rx = root(x); //xの根をrx
		int ry = root(y); //yの根をry
		if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
		par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
	}

	bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
		int rx = root(x);
		int ry = root(y);
		return rx == ry;
	}
};

int main(int argc, char const* argv[])
{
	int n,m;
	cin >> n >> m;

	UnionFind tree(n);

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

	for (int i = 0; i < m; i++) {
		int x,y;
		cin >> x >> y;
		tree.unite(x-1,y-1);
	}

	int cnt = 0;
	for (int i = 0; i < n; i++) {
		if (tree.same(i, p[i]-1)) {
			cnt++;
		}
	}

	cout << cnt << endl;
	return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define Yes cout<<"Yes"<<endl 
#define No cout<<"No"<<endl
#define yes cout<<"yes"<<endl 
#define no cout<<"no"<<endl
#define vec(a,y,x)  vector<vector<char>> a (y,vector<char>(x))
const double PI=3.14159265358979323846;
const in MOD = 1000000007;
const in INF=1e18+7;
const int inf=1e9+7;
const vector<int> dx={1,0,-1,0};
const vector<int> dy={0,1,0,-1};

int main(){
  int h,w,k;
  cin>>h>>w>>k;
  vector<vector<char>> c(h,vector<char>(w));
  
  rep(i,h){
    rep(j,w){
      cin>>c.at(i).at(j);
    }
  }
  int ans=0;
  
  for (int tmp1 = 0; tmp1 < (1 << h); tmp1++) {
  bitset<6> s(tmp1);
    for (int tmp2 = 0; tmp2 < (1 << w); tmp2++) {
    bitset<6> t(tmp2);
      //cout<<s<<" "<<t<<" ";
      int num=0;
      rep(i,h){
        rep(j,w){
          if(s.test(i)||t.test(j)) continue;
          if(c.at(i).at(j)=='#') num++;
        }
      }
      //cout<<""<<num<<"  ";
      if(num==k) ans++;
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
#include<math.h>
#define ll long long
#define fi first
#define se second
#define ld long double
#define mod 1000000007
using namespace std;
int main()
{
     ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
ll i,j,n;
cin>>n;
vector<ll>v(n),v1(n);
for(i=0;i<n;i++)
    cin>>v[i];
v1[0]=0;
v1[1]=fabs(v[0]-v[1]);
for(i=2;i<n;i++)
{
    v1[i]=min(v1[i-2]+fabs(v[i]-v[i-2]),v1[i-1]+fabs(v[i]-v[i-1]));
}
cout<<v1[n-1];
}


Measured memory_bytes: 1792
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
//#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    //freopen("input.txt", "r", stdin);
    int x;
    cin >> x;
    cout << !x;
    return 0;
}

Measured memory_bytes: 3684
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
const long double PI = (acos(-1));
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
int ctoi(char c)
{
    switch (c)
    {
    case '0':
        return 0;
    case '1':
        return 1;
    case '2':
        return 2;
    case '3':
        return 3;
    case '4':
        return 4;
    case '5':
        return 5;
    case '6':
        return 6;
    case '7':
        return 7;
    case '8':
        return 8;
    case '9':
        return 9;
    default:
        return 0;
    }
}
int main()
{
    int n;
    cin >> n;
    vector<int> vec(n);
    rep(i, n)
    {
        cin >> vec[i];
    }
    int a = vec[0];
    int sum = 1;
    for (int i = 0;; i++)
    {
        if (a == 2)
        {
            cout << sum << endl;
            return 0;
        }
        a = vec[a - 1];
        sum++;

        if (sum > n)
        {
            cout << -1 << endl;
            return 0;
        }
    }
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,i,j,a[200005];
	cin>>n;
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	sort(a,a+n);
	int num=0;
	for(i=1;i<n;i++){
		if(a[i]==a[i-1])num=1;
	}
	if(num==1)printf("NO");
	else printf("YES");
}

Measured memory_bytes: 1024
#include<stdio.h>
#include<iostream>
using namespace std;
int main (){
    int n;
    char c;
    cin >> n;
    for(int i=0; i<n; i++){
        cin >> c;
        if( c == 'Y' ) {
            cout << "Four" << endl;
            return 0;
        }
    }
    cout << "Three" << endl;
    return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

class Program
{
    struct Ratio
    {
        public readonly long T;
        public readonly long A;
        public Ratio(params long[] args)
        {
            T = args[0];
            A = args[1];
        }
    }
    static private long Solve(Ratio[] ratios)
    {
        int N = ratios.Length;
        var ratio1 = ratios[0];
        for (int i = 1; i < N; ++i)
        {
            long k = Math.Max((ratio1.T + ratios[i].T - 1) / (ratios[i].T),
                              (ratio1.A + ratios[i].A - 1) / (ratios[i].A));
            ratio1 = new Ratio(ratios[i].T * k, ratios[i].A * k);
        }
        return ratio1.T + ratio1.A;
    }
    static void Main(string[] args)
    {
        int N = int.Parse(Console.ReadLine());
        var ratios = new Ratio[N];
        for (int i = 0; i < N; ++i)
        {
            ratios[i] = new Ratio(Array.ConvertAll(Console.ReadLine().Split(), long.Parse));
        }
        Console.WriteLine(Solve(ratios));
    }
}


Measured memory_bytes: 3032
#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
#define mp make_pair
#define pb push_back
signed main(){
  int N,M,R; cin>>N>>M>>R;
  vi F(R);
  rep(i,0,R) cin>>F[i];
  vector<vector<pii>> D(N);
  rep(i,0,M){
    int A,B,C; cin>>A>>B>>C;
    D[A-1].pb(mp(B-1,C));
    D[B-1].pb(mp(A-1,C));
  }
  vii E(N,vi(N,MOD));
  rep(i,0,N){
    queue<pii> Q;
    Q.push(mp(i,0));
    E[i][i]=0;
    while(Q.size()>0){
      int X=Q.front().first,Y=Q.front().second;
      Q.pop();
      rep(j,0,D[X].size()){
        if(E[i][D[X][j].first]>Y+D[X][j].second){
          Q.push(mp(D[X][j].first,Y+D[X][j].second));
          E[i][D[X][j].first]=Y+D[X][j].second;
        }
      }
    }
  }
  int ans=MOD;
  sort(ALL(F));
  do{
    int memo;
    int sum=0;
    bool flag=0;
    for(auto p:F){
      if(flag){
        sum+=E[memo][p-1];
      }
      flag=1;
      memo=p-1;
    }
    ans=min(ans,sum);
  }while(next_permutation(ALL(F)));
  cout<<ans<<endl;
  }


Measured memory_bytes: 1408
#
# Written by NoKnowledgeGG @YlePhan
# ('ω')
#
#import math
#mod = 10**9+7
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
  
def main():
  MATH = []
  for i in range(1,10):
    for j in range(1,10):
      MATH.append(i*j)
  n = int(input())
  if n in MATH:
    print('Yes')
  else:
    print('No')
if __name__ == '__main__':
  main()

Measured memory_bytes: 2940
#include <stdio.h>

int	main(void)
{
	int	A, B,C;

	scanf("%d %d %d", &A, &B, &C);
	if (A + B + C != 17)
	{
		printf("NO");
		return (0);
	}
	if ((A == 5 && B == 5 && C == 7) || (A == 7 && B == 5 && C == 5) || (A == 5 && B == 7 && C == 5))
		printf("YES");
	else
		printf("NO");

	return (0);
}


Measured memory_bytes: 128
#include<iostream>
#include<string>
#include<algorithm>

using namespace std;

int main()
{
    string s, s1, s2;
    cin>>s;
    s1 = s;
    s2 = s;
    int ans1=0, ans2=0;
    s1[0] = '1';
    s2[0] = '0';
    if(s1[0] != s[0])
        ans1++;
    if(s2[0] != s[0])
        ans2++;
    for(int i=0;i<s1.size();i++)
    {
        if(i+1 != s1.size() && s1[i+1] == s1[i])
        {
            ans1++;
            if(s1[i] == '1')
                s1[i+1] = '0';
            else
            {
                s1[i+1] = '1';
            }
        }
    }
    for(int i=0;i<s2.size();i++)
    {
        if(i+1 != s2.size() && s2[i+1] == s2[i])
        {
            ans2++;
            if(s2[i] == '1')
                s2[i+1] = '0';
            else
            {
                s2[i+1] = '1';
            }   
        }
    }

    cout<<min(ans1,ans2)<<endl;
}

Measured memory_bytes: 512
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
using namespace std;

const int MOD = 1000000007;

int main()
{
    int n, m;
    cin >> n >> m;
    if(abs(n - m) > 1){
        cout << 0 << endl;
        return 0;
    }

    long long ans = 1;
    for(int i=1; i<=n; ++i){
        ans *= i;
        ans %= MOD;
    }
    for(int i=1; i<=m; ++i){
        ans *= i;
        ans %= MOD;
    }
    if(n == m){
        ans *= 2;
        ans %= MOD;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
# A - Colorful Slimes 2

N = int(input())
a = list(map(int,input().split()))
ans = 0
tmp = 1

for i in range(1,N):
    if a[i-1]==a[i]:
        tmp += 1
    else:
        tmp = 1
    ans += int(tmp%2==0)

print(ans)

Measured memory_bytes: 3060
#include<iostream>
#include<iomanip>
#include<cstring>
#include<cmath>
#include<cstdio>
#include<queue>
#include<algorithm>
using namespace std;
const int mod=1e9+7;
int read()
{
	char c=getchar();
	int res=0,bj=1;
	while(c<'0'||c>'9'){if(c=='-') bj=-1;c=getchar();}
	while(c>='0'&&c<='9') res=(res<<1)+(res<<3)+(c^48),c=getchar();
	return res*bj;
}
int n,dp[605][305][605],a[605],tot,num,b[605],c[605],nums=0;
bool vis[605],vst[605];
long long fir[605];
int main()
{
	n=read();
	for(int i=1;i<=2*n;i++) a[i]=read();
	fir[0]=1;
	for(int i=1;i<=2*n;i++) fir[i]=fir[i-1]*i%mod;
	for(int i=1;i<=2*n;i+=2)
	{
		if(a[i]!=-1&&a[i+1]!=-1){vst[a[i]]=vst[a[i+1]]=1;continue;}
		b[++tot]=a[i],b[++tot]=a[i+1];
		if(a[i]==-1&&a[i+1]==-1) nums++;
	}
	for(int i=1;i<=2*n;i++)
	{
		if(vst[i]) continue;
		c[++num]=i;
	}
	for(int i=1;i<=tot;i++) if(b[i]!=-1) b[i]=lower_bound(c+1,c+num+1,b[i])-c;
	for(int i=1;i<=tot;i++) if(b[i]!=-1) vis[b[i]]=1;
	dp[tot+1][0][0]=1;
	for(int i=tot+1;i>1;i--)
	for(int j=0;j<=tot/2;j++)
	for(int k=0;k+j<=tot;k++)
	if(dp[i][j][k])
	{
		if(vis[i-1])
		{
			if(j) dp[i-1][j-1][k]=(dp[i-1][j-1][k]+dp[i][j][k])%mod;
			dp[i-1][j][k+1]=(dp[i-1][j][k+1]+dp[i][j][k])%mod;
		}
		else
		{
			if(j) dp[i-1][j-1][k]=(dp[i-1][j-1][k]+dp[i][j][k])%mod;
			if(k) dp[i-1][j][k-1]=(dp[i-1][j][k-1]+1ll*dp[i][j][k]*k%mod)%mod;
			dp[i-1][j+1][k]=(dp[i-1][j+1][k]+dp[i][j][k])%mod;
		}
	}
	long long ans=dp[1][0][0];
	printf("%lld\n",ans*fir[nums]%mod);
}

Measured memory_bytes: 324728
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i, n) for(int i = 0; i < n; i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define fi first
#define se second
#define pb push_back
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF = (1<<30) - 1;
const ll LINF = (1LL<<60) - 1;
const ll mod = 1000000007;

void solve() {
    int k;
    cin >> k;
    ll ans = 0;
    for(int i = 1; i <= k ; i++) {
        for(int j = 1; j <= k; j++) {
            for(int l = 1; l <= k; l++) {
                ans += __gcd(i, __gcd(j, l));
            }
        }
    }
    cout << ans << endl;
    return;
}

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


Measured memory_bytes: 3560
#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, M;
    cin >> N >> M;

    map<int, int> roads;
    int a, b;
    repeat (i, M) {
        cin >> a >> b;
        roads[a] += 1;
        roads[b] += 1;
    }
    for (int i = 1; i <= N; ++i) {
        cout << roads[i] << endl;
    }
    return 0;
}


Measured memory_bytes: 512
#include<stdio.h>
#include<string.h>
int main(){
  char s[200001];
  scanf("%s",s);
  int a=0,b=strlen(s)-1;
  while(s[a]!='A'){a++;}
  while(s[b]!='Z'){b--;}
  printf("%d",b-a+1);
  return 0;}

Measured memory_bytes: 384
from collections import defaultdict

def prime_factrize(n):
    b = defaultdict(int)
    while n % 2 == 0:
        b[2] += 1
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            b[f] += 1
            n //= f
        else:
            f += 2
    if n != 1:
        b[n] += 1
    return b

n = int(input())
d = prime_factrize(n)
ans = 0
for x in d.values():
    y = 0
    for k in range(1, x + 1):
        y += k
        if y + k >= x:
            break
    ans += k
print(ans)


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

public class Pow
{
    public int pfrom { get; set; }
    public int pto { get; set; }
    public int pid { get; set; }
}

public class hello
{
    public static void Main()
    {
        var pows = new List<Pow>();
        string[] line = Console.ReadLine().Trim().Split(' ');
        var n = int.Parse(line[0]);
        var m = int.Parse(line[1]);
        for (int i = 0; i < m; i++)
        {
            string[] line2 = Console.ReadLine().Trim().Split(' ');
            pows.Add(new Pow { pid = i + 1, pfrom = int.Parse(line2[0]), pto = int.Parse(line2[1]) });
        }
        var ans = GetProf(pows, n);
        if (ans == -1) Console.WriteLine("Impossible");
        else Console.WriteLine(ans);
    }
    public static int GetProf(List<Pow> p, int n)
    {
        var a = 0;
        var count = 0;
        var pid = 0;
        while (true)
        {
            var t1 = p.Where(x => x.pfrom <= a+1).OrderByDescending(x => x.pto).ThenByDescending(x => x.pid);
            if (t1.Count() == 0) return -1;
            else
            {
                var pp = t1.First();
                a = pp.pto;
                if (a >= n) return count += 1;
                if (pp.pid == pid) return -1;
                pid = pp.pid;
                count++;
            }
        }
    }
}

Measured memory_bytes: 10372
#include<stdio.h>

void trace(int A[], int N){
  int i;

  for(i = 0 ; i < N ; i++){
    if(i > 0) printf(" ");
    printf("%d", A[i]);
  }
  printf("\n");
}

void insertionSort(int A[], int N){
  int i,j,key;

  for(i = 1 ; i < N ; i++){
    key = A[i];
    j = i - 1;

    while(j >= 0 && A[j] > key){
      A[j+1] = A[j];
      j--;
    }

    A[j+1] = key;
    trace(A,N);
  }
}


int main(){
  int i,j,N;
  int A[100];

  scanf("%d",&N);

  for(i = 0 ; i < N ; i++){
    scanf("%d",&A[i]);
  }

  trace(A,N);
  insertionSort(A,N);

  return 0;
}


Measured memory_bytes: 2140
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define per(i, n) for (int i = (int)(n-1); i >= 0; i--)
#define sz(x) int(x.size())
#define all(x) (x).begin(), (x).end()
#define INF 2e9
typedef long long ll;
typedef pair<int, int> P;

int main() {
    int n; cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];

    vector<int> ans(n);
    int cnt = 0;
    per(i, n) {
        int tmp = 0;
        int k = n/(i+1) - 1;
        rep(j, k) {
            tmp += ans[i+(i+1)*(j+1)];
        }
        tmp %= 2;
        if (tmp == a[i]) ans[i] = 0;
        else {
            ans[i] = 1;
            cnt++;
        }
    }
    cout << cnt << endl;
    rep(i, n) {
        if (ans[i] == 1) cout << i+1 << endl;
    }

}

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

int main(){
	
	int n;
	cin>>n;
	int mny=100000;
	
	for(int i=0;i<n;i++){
		mny*=1.05;
		mny+=999;
		mny/=1000;
		mny*=1000;
	}
	
	cout<<mny<<endl;
	
	return 0;
}


Measured memory_bytes: 1164
// ███▓▓▓▓▓▓▓▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓▓▓╬╬╬╬╬╬▓█
// ███▓███████▓▓╬╬╬╬╬╬╬╬╬╬╬╬▓███▓▓▓▓█▓╬╬╬▓█
// ███████▓█████▓▓╬╬╬╬╬╬╬╬▓███▓╬╬╬╬╬╬╬▓╬╬▓█
// ████▓▓▓▓╬╬▓█████╬╬╬╬╬╬███▓╬╬╬╬╬╬╬╬╬╬╬╬╬█
// ███▓▓▓▓╬╬╬╬╬╬▓██╬╬╬╬╬╬▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓█
// ████▓▓▓╬╬╬╬╬╬╬▓█▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓█
// ███▓█▓███████▓▓███▓╬╬╬╬╬╬▓███████▓╬╬╬╬▓█
// ████████████████▓█▓╬╬╬╬╬▓▓▓▓▓▓▓▓╬╬╬╬╬╬╬█
// ███▓▓▓▓▓▓▓╬╬▓▓▓▓▓█▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓█
// ████▓▓▓╬╬╬╬▓▓▓▓▓▓█▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓█
// ███▓█▓▓▓▓▓▓▓▓▓▓▓▓▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓█
// █████▓▓▓▓▓▓▓▓█▓▓▓█▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓█
// █████▓▓▓▓▓▓▓██▓▓▓█▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██
// █████▓▓▓▓▓████▓▓▓█▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██
// ████▓█▓▓▓▓██▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██
// ████▓▓███▓▓▓▓▓▓▓██▓╬╬╬╬╬╬╬╬╬╬╬╬█▓╬▓╬╬▓██
// █████▓███▓▓▓▓▓▓▓▓████▓▓╬╬╬╬╬╬╬█▓╬╬╬╬╬▓██
// █████▓▓█▓███▓▓▓████╬▓█▓▓╬╬╬▓▓█▓╬╬╬╬╬╬███
// ██████▓██▓███████▓╬╬╬▓▓╬▓▓██▓╬╬╬╬╬╬╬▓███
// ███████▓██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓╬╬╬╬╬╬╬╬╬╬╬████
// ███████▓▓██▓▓▓▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓████
// ████████▓▓▓█████▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓█████
// █████████▓▓▓█▓▓▓▓▓███▓╬╬╬╬╬╬╬╬╬╬╬▓██████
// ██████████▓▓▓█▓▓▓╬▓██╬╬╬╬╬╬╬╬╬╬╬▓███████
// ███████████▓▓█▓▓▓▓███▓╬╬╬╬╬╬╬╬╬▓████████
// ██████████████▓▓▓███▓▓╬╬╬╬╬╬╬╬██████████
// ███████████████▓▓▓██▓▓╬╬╬╬╬╬▓███████████
//#include "grader.h"
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <cmath>
#include <bitset>
#include <cassert>
#include <queue>
#include <deque>
#include <cassert>
#define x first
#define y second
#define pb push_back
#define mp make_pair
#define read(FILENAME) assert(freopen((FILENAME + ".in").c_str(), "r", stdin))
#define write(FILENAME) assert(freopen((FILENAME + ".out").c_str(), "w", stdout))
#define files(FILENAME) read(FILENAME), write(FILENAME)
using namespace std;
template <typename A, typename B> void chkmin(A &x, B y) {if (x > y) x = y;}
template <typename A, typename B> void chkmax(A &x, B y) {if (x < y) x = y;}
     
typedef pair <int, int> point;
     
const string FILENAME = "input";
const int MAXN = 4e5, p = 1e9 + 7;

long long n, A, B;
long long L, R;

int main() {
    ios::sync_with_stdio(0);
    //read(FILENAME);
    cin >> n >> A >> B;
    if (A > B) {
        cout << 0 << endl;
        return 0;
    }
    if (n == 1 || A == B) {
        cout << (A == B) << endl;
        return 0;
    }
    long long L = A + B + A * (n - 2);
    long long R = A + B + B * (n - 2);
    cout << R - L + 1 << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
  int i, j, k;
  for(i = 1; i <= 9; i++){
    for(j = 1; j <= 9; j++){
      k = i * j;
      printf("%dx%d=%d\n", i, j, k);
	}
  }
  return 0;
}

Measured memory_bytes: 524