akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <vector>

const int MOD = 998244353;
const int iINF = 2147483647 / 2;
const long long int llINF = 9223372036854775807 / 2;

using namespace std;
using ll = long long int;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vvvl = vector<vector<vector<ll>>>;

typedef pair<ll, ll> pll;
bool paircomp(const pll &a, const pll &b) {
  if (a.first == b.first)
    return a.second < b.second;
  return a.first < b.first;
}

#define REP(i, n) for (ll i = 0; i < (n); i++)
#define RREP(i, n) for (ll i = (n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define AUTO(i, m) for (auto &i : m)
#define ALL(a) (a).begin(), (a).end()
#define MAX(vec) *std::max_element(vec.begin(), vec.end())
#define MIN(vec) *std::min_element(vec.begin(), vec.end())
#define ARGMAX(vec)                                                            \
  std::distance(vec.begin(), std::max_element(vec.begin(), vec.end()))
#define ARGMIN(vec)                                                            \
  std::distance(vec.begin(), std::min_element(vec.begin(), vec.end()))
#define REV(T) greater<T>()
#define PQ(T) priority_queue<T, vector<T>, greater<T>>
#define VVL(a, b, c) vector<vector<ll>>(a, vector<ll>(b, c))
#define VV(T, a, b, c) vector<vector<T>>(a, vector<T>(b, c))
#define VVVL(a, b, c, d)                                                       \
  vector<vector<vector<ll>>>(a, vector<vector<ll>>(b, vector<ll>(c, d)))
#define VVV(T, a, b, c, d)                                                     \
  vector<vector<vector<T>>>(a, vector<vector<T>>(b, vector<T>(c, d)))
#define SP(a) setprecision(a)
#define SQRT(a) sqrt((long double)(a))
#define DPOW(a, b) pow((long double)(a), (long double)(b))
#define UNIQUE(vec)                                                            \
  do {                                                                         \
    sort(ALL((vec)));                                                          \
    (vec).erase(std::unique(ALL((vec))), (vec).end());                         \
  } while (0)

ll POW(ll n, ll m) {
  if (m == 0) {
    return 1;
  } else if (m % 2 == 0) {
    ll tmp = POW(n, m / 2);
    return (tmp * tmp);
  } else {
    return (n * POW(n, m - 1));
  }
}

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

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll A, B, C, D;
  cin >> A >> B >> C >> D;
  vvl DP = VVL(C + 1, D + 1, 0);
  DP[A][B] = 1;
  FOR(i, A, C + 1)
  FOR(j, B, D + 1)
  if ((i - A) != 0 || (j - B) != 0)
    DP[i][j] = (DP[i - 1][j] * j + DP[i][j - 1] * i -
                DP[i - 1][j - 1] * (i - 1) * (j - 1) % MOD + MOD) %
               MOD;

  cout << DP[C][D] << endl;

  return 0;
}


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


public class Main {
    static long battle(long H){
        if(H<=0) return 0;
        if(H==1) return 1;
        return 1 + 2 * battle(H/2);
    }
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        long H = sc.nextLong();
        System.out.println(battle(H));
    }
}


Measured memory_bytes: 23124
using System;

class C
{
	static void Main()
	{
		Console.ReadLine();
		var a = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);

		var r = 0L;
		var M = 0;
		foreach (var x in a)
			if (x < M) r += M - x;
			else M = x;
		Console.WriteLine(r);
	}
}


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

class Bmondai
{
    static void Main()
    {
        var S = Console.ReadLine();
        var ans = 0;
        var count = 0;
        foreach (var letter in S)
        {

            if (letter == 'A' || letter == 'C' || letter == 'G' || letter == 'T') count++;
            else
            {
                ans = Math.Max(ans, count);
                count = 0;
            }
        }
        ans= Math.Max(ans, count);
        Console.WriteLine(ans);
    }
}

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

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

int main()
{
    long long X;
    cin >> X;
    long long ans = 100;
    for (int i = 1;;i++){
        ans = (double)ans * 1.01;
        if(ans >= X){
            cout << i << endl;
            return 0;
        }
    }
}



Measured memory_bytes: 3636
def main():
    X = int(input())
    if 400 <= X <= 599:
        print(8)
    elif 600 <= X <= 799:
        print(7)
    elif 800 <= X <= 999:
        print(6)
    elif 1000 <= X <= 1199:
        print(5)
    elif 1200 <= X <= 1399:
        print(4)
    elif 1400 <= X <= 1599:
        print(3)
    elif 1600 <= X <= 1799:
        print(2)
    elif 1800 <= X <= 1999:
        print(1)
    

if __name__ == "__main__":
    main()

Measured memory_bytes: 61964
n,x,m = map(int,input().split())
if x == 1:
  print(n)
  exit()
u = [0 for _ in range(m)]
rs = [0 for _ in range(m+1)]
s = x
u[x] = 1
rs[1] = x
i = 2
while True:
  x = (x*x)%m
  if u[x] == 0:
    u[x] = i
    s += x
    rs[i] = s
    i += 1
  else:
    ls = u[x]
    le = i-1
    break
if n <= le:
  print(rs[n])
  exit()
ans = rs[ls-1]
ll = le-ls+1
nl = n-ls+1
lsum = rs[le] - rs[ls-1]
q = nl//ll
r = nl%ll
ans += q*lsum
ans += rs[ls-1+r] - rs[ls-1]
print(ans)

Measured memory_bytes: 79120
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int X;
  int Y;
  cin>>X;
  if((X%100)%5==0){
    Y=(X%100)/5;
  }
  else{
    Y=(X%100)/5+1;
  }
  if(Y<=X/100){
    cout<<1<<endl;
  }
  else{
    cout<<0<<endl;
  }
}

Measured memory_bytes: 3636
#include <iostream>

using namespace std;

int main()
{
    int a, b, c, x;
    cin >> a;
    cin >> b;
    cin >> c;
    cin >> x;

    int count = 0;
    for (auto i = 0; i <= a; ++i) {
        for (auto j = 0; j <= b; ++j) {
            for (auto k = 0; k <= c; ++k) {
                if ((500 * i + 100 * j + 50 * k) == x) {
                    ++count;
                }
            }
        }
    }
    cout << count << endl;
}

