akhauriyash/Code-Regression huggingface dataset:
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

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

using namespace std;

int main() {
	int N, i, t;
	vector<int> A(200000), B(200000);
	cin >> N;
	REP(i, N) {
		cin >> t;
		A[i] = t;
	}
	REP(i, N)
		B[i] = A[i] - i - 1;
	sort(B.begin(), B.begin() + N);
	if (N % 2)
		t = B[(N + 1) / 2 - 1];
	else
		t = (B[(N + 1) / 2 - 1] + B[(N + 1) / 2 - 1]) / 2;
	long long ans = 0;
	REP(i, N)
		ans += abs(A[i] - (t + (i + 1)));
	cout << ans << endl;
}

Measured memory_bytes: 1792
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

template <class T, class U>
vector<T> make_v(U size, const T& init){ return vector<T>(static_cast<size_t>(size), init); }

template<class... Ts, class U>
auto make_v(U size, Ts... rest) { return vector<decltype(make_v(rest...))>(static_cast<size_t>(size), make_v(rest...)); }

template<class T> void chmin(T &a, const T &b){ a = (a < b ? a : b); }
template<class T> void chmax(T &a, const T &b){ a = (a > b ? a : b); }

int main() {
    int r, c, k;
    cin >> r >> c >> k;
    auto dp = make_v(r, c, array<ll, 4>{0, 0, 0, 0});
    auto v = make_v(r, c, 0);
    for (int i = 0; i < k; ++i) {
        int a, b, cc;
        scanf("%d %d %d", &a, &b ,&cc);
        v[a-1][b-1] = cc;
    }
    dp[0][0][1] = v[0][0];
    for (int i = 0; i < r; ++i) {
        for (int j = 0; j < c; ++j) {
            for (int k = 0; k <= 3; ++k) {
                if(i+1 < r) {
                    chmax(dp[i+1][j][1], dp[i][j][k]+v[i+1][j]);
                    chmax(dp[i+1][j][0], dp[i][j][k]);
                }
                if(j+1 < c) {
                    if(k < 3) chmax(dp[i][j+1][k+1], dp[i][j][k]+v[i][j+1]);
                    chmax(dp[i][j+1][k], dp[i][j][k]);
                }
            }
        }
    }
    cout <<  *max_element(dp.back().back().begin(),dp.back().back().end()) << "\n";

    return 0;
}

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

int main() {

int x, n;
cin >> x >> n;
if(n==0){
    cout << x << endl;
}
else{
vector<int> vec(n);
for(int i=0;i<n;i++){
    cin >> vec.at(i);
}
int answer = 0;
bool finished = false;
bool judge;
for(int i=0;i<100;i++){//for文で絶対値を１ずつ増やす
    judge = true;
    for(int j=0;j<n;j++){
        if(vec.at(j)==x-i){
            judge = false;
        }
        if(j==n-1&&judge==true){
            answer = x-i;
            finished=true;
            break;
        }
    }
    if(finished){
        break;
    }
    judge = true;
    for(int k=0;k<n;k++){
        if(vec.at(k)==x+i){
            judge = false;
        }
        if(k==n-1&&judge==true){
            answer = x+i;
            finished=true;
            break;
        }
    }
    if(finished){
        break;
    }
}
cout << answer << endl;
}
}

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

int main() {
    double a, b, x;
    cin >> a >> b >> x;
    // cout << a*b - x/a << endl;
    double y = 2.0*b - 2.0*x/(a*a);
    if(y > b){
        y = (x/a)*(2.0/b);
        printf("%.10lf\n", 90.0-atan(y/b)*(180/M_PI));
    }else{
        printf("%.10lf\n", atan(y/a)*(180/M_PI));
    }
    // cout << y << endl;
    // printf("%.10lf\n", atan(y/a)*(180/M_PI));
    // cout << atan(y/a)*(180/M_PI) << endl;
}

Measured memory_bytes: 384
n = int(input())
s = int(input())

