akhauriyash/Code-Regression huggingface dataset:
/// kazuki08
/*
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
*/
#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 int long long
typedef long long ll;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
#define ar array
//#define inf 1000000000
#define mod 1000000007
#define dmp(x) cerr<<"line "<<__LINE__<<" "<<#x<<":"<<x<<endl
#define fs first
#define sc second
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define mt make_tuple
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){
    return o<<"("<<p.fs<<","<<p.sc<<")";
}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){
    o<<"{";
    for(const T& v:vc) o<<v<<",";
    o<<"}";
    return o;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());



signed main(){
IOS;
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
  
  int n;
  cin >> n;
  string ans = "";
  while(n){
    n--;
    ans+='a'+(n%26);
    n/=26;
  }
  reverse(all(ans));
  cout << ans << endl;


return 0;
}
///....


Measured memory_bytes: 3688
#include<stdio.h>
#include <string.h>
#include<math.h>

int main(){
	int x,i,j;
	int a[10],b[3];
	
	for(i=0;i<10;i++){
		scanf("%d",&a[i]);
	}
	for(i=0;i<9;i++){
		for(j=0;j<9-i;j++){
			if(a[j]>a[j+1]){
				x=a[j];
				a[j]=a[j+1];
				a[j+1]=x;
			}
		}
	}
	printf("%d\n",a[9]);
	printf("%d\n",a[8]);
	printf("%d\n",a[7]);
	
	return 0;
}

Measured memory_bytes: 600
import qualified Data.Set as Set

f2::Int->Int
f2 n
   |n `mod` 2==0 =n `div` 2
   |otherwise=n*3+1

f::Set.Set Int->Int->Int->Int
f ss p1 n
    |Set.member n ss==True =p1
    |otherwise=f (Set.insert n ss) (p1+1) (f2 n)

main = do
       e<-getLine
       let x=read e::Int
       putStrLn $ show $ f (Set.fromList []) 1 x

Measured memory_bytes: 508
//master
import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        double n = sc.nextDouble();
        p(2*Math.PI*n);
        
    }
    public static <T> void p(T message) {
        System.out.println(message);
    }

    public static <T> void pe(T message) {
        System.err.println(message);
    }

    public static <T> void pp(T message) {
        System.out.print(message);
    }
}
class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
 
    private int readByte() {
        if (hasNextByte())
            return buffer[ptr++];
        else
            return -1;
    }
 
    private boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }
 
    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr]))
            ptr++;
        return hasNextByte();
    }
 
    public String next() {
        if (!hasNext())
            throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
 
    public long nextLong() {
        if (!hasNext())
            throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
 
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
            throw new NumberFormatException();
        return (int) nl;
    }
 
    public double nextDouble() {
        return Double.parseDouble(next());
    }
}


Measured memory_bytes: 33264
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for(int(i) = 0; (i) < (n); (i)++)
#define FOR(i, m, n) for(int(i) = (m); (i) < (n); (i)++)
#define All(v) (v).begin(), (v).end()
#define pb push_back
#define MP(a, b) make_pair((a), (b))
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;
const int MOD = 1e9 + 7;

int main() {
    string S;
    cin >> S;
    vector<pair<int,pii>> vec;
    int r = 0, l = 0, idx = 0;
    rep(i, S.size()) {
        if(S[i] == 'R') {
            r++;
            if(S[i + 1] == 'L')
                idx = i;
        }
        if(S[i] == 'L') {
            l++;
            if(i+1==S.size()||S[i + 1] == 'R') {
                vec.pb(MP(idx, MP(r, l)));
                l = 0, r = 0;
            }
        }
    }
    int N = S.size();
    vector<int> res(N);
    for(auto x:vec){
        int idx = x.first;
        int r = x.second.first,l=x.second.second;
        res[idx] = (r+1)/2+l/2;
        res[idx+1] = (l+1)/2+r/2;
    }
    rep(i,N){
        cout << res[i] << (i==N-1?"\n":" ");
    }
    return 0;
}

Measured memory_bytes: 4448
#include<stdio.h>
#include<string.h>
 
int main(void)
{
   int i=0,a=0,x,n;
   char s[11];
 
   scanf("%s",s);
 
   n=strlen(s);
  
   while(i<n){
      x=0;
      while((s[i]=='A')||(s[i]=='C')||(s[i]=='G')||(s[i]=='T')){
         i++;
         x++;
      }
      if(x==0)  i++;
      if(a<x)   a=x;
   }
 
   printf("%d\n",a);
  
   return 0;
}

Measured memory_bytes: 128
hasIntersection :: [Double] -> String
hasIntersection [xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2]
    | not (xb1 > xa2 || yb1 > ya2 || xb2 < xa1 || yb2 < ya1) = "YES"
    | otherwise                                              = "NO"

main :: IO ()
main = putStr . unlines . map hasIntersection . map (map read) . map words . lines =<< getContents