Measured memory_bytes: 256
/*
螺旋本 p371

circumcenter:
    https://ja.wikipedia.org/wiki/%E5%A4%96%E6%8E%A5%E5%86%86#%E5%A4%96%E5%BF%83%E3%81%AE%E4%BD%8D%E7%BD%AE
    https://mathtrain.jp/goshin
*/
#pragma GCC optimize("Ofast")
#include <cstdio>
#include <cstdlib>
#include <string>
#include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
#include <bitset>
#include <cmath>
#include <limits>
#include <iostream>
#include <map>
#include <set>
#include <tuple>
using namespace std;
#define INF 1LL << 55
#define MAX 1LL << 30
#define MOD 1000000007
typedef long long ll;
typedef pair<int,int> P;
//typedef pair<pair<int,int>,int> p;
#define bit(n, k) ((n >> k) & 1) /*nのk bit目*/
#define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360)
template<class T,class U>bool chmin(T&a,const U&b){if(a<=b)return false;a=b;return true;}
template<class T,class U>bool chmax(T&a,const U&b){if(a>=b)return false;a=b;return true;}
//__builtin_popcount(S);
//C.erase(unique(C.begin(),C.end()),C.end());
//#define int ll
int dx[]={1,-1,0,0},dy[]={0,0,-1,1};

signed main(){
    int N;
    cin>>N;

    vector<int> a(N);
    for(int i=0;i<N;i++) cin>>a[i];
    sort(a.begin(),a.end());
    //差が2以上は駄目
    if(a[N-1]-a[0]>=2){
        cout<<"No"<<endl;
        return 0;
    }
    int count0=0,count1=0;
    for(int i=0;i<N;i++){
        if(a[i]==a[0]) count0++;
        else count1++;
    }
    if(count0==N){
        if(a[0]==N-1 || a[0]<=N/2 ){
            cout<<"Yes"<<endl;
        }else cout<<"No"<<endl;
        return 0;
    }
    if(count1<=1){
        cout<<"No"<<endl;
        return 0;
    }
    if(a[N-1]>=count0+1 && a[N-1]<=count0+count1/2){
        cout<<"Yes"<<endl;
    }else cout<<"No"<<endl;

}

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

namespace AtCoderRegularContest069
{
    public class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(program1(new String[] { Console.ReadLine(), Console.ReadLine() }));
        }

        public static string program1(string[] args)
        {
            var n = int.Parse(args[0]);
            var s = args[1].ToCharArray();

            var animalPattern = new List<char>[] { new List<char>() { 'S', 'S' }, new List<char> { 'S', 'W' }, new List<char> { 'W', 'W' }, new List<char> { 'W', 'S' } };

            return string.Join("", animalPattern.Select(animals =>
            {
                var prevAnimal = animals.First();
                
                foreach(var ans in s.Skip(1))
                {
                    var last = animals.Last();
                    if (last == 'S' && ans == 'x' || last == 'W' && ans == 'o')
                    {
                        animals.Add(prevAnimal == 'S' ? 'W' : 'S');
                    }
                    else
                    {
                        animals.Add(prevAnimal);
                    }
                    prevAnimal = last;
                }

                return animals;
            }).FirstOrDefault(animals => {
                if (animals.First() == animals.Last())
                {
                    if (s.First() == 'o' && animals.First() == 'S' || s.First() == 'x' && animals.First() == 'W')
                    {
                        return animals.ElementAt(1) == animals.ElementAt(n - 1);
                    }
                    else
                    {
                        return animals.ElementAt(1) != animals.ElementAt(n - 1);
                    }
                }
                else return false;
            })?.Take(n) ?? new List<char>() { '-', '1' }) ;
        }
    }
}


Measured memory_bytes: 16608
let () =
    let split s =
        let rec loop i cur flag acc =
            if i = String.length s then (
                if flag then cur :: acc else acc
            ) else (
                match flag, s.[i] with
                | true,  ' ' -> loop (i + 1) 0 false (cur :: acc)
                | false, ' ' -> loop (i + 1) 0 false acc
                | true,  v   -> loop (i + 1) (cur * 10 + int_of_char v - 48) true acc
                | false, v   -> loop (i + 1) (cur * 10 + int_of_char v - 48) true acc
            )
        in
        List.rev (loop 0 0 false [])
    in
    let main () =
        let n, x = Scanf.sscanf (read_line ()) "%d %d" (fun n x -> n, x) in
        let l = Array.of_list (split (read_line ())) in
        let a = Array.make (n + 1) 0 in
        for i = 1 to n do
            a.(i) <- a.(i - 1) + l.(i - 1)
        done;
        let rec loop i =
            if i <= n && a.(i) <= x then loop (i + 1) else i
        in
        Printf.printf "%d\n" (loop 0)
    in
    main()

Measured memory_bytes: 384
#include<iostream>
using namespace std;
int main(){
  int N, d[50];
  cin >> N;
  for(int i=0; i<N; i++){
    cin >> d[i];
  }
  int ans = 0;
  for(int i=0; i<N; i++){
    for(int j=i+1; j<N; j++){
      ans += d[i] * d[j];
    }
  }
  cout << ans << endl;
  return 0;
}

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

using namespace std;
typedef long long ll;
#define int ll

#define REP(i,n) for(int i=0;i<n;++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#  define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#  define DBG(fmt, ...)
#endif

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const double DINF = std::numeric_limits<double>::infinity();
const int MOD = 1000000007;
#define MAX_N 100010

// ユークリッドの互除法の変形
template <typename T> T gcd(T a, T b) { while (a) { b %= a; swap(a, b); } return b; }
// 最小公倍数
template <typename T> T lcm(T a, T b) { return a / gcd(a,b) * b; }

ll A, B, C, D;

// [A, B] にある n の倍数の数を返す
ll GetCnt(ll n) {
    ll a_c = A + (n - (A % n));
    if(A % n == 0) { a_c = A; }
    ll b_c = B - (B % n);

    return (b_c - a_c) / n + 1;
}

signed main()
{
    cin >> A >> B >> C >> D;
    ll ans = B - A + 1;
    ans -= GetCnt(C);
    ans -= GetCnt(D);
    ans += GetCnt(lcm(C, D));
    printf("%lld\n", ans);
    return 0;
}


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