import math
def f(b, n):
    # print(b, n)
    if n<b:
        return n
    else:
        x = f(b, n//b) + n%b
        return x
ans = 0
if n<s:
    print(-1)
    exit()
if n==s:
    print(n+1)
    exit()
for b in range(2,int(math.sqrt(n))+500):
    if f(b, n) == s:
        ans = b
        print(ans)
        exit()
for p in range(int(math.sqrt(n)), 0, -1):
    if (n+p-s) %p == 0:
        # print(p)
        if f((n+p-s)//p, n) == s:
            print((n+p-s)//p)
            exit()


print(-1)


Measured memory_bytes: 3064
fun main(args: Array<String>) {
    val x = readLine()!!.toLong()
    val fiveList = (-200..200.toLong()).map { Pair(it, it * it * it * it * it) }
    for (i in 0 until fiveList.size) {
        for (j in 0 until fiveList.size) {
            if (fiveList[i].second - fiveList[j].second == x) {
                println("${fiveList[i].first} ${fiveList[j].first}")
                return
            }
        }
    }
}

Measured memory_bytes: 35968
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#define rep(i,n) for(int i = 0; i < n;i++)
#define ll long long
#include <bits/stdc++.h>
using namespace std;
#define mo 1000000007
#define ull unsigned long long 
int main(){
  int k,x;cin>>k>>x;
  if(x<=k*500)
    cout<<"Yes";
  else
    cout<<"No";
}
  

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

using namespace std;

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

    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }

    map<int, int> m;
    for (int i = 0; i < n; i++) {
        m[a[i]]++;
    }

    int ans = 0;

    for (auto& p : m) {
        if (p.second < p.first) {
            ans += p.second;
        } else if(p.second > p.first) {
            ans += p.second - p.first;
        }
    }

    cout << ans << endl;
}


Measured memory_bytes: 5120
let id x = x
let init i = if i = 0 then 0 else Scanf.scanf "%d " id

let n = Scanf.scanf "%d\n" id
let row1 = Array.init (n + 1) init
let row2 = Array.init (n + 1) init

let rec solve x y tmp =
  if x = 0 then tmp
  else
    let upper = Array.fold_left ( + ) 0 (Array.sub row1 1 x)
    and lower = Array.fold_left ( + ) 0 (Array.sub row2 y (n - y + 1)) in
    solve (x - 1) (y - 1) (max tmp (upper + lower))

let () = solve n n 0 |> Printf.printf "%d\n"

Measured memory_bytes: 512
import java.io.*;
import java.io.IOException;
import java.util.*;

@SuppressWarnings({"rawtypes", "unchecked"})
class Main {
    final static int INF = 1 << 28;
    final static long LNF = 1L << 60;
    final static double EPS = 1e-9;
    final static double GOLDEN_RATIO = (1.0 + Math.sqrt(5)) / 2.0;

    static final long MOD = 1_000_000_007;
    static final String YES = "Yes";
    static final String NO = "No";

    public static void main(String[] args) throws Exception {
        final MyScanner sc = new MyScanner();
        long A;
        A = sc.nextLong();
        long B;
        B = sc.nextLong();
        long C;
        C = sc.nextLong();
        solve(A, B, C);
    }

    static void solve(long A, long B, long C){
        if((A == B) && A != C ) System.out.println("Yes");
        else
        if((C == B) && A != B ) System.out.println("Yes");
        else
        if((A == C) && A != B ) System.out.println("Yes");
        else
        System.out.println("No");
    }


    static class MyScanner {
 
        BufferedReader br;
        StringTokenizer st;
 
        MyScanner(FileReader fileReader) {
            br = new BufferedReader(fileReader);
        }
 
        MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
 
        String nn() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
 
        String next() {
            return nn();
        }

        String nextLine() {
            String ans = "";
            try {
                ans = br.readLine();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
            return ans;
        }
 
        char nextChar() {
            return nn().charAt(0);
        }
 
        int nextInt() {
            return Integer.parseInt(nn());
        }
 
        long nextLong() {
            return Long.parseLong(nn());
        }
 
        double nextDouble() {
            return Double.parseDouble(nn());
        }
 
        Integer[] niArr0(int n) {
            Integer[] ar = new Integer[n];
            for (int i = 0; i < n; i++) {
                ar[i] = nextInt();
            }
            return ar;
        }
 
        Integer[] niArr1(int n) {
            Integer[] ar = new Integer[n + 1];
            for (int i = 1; i <= n; i++) {
                ar[i] = nextInt();
            }
            return ar;
        }
 
        Long[] nlArr0(int n) {
            Long[] ar = new Long[n];
            for (int i = 0; i < n; i++) {
                ar[i] = nextLong();
            }
            return ar;
        }
 
        Long[] nlArr1(int n) {
            Long[] ar = new Long[n + 1];
            for (int i = 1; i <= n; i++) {
                ar[i] = nextLong();
            }
            return ar;
        }
    }

}


Measured memory_bytes: 23124
using System;
using System.Collections.Generic;
using System.Linq;

public class Hello
{
    private const int MOD_N = 1000000000 + 7;

    public static void Main()
    {
        var s = Console.ReadLine();

        var prev = s[0];
        for (int i = 1; i < s.Length; ++i)
        {
            var current = s[i];
            if (current == prev)
            {
                Console.WriteLine("Bad");
                return;
            }
            prev = current;
        }
        Console.WriteLine("Good");
    }

    private static int Comb(int m, int n)
    {
        var t = m - n;
        if (n > t)
            n = t;

        long numerator = 1;
        for (int i = 0; i < n; ++i)
        {
            numerator *= m - i;
            numerator %= MOD_N;
        }
        long denominator = 1;
        for (; n != 0; --n)
        {
            denominator *= n;
            denominator %= MOD_N;
        }

        var inv_denominator = ModInv((int)denominator, MOD_N);
        var ret = (int)(numerator * inv_denominator % MOD_N);

        return ret >= 0 ? ret : ret + MOD_N;
    }

    private static int ModInv(int a, int m)
    {
        int b = m, x = 1, y = 0;
        while (b != 0)
        {
            var t = a / b;
            a -= t * b;
            Swap(ref a, ref b);
            x -= t * y;
            Swap(ref x, ref y);
        }
        x %= m;
        return x >= 0 ? x : x + m;
    }

    private static void Swap<T>(ref T a, ref T b)
    {
        var t = a;
        a = b;
        b = t;
    }
}


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

using namespace std;

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

  int64_t n;
  cin >> n;

  int64_t rtn = sqrt(n);
  int64_t ans = 0;
  for (int i = 1; i <= rtn; ++i) {
    if (n % i == 0) {
      ans = n / i + i - 2;
    }
  }

  cout << ans << '\n';

  return 0;
}


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

using namespace std;
int main(){
	
	int N,K;
	cin>>N;
	cin>>K;
	int x[N],sum=0;
	//Min=100000000;
	for(int i=0;i<N;i++){
		cin>>x[i];
		sum+=2*min(x[i],K-x[i]);
	}
	
	cout<<sum<<endl;;
}

Measured memory_bytes: 256
h, w = map(int, input().split())
c = []
a = []

for i in range(10):
    c.append(list(map(int, input().split())))
for i in range(h):
    a.append(list(map(int, input().split())))

def search(glaph, start, goal):
    MAX_VAL = 0x10000000
    g_size = len(glaph)
    visited = [False] * g_size
    cost = [MAX_VAL] * g_size
    prev = [None] * g_size
    cost[start] = 0
    prev[start] = start
    now = start
    while True:
        min = MAX_VAL
        next = -1
        visited[now] = True
        for i in range(g_size):
            if visited[i]: continue
            tmp_cost = glaph[now][i] + cost[now]
            if cost[i] > tmp_cost:
                cost[i] = tmp_cost
                prev[i] = now
            if min > cost[i]:
                min = cost[i]
                next = i
        if next == -1: break
        now = next
    return cost[goal]

cost = []
for i in range(10):
    cost.append(search(c, i, 1))
sum = 0
for row in a:
    for element in row:
        if (element != -1):
            sum += cost[element]
print(sum)

Measured memory_bytes: 3444
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int a[]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
  int k;
  cin>>k;
  cout<<a[k-1]<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll n;
    cin>>n;
    if(n%2)
        cout<<0<<endl;
    else
    {
        ll ans=0;
        n/=2;
        while(n>0)
        {
            ans+=n/5;
            n/=5;
        }
    cout<<ans<<endl;
    }
    return 0;
}





