akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define rep(i,m,n) for(int (i)=(m);(i)<(n);++(i))
#define rREP(i,m,n) for(int (i)=(n)-1;(i)>=(m);--(i))
#define all(x) (x).begin(),(x).end()
#define out(y,x,h,w) (y)<0||(x)<0||(y)>=(h)||(x)>=(w)
constexpr int INF = 1000000001;
constexpr ll mod = 1000000007;
constexpr double PI = 3.1415926535897932;
template<class T>inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
template<class T>inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}
inline void init() {
	cin.tie(nullptr); cout.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

int main() {
	init();

	int N; cin >> N;
	vector<ll>A(N);
	ll sum = 0;
	rep(i, 0, N) {
		cin >> A[i];
		sum += A[i];
	}
	rep(i, 0, N - 1) {
		sum -= 2*A[i];
		++i;
	}
	vector<int>dp(N + 1);
	dp[N] = sum;
	rREP(i, 1, N) {
		dp[i] = (2*A[i-1]-dp[i+1]);
	}
	rep(i, 1, N + 1) {
		cout << dp[i];
		if (i == N)cout << "\n";
		else cout << " ";
	}

	return 0;
}

Measured memory_bytes: 2560
S = input()
n = len(S)
tmp = (n - 1) // 2
tmp2 = (n + 3) // 2
S2 = S[:tmp]
S3 = S[tmp2 - 1:]
ans = S == S[::-1] and S2 == S2[::-1] and S3 == S3[::-1]
print('Yes' if ans else 'No')


Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#define MOD 1000000007
#define INF 1 << 30

using namespace std;
typedef long long ll;

int main(void) {
	int num, i, a, x = 1, ans;
	cin >> num;
	ans = num;
	for (i = 0; i < num; i++) {
		cin >> a;
		if (a == x) {
			ans--;
			x++;
		}
	}
	if (ans == num)
		printf("-1\n");
	else
		cout << ans << "\n";
	return 0;
}

Measured memory_bytes: 384
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<cmath>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<numeric>
#include<functional>
#include<algorithm>
#include<bitset>
#include<tuple>
#include<unordered_set>
#include<unordered_map>
#include<random>
#include<array>
#include<cassert>
using namespace std;
#define INF (1<<29)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define uniq(v) v.erase(unique(all(v)),v.end())

#define MOD 998244353

int n, x;
int dp[2][512][501];


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

	cin >> n >> x;
	auto cur = dp[0];
	auto nxt = dp[1];
	cur[0][0] = 1;

	rep(i, n){
		memset(nxt, 0, sizeof(dp[0]));
		rep(s, 512) {
			int c = 0;
			rep(j, x + 1) {
				c += cur[s][j];
				c %= MOD;
				nxt[s ^ j][j] += c;
				nxt[s ^ j][j] %= MOD;
			}
		}
		swap(cur, nxt);
	}

	int ans = 0;
	rep(i, x + 1)(ans += cur[x][i]) %= MOD;
	cout << ans << endl;



	return 0;
}


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

#define pi 3.14159265

int main(){
    double a,b,C;
    cin >> a  >> b >> C;
    double S,  L, h;
    C = C*(pi/180);
    S = a * b * sin(C)/2;
    double c = sqrt(a*a + b*b -2*a*b*cos(C));
    L  = a + b + c;
    h = 2*S/a;
    printf("%.8f\n%.8f\n%.8f\n",S,L,h);
}


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

using namespace std;

using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using vi = vector<int>;
using vl = vector<ll>;

using _loop_int = int;
#define REP(i,n) for(_loop_int i=0; i<(_loop_int)(n); i++)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a); i<(_loop_int)(b); i++)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1; i>=(_loop_int)(a); i--)

#define CHMIN(a,b) (a)=min((a),(b))
#define CHMAX(a,b) (a)=max((a),(b))
#define ALL(v) (v).begin(),(v).end()

#define DEBUG(x) cerr<<#x<<": "<<(x)<<endl
#define DEBUG_VEC(v) cerr<<#v<<": ";REP(__i,(v).size())cerr<<((v)[__i])<<", ";cerr<<endl

const ll MOD = 1000000007ll;

int n,m;
int k[12];
int s[12][12];
int p[12];

int main(){
    scanf("%d%d",&n,&m);
    REP(i,m){
        scanf("%d",k+i);
        REP(j,k[i])scanf("%d",&s[i][j]),s[i][j]--;
    }
    REP(i,m)scanf("%d",p+i);
    int ans = 0;
    REP(msk,1<<n){
        int b[n] = {};
        REP(i,n)if(msk>>i&1)b[i]=1;
        bool ok = true;
        REP(i,m){
            int x = 0;
            REP(j,k[i])if(b[s[i][j]])x^=1;
            if(x != p[i])ok = false;
        }
        ans += ok;
    }
    printf("%d\n",ans);
    return 0;
}


Measured memory_bytes: 256
N = int(input())
S = list(map(int, input().split()))
ans = 10000

for T in range(1, N):
    s1 = 0
    s2 = 0
    for i in range(len(S)):
        if i+1 <= T:
            s1 += S[i]
        if i+1 > T:
            s2 += S[i]
    if abs(s1 - s2) < ans:
        ans = abs(s1 - s2)
        
print (ans)




Measured memory_bytes: 3060
#include <iostream>      // cout, endl, cin
#include <string>        // string, to_string, stoi
#include <vector>        // vector
#include <algorithm>     // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility>       // pair, make_pair
#include <tuple>         // tuple, make_tuple
#include <cstdint>       // int64_t, int*_t
#include <cstdio>        // printf
#include <map>           // map
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <deque>         // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset>        // bitset
#include <cctype>        // isupper, islower, isdigit, toupper, tolower
#include <cmath>

using namespace std;
typedef long long ll;

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

int count(int N)
{
        int ans = 0;
        while (N)
        {
                ans++;
                N /= 10;
        }
        return ans;
}

