akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define IL inline
#define _  200005
#define ll long long
#define RG register
using namespace std ;

IL int gi() {
	RG int data = 0 , fu = 1 ; RG char ch = 0 ;
	while(ch != '-' && (ch < '0' || ch > '9')) ch = getchar() ; if(ch == '-') fu = -1 , ch = getchar() ;
	while('0' <= ch && ch <= '9') data = (data << 1) + (data << 3) + (ch ^ 48) , ch = getchar() ; return data * fu ;
}

#define mod 1000000007

int n , a[_] ,pos[_] , f[_] ;

int main() {
	n = gi() ; for(int i = 1; i <= n; i ++) a[i] = gi() ; 
	f[0] = 1 ;
	for(int i = 1; i <= n; i ++) {
		f[i] = f[i - 1] ;
		if(pos[a[i]] && pos[a[i]] != i - 1) f[i] = (f[i] + f[pos[a[i]]]) % mod ;
		pos[a[i]] = i ; 
	}
	cout << f[n] << endl ; return 0 ; 
}


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

using namespace std;

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

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

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

// mod
const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

// floating
typedef double Real;
const Real EPS = 1e-11;
#define EQ0(x) (abs(x)<EPS)
#define EQ(a,b) (abs(a-b)<EPS)
typedef complex<Real> P;

int main(){
  int t;
  scanf("%d",&t);
  while(t--){
    int n,d;
    scanf("%d%d",&n,&d);
    priority_queue<int> Q;
    int sm=d;
    Q.push(-d);
    REP(i,n-1){
      int x = -Q.top(); Q.pop(); sm-=x;
      int y = 127;
      int z = x^y;
      sm += y+z;
      Q.push(-y);
      Q.push(-z);
    }
    printf("%d\n",sm);
  }
  return 0;
}


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

int main(){
  string S;
  cin >> S;
  if(S == "RRR"){
    cout << '3' << endl;
  }else if(S == "SRR" || S == "RRS"){
    cout << '2' << endl;
  }
  else if(S == "SSS"){
    cout << '0' << endl;
  }else{
    cout << '1' << endl;
  }
}


Measured memory_bytes: 3616
#include<stdio.h>
char f[6][6],s[6],i,j,a,y,x,p,b;
int main()
{
	for(;i<9;++i,b=!b){
		scanf("%s",s);
		for(j=0;j<4+b;++j){
			a=s[j]-48;
			f[i/2][j]|=a<<1+b;
			f[i/2+b][j+!b]|=a<<3-b*3;
		}
	}
	do{
		while(!((f[y][x]>>(p=(p+1)%4))&1));
		putchar("URDL"[p]);
		x+=p?2-p:0;
		y+=p==3?0:p-1;
		p=(p+2)%4;
	}while(y|x|f[0][0]==6&p==3);
	return!puts(""); 
}

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

int main() {
  uint32_t N = 0, M = 0;
  std::cin >> N >> M;

  uint32_t pos = N / 2, dist = 1;
  for (size_t i = M; i > 0; i--) {
    std::cout << pos << " " << pos + dist << std::endl;
    pos--;
    dist += 2;
    if (N % 2 == 0 && dist > N / 2 - 1 && dist % 2 != 0) dist++;
  }

  return 0;
}

Measured memory_bytes: 3600
/* AOJ Volume1-0102 */
using System;
public class Hello{
    public static void Main(){
        while(true){
            int DataNum = int.Parse(Console.ReadLine());
            if(DataNum <= 0){
                break;
            }
            
            int[,] DataMatrix = new int[DataNum + 1, DataNum + 1];
            
            for(int i = 0; i < DataNum; i++){
                string[] InputLine = Console.ReadLine().Split(' ');
                for(int j =0; j < DataNum; j++){
                    int InputVal = int.Parse(InputLine[j]);
                    DataMatrix[i, j] = InputVal;
                    DataMatrix[i, DataNum] += InputVal;
                    DataMatrix[DataNum, j] += InputVal;
                    DataMatrix[DataNum, DataNum] += InputVal;
                }
            }
            
            for(int i = 0; i < DataNum + 1; i++){
                for(int j = 0; j < DataNum + 1; j++){
                    Console.Write(String.Format("{0,5}", DataMatrix[i, j]));
                }
                Console.WriteLine();
            }
        }
    }
}

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

#define pb push_back

const int MAXN=5005*5;

string a[MAXN];

int main()
{
	//freopen("read.txt","r",stdin);
	string s;
	int k,cnt=0;
	cin >> s >> k;
	for (int i=0;i<s.size();i++)
	{
		string t;
		for (int j=0;j<k&&i+j<s.size();j++)
		{
			t+=s[i+j];
			a[cnt++]=t;
		}
	}
	sort(a,a+cnt);
	cnt=unique(a,a+cnt)-a;
	cout << a[k-1];
	return 0;
}

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

typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<double> vd;
typedef vector<ll> vl;
typedef vector<string> vs;
#define fo(i, a, b) for (int i = a; i < b; i++)
#define re(i, n) fo(i, 0, n)
#define pb push_back
#define mp make_pair
#define all(s) s.begin(), s.end()
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { ll g = gcd(a, b); return a / g * b; }
int main()
{
  ll a, b, k;
  cin >> a >> b >> k;

  if(a >= k) {
    a -= k;
  } else {
    if(b >= k - a) {
      b -= k - a;
      a = 0;
    } else {
      b = 0;
      a = 0;
    }
  }
  cout << a << ' ' << b << endl;

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int n,m,a,b,ans=1;
int c[1001];

int main(){
  scanf("%d %d",&n,&m);
  for(int i=0;i<m;i++){
    scanf("%d %d",&a,&b);
    c[a]++;
    c[b]--;
  }
  for(int i=1;i<=n;i++){
    c[i]+=c[i-1];
    ans+=(c[i]?3:1);
  }
  printf("%d\n",ans);
  return 0;
}

Measured memory_bytes: 1196
n,m,x = map(int,input().split())
goods = [list(map(int,input().split())) for i in range(n)]
from itertools import combinations as comb
minm=float('INF')
def check(l):
    suml = [0]*(m+1)
    for j in l:
        good = goods[j]
        for s in range(0,m+1):
            suml[s] += good[s]
    for j in range(1,m+1):
        if(suml[j]<x):
            return None
    return suml[0]

ok = False
for i in range(1,n+1):
    
    for l in comb(range(n),i):
        num = check(l)
        if(num is None):
            continue
        if(minm>num):
            minm = num
            ok = True
if(ok):
    print(minm)
else:
    print(-1)
        


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

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>
#include<iomanip>
#include<unordered_set>
#include<unordered_map>
#include<bitset>
#include<complex>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

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

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD =  (int)1e9 + 7;
const double EPS = 1e-9;

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

	int N, M;
	cin >> N >> M;

	vector<vector<int>> G(N);
	int A, B;
	rep(i, 0, M)
	{
		cin >> A >> B;
		A--, B--;
		G[A].push_back(B);
		G[B].push_back(A);
	}

	queue<int> q;
	q.push(0);
	vector<int> PRE(N, -1);
	PRE[0] = 0;
	while (!q.empty())
	{
		auto p = q.front();
		q.pop();
		for (auto e : G[p])
		{
			if (PRE[e] != -1)continue;
			PRE[e] = p + 1;
			q.push(e);
		}
	}

	cout << "Yes" << endl;
	rep(i, 1, N)
	{
		cout << PRE[i] << endl;
	}

	return 0;
}

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

int n;

struct Task
{
    int TimeLong = -1;
    int Limit = -1;
    Task(int timeLong, int limit)
    {
        TimeLong = timeLong;
        Limit = limit;
    }
};
vector<Task> vec;

int main(int argc, char *argv[])
{
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
        int timeLong, limit;
        cin >> timeLong >> limit;
        vec.emplace_back(Task(timeLong, limit));
    }
    sort(vec.begin(), vec.end(), [](Task x, Task y)->bool{
        return x.Limit < y.Limit;
    });
    int sum = 0;
    for (Task item : vec)
    {
        sum += item.TimeLong;
    }
    for (int i = n - 1; i >= 0; --i)
    {
        if (sum > vec[i].Limit)
        {
            cout << "No" << endl;
            return 0;
        }
        sum -= vec[i].TimeLong;
    }
    cout << "Yes" << endl;
    return 0;
}

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

int main() {
    int h, w;
    cin >> h >> w;
    string s[h];
    for (int i = 0; i < h; i++) {
        cin >> s[i];
    }
    for (int i = 0; i < w+2; i++) {
        cout << "#";
    }
    cout << endl;
    for (int i = 0; i < h; i++) {
        cout << "#" << s[i] << "#" << endl;
    }
    for (int i = 0; i < w+2; i++) {
        cout << "#";
    }
    cout << endl;
}

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

using namespace std;

int main()
{
	int n;
	cin >> n;
	
	// n個の数列から奇数番目のvの個数を求める配列
	vector<int> odds(100001, 0);
	// n個の数列から偶数番目のvの個数を求める配列
	vector<int> evens(100001, 0);
	// 入力されたvの値が何個あるのかを数えるための対応
	// iが奇数の場合は、奇数番目の配列へ、iが偶数のの場合は偶数番目の配列へ
	for (int i = 0; i < n; i++)
	{
		int v;
		cin >> v;
		if (i % 2 == 0)
		{
			odds[v]++;
		}
		else {
			evens[v]++;
		}
	}
	
	
	// 偶数番目の配列の最大値と2番目に大きい値を求める
	int odds_1 = 0;
	int odds_2 = 0;
	// 偶数番目の配列の最大値と2番目に大きい値を求める
	int evens_1 = 0;
	int evens_2 = 0;
	
	for (int i = 1; i <= 100000; i++)
	{
		// 奇数番目の配列の計算
		if (odds[i] >= odds[odds_1])
		{
			odds_2 = odds_1;
			odds_1 = i;
		}
		else if (odds[i] >= odds[odds_2])
		{
			odds_2 = i;
		}
		
		// 偶数番目の配列の計算
		if (evens[i] >= evens[evens_1])
		{
			evens_2 = evens_1;
			evens_1 = i;
		}
		else if (evens[i] >= evens[evens_2])
		{
			evens_2 = i;
		}
	}
	
	// 出力
	int answer = 0;
	if (odds_1 != evens_1)
	{
		answer = n - odds[odds_1] - evens[evens_1];
	}
	else {
		if (odds[odds_1] - odds[odds_2] <= evens[evens_1] - evens[evens_2])
		{
			answer = n - odds[odds_2] - evens[evens_1];
		}
		else {
			answer = n - odds[odds_1] - evens[evens_2];
		}
	}
	cout << answer << endl;
	
	return 0;
}




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

using namespace std;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rrep(i, n) for (ll i = (n - 1); i >= 0; --i)
#define blank(ans) cout << (ans) << " ";
#define mp(p, q) make_pair(p, q)
#define mt(p, q, r) make_tuple(p, q, r)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef string str;

typedef vector<ll> vll;
typedef vector<ld> vd;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<str> vs;
typedef vector<vector<ll>> vvll;
typedef vector<vector<ld>> vvd;
typedef vector<vector<bool>> vvb;
typedef vector<vector<char>> vvc;
typedef vector<vector<str>> vvs;
typedef vector<pair<ll, ll>> vpll;
typedef vector<tuple<ll, ll, ll>> vtlll;

const ld PI = acos(-1.0);
const ll MAX = 9000000000000000000;
const ll MIN = -9000000000000000000;
const ld DMAX = 4500;
const ld DMIN = -4500;
const ll MOD = 1000000007;

template <typename T>
void fin(T a)
{
  cout << a << endl;
  exit(0);
}

bool IsPrime(ll num)
{
  if (num < 2)
    return false;
  else if (num == 2)
    return true;
  else if (num % 2 == 0)
    return false;
  ld sqrtNum = sqrt(num);
  for (ll i = 3; i <= sqrtNum; i += 2)
  {
    if (num % i == 0)
      return false;
  }
  return true;
}

