akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <cstdint>
#include <cctype>
#include <numeric>
#include <bitset>
#include <functional>

using namespace std;

using ll =  long long;
using Pll = pair<ll, ll>;
using Pii = pair<int, int>;

constexpr int INF = 1 << 30;
constexpr ll LINF = 1LL << 60;
constexpr ll MOD = 1000000007;
constexpr long double EPS = 1e-10;
constexpr int dyx[4][2] = {
    { 0, 1}, {-1, 0}, {0,-1}, {1, 0}
};
int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    string s;
    cin >> s;
    int n = s.length();
    if(s[n-1] == 's') {
        cout << s << "es" << endl;
    } else {
        cout << s << "s" << endl;
    }
}

Measured memory_bytes: 3648
N = int(input())
S = str(input())
if N%2 == 1:
  print('No')
else:
  dev = int(N/2)
  str_mae = S[0:dev] 
  str_usiro = S[dev:] 
  if str_mae == str_usiro:
    print('Yes')
  else:
    print('No')

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

int main() {
  int X;
  cin >> X;
  vector<int> P(110000, 1);
  for(int i = 2; i * i <= 110000; i++) {
    if(P.at(i)) {
      for(int j = 0; i * (j + 2) < 110000; j++) {
        P.at(i * (j + 2)) = 0;
      }
    }
  }
  for(int i = X; i < 110000; i++) {
    if(P.at(i)) {
      cout << i << endl;
      break;
    }
  }
}

Measured memory_bytes: 640
import heapq

n, m = map(int,input().split())
A = list(map(lambda x:-int(x),input().split()))

heapq.heapify(A)

for i in range(m):
    maxim = heapq.heappop(A)
    maxim = -(-maxim//2)
    heapq.heappush(A, maxim)
    
print(-sum(A))

Measured memory_bytes: 20404
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"strconv"
)

var (
	readString func() string
	stdout     *bufio.Writer
)

func init() {
	readString = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

func readInt() int {
	return int(readInt64())
}

func readInt64() int64 {
	i, err := strconv.ParseInt(readString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = readInt()
	}
	return b
}

func readLengthAndSlice() (int, []int) {
	n := readInt()
	return n, readIntSlice(n)
}

func printf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(stdout, f, args...)
}

func println(args ...interface{}) (int, error) {
	return fmt.Fprintln(stdout, args...)
}

func eprintln(args ...interface{}) (int, error) {
	return fmt.Fprintln(os.Stderr, args...)
}

func eprintf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(os.Stderr, f, args...)
}

// readString() string
// readInt() int
// readIntSlice(n int) []int
// readLengthAndSlice() []int

// -----------------------------------------------------------------------------

func main() {
	defer stdout.Flush()
	n := readInt()

	var ans int
	var rec func(a, d int, used [8]bool) int
	rec = func(a, d int, used [8]bool) int {
		if n < a {
			return 0
		}
		if d == 0 {
			if used[3] && used[5] && used[7] {
				return 1
			} else {
				return 0
			}

		}
		var res int
		for _, x := range []int{3, 5, 7} {
			saved := used[x]
			used[x] = true
			res += rec(a+x*d, d/10, used)
			used[x] = saved
		}
		return res
	}
	d := 100
	v := 1
	for v != 0 {
		var used [8]bool
		v = rec(0, d, used)
		ans += v
		d *= 10
	}

	println(ans)
}

// -----------------------------------------------------------------------------


Measured memory_bytes: 640
N = int(input())
A = list(map(int,input().split()))

A.append(0)

money = 1000
kau = 0

for i in range(N):
    if A[i] < A[i+1]:
        continue
    else:
        kabu = money//A[kau]
        money = money - A[kau]*kabu
        money = money + kabu*A[i]
        kau = i+1
        
print(max(money,1000))

Measured memory_bytes: 9136
#include <iostream>
#include <string>
#include <vector>
#include <climits>
#include <set>
#include <algorithm>
#include <unordered_map>
#include <queue>
#include <iomanip>
#include <map>
#include <utility>
#include <numeric>
#include <chrono>
#include <ctime>
#include <bitset>
#include <iterator>
#include <cmath>
#include <stack>
#include <random>

#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define debug(x) cerr << #x << ": " << x << ", "
#define debugln(x) cerr << #x << ": " << x << '\n'

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

using namespace std;
using ll = long long;
using P = pair<ll, ll>;

constexpr ll mod = 1e9+7;
const double PI = acos(-1.0);
mt19937_64 engine(chrono::steady_clock::now().time_since_epoch().count());

vector<int> graph[100005];
int memo[2][100005];

ll dfs(int p, bool black, int rev) {
  if (memo[black][p] != -1) {
    return memo[black][p];
  }
  ll ret = 1;
  for(auto e: graph[p]) {
    if (e == rev) continue;
    ret *= dfs(e, false, p);
    ret %= mod;
  }
  if (!black) {
    ll ret2 = 1;
    for(auto e: graph[p]) {
      if (e == rev) continue;
      ret2 *= dfs(e, true, p);
      ret2 %= mod;
    }
    ret += ret2;
    ret %= mod;
  }
  //debug(p); debug(black); debugln(ret);
  memo[black][p] = ret;
  return ret;
}

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

  int n; cin >> n;
  rep(i, n-1) {
    int x, y; cin >> x >> y;
    graph[x].push_back(y);
    graph[y].push_back(x);
  }

  for(int i=1; i<=n; i++) {
    memo[0][i] = memo[1][i] = -1;
  }

  cout << dfs(1, false, -1) << endl;

}


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

int main() {
  ll n,count=0;
  cin >> n;
  ll sum[n];
  bool flag[n];
  flag[n-1]=true;
  vector<ll> v(n);
  r(i,n) cin >> v[i];
  sort(v.begin(),v.end());
  sum[0]=v[0];
  r(i,n-1)sum[i+1]=sum[i]+v[i+1];
  r(i,n-1){
    if(sum[i]*2>=v[i+1])flag[i]=true;
    else flag[i]=false;
  }
  r(i,n){
    if(flag[n-1-i]==true)count++;
    else break;
  }
  cout<<count<<endl;
}

Measured memory_bytes: 1920
#include<bits/stdc++.h>
using namespace std;
int main(){
  long h,n; cin >> h >> n;
  long sum = 0;
  for(int i = 0; i < n; i++){
    long a; cin >> a;
    sum += a;
  }
  if(h - sum <= 0)
    cout << "Yes";
  else
    cout << "No";
}
  