Measured memory_bytes: 4352
#include <iostream>
#include <algorithm>
using namespace std;
long long i,n,a[100000],b[100000],ans=1;
int main()
{
	cin>>n;
	for(i=0;i<n;i++)cin>>a[i];
	sort(a,a+n);
	b[0]=a[0];
	for(i=1;i<n;i++)b[i]=b[i-1]+a[i];
	i=n-2;
	while(a[i+1]<=b[i]*2&&i>-1)i--,ans++;
	cout << ans<<"\n";
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
struct Edge {
    int to;     // 辺の行き先
    int weight; // 辺の重み
    Edge(int t, int w) : to(t), weight(w) { }
};
using Graph = vector<vector<int> >;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define reprep(i,j,h,w) rep(i,h)rep(j,w)
#define rrep(i,m, n) for(int i = m; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define aall(x,n) (x).begin(),(x).begin()+(n)
#define VEC(type,name,n) std::vector<type> name(n);rep(i,n)std::cin >> name[i];
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define mk make_pair
#define sum accumulate
#define keta fixed<<setprecision
#define vvector(name,typ,m,n,a)vector<vector<typ> > name(m,vector<typ> (n,a))
#define vvvector(name,t,l,m,n,a) vector<vector<vector<t> > > name(l, vector<vector<t> >(m, vector<int>(n,a)));
typedef long long ll;
const int INF = 2000000000;
const long INF64 = 1000000000000000ll;
const ll MOD = 1000000007LL;
typedef unsigned int uint;
int main(){
    ll n,m;
    std::cin >> n>>m;
    if(m==0){
        std::cout << 0 << std::endl;
        exit(0);
    }
    std::vector<ll> a(n),b(n),c(n);
    std::vector<ll> aa(n),bb(n),cc(n);
    rep(i,n)std::cin >> aa[i]>>bb[i]>>cc[i];
    ll ans=0;
    for(int bit=0;bit<(1<<3);bit++){
        copy(all(aa),a.begin());
        copy(all(bb),b.begin());
        copy(all(cc),c.begin());
        if(bit&(1<<0))rep(i,n)a[i]*=-1;
        if(bit&(1<<1))rep(i,n)b[i]*=-1;
        if(bit&(1<<2))rep(i,n)c[i]*=-1;
        std::vector<ll> su(n,0);
        rep(i,n)su[i]=a[i]+b[i]+c[i];
        sort(all(su),greater<ll>());
        if(m==1) ans=max(ans,su[0]);
        else ans=max(ans,sum(su.begin(),su.begin()+m,0ll));
        
    }
    std::cout << ans << std::endl;
}

Measured memory_bytes: 256
number = input()

heights = input().split(' ')

heights = [int(x) for x in heights]



count = 0

temp = 0

nxt_pos = 0

for n in range (0, int(number)):
    if n <= nxt_pos:
        continue
    if count > len(heights) - n:
        break
    temp_count = 0
    for i in range (n, int(number)):
        if i == 0:
            continue
        if heights[i] <= heights[i-1]:
            temp_count += 1
        else:
            nxt_pos = i
            break
    if temp_count > count:
        count = temp_count

print (count)

Measured memory_bytes: 14224
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;

int main(){
  string str;
  cin >> str;
  int count = 0;
  int x = str.size() / 2;
  REP(i, x){
    if (str.at(i) != str.at(str.size() - i - 1)) count++;
  }
  printf("%d\n", count);
}


Measured memory_bytes: 256
let () =
  let a = Array.make 30 false in
  let rec read = function
      0 -> ()
    | i ->
       let n = read_int () in
       a.(n-1) <- true;
       read (i-1)
  in
  let () = read 28 in
  Array.iteri (fun i x -> if not x then Printf.printf "%d\n" (i+1)) a
;;

Measured memory_bytes: 2304
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

using u128 = __uint128_t;

#define int long long
#define idxSet tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
#define atIdx find_by_order
#define idxOf order_of_key
#define MOD 1000000007
#define MAX 200005
#define endl '\n'

#define v(type) vector<type>
#define p(type1 , type2) pair<type1 , type2>
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

int dp[MAX];

void solve() {
    int a , b;
    cin>>a>>b;
    cout<<a * b / __gcd(a , b)<<endl;
}

int32_t main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    //cin>>t;
    while (t--)
        solve();
    return 0;
}

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

typedef long long ll;
ll INF = 1LL << 60;
ll MAX = 100010;

vector<int> check;

int
main() 
{

  int n; cin >> n;
  vector<ll> arr(n);

  rep(i, 0, n) cin >> arr[i];

  ll ans = 0;
  rep(i, 0, n){
    while((arr[i] % 2) == 0){
      arr[i] /= 2;
      ans++;
    }
  }

  cout << ans << endl;

}




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

int main(void)
{
    long long D;
    cin >> D;
    vector<long long> c(26);
    vector<vector<long long>> used(26);
    for (long long i = 0; i < 26; i++)
    {
        cin >> c[i];
        used[i].push_back(-1);
    }
    vector<vector<long long>> s(D,vector<long long>(26));
    for (long long i = 0; i < D; i++)
    {
        for (long long j = 0; j < 26; j++)
        {
            cin >> s.at(i).at(j);
        }
    }

    long long lastnum = 0;
    vector<long long> ans(D);
    for (long long i = 0; i < D; i++)
    {
        long long pena = 0;
        for (long long j = 0; j < 26; j++)
        {
            pena += c[j] * (i - used.at(j).at(used[j].size() - 1));
        }
        ans[i] = -1;
        long long cnt = -100000000;
        for (long long j = 0; j < 26; j++)
        {
            pena -= c[j] * (i - used.at(j).at(used[j].size() - 1));
            if (s.at(i).at(j) - pena > cnt)
            {
                ans[i] = j;
                cnt = s.at(i).at(j) - pena;
            }
            pena += c[j] * (i - used.at(j).at(used[j].size() - 1));
        }
        used[ans[i]].push_back(i);
        lastnum += cnt;
    }

    time_t start_time = time(NULL); 
    while(clock() <  1.9 * CLOCKS_PER_SEC)
    {
        long long cnt = 100000000;
        long long ranD = rand() % D;
        long long ranq;
        for (long long i = 0; i < 26; i++)
        {
            if (i != ans[ranD])
            {
                if (abs(s.at(ranD).at(ans[ranD]) - s.at(ranD).at(i)) < cnt)
                {
                    ranq = i;
                    cnt = abs(s.at(ranD).at(ans[ranD]) - s.at(ranD).at(i));
                }
            }
        }

        used[ans[ranD]].erase(remove(used[ans[ranD]].begin(), used[ans[ranD]].end(), ranD), used[ans[ranD]].end());
        used[ranq].push_back(ranD);
        sort(used[ranq].begin(), used[ranq].end());
        long long oldans = ans[ranD];
        ans[ranD] = ranq;

        long long newnum = 0;
        for (long long i = 0; i< D; i++)
        {
            long long pena = 0;
            for (long long j = 0; j < 26; j++)
            {
            pena += c[j] * (i - used.at(j).at(used[j].size() - 1));
            }
            newnum += s.at(i).at(ans[i]) - pena;
        }
        
        if(newnum <= lastnum)
        {
            used[ranq].erase(remove(used[ranq].begin(), used[ranq].end(), ranD), used[ranq].end());
            used[ans[ranD]].push_back(ranD);
            sort(used[ans[ranD]].begin(), used[ans[ranD]].end());
            ans[ranD] = oldans;
        }
        else
        {
            lastnum = newnum;
        }
    }

    for (long long i = 0; i < D; i++)
    {
        cout << ans[i]+1 << endl;
    }
}