//実行部
void Main()
{
  ll n; cin >> n;
  str s; cin >> s;
  ll r = 0, b = 0;
  rep(i, n)
  {
    if(s[i] == 'R') r++;
    else b++;
  }
  if(r > b) fin("Yes");
  fin("No");
}
//前処理
int main()
{
  ifstream in("text.txt");
  cin.rdbuf(in.rdbuf());
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(20); //高精度少数表示
  Main();
  return 0;
}

/*
//test時
  g++ test.cpp -o test;./test
*/


Measured memory_bytes: 256
import java.io.PrintWriter
import java.util.*
import java.math.*
import java.lang.*
import kotlin.comparisons.*

val pw = PrintWriter(System.out)
val MOD: Long = (1e+9 + 7).toLong()

fun main(args: Array<String>) {
    val n = readInt() 
    val a = readListOfLong().sortedDescending()
    val ans = a.fold(a[0]) { acc, x -> gcd(acc, x) }
    println(ans)
    pw.flush()
}

/****** Declared Functions and Data Structures ******/
// IO
fun read() = readLine()!!
fun readInt() = read().toInt()
fun readLong() = read().toLong()
fun readDouble() = read().toDouble()
fun readListOfString() = read().split(" ")
fun readListOfInt() = readListOfString().map { it.toInt() }
fun readListOfLong() = readListOfString().map { it.toLong() }
fun readListOfDouble() = readListOfString().map { it.toDouble() }

fun Double.format(digits: Int) = String.format("%.${digits}f", this)
fun Float.format(digits: Int) = String.format("%.${digits}f", this)

fun print(value: Any) { pw.print(value) }
fun println(value : Any) { pw.println(value) }


// Extensions
fun<T> List<T>.toBuckets(bucketKeys: List<T>): Map<T, Int> {
    val buckets = bucketKeys.associate { t -> Pair(t, 0) }.toMutableMap()
    this.forEach { t ->
        buckets[t] = buckets[t]!! + 1
    }
    return buckets
}

fun <K, V> Map<K, V>.toMutableMap(): MutableMap<K, V> = HashMap(this)

// Util Functions
fun<T> permutations(src: List<T>): List<List<T>> {
    if(src.size == 1) return listOf(src)
    val perms = mutableListOf<List<T>>()
    val insertElement = src[0]
    permutations(src.drop(1)).forEach { perm ->
        for(i in 0..perm.size) {
            val newPerm = perm.toMutableList()
            newPerm.add(i, insertElement)
            perms.add(newPerm.toList())
        }
    }
    return perms
}

// return nCr, if you want nCr, please access v[n][r]
fun combinations(n: Long): List<List<Long>> {
    val v = (0..n).map { (0..n).map{0L}.toMutableList() }.toMutableList()
    for(i in 0 until v.size) {
        v[i][0] = 1L
        v[i][i] = 1L
    }
    for(i in 0 until v.size) {
        for(j in 1 until i) {
            v[i][j] = (v[i-1][j-1] + v[i-1][j]) % MOD
        }
    }
    return v.map { it.toList() }.toList()
}

// should be a >= b
fun gcd(a: Long, b: Long): Long = 
    if(b == 0L) a else gcd(b, a % b)

// shoud be a >= b
fun lcm(a: Long, b: Long): Long = 
    a / gcd(a, b) * b

fun sumDigits(num_: Long): Long {
    var num = num_
    var rtn: Long = 0
    while(num != 0.toLong()) {
        val tmp = num % 10
        rtn += tmp
        num /= 10
    }
    return rtn
}

fun isDecimal(v: Double): Boolean = ((v - Math.floor(v)) != 0.0)

// Data Structures
class Stack<T>(private var st: MutableList<T> = mutableListOf<T>()) {
    fun isEmpty() = st.isEmpty()
    fun top(): T = st.last()
    fun push(e: T) { st.add(e) }
    fun pop() { st = st.dropLast(1).toMutableList() }
}

class Queue<T>(private var que: MutableList<T> = mutableListOf<T>()) {
    fun isEmpty() = que.isEmpty()
    fun top(): T = que.first()
    fun push(e: T) { que.add(e) }
    fun pop() { que = que.drop(1).toMutableList() }
}


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

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

    long long x;
    cin >> x;

    long long now = 100;
    int i = 0;

    if(x == now){
        cout << 0 << endl;
        return 0;
    }

    while(true){
        double hoge = now / 100;
        long long fuga = (long long)(hoge);
        i++;
        now += fuga;
        if(now >= x){
            cout << i << endl;
            return 0;
        }
    }

    return 0;
}

Measured memory_bytes: 3648
#include <iostream>
#include <map>
//#include <string>
using namespace std;

int main()
{
	//string str;
	char str [100];
	map<char, int> mp;
	cin >> str;
	for(int i=0; str[i]!='\0'; ++i){
		//cout << str[i]  ;
		if(mp[str[i]] == 0) {
			//cout << "add" << endl;
			mp[str[i]]+= 1;
		}
		else {
			cout << "no" << endl;
			// It's suit return0 than take flag=1.
			return 0;
		} 
	}
	cout << "yes" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
using namespace std;
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(a > b){ a = b; return 1; } return 0; }
typedef long long ll;
int main()
{
  int n; cin >> n;
  vector<ll> a(n);
  rep(i,n) cin >> a[i];

  sort(a.begin(), a.end());
  ll res = a[n-1];
  int idx = n - 2;
  n -= 2;
  while(1) {
    if(n == 0) break;    
    if(n == 1) {
      res += a[idx];
      break;
    }
    else {
      n -= 2;
      res += 2 * a[idx];
      idx--;
    }
    if(n == 0) break;
  }
  cout << res << "\n";
  
  return 0;
}


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

using ll = long long;
using namespace std;

