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

int main(void){
  int N,count=0;
  cin>>N;
  vector<int>height,core;
  height.resize(N);
  core.resize(N);

  for(int i=0;i<N;i++)cin>>height[i];
  for(int t=0;t<N;t++){
    for(int j=0;j<t+1;j++)if(height[t+1]>=height[j])core[t]++;
    if(core[t]==t+1)count++;
  }
  cout<<count+1;
  return 0;
}


Measured memory_bytes: 256
N,W=map(int,input().split())
v=[0]*(N+1)
w=[0]*(N+1)
list0=[[0 for j in range (W+1)]for i in range(N+1)] 

for i in range(1,N+1):
    v[i],w[i]=map(int,input().split())
    
for i in range(1,N+1):
    for j in range(1,W+1):
        if j-w[i]<0:
            list0[i][j]=list0[i-1][j]
        elif i<=0:
            list0[i][j]=0
        elif i<=j and j<=0:
            list0[i][j]=0
        else:
            list0[i][j]=max(v[i]+list0[i-1][j-w[i]],list0[i-1][j])
        
        
        
print(list0[N][W])



Measured memory_bytes: 42348
#include<stdio.h>
int main(){
int a,b;
scanf("%d %d",&a,&b);
if(a < b){
printf("a < b\n");
}
else if(a > b){
printf("a > b\n");
}
else if(a==b){
printf("a == b\n");
}
return 0;
}

Measured memory_bytes: 580
#include <iostream>
#include <vector>

using namespace std;
typedef long long ll;

const ll MOD = 2019;