Measured memory_bytes: 3748
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<ll,ll> P;
using VP = vector<P>; using VVP = vector<VP>;
using VI = vector<ll>; using VVI = vector<VI>; using VVVI = vector<VVI>;
const int inf=1e9+7;
const ll INF=1LL<<61;
const ll mod=1e9+7;

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

int main(){
  int i,j;
  int n;
  cin>>n;
  n++;
  cout<<n/2<<endl;

}

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

using namespace std;
using ll = long long;
// #define int ll
using PII = pair<ll, ll>;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()

template<typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template<typename T> bool IN(T a, T b, T x) { return a<=x&&x<b; }
template<typename T> T ceil(T a, T b) { return a/b + !!(a%b); }

template<typename T> vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts) {
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type
fill_v(T &t, const V &v) { t=v; }
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t, const V &v ) { for(auto &e:t) fill_v(e,v); }

template<class S,class T>
ostream &operator <<(ostream& out,const pair<S,T>& a){
  out<<'('<<a.first<<','<<a.second<<')'; return out;
}
template<typename T>
istream& operator >> (istream& is, vector<T>& vec){
  for(T& x: vec) {is >> x;} return is;
}
template<class T>
ostream &operator <<(ostream& out,const vector<T>& a){
  out<<'['; for(T i: a) {out<<i<<',';} out<<']'; return out;
}

int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0}; // DRUL
const int INF = 1<<30;
const ll LLINF = 1LL<<60;
const ll MOD = 998244353;

// 階段行列を求める O(min(H,W)HW/64)
// 列に応じてbitsetのbit長を変えろ
using mat = vector<bitset<305>>;
mat gauss_jordan(mat a) {
    const int h = a.size(), w = a[0].size();
    int rank = 0;
    REP(i, min(w, h)) {
        int pivot = -1;
        FOR(j, rank, h) if(a[j][i]) {pivot = j; break;}
        if(pivot == -1) continue;
        swap(a[rank], a[pivot]);
        REP(j, h) if(j != rank && a[j][i]) a[j] ^= a[rank];
        rank++;
    }
    return a;
}

// 二分累乗
ll binpow(ll x, ll e) {
  ll ret = 1, p = x;
  while(e > 0) {
    if(e&1) {(ret *= p) %= MOD; e--;}
    else {(p *= p) %= MOD; e /= 2;} 
  }
  return ret;
};

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

    ll h, w;
    cin >> h >> w;
    mat a(h);
    REP(i, h) REP(j, w) {
        ll b; cin >> b;
        if(b) a[i].set(j);
    }

    auto ret = gauss_jordan(a);
    ll rank = h;
    REP(i, h) {
        bool flag = false;
        REP(j, w) if(ret[i][j]) flag = true;
        if(!flag) {
            rank = i;
            break;
        }
    }

    // (2^h - 2^(h-rank)) * 2^(w-1)
    ll ans = ((binpow(2, h) - binpow(2, h-rank)) % MOD + MOD) % MOD;
    (ans *= binpow(2, w-1)) %= MOD;
    cout << ans << endl;

    return 0;
}

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

#define fi first
#define se second
#define be begin
#define en end
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define ALL(a) (a).be() , (a).en()
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)        //repeat n times
#define REP2(i,s,n) for(int (i)=(s);(i)<(n);(i)++)   //repeat from s to n 
#define REPD(i,n) for(int (i)=(n);(i)>=0;(i)--)      //repeat from n to 0
#define REPD2(i,s,e) for(int (i)=(s);(i)>=(e);(i)--) //repeat from s to e
#define RANGE(i,v) for(auto &(i):v)                  //repeat range
#define ASIZE(a) (sizeof(a) / sizeof(a[0]))          //array size

using LL = long long;

template<typename T1,typename T2> using P = pair< T1, T2 >;
using Pii = P<int,int>;
using Pdd = P<double,double>;

template<typename T> using V = vector< T >;
using Vi = V<int>;
using Vll = V<LL>;
using Vs = V<string>;

const int INF = 1999999999;

