akhauriyash/Code-Regression huggingface dataset:
#ifndef LOCAL
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#else
#include <iostream>
#include <iomanip> 
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <memory>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#endif
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; }; sim > rge<c> range(c i, c j) { return rge<c>{i, j}; } sim > auto dud(c* x) -> decltype(cerr << *x, 0); sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; } eni(!=) cerr << boolalpha << i; ris; } eni(==) ris << range(begin(i), end(i)); } sim, class b dor(pair < b, c > d) { ris << "(" << d.first << ", " << d.second << ")"; } sim dor(rge<c> d) { *this << "["; for (auto it = d.b; it != d.e; ++it) *this << ", " + 2 * (it == d.b) << *it; ris << "]"; }
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

// #include <ext/pb_ds/assoc_container.hpp> 
// #include <ext/pb_ds/tree_policy.hpp> 
// using namespace __gnu_pbds; 
// #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 

template<typename T> void setmax(T& x, T y) {x = max(x, y);}
template<typename T> void setmin(T& x, T y) {x = min(x, y);}
#define fix(a) fixed << setprecision(a)
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define rep(i, a, b) for (int i = int(a); i < int(b); i++)
#define all(V) V.begin(), V.end()
#define rall(V) V.rbegin(), V.rend()
#define len(V) (int)V.size()
#define ll long long
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define endl '\n'

void solve(){
  int h, w;
  cin >> h >> w;
  string c[h];
  forn(i, h) cin >> c[i];
  rep(i, 1, h*2+1){
    cout << c[((i+1)/2)-1] << endl;
  }
}

int main() {
  ios::sync_with_stdio(false);
  // cin.tie(0); cout.tie(0);
  int t = 1;
  // cin >> t;
  forn(i, t){
    solve();
  }
}

/* 

aattccooddeerrbreeggiunlnaerrccoonntteesstt
aattccooddeerrbreeggiunlnaerrccoonntteesstt
*/

Measured memory_bytes: 3664
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cctype>

inline void read(int & x)
{
	x = 0;
	int k = 1;
	char c = getchar();
	while (!isdigit(c))
		if (c == '-') c = getchar(), k = -1;
		else c = getchar();
	while (isdigit(c))
		x = (x << 1) + (x << 3) + (c ^ 48),
		c = getchar();
	x *= k;
}

int n, m, k, cnt, ans[101010], p[101010];

struct City
{
	int p, num, y;
	bool operator < (const City & b) const
	{
		if (p == b.p) return y < b.y;
		return p < b.p;
	}
}c[101010];

signed main()
{
	read(n), read(m);
	for (int i = 1; i <= m; ++i) read(c[i].p), read(c[i].y), c[i].num = i, p[i] = c[i].p;
	std::sort(c + 1, c + m + 1); c[0].p = 0;
	for (int i = 1; i <= m; ++i)
	{
		if (c[i].p != c[i - 1].p) cnt = 1;
		else ++cnt;
		ans[c[i].num] = cnt;
	}
	for (int i = 1; i <= m; ++i)
	{
		k = 99999;
		while (p[i] <= k) 
		{
			k /= 10;
			putchar('0');
		}
		printf("%d", p[i]);
		k = 99999;
		while (ans[i] <= k) 
		{
			k /= 10;
			putchar('0');
		}
		printf("%d\n", ans[i]);
	}
}



Measured memory_bytes: 3456
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <cstring>
#define N 100002
using namespace std;
struct node{
	int u,v,w;
}e[200002];
vector<int> id[N];
int head[2000002],ver[2000002],nxt[2000002],edge[2000002],l;
int n,m,i,j,cnt[N],now[N],dis[2000002],num;
bool in[2000002];
int read()
{
	char c=getchar();
	int w=0;
	while(c<'0'||c>'9') c=getchar();
	while(c<='9'&&c>='0'){
		w=w*10+c-'0';
		c=getchar();
	}
	return w;
}
int my_comp(const node &x,const node &y)
{
	return x.w<y.w;
}
void insert(int x,int y,double z)
{
	l++;
	ver[l]=y;
	edge[l]=z;
	nxt[l]=head[x];
	head[x]=l;
}
void SPFA(int s)
{
	queue<int> q;
	memset(dis,0x3f,sizeof(dis));
	q.push(s);
	dis[s]=0;in[s]=1;
	while(!q.empty()){
		int x=q.front();
		q.pop();
		for(int i=head[x];i;i=nxt[i]){
			int y=ver[i];
			if(dis[y]>dis[x]+edge[i]){
				dis[y]=dis[x]+edge[i];
				if(!in[y]){
					in[y]=1;
					q.push(y);
				}
			}
		}
		in[x]=0;
	}
}
int main()
{
	n=read(),m=read();
	for(i=1;i<=m;i++) e[i].u=read(),e[i].v=read(),e[i].w=read();
	sort(e+1,e+m+1,my_comp);
	for(i=1;i<=m;i++){
		int u=e[i].u,v=e[i].v,w=e[i].w;
		if(now[u]!=w) cnt[u]++,now[u]=w,id[u].push_back(++num);
		if(now[v]!=w) cnt[v]++,now[v]=w,id[v].push_back(++num);
		insert(id[u][cnt[u]-1],id[v][cnt[v]-1],0);
		insert(id[v][cnt[v]-1],id[u][cnt[u]-1],0);
	}
	for(i=1;i<=n;i++){
		for(j=0;j<cnt[i];j++){
			insert(num+i,id[i][j],1);
			insert(id[i][j],num+i,1);
		}
	}
	SPFA(num+1);
	if(dis[num+n]==dis[0]) cout<<"-1"<<endl;
	else cout<<dis[num+n]/2<<endl;
	return 0;
}


Measured memory_bytes: 45824
#include<iostream>
#include<vector>
#include<queue>
#include<string>
#include<sstream>

using namespace std;

class Graph{
private:
    struct Node {
        int index;
        bool done;
        long long dist;
        vector<pair<int, int>> adj;
        Node() : done(false), dist(INF) {}

        bool operator>(const Node& another) const {
            return dist > another.dist;
        }
    };

    vector<Node> nodes;

    void range_check(int i) {
        if (i < 0 || i > n) {
            cout << "dijkstra: Invalid node index: " << i << endl;
            throw "Exception";
        }
    }
public:
    const static long long INF = 1LL << 62;
    const int n;

    Graph(int _n) : n(_n) {
        nodes = vector<Node>(_n);
        for (int i = 0; i < _n; ++i) {
            nodes[i].index = i;
        } 
    }

