akhauriyash/Code-Regression huggingface dataset:
#include<algorithm>
#include<iostream>
#include<string>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
  int i,j,k,l;
  int a[30],m,n;
  bool b[1000001],c[1000001];
  memset(c,0,1000001);
  c[2]=1;
  for(i=3;i<1000000;i+=2){
    l=(int)sqrt(i)+1;
    for(k=3;k<l;k+=2){
      if(i%k==0)
	break;
    }
    if(k>=l)
      c[i]=1;
  }
  while(cin>>m>>n&&m+n){
    for(i=0;i<m;i++)
      cin>>a[i];
    memset(b,0,1000001);
    b[0]=1;
    for(i=0;i<n;i++){
      if(b[i]){
	for(j=0;j<m;j++){
	  if(i+a[j]<=n)
	    b[i+a[j]]=1;
	}
      }
    }
    for(i=n;i>0;i--){
      if(b[i]&&c[i])
	break;
    }
    if(i)
      cout<<i<<endl;
    else
      cout<<"NA"<<endl;
  }
  return 0;
}

Measured memory_bytes: 0
package main

import (
	"bufio"
	"container/heap"
	"fmt"
	"os"
	"strconv"
)

const inf = int(1e15)

var sc *bufio.Scanner

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	sc = bufio.NewScanner(os.Stdin)
	sc.Buffer(make([]byte, 0), 1000000001*3)
	sc.Split(bufio.ScanWords)

	n, m, s, t := nextInt(), nextInt(), nextInt()-1, nextInt()-1

	gy := make([][]Edge, n)
	gs := make([][]Edge, n)
	for i := 0; i < m; i++ {
		u, v, a, b := nextInt()-1, nextInt()-1, nextInt(), nextInt()
		gy[u] = append(gy[u], Edge{to: v, cost: a})
		gy[v] = append(gy[v], Edge{to: u, cost: a})
		gs[u] = append(gs[u], Edge{to: v, cost: b})
		gs[v] = append(gs[v], Edge{to: u, cost: b})
	}

	cy := dijkstra(gy, s)
	cs := dijkstra(gs, t)
	ans := make([]int, n+1)
	for i := n - 1; i >= 0; i-- {
		r := inf - (cy[i] + cs[i])
		switch {
		case r < ans[i+1]:
			ans[i] = ans[i+1]
		default:
			ans[i] = r
		}
	}
	for i := 0; i < n; i++ {
		fmt.Println(ans[i])
	}
}

func dijkstra(g [][]Edge, from int) []int {
	n := len(g)
	d := make([]int, n)
	for i := 0; i < n; i++ {
		d[i] = inf
	}

	var pq PriorityQueue
	heap.Init(&pq)

	heap.Push(&pq, &Item{pos: from, cost: 0})
	d[from] = 0

	for len(pq) > 0 {
		s := heap.Pop(&pq).(*Item)
		if d[s.pos] < s.cost {
			continue
		}
		for _, e := range g[s.pos] {
			if d[e.to] > s.cost+e.cost {
				d[e.to] = s.cost + e.cost
				heap.Push(&pq, &Item{pos: e.to, cost: d[e.to]})
			}
		}
	}

	return d
}

// Edge .
type Edge struct {
	to, cost int
}

// https://golang.org/pkg/container/heap/

// An Item is something we manage in a priority queue.
type Item struct {
	pos  int // The value of the item; arbitrary.
	cost int // The priority of the item in the queue.
	// The index is needed by update and is maintained by the heap.Interface methods.
	// index int // The index of the item in the heap.
}

// A PriorityQueue implements heap.Interface and holds Items.
type PriorityQueue []*Item

func (pq PriorityQueue) Len() int { return len(pq) }

func (pq PriorityQueue) Less(i, j int) bool {
	// We want Pop to give us the highest, not lowest, priority so we use greater than here.
	return pq[i].cost < pq[j].cost
}

func (pq PriorityQueue) Swap(i, j int) {
	pq[i], pq[j] = pq[j], pq[i]
	// pq[i].index = i
	// pq[j].index = j
}

// Push .
func (pq *PriorityQueue) Push(x interface{}) {
	// n := len(*pq)
	item := x.(*Item)
	// item.index = n
	*pq = append(*pq, item)
}

// Pop .
func (pq *PriorityQueue) Pop() interface{} {
	old := *pq
	n := len(old)
	item := old[n-1]
	old[n-1] = nil // avoid memory leak
	// item.index = -1 // for safety
	*pq = old[0 : n-1]
	return item
}


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

void print_vec(vector<int> vec)
{
  cout << "[";
  for (int i = 0; i < vec.size(); i++)
  {
    cout << vec.at(i);
    if (i < vec.size() - 1)
    {
      cout << ", ";
    }
  }
  cout << "]...size: " << vec.size() << endl;
}

int main()
{
  vector<int> vec;

  while (true)
  {
    int n, m;
    cin >> n >> m;
    if (n == 0 && m == 0)
    {
      break;
    }

    priority_queue<int> pq;
    int max_num = 0;

    rep(i, n)
    {
      priority_queue<int> cq = pq;
      int a;
      cin >> a;

      while (!cq.empty())
      {
        int top = cq.top();
        int num = top + a;
        if (num <= m)
        {
          max_num = max(max_num, num);
          break;
        }
        cq.pop();
      }

      pq.push(a);
    }

    vec.push_back(max_num);
  }

  for (auto &&v : vec)
  {
    if (v)
    {
      printf("%d\n", v);
    }
    else
    {
      printf("NONE\n");
    }
  }
}



