akhauriyash/Code-Regression huggingface dataset:
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	N := nextInt()
	K := nextInt64()

	A := make([]int, N)
	for i := 0; i < N; i++ {
		A[i] = nextInt()
	}

	c1 := int64(0)
	c2 := int64(0)
	for i := 0; i < N; i++ {
		for j := 0; j < N; j++ {
			if A[i] > A[j] {
				if i < j {
					c1++
				}
				c2++
			}
		}
	}

	com := mdiv(mmul(K, K-1), 2)
	fmt.Println(madd(mmul(c1, int64(K)), mmul(c2, com)))
}

var mod = int64(1e9 + 7)

// mod を法とする加算
func madd(a, b int64) int64 { return (a + b) % mod }

// mod を法とする減算
func msub(a, b int64) int64 { return (a - b + mod) % mod }

// mod を法とする乗算
func mmul(a, b int64) int64 { return (a * b) % mod }

// mod を法とする除算
func mdiv(a, b int64) int64 { return mmul(a, minv(b)) }

// mod を法とした逆元
func minv(a int64) int64 {
	// 拡張ユークリッドの互除法
	b := mod
	u := int64(1)
	v := int64(0)
	for b > 0 {
		t := a / b
		a -= t * b
		a, b = b, a
		u -= t * v
		u, v = v, u
	}
	u %= mod

	if u < 0 {
		u += mod
	}
	return u
}

var stdin = initStdin()

func initStdin() *bufio.Scanner {
	bufsize := 1 * 1024 * 1024 // 1 MB
	var stdin = bufio.NewScanner(os.Stdin)
	stdin.Buffer(make([]byte, bufsize), bufsize)
	stdin.Split(bufio.ScanWords)
	return stdin
}

func nextString() string {
	stdin.Scan()
	return stdin.Text()
}

func nextBytes() []byte {
	stdin.Scan()
	return stdin.Bytes()
}

func nextInt() int {
	i, _ := strconv.Atoi(nextString())
	return i
}

func nextInt64() int64 {
	i, _ := strconv.ParseInt(nextString(), 10, 64)
	return i
}


Measured memory_bytes: 640
import numpy as np
x=int(input())
a = 0
b = 0
if x > 2:
    while b == 0:
        s = int(np.sqrt(x))
        for i in range(s):
            if x % (i+2) == 0:
                a = 1
                x += 1
                break
        if a == 0:
            b = 1
        else:
            a = 0
print(x)

Measured memory_bytes: 12392
#include<iostream>
using namespace std;
int main()
{
    int x[5];
    for(int i = 0; i < 5; i++){
        cin >> x[i];
    }
    for(int i = 0; i < 5; i++){
        if(x[i] == 0){
            cout << i+1;
        }
    }
}


Measured memory_bytes: 3544
//minamoto
#include<bits/stdc++.h>
#define R register
#define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
#define fd(i,a,b) for(R int i=(a),I=(b)-1;i>I;--i)
#define go(u) for(int i=head[u],v=e[i].v;i;i=e[i].nx,v=e[i].v)
template<class T>inline bool cmax(T&a,const T&b){return a<b?a=b,1:0;}
template<class T>inline bool cmin(T&a,const T&b){return a>b?a=b,1:0;}
using namespace std;
typedef long long ll;
const int N=5e5+5;
char s[N];int a[N],n,mn;ll res;
int main(){
//	freopen("testdata.in","r",stdin);
	scanf("%s",s+1),n=strlen(s+1)+1;
	s[0]='>',s[n]='<';
	fp(i,1,n)a[i]=(s[i-1]=='>'&&s[i]=='<')?0:-1;
	fp(i,1,n)if(a[i]==0){
//		printf("%d %d\n",i,a[i]);
		for(R int j=i+1;j<=n&&s[j-1]=='<';++j)cmax(a[j],a[j-1]+1);
		for(R int j=i-1;j&&s[j]=='>';--j)cmax(a[j],a[j+1]+1);
	}
	fp(i,1,n)res+=a[i];
	printf("%lld\n",res);
	return 0;
}

Measured memory_bytes: 2688
n=int(input())
if n%2:print(0);exit()
d=[10, 50, 250, 1250, 6250, 31250, 156250, 781250, 3906250, 19531250, 97656250, 488281250, 2441406250, 12207031250, 61035156250, 305175781250, 1525878906250, 7629394531250, 38146972656250, 190734863281250, 953674316406250, 4768371582031250, 23841857910156250, 119209289550781250, 596046447753906250, 2980232238769531250]
ans=0
for i in d:
  ans+=n//i
print(ans)

Measured memory_bytes: 3064
import numpy as np
w = input()
abc = np.zeros(26,dtype=int)
for i in range(len(w)):
    if w[i] == "a":
        abc[0] += 1
    if w[i] == "b":
        abc[1] += 1
    if w[i] == "c":
        abc[2] += 1
    if w[i] == "d":
        abc[3] += 1
    if w[i] == "e":
        abc[4] += 1
    if w[i] == "f":
        abc[5] += 1
    if w[i] == "g":
        abc[6] += 1
    if w[i] == "h":
        abc[7] += 1
    if w[i] == "i":
        abc[8] += 1
    if w[i] == "j":
        abc[9] += 1
    if w[i] == "k":
        abc[10] += 1
    if w[i] == "l":
        abc[11] += 1
    if w[i] == "m":
        abc[12] += 1
    if w[i] == "n":
        abc[13] += 1
    if w[i] == "o":
        abc[14] += 1
    if w[i] == "p":
        abc[15] += 1
    if w[i] == "q":
        abc[16] += 1
    if w[i] == "r":
        abc[17] += 1
    if w[i] == "s":
        abc[18] += 1
    if w[i] == "t":
        abc[19] += 1
    if w[i] == "u":
        abc[20] += 1
    if w[i] == "v":
        abc[21] += 1
    if w[i] == "w":
        abc[22] += 1
    if w[i] == "x":
        abc[23] += 1
    if w[i] == "y":
        abc[24] += 1
    if w[i] == "z":
        abc[25] += 1
ans = 0
for i in range(26):
    if abc[i]%2 != 0:
        ans = 1
