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

using ll = long long;
using ld = long double;
constexpr ll inf = static_cast<ll>(1e17);
constexpr int iinf = static_cast<int>(1e9);
constexpr ll mod = static_cast<ll>(1e9 + 7);

int h, w;
int num['z' - 'a' + 1];
int main()
{
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    std::cin >> h >> w;

    for (int i = 0; i < h; ++i)
        for (int j = 0; j < w; ++j) {
            char a;
            std::cin >> a;
            ++num[a - 'a'];
        }

    int four = 0, two = 0, one = 0;
    for (int i = 0, end = 'z' - 'a' + 1; i < end; ++i) {
        four += num[i] / 4;
        num[i] %= 4;
        two += num[i] / 2;
        num[i] %= 2;
        one += num[i];
    }

    if (h % 2 == 0 && w % 2 == 0) {
        if (two == 0 && one == 0)
            std::cout << "Yes" << std::endl;
        else
            std::cout << "No" << std::endl;
    }
    else if (h % 2 == 1 && w % 2 == 1) {
        if (two <= (h + w - 2) / 2 && one == 1)
            std::cout << "Yes" << std::endl;
        else
            std::cout << "No" << std::endl;
    }
    else {
        if (w % 2 == 0)
            std::swap(h, w);
        if (two <= h / 2 && one == 0)
            std::cout << "Yes" << std::endl;
        else
            std::cout << "No" << std::endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

ll cnt[100010];
int main() {
	ll n,k,q;
	cin>>n>>k>>q;
	for(ll i=0;i<q;i++){
		ll now;
		cin>>now;
		now--;
		cnt[now]++;
	}
	for(ll i=0;i<n;i++){
		ll mi=q-cnt[i];
		if(k<=mi){
			cout << "No";
		}
		else{
			cout << "Yes";
		}
		cout <<endl;
	}
	// your code goes here
	return 0;
}

Measured memory_bytes: 4416
a, b, c = [x for x in input().split()]
sum1 = int(a)+int(b+c)
sum2 = int(a)+int(c+b)
sum3 = int(b)+int(a+c)
sum4 = int(b)+int(c+a)
sum5 = int(c)+int(a+b)
sum6 = int(c)+int(b+a)
print(max(sum1, sum2, sum3, sum4, sum5, sum6))

Measured memory_bytes: 3064
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T>& V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> >& Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T>& mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }
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);}
/*
 <url:https://atcoder.jp/contests/abc161/tasks/abc161_c>
 問題文============================================================
 C - Replacing Integer
 =================================================================
 解説=============================================================
 ================================================================
 */

template<class Type>
Type solve(Type res = Type()){
    ll N,K; cin >> N >> K;
    res = min(N%K,K-N%K);
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    // solve(0);
    cout << fixed << setprecision(15) << solve<ll>() << endl;
    return 0;
}


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

int main(){
	int a,b;
	cin >> a >> b;
	if(a==b) cout << "a == b" << endl;
	else if(a>b) cout << "a > b" << endl;
	else cout << "a < b" << endl;

	return 0;
}


Measured memory_bytes: 3108
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    unsigned long int n, count, remain,a, b, blue,blue_last;
    cin >> n;
    cin >> a;
    cin >> b;
    count = n/(a+b);
    remain = n%(a+b);
    if (remain<a){
        blue_last = remain;
        
    }
    else{
        blue_last = a;
    }
    blue = a*count+blue_last;
    cout << blue << endl;
    
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#pragma GCC optimize "03"
using namespace std;

#define int long long int
#define pb push_back
#define pii pair<int,int>
#define fi first
#define se second
#define rep(i,a,b) for (int i = a; i < b; ++i)
#define dbg(x) { cerr<<"> "<<#x<<": "<<x<< endl; }
#define dbg2(x,y) { cerr<<"> "<<#x<<": "<<x<<" , "<<#y<<": "<<y<<endl; }
#define dbg3(x,y,z) { cerr<<"> "<<#x<<": "<<x<<" , "<<#y<<": "<<y<<" , "<<#z<<": "<<z<<endl; }
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#ifndef LOCAL
#define endl '\n'
#endif

const int inf = INT_MAX;
const int MOD = 1e9 + 7;
const int N = 22;

int a[N], b[N], c[N];

signed main(){
    IOS;
    int n;
    cin >> n;
    for (int i = 0; i < n; i++)
        cin >> a[i];
    for (int i = 1; i <= n; i++)
        cin >> b[i];
    for (int i = 1; i < n; i++)
        cin >> c[i];
    int s = 0;
    for (int i = 0; i < n; i++) {
        if (i == 0) {
            s += b[a[i]];
        }
        else {
            s += b[a[i]];
            if (a[i] - a[i-1] == 1)
                s += c[a[i-1]];
        }
    }
    cout << s << endl;
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
using namespace std;
#define rep(i, j, n) for (int i = j; i < (int)n; ++i)

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

  bool ok = false;
  rep(i, 0, n) {
    cin >> a;
    ok |= (a & 1);
  }
  if (ok)
    cout << "first";
  else
    cout << "second";
  cout << endl;

  return 0;
}


Measured memory_bytes: 3604
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author alireza_kaviani
 */

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

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
typedef pair<ld, ld> pld;
typedef pair<string, string> pss;

#define all(x)                      (x).begin(),(x).end()
#define Sort(x)                     sort(all((x)))
#define X                           first
#define Y                           second
#define Mp                          make_pair
#define sep                         ' '
#define endl                        '\n'
#define debug(x)                    cerr << #x << " = " << x << endl
#define SZ(x)                       ll(x.size())
#define fast_io                     ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define file_io                     freopen("in.txt" , "r+" , stdin) ; freopen("out.txt" , "w+" , stdout);
#define set_random                  mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

inline ll input() {
    ll n;
    cin >> n;
    return n;
}

ll poww(ll a, ll b, ll md) {
    return (!b ? 1 : (b & 1 ? a * poww(a * a % md, b / 2, md) % md : poww(a * a % md, b / 2, md) % md));
}

set_random;

const ll MAXN = 1e6 + 10;
const ll INF = 8e18;
const ll MOD = 1e9 + 7; // 998244353; // 1e9 + 9;

ll n;
double k , ans;

