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

int main() {
  int n,m;
  cin>>n>>m;
  vector<int> vec(m+1);
  for(int i=0;i<m;i++){
    cin>>vec.at(i);
  }
  int a=0;
  vector<int> answer(n+5);
  answer.at(0)=1;
  answer.at(1)=1;
  if(vec.at(a)==1){
    answer.at(1)=0;
    a++;
  }
  for(int i=2;i<n+1;i++){
    answer.at(i)=answer.at(i-1)+answer.at(i-2);
    answer.at(i)=answer.at(i)%1000000007;
    if(vec.at(a)==i){
      answer.at(i)=0;
      a++;
    }
  }
  cout<<answer.at(n)<<endl;
}

Measured memory_bytes: 1024
#include<queue>
#include<stack>
#include<math.h>
#include<cmath>
#include<bitset>
#include<stdio.h>
#include<string>
#include<map>
#include<algorithm>
#include<vector>
#include<iostream>
#include<utility>
#include<functional>
#include<deque>
#include<list>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int main(){
  int n,i;
  cin >> n;
  string s;
  map<string,int> mp;
  for(i=0;i<n;i++){
    cin >> s;
    mp[s]++;
  }
  printf("AC x ");
  cout << mp["AC"] << endl;
  printf("WA x ");
  cout << mp["WA"] << endl;
  printf("TLE x ");
  cout << mp["TLE"] << endl;
  printf("RE x ");
  cout << mp["RE"] << endl;
}

Measured memory_bytes: 3728
#include <iostream>
#include <string> 
#include <vector> 
#include <algorithm> 
#include <utility> 
#include <tuple> 
#include <cstdint> 
#include <cstdio> 
#include <map> 
#include <queue> 
#include <set> 
#include <stack> 
#include <deque> 
#include <unordered_map> 
#include <unordered_set> 
#include <bitset> 
#include <cctype> 
#include<math.h>
using namespace std;

#define int long long
#define endl "\n"
#define fir first
#define sec second
#define fro front
#define m_p make_pair
#define mod 1000000007
#define rep(i,n)  for(int i=0; i<(int) (n); i++)
#define all(v)  v.begin(),v.end()
#define vecin(v) for(int i=0; i<(int)v.size(); i++)cin>>v[i];
using namespace std;

const int MAX = 510000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
int jousu(int x00, int y00) {
	int z00 = 1;
	for (int i = 0; i < y00; i++) {
		z00 *= x00;
	}
	return z00;
}
int keta(int x00) {
	int z00 = x00;
	int w00 = 0;
	while (z00 != 0) {
		z00 /= 10;
		w00++;
	}
	return w00;
}