#define swap(a, b)    do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while(false)
#define repd(i, a, b) for(typeof(b) i = a; i < (b); ++i)
#define rep(i, n)     repd(i, 0, n)
#define dump(x)       cerr << #x << " = " << (x) << endl
#define debug(x)      cerr << "L" << __LINE__ << ": " << #x << " = " << (x) << endl
#define YN(x)         cout << ((x) ? "YES" : "NO") << endl
#define Yn(x)         cout << ((x) ? "Yes" : "No") << endl
#define yn(x)         cout << ((x) ? "yes" : "no") << endl
#define absi(x)       ( ((x) >= 0) ? (x) : (-(x)) )
#define debugvec(v)   rep(i, v.size()) cerr << "L" << __LINE__ << ": " << #v << "[" << i << "] = " << v[i] << endl;
#define debugvec2(v)  cerr << "L" << __LINE__ << ": " << #v << " = { "; rep(i, v.size()) cerr << v[i] << (i + 1 == v.size() ? "" : ", "); cerr << " }" << endl;

ll gcd(ll a, ll b) { return __gcd(a, b); }
ll lcm(ll a, ll b) { return (a == 0 || b == 0) ? 0 : (a / __gcd(a, b) * b); }

int main(int argc, const char* argv[]) {
	ll n;
	cin >> n;
	vector<ll> h(n);
	rep(i, n) {
		cin >> h.at(i);
	}

	ll prev = 0;
	rep(i, n) {
		if(h.at(i) > prev) {
			prev = h.at(i) - 1;
		} else if(h.at(i) == prev) {
			prev = h.at(i);
		} else {
			Yn(false);
			return 0;
		}
	}

	Yn(true);

	return 0;
}


Measured memory_bytes: 1024
import sys
from operator import itemgetter as ITEM
input = sys.stdin.readline

N, T = tuple(map(int, input().split()))
vA = [tuple(map(int, input().split())) for _ in range(N)]

vA.sort(key=ITEM(0))
#print(vA)

# dp[i..N][t..T+1] := max(sum(B))
# dp[i][min(t+A,T+1)] = max(dp[i-1][min(t+A,T+1)], dp[i-1][t]+B)
# if t<=T-1: you can eat
# dp[0][0] = 0

dp = [[0,]*(T+2)]
dp_apnd = dp.append

for A,B in vA:
  pDP = dp[-1]
  #nDP = [0,]*(T+2)
  nDP = dp[-1][:]
  #print(id(pDP),id(nDP))###
  for t in range(T):
    nDP[min(t+A,T+1)] = max(pDP[min(t+A,T+1)], pDP[t]+B)
  dp_apnd(nDP)
  #print(dp[-1][-4:])###

print(max(dp[-1]))


Measured memory_bytes: 114140
#include <iostream>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <vector>
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <queue>
#include <cmath>
#include <cstdio>
using namespace std;
int s[110],n;
int main(){
int sum=0;
cin>>n;
for(int i=0;i<n;i++){
 cin>>s[i];
 sum+=s[i];
}
sort(s,s+n);
if(sum%10!=0)
 cout<<sum;
else{
for(int i=0;i<n;i++)
{if((sum-s[i])%10!=0)
 {cout<<sum-s[i];
  system("pause");
  return 0;
 }
}
cout<<0<<endl;
}
system("pause");
return 0;
}