int main() {
    fast_io;

    cin >> n >> k;
    for(ll i = 1 ; i <= n ; i++)
    {
        ans += (1. / n) * pow(0.5 , ceil(max(0. , log2(k / i))));
    }
    printf("%.12f" , ans);

    return 0;
}
/*
todo :
    1- set constants
    2- check TimeLimit and MemoryLimit
    3- check special test cases
    4- don't forget BS can help you that is good idea(use for loop for floats)
    5- don't forget printf and scanf can help you in your code speed
*/


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

using namespace std;

#define rep(i, x)   for (__typeof(x) i = 0; i < x; i++)
#define mp             make_pair
#define pb             push_back
#define fi             first
#define se             second
#define sz(x)          (int)((x).size())
#define all(x)         (x).begin(), (x).end()
#define sci(x)         int x;       scanf("%d", &x);
#define scii(x, y)     int x, y;    scanf("%d %d", &x, &y);
#define sciii(x, y, z) int x, y, z; scanf("%d %d %d", &x, &y, &z);
#define TC(x)          sci(x); while(x --)
#define eprintf(...)   fprintf(stderr, __VA_ARGS__)
#define debug(x)       { cerr << #x << " = " << x << endl; }
#define repi(i, x)  for (__typeof(x) i = x-1; i >= 0; i --)
#define fore(itr, x)   for (__typeof(x.begin()) itr = x.begin(); itr != x.end(); itr ++)
#define forei(itr, x)  for (__typeof(x.end()) itr = x.end() - 1; itr != x.begin() - 1; itr --)
typedef long long      ll;
typedef pair<int, int> ii;
typedef pair<ii, int>  iii;
typedef vector<int>    vi;
typedef vector<ii>     vii;
typedef vector<iii>    viii;
typedef vector<vector<int> > vvi;
typedef pair<ll, ll>   pairl;
typedef vector<ll>     vl;
typedef vector<ll>     vll;
typedef vector<vector<ll> > vvl;
const   int            infi = numeric_limits<int>::max();
const   ll             infl = numeric_limits<ll>::max();
const   double         eps = 0;
const   int            ms  = 0;



int main()
{
    ios::sync_with_stdio(false);//endl->"\n"
    cin.tie(0);
    int N;
    cin >> N;
    vii p;
    rep(i, N){
        int a;
        cin >> a;
        p.pb({a, i+1});
    }
    sort(all(p));
    rep(i, N-1){
        cout << p[i].second << " ";
    }
    cout << p[N-1].second << "\n";
    return 0;
}

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

//macro
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) FOR(i,0,n)
#define RFOR(i,a,b) for(int i=(int)(b) - 1;i>=(int)(a);i--)
#define RREP(i,n) RFOR(i,0,n)
#define each(i, ctn) for (auto &&i : (ctn))
#define all(a) (a).begin(),(a).end()
#define mp make_pair
#define INF 114514810
#define INFL 1145148100000000000LL
#define EPS (1e-8)
#define MOD 1000000007
#define PI 3.141592653589793
#define equals(a,b)(fabs((a)-(b))<EPS)

//alias
using ll = long long;
using ull = unsigned long long;
using vb = vector<bool>;
using vvb = vector<vb>;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vs = vector<string>;
using vvs = vector<vs>;
using P = pair<ll, ll>;
template<class T> using heap = priority_queue<T>;
template<class T> using minheap = priority_queue<T, vector<T>, greater<T>>;

//func
template<typename A, typename T>void assign2d(A&arr, ll H, ll W, T t) { arr.resize(H);    REP(i, H) arr[i].assign(W, t); }
template<class T> ostream &operator<<(ostream &os, const vector<T> &v) { int n = v.size(); REP(i, n)os << v[i] << (i == n - 1 ? "" : " "); return os; }
template <class T = int> inline T in() { T x; cin >> x; return x; }
template<class T> inline void print(const T &x) { cout << x; }
struct pre_ { pre_() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(12); } } pre__;


int main(void) {
	ull X, Y;
	cin >> X >> Y;
	ull cnt = 0;
	ull A = X;
	while (A <= Y) {
		A *= 2;
		cnt++;
	}
	print(cnt);
	cout << "\n";

	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void){
	char s[7] = {'\0'};
	scanf("%s", s);
	if(s[2] == s[3] && s[4] == s[5]){
		printf("Yes\n");
	}
	else{
		printf("No\n");
	}
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
using namespace std;
int main(void){
    int n; cin >> n;
    int b[101]; for(int i=1;i<n;i++) cin >> b[i];
    int sum = b[1]+b[n-1];
    for(int i=1;i<n-1;i++) sum += min(b[i],b[i+1]);
    cout << sum << endl;
}


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

#pragma GCC optimize("O3,Ofast,no-stack-protector,unroll-loops,fast-math")

#define int long long
typedef pair <int, int> pii;

int32_t main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int h;
	cin >> h;
	cout << (1ll << (int)(ceil(log2(h + 1)))) - 1;
}


Measured memory_bytes: 512
n = int(input())
table = [[0]*10 for _ in range(10)]

for x in range(1,n+1):
    if x%10!=0:
        str_x = str(x)
        l,r = int(str_x[0]), int(str_x[-1])
        table[l][r] += 1

ans = 0
for x in range(1, n+1):
    if x%10 != 0:
        str_x = str(x)
        l,r = int(str_x[0]), int(str_x[-1])
        if l==r:
            ans += table[l][r]
        else:
            ans += table[r][l]
print(ans)

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