Measured memory_bytes: 3596
import java.util.*;

public class Main{
	public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        if(n==1){
            System.out.println("Hello World");
            return;
        }
        int a = sc.nextInt();
        int b = sc.nextInt();
        System.out.println(a+b);
    }
}


Measured memory_bytes: 23252
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define rrep(i,a,b) for(ll i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()

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

    string s[n];
    ll t[n];
    rep(i, 0, n){
        cin >> s[i];
        cin >> t[i];
    }

    string x;
    cin >> x;

    bool flag = 0;
    ll count = 0;
    rep(i, 0, n){
        if(flag){
            count += t[i];
        }
        if(s[i] == x){
            flag = 1;
        }
    }

    cout << count << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    int c1,c5,c10,c50,c100,c500,x;
    x = 0;
    cin>>c1>>c5>>c10>>c50>>c100>>c500;
    if (c1*1 + c5*5 + c10*10 + c50*50+ c100*100 + c500*500  >= 1000) {
        x=1;
    }
    
    cout<< x <<endl;
    
    return 0;
    
}

Measured memory_bytes: 1164
module Main where

-- import Debug.Trace

main :: IO ()
main = do
  n <- readLn :: IO Int
  hs <- map (read::String -> Int) . words <$> getLine
  print $ go hs 0 0
  where
    go [x] l mx = (max mx l)
    go (x:y:xs) l mx = if x >= y
      then go (y:xs) (l+1) mx
      else go (y:xs) 0 (max mx l)


Measured memory_bytes: 33148
// created by mtnshh
 
#include<bits/stdc++.h>
#include<algorithm>
using namespace std;

#define ll long long
#define ld long double
 
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define repb(i,a,b) for(ll i=a;i>=b;i--)
 
#define err() cout<<"=================================="<<endl;
#define errA(A) for(auto i:A)   cout<<i<<" ";cout<<endl;
#define err1(a) cout<<#a<<" "<<a<<endl
#define err2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<endl
#define err3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<endl
#define err4(a,b,c,d) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<" "<<#d<<" "<<d<<endl

#define pb push_back
#define all(A)  A.begin(),A.end()
#define allr(A)    A.rbegin(),A.rend()
#define ft first
#define sd second
 
#define pll pair<ll,ll>
#define V vector<ll>
#define S set<ll>
#define VV vector<V>
#define Vpll vector<pll>
 
#define endl "\n"
 
const ll logN = 20;
const ll M = 1000000007;
const ll INF = 1e12;
#define PI 3.14159265
 
const ll N = 100005;

void solve(){
	ll n,p;
	string s;
	cin>>n>>p>>s;
	ll ans=0;
	if(p==2 or p==5){
		rep(i,0,n)	if((s[i]-'0')%p==0)	ans+=(i+1);
		cout<<ans<<endl;
		return;
	}
	map<ll,ll> m;
	m[0]++;
	ll sum=0;
	ll q=1;
	repb(i,n-1,0){
		sum = (sum + (s[i]-'0')*q)%p;
		q=(10*q)%p;
		ans += m[sum];
		m[sum]++;
	}
	cout<<ans<<endl;
	return;
}

int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	ll no;
	// cin>>no;
	no = 1;
	while(no--){
		solve();
	}
    return 0;
}

Measured memory_bytes: 1044
#include<iostream>
#include<string>
#include<algorithm>
#include<bits/stdc++.h>
#include<vector>
 
using namespace std;
int MOD=1000000007;

int main(){
    int N,K; cin >> N >> K;
    string S; cin >> S;
    if(S[K-1]=='A') S[K-1]='a';
    else if(S[K-1]=='B') S[K-1]='b';
    else S[K-1]='c';
    cout << S << endl;
}

Measured memory_bytes: 764
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int N;
    cin >> N;
    if (N%2 == 1){
        N = N - 1;
        cout << N / 2 << endl;
    }
    else{
        cout << N / 2 - 1 << endl;
    }
}

Measured memory_bytes: 256
//AUTHOR: RAVAN_2070
//PUNE INSTITUTE OF COMPUTER TECHNOLOGY
/*                                                    
      I ♥ CLARICE STARLING...                                                               
      EXPLAINATION BELOW->
      Same as editorial ,main to uderstand no restriction on visiting again the visisted nodes
      Best TC
      5 4
      1 2,1 3,2 4, 2 5
      answer 1 2 3 4 5
*/
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<pair<ll,ll>> vii;
typedef pair<ll,ll> pii;
typedef map<ll,ll> mii;
#define MOD7 1000000007
#define MOD9 1000000009
#define pi 3.1415926535
#define Test_cases ll TC;cin>>TC;while(TC--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(), x.rend()
#define sp(x) fixed<<setprecision(x)
#define sz(x) (ll)(x.size())
#define fo(i,a,b) for(i=a;i<b;i++)
#define foe(i,a,b) for(i=a;i<=b;i++)
void solve()
{
   int n,mx=0;cin>>n;
   map<string,int>M;
   while(n--)
   {
       string s;cin>>s;
       M[s]++;
       mx=max(mx,M[s]);
   }
   map<string,int>::iterator it=M.begin();
   while(it!=M.end())
   {
       if(mx==it->S)
       cout<<it->F<<"\n";
       
       it++;
   }
       
}
int main()
{
   fastio
   solve();
  return 0;
}
//map<ll,ll,greater<int>> to sort in descending order ,in iterator declaration no greater<int>
//if you want to apply lowerbound on set use s.lower_bound(key),not the one used for vector
// Syntax to create a min heap for priority queue priority_queue <int, vector<int>, greater<int>>; 


Measured memory_bytes: 23808
#include <bits/stdc++.h>
#define rep(i,n,m) for(int i=n;i<(int)(m);i++)
#define rrep(i,n,m) for(int i=((int)(n)-1);i>=m;i--)
#define all(x) (x).begin(),(x).end()
#define sz(x) int(x.size())
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
using namespace std;
int main(){
    int m;
    cin>>m;
    cout<<48-m<<endl;
}


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