int modinv(int a, int m) {
	int b = m, u = 1, v = 0;
	while (b) {
		int 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 modpow(int a, int n) {
	int res = 1;
	while (n > 0) {
		if (n & 1) res* a% mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}
int gcd(int xx, int yy) {
	int p = xx;
	int q = yy;
	if (q > p)swap(p, q);
	while (p % q != 0) {
		p %= q;
		swap(p, q);
	}
	return q;
}
int lcm(int xx, int yy) {
	return xx * yy / gcd(xx, yy);
}
bool prime(int xx) {
	int a = xx;
	for (int i = 2; i * i <= xx; i++) {
		if (xx % i == 0) {
			return 0;
		}
	}
	return 1;
}
int com(int xx, int yy) {
	int zz = 1;
	for (int i = xx; i > xx - yy; i--) {
		zz *= i;
		zz %= mod;
	}
	for (int i = 1; i <= yy; i++) {
		zz *= modinv(i, mod);
		zz %= mod;
	}
	return zz;
}


signed main() {
	int n,a=0,b=0,c=0;
	cin >> n;
	vector<int>vec(n), vec1(n / 2), vec2(n / 2), vec3(n / 2);
	vecin(vec);
	if (n % 2 == 0) {
		for (int i = 0; i < n / 2; i++) {
			vec1[i] = vec[n - i * 2 - 1];
			vec2[i] = vec[n - i * 2 - 2];
		}
		for (int i = 0; i < n / 2; i++) {
			a += vec1[i];
			b += vec2[i];
			b = max(a, b);
		}
		cout << b << endl;
	}
	else {
		for (int i = 0; i < n / 2; i++) {
			vec1[i] = vec[n - i * 2 - 1];
			vec2[i] = vec[n - i * 2 - 2];
			vec3[i] = vec[n - i * 2 - 3];
		}
		for (int i = 0; i < n / 2; i++) {
			a += vec1[i];
			b += vec2[i];
			c += vec3[i];
			b = max(a, b);
			c = max(b, c);
		}
		cout << c << endl;
	}
}





Measured memory_bytes: 7188
#include<bits/stdc++.h>
using namespace std;
#define ll long long
map<ll,ll> mp;
ll fun(ll h){
	if(mp.find(h)!=mp.end()){
		return mp[h];
	}
	ll x=fun(h/2);
	mp[h]=1+2*x;
	return mp[h];
}
int main(){
	mp.clear();
	mp[0]++;
	mp[0]=0;
	mp[1]++;
	mp[1]=1;
	ll h;
	cin>>h;
	cout<< fun(h);
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int len;
char s[100005];
int main()
{
    cin>>s;
    len=strlen(s);
    if(s[0]==s[len-1])
    {
        if(len%2==0)
            printf("First\n");
        else
            printf("Second\n");
    }
    else
    {
        if(len%2==0)
            printf("Second\n");
        else
            printf("First\n");
    }
    return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <string>

using namespace std;

int main() {
	string s;
	long long int a;
	cin >> a;
	char c;
	while (cin >> c) {
		if (c == '=') {
			break;
		}
		long long int b;
		cin >> b;
		if (c == '+') {
			a += b;
		} else if (c == '-') {
			a -= b;
		} else if (c == '*') {
			a *= b;
		} else {
			a /= b;
		}
	}
	cout << a << endl;
	return 0;
}

Measured memory_bytes: 1156
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define all(x) x.begin(), x.end()
#define boost() ios_base :: sync_with_stdio(0); cin.tie(); cout.tie(); cout << fixed; cout << setprecision(15); srand(time(NULL))
#define endl '\n'
typedef long long ll;
const int _N = 1e5 + 11;
const ll INF = 1e18;
const ll MOD = 1e9 + 7;

long long C[55][55], n, a, b, v[55], res = 0;

int main() {
	boost();	
//	freopen("in", "r", stdin);
	for (int i = 0; i < 55; i++) C[i][0] = 1;
	for (int i = 1; i < 51; i++) {
		for (int j = 1; j < 51; j++) {
			C[i][j] = C[i - 1][j] + C[i - 1][j - 1];
		}
	}
	cin >> n >> a >> b;
	for (int i = 1; i <= n; i++) cin >> v[i];
	sort(v + 1, v + 1 + n); reverse(v + 1, v + n + 1);
	ll sum = 0;
	for (int i = 1; i <= a; i++) sum += v[i];
	cout << (double)sum / (double)a << endl;
	ll sum1 = 0;
	for (int i = 1; i <= n; i++) {
		sum1 += v[i];
		if (a <= i && i <= b) {
			if (sum * (ll)i == sum1 * a) {
				ll k = v[i], x = 0, y = 0;
				for (int j = 1; j <= i; j++) {
					if (k == v[j]) x += 1;
				}
				for (int j = i + 1; j <= n; j++) {
					if (k == v[j]) y += 1;
				}
				res += C[x + y][x];
			} 
		}
	}
	cout << res << endl;
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <time.h>
#include <limits.h>
int main(int argc, char const *argv[]) {
  int a,b,c;
  scanf("%d %d %d",&a,&b,&c);
  printf("%d\n", 3-(a==b)-(b==c)-(c==a)+(a==b&&b==c));
  return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;

#define REP(i, n) for (int i = 0; i < (int)(n); ++i)

int main() {
    int X, Y, Z, K;
    while (cin >> X >> Y >> Z >> K) {
        vector<long long> A(X), B(Y), C(Z);
        REP(i, X) cin >> A[i];
        REP(i, Y) cin >> B[i];
        REP(i, Z) cin >> C[i];
        sort(A.begin(), A.end(), greater<long long>());

        vector<long long> BC;
        REP(y, Y) REP(z, Z) BC.push_back(B[y] + C[z]);
        sort(BC.begin(), BC.end(), greater<long long>());

        vector<long long> ABC;
        REP(x, X) REP(k, min(K, (int)BC.size())) {
            ABC.push_back(A[x] + BC[k]);
        }
        sort(ABC.begin(), ABC.end(), greater<long long>());

        REP(k, K) cout << ABC[k] << '\n';
    }
}

Measured memory_bytes: 42984
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        Map<Integer,Integer> m = new HashMap<>();

        for (int i = 0; i < n; i++) {
            int a = scanner.nextInt();
            if (m.containsKey(a)) {
                m.put(a, m.get(a) + 1);
            }else {
                m.put(a,1);
            }
        }

        int ans = 0;
        for (int it : m.values()){
            if(it % 2 == 1) ans++;
        }
        System.out.println(ans);
    }
}

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

int main(){
    long long a,b,c,A,B,C;
    long long count = 0;
    cin >> a >> b >> c;
    if(a%2==0&&b%2==0&&c%2==0&&a==b&&b==c){
        count = -1;
        a = 1;
    }
    while(a%2==0&&b%2==0&&c%2==0){
            A = a/2;
            B = b/2;
            C = c/2;
            a = B+C;
            b = A+C;
            c = A+B;            
            count++;
    }
    cout << count << endl;

}

Measured memory_bytes: 3532
#include <stdio.h>
#include <math.h>

int s[1002];

#define gc() getchar_unlocked()
int in()
{
	int n = 0, c = gc();
	do n = 10*n + (c & 0xf), c = gc();
	while (c >= '0');
	return n;
}

int main()
{
	int n, i, is;
	double m, fs, a;
	
	while (n = in()) {
		is = 0; for (i = 0; i < n; i++) is += s[i] = in();
		m = (double)is/n;
		fs = 0; for (i = 0; i < n; i++) {
			a = s[i]-m;
			fs += a*a;
		}
		printf("%.8lf\n", sqrt(fs/n));
	}
	return 0;
}


Measured memory_bytes: 2036
#include<bits/stdc++.h>
using namespace std;
int main(){
  int a;
  cin >> a;
  if(400<=a && a<=599)cout << 8 << endl;
    if(600<=a && a<=799)cout << 7 << endl;
    if(800<=a && a<=999)cout << 6 << endl;  
    if(1000<=a && a<=1199)cout << 5 << endl;
    if(1200<=a && a<=1399)cout << 4 << endl;
      if(1400<=a && a<=1599)cout << 3 << endl;
      if(1600<=a && a<=1799)cout << 2 << endl;
      if(1800<=a && a<=1999)cout << 1 << endl;
}

Measured memory_bytes: 3564
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>

constexpr int INFI = 1145141919;

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

    int N;
    std::cin >> N;

    std::vector<int> a;
    for(int i=0; i<N; i++){
        int buf;
        std::cin >> buf;
        buf = buf - 1;
        a.push_back(buf);
    }

    int light=0;
    for(int i=0; i<N; i++){
        if(light==1){
            std::cout << i;
            return 0;
        }
        light=a.at(light);
    }

    std::cout << -1;

    return 0;
}


Measured memory_bytes: 892
from collections import deque
N, Q = map(int, input().split())
A = [[] for i in range(N)]
for i in range(N - 1):
  a, b = map(int, input().split())
  A[a-1].append(b-1)
  A[b-1].append(a-1)
B = [[0, -1] for i in range(N)]
for i in range(Q):
  p, x = map(int, input().split())
  B[p-1][0] += x
d = deque([0])
while len(d) != 0:
  x = d.popleft()
  for a in A[x]:
    if a == B[x][1]:
      continue
    B[a][1] = x
    B[a][0] += B[x][0]
    d.append(a)
for i in range(N):
  print(B[i][0], end = "")
  if i != N - 1:
    print(" ", end = "")

Measured memory_bytes: 138104
/* Nurgazy Zhandos */

#include <bits/stdc++.h>

#define F first
#define S second

#define pf push_front
#define pb push_back
#define mp make_pair
#define pp pop_back
#define in insert

#define up upper_bound
#define lb lower_bound

#define resize(v) v.resize(unique(all(v)) - v.begin()); 
#define all(a) a.begin(), a.end()
#define sz(a) a.size()

#define nl '\n'

//#define int long long

using namespace std;

typedef pair < pair <int, int >, int > piii;
typedef pair < long long, long long > pll;
typedef unsigned long long ull;
typedef pair < int, int > pii;
typedef long double ld;
typedef long long ll;

const int MAX_N = 1e5 + 123;
const int inf = 1e9 + 123;
const ll INF = 1e18 + 123;
const int NN = 2e6 + 123;
const double eps = 1e-9;
const int mod = 1e9 + 7;
const int N = 1e6 + 123;

inline int mult(int a, int b) {
	return 1ll * a * b % mod;
}

inline void fre() {
	#ifdef TEZZY
//	freopen("input.txt", "r", stdin);
// 	freopen("output.txt", "w", stdout);
	#endif
}

inline void boost() {
	ios_base :: sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
}

vector <int > v;
int lp[10011];
int a[10011];

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

	for(int i = 2; i <= n; i++) {
	 	if(!lp[i]) {
	 		v.pb(i);
	 		lp[i] = i;	
	    }

	    for(int j = 0; j < sz(v) && v[j] <= lp[i] && 1ll * i * v[j] <= n; j++) {
	     	lp[i * v[j]] = v[j];
	    }
	}

	for(int i = 2; i <= n; i++) {
	 	 int j = i;	
	 	 while(lp[j] > 0) {
			a[lp[j]]++;
			j /= lp[j]; 
	 	 }
	}
	
	int ans = 1;

	for(int i = 2; i <= n; i++) {
		ans = mult(ans, a[i] + 1);
	}
	
	cout << ans;
}

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

using namespace std;
using ll = long long;
using ld = long double;
using uint = unsigned int;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

/* [💭] [💡] [🎈] */

using namespace std;

int a[200000];
int occur[1000001];

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

    int n;
    cin >> n;

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

    int c = 0;
    for (int i = 0; i < n; i++) {
        int c2 = 0;
        for (int j = 1; j * j <= a[i]; j++) {
            if (a[i] % j) continue;
            c2 += occur[j];
            if (j * j != a[i]) c2 += occur[a[i] / j];
            if (c2 >= 2) break;
        }
        c += (c2 == 1);
    }
    cout << c;

    return 0;
}

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

typedef struct {
    char s[12];
    int p;
    int i;
} Res;

int comp(const void *a, const void *b) {
    Res *a_ = (Res *)a;
    Res *b_ = (Res *)b;
    int c = strcmp(a_->s, b_->s);
    if (c == 0) {
        return (b_->p) - (a_->p);
    }
    return c;
}

int main(void) {
    int N, i;
    scanf("%d", &N);
    Res res[101];
    for(i = 0; i < N; i++) {
        scanf("%s", res[i].s);
        scanf("%d", &res[i].p);
        res[i].i = i;
    }

    qsort(res, N, sizeof(Res), comp);

    for(i = 0; i < N; i++) {
        printf("%d\n", res[i].i + 1);
    }
    return 0;
}


Measured memory_bytes: 128
#!/usr/bin/python
# -*- coding: utf-8 -*-

import numpy as np

def int_mtx(N):
    x = []
    for _ in range(N):
        x.append(list(map(int,input().split())))
    return np.array(x)


N = int(input())
abc = int_mtx(N)

#f_inf = float("inf")
#dp = [f_inf]*N
dp = np.array([[0,0,0]]*N)

dp[0][0] = abc[0][0]
dp[0][1] = abc[0][1]
dp[0][2] = abc[0][2]

for i in range(1,N):
    dp[i][0] = max(dp[i-1][1]+abc[i][0],dp[i-1][2]+abc[i][0])
    dp[i][1] = max(dp[i-1][0]+abc[i][1],dp[i-1][2]+abc[i][1])
    dp[i][2] = max(dp[i-1][0]+abc[i][2],dp[i-1][1]+abc[i][2])

print(max(dp[N-1]))



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

using namespace std;

#define DUMP(x) std::cout << (#x) << " = " << (x) << "\n"
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define REP(i, k, n) for (int i = (k); i < (int)(n); ++i)
#define ALL(r) r.begin(), r.end()
#define YES puts("YES")
#define Yes puts("Yes")
#define NO puts("NO")
#define No puts("No")
#define IMP puts("IMPOSSIBLE")
#define Imp puts("Impossible")
#define imp puts("impossible")
#define pb push_back

template <typename T>
T dup(T x, T y)
{
    return (x + y - 1) / y;
};
template <typename A, size_t N, typename T>
inline void arrayFill(A (&array)[N], const T &val) { std::fill((T *)array, (T *)(array + N), val); }
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}

using ll = int64_t;
using vint = vector<int32_t>;
using vvint = vector<vint>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pint = pair<int32_t, int32_t>;
using pll = pair<ll, ll>;
using setint = unordered_set<int32_t>;
using setstr = unordered_set<string>;
using qint = queue<int32_t>;

constexpr std::int32_t INF = 1001001001;
constexpr std::int64_t LINF = 1001001001001001001;

void Main()
{
    string s, t;
    cin >> s >> t;
    rep(i, s.length())
    {
        if (s == t)
        {
            Yes;
            return;
        }
        t.insert(t.begin(), t.back());
        t.pop_back();
    }
    No;
}

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


Measured memory_bytes: 256
a, b, h, m = map(int, input().split())
a_theta = (30*h + 30*(m/60))%360
b_theta = (m/60)*360%360
# print(a_theta, b_theta)
import math
# print(math.sqrt(a**2 + b**2 - 2*a*b*math.cos(abs(a_theta - b_theta)/180*math.pi)))
print('{:.15f}'.format(math.sqrt(a**2 + b**2 - 2*a*b*math.cos(abs(a_theta - b_theta)/180*math.pi))))

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

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

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

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*);
    }
}