    // add directed edge from u-th node to v-th node
    void addEdge(int u, int v, int w) {
        range_check(u);
        range_check(v);
        nodes[u].adj.push_back(make_pair(v, w));
        if (w < 0) {
            cout << "dijkstra: All weights must be positive: " << w << " (" << u << " -- " << v << ")" << endl;
            throw "Exception";
        }
    }

    // add undirected edge between u-th node and v-th node
    void addUndirectedEdge(int u, int v, int w) {
        addEdge(u, v, w);
        addEdge(v, u, w);
    }

    // calculate shortest distance from s-th node
    void dikstra(int s) {
        range_check(s);

        priority_queue<Node, vector<Node>, greater<Node>> pq;

        nodes[s].dist = 0;
        pq.push(nodes[s]);

        while (!pq.empty()) {
            Node top = pq.top();
            pq.pop();
            top.done = true;

            int u = top.index;
            for (pair<int, int> p : top.adj) {
                int v = p.first;
                int w = p.second;
                if (nodes[v].done) continue;

                long long newdist = nodes[u].dist + (long long)w;
                if (nodes[v].dist > newdist) {
                    nodes[v].dist = newdist;
                    pq.push(nodes[v]);
                }
            }
        }
    }

    long long shortestDistTo(int i) const {
        return nodes[i].dist;
    }

    string dump() const {
        ostringstream os;
        for (Node node : nodes) {
            os << node.index << ": ";
            for (pair<int, int> p : node.adj) {
                os << p.first << "(" << p.second << ") ";
            }
            os << endl;
        }
        return os.str();
    }
};


int n, m, r;

int main () {
    cin >> n >> m >> r;
    Graph graph(n);
    for (int i = 0; i < m; ++i) {
        int u, v, w;
        cin >> u >> v >> w;
        graph.addEdge(u, v, w);
    }
    graph.dikstra(r);
    for (int i = 0; i < n; ++i) {
        long long d = graph.shortestDistTo(i);
        if (d == Graph::INF) {
            cout << "INF" << endl;
        } else {
            cout << d << endl;
        }
    }
}



Measured memory_bytes: 21472
#include <bits/stdc++.h>
#define fastcin() cin.tie(0);ios::sync_with_stdio(false)
#define rep(i,n) for(int i=0;i<int(n);i++)
#define rep1(i,n) for(int i=1;i<=int(n);i++)
#define per(i,n) for(int i=int(n)-1;i>=0;i--)
#define per1(i,n) for(int i=int(n);i>0;i--)
#define foreach(i,n) for(auto &&i:n)
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort(all(x))
#define REV(x) reverse(all(x))
#define MAX(x) *max_element(all(x))
#define MIN(x) *min_element(all(x))
#define LOWitr(x, n) lower_bound(all(x), n)
#define UPRitr(x, n) upper_bound(all(x), n)
#define cii(x) int x;cin >> x
#define cill(x) LL x;cin >> x
#define cis(x) string x;cin >> x
#define co(x) cout << x << endl
#define dump(x)  cout << #x << " = " << (x) << endl
#define truecheck assert
#define pb push_back
#define mp make_pair
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef long long int64;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
template<class T,class U>bool chmax(T &a, const U &b){if (a<b){a=b;return true;}return false;}
template<class T,class U>bool chmin(T &a, const U &b){if (b<a){a=b;return true;}return false;}
template<class T,class U>void vcin(T &v, U n){rep(i, n){typename T::value_type a;cin >> a;v.pb(a);}}
const int INF = 1e9, MOD = 1e9 + 7;
const LL LLINF = 1e16;

int main() {
    fastcin();
    cout << fixed << setprecision(10);
    int64 r=0, g=0, b=0;
    cii(n);
    cis(s);
    if (n <= 3){
        co(0);return 0;
    }
    rep(i, n){
        if (s[i]=='R')
            r++;
        if (s[i]=='G')
            g++;
        if (s[i]=='B')
            b++;
    }
    LL ans = r*g*b;
    if (ans == 0){
        co(0);return 0;
    }
    rep(i, (n-1)/2){
        rep(j, n - 2 - i*2){
            int64 a = j;
            int64 bb = j + i + 1;
            int64 c = j + i * 2 + 2;
            int64 x=0, y=0, z=0;
            if (s[a]=='R')
                x++;
            if(s[a]=='G')
                y++;
            if(s[a]=='B')
                z++;

            if (s[bb]=='R')
                x++;
            if(s[bb]=='G')
                y++;
            if(s[bb]=='B')
                z++;

            if (s[c]=='R')
                x++;
            if(s[c]=='G')
                y++;
            if(s[c]=='B')
                z++;
            if (x==1&&y==1&&z==1)
                ans--;
        }
    }
    if (ans < 0){
        co(0);
    }else{
        co(ans);
    }

    return 0;
}

Measured memory_bytes: 3652
a, b, c, x, y = list(map(int, input().split()))
if a > c*2 and b > c*2:
  if x > y:
    print(x * c * 2)
  else:
    print(y * c * 2)
elif a > c*2:
  if x > y:
    print(x * c * 2)
  else:
    print(x * c * 2 + (y - x) * b)
elif b > c*2:
  if y > x:
    print(y * c * 2)
  else:
    print(y * c * 2 + (x - y) * a)
elif a + b > c*2:
  if x > y:
    print(y * c * 2 + (x - y) * a)
  else:
    print(x * c * 2 + (y - x) * b)
else:
  print(a * x + b * y)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define reps(i,n) for(int i=1;i<(int)(n);i++)

typedef long long ll;
using namespace std;

ll gcd(ll a, ll b) { //最大公約数
  if (b==0) return a;
  else return gcd(b, a%b);
}

ll lcm(ll a, ll b) { //最小公倍数
  return a * b / gcd(a, b);
}

ll digit_sum(ll a){ //10進桁和
  ll ans=0;
  while(a>0){
    ans+=a%10;
    a/=10;
  }
  return ans;
}



int main()
{
  ll h,w;
  char a[110][110];
  bool flag[110][110]={false};
  bool flag2[110][110]={false};
  cin>>h>>w;
  rep(i,h){
    rep(j,w)cin>>a[i][j];
  }


  rep(i,h){
    ll tmp=0;
    rep(j,w){
      if(a[i][j]=='#')tmp++;
    }
    if(tmp!=0){
      rep(k,w){
        flag[i][k]=true;
      }
    }
  }


  rep(i,w){
    ll tmp=0;
    rep(j,h){
      if(a[j][i]=='#')tmp++;
    }
    if(tmp!=0){
      rep(k,h)flag2[k][i]=true;
    }
  }

  rep(i,h){
    ll tmp=0;
    rep(j,w){
      if(flag[i][j]&&flag2[i][j]){
        cout<<a[i][j];
        tmp++;
      }
    }
    if(tmp>0)cout<<endl;
  }
  return 0;
}