int main(){
  int N;
  cin >> N;
  vector<int> a(N);
  for(int i=0;i<N;i++){
    cin >> a.at(i);
  }
  sort(a.begin(),a.end());
  int64_t ans=1e9;
  for(int i=a.front();i<=a.back();i++){
    int64_t sum=0;
    for(int j=0;j<N;j++){
      sum+=pow(a.at(j)-i,2);
    }
    if(ans>sum){
      ans=sum;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
sys.setrecursionlimit(500*500)
import itertools
from collections import Counter,deque

def main():
    s = input().rstrip()
    if s == "RRR":
        print(3)
    elif s == "RRS" or s == "SRR":
        print(2)
    elif s == "SSS":
        print(0)
    else:
        print(1)





if __name__=="__main__":
    main()


Measured memory_bytes: 65124
#include<bits/stdc++.h>
using namespace std;
    
#define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
    
#define int long long
#define double long double
    
#define all(a)      (a).begin(),(a).end()
#define sz(x)       (int)x.size()
    
#define ff first
#define ss second
#define mp make_pair
         
#define pb push_back
#define endl "\n" 
         
#define f(i,l,r) for(int i=l;i<=r;i++)
#define rf(i,r,l) for(int i=r;i>=l;i--)    

#define bp __builtin_popcountll
#define inf 1e15
    
const int N=2e5+5;
const int M=1e9+7;
int n,k;
int a[N],f[N];
bool chk(int x)
{
	int ans=0;
	for(int i=0;i<n;i++)
	{
		int pp=x/f[i];
		ans+=max(0LL,a[i]-pp);
		if(ans>k) return false;
	}
	if(ans<=k) return true;
}
void solve()
{	
	cin>>n>>k;
	f(i,0,n-1) cin>>a[i];
	f(i,0,n-1) cin>>f[i];
	sort(a,a+n);
	sort(f,f+n);
	reverse(a,a+n);
	int low=0,high=1e12;
	int ans=high;
	while(low<=high)
	{
		int mid=(low+high)/2;
		if(chk(mid))
		{
			ans=mid;
			high=mid-1;
		}
		else
		{
			low=mid+1;
		}
	}
	cout<<ans;
}
signed main()  
{
	FAST
    int t=1;
    // cin>>t;
    for(int tc=1;tc<=t;tc++)
    {
    	// cout<<"Case #"<<tc<<": ";
    	solve();
    }
}

Measured memory_bytes: 3328
#include<stdio.h>
#include<stdlib.h>
struct node {
	int id;
	struct node *next;
};
int *visit, *queue, counter;
struct node **list;
void insert(int, int);
void bfs(int, int);
main()
{
        int i, n, m, q, s, t;
        scanf("%d%d", &n, &m);
        list = (struct node**)malloc(sizeof(struct node*) * n);
        visit = (int*)malloc(sizeof(int) * n);
    	queue = (int*)malloc(sizeof(int) * n);
    	for (i = 0; i < n; i++) {
    		list[i] = NULL;
    	}
        for (i = 0; i < m; i++) {
            scanf("%d%d", &s, &t);
            insert(s, t);
        }
        for (i = 0; i < n; i++) {
        	counter++;
        	if (!visit[i]) {
        		bfs(i, n);
        	}
        }
        scanf("%d", &q);
        for (i = 0; i < q; i++) {
                scanf("%d%d", &s, &t);
                if (visit[s] == visit[t]) {
                        printf("yes\n");
                } else {
                        printf("no\n");
                }
        }
        for (i = 0; i < n; i++) {
    		free(list[i]);
    	}
        free(list);
        free(visit);
        free(queue);
}
void insert(int a, int b)
{
	struct node *p = (struct node*)malloc(sizeof(struct node));
	p->id = b;
	p->next = list[a];
	list[a] = p;
	p = (struct node*)malloc(sizeof(struct node));
	p->id = a;
	p->next = list[b];
	list[b] = p;
}
void bfs(int p, int size)
{
        int i, pos, head = 0, tail = 0;
        struct node *n;
        queue[tail++] = p;
        visit[p] = counter;
        do {
                pos = queue[head++];
                for (n = list[pos]; n != NULL; n = n->next) {
                        if (!visit[n->id]) {
                                visit[n->id] = counter;
                                queue[tail++] = n->id;
                        }
                }
        } while (head != tail);
}


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

int main () {
    int N, tmp;
    int arr[2000000];
    cin >> N;
    for (int i = 0; i < N-1; i ++){
        cin >> tmp;
        arr[tmp - 1] += 1;
    }
    for (int i = 0; i < N; i ++){
        cout << arr[i] << endl;
    }
}


Measured memory_bytes: 4376
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>

using namespace std;

#define rint register int
#define gc() getchar()
inline int read(int r=0,int s=0,int c=gc()){for(;c<48||c>57;s=c,c=gc());for(;c>=48&&c<=57;(r*=10)+=c-48,c=gc());return s^'-'?r:-r;}
int n = 100, m = 100, c[105][105], f = 0, A, B;


int main()
{
	A = read(), B = read(); printf("%d %d\n",n,m); A--, B--;
	for(rint i = 1, j; i <= n; i++) for(j = 1; j <= m; c[i][j] = i<=n/2, j++);
	for(rint i = 1, x = 1, y = 1; i <= A; i++)
		c[x][y] = 0, (y+=2)>m?x += 2,y = 1:0;
	for(rint i = 1, x = n, y = m; i <= B; i++)
		c[x][y] = 1, (y-=2)<1?x -= 2,y = m:0;
	for(rint i = 1, j; i <= n; putchar('\n'), i++) for(j = 1; j <= m; printf("%c",c[i][j]?'#':'.'), j++); return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		/*
		 * Scannerで値取得。
		 */
		Scanner snum = new Scanner(System.in);

		//値取得
		long numN = snum.nextLong();

		snum.close();

		long tate = 0;
		long yoko = 0;

		//		numNを割る
		long halfLong = (long) (Math.sqrt(numN));

		//		halfLongの値から1ずつデクリメントしながら割り切れる値を探す
		//		割り切れたら割る→縦横の和から２引く
		for (tate = halfLong; tate > 0; tate--) {
			if (numN % tate == 0) {
				yoko = numN / tate;
				System.out.println(tate + yoko - 2);
				break;
			}
		}
	}

}


Measured memory_bytes: 23764
// きさま！ 見ているなッ！

#include<iostream>
#include<queue>
#include<memory>
#include<map>
#include<set>
#include<unordered_map>
#include<array>
#include<vector>
#include<algorithm>
#include<list>
#include<limits>
#include<stdio.h>
#include<math.h>
#include<string>
#include<thread>

using namespace std;
using ll = long long;
using vec = vector<int>;
using mat = vector<vec>;
using lst = list<ll>;

const ll MOD = 1000000007;


int main()
{
	int S, W;
	cin >> S >> W;
	cout << (S > W ? "safe" : "unsafe") << endl;

	return 0;
}



Measured memory_bytes: 3676
n = int(input())
a = list(map(int, input().split()))
count = True
for i in range(n):
    if a[i]%2 == 0:
        if(a[i]%3 != 0 and a[i]%5 != 0):
            count = False
            break
if count:
    print('APPROVED')
else:
    print('DENIED')

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

int A[100][100];
int TF[100000];

void Main()
{
  rep(i,100000) {TF[i] = 1;}
  int N, M;
  cin >> N >> M;
  vector<int> H(N);
  rep(i,N) cin >> H[i];
  vector<int> A(M), B(M);
  rep(i,M) {
    cin >> A[i] >> B[i];
    A[i]--; B[i]--;
  }
  rep(i,M) {
    if (H[A[i]] == H[B[i]]){
      TF[A[i]] = 0;
      TF[B[i]] = 0;
    } else if (H[A[i]] > H[B[i]]) TF[B[i]] = 0;
    else TF[A[i]] = 0;
  }
  int cnt = 0;
  rep(i,N) {cnt += TF[i];}
  cout << cnt << endl;
}

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


Measured memory_bytes: 4780
A,B,C,X,Y=map(int,input().split())
ans=0
if (A+B)//2>=C:
    ans=2*C*min(X,Y)
    if X>Y:
        if A>2*C:
            ans=ans+2*C*(X-Y)
        else:
            ans=ans+A*(X-Y)
    else:
        if B>2*C:
            ans=ans+2*C*(Y-X)
        else:
            ans=ans+B*(Y-X)
else:
    ans=A*X+B*Y
print(ans)
    

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

int main(){

	int a, b, c;
	cin >> a >> b >> c;
	int i = a;
	int num = 0;

	while(i < b + 1){
		if(c % i == 0){
			num++;
		}
		i++;
	}

	cout << num << endl;

return 0;
}

Measured memory_bytes: 1160
#include <stdio.h>
#define N 5000000

int left(int);
int right(int);
int maxHeapify(int);
int buildMaxHeap();


int A[N],n;

main()
{
  
  
  int i;
  
  
  
  
  scanf("%d",&n);
  
  for(i = 1; i <= n; i++){
    scanf("%d",&A[i]);
  }
  
  buildMaxHeap();
  for(i = 1; i <= n; i++){ 
    printf(" %d",A[i]);
  }
     printf("\n");
  return 0;
  
}


int left(int a)
{
  return 2*a;
}

int right(int a)
{
  return 2*a + 1;
}


int maxHeapify(int b)
{

  int l,r;
  int largest;
  int tmp;

  l = left(b);
  r = right(b);

  if(l <= n && A[l] > A[b]){
    largest = l;
  }
  else{
    largest = b;
  }

  if(r <= n && A[r] > A[largest]){
    largest = r;
  }
  if(largest != b){
    tmp = A[b];
    A[b] = A[largest];
    A[largest] = tmp;
   maxHeapify(largest);
  }
}


int buildMaxHeap()
{
  int i;

  for(i = n/2; i >= 1; i--){
    maxHeapify(i);
  }
}

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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ll << (b))
#define uniq(v) (v).erase(unique(all(v)), (v).end())
#define rsort(v) sort(all(v)); reverse(all(v))

using namespace std;

using i32 = int;
using i64 = long long;
using f80 = long double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << '\n'; exit(0); }
inline void no() { cout << "No" << '\n'; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { return a / gcd(a, b) * b; }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }
template<typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template<typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template<typename T> inline void amax(T &x, T y) { if (x < y) x = y; }
template<typename T> inline void amin(T &x, T y) { if (x > y) x = y; }
template<typename T> inline T power(T x, i64 n) { T r = 1; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template<typename T> istream& operator>>(istream &is, vector<T> &v) { for (auto &x : v) is >> x; return is; }
template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }

int g[110][110];

void solve() {
  int n, m;
  cin >> n >> m;
  using T = tuple<int, int, int>;
  vector<T> edges;
  rep(i, 110) rep(j, 110) g[i][j] = 1e9;
  rep(i, m) {
    int a, b, c;
    cin >> a >> b >> c;
    edges.emplace_back(a, b, c);
    g[a][b] = c;
    g[b][a] = c;
  }
  reps(k, n) reps(i, n) reps(j, n) {
    amin(g[i][j], g[i][k] + g[k][j]);
  }
  int ans = 0;
  rep(i, m) {
    int a, b, c;
    tie(a, b, c) = edges[i];
    if (g[a][b] != c) ans++;
  }
  cout << ans << '\n';
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, e) for (int i = (int)(s); i <= (int)(e); i++)
#define printYesNo(is_ok) puts(is_ok ? "Yes" : "No");
#define SORT(v) sort(v.begin(), v.end());
#define RSORT(v) sort(v.rbegin(), v.rend());
#define REVERSE(v) reverse(v.begin(), v.end());

template <typename T>
void printlnVector(T v)
{
  rep(i, v.size())
  {
    cout << v[i] << endl;
  }
}

template <typename T>
void printVector(T v)
{
  rep(i, v.size())
  {
    cout << v[i] << " ";
  }
  cout << endl;
}

int main()
{
  string S;
  cin >> S;
  int N = S.size();
  string S1 = S.substr(0, (N - 1) / 2);
  string S2 = S.substr((N + 3) / 2 - 1, N - ((N - 1) / 2) + 1);
  string rS = S, rS1 = S1, rS2 = S2;
  REVERSE(rS);
  REVERSE(rS1);
  REVERSE(rS2);
  bool is_ok = ((S == rS) && (S1 == rS1) && (S2 == rS2));
  printYesNo(is_ok);
  return 0;
}

Measured memory_bytes: 256
from math import factorial

def getlist():
	return list(map(int, input().split()))

N, A, B = getlist()
v = sorted(getlist())

ans1 = 0
for i in range(A):
	ans1 += v[-1 - i]
ans1 = ans1 / A
print(ans1)

if v[-1] != v[- A]:
	i = 0
	while True:
		if v[- A + i] == v[- A]:
			i += 1
		else:
			 break
	ans2 = factorial(v.count(v[- A])) // factorial(i) // factorial(v.count(v[- A]) - i)