Measured memory_bytes: 3064
#include <stdio.h>
#include <math.h>
#define maxn 65
#define eps 1e-8
double x[maxn],y[maxn],c[maxn],X[65*65*2],Y[65*65*2],r[maxn];
int tot,N,K;
double dis(double x,double y,double c,double X,double Y){
	return sqrt((X-x)*(X-x)+(Y-y)*(Y-y));//return c*sqrt((X-x)*(X-x)+(Y-y)*(Y-y));
}
void cal(double x1,double y1,double r1,double x2,double y2,double r2){//计算两圆交点坐标
	double D;//A=a*a,H=h*h,D=d*d;
	double ad,h;//ad=a*d;
	D=(x2-x1)*(x2-x1)+(y2-y1)*(y2-y1);
	if(D==0)return;
	ad=(r1*r1+D-r2*r2)/2;//2*a*d=r1*r1+D-r2*r2
	h=D*r1*r1-ad*ad;
	if(h<0)return;//漏了此句的判定
	h=sqrt(h);
	tot++,X[tot]=x1+ad*(x2-x1)/D-(y2-y1)*h/D,Y[tot]=y1+ad*(y2-y1)/D+(x2-x1)*h/D;
	tot++,X[tot]=x1+ad*(x2-x1)/D+(y2-y1)*h/D,Y[tot]=y1+ad*(y2-y1)/D-(x2-x1)*h/D;
}
int judge(double t){
	int i,j,cnt;
	for(i=1;i<=N;i++)r[i]=t/c[i];
	tot=0;
	for(i=1;i<=N;i++){
		tot++,X[tot]=x[i],Y[tot]=y[i];//tot++,X[i]=x[i],Y[i]=y[i];
		for(j=i+1;j<=N;j++)
			cal(x[i],y[i],r[i],x[j],y[j],r[j]);
	}
	for(i=1;i<=tot;i++){
		cnt=0;
		for(j=1;j<=N;j++)
			if(dis(x[j],y[j],c[j],X[i],Y[i])<r[j]+eps)cnt++;//浮点比大小无等于的情况，这是由浮点误差决定的。if(dis(x[j],y[j],c[j],X[i],Y[i])<t+eps)cnt++;
		if(cnt>=K)return 1;
	}
	return 0;
}
int main(){
	double l,r,mid;
	int i;
	scanf("%d%d",&N,&K);
	for(i=1;i<=N;i++)scanf("%lf%lf%lf",&x[i],&y[i],&c[i]);
	l=0,r=1000010;
	for(i=1;i<=100;i++){
		mid=(l+r)/2;
		if(judge(mid))r=mid;
		else l=mid;
	}
	printf("%.6lf\n",r);
	return 0;
}

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

typedef unsigned uint;

bool is_exist_bin_search(uint v, std::vector<uint> s){
  uint min = 0, max = s.size();
  while(min < max){
    uint mid = (min + max) / 2;
    uint v_mid = s[mid];
    if(v_mid == v) return true;

    if(v_mid >= v) max = mid;
    else min = mid+1;
  }
  return false;
}

unsigned count(std::vector<uint> s, std::vector<uint> t){
  uint n = 0;
  for(uint i = 0; i < t.size(); i++){
    if(is_exist_bin_search(t[i],s)) n++;
  }
  return n;
}

int main(){
  //std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);
  std::vector<uint> s,t;

  {
    uint n,buf;
    std::cin >> n;
    for(; n; n--){
      std::cin >> buf;
      s.push_back(buf);
    }
  }

  {
    uint q,buf;
    std::cin >> q;
    for(; q; q--){
      std::cin >> buf;
      t.push_back(buf);
    }
  }

  std::cout << count(s,t) << '\n';
}

Measured memory_bytes: 2640
#include <iostream>
#include <string>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <iomanip>

#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue

using namespace std;
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
const int inf = 1e9;
const ll linf = 1LL << 50;

ll sto(string st){
		ll res = 0;
		for(int i = 0; i < st.size(); i++){
				res = res * 10 + (st[i] - '0');
		}
		return res;
}

int main(int argc, char const* argv[])
{
	string s;
	cin >> s;
	ll res = 0;
	for(int i = 0; i < (1 << (s.size()-1)); i++){
			vector<int> vec;
			for(int j = 0; j < s.size()-1; j++){
					if((i >> j) % 2 == 0){
							vec.pb(j);
					}
			}
			if(vec.size() == 0){
					res += sto(s);
					continue;
			}
			res += sto(s.substr(0, vec[0]+1));
			for(int j = 0; j < vec.size() - 1; j++){
					res += sto(s.substr(vec[j]+1, vec[j+1]-vec[j]));
			}
			res += sto(s.substr(vec[vec.size()-1]+1));
	}
	cout << res << endl;
	return 0;
}


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

int main(){
	int M,D; cin>>M>>D;
	int ans = 0;
	for(int d=12; d<=D; d++){
		int d10 = d / 10, d1 = d % 10;
		if(d10>1 && d1>1 && d10*d1<=M) ans++;
	}
	cout<< ans <<endl;
}

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

using namespace std;

int main()
{
  int n, m;
  cin >> n >> m;
  float a[n];
  int sum = 0;
  int count = 0;

  for (int i = 0; i < n; i++)
  {
    cin >> a[i];
    sum += (int)a[i];
  }
  float border = (float)sum / (float)(4 * m);

  for (int i = 0; i < n; i++)
  {
    if (border <= a[i])
    {
      count++;
    }
  }

  if (count >= m)
  {
    cout << "Yes";
  }
  else
  {
    cout << "No";
  }

  return 0;
}

Measured memory_bytes: 888
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
template <class Key, class Compare = less<Key>>
using Tree = tree<Key, null_type, Compare, rb_tree_tag, tree_order_statistics_node_update>;






void Main() {

  int n, h, w;
  cin >> n >> h >> w;

  int ans = (n - h + 1) * (n - w + 1);
  cout << ans;


}


int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  #ifdef _DEBUG
//  freopen("in.txt", "r", stdin);
//  freopen("out.txt", "w", stdout);
  #endif
  Main();
}


Measured memory_bytes: 256
a,b,c=map(int,input().split())

if a>b:
    a,b=b,a
    if b>c:
        b,c=c,b
    else:
        b,c=b,c