Measured memory_bytes: 3656
#include <stdio.h>

int main() {
	int i, n, p[10], max = 0;
	int sum = 0;

	scanf("%d", &n);

	for (i = 0; i < n; i++) {
		scanf("%d", &p[i]);
		if (p[i] >= max) max = p[i];
		sum += p[i];
	}

	printf("%d\n", sum - max / 2);

	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <string>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
using namespace std;
#define loop(i,N) for(ll (i)=0; (i)<(N);++(i))
struct _OMAZINAI_ { _OMAZINAI_() { std::ios::sync_with_stdio(false); std::cin.tie(0); } } __omazinai_instance__;
#define INF ((1LL<<61) + (1<<29))
#define YesNo(x) {std::cout << ((x)?"Yes":"No") << std::endl;}
#define YESNO(x) {std::cout << ((x)?"YES":"NO") << std::endl;}
#define OddEven(x) {std::cout << ((x)%2?"Odd":"Even") << std::endl;}
#define ODDEVEN(x) {std::cout << ((x)%2?"ODD":"EVEN") << std::endl;}
typedef long long int ll;
ll my_gcd(ll a, ll b) { return b ? my_gcd(b, a%b) : a; };
void _INPUT_IMPL_() {};
template <class T, class... Args> void _INPUT_IMPL_(T& dest, Args&... args) { cin >> dest; _INPUT_IMPL_(args...); }
void _OUTPUT_IMPL_() {};
template <class T, class... Args> void _OUTPUT_IMPL_(T dest, Args... args) { cout << dest << (sizeof...(Args) ? " " : ""); _OUTPUT_IMPL_(args...); }
#define in(type, ...) type __VA_ARGS__; _INPUT_IMPL_(__VA_ARGS__)
#define in_v(type, name, cnt) vector<type> name(cnt); loop(i, cnt) cin >> name[i];
#define sort_v(v) std::sort(v.begin(), v.end())
#define unique_v(v) v.erase(std::unique(v.begin(), v.end()), v.end()) //必ずソート後に実行
#define out(...) (_OUTPUT_IMPL_(__VA_ARGS__), std::cout<<std::endl)
#define set_fix(x) ((std::cerr<<std::fixed<<std::setprecision(x)),(std::cout<<std::fixed<<std::setprecision(x)))
//小さい方に寄る
#define space_op(x, y, a, b, c) ([](auto x_, auto y_, auto a_, auto b_, auto c_){if(x_<y_)return a_;if(x_>y_)return c_;return b_;}(x,y,a,b,c))
#define space_out(x, y, a, b, c) out(space_op(x, y, a, b, c))

// ^^^ Template ^^^ //


int main() {
	in(ll, N, M);
	if (N == 1 && M == 1)
		out(1);
	else if (min(N, M) == 1)
		out(max(N, M) - 2);
	else
		out(max((N - 2)*(M - 2), 0ll));
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i, n) for(int i = 0; i < n; i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define fi first
#define se second
#define pb push_back
#define debug(x) cerr << #x << ": " << x << endl
#define debug_vec(v) cerr << #v << ":"; rep(i, v.size()) cerr << " " << v[i]; cerr << endl
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF = (1<<30) - 1;
const ll LINF = (1LL<<60) - 1;

void solve() {
    int n;
    cin >> n;
    vector<int> A(n), B(n);
    rep(i, n) cin >> A[i] >> B[i];
    sort(all(A));
    sort(all(B));
    int mini, maxi;
    if (n % 2 == 0) {
        mini = A[n / 2 - 1] + A[n / 2];
        maxi = B[n / 2 - 1] + B[n / 2];
    } else {
        mini = A[(n - 1) / 2];
        maxi = B[(n - 1) / 2];
    }
    cout << maxi - mini + 1 << endl;
}

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


Measured memory_bytes: 4768
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++) //for文マクロ
#define all(obj) obj.begin(), obj.end()
#define fast                      \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0);

using namespace std;

typedef unsigned long long ull;
typedef int long long ll;
constexpr ll bigNum = 1000000007;

signed main()
{
    fast;
    string s;
    cin >> s;
    bool isOk = true;
    for (int i = 0; i < s.size(); i++)
    {
        if (i % 2 == 1 && s[i] != 'R')
        {
        }
        else if (i % 2 == 0 && s[i] != 'L')
        {
        }
        else
        {
            isOk = false;
            break;
        }
    }
    if (isOk)
    {
        cout << "Yes";
    }
    else
    {
        cout << "No";
    }
}

Measured memory_bytes: 256
import itertools
 
N = int(input())
P = list(map(int, input().split()))
Q = list(map(int, input().split()))
 
lis = [x + 1 for x in range(N)] 
permutations_lis = itertools.permutations(lis)

p = 0
q = 0
if P == Q:
  ans = 0
  print(ans)
  quit()
  
x = 0
for one_case in permutations_lis:#順列が昇順であること　順列リストをforで回す
  x += 1
  if P == list(one_case):
    p = x
  elif Q == list(one_case):
    q = x

print(abs(q-p))  

Measured memory_bytes: 3064
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>

int main(void){
    int n, l;
    std::cin >> n >> l;
    std::priority_queue<std::string, std::vector<std::string>, std::greater<std::string>> ss;
    for(int i = 0; i < n; ++i){
        std::string s;
        std::cin >> s;
        ss.push(s);
    }
    while(!ss.empty()){
        std::cout << ss.top();
        ss.pop();
    }
    std::cout << std::endl;

    return 0;
}

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

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

            int K = s[0];
            int X = s[1];

            if (500 * K >= X) {
                Console.WriteLine("Yes");
            } else {
                Console.WriteLine("No");
            }
        }
    }
}