int main(){
    int N,K; cin >> N >> K;
    cin >> N >> K;
    int ans=0;
    
    rep(i,N){
        ans=K*pow(K-1,N-1);
    }
    cout << ans;
}

Measured memory_bytes: 512
#include <iostream>

int main(void)
{
	const long int MOD = 1E9+7;
	int n,m,i;
	scanf("%d%d",&n,&m);
	long int X=0,Y=0,a;

	for(i=0;i<n;++i){
		scanf("%lld",&a);
		X+=a*(n-2*i-1);
		X%=MOD;
	}

	for(i=0;i<m;++i){
		scanf("%lld",&a);
		Y+=a*(m-2*i-1);
		Y%=MOD;
	}

	printf("%lld\n",(X*Y)%MOD);

	return 0;
}

Measured memory_bytes: 256
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())
if A > B:
    x = A
    A = B
    B = x

nowA = A+T*V
nowB = B+T*W
if nowA >= nowB:
    ans = "YES"
else:
    ans="NO"
print(ans)

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

#define fi first
#define se second
#define pb push_back
#define sz(a) (int)(a).size()
#define mp(a, b) make_pair((a), (b))
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;

const ll MOD = 1e9 + 7;
const ll INF = 1e18;
const ll IINF = INT_MAX;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    map<ll, ll> cnt;
    ll sum = 0;
    for (int i = 0; i < n; i++) {
        int x;
        cin >> x;
        cnt[x]++;
        sum += x;
    }
    int q;
    cin >> q;
    for (int i = 0; i < q; i++) {
        ll b, c;
        cin >> b >> c;
        sum -= cnt[b] * b;
        sum += cnt[b] * c;
        cnt[c] += cnt[b];
        cnt[b] = 0;
        cout << sum << '\n';
    }
    return 0;
}

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

int main(){
    std::ios_base::sync_with_stdio(false);
    set<string> st; 
    int n;
    cin >> n;
    while(n--){
        string BUFF,c;
        cin >> BUFF >> c;
        if(BUFF=="insert")st.insert(c);
        else cout << (st.find(c)!=st.end()?"yes":"no") << "\n";
    }   
}



Measured memory_bytes: 29052
#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];

  // Initialize maximum profit and minimum value
  int maxp = -1000000000;
  int minv = R[0];

  // Update maximum profit and minimum value
  for (int i = 1; i < n; i++){
    maxp = max(maxp, R[i]-minv);
    minv = min(minv, R[i]);
  }

  cout << maxp << endl;
  return 0;
}



Measured memory_bytes: 3864
# ALDS1_3_B: Queue

#n, q = [5, 100]
#A = [('p1', 150), ('p2', 80), ('p3', 200), ('p4', 350), ('p5', 20)]

A = []
n, q = map(int, input().split())
for i in range(n):
    name, time = input().split()
    A.append((name, int(time)))

totaltime = 0
while len(A) > 0:
    #process, A = A[0], A[1:]
    name, time = A[0]
    A.remove(A[0])
    if (time - q) <= 0:
        totaltime += time
        print(name, totaltime)
    else:
        totaltime += q
        A.append((name, time - q))


Measured memory_bytes: 12240
// Problem : 
// 			A - AC or WA
// 			Editorial
// 		
// Contest : AtCoder - AtCoder Beginner Contest 152
// URL : https://atcoder.jp/contests/abc152/tasks/abc152_a
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define fo(i,n)         for(int i=0;i<n;i++)
#define Fo(i,k,n)       for(int i=k;i<n;i++) 
#define endl            "\n"
#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define vec(x)          vector<x>
#define matrix(x)       vector<vector<x>>
#define sz(x)             (int)x.size()
#define mem(a,b)        memset(a, b, sizeof a)
#define vii             vector<pair<int,int>>
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define gcd(a,b)        __gcd(a,b)
#define lcm(a,b)        (a*(b/gcd(a,b)))
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define MOD             998244353
#define deb(x)          cerr <<#x<<" = "<<x<<"\n"
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define all(v)          v.begin(),v.end()
#define rep(i,a,b)      for (int i = a; i<b; ++i)
#define len(s)          s.length()
#define watch(x)         cout << #x << " = " << x << endl
#define trace(x)         cerr << #x << " = " << x << endl
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());
 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
 
 
int power(int a,int b,int m=mod)
{int ans=1;while(b>0){if(b&1)ans=(ans*a)%m;a=(a*a)%m;b>>=1;}
return ans;}

void angshuGod()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}

const int N = 1e5+1;
const double pi = acos(-1);

void solve(){
    
	int n,m; cin>>n>>m;
	if(m<n) cout<<"No";
	else cout<<"Yes";
	
}

 
int32_t main()
{
    angshuGod();

    int t;

    t = 1;
    //cin>>t;

    while(t--){
        solve();
    }
    
    return 0;
}

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