Measured memory_bytes: 256
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**6)
INF = 10 ** 9 + 1  # sys.maxsize # float("inf")
MOD = 10 ** 9 + 7


def floor_sum(n, m, a, b):
    ret = 0
    if a >= m:
        ret += (n - 1) * n * (a // m) // 2
        a %= m
    if b >= m:
        ret += n * (b // m)
        b %= m
    y_max = (a * n + b) // m
    x_max = y_max * m - b
    if y_max == 0:
        return ret
    ret += (n - (x_max + a - 1) // a) * y_max
    ret += floor_sum(y_max, a, m, (a - x_max % a) % a)
    return ret


def debug(*x):
    print(*x, file=sys.stderr)


def solve(SOLVE_PARAMS):
    pass


def main():
    # parse input
    T = int(input())
    for _t in range(T):
        N, M, A, B = map(int, input().split())
        print(floor_sum(N, M, A, B))


# tests
T1 = """
5
4 10 6 3
6 5 4 3
1 1 0 0
31415 92653 58979 32384
1000000000 1000000000 999999999 999999999
"""
TEST_T1 = """
>>> as_input(T1)
>>> main()
3
13
0
314095480
499999999500000000
"""


def _test():
    import doctest
    doctest.testmod()
    g = globals()
    for k in sorted(g):
        if k.startswith("TEST_"):
            doctest.run_docstring_examples(g[k], g, name=k)


def as_input(s):
    "use in test, use given string as input file"
    import io
    f = io.StringIO(s.strip())
    g = globals()
    g["input"] = lambda: bytes(f.readline(), "ascii")
    g["read"] = lambda: bytes(f.read(), "ascii")


input = sys.stdin.buffer.readline
read = sys.stdin.buffer.read

if sys.argv[-1] == "-t":
    print("testing")
    _test()
    sys.exit()

main()


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

#define fastio {\
    ios::sync_with_stdio(0);\
    cin.tie(0);\
}

#define file {\
    freopen("io\\in.txt", "r", stdin);\
    freopen("io\\out.txt", "w", stdout);\
    freopen("io\\err.txt", "w", stderr);\
}

#ifdef LOCAL
#define debug(args...) {\
    string _s(#args);\
    replace(_s.begin(), _s.end(), ',', ' ');\
    stringstream _ss(_s);\
    istream_iterator<string> _it(_ss);\
    debug1(_it, args);\
}

#pragma GCC diagnostic ignored "-Wunused-parameter"
void debug1(istream_iterator<string> it) {
    cerr << endl;
}
#pragma GCC diagnostic pop

template<class T, class... Args>
void debug1(istream_iterator<string> it, T a, Args... args) {
    cerr << '>' << *it << " = " << a << "; ";
    debug1(++it, args...);
}
#else
#define debug(args...)
#define cerr if (false) cerr
#endif

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using si = set<int>;
using ii = pair<int, int>;
using vii = vector<ii>;

#define rep(i, n)   for (int i = 0; i < n; i++)
#define dotc()      int tcs; if (cin >> tcs) rep(tc, tcs)
#define sz(x)       (int)x.size()
#define eb          emplace_back
#define pb          push_back
#define mp          make_pair
#define mt          make_tuple
#define all(x)      x.begin(), x.end()
#define rall(x)     x.rbegin(), x.rend()
#define fi          first
#define se          second

const int inf(0x3fffffff);
const int mod(1000000007);
const double pi(acos(-1.0));

signed main() {
    fastio;
#ifdef LOCAL
    file;
#endif

    int l, r, d;
    cin >> l >> r >> d;
    int cnt = 0;
    for (int i = l; i <= r; i++) {
        if (i % d == 0) cnt++;
    }
    cout << cnt;

    return 0;
}


Measured memory_bytes: 3608
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <unordered_map>
#define FILL(a, n, x) memset((a), (x), sizeof ((a)[0]) * (n))
#define COPY(a, n, b) memcpy((b), (a), sizeof ((a)[0]) * (n))
using namespace std;

typedef long long li;
const li infl = ~0LLU >> 2;

// template <class T>
// inline void Min(T &x, T y) {
//   if (y < x) x = y;
// }
// template <class T>
// inline void Max(T &x, T y) {
//   if (y > x) x = y;
// }

const li mod = (li)1e18 + 9;
inline li Add(li x) { return x >= mod ? x - mod : x; }
inline void Add(li &x, li y) { x += y; if (x >= mod) x -= mod; }
inline li Sub(li x) { return x < 0 ? x + mod : x; }
inline void Sub(li &x, li y) { x -= y; if (x < 0) x += mod; }

li Mul(li x, li y) {
  return Sub((x * y - (li)(x / (long double)mod * y + 1e-3L) * mod) % mod);
}

inline li Mul(li x, li y, li z) { return Mul(x, Mul(y, z)); }
li Pow(li x, li y) {
  li z = 1;
  for (; y; y >>= 1) {
    if (y & 1) z = Mul(z, x);
    x = Mul(x, x);
  }
  return z;
}
li Inv(li x) {
  return Pow(x, mod - 2);
}

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

const int maxn = 2.5e5;
const li base = 1000037, invbase = Inv(base);

li _pow[maxn * 2 + 1], *pow = _pow + maxn;

void Init(int n) {
  pow[0] = 1;
  for (int i = 1; i <= n; ++i) {
    pow[i] = Mul(pow[i - 1], base);
    pow[-i] = Mul(pow[-i + 1], invbase);
  }
}

int n;
char str[maxn + 1];
int delta[maxn + 1];
li sum[maxn + 1];

int main(void) {
  scanf("%d%s", &n, str);
  Init(n);
  delta[0] = 0;
  sum[0] = 0;
  for (int i = 1; i <= n; ++i) {
    switch (str[i - 1]) {
    case '+':
      delta[i] = delta[i - 1];
      sum[i] = Add(sum[i - 1] + pow[delta[i]]);
      break;
    case '-':
      delta[i] = delta[i - 1];
      sum[i] = Sub(sum[i - 1] - pow[delta[i]]);
      break;
    case '<':
      delta[i] = delta[i - 1] - 1;
      sum[i] = sum[i - 1];
      break;
    case '>':
      delta[i] = delta[i - 1] + 1;
      sum[i] = sum[i - 1];
      break;
    }
  }
  unordered_map<li, int> cnt;
  li ans = 0;
  for (int i = n; i >= 0; --i) {
    if (i < n) {
      li target = Add(sum[i] + Mul(pow[delta[i]], sum[n]));
      ans += cnt[target];
    }
    ++cnt[sum[i]];
  }
  printf("%lld\n", ans);
  return 0;
}


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

int main()
{
	int c0=0, c1=0, c2=0, c3=0;
	int n;
	string s;
	
	cin>>n;
	for(int i=0; i<n; i++){
		cin>>s;
		if(s=="AC")
		   c0++;
		else if(s=="WA")
		   c1++;
		else if(s=="TLE")
		   c2++;
		else
           c3++;
	}
    cout<<"AC x "<<c0<<endl
	    <<"WA x "<<c1<<endl
	    <<"TLE x "<<c2<<endl
        <<"RE x "<<c3<<endl;
	return 0;	   
}

Measured memory_bytes: 3636
#include <iostream>

using namespace std;

int main()
{
  int n; int a[100001];
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    int p;
    cin >> p;
    a[p] = i;
  }
  
  for (int i = 1; i <= n; ++i)
    cout << a[i] << ' ';
}

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