#[allow(unused_imports)]
use std::cmp::{min, max};
#[allow(unused_imports)]
use std::io::{stdout, stdin, BufWriter, Write};

fn topological_sort(n: usize, xys: &Vec<(usize, usize)>) -> (Vec<usize>, Vec<Vec<usize>>) {
    // topological sort
    let mut edges = vec![vec![]; n];
    let mut h = vec![0; n];
    for &(x, y) in xys.iter() {
        edges[x].push(y);
        h[y] += 1;
    }

    use std::collections::VecDeque;
    let mut st = VecDeque::new();
    for i in 0..n {
        if h[i] == 0 {
            st.push_back(i);
        }
    }

    let mut ans = vec![];
    while let Some(i) = st.pop_front() {
        ans.push(i);
        for &t in edges[i].iter() {
            h[t] -= 1;
            if h[t] == 0 {
                st.push_back(t);
            }
        }
    }

    return (ans, edges)
}

fn main() {
    let out = std::io::stdout();
    let mut out = BufWriter::new(out.lock());
    macro_rules! puts {
        ($($format:tt)*) => (write!(out,$($format)*).unwrap());
    }

    input!{
      n: usize,
      m: usize,
      xys: [(usize1, usize1); m],
    }
    let (nodes, edges) = topological_sort(n, &xys);
    let mut dp = vec![0; n];
    for cur in nodes {
        for &nd in edges[cur].iter() {
            dp[nd] = max(dp[cur] + 1, dp[nd]);
        }
    }
    let ans = dp.iter().max().unwrap();
    puts!("{}\n", ans);
}