int main()
{
  int n;
  cin >> n;
  
  vector<int> size_a(101, 0);
  int size, ans = 0;
  
  for(int i = 0; i < n; i++){
    cin >> size;
    if(!size_a.at(size)){
      size_a.at(size) = 1;
      ans++;
    }
  }
  
  cout << ans << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <sstream>
#include <string>
#define _repargs(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _repargs(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define inf 2000000007
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;
template <typename T>
inline void output(T a, int p = 0) {
    if(p) cout << fixed << setprecision(p)  << a << "\n";
    else cout << a << "\n";
}
// end of template

struct node {int pos; ll cost;};
map<node, int> m;



int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    // source code
    int N, M;
    cin >> N >> M;
    vector<vector<node>> G(N);
    
    rep(i, M) {
        int a, b;
        ll c;
        cin >> a >> b >> c;
        a--; b--;
        G[a].pb({b, c});
    }
    vector<ll> S(N, 0);
    vector<int> vis(N, 0);
    vis[0] = 1;
    rep(a, N) rep(i, N) {
        if(vis[i]) {
            for(node n: G[i]) {
                if(vis[n.pos]) {
                    S[n.pos] = max(S[n.pos], S[i] + n.cost);
                }
                else {
                    S[n.pos] = S[i] + n.cost;
                    vis[n.pos] = 1;
                }
            }
        }
    }
    auto T = S;
    rep(a, N) rep(i, N) {
        if(vis[i]) {
            for(node n: G[i]) {
                T[n.pos] = max(T[n.pos], T[i] + n.cost);
            }
        }
    }
    if(S[N - 1] < T[N - 1]) output("inf");
    else output(T[N - 1]);
    
    
    
    return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
int main() {
  int x, y, a, b, c;
  cin >> x >> y >> a >> b >> c;
  priority_queue<int, vector<int>, less<int>> p;
  priority_queue<int, vector<int>, less<int>> q;
  priority_queue<int, vector<int>, less<int>> r;
  rep(i, a) {
    int v;
    cin >> v;
    p.push(v);
  }
  rep(i, b) {
    int v;
    cin >> v;
    q.push(v);
  }
  rep(i, c) {
    int v;
    cin >> v;
    r.push(v);
  }
 
  priority_queue<int, vector<int>, less<int>> apples;
  rep(i, x) {
    apples.push(p.top());
    p.pop();
  }
  rep(i, y) {
    apples.push(q.top());
    q.pop();
  }
  rep(i, c) {
    apples.push(r.top());
    r.pop();
  }
 
  long long sum = 0;
  rep(i, x + y) {
    sum += apples.top();
    apples.pop();
  }
 
  cout << sum << endl;
}

Measured memory_bytes: 3572
#include <iostream>
#include <vector>
#include<cmath>
using namespace std;
#define endl '\n'

using namespace std;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    long int n, k,a,b,count=0;
    bool x[101];
    for (int i = 0; i < 101;i++){
        x[i] = false;
    }
        cin >> n >> k;
    for (int i = 0; i < k;i++){
        cin >> a;
        for (int j = 0; j < a;j++){
            cin >> b;
            x[b] = true;
        }
    }
    for (int i = 0; i < 101;i++){
        if(x[i]==true){
            count++;
        }
    }
    cout << n - count;
    return 0;
}

Measured memory_bytes: 3640
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int K = sc.nextInt();

		int sum = 0;

		for(int i = 0; i < K; i++) {
			if(A > 0) {
				sum += 1;
				A -= 1;
				continue;
			}else if(B > 0) {
				sum += 0;
				B -= 1;
				continue;
			} else {
				sum -= 1;
				C -= 1;
				continue;
			}
		}
		System.out.println(sum);
	}

}


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

int prime[300000];
bool is_prime[300010];

void sieve(int n){
    int p = 0;
    for(int i = 0; i <= n; i++) is_prime[i] = true;
    is_prime[0] = is_prime[1] = false;
    for(int i = 2; i <= n; i++){
        if(is_prime[i]){
            prime[p++] = i;
            for(int j = 2*i; j <= n; j += i) is_prime[j] = false;
        }
    }
}

signed main(){
    sieve(300000);
    int n;
    while(1){
        cin >> n;
        if(n == 0) break;
        int ans = 0;
        for(int i = n + 1; i <= 2 * n; i++){
            if(is_prime[i] == true) ans++;
        }
        cout << ans << endl;
    }
}

Measured memory_bytes: 3400
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
  int eye1[4]={0},eye2[4]={0};
  double bell,hess;
  while(scanf("%lf %lf",&bell,&hess)!=EOF){
    if(bell>=1.1){
      eye1[0]++;
    }
    else if(bell>=0.6){
      eye1[1]++;
    }
    else if(bell>=0.2){
      eye1[2]++;
    }
    else{
      eye1[3]++;
    }
    if(hess>=1.1){
      eye2[0]++;
    }
    else if(hess>=0.6){
      eye2[1]++;
    }
    else if(hess>=0.2){
      eye2[2]++;
    }
    else{
      eye2[3]++;
    }
  }
  for(int i=0;i<4;i++){
    cout << eye1[i] << " " << eye2[i] << endl;
  }
}

Measured memory_bytes: 1232
#include<bits/stdc++.h>
#define ll long long
#define F(type, i, a, b) for(type i = a; i <= b; i ++)
#define RF(type, i, a, b) for(type i = a; i >= b;i --)
#define sz(a) sizeof(a)
#define deb(a) cerr<<" ["<<#a<<"->"<<a<<"] "
#define next_line cerr<<'\n'
#define all(a) a.begin(), a.end()
#define iter(it, s) for(auto it = s.begin(); it != s.end(); it ++)

using namespace std;

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

void solve()
{
    //If you cannot approach a problem
    //directly in the way it is proposed then try to think from backwards
    ll x, k, d;
    cin>>x>>k>>d;
    x = abs(x);
    ll ex = x / d;
    if(ex >= k){
        cout<<(x - (k * d))<<'\n';
    }
    else{
        k -= ex;
        x = x % d;
        if((k & 1LL) == 0LL){
            cout<<x<<'\n';
        }
        else{
            x = d - x;
            cout<<x<<'\n';
        }
    }
}

signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);
        freopen("Debug.txt", "w", stderr);
    #else
    #endif
        solve();
}


Measured memory_bytes: 3636
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;

typedef long long ll;
const int maxn=2000010;
const int mod=1e9+7;

ll fac[maxn], inv[maxn], ans;

ll Pow(ll x,ll y){
	ll ret=1;
	while(y){
		if(y&1) ret = ret*x%mod;
		x = x*x%mod;
		y >>= 1;
	}
	return ret;
}

void init(){
	fac[0]=inv[0]=1;
	for(int i=1;i<maxn;i++) fac[i]=fac[i-1]*i %mod;
	inv[maxn-1] = Pow(fac[maxn-1], mod-2);
	for(int i=maxn-2;i>=1;i--) inv[i]=inv[i+1]*(i+1)%mod;
}
ll C(ll x,ll y){
	return fac[x]*inv[y] %mod *inv[x-y]%mod;
}