Measured memory_bytes: 504
/*
─────────────────────
───────────████████──
──────────███▄███████
──────────███████████
──────────███████████
──────────██████─────
──────────█████████──
█───────███████──────
██────████████████───
███──██████████──█───
███████████████──────
███████████████──────
─█████████████───────
──███████████────────
────████████─────────
─────███──██─────────
─────██────█─────────
─────█─────█─────────
─────██────██────────
─────────────────────
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>

#define int long long
#define read(a) int a; cin >> a;
#define readb(a, b) int a, b; cin >> a >> b;
#define readc(a, b, c) int a, b, c; cin >> a >> b >> c;
#define reads(s) string s; cin >> s;
#define readarr(a, n) int a[(n) + 1] = {}; fori (i, 1, n) {cin >> a[i];}
#define readmat(a, n, m) int a[(n) + 1][(m) + 1] = {}; fori (i, 1, n) {fori (j, 1, m) cin >> a[i][j];}

#define print(a) cout << a << endl;
#define printarr(a, n) fori (i, 1, n) cout << a[i] << " "; cout << endl;
#define printv(v) for (int i: v) cout << i << " "; cout << endl;
#define printmat(a, n, m) fori (i, 1, n) {fori (j, 1, m) cout << a[i][j] << " "; cout << endl;}
#define all(v) v.begin(), v.end()
#define sz(s) (int)(s.size())
#define pb push_back
#define fi first
#define se second
#define rz resize
#define fori(i, a, b) for (int i = (a); i <= (b); i++)
#define ford(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
#define setprec(x) cout << fixed << setprecision(x);
 
using namespace std;
using namespace __gnu_pbds; 
 
typedef tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pair <int, int>> vpi;
typedef vector < vector <int> > vvi;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
const int INF = 4e18;
const int mod = 1e9+7; 

     
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    #ifndef ONLINE_JUDGE 
        freopen ("INPUT.txt" , "r" , stdin);
        freopen ("OUTPUT.txt" , "w" , stdout);
        freopen ("OUTPUT_ERROR.txt" , "w" , stderr);
    #endif

    //start from here

    setprec(15)

    readb(n, k) readarr(p, n)

    ld sum[1001]; sum[0] = 0;

    fori (i, 1, 1000) sum[i] = sum[i-1] + i;

    ld val[n+1];

    fori (i, 1, n) val[i] = sum[p[i]] / (ld)(p[i]);

    ld ans = 0, x = 0; fori (i, 1, k) x += val[i];

    ans = x;

    fori (i, k+1, n) 
    {
        x = x - val[i-k] + val[i];
        ans = max(ans, x);
    }

    print(ans)

    return 0;
}




Measured memory_bytes: 8492
import java.util.Scanner;

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

		int inSec = sc.nextInt();

		int minutes = 60;
		int hour = minutes * 60;

		int h = 0, m = 0, s = 0;

		if (hour <= inSec) {
			h = inSec / hour;
			inSec %= hour;
		}
		if (minutes <= inSec) {
			m = inSec / minutes;
			inSec %= minutes;
		}
		s = inSec;

		System.out.println(h + ":" + m + ":" + s);

	}

}


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

int main(){
  string s;
  cin >> s;
  
  int N = s.size();
  
  vector<int> AL;
  vector<int> ZL;
  
  for(int i= 0; i < N; i++){
    
    if(s[i] == 'A'){
     AL.push_back(i); 
    }
    
    if(s[i] == 'Z'){
      ZL.push_back(i); 
    }
  }
  int a = AL.front();
  int z =  ZL.back();
  
  int ans =  z - a + 1;
  cout << ans << endl;
 
}

Measured memory_bytes: 1364
#include <iostream>
#include <string.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int MAXN = 1e5 + 5;
const int INF = 0x3f3f3f3f;
#define DEBUG(x) cout << (x) << '\n'

void run(){
    int n, t, ans = 0; cin >> n;
    for(int i = 1; i <= n; i++)
        cin >> t, ans += (i & 1) && (t & 1);
    cout << ans;
}
int main(){
#ifdef Irene
    freopen("in.txt", "r", stdin);
#endif // Irene
//    ios::sync_with_stdio(false);

   run(); return 0;
}


Measured memory_bytes: 3592
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
#define all(a) a.begin(), a.end()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using namespace std;

template<const long long mod = 1000000007>
struct mint{ //modint
    long long x;
    mint(long long x = 0): x(((x % mod) + mod) % mod) {}
    friend istream& operator >> (istream &s, mint& m){ return s >> m.x; }
    friend ostream& operator << (ostream &s, mint m){ return s << m.x; }
    inline mint& operator += (mint a){ if((x += a.x) >= mod)x -= mod; return *this; }
    inline mint& operator -= (mint a){ if((x += mod - a.x) >= mod)x -= mod; return *this; }
    inline mint& operator *= (mint a){ (x *= a.x) %= mod; return *this; }
    inline mint& operator /= (mint a){ return (*this) *= a.inv(); }
    inline mint operator + (mint a){ mint res(*this); return res += a; }
    inline mint operator - (mint a){ mint res(*this); return res -= a; }
    inline mint operator * (mint a){ mint res(*this); return res *= a; }
    inline mint operator / (mint a){ mint res(*this); return res /= a; }
    inline void takemod(){ x = ((x % mod) + mod) % mod; }
    mint inv(){ return pow(mod - 2); }
    mint pow(long long p){
        mint res(1), tmp(x);
        for(; p; p >>= 1){ if(p & 1)res *= tmp; tmp *= tmp; }
        return res;
    }
};

template<const long long mod = 1000000007>
struct mfact{ //modfact
private:
    vector<mint<mod>> fact, ifact;
public:
    mfact(int size = 200010) : fact(size + 1), ifact(size + 1) {
        fact[0] = mint<mod>(1);
        for(int i = 1; i <= size; i++)fact[i] = fact[i - 1] * mint<mod>(i);
        ifact[size] = fact[size].inv();
        for(int i = size; i > 0; i--)ifact[i - 1] = ifact[i] * mint<mod>(i);
    }
    inline mint<mod> operator [] (int i){ return fact[i]; }
    inline mint<mod> nPr(int n, int r){ return fact[n] * ifact[r]; }
    inline mint<mod> nCr(int n, int r){ return fact[n] * ifact[n - r] * ifact[r]; }
};

// AtCoder Grand Contest 037
int main(){

    int n; cin >> n;
    mint<998244353> ans(1);

    function<int(char)> enc = [](char c){
        if(c == 'R')return 1;
        if(c == 'G')return 2;
        if(c == 'B')return 4;
        return 0;
    };

    vector<int> cnt(7, 0);
    rep(i, n * 3){
        char c; cin >> c;
        c = enc(c);
        if(cnt[7 - c]){
            ans *= mint<998244353>(cnt[7 - c]);
            cnt[7 - c]--;
            continue;
        }
        bool found = false;
        for(int j = 1; j <= 4; j <<= 1)if(cnt[j]){
            if(c != j){
                found = true;
                ans *= mint<998244353>(cnt[j]);
                cnt[j]--;
                cnt[c + j]++;
                break;
            }
        }
        if(!found)cnt[c]++; 
    }

    for(int i : cnt)assert(i == 0);
    cout << ans * mfact<998244353>()[n] << endl;
    return 0;

}

Measured memory_bytes: 3456
import java.util.*;

public class Main {
  public static void main(String[] args) throws Exception {
  Scanner sc = new Scanner(System.in);
  int n = sc.nextInt();
  int k = sc.nextInt();
  int sum = 0;
  int[] arr = new int[n];
  for (int i = 0; i < n; i++) {
    arr[i] = sc.nextInt();
  }
  Arrays.sort(arr);
  int count = 0;
  for (int i = arr.length - 1; count < k; i--) {
    sum += arr[i];
    count++;
  }

  System.out.println(sum);
  }
}


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

int main() {
  ll n;
  cin >> n;
  vector<ll> v(n);
  rep(i, n)
    cin >> v.at(i);
  sort(v.begin(),v.end());
  
  bool ans = false;
  
  rep(i, n-1){
    if(v.at(i) == v.at(i+1))
      ans = true;
  }
  if(ans)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
}

Measured memory_bytes: 4780
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define INF 1e12

#define PB push_back
#define PF push_front
#define fi first
#define se second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vpi vector<pii>
#define vll vector<ll>
#define vpl vector<pll>
#define vvi vector<vector<int>>
#define vvl vector<vector<ll>>
#define MX(x) *max_element(all(x))
#define MN(x) *min_element(all(x))
#define ios ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define pr_d(x) cout << fixed << setprecision(15) << x << endl
#define ud(c, x) distance(c.begin(), upper_bound(all(c), x))
#define ld(c, x) distance(c.begin(), lower_bound(all(c), x))
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define rep3(i, n) for (int i = (n - 1); i >= 0; --i)
#define rep4(i, a, b) for (int i = (a); i > (b); --i)
#define pb push_back
#define out(x) cout << x << "\n"
bool odd(int i) { return i % 2; }

#define all(v) v.begin(), v.end()
#define size(x) int(x.size())

int gcd(int a, int b) { return __gcd(a, b); }
int lcm(int a, int b) { return a * (b / gcd(a, b)); }
void Yes_No(bool f) {
  if (f)
    printf("YES\n");
  else
    printf("NO\n");
}

void deb_p(pii p) { printf("pair = %d %d\n", p.fi, p.se); }
void deb_i(int i) { printf("i = %d\n", i); }
void deb_v(vector<int> v) {
  printf("v = ");
  for (auto i : v) printf("%d ", i);
  printf("\n");
}
template <typename T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
bool chmin(T& a, const T& b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
//-------------------ここから回答する-----------------------

void solve(void) {
  string a, b, c;
  cin >> a >> b >> c;
  Yes_No(a[size(a)-1]==b[0]&&b[size(b)-1]==c[0]);
}
int main(void) { solve(); }

Measured memory_bytes: 3556
#include <stdio.h>
#include <vector>
#include <bitset>
#include <iostream>

int main()
{
  int n,k;
  scanf("%d", &n);
  scanf("%d", &k);
  std::vector<int> d(k);
  //std::vector<std::bitset<101>> veca(k);
  std::bitset<101> veca[100];
  for(int i=0;i<k;i++){
    veca[i] ^= veca[i];
    veca[i] = ~veca[i];
    int d;
    scanf("%d",&d);
    for(int j=0;j<d;j++){
      int aa;
      scanf("%d",&aa);
      veca[i].reset(aa);
    }
    //std::cout << std::endl;
    //std::cout << veca[i] << std::endl;;
  }
  std::bitset<101> tmp;
  tmp ^= tmp;
  tmp = ~tmp;

  for(int i=0;i<k;i++){
    tmp &= veca[i];
  }
  tmp = ~tmp;
  int sum = n - tmp.count();

  //std::cout << tmp << std::endl;;
  std::cout << sum << std::endl;
  return 0;

}

Measured memory_bytes: 3692
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const int MAX_K = 100010;

vector<int> dp(MAX_K);

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

    vector<int> a(n);
    rep(i, n) {
        cin >> a[i];
    }

    for(int i = 1; i <= k; i++) {
        rep(j, n) {
            if(i - a[j] >= 0) {
                dp[i] |= !dp[i-a[j]];
            }
        }
    }

    if(dp[k]) {
        cout << "First";
    }
    else {
        cout << "Second";
    }

    cout << endl;
    return 0;
}

Measured memory_bytes: 640
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


k,a,b = list(map(int, input().split()))
c = 1
if b<=a+2:
    ans = c + k
else:
    if k<=(a-c):
        ans = c + k
    else:
        c = a
        k -= (a-1)
        ans = c + (b-a)*(k//2)
        if k%2==1:
            ans += 1
print(ans)

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

int main() {
  int n; // 試行回数
  int k; // 操作Bの際に足す値
  cin >> n >> k;
  
  int ret = 1;
  for (int i = 0; i < n; i++) {
  	int ret_a = ret * 2;
    int ret_b = ret + k;
    
    ret = (ret_a <= ret_b) ? ret_a : ret_b;
  }
  
  cout << ret << endl;
}


Measured memory_bytes: 256
use proconio::input;

fn main() {
    input! {
        s : String
    };
    let mut dp = [[0i64;2019];2];
    let bytes = s.as_bytes();
    let mut res = 0;
    for i in 0..bytes.len() {
        dp[i%2][0] += 1;
        for j in 0..2019 { dp[1-i%2][j] = 0; }
        for j in 0..2019 {
            dp[1-i%2][(10*j+(bytes[i]-b'0') as usize)%2019] += dp[i%2][j];
        }
        res += dp[1-i%2][0];
    }
    println!("{}", res);
}


Measured memory_bytes: 2408
n = int(input())
for i in range(n):
    l = list(map(int, input().split()))
    x = y = z = 0
    for j in l:
        if j > y:
            y = j
        elif j > z:
            z = j
        else:
            x = 1
    print(["YES", "NO"][x])

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

int main(){
	/*input*/
	int a, b;	cin >> a >> b;
	/*calculaiton*/
	int min, max;  
	if(a > b){
		max = a;
		min = b;
	}else{
		max = b;
		min = a;
	}
	int tmp = max - min + 1;
	/*output*/
	if(tmp%2){
		cout << min + (tmp + 1)/2 - 1 << endl;
	}else{
		cout << "IMPOSSIBLE" << endl;
	}
}


