akhauriyash/Code-Regression huggingface dataset:
// --------------------<optimizations>--------------------
#pragma GCC optimize("O3")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)\
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define pii pair<ll,ll>
#define vpii vector<pair<ll,ll> >
#define F first
#define S second
#define ld long double
#define built __builtin_popcountll
#define mst(a,i) memset(a,i,sizeof(a))
#define all(x) x.begin(),x.end()
#define itit(it,a) for(auto it=(a).begin(); it!=(a).end(); it++)
#define rep(i,a,b) for(ll i=a; i<b; i++)
#define repr(i,a,b) for(ll i=a; i>b; i--)
#define reprr(i,a,b) for(ll i=a; i>=b; i--)
#define pi 3.14159265358979323846264338327950288419716939937510582097494459230
ll max3(ll x,ll y,ll z) {return max(max(x,y),z);}
ll min3(ll x,ll y,ll z) {return min(min(x,y),z);}
const ll M=2e5+10,M2=1e6+10,mod=1e9+7,inf=1e17+10;
void add(int& a, int b) {a+=b;if(a>=mod){a-=mod;}}
#define trace1(x)			 	 cerr<<#x<<": "<<x<<endl
#define trace2(x, y)		 	 cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)		 	 cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)	 	 cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)	 cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
int X[] = {0, 1, 0, -1};
int Y[] = {-1, 0, 1, 0};
ll power(ll x,ll n){ll result=1;while(n>0){if(n%2==1)result=(result*x); x=((x)*(x));n=n/2;}return result;}


int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	ll x,y;
	cin >> x >> y;
	ll ans=0;
	while(x<=y){
		x=x<<1;
		ans++;
	}
	cout << ans;
	return 0;
}


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

using namespace std;

#define ll long long
#define int ll
#define pb(x) push_back(x)
#define mp(x) make_pair(x)
#define fi first
#define se second
struct Trie
{
    Trie* next[26];
    bool last;
    Trie()
    {
        for(int i=0;i<26;i++)
        {
            next[i]=NULL;
        }
        last=false;
    }
};
Trie* head=new Trie();
int cnt=0;
void insert(string &s)
{
    Trie* ptr=head;
    for(int i=0;i<s.size();i++)
    {
        if(ptr->next[s[i]-'a']==NULL)
        {
            Trie* temp=new Trie();
            ptr->next[s[i]-'a']=temp;
        }
        ptr=ptr->next[s[i]-'a'];
    }
    if(ptr->last==false)
    {
        ptr->last=true;
        cnt++;
    }
    return;
}
int32_t main() {
    int t=1;
    //cin>>t;
    while(t--)
    {
       int A,B,C,D;
       cin>>A>>B>>C>>D;
       int cnt1=C/B+bool(C%B);
       int cnt2=A/D+bool(A%D);
       //cout<<cnt1<<" "<<cnt2;
       if(cnt1<=cnt2)
       {
           cout<<"Yes";
           
       }
       else cout<<"No";
    }

    return 0;
    
}

Measured memory_bytes: 3556
#include<stdio.h>
void meiji(int n,int t,int h){
  printf("meiji %d %d %d\n",n-1867,t,h);
}
void taisho(int n,int t,int h){
  printf("taisho %d %d %d\n",n-1911,t,h);
}
void showa(int n,int t,int h){
  printf("showa %d %d %d\n",n-1925,t,h);
}
void heisei(int n,int t,int h){
  printf("heisei %d %d %d\n",n-1988,t,h);
}
void not(){
  puts("pre-meiji");
}

main(){
  int n,t,h;

  while(scanf("%d %d %d",&n,&t,&h)!=EOF){
    if(1868<n && 1912>n){
      meiji(n,t,h);
    }
    else if(1912<n && 1926>n){
      taisho(n,t,h);
    }
    else if(1926<n && 1926>n){
      showa(n,t,h);
    }
    else if(1989<=n){
      if(1989!=n){
	heisei(n,t,h);
      }
      else if(t!=1){
	heisei(n,t,h);
      }
      else if(h>=8){
	heisei(n,t,h);
      }
      else showa(n,t,h);
    }
    else if(n==1868){
      if(t>9) meiji(n,t,h);
      else if(t<9) not();
      else if(h>7) meiji(n,t,h);
      else not();
    }
    else if(n==1912){
      if(t>7) taisho(n,t,h);
      else if(t<7) meiji(n,t,h);
      else if(h>29) taisho(n,t,h);
      else meiji(n,t,h);
    }
    else if(n==1926){
      if(t!=12) taisho(n,t,h);
      else if(h>24) showa(n,t,h);
      else taisho(n,t,h);
    }
    else not();

  }
  return 0;
}

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

int n;
int a[200];
int Ans = 1001001001;
int main()
{
    cin >> n;
    for(int i = 0; i < n; i++)
    {
        cin >> a[i];
        for(int j = 0; j < 33; j++)
        {
            if(a[i] % 2 == 1)
            {
                Ans = min(Ans, j);
            }
            else
            {
                a[i] = a[i] / 2;
            }
        }
    }
    cout << Ans << endl;
}

Measured memory_bytes: 256
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
count =0
for i in range(n):
    test = 0
    a = list(map(int, input().split()))
    for j in range(m):
        test += a[j]*b[j]
    if test+c > 0:
        count += 1
print(count)


Measured memory_bytes: 2940
#include <iostream>
#include <set>
#define MAX_N 1e5
using namespace std;

int main(){
    int n,m, a,b, ans =0;
    int obs[(int)MAX_N];
    set<int> adj[(int)MAX_N];
    cin >> n >> m;
    for(int i = 0; i < n ; ++i){
        cin >> obs[i];
    }
    while(m--){
        cin >> a >> b;
        a--, b--;
        adj[a].insert(b);
        adj[b].insert(a);
    }
    for(int i = 0; i < n ; ++i){
        bool isGoodObs = 1;
        for(auto elev : adj[i]){
            if(obs[elev] >= obs[i]) {
                isGoodObs = 0;
                break;
            }
        }
        ans += isGoodObs;
    }
    cout << ans;

    return 0;
}

Measured memory_bytes: 18052
#include<bits/stdc++.h>
using namespace std;
    
int main() {
    int n, l;
    cin >> n >> l;
    string s[n];
    for (int i = 0; i < n; i++) {
        cin >> s[i];
    }
    sort(s, s + n);
    for (int i = 0; i < n; i++) {
        cout << s[i];
    }
        return 0;
}