else:
    a,b=a,b
    if b>c:
        b,c=c,b
    else:
        b,c=b,c

if a>b:
    a,b=b,a
    
print(a,b,c)


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

int main(){
    int n,k;
    string s;
    char a;
    cin >> n >> k >> s;
     a = s.at(k-1);
     if(a=='A'){
         s.at(k-1) = 'a';
     }
    else if(a=='B'){
        s.at(k-1) = 'b';
    }
    else{
        s.at(k-1) ='c';
    }
    cout << s <<endl;
}

Measured memory_bytes: 256
from functools import lru_cache


def solve(n, aaa):
    @lru_cache(maxsize=None)
    def search_min(li, ri, lc, rc):
        w = ri - li
        if w == 1:
            return 0
        lrc = lc + rc
        if w == 2:
            return aaa[li + 1] * lrc
        if w == 3:
            a1, a2 = aaa[li + 1], aaa[li + 2]
            return (a1 + a2) * lrc + min(a1 * lc, a2 * rc)
        ret = min(aaa[i] * lrc + search_min(li, i, lc, lrc) + search_min(i, ri, lrc, rc) for i in range(li + 1, ri))
        return ret

    return search_min(0, n - 1, 1, 1) + aaa[0] + aaa[-1]


n = int(input())
aaa = list(map(int, input().split()))
print(solve(n, aaa))


Measured memory_bytes: 71944
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define str to_string
using namespace std;
using lint = long long;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}

int main(){
    int n;cin>>n;
    vector<lint> lucas(n+1);
    lucas[0]=2;
    lucas[1]=1;
    for(int i=2;i<n+1;i++){
        lucas[i]=lucas[i-1]+lucas[i-2];
    }
    cout<<lucas[n]<<endl;
}

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

int a,b;
int c = 0;

int main(){
    cin >> a >> b;
    for(int i = a; i <= b; i++){
        int n = i % 10, nn = i / 10000 % 10;
        int m = i / 10 % 10, mm = i / 1000 % 10;
        if(n == nn && m == mm) c++;
    }
    cout << c << endl;
    return 0;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
#define len(n) (int)n.length()
#define pb push_back
#define ll long long
#define make_pair mkp
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define ALL(v) (v).begin(), (v).end()
#ifdef DBGPRT
#define dbg(n) cerr << "//" << #n << ":" << n <<endl
#else
#define dbg(n) ;
#endif
typedef pair<ll, ll> LLARR;
#define INF 999999999
const double PI = 3.1415926535897932384626433832795;


vector<ll> memo(50,0);
ll fibo(int n)
{
	if ((n==0) || (n==1))
		return memo[n] = 1;
	
	if (memo[n] != 0)
		return memo[n];
	
	memo[n-1] = fibo(n-1);
	memo[n-2] = fibo(n-2);
	return fibo(n-1) + fibo(n-2);
}

int main()
{
	ios::sync_with_stdio(false);

	int n;
	cin >> n;
	
	cout << fibo(n) << endl;
	return 0;
}

Measured memory_bytes: 3128
import sys

sys.setrecursionlimit(200002)

n, m = list(map(int, input().split()))

g = [[] for _ in range(n)]
for _ in range(m):
    l, r, d = map(int, input().split())
    l -= 1
    r -= 1
    g[l].append((r, d))
    g[r].append((l, -d))


ds = [None for _ in range(n + 1)]


def check(v):
    for next_v, d in g[v]:
        if ds[next_v] is None:
            ds[next_v] = ds[v] + d
            if check(next_v) is False:
                return False
        elif not (ds[next_v] - ds[v] == d):
            return False
    return True


valid = True
for v in range(n):
    if ds[v] is None:
        ds[v] = 0
    if check(v) is False:
        valid = False
        break

if valid:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 129032
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define ALL(A) A.begin(), A.end()

using namespace std;

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

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	ll N, x; cin >> N >> x;
	vector<ll> a(N, 0LL);
	rep (i, N){
		cin >> a[i];
	} // end rep

	ll res = 0LL;
	ll diff = max(0LL, a[0] - x);
	res  += diff;
	a[0] -= diff;
	
	for (int i = 1; i < N; ++i){
		ll curr = a[i-1] + a[i];
		if (curr > x){
			ll diff = curr - x;
			res  += diff;
			a[i] -= diff;
		} // end if
	} // end for
	cout << res << endl;

	return 0;
}

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

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

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

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(10);
    string S;
    cin >> S;
    sort(ALL(S));
    if(S[0] == 'a' &&S[1] == 'b' &&S[2] == 'c'){
        cout << "Yes" << "\n";
    }else{
        cout << "No" << "\n";
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define enld '\n'
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("Ofast")
constexpr ll INF = 1e18;
constexpr int inf = 1e9;
constexpr ll mod = 1000000007;
constexpr ll mod2 = 998244353;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[6] = {1, 0, -1, 0,1,1};
const int dy[6] = {0, 1, 0, -1,1,-1};
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; }
// ---------------------------------------------------------------------------


int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string S;
    cin >> S;
    int N = S.size();
    reverse(S.begin(),S.end());
    map<int,ll> mp;
    ll ten = 1;
    ll now = 0;
   ll m = 2019;
    for(int i=0; i<N; i++){
        ll d = S[i] - '0';
        d *= ten;
        now += d;
        now %= m;
        mp[now]++;
        ten *= 10;
        ten %= m;
    }
    mp[0]++;
    ll ans = 0;
    for(auto m: mp){
        ans += m.second*(m.second-1LL)/2LL;
    }
    cout << ans << enld;
    return 0;
}