using namespace std;
#define long long long

const long N = 1e5 + 10;
const long MOD = 1e9 + 7;

long n, k;

int main()
{
//    freopen("tam.inp", "r", stdin);
    cin.tie(nullptr); ios_base::sync_with_stdio(false);

    cin >> n >> k;
    vector<int> a(n), dp(k + 1), tmp(k + 1);
    for (long i = 0; i < n; ++i) cin >> a[i];

    dp[0] = 1;
    for (int x : a) {
        long cur = 1;
        for (int i = 1; i <= k; ++i) {
            cur += dp[i];
            if (i - x - 1 >= 0) cur = (cur - dp[i - x - 1] + MOD) % MOD;
            tmp[i] = cur % MOD;
        }
        dp.swap(tmp);
        dp[0] = 1;
    }

    cout << dp.back();

    return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int rd(char c[]){
  int i, sz=0;
  for(;;){
    i = getchar_unlocked();
    if(i!=' '&&i!='\n'&&i!='\r'&&i!='\t'&&i!=EOF){
      break;
    }
  }
  c[sz++] = i;
  for(;;){
    i = getchar_unlocked();
    if(i==' '||i=='\n'||i=='\r'||i=='\t'||i==EOF){
      break;
    }
    c[sz++] = i;
  }
  c[sz]='\0';
  return sz;
}
void wt_L(const char c[]){
  int i=0;
  for(i=0;c[i]!='\0';i++){
    putchar_unlocked(c[i]);
  }
}
char in[4];
int main(){
  rd(in);
  if(in[0]=='9' || in[1]=='9'){
    wt_L("Yes");
    putchar_unlocked('\n');
  }
  else{
    wt_L("No");
    putchar_unlocked('\n');
  }
  return 0;
}
// cLay varsion 20170910-1

// --- original code ---
// char in[4];
// {
//   rd(in);
//   if(in[0]=='9' || in[1]=='9') wt("Yes"); else wt("No");
// }


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);

        String str = scan.next();

        for(int i = 0; i < str.length(); i++){
            char a = str.charAt(i);
            for(int j = 0; j < 3; j++){
                if(a == 'A'){
                    a = 'Z';
                }else{
                    a = (char)(a-1);
                }
            }
            System.out.print(a);
        }

        System.out.println();

    }

}


Measured memory_bytes: 27048
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        double a = sc.nextDouble();
        double b = sc.nextDouble();
        
        if(a > b) System.out.println("GREATER"); else if(a < b) System.out.println("LESS"); else System.out.println("EQUAL");
        
        
        
    }
}


Measured memory_bytes: 23124
n = int(input())
s = list(input())

ans = s.count("R") * s.count("G") * s.count("B")

for i in range(n):
  for j in range(n):
    if not i < j:
      continue
    k = j + (j-i)
    if k < n and "".join(sorted([s[i], s[j], s[k]])) == "BGR":
      ans -= 1

print(ans)      
    

Measured memory_bytes: 74512
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <cmath>
#include <iomanip>
#include <functional>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define REP(i, n) for (int i = 1; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) (int)(x).size()
using namespace std;
using ll = long long;
constexpr int inf = 1000000000;
constexpr ll INF = 5000000000000000000;

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

int main() {
    int p;
    cin >> p;
    mod = p;
    vector<ModInt> a(p, ModInt{0});
    rep(i, p) cin >> a[i];
    
    vector<ModInt> x(p, ModInt{0});
    rep(i, p) x[i] = ModInt{i};
    vector<ModInt> c(p, ModInt{0});
    rep(i, p) {
        ModInt seki(1);
        rep(j, p) {
            if (i == j) continue;
            seki *= (x[i] - x[j]);
        }
        c[i] = a[i] / seki;
    }
    vector<ModInt> s(p + 1, ModInt{0});
    s[1] = ModInt{1};
    REP(i, p) {
        vector<ModInt> n(p + 1, ModInt{0});
        rep(j, p) {
            n[j] += (-x[i] * s[j]);
            n[j + 1] += s[j];
        }
        swap(s, n);
    }
    
    vector<ModInt> ans(p, ModInt{0});
    rep(i, p) {
        vector<ModInt> vec = s;
        reverse(ALL(vec));
        vector<ModInt> res(p, ModInt{0});
        rep(j, p) {
            res[j] = vec[j];
            vec[j] -= res[j];
            vec[j + 1] -= res[j] * (-x[i]);
        }
        reverse(ALL(res));
        rep(j, p) ans[j] += c[i] * res[j];
    }
    rep(i, p) cout << ans[i] << "\n";
    return 0;
}