Measured memory_bytes: 256
using System;
class Program
{
    static int min(int _x,int _y)
    {
        if (_x < _y) return _x;
        return _y;
    }
    static int max(int _x, int _y)
    {
        if (_x > _y) return _x;
        return _y;
    }
    static void Main()
    {
        string[] input = Console.ReadLine().Split(' ');
        int W = int.Parse(input[0]);
        int H = int.Parse(input[1]);
        int N = int.Parse(input[2]);
        int x0 = 0, y0 = 0;
        int x1 = W, y1 = H;
        for (int i = 0; i < N; i++)
        {
            input = Console.ReadLine().Split(' ');
            if (int.Parse(input[2]) == 1) x0 = max(x0, int.Parse(input[0]));
            if (int.Parse(input[2]) == 2) x1 = min(x1, int.Parse(input[0]));
            if (int.Parse(input[2]) == 3) y0 = max(y0, int.Parse(input[1]));
            if (int.Parse(input[2]) == 4) y1 = min(y1, int.Parse(input[1]));
        }
        int ans = 0;
        if ((x1 - x0 < 0) || (y1 - y0 < 0)) ans = 0;
        else ans = (x1 - x0) * (y1 - y0);
        Console.WriteLine(ans);
    }
}

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

#define ll long long
#define sd(x) scanf("%d", &(x))
#define pii pair<int, int>
#define F first
#define S second
#define all(c) ((c).begin()), ((c).end())
#define sz(x) ((int)(x).size())
#define ld long double

template<class T,class U>
ostream& operator<<(ostream& os,const pair<T,U>& p){
	os<<"("<<p.first<<", "<<p.second<<")";
	return os;
}

template<class T,class U>
ostream& operator<<(ostream& os,const map<T, U> & mp){
	os << "{";
	int i = 0;
	for(auto it : mp){
		if(i) os<<", ";
		os << it;
		i++;
	}
	os << "}";	
	return os;
}

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

#ifdef LOCAL
#define cerr cout
#else
#endif

#define TRACE

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

int main(){
	int M, D;
	cin >> M >> D;
	int ans = 0;
	for(int d1 = 2; d1 <= 9; d1++)
	for(int d2 = 2; d2 <= 9; d2++){
		if(d1 * 10 + d2 <= D && (d1 * d2 <= M)) ans++;
	}
	printf("%d\n", ans);
}

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

using namespace std;

int main(){
  int N,K;
  cin >> K >>N;
  vector<int> A(N);
  
  for(int i=0;i<N;i++)
    cin >> A.at(i);
  
  A.push_back(K+A.at(0));
  
  int l=0;
  for(int j=0;j<N;j++)
    l=max(l,A.at(j+1)-A.at(j));
  
  cout << K-l << endl;
}
  


Measured memory_bytes: 1792
#include<stdio.h>
int main()
{
	double n, m, x[1001], sum = 0, ok = 0, key;

	scanf("%lf %lf", &n, &m);

	for (int i = 0; i < n; i++) {
		scanf("%lf", &x[i]);
		sum += x[i];
	}

	key = sum / (4 * m);

	for (int i = 0; i < n; i++) {
		if (x[i] >= key) ok++;
	}
	if (ok >= m) {
		printf("Yes");
	}
	else {
		printf("No");
	}

	return 0;
}

Measured memory_bytes: 128
import Data.List

main = do
	line <- getLine
	putStrLn $ unwords . map show . sort . map (read :: (String -> Int)) . words $ line


--main = do
--	line <- getLine
--	let a = read . head . words $ line :: Int
--	let b = read . last . words $ line :: Int
--	putStrLn (show (a * b) ++ " " ++ show (a * 2 + b * 2))

Measured memory_bytes: 3624
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <string>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#define re register
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define MAXN 200007
#define mo 19930726
using namespace std;
typedef unsigned long long ull;
#define ms(arr) memset(arr, 0, sizeof(arr))
#define ll long long
const int inf = 0x3f3f3f3f;
ll n,v[MAXN],x[MAXN],C,sum[MAXN],pre[MAXN],ans;
int main()
{
	cin>>n>>C;
	for(int i=1;i<=n;i++){
		cin>>x[i]>>v[i];
		sum[i]=sum[i-1]+v[i];
		pre[i]=max(pre[i-1],sum[i]-x[i]);
	}
	ll cnt=0;
	ll c=C;
	for(int i=n;i>=1;i--){
		ans=max(ans,cnt+pre[i]);
		cnt+=v[i]-2*(c-x[i]);
		c=x[i];
	}
	for(int i=1;i<=n;i++) x[i]=C-x[i];
	reverse(x+1,x+n+1);
	reverse(v+1,v+n+1);
	for(int i=1;i<=n;i++){
		sum[i]=sum[i-1]+v[i];
		pre[i]=max(pre[i-1],sum[i]-x[i]);
	}
	cnt=0;
	c=C;
	for(int i=n;i>=1;i--){
		ans=max(ans,cnt+pre[i]);
		cnt+=v[i]-2*(c-x[i]);
		c=x[i];
	}
	cout<<ans;
}

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

int main (){
  
    long long int N,O=0,m=0,a=0,r=0,c=0,h=0,ans=0;
    cin >> N;
    long long int w[5];
    char S[N][100];
    for(int i = 0; i < N; i++) {
        cin >> S[i]; 
    }

    for(int i = 0; i < N; i++) {
        if(S[i][0] == 'M'){
            m++;
        }else if(S[i][0] == 'A'){
            a++;
        }else if(S[i][0] == 'R') {
            r++;
        }else if(S[i][0] == 'C') {
            c++;
        }else if(S[i][0] == 'H') {
            h++;
        }else {
            continue;
        }
    }

    if(m == 0) {
        O++;
    }else if(a == 0) {
        O++;
    }else if(r == 0) {
        O++;
    }else if(c == 0) {
        O++;
    }else if(h == 0) {
        O++;
    }

    if(O > 2) {
        cout << 0 << endl;
    }else {
        w[0] = m;
        w[1] = a;
        w[2] = r;
        w[3] = c;
        w[4] = h;
        for(int i = 0; i < 3; i++) {
            for(int j = i+1; j < 4; j++) {
                for(int k = j+1; k < 5; k++) {
                    ans += w[i] * w[j] * w[k];
                }
            }
        }
    }
    cout << ans << endl;
    return 0;
}