Measured memory_bytes: 14588
import scala.io.Source.stdin
import scala.math.{max,min}

object Main extends App {

  val p = (
    (
      for (i <- (0 until 19) ++ (17 to 0 by -1)) yield (i+3)*(i+2)*(i+1)/6 - max(2*(i-9)*(i-8)*(i-7)/3,0)
    ) ++
    (for (i <- 37 to 51) yield 0)
  )

  stdin.getLines.foreach { x => println(p(x.toInt)) }
}

Measured memory_bytes: 43988
#include <iostream>
using namespace std;
int main()
{
	char c;
	cin >> c;
	if(c == 'a' || c == 'e'||c == 'i'||c == 'o'||c == 'u')
	{
		cout << "vowel"<< endl;
	}
	else
	
	{
		cout << "consonant" << endl;
	}
	return 0;
} 

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int sum = 0;

        for (int i = 0; i < M; i++) {
            sum += sc.nextInt();
        }

        if (N < sum) {
            System.out.println(-1);
        } else if (N > sum) {
            System.out.println(N - sum);
        } else {
            System.out.println(0);
        }
    }
}

Measured memory_bytes: 38940
import bisect
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
ad=sorted(a)
bd=sorted(b)
cd=sorted(c)
#print(ad)
#print(bd)
#print(cd)
count=0
for i in range(n):
  al=bisect.bisect_left(ad,bd[i])
  cl=bisect.bisect_right(cd,bd[i])
  sum=al * ( n - cl )
  #print(str(al) + " " + str(cl) + " " + str(sum))
  count=count+( al * ( n - cl ) )
print(count)

Measured memory_bytes: 23360
M = int(input())
d = [0] * M
c = [0] * M
for i in range(M):
    d[i], c[i] = map(int, input().split())

D = sum(c)
S = 0
for i in range(M):
    S += d[i] * c[i]

print(D - 1 + (S - 1) // 9)


Measured memory_bytes: 47576
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <deque>
#include <cctype>
#include <cstdio>
#include <math.h>
using namespace std;
int main(){
    long long x;
    cin >> x;
    long long ans=0;
    if(x%11==0){
        ans+=(x/11)*2;
    }else{
        ans+=(x/11)*2;
        if(x%11<=6){
            ans+=1;
        }else if(x%11>6){
            ans+=2;
        }
    }
    cout << ans <<  endl;
}

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

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

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def M(n): return ModInt(n)

class ModInt():
    def __init__(self, n):
        self.n = n

    def __add__(self, x):
        x = ModInt.xn(x)
        return ModInt((self.n+x) % mod)

    def __sub__(self, x):
        x = ModInt.xn(x)
        return ModInt((self.n-x) % mod)

    def __mul__(self, x):
        x = ModInt.xn(x)
        return ModInt((self.n*x) % mod)

    def __truediv__(self, x):
        x = ModInt.xn(x)
        return ModInt(self.n * pow(x, mod-2, mod) % mod)

    @classmethod
    def xn(cls, x):
        if isinstance(x, ModInt):
            return x.n
        return x

    def __str__(self):
        return str(self.n)

def main():
    n = I()
    xa = LI()

    m1 = M(1)
    c = [m1]
    for i in range(2, n+2):
        c.append(c[-1] + m1 / i)

    r = M(0)
    for i in range(1,n):
        t = xa[i] - xa[i-1]
        r += c[i-1] * t

    for i in range(n-1,1,-1):
        r *= i

    return r

print(main())





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

#define ll long long
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl

void solve(){
    int n;
    cin >> n;
    vector<int> prefix(n+1,0);
    string s;
    cin >> s;
    for(int i=0;i<n;i++){
        prefix[i+1]=prefix[i];
        if(s[i]=='R'){
            prefix[i+1]++;
        }
    }
    int cnt = 0;
    for(int i=0;i<prefix[n];i++){
        if(s[i]!='R'){
            cnt++;
        }
    }
    cout << cnt << endl;

}

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

    IOS;
    int T;
    T=1;
    //cin >> T;
    while(T--){
    solve();
    }

    

    return 0;
}


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

