akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
using namespace std;
#ifndef LOCAL
#define endl '\n'
#endif

#define fr(i, a, b) for(int i = a; i <= b; i++)
#define rf(i, a, b) for(int i = a; i >= b; i--)
#define pf push_front
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) (int)x.size()
#define lb lower_bound
#define ub upper_bound

typedef long long ll;
typedef long double f80;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

int pct(int x) { return __builtin_popcount(x); }
int pct(ll x) { return __builtin_popcountll(x); }
int bt(int x) { return 31 - __builtin_clz(x); } // floor(log2(x))
int bt(ll x) { return 63 - __builtin_clzll(x); } // floor(log2(x))
int cdiv(int a, int b) { return a / b + !(a < 0 || a % b == 0); }
ll cdiv(ll a, ll b) { return a / b + !(a < 0 || a % b == 0); }
int nxt_C(int x) { int c = x & -x, r = x + c; return (((r ^ x) >> 2) / c) | r; }
ll nxt_C(ll x) { ll c = x & -x, r = x + c; return (((r ^ x) >> 2) / c) | r; }

vector<int> get_bits(int mask) {
	vector<int> bb;
	while(mask) { int b = bt(mask); bb.pb(b); mask ^= (1 << b); }
	reverse(all(bb));
	return bb;
}

int get_mask(vector<int> v) {
	int mask = 0;
	for(int x : v) { mask ^= (1 << x); }
	return mask;
}

template<typename T>
void uniq(vector<T> &v) { sort(all(v)); v.resize(unique(all(v)) - v.begin()); }

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

ll rand(ll l, ll r){
	uniform_int_distribution<ll> uid(l, r);
	return uid(rng);
}

void sc() {}

template <typename Head, typename... Tail>
void sc(Head &H, Tail &... T) { cin >> H; sc(T...); }

#ifdef LOCAL
#define debug(...) cerr << "[L:" << __LINE__ << "][" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

// #ifndef LOCAL
// string to_string(__int128 x) {
// 	string s = "";
// 	bool neg = 0;
// 	if(x < 0) { s += "-"; neg = 1; x = -x; }
// 	if(!x) s += '0';
// 	while(x) {
// 		int rem = x % 10;
// 		s += to_string(rem);
// 		x /= 10;
// 	}
// 	reverse(s.begin() + neg, s.end());
// 	return s;
// }
// #endif

const int mod = 1e9 + 7; // 998244353;

int pwr(int a,ll b) {
	int ans = 1;
	while(b) {
		if(b & 1) ans = (ans * 1LL * a) % mod;
		a = (a * 1LL * a) % mod;
		b >>= 1;
	}
	return ans;
}

/*
	Lookout for overflows!!
	Check array sizes!!
	Clear before test cases!!
	Use the correct modulo!!
	Check for corner cases!!
	Are you forgetting something?!
	Read problem statement carefully!!!
*/

void solve() {
    int n;
    int ans = 0;
    sc(n);
    fr(i, 1, n) {
        int x;
        sc(x);
        ans += ((i & 1) & (x & 1));
    }
    cout << ans;
}

int main() {
	ios :: sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int t = 1;
	// cin >> t;
	for(int tt = 1; tt <= t; tt++) {
		solve();
	}
	return 0;
}

Measured memory_bytes: 3648
package main

import (
	"fmt"
	"sort"
)

func main() {
	var N int
	fmt.Scan(&N)

	v := make([]float64, N)
	for i := 0; i < N; i++ {
		fmt.Scan(&v[i])
	}

	sort.Float64s(v)

	ans := v[0]
	for _, v := range v {
		ans = (ans + v) / 2
	}

	fmt.Println(ans)
}


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

int main() {
  int cnt = 0;
  string S;
  cin >> S;

  if (S[0] == 'R') {
    cnt++;
    if (S[1] == 'R') {
      cnt++;
      if (S[2] == 'R') {
        cnt++;
      }
    } else {
      cnt = 1;
    }
  } else {
    cnt = 0;
    if (S[1] == 'R') {
      cnt++;
      if (S[2] == 'R') {
        cnt++;
      }
    } else {
      if (S[2] == 'R') {
        cnt++;
      }
    }
  }

  cout << cnt << endl;
}

Measured memory_bytes: 3628
num = gets.to_i;
aryNum = gets.split.map(&:to_i);

aryNum = aryNum.reverse;

for numIndex in 0..aryNum.length-1 do
	
	if numIndex == 0 then
		print aryNum[numIndex].to_s;
	else
		print " " + aryNum[numIndex].to_s;
	end
	
end

print "\r\n";

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

void solve() 
{
    int n;cin>>n;
    int a[n],b[n];
    REP(i,n)cin>>a[i];
    REP(i,n)cin>>b[i];
    int j=0,now=-1;
    REP(i,n){
        if(now!=a[i])j=0;
        if(a[i]==b[i]){
            for(;j<n;j++){
                if(a[i]!=a[j]&&a[i]!=b[j]){
                    swap(b[i],b[j]);
                    break;
                }
            }
            if(j==n){cout<<"No"<<endl;return;}
        }
        now=a[i];
    }
    cout<<"Yes"<<endl;
    REP(i,n)cout<<(i?" ":"")<<b[i];cout<<endl;
}

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

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

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
#define CLR(t,v) memset(t,(v),sizeof(t))
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<<endl;}
template<class T>void chmin(T&a,const T&b){if(a>b)a=b;}
template<class T>void chmax(T&a,const T&b){if(a<b)a=b;}


int nextInt() { int x; scanf("%d", &x); return x;}

int main2() {
  int N = nextInt();
  int M = nextInt();

  vector<int> ds;
  for (int d = 1; d * d <= M; d++) {
    if (M % d == 0) {
      ds.push_back(d);
      if (d * d != M) ds.push_back(M / d);
    }
  }
  sort(ALL(ds));
  int L = 0;
  for (int d : ds) {
    if (N <= d) {
      L = d;
      break;
    }
  }
  cout << M / L << endl;
  return 0;
}

int main() {
  for (;!cin.eof();cin>>ws)
    main2();
  return 0;
}


Measured memory_bytes: 256
// A.

#include <iostream>
#include <sstream>
#include <algorithm>
#include <vector>