ll work(int n,int m){ return C(n+m+2,m+1); }
ll calc(int a,int b,int c,int d){ return (work(c,d)-work(a-1,d)+mod -work(c,b-1)+mod +work(a-1,b-1))%mod; }
int x, y;
ll ret;
int main(){

	init();
	int x1, x2, x3, x4, x5, x6;
	int y1, y2, y3, y4, y5, y6;
	scanf("%d%d%d%d%d%d",&x1, &x2, &x3, &x4, &x5, &x6);
	scanf("%d%d%d%d%d%d",&y1, &y2, &y3, &y4, &y5, &y6);

	for(int i=x3;i<=x4;i++){
		x=i, y=y3-1;
		ret=(x+y+1)*calc(x-x2, y-y2, x-x1, y-y1)%mod *calc(x5-x, y5-y-1, x6-x, y6-y-1) %mod;
		ans=(ans+mod -ret)%mod;
	}
	for(int i=y3;i<=y4;i++){
		x=x3-1, y=i;
		ret=(x+y+1)*calc(x-x2, y-y2, x-x1, y-y1)%mod *calc(x5-x-1, y5-y, x6-x-1, y6-y) %mod;
		ans=(ans+mod -ret)%mod;
	}
	for(int i=x3;i<=x4;i++){
		x=i, y=y4;
		ans=(ans+ (x+y+1)*calc(x-x2, y-y2, x-x1, y-y1)%mod *calc(x5-x, y5-y-1, x6-x, y6-y-1) %mod )%mod;
	}
	for(int i=y3;i<=y4;i++){
		x=x4, y=i;
		ans=(ans+ (x+y+1)*calc(x-x2, y-y2, x-x1, y-y1)%mod *calc(x5-x-1, y5-y, x6-x-1, y6-y) %mod )%mod;
	}
	printf("%lld\n",ans);
	return 0;
}

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

using namespace std;

#define F first
#define S second
#define modulo ll (1e9 + 7)

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

void init(){
    cin.tie(0);
    cin.sync_with_stdio(0);
}

const int N = 2e5 + 9, M = 1e6, OO = 0x3f3f3f3f;
const ll llOO = 0x3f3f3f3f3f3f3f3f;



ll power(ll b, ll p){
    if(p == 0)return 1;
    ll res = power(b,p/2);
    res *= res;
    res %= modulo;
    if(p & 1)res *= b;
    return res % modulo;
}


int main(){
    init();

    string s;   cin >> s;
    s[5] = ' ';
    s[13] = ' ';
    cout << s;

}

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

const int MAXN = 21;
const int MOD = 1e9 + 7;
long long dp[1 << MAXN] = {0}, _dp[1 << MAXN] = {0};

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

    int n;
    cin >> n;
    const int max_mask = 1 << n;

    bool a;
    for (int i = 0; i < n; ++i) {
        cin >> a;
        dp[1 << i] = a ? 1 : 0;
    }

    for (int i = 0; i < n - 1; ++i) {
        for (int j = 0; j < n; ++j) {
            cin >> a;
            if (a) {
                for (int mask = 0; mask < max_mask; ++mask) {
                    if (!(mask >> j & 1))
                        _dp[mask + (1 << j)] += dp[mask];
                }
            }
        }
        for (int mask = 0; mask < max_mask; ++mask)
            _dp[mask] %= MOD;
        for (int j = 0; j < max_mask; ++j) {
            dp[j] = _dp[j];
            _dp[j] = 0;
        }
    }

    long long cnt = 0;
    for (int i = 0; i < max_mask; ++i)
        cnt += dp[i];

    cout << cnt % MOD << '\n';
    return 0;
}

Measured memory_bytes: 33024
#include <stdio.h>

int main(void) {
  int N;
  scanf("%d", &N);
  for (int i = 1; i <= 9; i++) {
    for (int j = 1; j <= 9; j++) {
      if (i*j == N) {
        puts("Yes");
        return 0;
      }
    }
  }
  puts("No");
  return 0;
}


Measured memory_bytes: 128
a = input()
b = input()
if len(a) != len(b):
  if len(a) > len(b):
    print("GREATER")
    quit()
  else:
    print("LESS")
    quit()
for i in range(len(a)):
  if int(a[i]) > int(b[i]):
    print("GREATER")
    quit()
  elif int(a[i]) < int(b[i]):
    print("LESS")
    quit()
print("EQUAL")

Measured memory_bytes: 3064
import java.util.Scanner;

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

		int n = sc.nextInt();
		int t = sc.nextInt();
		int a = sc.nextInt();

		double minSub = 1000.0;
		int ans = 0;
		for (int i = 1; i <= n; i++) {
			int h = sc.nextInt();
			double sub = Math.abs(a - (t - h * 0.006));
			if (sub < minSub) {
				minSub = sub;
				ans = i;
			}
		}
		System.out.println(ans);
		sc.close();
	}
}


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

#pragma GCC optimize ("O2")
#pragma GCC optimize ("tree-vectorize")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define FFOR(i, a, b) FOR(i, a, b+1)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) FOR(i, 1, n+1)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define LEN(x) (int)(x).size()
#define DUMP(x) cerr<<__LINE__<<' '<<#x<<"="<<(x)<<endl;
#define pb push_back
#define eb emplace_back
#define mp make_pair

using namespace std;
using lint = long long;
using pii =  pair<int, int>;
using pll =  pair<lint, lint>;
template <typename T> using vc = vector<T>;
template <typename T> using vvc = vector<vector<T>>;
template <typename T> inline bool chmax(T &a, T b){if(a<b){a = b; return true;} return false;}
template <typename T> inline bool chmin(T &a, T b){if(a>b){a = b; return true;} return false;}

constexpr lint ten(int n) {return n==0 ? 1 : ten(n-1)*10;}

class A {
public:
    void solve(std::istream& in, std::ostream& out){
        ios_base::sync_with_stdio(false);
        in.tie(nullptr), out.tie(nullptr);
        lint N, K, X, Y;
        in>>N>>K>>X>>Y;
        lint ans = 0;
        ans += min(N, K) * X;
        N -= min(N, K);
        ans += N * Y;
        out<<ans<<'\n';
    }
};


