akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include<list>
#include <algorithm>
#include <string>
#include <math.h>
#include<map>
#include <utility>

#include<queue>
using namespace std;
#define REP(i,k,n) for(int i=k;i<n;i++)
 
#define INF 1844674407370955161
typedef long long int ll;
#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))
#define MOD 1000000007

template<typename T>
int vector_finder(std::vector<T> vec, T number) {
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance( vec.begin(), itr );
  if (index != vec.size()) { // 発見できたとき
    return 1;
  }
  else { // 発見できなかったとき
    return 0;
  }
}

template<typename T>
T gcd(T a,T b){
	if(b>0){
		return gcd(b, a % b);
	}else{
		return a;
	}
}

template<typename T>
T lcm(T a,T b){
	T g = gcd(a, b);
	return a * b / g;
}

void clear( std::queue<pair<int,int> > &q )
{
   std::queue<pair<int,int> > empty;
   std::swap( q, empty );
}
bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }

    // 素数である
    return true;
}
template<typename T>
std::vector<T> enum_div(T n)//nの約数を列挙
{
	std::vector<T> ret;
	for(T i=1 ; i*i<=n ; ++i)
	{
		if(n%i == 0)
		{
			ret.push_back(i);
			if(i!=1 && i*i!=n)
			{
				ret.push_back(n/i);
			}
		}
	}
	return ret;
}


class DisjointSet{
    public:
        vector<int> rank, p;

        DisjointSet(){
        }

        DisjointSet(int size){
            rank.resize(size, 0);
            p.resize(size, 0);
            for (int i = 0; i < size;i++){
                makeSet(i);
            }
        }
        void makeSet(int x){
            p[x] = x;
            rank[x] = 0;
        }

        bool same(int x,int y){
            return findSet(x) == findSet(y);
        }
        void unite(int x,int y){
            link(findSet(x), findSet(y));
        }
        void link(int x,int y){
            if(rank[x]>rank[y]){
                p[y] = x;
            }else{
                p[x] = y;
                if(rank[x]==rank[y]){
                    rank[y]++;
                }
            }
        }
        int findSet(int x){
            if(x!=p[x]){
                p[x] = findSet(p[x]);
            }
            return p[x];
        }
};

int main()
{
    int sx, sy, tx, ty;
    cin >> sx >> sy >> tx >> ty;
    cout << "D";
    REP(i,0,tx-sx+1){
        cout << "R";
    }
    REP(i,0,ty-sy+1){
        cout << "U";
    }
    cout << "L";
    cout << "U";
    REP(i,0,tx-sx+1){
        cout << "L";
    }
    REP(i,0,ty-sy+1){
        cout << "D";
    }
    cout << "R";
    REP(i,0,tx-sx){
        cout << "R";
    }
    REP(i,0,ty-sy){
        cout << "U";
    }
    REP(i,0,tx-sx){
        cout << "L";
    }
    REP(i,0,ty-sy){
        cout << "D";
    }
    cout << endl;
}

Measured memory_bytes: 256
S = list(input())
# i = 2
while S != []:
    S.pop()
    S.pop()
    l = len(S)
    half = int(l / 2)
    # print(S)
    # print(S[0:half])
    # print(S[half:])
    if S[0:half] == S[half:]:
        print(l)
        exit()

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

long long mod(long long val, long long m) {
  long long res = val % m;
  if (res < 0) res += m;
  return res;
}

bool is_prime(long long N) {
    if (N == 1) return false;
    for (long long i = 2; i * i <= N; ++i) {
        if (N % i == 0) return false;
    }
    return true;
}

vector<pair<long long, long long> > prime_factorize(long long N) {
    vector<pair<long long, long long> > res;
    for (long long a = 2; a * a <= N; ++a) {
        if (N % a != 0) continue;
        long long ex = 0;
        while (N % a == 0) {
            ++ex;
            N /= a;
        }
        res.push_back({a, ex});
    }
    if (N != 1) res.push_back({N, 1});
    return res;
}

int main() {
  int N,ans=0,temp=-1;
  cin >> N;
  vector<int> B(N-1);
  rep(i,N-1) cin >> B[i];
  ans += B[0];
  rep(i,N-2){
    ans += min(B[i],B[i+1]);
  }
  ans += B[N-2];
  cout << ans << endl;
  
  return 0;
}


Measured memory_bytes: 3628
#include<stdio.h>
int main(void)
{
  int a,b,c,i,n;
  scanf("%d",&n);
  for(i=0;i<n;i++)
  {
    scanf("%d %d %d",&a,&b,&c);
    a=a*a;
    b=b*b;
    c=c*c;
    if(a+b==c ||b+c==a||c+a==b)
      printf("YES\n");
    else
      printf("NO\n");
  }
}

Measured memory_bytes: 1736
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i,n) for(ll i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define fi first
#define se second
#define endl "\n"

template<typename T> inline bool chmax(T &a, T b){if(a<b){a=b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;}
template<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){int len=d.size();rep(i,len){s<<d[i];if(i<len-1) s<<" ";}return s;}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){int len=d.size();rep(i,len){s<<d[i]<<endl;}return s;}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T> ostream& operator<<(ostream& s,const multiset<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){s<<"{"<<endl;for(auto itr=m.begin();itr!=m.end();++itr){s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;}s<<"}"<<endl;return s;}

const ll mod=1e9+7;
const ll inf=1e17;
const int INF=1e9;
const double EPS=1e-10;
const double PI=acos(-1);