Measured memory_bytes: 256
n=int(input())
A=list(map(int,input().split()))
MOD=10**9+7
O=[0]*61
Z=[0]*61
for a in A:
	for i in range(61):
		if (1<<i)&a:
			O[i]+=1
		else:
			Z[i]+=1
	
R=0
for i in range(61):
	R+=pow(2,i,MOD)*O[i]%MOD*Z[i]%MOD
	R%=MOD

print(R)

Measured memory_bytes: 122936
#include <iostream>
#include <math.h>
using namespace std;

int n;

void solve()
{
	double nx,ny,nr,mx,my,mr,pdist;


	cin >> nx >> ny >> nr >> mx >> my >> mr;
	pdist = sqrt(pow((nx-mx), 2.0) + pow((ny-my),2.0));

	if(pdist - nr + mr < 0.0){
		cout << 2 << endl;
	}
	else if((pdist - mr + nr < 0.0)){
		cout << -2 << endl;
	}
	else if(pdist - mr - nr > 0.0){
		cout << 0 << endl;
	}
	else {
		cout << 1 << endl;
	}
}

int main(void)
{
	cin >> n;
	while(--n, n>=0){
		solve();
	}
	return 0;
}

Measured memory_bytes: 1236
// #pragma GCC optimize("unroll-loops", "omit-frame-pointer", "inline")
// #pragma GCC option("arch=native", "tune=native", "no-zero-upper")
// #pragma GCC
// target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("tree-vectorize","openmp","predictive-commoning")
// #pragma GCC option("D_GLIBCXX_PARALLEL","openmp")

#pragma GCC optimize("O3")
// #pragma GCC target("avx2")

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<ll> vll;
// #define int long long
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000               // 2e9
#define LLINF 2000000000000000000ll  // 2e18 (llmax:9e18)
#define fi first
#define sec second
#define all(x) (x).begin(), (x).end()
#define sq(x) ((x) * (x))
#define dmp(x) cerr << #x << ": " << x << endl;

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