Measured memory_bytes: 3812
#include <bits/stdc++.h>
#include <bitset>
#include <cassert>
#include <cstring>
#include <functional>
#include <iomanip>
#include <list>
#include <cmath>
#include <memory>
#include <queue>
#include <set>
#include <stack>
#include <vector>
// #include <boost/multiprecision/cpp_dec_float.hpp>
// #include <boost/multiprecision/cpp_int.hpp>
using namespace std;
#define REP(i, n) for (int64_t i = 0; i < (int64_t)n; i++)
#define REP_FOR(i, a, b) for (int64_t i = (int64_t)a; i < (int64_t)b; i++)
#define REP_REV(i, a, b) for (int64_t i = (int64_t)a; i > (int64_t)b; i--)
#define FORALL(v) (v).begin(), (v).end()
#define mp(a, b) make_pair(a, b)
#define eb(x) emplace_back(x)
#define F first
#define S second
typedef long long ll;
typedef long double ld;
typedef pair<int64_t, int64_t> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<int64_t> vii;
typedef vector<vii> vvii;
const ll mod = 1e9 + 7;
const int64_t infi = 1147483600;
const ll infl = 4e18 + 5;
const char EOL = '\n';
//cout << fixed << setprecision(17) << res << endl;
// const ll MOD = 1000000009;

#define M 1000000007

std::vector<ll> fac(200001); //n!(mod M)
std::vector<ll> ifac(200001); //k!^{M-2} (mod M)

//x^n(mod M)d
ll
mpow(ll x, ll n)
{
    ll ans = 1;
    while (n > 0){
        if (n & 1) ans = ans*x % M;
        x = x*x % M;
        n = n >> 1;
    }
    return ans;
}

void
cominit(ll n)
{
    fac[0] = n;
    ifac[0] = 1;
    for (ll i = 0; i < 200001; i++){
        fac[i+1] = fac[i] * (n-i-1) % M; // n! mod M
        ifac[i+1] = ifac[i] * mpow(i+1, M-2) % M; // k!^{M-2} mod M
    }
}

ll
comb(ll b) {
    if (b == 0) return 1;
    auto res = fac[b-1] * ifac[b] %M;
    return res;
}

int main() {
    ll n, a, b;
    cin >> n >> a >> b;
    cominit(n);
    ll res = mpow(2, n) - 1;
    res = (res + M)%M;
    //cerr << "res = " << res << endl;
    res -= comb(a);
    //cerr << "comb("<<a<<") =" << comb(a) << endl;
    res = (res + M)%M;
    //cerr << "res = " << res << endl;
    res -= comb(b);
    //cerr << "comb("<<b<<") =" << comb(b) << endl;
    res = (res + M)%M;
    //cerr << "res = " << res << endl;
    cout << res << endl;
}


Measured memory_bytes: 3328
#include<bits/stdc++.h>
#define ll long long
#define all(v) v.begin(),v.end()
#define rall(v) v.begin(),v.end()
#define sz(x) (int)sz.size()
#define PB push_back
#define PI 3.1415926535897932384626433832795
#define what(x) cout<<#x<<" is "<<x<<endl;
using namespace std;

#ifdef LOCAL//ONLINE_JUDGE
#include "D:\c_c++\template.h"
#else
#define debug(...) 42
#endif

ll powmod(ll a,ll b,ll mod) {
    ll res=1;a%=mod;
    for(;b;b>>=1){
        if(b&1)res=res*a%mod;
			a=a*a%mod;
    }
    return res;
}

void solve(){
	int n;
	cin>>n;
	vector<vector<int>> vp(n,vector<int>(2));
	for(int i=0;i<n;i++){
		cin>>vp[i][0]>>vp[i][1];
	}
	int cnt=0;
	for(int i=0;i<n;i++){
		if(vp[i][0]==vp[i][1]){
			cnt++;
		}else{
			cnt=0;
		}
		if(cnt>=3){
			cout<<"Yes\n";
			return;
		}
	}
	cout<<"No\n";
}


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
//    #ifdef LOCAL
//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);
//    #endif
    int tc=1;
    // cin>>tc;
    while(tc--)solve();
}


Measured memory_bytes: 3656
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define Sort(Array) sort(Array.begin(), Array.end())
#define Reverse(a) reverse(a.begin(), a.end())
#define out(ans) cout << ans << endl;
const int MOD = 1000000007;
const int INF = 2147483647;

//------------↓------------- M -------------- E ---------------- M --------------- O ---------------↓--------------//
// コンパイル 
// g++ -std=c++1z
//
// -------型変換--------
// int を string に変換
// string s = to_string(n);
// string を int に変換
// int n = stoi(s);
//
// -------二分探索---------
// k以上の値が最初に現れる時のイテレータ
// lower_bound(data.begin(), data.end(), k)
// kより大きい値が最初の現れる時のイテレータ O(logN)
// upper_bound(data.begin(), data.end(), k)
// kがdataに存在するかをtrue or falseで返す O(logN)
// binary_search(data.begin(), data.end(), k)
// 
//
//
//
//
//
// 
//------------↑------------- M -------------- E ---------------- M --------------- O ---------------↑--------------//



int main(void) {

    ld r; cin >> r;
    ld ans = r * 6.28318530717958623200;
    printf("%.6Lf\n", ans);
    


    


    return 0;
}











Measured memory_bytes: 3756
from sys import stdin

s = stdin.readline().rstrip()

len_s = len(s)

for i in range(int(len_s/2+1)):
    if i != 0:
        if s[0:int(-i+len_s/2)] == s[int(-i+len_s/2):(len_s-i*2)]:
            print(len_s-i*2)
            break


Measured memory_bytes: 2940
#include <stdio.h>
 
int main(){
 
  int i;
  int count[26]={0};
  char str;
 
  while(scanf("%c",&str)!=EOF){
    if(str>='a' && str<='z'){
      count[str-'a']++;
    }else if(str>='A' && str<='Z'){
      count[str-'A']++;
    }
  }
  for(i=0;i<26;i++){
    printf("%c : %d\n",'a'+i,count[i]);
  }
  return 0;
}


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

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

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

	string S=in<string>(),T=in<string>();
	int num = 0;
	for(int i=0;i<3;i++){
		if(S[i]==T[i]) num++;
	}
	
	out(num);
	return 0;
}


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

using namespace std;

