akhauriyash/Code-Regression huggingface dataset:
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author aryssoncf
 */



// Taken from: https://github.com/bqi343/USACO/blob/master/Implementations/content/contest/templateShort.cpp

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ull> vul;
typedef vector<ll> vl;
typedef vector<pii> vpii;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define F0R(i, a) FOR(i,0,a)
#define ROF(i, a, b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i, a) ROF(i,0,a)
#define trav(a, x) for (auto& a: x)

#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rsz resize

#define mp make_pair
#define pb push_back
#define f first
#define s second

const int MOD = 1e9 + 7; // 998244353; // = (119<<23)+1
const int MX = 2e5 + 5;

template<class T>
bool ckmin(T &a, const T &b) {
    return a > b ? a = b, 1 : 0;
}

template<class T>
bool ckmax(T &a, const T &b) {
    return a < b ? a = b, 1 : 0;
}

mt19937 rng((uint32_t) chrono::steady_clock::now().time_since_epoch().count());


//
// Created by aryssoncf on 28/10/2019.
//

#include <type_traits>


#include <iterator>
#include <utility>

template<typename T>
constexpr auto hasBegin(int) -> decltype(std::begin(std::declval<T>()), true) {
    return true;
}

constexpr bool hasBegin(...) {
    return false;
}

template<typename T>
using IsContainer = std::integral_constant<bool, hasBegin<T>(0)>;


#ifndef JHELPER_EXAMPLE_PROJECT_IO_HPP
#define JHELPER_EXAMPLE_PROJECT_IO_HPP

#endif //JHELPER_EXAMPLE_PROJECT_IO_HPP

template<typename T>
std::istream &operator>>(std::istream &is, std::vector<T> &vec) {
    for (T &element: vec) {
        is >> element;
    }
    return is;
}

template<typename T, typename U>
std::istream &operator>>(std::istream &is, std::pair<T, U> &p) {
    is >> p.first;
    is >> p.second;
    return is;
}

template<class X, class Y>
std::ostream &operator<<(std::ostream &os, std::pair<X, Y> const &p) {
    return os << p.first << " " << p.second;
}

template<class Ch, class Tr, class Container>
std::basic_ostream<Ch, Tr> &operator<<(std::basic_ostream<Ch, Tr> &os, Container const &x) {
    bool first = true;
    for (auto &y : x) {
        if (first) {
            first = false;
        } else {
            os << " ";
        }
        os << y;
    }
    return os;
}

using namespace std;

class CGoToSchool {
public:
    void solve(std::istream &in, std::ostream &out) {
        int n;
        in >> n;
        vi A(n);
        in >> A;
        vi id(n);
        iota(all(id), 1);
        sort(all(id), [&](int i, int j) {
            return A[i - 1] < A[j - 1];
        });
        out << id << '\n';
    }

    void setup() {}
};


int main() {
    std::ios_base::sync_with_stdio(false);
    CGoToSchool solver;
    solver.setup();
    std::istream &in(std::cin);
    std::ostream &out(std::cout);
    in.tie(nullptr);
    out << std::fixed;
    out.precision(20);
    solver.solve(in, out);
    return 0;
}


Measured memory_bytes: 3996
import sys
sys.setrecursionlimit(10**9)

def BF(edges,n,s):
    inf=float("inf")
    d=[inf for i in range(n+1)]
    d[s]=0
    update=True
    for i in range(n+1):
      update=False
      for v,u,cost in edges:
        if cand[v]!=1 or cand[u]!=1:
          continue
        if d[v]!=inf and d[u]>d[v]+cost:
          d[u]=d[v]+cost
          update=True
      if update==False:
        break
      if i==n:
        return inf
    return -d[-1]

def DFS_1toN(v):
  for u in to[v]:
    if toflag[u]==0:
      toflag[u]=1
      DFS_1toN(u)
      
def DFS_Nto1(v):
  for u in ot[v]:
    if otflag[u]==0:
      otflag[u]=1
      DFS_Nto1(u)
    
n,m,p=map(int,input().split())
g=[]
to=[[] for _ in range(n+1)]
ot=[[] for _ in range(n+1)]
for _ in range(m):
  a,b,c=map(int,input().split())
  g.append([a,b,-(c-p)])
  to[a].append(b)
  ot[b].append(a)
toflag=[0]*(n+1)
toflag[1]=1
DFS_1toN(1)
otflag=[0]*(n+1)
otflag[n]=1
DFS_Nto1(n)
cand=[0]*(n+1)
for i in range(1,n+1):
  cand[i]=toflag[i]*otflag[i]
ans=BF(g,n,1)
if ans==float('inf'):
  print(-1)
else:
  print(max(ans,0))


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

#define sz(o) ((int)o.size())
#define all(o) o.begin(), o.end()
#define rep(i, a, b) for(int i = (a); i <= (b); i++)
#define repr(i, a, b) for(int i = (a); i >= (b); i--)
//#define vpal 100

typedef long long int ll;
typedef vector<ll> vll;
typedef vector<int> vi;

void solve(int testcase) {
    ll n;
    cin >> n;
    vll x(n);
    rep(i, 0, n-1) cin >> x[i];
    vll v(x);
    sort(all(v));
    int p1 = n/2 - 1, p2 = n/2;
    rep(i, 0, n-1){
        if(x[i] <= v[p1]) cout << v[p2] << '\n';
        else cout << v[p1] << '\n';
    }
}

int main() {
    #ifdef vpal
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    cout << setprecision(10);
    clock_t b = clock();
    int t = 1;
    //cin >> t;
    rep(tt, 1, t) solve(tt);
    clock_t e = clock();
    cerr << (double(e - b) / CLOCKS_PER_SEC) << " sec";
    return 0;
}

Measured memory_bytes: 5376
// Etavioxy
#include<cstdio>
#include<cctype>
#include<cstring>
#include<algorithm>
#include<cmath>
#define il inline
#define ll long long
#define rep(i,s,t) for(register int i=(s);i<=(t);i++)
#define rev_rep(i,s,t) for(register int i=(s);i>=(t);i--)
#define each(i,u) for(int i=head[u];i;i=bow[i].nxt)
#define file(s) freopen(s".in" ,"r",stdin),freopen(s".out","w",stdout)
#define pt(x) putchar(x)
using namespace std;
il int ci(){
	register char ch;int f=1;
	while(!isdigit(ch=getchar()))f=ch=='-'?-1:1;
	register int x=ch^'0';
	while(isdigit(ch=getchar()))x=(x*10)+(ch^'0');
	return f*x;
}

il ll comp(ll x){
	return x*(x-1)/2;
}
enum{N=200023};
int a[N],cnt[N];