int main(){
    string s;
    cin >> s;
    int n;
    n = s.length();
    if (s.at(n-1) == 's'){
        cout << s << "es" << endl;
    }else{
        cout << s << 's' << endl;
    }
}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
const long long INF = 1LL << 60;

int main() {
  int N,k=1,l=1;
  cin >> N;
  
  long long dp[100010];
  rep(i,100001){
    dp[i]=INF;
  }
  dp[0]=0;
  
  for(int i=0;i<N;i++){
    dp[i+1]=min(dp[i+1],dp[i]+1);
  }
  
  for(int j=0;j<6;j++){
    k *= 6;
    for(int i=0;i<N-k+1;i++){
    	dp[i+k]=min(dp[i+k],dp[i]+1);
  	}
  }
  
  for(int j=0;j<5;j++){
    l *= 9;
      for(int i=0;i<N-l+1;i++){
        dp[i+l]=min(dp[i+l],dp[i]+1);
      }
  }
  
  cout << dp[N] <<endl;
}

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

#define REP(i,n) for(ll i=0;i<(n);i++)
#define REAP(i,a,n) for(ll i=(a);i<(n);i++)
#define YES cout<<"Yes"<<endl
#define NO cout<<"No"<<endl
#define fr first
#define sc second
#define pb push_back
#define All(v) v.begin(),v.end()
typedef long long ll;

ll sp(ll x,ll y){
    ll a,b,c;
    ll wl,ws;
    wl=ws=x/2;
    if(x%2){
        wl=(x+1)/2;
    }
    ll mi=INT_MAX;
    REP(i,y-1){
        a=(i+1)*x;
        b=(y-i-1)*wl;
        c=(y-i-1)*ws;
        mi=min(mi,max(abs(a-b),max(abs(b-c),abs(c-a))));
    }
    return mi;
}

ll kaw(ll x,ll y){
    ll a,b,c;
    ll mi=INT_MAX;
    REP(i,y-1){
        a=(i+1)*x;
        b=c=(y-i-1)/2*x;
        if((y-i-1)%2)b=(y-i)/2*x;
        mi=min(mi,max(abs(a-b),max(abs(b-c),abs(c-a))));
    }
    return mi;
}

int main(){
    ios::sync_with_stdio(false);
    ll h,w;
    cin >> h >> w;
    ll mi=INT_MAX;
    mi=min(mi,sp(h,w));
    mi=min(mi,sp(w,h));
    mi=min(mi,kaw(h,w));
    mi=min(mi,kaw(w,h));
    cout << mi << endl;
}


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

int main(){
	int k;
  	string s;
  	cin >> k >> s;
  
  	if(s.size() > k){
      s = s.substr(0, k);
  	  s += "...";
    }

  	cout << s << endl;
}

Measured memory_bytes: 3632
#include <iostream>
#include <cmath>
#include <climits>
#include <string>
#include <numeric>
#include <vector>
#include <queue>
#include <map>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <set>

using namespace std;
using ll = long long;

template<typename T> void print(T t) { cout << t << endl; }

int main() {
	int A, B, C, K, n = 0;
	cin >> A >> B >> C >> K;
	while (A >= B) {
		B *= 2;
		n++;
	}
	while (B >= C) {
		C *= 2;
		n++;
	}
	print(n <= K ? "Yes" : "No");
}


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

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

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

#define CPP_STR(x) CPP_STR_I(x)
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_STR_I(args...) #args
#define CPP_CAT_I(x,y) x ## y

using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;

using f32 = float;
using f64 = double;

#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) for(i64 i = 1; i <= n; ++i)
#define RREP(i, n) for(i64 i = n - 1; i >= 0 ; --i)
#define RREPS(i, n) for(i64 i = n; i >= 1; --i)

#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))

#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

#define pb push_back
#define mp make_pair
#define F first
#define S second

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

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }

template<typename T, size_t N>
i64 SIZE(const T (&)[N]) { return static_cast<i64>(N); }


struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;

    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;


int main() {
    i64 N; cin >> N;
    i64 a;
    vector<i64> cnt(N, 0);
    REP(i, N - 1) {
        cin >> a;
        a--;
        cnt[a]++;
    }

    REP(i, N) {
        cout << cnt[i] << endl;
    }

    return 0;
}

Measured memory_bytes: 4784
#include <iostream>
#include <vector>
#include <queue>
#include <limits>
#include <tuple>

template <class T>
using MaxHeap = std::priority_queue<T>;
template <class T>
using MinHeap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

template <class Cost = int>
struct Edge {
    int src, dst;
    Cost cost;
    Edge(int src = -1, int dst = -1, Cost cost = 1)
        : src(src), dst(dst), cost(cost){};
};

template <class Cost = int>
using Graph = std::vector<std::vector<Edge<Cost>>>;

template <class Cost>
std::vector<Cost> dijkstra(const Graph<Cost>& graph, int s) {
    constexpr Cost INF = std::numeric_limits<Cost>::max();

    std::vector<Cost> dist(graph.size(), INF);
    dist[s] = 0;
    MinHeap<std::pair<Cost, int>> que;
    que.emplace(0, s);

    while (!que.empty()) {
        int v;
        Cost d;
        std::tie(d, v) = que.top();
        que.pop();
        if (d > dist[v]) continue;

        for (auto e : graph[v]) {
            if (dist[e.dst] <= dist[v] + e.cost) continue;
            dist[e.dst] = dist[v] + e.cost;
            que.emplace(dist[e.dst], e.dst);
        }
    }
    return dist;
}

constexpr int INF = std::numeric_limits<int>::max();

int main() {
    int n, m, s;
    std::cin >> n >> m >> s;

    Graph<int> graph(n);
    while (m--) {
        int u, v, d;
        std::cin >> u >> v >> d;
        graph[u].emplace_back(u, v, d);
    }

    auto dist = dijkstra(graph, s);
    for (auto d : dist) {
        if (d == INF) {
            std::cout << "INF" << std::endl;
        } else {
            std::cout << d << std::endl;
        }
    }
    return 0;
}



Measured memory_bytes: 15288
#include<bits/stdc++.h>
using namespace std;
#define ll long long

void solve()
{
 
string s,t;
    cin>>s>>t;
    int n=s.size(),m=t.size(),i,j;
    int ans=1e9;
    for(i=0;i<n;i++)
    {
        int cnt=0;
        int k=i;
        j=0;
        while(k<n&&j<m)
        {
           if(s[k]!=t[j])cnt++;
           k++;j++;
        }
        if(j==m)ans=min(ans,cnt);
    }
    cout<<ans<<endl;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    int t=1;
  //  cin>>t;
    while(t--)
        solve();
}

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