int main(){
    ll l, r;
    cin >> l >> r;
    ll ans = MOD - 1;
    r = min(r, l + MOD);
    for(ll i = l; i <= r; ++i){
        for(ll j = i + 1; j <= r; ++j){
            ans = min(ans, (i * j) % MOD);
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <math.h>
#include <utility>
#include <algorithm>
#include <functional>
#include <vector>
#include <numeric>
#include <bits/stdc++.h>
#include <atcoder/all>

#define int long long

struct edge {
    int to;
    int cost;
};

using namespace std;
using namespace atcoder;
using vi = vector<int>;
using vii = vector<vector<int>>;
using vb = vector<bool>;
using qi = queue<int>;
using P = pair<int, int>;
using graph = vector<vector<edge>>;
// using graph = vector<vector<int>>;
using mint = modint1000000007;


#define FOR(i, a, b) for (int i = a; i < (b); i++)
#define REP(i,n) for(int i=0;i<n;i++)
#define delim(i, n) cout << (i == n-1 ? "\n" : " ")
#define print1(v) cout << fixed << setprecision(10) << v << "\n"
#define print2(v1, v2) cout << fixed << setprecision(10) << v1 << " " << v2 << "\n"
#define printvi(v, n) REP(iiii, n) { cout << v[iiii]; delim(iiii, n); }
#define printvii(v, h, w) REP(iiiii, h) { printvi(v[iiiii], w); }

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; }

const int inf = 1LL << 60;
// const int inf = 100000000;
const int mod = 1000000007;

const int maxn = 3e5+1;
int n, m, k;
vi a(maxn);

vi dx = {-1, 0, 0, 1};
vi dy = {0, -1, 1, 0};

int op (int a, int b) {
    return max(a, b);
}
int e () {
    return -1;
}

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

    cin >> n >> k;
    REP(i, n) {
        cin >> a[i];
    }
    
    vi tmp(maxn, 0);
    segtree<int, op, e> seg(tmp);
    REP(i, n) {
        int val = seg.prod(max(0LL, a[i]-k), min(maxn, a[i]+k+1));
        seg.set(a[i], val+1);
    }

    int ret = seg.prod(0, maxn);
    print1(ret);
}

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

int main() {
	string s;
	cin>>s;
	bool hard=0;
	for(int i=0;i<3;i++)
    {
        int j=i+1;
        if(s[i]==s[j])
        {
            hard=true;
        }
    }
    if(hard)
        cout<<"Bad"<<endl;
    else
        cout<<"Good"<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <map>
#define eps 0.0000000001
#define maxn 30009
#define inf 0x3f3f3f3f
#define mod 1000000009
#define ll long long
using namespace std;
int n,m;
struct ee
{
    int to;
    ll v;
};
vector<ee> g[maxn];
ll d[maxn];
int in[maxn];
bool v[maxn],vv[maxn];
int main()
{
    //freopen("d:\\in.txt","r",stdin);
    scanf("%d%d",&n,&m);
    for(int i=1;i<=m;i++)
    {
        ee p;
        int a;
        scanf("%d%d%lld",&a,&p.to,&p.v);
        g[a].push_back(p);
    }
    memset(in,0,sizeof(in));
    queue<int> q;
    bool ff=false;
    for(int i=1;i<=maxn-5;i++)
        d[i]=-10000000000000000;
    q.push(1);
    d[1]=0;
    ll ann=0;
    while(!q.empty())
    {
        int u=q.front();
        q.pop();
        v[u]=false;
        for(int i=0;i<g[u].size();i++)
        {
            ee r=g[u][i];
            if(d[r.to]<d[u]+r.v)
            {
                in[r.to]++;
               // printf("%d %d\n",r.to,in[r.to]);
                if(in[r.to]==5000)
                {
                    ann=d[n];
                    //printf("d[n]=%lld\n",d[n]);
                }
                if(in[r.to]>60000)
                {

                    //printf("ann=%lld d[n]=%lld\n",ann,d[n]);
                    ff=true;
                    break;
                }
                d[r.to]=d[u]+r.v;
                if(d[n]>10000000000000000)
                {
                     ff=true;
                     break;
                }
                if(v[r.to]==false)
                {
                    q.push(r.to),v[r.to]=true;
                }
            }
        }
        if(ff)
            break;
    }
    if(ff&&(ann<d[n]||d[n]>10000000000000000))
        printf("inf\n");
    else
        printf("%lld\n",d[n]);
    return 0;
}


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

int main() {
  int N;
  cin >> N;
  
  vector<int> L(N);
  for (int i = 0; i < N; i++) {
    cin >> L.at(i);
  }
  sort(L.begin(), L.end());
  
  int ans = 0;
  for (int i = 0; i < N - 2; i++) {
    for (int j = i + 1; j < N - 1; j++) {
      int key = L.at(i) + L.at(j);
      int k = lower_bound(L.begin(), L.end(), key) - L.begin();
      ans += k - j - 1;
    }
  }
  
  cout << ans << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
#define ff first
#define ss second
#define sfi(a) scanf("%d",&a)
#define sfi2(a,b) scanf("%d %d",&a,&b)
#define sfi3(a,b,c) scanf("%d %d %d",&a,&b,&c)
#define sfll(a) scanf("%lld",&a)
#define all(a) a.begin(),a.end()
#define keepu(a) a.erase(unique(all(a)),a.end())
#define inf 1e7
#define m_p make_pair
#define min3(a,b,c) min(a,min(b,c))
#define pb push_back
#define mem(x,val) memset(x,val,sizeof(x))
#define read freopen("output.txt","r",stdin)
#define write freopen("input.txt","w",stdout)
#define FAST  ios_base::sync_with_stdio(0);cout.tie(0)
#define sqr(x) ((x)*(x))

typedef long long ll;
const ll mod = 1e9+7;
const int sz = 500;


int main(){

    string str;
    cin >> str;

    if(str[0]=='7' || str[1]=='7'|| str[2]=='7') puts("Yes");
    else puts("No");

    return 0;
}


Measured memory_bytes: 3596
#include <cstdio>
using namespace std;;

int main(){
	int a, b;
	scanf("%d %d", &a, &b);
	if(a > 0){
		printf("Positive");
	}else if(a <= 0 && b >= 0){
		printf("Zero");
	}else{
		if((b - a) % 2 == 0) printf("Negative");
		if((b - a) % 2 == 1) printf("Positive");
	}
	printf("\n");
	return 0;
}

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

using namespace std;
#define  ll long long
#define ld long double
#define f first
#define s second
const int N = 2e5+5;

ll n,k,sum[N],mod=1e9+7;

int main()
{

    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    cin >> n >> k;
    for(int i=2; i<=n+1; i++)
    {
        sum[i] = i+sum[i-1]-1;
    }

    ll ans = 0;
    for(int i=k; i<=n+1; i++)
    {
        ll mn = sum[i] , mx = sum[n+1] - sum[n+1-i];
        ans += (mx-mn+1);
        ans %= mod;
    }

    cout << ans << '\n';

    return 0;
}

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

typedef long long int ll;
typedef long unsigned lu;
typedef vector<ll> v;
typedef pair<ll,ll> p;
typedef vector <p> vp;
#define rep(i,j,k) for(ll i=j;i<k;i++)
#define repr(i,j,k) for(ll i=k;i>=j;i--)
#define read(a,n) rep(i,0,n) cin>>a[i];
#define show(a,n) rep(i,0,n) cout<<a[i]<<" ";
#define modulus 1000000007
#define MAX 100005
#define INF 1000000001
// #define cinv vl a(n) rep(i,0,n) { cin>>a[i]; }
#define fastio() ios_base::sync_with_stdio(false); cin.tie(NULL);
ll dp[MAX];

int main()
{
    fastio();
    int n;
    cin>>n;
    ll a[n];
    read(a,n);
    ll sum=0;
    for (int i = 0; i < n-1; i++)
    {
        if(a[i+1]<a[i])
        {
            sum+=abs(a[i]-a[i+1]);
            a[i+1]=a[i];
        }
        
    }
    cout<<sum<<"\n";
}



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

#define FI(i,a,b) for(int i=(a);i<=(b);i++)
#define FD(i,a,b) for(int i=(a);i>=(b);i--)

#define LL long long
#define Ldouble long double
#define PI 3.14159265358979323846264338327950288419

#define PII pair<int,int>
#define PLL pair<LL,LL>
#define mp make_pair
#define fi first
#define se second

using namespace std;

char s[55];

int main(){
	scanf("%s", s);
	int len = strlen(s);
	s[len - 8] = 0;
	puts(s);
	return 0;
}


Measured memory_bytes: 256
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <cassert>
#include <string.h>
//#include <unordered_set>
//#include <unordered_map>
//#include <bits/stdc++.h>

#define MP(A,B) make_pair(A,B)
#define PB(A) push_back(A)
#define SIZE(A) ((int)A.size())
#define LEN(A) ((int)A.length())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define fi first
#define se second

using namespace std;

template<typename T>inline bool upmin(T &x,T y) { return y<x?x=y,1:0; }
template<typename T>inline bool upmax(T &x,T y) { return x<y?x=y,1:0; }

typedef long long ll;
typedef unsigned long long ull;
typedef long double lod;
typedef pair<int,int> PR;
typedef vector<int> VI;

const lod eps=1e-11;
const lod pi=acos(-1);
const int oo=1<<30;
const ll loo=1ll<<62;
const int mods=998244353;
const int MAXN=1000005;
const int INF=0x3f3f3f3f;//1061109567
/*--------------------------------------------------------------------*/
inline int read()
{
	int f=1,x=0; char c=getchar();
	while (c<'0'||c>'9') { if (c=='-') f=-1; c=getchar(); }
	while (c>='0'&&c<='9') { x=(x<<3)+(x<<1)+(c^48); c=getchar(); }
	return x*f;
}
int n,ans;
char st[MAXN];
void solve()
{
	int t=n;
	for (int i=0;i<n;i++)
		if (st[i]=='1') upmin(t,max(i,n-i-1));
	upmax(ans,t);
}
int main()
{
	scanf("%s",st),n=strlen(st),ans=0;
	solve();
	for (int i=0;i<n;i++)
		if (st[i]=='0') st[i]='1';
		else st[i]='0';
	solve();
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 3916
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<ll,ll> pii;
typedef vector<pii> vpii;
 
#define pb(x) push_back(x)
#define ppb() pop_back()
#define mp(x,y) make_pair(x,y)
#define mod 1000000007
#define FOR0(i,n) for(int i=0;i<n;i++)
#define For(v) for(auto it = v.begin();it!=v.end();it++)
#define FOR(i,a,b) for(int i = a; i < b; i++)
#define FORD(i,a,b) for(int i=(a);i>=(int)(b);i--)
#define sf(n) scanf("%d", &n)
#define sfc(x) scanf("%c", &x)
#define pf(x) printf("%d", x)
#define pff(x) printf("%lf", x)
#define pfc(x) printf("%c", x)
#define pfs(x) printf("%s", x)
#define sf2(a,b) scanf("%d %d", &a, &b)
#define sf3(a,b,c) scanf("%d %d %d", &a, &b, &c)
#define pfn(n) printf("%d\n", n)
//#define pfs(n) printf("%d ", n)
#define ff first
#define ss second
#define mem(a,b) memset(a,b,sizeof(a))
#define sz size()
#define ll long long
#define fast ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
bool prime[500010];
void SieveOfEratosthenes(ll n)
{
    memset(prime,true, sizeof(prime));
 
    for (ll p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (ll i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
}
 
ll power(ll x,ll y)
{
    if (y == 0)
        return 1;
    else if (y%2 == 0)
        return power(x, y/2)*power(x, y/2);
    else
        return x*power(x, y/2)*power(x, y/2);
}
 

ll power1(ll a,ll b){
  ll res=1;
  while(b){
    if(b&1){
      res*=a;
    }
    a=a*a;
    b>>=1;
  }
  return res;
}

int main(){
  fast
  ll a[3],b[3];
  FOR0(i,3)cin>>a[i]>>b[i];
  ll freq[5]={0};
  FOR0(i,3){
    freq[a[i]]++;
    freq[b[i]]++;
  }
  sort(freq,freq+5,greater<ll>());
  if(freq[0]==2&&freq[1]==2&&freq[2]==1&&freq[3]==1)cout<<"YES";
  else cout<<"NO";
}

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

using namespace std;
using ll = long long;
using edge = struct {int to; ll cost;};

#define mod 1000000007
#define REP(i, n) for (int i = 0; i < n; i++)
#define INF (1 << 29)


//long C(long n, long r);
//long long gcd(long long a, long long b);
//long long lcm(long long a, long long b);


void solve()
{
    int n;
    cin >> n;
    set<int> s;
    REP(i, n){
        int d;
        cin >> d;
        s.insert(d);
    }
    cout << s.size() << "\n";
}

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

Measured memory_bytes: 256
from fractions import gcd

n=int(input())
a=list(map(int,input().split()))
mod=10**9+7

'''
lcm=1
for i in a:
 lcm=(lcm*i)//gcd(lcm,i)

ans=0
mod=10**9+7
for i in a:
 ans+=lcm//i
 ans%=mod
print(ans)
'''

from functools import reduce

lcm=reduce(lambda x,y :(x*y)//gcd(x,y),a)

'''
ans=0
mod=10**9+7
for i in a:
 ans+=lcm//i
 ans%=mod
'''
ans=sum(lcm//i for i in a)
ans%=mod
print(ans)

Measured memory_bytes: 6140
#include<stdio.h>
long long d[3010][3010],M=998244353;
int main(){
  int a,b,c,e,i,j;
  long long x,y,z;
  scanf("%d %d %d %d",&a,&b,&c,&e);
  d[a][b]=1;
  for(i=a;i<c;i++)d[i+1][b]=(d[i][b]*b)%M;
  for(j=b;j<e;j++)d[a][j+1]=(d[a][j]*a)%M;
  for(i=a;i<c;i++){
    for(j=b;j<e;j++){
      x=(d[i+1][j]*(i+1))%M;
      y=(d[i][j+1]*(j+1))%M;
      z=(d[i][j]*i*j)%M;
      d[i+1][j+1]=(x+y+M-z)%M;
    }
  }
  printf("%lld\n",d[c][e]);
  return 0;
}


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

int main() {
  long long X;
  cin >> X;
  long long a;
  int k;
  a = 100;
  k = 0;
  double b;
	//b = log((double)X/100.0)/log(1.01);
  
  
  while(a<X){
    k++;
    a = a*1.01;
    //cout<<k<<" "<<a<<endl;
  }
  cout<<k<<endl;
      
}



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

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string S;
  cin >> S;
  vector<bool> e(26, true);
  for (auto s : S)
    e[s - 'a'] = false;

  for (int i = 0; i < e.size(); i++) {
    if (e[i]) {
      cout << (char)(i + 'a') << endl;
      return 0;
    }
  }
  cout << "None" << '\n';
  return 0;
}


Measured memory_bytes: 512
#pragma comment(linker, "/STACK:102400000,102400000")
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <cmath>
#include <assert.h>
using namespace std;
#define vi vector<int>
#define pii pair<int,int>
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define SZ(x) (int)(x.size())
#define rep(i,a,b) for(int i=a;i<b;i++)
#define per(i,a,b) for(int i=b-1;i>=a;i--)
#define inf 1000000007
#define mod 1000000007
#define x first
#define y second
#define pi acos(-1.0)
#define DBG(x) cerr<<(#x)<<"="<<x<<"\n";
//#define dprintf(...) 
#define hash _hash
//#define dprintf(...) fprintf(outFile,__VA_ARGS__)
 
#define FOREACH(it,x) for(__typeof(x.begin()) it=x.begin();it!=x.end();it++)
#define ull unsigned long long
#define ll long long
#define N 100010
 
template <class T,class U>inline void Max(T &a,U b){if(a<b)a=b;}
template <class T,class U>inline void Min(T &a,U b){if(a>b)a=b;}
 
//FILE* outFile;

inline void add(int &a,int b){a+=b;while(a>=mod)a-=mod;}
 
int pow(int a,int b){
    int ans=1;
    while(b){
        if(b&1)ans=ans*(ll)a%mod;
        a=(ll)a*a%mod;b>>=1;
    }
    return ans;
}

ll a[2][2],b[2][2],c[2][2];
void mul(ll a[2][2],ll b[2][2]){
    rep(i,0,2)
        rep(j,0,2){
            c[i][j]=0;
            rep(k,0,2)c[i][j]+=a[i][k]*b[k][j]%mod;
        }
    rep(i,0,2)rep(j,0,2)a[i][j]=c[i][j]%mod;
}
char s[1005][1005];
int main(){
    int n,i,j,k,T,m=0,Q,ca=0;
    ll K;
    scanf("%d%d%lld",&n,&m,&K);
    rep(i,0,n)scanf("%s",s[i]);
    if(K<=1){puts("1");return 0;}
    K--;
    bool ok=0,ok1=0;
    rep(i,0,n)if(s[i][0]=='#'&&s[i][m-1]=='#'){ok=1;break;}
    rep(i,0,m)if(s[0][i]=='#'&&s[n-1][i]=='#'){ok1=1;break;}
    if(ok&&ok1){
        puts("1");return 0;
    }
    int sum=0;
    rep(i,0,n)rep(j,0,m)sum+=(s[i][j]=='#');
    if(!ok&&!ok1){
        printf("%d\n",pow(sum,(int)(K%(mod-1))));
        return 0;
    }
    int s1=0,s2=0;
    if(ok){
    rep(i,0,n){
        rep(j,0,m-1)if(s[i][j]=='#'&&s[i][j+1]=='#')s1++;
        if(s[i][0]=='#'&&s[i][m-1]=='#')s2++;
    }
    }
    else{
    rep(i,0,m){
        rep(j,0,n-1)if(s[j][i]=='#'&&s[j+1][i]=='#')s1++;
        if(s[0][i]=='#'&&s[n-1][i]=='#')s2++;
    }
    }
    //cerr<<sum<<" "<<s1<<" "<<s2<<"\n";
    a[0][0]=sum,a[0][1]=mod-s1,a[1][0]=0,a[1][1]=s2;
    b[0][0]=b[1][1]=1;
    while(K){
        if(K&1)mul(b,a);
        mul(a,a);K>>=1;
    }
    printf("%d\n",(b[0][0]+b[0][1])%mod);
    return 0;
}

Measured memory_bytes: 1280
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int count = 0;
		if (b >= a) {
			count = a;
		} else {
			count = a - 1;
		}
		System.out.println(count);
	}
}

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

using namespace std;
typedef long long ll;
typedef pair<ll, ll> p_ll;

template<class T>
void debug(T itr1, T itr2) { auto now = itr1; while(now<itr2) { cout << *now << " "; now++; } cout << endl; }
#define repr(i,from,to) for (int i=(int)from; i<(int)to; i++)
#define all(vec) vec.begin(), vec.end()
#define rep(i,N) repr(i,0,N)
#define per(i,N) for (int i=(int)N-1; i>=0; i--)

const ll MOD = pow(10,9)+7;
const ll LLINF = pow(2,61)-1;
const int INF = pow(2,30)-1;

vector<ll> fac;
void c_fac(int x=pow(10,6)+10) { fac.resize(x,true); rep(i,x) fac[i] = i ? (fac[i-1]*i)%MOD : 1; }
ll inv(ll a, ll m=MOD) { ll b = m, x = 1, y = 0; while (b!=0) { int d = a/b; a -= b*d; swap(a,b); x -= y*d; swap(x,y); } return (x+m)%m; }
ll nck(ll n, ll k) { return fac[n]*inv(fac[k]*fac[n-k]%MOD)%MOD; }
ll gcd(ll a, ll b) { if (a<b) swap(a,b); return b==0 ? a : gcd(b, a%b); }
ll lcm(ll a, ll b) { return a/gcd(a,b)*b; }


int main() {
  ll H; cin >> H;
  ll result = 1; while (result<=H) result *= 2;
  result--;
  cout << result << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <map>
#include <cstdio>

using namespace std;

int main() {
    int id;
    string type;
    map<string, int> mp;
    while (scanf("%d,", &id) != EOF) {
        cin >> type;
        mp[type]++;
    }
    cout << mp["A"] << endl;
    cout << mp["B"] << endl;
    cout << mp["AB"] << endl;
    cout << mp["O"] << endl;

    return 0;
}

Measured memory_bytes: 1244
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
All = [A, B, C, D, E]
_All = [A, B, C, D, E]
late = 10
late_menu = 0
total = 0
for menu in All:
    if menu % 10 == 0:
        total += menu
        _All.remove(menu)
if len(_All)>=1:
    for menu1 in _All:
        if menu1 % 10 <= late:
            late = menu1 % 10
            late_menu = menu1
    _All.remove(late_menu)
for x in _All:
    if x <= 10:
        x = 10
        total += x
    else:
        x = (x // 10 +1) * 10
        total += x
total = total + late_menu
print(total)

Measured memory_bytes: 3064
#include <stdio.h>

int main(void) {
	int H, W, i, j;
	while(1){
	scanf("%d %d", &H, &W);
	if(H == 0 && W == 0) break;
	for(i=0; i<H-1; i++){
		for(j=0; j<W; j++){
			if(i*j == 0 || j+1 == W)
				putchar('#');
			else putchar('.');
		}
		putchar('\n');
	}
	for(i=0; i<W; i++) putchar('#');
	putchar('\n');
	putchar('\n');
	}
	return 0;
}


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

int main() {
int a, b;
  cin >> a;
  cin >> b;
  
  if (a < b) {
    for (int i = 0; i < b; i++) {
      cout << a;
    }
  }
  else {
    for (int i = 0; i < a; i++) {
      cout << b;
  }
}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long 
#define int ll
#define pb push_back
#define sz(i) (int)(i.size())
#define fi first
#define se second
#define ld long double
#define pii pair<int, int>
#ifdef ONLINE_JUDGE
#define endl '\n'
#endif
const int inf = 0x3f3f3f3f3f3f3f3LL;
const int mod = 1e9 + 7;
using namespace std;
#ifndef ONLINE_JUDGE
#define tr(...) {__l(__LINE__);__f(#__VA_ARGS__, __VA_ARGS__);}
inline void __l(int line) { cerr << "#" << line << ": "; }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 tr(...)
#endif
template<class T> void smin(T& a, T val) {if (a > val) a = val;}template<class T> void smax(T& a, T val) {if (a < val) a = val;}template<typename T>inline std::ostream &operator << (std::ostream & os,const std::vector<T>& v){bool first = true;os << "[";for(auto i: v){if(!first)os << ", ";os << i;first = false;}return os << "]";}
const int N = 1e5 + 10;
// make sure N size is correctttt!!!!!!!!!

int dp[N][2], n;
// 0 => white, 1 => black
std::vector<int> v[N];

void dfs(int s, int p){
   int cnt = 0;
   int tt1 = 1, tt2 = 1;
   for(auto i: v[s]){
      if(i == p)continue;
      dfs(i, s);
      cnt++;
      tt1 *= (dp[i][0] + dp[i][1])%mod;
      tt1 %= mod;
      tt2 *= dp[i][0];
      tt2 %= mod;
   }
   if(cnt == 0){
      dp[s][0] = 1;
      dp[s][1] = 1;
   }
   else{
      dp[s][0] = tt1;
      dp[s][1] = tt2;
   }
}

int32_t main(){_

   cin>>n;

   for (int i = 0; i < n-1; ++i)
   {
      int x, y;
      cin>>x>>y;
      v[x].pb(y);
      swap(x, y);
      v[x].pb(y);
   }

   dfs(1,-1);

   cout<<(dp[1][0]+dp[1][1])%mod;

   //make sure N size is correct!!!!!!!!!
   return 0;
}

Measured memory_bytes: 15616
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = (A); I < (B); ++I)
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //ai>=v  x is sorted
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //ai>v  x is sorted
#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define REV(x) (reverse(x.begin(),x.end())) //reverse
#define TO(x,t,f) ((x)?(t):(f))
#define CLR(mat) memset(mat, 0, sizeof(mat))
#define FILV(x,a) fill(x.begin(),x.end(),a)
#define FILA(ar,N,a) fill(ar,ar+N,a)
#define NEXTP(x) next_permutation(x.begin(),x.end())
ll gcd(ll a,ll b){if(a<b)swap(a,b);if(a%b==0)return b;else return gcd(b,a%b);}
ll lcm(ll a,ll b){ll c=gcd(a,b);return ((a/c)*(b/c)*c);}//saisyo kobaisu
#define pb push_back
#define pri(aa) cout<<(aa)<<endl
#define mp(x,y) make_pair(x,y)
#define fi first
#define se second
const ll INF=1e9+7;
const ll N = 300003;

int LIS(vector<int> a){
	vector<int> dp;
	const int infi=1e9+7;
	int n = a.size();
	dp.resize(n);
	fill(dp.begin(),dp.end(),infi);
	for(int i=0;i<n;i++){
		*lower_bound(dp.begin(),dp.end(),a[i])=a[i];
	}
	int ans = lower_bound(dp.begin(),dp.end(),infi)-dp.begin();
	return ans;
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	vector<int> a;
	int n;cin>>n;a.resize(n);
	FOR(i,0,n)cin>>a[i];
	cout<<LIS(a)<<endl;
	return 0;
}



Measured memory_bytes: 4196
#include <bits/stdc++.h>
using namespace std;
int main() {
    string s;
    int a[26] = {};
    while(getline(cin, s)) {
        for(int i = 0; i < s.size(); i++) {
            char ch = s.at(i);
            if(isalpha(ch)) {
                if(isupper(ch)) {
                    ch = tolower(ch);
                }
                a[ch-'a']++;
            }
        }
    }
    for(int i = 0; i < 26; i++) {
        printf("%c : %d\n", (char)(i+'a'), a[i]);
    }
}


Measured memory_bytes: 3288
/* Manish Pant - insider_pants, hello_my_friend */
    
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

#define F first
#define S second
#define endl "\n"
#define pb push_back

typedef long long ll;
typedef long double ldob;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

template <class T> ostream& operator << (ostream &os, const vector<T> &v) { for (T i : v) os << i << " "; return os; }
template <class T> ostream& operator << (ostream &os, const set<T> &v) { for (T i : v) os << i << " "; return os; }
template <class T> ostream& operator << (ostream &os, const multiset<T> &v) { for (T i : v) os << i << " "; return os; }
template <class T, class S> ostream& operator << (ostream &os, const pair<T, S> &v) { os << v.F << ' ' << v.S; return os; }
template <class T, class S> ostream& operator << (ostream &os, const map<T, S> &v) { for (auto i : v) os << '(' << i.F << " => " << i.S << ')' << ' '; return os; } 

void fast()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}

ll n; 

void solve()
{
    ll temp = 100;
    ll c = 0;
    while(temp < n)
    {
        temp += (temp / 100);
        c++;
    }
    cout << c << endl;
}

int main()
{
    fast();
    cin >> n;
    solve();
}

Measured memory_bytes: 3640
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
from functools import reduce

i_i = lambda: int(i_s())
i_l = lambda: list(map(int, stdin.readline().split()))
i_s = lambda: stdin.readline().rstrip()

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

def gcd_list(l):
    return reduce(gcd, l)

N = i_i()
A = i_l()

print(gcd_list(A))

Measured memory_bytes: 14668
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**7)
import bisect
import heapq
import itertools
import math
import numpy as np
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from math import gcd
from operator import add, itemgetter, mul, xor
def cmb(n,r,mod):
  bunshi=1
  bunbo=1
  for i in range(r):
    bunbo = bunbo*(i+1)%mod
    bunshi = bunshi*(n-i)%mod
  return (bunshi*pow(bunbo,mod-2,mod))%mod
mod = 10**9+7
def I(): return int(input())
def LI(): return list(map(int,input().split()))
def MI(): return map(int,input().split())
def LLI(n): return [list(map(int, input().split())) for _ in range(n)]

n = I()

#graph[i]には頂点iと繋がっている頂点を格納する
graph = [[] for _ in range(n+1)]
prev_col = [0]*(n+1)
a_b = []
k=0
for i in range(n-1):
    a,b = MI()
    a_b.append(str(a)+" "+str(b))
    graph[a].append(b)
    graph[b].append(a)
#check[i] == -1ならば未探索
check = [-1]*(n+1)
check[0] = 0
check[1] = 0
for i in range(n+1):
    k = max(len(graph[i]),k)
d = deque()
d.append(1)
ans = dict()
while d:
    v = d.popleft()
    check[v] = 1
    cnt = 0
    for i in graph[v]:
      if check[i] != -1:
        continue
      cnt = cnt+1
      if prev_col[v] == cnt:
        cnt = cnt + 1
      prev_col[i] = cnt
      ans[str(min(i,v))+" "+str(max(i,v))]=cnt
      d.append(i)
print(k)
for key in a_b:
    print(ans[key])


Measured memory_bytes: 65456
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <set>
#include <map>
#include <algorithm>

#define int long long
#define MOD7 1000000007
#define MOD9 1000000009

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

using namespace std;

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

int nextInt() {int a; cin >> a; return a;}
char nextChar() {char a; cin >> a; return a;}
double nextDouble() {double a; cin >> a; return a;}
string nextString() {string a; cin >> a; return a;}

void inputVector(vector<int> &v, int &n) {rep(i,n){v.push_back(nextInt());}}
void inputVector(vector<double> &v, int &n) {rep(i,n){v.push_back(nextDouble());}}
void inputVector(vector<string> &v, int &n) {rep(i,n){v.push_back(nextString());}}

map<string, vector<string>> infos;
map<string, set<string>> memo;

set<string> solve(string team) {
    if (infos.find(team) == infos.end()) {
	set<string> tmp;
	tmp.insert(team);
	return tmp;
    }

    if (memo.find(team) != memo.end()) {
	return memo[team];
    }

    vector<string> mems = infos[team];
    set<string> ret;
    rep(i, mems.size()) {
	set<string> tmp = solve(mems[i]);
	for (string str : tmp) {
	    ret.insert(str);
	}
    }
    memo[team] = ret;
    return ret;
}

signed main() {
    int n;
    while (cin >> n) {
	if (n == 0) break;

	infos.clear();
	memo.clear();

	string firstTeam;
	rep(i, n) {
	    string str;
	    cin >> str;

	    string team = str.substr(0, str.find(":"));
	    if (i == 0) firstTeam = team;

	    string names = str.substr(str.find(":") + 1);
	    names.substr(0, names.size() - 1);

	    vector<string> tmp;
	    while (names.find(",") != string::npos) {
		tmp.push_back(names.substr(0, names.find(",")));
		names = names.substr(names.find(",") + 1);
	    }
	    tmp.push_back(names.substr(0, names.size() - 1));

	    infos.insert(make_pair(team, tmp));
	}

	cout << solve(firstTeam).size() << endl;
    }


    return 0;
}

Measured memory_bytes: 3336
package main

import (
	"fmt"
)

func main() {
	n := 0
	fmt.Scan(&n)
	arr := make([]int, n)
	for i := range arr {
		fmt.Scan(&arr[i])
	}
	min := -1
	cnt := 0
	for _, v := range arr {
		if min == -1 {
			min = v
			cnt++
			continue
		}
		if min < v {
			continue
		}
		min = v
		cnt++
		continue
	}
	fmt.Println(cnt)
}


Measured memory_bytes: 5376
#include<bits/stdc++.h>
#define st first
#define nd second
using namespace std;
using pii = pair<int, int>;
int main(){
    string s,t,u;
    cin >> s >> t;
    int a,b;
    scanf("%d%d",&a,&b);
    cin >> u;
    if(s==u) a--;
    if(t==u) b--;
    printf("%d %d",a,b);


}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define SZ(X) ((int)(X).size())
#define endl "\n";
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	// freopen("input.txt", "r", stdin);
	// freopen("output.txt", "w", stdout);
	string s;
	cin>>s;
	for (int i = 0; i < SZ(s); ++i)
		{
			if(i%2==0) cout<<s[i];
		}	

   return 0;
}


Measured memory_bytes: 3748
def north(d):
    d[0], d[1], d[5], d[4] = d[1], d[5], d[4], d[0]


def west(d):
    d[0], d[2], d[5], d[3] = d[2], d[5], d[3], d[0]


def east(d):
    d[0], d[3], d[5], d[2] = d[3], d[5], d[2], d[0]


def south(d):
    d[0], d[4], d[5], d[1] = d[4], d[5], d[1], d[0]


F = {'N': north, 'W': west, 'E': east, 'S': south}

d, os = list(map(int, input().split())), input()

for o in os:
    F[o](d)

print(d[0])

Measured memory_bytes: 7800
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define RFOR(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define rep(i,n) FOR(i,0,(n))
#define REPS(i,n) FOR(i,1,(n)+1)
#define RREP(i,n) RFOR(i,0,(n))
#define rng(x) (x).begin(),(x).end()
#define rrng(x) (x).rbegin(),(x).rend()
#define debug(x) cout << #x << " = " << (x) << endl;
#define SORT(x) sort(rng(x))
#define RSORT(x) sort(rrng(x))
#define SUM(x) accumulate(rng(x),0)
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define uni(x) x.erase(unique(rng(x)),x.end())
#define SP << " " <<
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using pii = pair<int, int>;
using tiii = tuple<int, int, int>;
const int mod = 1000000007;
const double EPS = 1e-9;
const int INF = (1<<30)-1;
const ll INFLL = (1LL<<62)-1;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
//cout << fixed << setprecision(10);

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

ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}

int main () {
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;

  vi nums;
  int now = 1;
  int cnt = 0;
  rep(i,n) {
    if (s[i] == (char)('0' + now)) cnt++;
    else {
      nums.pb(cnt);
      now = 1 - now;
      cnt = 1;
    }
  }
  if (cnt != 0) nums.pb(cnt);
  if (nums.size()%2 == 0) nums.pb(0);

  int add = 2*k + 1;
  int ans = 0;
  for (int i = 0; i < nums.size(); i+=2) {
    int tmp = 0;

    int left = i;
    int right = min(i+add, (int)nums.size());
    for (int j = left; j < right; ++j) {
      tmp += nums[j];
    }
    ans = max(tmp, ans);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 1020
// https://atcoder.jp/contests/arc084/tasks/arc084_b
//
#![allow(unused_imports)]
use std::io::*;
use std::fmt::*;
use std::str::*;
use std::cmp::*;
use std::collections::*;

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

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

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

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

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

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

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

#[allow(unused_macros)]
macro_rules! dvec {
    ($t:expr ; $len:expr) => {
        vec![$t; $len]
    };

    ($t:expr ; $len:expr, $($rest:expr),*) => {
        vec![dvec!($t; $($rest),*); $len]
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

fn main() {
    input! {
        k: usize
    };

    let mut dp = vec![1e9 as i64; k];
    let mut q = VecDeque::new();

    dp[1] = 1;
    q.push_back((1, 1i64));

    while let Some((modulo, keta)) = q.pop_front() {
        let m10 = modulo * 10 % k;
        if dp[m10] > keta {
            dp[m10] = keta;
            q.push_front((m10, keta));
        }
        let mp1 = (modulo + 1) % k;
        if dp[mp1] > keta+1 {
            dp[mp1] = keta+1;
            q.push_back((mp1, keta+1));
        }
    }
    println!("{}", dp[0]);
}


Measured memory_bytes: 6396
#include <stdio.h>

int main()
{
  int a,b,c,d,e,k;
  int t=0;
  scanf("%d\n%d\n%d\n%d\n%d\n%d",&a,&b,&c,&d,&e,&k);

  if(e-a>k || d-a>k || c-a>k || b-a>k)
    t=1;

  if(c-b>k||d-b>k||e-b>k||d-c>k||e-c>k||e-d>k)
    t=1;

  if(t==0)
    printf("Yay!");

  else if(t==1)
    printf(":(");
  
  return 0;
}

Measured memory_bytes: 128
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 2000000000
#define EQ(a,b) (abs((a)-(b))<EPS)
vector<string> v;
int main()
{
	int n;
	cin >> n;
	for(int i=0;i<n;i++)
	{
		v.clear();
		int out=0;
		while(1)
		{
			string s;
			cin >> s;
			if(s=="OUT")
			{
				out++;
			}
			else
			{
				v.pb(s);
			}
			if(out==3)break;
		}
		int point=0,runner=0,f=0,s=0,t=0;
		for(int j=0;j<v.size();j++)
		{
			if(v[j]=="HIT")
			{
				if(t)
				{
					point++;
					runner--;
				}
				t=s;
				s=f;
				f=1;
				runner++;
			}
			else
			{
				f=0;s=0;t=0;
				point+=(runner+1);
				runner=0;
			}
		}
		cout << point << endl;
	}
	return 0;
}

Measured memory_bytes: 1220
mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    D = int(input())
    C = list(map(int, input().split()))
    S = []
    for _ in range(D):
        S.append(list(map(int, input().split())))
    ans = 0
    last = [-1] * 26
    for d in range(D):
        t = int(input()) - 1
        ans += S[d][t]
        last[t] = d
        for i in range(26):
            ans -= C[i] * (d - last[i])
        print(ans)


if __name__ == '__main__':
    main()


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

int main(){
  // xっていう入れ物(変数)を使います！という宣言
  // answerっていう入れ物(変数)を使います！という宣言
  int x,answer;
  // xにユーザーの入力をいれる
  cin>>x;
  // answer に xの3じょうを代入
  answer = x * x * x;
  // answer の内容を出力
  cout << answer << endl;
  return 0;
}


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

int main() {
    int N, K;
    cin >> N >> K;
    vector<int> A(N);

    int sum = 0;
    rep(i, N) {
        cin >> A[i];
        sum += A[i];
    }

    // 約数の全列挙
    set<int> st;
    for (int i=1; i*i<=sum; ++i) {
        if (sum%i == 0) {
            st.insert(i);
            st.insert(sum/i);
        }
    }

    int ans = 1;
    for (int d : st) {

        int s = 0;
        vector<int> a(N);
        rep(i, N) {
            s += A[i]%d;
            a[i] = A[i]%d;
        }

        sort(a.rbegin(), a.rend());

        int pnum = s/d;
        int s1 = 0;
        rep(i, pnum) {
            s1 += (d - a[i]);
            s -= a[i];
        }

        if (max(s, s1) <= K) {
            assert(s >= s1);
            ans = max(ans, d);
        }
    }

    cout << ans << endl;

}


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

class Program
{
    static void Main(string[] args)
    {
        // 入力
        int n = int.Parse(Console.ReadLine());
        int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();

        var ans = 0;
        int[] count = new int[n];
        for (int i = 0; i < n; i++)
        {
            if (a[i] % 2 == 0)
            {
                IEnumerable<int> tmp = PrimeFactors(a[i]);
                count[i] = tmp.Count(value => value == 2);
            }
        }

        Console.WriteLine(count.Sum());
    }

    //素因数分解
    public static IEnumerable<int> PrimeFactors(int n)
    {
        int i = 2;
        int tmp = n;

        while (i * i <= n) //※1
        {
            if (tmp % i == 0)
            {
                tmp /= i;
                yield return i;
            }
            else
            {
                i++;
            }
        }
        if (tmp != 1) yield return tmp;//最後の素数も返す
    }

}


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

int main(){
  int A,B;
  cin>>A>>B;
  for (int i=0;i<B+2;i++){
    cout<<"#";
  }
  cout<<endl;
  for (int i=0;i<A;i++){
    string C;
    cin>>C;
    cout<<"#"<<C<<"#"<<endl;
  }
  for (int i=0;i<B+2;i++){
    cout<<"#";
  }
  cout<<endl;
}

Measured memory_bytes: 256
/*
	Behind every successful man 
	there's a lot of unsuccessful years
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back 
#define eb emplace_back
#define fn for(int i =0 ;i <n;i++)
#define fn1 for( int i =1;i<=n;i++)
#define fm for(int j =0 ;j <m;j++)
#define fm1 for(int j =1;j<=m;j++)
#define fi first
#define se second
#define E endl
#define MOD 1000000007
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
const int N = 1e6+5;
const int INF = 1e18L;
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << 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...);
}
int ar[N];
int dp[N];
signed main(){
	// #ifndef ONLINE_JUDGE
	// freopen("input.txt","r",stdin);
	// freopen("output.txt","w",stdout);
	// #endif
	IOS;
	int T=1;
	// cin >> T;
	vector<int>v;
	for(int i =0;i<=60;i++)v.pb(pow(2,i));
	while(T--){
		int n;
		cin >> n ;
		int idx = lower_bound(all(v),n)-v.begin();
		if(binary_search(all(v),n)){

		}
		else
			idx--;
		int ans=0;
		for(int i =0 ;i<=idx;i++)ans+=v[i];
			cout <<ans<<endl;
	
	}
	
	cerr << "Time Taken : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
	return 0;
}

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

int main () {
  int a=0,b=0,c=0,d=0,e=0;
  string S,T;
  cin>>S;
  T="ATCG";
  c=S.size();
  for(int i =0;i<c;i++){
    for( int j=0;j<4;j++){
      if(S.at(i)==T.at(j)){
        //cout<<a<<endl;
        a++;
        d++;
        //cout<<a<<endl;
        e=a;
        //cout<<e<<endl;
      }
    }
    if(d==0){
      a=0;
    }
    d=0;
    if(b<e){b=a;}
  }
  cout<<b<<endl;
}

Measured memory_bytes: 256
#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 FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define VRSORT(v) sort(v.begin(), v.end(),greater<int>());
#define INF 999999999
#define MOD 1000000007
#define M_PI 3.14159265358979323846
#define ALL(X) (X).begin(),(X).end()

#ifdef __LOCAL
    #define DBG(X) cout << #X << " = " << (X) << endl;
    #define SAY(X) cout << (X) << endl;
#else
    #define DBG(X)
    #define SAY(X)
#endif

#ifdef __LOCAL
    #include <filesystem>
    namespace fs = std::filesystem;
#endif

using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

int dx[]={1, 0, -1, 0, 0};
int dy[]={0, 1, 0, -1, 0};
const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);
const int NIL = -1;
static mt19937 _g(time(nullptr));
 
std::string pad(int num){ char buffer[4]; std::snprintf(buffer, sizeof(buffer), "%03d", num); return buffer;}
inline ll randint(ll a, ll b) { ll w = (_g() << 31LL) ^ _g(); return a + w % (b - a + 1); }
inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T> inline T sign(T x) { return T(x > 0) - T(x < 0); }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline T fetch() { T ret; cin >> ret; return ret; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

int N;
vector<int> A;

void input(){
  fast_io();
  #ifdef __LOCAL
    fs::path p = __FILE__;
    fs::path input,output;
    input = output = p.parent_path();
    input += string("/input/") + string(p.stem()) + string(".txt");
    output += string("/output/") + string(p.stem()) + string(".txt");
    freopen(input.c_str(), "r", stdin);
    freopen(output.c_str(), "w", stdout);
  #endif
  cin >> N;
  A = fetch_vec<int>(N);
}


int solve(){
  vector<int> ans(N,0);
  for(int i=N;i>=1;i--){
    int a=0;
    int k=i;
    while(k<=N) {a^=ans[k-1];k+=i;}
    if(a==A[i-1]) continue;
    else ans[i-1] ^= 1;
  }
  int M=accumulate(ALL(ans),0);
  vector<int> ret;
  REP(i,N) if(ans[i]) ret.push_back(i+1);
  cout << M << endl;
  cout << ret << endl;
  
  return 0;
}

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


Measured memory_bytes: 3192
#include <bits/stdc++.h>
using namespace std;
 
int main(){
    int N;
    cin >> N;
    map<int, int> mp;
    vector<int> values;
    for(int i=0; i<N; i++){
        int a;
        cin >> a;
        values.push_back(a);
        mp[a]++;
    }
 
    sort(values.rbegin(), values.rend());
    values.erase(std::unique(values.begin(), values.end()), values.end());
 
    int ans = 0;
    for(auto a : values){
        for(int i=30; i>=0; i--){
            if(mp[a] == 0) break;
            int b = (1<<i) - a;
            if(!mp.count(b)) continue;
            int add;
            if(a == b){
                add = mp[a]/2;
            }else{
                add = min(mp[a], mp[b]);
            }
            ans += add;
            mp[a] -= add;
            mp[b] -= add;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 10356
#pragma GCC target ("avx2")
#pragma GCC optimize ("unroll-loops")
#pragma GCC optimize ("O3")
#include "bits/stdc++.h"
#include <unordered_set>
#include <unordered_map>
#include <random>
using namespace std;
typedef long long ll;
const ll MOD = /*1'000'000'007LL;*/ 998'244'353LL;
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int (i)=0; (i)<(n); (i)++)
const int dx[4]={ 1,0,-1,0 };
const int dy[4]={ 0,1,0,-1 };

int K;
bool canVis[100000][46];

void solve(int n, int k){
    canVis[n][k] = true;
    rep(i, 10){
        if(i > k) break;
        if(!canVis[(10*n+i)%K][k-i]){
            solve((10*n+i)%K, k-i);
        }
    }
}

signed main(){
    cin >> K;
    for(int i=1; i<=9*5; i++){
        memset(canVis, false, sizeof(canVis));
        solve(0, i);
        if(canVis[0][0]){
            cout << i << endl;
            return 0;
        }
    }
}

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

#define ll long long
#define INF 99999999
#define rep(i,n) for(int i=0,temp=(int)(n);i<temp;++i) //vec.size()がnの時等の高速化
#define all(x) (x).begin(),(x).end()
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define vint vector<int>
#define vvint vector<vector<int>>

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


int main(){
  int a,b,c;
  cin >> a >> b >> c;
  cout << max(10*a+b+c,max(10*b+a+c,10*c+a+b)) << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef pair<char, bool> pi; //0 left, 1 right
#define f first
#define s second

long long n, q;
pi spells[200005];
string ss;
long long upper, lower, mid, ri, le;

long long bsta(long long guess) {
	long long pos = guess;
	for (long long i = 0; i < q; i++) {
		if (spells[i].f == ss[pos]) {
			if (spells[i].s) pos++;
			else pos--;
		}
		if (pos < 0) return -1; //Felong long off left side
		else if (pos >= n) return 1; //Felong long off right side
	}
	return 0;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
	cin >> n >> q >> ss;
	for (long long i = 0; i < q; i++) {
		char x;
		cin >> spells[i].f >> x;
		if (x == 'L') spells[i].s = 0;
		else spells[i].s = 1;
	}
	lower = -1, upper = n;
	while (upper - lower > 1) {
		mid = ((upper + lower)>>1);
		if (bsta(mid) == -1) lower = mid;
		else upper = mid;
	}
	le = upper;
	lower = -1, upper = n;
	while (upper - lower > 1) {
		mid = ((upper + lower)>>1);
		if (bsta(mid) == 1) upper = mid;
		else lower = mid;
	}
	ri = lower;
	cout << ri - le + 1;
}


Measured memory_bytes: 976