int main(){
	int n=ci(); ll ans=0;
	rep(i,1,n) cnt[a[i]=ci()]++;
	rep(i,1,n) ans += comp(cnt[i]);
	rep(i,1,n) printf("%lld\n",ans-cnt[a[i]]+1);
	return 0;
}


Measured memory_bytes: 3584
#define ll long long int
#define ull unsigned long long int
#define pb push_back
#define mp make_pair
#define ye cout<<"YES";
#define no cout<<"NO";
#define ln cout<<"\n";
// cout<<"Case #"<<ts<<": ";
#include <bits/stdc++.h>
using namespace std;

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

	 ll t=1,r,n,a,d,c,b,x,y,sum,cnt,i,j,k,m,l,q,maxx,minn,temp,ans,flag,g,ts;
	
	 char ch;
	 double dans;
	 string str,ttr;
	 
//	 cin >> t;

	
	for(ts=1;ts<=t;ts++)
	{
	     flag=0;sum=0;cnt=0;ans=0;k=0;maxx=0;minn=0;a=0;b=0;temp=0;
	    
	     cin >>a >> b >>c >>d;
	     
	     while(a>0 && c>0)
	     {
	         a=a-d;
	         c=c-b;
	     }
	     
	     if(c>0 && a<=0)
	     cout<<"No";
	     else
	     cout<<"Yes";
	     
	    
	     ln
	 }
	return 0;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
#define show(x) {for(auto i: x){cout << i << " ";} cout << endl;}
using namespace std;
using ll = long long;
using P = pair<int, int>;

const int INF = 1e9;

int main() {
    // bit
    int N, M, X;
    cin >> N >> M >> X;
    vector<int> C(N);
    vector<vector<int>> book(N, vector<int> (M));
    rep(i, N) {
        cin >> C[i];
        rep(j, M) cin >> book[i][j];
    }
    int ans = INF;
    for (int bit = 0; bit < (1<<N); bit++) {
        int temp = 0;
        vector<int> prog(M);
        for (int j = 0; j < N; j++) {
            if ((bit >> j) & 1) {
                temp += C[j];
                rep(k, M) {
                    prog[k] += book[j][k];
                }
            }
        }
        bool flag = true;
        rep(i, M) {
            if (prog[i] < X) {
                flag = false;
            }
        }
        if (flag) ans = min(ans, temp);
    }
    if (ans == INF) cout << -1 << '\n';
    else cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define all(v) v.begin(),v.end()
#define P pair<int,int>
#define len(s) (int)s.size()
#define pb push_back

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;
}
constexpr int mod = 1e9+7;
constexpr int inf = 3e18;

int N;
int cnt[100005];
int sum;
signed main(){
	cin>>N;
	rep(i,N){
		int a;cin>>a;sum+=a;
		cnt[a]++;
	}
	int Q;cin>>Q;
	while(Q--){
		int b,c;cin>>b>>c;
		sum+=(c-b)*cnt[b];
		cnt[c]+=cnt[b];cnt[b]=0;
		cout<<sum<<endl;
	}
}


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