Measured memory_bytes: 3788
#include<iostream>
#include<cstring>
#include<cstdio>
#include<vector>
#define MN 200000
#define N 262144
using namespace std;
inline int read()
{
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
vector<int> v[MN+5];
int n,m,a[MN+5],num[MN+5],f[MN+5],T[N*2+5];
inline void Renew(int x,int v){for(x+=N+1;T[x]=min(T[x],v),x>>=1;);}
inline int Query(int l,int r)
{
    int res=1e9;
    for(l+=N,r+=N+2;l^r^1;l>>=1,r>>=1)
    {
        if(~l&1) res=min(res,T[l+1]);
        if( r&1) res=min(res,T[r-1]);
    }
    return res;
}
int main()
{
    n=read();
    for(int i=1;i<=n;++i) num[i]=num[i-1]+1-(a[i]=read()),f[i]=1e9;
    m=read();memset(T,63,sizeof(T));
    for(int i=1;i<=m;++i)
    {
        int l=read(),r=read();
        v[l-1].push_back(r);
    }
    for(int i=0;i<n;++i)
    {
        f[i+1]=min(f[i+1],f[i]+a[i+1]);
        for(int j=0;j<v[i].size();++j)
        {
            int V=min(f[i]+num[v[i][j]]-num[i],Query(i,v[i][j])+num[v[i][j]]);
            f[v[i][j]]=min(f[v[i][j]],V);
            Renew(v[i][j],V-num[v[i][j]]);
        }
    }
    printf("%d",f[n]);
    return 0;
}


Measured memory_bytes: 13312
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long power = 1;
		for(int i = 1 ; i <= N ; i++) {
			power = power * i % (1000000007);
		}
		System.out.println(power);
	}
}


Measured memory_bytes: 21716
#include<bits/stdc++.h>
using namespace std;
int main() {
	string S; cin >> S;
	int cnt_1 = 0, cnt_0 = 0;
	for (int i = 0; i < S.size(); i++) {
		if (S[i] == '0') cnt_0++;
		else cnt_1++;
	}
  //cout<<cnt_1<<cnt_0;
	cout << min(cnt_1, cnt_0) * 2 << endl;
}

Measured memory_bytes: 512
INF = 10 ** 9
n, k = gets.split.map(&:to_i)
nums = gets.split.map(&:to_i)

ans = (1..INF).bsearch { |min_length|
  cut_count = nums.inject(0) { |res, num| res + (num / min_length.to_f).ceil - 1 }
  cut_count <= k
}

puts ans


Measured memory_bytes: 27956
#include <bits/stdc++.h>
using namespace std;
#define repl(i, l, r) for (ll i = (l); i < (r); i++)
#define rep(i, n) repl(i, 0, n)
#define CST(x) cout << fixed << setprecision(x)
using ll = long long;
const ll MOD = 1000000007;
const int inf = 1e9 + 10;
const ll INF = 4e18 + 10;
const int dx[9] = {1, 0, -1, 0, 1, -1, -1, 1, 0};
const int dy[9] = {0, 1, 0, -1, 1, 1, -1, -1, 0};
int main() {
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);

	ll a[2], b[2];
	rep(i, 2) cin >> a[i];
	rep(i, 2) cin >> b[i];
	ll ans = -INF;
	rep(i, 2) rep(j, 2) ans = max(ans, a[i] * b[j]);
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3644
#include <stdio.h>
#include <string.h>
typedef long long ll;
using namespace std;

ll gcd(ll a, ll b) {
  ll t;
  while(b) {
    t = a % b;
    a = b;
    b = t;
  }
  return a;
}

int main(void) {
  ll i, j, k, n, m, min = 1e15, ans;
  scanf("%lld%lld", &n, &m);
  ll x[n];
  for(i = 0; i < n; ++i) {
    scanf("%lld", &x[i]);
    if(min > x[i]) min = x[i];
  }
  min = min > m ? m : min;
  m -= min;
  ans = m;
  for(i = 0; i < n; ++i) ans = gcd(ans, x[i] - min);
  printf("%lld", ans);
  return 0;
}

Measured memory_bytes: 896
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int n;
long long c[101][101];

int main(void){
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			scanf("%lld",&c[j][i]);
		}
	}
	long long cnt=0;
	for(int i=0;i<n;i++){
		for(int j=i+1;j<n;j++){
			cnt+=min(c[i][j],c[j][i]);
		}
	}
	printf("%lld\n",cnt);
	return 0;
}

Measured memory_bytes: 1108
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#include<iomanip>
#include<set>
#include<utility>
using namespace std;
#define FOR(i, a, b) for(int i=(a); i<(b);  i++)
#define REP(i, n)    for(int i=0;   i<(n);  i++)
#define REP1(i, n)   for(int i=1;   i<=(n); i++)
#define pb push_back
#define mp make_pair
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define EPS 1e-7
#define ALL(obj) (obj).begin(), (obj).end()
using ul    = unsigned long;
using ll    = long long;
using ld    = long double;
using vint  = vector<int>;
using vll   = vector<ll>;
using pint  = pair<int, int>;
using pll   = pair<ll, ll>;
using vpint = vector<pint>;
using vpll  = vector<pll>;
const int INF = (int)1e9 + 1;
const int MOD = (int)1e9 + 7;
#define INT(argu) (int)(argu+eps)

int n, x;

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

  scan(n>>x);
  vint l(n);
  REP(i, n) scan(l[i]);

  int d=0;

  int cnt =1 ;
  REP(i, n){
    d += l[i];
    if(d<=x) cnt++;
  }

  cout << cnt << endl;

  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(){
  int n, i, j; scanf("%d", &n);
  int h[20] = {};
  int count = 0;
  
  for(i = 0; i < n; i++){
    scanf("%d", &h[i]);
    if(i == 0) count++;
    else{
      int flag = 1;
      for(j = 0; j < i; j++){
	if(h[j] > h[i]) flag = 0;
      }
      if(flag == 1) count++;
    }
  }

  printf("%d\n", count);

  return 0;
}