using namespace std;

int main(int argc, char* argv[]) {
	int a, b, c;
	cin >> a >> b >> c;
	cout << (a + b + c >= 22 ? "bust" : "win") << endl;
	return 0;
}


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

using namespace std;
using ll  = long long;
using ii  = pair < int , int >;
using i3  = pair < int , ii >;
using vi  = vector < int >;
using vii = vector < ii >;
using vi3 = vector < i3 >;

const int N = 1e5 + 5;
const ll INF = 1e12;
const double eps = 1e-9 , PI = acos(-1);

int n , m;
int a[N];


void solve(){
    scanf("%d" , &n);
    for(int i = 0 ; i < n ; i ++){
        scanf("%d" , &a[i]);
    }

    sort(a , a + n);
    int mn = a[n/2-1];
    int mx = a[n/2];

    printf("%d\n" , mx - mn);

}

main(){
    int t = 1;
    //scanf("%d" , &t);

    while( t -- ){
            solve();
    }

    return 0;
}




Measured memory_bytes: 640
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder
{
    class Program
    {
        static void Main()
        {
            Solve();

            Console.ReadKey();
        }

        static void Solve()
        {
            var str = IO.GetIntList();
            var ans = Math.Min(str[0] * str[1], str[2]);


            Console.Write(ans);
        }
    }


    static class IO
    {
        static public string GetString() { return Console.ReadLine(); }
        static public int GetInt() { return int.Parse(Console.ReadLine()); }
        static public long GetLong() { return long.Parse(Console.ReadLine()); }
        static public List<string> GetStringList() { return Console.ReadLine().Split(' ').ToList(); }
        static public List<int> GetIntList() { return Console.ReadLine().Split(' ').Select(int.Parse).ToList(); }
        static public List<long> GetLongList() { return Console.ReadLine().Split(' ').Select(long.Parse).ToList(); }
        static public List<double> GetDoubleList() { return Console.ReadLine().Split(' ').Select(double.Parse).ToList(); }
        static public void WriteStrings<T>(IEnumerable<T> values) { foreach (var o in values) { Console.Write(o + " "); } }
    }
}

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

const int MAXN = 200010;
int nxt[MAXN][26], f[MAXN], n;
char buf[MAXN];
int main() {
	std::ios_base::sync_with_stdio(false), std::cin.tie(0);
	std::cin >> buf + 2; n = strlen(buf + 2);
	f[n + 2] = 1;
	for (int i = n + 1; i; --i) {
		memcpy(nxt[i], nxt[i + 1], 104);
		nxt[i][buf[i + 1] - 'a'] = i + 1;
		f[i] = 0x3f3f3f3f;
		for (int j = 0; j < 26; ++j)
			f[i] = std::min(f[i], f[nxt[i][j]] + 1);
	}
	int x = 1;
	while (x) {
		for (int i = 0; i < 26; ++i) if (f[nxt[x][i]] + 1 == f[x]) {
			std::cout << (char) (i + 'a');
			x = nxt[x][i];
			break;
		}
	}
	std::cout << '\n';
	return 0;
}


Measured memory_bytes: 21632
#include<iostream>
#include<algorithm>
void swap(int& x, int& y){
    int tmp = x;
    x = y;
    y = tmp;
}
int main(){
    int a, b, c;
    std::cin >> a >> b >> c;
    if(a>b) std::swap(a,b);
    if(b>c) std::swap(b,c);
    if(a>b) std::swap(a,b);
    
    std::cout << a << " " << b << " " << c << std::endl;
    return 0;
}


Measured memory_bytes: 3088
import math
import copy
import sys
import bisect
input = sys.stdin.readline

def main():
    n=int(input())
    a = list(map(int,input().split()))
    b = list(map(int,input().split()))
    c = list(map(int,input().split()))
    a.sort()
    c.sort()
    ans=0
    for x in b:
        ans += bisect.bisect_left(a, x) * (n - bisect.bisect_right(c, x))
    print(ans)
if __name__ == "__main__":
    main()

Measured memory_bytes: 97372
import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        long[] arr = new long[n];
        for (int i=0; i<n; i++) arr[i] = sc.nextLong();
        long[] dp = new long[n];
        Arrays.fill(dp, 1000000000);
        if (k >= n) {
            System.out.println(Math.abs(arr[n-1]-arr[0]));
        } else {
            for (int i=0; i<=k; i++) {
                dp[i] = Math.abs(arr[i] - arr[0]);
            }
            for (int i=k+1; i<n; i++) {
                for (int j=i-1; j>=(i-k); j--) {
                    dp[i] = Math.min(dp[i], dp[j]+Math.abs(arr[i]-arr[j]));
                }
            }
            System.out.println(dp[n-1]);
        }
    }
}

Measured memory_bytes: 60832
from itertools import combinations
n=int(input())
name=[0]*5
march=['M','A','R','C','H']
for i in range(n):
  s=input()
  if s[0] in march:
    name[march.index(s[0])]+=1
sm=0
for i,j,k in list(combinations(name,3)):
  sm+=i*j*k
print(sm)

Measured memory_bytes: 74756
#define _USE_MATH_DEFINES

#include <vector>
#include <list>
#include <map>
#include <string>
#include <iostream>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <utility>
#include <ctgmath>
#include <queue>
#include <set>

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;

const ll inf = 10e17;
const ll mod = inf;//1000000007;
const ld eps = 10e-9;



ll solve(void);
ll gcd(ll x, ll y);


ll mulmod(ll x, ll y)
{
	return (x * y) % mod;
}

ll submod(ll x, ll y)
{
	return (x - y + 100 * mod) % mod;
}

ll power(ll n, ll r)
{
	if ( r == 0 ) { return 1; }
	if ( r == 1 ) { return n; }
	if ( n == 0 ) { return 0; }
	if ( n == 1 ) { return 1; }

	if (r % 2 == 0)
	{
		ll y = power(n, r/2);
		return mulmod(y, y);
	}
	else
	{
		ll y = power(n, (r-1)/2);
		return n * mulmod(y, y) % mod;
	}
}

ll gcd(ll x, ll y)
{
	if (y == 1) { return 1;}
	if (x % y == 0) { return y; }
	return gcd(y, x % y);
}