else:
	ans2 = 0
	n = v.count(v[-1])
	for i in range(A, B + 1):
		if v[- i] == v[- A]:
			ans2 += factorial(n) // factorial(n - i) // factorial(i)

		else:
			 break

print(int(ans2))

Measured memory_bytes: 3064
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 998244353
dd = [(0,-1),(1,0),(0,1),(-1,0)]
ddn = [(0,-1),(1,-1),(1,0),(1,1),(0,1),(-1,-1),(-1,0),(-1,1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    rr = []

    while True:
        n = I()
        if n == 0:
            break
        a = [LI()[1:] for _ in range(n)]
        d = collections.defaultdict(list)
        for i in range(n):
            for c in a[i]:
                d[c].append(i)
        r = -1
        s = [set([i]) for i in range(n)]
        for k in sorted(list(d.keys())):
            ts = set()
            for c in d[k]:
                ts |= s[c]
            if len(ts) == n:
                r = k
                break
            for c in d[k]:
                s[c] |= ts
        rr.append(r)

    return '\n'.join(map(str,rr))


print(main())




Measured memory_bytes: 9228
from collections import defaultdict

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

fac = [1, 1]
inv = [1, 1]
finv = [1, 1]
for i in range(2, n+5):
    fac.append(fac[i-1] * i % mod)
    inv.append(mod - inv[mod%i] * (mod//i) % mod)
    finv.append(finv[i-1] * inv[i] % mod)

def nck(n, k):
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k] * finv[n-k] % mod) % mod

ans = 0

a.sort()
mx_d = defaultdict(int)
for ai in a:
    mx_d[ai] += 1

i = 0
while i < n:
    # a[i]がj個
    j = mx_d[a[i]]
    for x in range(j):
        if i + (x + 1) < k:
            continue
        ans += nck(i, k-(x+1)) * a[i] % mod * nck(j, x+1) % mod
        ans %= mod
    i += j



a.sort(reverse=True)
mx_d = defaultdict(int)
for ai in a:
    mx_d[ai] += 1

i = 0
while i < n:
    # a[i]がj個
    j = mx_d[a[i]]
    for x in range(j):
        if i + (x + 1) < k:
            continue
        ans -= nck(i, k-(x+1)) * a[i] % mod * nck(j, x+1) % mod
        ans %= mod
    i += j

print(ans)

Measured memory_bytes: 81136
#include <cmath>
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<set>
#include<tuple>
#include<bitset>
#include<iomanip>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
ll inf = 1000000007;
ll v[105], w[105];
ll dp[10005][10005];
int main() {
	int n, W;
	cin >> n >> W;
	for (int i = 0; i < n; i++) {
		cin >> v[i] >> w[i];
	}
	for (int i = 0; i <= W; i++) {
		dp[0][i] = 0;
	}
	for (int i = 0; i <n; i++) {
		for (int j = 0; j <= W; j++) {
			if (j >= w[i]) {
				dp[i + 1][j] = max(dp[i][j], dp[i][j - w[i]] + v[i]);
			}
			else {
				dp[i + 1][j] = dp[i][j];
			}
		}
	}
	cout << dp[n][W] << endl;
	return 0;
}


Measured memory_bytes: 10920
#include<iostream>
#include<algorithm>
#include<cassert>
#include<vector>
#include<fstream>
#include<string>
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include<queue>
#include<map>

using namespace std;
#define REP(i,m,n) for(int i=m;i<n;++i)
#define INF 10000000000000000
#define MOD 1000000007
#define ll long long
#define mp make_pair

vector<pair<int,int>>edge[100000];
vector<int>dist(100000, INF);
queue<int>q;

int main() {
	int k;
	cin >> k;
	REP(i, 1, k) {
		edge[i].push_back(mp((i * 10) % k, 0));
		edge[i].push_back(mp((i + 1) % k, 1));
	}
	q.push(1);
	dist[1] = 1;
	while (q.empty() == false) {
		int a = q.front(); q.pop();
		REP(i, 0, edge[a].size()) {
			if (dist[a] + edge[a][i].second < dist[edge[a][i].first]) {
				dist[edge[a][i].first] = dist[a] + edge[a][i].second;
				q.push(edge[a][i].first);
			}
		}
	}
	cout << dist[0] << endl;
	return 0;
}

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


int main(){
    string N;
    cin>>N;
    char n;
    int sum=0;
    for(int i=0;i<N.size();i++){
        n=N.at(i);
        sum+=n-'0';
    }
    if(sum%9==0){
        cout<<"Yes"<<endl;
    }
    else{
        cout<<"No"<<endl;
    }
}

Measured memory_bytes: 3720
#include<bits/stdc++.h>
#define endl "\n"
#define pb push_back
#define ll long long
#define d1(x)  cerr << #x << "--> " << x << endl
#define d2(x,y)  cerr << #x << "--> " << x << " | " << #y << "--> " << y <<endl
#define d3(x,y,z)  cerr << #x << "--> " << x << " | " << #y << "--> " << y <<" | " << #z << "--> "<< z<< endl
#define d4(x,y,z,w)  cerr << #x << "--> " << x << " | " << #y << "--> " << y <<" | " << #z << "--> "<< z << " | "<< #w << "--> " << w <<endl
#define vpll vector<pair<ll,ll>>
#define F first
#define S second
#define T ll tt; cin>>tt; while(tt--)
using namespace std;
ll mode=1ll<<32;
const ll maxn=1e3+10;
ll __lcm(ll a, ll b){ return (a*b)/__gcd(a,b); }
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll getRand(ll l, ll r){ uniform_int_distribution<int> uid(l, r); return uid(rng); }


void solve(){
	
	
	ll n;
	cin>>n;
	
	if (n==2){
		cout<<1<<endl;
		return;
	}
	
	ll x=n-1, ans=0;
	for (ll i=2;i*i<=x;i++){
		if (x%i==0){
			if ((x/i)==i) ans++;
			else ans+=2;
		}
	}
	
	ans+=2;
	
	vector<ll> v;
	for (ll i=2;i*i<=n;i++){
		if (n%i==0){
			if ((n/i)==i) v.pb(i);
			else{
				v.pb(i);
				v.pb(n/i);
			}
		}
	}
	
	for (auto i:v){
		ll prev=ans;
		ll z=n;
		while(z%i==0) z=z/i;
		
		if (z==1 || (z-1)%i==0) ans++;
		if (ans==prev){
			ll xx=0;
			ll l=0, r=z/i;
			while(l<=r){
				ll m=(l+r)/2;
				if ((z-m*i)>=1){
					xx=m;
					l=m+1;
				}
				else{
					r=m-1;
				}
			}
			//d2(i,z);
			z=z-xx*i;
			
			
			while(z%i==0) z=z/i;
			if (z==1 || (z-1)%i==0) ans++;
		}
	}
	
	cout<<ans<<endl;
	
	return;
	
}

int main(){ 
    
    #ifndef ONLINE_JUDGE
  	//	freopen("input.txt", "r", stdin);
    #endif
    srand(time(0)); 
    
    ios::sync_with_stdio(0);
    cin.tie(0);


	//T{ solve(); }
	solve();
		
	
	return 0;
}

Measured memory_bytes: 384
N,K = map(int,input().split())
S = input()

L = [0]
tmp = '1'

"""
下記をLに格納する。

0,2,4,6...番目のidxは1の値の個数
1,3,5,7,...番目のidxは0の値の個数

また、Lの最後の要素は「1の値の個数」となるようにする。
（なので、0になることもある）
これで、無理やりLの要素数を必ず奇数になるように強制する。
これで「1の値の個数」で始まって終わる配列を取得する。
"""

for s in S:
  if s == tmp:
    L[-1] += 1
  else:
    L.append(1)
  tmp = s

if tmp == '0':
  L.append(0)


## 全てを1、もしくは0で表現できてしまう場合は文字列の長さをそのまま出力する
M = len(L)
if M <= 2*K+1:
  ans = N
  print(ans)
  exit()


## 累積を計算
## 最初の要素は使わない（下記のループを簡単に書くために要素を一個多くしているだけ）
X = [0]*(M+1)
for i in range(M):
  X[i+1] = X[i] + L[i]


## answer
ans = 0
for m in range(0,M-2*K,2):
  _ = X[2*K+m+1]-X[m]
  ans = max(ans, _)


print(ans)

Measured memory_bytes: 8004
use proconio::{input, fastout};
use proconio::marker::{Chars};
use proconio::marker::Usize1;
use std::cmp::*;

macro_rules! debug {
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

#[fastout]
fn main() {
    input!{
        n: usize,
        a: usize,
    }

    if n%500<=a {
        println!("Yes");
    } else {
        println!("No");
    }

}


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



using namespace std;

typedef vector<int> VI;
typedef vector<string> VS;


//container util
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)



int main(void){

	int A, B; cin >> A >> B;

	
	if(A >= 13) cout << B << endl;
	else if(A >= 6) cout << B / 2 << endl;
	else cout << 0 << endl;
	
	


	return 0;

}


Measured memory_bytes: 256
Option Strict On
Imports System.Console
Imports System.Collections.Generic

Module Program

    Sub Main()
        Dim n As Integer = NextInt()
        Dim k As Integer = NextInt()

        Dim ans As Integer = 1

        For i As Integer = 0 To n - 1
            ans *= k - B2i(i <> 0)
        Next

        WriteLine(ans)
    End Sub

    Function B2i(ok As Boolean) As Integer
        If ok Then Return 1
        Return 0
    End Function

    Function NextInt() As Integer
        Return CInt(NextString())
    End Function

    Function NextString() As String
        Dim result As New List(Of String)
        Do
            Dim tmp As Integer = Read()
            If tmp < 0 Then Exit Do
            Dim nextChar As Char = Chr(tmp)

            If Not Char.IsWhiteSpace(nextChar) Then
                result.Add(nextChar)
            ElseIf nextChar <> vbCr Then
                Exit Do
            End If
        Loop
        Return String.Join("", result)
    End Function

End Module


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


int main(){
	int x,y,z,e,m;
	
	while(~scanf("%d",&e)){
		if(e==0)break;
		m=e;
		for(z=0;z*z*z<=e;z++){
			for(y=0;z*z*z+y*y<=e;y++){
				m=m>z+y+e-z*z*z-y*y?z+y+e-z*z*z-y*y:m;
			}
		}
		
		printf("%d\n",m);
	}
	return 0;
}

Measured memory_bytes: 760
#include<stdio.h>

struct zhen
{
	long long teleporter;
	int flag = 0;/*判断是否来过*/
}d[200005];


struct cc
{
	long long des;
}c[200005];

int main()
{
	long long n, k, i,j,bj,flag0=0;
	scanf("%lld%lld", &n, &k);
	for (i = 1; i <= n; i++)/*输入每个镇的传送门*/
		scanf("%lld", &d[i].teleporter);
	c[0].des = 1;/*第几次在哪个镇*/
	d[1].flag = 1;
	for (i = 1; i <= k; i++)
	{
		c[i].des = d[c[i-1].des].teleporter;
		if (d[c[i].des].flag == 1)
		{
			bj = i;
			flag0 = 1;/*表示存在循环*/
			break;
		}
		d[c[i].des].flag = 1;
	}
	if (flag0)
	{
		for (j = 0; j < bj; j++)
			if (c[j].des == c[bj].des)
				break;
		long long cha = bj - j,ys;
		ys = (k - j) % cha;
		printf("%lld\n", c[j  + ys].des);
	}
	else
	{
		printf("%lld\n", c[k].des);
	}
	return 0;
}

Measured memory_bytes: 6100
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define loop(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  loop(i,0,n)
#define all(c) c.begin(),c.end()
#define rall(c) c.rbegin(),c.rend()
#define vi vector<int>
#define vl vector<ll>
#define pll pair<ll,ll>
#define vpll vector<pll>

int main(){
    int N;
    cin>>N;
    int c[N],v[N];
    rep(i,N)cin>>v[i];
    rep(i,N)cin>>c[i];
    int ans=0;

    rep(i,N){
      if(v[i]>=c[i])ans+=v[i]-c[i];
    }
    cout<<ans<<endl;
}


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

int
main(int argc, char *argv[])
{
        int r, c;
        int i, j;
        int rsum, *csum;
        int *data, *itr;

        scanf("%d %d", &r, &c);
        data = (int *)malloc((r + 1) * (c + 1) * sizeof(int));
        csum = data + (c + 1) * r;
        for (i = 0; i < r; i++) {
                itr = data + (c + 1) * i;
                rsum = 0;
                for(j = 0; j < c; j++) {
                        scanf("%d", itr);
                        rsum += *itr;
                        csum[j] += *itr;
                        itr++;
                }
                *itr = rsum;
        }
        for (j = 0; j < c; j++)
                csum[c] += csum[j];

        itr = data;
        for (i = 0; i < r + 1; i++)
                for (j = 0; j < c + 1; j++)
                        printf("%d%c", *itr++, (j == c)? '\n' : ' ');

        return 0;
}

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

signed main() {

    int r;
    cin >> r;

    double ans = (double) (2 * r) * M_PI;

    cout << fixed << setprecision(10) << ans << endl;

    return 0;
}


Measured memory_bytes: 3808
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
    
    Scanner sc = new Scanner(System.in);
      
      //入力
      int N =sc.nextInt();//商品の種類
      int M =sc.nextInt();//選択する個数
      
      int item[] = new int[N];
      double sum =0;
      int count =0;
      
      //各商品の投票数を配列へ
      for(int i=0; i<N; i++){
        	item [i] = sc.nextInt();
             sum += item[i];//総投票数
      }
       //選択されるための最低投票数
      double min = sum/(4*M);    
      
      for(int i=0; i<N; i++){
        
        //各投票数が最低投票数を超えているか
        if(item[i]>=min){
          count++;
        }
      }
      //最低投票数以上の票がある商品をM 以上選択できるか
      if(count>=M){
          System.out.println("Yes");
            
      }
      else{
          System.out.println("No");   
      }     
    }
}

Measured memory_bytes: 36060
#include <bits/stdc++.h>
#define MOD 1000000007
 
using namespace std;
 
typedef long long ll;
 
ll pow_mod(ll x,int k) {
  ll ans=1;
  while (k) {
    if (k&1) ans=ans*x%MOD;
    x=x*x%MOD;
    k>>=1;
  }
  return ans;
}
 
int C[5005][5005],facd[10000005],facv[10000005],inv[5005];
 
void pre(int n,int m) {
  facd[0]=1;
  for(int i=1;i<=n;i++) facd[i]=(ll)facd[i-1]*i%MOD;
  facv[n]=pow_mod(facd[n],MOD-2);
  for(int i=n-1;i>=0;i--) facv[i]=(ll)facv[i+1]*(i+1)%MOD;
  for(int i=0;i<=m;i++) C[i][0]=1;
  for(int i=1;i<=m;i++)
    for(int j=1;j<=i;j++) C[i][j]=(C[i-1][j-1]+C[i-1][j])%MOD;
  inv[1]=1;
  for(int i=2;i<=m;i++) inv[i]=(ll)(MOD-MOD/i)*inv[MOD%i]%MOD;
}
 
ll f[5005][5005];
 
int main() {
  int n,m;
  scanf("%d%d",&n,&m);
  pre(n,m);
  ll v=1;
  for(int i=0;i<=m;i++) {
  	ll t=v*((i)?inv[i]:1)%MOD;
  	for(int j=i+1;j<=m;j++) {
  		f[i][j]=(f[i][j]+t*inv[j])%MOD;
  		f[j][j]=(f[j][j]-t*inv[j]%MOD+MOD)%MOD;
	  } 
    ll s=0;
    for(int j=i;j<=m;j++) {
        if (i) f[i][j]=(f[i][j]-f[i-1][j-1]*inv[j]%MOD+MOD)%MOD;
        f[i][j]=(f[i][j]+s*inv[j])%MOD;
        s=(s+f[i][j])%MOD;
      }
    if (i) v=v*(1LL+inv[i])%MOD;
  } 
  ll ans=0;
  for(int i=0;i<m;i++)
    ans=(ans+f[i][m]*facd[n-i-1]%MOD*facv[m-i-1])%MOD;
  ans=ans*facd[m]%MOD;
  printf("%lld\n",ans);
  return 0;
}

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


int main(){
	int a[100000];
	int i,n,max=0,z1=0,z2=0;

	string mozi;
	


	cin >> mozi;

	size_t size = mozi.size();
	n = size;
	

	for (i = 0; i < n; i++) {
		a[i]=(int(mozi[i]-48));
	
    }

	for (i = 0; i < n; i++) {
		if (i % 2 != a[i]) {
			z1++;

		}

		if ((i+1) % 2 != a[i]) {
			z2++;

		}
	}
	if (z1 < z2)cout << z1;
	else cout << z2;


	return 0;
	}

Measured memory_bytes: 896
#include <iostream>
#include <utility>
#include <map>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <array>
#include <math.h>
#include <numeric>
#include <sstream>
#include <queue>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
int main(int argc, char const *argv[]) {
    string s;
    string t;
    cin >> s >> t;
    int n = s.length();
    bool a[26][26];
    bool b[26][26];
    REP(i,26) REP(j,26) a[i][j] = b[i][j] = false;
    REP(i,n) a[s[i]-'a'][t[i]-'a'] = true;
    REP(i,n) b[t[i]-'a'][s[i]-'a'] = true;
    REP(i,26) {
        int ca = 0;
        int cb = 0;
        REP(j,26) {
            if (a[i][j]) ca++;
            if (b[i][j]) cb++;
        }
        if (ca >= 2 || cb >= 2) {
            cout << "No" << std::endl;
            return 0;
        }
    }
    cout << "Yes" << std::endl;
    return 0;
}

Measured memory_bytes: 776
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cmath>
#include <iomanip>
#include <queue>
#include <list>
#include <stack>
#include <cctype>
#include <cmath>
#include <set>

using namespace std;

/* typedef */

typedef long long ll;

/* constant */

const int INF = 1 << 30;
const int MAX = 1000000;
const int mod = 1000000007;
const double pi = 3.141592653589;
/* global variables */

/* function */

/* main */
int main(){

    int n, k; cin >> n >> k;
    vector<double> E(n);
    double dice;
    for (int i = 0; i < n; i++) {
        cin >> dice;
        E[i] = (dice + 1.0) / 2.0;
    }

    double max_E = 0.0;
    for (int i = 0; i < k; i++) {
        max_E += E[i];
    }

    double tmp = max_E;
    for (int i = k; i < n; i++) {
        tmp += E[i];
        tmp -= E[i-k];
        max_E = max(max_E, tmp);
    }

    cout << fixed << setprecision(7) << max_E << '\n';

    return 0;
}


Measured memory_bytes: 1792
from sys import stdin
from fractions import gcd
def main():
    #入力
    readline=stdin.readline
    N=int(readline())
    A=list(map(int,readline().split()))
    A.insert(0,0)
    A.append(0)

    L=[0]*N
    R=[0]*N
    for i in range(1,N):
        L[i]=gcd(L[i-1],A[i])
    for i in range(N-2,-1,-1):
        R[i]=gcd(R[i+1],A[i+2])

    res=0
    for i in range(N):
        res=max(res,gcd(L[i],R[i]))
    print(res)

if __name__=="__main__":
    main()

Measured memory_bytes: 16204
#include <bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define COUT(x) cout<<(x)<<"\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define REP(i, n) for(int i=0;i<n;i++)
#define YES(x) cout<<(x?"YES":"NO")<<"\n"
#define Yes(x) cout<<(x?"Yes":"No")<<"\n"
#define dump(x) cout<<#x<<" = "<<(x)<<"\n"
#define endl "\n"
using G = vector<vector<int>>;
using M = map<int,int>;
using P = pair<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int,vector<int>,greater<int>>;
using V = vector<int>;
using ll = long long;
using edge = struct { int to; int cost; };
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; }
const int INF = 1e9;
const int mod = 1e9+7;
const ll LINF = 1e18;

struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

mint choose(int n, int a) {
  mint x = 1, y = 1;
  REP(i,a) {
    x *= n-i;
    y *= i+1;
  }
  return x / y;
}

int main() {
  IOS;
  int X,Y; cin >> X >> Y;
  /*
    (1a + 2b) = X
    (2a + 1b) = Y
    a = X - 2b
  */
  mint ans = 0;
  REP(b, 1000005) {
    int a = X - (2*b);
    if (a < 0) break;
    if (Y == (2*a) + b) {
      ans += choose(a+b, b);
    }
  }
  COUT(ans);
  return 0;
}

Measured memory_bytes: 3600
using System;

namespace cs
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var input = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
            var n = input[0];
            var l = input[1];
            
            int min = 101;
            int t;
            int minI = 0;
            int sum = 0;
            int azi;

            for(int i = 1; i <= n; i++){
                t = min;
                azi = l + i -1;
                min = Math.Min(min, Math.Abs(azi));
                
                if(t != min) minI = azi;
                sum += azi;

            }

            Console.WriteLine(sum - minI);
        }
    }
}


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

using namespace std;
#define ll long long
#define ld long double
#define mk make_pair
#define pb push_back
#define sz(a) (int)(a).size()
#define rep(i, a, b) for (int i = (a), _b = (b); i < _b; ++i)
#define frep(i, a, b) for (int i = (a), _b = (b); i <= _b; ++i)

