akhauriyash/Code-Regression huggingface dataset:
#pragma region cp-helper
#include <bits/stdc++.h>
using namespace std;
#define AC ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define int long long
#define ll long long
#define ull unsigned long long
#define ii pair<int, int>
#define lll pair<ll, ll>
#define vi vector<int>
#define vvi vector<vi>
#define vl vector<ll>
#define vll vector<lll>
#define vvl vector<vl>
#define vii vector<ii>
#define all(a) a.begin(), a.end()
#define qsort(a) sort(all(a))
#define qsortd(a) sort(all(a), greater<>())
#define qsortf(a, f) sort(all(a), f)
#define pb(n) push_back(n)
#define eb(n) emplace_back(n)
#define pp(a, b) emplace_back(a, b)
#define umap unordered_map
#define uset unordered_set
#define nl '\n'
#define fileio(in, out) freopen(in, "r", stdin); freopen(out, "w", stdout)
#define qmod %mod
#define pls signed
#define give main()
const int mod = 1000000007;

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

#pragma endregion

const int N = 200005;

int n, arr[N], occ[1000005], ans;

pls give {
    AC;
    cin >> n;
    for (int i=0; i<n; i++) {
        cin >> arr[i];
        occ[arr[i]]++;
    }
    for (int i=0; i<n; i++) {
        if (occ[arr[i]] > 1) continue;
        if (arr[i] != 1 and occ[1]) continue;
        bool flag = true;
        for (int j=2; j*j <= arr[i]; j++) {
            if (arr[i] % j == 0) {
                if (occ[j]) {
                    flag = false;
                    break;
                }
                if (occ[arr[i]/j]) {
                    flag = false;
                    break;
                }
            }
        }
        if (flag) ans++;
    }
    cout << ans << nl;
}

Measured memory_bytes: 12848
#include "bits/stdc++.h"

#define REP(i,n) for(ll i=0;i<ll(n);++i)
#define RREP(i,n) for(ll i=ll(n)-1;i>=0;--i)
#define FOR(i,m,n) for(ll i=m;i<ll(n);++i)
#define RFOR(i,m,n) for(ll i=ll(n)-1;i>=ll(m);--i)
#define ALL(v) (v).begin(),(v).end()
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());
#define INF 1000000001ll
#define MOD 1000000007ll
#define EPS 1e-9

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


using namespace std;

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

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

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll k, a, b;

	cin >> k >> a >> b;
	ll ans = k + 1;
	if (a < b&&k >= a) {
		k -= a - 1;
		chmax(ans, a + (k / 2)*(b - a) + (k % 2));
	}
	cout << ans << endl;

}

Measured memory_bytes: 256
x = gets.chomp.to_i
if x == 1
    puts "0 -1"
    exit
end
a = 1
multiplier = [-1, 1]
b = 1

while !multiplier.include?(a ** 5 - x) 
    a += 1
    tmp = a**5
    multiplier.push(tmp)
    multiplier.unshift(-1*tmp)
end

loop do
    if b ** 5 == a ** 5 - x
        break
    end
    if (-1 * b) ** 5 == a ** 5 - x
        b *= -1
        break
    end
    b += 1
end

puts [a, b].join(" ")

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

#ifdef LOCAL
#include "debug.h"
#else
#define DEBUG(...)
#endif

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  for (auto&& e : a) cin >> e;
  sort(begin(a), end(a));
  cout << accumulate(begin(a), begin(a) + k, 0) << '\n';
}


Measured memory_bytes: 3644
#include <stdlib.h> 
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <math.h>

using namespace std; 

int main()
{
	int n;
	int counterAC = 0, counterWA = 0, counterTLE = 0, counterRE = 0;
	cin>>n;
	
	string s[n];
	
	for(int i = 0 ; i < n ; i++)
	{
		cin>>s[i];
		if(s[i] == "AC") counterAC++;
		if(s[i] == "WA") counterWA++;
		if(s[i] == "TLE") counterTLE++;
		if(s[i] == "RE") counterRE++;
	}		
	
	cout<<"AC x "<<counterAC<<endl;
	cout<<"WA x "<<counterWA<<endl;
	cout<<"TLE x "<<counterTLE<<endl;
	cout<<"RE x "<<counterRE<<endl;
	
	return 0;
}


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

using ll=long long;
const ll z=0;

int main() {
  ll D,N;
  cin >> D >> N;
  ll k;
  if(N!=100)
    k=N*pow(100,D);
  else
    k=101*pow(100,D);
    cout << k << endl;
}

Measured memory_bytes: 256
#include <queue>
#include <vector>
#include <iostream>
using namespace std;
int H, W, c[109][109];
int main() {
	cin >> W >> H;
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			cin >> c[i + 1][j + 1];
		}
	}
	H += 2, W += 2;
	vector<vector<int> > G(H * W);
	for (int i = 0; i < H - 1; i++) {
		for (int j = 0; j < W; j++) {
			int v1 = i * W + j, v2 = v1 + W;
			G[v1].push_back(v2);
			G[v2].push_back(v1);
		}
		for (int j = 0; j < W - 1; j++) {
			int v1 = i * W + j + (i & 1 ? 0 : 1), v2 = v1 + W + (i & 1 ? 1 : -1);
			G[v1].push_back(v2);
			G[v2].push_back(v1);
		}
	}
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W - 1; j++) {
			int v1 = i * W + j, v2 = v1 + 1;
			G[v1].push_back(v2);
			G[v2].push_back(v1);
		}
	}
	vector<bool> vis(H * W, false); vis[0] = true;
	queue<int> que; que.push(0);
	while (!que.empty()) {
		int u = que.front(); que.pop();
		for (int i : G[u]) {
			if (!vis[i] && c[i / W][i % W] == 0) {
				vis[i] = true;
				que.push(i);
			}
		}
	}
	int ret = 0;
	for (int i = 0; i < H * W; i++) {
		for (int j : G[i]) {
			if (vis[i] && !vis[j]) ret++;
		}
	}
	cout << ret << endl;
	return 0;
}

Measured memory_bytes: 3704
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<queue>
#include<cmath>
#include<map>
#include<set>
using namespace std;
const int INF = 1 << 29;
const double EPS = 1e-9;

typedef long long ll;

#define SORT(c) sort((c).begin(),(c).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)


int N;
long X[100001];
long A,B;
int main(int argc, char * argv[])
{
    ios::sync_with_stdio(false);
    cin >> N >> A >> B;
    rep(i,N) {
        cin >> X[i];
    }

    long long ret = 0;
    for (int i = 1; i < N; i++) {
        ret += min(A*(X[i] - X[i-1]), B);
    }
    cout << ret << endl;

    return 0;
}