int main()
{
        int K, N;
        cin >> K >> N;
        vector<int> A(N);
        rep(i, N) cin >> A[i];
        vector<int> B(N);
        B[0] = A[1] - A[0];
        for (int i = 1; i < N-1; i++)
        {
                B[i] = A[i + 1] - A[i];
        }
        B[N - 1] = K - A[N - 1]+A[0];
        sort(all(B));
        cout << endl;
        ll ans = 0;
        rep(i, N - 1)
        {
                ans += B[i];
        }
        cout << ans << endl;

        return 0;
}


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

//#define int long long
#define ll long long
#define all(v) (v).begin(), (v).end()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

signed main()
{   
    gearup;
    ll n;cin >> n;
    vl a(n);
    rep(i,n) cin >> a[i];
    ll res = 0;
    rep(i,n){
        while(a[i] % 2 == 0){
            res++;
            a[i]/=2;
        }
    }
    cout << res << endl;
}


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

using namespace std;
using ll = long long;

//cout << std::fixed << std::setprecision(15) << y << endl;

int main() {
    int n = 0;
    string s = "";
    cin >> n >> s;
    vector<int> c(3);
    int sum = 0;
    
    for(int i = 0;i < 1000;i++){
        int tmp = i;
        c[2] = tmp % 10;
        tmp /= 10;
        c[1] = tmp % 10;
        c[0] = tmp / 10;
        int f = 0;
        
        for(int j = 0;j < n;j++){
            
            if(c[f] == s[j] - '0'){
                f++;
            }
            if(f == 3){
                break;
            }
           //cout << "hoge" << endl;
        }
        if(f == 3){
            sum ++;
        }
    }
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 3604
//#define _GLIBCXX_DEBUG
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<set>
#include<unordered_set>
#include<map>
#include<unordered_map>
#include<string>
#include<bitset>
#include<random>
#include<ctime>
using namespace std;
typedef long long ll;

signed main() {
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	ll a, b, c;
	cin >> a >> b >> c;
	cout << c - min(a - b, c);
}


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

using namespace std;

#define REP1(i,n) for(int i=1, i##_len=(n); i<i##_len; ++i)
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define pow(x) x*x
#define ll long long

static const ll MAX = 1000000;
static const ll INFTY = 1e12;
static const ll MOD = 1000000007;

template < typename T > inline string toString( const T &a ) { ostringstream oss; oss << a; return oss.str(); };

struct edge {
    ll to, cost;
};

using Graph = vector<vector<int>>;
using _Graph = vector<vector<edge>>;


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

// 深さ優先探索
vector<bool> seen;
vector<int> colors;

int H, W, N;
int sx, sy, gx, gy; 
vector<vector<char>> field;
vector<vector<int>> dist;
//vector<pair<int, int>> gx, gy;
deque<pair<int, int>> que;

typedef vector<vector<int> > Matrix;

const ll INF = 1e18;

int main() {

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

    if(A*B % 2 == 1){
        cout << "Yes";
        return 0;
    }
    cout << "No";
    return 0;

 

}

/*
みんな、くるくるぱーにな〜れ
　∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
　　　　　　　　　　(¸.·´ (¸.·'* ☆
*/



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define REP(i, n) for (signed long long i = 0; i < (n); i++)
#define MOD 1000000007
#define bitcnt(a) (ll) __builtin_popcount((a))
using namespace std;
typedef long long ll;

ll h, w;
bool in(ll y, ll x) {
  if (x < 0 || y < 0 || x == w || y == h)
    return 0;
  return 1;
}
string s[51];
int main() {
  cin >> h >> w;
  REP(i, h) cin >> s[i];
  REP(i, h) {
    REP(j, w) {
      if (s[i][j] == '.')
        continue;
      ll xy[] = {0, 1, 0, -1, 0};
      bool f = 0;
      REP(k, 4) {
        if (in(i + xy[k], j + xy[k + 1]) && s[i + xy[k]][j + xy[k + 1]] == '#') {
          f = 1;
        }
      }
      if (!f)
        return !printf("No\n");
    }
  }
  cout << "Yes" << endl;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Comparator;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");

		int n = Integer.parseInt(str[0]);
		long h = Long.parseLong(str[1]);

		long a[] = new long[n];
		Long b[] = new Long[n];

		long maxA = 0;
		for (int i = 0; i < n; i++) {
			str = br.readLine().split(" ");
			a[i] = Long.parseLong(str[0]);
			b[i] = Long.parseLong(str[1]);

			maxA = Math.max(maxA, a[i]);
		}

		Arrays.sort(b, Comparator.reverseOrder());

		long count = 0;
		for (int i = 0; i < n; i++) {
			if (b[i] <= maxA)
				break;

			h -= b[i];
			count++;

			if (h <= 0)
				break;
		}

		while (h > 0) {
			h -= maxA;
			count++;
		}

		System.out.println(count);
	}
}


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

using namespace std;

int main(void)
{
    int N;
    cin >> N;

    int num;
    vector<int> P;
    for(int i=0;i<N;i++){
        cin >> num;
        P.push_back(num-1);
    }

    vector<int> Q(N);
    
    for(int i=0;i<N;i++){
        Q[P[i]] = i;
    }

    multiset<int> M = {-1,-1,N,N};


    long long result = 0;

    for(int i=N-1;i>=0;i--){
      
      int now = Q[i];
      
    auto L = M.upper_bound(now);
    int x = *(L);
      ++L;
    int y = *(L);
      L = prev(L,2);
    int b = *(L);
      L--;
    int a = *(L);

    result += (i+1)*(1LL*(b-a)*(x-now)+1LL*(now-b)*(y-x));

    M.emplace(now);

    }

    cout << result << endl;
}

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