vector<ll> perm;
vector<ll> inv;
void init_inv(ll m)
{
	perm.resize(m);
	inv.resize(m);
	
	perm[0] = 1;
	inv[0] = 1;

	for (ll i = 1; i < m; i++)
	{
		perm[i] = mulmod(perm[i-1], i);
	}
	
	for (ll i = 1; i < m; i++)
	{
		inv[i] = power(perm[i], mod - 2);
	}
}

ll ncr(ll n, ll r)
{
	// n (n-1) ... (n-r)
	if ( r == n || r == 0 ) { return 1; }

	ll ans = 1;
	//for (ll i = 0; i < r; i++)
	//	ans = mulmod(ans, n - i);

	ll p = 1;
	for (ll i = n - r + 1; i <= n; i++)
		p *= i;
	ll q = 1;
	for (ll i = 1; i <= r; i++)
		q *= i;

	return p / q;
	// return mulmod(ans, inv[r]);
	// return mulmod(perm[n], mulmod(inv[n-r], inv[r]));
}

bool binary_check(ll mid, ll key)
{
	return mid >= key;
}

ll binary_search()
{
	ll n, k;
	cin >> n >> k;

	ll ng = 0;
	ll ok = n;

	while (abs(ok - ng) > 1)
	{
		ll mid = (ok+ng) / 2;
		if (binary_check(mid, k)) ok = mid;
		else ng = mid;
	}

	return ok;
}

string s;
ll k, l;


ll calc(ll digit, ll k, bool smaller)
{
	if (digit == l) {
		if (k == 0) return 1;
		else return 0;
	}
	if (k == 0) return 1;
	if (smaller) 
	{
		return ncr(l - digit, k) * power(9, k);
	}
	if(s[digit] == '0') return calc(digit+1, k, false);
	ll zero = calc(digit + 1, k, true);
	ll bet  = calc(digit + 1, k - 1, true) * (s[digit] - 1 - '0');
	ll giri = calc(digit + 1, k - 1, false);
	return zero + bet + giri;
}

ll solve(void)
{
	init_inv(1000);
	cin >> s;
	cin >> k;
	l = s.length();

	cout << calc(0, k, false) << endl;
	return 0;
}

int main(void)
{
	while (solve())
	{
	}
	return 0;
}


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

using namespace std; 
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>; 

#define INF INT_MAX/2 //(1<<(4*4-1))
#define MOD 10007
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()

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


  int N;
  cin>>N;
  vector<double>x(N);
  vector<string>u(N);
  for(int i=0;i<N;i++)cin>>x[i]>>u[i];
  int a=380000;

  double ans=0;
  for(int i=0;i<N;i++){
    if(u[i]=="JPY")ans+=x[i];
    else ans+=x[i]*a;
  }
  cout<<fixed<<setprecision(10)<<ans<<endl;
  return 0;
}


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

using namespace std;

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

#define MOD 1000000007
#define REP(i, N) for (int i = 0; i < N; ++i)
#define REP1(i, N) for (int i = 1; i <= N; ++i)
#define RREP(i, N) for (int i = N - 1; i >= 0; --i)
#define ALL(a) a.begin(), a.end()