#define rep(i, n) REP(i, 0, n)
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(x) cout << x << endl;

int main() {
    string s;
    cin >> s;

    int cnt = 0;
    int ans = 0;
    rep(i,s.size()){
        if(s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T'){
            cnt = 1;
            REP(j,i+1,s.size()){
                if(s[j] == 'A' || s[j] == 'C' || s[j] == 'G' || s[j] == 'T'){
                    cnt += 1;
                }else{
                    break;
                }
            }
            ans = max(ans, cnt);
        }
    }
    OP(ans);
}


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

using namespace std;

#define int long long
#define ALL(x) (x).begin(),(x).end()
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))

typedef pair<int,int> PI;
typedef pair<int,pair<int,int>> PII;
static const int INF=1010000000000000017LL;
static const double eps=1e-12;
static const double pi=3.14159265358979323846;
static const int dx[4]={1,-1,0,0};
static const int dy[4]={0,0,1,-1};
static const int ddx[8]={1,-1,0,0,1,1,-1,-1};
static const int ddy[8]={0,0,1,-1,1,-1,1,-1};

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

int mod=1000000007;

int S;
int dp[5005];

signed main(){
    cin>>S;
    for(int i=3;i<=2000;++i)dp[i]=1;
    for(int s=3;s<=S;++s){
        for(int i=3;i<=2000;++i){
            dp[s+i]+=dp[s];
            dp[s+i]%=mod;
        }
    }
    cout<<dp[S]%mod<<endl;
}

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

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

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

Measured memory_bytes: 384
n, a, b=gets.strip.split.map(&:to_i)
h = readlines.map {|line| line.strip.to_i }
c=a-b

ok=(h.max/b.to_f).ceil
ng=1
while ok-ng > 1
#p [ok,ng]
  mid = (ok+ng)/2
  remains = h.map {|e| e-b*mid }.select {|e| e>0 }
  if remains.length.zero?
    ok=mid
    next
  end
  if mid >= remains.map {|e| (e/c.to_f).ceil }.inject(:+)
    ok=mid
  else
    ng=mid
  end
end

p ok


Measured memory_bytes: 67164
#include<bits/stdc++.h>
# define ll long long
# define inf 1e9+5
using namespace std;
int main(){
	ll n;
	cin>>n;
	vector<ll>c(n);
	for(ll i=0;i<n;i++) cin >>c[i];
	vector<ll>dp(n,inf);
	dp[0]=0;
	for(ll i=1;i<=n;i++){
		for(auto j:{i-1,i-2}){
			if(j>=0){
		dp[i]=min(dp[i],dp[j]+abs(c[i]-c[j]));
	}
	}
}

		cout<<dp[n-1]<<"\n";
		
	
	
	
	
	return 0;
	}


Measured memory_bytes: 1792
#include<iostream>
#include<string>
#include<queue>
//#include<algorithm>
using namespace std;

int main(){
  int n, q, t;
  string name;
  queue<pair<string, int> > Q; //????????????????????\???

  cin >> n >> q;
  for(int i = 0; i < n; i++){
    cin >> name >> t;
    Q.push(make_pair(name, t));
  }

  pair<string, int> u;
  int elaps = 0, a;

  //????????\??¬????????§???
  for (; !Q.empty();){
    u = Q.front(); Q.pop();
    a = min(u.second, q); //a???????????????????????????????????§????????????q???
    u.second -= a;
    elaps += a; //?????????????????????
    if ( u.second > 0 ){
      Q.push(u); //??????????????????????????´???????????\??????????°??????????
    }
    else{
      cout << u.first << " " << elaps << endl;
    }
  }

  return 0;

}

Measured memory_bytes: 6356
//0:実行モード
//1:開発モード
//2:最終テストモード
const sys_debugMode : number = 0;

function chk(in_data1 : any, in_data2? : any) : void{
	if (sys_debugMode == 0 || sys_debugMode == 2){
		return;
	}
	else if (in_data2 === undefined){
		console.log(in_data1);
	}
	else{
		console.log(in_data1 + "[" + typeof(in_data2) + "] =", in_data2);
	}
}

function prt(in_data : any) : void{
	console.log(in_data);
}

class ParamManager {

	private a_s_inputLines : string[];
	private n_maxLine : number;
	private n_nowLineCnt : number;

	constructor(){
		this.a_s_inputLines = this.inputLines();
		this.n_maxLine = this.a_s_inputLines.length;
		this.descLines();
		this.n_nowLineCnt = 1;
	}
	inputLines(){
		const fs = require('fs');

		let text;
		if(sys_debugMode == 0){
			text = fs.readFileSync("/dev/stdin", 'utf8');
		}
		else{
			text = fs.readFileSync("input.txt", 'utf8');
		}

		const line:string[] = text.toString().replace(/\r/g, "").split('\n');

		return line;
	}
	descLines(){
		chk("ParamManager.a_s_inputLines", this.a_s_inputLines);
	}
	getNextLine(in_s_type?):any{
		if (this.n_nowLineCnt > this.n_maxLine){
			chk("ParamManager.getNextLine","No Next Line!");
			return;
		}
		const s_returnLine:string = this.a_s_inputLines[this.n_nowLineCnt - 1];

		this.n_nowLineCnt++;
		
		if (in_s_type == "n"){
			return parseInt(s_returnLine);
		}
		else if (in_s_type == "a"){
			return s_returnLine.split(" ");
		}
		else if (in_s_type =="an" || in_s_type =="na"){
			const a_s_temp = s_returnLine.split(" ");
			const a_n_temp = a_s_temp.map(function(str){return Number(str)});
			return a_n_temp;
		}
		else{
			return s_returnLine;
		}
	}
}
const paramManager = new ParamManager();
//==================================================
//A - Sheep and Wolves
//==================================================
class Param{
	sheepNum:number;
	wolfNum:number;

	constructor(){
		chk("--------------------------------------------------");
		chk("パラメータ");
		//羊が S匹、狼がW匹います。
		const aTemp = paramManager.getNextLine("an");
		this.sheepNum = aTemp[1-1];
		this.wolfNum = aTemp[2-1];
		
		chk(this);
	}
}
const param = new Param();
//==================================================
class Manager{