int main() {
    int n, sum = 0, ans = 0;
    string s;
    cin >> n >> s;
    for(int i = 0; i < s.size(); ++i) {
        if(s[i] == 'I') {
            sum++;
        } else if(s[i] == 'D') {
            sum--;
        }
        if(ans < sum) ans = sum;
    }
    cout << ans << '\n';
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string.h>
#include <cmath>

using namespace std;

bool f[100105];

int main()
{
	int x;
	cin >> x;
	for (int i = 2; i <= x+100; i++) {
		if (f[i] == 0) {
			//素数
			for (int j = 2; i*j <= x + 100; j++) {
				f[i*j] = 1;
			}
		}
	}
	int i=x;
	while (1) {
		if (f[i] == 0) {
			cout << i;
			break;
		}
		i++;
	}
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
#define CoDeFoRcEs_and_ChIlL ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
typedef long long ll;
#define fl(i,a,b) for(ll i=a;i<b;i++)
#define rfl(i,a,b) for(ll i=a;i>b;i--)
#define pb push_back
#define mp make_pair
#define test ll t;cin>>t;while(t--)
#define lld long double
#define vpp vector<pair<ll,ll>>
#define pii pair<ll,ll>
#define ff first
#define ss second
#define endl '\n'
#define trace(x) cerr<<#x<<": "<<x<<" "<<endl;
const ll M =1000000007;
const double pi  =acos(-1);
const int N = 5e2 + 10;
int main()
{  
    CoDeFoRcEs_and_ChIlL;
    ll k,a,b,f=0;
  cin>>k>>a>>b;
  fl(i,a,b+1)
  {
if(i%k==0)f=1;}
  if(f)cout<<"OK";
    else cout<<"NG";
} 

Measured memory_bytes: 3652
n = int(input())
a = list(map(float, input().split()))

# dp = [[None] * 1501 for i in range(3000)]
# def dfs(i=0, at=(n + 1) // 2):
#     if i == n:
#         return int(at <= 0)
#     at = max(at, 0)
#     if dp[i][at] is not None:
#         return dp[i][at]
#
#     r = dfs(i + 1, at - 1) * a[i] + dfs(i + 1, at) * (1 - a[i])
#     dp[i][at] = r
#     return r
# print(dfs())

dp = [[0] * 1501 for i in range(3000)]
dp[n][0] = 1
for i in reversed(range(n)):
    for at in reversed(range((n + 1) // 2 + 1)):
        r = dp[i + 1][max(0, at - 1)] * a[i] + dp[i + 1][at] * (1 - a[i])
        dp[i][at] = r

print(dp[0][(n + 1) // 2])



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

using namespace std;
#define ll long long

const int N=1e6+100;
const int inf=0x3f3f3f3f;


ll p[N],c[N];

ll vis[6000],g[6000];
ll n,k,step;
void A(int s)
{
     while(1){
        if(vis[s]) return ;
        step++;
        g[step]=g[step-1]+c[p[s]];
        vis[s]=1;
        s=p[s];
     }
}
void solve()
{

   cin>>n>>k;
   for(int i=1;i<=n;i++)
        cin>>p[i];

   for(int i=1;i<=n;i++)
       cin>>c[i];
   ll ans=-1e18;
   for(int i=1;i<=n;i++){
       ll kk=k;
       memset(vis,0,sizeof vis);
       for(int i=1;i<=n;i++) g[i]=-1e18;
       step=0;
       A(i);
       ll ma=g[step];
       for(int i=2;i<=step;i++){
          g[i]=max(g[i],g[i-1]);
       }
      // if(step>=kk) ans=max(ans,g[step]);
     // for(int i=1;i<=step;i++) cout<<g[i]<<" ";
      //cout<<endl;
       ll ty=kk/step;

       if(ty>=1){
          ans=max(max(ans,g[step]),max(g[kk%step]+ty*ma,g[step]+(ty-1)*ma));
       }
       else {
        ans=max(ans,g[kk%step]);
       }
   }
    cout<<ans<<endl;
}
int main()
{
    ios::sync_with_stdio(0),cin.tie(0);
    solve();
    return 0;
}


Measured memory_bytes: 3780
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  int a[N],b[N];
  int i;
  for(i=0;i<N;i++){
    cin >> a[i];
  }
  for(i=0;i<N;i++){
    b[i]=0;
  }
  for(i=0;i<N;i++){
    if(a[i]%2==0){
      b[i]=a[i];
    }
  }
  string s="APPROVED";
  for(i=0;i<N;i++){
    if(b[i]%3!=0 && b[i]%5!=0){
      s="DENIED";
      break;
    }
  }
  cout << s << endl;
}
      
  


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#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 rev(i, n) for(int i = (int)(n - 1); i >= 0; i--)
#define rev1(i, n) for(int i = (int)(n); i > 0; i--)
#define pb push_back
#define all(v) ((v).begin(), (v).end())
using ll = long long;
using P = pair<int, int>;
/* ------------------------------------------------ */
ll fact(int i) {       //階乗
    if (i == 0) return 1;
    return (fact(i - 1)) * i;
}
ll gcd(ll a, ll b) {        //最大公約数
    if(b == 0) return a;
    return gcd(b, a % b); 
}
ll lcm(ll a, ll b) {      //最小公倍数
    return a * b / gcd(a, b);
}
int keta(ll n) {        //桁数を求める
    if(n == 0) return 1;
    int count = 0;
    while(n != 0) {
        n /= 10;
        count++;
    }
    return count;
}
ll ketasum(ll n) {    //各桁の和
    ll sum = 0;
    while(n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
/* ------------------------------------------------ */
int main() {
    int h,w;
    cin >> h >> w;
    char s[55][55];
    rep(i, h) {
        rep(j, w) cin >> s[i][j];
    }
    int dist[55][55];
    rep(i, h) {
        rep(j, w) dist[i][j] = -1;
    }
    dist[0][0] = 1;
    int f[]={0,1,0,-1};
    int g[]={1,0,-1,0};
    queue<P> que;
    que.push({0,0});
    while(!que.empty()) {
        P p = que.front();
        que.pop();
        rep(i, 4) {
            int x = p.first + f[i],y = p.second + g[i];
            if(x > h-1 || x < 0 || y > w-1 || y < 0) continue;
            if(dist[x][y] == -1 && s[x][y] == '.'){
                dist[x][y] = dist[p.first][p.second]+1;
                que.push({x,y});
            }
        }
    }
    if(dist[h-1][w-1]==-1) {
        cout << -1 << endl;
        return 0;
    }
    int ans = h*w - dist[h - 1][w - 1];
    rep(i, h) {
        rep(j, w) if(s[i][j] == '#') ans--;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3644
n,m=map(int,input().split())
c={}
d=[]
for i in range(n):
  a,b=map(int,input().split())
  if a not in c:
    c[a]=0
    d.append(a)
  c[a]+=b
  
d.sort()

ans=0
for i in range(n):
  if m > c[d[i]]:
    m-=c[d[i]]
    ans+=d[i]*c[d[i]]
  else:
    ans+=d[i]*m
    break
    
print(ans)

  

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


using namespace std;


#ifdef zxc

#include "debug.h"

#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

using ll = int64_t;
using ld = long double;
const ld EPS = 1e-10;
const ll MOD = 1e9 + 7;
const ld PI = 3.141592653589793;
const int maxn = 200001;

void fast_io() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
}

int a[maxn];
ll dp[maxn][3];

signed main() {
#ifdef zxc
    mt19937 mt(228);
    freopen("../kolya_input.txt", "r", stdin);
//    freopen("../kolya_output.txt", "w", stdout);
#else
    //    mt19937 mt(std::chrono::high_resolution_clock::now().time_since_epoch().count());
    //            freopen("", "r", stdin);
    //        freopen("hack.out", "w", stdout);
#endif
    fast_io();
    cout.precision(1);
    cout << fixed;
    auto start = chrono::steady_clock::now();
    ll ans = 0;
    int n;
    cin >> n;
    for (int i = 1; i <= n; ++i) {
        cin >> a[i];
        if (a[i] & 1) {
            ans += a[i] / 2;
            a[i] = 1;
        } else if (a[i]) {
            ans += (a[i] - 1) / 2;
            a[i] = 2;
        }

    }


    for (int i = 1; i <= n; ++i) {
        dp[i][0] = dp[i][1] = dp[i][2] = -1e15;
    }
    dp[1][a[1]] = ans;
    if (a[1] == 2) {
        dp[1][0] = ans + 1;
    }
    for (int i = 2; i <= n; ++i) {
        for (int z = 0; z <= a[i]; ++z) { // to dec
            for (int e = z; e <= 2; ++e) {
                dp[i][a[i] - z] = max(dp[i][a[i] - z], dp[i - 1][e] + z);
            }
            if (z == 2) {
                for (int e = 0; e <= 2; ++e) {
                    dp[i][0] = max(dp[i][0], dp[i - 1][e] + 1);
                }
            }
        }
//        debug(i, dp[i][0]);
//        debug(i, dp[i][1]);
//        debug(i, dp[i][2]);
    }
    cout << max({dp[n][0], dp[n][1], dp[n][2]});
    auto end = chrono::steady_clock::now();
    debug("time", chrono::duration_cast<chrono::milliseconds>(end - start).count() / 1000.0);

}



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

namespace Buffet
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var A = Console.ReadLine().Split().Select(x => int.Parse(x));
            var B = Console.ReadLine().Split().Select(x => int.Parse(x));
            var C = Console.ReadLine().Split().Select(x => int.Parse(x));

            var score = 0;
            var prevCooking = 0;
            foreach(var a in A.Select((x,i) => new{ Cooking = x,Index = i}))
            {
                score += B.ElementAt(a.Cooking -  1);
                if((a.Cooking - 1) == prevCooking)
                {
                    if(prevCooking > 0)
                    {
                        score += C.ElementAt(prevCooking - 1);
                    }
                }
                prevCooking = a.Cooking;
            }
            Console.WriteLine(score);
        }
    }
}

Measured memory_bytes: 13396
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define all(a) a.begin(), a.end()
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,int> pli;
typedef pair<int,int> pii;
#define rep(i,a,b) for(ll i=a ; i<b ; i++)
#define qrep(que, ite) for(auto ite=begin(que) ; ite!=end(que) ; ite++)
const int max_n = 1e5;
const ll mod = 1e9+7;
const ll INF = 1e17;
const int inf = 1e5;
typedef long double ld;
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; }
ll gcd(ll a, ll b) { return a ? gcd(b%a, a) : b; }
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
ll mo = 998244353;
struct UnionFind {
    vector<int> par;

    UnionFind(int n) : par(n, -1) { }
    void init(int n) { par.assign(n, -1); }

    int root(int x) {
        if (par[x] < 0) return x;
        else return par[x] = root(par[x]);
    }

    bool issame(int x, int y) {
        return root(x) == root(y);
    }

    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (par[x] > par[y]) swap(x, y); // merge technique
        par[x] += par[y];
        par[y] = x;
        return true;
    }

    int size(int x) {
        return -par[root(x)];
    }
};
struct SegmentTree{
  int N;
  vector<int> node;
  public :
    void intit(vector<int>v){
      int sz = v.size();
      N=1;
      while(N<sz) N*=2;
      node.resize(N);
      for(int i=0 ; i<sz ; i++) node[i+N-1] = v[i];
      for(int i=N-2 ; i>=0 ; i--) node[i] = min(node[i*2+1], node[i*2+2]);
    }
    void update(int x, int val){
      x += N-1;
      node[x+N-1] = val;
      while(x>0){
        x = (x-1)/2;
        node[x] = min(node[x*2+1], node[x*2+2]);
      }
    }
    int getmin(int a, int b, int k, int l, int r){
      if(b<=l || r<=a) return inf;
      else if(a<=l && r<=b) return node[k];
      else{
        int vl = getmin(a, b, 2*k+1, l, (l+r)/2);
        int vr = getmin(a, b, 2*k+2, (l+r)/2, r);
        return min(vl, vr);
      }
    }
};
int main(){
  char c; cin>>c;
  if(isupper(c)){
    cout<<'A'<<endl;
  }else{
    cout<<'a'<<endl;
  }
  return 0;
}


Measured memory_bytes: 3552
S = input()
N = len(S)
boarder = [] # R->L or L->Rの場所
for i in range(N-1):
    if S[i] != S[i+1]:
        boarder.append(i+1)
num_boarder = len(boarder)
ans = [0 for i in range(N)]
index = 0
for i in range(0, num_boarder, 2):
    # indexからboarder[i]にいる子はboarder[i]-1かboarder[i]に集まる
    # boarder[i]からindexまでの距離がk -> その区間にはk+1人の子供
    # k = 2mならindexにいる子はboarder[i]-1にくる
    # その数はm+1人
    # R->Lの境目はboarder[0], boarder[2],...
    # 最初は0からboarder[1]-1の子がboarder[0]-1とboarder[0]に集まる
    # 次はboarder[1]からboarder[3]-1の子がboarder[2]-1とboarder[2]に集まる
    LtoR = boarder[i] - 1 - index
    if LtoR % 2 == 0:
        ans[boarder[i] - 1] += (LtoR+1) // 2 + 1
        ans[boarder[i]] += (LtoR+1) // 2
    else:
        ans[boarder[i] - 1] += (LtoR+1) // 2
        ans[boarder[i]] += (LtoR+1) // 2
    if i+1 < num_boarder:
        RtoL = boarder[i+1] - 1 - boarder[i]
        if RtoL % 2 == 0:
            ans[boarder[i]] += (RtoL+1) // 2 + 1
            ans[boarder[i] - 1] += (RtoL+1) // 2
        else:
            ans[boarder[i]] += (RtoL+1) // 2
            ans[boarder[i] - 1] += (RtoL+1) // 2
        index = boarder[i+1]
    else:
        RtoL = N-1 - boarder[-1]
        if RtoL % 2 == 0:
            ans[boarder[i]] += (RtoL+1) // 2 + 1
            ans[boarder[i] - 1] += (RtoL+1) // 2
        else:
            ans[boarder[i]] += (RtoL+1) // 2
            ans[boarder[i] - 1] += (RtoL+1) // 2
print(*ans)

Measured memory_bytes: 10352
#include <cstdio>

int main(){
	int n;
	for(;;){
		scanf("%d",&n);
		if(n==0) break;
		int data[1000][4];
		for(int i=0;i<n;i++){
			for(int j=0;j<4;j++){
				scanf("%d",&data[i][j]);
			}
		}
		int p,q,r,c;
		scanf("%d%d%d%d",&p,&q,&r,&c);
		int cannum=0;
		for(int i=0;i<n;i++){
			if(data[i][1]<=p && data[i][2]<=q && data[i][3]<=r && (data[i][1]+data[i][3])*4+data[i][2]*9 <= c){
				printf("%d\n",data[i][0]);
				cannum++;
			}
		}
		if(cannum==0) printf("NA\n");
	}
}

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

int main() {
  int N, K;
  cin >> N >> K;
  int total = 0, x;
  for (int i=0; i<N; i++) {
    cin >> x;
    if (x < K-x) total += 2*x;
    else total += (K-x)*2;
  }
  cout << total << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define range(i, a, b) for(auto i = (a); i < (b); i++)
#define rep(i, a) range(i, 0, a)
using namespace std;
const int INF = sizeof(int) == sizeof(long long) ? LONG_LONG_MAX : INT_MAX;
const int MOD = 1000000007;
const long double EPS = 1e-8;

signed main() {
	int n, kk;
	cin >> n >> kk;
	pair <int, int> xy[n], yx[n];
	rep (i, n) {
		int inx, iny;
		cin >> inx >> iny;
		xy[i] = {inx, iny};
		yx[i] = {iny, inx};
	}
	sort(xy, xy + n);
	sort(yx, yx + n);
	int ans = INF;
	rep (i, n) rep (j, n) rep (k, n) rep(l, n) {
		int ue = yx[n - 1 - i].first, shita = yx[j].first,
				hidari = xy[k].first, migi = xy[n - 1 - l].first;
		int cnt = 0;
		rep (m, n) {
			cnt += (shita <= xy[m].second && xy[m].second <= ue)
					&& (hidari <= xy[m].first && xy[m].first <= migi);
		}
		if (cnt >= kk) {
			ans = min(ans, (ue - shita) * (migi - hidari));
		}
	}
	cout << ans << endl;
	return 0;
}


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

//template
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(a);i>(b);i--)
#define ALL(v) (v).begin(),(v).end()
typedef long long int ll;
const int inf = 0x3fffffff; const ll INF = 0x1fffffffffffffff; const double eps=1e-12;
void tostr(ll x,string& res){while(x)res+=('0'+(x%10)),x/=10; reverse(ALL(res)); return;}
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; }
//end

int n,m,g[710][710];
int col[710], cnt[2];
bitset<710> dp;

void dfs(int x,int c){
   if(col[x]==-1)col[x]=c;
   else if(col[x]!=c){puts("-1"); exit(0);}
   else return;
   cnt[c]++;
   rep(nxt,0,n)if(g[x][nxt]&&x!=nxt)dfs(nxt,c^1);
}

int main(){
   scanf("%d%d",&n,&m);
   fill(g[0],g[n],1);
   rep(i,0,m){
      int x,y; scanf("%d%d",&x,&y); x--; y--;
      g[x][y]=g[y][x]=0;
   }
   dp=1; memset(col,-1,sizeof(col));
   rep(i,0,n)if(col[i]==-1){
      cnt[0]=cnt[1]=0; dfs(i,0);
      dp=(dp<<cnt[0])|(dp<<cnt[1]);
   }
   ll res=INF;
   rep(i,0,n)if(dp[i])chmin(res,1LL*i*(i-1)/2+1LL*(n-i)*(n-i-1)/2);
   printf("%lld\n",res);
   return 0;
}

Measured memory_bytes: 2176
#include<stdio.h>

int main(){
	int n,i,x=1;
	
	scanf("%d",&n) ;
	int str[n];
	for(i=0;i<n;i++){
		scanf("%d",&str[i]);
	}
	for(i=0;i<n;i++){
		if(str[i]==x){
			x++;
		}
	}
	if(x==1){
		printf("-1");
	}else printf("%d",n-x+1);
}

Measured memory_bytes: 896
#include<stdio.h>
int main()
{
    long long m,n,a,b,c,i,j,k,l,t;
    scanf("%lld",&t);
    for(i=1;i<=t;i++)
    {
        scanf("%lld %lld %lld",&a,&b,&c);
        if(a*a==b*b+c*c||b*b==c*c+a*a||c*c==a*a+b*b) printf("YES\n");
        else printf("NO\n");
    }
    return 0;
}

Measured memory_bytes: 580
#n=int(input())
l,r=map(int,input().split())
#t=int(input())
#al=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]

if r-l>=2019:
    mn=0
else:
    mn=(l*r)%2019
    for i in range(l,r):
        for j in range(i+1,r+1):
            mn=min(mn,(i*j)%2019)
print(mn)


Measured memory_bytes: 9164
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<string>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
vector<P> node[100005];
bool used[100005];
int ans[100005]={0};
void dfs(int pos){
  for(int i=0;i<node[pos].size();i++){
    int to=node[pos][i].first;
    if(!used[to]){
      used[to]=true;
      dfs(to);
    }
  }
}
int main(){
  ll n,m;
  cin>>n>>m;
  for(int i=0;i<m;i++){
    ll x,y,z;
    cin>>x>>y>>z;
    z=z%2;
    node[x].push_back(P(y,z));
    node[y].push_back(P(x,z));
  }
  for(int i=1;i<=n;i++) used[i]=false;
  ll ans=0;
  for(int i=1;i<=n;i++){
    if(!used[i]) {
      used[i]=true;
      dfs(i);
      ans++;
    }
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 11008
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <unordered_map>
using namespace std;

#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v.begin(), v.end())
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }

int A, B;

// solve (n, 1)
vector<string> solve(int n) {
  vector<string> res;
  int p = n / 50;
  int r = n % 50;
  string kuro = "";
  string tmp = "";
  for (int i = 0; i < 100; ++i) kuro += "#";
  for (int i = 0; i < p; ++i) {
	res.push_back(kuro);
	tmp = "";
	for (int j = 0; j < 100; ++j) {
	  if (j % 2 == 0) tmp += '.';
	  else tmp += '#';
	}
	res.push_back(tmp);
  }
  res.push_back(kuro);
  tmp = "";
  for (int i = 0; i < r*2; ++i) {
	if (i % 2 == 0) tmp += '.';
	else tmp += '#';
  }
  while (tmp.size() < 100) tmp += '#';
  res.push_back(tmp);
  res.push_back(kuro);

  return res;
}

void rev(vector<string> &vec) {
  for (int i = 0; i < vec.size(); ++i) {
	for (int j = 0; j < vec[i].size(); ++j) {
	  if (vec[i][j] == '.') vec[i][j] = '#';
	  else vec[i][j] = '.';
	}
  }
}


int main() {
  while (cin >> A >> B) {
	vector<string> res;
	if (A == 1) {
	  res = solve(B);
	  rev(res);
	}
	else if (B == 1) {
	  res = solve(A);
	}
	else {
	  res = solve(B-1);
	  rev(res);
	  vector<string> add = solve(A-1);
	  for (int i = 0; i < add.size(); ++i) res.push_back(add[i]);
	}

	cout << res.size() << " " << res[0].size() << endl;
	for (int i = 0; i < res.size(); ++i) {
	  cout << res[i] << endl;
	}
  }
}







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

int main() {
    int n, m; cin >> n >> m;
    vector<int> a(n), b(n);
    vector<int> c(m), d(m);

    rep(i, n) {
        cin >> a.at(i) >> b.at(i);
    }
    rep(i, m) {
        cin >> c.at(i) >> d.at(i);
    }

    int minv;
    rep(i, n) {
        int distance;
        int ans = 1;
        rep(j, m) {
            distance = abs(a.at(i) - c.at(j)) + abs(b.at(i) - d.at(j));
           //printf("distance=%d, j=%d\n", distance, j);
            if (j == 0)
                minv = distance;
            else {
                if (minv > distance) {
                    //printf("minv=%d, distance=%d\n", minv, distance);
                    ans = j+1;
                    minv = distance;
                }
            }
        }
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <queue>
#include <math.h>
#include <stack>
#include <set>
#include <deque>

using namespace std;
typedef long long ll;
ll mod = 1e9+7;
#define rep(i,n) for(int i = 0; i < (n); ++i)

int main(){
    int n;
    cin >> n;
    set<string> st;
    rep(i, n) {
        string s;
        cin >> s;
        st.insert(s);
    }
    cout << st.size() << endl;
    return 0;
}


Measured memory_bytes: 19224
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		String s = sc.next();

		int ans = 1000;
		for(int i=0;i<=s.length()-3;i++) {
			String x = s.substring(i, i+3);
			int n = Integer.parseInt(x);
			ans = Math.min(ans, Math.abs(n-753));
		}

		out.println(ans);

		sc.close();

	}

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

}


Measured memory_bytes: 21844
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

class Main {
    public static void main(final String[] args) throws Exception {

        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in));) {
            List<String> inputString = Arrays.asList(br.readLine().split(" "));
            List<Integer> numbers = new ArrayList<>();
            for (String str : inputString) {
                numbers.add(Integer.parseInt(str));
            }

            int ans = 0;
            for (int i = 0; i <= numbers.get(0); i++) {
                for (int j = 0; j <= numbers.get(0); j++) {
                    int k = numbers.get(1) - i - j;
                    if (0 <= k && k <= numbers.get(0)) {
                        ans++;
                    }
                }
            }

            System.out.println(ans);
        } catch (IOException | NumberFormatException e) {
            e.printStackTrace();
            System.exit(0);
        } catch (final Exception e) {
            e.printStackTrace();
            System.exit(0);
        }
    }
}

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