int main()
{
  int N, M;
  cin >> N >> M;
  vector<int> s[10];
  REP(i, M)
  {
    int k;
    cin >> k;
    REP(j, k)
    {
      int ss;
      cin >> ss;
      ss--;
      s[i].push_back(ss);
    }
  }
  int p[10];
  REP(i, M)
  cin >> p[i];
  int ans = 0;
  // スイッチのon/offの組み合わせを全部試す
  for (int mask = 0; mask < (1 << N); ++mask)
  {
    bool ok = true; // 全ての電球が点灯するか否か
    REP(i, M)       // 電球iを全部試す
    {
      int count = 0;      // 電球iに繋がっているスイッチのうちonになっているスイッチの個数
      REP(j, s[i].size()) // 電球iに繋がっているスイッチを全部確認
      {
        if ((mask >> s[i][j]) & 1)
          count++;
      }
      if (count % 2 != p[i]) // 電球iが点灯しなかった場合
        ok = false;
    }
    if (ok)
      ans++;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
int main() {
  int h1, h2, m1, m2, k;
  cin >> h1 >> m1 >> h2 >> m2 >> k;
  cout << (h2 - h1) * 60 + m2 - m1 - k << endl;
  return 0;
}

Measured memory_bytes: 3548
#include <bits/stdc++.h>
#define mset(arr, val) memset(arr, val, sizeof(arr))
#define ll long long
#define endl "\n"
using namespace std;
// const double PI = acos(-1.0);
// const double E = exp(1.0);
// const double EPS = 1e-9;
const int MOD = (int)1e9 + 7;
const int N = (int)1e5;

int main()
{
#ifdef MY_PREPROCESSOR
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    int64_t a, b, x;
    cin >> a >> b >> x;
    int64_t ans = (b / x) - (a / x);
    if (a % x == 0)
        ans++;
    cout<< ans;
    
    return 0;
}

Measured memory_bytes: 3572
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()

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

#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin>>n;
  
  vector<int> vec(n);
  rep(i,n) cin>>vec[i];
  
  int c=0;
  
  for(int i=1;i<n-1;i++){
    if(vec[i-1]<vec[i] && vec[i]<vec[i+1]) c++;
    if(vec[i-1]>vec[i] && vec[i]>vec[i+1]) c++;
  }
  
  cout << c <<endl;
  
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;


int main()
{
    ll n; // number of attendee
    ll d; // number of day
    ll x; // number of chocolate left
    cin >> n >> d >> x;
    REP(i, n) {
        ll interval = 0;
        cin >> interval;
        x += (d - 1) / interval + 1;
    }
    cout << x << endl;
    return 0;
}

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

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
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; }
const int INF = (1<<30) - 1;
const ll LINF = (1LL<<60) - 1;

int main(){
    string s;
    cin >> s;
    if (s == "Sunny") cout << "Cloudy" << endl;
    else if (s == "Cloudy") cout << "Rainy" << endl;
    else cout << "Sunny" << endl;
}

Measured memory_bytes: 3500
fn getline() -> String{
  let mut __ret=String::new();
  std::io::stdin().read_line(&mut __ret).ok();
  return __ret;
}

fn main() {
  let line = getline();
  let n:u32 = line.trim().parse().unwrap();
  let temp_l1 = getline();
  let l1:Vec<char> = temp_l1.chars().collect();
  let temp_l2 = getline();
  let l2:Vec<char> = temp_l2.chars().collect();
  
  let mut pos:u32;
  let mut ans:i64;
  let mut prev:i64;
  let modulo:i64 = 1000000007;
  if l1[0] == l2[0] {
    ans = 3;
    pos = 1;
    prev = 1;
  } else {
    ans = 6;
    pos = 2;
    prev = 2;
  }
  while pos < n {
    let color;
    if l1[pos as usize] == l2[pos as usize] {
      color = 3 - prev;
      prev = 1;
      pos += 1;
    } else {
      if prev == 1 {
        color = 2;
      } else {
        color = 3;
      }
      prev = 2;
      pos += 2;
    }
    // println!("{} {} {}", ans, color, pos);
    ans = color * ans % modulo
  }
  println!("{}", ans);
}

Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
// const bool debug=true;
const bool debug=false;
#define DEBUG if(debug==true)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll MOD = 1000000007;

int main(void) {
    ll n,k;
    cin >> n >> k;
    vector<ll> minus,plus;
    minus.push_back(0);
    plus.push_back(0);
    rep(i,n){
       ll tmp;
       cin >> tmp;
       if(tmp<0)minus.push_back(tmp);
       else plus.push_back(tmp); 
    }
    sort(minus.begin(),minus.end(),greater<ll>());
    ll res = 1LL<<60;
    for(int i=0;i<=k;i++){
        DEBUG{
            cout << res << endl;
        }
        if(i>minus.size()-1||k-i>plus.size()-1)continue;
        res = min(res, plus[k-i]-minus[i]+min(plus[k-i],minus[i]*-1));
    }
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 1656
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please


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


	int N;
	cin >> N;
	int A[200001];
	rep1(i, N) cin >> A[i];

	vector<int> kotae;
	int B[200001] = {};
	for (int i = N; i > 0; i--) {
		if (A[i] != B[i]) {
			cesp(i);
			cesp(A[i]);
			ce(B[i]);
			kotae.pb(i);
			int rt = sqrt(i);
			rep1(j, rt) {
				if (i % j == 0) {
					B[j] ^= 1;
					if(i != j * j) B[i / j] ^= 1;
				}
			}
		}
	}
	co(kotae.size());
	rep1(i, kotae.size()) {
		cosp(kotae[kotae.size() - i]);
	}

	Would you please return 0;
}

Measured memory_bytes: 3192
n,m=gets.split.map &:to_i
a=[*1..200].select{|i|i%2==0}
b=[*1..200].select{|i|i%2!=0}
na = n==0 ? nil : a[0..n-1]
nb = m==0 ? nil : b[0..m-1]
if na.nil?
  nn=nb
elsif nb.nil?
  nn=na
else
  nn=na+nb
end
puts nn.combination(2).map{|i|i.inject(:+)}.select{|i|i%2==0}.size


Measured memory_bytes: 2172
N = int(input())
CSF = []
for i in range(N-1):
    CSF.append(list(map(int,input().split())))

for i in range(N):
    if i == N-1:
        print(0)
    else:
        ans = CSF[i][1]+CSF[i][0]
        for j in range(i+1,N-1):
            if ans < CSF[j][1]:
                ans = CSF[j][1]
            elif ans%CSF[j][2] != 0:
                ans += (CSF[j][2]-ans%CSF[j][2])
            ans += CSF[j][0]
        print(ans)

Measured memory_bytes: 3188
#include <bits/stdc++.h>
#define all(x) begin(x), end(x)
#define dbg(x) cerr << #x << " = " << x << endl
#define _ << ' ' <<
using namespace std;
using ll = long long;
using vi = vector<int>;


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

    if (s[2] == s[3] && s[4] == s[5])
        cout << "Yes";
    else
        cout << "No";
}


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

s = input()

ans = set()
for i in range(10):
    a = s.find(str(i))
    if a == -1:
        continue
    for j in range(10):
        b = s.find(str(j), a+1)
        if b == -1:
            continue
        for k in range(10):
            if s.find(str(k), b+1) != -1:
                ans.add(str(i)+str(j)+str(k))
print(len(ans))


Measured memory_bytes: 38436
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  ll a, b;
  string s;
  in2(a, b);
  if(a == 2 || b == 2)
    s = "No";
  else if(a == 4 || a == 6 || a == 9 || a == 11){
    if(b == 4 || b == 6 || b == 9 || b == 11)
      s = "Yes";
    else
      s = "No";
  }
  else{
    if(b == 4 || b == 6 || b == 9 || b == 11)
      s = "No";
    else
      s = "Yes";
  }
  out(s);
  memi;
}

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

int main()
{
    int N; cin>>N;
    double p[N+1];
    p[0] = 0.0;
    for(int i=1;i<=N;i++)
        cin>>p[i];
    double dp[N+1][N+1];
    memset(dp,0,sizeof(dp));
    dp[0][0] = 1;
    for(int i=1;i<=N;i++)
    {
        for(int j=0;j<=i;j++)
        {
            if(j==0)
                dp[i][j] = dp[i-1][j] * (1-p[i]);
            else
            {
                  dp[i][j] = dp[i - 1][j]*(1.0 - p[i]) 
                           + dp[i - 1][j - 1] * p[i]; 
            }
            
        }
    }
    double ans = 0.0; 
  
    for (int i = (N + 1) / 2; i <= N; i += 1) 
        ans += dp[N][i]; 
    printf("%0.10f", ans);  
    // cout<<ans<<endl;
    return 0;
  

}

Measured memory_bytes: 70528
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <stack>
#include <functional>

#ifdef LOCAL
    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
    #define eprintf(...) 42
#endif