	constructor(){
		this.main();
	}

	main():void{
		chk("--------------------------------------------------");
		chk("main");
		//狼の数が羊の数以上のとき、羊は狼に襲われてしまいます。
		if(param.wolfNum >= param.sheepNum){
			//羊が狼に襲われるなら unsafe
			prt("unsafe");
		}
		else{
			//襲われないなら safe
			prt("safe");
		}
	}
}
const manager = new Manager();
//==================================================

Measured memory_bytes: 29568
#include<bits/stdc++.h>
#include<iostream>
using namespace std;
int main() {
  ios::sync_with_stdio(0);cin.tie(0);   //b题 
  int n,t=0;
  cin>>n;
  string s;
  cin>>s;
  for(int i=0;i<n-2;i++)
  {
  	if(s[i]=='A')
  	{
  		if(s[i+1]=='B'&&s[i+2]=='C')
  		t++;
	  }
  }
  cout<<t;
  
 
  
}

Measured memory_bytes: 384
L=int(input())
n=L.bit_length()
if L==2**n:
  n+=1
path=[]
for i in range(1,n):
  path.append([i,i+1,0])
  path.append([i,i+1,2**(i-1)])
k=(L-1)-(2**(n-1)-1)
cur=2**(n-1)
while k>0:
  if k==1:
    kk=1
  else:
    kk=k.bit_length()
  path.append([kk,n,cur])
  cur+=2**(kk-1)
  k=L-cur
print(n,len(path))
for p in path:
  print(*p)

Measured memory_bytes: 3064
s=input()
a=int(s[:2])
b=int(s[2:])
def f(a):
    a1,a2=0,0
    if 1<=a<=12:
        a1=1
    if 0<=a<=99:
        a2=1
    return (a1,a2)
a1,a2=f(a)
b1,b2=f(b)
if a1 and a2 and b1 and b2:
    print('AMBIGUOUS')
elif a1 and b2:
    print('MMYY')
elif a2 and b1:
    print('YYMM')
else:
    print('NA')
    


Measured memory_bytes: 38384
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
	char s[15];
	int sum=0;
	scanf("%s",s);
	const int len=strlen(s);
	for(int i=0;i<len;i++)
	if(s[i]=='o')
	sum++;
	if(len-sum>7)
	printf("NO");
	else
	printf("YES");
	return 0;
 } 

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

int main() {
  int number_n, i, j, flag, count = 0;
  scanf("%d", &number_n);
  int score[number_n];
  int ranking[number_n];
  char city_name[number_n][11];
  for(i = 0; i < number_n; i++) {
    scanf("%s %d", city_name[i], &score[i]);
  }
  for(i = 0; i < number_n; i++) {
    count = 0;
    for(j = 0; j < number_n; j++) {
      if(strcmp(city_name[i], city_name[j]) == 0) {
        if(score[i] < score[j]) {
          count++;
        }
      } else if(strcmp(city_name[i], city_name[j]) > 0) {
        count++;
      }
    }
    ranking[count] = i + 1;
  }
  for(i = 0; i < number_n; i++) {
    printf("%d\n", ranking[i]);
  }
  return 0;
}


Measured memory_bytes: 128
s=str(input())
ans=0
if s[0]=="R":
    ans=1
    if s[1]=="R":
        ans=2
        if s[2]=="R":
            ans=3
else:
    if s[1]=="R":
        ans=1
        if s[2]=="R":
            ans=2
    else:
        if s[2]=="R":
            ans=1
print(ans)

Measured memory_bytes: 9120
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<algorithm>
#define ll long long
#define maxn 200010
inline ll read()
{
	ll x=0; char c=getchar(),f=1;
	for(;c<'0'||'9'<c;c=getchar())if(c=='-')f=-1;
	for(;'0'<=c&&c<='9';c=getchar())x=x*10+c-'0';
	return x*f;
}
inline void write(ll x)
{
	static char buf[20],len; len=0;
	if(x<0)x=-x,putchar('-');
	for(;x;x/=10)buf[len++]=x%10+'0';
	if(!len)putchar('0');
	else while(len)putchar(buf[--len]);
}
inline void writesp(ll x){write(x); putchar(' ');}
inline void writeln(ll x){write(x); putchar('\n');}
int a[maxn],b[maxn];
int n,m,mx,sum;
int check(int p)
{
	// printf("%d *************\n",p);
	ll A=0,B=0;
	for(int i=1;i<=n;i++)
		b[i]=a[i]%p,B+=p-b[i];
	std::sort(b+1,b+n+1);
	for(int i=1;i<=n+1;i++){
		// printf("%d %d %d\n",i,A,B);
		if(A==B&&A<=m)return 1;
		A+=b[i]; B-=p-b[i];
	}
	return 0;
}
int main()
{
	n=read(); m=read();
	sum=mx=0;
	for(int i=1;i<=n;i++){
		a[i]=read();
		sum+=a[i]; mx=std::max(mx,a[i]);
	}
	int ans=0;
	for(int i=1;i*i<=sum;i++)
		if(sum%i==0){
			if(check(i))ans=std::max(ans,i);
			if(check(sum/i))ans=std::max(ans,sum/i);
		}
	writeln(ans);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;

ll dp[4000];

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll X; cin >> X;
	dp[0] = 100;
	for (int i = 1; i <= 3760; i++) dp[i] = dp[i - 1] + dp[i - 1] / 100;
	
	ll ans = 0;
	for (int i = 0; i <= 3760; i++) {
		if (dp[i] >= X) {
			ans = i;
			break;
		}
	}
	cout << ans << '\n';
	return 0;
}

Measured memory_bytes: 3632
#include<iostream>
#include<math.h>
using namespace std;

int main(){
	
	int n,z;
	double x1,y1,r1;
	double x2,y2,r2;
	
	cin>>n;
	
	for(int i=0;i<n;i++){
		cin >> x1 >> y1 >> r1 ;
		cin >> x2 >> y2 >> r2 ;
		
		double m = sqrt( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) ) ;
		
		if( r1 > m+r2 ) z=2;
		else if( r2 > m+r1 ) z=-2;
		else{
			if( r1+r2 >= m ) z=1;
			else z=0;
		}
		
		cout << z << endl;
	}