Measured memory_bytes: 13268
#include <bits/stdc++.h>
const int N=605,mu=1000000007;
int s[N],a[N],f[N][N],Ans,ans[N],x,y,n,k;
int c(int x,int y){
	if (x>y) return 0;
	return ans[s[y]-s[x-1]];
}
int main(){
	scanf("%d%d",&n,&k);
	n<<=1;
	for (int i=1;i<=n;i++) s[i]=1;
	for (int i=1;i<=k;i++){
		scanf("%d%d",&x,&y);
		a[x]=y,a[y]=x,s[x]=0,s[y]=0;
	}
	for (int i=1;i<=n;i++) s[i]=s[i]+s[i-1];
	ans[0]=1;
	for (int i=2;i<=n;i+=2)
		ans[i]=ans[i-2]*1ll*(i-1)%mu;
	for (int l=1;l<=n/2;l++)
		for (int i=1;i<=n-2*l+1;i++){
			int j=i+2*l-1,ff=0;
			for (int k=i;k<=j;k++) 
				if ((a[k] && a[k]<i) || a[k]>j) ff=1;
			if (ff) continue;
			f[i][j]=c(i,j);
			for (int k=i+1;k<j;k+=2)
				f[i][j]=(f[i][j]-1ll*f[i][k]*c(k+1,j)%mu+mu)%mu;
			Ans=(Ans+1ll*f[i][j]*ans[s[n]-(s[j]-s[i-1])]%mu)%mu;
		}
	printf("%d\n",Ans);
}

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

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> VI;
typedef vector<VI> VVI;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = numeric_limits<int>::max() / 2;
const int NEG_INF = numeric_limits<int>::min() / 2;

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

    int t, p, r;
    while (true)
    {
        cin >> t >> p >> r; //???????????°???????????°?????¬???????????°
        if (t == 0)
            break;
        int seikai[t + 1] = {0}, penalty[t + 1] = {0}, gotou[t + 1][p + 1] = {0};
        for (int i = 0; i < r; i++)
        {
            int tID, pID, time;
            string s;
            cin >> tID >> pID >> time >> s;
            if (s == "CORRECT")
            {
                seikai[tID]++;
                penalty[tID] += gotou[tID][pID] * 1200 + time;
            }
            else
            {
                gotou[tID][pID]++;
            }
        }
        bool checked[t + 1] = {false};
        for (int i = 1; i <= t; i++)
        {
            int team, seikaimax = -1, pena = INF;
            for (int j = 1; j <= t; j++)
            {
                if (!checked[j])
                {
                    if (seikaimax < seikai[j])
                    {
                        seikaimax = seikai[j];
                        team = j;
                        pena = penalty[j];
                    }
                    else if (seikaimax == seikai[j])
                    {
                        if (pena > penalty[j])
                        {
                            team = j;
                            pena = penalty[j];
                        }
                    }
                }
            }
            checked[team] = true;
            cout << team << " " << seikaimax << " " << pena << endl;
        }
    }
}


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

int main() {
  int H,W,i,j,lx=0,x;
  cin >> H >> W;
  vector<string> S(H);
  vector<vector<int>> L(H, vector<int>(W,0)), R(H, vector<int>(W,0)),
                      D(H, vector<int>(W,0)), U(H, vector<int>(W,0));
  for(i=0; i<H; i++)
    cin >> S.at(i);

  for(i=0; i<H; i++)
    for(j=0; j<W; j++)
      if(S.at(i).at(j) == '.') {
        if(i==0)
          U.at(i).at(j) = 1;
        else
          U.at(i).at(j) = U.at(i-1).at(j)+1;
        if(j==0)
          L.at(i).at(j) = 1;
        else
          L.at(i).at(j) = L.at(i).at(j-1)+1;
      }

  for(i=H-1; i>=0; i--)
    for(j=W-1; j>=0; j--)
      if(S.at(i).at(j) == '.') {
        if(i==H-1)
          D.at(i).at(j) = 1;
        else
          D.at(i).at(j) = D.at(i+1).at(j)+1;
        if(j==W-1)
          R.at(i).at(j) = 1;
        else
          R.at(i).at(j) = R.at(i).at(j+1)+1;
      }

  for(i=0; i<H; i++)
    for(j=0; j<W; j++) {
      x = L.at(i).at(j) + R.at(i).at(j) +
             D.at(i).at(j) + U.at(i).at(j) - 3;
      if(x > lx)
        lx = x;
    }

  cout << lx << endl;
}

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

using namespace std;


int main()
{
  string s;
  cin >> s;
  // if (strlen(s) == 2) {
  if (s.size() == 2) {
    cout << s << endl;
    return 0;
  }
  reverse(s.begin(), s.end()) ;
  cout << s << endl;
  return 0;
}

Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10000000)
H,W=map(int,input().split())
series = [[] for h in range(H)]
for h in range(H):
	series[h] = list(input())

def Go(h,w):
	#print(h,w)
	global c
	check[h][w]=1
	count = 0
	front = ""
	if series[h][w] == "#":
		front = "."
	else:
		front = "#"
	if h >= 1:
		if series[h-1][w] == front and check[h-1][w] == 0:
			if series[h-1][w] == ".":
				count += Go(h-1,w)+1
			else:
				count += Go(h-1,w)
				c += 1
				used[h-1][w] = 1
	if h < H-1:
		if series[h+1][w] == front and check[h+1][w] == 0:
			if series[h+1][w] == ".":
				count += Go(h+1,w)+1
			else:
				count += Go(h+1,w)
				c += 1
				used[h+1][w] = 1
	if w >= 1:
		if series[h][w-1] == front and check[h][w-1] == 0:
			if series[h][w-1] == ".":
				count += Go(h,w-1)+1
			else:
				count += Go(h,w-1)
				c += 1
				used[h][w-1] = 1
	if w < W-1:
		if series[h][w+1] == front and check[h][w+1] == 0:
			if series[h][w+1] == ".":
				count += Go(h,w+1)+1
			else:
				count += Go(h,w+1)
				c += 1
				used[h][w+1] = 1
	return count

ans=0
used =  [[0 for w in range(W)] for h in range(H)]
check = [[0 for w in range(W)] for h in range(H)]
for h in range(H):
	for w in range(W):
		if series[h][w] == "#" and used[h][w] == 0:
			c=1
			ans += Go(h,w) * c
print(ans)

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

typedef pair<int,int> P;

int main() {
  int n,m;
  while(cin >> n >> m && n) {
    bool u[n];
    memset(u,0,sizeof(u));
    vector<P> v[n];
    for(int i=0; i<m; i++) {
      int x,y,z;
      cin >> x >> y >> z;
      v[x].push_back(P(y,z));
      v[y].push_back(P(x,z));
    }
    int ans=0;
    priority_queue<P,vector<P>,greater<P> > que;
    que.push(P(0,0));
    while(!que.empty()) {
      P p=que.top();que.pop();
      int x=p.second,c=p.first;
      if(u[x]) continue;
      u[x]=1;
      ans+=c;
      for(int i=0; i<v[x].size(); i++) {
        int y=v[x][i].first;
        if(!u[y]) que.push(P(v[x][i].second,y));
      }
    }
    cout << ans << endl;
  }
  return 0;
}


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