#include <iostream>
using namespace std;
int main() {
  int64_t n;
  cin >> n;
  vector<int> out;

  for (int i = 1; i < 100; ++i) {
    n--;
    out.push_back(n % 26);
    n /= 26;
    if (n == 0) {
      break;
    }
  }

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

  for (auto out_i : out) {
    auto temp = char('a' + out_i);
    cout << temp;
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 3608
#include <bits/stdc++.h>
using namespace std;
#define IO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

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

    if(s.length()>k){
        string ans(s.begin(),s.begin()+k);
        ans += "...";
        cout<<ans<<endl;
    }
    else
        cout<<s<<endl;

    return 0;
}





Measured memory_bytes: 3652
#include<stdio.h>
#include<stdlib.h>
#include<stdint.h>
#include<inttypes.h>

typedef int32_t i32;
typedef int64_t i64;

const i32 mod = 1000000007;

i32 mod_pow (i32 r, i32 n) {
  i32 t = 1;
  i32 s = r;
  while (n > 0) {
    if (n & 1) t = (i64) t * s % mod;
    s = (i64) s * s % mod;
    n >>= 1;
  }
  return t;
}

i32 inv (i32 a) {
  return mod_pow (a, mod - 2);
}

void run (void) {
  i32 n, a, b, c;
  scanf ("%" SCNi32 "%" SCNi32 "%" SCNi32 "%" SCNi32, &n, &a, &b, &c);
  i32 p = (i64) a * inv (a + b) % mod;
  i32 q = (1 + mod - p) % mod;
  i32 *inverse = (i32 *) calloc (n + 1, sizeof (i32));
  inverse[1] = 1;
  for (i32 i = 2; i <= n; ++i) {
    inverse[i] = (i64) (mod - mod / i) * inverse[mod % i] % mod;
  }
  i64 ans = 0;
  i32 comb = 1;
  for (i32 i = 0, t = 1, x = mod_pow (p, n), y = mod_pow (q, n); i < n; ++i, x = (i64) x * q % mod, y = (i64) y * p % mod) {
    i64 prob = (i64) comb * (x + y);
    t = (t + (i64) 2 * mod * mod - prob) % mod;
    ans += t;
    comb = (i64) comb * (n + i) % mod * inverse[i + 1] % mod;
  }
  ans = (ans + n) % mod * 100 % mod * inv (100 - c) % mod;
  printf ("%" PRIi64 "\n", ans);
}

int main (void) {
  run();
  return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std ;
const int N = 200010 ;
int n,a[N],x,y ; 
int main(){
//	freopen("in.txt","r",stdin) ;
	cin >> n ;
	for(int i = 1 ; i <= n ; i++){
		scanf("%d",&a[i]) ;
		if(a[i]%2) x++ ; // odd
		else y++ ; //even 
	}
	if(!x || !y) printf("%d\n",0) ;
	else{
		if(x%2)
			printf("%d\n",x+y-1) ; 
		else printf("%d\n",x+y-2) ; 
	}
	return 0 ; 
}


Measured memory_bytes: 3976
n = int(input())
t = list(map(int, input().split()))
v = list(map(int, input().split()))

maxv = [0]
for _t, _v in zip(t, v):
  maxv[-1] = min(maxv[-1], _v)
  for ti in range(_t * 2):
    maxv.append(_v)

N = len(maxv)
candv = [0] * N
for i in range(N - 1):
  candv[i + 1] = min(candv[i] + 0.5, maxv[i + 1])

candv[-1] = 0
for i in reversed(range(1, N)):
  candv[i - 1] = min(candv[i - 1], candv[i] + 0.5)

ans = 0
for x1, x2 in zip(candv, candv[1:]):
  ans += (x1 + x2) * 0.5 / 2

print(ans)


Measured memory_bytes: 4140
#include<bits/stdc++.h>
#define ll long long
#define MOD 1000000007
#define FOR(i, a, b) for(int i=a; i<b; i++)
#define REP(i, n) for(int i=0; i<n; i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using namespace std;

int main() {
    int N; cin >> N;
    ll h[100010];
    REP(i, N) cin >> h[i];

    ll INF = 1LL << 60;
    ll dp[100010];
    REP(i, 100010) dp[i] = INF;
    dp[0] = 0;

    REP(i, N) {
        chmin(dp[i], dp[i-1] + abs(h[i] - h[i-1]));
        if (i > 1) chmin(dp[i], dp[i-2] + abs(h[i] - h[i-2]));
    }
    cout << dp[N-1] << endl;
}


Measured memory_bytes: 1792
n, m = map(int, input().split())
n += 1
s = input()
dst = [float("inf")]*n
dst[-1] = 0
m_last = n-1

for i in reversed(range(n-1)):
    if s[i] == "1":
        continue
    for j in reversed(range(min(m_last+1, i+m+1))):
        # print(i, j)
        if s[j] == "0":
            dst[i] = dst[j]+1
            m_last = j
            break

    if dst[i] == float("inf"):
        print(-1)
        exit()

# print(dst)
last_idx = 0
last_num = dst[0]
ans = []
for i in range(1, n):
    if dst[i] != float("inf") and dst[i] != last_num:
        ans.append(i - last_idx)
        last_num = dst[i]
        last_idx = i

print(*ans)



Measured memory_bytes: 53068
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define USE_LLONG_AS_INT
#ifdef USE_LLONG_AS_INT
#define int long long
#define inf (1ll<<60)
#else
#define inf (1<<30)
#endif
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define rev(i,n) for(int i=(n)-1;i>=0;i--)
#define vi vector<int>
#define vvi vector<vi>
#define vs vector<string>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define Yes(f) cout<<(f?"Yes":"No")<<endl
#define yes(f) cout<<(f?"yes":"no")<<endl
#define YES(f) cout<<(f?"YES":"NO")<<endl
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v), greater<int>())

using namespace std;

const int mod=1e9+7;
const string sp=" ";

void run();

void init() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(12);
}

signed main(){
    init();
    run();
    return 0;
}