if ans == 0:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 27100
//I am so vegetable
//#define err
#pragma GCC optimize(2)
#include <bits/stdc++.h>
#define FIO ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define pb push_back
#define in insert
#define er erase
#define ct count
#define ep empty
#define _for(i,a,b) for(int i = (a);i<(b);++i)
#define _rfor(i,a,b) for(int i = (a);i>(b);--i)
#define _sfor(p,st) for(auto &p:st)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9+7;
const double eps = 1e-6;
const double pi = acos(-1.0);
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
ll qpow(ll x, ll y) { ll ans = 1; for (; y > 0; y >>= 1) { if (y & 1)ans *= x; x *= x; }return ans; }
ll qpow(ll x, ll y, int MOD) { ll ans = 1; for (; y > 0; y >>= 1) { if (y & 1)ans = ans*x%MOD; x = x*x%MOD; }return ans; }
void exgcd(ll a,ll b,ll &x,ll &y){
    if(!b){x=1;y=0;return;}
    exgcd(b,a%b,x,y);
    ll X=x;
    x=y; y=X-a/b*y;
}
ll inv(ll x, int mod = MOD) { return qpow(x, mod - 2) % mod; }
ll m_m(ll a){ return (a%MOD+MOD)%MOD; }


int main() {
	//ofstream cout("E:\\acm dream\\out.txt",ios::out);
	FIO;
    #ifdef err
	double be = clock();
    #endif
    int n;cin>>n;
    if(n%1000==0)cout<<0;
  	else cout<<1000-n%1000;
    #ifdef err
	double en = clock();
    cout<<"time: "<<fixed<<setprecision(8)<<en-be;
    #endif
	return 0;
}

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

int main() {
	int A;
	int B;
	int C;
	int K;
	int p;
	int r;

	cin >> A >> B >> C;
	cin >> K;

	p = 0;
	for(int i = 0; i < K + 1; i++) {
		if (A < B) break;
		B = B + B;
		p++;
	}
	if (p > K) {
		cout << "No" << endl;
		return 0;
	}
	r = 0;
	for(int i = 0; i < K - p + 1; i++) {
		if (B < C) break;
		C = C + C;
		r++;
	}
	if (r > (K - p)) {
		cout << "No" << endl;
		return 0;
	}
	cout << "Yes" << endl;
	return 0;
}


Measured memory_bytes: 3636
import java.util.Arrays;
import java.util.Scanner;

public class Main implements Runnable {
	public static void main(String[] args) {
		new Thread(null, new Main(), "", Runtime.getRuntime().maxMemory()).start();
		// new Main().run();
	}

	public void run() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] x = new int[N];
		int[] d = new int[N];// d[i]: = | x[i] - x[i-1] |
		for (int i = 0; i < N; ++i) {
			x[i] = sc.nextInt();
			d[i] = x[i] - (i > 0 ? x[i - 1] : 0);
		}
		int M = sc.nextInt();
		long K = sc.nextLong();
		int[] a = new int[M];
		int[] comb = new int[N];// comb[i]:=i番目の数がcomb[i]に移動
		for (int i = 0; i < N; ++i) {
			comb[i] = i;
		}
		for (int i = 0; i < M; ++i) {
			a[i] = sc.nextInt();
			--a[i];
			// swap[ d[i] , d[i+1] ]
			{
				int tmp = comb[a[i]];
				comb[a[i]] = comb[a[i] + 1];
				comb[a[i] + 1] = tmp;
			}
		}

		int[] cur = new int[N];
		for (int i = 0; i < N; ++i) {
			cur[i] = i;
		}
		for (; K > 0; K >>= 1, comb = mul(comb, comb)) {
			if (K % 2 == 1) {
				cur = mul(cur, comb);
			}
		}
		long L = 0;
		for (int i = 0; i < N; ++i) {
			L += d[cur[i]];
			System.out.println(L);
		}
	}

	int[] mul(int[] ord1, int[] ord2) {
		int n = ord1.length;
		if (ord1.length != ord2.length) {
			throw new AssertionError();
		}
		int[] ret = new int[n];
		for (int i = 0; i < n; ++i) {
			ret[i] = ord1[ord2[i]];
		}
		return ret;
	}

	static void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}
}

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

int M, N;
double P[16][16];

int i, j, k, S;
double win, lose, ans;
double dp[17][1 << 16][16];

int main(void) {
  cin >> M >> N;
  for(i = 0; i < M; i++) for(j = 0; j < N; j++) cin >> P[i][j];

  /* 状態:
   *   dp[i][S][j] =
   *     集合Sのねこをすでに使っていて,
   *     敵iとねこjが戦うときに最善の行動をした場合の確率
   * 基底:
   *   dp[N][S][j] = 1
   *   where S in [0, 1 << N), j in [0, M)
   * 遷移:
   *   dp[i][S][j] = dp[i + 1][S][j] * P[j][i] + max(dp[i][S | (1 << k)][k]) * (1 - P[j][i])
   *   where k not in S
   */

  for(S = 0; S < (1 << M); S++) for(j = 0; j < M; j++) dp[N % 2][S][j] = 1;

  for(i = N - 1; i >= 0; i--) {
    for(S = 0; S < (1 << M); S++) for(j = 0; j < M; j++) dp[i % 2][S][j] = 0;
    for(S = (1 << M) - 1; S >= 0; S--) {
      for(j = 0; j < M; j++) if(S & (1 << j)) {
        win = dp[(i + 1) % 2][S][j] * P[j][i];
        lose = 0;
        for(k = 0; k < M; k++) if(!(S & (1 << k))) {
          lose = max(lose, dp[i % 2][S | (1 << k)][k] * (1 - P[j][i]));
        }
        dp[i % 2][S][j] = max(dp[i % 2][S][j], win + lose);
      }
    }
  }

  ans = 0;
  for(i = 0; i < M; i++) ans = max(ans, dp[0][1 << i][i]);
  printf("%.15lf\n", ans);
}


Measured memory_bytes: 19592
import java.util.Scanner;

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

    int N = scanner.nextInt();
    int A = scanner.nextInt();
    int B = scanner.nextInt();

    int num1 = 0, num2 = 0, num3 = 0;
    for (int i = 0; i < N; i++) {
      int p = scanner.nextInt();
      if (p <= A) num1++;
      else if (p <= B) num2++;
      else num3++;
    }
    System.out.println(Math.min(num1, Math.min(num2, num3)));
  }
}


Measured memory_bytes: 24144
#include "bits/stdc++.h"
using namespace std;
typedef pair<int,int> P;
class Edge
{
	public:
	int to,cost;
	Edge(int t,int c)
	{
		to=t;cost=c;
	}
};
vector<Edge> g[100];
int dist[100][100];//i...始点

void dijk(int s,int mode)
{
	dist[mode][s]=0;
	priority_queue<P,vector<P>,greater<P>> q;
	q.push(P(0,s));
	while(!q.empty())
	{
		P p=q.top();q.pop();
		if(p.first>dist[mode][p.second])
			continue;
		for(int i=0;i<g[p.second].size();i++)
		{
			Edge e=g[p.second][i];
			if(dist[mode][e.to]>dist[mode][p.second]+e.cost)
			{
				dist[mode][e.to]=dist[mode][p.second]+e.cost;
				q.push(P(dist[mode][e.to],e.to));
			}
		}
	}
	return;
}