using namespace std;

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

    for (int i = 0; i <= n; i++) {
        for (int j = 0; j <= n; j++) {
            if (i + j <= n) {
                int k = n - (i + j);
                if (i * 10000 + j * 5000 + k * 1000 == y) {
                    cout << i << ' ' << j << ' ' << k << endl;
                    return 0;
                }
            }
        }
    }
    
    cout << -1 << ' ' << -1 << ' ' << -1 << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#define SIZE_VALUE 1000005

int main(){
    bool prime[SIZE_VALUE];
    int i,count=0,input;
    memset(prime,0,sizeof(prime));
    for(i=2;i*i<SIZE_VALUE;i++){
        if(prime[i]==0)
        for(int j=i*i;j<SIZE_VALUE;j+=i){
            prime[j]=1;
        }
    }
    while(scanf("%d",&input)==1){
        count=0;
    for(i=2;i<=input;i++){
        if(prime[i]==0)
            count++;
    }
    printf("%d\n",count);
    }
    return 0;
}

Measured memory_bytes: 2008
#include <iostream>
#include <math.h>
int main()
{
	int N; std::cin >> N;
	int a[110000];
	for(auto &x : a) x = 0;
	for(int n=0; n<N; n++)
	{
		int tmp;
		std::cin >> tmp;
		a[tmp]++;
	}

	if(N%2==0)
	{
		for(int i=1; i<=N-1; i+=2)
		{
			if(a[i]!=2)
			{
				std::cout << 0 << std::endl;
				return 0;
			}
		}
	}
	else
	{
		if(a[0]!=1)
		{
			std::cout << 0 << std::endl;
			return 0;
		}
		else
		{
			for(int i=2; i<=N-1; i+=2)
			{
				if(a[i]!=2)
				{
					std::cout << 0 << std::endl;
					return 0;
				}
			}
		}
	}
	//double tmp = pow(2,N/2);
	long long ans = 1;
	for(int i=0; i<N/2; i++)
	{
		ans *= 2;
		ans %= 1000000007;
	}
	std::cout << ans << std::endl;
	return 0;
}

Measured memory_bytes: 640
fun main(args: Array<String>){
    val (H,W) = readLine()!!.split(" ").map{ it.toInt()}
    var dp = Array(H){Array(W){0}}
    var s = Array(H){""}

    for(i in 0 until H){
        s[i] = readLine()!!
    }




    for(i in 0 until H){
        for(j in 0 until W) {
            var fromW: Int  = if(j>0) dp[i][j-1] else 9999
            var fromH: Int = if(i>0) dp[i-1][j] else 9999
            if(j>0){
                if(s[i][j-1] == '.' && s[i][j] == '#'){
                    fromW++
                }
            }
            if(i>0){
                if(s[i-1][j] == '.' && s[i][j] == '#'){
                    fromH++
                }
            }

            if(i ==0 && j==0){
                if(s[0][0] == '#'){
                    dp[0][0] = 1
                }
            } else if (i == 0){
                dp[i][j] = fromW
            } else if (j==0){
                dp[i][j] = fromH
            } else {
                dp[i][j] = Math.min(fromH,fromW)
            }



        }
    }
    println(dp[H-1][W-1])
//    for(i in 0 until H){
//        for(j in 0 until W){
//            print(dp[i][j])
//        }
//        println()
//    }


}

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

using namespace std ;

const int MAX = 1e5 + 10 ;

int arr[MAX] , pos[MAX] , vis[MAX] , comp[MAX] ;
int n , m ;
int id = 0 ;

vector< vector<int> >adj(MAX) ;

void dfs(int node)
{
	vis[node] = 1 ;
	comp[node] = id ;
	for(auto &child : adj[node])
	{
		if(vis[child] == 1)
			continue ;
		dfs(child) ;
	}
	return ;
}

int main()
{
	ios_base::sync_with_stdio(0) ;
	cin.tie(0) ;
	cin>>n>>m ;
	for(int i = 1 ; i <= n ; ++i)
	{
		cin>>arr[i] ;
		pos[arr[i]] = i ;
	}
	for(int i = 0 ; i < m ; ++i)
	{
		int x , y ;
		cin>>x>>y ;
		adj[x].push_back(y) ;
		adj[y].push_back(x) ;
	}
	for(int i = 1 ; i <= n ; ++i)
	{
		if(vis[i] == 1)
			continue ;
		id++ ;
		dfs(i) ;
	}
	int ans = 0 ;
	for(int i = 1 ; i <= n ; ++i)
	{
		if(comp[i] == comp[pos[i]])
			ans++ ;
	}
	return cout<<ans<<"\n" , 0 ;
}		

Measured memory_bytes: 9344
#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <algorithm>
#include <string>
using namespace std;
int main(void){
    int h , w ; 
    cin >> h >> w ;
    int h2 = h + 2 ;
    int w2 = w + 2 ;
    char a[h][w];
    for(int i = 0 ; i < h ; i++){
        for(int j = 0 ; j < w ; j++ ){
            cin >> a[i][j] ;
        }
    }

    char b[h2][w2] ;

    for(int i = 0; i < w2 ; i++){
        b[0][i] = '#' ;
        b[h+1][i] = '#' ;
    }
    for(int i = 0 ; i < h  ; i++){
        for(int j = 0 ; j < w2 ; j ++){
           if(j == 0||j == w + 1 ){
               b[i + 1][j] = '#' ;
           }else{
               b[i+1][j]=a[i][j-1] ;
           }
        }
    }
    
    for(int l = 0 ; l < h2 ; l++){
        for(int j = 0 ; j < w2 ; j++ ){
            cout << b[l][j] ;
        }
        cout << endl;
    }
    return 0;
}

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

typedef long long ll;
typedef long double ld;

#define imx INT_MAX
#define imn INT_MIN
#define llmx LLONG_MAX
#define llmn LLONG_MIN

#define fi first
#define se second
#define pb push_back


int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n;
	cin>>n;
	ll sum=0;
	for(int i = 1; i <= n; i++)
	{
		if(!(i%3==0 or i%5==0))
		{
			sum+=i;
		}
	}
	cout<<sum<<endl;
}

Measured memory_bytes: 3636
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<string>
#include<cstring>
#include<algorithm>
#include<vector>
#include<map>

using namespace std;

typedef long long ll;

typedef std::pair<int, int> ipair;
bool lessPair(const ipair& l, const ipair& r){return l.second < r.second;}
bool morePair(const ipair& l, const ipair& r){return l.second > r.second;}

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

const ll MOD = 1e9 + 7;
void add(long long &a, long long b) { a += b; if (a >= MOD) a -= MOD; }