int main() {
    int K, N;
    cin >> K >> N;
    vector<int> A(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }
    sort(A.begin(), A.end());
    vector<int> diff(N);
    for (int i = 0; i < N; i++) {
        diff[i] = A[i+1] - A[i];
        if (i == N-1) diff[i] = K - (A[i] - A[0]);
    }
    int MAX = 0;
    for (int i = 0; i < N; i++) {
        MAX = max(MAX, diff[i]);
    }
    cout << K-MAX << endl;
}

Measured memory_bytes: 1792
#include <stdio.h>
#define ll long long

typedef struct Point{ll x,y;}P;
typedef struct line{P p1,p2;}L;
int sgn(ll x){return x<0?-1:x>0;}

int iscross(L s,L t){
	//点(p,q)が直線f(x,y)=ax+by+c=0のどっち側にあるかはf(p,q)を見ればよい
	//点(x1,y1),(x2,y2)を結ぶ直線の式は(y2-y1)*(x-x1)+(x2-x1)*(y1-y)=0
	ll t1=(s.p2.y-s.p1.y)*(t.p1.x-s.p1.x)+(s.p2.x-s.p1.x)*(s.p1.y-t.p1.y);
	ll t2=(s.p2.y-s.p1.y)*(t.p2.x-s.p1.x)+(s.p2.x-s.p1.x)*(s.p1.y-t.p2.y);
	ll t3=(t.p2.y-t.p1.y)*(s.p1.x-t.p1.x)+(t.p2.x-t.p1.x)*(t.p1.y-s.p1.y);
	ll t4=(t.p2.y-t.p1.y)*(s.p2.x-t.p1.x)+(t.p2.x-t.p1.x)*(t.p1.y-s.p2.y);
	//同一直線上にない
	if(t1 || t2)return sgn(t1)!=sgn(t2) && sgn(t3)!=sgn(t4);
	//同一直線上にある
	ll c1=(s.p2.x-s.p1.x)*(s.p2.x-s.p1.x)+(s.p2.y-s.p1.y)*(s.p2.y-s.p1.y);
	ll c2=(t.p1.x-s.p1.x)*(s.p2.x-s.p1.x)+(t.p1.y-s.p1.y)*(s.p2.y-s.p1.y);
	ll c3=(t.p2.x-s.p1.x)*(s.p2.x-s.p1.x)+(t.p2.y-s.p1.y)*(s.p2.y-s.p1.y);
	if(0<=c2&&c2<=c1 || 0<=c3&&c3<=c1 || c2<=0&&c1<=c3 || c3<=0&&c1<=c2)return 1;
	return 0;
}