typedef complex<ld> cplex;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef vector<ii> vii;
typedef vector<iii> viii;

const int inf = 1000000007;
const ll linf  = 1ll * inf * inf;
const int N = 50 + 7;
const int M = 31;
const int multipleTest = 0;

string s;

void solve() {
    cin >> s;
    for (int i = 0; i + 1 < s.size(); ++i) {
        if (s[i] == 'A' && s[i + 1] == 'C') {
            puts("Yes");
            return;
        }
    }
    puts("No");
}

int main() {
#ifdef _LOCAL_
    freopen("in.txt", "r", stdin);
//    freopen("out.txt", "w", stdout);
#endif
    int Test = 1;
    if (multipleTest) {
        cin >> Test;
    }
    for(int i = 0; i < Test; ++i) {
//        printf("Case #%d: ", i + 1);
        solve();
    }
#ifdef _LOCAL_
    cout<<"\n" << 1.0 * clock() / CLOCKS_PER_SEC <<endl;
#endif
}


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

int mat[110][110];
long long sum[110][110];

int main() {
    int n;
    cin >> n;
    for (int i=1; i<=n; ++i) {
        for (int j=1; j<=n; ++j) {
            cin >> mat[i][j];
        }
    }
    for (int i=0; i<=n; ++i) {
        for (int j=0; j<=n; ++j) {
            if (i == 0 || j == 0) {
                sum[i][j] = 0;
            } else {
                sum[i][j] = sum[i-1][j] + sum[i][j-1] - sum[i-1][j-1] + mat[i][j];
            }
        }
    }
    long long mx = -1000001;
    for (int i=1; i<=n; ++i) {
        for (int j=1; j<=n; ++j) {
            for (int k=i; k<=n; ++k) {
                for (int l=j; l<=n; ++l) {
                    long long area = sum[k][l] - sum[i-1][l] - sum[k][j-1] + sum[i-1][j-1];
                    mx = max(mx, area);
                }
            }
        }
    }
    cout << mx << endl;
    return 0;
}

Measured memory_bytes: 1284
using System;
using System.Linq;

namespace AtCoder
{
    class Program
    {
        static void Main()
        {
            int n = int.Parse(Console.ReadLine());
            var a = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
            int x4 = a.Count(i => i % 4 == 0);
            int x2 = a.Count(i => i % 2 == 0) - x4;
            n -= x2;
            if (x2 != 0)
                Console.WriteLine(Math.Ceiling(n / 2.0) <= x4 ? "Yes" : "No");
            else
                Console.WriteLine(n / 2 <= x4 ? "Yes" : "No");
        }
    }
}

Measured memory_bytes: 20576
#include<stdio.h>
int main(void)
{
	int d[100];
	int n,i,j,cnt;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&d[i]);
	}
	cnt=0;
	for(i=0;i<n-1;i++){
		if(d[i]>0){
			for(j=i+1;j<n;j++){
				if(d[i]==d[j]){
					cnt++;
					d[j]=0;
				}
			}
		}
	}
	printf("%d\n",n-cnt);
	return 0;
}


Measured memory_bytes: 128