int main()
{
	int n,m,s,g1,g2;
	while(1)
	{
		cin>>n>>m>>s>>g1>>g2;
		if(n==0)
			break;
		s--;
		g1--;
		g2--;
		for(int i=0;i<100;i++)
			g[i].clear();
		
		fill(dist[0],dist[100],1e8-1);
		for(int i=0;i<m;i++)
		{
			int a,b,c;
			cin>>a>>b>>c;
			a--;b--;
			g[a].push_back(Edge(b,c));
		}
		for(int i=0;i<n;i++)
			dijk(i,i);
		int ans=1e8-1;
		//どこまで共通で通るかを定める
		for(int i=0;i<n;i++)
			ans=min(ans,dist[s][i]+dist[i][g1]+dist[i][g2]);
		cout<<ans<<endl;
	}
	return 0;
}


Measured memory_bytes: 3016
//from PKU1125
#define M 299
double dist[M][M],d;
next[M][M],x[M],y[M];
main(){
	int a,b,k,n,i,j;
	for(;scanf("%d",&n),n;){
		/*initialize*/
		for(i=1;i<=n;i++)scanf("%d",&a),scanf("%d%d",x+a,y+a);
		for(i=1;i<=n;i++)for(j=1;j<=n;next[i][j]=j,j++)
			dist[i][j]=(d=hypot(x[i]-x[j],y[i]-y[j]))<50.1?d:M;

		{/*warshall-floyd*/
			int k,i,j;
			for(k=1;k<=n;k++)
				for(i=1;i<=n;i++)
					for(j=1;j<=n;j++){
						if(dist[i][j]>dist[i][k]+dist[k][j])
							dist[i][j]=dist[i][k]+dist[k][j],next[i][j]=next[i][k];
					}
		}

		{/*query*/
			for(scanf("%d",&k);k;k--){
				scanf("%d%d",&a,&b);
				if(dist[a][b]>=M){puts("NA");continue;}
				for(j=a;j!=b;j=next[j][b])printf("%d ",j);
				printf("%d\n",b);
			}
		}
	}exit(0);
}

Measured memory_bytes: 980
//Daniel Grzegorzewski
#include <bits/stdc++.h>

#define MP make_pair
#define PB push_back
#define ST first
#define ND second
#define int long long

using namespace std;

typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<PII> VII;
typedef long long LL;

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

const int N = (int)1e5 + 10;
const int MOD = 1e9 + 7;

int n, ile[N];

int fpow(int x, int y) {
	if (y == 0)
		return 1;
	if (y&1)
		return (x*fpow(x, y-1))%MOD;
	int res = fpow(x, y/2);
	return (res*res)%MOD;
}

signed main()
{
	init_ios();	
	cin >> n;
	for (int i = 1; i <= n; ++i) {
		int x;
		cin >> x;
		++ile[x];
	}
	if (n%2 == 1) {
		if (ile[0] != 1) {
			cout<<"0\n";
			return 0;
		}
		for (int i = 2; i <= n; i += 2) {
			if (ile[i] != 2) {
				cout<<"0\n";
				return 0;
			}
		}
	}
	else {
		for (int i = 1; i <= n; i += 2) {
			if (ile[i] != 2) {
				cout<<"0\n";
				return 0;
			}
		}
	}
	cout<<fpow(2, n/2)<<"\n";
}

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

using namespace std;

#define debug(n) cerr << #n << ':' << n << endl;
#define dline    cerr << __LINE__ << endl;

using ll = long long;
template<class T, class U> using P = pair<T,U>;
template<class T> using Heap = priority_queue<T>;
template<class T> using heaP = priority_queue<T,vector<T>,greater<T>>;
template<class T,class U> using umap = unordered_map<T,U>;
template<class T> using uset = unordered_set<T>;

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

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

template<class T, size_t N, class U>
void Fill(T (&a)[N], const U&v){
    fill((U*)a,(U*)(a+N),v);
}

template<class T>
istream& operator >> (istream&is, vector<T>&v){
  for(auto&e:v)is >> e;
  return is;
}

int main(){
  int n,m;cin >> n >> m;
  uset<int>ac;
  umap<int,int>wa;
  for(int i = 0; i < m; ++i){
    int p;cin >> p;
    string s; cin >> s;
    if(ac.count(p))continue;
    if(s[0] == 'A') ac.insert(p);
    else wa[p]++;
  }
  P<int,int> ans = {0,0};
  for(auto e:ac){
    ans.first++;
    ans.second += wa[e];
  }
  cout << ans.first << ' ' << ans.second << endl;
  return 0;
}


Measured memory_bytes: 8484
#include<set>
#include<vector>
#include<iostream>
using namespace std;
int main() {
    int n;
    cin >> n;
    vector<int> v;
    set<int> s;
    for (int i = 0; i < n; i++) {
        int a;
        cin >> a;
        if (s.find(a)==s.end()) {v.push_back(a);s.insert(a);}
    }
    int size = v.size();
    for (int i = 0; i < size; i++) {
        cout << v[i];
        if (i!=size-1) cout << " ";
    }
    cout << endl;
    return 0;
}


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

#define MAX 100000

int parent(int i) {return i /2;}

int left(int i) {return 2 *i;}

int right(int i) {return 2 *i+1;}

int main()
{
  int HH, i, O[MAX + 1];
  cin >>  HH;
  for (i=1;i<=HH;i++) cin>>O[i];

  for (i=1;i<=HH;i++)
    {
      cout << "node "<< i << ": key = " << O[i] <<", ";
      if (parent(i) >= 1) cout << "parent key = " << O[parent(i)] << ", ";
      if (left(i) <=HH) cout << "left key = " << O[left(i)] << ", ";
      if (right(i) <= HH) cout << "right key = " << O[right(i)] << ", ";

      cout << endl;

    }
  return 0;
}



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

int main(){
  int n, m; cin >> n >> m;
  vector<int> A(n);
  for(int i = 0; i < n; i++){
    cin >> A.at(i);
  }
  vector<pair<int, int>> BC(m);
  for(int i = 0; i < m; i++){
    int b, c; cin >> b >> c;
    BC.at(i) = {c, b};
  }
  sort(A.begin(), A.end());
  sort(BC.begin(), BC.end());
  int cnt1 = m-1; int cnt2 = 0;
  bool fin = false;
  while(true){
  	int b = BC.at(cnt1).second;
    int c = BC.at(cnt1).first;
    for(int i = cnt2; i < min(n, cnt2 + b); i++){
      if(c > A.at(i)) A.at(i) = c;
      else fin = true;
    }
    if(fin) break;
    if(cnt1 == 0 || cnt2 >= n) break;
    cnt2 += b;
    cnt1--;
  }
  long long ans = 0;
  for(int k: A) ans += k;
  cout << ans << endl;
}