#define rep_(i, a_, b_, a, b, ...) for (int i = (a), i##_len = (b); i < i##_len; ++i)
#define rep(i, ...) rep_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define reprev_(i, a_, b_, a, b, ...) for (int i = (b-1), i##_min = (a); i >= i##_min; --i)
#define reprev(i, ...) reprev_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define all(x) (x).begin(), (x).end()
template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int,int> P;
typedef long double ld;

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, p; cin >> n >> p;
    string s; cin >> s;
    if (p != 2 && p != 5) {
        ll now = 1;
        vector<ll> k(n);
        reprev (i, n) {
            k[i] = ((ll)(s[i] - '0') * now) % p;
            now = (now * 10) % p;
        }
        rep (i, n) eprintf("%lld ", k[i]); eprintf("\n");
        map<ll, int> m;
        m[0]++;
        ll sum = 0;
        reprev (i, n) {
            sum = (k[i] + sum) % p;
            eprintf("%lld ", sum);
            m[sum]++;
        }
        eprintf("\n");
        ll ans = 0;
        for (auto i : m) {
            eprintf("%lld:%d ", i.first, i.second);
            ans += (ll)i.second * (i.second - 1LL) / 2LL;
        }
        eprintf("\n");
        cout << ans << "\n";
    } else {
        ll ans = 0;
        reprev (i, n) {
            if ((int)(s[i] - '0') % p == 0) ans += (ll)i + 1LL;
        }
        cout << ans << "\n";
    }
    return 0;
}

Measured memory_bytes: 2580
// By Mohit Gupta
#include <bits/stdc++.h>
using namespace std;
#define printint(v) copy(begin(v), end(v), ostream_iterator<int>(cout," "))
#define printintv(s,e) copy(s,e, ostream_iterator<int>(cout," "))
#define forstl(i,v) for(auto &i: v)
#define forn(i,e) for(int i = 0; i < e; i++)
#define forsn(i,s,e) for(int i = s; i < e; i++)
#define rforn(i,s) for(int i = s; i >= 0; i--)
#define rforsn(i,s,e) for(int i = s; i >= e; i--)
#define clz(a) __builtin_clz(a) // count leading zeroes
#define ctz(a) __builtin_ctz(a) // count trailing zeroes
#define popc(a) __builtin_popcount(a) // count set bits (for ints only diff for ll)
//https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html for other in built
#define ln "\n"
#define dbg(x) cout<<#x<<" = "<<x<<ln
#define pb push_back
#define fi first
#define se second
#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef long long ll;
typedef pair<int,int> p32; 
typedef pair<ll,ll> p64;
typedef pair<double,double> pdd;
typedef vector<ll> v64;
typedef vector<int> v32;
typedef vector<vector<int> > vv32;
typedef vector<p64> vp64;
typedef vector<p32> vp32;
typedef map<int,int> m32;
#pragma GCC optimize ("-O2")
const int LIM = 5e5+5, MOD = 998244353;
int t,n,m,k,x,y;
 
 
int32_t main()
{
	IOS;
	double pi = 3.1415926535;
	int r;
	cin>>r;
	cout<<2.0*pi*r<<ln;
}


Measured memory_bytes: 3768
#include <stdio.h>
int main(){
char S, A, B;
scanf("%s=c", &S, &A, &B);
if(S, A != B){printf("Yes\n");}
else if(S, B != A){
printf("Yes\n");
}else if(A, B != S){
printf("Yes\n");
}else if( S == A, A == B){
printf("No\n");
}
return 0;
}

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

vector<int> a(3);
vector<int> s(4,0);
int n;
int dfs(int i,vector<int> &l,int t,int cost){//i番目のlをt番目に合成
	if(i==n){
		int res = cost;
		bool flag = false;
		for(int j=0;j<3;j++){
			res += abs(a[j]-s[j]);
			if(s[j] ==0) flag = true;
		}
		if(flag) return 1e9;
		else return res;
	}
	int res = 1e9;
	s[t] += l[i];//合成
	if(t!=3)cost+=10;
	for(int j = 0;j<4;j++){
		res = min(res,dfs(i+1,l,j,cost) );
	}
	s[t] -=l[i];
	return res;
}

int main(){
cin>>n>>a[0]>>a[1]>>a[2];
vector<int> l(n);
for(int i=0;i<n;i++)cin>>l[i];
	int ans = 1e9;
	ans =  min(ans,dfs(0,l,0,0) );
	ans =  min(ans,dfs(0,l,1,0) );
	ans =  min(ans,dfs(0,l,2,0) );
	ans =  min(ans,dfs(0,l,3,0) );
	cout<<ans-30<<endl;
	return 0;
}


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

using namespace std;

int main(void) {
  int n; cin >> n;
  multiset<int> mtr;
  
  for (int i = 0; i < n; i++) {
    int j; cin >> j;
    mtr.insert(j);
  }

  int bf, af = 0;
  double ans = 0.0;
  for (auto it = mtr.begin(); it != mtr.end(); it++) {
    bf = af;
    af = *it;
    if (bf == 0) {
      continue;
    }
    if (ans - 0.0 < DBL_EPSILON) {
      ans = (bf + af) / 2.0;
    } else {
      ans = (ans + af) / 2.0;
    }
    
  }

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    int n,k;cin>>n>>k;int a[n];
    for(int i=0;i<n;i++)cin>>a[i];
    sort(a,a+n,greater<int>());
    ll ans = 0;
    for(int i=min(n,k);i<n;i++)
        ans+=a[i];
    cout<<ans;
    return 0;
}


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

#define ll long long
#define INF_LL 1LL << 60
#define INF 99999999
#define MOD (ll)1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define REP(i, a, n) for(int i = a; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

void put_double(double obj){printf("%.12f\n",obj);};

template < typename T > std::string to_string( const T& n )
{
    std::ostringstream stm ;
    stm << n ;
    return stm.str() ;
}

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


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

    rep(i, 5) cout << s[i];
    cout << " ";
    REP(i, 6, 13) cout << s[i];
    cout << " ";
    REP(i, 14, s.size()) cout << s[i];
    cout << endl;
}