int main(void) {
  int N;
  int ans = -1;
  cin >> N;
  vector<long long> H(N);
  for (int i = 0; i < N; i++) {
    cin >> H[i];
  }
  int tmp = 0;
  for (int i = 1; i < N; i++) {
    if (H[i] <= H[i - 1]) {
      tmp++;
    } else if (H[i] > H[i - 1]) {
      ans = max(tmp, ans);
      tmp = 0;
    }
  }
  ans = max(tmp, ans);
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 1024
#include<stdio.h>
#include<string.h>
int main(){
	int a,i,o=0;
	char c[11],d[22],e[11]={0},*b,tin[11]={0},*po;
	scanf("%s %d",c,&a);
	for(i=1;i<=a;i++){
		scanf("%s",d);
		if((b=strstr(d,c))!=NULL)o++;
		else{
			strcpy(e,d);
			strcat(d,e);
			if((po=strstr(d,c))!=NULL)o++;
		}
	}
	printf("%d\n",o);
	return 0;
}



Measured memory_bytes: 2044
s=input()
youbi=["SUN","MON","TUE","WED","THU","FRI","SAT"]
if s==youbi[0]:
    print(7)
elif s==youbi[1]:
    print(6)
elif s==youbi[2]:
    print(5)
elif s==youbi[3]:
    print(4)
elif s==youbi[4]:
    print(3)
elif s==youbi[5]:
    print(2)
elif s==youbi[6]:
    print(1)


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

int main(void){
    long long int i, j, n, x, ans=0, po=0;
    char s[3];
    scanf("%s", s);
    ans = (s[0]=='R') + (s[1]=='R') + (s[2]=='R');
    if(ans==0) printf("0");
    else if(ans==1 || s[1]=='S') printf("1");
    else printf("%lld", ans);
    
}

Measured memory_bytes: 1724
n,k = map(int, input().split())
a = list(map(int, input().split()))
a = [i-1 for i in a]
num = [0] * (n)
num[0] = 1
now = 0
looped = 0
for i in range(2,k+2):
  nex = a[now]
  if num[nex]:
    start = num[nex]
    cycle = i - num[nex]
    v = (k+1-i) % cycle + start
    ans = num.index(v) + 1
    looped = 1
    break
  else:
    num[nex] = i
    now = nex
if looped:
  print(ans)
else:
  print(now+1)

Measured memory_bytes: 103444
#include <bits/stdc++.h>
using namespace std;
 
#define lli long long int
#define REP(i,s,n) for(lli i=s;i<n;i++)
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)
#define TO_STRING(VariableName) # VariableName
#define LOG(x) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<endl;
#define LOG2(x,y) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<endl;
#define LOG3(x,y,z) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;
#define LOG4(w,x,y,z) if(DEBUG)cout<<TO_STRING(w)<<"="<<w<<" "<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;
 
template<class T>bool chmax(T & a, const T & b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }

lli d;
lli c[26];
lli s[370][26];
lli t[370];
lli lastDay[26];


lli score(){

	lli ans = 0;
	REP(i,0,26)lastDay[i]=0;

	REP(i,1,d+1){
		ans += s[i-1][t[i-1]];

		lastDay[t[i-1]] = i;
		REP(j,0,26){
			ans -= c[j]*(i-lastDay[j]);
			LOG2(ans,c[j]*(i-lastDay[j]))
		}
		cout<<ans<<endl;
	}
	return ans;
}

void dummyDayInput(){

	REP(i,0,d){
		cin>>t[i];
		//t[i]=1;
		t[i]--;
	}

}

void input(){
	cin>>d;
	REP(i,0,26)cin>>c[i];
	REP(i,0,d){
		REP(j,0,26){
			cin>>s[i][j];
		}
	}
}

void dummyDayChangeInput(){
	lli m;
	cin>>m;

	REP(i,0,m){
		lli d,q;
		cin>>d>>q;
		d--,q--;
		t[d] = q;
		cout<<score()<<endl;
	}
}

int main(){

	ios::sync_with_stdio(false);
	std::cin.tie(nullptr);
	input();

	dummyDayInput();
	score();
	//dummyDayChangeInput();
 
	return 0;
}

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

int main(){
    int n; cin >> n;
    vector<long long> heights(n); for (int i=0;i<n;i++){cin >> heights[i];};
    int longest_stream = 0;
    int temporary_stream = 0;
    long long previous = heights[0];
    if (n==1){
        cout << 0 << endl;
    } else {
        for (int i=1;i<n;i++){
            if (heights[i] <= previous){
                temporary_stream += 1;
            } else {
                if (temporary_stream >= longest_stream){
                    longest_stream = temporary_stream;
                }
                temporary_stream = 0;
            }
            previous = heights[i];
        }
        if (temporary_stream >= longest_stream){
            longest_stream = temporary_stream;
        }
        cout << longest_stream << endl;
    }
    return 0;
}

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

int main(){
  int N;
  cin >> N;
  int64_t ans=1;
  const int64_t MAX=1e18;
  vector<int64_t> v(N);
  for(int i=0;i<N;i++){
    cin >> v.at(i);
    if(v.at(i)==0){
      cout << 0 << endl;
      return 0;
    }
  }
  for(int i=0;i<N;i++){
    if(ans<=MAX/v.at(i)){
      ans*=v.at(i);
    }else{
      cout << -1 << endl;
      return 0;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 4056
//{{{
#include<algorithm>
#include<cmath>
#include<fstream>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<random>
#include<set>
#include<sstream>
#include<sys/time.h>
#include<unordered_map>
#include<unordered_set>
#include<vector>
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (ll)1e18L + 9 };
using namespace std;
#ifdef LOCAL
#include"rprint2.hpp"
#else
#define FUNC(name) template <ostream& out = cout, class... T> void name(T&&...){ }
FUNC(prints) FUNC(printw) FUNC(printwe) FUNC(printb) FUNC(printbe) FUNC(printd) FUNC(printde) FUNC(printdu);
#endif
template <class S, class T>
istream& operator >> (istream& in, pair<S, T>& p){ return in >> p.first >> p.second; }
template <class T>
istream& operator >> (istream& in, vector<T>& v){ for(auto& e : v){ in >> e; } return in; }
//}}}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int r, d, x;
    cin >> r >> d >> x;
    for(int i = 2001; i <= 2010; i++){
        x = x * r - d;
        cout << x << '\n';
    }
}


Measured memory_bytes: 888
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda:sys.stdin.readline().rstrip()
def resolve():
    n=int(input())
    S=input()
    A=[((S[i]=='B') is (i&1==1))+0 for i in range(2*n)]

    # pair が偏る場合は不可能
    if(sum(A)!=n):
        print(0)
        return

    cnt=0
    ans=1
    for a in A:
        if(a==0):
            cnt+=1
        else:
            ans*=cnt
            ans%=MOD
            cnt-=1

    # factorial(n) を掛ける
    for i in range(1,n+1):
        ans*=i
        ans%=MOD
    print(ans)
resolve()

Measured memory_bytes: 53600
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define M1 					1000000007
#define M2 					998244353
#define ll 					long long int
#define pll 				pair<ll,ll>
#define mll 				map<ll,ll>
#define F 					first
#define S 					second
#define PB 					push_back
#define mp 					make_pair
#define lb 					lower_bound
#define ub 					upper_bound
#define V(a) 				vector<a>
#define endl 				'\n'
#define test(t) 			while(t--)
#define PI 					acos(-1.0)
#define rep(i,a,b) 			for(ll i=a;i<b;i++)
#define repp(i,b,a) 		for(ll i=b-1;i>=a;i--)
#define clr(ar, val)		memset(ar, val, sizeof(ar))
#define setbits(x) 			__builtin_popcountll(x)
#define zrobits(x) 			__builtin_ctzll(x)
#define ps(y) 				fixed << setprecision(y)
#define all(x) 				begin(x),end(x)
#define allr(x) 			rbegin(x),rend(x)
const int inf= 				0x3f3f3f3f;
const ll INF= 				0x3f3f3f3f3f3f3f3f;
const int dx[4]= 			{ 0, -1, 0, 1 };
const int dy[4]= 			{ -1, 0, 1, 0 };

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template<typename T>
#define o_set(T) tree<T, null_type,less<T>, rb_tree_tag,tree_order_statistics_node_update>
//member functions :
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set

ll CalculateMex(set<ll> Set){
    ll Mex = 0;
    while(Set.find(Mex)!=Set.end()){
        Mex++;
    }
    return Mex;
}

ll floor_div(ll a, ll b) {
	return a / b - (((a ^ b) < 0) and a % b);
}
ll ceil_div(ll a, ll b){
    return a / b + (((a ^ b) >= 0) and a % b);
}

inline void INP()
{
	#ifndef ONLINE_JUDGE
	    freopen("input.txt","r",stdin);   
	    freopen("output.txt","w",stdout);
	#endif 
}
ll modp(ll a, ll b){
    ll res = 1;
    while(b>0){
        if (b&1) res = (res*a)%M1;
        a = (a*a)%M1;
        b>>=1;
    }
    return res;
}

ll minsum[200005];
void solve()
{
    ll n,k;
    cin>>n>>k;
    minsum[1] = 0;
    ll maxsum = (((n*(n+1))%M1)*modp(2,M1-2))%M1;
    rep(i,2,n+2){
        minsum[i] = (minsum[i-1] + i-1 + M1)%M1;
    }
    ll ans = 0;
    rep(i,k,n+2){
        ans = (ans + maxsum - minsum[n-i + 1] - minsum[i] + 1 + M1)%M1;
    }
    cout << ans << endl;
    
}

int32_t main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t=1;
    // cin>>t;
    test(t){
        solve();
    }
    return 0;
}