int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    int n;
    cin>>n;
    vector<int> h(n),a(n,0);
    rep(i,n){
        cin>>h[i];
    }
    int ans=0;
    while(true){
        int ma=0,l=-1,r;
        rep(i,n)FOR(j,i,n){
            bool flag=true;
            FOR(k,i,j+1){
                if(a[k]>=h[k]){
                    flag=false;
                }
            }
            if(flag){
                if(chmax(ma,int(j-i+1))){
                    l=i,r=j;
                }
            }
        }
        if(l==-1){
            break;
        }
        while(true){
            bool flag=false;
            FOR(i,l,r+1){
                a[i]++;
                if(a[i]==h[i]){
                    flag=true;
                }
            }
            ans++;
            if(flag) break;
        }
        bool flag=true;
        rep(i,n){
            if(a[i]!=h[i]) flag=false;
        }
        if(flag) break;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main()
{
	long long A,B,C,K;
	long long a,b,c;

	cin >> A >> B >> C >> K;

	a = min(A,K);
	b = max((long long)0,min(K - a,B));
	c = max((long long)0,min(K - a - b,C));

	//cout << a << " " << b << " " << c << endl;

	cout << a - c << endl;

	return 0;
}

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

using namespace std;
typedef long long ll;
#define Inf 1 << 20
#define MInf -(1 << 20)


#define REP(n) for(int i = 0;i < (int)(n);i++)
#define rep(i,n) for(int i = 0;i < (int)(n);i++)
#define Rep(i,n,m) for(int i = (int)(n); i < (int)(m);i++)
#define rrep(i,n) for(int i = (int)(n - 1); i > -1;i--)
#define RRep(i,n,m) for(int i = (int)(n - 1); i > (int)(m);i--)
#define trav(a, x) for(auto& a : x)

#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort(ALL(V))
#define REVERSE(V) reverse(ALL(V))
#define RSORT(V) SORT(V);REVERSE(V)


#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define YES(n) cout << ((n) ? "YES" : "NO") << endl;
#define yes(n) cout << ((n) ? "yes" : "no") << endl;




int main()
{
    int N;
    cin >> N;
    vector<int> v(N),c(N);
    rep(i,N)
        cin >> v.at(i);
    rep(i,N)
        cin >> c.at(i);
    vector<int> list;
    rep(i,N)
    {
        if(0 < v[i] - c[i])
            list.push_back(v[i] - c[i]);
    }
    cout << accumulate(ALL(list),0) << 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 INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main()
{
    int N,p,pmin=200001,ans=0;
    cin >> N;
    for(int i=0; i<N; i++){
        cin >> p;
        if(pmin > p){
            pmin = p;
            ans++;
        }
    }
    cout << ans << endl;

    return 0;    
}

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

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    
    if (b==c and a!=b) cout << a << endl;
    else if (a==c and a!=b) cout << b << endl;
    else if (a==b and a!=c) cout << c << endl;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
  int r,c,rlu;

  while(1){
    cin>>r>>c;

    if(r == 0 && c == 0){
      break;
    }

    rlu = r	* c;

    if(rlu % 2 == 0){
      cout<<"yes"<<endl;
    }
    else{
      cout<<"no"<<endl;
    }
  }
  return 0;
}

Measured memory_bytes: 3088
n=int(input())


def check(n):
    ans=0
    for i in range(1,n+1):
        if n%i==0:
            ans+=1
    if ans==8:
        return True
    return False

ans=0
for i in range(1,n+1,2):
    if check(i):
        ans+=1
print(ans)

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

using namespace std;

vector<int> GetPos(vector<int> & a) {
  vector<int> pos(a.size());
  iota(pos.begin(), pos.end(), 0);
  sort(pos.begin(), pos.end(), [&](int l, int r) {
    return a[l] < a[r];
  });
  return pos;
}

int main() {
  int n;
  scanf("%d", &n);
  vector<int> a(n), b(n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  for (int i = 0; i < n; ++i) {
    scanf("%d", &b[i]);
  }
  bool ok = 1;
  vector<int> pa = GetPos(a), pb = GetPos(b);
  for (int i = 0; i < n; ++i) {
    ok &= a[pa[i]] <= b[pb[i]];
  }
  if (!ok) {
    puts("No");
    return 0;
  }
  for (int i = 0; i + 1 < n; ++i) {
    if (a[pa[i+1]] <= b[pb[i]]) {
      puts("Yes");
      return 0;
    }
  }
  vector<int> to(n);
  for (int i = 0; i < n; ++i)
    to[pa[i]] = pb[i];
  int now = to[0], cnt = 1;
  while (now) {
    ++cnt;
    now = to[now];
  }
  puts(cnt < n ? "Yes" : "No");
  return 0;
}


Measured memory_bytes: 2176
alp = "abcdefghijklmnopqrstuvwxyz"
ans = [False for _ in range(26)]
S = list(input())
for i in S:
    for p in range(26):
        if i == alp[p]:
            ans[p] = True
for i in range(26):
    if ans[i] == False:
        print(alp[i])
        break
else:
    print("None")

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

int main()
{
    int n;
    double x1, y1, r1, x2, y2, r2;

    cin >> n;

    while( n-- )
    {
        cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2 ;

        double dis = sqrt( ( x1 - x2 ) * ( x1 - x2 ) + ( y1 - y2 ) * ( y1 - y2 ) );
        if( dis > r1 + r2 )
            cout << 0 << endl;
        else if( r1 > dis + r2 )
            cout << 2 << endl;
        else if( r2 > dis + r1 )
            cout << -2 << endl;
        else
            cout << 1 << endl;
    }
    return 0;
}


Measured memory_bytes: 3132
#!/usr/bin python3
# -*- coding: utf-8 -*-

mod = 10**9+7
n = int(input())
seen = {}
# dp[i]: 左からi番目まで見た際の場合の数

dp = [0] * (n+1)
dp[0] = 1

for i in range(1, n+1):
    ci = input()
    j = seen.get(ci, 0)
    if j == 0:          #新しい色の追加
        dp[i]+=dp[i-1]
    elif j == i-1:      #直前と同じ
        dp[i]+=dp[i-1]
    else:
        dp[i]+=dp[i-1]  #新しい色の左以前を変える
        dp[i]+=dp[j]    #新しい色の左側を変える
        dp[i]%=mod
    seen[ci] = i
#    print(i,ci,dp,seen)
print(dp[n])

Measured memory_bytes: 42472
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
# def LF(): return [float(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  N,X,T=LI()
  ans=0
  for i in range(1,10000):
    ans+=X
    if ans>=N:
      return i*T

# main()
print(main())


Measured memory_bytes: 10780
#include<stdio.h>
int main()
{
    int A,B,C1,C2,C3;
    scanf("%d %d", &A, &B);
    C1=A+B;
    C2=A-B;
    C3=A*B;
    if(C1>=C2 && C1>=C3)
    {
        printf("%d", C1);
    }
    else if(C2>=C1 && C2>=C3)
    {
        printf("%d", C2);
    }
    else{
       printf("%d", C3);
    }
    return 0;
}


Measured memory_bytes: 128
#include<stdio.h>
#include<stdlib.h>
 
int main(){
  int A, B, C, D;
  scanf("%d%d%d%d", &A, &B, &C, &D);

  if(A+B>C+D)
    printf("Left\n");
  else if(A+B==C+D)
    printf("Balanced\n");
  else
    printf("Right\n");

}


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

signed main(){
    double d;
    cin >> d;
    double ans = max(sqrt(2) * d, (double)(int)(d + 1));    
    printf("%.10f\n", ans);
}


Measured memory_bytes: 3280
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
    int numberOfElements=0;
    int numberOfOperations=0;
        
    cin>>numberOfElements;
    vector<long long int> arr(numberOfElements);
    
    long long int sum=0;

    for(int i=0; i<numberOfElements; i++){
        cin>>arr[i];
        sum=sum+arr[i];
    }
    
    cin>>numberOfOperations;
    vector<vector<int>> op(numberOfOperations, vector<int>(2,0));
    
    for(int i=0; i<numberOfOperations; i++){
        cin>>op[i][0];
        cin>>op[i][1];
    }

    sort(arr.begin(), arr.end());

    vector<long long> auxiliary(arr[numberOfElements-1]+1, 0);
    vector<long long int> output;

    for(int i=0; i<numberOfElements; i++){
        auxiliary[arr[i]-1]++;
    }

    for(int i=0; i<numberOfOperations; i++){
        if(auxiliary.size()<=max(op[i][0],op[i][1])){
            auxiliary.resize(max(op[i][0],op[i][1])+1, 0);
        }
        sum=sum+(auxiliary[op[i][0]-1])*(op[i][1]-op[i][0]);
        auxiliary[op[i][1]-1]+=auxiliary[op[i][0]-1];
        auxiliary[op[i][0]-1]=0;
        output.push_back(sum);
    }

    for(int i=0; i<numberOfOperations; i++){
        cout<<output[i]<<" ";
    }

    return 0;
}


Measured memory_bytes: 12104
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>

#include <complex>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#define debug(x) cerr << #x << " = " << (x) << endl;


#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 3000100

ll fac[SIZE];
ll inv[SIZE];

ll factorial(int n,int M){
  ll ret=1;
  if(n<=1) return 1;
  return fac[n];
  
  for(int i=1;i<=n;i++){
    ret = (ret*i)%M;
  }
  
  return ret;
}

ll power(int k,int n,int M){
  if(n==0) return 1;
  if(n==1) return (ll)k;
  
  ll ret = power(k,n/2,M);
  
  ret=(ret*ret)%M;
  
  if(n%2==1)
    ret=(ret*k)%M;
  
  return ret;
}

void factorial_init(int n){
  fac[0] = 1;
  for(int i=1;i<=n;i++) fac[i] = (i * fac[i-1])%mod;

  inv[n] = power(fac[n],mod-2,mod);
  for(int i=n;i>=1;i--) inv[i-1] = (i*inv[i])%mod;
}

//nCm nPm nHm (mod M)

/*Combination*/
int C(int n,int m,int M){
  if(n<m) return 0;
  if(m==0 || n==m) return 1;
  
  ll chi = factorial(n,M);
  ll mot = (inv[m] * inv[n-m])%M;  
  ll ret = (chi*mot)%M;
  
  return (int)ret;
}

/*Combination with Repetitions*/
int H(int n,int m,int M){
  if(n==0 && m==0) return 1;
  return C(n+m-1,m,M);
}



bool solve(){
  int a,b,c,sx,sy;

  scanf("%d%d%d%d%d",&a,&b,&c,&sx,&sy);

  if(a +b + c == 0) return false;
  
  if(sx < sy){
    swap(sx,sy);
    swap(a,b);
  }

  ll ans_sum = 0;
  
  for(int i=sx-sy;i<=sx;i++){
    int p = i;
    int q = i - (sx-sy);

    if(p < a || q < b || (a==0 && p>0) || (b==0 && q > 0)) continue;

    ll ans = 1;

    ans = (ans * C(p-1,a-1,mod))%mod;
    ans = (ans * C(q-1,b-1,mod))%mod;
    ans = (ans * C(sx-i+(c+b+a-1),c+b+a-1,mod))%mod;
    
    ans_sum = (ans_sum + ans)%mod;
  }
  
  ans_sum = (ans_sum * factorial(a+b+c,mod))%mod;
  ans_sum = (ans_sum * inv[a])%mod;
  ans_sum = (ans_sum * inv[b])%mod;
  ans_sum = (ans_sum * inv[c])%mod;

  printf("%lld\n",ans_sum);

  return true;
}

int main(){

  factorial_init(3000000);
  
  while(solve());
  
  return 0;
}

Measured memory_bytes: 50024
import sys
from scipy.sparse.csgraph import floyd_warshall as f
input=sys.stdin.buffer.readline
def main():
  n,m,l=map(int,input().split())
  d=[[0]*(n+1)for _ in range(n+1)]
  for _ in range(m):
    a,b,c=map(int,input().split())
    d[a][b]=c
  d=f(f(d,0)<=l)-1
  d[d>n]=-1
  a=[d[tuple(map(int,input().split()))]for _ in range(int(input()))]
  print('\n'.join(map(str,map(int,a))))
main()

Measured memory_bytes: 24032
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <algorithm>
using namespace std;

long long N;

int main() {
    cin >> N;
    long long f = -1;
    for (long long i = 2; i * i <= N; i++) {
        if (N % i == 0) {
            f = i;
        }
    }
    cout << (f == -1? N - 1 : N / f + f - 2) << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<queue>
#include<vector>
#include<string.h>
#include<algorithm>
#include<iomanip>
using namespace std;
const int maxn = 55;

char mp[maxn][maxn];
int vis[maxn][maxn];
int n,m;
int num=0;
void dfs(int x,int y)
{
	if(vis[x][y]) return ;
	if(x<1||x>n||y<1||y>m) return ;
	vis[x][y]=1;
	if(mp[x][y]=='.') return;
	num++;
	dfs(x+1,y);
	dfs(x-1,y);
	dfs(x,y+1);
	dfs(x,y-1);
}

int check()
{
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++){
			if(vis[i][j]==0&&mp[i][j]=='#'){
				num=0;
				dfs(i,j);
				if(num==1) return 0;
			}
		}
	}
	return 1;
}