int main() {
	A solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 3640
#include <iostream>
#include <cstdio>
#include <complex>
#include <cmath>
#include <utility>
#include <algorithm>
using namespace std;

typedef complex<int> xy_t;
xy_t P[100010];
xy_t Q[100010];

bool com(xy_t a, xy_t b)
{
    if(a.real()==b.real())
        return a.imag()<b.imag();
    else    return a.real()<b.real();
}
int main()
{
    int n, x, y, t;
    cin >> n;
    for(int i=0;i<n;i++)
    {
        cin >> x >> y;
        P[i] = xy_t(x, y);
    }
    sort(P, P+n, com);
    Q[0] = P[0];
    Q[1] = P[1];
    int num = 2;
    for(int i=2;i<n;i++)
    {
        if((Q[num-1].real()-Q[num-2].real())*(P[i].imag()-Q[num-2].imag()) - (Q[num-1].imag()-Q[num-2].imag())*(P[i].real()-Q[num-2].real()) >= 0)
        {
            Q[num] = P[i];
            num++;
        }
        else  {
                  while(num >= 2)
                  {
                    if((Q[num-1].real()-Q[num-2].real())*(P[i].imag()-Q[num-2].imag()) - (Q[num-1].imag()-Q[num-2].imag())*(P[i].real()-Q[num-2].real()) >= 0)
                    {
                        Q[num] = P[i];
                        num++;
                        break;
                    }
                    num--;
                  }
              }
        if(num == 1)
        {
            Q[num] = P[i];
            num++;
        }
    }
    t = num;
    for(int i=n-2;i>=0;i--)
    {
        if((Q[num-1].real()-Q[num-2].real())*(P[i].imag()-Q[num-2].imag()) - (Q[num-1].imag()-Q[num-2].imag())*(P[i].real()-Q[num-2].real()) >= 0)
        {
            Q[num] = P[i];
            num++;
        }
        else  {
                  while(num >= t+1)
                  {
                    if((Q[num-1].real()-Q[num-2].real())*(P[i].imag()-Q[num-2].imag()) - (Q[num-1].imag()-Q[num-2].imag())*(P[i].real()-Q[num-2].real()) >= 0)
                    {
                        Q[num] = P[i];
                        num++;
                        break;
                    }
                    num--;
                  }
              }
        if(num == t)
        {
            Q[num] = P[i];
            num++;
        }
    }
    t=0;
    for(int i=0;i<num-1;i++)
        if(Q[t].imag() > Q[i+1].imag())
            t = i+1;
    cout << num-1 << endl;
    for(int i=t;i<num-1;i++)
        cout << Q[i].real() << ' ' << Q[i].imag() << endl;
    for(int i=0;i<t;i++)
        cout << Q[i].real() << ' ' << Q[i].imag() << endl;
    return 0;
}



Measured memory_bytes: 4656
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<map>
#include<set>
#define SF scanf
#define PF printf
#define MAXN 100010
using namespace std;
int dist[MAXN];
vector<int> a[MAXN],w[MAXN];
struct node{
	int col,sum,x;
	node () {}
	node (int col1,int sum1,int x1):col(col1),sum(sum1),x(x1) {}
	bool operator < (const node &a) const{
		return sum>a.sum;
	}
};
queue<node>q;
map<pair<int,int>,int>vis;
set<pair<int,int> >used[MAXN];
int n;
void spfa(){
	dist[1]=0;
	while(!q.empty()){
		node x=q.front();
		q.pop();
		if(dist[x.x]<x.sum||used[x.x].count(make_pair(x.col,x.sum)))
			continue;
		used[x.x].insert(make_pair(x.col,x.sum));
		int u=x.x;
		for(int i=0;i<a[u].size();i++){
			if(x.col!=-1&&x.col!=w[u][i])
				continue;
			int len=dist[u]+(w[u][i]!=x.col);
			int v=a[u][i];
			if(dist[v]==-1||(dist[v]>=len&&(vis.count(make_pair(v,w[u][i]))==0||vis[make_pair(v,w[u][i])]>len))){
				dist[v]=len;
				vis[make_pair(v,w[u][i])]=len;
				q.push(node(w[u][i],dist[a[u][i]],a[u][i]));
				if(vis.count(make_pair(v,-1))==0||vis[make_pair(v,-1)]>len){
					q.push(node(-1,dist[a[u][i]],a[u][i]));	
					vis[make_pair(v,-1)]=len;
				}
			}
		}
	}
}
int main(){
	memset(dist,-1,sizeof dist);
	int m,u,v,val;
	SF("%d%d",&n,&m);
	int col=0;
	for(int i=1;i<=m;i++){
		SF("%d%d%d",&u,&v,&val);
		a[u].push_back(v);
		a[v].push_back(u);
		w[u].push_back(val);
		w[v].push_back(val);
		col=max(col,val);
	}
	q.push(node(-1,0,1));
	vis[make_pair(0,-1)]=0;
	spfa();
	PF("%d",dist[n]);
}

Measured memory_bytes: 64128
#include <stdio.h>
#include <ctype.h>
#include <algorithm>
#include <assert.h>
#include <cmath>

using namespace std;

char *p1, *p2, buf[1 << 20];

inline char gc()
{
    return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 20, stdin), p1 == p2) ? EOF : *p1++;
}

template<typename T>
void rd(T &num)
{
    char tt;
    bool flag = 0;
    while (!isdigit(tt = gc()) && tt != '-');
    if (tt == '-')
        flag = 1, num = 0;
    else
        num = tt - '0';
    while (isdigit(tt = gc()))
        num = num * 10 + tt - '0';
    if (flag)
        num = -num;
    return;
}

int A, B, C;

int main()
{
    rd(A), rd(B), rd(C);
    printf("%d\n", B + min(C, A + B + 1));
    return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
ll n,l;
cin>>n>>l;
string s[n];
for(int i=0;i<n;i++)
{

    cin>>s[i];
}
sort(s,s+n);
for(auto i: s)cout<<i;
    
}

Measured memory_bytes: 3656
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define mt              make_tuple
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define range(a,b)		substr(a,b-a+1)
#define w(x)            int x; cin>>x; while(x--)
#define trace(x) 		cerr<<#x<<": "<<x<<" "<<endl;
#define FIO             ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

struct tri
{
	int k, l, r;
};

bool cmp(tri a, tri b)
{
	return abs(a.l - a.r) > abs(b.l - b.r);
}