Measured memory_bytes: 9984
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
ll L[100];

int main() {
    int N;
    cin >> N;
    L[0] = 2;
    L[1] = 1;
    for (int i = 2; i <= N; i++) {
        L[i] = L[i - 1] + L[i - 2];
    }
    cout << L[N] << endl;
    return 0;
}

Measured memory_bytes: 256
use proconio::{fastout, input};

const M: u64 = 998244353;

#[fastout]
fn main() {
    input! {in_n: usize, in_s: usize, in_a: [usize; in_n]};
    let mut v = [0 as u64; 3001];

    for a in &in_a {
        for i in (0..v.len()).rev() {
            v[i] += v[i];

            if i == 0 || i == *a {
                v[i] += 1;
            }

            if i >= *a {
                v[i] += v[i - *a];
            }

            v[i] = v[i] % M;
        }
    }

    println!("{}", v[in_s]);
}


Measured memory_bytes: 2256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1000000007;
#define all(V) V.begin(),V.end()

vector<vector<int>> T(100000);
vector<int> U(100000, 0);
vector<int> S(100000);
set<int> E;
queue<int> Q, R;
map<pair<int, int>,int> Mp;
vector<int> art(100000);
vector<int> arr1(100000,-1), arr2(100000,-1);

void root(int x) {
	if (arr1[x] == 0) {
		return;
	}
	if (Mp.count({ x, art[x] }))
		Mp[{x, art[x]}]++;
	else
		Mp[{art[x], x}]++;
	root(art[x]);
	return;
}

void bfs(int a) {
	//cout << 239 << endl;
	int x, cnt = 0;
	Q = R;
	arr1 = arr2;
	Q.push(-1);
	Q.push(a);
	arr1[a] = 0;
	while (Q.size()!=1) {
		x = Q.front();
		Q.pop();
		if (x == -1) {
			cnt++;
			Q.push(x);
			continue;
		}
		if (E.count(x)) {
			E.erase(x);
			root(x);
			return;
		}
		for (int i : T[x]) {
			if (arr1[i] < 0) {
				Q.push(i);
				art[i] = x;
				arr1[i] = cnt;
			}
		}
	}
}

int main() {
	int N, M, a, b;
	cin >> N >> M;
	for (int i = 0;i < M;i++) {
		cin >> a >> b;
		a--;b--;
		Mp.insert({ { a, b }, 0 });
		T[a].push_back(b);
		T[b].push_back(a);
		U[a]++;
		S[a]++;S[b]++;
	}
	for (int i = 0;i < N;i++) {
		if (U[i] % 2)
			E.insert(i);
	}
	if (E.size() % 2) {
		cout << -1 << endl;
		return 0;
	}
	while (!E.empty()) {
		a = *E.begin();
		E.erase(E.begin());
		bfs(a);
	}
	for (auto i : Mp) {
		if (i.second % 2)
			cout << i.first.second + 1 << " " << i.first.first + 1 << endl;
		else
			cout << i.first.first + 1 << " " << i.first.second + 1 << endl;
		//cout << i.second << endl;
	}
}

Measured memory_bytes: 19712
#include<stdio.h>

int main(void){

int n;
int k=0;//桁数
int i;
int ans=0;
float dummy;

scanf("%d",&n);


for(i=1;i<=n;i++){
    k=0;
    dummy=i;
    while(dummy>=1){
        dummy=dummy/10;
        k++;
    }
    if(k%2!=0){
        ans++;
    }
}

printf("%d",ans);


return 0;

}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
 
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i < (int)(n); i++)
#define print(a) cout << (a) << endl; 
typedef long long ll;
const int MOD = 1000000007; 


int main() {
    int n, k;
    cin >> n >> k;
    int ret = 0;
    while (n) {
        ret += 1;
        n /= k;
    } 
    cout << ret << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h> 
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vl;
typedef pair<ll,ll> pll;
#define vbi vector<bool> 
#define mod 1000000007
#define INF 1000000000
#define all(x) x.begin(),x.end()
#define mp make_pair
#define pb push_back
#define sd second
#define ft first
#define ms(x,v) memset(x,v,sizeof x)
#define endl '\n'
#define cnl cout<<endl;
#define fr(i,b) for(ll i=0; i<=b; i++)
#define frr(i,b) for(ll i=0;i<b;i++)
#define fb(i,b) for(ll i=b-1; i>=0; i--)
#define pi  3.141592653589793238
ll i,j;
int main(){
 
    ll a;cin>>a;
    string s; cin>>s;
    if(a<3200) cout<<"red"<<endl;
    else cout<<s<<endl;








    return 0;
}

Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define Rep(i,n) for(intl i=0;i<(intl)(n);i++)
#define Rep1(i,n) for(intl i=1;i<(intl)(n)+1;i++)
#define vec vector
#define fi first
#define se second
#define pub push_back
#define pob pop_back
#define SortA(v) sort(v.begin(), v.end())
#define SortD(v) sort(v.rbegin(), v.rend())
#define All(a) (a).begin(),(a).end()
using intl = int64_t;
using vi = vec<intl>;
using vvi = vec<vi>;
using pi = pair<intl,intl>;
using vpi = vec<pi>;
vec<intl> dx = {0, 1, 0, -1, 1, 1, -1, -1};
vec<intl> dy = {1, 0, -1, 0, 1, -1, 1, -1};
constexpr intl INF = 9223372036854775807;


int main(){
  vi A(5);
  Rep(i,5){
    cin >>A[i];
    if(A[i] == 0){cout << i+1;return 0;}
  }
  
}
  

Measured memory_bytes: 3604
#include <bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
using namespace std;
 
#define dump(x)  cout << #x << " = " << (x) << endl;
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) << endl
#define possible(n) cout << ((n) ? "possible" : "impossible"  ) << endl
 
#define SANKOU(n,a,b) cout << ((n) ? (#a) : (#b) ) << endl
 
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
 
#define FOREACH(x,a) for(auto& (x) : (a) )
 
#define WFA(d,v) REP(k,v)REP(i,v)REP(j,v)d[i][j]=min(d[i][j],d[i][k]+d[k][j])
 
#define SCOUT(x) cout<<(x)<<" "
#define ENDL cout<<endl
 
#define VECCIN(x) for(auto&youso_: (x) )cin>>youso_
#define VECIN2(x,y) REP(i,x.size())cin>>x[i]>>y[i]
#define VECCOUT(x) if(1){for(auto tt=x.begin();tt!=x.end();tt++){if(tt!=x.begin())cout<<" ";cout<<(*tt);}cout<<endl;}
 