Measured memory_bytes: 5164
#include <bits/stdc++.h>
#define MAXN 200005
#define ll long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(c) (c).begin(), (c).end()
using namespace std;

string s, poc, kraj, c;
int q, t, f;
int obrnut;

int main()
{
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	
	cin >> s >> q;
	for (; q; --q) {
		cin >> t;
		if (t == 1) obrnut += 1;
		else {
			cin >> f >> c;
			if (!(obrnut % 2)) {
				if (f == 1) poc = poc + c;
				else kraj = kraj + c;
			}
			else {
				if (f == 2) poc = poc + c;
				else kraj = kraj + c;
			}
		}
	}
	if (!(obrnut % 2)) {
		for (int i = poc.size() - 1; i >= 0; i--) cout << poc[i];
		cout << s;
		cout << kraj;
	} 
	else {
		for (int i = kraj.size() - 1; i >= 0; i--) cout << kraj[i];
		for (int i = s.size() - 1; i >= 0; i--) cout << s[i];
		cout << poc;
	}
	return 0;
}


Measured memory_bytes: 1440
import sys
N = int(input())
s = str(input())
t = str(input())

answer = 2 * N
for i in range(N, 2 * N + 1):
    if s[len(s) - (2 * N - i):] == t[:2 * N - i]:
        answer = i
        break
    
print(answer)


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

template <class Weight>
struct edge {
	int to;
	Weight cost;
	edge(int t, Weight c) : to(t), cost(c) {}
};

template <class Weight>
using edges = vector<edge<Weight>>;

template <class Weight>
using graph = vector<edges<Weight>>;

template <class Weight>
vector<Weight> bellman_ford(int s, const graph<Weight>& G, const Weight inf) {
	int n = G.size();
	vector<Weight> dist(n, inf);
	dist[s] = 0;
	bool upd;
	for (int i = 0; i < n; i++) {
		upd = false;
		for (int v = 0; v < n; v++) {
			for (auto& e : G[v]) if (dist[v] != inf && dist[e.to] > dist[v] + e.cost) {
				dist[e.to] = dist[v] + e.cost;
				upd = true;
			}
		}
		if (!upd) return dist;
	}
	dist.clear();
	return dist;
}

const int INF = 1e9;

int main()
{
	ios::sync_with_stdio(false), cin.tie(0);
	int n, m, r;
	cin >> n >> m >> r;
	graph<int> G(n);
	for (int i = 0; i < m; i++) {
		int s, t, d;
		cin >> s >> t >> d;
		G[s].emplace_back(t, d);
	}
	auto dist = bellman_ford(r, G, INF);
	if (dist.empty()) {
		puts("NEGATIVE CYCLE");
		return 0;
	}
	for (int i = 0; i < n; i++) {
		if (dist[i] == INF) puts("INF");
		else printf("%d\n", dist[i]);
	}
	return 0;
}



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

using namespace std;