vector<ll> enum_div(ll n) {
   vector<ll> ret;
   for (ll i=1 ; i*i<=n ; ++i) {
      if (n%i == 0) {
         ret.push_back(i);
         if (i!=1 && i*i!=n) {
            ret.push_back(n/i);
         }
      }
   }
   return ret;
}

int main() {
   ll N;
   cin >> N;
   vector<ll> res = enum_div(N);
   ll ans = 0;
   for (ll i = 0; i < (ll)res.size(); i++) {
      ll l = res[i];
      ll m = N / res[i];
      // cout << l << " " << m << endl;
      if (l < m - 1) ans += m - 1;
   }
   cout << ans << endl;
   return 0;
}


Measured memory_bytes: 384
#include<iostream>
#include<algorithm>
using namespace std;
static const int MAX =200000;

int main(){
	int R[MAX] ,n;
	cin >> n;
	for(int i=0;i<n;i++)cin >> R[i];

int maxnum=-2000000000;
int minnum=R[0];

for(int i=1;i<n;i++){
maxnum=max(maxnum,R[i]-minnum);
minnum=min(minnum,R[i]);//-999999999
}
cout << maxnum <<endl;

return 0;
}

Measured memory_bytes: 1940
#include<bits/stdc++.h>
using namespace std;
#define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long int
#define fi first
#define se second
#define pub push_back
#define pi pair<int,int>
#define all(v) (v).begin(), (v).end()
#define rep(i, l, r) for(int i=(int)(l);i<(int)(r);i++)
#define repd(i, l, r) for (int i=(int)(l);i>=(int)(r);i--)
#define clrg(i, l, r) for(int i=(int)(l);i<(int)(r);i++)vis[i]=0,v[i].clear();
int power(int x, unsigned int y){int res = 1;while (y > 0){ if (y & 1){res = res*x;} y = y>>1;x = x*x;}return res;}
int powermod(int x, unsigned int y, int p){int res = 1;x = x % p;while (y > 0){if (y & 1){res = (res*x) % p;}y = y>>1; x = (x*x) % p;}return res;}
#define print2d(mat,n,m){for(int i=0;i<(int)(n);i++){for(int j=0;j<(m);j++){cout<<mat[i][j]<<" ";}cout<< endl;}}
#define clr(a,x) memset(a,x,sizeof(a))
#define rr(v) for(auto &val:v)
#define print(v) for (const auto itr : v){cout<<itr<<' ';}cout<<"\n";
#define ln length()
#define sz size()
#define mod 1000000007
#define elif else if
int32_t main(){
   int a,b,c,d; cin>>a>>b>>c>>d;
   int ans=max(a*c,b*d);
   ans=max(ans,a*d);
   ans=max(ans,b*c);
   cout<<ans<<"\n";
   return 0;
}
/*
Edge cases? n=1? a[i]<=0?
long vs int? 1LL? 64bits?
Re-read problem. Is it as easy as it seems?
KEEP CORRECTING AND SUBMITTING!
*/


Measured memory_bytes: 3624
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author IncubatorMan
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>
using namespace std;
#define long long long
typedef pair < long , long > pii;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
class BPopularVote {
public:
	void solve(std::istream& in, std::ostream& out) {
	    int n,m;
	    in>>n>>m;
	    vector<double> data(n);
	    for(double &x : data)in>>x;

	    sort(data.begin(),data.end());
	    reverse(data.begin(),data.end());

        double tot = accumulate(data.begin(),data.end(),0.0);
	    double lim = tot/(4*m);
	   int cnt=0;
	   for(int i=0;i<n;i++){
	       if(data[i]>=lim) cnt++;
	   }
	   if(cnt>=m) out<<"Yes\n";
	   else out<<"No\n";

	}
};