int32_t main()
{
	FIO;
	w(t)
	{
		int n; cin >> n;
		mk(arr, n, tri);

		int ans = 0;
		set<int> reml, remr;
		for (int i = 0; i < n; ++i)
		{
			cin >> arr[i].k >> arr[i].l >> arr[i].r;
			arr[i].k--;
			reml.insert(i);
			remr.insert(i);
		}

		sort(arr, arr + n, cmp);

		for (int i = 0; i < n; ++i)
		{

			if (arr[i].l > arr[i].r)
			{
				auto it = reml.upper_bound(arr[i].k);

				if (it != reml.begin())
				{
					ans += arr[i].l;
					it--;
					reml.erase(it);
					remr.erase(remr.begin());
				}
				else
					ans += arr[i].r;
			}

			else
			{
				auto it = remr.upper_bound(arr[i].k);
				if (it != remr.end())
				{
					ans += arr[i].r;
					remr.erase(it);
					reml.erase((--reml.end()));
				}
				else
					ans += arr[i].l;
			}
		}

		cout << ans << '\n';
	}
	return 0;
}


Measured memory_bytes: 27072
arr = []
a,b = [],[]
for _ in range(int(input())):
    x,y = list(map(int,input().split()))
    a.append(x)
    b.append(y)
a.sort()
b.sort()
n = len(a)
if n%2!=0:
    x = n//2
    print(b[x]-a[x]+1)
else:
    x = n//2
    y = x-1
    a1 = (a[x]+a[y])/2
    b1 = (b[x]+b[y])/2
    ans = (b1-a1)/0.5
    print(int(ans)+1)


Measured memory_bytes: 25564
#include<bits/stdc++.h>
using namespace std;
using Int = long long;

template<Int MOD = 1000000007>
struct Mod{
  Int prev=0;
  vector<Int> fact,inv,finv;
  Mod(){}
  Mod(Int n){init(n);}
  
  Int pow(Int x,Int n){
    Int res=1;
    while(n){
      if(n&1) (res*=x)%=MOD;
      (x*=x)%=MOD;
      n>>=1;
    }
    return res;
  }
  
  Int inverse(Int a){
    return pow(a,MOD-2);
  }
  
  void init(Int n){
    if(prev>=n) return;
    prev=n;
    fact=inv=finv=vector<Int>(n);
    
    fact[0]=1;
    for(Int i=1;i<n;i++)
      fact[i]=(fact[i-1]*i)%MOD;
    
    inv[1]=1;
    for(Int i=2;i<n;i++)
      inv[i]=inv[MOD%i]*(MOD-MOD/i)%MOD;
    
    finv[0]=1;
    for(Int i=1;i<n;i++)
      finv[i]=finv[i-1]*inv[i]%MOD;
  }
  
  Int comb(Int n,Int k){
    Int res=1;
    for(Int i=0;i<k;i++){
      res*=(n-i)%MOD;
      res%=MOD;
      res*=inverse(i+1);
      res%=MOD;
    }
    return res;
  }
  
  //only for prime MOD
  Int C(Int n,Int k){
    if(k<0||k>n) return 0;
    return fact[n]*finv[k]%MOD*finv[n-k]%MOD;
  }

  Int H(Int n,Int k){
    return C(n+k-1,k);
  }
  
  Int montmort(Int n){
    Int res=0,rinv=1;
    for(Int k=2;k<=n;k++){
      (rinv*=inverse(k))%=MOD;
      if(k%2) (res+=MOD-rinv)%=MOD;
      else (res+=rinv)%=MOD;
    }
    for(Int i=1;i<=n;i++)
      (res*=i)%=MOD;
    return res;
  }
  
  // calculate P(t) from given points in [0,N]
  Int LagrangePolynomial(vector<Int> &y,Int t){
    Int n=y.size()-1;
    init(n+1);
    Int num=1;
    for(Int i=0;i<=n;i++)
      num=num*((t-i)%MOD)%MOD;
    Int res=0;
    for(Int i=0;i<=n;i++){
      Int tmp=(y[i]*num%MOD)*inverse((t-i)%MOD)%MOD;
      tmp=tmp*finv[i]%MOD;
      tmp=tmp*finv[n-i]%MOD;
      if((n-i)&1) tmp=MOD-tmp;
      res=(res+tmp)%MOD;
    }
    return res;
  }
};

//INSERT ABOVE HERE
signed main(){
  const Int MOD = 1e9+7;
  Mod<MOD> mod(2e5);
  Int n,k;
  cin>>n>>k;
  Int ans=0;
  for(Int i=1;i<=k;i++){
    Int res=mod.C(k,i)*mod.pow(i,n)%MOD;
    if((k-i)&1) ans+=MOD-res;
    else ans+=res;
    ans%=MOD;
  }
  cout<<ans<<endl;
  return 0;
}



Measured memory_bytes: 7480
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define rep(i,m,n) for(int (i)=(m);(i)<(n);++(i))
#define rREP(i,m,n) for(int (i)=(n)-1;(i)>=(m);--(i))
#define all(x) (x).begin(),(x).end()
#define out(y,x,h,w) (y)<0||(x)<0||(y)>=(h)||(x)>=(w)
constexpr int INF = 1000000001;
constexpr ll mod = 1000000007;
constexpr double PI = 3.1415926535897932;
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;
}
inline void init() {
	cin.tie(nullptr); cout.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

struct mint {
    ll x; // typedef long long ll;
    mint(ll x = 0) :x((x% mod + mod) % mod) {}
    mint operator-() const { return mint(-x); }
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod - a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint a) const {
        mint res(*this);
        return res += a;
    }
    mint operator-(const mint a) const {
        mint res(*this);
        return res -= a;
    }
    mint operator*(const mint a) const {
        mint res(*this);
        return res *= a;
    }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const {
        return pow(mod - 2);
    }
    mint& operator/=(const mint a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint a) const {
        mint res(*this);
        return res /= a;
    }
};
struct comb {
    vector<mint> fact, ifact;
    comb(int n) :fact(n + 1), ifact(n + 1) {
        assert(n < mod);
        fact[0] = 1;
        for (int i = 1; i <= n; ++i) fact[i] = fact[i - 1] * i;
        ifact[n] = fact[n].inv();
        for (int i = n; i >= 1; --i) ifact[i - 1] = ifact[i] * i;
    }
    mint operator()(int n, int k) {
        if (k < 0 || k > n) return 0;
        return fact[n] * ifact[k] * ifact[n - k];
    }
};
template< typename T > T mod_pow(T x, T n, const T& p) {
    T ret = 1;
    while (n > 0) {
        if (n & 1) (ret *= x) %= p;
        (x *= x) %= p;
        n >>= 1;
    }
    return ret;
}