int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++){
		scanf("%s",mp[i]+1);
	}
	if(check()){
		printf("Yes\n");
	}else
		printf("No\n");

	return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <numeric>
#include <math.h>
#include <algorithm> 
#include <string>

#define rep(i,n) for(int (i) = 0;(i) < (n);(i)++)
#define sum(n) accumulate((n).begin(), (n).end(), 0)
using namespace std;


int main(){
	int h, w,check,outcheck;
	char cell[100][100];
	bool is_space_w[100], is_space_h[100];

	check = 0;
	outcheck = 0;

	rep(i, 100) {
		is_space_w[i] = false;
		is_space_h[i] = false;

	}
	
	cin >> h >> w;

	rep(i, h) {
		rep(j, w) {
			cin >> cell[i][j];
		}
	}

	rep(i, h) {
		check = 0;
		rep(j, w) {
			if (cell[i][j] == '.') {
				check++;
			}
			
		}

		if(check == w) {
			is_space_h[i] = true;
		}
		
	}

	rep(i, w) {
		check = 0;
		rep(j, h) {
			if (cell[j][i] == '.') {
				check++;
			}
			
		}

		if (check == h) {
			is_space_w[i] = true;
		}
	}
	cout << endl;

	rep(i, h) {
		outcheck = 0;
		rep(j, w) {
			if (!(is_space_w[j] || is_space_h[i])) {
				cout << cell[i][j];
				outcheck++;
			}
		}
		if (outcheck != 0) {
			cout << endl;
		}
		
	}

}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<bitset>
#include<vector>
#include<deque>
#include<list>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<iomanip>
#include <functional>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int mod = 1000000007;
const int INF = 1 << 28;
const double EPS = 1e-10;
//cout << fixed << std::setprecision(9)
//memset(a, 0, sizeof(a));
//--------------------------