int main(){
    int n,k;
    cin>>n>>k;
    deque<int> v;
    REP(i,n){
        int t;
        cin>>t;
        v.pb(t);
    }

    int ans = -INF;
    REP(a,k+1){
        REP(b,k+1){
            if(a+b>k) continue;
            deque<int> v_tmp = v;
            Vi my_value;
            REP(i,a){
                if(!v_tmp.empty()){
                    my_value.pb(v_tmp.front());
                    v_tmp.pop_front();
                }
            }
            REP(i,b){
                if(!v_tmp.empty()){
                    my_value.pb(v_tmp.back());
                    v_tmp.pop_back();
                }
            }
            sort(ALL(my_value));
            int e = k-(a+b);
            int total = 0;
            REP(i,my_value.size()){
                if(i<e && my_value[i]<0) continue;
                total += my_value[i];
            }
            ans = max(ans,total);
        }
    }

    cout<<ans<<endl;


    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int N, M, k, cnt = 0;
  cin >> N >> M;
  vector<long long int> p_v(10), k_v(10), x_v(10, 0);
  vector<vector<long long int>> s_v(10, vector<long long int>(10));
  
  for (int i = 0; i < M; i++) {
    cin >> k;
    k_v.at(i) = k;
    for (int j = 0; j < k; j++) {
      //cout << "sdssd" << endl;
      cin >> s_v.at(i).at(j);
    }
  }
  for (int i = 0; i < M; i++) {
    cin >> p_v.at(i); 
  }
  x_v[N-1] = -1;
  for (int i = 0; i < pow(2, N); i++) {
    int flag = 0;
    x_v[N-1] += 1;
    for (int j = N-1; j >= 0; j--) {
      //cout << "s" << endl;
      if (x_v[j] >= 2) {
        x_v[j] = 0;
        x_v[j-1] += 1;
      }
    }
    
    for (int j = 0; j < N; j++) {
      //printf("%lld ", x_v[j]);
    }
    //puts("");

    for (int j = 0; j < M; j++) {
      int sum = 0;
      for (int k = 0; k < k_v[j]; k++) {
        sum += x_v[s_v[j][k]-1];
      }
      if (sum % 2 == p_v[j]) {
        ;
      }
      else {
        flag = -1;
        break;
      }
    }
    if (flag == 0) cnt++;

  }
  cout << cnt << endl;
  // f_n = f_{n-1} + f_{n-2}
  // f_0 = 1
  // f_1 = 1
  // f_2 = 2
  // f_3 = 3
  // long long int j = 0;
  // for (int i = 0; i <= N; i++) {
  //   if (a_v[j] == i) {
  //     j++;
  //   }
  //   else {
  //     if (i >= 2) {
  //       f[i] = f[i-1] + f[i-2];
  //     }
  //     else if (i == 1) {
  //       f[i] = f[i-1] + 0;
  //     }
  //     else if (i == 0) {
  //       f[i] = 1;
  //     }

  //   }
  // }
  // for (int i = 0; i <= N; i++) {
  //   //cout << "f" << f[i] << endl;
  // }
  // //cout << "j:" << j << endl;

  // cout << f[N]%1000000007 << endl;
  return 0;
}


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

using ll = long long;
using ld = long double;
using vi = vector<int>;
using vll = vector<ll>;
using P = pair<int, int>;

constexpr int INF = 1e9;
constexpr ll INFLL = 1e18;
constexpr int MOD = 1e9 + 7;
const ld PI = acosl(-1);

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

struct UnionFind {
  vector<int> d;
  UnionFind(int n=0): d(n,-1) {}
  int find(int x) {
    if (d[x] < 0) return x;
    return d[x] = find(d[x]);
  }
  bool unite(int x, int y) {
    x = find(x); y = find(y);
    if (x == y) return false;
    if (d[x] > d[y]) swap(x,y);
    d[x] += d[y];
    d[y] = x;
    return true;
  }
  bool same(int x, int y) { return find(x) == find(y);}
  int size(int x) { return -d[find(x)];}
};