return 0;
}

Measured memory_bytes: 1232
#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

int main() {
    int N, K;
    cin >> N >> K;
    
    vector<long long int> X(N);
    for(int n=0; n<N; n++) {
        cin >> X[n];
    }
    
    long long int ans=1e9, tmp;
    int index0=lower_bound(X.begin(), X.end(), 0)-X.begin();
    // cout << index0 << endl;

    if(K==1) {
        if(index0<N) {
            ans = X[index0];
        }
        if(index0>0) {
            ans = min(ans, -X[index0-1]);
        }
    }

    for(int i=index0; i<N; i++) {
        if(K-(i-index0+1)<0) break;
        if(K-(i-index0+1)>index0) continue;

        if(K-(i-index0+1)>0) {
            // cout << i+1-K << " " << i << endl;
            tmp = X[i]*2;
            tmp += -X[i+1-K];
            ans = min(tmp, ans);
            
            tmp = -X[i+1-K]*2;
            tmp += X[i];
            ans = min(tmp, ans);
        } else {
            // cout << i << endl;
            tmp = X[i];
            ans = min(tmp, ans);
        }
    }

    if(index0==N) {
        tmp = -X[N-K];
        ans = min(tmp, ans);
    }
    
    // for(int i=index0-1; i>=0; i--) {
    //     if(K-(index0-i)<0) break;
    //     if(K-(index0-i)>N-index0) continue;

    //     tmp=X[i]*2;
    //     tmp+=
    // }

    cout << ans << endl;

    return 0;
    
}

Measured memory_bytes: 1024
#include <iostream>
#include <iomanip>
#include <utility>
#include <cmath>
#include <random>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <algorithm>
using namespace std;

#define rep(i,n) for(int i = 0; i<n; ++i)
#define REP(i,n) for(int i = 1; i<=n; ++i)
#define all(x) begin(x),end(x)
#define show(obj) {for(auto x:obj)cout<<x<<' ';cout<<endl;}
#define line "----------"
typedef long long ll;
typedef pair<int,int> ip;
typedef pair<ll,ll> lp;
const int inf = 1001001000;
const ll INF = 1LL<<60;
const ll MOD = 1e9 + 7;