Measured memory_bytes: 128
N = int(input())
a = [int(input()) for _ in range(N)]

a.sort()
sum_a = sum(a)
d = sum_a

for i in range(N):
    if a[i]%10 != 0:
        d = a[i]
        break

if sum_a%10 != 0:
    ans = sum_a
else:
    ans = sum_a-d

print(ans)

Measured memory_bytes: 3060
#include <iostream>
#include <stdio.h>
#include <bits/stdc++.h>
#include <vector>
#include <cmath>
#define rep(i,n) for(ll i=0;i<n;i++)
typedef long long ll;
using namespace std;

const ll MAX = 1000000;
const ll MOD = 1000000007;

ll fac[MAX];

// テーブルを作る前処理
/*
void COMinit() {
    fac[0] = fac[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
    }
}
*/

ll pow_kai(ll a,ll n){//aのn乗を計算します。
  ll x = 1;
  while(n > 0){//全てのbitが捨てられるまで。
    if(n&1){//1番右のbitが1のとき。
      x = x*a%MOD;
    }
    a = a*a%MOD;
    n >>= 1;//bit全体を右に1つシフトして一番右を捨てる。
  }
  return x;
}

// 二項係数計算
ll COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    ll tmp=1;
    for(ll i=n;i>=n-k+1;i--) tmp = (tmp*i)%MOD;

    return (tmp * pow_kai(fac[k],MOD-2)) % MOD;
}

void chmax(ll &a,const ll &b){
    if(a<b) a=b;
}
void chmin(ll &a,const ll &b){
    if(a>b) a=b;
}


int main()
{

    char X;
    cin >>X;

    if('a'<=X && X<='z'){
        cout << "a" <<endl;
    }else{
        cout << "A" << endl;
    }
    



    return 0;


}

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

using namespace std;

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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,n) for(int i=1;i<=(int)(n);i++)
#define rep3(i,n) for(int i=0;i<=(int)(n);i++)
#define REP(i,m,n) for(int i=m;i<(int)(n);i++)
#define repll(i,n) for(ll i=0;i<(ll)(n);i++)
#define repll2(i,n) for(ll i=1;i<=(ll)(n);i++)
#define REPLL(i,m,n) for(ll i=m;i<(ll)(n);i++)
#define INF (int)1e9  //
#define LINF (ll)4e18  //
#define MOD (int)(1e9)+7
#define MP make_pair
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define yes(n) cout << ((n) ? "yes" : "no"  ) << endl
#define PI 3.1415926535898

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

int main() {
    int n;
    cin >> n;
    int a[n];
    rep(i, n) cin >> a[i];

    int cnt = 0;
    int button = 0;
    while (1) {
        cnt++;
        button = a[button] - 1;
        if (button == 1) {
            cout << cnt << endl;
            return 0;
        }
        if (cnt == 1000000) {
            cout << -1 << endl;
            return 0;
        }
    }

}



Measured memory_bytes: 640
#include <stdio.h>


int main()
{
    int n,m;scanf("%d%d",&n,&m);
    int flag[n+1],rec2[m];bool rec1[m];
    for (int i=1;i<=n;++i) flag[i]=0;

    for (int i=0;i<m;++i){
        int tmp;char st[10];
        scanf("%d%s",&tmp,st);
        if (st[0]=='A'){
            rec1[i]=1;
            flag[tmp]=1;
        }
        else rec1[i]=0;
        rec2[i]=tmp;
    }
    int ans1=0,ans2=0;
    for (int i=0;i<m;++i){
        if (flag[rec2[i]] && rec1[i]==0) ++ans2;
        if (flag[rec2[i]] && rec1[i]==1) ++ans1,flag[rec2[i]]=0;
    }
    printf("%d %d\n",ans1,ans2);

}


Measured memory_bytes: 1024
#include<stdio.h>

int main(void)
{
  double r, l, S;

  scanf("%lf", &r);

  l = 2 * r * 3.141592653589;
  S = r * r * 3.141592653589;
  
  printf("%lf %lf\n", S, l);

  return 0;
}



Measured memory_bytes: 2140
import std.stdio;
import std.conv, std.array, std.algorithm, std.string;
import std.math, std.random, std.range, std.datetime;
import std.bigint;
import std.container;
string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }

void main(){
	long n = read.to!long;
	long[] as = readln.split.map!(to!long).array;
	
	int oddcount;
	int x4count;
	foreach(a; as){
		if(a % 4 == 0) x4count += 1;
		if(a % 2 == 1) oddcount += 1;
		}
	
	string ans;
	if(oddcount + x4count == n){
		if(oddcount - 1 <= x4count) ans = "Yes"; 
		else ans = "No";
		}
	else{
		if(oddcount <= x4count) ans = "Yes"; 
		else ans = "No";
		}
	
	ans.writeln;
	}
	