int main() {
	init();

	int K; cin >> K;
	string s; cin >> s;
    comb nCr(K + s.size());
    vector<mint>a(K + 1), b(K + 1);
    a[0] = 1; b[0] = 1;
    rep(i, 1, K + 1) {
        a[i] = a[i - 1] * 25;
        b[i] = b[i - 1] * 26;
    }
    mint ans = 0;
    rep(i, 0, K + 1) {
        ans += a[K - i] * nCr(K - i + s.size() - 1, s.size()-1) * b[i];
    }
    cout << ans.x << "\n";

	return 0;
}

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

#define ll long long
#define INF 99999999
#define MOD (ll)1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

template < typename T > std::string to_string( const T& n )
{
    std::ostringstream stm ;
    stm << n ;
    return stm.str() ;
}

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


int main()
{
    ll N;
    cin >> N;

    set<ll> A;
    rep(i,N)
    {
        ll tmp;
        cin >> tmp;
        A.insert(tmp);
    }
    if( A.size() == N ) cout << "YES" << endl;
    else cout << "NO" << endl;




}


Measured memory_bytes: 9600
a,b,h,m = map(int,input().split())
time = 60*h + m
tansin = 1/2 * time
tyousin = 6 * m

do = min(abs(tansin - tyousin) , 360 - abs(tansin - tyousin))
import math
if do == 180:
  print(a + b)
else:
  c = math.sqrt(a**2 + b**2 - 2*a*b*math.cos(math.radians(do)))
  print(c)

Measured memory_bytes: 9576
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<queue>
#include<cstring>
#include<stack>
#include<cstdlib>
int main()
{
	int n;
	int a,b,c,d;
scanf("%d",&n);
a=n/1000;
b=(n%1000)/100;
c=(n%100)/10;
d=n%10;
if(( a==b && a==c && a==d )||( b==c && c==d )||( a==b && a==c ))
	printf("Yes\n");

else
	printf("No\n");
}

Measured memory_bytes: 128
/*
中心が (xa, ya) で半径 ra の円 A と、中心が (xb, yb) で半径 rb の円 B が与えられたとき、
 B が A の中にあるとき 2、
 A が B の中にあるとき -2、
 A の円周と B の円周が交わっている場合 1、
 A と B が重なっていないとき 0
を出力して終了するプログラムを作成して下さい。なお A と B は同じものではないとします。
xa ya ra xb yb rb
*/
#include <fstream>
#include <iostream>
#include <cmath>
#include <vector>
#include <queue>
#include <utility>
#include <algorithm>
using namespace std;

int main() {
  int n;
  cin >> n;
  while (n--) {
    double xa, ya, ra, xb, yb, rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    double d = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));
    int res;
    if (rb + d < ra) {
      res = 2;
    } else if (ra + d < rb) {
      res = -2;
    } else if (d <= ra + rb) {
      res = 1;
    } else {
      res = 0;
    }
    cout << res << endl;
  }
}

Measured memory_bytes: 1232
n=int(input())
an=list(map(int, input().split()))

toukou =[]
for i,a in enumerate(an):
    toukou.append([str(i+1),str(a)])
toukou.sort(key=lambda x:int(x[1]))
number = []
for s in toukou:
    number.append(s[0])
print(' '.join(number))

Measured memory_bytes: 83436
#include<iostream>
#include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define endl '\n'
using namespace std;
int main()
{
    fastio;
    string s;
    long long i,cnt1=0,cnt2=0;
    cin>>s;
    for(i=0;i<s.size();i++)
    {
        if(i%2==0)
        {
            if(s[i]!='0')
            {
                cnt1++;
            }
        }
        else
        {
            if(s[i]!='1')
            {
                cnt1++;
            }
        }
    }
    for(i=0;i<s.size();i++)
    {
        if(i%2==0)
        {
            if(s[i]!='1')
            {
                cnt2++;
            }
        }
        else
        {
            if(s[i]!='0')
            {
                cnt2++;
            }
        }
    }
    cout<<min(cnt1,cnt2);
    return 0;
}


Measured memory_bytes: 3780
#include<cstdio>	
#include<algorithm>
using namespace std;
typedef long long LL;
LL n,k,ans;
int main()
{
	scanf("%lld%lld",&n,&k);
	for(LL i=n;i>k;i--)
	{
		LL x=n/i;
		ans+=(i-k)*x;
		LL y=n-i*x-k;
		if(k)
			y++;
		ans+=y>0?y:0;
	}
	printf("%lld",ans);
}

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

typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef pair<int, ii> iii;
typedef pair<ii, int> ri3;
#define mp make_pair
#define pb push_back
#define fi first
#define sc second
#define SZ(x) (int)(x).size()
#define ALL(x) begin(x), end(x) 
#define REP(i, n) for (int i = 0; i < n; ++i) 
#define FOR(i, a, b) for (int i = a; i <= b; ++i)
#define RFOR(i, a, b) for (int i = a; i >= b; --i)

vector<int> ans;
void dnc(int a, int b, int x) {
    if (__builtin_popcount(x) == 1) {
        //cout << "PUSH " << a << " " << b << " " << x << endl;
        ans.push_back(a);
        ans.push_back(b);
        return;
    }

    int d = (a^b) & x; d &= -d;
    x &= ~d;

    int c = a ^ (x&-x);
    //cout << a << " " << b << " :: " << x << " :: " << c << endl;
    dnc(a, c&(~d) | (a & d), x);
    dnc(c&(~d) | (b & d), b, x);
}

int main() {
    //freopen("in.txt", "r", stdin);
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, a, b; cin >> n >> a >> b;

    if ((__builtin_popcount(a) - __builtin_popcount(b))%2 == 0) cout << "NO " << '\n';
    else {
        ans.reserve((1<<n));
        dnc(a, b, (1<<n)-1);
        cout << "YES" << '\n';
        for (auto x : ans) cout << x << ' '; cout << '\n';
    }
}



Measured memory_bytes: 1536