int n, k;

int main()
{
	cin >> n >> k;

	if (n % 2) {
		if (n / 2 + 1 >= k) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
	else {
		if (n / 2 >= k) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define WHOLE(v) (v).begin(), (v).end()
#define REV_WHOLE(v) (v).rbegin(), (v).rend()
using i64 = int64_t;
using namespace std;
template <size_t I, class H, class... T> struct TupleReaderWriter{static tuple<H,T...> r(istream&i){H v;i>>v;return tuple_cat(tuple<H>(v),TupleReaderWriter<sizeof...(T)-1,T...>::r(i));}static void w(ostream&o,tuple<H,T...>&t,string d){TupleReaderWriter<I-1,H,T...>::w(o,t,d);o<<d<<get<I>(t);}};
template <class H, class... T> struct TupleReaderWriter<0,H,T...>{static tuple<H,T...> r(istream&i){H v;i>>v;return tuple<H>(v);}static void w(ostream&o,tuple<H,T...>&t,string d){o<<get<0>(t);}};
template<class T>istream&operator>>(istream&i,vector<T>&v){for(auto&x:v)i>>x;return i;}
template<class T>ostream&operator<<(ostream&o,vector<T>&v){string delim="";for(auto&x:v)o<<delim<<x,delim=" ";return o;}
template <class... T> istream& operator>>(istream&i,tuple<T...>& t) { t = TupleReaderWriter<sizeof...(T), T...>::r(i); return i; }
template <class... T> ostream& operator<<(ostream& o, tuple<T...>& t) { string delim = " "; TupleReaderWriter<sizeof...(T) - 1, T...>::w(o, t, delim); return o; }
template<typename T> using rev_priority_queue = priority_queue<T, vector<T>, greater<T>>;
template<typename T> using vector2d = vector<vector<T>>;
void R_YESNO(bool p) { cout << (p ? "YES" : "NO") << endl; }
void R_YesNo(bool p) { cout << (p ? "Yes" : "No") << endl; }

// 完全二分木
// Tは $f : T \to T$ についてモノイドである必要がある。
template <typename T = int64_t>
struct SegTree {
    using F = function<T(T, T)>;
	int N;
    vector<T> array;
	const F f;
	const T init;
	SegTree() {}
	SegTree(int len, const F f, const T &init) : f(f), init(init) {
		for(N = 1; N < len; N <<= 1);
		int n = 2 * N - 1;
		for(int i = 0; i < n; i++) array.push_back(init);
	}
	// $O(\log N)$
	void update(int k, T val) {
		k += N;
		array[k] = val;
		while(k >>= 1) array[k] = f(array[2 * k], array[2 * k + 1]);
	}
    T get(int k) {
        return array[k + N];
    }
	// $O(\log N)$
	T query(int l, int r) {
		T L = init, R = init;
		for(l += N, r += N; l < r; l >>= 1, r >>= 1) {
			if(l & 1) L = f(L, array[l++]);
			if(r & 1) R = f(array[--r], R);
		}
		return f(L, R);
	}
};

using Data = tuple<i64, i64, i64>;
const i64 INF = 1e15;

int main() {
    int N, M;
    cin >> N >> M;
    // Rでソート
    vector<Data> X(M);
    for(int i = 0; i < M; i++) {
        i64 L, R, C;
        cin >> L >> R >> C;
        L--, R--;
        X[i] = make_tuple(R, L, C);
    }
    sort(WHOLE(X));
    SegTree<i64> seg(N + 1, [](i64 x, i64 y) -> i64 {
        return min(x, y);
    }, INF);
    seg.update(0, 0);
    for(int i = 0; i < M; i++) {
        i64 L, R, C;
        tie(R, L, C) = X[i];
        i64 cand = seg.query(L, R + 1) + C;
        i64 val = seg.get(R);
        if (cand < val){
            seg.update(R, cand);
        }
    }
    i64 ans = seg.get(N - 1);
    if(ans >= INF) cout << -1 << endl;
    else cout << ans << endl;
    return 0;
}

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

using namespace std;

#define LL long long 
#define ULL unsigned LL
#define LD long double 

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	string s;
	cin>>s;
	int suma = 0;
	for(int i=0; i<s.size(); i++) {
		suma += (s[i] - '0');
		suma %= 9;
	}
	cout<<(suma%9==0?"Yes":"No");
}


Measured memory_bytes: 3736
from collections import Counter
n = int(input())
w = [input() for _ in range(n)]

if n != len(Counter(w)):
    print('No')
    exit()

s = w[0][-1]
for i in range(1,n):
    if s != w[i][0]:
        print('No')
        exit()
    s = w[i][-1]
print('Yes')

Measured memory_bytes: 9460
#include <bits/stdc++.h>
using namespace std;
template<class T> ostream& operator<<(ostream &os, vector<T> V) { os << "[ "; 
  for(auto v:V)os << v << " "; return os << "]";
}
template<class T> ostream& operator<<(ostream &os, set<T> S){ os << "{ "; 
  for(auto s:S) os<<s<<" ";  return os<<"}"; 
}
template<class L, class R> ostream& operator<<(ostream &os, pair<L,R> P) {
  return os<<"("<<P.first<<","<< P.second << ")";
}
template<class L, class R> ostream& operator<<(ostream &os, map<L,R> M) {
  os<<"{ ";for(auto m:M)os<<"("<<m.first<<":"<<m.second<<")";
  return os<<"}";
}
#define cerr cout
#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(...) 1
#endif
// #include <ext/pb_ds/assoc_container.hpp> 
// #include <ext/pb_ds/tree_policy.hpp> 
// using namespace __gnu_pbds;
// #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// find_by_order(k)  returns iterator to kth element starting from 0;
// order_of_key(k) returns count of elements strictly smaller than k;
//For multiset use less_equal operator but it does support erase operations for multiset
#define ll long long
#define ld long double
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define I insert 
#define pb push_back
#define F first
#define S second
#define endl "\n"
#define all(v) (v).begin(),(v).end()
#define For(i,n) for(int i=0;i<(int)n;++i)
#define Rev(i,n) for(int i=(int)n-1;i>=0;--i)
#define Rep(i,n) for(int i=1;i<=(int)n;++i)
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<pii,int> ppi;
typedef vector<pii> vpi;
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define mp make_pair
const int mod =998244353; 
const int N = 4e5 + 100;
// inline void modadd(int &a,int &b){a+=b;if(a>=mod)a-=mod;} 
inline int add(int a,int b){
  a += b;
  if(a >=mod) a -= mod;
  return a;
}
inline int sub(int a,int b){
  a -= b;
  if(a < 0) a += mod;
  return a;
}
int dp[N];
int oth[N];
int L[N], R[N];

int main(){
  fio; cout<<fixed<<setprecision(25);	
  int n , k;
  cin >> n >> k;
  for(int i = 1;i <= k ; ++i)
    cin >> L[i] >> R[i];
  dp[1] = 1;
  //oth[1] = 1;
  for(int i = 1;i <= n-1 ; ++i){
    //cout << i << ' ' << dp[i] << endl;
    for(int j = 1;j <= k ; ++j){
      oth[i+L[j]] = add(oth[i+L[j]] , dp[i]); 
      oth[i+R[j]+1] = sub(oth[i+R[j]+1] , dp[i]); 
    }
    dp[i+1] = add(oth[i+1], oth[i]);
    oth[i+1] = dp[i+1];
  }
  cout << dp[n] << endl;
}


Measured memory_bytes: 5944
import itertools
import math
import fractions
import functools
import copy
s = input()

maximum = 0 
count = 0

for i in range(len(s)):
    if s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T":
        count += 1
        maximum = max(maximum,count)
    else:
        count = 0

print(maximum)

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

bool f(int x){
    int res = 0;
    for(int i = 1; i <= x; ++i){
        if(x%i==0) res++;
    }
    if(res==8) return true;
    return false;
}

int main(){
    int n, ans = 0;
    cin >> n;
    for(int i = 1; i <= n; i+=2){
        if(f(i)) ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
	int n;
	cin>>n;
	int a[n],b[n],c[n-1];
	for(int i=0;i<n;i++){cin>>a[i];}
	for(int i=0;i<n;i++){cin>>b[i];}
	for(int i=0;i<n-1;i++){cin>>c[i];}
	int sum=0;
	for(int i=0;i<n-1;i++){
		sum+=b[a[i]-1];
		if(a[i+1]-a[i]==1)sum+=c[a[i]-1];
	}
	sum+=b[a[n-1]-1];
	cout<<sum<<'\n';
} 

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

using namespace std;

#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define all(c) (c).begin(), (c).end()
#define zero(a) memset(a, 0, sizeof a)
#define minus(a) memset(a, -1, sizeof a)
#define watch(a) { cout << #a << " = " << a << endl; }
template<class T1, class T2> inline bool minimize(T1 &a, T2 b) { return b < a && (a = b, 1); }
template<class T1, class T2> inline bool maximize(T1 &a, T2 b) { return a < b && (a = b, 1); }
template<class T> void operator>> (istream& ist, vector<T>& vs) { for(auto& e: vs) cin >> e; }

typedef long long ll;
int const inf = 1<<29;

int main() {
  int A, B, C; cin >> A >> B >> C;
  int X, Y; cin >> X >> Y;
  int64_t ans = 1e15;
  rep(cnum, 200010) {
    int64_t acnt = max(0, X - cnum / 2);
    int64_t bcnt = max(0, Y - cnum / 2);
    int64_t sum = acnt * A + bcnt * B + cnum * C;
    minimize(ans, sum);
  }
  cout << ans << endl;
}


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

using namespace std;
const int N = 100010;
int _w;

int n, m, a[N];

int main() {
	_w = scanf( "%d%d", &n, &m );
	for( int i = 0; i < m; ++i ) {
		int u, v;
		_w = scanf( "%d%d", &u, &v );
		a[u] ^= 1;
		a[v] ^= 1;
	}
	int s = 0;
	for( int i = 1; i <= n; ++i ) s += a[i];
	puts( s <= 1 ? "YES" : "NO" );
	return 0;
}


Measured memory_bytes: 640
let _ =
	let a, b, c = Scanf.scanf "%d %d %d\n" (fun a b c -> a, b, c) in
    let ls = List.sort (fun x y -> compare y x) [a; b; c] in
    (List.nth ls 0) * 10 + (List.nth ls 1) + (List.nth ls 2)
    |> print_int

Measured memory_bytes: 384
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <numeric>
#include <complex>
#include <string>
#include <ctime>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <fstream>
#include <climits>

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef pair <int, int> pnt;

#define FI(i,a) for (int i=0; i<(a); ++i)
#define FOR(i,s,e) for (int i=(s); i<(e); ++i)
#define MEMS(a,b) memset(a,b,sizeof(a))
#define pb push_back
#define mp make_pair
#define ALL(a) a.begin(),a.end()
#define V(t) vector < t >
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):(-(a)))

const double pi = 3.14159265358979323846264338327950288419716939937511;
const double eps = 1e-9;
using namespace std;

int main(){
    
//    freopen("elect.out", "w", stdout);
//    freopen("input.txt", "r", stdin);
    
    int rows, cols;
    cin >> rows >> cols;
    
    int visited_count = 0;
    for (int i = 0; i < rows; i++) {
        for (int j = 0; j < cols; j++) {
            char temp;
            cin >> temp;
            if (temp == '#') visited_count++;
        }
    }

    bool possible = (visited_count == rows + cols - 1) ? true : false;
    
    if (possible) {
        cout << "Possible" << endl;
    } else {
        cout << "Impossible" << endl;
    }
        
}

Measured memory_bytes: 256
#input
K = int(input())
S = str(input())

#output
# (o以外) o (o以外) o (f以外) f (何でも)

#こちらもmodで割った余り。maxが決まっていて、大きくない時はこちらが早い。
mod = pow(10, 9) + 7

n_ = 5 * pow(10, 6)
fun = [1] * (n_+1)
for i in range(1, n_+1):
    fun[i] = fun[i-1] * i % mod
rev = [1] * (n_+1)
rev[n_] = pow(fun[n_], mod-2, mod)
for i in range(n_-1, 0, -1):
    rev[i] = rev[i+1] * (i+1) % mod
def cmb(n,r):
    if n < 0 or r < 0 or r > n: return 0
    return fun[n] * rev[r] % mod * rev[n-r] % mod

#重複組み合わせはH(n, r) = cmb(n+r-1, r)

L = len(S)
answer = 0
for i in range(K+1):
    answer += pow(25, i, mod) * pow(26, K-i, mod) * cmb(L-1+i, i)
    answer %= mod
print(answer)

Measured memory_bytes: 169452
#include <algorithm>
#include <climits>
#include <complex>
#include <cstring>
#include <iostream>
#include <map>
#include <set>
#include <vector>

// using
using namespace std;

// typedef
typedef long long ll;

// define
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define REVERSE(c) reverse(ALL(c))
#define UNIQ(c) unique(ALL(c))
#define FOR(i, a, b, c) for (int i = (int)(a); i < (int)(b); i += (int)(c))
#define REP(i, n) FOR(i, 0, n, 1)
#define RFOR(i, a, b, c) for (int i = (int)(a); i >= (int)(b); i -= (int)(c))
#define RREP(i, n) RFOR(i, n, 0, 1)

// functions
int ceil(int a, int b) {
    return (a + b - 1) / b;
}
int round(int a, int b) {
    return (a + b / 2) / b;
}
int gcd(int a, int b) {
    return b ? gcd(b, a % b) : a;
}
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}
template <class T> bool amax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> bool amin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}