#define ALL(obj) (obj).begin(),(obj).end()
 
#define EXIST(n,x) (find(ALL(n),x)!=n.end())
#define UNIQUE(obj) sort(ALL( obj )); obj.erase(unique(ALL(obj)),obj.end())
#define EN(x) if(1){cout<<#x<<endl;return 0;}
#define COUT(x) cout<<(x)<<endl
void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail){
    cin>>head;
    CINT(move(tail)...);
}
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)
 
template <class T = ll>
T IN(){T x;cin>>x;return (x);}
 
template <class Head>
void VT(Head head){}
template <class Head,class Seco,class... Tail>
void VT(Head&& head,Seco&& seco,Tail&&... tail){
    seco.resize(head);
    VT(head,move(tail)...);
}
void VT2(){}
template <class Head,class... Tail>
void VT2(Head&& head,Tail&&... tail){
  VECCIN(head);
  VT2(move(tail)...);
}
 
template <class Head>
void VT3(Head&& head){}
template <class Head,class Seco,class... Tail>
void VT3(Head&& head,Seco&& seco,Tail&&... tail){
  seco[head]=IN();
  VT3(head,move(tail)...);
}
 
#define VC1(n,...) V __VA_ARGS__;VT(n,__VA_ARGS__);VT2(__VA_ARGS__); //aaabbbccc
#define VC2(n,...) V __VA_ARGS__;VT(n,__VA_ARGS__);REP(i,n)VT3(i,__VA_ARGS__); //abcabcabc
 
//#include <boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision; // cpp_int
 
#define P pair<ll,ll>
#define V vector<ll>
#define M map<ll,ll>
#define S set<ll>
 
#define pb(a) push_back(a)
#define mp make_pair

int main(){
  CIN(n,k);
  if(k==0){
    COUT(1LL*n*n);
    return 0;
  }
  ll cou = 0;
  FOR(b,k+1,n+1){
    //5,2なら3,4,5
    int pat=n/b;
    cou += 1LL * pat * (b-k);

    cou += max(0LL,1LL*(n%b)-k+1);
  }
  COUT(cou);

  return 0;
}

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

using namespace std;
typedef long long int ll;

int main() {
  double n,m,d;
  cin>>n>>m>>d;
  double res;
  //  res=(m-1)*(n-d)*2/n/n;
  res =(m-1.0);
  res/=n;
  res*=(n-d);
  res/=n;
  res*=2.0;
  
  if(d==0)
    res/=2.0;

  cout<<fixed;
  cout<<setprecision(10)<<res<<endl;
  return 0;
}



Measured memory_bytes: 256
N,D = map( int, input().split())
X = [0 for i in range(10) for j in range(10)]
for i in range(N):
  X[i] = list(map( int, input().split()))
ans = 0
for i in range(N-1):
  for j in range(i+1,N):
    len = 0
    for a in range(D):
      len += (X[i][a] - X[j][a]) ** 2
    len = len ** 0.5
    if len == int(len):
      ans += 1
print(ans)


Measured memory_bytes: 3188
# coding: utf-8
import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N, K = lr()
dice = np.arange(1, N+1, dtype=np.int32)
need = np.zeros(N, np.int32)

for i in range(20):
    target = dice < K
    need[target] += 1
    dice[target] <<= 1 #2倍

rate = (.5) ** need
answer = rate.sum() / N
print(answer)
#


Measured memory_bytes: 13764
#include <bits/stdc++.h>
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define int long long
#define ld long double
#define endl "\n"
using namespace std;

int _hash(int x, int y) {
  return x*1e9+y;
}

int32_t main() {
  int h,w,m;
  cin>>h>>w>>m;
  unordered_map<int,int> rows,cols;
  unordered_map<int,bool> points;
  while(m--) {
    int x,y;
    cin>>x>>y;
    rows[x]++;
    cols[y]++;
    points[_hash(x,y)] = true;
  }
  vector<int> X,Y;
  int mx = 0, my = 0;
  for(auto& it : cols) {
    my = max(my,it.second);
  }
  for(auto& it : rows) {
    mx = max(mx,it.second);
  }
  for(auto& it : cols) {
    if(it.second == my) {
      Y.emplace_back(it.first);
    }
  }
  for(auto& it : rows) {
    if(mx == it.second) {
      X.emplace_back(it.first);
    }
  }
  int ans = mx+my-1;
  for(int x : X) {
    for(int y : Y) {
      if(!points[_hash(x,y)]) {
        ans++;goto lab;
      }
    }
  }
  lab:
  cout<<ans;
  cout<<endl;
  return 0;
}

Measured memory_bytes: 52044
import sys
input = sys.stdin.readline


def main():
    N = int(input())
    A = list(map(int, input().split()))
    B = [0]*60
    for a in A:
        for i in range(len(B)):
            if a & (2**i):
                B[i] += 1
    ans = 0
    for i, b in enumerate(B):
        ans += 2**i * b * (N-b)
    ans %= 10**9+7
    print(ans)


if __name__ == '__main__':
    main()


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

seat = [0] * (N + 1)


def ask(i):
    print(i)

    s = input()
    if s == "Vacant":
        exit()
    seat[i] = s
    return s


l, r = 0, N - 1
ask(0)
ask(N - 1)

for _ in range(18):
    m = (r + l) // 2
    res = ask(m)
    if res == seat[l]:
        if (m - l) % 2 == 0:  # 席が奇数個
            l = m
        else:
            r = m
    else:
        if (m - l) % 2 == 0:  # 席が奇数個
            r = m
        else:
            l = m


Measured memory_bytes: 4424
#include <bits/stdc++.h>
using namespace std;
const int MAX = 101;
int num[MAX];
int main()
{
    int n,cnt=0;
    scanf("%d",&n);
    for(int i=0;i<n;i++)
        scanf("%d",&num[i]);
    for(int i=0;i<n-1;i++)
        for(int j=0;j<n-i-1;j++)
         if(num[j]>num[j+1])
    {
        cnt++;
        swap(num[j],num[j+1]);
    }
    for(int i=0;i<n;i++)
        if(i==0) printf("%d",num[i]);
        else printf(" %d",num[i]);
    printf("\n");
    printf("%d\n",cnt);
    return 0;
}