template <class T>
using MaxHeap = priority_queue<T>;
template <class T>
using MinHeap = priority_queue<T, vector<T>, greater<T>>;
template <class T>
vector<T> vect(int len, T elem) {
  return vector<T>(len, elem);
}

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << p.fi << ',' << p.sec;
  return os;
}
template <class T, class U>
istream &operator>>(istream &is, pair<T, U> &p) {
  is >> p.fi >> p.sec;
  return is;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  for (int i = 0; i < vec.size(); i++) {
    os << vec[i];
    if (i + 1 < vec.size()) os << ' ';
  }
  return os;
}
template <class T>
istream &operator>>(istream &is, vector<T> &vec) {
  for (int i = 0; i < vec.size(); i++) is >> vec[i];
  return is;
}
void fastio() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  cout << fixed << setprecision(20);
}

#define endl "\n"

void solve() {
  vector<int> a = {-1, 2, 5, 5, 4, 5, 6, 3, 7, 6};
  int N, M;
  cin >> N >> M;
  vector<int> A(M);
  cin >> A;
  sort(all(A));
  reverse(all(A));
  int mi = INF;
  for (int ele : A) { chmin(mi, a[ele]); }
  vector<int> dp(N + 1, -INF);
  dp[0] = 0;
  for (int i = 1; i <= N; i++) {
    for (int j : A) {
      if (i - a[j] >= 0) chmax(dp[i], dp[i - a[j]] + 1);
    }
  }
  int cur = N;
  vector<int> ans;
  for (int i = 0; i < dp[N]; i++) {
    for (int j : A) {
      if (cur - a[j] >= 0 && dp[cur - a[j]] == dp[cur] - 1) {
        ans.push_back(j);
        cur -= a[j];
        break;
      }
    }
  }
  for (int i = 0; i < ans.size(); i++) cout << ans[i];
  cout << endl;
  return;
}

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

  // int t; cin >> t;
  // for(int i=1;i<=t;i++){
  //   cout << "Case #" << i << ": ";
  //   solve();
  // }
  return 0;
}


Measured memory_bytes: 384
import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception{
		Scanner scn = new Scanner(System.in);
		int a = scn.nextInt();
		String s = scn.next();
      	int b = scn.nextInt();
      	int ans = 0;
      	if(s.equals("+")) ans = a+b;
      	else ans = a-b;
      	System.out.println(ans);
	}
}

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

#define ll long long int
#define endl '\n'
ll const mod = 1e9 + 7;


int main() {
    
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    int n;
    cin>>n;
    
    ll s=0;
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=n;j++)
        {
            for(int k=1;k<=n;k++)
            {
                s+=__gcd(i,__gcd(j, k));
            }
        }
    }
    
    cout<<s;
    
	// your code goes here
	return 0;
}


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

int main()
{
	int Min = INT_MAX;
	int Max = -INT_MAX;
	
	int n,temp;
	cin >> n;
	for(int i = 1;i <= n;i ++)
	{
		cin >> temp;
		if(i != 1) Max = max(temp - Min, Max);
		Min = min(Min,temp);
	}
	
	cout << Max <<endl;
	return 0;
}

Measured memory_bytes: 3088
#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long ll;
typedef long double ld;
#define pb push_back
#define mp make_pair

using namespace std;

int main()
{
   FAST/**/
   
   ll x,y,z,k;
   cin>>x>>y>>z>>k;
   
   ll arr[x], arr1[y], arr2[z];
   for(ll i=0;i<x;i++)
        cin>>arr[i];
   for(ll i=0;i<y;i++)
        cin>>arr1[i];
   for(ll i=0;i<z;i++)
        cin>>arr2[i];
   
   sort(arr,arr+x);        
   sort(arr1,arr1+y);
   sort(arr2,arr2+z);  
   
   vector<ll> hold;
   for(ll i=0;i<x;i++)
        for(ll j=0;j<y;j++)
            hold.pb(arr[i] + arr1[j]);
   
   sort(hold.begin(), hold.end(), greater<ll>());
   
   vector<ll> hold1;
   for(ll i=0;i<min((ll)hold.size(), k);i++)
        for(ll j=0;j<min(z,k);j++)
            hold1.pb(hold[i]+arr2[j]);
   sort(hold1.begin(), hold1.end(), greater<ll>());
   for(ll i=0;i<k;i++)
        cout<<hold1[i]<<"\n";
   
   return 0;
}

Measured memory_bytes: 43364
#include <bits/stdc++.h>
using namespace std;
#define REP(i,N) for(i=0;i<N;i++)
#define INF 1e9
typedef long long ll;

int main(void){
  int N;cin >> N;
  int V[N],C[N];
  int i,ans=0;
  REP(i,N) cin >> V[i];
  REP(i,N) cin >> C[i];
  REP(i,N){
    if(V[i]-C[i]>0)ans+=V[i]-C[i];
  }
  cout << ans << endl;
  return 0;
}


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

namespace ConsoleApp16
{
    class Program
    {
        static void Main(string[] args)
        {
            var values1 = Console.ReadLine().Split(' ').Select(s=>int.Parse(s)).ToArray();
            var values2 = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();

            int N = values1[0];
            int K = values1[1];

            int[] hn = values2;

            Console.WriteLine(hn.Where(h => h >= K).Count());
        }
    }
}


Measured memory_bytes: 19296
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i,n) for(ll i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define fi first
#define se second

template<typename T> inline bool chmax(T &a, T b){if(a<b){a=b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;}
template<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){int len=d.size();rep(i,len){s<<d[i];if(i<len-1) s<<" ";}return s;}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){int len=d.size();rep(i,len){s<<d[i]<<endl;}return s;}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){s<<"{"<<endl;for(auto itr=m.begin();itr!=m.end();++itr){s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;}s<<"}"<<endl;return s;}

const ll mod=1e9+7;
const ll inf=1e17;
const int INF=1e9;
const double PI=acos(-1);
const double EPS=1e-10;