// main
int main() {
    string N, M;
    cin >> N;
    M = N.c_str();
    REVERSE(M);
    if (N == M) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}


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


using namespace std;
#define rep(i,n) for (int i = 0; i < (int)(n); ++i)
#define reps(i,n) for (int i = 1; i <= (int)(n); ++i)
#define repd(i,n) for (int i = (int)(n - 1); i >= 0; --i)
#define repds(i,n) for (int i = (int)(n); i > 0; --i)
#define loop(i,x,n) for (int i = (int)(x); i < (n); ++i)
#define loops(i,x,n) for (int i = (int)(x); i <= (n); ++i)
#define loopd(i,x,n) for (int i = (int)(x); i > (n); --i)
#define loopds(i,x,n) for (int i = (int)(x); i >= (n); --i)
#define itrep(i,s) for (auto i = begin(s); i != end(s); ++i)
#define itrepd(i,s) for (auto i = --end(s); i != begin(s); --i)
#define all(f,x,...) [&](decltype(x)& whole) { return (f)(begin(whole), end(whole), ##__VA_ARGS__); }(x)
#define rall(f,x,...) [&](decltype(x)& whole) { return (f)(rbegin(whole), rend(whole), ##__VA_ARGS__); }(x)
using ll = long long;
using ld = long double;
constexpr ll inf = static_cast<ll>(1e17);
constexpr int iinf = static_cast<int>(1e9);
constexpr double dinf = 1e10;
constexpr ld ldinf = 1e17;
constexpr ll mod = static_cast<ll>(1e9 + 7);
std::ostream& endn(std::ostream& os) { return os.put(os.widen('\n')); }
template<class T> constexpr int sz(const T& a) { return (int)a.size(); }
template<class T, class ... Args> constexpr void mins(T& a, Args... args) { a = min<T>({ a, args... }); }
template<class T, class... Args> constexpr void maxs(T& a, Args... args) { a = max<T>({ a,args... }); }