Measured memory_bytes: 3228
#include<ctime>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<queue>
#include<vector>
#define file(x)freopen(x".in","r",stdin);freopen(x".out","w",stdout)
#define rt register int
#define l putchar('\n')
#define ll long long
#define r read()
using namespace std;
inline ll read(){
    ll x=0;char zf=1;char ch=getchar();
    while(ch!='-'&&!isdigit(ch))ch=getchar();
    if(ch=='-')zf=-1,ch=getchar();
    while(isdigit(ch))x=x*10+ch-'0',ch=getchar();return x*zf;
}
void write(ll y){if(y<0)putchar('-'),y=-y;if(y>9)write(y/10);putchar(y%10+48);}
void writeln(const ll y){write(y);putchar('\n');}
int k,m,n,x,y,z,cnt,ans,ret;
int a[100010],b[100010],t1,t2;
char c[100010],s[100010];
int calc(){	
	t1=t2=0;
	for(rt i=1;i<=n;i++)b[++t2]=0;
	for(rt i=1;i<n;i++)if(c[i]=='0'&&c[i+1]=='1')a[++t1]=i;
	for(rt i=1;i<n;i++)if(s[i]=='0'&&s[i+1]=='1')b[++t2]=i;
	for(rt i=1;i<=n;i++)b[++t2]=n;int nowmin=998244353;
	for(rt i=1;i<=t2-n+1;i++){
		int ans=0;
		for(rt j=1;j<i;j++)if(b[j])ans+=b[j];
		for(rt j=0;j<t1;j++)ans+=abs(a[j+1]-b[i+j]);
		for(rt j=t1;b[i+j]!=n;j++)ans+=n-b[i+j];
		nowmin=min(nowmin,ans);
	}
	return nowmin;
}
int main(){
	n=r;
	scanf("%s",c+1);scanf("%s",s+1);
	if(n==1&&c[1]!=s[1])writeln(1);
	else if(n==2&&c[1]!=s[1]&&c[1]==c[2]&&s[1]==s[2])writeln(2);
	else {
		ret=calc();
		for(rt i=1;i<=n;i++)c[i]='0'+'1'-c[i],s[i]='0'+'1'-s[i];
		ret+=calc();cout<<ret;		
	}
	return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fi first
#define se second
#define pb push_back
#define pr pair<int,int>
#define mod 1000000007
#define endl "\n"

int power(int a,int b,int m=mod)
{
	if(b==0)	return 1;
	if(b==1)	return a;
	int res=power(a,b/2,m);
	res=(res*res)%m;
	if(b&1)	res=(res*a)%m;
	return res;
}
int modinv(int a,int m=mod){ return power(a,m-2,m);}
int add(int a,int b,int m=mod){	int c=(a+b);	if(c>=m)	c-=m;	return c;}
int sub(int a,int b,int m=mod){	int c=(a-b);	if(c<0)		c+=m;	return c;}
int mul(int a,int b,int m=mod){	return (a*b)%m;}
//	x<<1 => x*2		x>>1 => x/2;	cout<<flush;
//	cout<<fixed<<setprecision(10)<<ans<<endl;


void solve()
{
	int n,x,m;
	cin>>n>>x>>m;
	map<int,int> mp;
	int pre[m];
	memset(pre,0,sizeof(pre));
	pre[0]=0;
	int T=2;
	pre[1]=x;
	mp[x]=1;
	n--;
	//cout<<"x is "<<x<<endl;
	while(n--)
	{
		x=(x*x)%m;
		if(mp[x])
			break;
		pre[T]=pre[T-1]+x;
		mp[x]=T++;
		//cout<<"x is "<<x<<" "<<pre[T-1]<<endl;
	}
	if(n<1)
	{
		cout<<pre[T-1]<<endl;
		return;
	}
	int period=T-mp[x];
	int val=pre[T-1]-pre[mp[x]-1];
	
	//cout<<"T is "<<T<<" "<<pre[T-1]<<endl;
	//cout<<"period is "<<period<<endl;
	
	int ans=pre[T-1];
	int left=n+1;
	
	//cout<<"left is "<<left <<endl;
	ans+=(left/period)*val;
	
	left=left%period;
	int start=mp[x];
	while(left--)
	{
		ans+=pre[start]-pre[start-1];
		start++;
	}
	cout<<ans<<endl;
}

int32_t main()
{
	ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
	int t=1;//cin>>t;
	for(int i=1;i<=t;i++){	solve();}
	return 0;
}

Measured memory_bytes: 7444
#include <ext/pb_ds/assoc_container.hpp>
#include <bits/stdc++.h>
using namespace std;
using namespace __gnu_pbds;
template <class c, class cmp = less<c> > using ordered_set = tree<c, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...) 
#endif
template<class T> ostream& operator<<(ostream &os, vector<T> V) {os << "[ "; for(auto v : V) os << v << " "; return os << "]";}
template<class L, class R> ostream& operator<<(ostream &os, pair<L,R> P) {return os << "(" << P.first << "," << P.second << ")";}
template <typename T,typename U>pair<T,U> operator+(const pair<T,U> & l,const std::pair<T,U> & r) { return {l.first+r.first,l.second+r.second};}
typedef long long int ll;
const ll mod =1e9+7;
const int maxn = 200002;
#define endl '\n'
#define ld long double
#define int ll
#define all(x) (x).begin(),(x).end()
#define biton(x, y) (((x>>y)&1ll) == 1)
#define bitoff(x, y) (((x>>y)&1ll) == 0)

int32_t main()
{ 
   IOS

  int n, k;
  cin >> n >> k;
  ld a[n+1];
  a[0] = 0.0;
  for(int i = 1;i<=n;i++){
    cin >> a[i];
    a[i] = log2(a[i]);
    a[i] += a[i-1];
  }

  for(int i = k+1;i<=n;i++){
    ld now = a[i] - a[i-k];
    ld prev = a[i-1] - a[i-k-1];
    if(now>prev+abs((ld)1e-9)){
      cout << "Yes"<<endl;
    }
    else{
      cout << "No"<<endl;
    }
  }


 
}

Measured memory_bytes: 6924
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
a, b = M()
print(a*b)

Measured memory_bytes: 68244
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define EPS (1e-7)
#define INF (1e9)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
const double PI = acos(-1);
const ll MOD = 1000000007;
// const ll MOD = 998244353;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
 
template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
///////////////////////////////////////////////////////////////

ll f(ll n) {
    ll ret = 1;
    while (n > 0) {
        ret <<= 1;
        n >>= 1;
    }
    return ret;
}
 