Measured memory_bytes: 1024
#include <stdio.h>
#include <string.h>

void deleteFirst(int**, int*);
void deleteLast(int**, int*);
void insertOne(int**, int**, int, int*);
void deleteOne(int**, int**, int, int*);

int main(void){
    int xs[2000002] = {};
    
    int* fp = &xs[2000000];
    int* lp = fp;
    int len = 0;
    int n;
    char str[20];
    fgets(str, sizeof(str), stdin);
    sscanf(str, "%d", &n);
    for(int i=0; i < n; ++i){
        fgets(str, sizeof(str), stdin);
        if(str[6] == 'F'){
            deleteFirst(&fp, &len);
        }else if(str[6] == 'L'){
            deleteLast(&lp, &len);
        }else{
            char *tp;
            int m;
            tp = strtok(str, " " );
            tp = strtok(NULL," ");
            sscanf(tp, "%d", &m);
            if(str[0] == 'i'){
                insertOne(&fp, &lp, m, &len);
            }else{
                deleteOne(&fp, &lp, m, &len);
            }
        }
        
        if(len == 0){
            fp = &xs[2000000];
            lp = fp;
        }
    }
    
    for(int i = 0; i < lp - fp; ++i){
        if(*(fp + i) != -1){
            printf("%d ", *(fp + i));
        }
    }
    printf("%d\n", *lp);
}

void deleteFirst(int** fp, int *len){
    **fp = -1;
    --*len;
    while(**fp == -1) ++*fp;
}

void deleteLast(int** lp, int* len){
    **lp = -1;
    --*len;
    while(**lp == -1) --*lp;
}

void insertOne(int** fp, int** lp, int m, int* len){
    if(*len == 0){
        **fp = m;
    }else{
        --*fp;
        **fp = m;
    }
    ++*len;
}

void deleteOne(int** fp, int** lp, int m, int* len){
    for(int j = 0; j <= *lp - *fp; ++j){
        if(*(*fp + j) == m){
            *(*fp + j) = -1;
            --*len;
            if(j == 0){
                while(**fp == -1) ++*fp;
            }else if((*fp + j) == *lp){
                while(**lp == -1) --*lp;
            }
            break;
        }
    }
}

Measured memory_bytes: 10548
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod
mod = 10**9+7 #出力の制限
N = 10**6
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )
    