Measured memory_bytes: 1408
#include<iostream>
#include <bits/stdc++.h>
#include <string>
#include <cstring>
#include <algorithm>
using namespace std;

int main() {
	
    string n  ;    
    cin >> n ;
    bool ans = false ;
    for (int i = 0; i < 3; i++){
        if(n[i]=='7'){
            cout << "Yes" << endl ;
            ans = true ;
            break ;
        }
    }
    
    if(!ans) cout << "No" << endl;
    
  	return 0;
}


Measured memory_bytes: 3624
def solve():
    S = input()
    N = len(S)
    l = list(S)
    cond = False
    
    s = list(S[:(N-1)//2])
    t = list(S[(N+3)//2-1:])
    
    if l == list(reversed(l)) and s == list(reversed(s)) and t == list(reversed(t)):
        cond = True
    
    return 'Yes' if cond else 'No'

print(solve())

Measured memory_bytes: 3064
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace AtCoderCS
{
    class Program
    {
        static string Get0040(string[] words)
        {
            for (int a = 0; a < 26; a++)
            {
                for (int b = 0; b < 26; b++)
                {
                    bool thisorthat = false;
                    foreach (string word in words)
                    {
                        if (word.Length == 4)
                        {
                            StringBuilder strb = new StringBuilder();
                            foreach (char c in word)
                            {
                                strb.Append((char)('a' + ((a * (c - 'a') + b) % 26)));
                            }
                            if (strb.ToString().Equals("this") || strb.ToString().Equals("that"))
                            {
                                thisorthat = true;
                                break;
                            }
                        }
                    }
                    if (thisorthat)
                    {
                        StringBuilder ans = new StringBuilder();
                        foreach (string word in words)
                        {
                            StringBuilder strb = new StringBuilder();
                            foreach (char c in word)
                            {
                                strb.Append((char)('a'+((a * (c - 'a') + b) % 26)));
                            }
                            if (ans.Length > 0) ans.Append(' ');
                            ans.Append(strb.ToString());
                        }
                        return ans.ToString();
                    }
                }
            }
            return null;
        }
        
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            for (int i = 0; i < n; i++)
            {
                string[] words = Console.ReadLine().Split(' ');
                Console.Out.WriteLine(Get0040(words));
            }
        }
    }
}

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

#include <cstdio>

using namespace std;


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

	int n, m, d;
	cin >> n >> m >> d;

	double c = double(2 * (n - d)) / double(n);
	if (d == 0) {
		c = 1;
	}

	double l;
	l = (m - 1) * (c / double(n));


	printf("%lf\n", l);
	// cout << l << '\n';


	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
    
    int x,y,s;
    while(scanf("%d %d %d", &x, &y, &s),x||y||s){
        int i,j,max;
        max=0;
        for(i=1;i<s;i++){
            for(j=1;j+i<=s;j++){
                if((i*(100+x))/100+(j*(100+x))/100==s){
                    if(max<(i*(100+y))/100+(j*(100+y))/100){
                        max=(i*(100+y))/100+(j*(100+y))/100;
                    }
                }
            }
        }
        printf("%d\n",max);
    }
    
    return 0;
}

Measured memory_bytes: 600
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int d;
  cin>>d;
  if(d==25)
    cout<<"Christmas";
  else if(d==24)
    cout<<"Christmas Eve";
  else if(d==23)
    cout<<"Christmas Eve Eve";
  else
    cout<<"Christmas Eve Eve Eve";
}

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

int ans[105][105];
int l,c;
int h,w;
void color(int now,int k)
{
    if(k==0)
        return ;
    ans[l][c]=now;
    if(l%2==0&&c==w-1)
        l++;
    else if(l%2==1&&c==0)
        l++;
    else if(l%2==0)
        c++;
    else
        c--;
    //cout<<l<<' '<<c<<endl;
    color(now,k-1);
}

int main()
{
    cin>>h>>w;
    int n;
    scanf("%d",&n);
    l=0,c=0;
    for(int i=1;i<=n;i++)
    {
        int k;
        scanf("%d",&k);
        color(i,k);
    }
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++)
        {
            printf("%d ",ans[i][j]);
        }
        printf("\n");
    }
    //cout << "Hello world!" << endl;
    return 0;
}


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

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

  int A, B, C;
  cin >> A >> B >> C;

  for (int i = 1; i <= B; ++i) {
    if ((i * A) % B == C) {
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}


Measured memory_bytes: 256
S = input()
d = {}

ans = 'Yes'
for i in range(len(S)):
    if S[i] in d:
        d[S[i]] += 1
    else:
        d[S[i]] = 1

    if d[S[i]] > 2:
        ans = 'No'
        break

if len(d) != 2:
    ans = 'No'

print(ans)


Measured memory_bytes: 3060
//----------BHAVIK DIWANI(PICT_COMP)---------------
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define test ll t; cin>>t; while(t--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mod 1000000007
#define ll long long
#define int long long
#define ull unsigned long long
#define MAX 1000005
#define pb push_back
#define mkp make_pair
#define vi vector<int>
#define pii pair<int,int>
#define endl '\n'
#define vs vector<string>
#define mii map<int,int>
#define msi map<string,int>
#define vpii vector< pair<int, int > >
#define vpsi vector< pair< string ,int > >
#define forci(p,q) for(int i=p;i<q;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/gcd(a,b)*b);}
ull power(ull a, ull b) {a %= mod;  ull res = 1;  while (b > 0) { if (b & 1) res = res * a % mod;  a = a * a % mod;  b >>= 1; }  return res%mod; }
ll modmul(ll x, ll y){return (x*y)%mod;}
ll modadd(ll x, ll y){return (x+y)%mod;}
ll modsub(ll x, ll y){return (x-y+mod)%mod;}
ll fact[1000007]={0};
void facto() {fact[0]=1;fact[1]=1;for(int i=2;i<1000007;i++)fact[i]=(fact[i-1]*i)%mod;}
ll ncr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(power(fact[r],mod-2)))%mod; res=(res*(power(fact[n-r],mod-2)))%mod; return res;}
ll npr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(power(fact[n-r],mod-2)))%mod; return res;}
inline long long toint(const std::string &s) {std::stringstream ss; ss << s; long long x; ss >> x; return x;}
inline std::string tostring(long long number) {std::stringstream ss; ss << number; return ss.str();}
inline std::string tobin(long long x) {return std::bitset<63>(x).to_string();}
/*bool prime[MAX];
ull sieve(){memset(prime,true,sizeof(prime));for(ull p=2;p*p<MAX;p++){if(prime[p]==true){for(ull i=2*p;i<MAX;i+=p){prime[i]=false;}}}prime[0]=0;prime[1]=0;
}*/
/*
int inv[1000001]={0};int invf[1000001]={0};
void findinverse(){
	inv[0]=1;
	inv[1] = 1;
	for(int i = 2; i <=1e6 ; ++i)
		inv[i] = (mod - (mod/i) * inv[mod%i] % mod) % mod;
	invf[0]=1;invf[1]=1;
	for(int i=2;i<=1e6;i++){
		invf[i]=invf[i-1]*inv[i]%mod;
	}
}*/
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> orderedSet;
typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> orderedMultiset;
int solve()
{
	int n;
	cin>>n;
	int a[n],b[n];
	for(int i=0;i<n;i++){
		cin>>a[i]>>b[i];
	}
	for(int i=0;i<n;i++){
		if(i+2<n && a[i]==b[i] && a[i+1]==b[i+1] && a[i+2]==b[i+2]){
			cout<<"Yes"<<endl;
			return 0;
		}
	}
	cout<<"No"<<endl;
	return 0;
}
signed main()
{
	fastio;
//	test
		solve();
}