int main(){
	int N,M; cin>>N>>M;
	int ans = 0;
	for(int i = 1; i*i<=M; ++i){
		if(M%i != 0)continue;
		int t = M/i;
		if(t >= N)ans = max(ans, i);
		if(i >= N)ans = max(ans, t);
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cstring>
#include <cmath>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
# ifdef __GNUC__
# if __cplusplus > 199711L
# include <unordered_set>
# include <unordered_map>
# else
# include <tr1/unordered_map>
# include <tr1/unordered_set>
using namespace tr1;
# endif
# else
# include <unordered_map>
# include <unordered_set>
# endif
using namespace std;

#define fi first
#define se second
#define FO(x, n) for (int x = 0; x < n; ++x)
#define FOR(x, a, b) for (int x = a; x < b; ++x)
#define RFO(x, n) for (int x = n - 1; x >= 0; --x)
#define RFOR(x, a, b) for (int x = b - 1; x >= a; --x)
typedef unsigned char byte;
typedef unsigned int uint;
typedef long long llong;
typedef unsigned long long ullong;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<llong, llong> pll;
inline bool feq(const double& a, const double& b) { return fabs(a - b) < 1e-10; }

const int MAXN = 55;
llong N;
llong nums[MAXN];

llong perform(llong K)
{
    llong res = 0;
    FO (i, N)
    {
        llong diff = nums[i] + K - (N - 1);
        if (diff > 0)
            res += diff / (N + 1) + bool(diff % (N + 1));
    }
    return res;
}

int main()
{
    while (cin >> N)
    {
        FO (i, N)
            cin >> nums[i];
        llong lo = 0, hi = 50e16 + 100;
        while (lo < hi)
        {
            llong mid = lo + (hi - lo) / 2;
            llong cnt = perform(mid);
            if (cnt == mid)
            {
                lo = mid;
                break;
            }
            else if (cnt > mid)
            {
                lo = mid + 1;
            }
            else
            {
                hi = mid - 1;
            }
        }
        for (llong i = max(lo - 10000, 0LL); i <= hi + 10000; ++i)
            if (perform(i) == i)
            {
                cout << i << endl;
                break;
            }
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include<math.h>
#include<queue>
#include<cstdio>
#include<set>
#include<map>
using namespace std;

int main(){
    long long H,W;
    cin >> H >> W;
  	if(H==1 || W==1) cout << 1;
    else if(H*W%2==0) cout << H*W/2;
    else cout << H*W/2+1;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<math.h>
#include<string.h>
#include<stdlib.h>
#include<vector>
#include<climits>
#include<utility>
#define vi vector<int>
#include<algorithm>
#include<list>
#define li list<int>
#include<stack>
#include<queue>
#define ll long long
using namespace std;
class node{
    public:
        int data;
        node*left;
        node*right;

        node(int d){
            data = d;
        }
};
int main(){
    int n;
    cin>>n;
    int k;
    cin>>k;
    int arr[n];
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    int dp[n];
    int temp,local;
    memset(dp,0,sizeof dp);
    for(int i=1;i<n;i++){
        local=INT_MAX;
        for(int j=1;j<=k;j++){
            if(i-j>=0){
                temp=dp[i-j]+abs(arr[i]-arr[i-j]);
                local=min(local,temp);
            }
        }
        dp[i]=local;
    }
    cout<<dp[n-1];
    return 0;
}                   

Measured memory_bytes: 1024
#include<iostream>
#include<string>
#include <vector>
#include<algorithm>
#include<cmath>
#include<iomanip>
using namespace std;
using vi = vector<int>;
using vii = vector<vi>;
using pii = pair<int, int>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define vsort(v) sort(v.begin(), v.end())
#define rv(v) reverse(v.begin(), v.end())
#define ll long long
const ll MOD = 1e9 + 7;

int main() {
	int n, k;
	cin >> n >> k;
	vi l(n);
	rep(i, n) cin >> l[i];
	vsort(l);
	rv(l);
	int sum = 0;
	rep(i, k) sum += l[i];
	cout << sum << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define X first
#define Y second
#define pb emplace_back
#define FOR(i,a,b) for(int (i)=(a);i<(b);++(i))
#define EFOR(i,a,b) for(int (i)=(a);i<=(b);++(i))
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define REP rep
#define rrep(X,Y) for (int (X) = (Y)-1;(X) >=0;--(X))
#define all(X) (X).begin(),(X).end()
#define eb emplace_back

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef ll LL;
typedef pii PII;
typedef pll PLL;
const ll MOD=1e9+7;

#define rall(X) (X).rbegin(),(X).rend()
#define UNIQUE(X) (X).erase(unique(all(X)),(X).end())
#define reps(X,S,Y) for (int (X) = S;(X) < (Y);++(X))
#define rreps(X,S,Y) for (int (X) = (Y)-1;(X) >= (S);--(X))
template<class T> inline bool MX(T &l,const T &r){return l<r?l=r,1:0;}
template<class T> inline bool MN(T &l,const T &r){return l>r?l=r,1:0;}

int N;
bool pos = false;
set<int> es[114514];
map<int, bool> mem[114514];

bool Solve() {
  cin >> N;
  rep(i, N-1) {
    int u, v;
    cin >> u >> v;
    --u;
    --v;
    es[u].insert(v);
    es[v].insert(u);
  }
    
  if (N == 2) return false;
  if (N == 3) return true;

  queue<int> que;
  rep(v, N) {
    if (es[v].size() == 1) que.push(v);
  }

  while (!que.empty()) {
    int v = que.front(); que.pop();
    if (es[v].empty()) continue;
    {
    //  return true;
    }

    int u = *es[v].begin();
    for (int w : es[u]) {
      if (w == v) continue;
      es[w].erase(u);
      if (es[w].empty()) return true;
      if (es[w].size() == 1) que.push(w);
    }
  }

  return false;
}

signed main(){
  ios_base::sync_with_stdio(false);
  cout<<fixed<<setprecision(0);

  if (Solve()) puts("First");
  else puts("Second"); 
}


Measured memory_bytes: 20736
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())//vectorの降順ソート
#define ll long long
#define pb(a) push_back(a)
#define INF 1000000000
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

typedef vector<unsigned int>vec;
typedef vector<vec> mat;
//typedef tuple<ll, ll, ll> T;

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 dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int R,G,B,N;
    cin>>R>>G>>B>>N;
    ll ans=0;
    for(int r=0;r<=N;r++){
        for(int g=0;g<=N;g++){
            int Bb = N- R*r - G*g;
            if(Bb>=0 && Bb%B==0){
                //cout<<r<<":"<<g<<":"<<B*b<<endl;
                ans++;
            }
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#118c
#最小公倍数
N = int(input())
A_list = [int(e) for e in input().split()]

#######################################
#https://note.nkmk.me/python-gcd-lcm/
#import math
import fractions
from functools import reduce

def gcd(*numbers):
    #return reduce(math.gcd, numbers)
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    #return reduce(math.gcd, numbers)
    return reduce(fractions.gcd, numbers)
#######################################

print(gcd(*A_list))

Measured memory_bytes: 14252
import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = Integer.parseInt(scan.next());
		int k = Integer.parseInt(scan.next());
		int[] sunuke = new int[n];
		for(int i = 0;i < k; ++i){
			int d = Integer.parseInt(scan.next());
			for(int j = 0;j < d; ++j){
				sunuke[Integer.parseInt(scan.next())-1]++;
			}
		}
		int count = 0;
		for(int i :sunuke){
			if(i == 0)count++;
		}
		System.out.print(count);
	}
}



Measured memory_bytes: 41592
#include "bits/stdc++.h"
using namespace std;
#define INF 1000000000
#define rep(i, n) for(int i = 0; i < n; i++)
#define ALL(x) (x).begin(), (x).end()  //昇順
#define RALL(x) (x).rbegin(), (x).rend() // 降順
const long long mod = 1e9+7;
typedef priority_queue<int> PQ;
typedef vector<long long> Vl;
typedef vector<int> VI;  // VI a(n);
typedef vector<string> VS;  
typedef vector<char> VC; 
typedef vector<VS> VSS;
typedef vector<VC> VCC;    
typedef vector<VI> VVI;   // VVI a(n,vector<int>(m)) n * m 
typedef vector<Vl> VVl;
typedef pair<int, int> PII;
typedef map<int, int> MP;   //MP a;
typedef vector<pair<int, int> > PS;
typedef long long ll;  //ll とdoubleは違う
template <class T>  // chmax(max, a);
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T> //chmin(min,a)
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}
template<typename T>   // operator << (cout,a);
ostream& operator << (ostream& os, vector<T>& v) {
    os << "{";
    rep(i, (int)v.size()) { os << v[i] << (i < v.size() - 1 ? ", " : ""); }
    os << "}";
    return os;
}

int main(){
    ll x,y,n,m,h,k,max=-100000,min=1000000000,ans=0,sum=0;
    string s,t,s1;
    cin >> s;
    char c = 'a';
    int b=26;
    bool f=true,f1=true;
    s1=s;



    while(b>0){
        s = s1;
        for(int i=0; i<s.size();i++){
            if(s[i] != c)
                f=false;
        }
        if(f){
            cout << 0 << endl;
            return 0;    
        }
        f=true;
        while(f1){
            for(int i=0; i<s.size()-1;i++){
                if(s[i]!=c && s[i+1]!=c)
                    t.push_back(s[i]);
                else{
                    t.push_back(c);
                }
            }
            ans++;
            for(int i=0; i<t.size();i++){
                if(t[i] != c)
                    f=false;
            }

            if(f){
                chmin(min, ans);
                f1 = false;
                ans = 0;
            }  
            s = t;
            t = ""; 
            f = true;

        } 
        f1 = true;
        c++;
        b--;
    }
    cout << min << endl;
    return 0;
}
  


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  string a,b,c;
  cin>>n;
  cin>>a>>b>>c;
  int cnt=0;
  for(int i=0;i<n;i++){
    if(a[i]==b[i]&&b[i]==c[i]);
    else if(a[i]!=b[i]&&b[i]!=c[i]&&c[i]!=a[i])cnt+=2;
    else cnt++;
  }
  cout<<cnt<<endl;
  return(0);
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <cmath>
#include <iomanip>
#include <bitset>
#include <string>
using namespace std;

typedef long long int ll;
typedef long double ld;



int main(){
    ll a,c;
    char b;
    cin >> a >> b >> c;
    if (b=='+'){
        cout << a+c << endl;
    }else{
        cout << a-c << endl;
    }
}


Measured memory_bytes: 256
#python3
# utf-8

n = int(input())
t__x__y = []
for i in range(n):
    t, x, y = (int(x) for x in input().split())
    t__x__y.append((t, x, y))

t__x__y = sorted(t__x__y)
ct, cx, cy = (0, 0, 0)
for i in range(n):
    nt, nx, ny = t__x__y[i]
    dist = abs(cx - nx) + abs(cy - ny)
    time = nt - ct
    if dist > time:
        print('No')
        quit()
    if dist % 2 != time % 2:
        print('No')
        quit()

print('Yes')

Measured memory_bytes: 18168
#define MAXN (25+10)
#include<cstdio>

struct Tree
{
	int l;
	int r;
	int fa;
	Tree():l(-1),r(-1),fa(-1) {}
}tree[MAXN];

void add(Tree &aim,int lef,int rig)
{
	aim.l=lef;
	aim.r=rig;
}
int N;
int origin;

void Preorder(int oper)
{
	printf(" %d",oper);
	if(tree[oper].l!=-1)
		Preorder(tree[oper].l);
	if(tree[oper].r!=-1)
		Preorder(tree[oper].r);
}
void Inorder(int oper)
{
	if(tree[oper].l!=-1)
		Inorder(tree[oper].l);
	printf(" %d",oper);
	if(tree[oper].r!=-1)
		Inorder(tree[oper].r);
}
void Postorder(int oper)
{
	if(tree[oper].l!=-1)
		Postorder(tree[oper].l);
	if(tree[oper].r!=-1)
		Postorder(tree[oper].r);
	printf(" %d",oper);
}
int main()
{
	scanf("%d",&N);
	for(int i=0;i<N;++i)
	{
		int ord,lef,rig;
		scanf("%d%d%d",&ord,&lef,&rig);
		add(tree[ord],lef,rig);
		tree[lef].fa=ord;
		tree[rig].fa=ord;
	}
	for(int i=0;i<N;++i)
		if(tree[i].fa==-1)
		{
			origin=i;
			break;
		}
	printf("Preorder\n");
	Preorder(origin);
	printf("\nInorder\n");
	Inorder(origin);
	printf("\nPostorder\n");
	Postorder(origin);
	printf("\n");
	return 0;
}

Measured memory_bytes: 2704
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
  ll n;
  cin>>n;
  vector<ll>h(n);
  rep(i,n){
    cin>>h[i];
  }
  
  ll ans=0;
  
  ll maxl=0;
  for(int i=0;i<n-1;i++){
    if(h[i]>=h[i+1]){
      ans++;
      maxl=max(maxl,ans);
    }
    else{
      ans=0;
  }
  }
  cout<<maxl<<endl;
}

Measured memory_bytes: 1024
package main

import (
	"fmt"
	"os"
	"bufio"
	"strings"
)

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Scan()
	
	s := sc.Text()
	cols := strings.Split(s,"")
	
	Sum := 0 
	for _, c := range cols {
		if c == "1" {
			Sum++
		}
	}
		
	fmt.Println(Sum)
}


Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <numeric>
#include <tuple>
#include <stack>

#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) x.begin(),x.end()
#define print(s) cout << s << endl
typedef long long ll;
using namespace std;

int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}

int main() {
    int n,d; cin >> d >> n;
    // int S = 1; for (int i = 0; i < d; i++) S *= 100;
    int S = pow(100,d);
    cout << (n<=99 ? S*n: S*101) << endl;
    // int D, N; cin >> D >> N;
 
	// int S = 1; for (int i = 0; i < D; i++) S *= 100;
	// if (N <= 99) {
	// 	cout << S * N << endl;
	// }
	// else {
	// 	cout << S * 101 << endl;
	// }
	// return 0;
}

Measured memory_bytes: 384
#encoding:utf-8



N = int(input())
A = [int(i) for i in input().split()]

answer = 100
for i in range(N):
    count = 0
    while A[i]%2 == 0:
        count += 1
        A[i] /= 2
    answer = min(answer,count)

print(int(answer))


Measured memory_bytes: 2940
#include<stdio.h>
#include<string.h>
#define LEN 100005
  
typedef struct pp{
  char name[100];
  int t;
}P;
  
P Q[LEN+1];
int head, tail, n;
  
void enqueue(P );
P dequeue(void);
int calc(int,int);
  
int main(){
  int e=0,c;
  int i,q;
  P u;
  scanf("%d %d\n", &n, &q);
  
  for ( i = 1; i <= n; i++){
    scanf("%s", Q[i].name);
    scanf("%d",&Q[i].t);
  
  }
  
  head = 1;
  tail = n+1;
    
  while(head != tail){
    u = dequeue();
    c = calc(q,u.t);
    u.t -= c;;
    e += c;
     
  
    if(u.t > 0){
      enqueue(u);
    }
      
    else{
      printf("%s %d\n", u.name ,e);
    }
   
  }
  return 0;
}
P dequeue(){
    P x;
    x = Q[head];
    head = (head+1)%LEN;
    return x;
      }
void enqueue(P x){
  Q[tail] = x;
  tail = (tail + 1)%LEN;
}
int calc(int x, int y){
  return x < y ? x:y;
}


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

int main()
{
    int n; cin>>n;
    int ac=0,tle=0,wa=0,re=0;

    while(n>0)
    {
        string s; cin>>s;

        if(s=="AC")
            ac++;
        else if(s=="TLE")
            tle++;
        else if(s=="WA")
            wa++;
        else
            re++;

        n--;
    }
    cout<<"AC x "<<ac<<endl;
    cout<<"WA x "<<wa<<endl;
    cout<<"TLE x "<<tle<<endl;
    cout<<"RE x "<<re<<endl;
}


Measured memory_bytes: 3628
N,M=map(int,input().split())
A,c,dp,r=[0]*N,0,0,[]
for i, s in enumerate(reversed(input())):
    if s=="1":c+=1;A[i]=c
    else:c=0
while dp+M<=N-1:
    t = M-A[dp+M]
    if t>0: dp+=t
    else:print(-1);exit()
    r.append(t)
r.append(N-dp)
print(*reversed(r))

Measured memory_bytes: 84508