X, Y = list(map(int, input().split()))
u = [1, 2]
r = [2, 1]
flag = True
for i in range(Y//2+1):
    if i*1+2*(Y-i*2)==X:
        flag = False
        N = i+Y-i*2
        print(cmb(N, i, 10**9+7))
        
if flag:
    print(0)

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

#define pb push_back
#define F first
#define S second
#define fo(i,a,b)  for(int i = a; i < b; i++)

using ll = long long;
using ld = long double;
using ul = unsigned long long;
using ii = pair<int, int>;
#define Mosta     ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ReadFile            freopen("input.in","r",stdin)
#define WriteFile           freopen("output.txt","w",stdout)
const ll mod7 = 1000000007,mod = 1000000000,OO = 0x3f3f3f3f;
const ld EPS = 1e-7;
double Pi=acos(-1);
const ld rad=Pi/180.0;
ll power(ll x, ll y, ll p)
{
    ll res = 1;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
ll nCr (ll n,ll m)
{
        return(m == 0)?1:n*nCr(n-1,m-1)/m;
}
/*****************************************************/


int main()
{
    int n;
    cin >> n;
    int a[n] , b[n-1];

    for(int i = 1; i <= n-1; ++i)
        cin >> b[i];

    a[1] = b[1];

    for(int i = 2; i <= n; ++i)
        a[i] = min(b[i] , b[i-1]);

    a[n] = b[n-1];
    ll ans = 0;
    for(int i = 1; i <= n; ++i)
        ans += a[i];

    cout << ans << "\n";

    return 0;
}


Measured memory_bytes: 256
//by Himanshu Shukla
#pragma GCC optimize("O2")
#include <bits/stdc++.h>
using namespace std;
#define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define ll long long
#define v32 vector<int>
#define v64 vector<ll>
#define s32 set<int>
#define s64 set<ll>
#define graph vector<s32>
#define p32 pair<int,int>
#define p64 pair<ll,ll>
#define fi first
#define se second
#define ln '\n'
#define debug(x) cout << (#x) << ": " << (x) << ln
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
inline ll add(ll a, ll b, ll m) { return (((a % m + b % m) % m + m) % m); }
inline ll mul(ll a, ll b, ll m) { return (((a % m * b % m) % m + m) % m); }
const double EPS = 1e-6;
const ll MOD = 1e9 + 7;
template <typename T, typename U>
ostream& operator<<(ostream& out, const pair<T,U>& p){
	out << '[' << p.fi << ", " << p.se << ']';
	return out;
}
template <template <typename, typename...> class ContainerType, typename ValueType, typename ...Args>
void print_container(const ContainerType<ValueType, Args...>& c){
	cout << "{ ";
	for(const auto& v : c)
		cout << v << ' ';
	cout << '}' << ln;
}

int main()
{
	FASTIO;
	int m,d;
	cin >> m >> d;
	set<int> ans;
	for(int j = 4;j < m + 1;j++){
		for(int i = 1;i < 10;i++){
			if(j % i == 0){
				int temp1 = 10 * i + (j / i);
				int temp2 = 10 * (j / i) + i;
				if(i >= 2 && i <= 9 && (j / i) >= 2 && (j / i) <= 9){
					if(temp1 <= d)
						ans.insert(temp1);
					if(temp2 <= d)
						ans.insert(temp2);
				}
			}
		}
	}
	cout << ans.size() << ln;
	return 0;
}


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

#define MOD 1000000007
#define ll long long int
#define vi vector<int>
#define vii vector< vector<int> >
#define PI 3.1415926535897932384626433832795
#define INF 9223372036854775807LL


int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	string s,t;
	cin >> s >> t;
	int n = s.length();
	for(int i = 0; i < n; i++) {
		s = s.at(n-1)+s;
		s.pop_back();
		if(s == t) {
			cout << "Yes";
			return 0;
		}
	}
	cout << "No";
	return 0;
}



Measured memory_bytes: 256
#define _USE_MATH_DEFINES

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <unordered_map> 
#include <unordered_set>
#include <functional>

using namespace std;

typedef pair<long long int, long long int> P;
typedef tuple<int, int, int> T;

long long int INF = 1e18;
long long int MOD = 1e9 + 7;

int main(){
	int N;
	cin >> N;
	printf("%.10f\n", (double)(N / 2 + N % 2) / N);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
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: 3092
#include<bits/stdc++.h>

int main() {
	using std::cerr;
	std::ios_base::sync_with_stdio(false), std::cin.tie(nullptr);

	int N; std::cin >> N;
	std::vector<int64_t> A(N); for (auto& a : A) std::cin >> a;
	std::vector<int64_t> B(N); for (auto& b : B) std::cin >> b;

	{
		int z = int(std::max_element(A.begin(), A.end()) - A.begin());
		std::rotate(A.begin(), A.begin()+z, A.end());
		std::rotate(B.begin(), B.begin()+z, B.end());
	}

	A.push_back(A[0]);

	std::vector<int64_t> C(N+1);
	for (int i = 1; i <= N-1; i++) {
		C[i+1] = 2 * (C[i] + B[i]) - C[i-1];
	}

	double ans = 0;
	std::vector<std::pair<int, int64_t>> hull;
	for (int i = 0; i <= N; i++) {
		int64_t v = A[i] - C[i];
		while (hull.size() >= 2 &&
				(hull[hull.size()-1].second - hull[hull.size()-2].second) * (i - hull[hull.size()-2].first)
				<= (v - hull[hull.size()-2].second) * (hull[hull.size()-1].first - hull[hull.size()-2].first)) {
			hull.pop_back();
		}
		hull.emplace_back(i, v);
	}
	for (int z = 1; z < int(hull.size()); z++) {
		auto [i, v0] = hull[z-1];
		auto [j, v1] = hull[z];
		for (int k = i+1; k <= j; k++) {
			ans += double((v0 + C[k]) * (j - k) + (v1 + C[k]) * (k - i)) / (j - i);
		}
	}
	ans /= N;
	std::cout << std::fixed << std::setprecision(20) << ans << '\n';

	return 0;
}


Measured memory_bytes: 14116
#include<iostream>
#include<math.h>
#include<cstdio>
#include<iomanip>
using namespace std;

int main(){

    long double n,k;
    cin >> n >> k;
    long double pro = 0;
    long double value = 0;
    long double cnt = 0;
  	long double tmp = 1;
  	tmp /= n;
    for (int i = 1; i < n+1; i++)
    {
      	if(i >= k){
        	break; 
        }
        value = i;
      	cnt = 0;
        while(value < k){
            value *= 2;
            cnt ++;
        }
        pro +=(tmp) * pow(0.5,cnt);
    }
  
  	if(n >= k){
      pro += (n-k+1) / n;
    }
  	
    cout << fixed << setprecision(12) << pro << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <stack>
#include <deque>
#include <cmath>
#include <map>
using ll = long long;
using namespace std;

int main() {
  int n;
  cin >> n;
  cout << n*(n+1)/2 << endl;
}


Measured memory_bytes: 256
import sys

N,Q=map(int,sys.stdin.readline().rstrip().split())
S=list(sys.stdin.readline().rstrip())
count = [0 for i in range(N)]
phase=0
csum=0
for i,c in enumerate(S):
    if c=='A' and phase==0:
        phase=1
    elif c=='C' and phase==1:
        csum+=1
        phase=0
    elif c=='G' or c=='T':
        phase=0
    count[i]=csum
#print(count)
ans=[]
for i in range(Q):
    l,r=map(int,sys.stdin.readline().rstrip().split())
    ans.append(count[r-1]-count[l-1])
for a in ans:
    print(a)


Measured memory_bytes: 57864
from collections import deque,Counter

N = int(input())
arrA = list(map(int,input().split()))

B = deque()

flg = True
for a in arrA:
    if flg:
        B.append(a)
    else:
        B.appendleft(a)
    flg = not flg
if not flg:
    B.reverse()

print(*B)

Measured memory_bytes: 25412
#include<iostream>

using namespace std;

int main() {
   int n;
   
   cin >> n;
   int a[n];
   for(int i=0;i<n;i++)cin >> a[i];

    int max = a[0];
    int min = a[0];
   for(int i=0;i<n;i++){
       if(a[i] > max)max = a[i];
       if(a[i] < min)min = a[i];
   }
    cout << max - min << endl;
    return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize(2)
#include<bits/stdc++.h>
#define ll long long
#define maxn 1000005
#define inf 1e9
#define pb push_back
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=a;i>=b;i--)
using namespace std;

inline int read()
{
	int x=0,w=1; char c=getchar();
	while(c<'0'||c>'9') {if(c=='-') w=-1; c=getchar();}
	while(c<='9'&&c>='0') {x=(x<<1)+(x<<3)+c-'0'; c=getchar();}
	return w==1?x:-x;
}

char s[maxn];

int main()
{
	scanf("%s",s+1); int len=strlen(s+1),ans=0;
	rep(i,1,len) ans+=(s[i]-'0');
	if(ans%9==0) puts("Yes"); else puts("No");
	return 0;
}

Measured memory_bytes: 3952
/*
    飲んだ魔剤で家が建つ。
    created at: 2020-04-01 22:11:42
                2020-04-01 22:52:01
*/

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

#define all(x) (x).begin(),(x).end()
#define rev(x) greater<(x)>()
#define MOD 1000000007
#define INF 1000000000

typedef long long LL;
typedef long double LD;

bool compare_by_b(pair<int, int> a, pair<int, int> b)
{
    if (a.second != b.second) {
        return a.second < b.second;
    } else {
        return a.first < b.first;
    }
}

LL modpower(LL n, LL m, LL mod) {
    if (m == 0) {
        return 1;
    } else if (m % 2 == 0) {
        LL p = modpower(n, m/2, mod);
        return p*p % mod;
    } else {
        return n*modpower(n, m-1, mod) % mod;
    }
}

LL modinv(LL n, LL mod) {
    return modpower(n, mod-2, mod);
}

LL modcombination(LL n, LL r, LL mod) {
    LL ret = 1;

    for (int i = 0; i < r; i++) {
        ret *= (n-i);
        ret %= mod;
        ret *= modinv(i+1, mod);
        ret % mod;
    }

    return ret % mod;
}

int gcd(int k, int l) {
    if (l > 0) return gcd(l, k%l);
    else return k;
}

ostringstream oss_global;
string s_global = oss_global.str();

int main()
{
    string s;
    cin >> s;
    int n = s.length();

    int a, b, c;
    a = b = c = 0;

    if (s[0] == 'A') a = 1;

    int cnt = 0;
    for (int i = 2; i <= n-2; i++) {
        if (s[i] == 'C') cnt++;
    }
    if (cnt == 1) b = 1;

    if (a && b) {
        int flag = 1;
        for (int i = 1; i < n; i++) {
            char d = s[i];
            if (d == 'A' || d == 'B' || d >= 'D' && d <= 'Z') flag = 0;
        }
        if (flag) c = 1;
    }

    if (c) cout << "AC" << endl;
    else cout << "WA" << endl;

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
#define int long long
#define Okay_Bye return 0
#define fo(i,n) for(auto i=0;i<n;i++)
#define f1(i,n) for(auto i=1;i<=n;i++)
#define pn printf("\n")
#define Maxn 100005
#define ok printf("ok\n")
int n,m;
int a[Maxn],dp[Maxn];

int func(int idx){
    if(idx==(n-1))return 0;
    if(idx>=n)return INT_MAX;
    //ok;
    if(dp[idx]!=-1)return dp[idx];
    //ok;
    int mini = INT_MAX;
    int fu = INT_MAX;
    int index = -1;
    f1(i,min(n,m)){
        if(idx+i<n){
        fu = abs(a[idx]-a[idx+i])+func(idx+i);
        //cout<<idx<<":"<<idx+i<<":"<<fu<<endl;
        mini = min(fu,mini);
        }
    }
    return dp[idx]= mini;
    
}

void solve(){
    cin>>n>>m;
    memset(dp,-1,sizeof dp);
    fo(i,n)cin>>a[i];
    cout<<func(0)<<endl;
}

signed main()
{
	int t=1;
	//cin>>t;
	while(t--)solve();
	Okay_Bye;
}

Measured memory_bytes: 9348
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)
const ll MAX_N=100;
bool flg[MAX_N];
ll N,K;
int main(){
	cin.tie(0);
	cin.sync_with_stdio(false);
	cin>>N>>K;
	REP(i,K){
		ll d;
		cin>>d;
		REP(j,d){
			ll a;
			cin>>a;
			flg[a-1]=true;
		}
	}
	ll ans=0;
	REP(i,N){
		if(!flg[i])ans++;
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 3644
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string>

int main(void) {
	std::string input;

	std::cin >> input;
	int n = input.size();
	int r = n;
	for (int i = 1; i < n; i++) {
		if (input[i - 1] != input[i])
			r = std::min(r, std::max(i, n - i));
	}

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

Measured memory_bytes: 512
n = int(input())
V = [[] for i in range(n+1)]
for i in range(n-1):
    a,b,c = map(int,input().split())
    V[a].append([b,c])
    V[b].append([a,c])
q,k = map(int,input().split())
from collections import deque
dis = [-1]*(n+1)
Q = deque([])
Q.append(k)
dis[k] = 0
while Q:
    r = Q.popleft()
    for A,D in V[r]:
        if dis[A] == -1:
            Q.append(A)
            dis[A] = dis[r] + D
x = [0]*q
for i in range(q):
    x,y = map(int,input().split())
    print(dis[x]+dis[y])

Measured memory_bytes: 51296
#include <stdio.h>
#include <stdlib.h> //EXIT_FAILURE
#include <assert.h>

int main(){
	int ret;
	char c;
	if((ret = scanf("%c",&c))== EOF){
		return EXIT_FAILURE;
	}
	assert(97<= c && c <=121);
	c += 1;
	printf("%c\n",c);
	return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<algorithm>
#include<vector>
#include<numeric>
#include<string>
#include<cmath>
#include<set>
#include<queue>
#include<deque>
#include<bitset>
#include<iomanip>
#include<cctype>
#include<map>
#include<cstring>

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,a,b) for (int (i)=a;(i)<(b);(i)++)
#define all(x) (x).begin(),(x).end()

using namespace std;
using ll = long long int;

const int inf = 1001001000;
const long long int Inf = 1001001001001001000;


void print(vector<vector<int>> a){
	for (int i = 0; i < a.size(); i++)
	{
		for (int j=0;j<a[i].size();j++){
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
}

void print(vector<vector<long long int>> a){
	for (int i=0;i<a.size();i++){
		for (int j=0;j<a[i].size();j++){
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
}

void print(vector<int> a){
    int n = a.size();
    for (int j=0;j<n;j++) {
        if (j != n-1) cout << a[j] << " ";
        else cout << a[j] << endl;
    }
}

void print(set<int> a){
	for (auto x:a)
		cout << x << " ";
	cout << endl;
}



int main() {
	int n;
	cin >> n;
	vector<int> a(n);
	rep(i, n) cin >> a[i];
	int ans = 0;
	rep(i, n - 1)
	{
		rep2(j,i+1,n){
			ans += a[i] * a[j];
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
a = input()
b = input()

if(len(a) > len(b)):
    for i in range(len(b)):
        print(a[i],b[i],sep="",end="")
    print(a[i+1:])
else:
    for i in range(len(a)):
        print(a[i],b[i],sep="",end="")
    print(b[i+1:])



Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
int hoge[100001];
void f(int p) {
	if (p > 100000) return;
	if (hoge[p]) return;
	hoge[p] = 1;
	for (int n = 100; n <= 105; ++ n) f(p+n);
}
int main() {
	f(0);
	int X;
	cin >> X;
	cout << hoge[X] << endl;
}


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

using namespace std;

typedef long long ll;

#define INF (int)1e9+7
#define rep(i,a,b) for(int i=a;i<b;++i)
#define rrep(i,a,b) for(int i=a;i>=b;--i)
#define vi vector<int>
#define vl vector<ll>
#define ld long double
#define vvi vector<vector<int>>
#define vvl vector<vector<long long>>
#define pii pair<int,int>
#define pll pair<long,long>
#define vpii vector<pii>
#define vpll vector<pll>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626433832795
#define fix(f,n) fixed<<setprecision(n)<<f

ll powM(ll a,ll b,ll m )
{ 
  a%=m;
  ll ans=1;
  while(b>0)
  {
    if(b&1)ans=ans*a%m;
    a=a*a%m;
    b>>=1;
  }

return ans;
}






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

 string s;cin>>s;

 string t="";

for(int i=0;i<s.size();i+=2)t+=s[i];

  cout<<t<<"\n";

return 0;

}

Measured memory_bytes: 592
#![allow(unused_imports)]
use std::cmp::*;
use std::collections::*;
use itertools::Itertools;
use num_traits::clamp;
use ordered_float::OrderedFloat;
use proconio::{input, marker::*, fastout};
use superslice::*;

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

    let mut money = vec![0; n+1];
    money[0] = 1000;
    let mut stock = vec![(0, 0); n+1];
    for i in 0..n {
        money[i+1] = max(money[i], stock[i].0 * a[i] + stock[i].1);
        let stock1 = money[i] / a[i];
        let rem1 = money[i] % a[i];
        let stock2 = stock[i].0 + stock[i].1 / a[i];
        let rem2 = stock[i].1 % a[i];
        if stock1 > stock2 {
            stock[i+1].0 = stock1;
            stock[i+1].1 = rem1;
        } else if stock1 < stock2 {
            stock[i+1].0 = stock2;
            stock[i+1].1 = rem2;
        } else {
            stock[i+1].0 = stock1;
            stock[i+1].1 = max(rem1, rem2);
        }
    }
    println!("{}", money[n]);
}


Measured memory_bytes: 2148
local mfl = math.floor

local function comp(a, b)
  return a < b
end

local function lower_bound(ary, x)
  local num = #ary
  if num == 0 then return 1 end
  if not comp(ary[1], x) then return 1 end
  if comp(ary[num], x) then return num + 1 end
  local min, max = 1, num
  while 1 < max - min do
    local mid = mfl((min + max) / 2)
    if comp(ary[mid], x) then
      min = mid
    else
      max = mid
    end
  end
  return max
end

local function upper_bound(ary, x)
  local num = #ary
  if num == 0 then return 1 end
  if comp(x, ary[1]) then return 1 end
  if not comp(x, ary[num]) then return num + 1 end
  local min, max = 1, num
  while 1 < max - min do
    local mid = mfl((min + max) / 2)
    if not comp(x, ary[mid]) then
      min = mid
    else
      max = mid
    end
  end
  return max
end

local s = io.read()
local t = io.read()
local w = {}
for i = 1, 26 do
  w[i] = {}
end
for i = 1, #s do
  local b = s:byte(i) - 96
  table.insert(w[b], i)
end
for i = 1, #t do
  local b = t:byte(i) - 96
  if #w[b] == 0 then print(-1) os.exit() end
end
local loop = 0
local pos = 0
for i = 1, #t do
  local b = t:byte(i) - 96
  local ub = upper_bound(w[b], pos)
  if #w[b] < ub then
    loop = loop + 1
    pos = w[b][1]
  else
    pos = w[b][ub]
  end
end
print(loop * #s + pos)


Measured memory_bytes: 4008
#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;

template<class T> inline void chmax(T& a, T b) { if(b > a) a = b; }

const int EMPTY = 5;

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

int n;
int field[5][5];
int score[6];

int calc() {
	int res = 0;
	vector<vector<int> > cur(5, vector<int>(5));
	for(int i = 0; i < 5; ++i)
		for(int j = 0; j < 5; ++j)
			cur[i][j] = field[i][j];

	for(int bonus = 1;; ++bonus) {
		bool end = true;
		vector<vector<int> > next(cur);

		for(int i = 0; i < 5; ++i)
			for(int j = 1; j <= 3; ++j) if(cur[i][j] != EMPTY)
				if(cur[i][j - 1] == cur[i][j] && cur[i][j + 1] == cur[i][j]) {
					next[i][j - 1] = next[i][j] = next[i][j + 1] = EMPTY;
					end = false;
				}

		for(int i = 1; i <= 3; ++i)
			for(int j = 0; j < 5; ++j) if(cur[i][j] != EMPTY)
				if(cur[i - 1][j] == cur[i][j] && cur[i + 1][j] == cur[i][j]) {
					next[i - 1][j] = next[i][j] = next[i + 1][j] = EMPTY;
					end = false;
				}

		for(int i = 0; i < 5; ++i)
			for(int j = 0; j < 5; ++j)
				if(next[i][j] == EMPTY)
					res += score[cur[i][j]] * bonus;

		for(int i = 1; i < 5; ++i)
			for(int j = 0; j < 5; ++j)
				if(next[i][j] == EMPTY)
					for(int k = i; k >= 1 && next[k - 1][j] != EMPTY; --k)
						swap(next[k][j], next[k - 1][j]);

		if(end)
			return res;

		cur.swap(next);
	}
}

int move(int y, int x, int cnt = 0) {
	if(cnt == n)
		return calc();

	int res = calc();
	for(int i = 0; i < 4; ++i) {
		int nx = x + dx[i], ny = y + dy[i];

		if(nx < 0 || ny < 0 || nx >= 5 || ny >= 5)
			continue;

		swap(field[y][x], field[ny][nx]);
		chmax(res, move(ny, nx, cnt + 1));
		swap(field[y][x], field[ny][nx]);
	}

	return res;
}

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

	for(; cin >> n, n >= 0;) {
		for(int i = 0; i < 5; ++i) {
			for(int j = 0; j < 5; ++j) {
				cin >> field[i][j];
				--field[i][j];
			}
		}

		for(int i = 0; i < 5; ++i)
			cin >> score[i];

		int ans = 0;
		for(int i = 0; i < 5; ++i)
			for(int j = 0; j < 5; ++j)
				chmax(ans, move(i, j));

		cout << ans << endl;
	}

	return EXIT_SUCCESS;
}

Measured memory_bytes: 1220
#Pの時に必要なトラックの数を求める関数
def unit_check(n, k, w_list, P):
    i = 0
    for j in range(k):
        weight = 0
        while weight + w_list[i] <= P:
            weight += w_list[i]
            i += 1
            if i == n:
                return 1
    return 0

n, k = map(int,input().split())
w_list = [0] * n
for i in range(n):
    w_list[i] = int(input())

left = 0
#荷物の最大数x荷物の最大の重さ
right = 100000*10000
while left+1 < right:
    mid = (left+ right)//2
    check = unit_check(n, k, w_list, mid)
    if check == 1:
        right = mid
    else:
        left = mid
print(right)




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

using namespace std;

#define REP(i,m) for(ll i=0; i<m; i++)
#define FOR(i,n,m) for(ll i=n; i<m; i++)
#define INF 1000000007
#define INFL (1LL << 60)
#define MOD 998244353
#define ALL(v) v.begin(),v.end()
#define pb push_back
#define ll long long int
#define P pair<ll, ll>

int main(){
	int n, m, c = 0;
	cin >> n >> m;
	REP(i,m){
		int a;
		cin >> a;
		c += a;
	}
	cout << 1 + (c-1)/(n+1) << endl;
	return 0;
} 



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

int main(){
    int64_t N,A,B;
    cin >> N >> A >> B;
    int64_t ans = 0;
    int64_t syou = 0;
    int64_t amari = 0;
    
    syou = N / (A+B);
    amari = N % (A+B);
    ans = syou * A;
    if ( amari >= A ){
        ans = ans + A;
    } else {
        ans += amari;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define f   first
#define s   second
#define pb          push_back
#define mod         1000000007
#define hell        998244353
#define inf         1000000000000000000LL
using namespace std;
ll n,k,m;
ll dp[200005]; // for sizeof subtrees;
vector<ll> adj[200005];
ll ans[200005];
ll fact[200005];
ll siz[200005];
//double dp[3005][3005];
void dfs3(ll x,ll p=-1)
{   siz[x]=1;
    for(auto y:adj[x])
    {
        if(y==p) continue;
        dfs3(y,x);
        siz[x]+=siz[y];
    }

}
ll power(ll x,ll y)
{
    ll res=1;
    while(y>0)
    {
        if(y%2) res=(x*res)%mod;
        x=(x*x)%mod;
        y/=2;
    }
    return res;
}
ll invmod(ll x)
{return power(x,mod-2);}
void dfs(ll x,ll p=-1)
{   dp[x]=fact[siz[x]-1];
    for(auto y:adj[x])
    {
        if(y==p) continue;
        dfs(y,x);
        dp[x]=(dp[x]*dp[y])%mod;
        dp[x]=(dp[x]*invmod(fact[siz[y]]))%mod;
    }
    //cout<<mul<<" ";
    

}
void dfs2(ll x,ll p=-1)
{   //cout<<prev<<" ";
    /*ll mul=(prev*siz[x])%mod;
    //cout<<mul<<" ";
    mul=(mul*invmod(n-siz[x]))%mod;
    //cout<<mul<<"\n";
    ans[x]=mul;
    for(auto y:adj[x])
        if(y!=p)
        dfs2(y,x,mul);*/
    ans[x]=dp[x];
    for(auto y:adj[x])
        {if(y==p) continue;
            dp[x]=(dp[x]*fact[siz[y]])%mod;
            dp[x]=(dp[x]*invmod(fact[siz[x]-1]))%mod;
            siz[x]-=siz[y];
            dp[x]=(dp[x]*fact[siz[x]-1])%mod;   
            dp[x]=(dp[x]*invmod(dp[y]))%mod;
            
            dp[y]=(dp[y]*invmod(fact[siz[y]-1]))%mod;
            siz[y]+=siz[x];
            dp[y]=(dp[y]*fact[siz[y]-1])%mod;
            dp[y]=(dp[y]*dp[x])%mod;
            dp[y]=(dp[y]*invmod(fact[siz[x]]))%mod;
            
            dfs2(y,x);

            dp[y]=(dp[y]*(fact[siz[x]]))%mod;
            dp[y]=(dp[y]*invmod(dp[x]))%mod;
            dp[y]=(dp[y]*invmod(fact[siz[y]-1]))%mod;
            siz[y]-=siz[x];
            dp[y]=(dp[y]*(fact[siz[y]-1]))%mod;

            dp[x]=(dp[x]*(dp[y]))%mod;
            dp[x]=(dp[x]*invmod(fact[siz[x]-1]))%mod;
            siz[x]+=siz[y];
            dp[x]=(dp[x]*(fact[siz[x]-1]))%mod;
            dp[x]=(dp[x]*invmod(fact[siz[y]]))%mod;

        }
}
void solve()
{   ll W,X,D,Y,A,B,C;
    cin>>n;
    for(int i=0;i<n-1;i++)
    {
        ll x,y;
        cin>>x>>y;
        adj[x].pb(y);
        adj[y].pb(x);
    }
    dfs3(1,-1);
    dfs(1,-1);
    dfs2(1,-1);
    //for(int i=1;i<=n;i++) cout<<siz[i]<<" ";
        //cout<<"\n";
    for(int i=1;i<=n;i++)
       cout<<ans[i]<<"\n";
}

int main()
{
    ll t=1;
    fact[0]=1;
    //cin>>t; 
    for(int i=1;i<200005;i++) fact[i]=(fact[i-1]*i)%mod; 
    while(t--)
        solve();

}

Measured memory_bytes: 20976
#include <bits/stdc++.h>
#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 ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int D;
int C[30];
int S[400][30];
int last[400][30];

unsigned int xor128()
{
  static unsigned int x=123456789,y=362436069,z=521288629,w=88675123;
  unsigned int t;
  t=(x^(x<<11)); x=y; y=z; z=w; 
  return( w=(w^(w>>19))^(t^(t>>8)) );
}

ll score(vector<int>& t)
{
  ll s = 0LL;
  REP(i,t.size()){
    s += S[i][t[i]];
    REP(j,26) last[i+1][j] = last[i][j];
    last[i+1][t[i]] = i+1;
    REP(j,26){
      s -= C[j] * (i+1-last[i+1][j]);
    } 
  }
  return s;
}

ll score_2(vector<int>& t, ll before, int d, int old, int q)
{
  ll s = before;
  s += S[d][q] - S[d][old];
  FOR(i,d,D){
    if(t[i]==old) break;
    s += C[old] * ((i+1) - last[i+1][old]);
    s -= C[old] * ((i+1) - last[d][old]);
  }
  FOR(i,d,D){
    if(i!=d && t[i]==q) break;
    s += C[q] * ((i+1) - last[i+1][q]);
    s -= C[q] * ((i+1) - (d+1));
  }

  return s;
}

vector<int> init(void)
{
  vector<int> t;
  REP(d, D){
    ll max_sc = LLONG_MIN;
    int ind = 0;
    REP(i,26){
      t.push_back(i);
      ll sc = score(t);
      if(max_sc<sc){
        max_sc = sc;
        ind = i;
      }
      t.pop_back();
    }
    t.push_back(ind);
  }
  return t;
}

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> D;
  REP(i,26) cin >> C[i];
  REP(i,D) REP(j,26) cin >> S[i][j];

  auto T = init();
  ll max_score = score(T);
  
  int ti = clock();
  while(clock() - ti < 190 * CLOCKS_PER_SEC / 100){ 
    REP(loop,150){
      int d = xor128() % 365;
      int q = xor128() % 26;
      int old = T[d];
      T[d] = q;
      ll tmp = score_2(T, max_score, d, old, q);
      if(max_score<tmp){
        max_score = tmp;
        FOR(i,d,D){
          if(T[i]==old) break;
          last[i+1][old] = last[d][old];
        }
        FOR(i,d,D){
          if(i!=d && T[i]==q) break;
          last[i+1][q] = (d+1);
        }
      }else{
        T[d] = old;
      }
    }
  }
  REP(i,D) cout << T[i]+1 << '\n';
  return 0;
}


Measured memory_bytes: 3780
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define all(ppp) ppp.begin(),ppp.end()
#define out(ppp) cout<<(ppp)<<endl
#define out1(ppp) cout<<(ppp) 
#define MAX_CHAR 256

#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define REP(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
#define pb push_back
#define lint ll
typedef long double ld;
typedef complex<ld> cd;
ll MOD;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;
typedef vector<vpi> vvpi;

typedef set<pi> spi;

const int INF=INT_MAX;

vector<vector<lint>> matmul(const vector<vector<lint>> &A, const vector<vector<lint>> &B, lint mod=MOD){
    int H = A.size(), W = B[0].size(), K = B.size();
    vector<vector<lint>> C(H, vector<lint>(W));
    REP(i, H) REP(j, W) REP(k, K) (C[i][j] += A[i][k] * B[k][j]) %= mod;
    return C;
}
vector<vector<lint>> matpower(vector<vector<lint>> X, lint n, lint mod=MOD){
    vector<vector<lint>> res(X.size(), vector<lint>(X.size()));
    REP(i, res.size()) res[i][i] = 1;
    while (n)
    {
        if (n & 1) res = matmul(res, X, mod);
        X = matmul(X, X, mod); n >>= 1;
    }
    return res;
}
lint power(lint x, lint n){
    lint ans = 1;
    while (n>0)
    {
        if (n & 1) (ans *= x) %= MOD;
        (x *= x) %= MOD;
       n >>= 1;
    }
   return ans;
}

ll sol(ll len,ll A,ll B,ll amari){
    if(!len){
        return amari;
    }
    ll d=to_string(A).length();
    ll m=1;
    F0R(i,d){
        m*=10;
    }
    ll n_term=min((m-1-A)/B+1,len);
    vector<vector<ll>> trans{{power(10,d),1,0},{0,1,1},{0,0,1}};
    trans=matpower(trans,n_term);
    return sol(len-n_term,A+B*n_term,B,(trans[0][0]*(amari%MOD)%MOD+trans[0][1]*(A%MOD)+trans[0][2]*(B%MOD)%MOD)%MOD);
    
}




void solve(){
    ll l,A,B;
    cin>>l>>A>>B>>MOD;
    ll ret=sol(l,A,B,0);
    out(ret);
}

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

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

ll choose2(ll n) {
  return n*(n-1)/2;
}

int main() {
  int n;
  cin >> n;
  
  vector<int> A(n);
  map<int, int> m;
  rep (i,n) {
    cin >> A.at(i);
    m[A.at(i)] += 1;
  }
  
  ll sum = 0;
  for (auto p : m) {
    auto k = p.first;
    auto v = p.second;
    sum += choose2(v);
  }
  
  rep(i, n) {
    ll ans = sum;
    ans -= choose2(m.at(A.at(i)));
    ans += choose2(m.at(A.at(i))-1);
    cout << ans << endl;
  }
  return 0;
}


Measured memory_bytes: 10112
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdio>

using namespace std;

char s[100005];

int main()
{
    cin >> s;
    int l = strlen(s),p;
    for(register int i = 0; i < l; i++)
    {
        p = l - i - 1;
        if(s[i] == 'b' && s[p] != 'd') {cout << "No" << endl;return 0;}
        if(s[i] == 'd' && s[p] != 'b') {cout << "No" << endl;return 0;}
        if(s[i] == 'p' && s[p] != 'q') {cout << "No" << endl;return 0;}
        if(s[i] == 'q' && s[p] != 'p') {cout << "No" << endl;return 0;}
    }
    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
//mt19937 mrand(random_device{}()); 
const ll mod=1000000007;
//int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head

int main() {
	int a,b;
	scanf("%d%d",&a,&b);
	printf("%d",a*b);
} 

Measured memory_bytes: 3796
#include <stdio.h>
#include <math.h>
int main(void){
    int n;
    long long power=1;
    scanf("%d", &n);
    for(int i=1; i<=n; i++) power=(power*i)%(long long)(pow(10, 9)+7);
    printf("%lld", power);
    return 0;
}

Measured memory_bytes: 1664
// Copyright lzt
#include<stdio.h>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<cmath>
#include<iostream>
#include<queue>
#include<string>
#include<ctime>
using namespace std;
typedef long long ll;
typedef std::pair<int, int> pii;
typedef long double ld;
typedef unsigned long long ull;
typedef std::pair<long long, long long> pll;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define rep(i, j, k)  for (register int i = (int)(j); i <= (int)(k); i++)
#define rrep(i, j, k) for (register int i = (int)(j); i >= (int)(k); i--)
#define Debug(...) fprintf(stderr, __VA_ARGS__)

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

const int maxn = 100100;
int n, m;
vector<int> G[maxn];
int f[maxn], deg[maxn];

void work() {
  n = read(), m = read();
  rep(i, 1, m) {
    int x = read(), y = read();
    G[x].pb(y); deg[y]++;
  }
  queue<int> q;
  rep(i, 1, n) {
    if (!deg[i]) q.push(i);
  }
  int ans = 0;
  while (!q.empty()) {
    int u = q.front(); q.pop(); ans = max(ans, f[u]);
    rep(i, 0, G[u].size() - 1) {
      int v = G[u][i];
      f[v] = max(f[v], f[u] + 1);
      deg[v]--;
      if (!deg[v]) q.push(v);
    }
  }
  printf("%d\n", ans);
}

int main() {
  #ifdef LZT
    freopen("in", "r", stdin);
  #endif

  work();

  #ifdef LZT
    Debug("My Time: %.3lfms\n", (double)clock() / CLOCKS_PER_SEC);
  #endif
}



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


binary_tree = [{"parent": -1, "sibling": -1} for _ in range(N)]
for _ in range(N):
    node_input = input()
    id, left, right = map(int, node_input.split())

    binary_tree[id]["left"] = left
    binary_tree[id]["right"] = right

    if left != -1:
        binary_tree[left]["parent"] = id
    if right != -1:
        binary_tree[right]["parent"] = id


def set_depth(id, depth):
    if id == -1:
        return

    D[id] = depth
    set_depth(binary_tree[id]["left"], depth+1)
    set_depth(binary_tree[id]["right"], depth+1)

def set_height(id):
    h1, h2 = 0, 0
    if binary_tree[id]["left"] != -1:
        h1 = set_height(binary_tree[id]["left"]) + 1
    if binary_tree[id]["right"] != -1:
        h2 = set_height(binary_tree[id]["right"]) + 1
    H[id] = max(h1, h2)
    return H[id]


D = [0 for i in range(N)]
H = [0 for i in range(N)]
for id in range(N):
    if binary_tree[id]["parent"] == -1:
        set_depth(id, 0)
        set_height(id)


def get_sibling(id):
    parent_id = node["parent"]
    if parent_id == -1:
        return -1
    if binary_tree[parent_id]["left"] != id:
        return binary_tree[parent_id]["left"]
    else:
        return binary_tree[parent_id]["right"]

def get_degree(node):
    degree = 0
    if node["left"] != -1:
        degree += 1
    if node["right"] != -1:
        degree += 1
    return degree

def get_type(node, dgree):
    if node["parent"] == -1:
        return "root"
    if degree == 0:
        return "leaf"
    return "internal node"

for id in range(N):
    node = binary_tree[id]
    parent_id = node["parent"]
    sibling_id = get_sibling(id)
    degree = get_degree(node)
    node_type = get_type(node, degree)
    print("node {}: parent = {}, sibling = {}, degree = {}, depth = {}, height = {}, {}".format(id, parent_id, sibling_id, degree, D[id], H[id], node_type))


Measured memory_bytes: 5624
n,h=gets.split.map(&:to_i)
a,b=[],[]
n.times{|i|x=gets.split.map(&:to_i);a<<x[0];b<<x[1]}
i=0
b.sort!
x=a.sort.slice(-1)
b.reject!{|i| i<x}
until b.empty?
  i+=1
  h-=b.pop
  if h<=0
    puts i
    exit
  end
end
puts h%x==0 ? i+h/x : i+h/x+1

Measured memory_bytes: 5256
#include<bits/stdc++.h>
using namespace std;
long long a,b,c,d,e;
string s;
int main(){
    ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
    cin>>s;
    if(s[2]==s[3]&&s[4]==s[5]){
        cout<<"Yes";
    }else{
        cout<<"No";
    }
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.close();
		
		int c = 0;
		for (int i =0; i < s.length();i++) {
			if (s.charAt(i) == '1') {
				c++;
			}	
		}
		System.out.println(c);

	}

}


Measured memory_bytes: 23636
#include<bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define t1 first
#define t2 second
using namespace std;
int main()
{
	long long n;
	cin>>n;
	long long g=0,b,c=0;
	for(long long i=n;i>0;i/=10)
	{
		g++;
		b=i%10;
		c+=i%10;
	}
	if(c==b+9*(g-1))
	cout<<c;
	else
	cout<<9*(g-1)+b-1;
	return 0;
} 

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <deque>
#include <list>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>

using namespace std;


#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repr(i,n) for(int (i)=(n); (i)>=(0); (i)--)
#define SIZE(x) ((int)(x).size())
#define GCD(a, b) int gcd(int a,int b){return b?gcd(b,a%b):a;}
#define QP(a, b) int qp(int a,ll b){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}


template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}

typedef pair<int, int> pii;
typedef long long ll;

int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1001001001001001LL;
const ll MOD = 1000000007LL;


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    int ans = 0;
    rep(i, N){
        ans += (i+1);
    }
    cout << ans;
    cout << endl;
    return 0;
}



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

int main() {
    int N, K;
    cin >> N >> K;
    vector<int> x(N);
    rep(i, N) {
        cin >> x.at(i);
    }

    int sum = 0;
    rep(i, N) {
        int disA = x.at(i) - 0;
        int disB = K - x.at(i);
        sum += min(disA, disB) * 2;
    }

    cout << sum << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <unordered_set>
using namespace std;
#define printclock cerr << "Time : " << 1000 * (ld)clock() / (ld)CLOCKS_PER_SEC << "ms\n";
#define deb2(x, y) cout << #x << ": " << x << " | " << #y << ": " << y << endl
#define deb1(x) cout << #x << ": " << x << endl
#define rep(i, a, n) for (int i = (a); i < (n); ++i)
#define prec(n) fixed << setprecision(n)
#define all(a) a.begin(), a.end()
#define fast                      \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0);
#define pii pair<int, int>
#define vii vector<int>
#define ld long double
#define int long long
#define MOD LLONG_MAX
#define mp make_pair
#define pb push_back
#define endl "\n";
inline void get(vector<int> &arr, int n)
{
    int a;
    for (int i = 0; i < n; i++)
    {
        cin >> a;
        arr.push_back(a);
    }
}
inline void print(vector<int> &arr, int n)
{
    for (int i = 0; i < n; i++)
        cout << arr[i] << " ";
    cout << endl;
}
/*----------------------------------TEMPLATE------------------------------------*/
int32_t main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
#endif
    fast;
    /*----------------------------PEEPEEPOOPOO-------------------------------------*/
    int t;
    //cin >> t;
    t = 1;
    while (t--)
    {
        int d,t,s;
        cin >> d >> t >> s;
        if(s*t >= d) cout << "Yes" << endl
        else cout << "No" << endl;
    }
    return 0;
}
/*--------------------------------PEEPEEPOOPOO-------------------------------------*/

Measured memory_bytes: 3644
#include <cstdio>
#include <cstring>
#include <algorithm>
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)
using namespace std;

const int N=(1<<17)+5;

int n,A,B,p[N],cnt[N];

void solve(int w,int l,int r,int A,int B) {
	if (l+1==r) {
		p[l]=A;p[r]=B;
		return;
	}
	int mid=l+r>>1,id=0;
	fo(i,0,w) if ((A^B)&(1<<i)) {id=i;break;}
	int t=(A&(1<<id))>0;
	int aa=A^(A&(1<<w))^(A&(1<<id));
	aa=aa^(((A&(1<<w))>0)*(1<<id));
	int bb=B^(B&(1<<w))^(B&(1<<id));
	bb=bb^(((B&(1<<w))>0)*(1<<id));
	if (cnt[aa]&1) {
		solve(w-1,l,mid,aa,0);
		solve(w-1,mid+1,r,0,bb);
	} else {
		solve(w-1,l,mid,aa,1);
		solve(w-1,mid+1,r,1,bb);
	}
	fo(i,l,mid) {
		p[i]=p[i]^(((p[i]&(1<<id))>0)*(1<<w));
		p[i]=p[i]^(p[i]&(1<<id));
		if (t) p[i]=p[i]|(1<<id);
	}
	fo(i,mid+1,r) {
		p[i]=p[i]^(((p[i]&(1<<id))>0)*(1<<w));
		p[i]=p[i]^(p[i]&(1<<id));
		if (!t) p[i]=p[i]|(1<<id);
	}
}

int main() {
	scanf("%d%d%d",&n,&A,&B);
	int k=0;fo(i,0,n-1) if ((A^B)&(1<<i)) k++;
	if (!(k&1)) {puts("No");return 0;}
	fo(i,0,(1<<n)-1) fo(j,0,n-1) if (i>>j&1) cnt[i]++;
	solve(n-1,0,(1<<n)-1,A,B);
	puts("Yes");
	fo(i,0,(1<<n)-1) printf("%d ",p[i]);
	return 0;
}

Measured memory_bytes: 1920