Measured memory_bytes: 4404
S = list(input())
cnt = 0
cnt2 = 0
for i in range(len(S)//2):
    if S[i]==S[len(S)-i-1]:
        cnt+=1
if cnt==len(S)//2:
    for j in range(len(S)//4):
        if S[j]==S[len(S)//2-j-1] and S[len(S)-1-j]==S[len(S)//2+j+1]:
            cnt2+=1
if cnt2==len(S)//4:
    print('Yes')
else:
    print('No')

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

typedef struct node list;

struct node {
    int key;
    list *next;
    list *prev;
};

list *head, *tail;

void insert(int key) {
    list *new;
    new = (list*)malloc(sizeof(list));
    new->key = key;
    new->next = head->next;
    new->prev = head;
    head->next = new;
    new->next->prev = new;
}

void del(int key) {
    list *t = head->next, *prev = head;
    while(t != tail && t->key != key) {
        prev = t;
        t = t->next;
    }

    if (t != tail) {
        prev->next = t->next;
        t->next->prev = prev;
        free(t);
    }
}

void del_first() {
    list *first = head->next;
    head->next = first->next;
    first->next->prev = head;
    free(first);
}

void del_last() {
    list *last = tail->prev;
    tail->prev = last->prev;
    last->prev->next = tail;
    free(last);
}

void show() {
    list *t = head->next;
    while(t != tail) {
        printf("%d%c", t->key, ((t->next == tail) ? '\n' : ' '));
        t = t->next;
    }
}

int main() {
    int i, n;
    char command[20];
    int key;

    scanf("%d", &n);

    head = (list*)malloc(sizeof(list));
    tail = (list*)malloc(sizeof(list));
    head->key = tail->key = -1;
    head->next = tail;
    tail->prev = head;
    head->prev = tail->next = NULL;

    for(i = 0; i < n; i++) {
        scanf("%s", command);
        if (strcmp(command, "insert") == 0) {
            scanf("%d", &key);
            insert(key);
        } else if (strcmp(command, "delete") == 0) {
            scanf("%d", &key);
            del(key);
        } else if (strcmp(command, "deleteFirst") == 0) {
            del_first();
        } else if (strcmp(command, "deleteLast") == 0) {
            del_last();
        }
    }

    show();
    return 0;
}

Measured memory_bytes: 33080
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>

using namespace std;


int main() {

	int x,n;
	cin >> x;
	vector<int> num(x,0);
	num[0] = 1;
	for (int i = 1; i < x;i++) {
		if (num[i-1] != 0) continue;
		n = i;
		while(n < x) {
			n *= i;
			if (n <= x) {
				num[n - 1] = n;
			}
		}
	}
	sort(num.begin(), num.end(), greater<int>());
	cout << num[0];

	return 0;
}

Measured memory_bytes: 256
N = int(input())
for h in range(1, 3501):
    for n in range(1, 3501):
        bunshi = N * h * n
        bunbo = 4 * h * n - N * n - N * h
        if bunbo > 0 and bunshi % bunbo == 0:
            print("{} {} {}".format(h, n, bunshi // bunbo))
            exit()

Measured memory_bytes: 40556
inputs = [int(x) for x in input().split()]

N = inputs[0]
D = inputs[1]
answer = 0
if N > (D*2) + 1:
  check = N % ((D*2) + 1)
  answer = N / ((D*2) + 1) 
  answer = int(answer)
  if check != 0:
    answer += 1
  
else:
  answer = 1
  
print(answer)

Measured memory_bytes: 3064
//Love and Freedom.
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<bitset>
#define inf 20021225
#define ll long long
#define mdn 998244353
using namespace std;

bitset<310> r[310],a[310]; int n,m;
int gauss()
{
	int w = 0;
	/**for(int i=1,j;i<=min(n,m);i++)
	{
		if(!r[i][i])
		{
			for(j=i+1;j<=n;j++)
				if(r[j][i])	break;
			if(j>n)	continue;
			swap(r[i],r[j]);
		}
		for(j=i+1;j<=n;j++)
			if(r[j][i])	r[j]^=r[i];
	}
	for(int i=1;i<=min(n,m);i++)	if(r[i][i])	w++;*/
	for(int i=1;i<=n;i++)
	{
		for(int j=m;j;j--)
		{
			if(!r[i][j])	continue;
			if(!a[j].any())
			{
				a[j]^=r[i],w++;
				break;
			}
			else	r[i]^=a[j];
		}
	}
	return w;
}
int ksm(int bs,int mi)
{
	int ans = 1;
	while(mi)
	{
		if(mi&1)	ans=(ll)ans*bs%mdn;
		bs=(ll)bs*bs%mdn; mi>>=1;
	}
	return ans;
}
int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++)
		for(int j=1;j<=m;j++)
		{
			int x;scanf("%d",&x);
			r[i][j] = x;
		}
	int ans = ksm(2,n+m-1)-ksm(2,n+m-1-gauss());
	printf("%d\n",(ans+mdn)%mdn);
	return 0;
}

Measured memory_bytes: 128
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define For(i,a,b) for(int i=a;i<=b;i++)
#define F first
#define S second
#define all(x) x.begin(),x.end()
#define sz(x) ((int)x.size())
#define MOD (ll)(1e9+7)
#define INF 1e17
#define int ll
#define EPS (1e-6)
using namespace std;
using ll=long long;
using pii=pair<int,int>;

int gcd(int a,int b) { return b==0?a:gcd(b,a%b); }
int lcm(int a,int b) { return a/gcd(a,b)*b; }

int fpow(int b,int p)
{
	if(p==0) return 1;
	int h=fpow(b,p/2);
	if(p%2) return h*b%MOD*h%MOD;
	return h*h%MOD;
}

int32_t main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	int n,m; cin>>n>>m;
	vector<string> in(n);
	vector<bool> a(n,false),b(m,false);
	For(i,0,n-1){
		cin>>in[i];
		For(j,0,m-1){
			if(in[i][j]=='#'){
				a[i]=true; b[j]=true;
			}
		}
	}
	For(i,0,n-1){
		For(j,0,m-1){
			if(a[i] && b[j]) cout<<in[i][j];
		}
		if(a[i])cout<<"\n";
	}
	return 0;
}





























Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using pint = pair<int,int>;
ll mod = 1000000007,mod2 = 998244353;

void chmin(long long &a, long long b) { if (a > b) a = b; }
void chmax(long long &a, long long b) { if (a < b) a = b; }
//void chmin(int &a, int b) { if (a > b) a = b; }
//void chmax(int &a, int b) { if (a < b) a = b; }

const long long INF = 1LL<<60;
ll gcd(ll a,ll b){
    if(b == 0) return a;
    else return gcd(b,a%b);
}

//重みある時
using Edge = pair<int,int>;
using Graph = vector<vector<Edge> >;

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


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

int main() {
    int k, s;
    cin >> k >> s;
    int count = 0;

    for(int x = 0; x <= k; x++)
        for(int y = 0; y <= k; y++) {
            int z  = s - x - y;

            if(z >= 0 && z <= k) 
                count++;
    }

    cout << count << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
#include <iostream>
#include <cctype>
#include <algorithm>
#include <cstdlib>
#define LL long long
#define N 100010
using namespace std;
LL L, a[N];
int n;
int main(){
	int i, j;
	scanf("%d%I64d", &n, &L);
	for (i = 1; i <= n; ++ i) scanf("%I64d", &a[i]);
	int id = -1;
	for (i = 1; i < n; ++ i){
		if (a[i] + a[i + 1] >= L) id = i;
	}
	if (id != -1){
		puts("Possible");
		for (i = 1; i < id; ++ i)
			printf("%d\n", i);
		for (i = n - 1; i >= id; -- i)
			printf("%d\n", i);
	}else puts("Impossible");
	return 0;
}

Measured memory_bytes: 1536
use std::io::Read;
use std::vec::Vec;

macro_rules! get {
    // 1行 1数値を取得する。
    ($t: ty) => {{
        let mut line: String = String::new();
        std::io::stdin().read_line(&mut line).unwrap();
        line.trim().parse::<$t>().unwrap()
    }};
    // 1行n数値を、全部同じ型でパースしてVecで返す。
    ($t:ty ;;) => {{
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace().map(|text| text.parse::<$t>().unwrap()).collect::<Vec<_>>()
    }};
}

fn main() {
    let N = get!(i32);
    let vec: Vec<i32> = get!(i32 ;;);
    
    let mut count = 0;
    let mut multiple_of_two = 2;


    'outer: loop{
        let vec = vec.clone();
        for i in vec{
            match i % multiple_of_two == 0{
                true => (),
                false => break 'outer,
            };
        }
        count += 1;
        multiple_of_two *= 2;
    }
    println!("{}", count)

}


Measured memory_bytes: 4352
import java.util.*;
import java.io.*;
class Main {
	public static void main (String[] args) throws java.lang.Exception {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(), b = sc.nextInt();
		System.out.println(a < b ? "a < b" : a > b ? "a > b" : "a == b");
	}
}

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

public class Main {
    void run() {
        int LA = readInt();
        int LB = readInt();
        int[] A = new int[LA];
        int[] B = new int[LB];
        for (int i = 0; i < LA; i++) {
            A[i] = readInt();
        }
        for (int i = 0; i < LB; i++) {
            B[i] = readInt();
        }
        int ans = 0;
        for (int i = 0; i < LB; i++) {
            int p = 0;
            int k = i;
            while (p < LA && k < LB) {
                if (A[p] == B[k]) {
                    ++k;
                }
                p++;
            }
            ans = Math.max(ans, k - i);
        }
        sysout.println(ans);
    }

    public static void main(String[] args) {
        new Main().run();
    }

    // flush automatically iff you call `println` or `printf` or `format`.
    PrintWriter sysout = new PrintWriter(System.out, true);

    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer buffer = null;

    String read() {
        if (buffer == null || !buffer.hasMoreTokens()) {
            try {
                buffer = new StringTokenizer(in.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return buffer.nextToken();
    }

    int readInt() {
        return Integer.parseInt(read());
    }

    long readLong() {
        return Long.parseLong(read());
    }

    double readDouble() {
        return Double.parseDouble(read());
    }

    String readLine() {
        buffer = null;
        try {
            return in.readLine();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}

Measured memory_bytes: 26472
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int A = scanner.nextInt();
		int B = scanner.nextInt();
		int C = scanner.nextInt();
		int X = scanner.nextInt();
		scanner.close();
		int ans = 0;
		for (int a = 0; a <= A; a++) {
			for (int b = 0; b <= B; b++) {
				for (int c = 0; c <= C; c++) {
					if (a*500 + b*100 + c*50 == X) {
						ans++;
					}
					if (a*500 + b*100 + c*50 >= X) {
						break;
					}
				}
				if (a*500 + b*100 >= X) {
					break;
				}
			}
			if (a*500 >= X) {
				break;
			}
		}
		System.out.println(ans);
	}
	
}

Measured memory_bytes: 21844
// 失敗するからこそ そこから立ち向かって行く強さがあってそんな強さが本当の強さだと私は思うから
// ぜったいあきらめない
#if defined(DAIJOBU)
#include "/home/ichigo/includes.hpp"
#include "PP.hpp"
#define deb(x...) cerr << "[" << #x << "] = " << x << "\n";
#else
#include <bits/stdc++.h>
#define deb(x...)
#endif
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long lint;
typedef vector<lint> vlint;
typedef vector<vlint> vvlint;
typedef pair<lint, lint> plint;
typedef double ld;

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

int main() {
    ios::sync_with_stdio(false);
	cin.tie(0);
	
	string s;
	cin >> s;
	if(s > "2019/04/30")puts("TBD");
	else puts("Heisei");
	return 0;
}



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

using namespace std;

typedef pair<int, int> P;

int memo[16][16];

int Solve(int n, int d, int maxd, const vector<P>& score) {
  if (d >= maxd) {
    return 0;
  }  
  if (n == score.size()) {
    return 0;
  }
  if (memo[n][d] != 0) {
    return memo[n][d];
  }
  
  int r1 = 0, r2 = 0;
  if (maxd - d >= 2 && score[n].second == 2) {
    r1 = score[n].first + Solve(n + 1, d + 2, maxd, score);
  } 
  if (score[n].second == 1) {
    r2 = score[n].first + Solve(n + 1, d + 1, maxd, score);
  }
  int r = max(r1, r2);
  
  return memo[n][d] = max(r, Solve(n + 1, d, maxd, score));
}

int main() {
  int d, x;
  cin >> d >> x;
  
  vector<P> score;
  for (int i = 0; i < x; i++) {
    char a; int p;
    cin >> a >> p;
    if (a == 'D') {
      score.push_back(P(p, 1));
    }
  }
  int y;
  cin >> y;
  for (int i = 0; i < y; i++) {
    string bc; int q;
    cin >> bc >> q;
    if (bc == "DD") {
      score.push_back(P(q, 2));
    }
  }

  cout << Solve(0, 0, d, score) << endl;
  
  return 0;
}

Measured memory_bytes: 3156