int main(){
    ios::sync_with_stdio(false); cin.tie(nullptr);
    //cout << fixed << setprecision(6);
    int n, m;
    cin >> n >> m;
    UnionFind uf(n);
    rep (i, m) {
        int a, b;
        cin >> a >> b;
        uf.unite(--a, --b);
    }

    int ans = 0;
    rep (i, n) ans = max(ans, uf.size(i));

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

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

int main() {
    ll N;
    cin >> N;
    ll sum = 0;
    sum += (N * (N+1)) /2;
    sum -= (3*(1+N/3)*(N/3))/2;
    sum -= (5*(1+N/5)*(N/5))/2;
    sum += (15*(1+N/15)*(N/15))/2;
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 3632
s = input()
K = int(input())

S = [ss for ss in s]
S_set = list(set(S))
S_set.sort()

substring = []
for c in S_set:
  idx_c = [i for i, x in enumerate(s) if x == c]
  substring_c = []
  for x in idx_c:
    for dx in range(1, min(5, len(s)-x)+1):
      substring_c.append(s[x:x+dx])
  substring_c = list(set(substring_c))
  substring += substring_c
  if len(substring) >= 5:
    break

substring.sort()
print(substring[K-1])

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

int main() {
	int N,K,s=0;
	cin >> N >> K;
	vector<int> p(N);

	rep(i,N)
		cin >> p.at(i);
	sort(p.begin(), p.end());

	rep(i,K)
		s += p.at(i);
	cout << s << endl;
}

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

#define rep(i, n) for(int i = 0; i < n; i++)

typedef long long ll;
using namespace std;
int mod = 1000000007;

char grid[22][22];
bool visited[22][22];

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

vector<int> node[400];

int main(void){
    int H, W; cin >> H >> W;
    rep(i, H){
        string S; cin >> S;
        rep(j, W){
            grid[i+1][j+1] = S[j];
        }
    }
    for(int i = 1; i <= H; i++){
        for(int j = 1; j <= W; j++){
            if(grid[i][j] == '.'){
                rep(k, 4){
                    int ni = i + dx[k];
                    int nj = j + dy[k];
                    if(grid[ni][nj] == '.') node[(i-1)*W + j].push_back((ni-1)*W + nj);
                }
            }
        }
    }
    
    //頂点1~H*Wまでの辺が引かれた
    int num_node = H*W;
    int wf[num_node+1][num_node+1];
    rep(i, num_node+1) rep(j, num_node+1) wf[i][j] = mod;
    rep(i, num_node+1) wf[i][i] = 0;
    rep(i, num_node+1){
        rep(j, node[i].size()){
            int to = node[i][j];
            wf[i][to] = 1;
        }
    }

    for(int k = 1; k <= num_node; k++){
        for(int i = 1; i <= num_node; i++){
            for(int j = 1; j <= num_node; j++){
                wf[i][j] = min(wf[i][j], wf[i][k] + wf[k][j]);
            }
        }
    }
    rep(i, num_node+1){
        rep(j, num_node+1){
            if(wf[i][j] == mod) wf[i][j] = -1;
        }
    }
    int ans = 0;
    rep(i, num_node+1){
        rep(j, num_node+1){
            ans = max(ans, wf[i][j]);
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 896
#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
signed main(){
  int A,B;
  cin>>A>>B;
  string ans=":(";
  if(A<=8&&B<=8)
    ans="Yay!";
  cout<<ans;
  }


Measured memory_bytes: 256
/*

                              Jai Shree Krishna !!
                                 Radhe Radhe !!
                                 
             उद्यमेन हि सिद्ध्यन्ति कार्याणि न मनोरथैः। नहि सुप्तस्य सिंहस्य मुखे प्रविशन्ति मृगाः।।
             
*/
   
   
#include <bits/stdc++.h>
using namespace std;
 
#define int long long
typedef long long ll;
#define loop(i,n)  for(int i=0;i<n;i++)
#define read(a) int a; cin >>a;
#define readarr(a,n) int a[n] ; for(int i=0;i<n;i++) cin >> a[i];
#define readmat(a,n,m) int a[n][m]; for(int i=0;i<n;i++) for(int j=0;j<m;j++) cin >> a[i][j];
#define pb push_back
#define ff first
#define ss second
#define vi vector<int>
#define pi pair<int,int>
#define vvi vector<vector<int>>
#define sti set<int>
#define vpi vector<pair<int,int>>
#define print(a,n) for(int i=0;i<n;i++) cout<<a[i]<<" "; cout<<endl;
#define printmat(a,n,m) for(int i=0;i<n;i++) {for(int j=0;j<m;j++) cout<<a[i][j]<<" "; cout<<endl;}
#define fast ios_base::sync_with_stdio(false);  cin.tie(NULL);
#define endl "\n"
#define mp make_pair
#define ins insert
#define rep(i,s,e)   for(int i=s;i<=e;i++)
#define repd(i,s,e)  for(int i=e;i>=s;i--)
#define vb vector<bool>
#define read2(n,m) int n,m; cin >> n >> m;
#define range(v) v.begin(),v.end()
#define sortd(v) sort(v.begin(),v.end(),greater<int>())
#define sorti(v) sort(v.begin(),v.end())

const ll inf = 1e18;
const ll mod = 1e9 + 7;
 
signed main()
{
 
    fast;
    int x,y;
    cin >> x >> y;
    if(y%2==1){
    	cout<<"No"<<endl;
    	return 0;
    }
    else{
    	int b = y/2 - x;
    	if(b<0){
    		cout<<"No"<<endl;
    	}
    	else{
    	 int a = x - b;
    	 if(a<0) {
    	 	cout<<"No"<<endl;
    	 }
    	 else cout<<"Yes"<<endl;
    	}
    }
    
    return 0;
}

/* Pooja Yadav */

Measured memory_bytes: 3604
# coding: utf-8
# Your code here!
a,b,c=map(int,input().split())

sum=0
i=0
while True:
    sum+=a
    i+=1
    if sum>=c:
        print(i)
        break
    if i%7==0:
        sum+=b
        if sum>=c:
            print(i)
            break


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

ll f(ll n) {
  return n * (n + 1) / 2;
}

int main() {
  int n;
  cin >> n;
  vector<int> x(n + 1, 0);
  ll ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += i * f(n / i);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 42324
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(void){
    ll n,k,h[100010],dp[100010];
    cin>>n>>k;
    for(int i=0;i<n;i++){
        cin>>h[i];
        dp[i]=1e12;
    }
    dp[0]=0;
    for(int i=1;i<=k&&i<n;i++){
        dp[i]=abs(h[i]-h[0]);
    }
    for(int i=k+1;i<n;i++){
        for(int j=i-k;j<i;j++){
            dp[i]=min(dp[i],dp[j]+abs(h[i]-h[j]));
        }
    }
    cout<<dp[n-1]<<endl;
}


Measured memory_bytes: 1920
#include <iostream>

using namespace std;

int main() {
    int a, b;
    cin >> a >> b;
    int a_tmp, b_tmp;
    a_tmp = a - 1;
    b_tmp = b - 1;
    int ans = 0;
    if (a >= b) {
        ans += a;
        if (a_tmp >= b) {
            ans += a_tmp;
        } else {
            ans += b;
        }
    } else {
        ans += b;
        if (b_tmp >= a) {
            ans += b_tmp;
        } else {
            ans += a;
        }
    }

    cout << ans;
}

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

#define YYDBG 0

#if YYDBG==1
#define PRINTF(...) printf(__VA_ARGS__);
#define FOR for
#define IF if
#define ELSE else
#else
#define PRINTF(...) 
#define FOR(...)
#define IF(...)
#define ELSE 
#endif


typedef struct _ll {
    struct _ll * p;
    struct _ll * n;
    int          c;
    int          v;
}ll;

#define PD(_A,_B) PRINTF("%d,%d -> ", (_A), (_B));

#define LAN(_A,_C,_V) {(_A)=malloc(sizeof(ll));(_A)->c=(_C);(_A)->v=(_V);}
#define LAL(_A,_C,_V) ({if((_A)!=NULL){(_A)->n=malloc(sizeof(ll));(_A)->n->p=(_A);(_A)->n->c=(_C);(_A)->n->v=(_V);}(_A)->n;})
#define LAE(_A,_C,_V) ({ll *c;c=(_A);if(c!=NULL){while(c->n!=NULL){c=c->n;};c->n=malloc(sizeof(ll));c->n->p=c;c->n->v=(_V);}(c->n);})

#define LPT(_A) {ll *c;c=(_A);PRINTF("dump : ");while(c!=NULL){PD(c->c,c->v);c=c->n;}PRINTF("\n");}

#define LAD(_A,_C,_V) {ll *c,*t;c=(_A);if(c!=NULL){while(c->n != NULL){if(c->v>=(_V)){break;}c=c->n;};t=c->n;c->n=malloc(sizeof(ll));c->n->n=t;c->n->p=c;c->n->c=(_C);c->n->v=(_V);}}
#define LAA(_A,_C,_V) {ll *c,*t;c=(_A);if(c!=NULL){while(c->n != NULL){if(c->n->v>(_V)){break;}c=c->n;};t=c->n;c->n=malloc(sizeof(ll));c->n->n=t;c->n->p=c;c->n->c=(_C);c->n->v=(_V);}}
int inputs[100000];
int N;
int main(void) {
    int i,j,k;
    int count;
    int max;
    ll *top, *curr, *last;

    LAN(top,-1,999999);
    last = top;

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

    count = 0;
    max = inputs[N-1];
    for(i=N-1;i>=0;i--) {
        int v = inputs[i];
        PRINTF("[%d] ", count);

        curr = NULL;
        if ( v < last->v ) {
            PRINTF("YYDBG");

        curr = top->n;
        while(curr != NULL) {
            if(curr->v > v) {
                PRINTF("ll (%d, %d)[%d]\n", curr->c, curr->v, v);
//                colors[i] = curr->c;
                curr->v = v;
                break;
            }
            curr = curr->n;
        }
        }


        if(curr == NULL) {
            count++;
            last = LAL(last, count, inputs[i]);
//            LPT(top);

        } else { PRINTF("yydbg\n");}
    }

    printf("%d\n", count);
    return 0;
}



Measured memory_bytes: 3712
#include "bits/stdc++.h"
#define Rep(i,n) for(int i=0;i<(int)(n);i++)
#define For(i,n1,n2) for(int i=(int)(n1);i<(int)(n2);i++)
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define RREP(i,n) for(ll i=((ll)(n)-1);i>=0;i--)
#define FOR(i,n1,n2) for(ll i=(ll)(n1);i<(ll)(n2);i++)
#define RFOR(i,n1,n2) for(ll i=((ll)(n1)-1);i>=(ll)(n2);i--)
#define all(a)  (a).begin(),(a).end()
#define IOS std::cin.tie(0),std::ios::sync_with_stdio(false)

namespace idaten {

	using namespace std;
	using ll = int_fast64_t;
	using ull = uint_fast64_t;
	using P = std::pair<int64_t, int64_t>;
	template<typename T1, typename T2> inline bool chmin(T1& a, T2 b) { if (a > b) { a = b; return 1; }return 0; }
	template<typename T1, typename T2> inline bool chmax(T1& a, T2 b) { if (a < b) { a = b; return 1; }return 0; }
	template<class T> inline std::istream& operator >> (std::istream& is, std::vector<T>& v) { for (T& x : v) { is >> x; }return is; }
	template<class T> inline std::ostream& operator << (std::ostream& os, const std::vector<T>& v) {
		for (auto itr = v.begin(); itr != v.end();) { os << (*itr) << ((++itr != v.end()) ? " " : ""); }
		return os;
	}
	template<class V, typename T>inline void fill(V& v, const T& val) { v = val; }
	template<class V, typename T>inline void fill(std::vector<V>& v, const T& val) { for (V& x : v) { fill(x, val); } }
	template<class V, typename H>inline void resize(std::vector<V>& v, const H h) { v.resize(h); }
	template<class V, typename H, typename... T>inline void resize(std::vector<V>& v, const H& h, const T& ... t) { v.resize(h); for (auto& x : v) { resize(x, t...); } }
	inline void put() {}
	template<class T> inline void put(const T& first) { std::cout << first << "\n"; }
	template<class T, class... N> inline void put(const T& first, const N& ... rest) { std::cout << first << " "; put(rest...); }

	void solve() {
		IOS;
		ll n;
		cin >> n;
		vector<ll> a(n+1);
		cin >> a;
		ll cnt = 0;
		REP(i, n+1) {
			cnt += a[i];
		}
		cnt--;
		vector<ll> c(n+1);
		c[0] = 1;
		ll res = 0;
		FOR(i, 1, n+1) {
			if (c[i - 1] <= a[i - 1]) {
				put(-1);
				return;
			}
			ll m = min(c[i - 1] - a[i - 1], cnt);
			c[i] = m * 2 + (c[i - 1] - m) - a[i - 1];
			cnt -= m;
		}
		if (c.back() != a.back()) {
			put(-1);
			return;
		}
		if (cnt != 0) {
			put(-1);
			return;
		}
		REP(i, n+1) {
			res += c[i];
		}
		put(res);
	}
} // namespace idaten

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


Measured memory_bytes: 4780
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const long double PI = (acos(-1));
#define rep(i, x, n) for (int i = x; i < (int)(n); i++)
#define sc(x) scanf("%d",&x)
#define scll(x) scanf("%lld",&x)
static const int mod = 1e9+7;
ll mpow(ll a, ll n){
    ll res = 1;
    while (n > 0){
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

int main(){
    int n, ans = 0; sc(n);
    vector<int> a(n);
    rep(i, 0, n) sc(a[i]);
    map<int, int> mp;
    rep(i, 0, n) ++mp[a[i]];
    for (const auto &x: mp){
        if (x.second == 2) ans++;
        else if (x.first==0 && x.second==1) continue;
        else{
            ans = -1;
            break;
        }
    }
    if (ans < 0) cout << 0 << endl;
    else cout << mpow(2, ans) << endl;
    return 0;
}

Measured memory_bytes: 3584
#include <stdio.h>
 
int main (void) {
    int a, b;
    scanf("%d %d", &a, &b);
    int n = b - a;
    int sum = 0;

    for ( int i = 1; i <= n; i++ ) {
        sum += i;
    }
    printf("%d", sum - b);

    return 0;
}

Measured memory_bytes: 128
#include <algorithm>
#include <cmath>
#include <complex>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
#include <functional>
#include <cstring>
#include <regex>
#include <random>
#include <cassert>
#include <stack>
using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, s, n) for (int i = (s); i < (int)(n); i++)
#define revrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define revrepr(i, s, n) for (int i = (n) - 1; i >= s; i--)
#define debug(x) cerr << #x << ": " << x << "\n"
#define popcnt(x) __builtin_popcount(x)

using ll = long long;
using P = pair<int, int>;

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

template<class T>
istream& operator >>(istream &is, vector<T> &v) {
    for (int i = 0; i < (int)v.size(); i++) cin >> v.at(i);
    return is;
}

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

template<class T>
void print(const vector<T> &v, const string &delimiter) { rep(i, v.size()) cout << (0 < i ? delimiter : "") << v.at(i); cout << endl; }

template<class T>
void print(const vector<vector<T>> &vv, const string &delimiter) { for (const auto &v: vv) print(v, delimiter); }

int main() {
    int x, y, z;
    cin >> x >> y >> z;
    printf("%d %d %d\n", z, x, y);
}

Measured memory_bytes: 256
from itertools import permutations as pmt

N,M = [int(x) for x in input().split()]

import numpy as np
Mat = [[0 for i in range(N)] for j in range(N)]
for i in range(M):
    a,b = [int(x) for x in input().split()]
    Mat[a-1][b-1] = 1

Mat = np.array(Mat)
Mat += Mat.T

ans = 0
for od in pmt([i for i in range(1,N)]):
    order = [0] + list(od)
    ok = True
    for i in range(N-1):
        ok &= (Mat[order[i]][order[i+1]] > 0)
    ans += int(ok)    

print(ans)

Measured memory_bytes: 14468
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll maxn = 1e7 + 5;
const ll maxm = 1e3 + 5;
ll n, ans;
ll f[maxn];
int main(){
    cin >> n;
    for(ll i = 1;i <= n;i++){
        for(ll j = 1;i * j <= n;j++){
            f[i * j]++;
        }
    }
    for(ll i = 1;i <= n;i++){
        ans += i * f[i];
    }
    // for(int i = 1;i <= n;i++){
    //     cout << f[i] << endl;
    // }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 81712
#include <iostream>
#include <algorithm>
#include <vector>
#include <string.h>
#include <cmath>
#include <math.h>
#include <ctime>
#include <cstring>
#include <climits>
#include <sstream>
#include <array>
#include <tuple>
#include <set>
#include <iterator>
#include <cstdio>
#include <string>
#include <stack>
#include <valarray>
#include <utility>
#include <iomanip>
#include <list>
#include <numeric>
#include <regex>
#include <map>
#include <queue>
#include <deque>
#include <unordered_set>
#include <unordered_map>

using namespace std;

#define ios         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define ll          long long
#define PI          3.1415926535
#define pb          push_back
#define ins         insert
#define INF         LLONG_MAX
#define mk          make_pair
#define lb(v,x)     lower_bound(all(v),x)
#define ub(v,x)     upper_bound(all(v),x)
#define ff          first
#define ss          second
#define rev         reverse
#define uset        unordered_set
#define umap        unordered_map
#define endl        "\n"
#define max3(x,y,z)  max(x,max(y,z))
#define min3(x,y,z)  min(x,min(y,z))
#define sz(a)       (ll)a.size()
#define double      long double
#define minpq       priority_queue <ll,vector<ll>,greater<ll> > 
#define fill(x,y)   memset(x,y,sizeof(x))
#define all(x)      (x).begin(), (x).end()
#define rall(x)     (x).rbegin(), (x).rend()
#define MOD         1000000007 //1e9+7
#define bp(n)       __builtin_popcountll(n)
#define mxt(a)      *(max_element(a.begin(),a.end()))
#define mnt(a)      *(min_element(a.begin(),a.end())
#define unique_sort(c) (sort(all(c)), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define rep(i, a, b) for(ll i = (a); i<= (b); ++i)
#define trav(a, x) 	 for(auto &a : x)
#define re(i,n)      for(ll i = 0; i < n; ++i) 
const ll N = 2e5 + 7;
typedef pair<ll,ll>   pii;
typedef vector<pii>   vpii;
typedef vector<ll>    vll;
const string alpha = "abcdefghijklmnopqrstuvwxyz";
ll power(ll x,ll y){ll res=1;x=x;while(y>0){if(y&1)res=(res*x);y=y>>1;x=(x*x);}return res;}
template<typename T> T gcd(T a,T b){ if(a==0) return b; return gcd(b%a,a); }
template<typename T> T powm(T a,T b, ll m){T cnt=1; while(b>0){ if(b%2==1) cnt=(cnt*a)%m; b/=2; a=(a*a)%m; }return cnt%m;}
ll ncr(ll n,ll r){ll res=1;if(r>n)return 0;if(r>n-r)r=n-r;for(ll i=0;i<r;i++){res*=(n-i);res/=(i+1);}return res;}
ll sqr(ll x) { return x * x;}
// always use 1ll*ans to avoid signed integer overflow; 
void prec(){

}
void solve(){
	ll n,m,x,ans=INF;
	cin>>n>>m>>x;
	ll c[n+1],a[n+1][m+1];
	rep(i,0,n-1){
		cin>>c[i];
		rep(j,0,m-1) cin>>a[i][j];
	}
	ll nop[m];
	fill(nop,0);
	for(int mask=0; mask<(1<<n); ++mask){
		ll cost=0;
		for(int i=0; i<n; ++i){
			if(mask & (1<<i)){
				cost+=c[i];
				rep(j,0,m-1){
					nop[j]+=a[i][j];
				}
			}
		}
		int ok=1;
		rep(j,0,m-1) if(nop[j]<x) ok=0;
		if(ok) ans=min(ans,cost);
		fill(nop,0);
	}
	if(ans==INF) cout<<"-1\n";
	else cout<<ans<<endl;
}

int main()
{
    ios;
    int tc=1;
    //cin>>tc;
    prec();
    while(tc--)
    	solve();
    return 0; 
}


Measured memory_bytes: 3192
#include <bits/stdc++.h>
#include <iostream>
#define pb push_back
#define INF 1000000000
#define mp make_pair
#define ll long long
#define tc int t; cin>>t; while(t--)
#define for0(i,n) for(int i=0; i<n; i++)
#define for1(i,n) for(int i=1; i<=n; i++)
#define pi pair<int,int>
#define pii vector<pair<int,int>>

using namespace std;

#define nl '\n'
#define dbg(...) cout << "[" << #__VA_ARGS__ << "]: ", cout << to_string(__VA_ARGS__) << endl
/*compact version*/
template <typename T, size_t N> int SIZE(const T (&t)[N]) { return N; } template<typename T> int SIZE(const T &t) { return t.size(); } string to_string(string &s, int x1 = 0, int x2 = 1e9) { return '"' + ((x1 < s.size()) ? s.substr(x1, x2 - x1 + 1) : "") + '"'; } string to_string(const char* s) { string tmp(s); return to_string(tmp); } string to_string(bool b) { return (b ? "true" : "false"); } string to_string(char c) { return string({c}); } template<size_t N> string to_string(bitset<N> &b, int x1 = 0, int x2 = 1e9) { string t = ((x1 < b.size()) ? (b.to_string()).substr(x1, x2 - x1 + 1) : ""); reverse(begin(t), end(t)); return '"' + t + '"'; } template <typename A, typename... C> string to_string(A (&v), int x1 = 0, int x2 = 1e9, C... coords); int l_v_l_v_l = 0, t_a_b_s = 0; template <typename A, typename B> string to_string(pair<A, B> &p) { l_v_l_v_l++; string res = "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; l_v_l_v_l--; return res; } template <typename A, typename... C> string to_string(A (&v), int x1, int x2, C... coords) { int rnk = rank<A>::value; string tab(t_a_b_s, ' '); string res = ""; bool first = true; if (l_v_l_v_l == 0) res += nl; res += tab + "["; x1 = min(x1, SIZE(v)), x2 = min(x2, SIZE(v)); auto l = begin(v); advance(l, x1); auto r = l; advance(r, (x2 - x1) + (x2 < SIZE(v))); for (auto e = l; e != r; e = next(e)) { if (!first) { res += ", "; } first = false; l_v_l_v_l++; if (e != l) { if (rnk > 1) { res += nl; t_a_b_s = l_v_l_v_l; }; } else { t_a_b_s = 0; } res += to_string(*e, coords...); l_v_l_v_l--; } res += "]"; if (l_v_l_v_l == 0) res += nl; return res; }
/*end of compact version*/

void prl(int x) {cout << x << endl;}
void pr(int x) { cout << x << " ";}

void init() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
#ifndef ONLINE_JUDGE
    freopen("input1.txt", "r", stdin);
    freopen("output1.txt", "w", stdout);
#endif
}
const int sz = 10001000;
const int size = 1e6 + 1;


int main() {
    init();
    // tc
    {
        ll n; cin >> n;
        int intrst = 1;
        ll x = 100;
        ll cnt = 0;
        ll j = 1;
        // cout << 110 / 100 << " ";
        while (x < n) {
            x += x / 100;
            cnt++;
        }
        cout << cnt << endl;
    }
    return 0;
}

Measured memory_bytes: 3656
#include"bits/stdc++.h"
using namespace std;

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define eb emplace_back

using ll = long long;
using vll = vector<ll>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using P = pair<int, int>;

void Main() {
    ll a, b, k; cin >> a >> b >> k;
    
    rep(i, k){
        if(i&1){
            if(b&1) b--;
            a += b/2;
            b /= 2;
        }
        else{
            if(a&1) a--;
            b += a/2;
            a /= 2;
        }
    }
    cout << a << " " << b << endl;
    return;
}

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

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

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

//繰り返し二乗法
ll mod_pow(ll a, ll n, ll m) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%m;
		a = a * a%m; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

//逆元(Eucledean algorithm)
ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 18;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
using mP = pair<modint, modint>;

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



void solve() {
	string s; cin >> s;
    if(s[2] == s[3] && s[4] == s[5]) cout << "Yes" << endl;
    else cout << "No" << endl;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  //cout << fixed << setprecision(10);
  //init_f();
  //init();
  //int t; cin >> t; rep(i, t)solve();
  solve();
//   stop
    return 0;
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
#define MN 100000
struct edge{int nx,t;}e[MN*2+5];
int h[MN+5],en,r[MN+5],q[MN+5],qn,u[MN+5],f[MN+5],ans,ad;
char c[MN+5];
inline void ins(int x,int y)
{
	e[++en]=(edge){h[x],y};h[x]=en;++r[x];
	e[++en]=(edge){h[y],x};h[y]=en;++r[y];
}
void dp(int x,int fa)
{
	ad+=r[x];ad+=r[x]=(c[x]=='W')^(r[x]&1);
	for(int i=h[x];i;i=e[i].nx)if(e[i].t!=fa&&!u[e[i].t])
	{
		dp(e[i].t,x);
		ans=min(ans,f[x]+f[e[i].t]);
		f[x]=min(f[x],f[e[i].t]-2*r[x]);
	}
}
int main()
{
	int n,i,j,x,y;
	scanf("%d",&n);
	for(i=1;i<n;++i)scanf("%d%d",&x,&y),ins(x,y);
	scanf("%s",c+1);
	for(i=1;i<=n;++i)if(r[i]<2&&c[i]=='B')u[q[++qn]=i]=1;
	for(i=1;i<=qn;++i)for(j=h[q[i]];j;j=e[j].nx)
		if(--r[e[j].t]==1&&c[e[j].t]=='B')u[q[++qn]=e[j].t]=1;
	if(n==qn)return 0*puts("0");
	for(i=1;i<=n;++i)if(!u[i]){dp(i,0);break;}
	printf("%d",ans+ad);
}

Measured memory_bytes: 7296
mod = 10**9+7
import fractions,collections
def lcm(a,b):
    return (a*b)//fractions.gcd(a,b)
N = int(input())
A = list(map(int,input().split()))
C = collections.Counter(A)
k = list(C.keys())
v = list(C.values())
lc = 1
for i in range(len(k)):
    lc = lcm(lc,k[i])
ans = 0
for i in range(len(k)):
    ans += lc//k[i]*v[i]
print(ans%mod)

Measured memory_bytes: 6620