void run(){
    int n,m;
    cin>>n>>m;
    priority_queue<int> q;
    rep(_,n){
        int a;
        cin>>a;
        q.push(a);
    }
    while(m--){
        int a=q.top();
        q.pop();
        a/=2;
        q.push(a);
    }
    int ans=0;
    rep(_,n){
        ans+=q.top();
        q.pop();
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 1528
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

#define rep(i,a,b) for(ll i=a;i<b;i++)
#define rrep(i,b,a) for(int i=b;i>=a;i--)
#define fori(a) for(auto i : a )
#define all(a) begin(a), end(a)
#define set(a,b) memset(a,b,sizeof(a))
#define sz(a) a.size()
double pi=acos(-1);
#define ll long long
#define ull unsigned long long
#define pb push_back
#define PF push_front //deque
// #define mp make_pair
#define pq priority_queue
const ll mod=1000000007;
#define f first
#define s second
#define pii pair< ll, ll >
#define vi vector<int>
#define vpii vector<pii>
#define debug(v) for(auto i:v) cout<<i<<" ";
#define tc int t; cin >> t; while(t--)

using namespace boost::multiprecision;
using namespace std;
void optimizeIO(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}


const int N=1000005;
ll fact[N],invfact[N];
ll power(ll x,ll y){
  if(y<=0) return 1LL;
  ll z=power(x,y/2);
  if(y%2) return (((z*z)%mod)*x)%mod;
  return (z*z)%mod;
}

void pre(){
  fact[0]=invfact[0]=invfact[1]=fact[1]=1;
  rep(i,2,N) fact[i]=(i*fact[i-1])%mod;
  rep(i,2,N) invfact[i]=(invfact[i-1]*power(i,mod-2))%mod;
}
ll nCr(ll n,ll k){ return (((fact[n]*invfact[n-k])%mod)*invfact[k])%mod; }



const int N1=1e6+1;
vector<int> isprime(N1,1),prime;
void seive(){
  rep(i,2,sqrt(N1)+1){
      if(isprime[i]){
        for(int j=i*i;j<N1;j+=i) isprime[j]=0;
        prime.pb(i);
      }
  }
  rep(i,sqrt(N1)+1,N1) if(isprime[i]) prime.pb(i);
}



struct dsu {
    vector<int> par, rank;
    dsu(int n): par(n+1), rank(n+1) {
        for (int i = 0; i <= n; i++) {
            par[i] = i;
            rank[i]= 1;
        }
    }
    int root(int a) {
        if (a == par[a]) return a;
        return par[a] = root(par[a]);
    }
    void merge(int a, int b) {
        a = root(a);
        b = root(b);
        if (a == b) return;
        if (rank[a] > rank[b]) swap(a, b);
        par[b] = a;
    }
    set<int> parent(int n){
        set<int> s;
        for(int i=1;i<=n;i++){
            s.insert(root(i));
        }
        return s;
    }
};

void solve(){
  int a,b;
  cin>>a>>b;
  int ans=0;
  for(int i=a;i<=b;i++){
    string x=to_string(i);
    string y=x;
    reverse(all(y));
    if(y==x) ans++;
  }
  cout<<ans<<endl;
}

int main(){
    optimizeIO();
    int r=1;
    {solve();}
}


Measured memory_bytes: 6944
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <list>
#include <queue>
#include <tuple>
#include <deque>
#include <algorithm>
#include <numeric>
#include <utility>
#include <complex>
#include <functional>
using namespace std;
const int MOD = 1000000007;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = (1 << 28);
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#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()
int a;
string s;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> a >> s;

    if (a >= 3200)
    {
        cout << s << "\n";
        return 0;
    }
    else
    {
        cout << "red"
             << "\n";
    }
}

Measured memory_bytes: 256
#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 main() {
  ll a;
//   10までだったら小数点以下も桁数として扱える
  double b;
  cin >> a >> b;
//   9.999の場合は切り捨てで崩れるから+0.5する
  ll ib = b*100+0.5;
  a *= ib;
  a /= 100;
  printf("%lld\n", a);
  return 0;
}

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

#define REP(i,n) for(ll i=0;i<ll(n);++i)
#define RREP(i,n) for(ll i=ll(n)-1;i>=0;--i)
#define FOR(i,m,n) for(ll i=m;i<ll(n);++i)
#define RFOR(i,m,n) for(ll i=ll(n)-1;i>=ll(m);--i)
#define ALL(v) (v).begin(),(v).end()
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());
#define INF 1000000001ll
#define MOD 1000000007ll
#define EPS 1e-9

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


using namespace std;

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

template <class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
template <class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
int dfs(vi &dp, vvi &g, vi &p, int v) {
	if (dp[v] != -1)return dp[v];
	int ret = 0;
	REP(i, g[v].size()) {
		if (chmax(ret, dfs(dp, g, p, g[v][i])+1)) {
			p[v] = g[v][i];
		}
	}
	return dp[v] = ret;
}
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n, m;
	cin >> n >> m;
	vvi g(n), rg(n);
	vi cnt(n, 0);
	REP(i, n + m - 1) {
		int a, b;
		cin >> a >> b;
		a--; b--;
		g[a].push_back(b);
		rg[b].push_back(a);
		cnt[b]++;
	}
	int r = -1;
	REP(i, n) {
		if (cnt[i] == 0) {
			assert(r == -1);
			r = i;
		}
	}

	vi ans(n, -1);
	vi dp(n, -1);
	dp[r] = 0;
	REP(i, n)if (dp[i] == -1)dfs(dp, rg, ans, i);
	REP(i, n)cout << ans[i]+1 << endl;
}


Measured memory_bytes: 17920
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <array>
#include <tuple>
#include <random>

using namespace std;
typedef long long int ll;

#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for(int i = int(a); i < int(b); i++)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep,)(__VA_ARGS__)
#define all(x) (x).begin(), (x).end()

#define inf 10000000000

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

    ll a, b;
    cin >> a >> b;
    cout << ((a%3 == 0 || b%3 == 0 || (a + b) % 3 == 0) ? "Possible" : "Impossible") << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<set>