Measured memory_bytes: 256
#import<bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long LL;
LL i,j,k,l,m,n,p=1,q=1e9+7,v,w,x,y,z,a[200040],b[200040];
int C(LL a,LL b){return labs(a)>labs(b);}
LL P(LL x,LL y)
{
	LL i=q-2,v=x;
	for(;i;i>>=1)
	{
		if(i&1)
		{
			v=v*y%q;
		}
		y=y*y%q;
	}
	return v;
}
main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin>>n>>k;
	for(;i<n;i++)
	{
		cin>>a[i];
		if(a[i]>0)x++;
	}
	if(k<2)
	{
		sort(a,a+n);
		cout<<(a[n-1]+q)%q;
	}
	else if(k==n)
	{
		for(i=0;i<k;i++)p=p*(a[i]+q)%q;
		cout<<p;
	}
	else if(!x)
	{
		sort(a,a+n);
		if(k%2)
		{
			for(i=0;i++<k;)p=p*(a[n-i]+q)%q;
		}
		else
		{
			for(i=0;i<k;i++)p=p*(a[i]+q)%q;
		}
		cout<<p;
	}
	else
	{
		sort(a,a+n,C);
		for(i=x=0;i<k;i++)
		{
			if(a[i]>0)
			{
				x++;
				p=p*a[i]%q;
			}
			else if(a[i]<0)
			{
				y++;
				p=p*(a[i]+q)%q;
			}
			else
			{
				cout<<0;
				return 0;
			}
		}
		if(y%2)
		{
			for(v=k-1;a[v]>0;)v--;
			for(w=k;a[w]<0;)w++;
			for(x=k-1;~x&&a[x]<0;)x--;
			for(y=k;a[y]>0;)y++;
			if(a[w]*a[x]>a[y]*a[v]||x<0)
			{
				cout<<P(p*a[w]%q,a[v]+q);
			}
			else
			{
				cout<<P(p*(a[y]+q)%q,a[x]);
			}
		}
		else cout<<p;
	}
}

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

int main(){
	string S;
	cin >> S;
	int LS = S.size();
	int k = 2;
	int ans = 1000;
	while (k<LS) {
		int tmp = stoi(S.substr(k-2,3));
		int l = abs(tmp-753);
		ans = min(ans, l);
		k++;
	}

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


Measured memory_bytes: 3632
#pragma GCC optimize(2)
#include<bits/stdc++.h>
#define ll long long
#define maxn 2000005
#define inf 1e18
#define pb push_back
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=a;i>=b;i--)
using namespace std;

inline int read()
{
	int x=0,w=1; char c=getchar();
	while(c<'0'||c>'9') {if(c=='-') w=-1; c=getchar();}
	while(c<='9'&&c>='0') {x=(x<<1)+(x<<3)+c-'0'; c=getchar();}
	return w==1?x:-x;
}

ll n,a[maxn],b[maxn],tot,mn;

int main()
{
	n=read(); rep(i,1,n) a[i]=read(),b[i]=read(),tot+=a[i]; mn=inf;
	rep(i,1,n) if(a[i]>b[i]) mn=min(mn,b[i]);
	if(mn==inf) return puts("0"),0;
	printf("%lld\n",tot-mn);
	return 0;
}

Measured memory_bytes: 4032
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{

	public static void main(String[] args) {
		//Scanner sc = new Scanner(System.in);
		//int n= Integer.parseInt(sc.next());
		//System.out.println(n);


		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


			String line = br.readLine();


			//String[] strs = line.split(" ");//区切りで変える

			int N = Integer.parseInt(line);
			String[] array = new String[3];

			for(int i = 0;i<array.length;i++) {
				array[i] = br.readLine();
			}

			int ans_count = 0;
			for(int i = 0;i<N;i++) {
				char a = array[0].charAt(i);
				char b = array[1].charAt(i);
				char c = array[2].charAt(i);

				int temp = 0;

				if(a==b) {
					temp++;
				}
				if(b==c) {
					temp++;
				}
				if(a==c) {
					temp++;
				}

				switch(temp) {
				case 0:
					ans_count +=2;
					break;
				case 1:
				case 2:
					ans_count++;
					break;
				case 3:
					break;

				}


			}

			System.out.println(ans_count);


		} catch (IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}


	}

}


Measured memory_bytes: 20564
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}
use std::collections::HashMap;
use std::cmp::{max,min};
fn main(){
    input!{
        s:chars,
        t:chars,
    }
    let mut ans = true;
    let mut map = HashMap::new();
    for j in 0..s.len() {
        if let Some(&x) = map.get(&s[j]){
            if x != t[j] {
                ans = false;
                break;
            }
            continue;
        }
        map.insert(s[j],t[j]);
    }
    map = HashMap::new();
    for j in 0..t.len() {
        if let Some(&x) = map.get(&t[j]){
            if x != s[j] {
                ans = false;
                break;
            }
            continue;
        }
        map.insert(t[j],s[j]);
    }
    println!("{}",if ans {"Yes"} else {"No"});
}


Measured memory_bytes: 6396
import java.io.*;
import java.util.*;

public class Main {

	final static long MOD = 1000000007;
	public static String[] Ws = null;
	public static int wsIndx = 0;
	public static BufferedReader in = null;
	public static void main(String[] args) throws Exception {
		solution(args);
		if(in!=null){
			in.close();
		}
	}

	public static void solution(String[] args) throws Exception{


		System.out.printf("ABC%03d\n",nextInt());

	}

	public static boolean isPalindromicStr(String s) {
		int h = 0;
		int t = s.length() - 1;
		while (h <= t) {
			if (s.charAt(h) != s.charAt(t)) {
				break;
			}
			h++;
			t--;
		}
		if (h > t) {
			return true;
		}
		return false;
	}
	public static String[] toStringArray(String s) {
		String[] tmp = new String[s.length()];
		char[] c = s.toCharArray();
		for (int i = 0; i < tmp.length; i++) {
			tmp[i] = String.valueOf(c[i]);
		}
		return tmp;
	}

	public static void check() throws Exception{
		if(in == null){
			in = new BufferedReader(new InputStreamReader(System.in));
		}
		if(Ws==null || Ws.length<=wsIndx){
			Ws = in.readLine().split(" ");
			wsIndx=0;
		}
	}
	public static int nextInt()throws Exception{
		check();
		return Integer.parseInt(Ws[wsIndx++]);
	}

	public static long nextLong()throws Exception{
		check();
		return Long.parseLong(Ws[wsIndx++]);
	}

	public static String nextString()throws Exception{
		check();
		return Ws[wsIndx++];
	}