int main(){
	int q;
	scanf("%d",&q);
	while(q--){
		L s,t;
		for(int i=0;i<2;i++){
			scanf("%lld%lld%lld%lld",&s.p1.x,&s.p1.y,&s.p2.x,&s.p2.y);
			if(!i)t=s;
		}
		printf("%d\n",iscross(s,t));
	}
}


Measured memory_bytes: 2084
#include<bits/stdc++.h>                          
using namespace std;
int a,b,c,d;
int main(){
    cin>>a>>b>>c>>d;
    if((abs(a-b)<=d&&abs(c-b)<=d)||abs(a-c)<=d) cout<<"Yes";
    else cout<<"No";
	return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-S
a,b = map(str,input().split())

if a == "H" and b == "H":
    print("H")
elif a == "H" and b == "D":
    print("D")
elif a == "D" and b == "H":
    print("D")
elif a == "D" and b == "D":
    print("H")


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

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

int main() {
	int H, W;
	cin >> H >> W;
	vector<string> S(H);
	for (int n = 0; n < H; ++n) {
		cin >> S[n];
	}
	long long ans = 0;
	vector<vector<bool>> data(H, vector<bool>(W, false));

	for (int n = 0; n < H; ++n) {
		for (int m = 0; m < W; ++m) {
			if (false == data[n][m]) {
				long long countB = 0;
				long long countW = 0;
				queue<pair<int, int>> q;
				data[n][m] = true;
				q.emplace(n, m);
				while (!q.empty()) {
					int x = q.front().first;
					int y = q.front().second;
					q.pop();
					if (S[x][y] == '#') {
						countB++;
					}
					else {
						countW++;
					}
					//範囲内かつ0を4セット
					for (int l = 0; l < 4; ++l) {
						int x1 = x + dx[l];
						int y1 = y + dy[l];
						if ((0 <= x1) && (H > x1) && (0 <= y1) && (W > y1)) {
							if ((S[x][y] != S[x1][y1]) && (!data[x1][y1])) {
								data[x1][y1] = true;
								q.emplace(x1, y1);
							}
						}
					}
				}
				ans += countB * countW;
			}
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 3880
N,K=map(int,input().split())
*A,=map(int,input().split())

D=[0]*(2*10**5+1)

t=len(set(A))-K
if t<=0:
    print(0)
else:
    for a in A:
        D[a]+=1
    print(sum(sorted([d for d in D if 0<d])[:t]))

Measured memory_bytes: 32848
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String A = sc.next();
		String B = sc.next();
		sc.close();
		
		String ans = "";
		if(A.length() != B.length()) {
			if(A.length() > B.length())
				ans = "GREATER";
			else
				ans = "LESS";
		} else {
			boolean flag = true;
			for(int i = 0;i < A.length();++i) {
				if(A.charAt(i) != B.charAt(i)) {
					if(A.charAt(i) > B.charAt(i))
						ans = "GREATER";
					else
						ans = "LESS";
					flag = false;
				}
				if(!flag)
					break;
			}
			if(flag)
				ans = "EQUAL";
		}
		System.out.println(ans);
	}
}


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

int two_count(int a){
  if(a%2==1){
    return 0;
  }
  else{
    return 1 + two_count(a/2);
  }
}
  
int main(){
  int N;
  cin >> N;
  vector<int> A(N);
  for(int i=0; i<N; i++){
    int ret;
    cin >> ret;
    A.at(i) = ret;
  }
  
  int answer = 1000000;
  for(int i=0; i<N; i++){
    int tmp = two_count(A.at(i));
    if(tmp<answer){
      answer = tmp;
    }
  }
  cout << answer;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef vector<vector<ll>> Mat;
#define ALL(v) (v).begin(),(v).end()
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;

ll mod_pow(ll a, ll n) {
	if (n == 0) return 1;
	if (n % 2 == 0) {
		ll tmp = mod_pow(a, n / 2);
		return (tmp * tmp) % MOD;
	}
	return (a * mod_pow(a, n - 1)) % MOD;
}

vector<ll> fact;
vector<ll> inv_fact;

void comb_init(int n) {
	fact.resize(n + 1);
	inv_fact.resize(n + 1);
	fact[0] = inv_fact[0] = 1;
	for (int i = 1; i <= n; i++) {
		fact[i] = (fact[i - 1] * i) % MOD;
		inv_fact[i] = (inv_fact[i - 1] * mod_pow(i, MOD - 2)) % MOD;
	}
}

ll comb(int n, int k) {
	if (n < k) return 0;
	ll ret = fact[n];
	(ret *= inv_fact[k]) %= MOD;
	(ret *= inv_fact[n - k]) %= MOD;
	return ret;
}

int main() {
	int N, A, B, C;
	cin >> N >> A >> B >> C;
	comb_init(2 * N);
	ll ans = 0;
	for (int M = N; M < 2 * N; M++) {
		ll p = 0;
		ll a = A * mod_pow(A+B, MOD - 2) % MOD;
		ll b = B * mod_pow(A+B, MOD - 2) % MOD;
		p = mod_pow(a, N);
		(p *= mod_pow(b, M - N)) %= MOD;
		ll t = mod_pow(b, N);
		(t *= mod_pow(a, M - N)) %= MOD;
		(p += t) %= MOD;
		(p *= comb(M - 1, N - 1)) %= MOD;
		(ans += p * M%MOD) %= MOD;
	}
	(ans *= 100) %= MOD;
	(ans *= mod_pow(100 - C, MOD - 2)) %= MOD;
	cout << ans << endl;
}

Measured memory_bytes: 3328
n = int(input())
nli = []

nlid = {'M':0,'A':0,'R':0,'C':0,'H':0}

for i in range(n):
    p = str(input())
    nli.append(p)
    q = list(p)
    po = q[0].upper()
    if po in nlid :
        nlid[po] = nlid[po] + 1
    else:
        None
    
#print(nlid)
count = nlid['M'] * nlid['A'] * nlid['R'] + nlid['M'] * nlid['A'] * nlid['C'] + nlid['M'] * nlid['A'] * nlid['H'] + nlid['M'] * nlid['R'] * nlid['C'] + nlid['M'] * nlid['R'] * nlid['H'] + nlid['M'] * nlid['C'] * nlid['H'] + nlid['A'] * nlid['R'] * nlid['C'] + nlid['A'] * nlid['R'] * nlid['H'] + nlid['A'] * nlid['C'] * nlid['H'] + nlid['R'] * nlid['C'] * nlid['H']
                
print(count)

Measured memory_bytes: 9872
#include<stdio.h>

int main(){
	
	int a, b, c;
	
	scanf("%d %d %d", &a, &b, &c);
	
	int flag = 0;
	
	if(a + b == c){
		flag = 1;
	}
	else if(a + c == b){
		flag = 1;
	}
	else if(c + b == a){
		flag = 1;
	}
	
	if(flag == 1){
		puts("Yes");
	}
	else{
		puts("No");
	}
	
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i, n) for (ll(i) = 0; (i) < (n); (i)++)
#define all(x) (x).begin(), (x).end()
#define print(x) cout << (x) << endl;

typedef long long ll;
const ll INF = 99999999999999;
const ll MOD = 1000000007;

using namespace std;

int main()
{
    string s;
    ll ans;
    cin >> s;
    if (s == "SUN")
    {
        ans = 7;
    }
    else if (s == "MON")
    {
        ans = 6;
    }
    else if (s == "TUE")
    {
        ans = 5;
    }
    else if (s == "WED")
    {
        ans = 4;
    }
    else if (s == "THU")
    {
        ans = 3;
    }
    else if (s == "FRI")
    {
        ans = 2;
    }
    else if (s == "SAT")
    {
        ans = 1;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Convert;
using static System.Math;
//using Debug;
//using static System.Globalization.CultureInfo;
//using Edge = Pair<long, int>;
using System.Text;
class Program
{
    static void Main(string[] args)
    {
        Solve();
        //WriteLine(Solve());
    }
    static void Solve()
    {
        var nm = Input.ar;
        var ar = new HashSet<int>();
        for (var i = 0; i < nm[1]; i++)
            ar.Add(Input.num);
        var dp = new long[nm[0]+1];
        dp[0] = 1;
        dp[1] = ToInt64(!ar.Contains(1));
        for (var i = 2; i <= nm[0]; i++)
            if (!ar.Contains(i))
            {
                dp[i] += dp[i - 1] + dp[i - 2];
                dp[i] %= Input.MOD;
            }
        WriteLine(dp[nm[0]]);

    }
}

public class Input
{
    public static string read => ReadLine().Trim();
    public static int[] ar => read.Split(' ').Select(int.Parse).ToArray();
    public static int num => ToInt32(read);
    public static long[] arL => read.Split(' ').Select(long.Parse).ToArray();
    public static long numL => ToInt64(read);
    public static char[][] gred(int h)
        => Enumerable.Repeat(0, h).Select(_ => read.ToCharArray()).ToArray();
    public static int[] ar1D(int n)
        => Enumerable.Repeat(0, n).Select(_ => num).ToArray();
    public static long[] arL1D(int n)
        => Enumerable.Repeat(0, n).Select(_ => numL).ToArray();
    public static string[] strs(int n)
        => Enumerable.Repeat(0, n).Select(_ => read).ToArray();
    public static int[][] ar2D(int n)
        => Enumerable.Repeat(0, n).Select(_ => ar).ToArray();
    public static long[][] arL2D(int n)
        => Enumerable.Repeat(0, n).Select(_ => arL).ToArray();
    public static T getValue<T>(string g)
    {
        var t = typeof(T);
        if (t == typeof(int))
            return (T)(object)int.Parse(g);
        if (t == typeof(long))
            return (T)(object)long.Parse(g);
        if (t == typeof(string))
            return (T)(object)g;
        if (t == typeof(char))
            return (T)(object)char.Parse(g);
        if (t == typeof(double))
            return (T)(object)double.Parse(g);
        if (t == typeof(bool))
            return (T)(object)bool.Parse(g);
        return default(T);
    }
    public static string[] Make<T1, T2>(out T1 v1, out T2 v2)
    {
        var r = read.Split(' ');
        v1 = getValue<T1>(r[0]);
        v2 = getValue<T2>(r[1]);
        return r;
    }
    public static string[] Make<T1, T2, T3>(out T1 v1, out T2 v2, out T3 v3)
    {
        var r = Make(out v1, out v2);
        v3 = getValue<T3>(r[2]);
        return r;
    }
    public const long Inf = (long)1e18;
    public const double eps = 1e-6;
    public const string Alfa = "abcdefghijklmnopqrstuvwxyz";
    public const int MOD = 1000000007;
}

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

int gcc(int a,int b){
  if(b==0)return a;
  if(a>b){return gcc(b,a%b);
  }else return gcc(a,b%a);
}

int main(){
  int i,N,K,a,ans=1,x=0;
  char ss[10000];
  scanf("%d",&N);
  scanf("%d",&K);
  for(i=0;i<N;i++){
	  scanf("%d",&a);
	  x+=a;
	  if(x<=K)ans++;
  }
  printf("%d",ans);
  return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long LL;
const int SIZEN = 100010;
int N,M;
LL f[SIZEN]={0},ans = 0;
int a[SIZEN]={0};
LL sum[SIZEN]={0};
int main(){
	scanf("%d%d",&N,&M);
	for(int i = 1;i <= N;i++)scanf("%d",&a[i]);
	for(int i = 2;i <= N;i++){
		int x,y;
		if(a[i-1] < a[i]){
			x = a[i-1];y = a[i];
			ans += y-x;
			f[x+1] += (-x-1);
			f[y+1] -= (-x-1);
			sum[x+1]++;sum[y+1]--;
		}	
		else{
			ans += M-a[i-1];
			ans += a[i];
			x = a[i-1];y = M;
			if(x+1 <= y){
				f[x+1] += (-x-1);
				f[y+1] -= (-x-1);
				sum[x+1]++;sum[y+1]--;
			}
			x = 1;y = a[i];
			f[x] += (M-a[i-1]-1);
			f[y+1] -= (M-a[i-1]-1);
			sum[x]++;sum[y+1]--;	
		}
	}
	LL mx = 0;
	for(int i = 1;i <= M;i++){
		sum[i] += sum[i-1];
		f[i] += f[i-1];
		mx = max(mx,f[i]+(LL)sum[i]*i);
	}
	mx = max(mx,0LL);
	printf("%lld\n",ans-mx);
	getchar();getchar();
	return 0;
}


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

int main() {
  double A, B, H, M;
  cin >> A >> B >> H >> M;
  double pi = acos(-1);
  double minute = 60 * H + M;
  double rad = minute * pi * 5.5 / 180;
  double x = sqrt(A * A + B * B - 2 * A * B * cos(rad));
  cout << fixed << setprecision(10) << x << endl;
}

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

int main(){
    using namespace std;
    unsigned long N;
    cin >> N;
    unsigned long M{N};
    vector<unsigned long> facs{N};
    for(unsigned long i{2}; i * i <= N; ++i)if(N % i == 0){
        facs.push_back(i);
        if(i * i != N)facs.push_back(N / i);
    }
    const auto& check = [](unsigned long i, unsigned long M) -> bool {
        while(M % i == 0)M /= i;
        return M % i == 1;
    };
    unsigned long ans{M > 2};
    for(const auto& i : facs)ans += check(i, M);
    N = M - 1;
    for(unsigned long i{2}; i * i <= N; ++i)if(N % i == 0){
        ++ans;
        if(i * i != N)++ans;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 384
#include<stdio.h>
int main()
{
	char s[10],t[10],u[10];
	int a,b;
	scanf("%s %s",s,t);
	scanf("%d %d",&a,&b);
	scanf("%s",u);
	if(s[0]==u[0]){
		a=a-1;
	}
	else b=b-1;
	printf("%d %d\n",a,b);
	return 0;
}


Measured memory_bytes: 1672
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
ll GetDigit(ll num){ return log10(num)+1; } //numの桁数を求める

int main()
{
    int x, y;
    cin >> x >> y;
    int min = 2*x;
    int max = 4*x;
    for (size_t i = min; i <= max; i+=2)
    {
        if(y == i){
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    
}

Measured memory_bytes: 3676
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <numeric>
#include <array>
#include <cmath>
#include <memory>
#include <map>
using namespace std;
#define DEB(variable) cout << #variable << '=' << variable << endl

#define FOR(LoopVariable,numberOFbegin,numberOFend) for (long long int LoopVariable = (numberOFbegin); (LoopVariable) < (numberOFend); (LoopVariable)++)
#define DEFOR(LoopVariable,numberOFbegin,numberOFend) for (long long int LoopVariable = (numberOFbegin)-1; (LoopVariable) >= (numberOFend); (LoopVariable)--)
#define REP(LoopVariable,numberOFend) for(long long int LoopVariable = 0;(LoopVariable)<(numberOFend);LoopVariable++)

using llint = long long int;

constexpr long long int linf = numeric_limits<long long int>::max()-5;
constexpr long long int inf= numeric_limits<int>::max()-5;
constexpr long long int mod = 1000000007;

int main(){

    string s;
    cin>>s;
    map<char,llint> mp;
    for(auto x:s){
        mp[x]++;
    }
    for(auto x='a';x<='z';x++){
        if(mp[x]==0){
            cout<<x<<endl;
            return 0;
        }
    }
    cout<<"None"<<endl;

    return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define fastio ios_base::sync_with_stdio(0); cin.tie(0)
#define int long long
const int mod = 1e9 + 7;

int32_t main(){
	fastio;
	
	int n; cin >> n;
	unordered_map<int,int> mp;
	int sum = 0;
	for(int i=0; i<n; i++){
		int x; cin >> x;
		mp[x]++;
		sum += x;
	}
	
	int q; cin >> q;
	while(q--){
		int b, c; cin >> b >> c;
		sum += mp[b]*(c-b);
		cout << sum << endl;
		mp[c] += mp[b];
		mp.erase(b);
	}
	return 0;
}
		


Measured memory_bytes: 6620