#include<map>
#include<queue>
#define REP(i,a) for (int i = 0;i < (a);++i)
#define FOR(i,a,b) for (int i = (a);i < (b); ++i)
#define FORR(i,a,b) for (int i = (a);i >= (b); --i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SORT(list) sort(ALL((list)));
#define MOD 1000000007
using namespace std;
using ll = long long;
int main(){
    int w,h,n;
    cin >> w >> h >> n;
    vector<int> x(n),y(n),a(n);
    REP(i,n)cin >> x[i] >> y[i] >> a[i];
    int whitel = 0,whiter=w,whitet = h,whiteb = 0;
    REP(i,n){
        if(a[i] == 1){
            whitel = max(whitel,x[i]);
        }
        else if(a[i] == 2){
            whiter = min(whiter,x[i]);
        }
        else if(a[i] == 3){
            whiteb = max(whiteb,y[i]);
        }
        else if(a[i] == 4){
            whitet = min(whitet,y[i]);
        }
    }
    //cout << whitel << endl << whiter << endl << whitet << endl << whiteb << endl;
    if(whitet-whiteb <= 0 || whiter-whitel <= 0)
        cout << 0 << endl;
    else
        cout << (whitet-whiteb)*(whiter-whitel) << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
	int  a , b , c , d , x , y ;
	cin>>a>>b>>c>>d;
	 x = max(a,c);
     y = min(b,d);
	if((y-x)<=0)
    {
        cout<<"0";
    }
    else
    {
        cout<<y-x<<"\n";
    }
}


Measured memory_bytes: 256
#include <iostream>

#define FOR(i,a,b) for(int i=(a);i<(b);i++)

using namespace std;

const int MAX_N = 55555;
bool is_prime[MAX_N+1];

void sieve()
{
  is_prime[0] = is_prime[1] = false;
  FOR(i,2,MAX_N+1) is_prime[i] = true;
  FOR(i,2,MAX_N+1)
    if(is_prime[i])
      for(int j = i*2; j <= MAX_N; j+=i)
        is_prime[j] = false;
}

int main()
{
  sieve();
  
  int N;
  cin >> N;

  int x = 2;
  for(int i = 0; i < N; ++i){
    for(int j = x; j < MAX_N; ++j){
      if(is_prime[j] && j%5 == 1){
        cout << j << " ";
        x = j+1;
        break;
      }
    }
  }
  
  cout << endl;
}

Measured memory_bytes: 256
N, K = gets.split.map(&:strip).map(&:to_i)
A = gets.split.map(&:strip).map(&:to_i)

(1..(N-K)).each do |i|
  if A[K+i-1] > A[i-1]
    puts 'Yes'
  else
    puts 'No'
  end
end


Measured memory_bytes: 47940
try:
    while True:
        x = input()
        if x=='0':
            break
        a = 0
        b = 0
        for i in range(1,len(x)):
            if x[i]=='A':
                a = a + 1
            elif x[i]=='B':
                b = b + 1
        if a > b:
            a = a + 1
        elif a < b:
            b = b + 1
        print(a,b)
except EOFError:
    pass


Measured memory_bytes: 5556
N = int(input())
 
ABC = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
ANS=[]
ANS_N=[]
 
while N != 0:
  N -= 1
  ANS.append(N%26)
  N = N // 26
 
for i in range(len(ANS)):
  ANS_N.append(ABC[ANS[i]])
 
ans = "".join(reversed(ANS_N))
print(ans)

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

            #define FOR(i,a,b) for (int i = (a); i < (b); i++)
            #define rep(i,n) FOR(i,0,n)
            #define RFOR(i,b,a) for (int i = (b)-1; i >= (a); i--)
            #define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++)
            #define FILL(a,value) memset(a, value, sizeof(a))

            #define SZ(a) (int)a.size()
            #define ALL(a) a.begin(), a.end()
            #define PB push_back
            #define MP make_pair
            #define SC second
            #define FS first

            typedef long long LL;
            typedef vector<int> VI;
            typedef vector<LL>VL;
            typedef vector <bool >VB;
            typedef vector<vector<int>>WI;
            typedef vector<vector<LL>>WL;
            typedef pair<int, int> PII;
            typedef pair<double, double> PDD;

            const double PI = acos(-1.0);
            const int INF = 1000 * 1000 * 1000 + 7;
            const LL LINF = LL(1e12);
            const int MAS = int(1e5 * 3 + 1);
            const double EPS = 1e-7;
            const LL MAX = 4294967296;
            const LL MOD =LL(1e9+7);

            int main()
            {

            int a,b;cin >> a >> b ; cout << max(0,a-2*b);
            }


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
  int n[3]; 
  cin >> n[0] >> n[1] >> n[2];
  sort(n, n + 3);
  if (n[0] == 5 && n[1] == 5 && n[2] == 7){
    cout << "YES" << endl;
  } else cout << "NO" << endl;
}
        
  

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>