Measured memory_bytes: 3656
#include <cmath>
#include <iostream>
#include <algorithm>
using namespace std;
#define REP(i,n) for(int i = 0; i < n; i++)

int main(void)
{
    int N, X;
    cin >> N >> X;
    int m[N];
    REP(i,N)
    {
        cin >> m[i];
    }

    int sum = 0;
    int minValue = 1 << 30;

    REP(i,N)
    {
        minValue = min(minValue, m[i]);
        sum += m[i];
    }

    cout << N + (X-sum) / minValue <<endl; 


}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <map>
#define ull unsigned long long
#define ll long long
using namespace std;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a,b,k;
    cin >> a >> b >> k;
    vector<int> ans;
    for(int i=a;i<=b;i++){
        if(i<=a+k-1 || i>=b-k+1){
            ans.push_back(i);
        }
    }
    for(int i=0;i<ans.size();i++){
        cout << ans[i] << endl;
    }

    return 0;
}


Measured memory_bytes: 256
/* imports all std modules {{{*/
import
  std.algorithm,
  std.array,
  std.ascii,
  std.base64,
  std.bigint,
  std.bitmanip,
  std.compiler,
  std.complex,
  std.concurrency,
  std.container,
  std.conv,
  std.csv,
  std.datetime,
  std.demangle,
  std.encoding,
  std.exception,
  std.file,
  std.format,
  std.functional,
  std.getopt,
  std.json,
  std.math,
  std.mathspecial,
  std.meta,
  std.mmfile,
  std.net.curl,
  std.net.isemail,
  std.numeric,
  std.parallelism,
  std.path,
  std.process,
  std.random,
  std.range,
  std.regex,
  std.signals,
  std.socket,
  std.stdint,
  std.stdio,
  std.string,
  std.system,
  std.traits,
  std.typecons,
  std.uni,
  std.uri,
  std.utf,
  std.uuid,
  std.variant,
  std.zip,
  std.zlib;
/*}}}*/

/+---test
5 2 4
---+/
/+---test
5 2 3
---+/
/+---test
6 1 6
---+/

void main(string[] args) {
  long N, A, B;
  readf(" %d %d %d ", &N, &A, &B);

  if ((B-A)%2 == 0) {
    ((B-A)/2).writeln;
    return;
  }

  if (B-A == 1) {
    min(B-1, N-A).writeln;
    return;
  }
  (min(N-B, A-1) + 1 + ((B-A-1)/2)).writeln;
}


Measured memory_bytes: 256
import math
chou, tan, ji, hun = map(int,input().split())

kakudo = abs(((ji*30 + hun*.5) - (hun*6)))

if kakudo > 180:
    kakudo = 360 - kakudo

kakudo = abs((math.radians(kakudo)))
ans =( chou**2 + tan**2 - 2*chou*tan*math.cos(kakudo))**.5
print(ans)

Measured memory_bytes: 9416
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;
 
int main() {
    ll n;
    cin >> n;

    ll ans = 0, cntA = 0, Bcnt = 0, BcntA = 0;
    rep(loop, n) {
        string s;
        cin >> s;
        ll m = s.size();
        rep(i, m-1) {
            if(s[i] == 'A' && s[i+1] == 'B') {
                ans++;
            }
        }
        if(s[0] == 'B' && s[m-1] == 'A') {
            BcntA++;
            continue;
        }
        if(s[0] == 'B') {
            Bcnt++;
        }
        if(s[m-1] == 'A') {
            cntA++;
        }
    }

    if(BcntA == 0) {
        ans += min(Bcnt, cntA);
        out(ans);
        re0;
    }

    ans += BcntA - 1;
    if(Bcnt > 0) {
        ans++;
        Bcnt--;
    }
    if(cntA > 0) {
        ans++;
        cntA--;
    }
    
    ans += min(Bcnt, cntA);
    out(ans);
    re0;
}

Measured memory_bytes: 256
import bisect
q = int(input())
LR = (tuple(map(int,input().split())) for i in range(q))
ans = []
sosuu = [2]
A = 100000
for L in range(3, A, 2): # 2 以外の素数は奇数なので
    for L2 in sosuu:
        if L % L2 == 0:
            break # 素数でないことがわかったらそれ以上ループする必要はない
    else: # break で抜けることがなかったら L は素数（Python 特有の制御構文）
        sosuu.append(L)
        if (L+1)/2 in sosuu:
          ans.append(L)
for lr in LR:
  print(bisect.bisect_right(ans,lr[1]) - bisect.bisect_left(ans,lr[0]))

Measured memory_bytes: 77560
#include <stdio.h>

int main(){
  long int n,d;
  scanf("%ld%ld",&n,&d);
  int ans = 0,i=0;
  for(i;i<n;++i){
    long int x,y;
    scanf("%ld%ld",&x,&y);
    if(x*x+y*y<=d*d)ans++;
  }
  printf("%d\n",ans);
  return 0;
}


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

int main(){
    int N; cin >> N;
    string answer;answer = "No";
    for (int i=1;i<=9;i++){
        for(int j=1; j<=9; j++){
            if(i*j ==N){
                answer = "Yes";
            }
        }
    }
    cout << answer << endl;
}

Measured memory_bytes: 256
N = input()