typedef long long ll;

#ifdef RED
  mt19937 rnd(228);
#else
  mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
#endif

const int N = 1005;
const int MOD = (int)1e9 + 7;

int h, w;
int dp[N][N];
char s[N][N];

int main() {
#ifdef RED
  freopen("a.in", "r", stdin);
#endif
  ios_base :: sync_with_stdio(0);
  cin.tie(0);
  cin >> h >> w;
  for (int i = 1; i <= h; ++i) {
    for (int j = 1; j <= w; ++j) {
      cin >> s[i][j];
    }
  }
  dp[1][1] = 1;
  for (int i = 1; i <= h; ++i) {
    for (int j = 1; j <= w; ++j) {
      if (s[i][j] == '.') {
        if (s[i - 1][j] == '.') {
          dp[i][j] += dp[i - 1][j] % MOD;
          dp[i][j] %= MOD;
        }if (s[i][j - 1] == '.') {
          dp[i][j] += dp[i][j - 1] % MOD;
          dp[i][j] %= MOD;
        }
      }
    }
  }
  cout << dp[h][w];
  return 0;
}


Measured memory_bytes: 5120
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define mod 1000000007
#define pb push_back
#define pii pair<ll,ll>
#define pi pair<int ,int> 
#define REP(i,a,n) for(int i=a;i<n;i++)
#define rep(i,a,n) for(int i=a;i>=n;i-- )

int main() { 
     int h,n;
     cin>>h>>n;
     int a[n],b[n];
     REP(i,0,n)
     {
         cin>>a[i]>>b[i];
     }
     vector<vector<int>>dp(n+1,vector<int>(h+1,1e9+1000000001));
     for(int i=0;i<n;i++)
     {
         
         
         for(int j=1;j<=h;j++)
         {
             if(j<=a[i])
             {
                 dp[i+1][j]=min(dp[i][j],b[i]);
             }
             else
             {
                 dp[i+1][j]=min(dp[i][j],dp[i+1][j-a[i]]+b[i]);
             }
         }
     }
     cout<<dp[n][h];
 	return 0;
}

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

#define ll long long
#define vvi vector<vector<int>>
#define vec vector
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define uniqueV(x) sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end());
#define rep(i, n) for (int (i) = (0); (i) < (n); ++(i))
#define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))
#define debug(x) cerr << #x << ": " << x << endl;
#define debug2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;
#define debug3(x, y, z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = "<<"("<<x<<", "<<y<<", "<<z<<")"<<endl;
#define debugB(x, y) cerr<<#x<<": "<<bitset<y>(x) << endl;
#define line() cerr << "---------------" << endl;

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

template<typename T>
void printA(vector<T> &printArray, char between = ' ') {
   int paSize = printArray.size();
   for (int i = 0; i < paSize; i++) { cerr << printArray[i] << between;}
   if (between != '\n') {cerr << endl;}
}

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

int H, W;
char B[60][60];
int dist[60][60];
const int INF =  1e8;

void dfs(int y, int x, int cnt) {
   if (dist[y][x] <= cnt) return;

   dist[y][x] = cnt;
   rep (i, 4) {
      int nx = x + dx[i], ny = y + dy[i];
      if (nx < 0 || nx >= W || ny < 0 || ny >= H || B[ny][nx] == '#') continue;
      dfs(ny, nx, cnt+1);
   }
}

int main() {
   cin >> H >> W;
   int black = 0;
   rep (i, H) { 
      cin >> B[i]; 
      rep (j, W) {
         if (B[i][j] == '#') {
            black++;
         }
      }
   }

   rep (i, H) { rep(j, W) { dist[i][j] = INF; } }
   dfs(0, 0, 0);

   int n = dist[H-1][W-1];
   if (n == INF) {
      cout << -1 << endl;
   } else {
      cout << H*W - black - dist[H-1][W-1] -1 << endl;
   }

   return 0;
}

Measured memory_bytes: 384
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long[][] hp = new long[101][101];
		for(int i = 1; i < 101; i++) {
			for(int j = 1; j < 101; j++) {
				hp[i][j] = (long) Math.pow(i - j, 2);
			}
		}
		int n = sc.nextInt();
		int[] x = new int[n];
		for(int i = 0; i < n; i++) {
			x[i] = sc.nextInt();
		}
		long ans = Long.MAX_VALUE;
		for(int i = 1; i < 101; i++) {
			long min = 0;
			for(int j = 0; j < n; j++) {
				min += hp[x[j]][i];
			}
			ans = Math.min(ans, min);
		}

		System.out.println(ans);

	}

}


Measured memory_bytes: 22612
/// Containers Start
#include <algorithm>
#include <bitset>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
/// C Header Files
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <math.h>
#include <stdio.h>
/// Containers End

using namespace std;

/// Math Start
#define PI acos(-1.0)
#define Pi 3.141592653589793
#define EPS (1e-7)
#define INF (0x3f3f3f3f)
/// Math End

/// Extra Start
#define nn '\n'
#define pb push_back
#define ull unsigned long long
#define ll long long
#define MOD 1000000007
#define sz(a) int((a).size())
#define space " "
#define All(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
/// Extra End

#define rep(i, n) for (int i = 0; i < n; i++)
#define Cini(a)                                                                \
    int a;                                                                     \
    cin >> a;
#define Cinii(a, b)                                                            \
    int a, b;                                                                  \
    cin >> a >> b;
#define Ciniii(a, b, c)                                                        \
    int a, b, c;                                                               \
    cin >> a >> b >> c;
#define Cins(s)                                                                \
    string s;                                                                  \
    cin >> s;
#define Cinss(s1, s2)                                                          \
    string s1, s2;                                                             \
    cin >> s1 >> s2;
#define Cinc(c)                                                                \
    char c;                                                                    \
    cin >> c;
/// Functions End