int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int N; cin >> N;
    vector<ll> A(N);
    rep(i,N) cin >> A[i];

    map<ll, int, greater<ll>> dic;
    rep(i,N) dic[A[i]]++;

    int cnt = 0;
    for (auto i : dic) {
        if (i.second <= 0) continue;
        ll k = f(i.first) - i.first;
        if (k == i.first) {
            cnt += i.second/2;
        } else {
            int c = min(dic[k],i.second);
            cnt += c;
            dic[k] -= c;
        }
    }

    cout << cnt << endl;

}

Measured memory_bytes: 26880
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int INF = (1LL << 30) - 1;
int MOD = 1e9+7;
struct UnionFind {
    vector<int> par;
    
    UnionFind(int n) : par(n, -1) {}
    void init(int n) { par.assign(n, -1);}
    
    int root(int x) {
        if (par[x] < 0) return x;
        else return par[x] = root(par[x]);
    }
    
    bool issame(int x, int y) {
        return root(x) == root(y);
    }
    
    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (par[x] > par[y]) swap(x, y); // merge technique
        par[x] += par[y];
        par[y] = x;
        return true;
    }
    
    int size(int x) {
        return -par[root(x)];
    }
};
ll combi(ll a){
    return a * (a-1) / 2;
}
main(){
    ll N,M;
    cin >> N >> M;
    UnionFind uf(N);
    vector<P> V(M);
    rep(i,0,M)cin >> V[i].first >> V[i].second;
    rep(i,0,M)V[i].first--, V[i].second--;
    vector<ll> ans(M);
    reverse(V.begin(), V.end());
    ll sum = combi(N);
    rep(i,0,M){
        ans[i] = sum;
        ll va = V[i].first, vb = V[i].second;
        if(uf.issame(va, vb)){
            continue;
        }
        ll a = uf.size(va), b = uf.size(vb);
        uf.merge(va, vb);
        ll c = uf.size(va);
        sum = sum + combi(a) + combi(b) - combi(c);

    }
    reverse(ans.begin(), ans.end());
    rep(i,0,M){
        cout << ans[i] << endl;
    }
}

Measured memory_bytes: 3328
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int modulo= 1000000007;
int main(){
	int n;
	cin>>n;
	int arr[n];
	ll sum=0;
	for(int i=0; i<n; i++){
		cin>>arr[i];
		sum+=arr[i];
		sum%=modulo;
	}
		ll ans=0;
		for(int i=0; i<n; i++){
			sum-=arr[i];
			if(sum<0) sum+=modulo;
			ans+=sum*arr[i];
			ans%=modulo;
		}
		cout<<ans;
}

Measured memory_bytes: 4420
//
// Created by Rea1 on 2020/2/22.
//
#pragma comment(linker, "/STACK:1024000000,1024000000")

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define lson l, mid, rt << 1
#define rson mid + 1, r, rt << 1 | 1

int main() {
    int N,R;
    cin >> N >> R;
    if (N >= 10) {
        cout<<R;
    } else {
        cout<<R + 100 * (10 - N);
    }
    return 0;
}


Measured memory_bytes: 256
def build_upward as, i
  p_i = (i + 1) / 2 - 1
  if p_i >= 0 && as[p_i] < as[i]
    as[p_i], as[i] = as[i], as[p_i]
    build_upward as, p_i
  end
end

def build_downward as, i
  a_len = as.length
  l_i = 2 * (i + 1) - 1
  r_i = 2 * (i + 1)
  v = as[i]
  l_v = ((a_len - 1) >= l_i) ? as[l_i] : -1
  r_v = ((a_len - 1) >= r_i) ? as[r_i] : -1

  largest_i = i
  largest_v = as[i]
  if l_v > largest_v
    largest_i = l_i
    largest_v = l_v
  end
  if r_v > largest_v
    largest_i = r_i
    largest_v = r_v
  end
  if largest_i != i
    as[i], as[largest_i] = as[largest_i], as[i]
    build_downward as, largest_i
  end
end

heap = []
res = []
while l = gets
  command, val = l.chomp.split(' ')
  case command
  when 'end'
    puts res.join("\n")
    break
  when 'insert'
    heap << val.to_i
    build_upward heap, heap.length - 1
  when 'extract'
    res << heap[0]
    if heap.length > 1
      heap[0] = heap.pop
      build_downward heap, 0
    end
  end
end


Measured memory_bytes: 22456
#include <bits/stdc++.h>
#include <stdio.h>
#include <math.h>
using namespace std;
using vi = vector<int>;
using vll = vector<long long int>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vvll = vector<vector<long long int>>;
using ll = long long int;

int main(){
    ll A, B; cin >> A >> B;
    cout << 6 - A - B;
}

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

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

	int r = 0;
	for (int i = a; i <= b; i++) {
		int s = i % 10, t = i / 10000 % 10; //１の位と５の位
		int u = i / 10 % 10, v = i / 1000 % 10; //２の位と４の位
		if (s == t && u == v) r++;
	}
	cout << r << endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
typedef pair<ll,ll> pll;
const ll mod=1e9+7;
//const ll mod=998244353;
const ll inf=5e18;

int main() {
  ll n;
  cin >> n;
  for(ll i=0;i<n-1;i++,cout<<endl) {
    for(ll j=i+1;j<n;j++) {
      ll t=1,x=i,y=j;
      while((x&1)==(y&1)) x>>=1,y>>=1,t++;
      cout << t << " ";
    }
  }
}

Measured memory_bytes: 512
// Example program
#include <iostream>
using namespace std;

int main()
{
    int x;
    cin >> x;
    for (int i = 0; i <= x; i++){
        int c = i;
        if (i % 3 == 0){//3の倍数
            if (i == 0){//0
            } else {
                cout << " " << i;
            }
        } else while(1){
            if (c % 10 == 3){//...3
                cout << " " << i;
                break;
            }
            c /= 10;
            if (c == 0) break;
        }
    }
    cout << endl;
    return 0;
}