int n, k;
void solve() {
    cin >> n >> k;

    int ans = 0;
    rep(i, n) {
        int h; cin >> h;
        if (h >= k)++ans;
    }
    cout << ans << endn;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    solve();
    cout << flush;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<string.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
long long int mod=1e9+7;
bool debug=false;
typedef long long ll;
int main(){
	int r;
	cin>>r;
	cout<<r*r*3<<endl;
	return 0;
}

Measured memory_bytes: 256
N, M = map(int, input().split())
k, s = [[] for _ in range(2)]
for _ in range(M):
    kk, *connected_switches = map(int, input().split())
    k.append(kk)
    s.append(connected_switches)

p = list(map(int, input().split()))

OFF = 0
ON = 1

ans = 0
for i in range(2 ** N):
    ptn = [OFF] * N
    for j in range(N):
        if (i >> j) & 1:
            ptn[len(ptn) - j - 1] = ON

    ON_SW_COUNT_LIST = []  # 各電球に繋がったON状態のスイッチの数リスト
    for connected_switches in s:
        on_sw_cnt = len([1 for sw in connected_switches if ptn[sw - 1] == ON])
        ON_SW_COUNT_LIST.append(on_sw_cnt)

    ans += all([c % 2 == p[i] for i, c in enumerate(ON_SW_COUNT_LIST)])

print(ans)


Measured memory_bytes: 9184
#include <iostream>
#include <vector>
#define mod 1000000007
using namespace std;
using LL = long long;

int h;
vector<vector<int>> stone;

bool fall(){
    bool flag=0;
    for(int i=0;i<5;i++){
        for(int j=h-1;j>0;j--){
            if(stone[j][i]==0 && stone[j-1][i]!=0){
                flag=1;
                stone[j][i]=stone[j-1][i];
                stone[j-1][i]=0;
            }
        }
    }
    return flag;
}

int erase(){
    int ret=0;
    for(int i=0;i<h;i++){
        if(stone[i][0]==stone[i][1] && stone[i][1]==stone[i][2]){
            int buf=stone[i][0];
            stone[i][0]=stone[i][1]=stone[i][2]=0;
            ret += buf*3;
            if(stone[i][3]==buf){
                stone[i][3]=0;ret+=buf;
                if(stone[i][4]==buf){stone[i][4]=0;ret+=buf;}
            }
        }
        else if(stone[i][1]==stone[i][2] && stone[i][2]==stone[i][3]){
            int buf=stone[i][1];
            stone[i][1]=stone[i][2]=stone[i][3]=0;
            ret+=buf*3;
            if(stone[i][4]==buf){stone[i][4]=0;ret+=buf;}
        }
        else if(stone[i][2]==stone[i][3] && stone[i][3]==stone[i][4]){
            int buf=stone[i][2];
            stone[i][2]=stone[i][3]=stone[i][4]=0;
            ret+=buf*3;
        }
    }
    return ret;
}

int main(){
    while(cin>>h){
        if(h==0)return 0;
        stone.resize(h);
        for(int i=0;i<h;i++)stone[i].resize(5);
        for(int i=0;i<5*h;i++)cin>>stone[i/5][i%5];

        int score=0;
        while(1){
            int buf=erase();
            score+=buf;
            if(buf==0)break;
            while(fall()){}

    
            //cout<<"#"<<score<<endl;for(int i=0;i<h;i++)for(int j=0;j<5;j++)cout<<stone[i][j]<<(j!=4?" ":"\n");
            
        }
        cout<<score<<endl;
    }
}


Measured memory_bytes: 2980
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
#include <utility>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;

#define INF_LL (ll)1e18
#define INF (int)1e9
#define REP(i, n) for(int i = 0;i < (n);i++)
#define FOR(i, a, b) for(int i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
using ll = long long;
using PII = pair<int, int>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

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

	int N;
	int res = 1;
	cin >> N;
	while(res*2 <= N) res *= 2;
	cout << res << endl;
}


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

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;