int main()
{
    int K,S,z;
    int ans=0;
    cin >> K >> S;

    for (int x = K; x >= 0; x--)
    {
        for (int y = K; y >= 0; y--)
        {
            z = S-x-y;
            if (0 <= z && z <= K)
            {
                if (x+y+z == S)
                {
                    ans++;
                }
            }
            
            
        }
        
        
    }
    
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 888
from fractions import gcd
from functools import reduce


def lcm(a, b):
    return a * b // gcd(a, b)


def solve(string):
    n, m, *a = map(int, string.split())
    c = 2**len(bin(a[0]).split("1")[-1])
    l = reduce(lcm, (2 * m + 1 if _a % c or not _a // c % 2 else _a for _a in a))
    return str(max((m - l // 2) // l + 1, 0))


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))


Measured memory_bytes: 17168
def solve():
    n = int(input())
    a = list(map(int, input().split()))
    ruiseki = [a[0]]
    for i in range(1,n):
        ruiseki.append(a[i]+ruiseki[i-1])
    ans = 0
    for i in range(n):
        ans += a[i]*(ruiseki[-1]-ruiseki[i])
    print(ans % (10**9+7))
    return 0

if __name__ == "__main__":
    solve()


Measured memory_bytes: 101924
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>

using namespace std;

struct ANS{
	int pay_10,pay_50,pay_100,pay_500,toal;
};

int main(){

	int price,num_10,num_50,num_100,num_500,tmp,pay_sum;
	int ret_10,ret_50,ret_100,ret_500;
	ANS ans;
	bool First = true;

	while(true){
		scanf("%d",&price);
		if(price == 0)break;

		ans.toal = 10000000; //???????????°

		scanf("%d %d %d %d",&num_10,&num_50,&num_100,&num_500);

		for(int a = 0; a <= num_10; a++){
			for(int b = 0; b <= num_50; b++){
				for(int c = 0; c <= num_100; c++){
					for(int d = 0; d <= num_500; d++){
						if((pay_sum = 10*a+50*b+100*c+500*d) >= price){
							tmp = a + b + c + d; //?????£????????°

							ret_10 = ret_50 = ret_100 = ret_500 = 0;

							//???????????£?????????????????£??????????????????????¢???????
							pay_sum -= price;	//?????£????????????
							while(pay_sum >= 500){
								pay_sum -= 500;
								ret_500++;
							}
							while(pay_sum >= 100){
								pay_sum -= 100;
								ret_100++;
							}
							while(pay_sum >= 50){
								pay_sum -= 50;
								ret_50++;
							}
							while(pay_sum >= 10){
								pay_sum -= 10;
								ret_10++;
							}

							if((a > 0 && ret_10 > 0)||(b > 0 && ret_50 > 0)||(c > 0 && ret_100 > 0)||(d > 0 && ret_500 > 0)){
								//Do nothing
							}else{
								tmp = num_10 + num_50 + num_100 + num_500 - (a+b+c+d-(ret_10+ret_50+ret_100+ret_500));
								if(tmp < ans.toal){
									ans.toal = tmp;
									ans.pay_10 = a;
									ans.pay_50 = b;
									ans.pay_100 = c;
									ans.pay_500 = d;
								}
							}
						}
					}
				}
			}
		}

		if(!First)printf("\n");

		if(ans.pay_10 > 0)printf("10 %d\n",ans.pay_10);
		if(ans.pay_50 > 0)printf("50 %d\n",ans.pay_50);
		if(ans.pay_100 > 0)printf("100 %d\n",ans.pay_100);
		if(ans.pay_500 > 0)printf("500 %d\n",ans.pay_500);

		First = false;
	}
	return 0;
}

Measured memory_bytes: 2568
module Main where

import Data.List
import Data.Char (digitToInt)
import Control.Monad
import Debug.Trace
import qualified Data.ByteString.Char8 as BC
import Data.Maybe (fromJust)
import qualified Data.Map.Strict as M
import qualified Data.Vector.Unboxed as V


readTuple2 :: IO (Int, Int)
readTuple2 = do
    [a, b] <- map (fst . fromJust . BC.readInt) . BC.words <$> BC.getLine
    return (a, b)

readTuple3 :: IO (Int, Int, Int)
readTuple3 = do
    [a, b, c] <- map (fst . fromJust . BC.readInt) . BC.words <$> BC.getLine
    return (a, b, c)

readInt :: IO Int
readInt = fst . fromJust . BC.readInt <$> BC.getLine

readInts :: IO [Int]
readInts = map (fst . fromJust . BC.readInt) . BC.words <$> BC.getLine

split :: (a -> Bool) -> [a] -> [[a]]
split f [] = []
split f as = let
    (fo, la) = span f as
    las = case la of
        [] -> []
        xs -> split f $ tail xs
    in
        case fo of
            [] -> las
            xs -> xs : las

fastPowerMod :: Int -> Int -> Int -> Int
fastPowerMod b 0 _ = 1
fastPowerMod b 1 modnum = b `mod` modnum
fastPowerMod b n modnum
            | even n = (fastPowerMod b (n `div` 2) modnum ^ 2) `mod` modnum
            | otherwise = (fastPowerMod b (n - 1) modnum * b) `mod` modnum

modInverse :: Int -> Int -> Int
modInverse n modnum = fastPowerMod n (modnum - 2) modnum

combinationM :: Int -> Int -> Int -> Int
combinationM  _ 0 _ = 1
combinationM  n 1 _ = n
combinationM  n k modnum
            | n < k = 0
            | k > (n - k) = combinationM  n (n - k) modnum
            | otherwise = upper * kfinv `mod` modnum where
                upper = prodMod [n,(n-1)..(n - k+1)] modnum
                kfinv = modInverse (prodMod [1..k] modnum) modnum

solve :: [Int] -> Int
solve xs = snd $ head $ sortOn snd $ fmap addV [1..100] where
    addV n = (n, sum $ fmap (\x -> (x - n) ^ 2 ) xs)

prodMod :: [Int] -> Int -> Int
prodMod xs modnum = foldl' (\b a -> b * a `mod` modnum) 1 xs

modSub :: Int -> Int -> Int -> Int
modSub mod a b
            | a < b = a - b + mod
            | otherwise = a - b


main = do
    (n, a, b) <- readTuple3
    let modnum = 1000000007
    let modSuba = modSub modnum
    print $ fastPowerMod 2 n modnum `modSuba` combinationM n a modnum `modSuba` combinationM n b modnum - 1



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

using namespace std;

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

    long ans = 0;
    long now = 0;
    for (long i = 0; i < n-1; ++i) {
        if (h[i]>=h[i+1]) {
            ++now;
        } else {
            if (ans < now) {
                ans = now;
            }
            now = 0;
        }
    }
    if (ans < now) {
        ans = now;
    }
    cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const long double PI = (acos(-1));
#define rep(i, x, n) for (int i = x; i < (int)(n); i++)
#define sc(x) scanf("%d",&x)
#define scll(x) scanf("%lld",&x)
int main(){
    ll a, b, n;
    scll(a), scll(b), scll(n);
    ll z = min(b-1, n);
    ll ans = a*z/b + a*(z/b);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3764
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<string>
using namespace std;

int main(){
    char s[101];
    cin>>s;
    for(int i=0;i<strlen(s);i++){
        printf("x");
    }
    printf("\n");
}

Measured memory_bytes: 384
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <tuple>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
# include <chrono>
# include <random>
# include <limits.h>
# include <unordered_map>
# include <unordered_set>
# include <deque>
# include <cstdio>
# include <cstring>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr long long MOD = 1000000000 + 7;
constexpr long long INF = 1e17 - 10;
const double PI = acos(-1);
typedef pair<LL, LL> Pll;
typedef pair<LL, LL> Vec2;
LL h, w, n, m, s, ans = 0, num = 1, sum = 0;
bool f[1000000000];
string str;
struct Edge { int to, cost; };
vector<Edge>edge[10000];
Pll bfs(LL s) {
	f[s] = 1;
	deque<Pll> pq;
	pq.push_front(Pll(s, 1));
	while (!pq.empty()) {
		LL vv = pq.front().first, pc = pq.front().second;
		pq.pop_front();
		if (vv % n == 0)
			return Pll(vv,pc);
		f[vv] = 1;
		if (f[(vv * 10) % n] == 0) {
			pq.push_front(Pll((vv * 10)%n , pc));
		}
		if (f[(vv + 1) % n] == 0) {
			pq.push_back(Pll((vv + 1) % n, pc + 1));
		}
	}
}
int main() {
	cin >> n; 
	Pll xx = bfs(1);
	cout << xx.second << endl;
	return 0;
}


Measured memory_bytes: 1664
import sys
from io import StringIO
import unittest


def resolve():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))

    for i in range(k, n, 1):
        if a[i - k] < a[i]:
            print('Yes')
        else:
            print('No')

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """5 3
96 98 95 100 20"""
        output = """Yes
No"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """3 2
1001 869120 1001"""
        output = """No"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """15 7
3 1 4 1 5 9 2 6 5 3 5 8 9 7 9"""
        output = """Yes
Yes
No
Yes
Yes
No
Yes
Yes"""
        self.assertIO(input, output)


if __name__ == "__main__":
    # unittest.main()
    resolve()


Measured memory_bytes: 39588
///Bismillahir Rahmanir Rahim
#include<bits/stdc++.h>
using namespace std;
#define     FAST        ios_base::sync_with_stdio(false);cin.tie(NULL)
#define     int 	    long long
#define 	pb 	        push_back
#define 	mp 	        make_pair
#define 	pi 	        2*acos(0.0)
#define     scan(i)     scanf("%lld",&i)
#define     scann(i,j)  scanf("%lld%lld",&i,&j)
#define     print(i)    printf("%lld\n",i)
#define     printt(i,j) printf("%lld %lld\n",i,j)
#define     loop(i,n) 	for(int i = 0 ; i <n ; i++)
#define     loopp(i,n) 	for(int i = 1 ; i <=n ; i++)
#define 	vect 	    vector<int>
#define 	vec_it 	    vector<int>::reverse_iterator vi
#define     sorta(v)    sort(v.begin(),v.end())
#define     sortd(v)    sort(v.begin(),v.end(),greater<>())
#define     sorted      is_sorted(v.begin(),v.end())
#define 	mapp 	    map<int,int>
#define 	pairr 	    pair<int,int>
#define 	sett	    set<int>
#define 	set_it 	    set<int>::reverse_iterator si
#define     map_it      map<int,int> :: reverse_iterator mi
#define 	yes 	    cout<<"YES"<<endl
#define 	no 	        cout<<"NO"<<endl
#define 	ff 	        first
#define 	ss 	        second
#define     mx          INT_MAX
#define     lmx         LLONG_MAX
#define     mn          INT_MIN
#define     lmn         LLONG_MIN
#define     GCD         __gcd(a,b)
#define     LCM         (a/GCD)*b
template <typename T> T gcd(T a,T b){return (b==0)?a:gcd(b,a%b);}
template <typename T> T lcm(T a,T b) {return a*(b/gcd(a,b));}
int modulo (int a, int b) { return a >= 0 ? a % b : ( b - abs ( a%b ) ) % b; }

void solve()
{
  //  freopen ("(input).txt" , "r",  stdin) ;
  //  string st,stt ;
  //  int low=0,high=0;
  //  int l=0,r;
    int n,k,t,x,y,z,d=0,temp=0,cnt=0,sum=0,f=0;
    cin>>n>>k  ; vect v(n) ,a ,b  ; sett s ; set_it ; mapp m,mm ;  map_it ; pairr p ;
    loop(i,n)
    {
        cin>>v[i];
        if(i>0)
        {
            if(v[i]+v[i-1]>k)
            {
                if(v[i-1]<=k)
                {
                    sum+=(v[i]+v[i-1])-k;
                    v[i]=(k-v[i-1]);
                }
                else if(v[i-1]>k)
                {
                    sum+=(v[i]+v[i-1])-k;
                    v[i]=0;
                }
            }
        }
    }
    cout<<sum<<endl;


}

main()
{
    int t;
  //  cin>>t;
  //  while(t--)
        solve();
}


Measured memory_bytes: 3992
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>

using namespace std;

int p[4];

int gcd(int a,int b){
	if(b==0)return a;
	return gcd(b,a%b);
}

int main(void){
	int a,b,c;
	while(1){
		scanf("%d %d %d",&a,&b,&c);
		if(a+b+c==0)break;
		if(b*b-4*a*c<0){
			printf("Impossible\n");
		}else{
			int l=b*b-4*a*c;
			double ll=sqrt(l);
			int l2=ll;
			p[0]=p[2]=a*2;
			if(l2==ll){ 
				p[1]=b+l2;
				p[3]=b-l2;
				if(p[0]<0){
					p[0]=-p[0];
					p[1]=-p[1];
					p[2]=-p[2];
					p[3]=-p[3];
				}
				int k=gcd(abs(p[0]),abs(p[1]));
				p[0]/=k;
				p[1]/=k;
				k=gcd(abs(p[2]),abs(p[3]));
				p[2]/=k;
				p[3]/=k;
				if(p[2]>p[0] || (p[2]==p[0] && p[3]>p[1])){
					swap(p[0],p[2]);
					swap(p[1],p[3]);
				}
				for(k=0;k<4;k++)printf("%d%c",p[k],k==3?'\n':' ');
			}else printf("Impossible\n");	
		}
	}
	return 0;
}

Measured memory_bytes: 1040