int main() {
    ios_base::sync_with_stdio(false);cin.tie(NULL);
	BPopularVote solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstring>

using namespace std;

string code[] = {
    "<", "DO",
    "<", "VARS", "<", "0", ">", "<", "0", ">", ">",
    "<", "IN", "<", "0", ">", ">",
    "<", "VARS", "<", "1", ">", "<", "MUL", "<", "800", ">", "<", "VAR", "<", "0", ">", ">", ">", ">",
    "<", "VARS", "<", "2", ">", "<", "MUL", "<", "200", ">", "<", "DIV", "<", "VAR", "<", "0", ">", ">", "<", "15", ">", ">", ">", ">",
    "<", "VARS", "<", "3", ">", "<", "SUB", "<", "VAR", "<", "1", ">", ">", "<", "VAR", "<", "2", ">", ">", ">", ">",
    "<", "OUT", "<", "VAR", "<", "3", ">", ">", ">",
    ">"};

int number[112345];

pair<int, int> runPart(int first)
{
    int i = first + 1;
    int res = 0;

    pair<int, int> val;

    string str = code[i];

    if (str == "DO")
    {
        i++;
        while (code[i] != ">")
            i = runPart(i).second + 1;
    }
    else if (str == "REP")
    {
        i++;
        val = runPart(i);
        for (int j = 0; j < val.first; j++)
            i = runPart(val.second + 1).second + 1;
    }
    else if (str == "IN")
    {
        i++;
        int input;
        cin >> input;
        val = runPart(i);
        number[val.first] = input;
        i = val.second + 1;
    }
    else if (str == "OUT")
    {
        i++;
        val = runPart(i);
        cout << val.first << endl;
        i = val.second + 1;
    }
    else if (str == "VAR")
    {
        i++;
        val = runPart(i);
        res = number[val.first];
        i = val.second + 1;
    }
    else if (str == "VARS")
    {
        i++;
        val = runPart(i);
        int index = val.first;
        i = val.second + 1;
        val = runPart(i);
        number[index] = val.first;
        i = val.second + 1;
    }
    else if (str == "SUM")
    {
        i++;
        val = runPart(i);
        res = val.first;
        i = val.second + 1;
        val = runPart(i);
        res += val.first;
        i = val.second + 1;
    }
    else if (str == "SUB")
    {
        i++;
        val = runPart(i);
        res = val.first;
        i = val.second + 1;
        val = runPart(i);
        res -= val.first;
        i = val.second + 1;
    }
    else if (str == "MUL")
    {
        i++;
        val = runPart(i);
        res = val.first;
        i = val.second + 1;
        val = runPart(i);
        res *= val.first;
        i = val.second + 1;
    }
    else if (str == "DIV")
    {
        i++;
        val = runPart(i);
        res = val.first;
        i = val.second + 1;
        val = runPart(i);
        res /= val.first;
        i = val.second + 1;
    }
    else
    {
        res = stoi(code[i]);
        i++;
    }

    return {res, i};
}

int main()
{
    memset(number, 0, sizeof(number));

    runPart(0);

    return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;

const int MAX=200005;
const ll MOD=1000000007;
int a[MAX],b[MAX],n;
int main(){
    scanf("%d",&n);
    for(int i=0;i<n;i++) scanf("%d",&a[i]),b[i]=a[i];
    sort(a,a+n);
    for(int i=0;i<n;i++){
        if(b[i]>=a[n/2]) printf("%d\n",a[n/2-1]);
        else printf("%d\n",a[n/2]);
    }
}


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

using ll = long long;

int main() {
    int N, ans = 0;
    cin >> N;
    vector<string> S(N * 2);
    rep(i, N) {
        cin >> S[i];
        S[i + N] = S[i];
    }
    rep(i, N) {
        bool f = true;
        rep(j, N) {
            rep(k, N) {
                if (S[i + j][k] != S[i + k][j]) f = false;
            }
        }
        if (f) ans += N;
    }
    cout << ans << endl;
}

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

using namespace std;

int main() {
  std::ios_base::sync_with_stdio(false);
  long long n, ans = 0;
  cin >> n;
  for (long long i = 1, j; i <= n; i = j + 1) {
    j = n / (n / i);
    long long z = n / i;
    if (n % z == 0) {
      long long m = n / z - 1;
      if (m > 0 && n / m == n % m) ans += m;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include<cmath>
#include<iostream>
#include<string>
#include<iomanip>
#include<bits/stdc++.h>
using namespace std;
typedef long double ld;

int main(){
    int a, b, h, m;
    cin >> a >> b >> h >> m;
    ld minute, angle_l, angle_s, angle, r;
    minute = h * 60 + m;
    angle_s = 0.5 * minute;
    angle_l = fmod(6 * minute, 360);
    angle = min(abs(angle_l - angle_s), 360 - abs(angle_l - angle_s));
    r = sqrt(a * a + b * b - 2 * a * b * cos(angle * M_PI / 180));
    cout << fixed << setprecision(9) << r << endl;

    return 0;
}


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

int main() {
  
  string a, b, c;
  cin >> a >> b >> c;
  
  char ai = a[0] - 32;
  char bi = b[0] - 32;
  char ci = c[0] - 32;
 
  cout << ai << bi << ci << endl;

}

Measured memory_bytes: 256
#安定なソート判定
def print_output(_list):
    for index in range(len(_list)):
        if index == len(_list) - 1:
            print(_list[index])
        else:
            print(_list[index],end=' ')

def bubble(_target_list):
    target_list = _target_list.copy()
    for index in range(1, len(target_list)):
        for compare_index in reversed(range(index)):
            if target_list[compare_index + 1][1] < target_list[compare_index][1]:
                target_list[compare_index + 1] ,target_list[compare_index] = target_list[compare_index] ,target_list[compare_index + 1]
            else:            
                break
    return target_list

def selection(_target_list):
    target_list = _target_list.copy()
    for i in range(len(target_list)):
        minj = i
        for j in range(i, len(target_list)):
            if target_list[j][1] < target_list[minj][1]:
                minj = j
        if i != minj:
            target_list[i], target_list[minj] = target_list[minj], target_list[i]
    return target_list

target_length = int(input())
target_list = [x for x in input().split()]

bubble_list = bubble(target_list)
print_output(bubble_list)
print("Stable")
selection_list = selection(target_list)
print_output(selection_list)
if bubble_list == selection_list:
    print("Stable")
else:
    print("Not stable")


Measured memory_bytes: 5620
#include<bits/stdc++.h>
#include<boost/multiprecision/cpp_int.hpp>
using namespace std;
using namespace boost::multiprecision;
#define BEGIN ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define END return EXIT_SUCCESS
#define rep(I,N) for(auto I=0;I<(N);++I)
#define up(I,A,B) for(auto I=(A);I<=(B);++I)
#define dw(I,A,B) for(auto I=(A);I>=(B);--I)
#define all(C) (C).begin(),(C).end()
#define rall(C) (C).rbegin(),(C).rend()
#define ft first
#define sd second
#define mp make_pair
#define mt make_tuple
#define pf push_front
#define pb push_back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define rs resize
typedef long long ll;
typedef unsigned long long ull;
template<class T>inline void                                      in(T &p){cin>>p;}
template<class T1,class T2>inline void                            in(T1 &p1,T2 &p2){cin>>p1>>p2;}
template<class T1,class T2,class T3>inline void                   in(T1 &p1,T2 &p2,T3 &p3){cin>>p1>>p2>>p3;}
template<class T1,class T2,class T3,class T4>inline void          in(T1 &p1,T2 &p2,T3 &p3,T4 &p4){cin>>p1>>p2>>p3>>p4;}
template<class T1,class T2,class T3,class T4,class T5>inline void in(T1 &p1,T2 &p2,T3 &p3,T4 &p4,T5 &p5){cin>>p1>>p2>>p3>>p4>>p5;}
template<class T>inline void                                      ins(T &p){for_each(all(p),in<decltype(p[0])>);}
template<class T>inline void                             out(T p){cout<<p<<endl;}
template<class T1,class T2>inline void                   out(T1 p1,T2 p2){cout<<p1<<" "<<p2<<endl;}
template<class T1,class T2,class T3>inline void          out(T1 p1,T2 p2,T3 p3){cout<<p1<<" "<<p2<<" "<<p3<<endl;}
template<class T1,class T2,class T3,class T4>inline void out(T1 p1,T2 p2,T3 p3,T4 p4){cout<<p1<<" "<<p2<<" "<<p3<<" "<<p4<<endl;}
inline                                              void out(double p){printf("%.10f\n",p);}
template<class T>inline                             void outs(T p){for_each(all(p),out<decltype(p[0])>);}

inline void solve(void){
  int N,K;
  in(N,K);
  vector<int>h(N);
  ins(h);
  int cnt=0;
  rep(i,N)if(h[i]>=K)cnt++;
  out(cnt);
}
int main(int argc,char**argv){
  BEGIN;
  solve();
  END;
}


Measured memory_bytes: 640
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<set>
#include<queue>
#include<stack>
#include<bitset>
#include<functional>
#include<map>
#include<unordered_set> 
#include<cmath>
using namespace std;
long long p = 998244353;
//long long p = 1000000007;
#define int long long
#define vel vector<long long>
#define vvel vector<vel>
#define rep(i,n) for(int i=0;i<n;i++)
#define sor(v) sort(v.begin(),v.end())
#define mmax(a,b) a=max(a,b)
#define mmin(a,b) a=min(a,b)
#define mkp make_pair
#define pin pair<int,int>
#define qin pair<int,pin>
#define V vector
#define Endl endl
#define veb vector<bool>
#define rev(s) reverse(s.begin(),s.end())
#define lower(h,val) lower_bound(h.begin(),h.end(),val)
#define upper(h,val) upper_bound(h.begin(),h.end(),val)
#define mint modint<998244353>
#define end_s(a) cout <<a<<endl;return 0
vel pa;
int root(int x) {
	if (pa[x] == -1) { return x; }
	int ans = root(pa[x]); pa[x] = ans;
	return ans;
}
void marge(int x, int y) {
	x = root(x);
	y = root(y);
	if (x != y) { pa[x] = y; }
}
V<string> solve2(int a, int b) {
	if (a < 0 || b < 0) { return {}; }
	if (a == 0 && b == 0) {
		V<string> ans(1, "");
		return ans;
	}
	V<string> ans = solve2(a - 1, b);
	V<string> nans;
	for (auto x : ans) { nans.push_back(x+"A"); }
	V<string> ans2 = solve2(a, b - 1);
	for (auto x : ans2) { nans.push_back(x+"B"); }
	return nans;
}
signed main() {
	int n, m; cin >> n >> m;
	V<V<pin>> wor(m);
	while (true) {
		int s, t, e; cin >> s >> t >> e;
		if (e == 0) { break; }
		wor[t - 1].push_back(mkp(s - 1, e));
	}
	int l; cin >> l;
	rep(i, l) {
		vel ans(n);
		vel val(m);
		rep(i, m) { cin >> val[i]; }
		rep(j, m) {
			for (auto x : wor[j]) {
				ans[x.first] += x.second * val[j];
			}
		}
		rep(i, n - 1) { cout << ans[i] << " "; }
		cout << ans[n - 1] << endl;
	}
	return 0;
}


Measured memory_bytes: 4644
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        if(b % a == 0) System.out.println(a + b);
        else System.out.println(b - a);
    }
}

Measured memory_bytes: 35772
package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	nums := make([]int, n)
	for i:=0; i<len(nums); i++{
		fmt.Scan(&nums[i])
	}
	count := 0
	for i:=1; i<len(nums); i++{
		if nums[i-1] > nums[i]{
			count += (nums[i-1] - nums[i])
			nums[i] = nums[i-1]
		}
	}
	fmt.Println(count)
}

Measured memory_bytes: 6484
import java.util.*;
import java.io.*;
import java.lang.*;

class Main{
	static int [][]dp;
	static int row, col;
	static String []grid;
	static int MOD = (int)1e9 + 7;
	static int back(int x, int y){
		if(x == row - 1 && y == col - 1)return 1;
		if(x >= row || y >= col || grid[x].charAt(y) == '#')return 0;
		if(dp[x][y] != -1)return dp[x][y];
		return dp[x][y] = ((back(x + 1, y) % MOD)  + (back(x, y + 1) % MOD)) % MOD;
	}
	public static void main(String[] args)throws IOException{
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			 row = sc.nextInt();
			 col = sc.nextInt();
			 dp = new int[row + 1][col + 1];
			 grid = new String[row + 1];
			 grid[0] = sc.nextLine();
			 for(int i = 0; i < row; ++i){
			 	for(int j = 0; j < col; ++j){
			 		dp[i][j] = -1;
			 	}
			 }
			for(int i = 0; i < row; ++i){
				grid[i] = sc.nextLine();
			}
			System.out.println(back(0, 0));
		}		
	}
}


Measured memory_bytes: 37240
#include<iostream>
#include<string>
using namespace std;
int main()
{
	string s, t;
	cin >> s;
	for(unsigned int i = 0; i < s.size(); i++){
		if(s[i] == '0') t += '0';
		if(s[i] == '1') t += '1';
		if(s[i] == 'B' && t.size() != 0) t.pop_back();
	}
	cout << t << endl;
	return 0;
}

Measured memory_bytes: 256
/*
    飲んだ魔剤で家が建つ。
    created at: 2020-04-18 19:32:48
*/

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


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

    vector<bool> oks(n+1, true);
    for (int i = 0; i < m; i++)
        oks[a[i]] = false;

    vector<long> dp(n+1);
    dp[0] = 1;
    for (int now = 0; now < n; now++) {
        for (int next = now+1; next <= min(n, now+2); next++) {
            if (oks[next]) {
                dp[next] += dp[now];
                dp[next] %= MOD;
            }
        }
    }

    cout << dp[n] << endl;

    return 0;
}