fizz = []
buzz = []
fizzbuzz = []
x = 0

for n in range(1, int(N)+1):
  x += n
  if n % 3 == 0:
    fizz.append(n)
  if n % 5 == 0:
    buzz.append(n)
  if n % 15 == 0:
    fizzbuzz.append(n)

fizz = sum(fizz)
buzz = sum(buzz)
fizzbuzz = sum(fizzbuzz)
y = x - fizz - buzz + fizzbuzz
print(y)

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

#define pi 3.141592654
#define fix(n) cout << fixed << setprecision(n)

#define rep(i,a,b) for(int i=a;i<b;i++)
#define ren(i,a,b) for(int i=a;i>=b;i--)

#define si(d)  scanf("%d",&d)
#define sll(d) scanf("%lld",&d)
#define pin(d) printf("%d\n",d)
#define pln(d) printf("%lld\n",d)
#define nl 	   printf("\n")

#define ll long long
#define ull unsigned long long

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

#define vi vector<int>
#define pii pair<int,int> 
#define piii pair<pair<int,int>,int> 

#define chalne_de continue
int mod=1000000007;
const int N = 1000005;

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

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	//freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
	int n ,m ;
	cin >> n >> m;
	char a[n+3][m+3];
	rep(i,1,n+1)
	{
		rep(j,1,m+1)
		{
		
			cin >> a[i][j];
		}
	}
	rep(i,0,n+2)
	{
		rep(j,0,m+2)
		{
			if ( i == 0 || j == 0 || i == n+1 || j == m+1)
				cout << "#";
			else
			cout << a[i][j];
		}
		cout << endl;
	}

	return 0;
}


Measured memory_bytes: 256
//高知能系Vtuberの高井茅乃です。
//Twitter: https://twitter.com/takaichino
//YouTube: https://www.youtube.com/channel/UCTOxnI3eOI_o1HRgzq-LEZw

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

#define INF 1999999999
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define MODA 1000000007 

int main() {
	int ans = 0;
	int tmp;
	string s;
	cin >> s;
	if (s[0] == s[1] && s[1] == s[2]) cout << "No" << endl;
	else cout << "Yes" << endl;
	
	//cout << ans << endl;
}

Measured memory_bytes: 256
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstring>
#include <iterator>
#include <bitset>
//#include <utility>
//#include <memory>
//#include <functional>
//#include <deque>
//#include <cctype>
//#include <ctime>
//#include <numeric>
//#include <list>
//#include <iomanip>

//#if __cplusplus >= 201103L
//#include <array>
//#include <tuple>
//#include <initializer_list>
//#include <unordered_set>
//#include <unordered_map>
//#include <forward_list>
//
//#define cauto const auto&
//#else

//#endif

using namespace std;


namespace{
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
    v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
    stringstream ss;
    ss << f;
    ss >> t;
}


#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define F first
#define S second
#define mkp make_pair
#define RALL(v) (v).rbegin(),(v).rend()


#define MOD 1000000007LL
#define EPS 1e-8
static const int INF=1<<24;

void mainmain(){
	int c,n,m,d,s;
	while(cin>>c>>n>>m>>s>>d,c||n||m||s||d){
		vvint dp;
		initvv(dp,n,c+1,-1);
		VV(pii) vv(n);
		rep(i,m){
			int a,b,f;
			cin>>a>>b>>f;
			vv[a-1].PB(mkp(b-1,f));
			vv[b-1].PB(mkp(a-1,f));
		}
		priority_queue<pair<int,pii>> pq;
		pq.push(mkp(0,pii(s-1,c)));
		while(!pq.empty()){
			pair<int,pii> top=pq.top();
			pq.pop();
			if(dp[top.S.F][top.S.S]!=-1){
				continue;
			}	
			dp[top.S.F][top.S.S]=-top.F;
			rep(i,vv[top.S.F].size()){
				if(dp[vv[top.S.F][i].F][top.S.S]==-1){
					pq.push(mkp(top.F-vv[top.S.F][i].S,pii(vv[top.S.F][i].F,top.S.S)));
				}
				if(top.S.S>=1&&dp[vv[top.S.F][i].F][top.S.S-1]==-1){
					pq.push(mkp(top.F-vv[top.S.F][i].S/2,pii(vv[top.S.F][i].F,top.S.S-1)));
				}
			}
		}
		int ans=INF;
		rep(i,dp[d-1].size()){
			ans=min(ans,dp[d-1][i]);
		}
		cout<<ans<<endl;
	}
}



}
main() try{
    mainmain();
}
catch(...){
}

Measured memory_bytes: 1336
#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#include<string>
#include<iostream>
#include<vector>
#include<cstdlib>
using namespace std;
 
template <class T> using V = vector<T>;
 
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
 
const long long INF = 1LL << 60;
 