	public static int[] nextInts()throws Exception{
		check();
		int[] tmp = new int[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Integer.parseInt(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static long[] nextLongs()throws Exception{
		check();
		long[] tmp = new long[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Long.parseLong(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static String[] nextStrings()throws Exception{
		check();
		wsIndx=Ws.length;
		return Ws;
	}


}


Measured memory_bytes: 22740
N,Q = gets.split.map &:to_i
S = gets.chomp.chars.map{ |c| c.intern }
QS = (0...Q).map{ 
  t,d = gets.split
  [t.intern, d == "L" ? -1 : +1]
}

i0 = (0...N).bsearch{ |i|
  k = i
  ans = true
  QS.each{ |t,d|
    next if S[k] != t
    k += d
    if k < 0
      ans = false
      break
    end
    if N <= k
      ans = true
      break
    end
  }
  ans
} || N

i1 = (0...N).bsearch{ |i|
  k = i
  ans = false
  QS.each{ |t,d|
    next if S[k] != t
    k += d
    if k < 0
      ans = false
      break
    end
    if N <= k
      ans = true
      break
    end
  }
  ans
} || N

p i1-i0


Measured memory_bytes: 29564
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define uli unsigned long long int
#define INF 999999999999999999
#define rep(i,m,n) for(lli i = m;i < n;i++)
#define rrep(i,m,n) for(lli i=m-1;i>=n;i--)
#define pb(n) push_back(n)
#define UE(N) N.erase(unique(N.begin(),N.end()),N.end());
#define Sort(n) sort(n.begin(), n.end())
#define Rev(n) reverse(n.begin(),n.end())
#define Out(S) cout << S << endl
#define NeOut(S) cout << S
#define HpOut(S) cout << setprecision(25) << S << endl
#define Vec(K,L,N,S) vector<L> K(N,S)
#define DV(K,L,N,M,S) vector<vector<L>> K(N,vector<L>(M,S))
#define TV(K,L,N,M,R,S) vector<vector<vector<L>>> K(N,vector<vector<L>>(M,vector<L>(R,S)))
#define pint pair<lli,lli>
#define paf(L,R) pair<L,R>
#define mod 1000000007
#define MAX 510000
#define ALL(a)  a.begin(),a.end()
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
lli gcd(lli num1, lli num2){
    return num2 != 0 ? gcd(num2, num1 % num2) : num1;
}
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  lli A,B,C,D,E,F,N,M,K,L,X,Y,Z,H,W,sum=0,num=0,flag=0;string S,T;
  cin >> N >> M;
  Vec(is,bool,N,1);
  rep(i,0,M){
    cin >> A;
    is[A-1]=0;
  }
  Vec(DP,lli,N,0);
  if(is[0])DP[0]=1;
  if(is[1])DP[1]=DP[0]+1;
  rep(i,2,N){
    if(is[i-1])DP[i]+=DP[i-1];
    if(is[i-2])DP[i]+=DP[i-2];
    DP[i]%=mod;
  }
  Out(DP[N-1]%mod);
}

Measured memory_bytes: 1024
#include<stdio.h>

int main(void)
{
	long long int n, m;
	long long int ans;
	scanf("%lld %lld", &n, &m);

	if (n >= m/2) { 
		ans = m / 2;
	}
	else { 
		ans = n + (m - 2 * n) / 4;
	}
	printf("%lld\n", ans);
	return 0;
}

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

int main() {
  int n; cin >> n;
  map<string, int> mp;
  for (int i = 0; i < n; i ++) {
    string s; cin >> s;
    mp[s] ++;
  }

  cout << mp.size() << endl;
}


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

using namespace std;

typedef long long ll;

vector<int> x;

int main(int, char**)
{
	ll a, b, k, ans = 0;
	string s;
	cin >> a >> s >> k;

	for (int i = 0; i < s.length(); i++) {
		if (s[i] != s[k-1]) cout << '*';
		else cout << s[i];
	}
	cout << endl;

	return 0;
}
 

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

using namespace std;
 
/// ----------------------------- (Debug) ------------------------------
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; }; sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0); sim > char dud(...);
struct debug {
#ifndef ONLINE_JUDGE
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i));}
sim, class b dor(pair < b, c > d) {ris << "(" << d.first << ", " << d.second << ")";}
sim dor(rge<c> d) {*this << "["; for (auto it = d.b; it != d.e; ++it) *this << ", " + 2 * (it == d.b) << *it; ris << "]";}
#else
sim dor(const c&) { ris; }
#endif
};
vector<char*> tokenizer(const char* args) {
	char *token = new char[111]; strcpy(token, args); token = strtok(token, ", ");
	vector<char*> v({token});
	while(token = strtok(NULL,", ")) v.push_back(token);
	return reverse(v.begin(), v.end()), v;
}
void debugg(vector<char*> args) { cerr << "\b\b "; }
template <typename Head, typename... Tail>
void debugg(vector<char*> args, Head H, Tail... T) {
	debug() << " [" << args.back() << ": " << H << "] ";
	args.pop_back(); debugg(args, T...);
}
#define harg(...) #__VA_ARGS__
#ifndef ONLINE_JUDGE
#define dbg(...) { debugg(tokenizer(harg(__VA_ARGS__, \b\t-->Line)), __VA_ARGS__, __LINE__); cerr << endl;}
#else
#define dbg(...) { }
#endif
/// -----------------------------------------------------------------------
 
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi; 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)    
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define print(x) cout << x << "\n";
#define REP(i,a,b) for(i=a;i<=b;i++)
#define RAP(i,a,b) for(i=a;i>=b;i--)
#define spa <<" "<<
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)x.size()
ll mod=1e9+7;
const int MX=0x3f3f3f3f;

int main(){
	IOS;
	int n,i;
	cin>>n;
	int a[n];
	ll ans=0;
	REP(i,0,n-1) cin>>a[i];
	REP(i,1,n-1) {
		if(a[i-1]>a[i]) ans+=a[i-1]-a[i],a[i]=a[i-1];
	}
	cout<<ans;
	return 0;
}

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

using namespace std;

#define PB push_back
#define f first
#define s second
#define what_is(x) cerr << #x << " is " << x << endl;

typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;

ll eval(ll a, ll b) //how many times to split a such that each piece is <= b
{
    return max(0LL, (a+b-1)/b - 1);
}

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    ll n, k;
    cin >> n >> k;
    ll arr[n];
    for(int i=0; i<n; i++)
    {
        cin >> arr[i];
    }
    ll lo = 1, hi = 1000000000;
    while(lo < hi)
    {
        ll mid = (lo + hi)/2;
        bool ok = true;
        ll ctr = 0;
        //what_is(mid);
        for(int i=0; i<n; i++)
        {
            //what_is(arr[i]);
            //what_is(eval(arr[i], mid));
            ctr += eval(arr[i], mid);
        }
        ok &= (ctr <= k);
        if(ok)
        {
            hi = mid;
        }
        else
        {
            lo = mid + 1;
        }
    }
    cout << lo;
    return 0;
}


Measured memory_bytes: 5196
import java.util.*;
import java.lang.Math;
public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println(createString(sc.nextLine()));
        sc.close();
    }

    private static String createString(String ST) {
        String[] list = ST.split(" ");

        return list[1]+list[0];
    }
}

Measured memory_bytes: 21844
#include <iostream>
#include <string>
#include<stdlib.h>
#include <cassert>
using namespace std;
int main() {
	int x,y;cin>>x>>y;
	if(x==1&&y%2==!0)
		cout<<"No\n";
	else if(x%2==0 && y%2==!0)
		cout<<"No\n";
	else if(y<(2*x)||y>(4*x))
		cout<<"No\n";
	else if(y>=2*x&&y<=4*x)
		cout<<"Yes\n";




	return 0;
}


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

int main(){
  string s,t,u;
  int a,b;
  cin >> s >> t >> a >> b >> u;
  if(s == u){
    cout << a-1 << " " << b << endl;
  }
  else{
    cout << a << " " << b-1 << endl;
  }
}

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

using namespace std;

#define sz(x) (int)(x.size())
#define fr(i,a,b) for(int i=a;i<b;++i)
/////////////////////

vector<int> a, b;
int n, m;

void bad(){
	cout << "Impossible" << endl;
	exit(0);
}

void solve(){
	cin >> n >> m;
	a.resize(m);
	int cnt = 0;
	fr(i, 0, m){
		cin >> a[i];
		cnt += (a[i] % 2);
	}
	if(m == 1){
		cout << a[0] << endl;
		if(n > 1){
			cout << 2 << endl;
			cout << a[0] - 1 << " " << 1 << endl;
		}else{
			cout << 1 << endl;
			cout << a[0] << endl;
		}
		return;
	}
	if(cnt > 2) bad();
	fr(i, 0, m) if(a[i] % 2 == 1){
		swap(a[i], a[0]);
		break;
	}
	fr(i, 1, m) if(a[i] % 2 == 1){
		swap(a[i], a[m-1]);
		break;
	}
	b = a;

	b[0] += 1;
	b.back() -= 1;
	if(b.back() == 0) b.pop_back();
	fr(i, 0, m) cout << a[i] << " ";
	cout << endl;
	cout << sz(b) << endl;
	fr(i, 0, sz(b)) cout << b[i] << " ";
	cout << endl;

}

int main(){
#ifdef _DEBUG
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif

	solve();


	return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    int a,b,c,d,e,f,S;
    cin >> a >> b >> c >> d >> e >> f;
    
    S=a*1+b*5+c*10+d*50+e*100+f*500;
    
    if(S>=1000)
        cout << '1' << endl;
    else
        cout << '0' << endl;       
}



Measured memory_bytes: 3116
unittest
{
	assert( [ "3 4 3", "1 3 3 100", "1 2 2 10", "2 3 2 10" ].parse.expand.solve == 110 );
	assert( [ "4 6 10", "2 4 1 86568", "1 4 0 90629", "2 3 0 90310", "3 4 1 29211", "3 4 3 78537", "3 4 2 8580", "1 2 1 96263", "1 4 2 2156", "1 2 0 94325", "1 4 3 94328" ].parse.expand.solve == 357500 );
	assert( [ "10 10 1", "1 10 9 1" ].parse.expand.solve == 1 );
}



import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto nmq = input.front.split.to!( long[] );
	auto abcds = new long[ 4 ][ nmq[ 2 ] ];
	foreach( ref abcd; abcds )
	{
		input.popFront;
		abcd = input.front.split.to!( long[] );
		abcd[ 0 .. 2 ] -= 1;
	}
	return tuple( nmq[ 0 ], nmq[ 1 ], abcds );
}

auto solve( long n, long m, long[ 4 ][] abcds )
{
	return solve2( abcds, 1, m, new long[ n ], 0 );
}

long solve2( long[ 4 ][] abcds, long mi, long ma, long[] ds, long i )
{
	auto s = 0L;
	if( i < ds.length )
	{
		foreach( d; mi .. ma + 1 )
		{
			ds[ i ] = d;
			s = max( s, solve2( abcds, d, ma, ds, i + 1 ) );
		}
	}
	else
	{
		foreach( abcd; abcds )
		{
			if( ds[ abcd[ 1 ] ] - ds[ abcd[ 0 ] ] == abcd[ 2 ] ) s += abcd[ 3 ];
		}
	}
	return s;
}




Measured memory_bytes: 2772
import java.util.Scanner;

public class Main {

	static Scanner scanner;
	public static void main(String[] args) {
	    scanner = new Scanner(System.in);

	    int A=gi();
	    int e= Math.abs(25-A);
	    
	    StringBuilder sb=new StringBuilder();
	    sb.append("Christmas");
	    for (int i=0; i<e;i++) {
	    	sb.append(" Eve");
	    }

        System.out.println(sb.toString());
//        if (a<=c&&c<=b) {
//        	System.out.print("Yes");
//        }else{
//        	System.out.print("No");
//        }


	}

	// 文字列として入力を取得
	public static String gs() {
		return scanner.next();
	}

	// intとして入力を取得
	public static int gi() {
		return Integer.parseInt(scanner.next());
	}

	// longとして入力を取得
	public static long gl() {
		return Long.parseLong(scanner.next());
	}
}

Measured memory_bytes: 35424