using namespace std;

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

	vector<vector<int>> a(2, vector<int>(n, 0));
	for (int i = 0; i < 2 * n; i++) {
		if (i < n) {
			cin >> a[0][i];
		} else {
			cin >> a[1][i - n];
		}
	}

	int ans = 0;
	for (int i = 0; i < n; i++) {
		int sum = 0;
		for (int j = 0; j <= i; j++) {
			sum += a[0][j];
		}
		for (int j = i; j <  n; j++) {
			sum += a[1][j];
		}
		ans = max(ans, sum);
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long 
#define pb push_back
#define mod 998244353
#define all(v) v.begin(),v.end()
#define MP make_pair
#define F first
#define S second
#define inf 1000000000000000000
#define vll vector<ll>
using namespace std;
const int N=1000005;

void solve()
{
	ll ans,a,b,c,n,i,j;
	ans=0;
	cin>>a>>b>>c>>n;
	for(i=0;i<=n;i++)
		for(j=0;j<=n;j++)
			if(n-a*i-b*j>=0 && (n-a*i-b*j)%c==0) ans++;
	cout<<ans;
	
}
 
int main() {
    
    ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	
    ll t=1;
    //cin>>t;
    while(t--)
        solve();
 
    
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define mk make_pair
#define fi first
#define se second
#define vll vector<ll>
#define pii pair<ll,ll>
#define vvll vector< vector<ll> >
#define pb push_back
#define inf 1e16
#define M 1000000007
#define all(v) (v).begin(),(v).end()
#define rep(i,a,b) for(ll i=a;i<b;++i)
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
#define mx 1000010

int main(){
	IOS;
	ll a,b,c;cin>>a>>b>>c;
	if((c<b&&c>a)||(c<a&&c>b))cout<<"Yes";
	else cout<<"No";
	return 0;
}



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

prime_factor = {1: 1} if n == 1 else {}
for i in range(2, n+1):
    while i % 2 == 0:
        prime_factor[2] = prime_factor.get(2, 0) + 1
        i //= 2
    f = 3
    while f * f <= i:
        if i % f == 0:
            prime_factor[f] = prime_factor.get(f, 0) + 1
            i //= f
        else:
            f += 2
    if i != 1:
        prime_factor[i] = prime_factor.get(i, 0) + 1

m = len(prime_factor)
prime = list(prime_factor.keys())

dp = [[0]*76 for _ in range(m+2)]
dp[0][1] = 1
for i in range(m):
    for j in range(76):
        for k in range(prime_factor[prime[i]]+1):
            if (v := j * (k+1)) < 76:
                dp[i+1][v] += dp[i][j]

print(dp[m][75])


Measured memory_bytes: 9200
#include <iostream>

using namespace std;

int main()
{
    int n=0;
    char s[4];
    for(int i=0;i<4;i++)
    {
     cin>>s[i];
    }
    if(s[0]==s[1])
    {
        n++;
    }
    else
    {
        if(s[0]==s[2])
        {
            n++;
        }
        else
        {
            if(s[0]==s[3])
            {
                n++;
            }
        }
    }
    if(s[1]==s[2])
    {
        n++;
    }
    else
    {
        if(s[1]==s[3])
        {
            n++;
        }
    }
    if(s[2]==s[3])
    {
        n++;
    }
    if(n==2)
    {
       cout<<"Yes";
    }
    else
    {
        cout<<"No";
    }
    return 0;
}


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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void Main() {
    ll N, X; cin >> N >> X;
    ll pos = 0, ans = 1;
    rep(i, N){ll l; cin >> l; pos += l; if (pos <= X){ans++;}}
    cout << ans << endl;
}

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


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <sstream>
#include <string>
#include <vector>
using namespace std;

typedef long long ll, lint;
typedef long double ldouble;

#define sz(v) ((int) (v).size())
#define FOR(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define For(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define all(v) (v).begin(), (v).end()

#define mp make_pair
#define pb push_back
#define fst first
#define snd second

template<class T>
string to_string(T arr, int len = 1e9) {
    stringstream ss;
    int i = 0;
    for (auto item : arr) {
        ss << item << ' ';
        if (++i == len)
            break;
    }
    return ss.str();
}

#ifdef LOCAL
    #define dbg(expr) cout << "[line " << __LINE__ << "] " << (#expr) << ": " << (expr) << endl;
#else
    #define dbg(expr) (void) 0;
#endif


int main() {
#ifndef LOCAL
    cin.tie(0);
    ios_base::sync_with_stdio(false);
#endif

    int n;
    cin >> n;
    vector<lint> a(n);
    map<lint, lint> odd, even;
    For (i, n) {
        cin >> a[i];
        if (i % 2 == 0)
            even[a[i]]++;
        else
            odd[a[i]]++;
    }

    vector<pair<lint, lint>> odd_order, even_order;
    for (auto e : even)
        even_order.emplace_back(e.second, e.first);
    sort(all(even_order));
    reverse(all(even_order));
    for (auto e : odd)
        odd_order.emplace_back(e.second, e.first);
    sort(all(odd_order));
    reverse(all(odd_order));

    lint ans = n;
    lint even_total = n / 2 + n % 2;
    lint odd_total = n / 2;
    for (int i = 0; i < min(2, sz(even_order)); i++) {
        For (j, min(2, sz(odd))) {
            if (even_order[i].second == odd_order[j].second) {
                lint cur = (even_total - even_order[i].first) + odd_total;
                ans = min(ans, cur);
                cur = even_total + (odd_total - odd_order[j].first);
                ans = min(ans, cur);
                continue;
            }
            lint cur = (even_total - even_order[i].first) + (odd_total - odd_order[j].first);
            ans = min(ans, cur);
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 9592
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <array>
#include <set>
#include <map>
#include <cmath>
#include <complex>
#include <algorithm>
#include <numeric>
#include <utility>
#include <tuple>
#include <bitset>
#include <cstdint>
#include <cassert>
#include <random>
#include <iterator>

using namespace std;
using i64 = int64_t;
using i32 = int32_t;

const i64 mod = 1e9 + 7;
i64 ipow(i64 a, i64 b) {
    i64 x = a, y = 1;
    for (; b > 0; b >>= 1) {
        if (b & 1) (y *= x) %= mod;
        (x *= x) %= mod;
    }
    return y;
}
i64 inv(i64 x) {
    return ipow(x, mod - 2);
}
i64 fact(i64 x) {
    static vector<i64> f;
    i64 i = f.size();
    if (x >= i) {
        f.resize(x + 1);
        for (; i <= x; ++i) {
            f[i] = i == 0 ? 1 : i * f[i - 1] % mod;
        }
    }
    return f[x];
}
i64 perm(i64 n, i64 k) {
    return k <= n ? fact(n) * inv(fact(n - k)) % mod : 0;
}
i64 comb(i64 n, i64 k) {
    return k <= n ? fact(n) * inv(fact(k) * fact(n - k) % mod) % mod : 0;
}
int main() {
    i64 n, k;
    cin >> n >> k;
    cout << perm(k, n) << endl;
    return 0;
}


Measured memory_bytes: 3112
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

class Main {
    public static void main(String[] args){
        Scanner scanner =  new Scanner(System.in);
        int first = scanner.nextInt();
        int second = scanner.nextInt();
        int third = scanner.nextInt();
        List<Integer> list = Arrays.asList(first,second,third);

        int count5 = 0;
        int count7 = 0;
        for (int value : list) {
            if (value == 5) {
                count5++;
            }
            if(value == 7) {
                count7 ++;
            }
        }
        if (count5 == 2 && count7 == 1) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }


    }
}

Measured memory_bytes: 21844
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <unordered_map>

using namespace std;

int main() {
    int n; cin >> n;
    vector<string> words(n);
    vector<string> exists(n);
    for(int i = 0; i < n; i++){
        cin >> words[i];
    }

    bool flag = true;
    exists[0] = words[0];
    for(int i = 1; i < n; i++){
        if(words[i].substr(0,1) == words[i-1].substr(words[i-1].size()-1, 1)
        && !(find(exists.begin(),exists.end(), words[i]) != exists.end())){
            exists[i] = words[i];
        } else {
            flag = false;
            break;
        }
    }
    cout << (flag?"Yes":"No") << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
#include <iomanip>
#include <deque>
#include <stdio.h>
using namespace std;

#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 FOREACH(i,Itr) for(auto (i)=(Itr).begin();(i)!=(Itr).end();(i)++)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define PB_VEC(Itr1,Itr2) (Itr1).insert((Itr1).end(),(Itr2).begin(),(Itr2).end())
#define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end())
#define LBOUND(Itr,val) lower_bound((Itr).begin(),(Itr).end(),(val))
#define UBOUND(Itr,val) upper_bound((Itr).begin(),(Itr).end(),(val))
#define EPS 1.0e-8
#define MOD 1000000007
typedef long long ll;

long long pow_mod(long long n, long long k, long long m){
    long long res=1;
    for(;k>0;k>>=1){
        if(k&1)res=((res%m)*(n%m))%m;
        n=((n%m)*(n%m))%m;
    }
    return res;
}

int main(){
    
    int N; cin>>N;
    vector<int> a(N);
    REP(i,N)cin>>a[i];
    
    map<int,int> cnt;
    REP(i,N){
        if(cnt.find(a[i])==cnt.end())cnt[a[i]]=1;
        else cnt[a[i]]++;
    }
    
    if(N%2==1){
        if(cnt[0]!=1){
            cout<<0<<endl;
            return 0;
        }
        for(int i=2;i<N;i+=2){
            if(cnt[i]!=2){
                cout<<0<<endl;
                return 0;
            }
        }
    }else{
        for(int i=1;i<N;i+=2){
            if(cnt[i]!=2){
                cout<<0<<endl;
                return 0;
            }
        }
    }
    
    cout<<pow_mod(2,N/2,MOD)<<endl;
    
    return 0;
}


Measured memory_bytes: 3584
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define eps LDBL_EPSILON
#define int long long
#define ll long long
#define moder 1000000007
#define INF LLONG_MAX/3
#define P std::pair<int,int>
#define prique priority_queue<int,vector<int>,greater<int>>
using namespace std;
int n,a[110],sum;
signed main(){
	cin>>n;
	rep(i,n){
		cin>>a[i];
		sum+=a[i];
	}
	int sa=INF;
	int ans;
	for(int i=n;i>=0;i--){
		if(sa>=abs(a[i]*n-sum)){
			ans=i;
			sa=abs(a[i]*n-sum);
		}
	}
	cout<<ans<<endl;
	return 0;
}

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

using namespace std;
int n;
const int INF = 1e7;
vector<int> h;
vector<int> dp;

int main(){
	cin >> n;
	h = vector<int>(n);
	dp = vector<int>(n + 1);
	for(auto &it: h) cin >> it;
	for(int i=1; i<=n ; i++){
		int x = dp[i - 1] + abs(h[i] - h[i - 1]);
		int y = i - 2 >= 0 ? dp[i - 2] + abs(h[i] - h[i - 2]) : INF;
		dp[i] = min(x,y);
	}
	cout << dp[n-1] << "\n";

	return 0;
}


Measured memory_bytes: 3560
#include<iostream>

using namespace std;

int main(){

    long long n;
    cin>>n;
    long long sum = 0ll;
    for(long long i=1;i<=n;++i){
        if(i%3!=0 and i%5!=0)
            sum+=i;
    }
    cout<<sum;
    return 0;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
using namespace std;
using Graph = vector<vector<int>>;
#define MOD 1000000007
#define MOD2 998244353
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long ll;
typedef pair<ll, ll> P;

long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

int main(){
    ll n, k;
    cin >> n >> k;
    ll a[n];
    rep(i, n) cin >> a[i];
    ll in = 0, out = 0;
    rep(i, n){
        for (int j = i + 1; j < n; j++){
            if (a[i] > a[j]) {
                in++;
            }
        }
        rep(k, n) if (a[i] > a[k]) {
            out++;
        }
    }
    cout << ((in * k)%MOD + ((out * ((k * (k - 1))%MOD))%MOD * modinv(2, MOD))%MOD) % MOD << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define rrep(i,a,b) for(int i=(a);i>=(b);--i)
#define MP make_pair
#define PB push_back
typedef long long LL;
const LL P = 998244353;
const int N = 1e5+10;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int n,h[N],dp[N][2];

int main(){
	scanf("%d",&n);
	rep(i,1,n)scanf("%d",h+i);
	dp[0][0] = dp[0][1] = 1;
	rep(i,1,n){
		dp[i][0] = (dp[i-1][0] && h[i]-1>=h[i-1]-1) || (dp[i-1][1] && h[i]-1>=h[i-1]);
		dp[i][1] = (dp[i-1][0] && h[i]>=h[i-1]-1) || (dp[i-1][1] && h[i]>=h[i-1]);
	}
	cout<<((dp[n][0]||dp[n][1]) ? "Yes" : "No")<<endl;
	return 0;
}

Measured memory_bytes: 1536
#include <cstdlib>
#include <iostream>
#include <math.h>
#include <vector>
#include <numeric>

using namespace std;

int main(int argc, const char *argv[]) {
  int N, K;

  cin >> N >> K;
  vector<long int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }

  if(N <= K){
    cout << "0" << endl;
    return 0;
  }

  long int sum = accumulate(A.begin(), A.end(), 0LL);
  sort(A.begin(),A.end(),std::greater<int>());
  for (int i = 0; i < K; i++) {
    sum -= A[i];
    A[i] = 0;
  }
  cout << sum << endl;
  return 0;
}


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

using namespace std;

#define N 100

int n, a[2 * N + 5];

int main() {
    scanf("%d", &n);
    for (int i = 1; i <= 2 * n; ++i) scanf("%d", &a[i]);
    sort(a + 1, a + 2 * n + 1);
    int ans = 0;
    for (int i = 1; i <= n; ++i) {
        ans += a[2 * i - 1];
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
a=[input() for i in range(3)]

oni=[int(i) for i in a[0].split()]
hito=[int(i) for i in a[1].split()]
t=int(a[2])

kyori=abs(oni[0]-hito[0])
spe=(oni[1]-hito[1])

if spe<=0:
	print("NO")

else:

	if kyori>spe*t:
		print("NO")

	else:
		print("YES")

Measured memory_bytes: 9104
#from collections import deque,defaultdict
from sys import stdin
input = stdin.readline
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 10**18
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

n,k = inm()
a = inl()
for kk in range(k):
    l = [0]*n
    r = [0]*(n+1)
    for j in range(n):
        l[max(0,j-a[j])] += 1
        r[min(n,j+a[j]+1)] += 1
    cnt = 0
    mn = BIG
    for j in range(n):
        cnt += l[j]-r[j]
        a[j] = cnt
        mn = min(mn,cnt)
    if mn==n:
        break
pad = ''
for j in range(n):
    printn(pad+str(a[j]))
    pad = ' '
print('')


Measured memory_bytes: 168300
n, x = map(int, input().split())
a = list(map(int, input().split()))

s = 0
if a[0] > x:
    s += a[0] - x
    a[0] = x
for i in range(n-1):
    if a[i] + a[i+1] > x:
        s += (a[i] + a[i+1]) - x
        a[i+1] = x - a[i]

print(s)

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

int main() {
  int A,B,C;
  cin >> A >> B >> C;
  if(A==7 && B == 5 && C == 5) cout<< "YES" << endl;
  else if(A==5 && B == 7 && C == 5) cout<< "YES" << endl;
  else if(A==5 && B == 5 && C == 7) cout<< "YES" << endl;        
  else cout << "NO" << endl;
  
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
	
	int a,b,x,i,mini=3000,sum;
	
	for(i=0; i < 3 ;i++){
		scanf("%d",&a);
		
		if(a < mini){
			mini = a;
		}
		
	}
	
	sum=mini;
	
	mini=3000;
	
	for(i=0; i < 2 ;i++){
		scanf("%d",&b);
		
		if(b < mini){
			mini = b;
		}
	}
	
	sum=sum+mini-50;
	
	
	printf("%d\n",sum);
	
		return 0;
}

Measured memory_bytes: 592
#include <stdio.h>

int min(int a,int b){
	if(a<=b){return a;}
	else{return b;}
}

int pow[15];
int dp[100005];

int main() {

	int N;

	scanf("%d",&N);

	int i,j;

	pow[0]=1;
	for(i=1;i<=6;i++){
	pow[i]=pow[i-1]*6;
	}
	pow[7]=9;
	for(i=8;i<=11;i++){
	pow[i]=pow[i-1]*9;
	}

	for(i=0;i<=N;i++){
	dp[i]=114514;
	}

	for(i=0;i<=11;i++){
	dp[pow[i]]=1;
	}

	for(i=0;i<=11;i++){
		for(j=0;j<=N;j++){
			if(j+pow[i]<=N){
			dp[j+pow[i]]=min(dp[j+pow[i]],dp[j]+1);
			}
		}
	}

	printf("%d\n",dp[N]);

	return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define rep(i,n) for (long long i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
const ll MOD = 200003;
const ll INF = 1000000000000000000;
#define all(v) v.begin(), v.end()


int main(){
  string S;
  cin >> S;
  ll k=S.size();
  rep(i,(ll)S.size()-1){
    if(S.at(i)!=S.at(i+1)){
      k=min(k,max(i+1,(ll)S.size()-1-i));
    }
  }
  cout << k << endl;
}

Measured memory_bytes: 3768
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if V <= W:
    print("NO")
    exit()



diff = max(A, B) - min(A, B)

speed = V - W

if diff / speed <= T:
    print("YES")
else:
    print("NO")

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

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

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

using namespace std;

int main() {
	string S;
	cin >> S;
	for (int i = 0; i < S.size(); i++) S[i] = 'x';
	cout << S << endl;
	return 0;
}

Measured memory_bytes: 3628
import java.util.Scanner;

class Main {

    public static void main(String[] args) {
	int n;
	int[] A;
	Scanner sc = new Scanner(System.in);

	n = sc.nextInt();
	A = new int[n];
	
	for(int i=0; i<n; i++){
	    A[i] = sc.nextInt();
	}

	for(int i=1; i<n;i++){
	    for(int k=0; k<n-1; k++){
		System.out.print(A[k]+" ");
	    }
	    System.out.print(A[n-1]);
	    System.out.println("");
	    int v = A[i];
	    int j = i-1;
	    while(j>=0 && A[j]>v){
		A[j+1] = A[j];
		j--;
	    }
	    A[j+1] = v;
	    
	}
	for(int k=0; k<n-1; k++){
	    System.out.print(A[k]+" ");
	}
	System.out.print(A[n-1]);
	System.out.println("");
    }
}



Measured memory_bytes: 30028