using ll = long long;
using db = double;
using st = string;
using ch = char;
using bl = bool;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
using vbl = V<bl>;

 
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>=(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
  
 

ll sum(ll n) {
ll m=0;
  while(n){
    m+=n%10;
    n/=10;
  }
  return m;
}
 
 
const int MAX = 510000;
const int MOD = 1000000007;
 
long long fac[MAX], finv[MAX], inv[MAX];
 
void Comuse() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
 
 
#define comuse Comuse()
 
ll combi(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
 
 
 
 
ll lcm(ll a,ll b){
  ll n;
  n=a/gcd(a,b)*b;
  return n;
}




 
/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
 
 
signed main() {
  ll n;
    ci(n)
  vll A(n);
  ll ans=0;
  FOR(i,0,n){
    ci(A[i])
  }
  FOR(i,0,n-1){
    if(A[i]>A[i+1]){
      ans+=A[i]-A[i+1];
    }
  }
  ans+=A[n-1];
  co(ans)
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define vi vector<int>
#define pb push_back
#define i197 1000000007
#define MAX_N 200002
using namespace std;

typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<Pii,int> Piii;
typedef pair<int,ll> Pil;
typedef pair<ll,ll> Pll;
typedef pair<string,int> Psi;
typedef pair<Psi,int> Psii;

const int inf=1000000000;
struct edge{
	int myc,to,c,cost;
};
struct pos{
	int to,cost,color;
};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
int f[MAX_N]={};
int b[MAX_N]={};

int main() {
	int n,p;
	string s;

	vector<Psii> v;

	cin>>n;
	rep(i,n){
		cin>>s>>p;
		v.push_back(Psii(Psi(s,100-p),i+1));
	} 
	sort(v.begin(),v.end());
	rep(i,n)cout<<v[i].second<<endl;
	return 0;
}


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

int main() {
	int N, M;
	cin >> N >> M;
	int L, R;
	int left = 1, right = N;
	for (int i = 0; i < M; i++)
	{

		cin >> L >> R;
		left = max(L, left);
		right = min(R, right);
	}

	int ans = max(right - left + 1, 0);

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(a) (a).begin(), (a).end()
#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define RREP(i, n) for(int (i)=(n)-1; (i)>=0; (i)--)
#define ios() cin.tie(0), ios::sync_with_stdio(false)
typedef long long ll;
typedef unsigned long long ull;
ll const MOD = 1e9+7;
ll const INF = 1e18;
using namespace std;

int main(){
    string s;
    cin >> s;
    int n = 0;
    REP(i, s.length()){
        if(s[i] == '0'){
            n++;
        }else{
            n--;
        }
    }
    cout << s.length() - abs(n) << endl;
    return 0;
}

Measured memory_bytes: 512
N = int(input())
ls = []
ls2 = []
for i in range(N):
    ls.append(input())
for i in range(N):
    ls2.append(ls[i][0])
M = ls2.count("M")
A = ls2.count("A")
R = ls2.count("R")
C = ls2.count("C")
H = ls2.count("H")
print(M*A*R+M*A*C+M*A*H+M*R*C+M*R*H+M*C*H+A*R*C+A*R*H+A*C*H+R*C*H)

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

int main(){
    int n;
    cin >> n;
    string s;
    cin >> s;
    for(int i=0; i<s.size(); i++){
        if((int)s[i]+n > 90){
            s[i] = (int)s[i]+n-26; 
        }else{
            s[i] = (int)s[i]+n;
        }
    }
    cout << s << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++)
#define repl(i,n) REPL(i,0,n)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;

int main() {
  string S;
  cin >> S;
  string T = "CODEFESTIVAL2016";
  int cnt = 0;
  rep(i, 16) if(S[i] != T[i]) cnt++;
  cout << cnt << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <stack>
#include <functional>

#ifdef LOCAL
    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
    #define eprintf(...) 42
#endif

#define rep_(i, a_, b_, a, b, ...) for (int i = (a), i##_len = (b); i < i##_len; ++i)
#define rep(i, ...) rep_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define reprev_(i, a_, b_, a, b, ...) for (int i = (b-1), i##_min = (a); i >= i##_min; --i)
#define reprev(i, ...) reprev_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define all(x) (x).begin(), (x).end()
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; }
// template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int,int> P;
typedef long double ld;

int main (void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<ll> a(n); rep (i, n) cin >> a[i];
    map<ll, int> m; rep (i, n) m[a[i]]++;
    vector<ll> k = {0, 0};
    for (auto p : m) {
        eprintf("(%lld,%d)", p.first, p.second);
        if (p.second >= 4) k.push_back(p.first);
        if (p.second >= 2) k.push_back(p.first);
    } eprintf("\n");
    sort(all(k)); reverse(all(k));
    for (ll i : k) eprintf("%d ", i); eprintf("\n");
    cout << k[0] * k[1] << "\n";
    return 0;
}

Measured memory_bytes: 7296
<?php

$stdins = [];
while($line=fgets(STDIN)){
    $stdins[] = trim($line);
}

foreach($stdins as $stdin){
    $S = $stdin;

    $values = explode(" ", $S);
    $A = $values[0];
    $B = $values[1];
    $K = $values[2];
    for($i=$A;$i<min($A+$K, $B);$i++){
        print($i."\n");
    }
    for($i=max($B-$K+1, $i);$i<=$B;$i++){
        print($i."\n");
    }
}


Measured memory_bytes: 3828
#include<bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define Yes cout<<"Yes"<<endl 
#define No cout<<"No"<<endl
#define yes cout<<"yes"<<endl 
#define no cout<<"no"<<endl
#define vec(a,y,x)  vector<vector<char>> a (y,vector<char>(x))
const double PI=3.14159265358979323846;
const in MOD = 1000000007;
const in INF=1e18+7;
const int inf=1e9+7;
const vector<int> dx={1,0,-1,0};
const vector<int> dy={0,1,0,-1};

int main(){
  in A,B,N;
  cin>>A>>B>>N;
  in m=min(B-1,N);
  in ans=(A*m)/B-A*(m/B);
  cout<<ans<<endl;
}

Measured memory_bytes: 3600
#include <stdio.h>

int main()
{
	int val[101] = {0}, val2[100], v, i, max;

	i = 0;
	while(scanf("%d", &v) != EOF){
		val[v]++;

		i++;
	}

	max = 1;
	for(i = 1; i < 101; i++){
		if(max < val[i]) max = val[i];
	}

	for(i = 1; i < 101; i++){
		if(val[i] == max) printf("%d\n", i);
	}

	return 0;
}

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

void fnInput(vector<vector<int>>& rvvnEnjoy)
{
  int nEnjoySiz;
  cin >> nEnjoySiz;
  rvvnEnjoy.resize(nEnjoySiz, vector<int>(3));

  for (int i = 0; i < nEnjoySiz; i++)
    cin >> rvvnEnjoy[i][0] >> rvvnEnjoy[i][1] >> rvvnEnjoy[i][2];
}
  
int fnDPHappy(const vector<vector<int>>& cnrvvnEnjoy)
{
  vector<vector<int>> vvnDPHappy(cnrvvnEnjoy.size() + 1, vector<int>(cnrvvnEnjoy[0].size()));

  for (int i = 0; i < vvnDPHappy.size() - 1; i++)
    for (int j = 0; j < vvnDPHappy[i].size(); j++)
      for (int k = 0; k < vvnDPHappy[i].size(); k++)
        if (j != k)
          vvnDPHappy[i + 1][k] = max(vvnDPHappy[i + 1][k], vvnDPHappy[i][j] + cnrvvnEnjoy[i][k]);

  int nMaxHappy = 0;
  int nLastDay = vvnDPHappy.size() - 1;

  for (int j = 0; j < vvnDPHappy[nLastDay].size(); j++)
    nMaxHappy = max(nMaxHappy, vvnDPHappy[nLastDay][j]);

  return nMaxHappy;
}
  
int main()
{
  vector<vector<int>> vvnEnjoy;
  fnInput(vvnEnjoy);
  cout << fnDPHappy(vvnEnjoy) << endl;

  return 0;
}

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

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int k;
    int ans;
    ans = 0;
    cin >> k;
    for(int i = 1; i < k+1; i++){
        for(int j = 1; j < k+1; j++){
            for(int l = 1; l < k+1; l++){
                ans += gcd(gcd(i,j),l);
            }
        }
    }
    cout << ans << endl;
}

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

vector<int> A={1,4,8,9,16,16,25,27,32,36,49,64,64,64,81,81,100,
 121,125,128,144,169,196,216,225,243,256,256,256,
 289,324,343,361,400,441,484,512,512,529,576,625,
 625,676,729,729,729,784,841,900,961,1000,1024,
 1024,1024,1089};

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

    for(int i=0;i<(int)A.size();i++){
        if(A[i]==n){
            cout << A[i] << endl;
        }else{
            if(n>A[i] && n<A[i+1]){
                cout << A[i] << endl;
                
            }
        }
    }

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#define MAXM 3000
#define MAXN 3000
using std::cout;
using std::cin;
typedef long long ll;
const int mod=1E9+7;
inline ll expow(ll a,int x){
	ll ret=1;
	while(x){
		if(x&1) ret=(ret*a)%mod;
		a=(a*a)%mod;
		x>>=1;
	}
	return ret;
}
ll f[2][MAXN+10][2];
inline void ModAdd(ll &x,ll delta){
	x+=delta%mod;
	while(x>=mod) x-=mod;
	if(x<0) x+=mod; 
}
int main(){
	int n,m;ll ans=0;
	cin>>n>>m;
	/*
	if(n==1) return cout<<expow(2,m),0;
	if(n>=m) return cout<<expow(2,2*m),0;
	*/
	if (n == 1)
    {
        ans = 2;
        for (int i = 1; i <= m; i++)
            ans = ans * 2 % mod;
        cout << ans; return 0;
	}else if(n>=m){
		ans=2;
		for(int i=1;i<2*m;i++) ans = ans*2%mod;
		cout << ans; return 0;
	}
	//BR&RB B   R   2 j   -> j
	//BB    B-- R++ 1 j-1 -> j
	//RR    R-- B-- 1 j+1 -> j
	int cur=0;f[cur][0][1]=1;
	for(int i=1;i<=n;i++) f[cur][i][0]=1;
	for(int i=1;i<=m;i++){// i-th times (1~m) last j blocks of R(1~n) R=0 exist or not (Minimum representation)
		cur^=1;                                     /*R->0*/ 
		f[cur][0][1]=(f[cur^1][0][1]+f[cur^1][1][1]+f[cur^1][1][0])%mod; 
		
		f[cur][1][0]=(f[cur^1][1][0]+f[cur^1][2][0])%mod;              /*R->0*/ 
		f[cur][1][1]=(f[cur^1][0][1]+2LL*f[cur^1][1][1]+f[cur^1][2][1]+f[cur^1][1][0])%mod; 
		
		for(int j=2;j<n;j++){
			f[cur][j][0]=(f[cur^1][j-1][0]+2LL*f[cur^1][j][0]+f[cur^1][j+1][0])%mod;
			f[cur][j][1]=(f[cur^1][j-1][1]+2LL*f[cur^1][j][1]+f[cur^1][j+1][1])%mod;
		}
		
		f[cur][n][0]=(f[cur^1][n-1][0]+f[cur^1][n][0])%mod;
		f[cur][n][1]=(f[cur^1][n-1][1]+f[cur^1][n][1])%mod;
	}
	for(int i=0;i<=n;i++) ModAdd(ans,f[cur][i][1]);
	cout<<ans;
	return 0;
}

Measured memory_bytes: 384
n, k = map(int, input().split())

MOD = 10 ** 9 + 7

class ModCmb:
    def __init__(self, size):
        self.inv = [1] * (size + 1)
        self.fact = [1] * (size + 1)
        temp_inv = [1] * (size + 1)
        for i in range(2, size + 1):
            temp_inv[i] = ( -(MOD // i) * temp_inv[MOD%i] ) % MOD
        for i in range(2, size + 1):
            self.fact[i] = self.fact[i-1] * i % MOD
            self.inv[i] = self.inv[i-1] * temp_inv[i] % MOD

    def cmb(self, n, r):
        if n <= 1 or n == r:
            return 1
        elif r == 1:
            return n
        else:
            return  (self.fact[n] * self.inv[r] % MOD ) * self.inv[n-r] % MOD

cmb = ModCmb(n)

for i in range(1, k+1):
    if i > n-k+1:
        print(0)
    else:
        print((cmb.cmb(n-k+1,i) * cmb.cmb(k-1,i-1))%MOD)

Measured memory_bytes: 3572
def main():
    import numpy as np
    from bisect import bisect_left,bisect_right
    n,k=map(int,input().split())
    A=list(map(int,input().split()))
    A=np.array(A)
    A=np.sort(A)
    Ap=A[A>0]
    Az=A[A==0]
    Am=A[A<0]   
    lm,lz,lp=len(Am),len(Az),len(Ap)
    Am2=Am**2
    Ap2=Ap**2
    #print(Ap,Am,Az,Ap2,Am2)
    def cnt_product(x): #ある数字の組であってその積がx以下となるものの数
        if x<0:
            X=np.searchsorted(Am,x//Ap,side='right')
            #print(X)
            return X.sum()
        
        else:
            ans=lz*(n-lz)+lz*(lz-1)//2+lp*lm

            X=np.searchsorted(Ap,x//Ap,side='right')
            Xd=np.count_nonzero(Ap2<=x)

            Y=np.searchsorted(Am,(-x-1)//(-Am),side='right')
            Yd=np.count_nonzero(Am2<=x)
            
            ans+=(X.sum()-Xd+lm**2-Y.sum()-Yd)//2
            return ans

    left=-10**18
    right=10**18
    while right-left>1:
        mid=(left+right)//2
        if cnt_product(mid)<k:
            left=mid
        else:
            right=mid
    print(right)

if __name__=='__main__':
    main()

Measured memory_bytes: 32320
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define ALL(v) (v).begin(), (v).end()

using namespace std;
using ll = long long;

ll N;

int dfs(ll n, bool has3, bool has5, bool has7) {
  if (n > N) return 0;

  n *= 10;
  int ret = (has3 and has5 and has7);
  ret += dfs(n+3, true, has5, has7);
  ret += dfs(n+5, has3, true, has7);
  ret += dfs(n+7, has3, has5, true);

  return ret;
}

int main()
{
  cin >> N;
  int ans = dfs(0, false, false, false);

  cout << ans << endl;
}

Measured memory_bytes: 256
#include<stdio.h>

int main() {
   int a, b;
   int getcoin = 0;
   int cnt = 2;
   scanf("%d %d", &a, &b);

   for(int i = 0; i < cnt; i++) {
      if(a >= b) {
         getcoin += a;
         a--;
      }
      else {
         getcoin += b;
         b--;
      }
   }

   printf("%d\n", getcoin);
   return 0;
}

Measured memory_bytes: 128