Measured memory_bytes: 1408
#include<bits/stdc++.h>
typedef int ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 1, 1, -1, -1};
int dx[]={1, -1, 0, 0, 1, -1, -1, 1};

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define rep(i,n) for (int i=0;i<(n);i++)
#define REP(i,n) for (int i=0;i<(n);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define mp make_pair
#define fi first
#define sc second
ll n;
string s[200000];
ll used[100];
ll num[256];

ll al[10];

ll ans(ll *v,ll nn,ll d) {
	if(d >= nn) {
		/*rep(i,n) {
			if(num[s[i][0]] == 0 && s[i].size() > 1) {
				return 0;
			}
		}*/

		ll sum = 0;
		rep(i,n-1) {
			ll a = 0;
			rep(j,s[i].size()) {
				a *= 10;
				a += num[s[i][j]];
			}
			sum += a;
		}
		ll sn = 0;
		rep(i,s[n-1].size()) {
			sn *= 10;
			sn += num[s[n-1][i]];
		}
		return sum == sn;
	}

	ll ret = 0;
	rep(j,10) {
		if(al[j]) 
			continue;
		bool f = false;
		if(j == 0) {
			rep(i,n) {
				if(s[i][0] == v[d] && s[i].size() > 1)
					f = true;
			}
		}
		if(f) continue;
		num[v[d]] = j;
		al[j] = true;
		ret += ans(v,nn,d+1);
		al[j] = false;
	}

	return ret;
}

int main(){

	while(true) {
		cin >> n;
		if(n==0)
			break;
		rep(i,n) cin >> s[i];

		rep(i,26)
			used[i] = false;

		rep(i,n) {
			for(auto c : s[i]) {
				used[c-'A'] = true;
			}
		}

		int v[100];
		ll c = 0;
		rep(i,26) {
			if(used[i]) {
				v[c++] = i+'A';
			}
		}

		cout << ans(v,c,0) << endl;
	}


	return 0;
}



Measured memory_bytes: 4672