Measured memory_bytes: 3112
#include <iostream>
#include <string>
using namespace std;
int S(int N)
{
    int s = 0;
    while (N) {
        s += N % 10;
        N /= 10;
    }
    return s;
}
int main()
{
    int N;
    cin >> N;
    cout << (N % S(N) == 0 ? "Yes" : "No") << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define LL long long
struct Edge{
	int next,to;
}edge[100];
LL f[51][1<<20];
int fi[51],se=1,fa[51],fa1[51],d[51],dep[51];
inline void add_edge(int u,int v){edge[++se].next=fi[u],fi[u]=se,edge[se].to=v;}
inline void add(int u,int v){add_edge(u,v),add_edge(v,u);}
void dfs(int x){
	for(int i=fi[x];i;i=edge[i].next){
		int v=edge[i].to;if(v==fa[x])continue;
		fa[v]=x,fa1[v]=i/2,dep[v]=dep[x]+1,dfs(v);
	}
}
int main(){
	int n,u,v,m,k,s;scanf("%d",&n);
	for(int i=1;i<n;i++)scanf("%d%d",&u,&v),add(u,v);
	dfs(1);scanf("%d",&m);s=1<<m;
	for(int i=0;i<m;i++){
		scanf("%d%d",&u,&v);
		if(dep[u]>dep[v])swap(u,v);
		k=dep[v]-dep[u];
		for(int j=0;j<k;j++)d[fa1[v]]|=(1<<i),v=fa[v];
		while(v!=u)d[fa1[v]]|=1<<i,v=fa[v],d[fa1[u]]|=1<<i,u=fa[u];
	}
	f[1][0]=1;
	for(int i=1;i<n;i++){
		for(int j=0;j<s;j++){
			f[i+1][j]+=f[i][j];
			f[i+1][j|d[i]]+=f[i][j];
		}
	}
	printf("%lld",f[n][s-1]);
	return 0;
}

Measured memory_bytes: 403840
#include <bits/stdc++.h>
//#include <ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
//using namespace __gnu_pbds;
//template<typename key, typename val>
//using ordered_tree =
//  tree<key, val, greater<>, rb_tree_tag, tree_order_statistics_node_update>;
typedef long long int64;
typedef complex<double> comp;
const double pi = 3.14159265358979323846;
const int inf = (int)1e+9 + 2;
const int64 inf64 = (int64)1e+18 + 2;
const double dinf = 1e+20;
const int mod = 1'000'000'007;//998244353;
const int base = 2187;
const double eps = 1e-8;
const int N = 300'000;
const int LOGN = 19;

int n, m, k;

void solve(int test)
{
  cin >> n;
  map<int, int> mp;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    ++mp[x];
  }
  if (mp.size() == 1 && mp.begin()->first == 0) {
    cout << "Yes\n";
    return;
  }
  if (mp.size() == 2 && n % 3 == 0) {
    auto it2 = mp.begin();
    auto it1 = it2++;
    if (it1->first == 0 && it1->second * 2 == it2->second) {
      cout << "Yes\n";
      return;
    }
  }
  if (mp.size() == 3 && n % 3 == 0) {
    auto it3 = mp.begin();
    auto it1 = it3++;
    auto it2 = it3++;
    if ((it1->first ^ it2->first ^ it3->first) == 0 &&
         it1->second == it2->second && it2->second == it3->second) {
      cout << "Yes\n";
      return;
    }
  }
  cout << "No\n";
}

void precalc()
{
}

int main()
{
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  precalc();
  int test = 1;
  //cin >> test;
  //auto start = chrono::high_resolution_clock::now();
  for (int i = 1; i <= test; ++i)
    solve(i);
  //cerr << chrono::duration_cast<chrono::milliseconds>(chrono::high_resolution_clock::now() - start).count() << '\n';
  return 0;
}


Measured memory_bytes: 3840
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int W = Integer.parseInt(sc.next());
		int H = Integer.parseInt(sc.next());
		int x = Integer.parseInt(sc.next());
		int y = Integer.parseInt(sc.next());
		
		System.out.print((double)W*(double)H/(double)2);
		if(x/1.0==W/2.0 &&y/1.0==H/2.0) {
			System.out.print(" ");
			System.out.println(1);
		}else {
			System.out.print(" ");
			System.out.println(0);
		}
		
		sc.close();
	}
}

Measured memory_bytes: 22996
N, M, C = map(int, input().rstrip().split())
B = [int(_) for _ in input().rstrip().split()]
A = [[int(_) for _ in input().rstrip().split()] for _ in range(N)]

ans = 0

for i in range(N):
    sum = C
    for j in range(M):
        sum += A[i][j] * B[j]
    if sum > 0:
        ans += 1

print(ans)

Measured memory_bytes: 3064
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] h = new int[n];
		for(int i = 0; i < n; i++) {
			h[i] = sc.nextInt();
		}
		int answer = 0;
		for(int i = 0; i < n; i++) {
			while(h[i] != 0) {
				answer += 1;
				for(int j = i; j < n; j++) {
					if(h[j] <= 0)
						break;
					else
						h[j] -= 1;
				}
			}
		}
		System.out.println(answer);
	}

}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i = ((ll) a); i < ((ll) n); i++)
using namespace std;
typedef long long ll;

int main(void) {
  string S;
  ll N, K;
  cin >> S >> K;
  N = S.length();

  ll dp[N][N][K + 1];
  REP(l, 0, N) REP(r, l, N) REP(k, 0, K + 1) dp[l][r][k] = 0;
  REP(l, 0, N) REP(k, 0, K + 1) dp[l][l][k] = 1;
  REP(l, 0, N - 1) if(S[l] == S[l + 1]) dp[l][l + 1][0] = 2;
  REP(l, 0, N - 1) REP(k, 1, K + 1) dp[l][l + 1][k] = 2;
  REP(s, 0, N) REP(l, 0, N - s) {
    ll r = l + s;
    REP(k, 0, K + 1) {
      if(l + 1 <= r - 1 && S[l] == S[r]) dp[l][r][k] = max(dp[l][r][k], dp[l + 1][r - 1][k] + 2);
      if(l + 1 <= r) dp[l][r][k] = max(dp[l][r][k], dp[l + 1][r][k]);
      if(l <= r - 1) dp[l][r][k] = max(dp[l][r][k], dp[l][r - 1][k]);
      if(k > 0 && l + 1 <= r - 1) dp[l][r][k] = max(dp[l][r][k], dp[l + 1][r - 1][k - 1] + 2);
      if(k > 0 && l + 1 <= r) dp[l][r][k] = max(dp[l][r][k], dp[l + 1][r][k - 1]);
      if(k > 0 && l <= r - 1) dp[l][r][k] = max(dp[l][r][k], dp[l][r - 1][k - 1]);
      if(k > 0) dp[l][r][k] = max(dp[l][r][k], dp[l][r][k - 1]);
    }
  }
  cout << dp[0][N - 1][K] << endl;
}