/// Debug Start
#define deb(x) cout << #x << ": " << x << endl
#define deb2(x, y) cout << #x << ": " << x << '\t' << #y << ": " << y << endl;
#define deb3(x, y, z)                                                          \
    cout << #x << ": " << x << '\t' << #y << ": " << y << '\t' << #z << ": "   \
         << z << endl;
/// Debug End

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

/**>>>>>>>>>>>>>>>>>>> END <<<<<<<<<<<<<<<<<<**/

/// template


signed main(void) {
    cin.sync_with_stdio(false);
    cin.tie(0);
    Cins(S);
    bool ok = true;
    rep(i,S.length()){
        if(i%2==0 && !(S[i]=='R' or S[i]=='U' or S[i]=='D')){
            ok = false;
            break;
        }
        if(i%2==1 && !(S[i]=='L' or S[i]=='U' or S[i]=='D')){
            ok = false;
            break;
        }
    }
    cout << ((ok)? "Yes":"No") << nn;
    return 0;
}

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

using namespace std;

int n,num[200010],cnt,ans[200010];
long long int r1,r2;

long long int qpow(int a,int x,int mod)
{
	if(x==0)
	    return 1%mod;
	if(x==1)
	    return a%mod;
	long long int a1=qpow(a,x/2,mod);
	if(x%2==0)
	    return a1*a1%(long long)mod;
	else
	    return a1*a1%mod*(long long)a%(long long)mod;
}

int main()
{
	ios::sync_with_stdio(false);
    cin.tie(0);
    cin>>n;
    for(int i=1;i<=n;i++)
    {
    	char c;
    	cin>>c;
    	num[i]=c-'0';
    	if(num[i]==1)
    	    cnt++;
	}
	if(cnt==0)
	{
		for(int i=1;i<=n;i++)
		    cout<<"1"<<endl;
		return 0;
	}
	if(cnt==1)
	{
		for(int i=1;i<=n;i++)
		{
			if(num[i]==1)
			    ans[i]=0;
			else
			{
				int item;
				if(i!=n)
				    item=num[n];
				else
				    item=1;
				ans[i]++;
				if(item==1)
				    ans[i]++;
			}
		}
		for(int i=1;i<=n;i++)
		    cout<<ans[i]<<endl;
		return 0;
	}
	for(int i=1;i<=n;i++)
	{
		if(num[i]==1)
		{
			r1=(r1+qpow(2,n-i,cnt+1))%(cnt+1);
			r2=(r2+qpow(2,n-i,cnt-1))%(cnt-1);
		}   
	}	
	for(int i=1;i<=n;i++)
	{
		if(num[i]==0)
		{
			int cnt1=1;
			long long int r3=(r1+qpow(2,n-i,cnt+1))%(cnt+1);
			while(r3>0)
			{
				long long int num1=0;
			    long long int a=r3;
			    while(a>0)
			    {
				    if(a%2==1)
				        num1++;
				    a=a/2;
			    }
			    r3=r3%num1;
			    cnt1++;
			}
			ans[i]=cnt1;
		}
		else
		{
			int cnt1=1;
			long long int r3=(r2-qpow(2,n-i,cnt-1)+cnt-1)%(cnt-1);
			while(r3>0)
			{
				long long int num1=0;
			    long long int a=r3;
			    while(a>0)
			    {
				    if(a%2==1)
				        num1++;
				    a=a/2;
			    }
			    r3=r3%num1;
			    cnt1++;
			}
			ans[i]=cnt1;
		}
	}
	for(int i=1;i<=n;i++)
	   cout<<ans[i]<<endl;
	return 0;
 } 

Measured memory_bytes: 5212
#include<bits/stdc++.h>
using namespace std;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort(ALL(V))

vector<string> split(string,string);

//template<typename T>
//void swap(T*,T*);
//char ToUpper (char cX) { return toupper(cX); }

int main()
{
    string s,t;
    cin >> s;
    cin >> t;
    if(s[0] == t[2] && s[1] == t[1] && s[2] == t[0])
    {
        cout << "YES";
    }else
    {
        cout << "NO";
    }
}


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 = 1000000007;

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

  ll n;
  cin >> n;
  vector<ll> p(n);
  REP(i, n) cin >> p[i];

  ll ma = 0, sum = 0;
  REP(i, n) {
    chmax(ma, p[i]);
    sum += p[i];
  }

  cout << sum - ma + ma/2 << endl;

  return 0;
}


Measured memory_bytes: 256
a=input()
tmp=0
ans=0
for i in range(len(a)-1):
    a=a[:-1]
    if len(a)%2==0:
        x=int(len(a)/2)
        if a[:x]==a[x:]:
            tmp=len(a[:x])*2
            ans=max(tmp,ans)
print(ans)

Measured memory_bytes: 3060
N = int(input())
A = list(map(int, input().split()))
tmp = [0] * N
ans = []
ans_m = 0
for i in range(N, 0, -1):
    x = 0
    for j in range(i, N+1, i):
        x += tmp[j-1]
    if x % 2 != A[i-1]:
        tmp[i-1] = 1
        ans_m += 1
        ans.append(str(i))
print(ans_m)
if ans:
    print(" ".join(ans))




Measured memory_bytes: 96904
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
#include<stdio.h>
#include<string.h>
#include <bitset>
#include<assert.h>
#include<random>
using namespace std;
#define int long long

#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
// #define MOD 998244353 
#define MEM_SIZE 10000
#define DEBUG_OUT true
#define ALL(x) (x).begin(), (x).end()

template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return; std::cout << e <<" ";}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){std::cout<< e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class... Ts> void DEBUG(T d, Ts... e){if(DEBUG_OUT == false)return;DEBUG(d);DEBUG(e...);}
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; abort();}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

void solve(void)
{
  int N;cin>>N;
  N--;
  vector<char> vec;
  while(N >= 0)
  {
    vec.push_back((N%26)+ 'a');
    N -= N%26;
    N /=26;
    N--;
  }

  for (int i = 0; i < vec.size(); i++)
  {
    cout<<vec[vec.size()-1-i];
  }
  cout<<endl;
  

  

  return;
}
int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(11);
  solve();

  return 0;
}


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