using namespace std;
using ll = long long;

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

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

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

	int N=in(),M=in();
	deque<int> A(N+1,0);
	REP(i,M){
		A[in()]=1;
	}
	const int atcoder_mod = 1e9+7;
	vector<int> dp(N+1,0);
	dp[0] = 1;
	for(int i=0;i<N;i++){
		if(A[i+1]==0){
			dp[i+1] += dp[i];
			dp[i+1] %= atcoder_mod;
		}
		if(i<N-1 && A[i+2]==0){
			dp[i+2] += dp[i];
			dp[i+2] %= atcoder_mod;
		}
	}

	cout << dp[N] << endl;
	return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ll long long int

using namespace std;

int main()
{
  int n, m;
  cin >> n >> m;
  int l = 0;
  int r = n;
  REP(i, m)
  {
    int li, ri;
    cin >> li >> ri;
    l = max(l, li);
    r = min(r, ri);
  }

  cout << max(r - l + 1, 0) << endl;
}

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

int main(){
  int i,j;
  vector<int> v(10,0);
  
  for(i = 0; i < 3; i++){
    j=0;
    cin >> j;
	v[j-1] += 1;
  }
  
  if(v[4]==2 && v[6] ==1){
    cout << "YES" << endl;
  }else{
    cout << "NO" << endl;
  }
}

Measured memory_bytes: 256
import java.io.*;
import java.lang.*;
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int X = scan.nextInt();
    int Y = scan.nextInt();

    if (Y % 2 == 0){
      System.out.println(X + Y/2);
    }

  }

}


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

typedef long long ll;
typedef string st;
typedef vector<int> vi;
typedef vector<st> vs;
#define rep(i, n) for(int i = 0; i < n; i++)
#define fogg(i,a,b) for(int i = (a); i <= (b); i++)
#define ford(i,a,b) for(int i = (a); i >= (b); i--)
#define test int t; cin >> t; while(t--)
#define debug(x) cout << '>' << #x << ':' << x << "\n";
#define endl '\n'
#define pb push_back
#define gp " "
#define ff first
#define ss second
#define mp make_pair



int main() {
    int n,d;
    cin >> n >> d;
    int temp=2*d+1;
    if(n%temp==0){
        cout << int(n/temp); 
    }
    else{
        cout << int(n/temp)+1;
    }
return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repf(i,a,b) for (int i = (a); i < (b); i++)
#define repi(i,a,b) for (int i = (a); i <= (b); i++)
#define repr(i,a,b) for (int i = (a); i >= (b); i--)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define debug(x)  cout << #x << " = " << (x) << endl;
#define SORT(x) sort(all(x));
#define RSORT(x) sort(rall(x));
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vd = vector<double>;
using vb = vector<bool>;
using pii = pair<int, int>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<string>;
using tiii = tuple<int, int, int>;
const ll inf = 1ll<<29;
const ll mod = 1000000007;      
const double eps = 1e-9;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};

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, Q;
  string S;
  cin >> N >> Q >> S;

  // dummy
  S.push_back('X');
  
  vi c_sum(N+1,0);
  rep(i,N) {
    c_sum.at(i+1) = c_sum.at(i);
    if(S.at(i)=='A' && S.at(i+1)=='C') {
      c_sum.at(i+1)++;
    }
  }

//0 1 2 3 4 5 6 7 7+1
//0 1 1 2 2 2 3 3 3
// 0 1 2 3 4 5 6 7
// A C A C T A C G

  rep(i,Q) {
    int l, r; cin >> l >> r;
    l--; r--;

    cout << c_sum.at(r) - c_sum.at(l) << endl;
  }
}

Measured memory_bytes: 1408
#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <deque>
#include <numeric>
#include <bits/stdc++.h>
#include <utility>
#include <iomanip>

#define ALL(obj) (obj).begin(), (obj).end()
#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define RFOR(i,a,b) for(int i = (a); (b) <= i; i--)
#define REP(i,n) for(int i = 0; i < (n); i++)
#define RREP(i,n) for(int i = n; n <= i; i--)
#define ABS(a) ((a < 0) ? ((-1)*(a)) : (a))
#define elif else if
#define MOD 1000000007