Measured memory_bytes: 210944
s = input()
l = len(s)
atgc = {'A', 'T', 'G', 'C'}

ans = 0
for i in range(l+1):
    for j in range(i+1, l+1):
        for k in s[i:j]:
            if k not in atgc:
                break
        else:
            ans = max(ans, j-i)
print(ans)


Measured memory_bytes: 38256
def main():
    N, A, B = (int(i) for i in input().split())
    H = [int(input()) for i in range(N)]

    def is_ok(H, mid):
        H = [h - mid*B for h in H]
        need = 0
        for h in H:
            if h > 0:
                need += (h + (A - B) - 1)//(A - B)
        if need <= mid:
            return True
        else:
            return False

    def binary_search_meguru(H):
        ng = -1
        ok = 10**9 + 1
        while abs(ok - ng) > 1:
            mid = ng + (ok - ng) // 2  # 爆破回数
            if is_ok(H, mid):
                ok = mid
            else:
                ng = mid
        return ok

    print(binary_search_meguru(H))


if __name__ == '__main__':
    main()


Measured memory_bytes: 122840
#include <iostream>
#include <set>
#include <queue>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
#include <numeric>
#include <functional>

using namespace std;
#define ALL(x)              (x).begin(),(x).end()
typedef long long           ll;
#define REP(i, n)           for (ll i = 0 ; i < (ll)n ; ++i)
#define REPN(i, m, n)       for (ll i = m ; i < (ll)n ; ++i)
#define INF                 (ll)1e9
#define MOD                 (1000 * 1000 * 1000 + 7)
#define Ceil(x, n)          (((((x))+((n)-1))/n))
#define CeilN(x, n)         (((((x))+((n)-1))/n)*n)
#define FloorN(x, n)        ((x)-(x)%(n))
#define IsOdd(x)            (((x)&0x01UL) == 0x01UL)
#define IsEven(x)           (!IsOdd((x)))
#define M_PI                3.14159265358979323846
typedef pair<ll, ll>	    P;

/*-----------------------------------------------------------------------------
　処理
 -----------------------------------------------------------------------------*/
int main()
{
	ll N;
	cin >> N;
	vector<ll> a(3 * N);
	for_each(ALL(a), [](ll &a){ cin >> a; });
	sort(ALL(a), greater<ll>());

	ll ans = 0;
	REP(i, N) {
		ans += a[2 * i + 1];
	}

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


Measured memory_bytes: 2560
#include <iostream>
#include <cstring>
#include <stdlib.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <math.h>
#include <string>
#include <map>
#include <cstdlib>
#include <sstream>
#include <bitset>
using namespace std;

typedef long long ll;
typedef pair<ll,ll> P;


int main()
{
    string S,T;
    cin >> S >> T;
    int ans=0;
    for(int i=0; i<S.size(); i++){
        if(S[i]!=T[i]) ans++;
    }
    cout << ans << endl;




    return 0;
}

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

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>
#include<iomanip>
#include<unordered_set>
#include<bitset>
#include<complex>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

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

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

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

	int A, B, K;
	cin >> A >> B >> K;

	int d = min(K, A);
	A -= d;
	K -= d;
	B = max(0LL, B - K);

	cout << A << " " << B << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using P = pair<ll,ll>;
const ll mod = 1e9+7;
#define ALL(x) (x).begin(),(x).end()
#define pow(x,y) modpow(x,y)
#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define REPS(i,n) for(ll (i)=1;(i)<=(n);(i)++)
#define RREP(i,n) for(ll (i)=(n-1);(i)>=0;(i)--)
#define RREPS(i,n) for(ll (i)=(n);(i)>0;(i)--)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());

template <class T = int>T in(){
    T x;
    cin >> x;
    return (x);
}

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

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

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(10);
    int N = in();
    vector<int> A(N);
    REP(i,N)A[i] = in();
    int count = 1;
    int answer = 0;
    sort(ALL(A),greater<>());
    REP(i,N-1){
        if(A[i] == A[i+1]){
            count++;
        }else{
            if(count < A[i]){
                answer += count;
            }else{
                answer += count - A[i];
            }
            count = 1;
        }
    }
    if(A[N-2] != A[N-1]){
        if(A[N-1] != 1)answer++;
    }else{
        if(count < A[N-1]){
            answer += count;
        }else{
            answer += count - A[N-1];
        }
    }
    cout << answer << "\n";
}

Measured memory_bytes: 640
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String input = sc.nextLine();
        // System.out.println(input);
        String[] inputs = input.split(" ", 0);
        int hp = Integer.parseInt(inputs[0]);
        int attack = Integer.parseInt(inputs[1]);
        int count = 0;
        while(true){
            hp -= attack;
            count++;
            if(hp <= 0){
                break;
            }
        }
        System.out.println(count);
    }
}

Measured memory_bytes: 20820
#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<map>
using namespace std;
int main() {
  long long n,ans=0;
  cin >> n;
  n++;
  while(n>9) {
    n/=10;
    ans++;
  }
  cout << n-1+ans*9 << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include<bits/stdc++.h>
#include<vector>
#include<string>
#define ll long long
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define vi vector<ll>
#define el printf("\n")
#define N 100001
using namespace std;



int main()
{   IOS;
cout.precision(30);
   string S;
   cin >> S;
   ll x=S.size();string ch1="",ch2="";
   for(int i=0;i<x;i++)
   {
       if(i%2==0)
       {
           ch1+="0";
           ch2+="1";
       }
        if(i%2==1)
       {
           ch2+="0";
           ch1+="1";
       }
   }
   ll a=0,b=0;
   for(int i=0;i<x;i++)
   {
       if(S[i]!=ch1[i])
        a++;
       if(S[i]!=ch2[i])
        b++;
   }
   cout << min(a,b);
    return 0;
}


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

typedef long long ll;
const ll INF = 1e18;
const int BIG = 1e9 + 555;

int a, b;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	
	cin >> a >> b;
	
	if(b == 1){
		cout << "0\n";
		return 0;
	}

	if(a >= b){
		cout << "1\n";
		return 0;
	}
	
	int ans = 1;
	int x = a - 1;
	while(true){
		ans++;
		a += x;
		if(a >= b){
			cout << ans << '\n';
			return 0;
		}
	}

	return 0;
}


Measured memory_bytes: 256