int main() {
  char c;
  cin>>c;

  char ans;
  if (c=='A') ans='T';
  else if (c=='C') ans='G';
  else if (c=='G') ans='C';
  else ans='A';
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
//999.cpp
#include<iostream>
#include<cmath>

using namespace std;

int main() {
  int n;
  cin >> n;
  int n3 = floor(n / 100);
  int n2 = floor((n % 100) / 10);
  int n1 = n % 10;

  if (n3 ==  1 || n3 == 9) {
    if (n3 == 1) {
      n3 = 9;
    } else {
      n3 = 1;
    }
  }
  if (n2 ==  1 || n2 == 9) {
    if (n2 == 1) {
      n2 = 9;
    } else {
      n2 = 1;
    }
  } 
 if (n1 ==  1 || n1 == 9) {
    if (n1 == 1) {
      n1 = 9;
    } else {
      n1 = 1;
    }
  }
  cout << n3 << n2 << n1 << endl;
  return 0;
}

Measured memory_bytes: 256
a = []
while True:
    x, op, y = input().split()
    if op == '?':
        break
    x = int(x); y = int(y)
    if op == '+':
        a.append('{}'.format(x+y))
    elif op == '-':
        a.append(x-y)
    elif op == '*':
        a.append(x*y)
    else:
        a.append(x//y)
for x in a:
    print('{}'.format(x))

Measured memory_bytes: 7592
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#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 show(x) for(auto i: x){cout << i << " ";}
#define showm(m) for(auto i: m){cout << m.x << " ";}
typedef long long ll;
typedef pair<int, int> P;


int main()
{
    int n, m;
    cin >> n >> m;
    vector<P> ab;
    rep(i, n){ int tmpa, tmpb; cin >> tmpa >> tmpb; ab.push_back(P(m-tmpa, tmpb));}

    
    priority_queue<int, vector<int>, less<int>> que_gre[m];
    rep(i, n) {
        if (ab[i].first >= 0) que_gre[ab[i].first].push(ab[i].second);
    }

    ll ans = 0;
    priority_queue<int, vector<int>, less<int>> work;
    for (int i = m-1; i >= 0; i--)
    {
        while(!que_gre[i].empty()){
            work.push(que_gre[i].top());
            que_gre[i].pop();
        }
        if(!work.empty()){
            ans += work.top();
            work.pop();
        }
    }
    cout << ans << endl;

}



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

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

void solve(long long N){
    vector<ll> res(N+1);
    rep(i,N+1){
        if(i == 0) continue;
        for(ll j = i; j <= N+1; j += i){
            res[j]++;
        }
    }
    ll ans = 0;
    rep(i,N+1){
        ans += i * res[i];
    }
    cout << ans << endl;

}

int main(){
    long long N;
    scanf("%lld",&N);
    solve(N);
    return 0;
}


Measured memory_bytes: 81372
#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <string>
#include <cmath>
#include <sstream>
#include <istream>
#include <iomanip>
#include <typeinfo>
#include <stack>

using namespace std;
typedef long long ll;
ll N;

vector< ll > divisor(ll n) {
  vector< ll > ret;
  for(ll i = 1; i * i <= n; i++) {
    if(n % i == 0) {
      ret.push_back(i);
      if(i * i != n) ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}

int main(){

    ll N;
    cin >> N ;
    vector<ll > A(N, 0);
    vector<ll > result(N,0);
    vector<ll > ans;

    for(int i = 0; i < N; i++){
        cin >> A[i];
    }
    
    for(ll i = N - 1; i >= 0 ; i--){
        vector<ll > rat = divisor(i + 1);
        //cout << result[i] << ":" << A[i] << endl;
        if((result[i] + 1 ) % 2 == A[i] ){
            for(ll j = 0; j < rat.size(); j++){
                result[rat[j] - 1] ++;
                //cout << rat[j] << ":" << result[rat[j] - 1] << endl;
            }
            ans.push_back(i + 1);
            //cout << i + 1 << endl;
        }else{
            ans.push_back(-1);
        }
    }

    reverse(ans.begin(), ans.end());

    ll cn = 0;
    vector<ll > true_ans;
    for(ll i = 0; i < ans.size(); i++){
        if(ans[i] != -1){
            cn++;
            true_ans.push_back(ans[i]);
        }
    }

    if(cn != 0){
        cout << cn << endl;
        for(ll i = 0; i < true_ans.size() - 1 ; i++){
            cout << true_ans[i] << " ";
        }
        cout << true_ans[true_ans.size() - 1] << endl;
    }else{
        cout << "0" << endl;

    }


    
}

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

#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, n) for (int i = (n) - 1; i >= 0; i--)

using namespace std;
using ll = long long;

const int MOD = 1000000007;

struct mint { int n; mint(int n_ = 0) : n(n_) {} };
mint operator-(mint a) { return -a.n + MOD * (a.n != 0); }
mint operator+(mint a, mint b) { int x = a.n + b.n; return x - (x >= MOD) * MOD; }
mint operator-(mint a, mint b) { int x = a.n - b.n; return x + (x < 0) * MOD; }
mint operator*(mint a, mint b) { return (long long)a.n * b.n % MOD; }
mint &operator+=(mint &a, mint b) { return a = a + b; }
mint &operator-=(mint &a, mint b) { return a = a - b; }
mint &operator*=(mint &a, mint b) { return a = a * b; }
istream &operator>>(istream &i, mint &a) { return i >> a.n; }
ostream &operator<<(ostream &o, mint a) { return o << a.n; }

vector<mint> F_{1, 1}, R_{1, 1}, I_{0, 1};

void check_fact(int n) {
  for (int i = I_.size(); i <= n; i++) {
    I_.push_back(I_[MOD % i] * (MOD - MOD / i));
    F_.push_back(F_[i - 1] * i);
    R_.push_back(R_[i - 1] * I_[i]);
  }
}

mint I(int n) { check_fact(abs(n)); return n >= 0 ? I_[n] : -I_[-n]; }
mint F(int n) { check_fact(n); return n < 0 ? 0 : F_[n]; }
mint R(int n) { check_fact(n); return n < 0 ? 0 : R_[n]; }
mint C(int n, int r) { return F(n) * R(n - r) * R(r); }
mint P(int n, int r) { return F(n) * R(n - r); }
mint H(int n, int r) { return n == 0 ? (r == 0) : C(n + r - 1, r); }


int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int N, K;
  cin >> N >> K;
  vector<vector<int>> g(N);
  rep(i, N-1) {
    int u, v;
    cin >> u >> v;
    u--; v--;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  if (N == 1) {
    cout << K << endl;
    return 0;
  }
  mint ans = 1;
  auto dfs = [&](auto dfs, int u, int p) -> void {
    if (p == -1) {
      ans *= P(K, g[u].size()+1);
    } else {
      ans *= P(K - 2, (int)g[u].size() - 1);
    }
    for (int v : g[u]) if (v != p) {
      dfs(dfs, v, u);
    }
  };
  dfs(dfs, 0, -1);
  cout << ans << endl;
}

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

#define mod 1000000007
#define limit 200001
typedef long long ll;
typedef long double ld;
#define rep(i,n) for(i = 0; i < n; i++)
#define max(a,b) ((a)>(b) ? (a) : (b))
#define min(a,b) ((a)<(b) ? (a) : (b))
int up_int(const void *a, const void *b){return *(int*)a - *(int*)b;}
int down_int(const void *a, const void *b){return *(int*)b - *(int*)a;}
int up_char(const void *left, const void *right) {return strcmp((char *)left,(char *)right);}

int main(){
    int n,m,i,j,count=0;
    int h[100001];
    int a[100001];
    int b[100001];
    int flag[100001] = {0};
    
    scanf("%d %d",&n,&m);
    for(i = 1; i <= n; i++) scanf("%d",&h[i]);
    for(i = 1; i <= m; i++) scanf("%d %d",&a[i],&b[i]);
    
    for(i = 1; i <= m; i++){
        if(h[a[i]] > h[b[i]]){
            flag[b[i]]--;
//            printf("%d is bad\n",b[i]);
        }else if(h[a[i]] == h[b[i]]){
            flag[a[i]]--;
            flag[b[i]]--;
//            printf("%d and %d are bad\n",a[i],b[i]);
        }else{
            flag[a[i]]--;
//            printf("%d is bad\n",a[i]);
        }
    }
    for(i = 1; i <= n; i++){
        if(flag[i] == 0){
            count++;
//            printf("%d is good tower!\n",i);
        }
    }
//    for(i = 1; i <= n; i++) printf("%d ",flag[i]);
    printf("%d\n",count);
    return 0;
}


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

using namespace std;

/**
 *  Name: Chris M. Perez
 *  University: Interamerican University Metro Campus
 *
**/

#define endl '\n'
#define MOD 10E9
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define gcd(x , y) __gcd(x , y)
#define all(x) (x).begin() , (x).end()
#define forn(i , a , b) for(int i=(a);i<(b);i++)
#define forrange(j , a , b) for(int j=(a);j<=(b);j++)
#define nestedforn(i , a , b , j , c , d) for(int i=(a);i<=(b);i++) for(int j=(c);j<=(d);j++)
#define sort_all(x) sort(all(x))
#define zeros_at_beginning(x) __builtin_clz(x)
#define zeros_at_end(x) __builtin_ctz(x)
#define ones(x) __builtin_popcount(x)
#define parity_even_or_odd_ones __builtin_parity(x)


typedef vector<int> vi;
typedef pair<int , int> pii;
typedef tuple<int , int , int> tiii;
typedef vector<pii> vpii;
typedef vector<tiii> vtiii;
typedef unsigned int ui;
typedef unsigned long long ull;
typedef long long ll;
typedef long long int lli;

                                                                         
int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(10);
  cout << fixed;  

#ifdef LOCAL_DEFINE
  freopen("input.txt" , "rt" , stdin);
#endif
      
  int n; cin >> n; 
  int k; cin >> k;
  char s[n + 1];
  cin >> s;
  s[k - 1] = tolower(s[k - 1]);
  cout << s << endl;                                           
    
 
#ifdef LOCAL_DEFINE 
  cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif  
  return 0;
}

Measured memory_bytes: 256
import kotlin.math.*
import kotlin.system.exitProcess

private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readLong() = readLn().toLong() //single long

private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map { it.toInt() } // list of ints
private fun readLongs() = readStrings().map{it.toLong()} // list of longs

fun main(){
    val vList = readInts()
    for(i in 0 until vList.size){
        if(vList[i] == 0){
            println(i +1 )
            exitProcess(0)
        }
    }
}


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

using namespace std;
#define FOR(i,o,n) for(long long i = o;i<n;i++)
#define oneforall ios::sync_with_stdio(false);cin.tie(0);
#define all(v) (v).begin(),(v).end()
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) long long __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
#define int long long
const long long INF=1e18;
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
typedef vector<int> vi;
typedef vector<long long> vl;
typedef long long ll;
typedef vector<pair<long, long > > vpll;
typedef vector<pair<int, int > > vpii;


int32_t main() {
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    
    ini(n);
    vi tmp(n);
    FOR(i,0,n)tmp[i] = 0;
    FOR(i,0,n-1){
        ini(x);
        x--;
        tmp[x]++;
    }
    FOR(i,0,n){
        out(tmp[i]);
    }
    
    
    
    
    
    
    
    
    
    
    
    return 0;
}


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

#define tc(t) int t; cin>>t; while(t--)
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    string s;
    cin >> n >> s;
    if(n >= 3200){
        cout << s << endl;
    }
    else {
        cout <<  "red" << endl;
    }


}






Measured memory_bytes: 3600