using namespace std;

#define ld long double
#define ll long long

map <int ,int> mpa,mpb;
typedef pair<ll, ll> P;
priority_queue<P, vector<P>, greater<P>> pque;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int N;
  cin >> N;
  map<int,int> mp;
  
  for(int i=0;i<110;i++){
    mp[i]=0;
  }
  
  for(int i=2;i<=N;i++){
    int k=i;
    int l=2;
    while(k>1){
      if(k%l==0){
        mp[l]++;
        k/=l;
      }else{
        l++;
      }
    }
  }
  int a=0,b=0,c=0,d=0,e=0;
  for(auto f:mp){
    if(f.second>=74)a++;
    if(f.second>=24)b++;
    if(f.second>=14)c++;
    if(f.second>=4)d++;
    if(f.second>=2)e++;
  }
  int ans=a+b*(e-1)+c*(d-1)+d*(d-1)/2*(e-2);
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#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 {
		printf("a < b\n");
	}
	return 0;
}


Measured memory_bytes: 2048
#include<iostream>
#include<map>
#include<algorithm>
#include <iomanip>
#include <cmath>
#include <sstream>
#include <unordered_map>
#include <unordered_set>
#include <deque>
#include <vector>
#include <bitset>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <cstring>
#include <cstdio>

constexpr int INF = 1050000000;
constexpr int MOD = 1000000007;
constexpr int LONGINF = 1005000000000000000;
using namespace std;

using ll = long long;



int main() {
	int n; cin >> n;

	int a;

	int x = 0, y = 0, z = 0;

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

		if (a % 4 == 0) { y++; }
		else if (a % 2 == 0) { x++; }
	}

	if (x < 2) { x = 0; }
	if (y&&x==0) { z = 1; }

	if (y * 2 + x + z >= n) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}

}

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<cstdlib>
#include<cstring> 
#include<algorithm>
#include<queue>
#include<vector>
#include<ctime>
using namespace std;
typedef long long ll;
const int N = 200010;
ll read() {
	ll x = 0,f = 1;char c = getchar();
	while(c < '0' || c > '9') {
		if(c == '-') f = -1; c = getchar();
	}
	while(c >= '0' && c <= '9') {
		x = x * 10 + c - '0'; c = getchar();
	}
	return x * f;
}
struct node {
	int v,nxt;
}e[N << 1];
int du[N],ejs,head[N];
void add(int u,int v) {
	e[++ejs].v = v;e[ejs].nxt = head[u];head[u] = ejs;
}
int n,dis[N];
void dfs(int u,int fa) {
	for(int i = head[u];i;i = e[i].nxt) {
		int v = e[i].v;if(v == fa) continue;
		dis[v] = dis[u] + 1;
		dfs(v,u);
	}
}
int zj[N],tot;
bool get(int u,int fa,int T) {
	if(u == T) {
		zj[++tot] = T;
		return true;
	}
	for(int i = head[u];i;i = e[i].nxt) {
		int v = e[i].v;if(v == fa) continue;
		if(get(v,u,T)) {
			zj[++tot] = u;
			return true;
		}
	}
	return false;
}
int ans[N];
int main() {
	n = read();
	for(int i = 1;i < n;++i) {
		int u = read(),v = read();add(v,u);add(u,v);
		du[u]++;du[v]++;
	}
	
	dfs(1,0);
	int tmp = 0;
	for(int i = 1;i <= n;++i)
		if(dis[i] > dis[tmp]) tmp = i;
	dis[tmp] = 0;
	dfs(tmp,0);
	int tt = 0;
	for(int i = 1;i <= n;++i) 
		if(dis[i] > dis[tt]) tt = i;
	get(tmp,0,tt);
	
	int flag = 0;
	for(int i = 1;i <= tot;++i) {
		if(du[zj[i]] < du[zj[tot - i + 1]]) break;
		if(du[zj[i]] > du[zj[tot - i + 1]]) {
			flag = 1;break;
		}
	}
	if(flag) {
		for(int i = 1;i <= tot / 2;++i) swap(zj[i],zj[tot - i + 1]);
	}
	
	int pos = 0,now = 0;
	
	ans[++pos] = ++now;
	for(int i = 2;i < tot;++i) {
		int tmp = ++now;
		for(int j = 1;j < du[zj[i]] - 1;++j) ans[++pos] = ++now;
		ans[++pos] = tmp;
	}
	ans[++pos] = ++now;
	if(pos != n) {
		puts("-1");return 0;
	}
	for(int i = 1;i <= pos;++i) printf("%d ",ans[i]);
	return 0;
}


Measured memory_bytes: 10752
#include<stdio.h>
int main()
{
	int n;
	scanf("%d",&n);
	int count=0;
	for(;n!=0;n/=10)
	{
		if(n%10==7)
		{printf("Yes");
		count=1;break;}
	}
	if(count==0)
	printf("No");
	return 0;
	
}

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

using namespace std;

const int MAX_C = 60;
long long Com[MAX_C][MAX_C];

void calc_com() {
    memset(Com, 0, sizeof(Com));
    Com[0][0] = 1;
    for (int i = 1; i < MAX_C; ++i) {
        Com[i][0] = 1;
        for (int j = 1; j < MAX_C; ++j) {
            Com[i][j] = Com[i-1][j-1] + Com[i-1][j];
        }
    }
}

int main() {
	calc_com();
	int N,A,B; cin >> N >> A >> B;
	vector<long long> v(N);
	for(auto&a:v) cin >> a;
	sort(v.begin(),v.end(),greater<>());
	auto a=lower_bound(v.begin(),v.end(),v[A-1],greater<>());
	auto b=upper_bound(v.begin(),v.end(),v[A-1],greater<>());
	int cnt=distance(a,b);
	double res=0;
	for(int i=0;i<A;++i) res+=v[i];
	res/=A;
	printf("%.10f\n",res);
	if(v[0]==v[A-1]) {
		long long ans=0;
		for(int i=A;i<=min(B,cnt);++i) ans+=Com[cnt][i];
		cout << ans << endl;
	} else cout << Com[cnt][A-(a-v.begin())] << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
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 ll INF = 1LL<<60;

int main()
{
  ll n,m;cin>>n>>m;
  string ans= n==m ? "Yes":"No";
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 256