int main(){
	cin.tie(0);ios::sync_with_stdio(false);
	int n,m;
	cin>>n>>m;
	vector<int> a(n);
	map<int,int> mp1,mp2;
	rep(i,n){
		cin>>a[i];
		mp1[a[i]]++;
		mp2[a[i]%m]++;
	}
	vector<vector<int>> cnt(m);
	for(auto itr:mp1){
		cnt[itr.fi%m].push_back(itr.se);
	}
	rep(i,m){
		sort(begin(cnt[i]),end(cnt[i]),greater<int>());
	}
	int ans=0;
	for(auto &itr:mp2){
		int r=itr.fi,now=itr.se;
		int tar=mp2[(m-r)%m];
		if(r!=(m-r)%m){
			if(tar>=now){
				itr.se-=now;
				ans+=now;
				mp2[(m-r)%m]-=now;
			}
		}else{
			ans+=mp2[r]/2;
		}
	}
	rep(i,m){
		if(i==(m-i)%m) continue;
		int ret=mp2[i];
		int now=0;
		for(auto x:cnt[i]){
			if(x>=ret){
				ans+=ret/2;
				break;
			}else{
				ans+=x/2;
				ret-=x/2*2;
			}
		}
	}
	cout<<ans<<endl;
}


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

int main() {
    int N, Q;
    std::cin >> N >> Q;
    std::vector<std::vector<int>> v(N);
    for (int q = 0; q < Q; ++q) {
        int t;
        std::cin >> t;
        if (t == 0) {
            int i, x;
            std::cin >> i >> x;
            v[i].push_back(x);
        } else if (t == 1) {
            int i;
            std::cin >> i;
            if (v[i].empty()) {
                std::cout << "\n";
            } else {
                for (int j = 0; j < v[i].size(); ++j) {
                    std::cout << v[i][j] << " \n"[j == v[i].size() - 1];
                }
            }
        } else {
            int i;
            std::cin >> i;
            v[i].clear();
        }
    }
    return 0;
}



Measured memory_bytes: 5780
#include <iostream>
#include <vector>
#include <array>
#include <list>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <tuple>
#include <memory>
#include <cmath>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <numeric>
#include <climits>
#include <cfloat>
#include <cassert>
#include <random>


int main() {
	long long int n; std::cin >> n;
	int a, b; std::cin >> a >> b;
	for (auto i = 1; i <= n % 12; ++i) {
		if (i % 2 == 1) {
			a = a - b;
		}
		else {
			b = a + b;
		}
	}
	std::cout << a << ' ' << b << std::endl;
}


Measured memory_bytes: 3104
#!/usr/bin/env python
from collections import deque, defaultdict
from itertools import combinations, combinations_with_replacement
import bisect
from math import factorial, sqrt, log, ceil, floor

def main():
    A, B, N = map(int, input().split())

    if N >= B:
        print(floor(A * (B - 1) / B))
    else:
        print(floor(A * N / B))


if __name__ == '__main__':
    main()

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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define deg_to_rad(deg) (((deg) / 360) * 2 * M_PI)
#define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360)

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i < (int)(n); i++)

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

typedef long long ll;

map<ll, ll> prime_factor(ll n) {
    map<ll, ll> res;
    for (ll i = 2; i * i <= n; i++) {
        while (n % i == 0) {
            ++res[i];
            n /= i;
        }
    }
    if (n != 1) res[n] = 1;
    return res;
}

int main() {
    ll N;
    ll ans = 0;
    cin >> N;
    map<ll, ll> prime = prime_factor(N);
    for (auto p : prime) {
        ll max_e = p.second;
        int e = 1;
        int cnt = 0;
        while (max_e >= e) {
            cnt++;
            max_e -= e;
            e++;
        }
        ans += cnt;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rep2(i, s, n) for(int i=s; i<(n); ++i)
#define sz(x) int(x.size())

typedef long long ll;

using namespace std;

/*******-c++14 don't include-*******/
template<typename T>
T gcd(T a, T b){if( b == 0)return a; return gcd(b, a%b); }
template<typename T>
T lcm(T a, T b){return a*b/gcd(a,b); }
void printArr(int *a, int len){for(int i=0; i<len; i++){if(i)cout << " ";cout << a[i];}cout << endl;}
/*******---------------------*******/

static const int INTINF = (2147483647);
static const ll LLINF = (9223372036854775807);
static const int MAX = 200001;
static const ll MOD = 1000000007;

//--global--//

struct MyTask{
    ll a, b;
    MyTask() {}
    MyTask(ll a0, ll b0) : 
        a(a0),
        b(b0)
        {}
    bool operator< (const MyTask& rhs) const
    {
        if(b < rhs.b){
            return true;
        }
        return false;
    }
};

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

int main(int argc, const char * argv[]) {
    //提出時、消す----//
    //--------------//
    
    ll n;
    cin >> n;
    MyTask Tasks[MAX];
    rep(i, n){
        ll a;
        ll b;
        cin >> a;
        cin >> b;
        Tasks[i] = MyTask(a, b);
    }
    sort(Tasks, Tasks+n, [](const MyTask &x, const MyTask &y){
        return x.a < y. a;
    });
    sort(Tasks, Tasks+n);
    ll now = 0;
    rep(i, n){
        now += Tasks[i].a;
        if(now > Tasks[i].b){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    
    return 0;
}


Measured memory_bytes: 3328
from itertools import combinations

n,m,x=map(int,input().split())

l=[list(map(int,input().split())) for _ in range(n)]
cost=float("inf")

for i in range(1,n+1):
    for l1 in combinations(l,i):
        score = [0]*m
        cost1=0

        for l2 in l1:
            cost1 += l2[0]
            for j in range(1,m+1):
                score[j-1] += l2[j]

        if min(score) >= x:
            cost = min(cost,cost1)

if cost == float("inf"):
    print(-1)
else:
    print(cost)

Measured memory_bytes: 9220
#include <cstdio>
#include <cstring>

using namespace std;

int main(void){
	int num, ans[4] = {0}, i;
	char str[3], s[4][3] = {"A","B","AB","O"};
	while(scanf("%d%*c%s",&num,str) != EOF){
		for(i = 0;i < 4;i++){
			if(!strcmp(s[i],str)){
				ans[i]++;
			}
		}
	}
	for(i = 0;i < 4;i++){
		printf("%d\n",ans[i]);
	}
	return 0;
}

Measured memory_bytes: 1032