akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;

class Main
{

	public static void main(String[] args) 
	{
		Scanner scan = new Scanner(System.in);
		int value = scan.nextInt();
		int a = value;
		value = scan.nextInt();
		int b = value;
		
		if(a>b)
		{
			System.out.println("a > b");
		}
		else if(a<b)
		{
			System.out.println("a < b");
		}
		if(a==b)
		{
			System.out.println("a == b");
		}

	}

}



Measured memory_bytes: 26224
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <numeric>
#include <cassert>
#include <vector>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<P,int> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-8;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

ll Pow(ll n,ll p){
	ll r=1;
	for(;p>0;p>>=1){
		if(p&1) r=(r*n)%mod;
		n=(n*n)%mod;
	}
	return r;
}

const int M=100005;
ll F[M];

void Init(){
	F[0]=1;
	for(int i=1;i<M;i++) F[i]=F[i-1]*i%mod;
}

ll Div(ll n,ll m){
	return n*Pow(m,mod-2)%mod;
}

ll nCk(ll n,ll k){
	return Div(F[n],F[n-k]*F[k]%mod);
}

int n;

int main(){
	cin>>n;
	cout<<(Pow(10,n)-Pow(9,n)*2+Pow(8,n)+mod*2)%mod<<endl;
}

Measured memory_bytes: 3612
S=[ord(i)-97 for i in list(input())]
K=int(input())
N=len(S)
T=[chr(S[i]+97) for i in range(N)]
for i in range(N):
    if K>=(26-S[i]):
        K-=(26-S[i])%26
        T[i]='a'
        S[i]=0
    else:
        continue
S[-1]=(S[-1]+K)%26
T[-1]=chr(S[-1]+97)
ans=""
for i in range(N):
    ans=ans+T[i]
print(ans)


Measured memory_bytes: 4928
n,k = map(int,input().split())
a = list(map(int,input().split()))

t = 1
tl = [1]
ts = {1}
for i in range(len(a)):

    t = a[t-1]
    if t in ts:
        break
    else:
        tl.append(t)
        ts.add(t)

tl2 = tl[tl.index(t):len(tl)]


if k < len(tl):
    ans = tl[k]
else:
    k = k - (len(tl) - len(tl2))
    j = k % len(tl2)
    ans = tl2[j]

print(ans)

Measured memory_bytes: 32272
#include<bits/stdc++.h>
#define rep(i,N) for(ll (i)=0;(i)<(N);(i)++)
#define chmax(x,y) x=max(x,y)
#define chmin(x,y) x=min(x,y)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int mod = 1000000007;

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

Measured memory_bytes: 384
package main

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

const (
	initialBufSize = 1e4
	maxBufSize     = 1e6 + 7
)

var buf []byte = make([]byte, maxBufSize)
var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(buf, maxBufSize)
}

// 排他的論理和（XOR）の練習
// a^a = 0とか、交換法則が成り立つとか、a^0 = aとか。

func main() {
	N := nextInt()
	an := make([]int, N)
	ans := make([]uint, N)
	var xorall uint
	for i := range an {
		an[i] = nextInt()
		xorall ^= uint(an[i])
	}
	for i := 0; i < N; i++ {
		ans[i] = xorall ^ uint(an[i])
	}
	fmt.Println(strings.Trim(fmt.Sprint(ans), "[]"))
}

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func abs(a int) int {
	if a > 0 {
		return a
	} else {
		return -a
	}
}

func pow(p, q int) int {
	res := p
	if q == 0 {
		return 1
	}
	for i := 0; i < q-1; i++ {
		res *= p
	}
	return res
}

func MinOf(vars ...int) int {
	min := vars[0]
	for _, i := range vars {
		if min > i {
			min = i
		}
	}
	return min
}

func MaxOf(vars ...int) int {
	max := vars[0]
	for _, i := range vars {
		if max < i {
			max = i
		}
	}
	return max
}

func gcdof2numbers(a int, b int) int {
	if b == 0 {
		return a
	}
	return gcdof2numbers(b, a%b)
}

func lcmof2numbers(a int, b int) int {
	return a / gcdof2numbers(a, b) * b
}

// マイナスの場合は考慮していない
func fuctorial(a int) int {
	if a == 1 || a == 0 {
		return 1
	} else {
		return fuctorial(a-1) * a
	}
}

func NextPermutation(x sort.Interface) bool {
	n := x.Len() - 1
	if n < 1 {
		return false
	}
	j := n - 1
	for ; !x.Less(j, j+1); j-- {
		if j == 0 {
			return false
		}
	}
	l := n
	for !x.Less(j, l) {
		l--
	}
	x.Swap(j, l)
	for k, l := j+1, n; k < l; {
		x.Swap(k, l)
		k++
		l--
	}
	return true
}

// 素因数分解したmapを返す
func primeFuctorize(n int) map[int]int {
	pf := map[int]int{}
	for i := 2; i*i <= n; i++ {
		for n%i == 0 {
			pf[i]++
			n /= i
		}
	}
	if n != 1 {
		pf[n]++
	}
	return pf
}


Measured memory_bytes: 18972
#include <stdio.h>
#include <stdlib.h>
int puz[4][4];
int temp[4][4];
int dx[4]={0,1,0,-1}; 
int dy[4]={1,0,-1,0}; 
void empty(int x[],int y[])
{
  int i,j;
  for(i=0;i<4;i++) 
  {
    for(j=0;j<4;j++) 
    {
      if(puz[i][j]==0) 
      {
        *x = j;
        *y = i;
        return;
      }
    }
  }
}
void swap(int a[],int b[])
{
  int temp;
  temp=*a;
  *a=*b;
  *b=temp;
}
int cal(){
  int i,a,sum=0;
  for(i=0; i<16; i++){
    a = puz[i/4][i%4];
    if(a!=0)
    {
      a=a-1;
      sum = sum + abs((i/4)-(a/4))+abs((i%4)-(a%4));
    }
  }
  return sum;
}
int dfs(int x,int y,int p,int dep, int lim) 
{
  int i,h,x2,y2,res;
  h=cal();
  if(h==0) return dep;
  if(dep+h>lim) return -1;
  for(i=0;i<4;i++)
  {
    x2=x+dx[i];  
    y2=y+dy[i];
    if(~p && i==(p+2)%4) //////
        continue;
    if(!(0<=x2 && x2<4 && 0<=y2 && y2<4)) 
        continue;
    swap(&puz[y][x],&puz[y2][x2]);
    res = dfs(x2,y2,i,dep+1,lim);
    if(~res) 
        return res;
    swap(&puz[y][x],&puz[y2][x2]);
  }
  return -1;
}
int main() {
  int i,j,ans,x,y,l;
  for(i=0;i<4;i++){
    for(j=0;j<4;j++)
    {
        scanf("%d",&puz[i][j]);
        temp[i][j]= puz[i][j];
    }  
  }
  empty(&x,&y);
  
  for(l=0;l<100;l++)
  {
    ans=dfs(x,y,-1,0,l);
    if(ans!=-1)
    {
      printf("%d\n",ans);
      break;
    }
  
    ans = -1;  
    if(l==99) 
        printf("%d\n",ans);
  }
  return 0;
}



Measured memory_bytes: 2108
from scipy.misc import comb
mod = 10 ** 9 + 7
n, k = map(int, input().split())

for i in range(k):
	blue_place = comb(n-k+1,i+1,exact=True) #赤の間i箇所に青を入れる（=赤の個数+1）
	blue_inner  = comb(k-1,i,exact=True) #青の並べ方
	print(blue_place*blue_inner%mod)

Measured memory_bytes: 18392
#include <iostream>
#include <vector>
#include <set>
using namespace std;

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

    vector<long> idx(N + 1);
    for (long long i = 1; i <= N; i++) {
        long long a;
        cin >> a;
        idx[a] = i;
    }

    long long res = 0;
    set<long long> st = {0, N + 1};
    for (long long i = 1; i <= N; i++) {
        auto itr = st.lower_bound(idx[i]);
        long long right = *itr;
        long long left = *(--itr);
        res += i * (idx[i] - left) * (right - idx[i]);
        st.insert(idx[i]);
    }

    cout << res << "\n";
    return 0;
}

Measured memory_bytes: 11136
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
inline char tc(void){
	static char fl[10000],*A=fl,*B=fl;
	return A==B&&(B=(A=fl)+fread(fl,1,10000,stdin),A==B)?EOF:*A++;
}
inline int read(void){
	int a=0;char c;
	while((c=tc())<'0'||c>'9');
	while(c>='0'&&c<='9')a=a*10+c-'0',c=tc();
	return a;
}
int n,a[200005],b[200005],c[200005],d[200005],ans,t;
long long sum;
int main(void){
	register int i,j;
	n=read();
	for(i=1;i<=n;++i)a[i]=read();
	for(i=1;i<=n;++i)b[i]=read();
	for(i=0;i<=28;++i){
		sum=0,t=1<<i;
		for(j=1;j<=n;++j)c[j]=a[j]%(1<<i+1),d[j]=b[j]%(1<<i+1);
		sort(c+1,c+n+1),sort(d+1,d+n+1);
		for(j=1;j<=n;++j)
			sum=(sum+(lower_bound(d+1,d+n+1,2*t-c[j])-d)+(lower_bound(d+1,d+n+1,4*t-c[j])-d)-(lower_bound(d+1,d+n+1,3*t-c[j])-d)-(lower_bound(d+1,d+n+1,1*t-c[j])-d))&1;
		if(sum&1)ans+=t;	
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 3328
import java.io.*;
import java.util.*;
import java.util.function.*;

final class Solver {
	static final Solver INSTANCE = new Solver();

	void solve(Supplier<String> sc) {
		int K = Integer.parseInt(sc.get());
		int A = Integer.parseInt(sc.get());
		int B = Integer.parseInt(sc.get());
		var b = B / K;
		var a = (A - 1) / K;
		System.out.println(b - a > 0 ? "OK" : "NG");
	}
}

class Main {
	public static void main(String... args) {
		var reader = new BufferedReader(new InputStreamReader(System.in));
		Solver.INSTANCE.solve(new Supplier<>() {
			StringTokenizer line;

			public String get() {
				while (line == null || !line.hasMoreTokens()) try {
					line = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
				return line.nextToken();
			}
		});
	}
}

Measured memory_bytes: 32644
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //これつけるとA[N]でもいいらしい
//for文のマクロ
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define big 1000000007
#define all(a) sort((a).begin(),(a).end()) //ソートのマクロ
#define Re(a) reverse((a).begin(),(a).end())
int main(){
    int n;
    int k;
    cin>>n>>k;
    //int l = n.length();
    vector<int> d(k);
    rep(i,k){
        cin>>d[i];
    }
    bool hate = true;
    while(hate){
        hate = false;
        string s = to_string(n);
        int l = s.length();
        bool roop = false;
        for(int i=0;i<l;i++){
            rep(j,k){
                if(s[i]==d[j]+'0'){
                    hate = true;
                    n++;
                    roop = true;
                    break;
                }
            }
            if(roop){
                break;
            }
        }
    }
    cout<<n<<endl;
}

Measured memory_bytes: 256
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <chrono>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#include <sstream>
#include <cassert>
#include <tuple>
#include <iomanip>
#include <random>
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <fstream>
#include <unordered_map>

#define ll long long

using namespace std;

const int MINN = 2001;
const int maxn = (int) 2e5 + 100;
const int inf = 1e9 + 7;

vector < int > g[maxn];
vector < pair < int, int > > last;
int n, u[maxn], p[maxn];

vector < int > gv;

string s;

int k;

int dp[maxn][13];

int main(){
    cin >> s;
    dp[0][0] = 1;
    s = '#' + s;
    n = (int)s.size();
    for(int i = 1; i < n; i++){
        if(s[i] == '?'){
            for(int j = 0; j < 10; j++){
                for(int k = 0; k < 13; k++){
                    dp[i][(k * 10 + j) % 13] += dp[i - 1][k];
                    dp[i][(k * 10 + j) % 13] %= inf;
                }
            }
        }
        else{
            int now = s[i] - '0';
            for(int k = 0; k < 13; k++){
                dp[i][(k * 10 + now) % 13] += dp[i - 1][k];
                dp[i][(k * 10 + now) % 13] %= inf;
            }
        }
    }
    cout << dp[n - 1][5];
    return 0;
}

Measured memory_bytes: 14844
#include <iostream>
#include <array>
#include <algorithm>
#include <vector>
#include <set>
#include <unordered_set>
#include <cmath>
#include <complex>
#include <deque>
#include <iterator>
#include <numeric>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define rep(i, k, n) for (ll i=k; i<(ll)n; ++i)
#define REP(i, n) rep(i, 0, n)
#define ALL(v) v.begin(),v.end()
template<class T> inline bool chmax(T& a, T b) {if (a<b) {a=b; return true;} return false;}
template<class T> inline bool chmin(T& a, T b) {if (a>b) {a=b; return true;} return false;}

const ll MOD = 1000000007;
const ll HIGHINF = (ll)1e18;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n; cin >> n;
    vll h(n); REP(i, n) cin >> h[i];
    vll dp(n, 0);
    dp[1] = abs(h[1]-h[0]);
    rep(i, 2, n) dp[i] = min(dp[i-2] + abs(h[i]-h[i-2]), dp[i-1]+abs(h[i]-h[i-1]));
    cout << dp[n-1] << '\n';
    return 0;
}


Measured memory_bytes: 1792
let () =
	let n = Scanf.scanf "%d\n" (fun x -> x) in
	let v = Array.to_list (Array.init n (fun _ -> Scanf.scanf "%d " (fun x -> x))) in
	let  c = Array.to_list (Array.init n (fun _ -> Scanf.scanf "%d " (fun x -> x))) in
	let sabun = List.map2 (fun a b -> a -b) v c in
	List.fold_left (fun a b -> if b > 0 then a + b else a) 0 sabun
	|> print_int


Measured memory_bytes: 384
# AOJ 0226: Hit and Blow
# Python3 2018.6.25 bal4u
 
while 1:
    r, a = input().split()
    if r == '0': break
    h = 0
    for i in range(4):
        if r[i] == a[i]: h += 1
    print(h, len(set(r) & set(a))-h)


Measured memory_bytes: 5572
#pragma region template 2.4
#include <bits/stdc++.h>
using namespace std;
template <typename T>
using pq_asc = priority_queue<T, vector<T>, greater<T>>;
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> ii;
typedef vector<ii> vii;
typedef vector<string> vs;
#define REP(i, n) for (ll i = 0; i < (n); ++i)
#define REP1(i, n) for (ll i = 1; i <= (n); ++i)
#define FOR(i, a) for (auto &i : a)
#define CH(f, x, y) x = f(x, y)
#define IN(T, x) \
    T x;         \
    cin >> x;
#define AIN(T, a, n) \
    vector<T> a(n);  \
    FOR(i, a)        \
    cin >> i;
#define A2IN(T1, a, T2, b, n) \
    vector<T1> a(n);          \
    vector<T2> b(n);          \
    REP(i, n)                 \
    cin >> a[i] >> b[i];
#define OUT(x) cout << (x) << endl;
#define FOUT(x) cout << fixed << setprecision(15) << (x) << endl;
#define ALL(a) (a).begin(), (a).end()
#define SORT(a) sort(ALL(a))
#define RSORT(a) \
    SORT(a);     \
    reverse(ALL(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define DUMPA(a)          \
    cout << #a << " = {"; \
    JOUT(ALL(a), cout, ", ") << "}" << endl;

template <typename T>
ostream &JOUT(T s, T e, ostream &os = cout, string sep = " ")
{
    if (s != e)
    {
        os << *s;
        ++s;
    }
    while (s != e)
    {
        os << sep << *s;
        ++s;
    }
    return os;
}

ostream &YES(bool cond, string yes = "Yes", string no = "No", ostream &os = cout)
{
    if (cond)
    {
        os << yes << endl;
    }
    else
    {
        os << no << endl;
    }
    return os;
}

template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p)
{
    os << '(' << p.first << ", " << p.second << ')';
    return os;
}

template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v)
{
    os << '[';
    JOUT(ALL(v), os, ", ") << ']';
    return os;
}

const ll INF = 1e18;
const ll MOD = 1e9 + 7;
#pragma endregion template

int main()
{
    IN(ll, H);
    IN(ll, W);
    AIN(string, A, H);
    ll s = 0;
    FOR(r, A)
    {
        FOR(c, r)
        {
            s += c == '#';
        }
    }
    YES(s == H + W - 1, "Possible", "Impossible");
}

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
char s[200010];
bool v[3][3][3];
const int mod=998244353;
int f[200010][3][3][2],n,mo,p,ans,tot=1,q1[100],q2[100],q3[100];
bool vis[200010][3][3][2]; 
int dp(int len,int sum,int pre,int tag)
{
	if (len>n) return (sum==mo&&tag);
	if (vis[len][sum][pre][tag]) return f[len][sum][pre][tag];
	vis[len][sum][pre][tag]=1;
	int S=0;
	for (int i=0;i<3;i++)
	{
		S+=dp(len+1,(sum+i)%3,i,tag|(i==pre));
		if (S>=mod) S-=mod;
	}
	return f[len][sum][pre][tag]=S;
}
int main()
{
	scanf("%s",s+1);n=strlen(s+1);p=1;
	for (int i=1;i<=n;i++) {if (s[i]==s[i-1]) p=0;else tot--;mo+=s[i]-'a';}
	if (tot==0) {printf("1");return 0;}
	if (n==2) {printf("2");return 0;}
	if (n==3)
	{
		int h=0,t=0;
		q1[++t]=s[1]-'a';q2[t]=s[2]-'a';q3[t]=s[3]-'a';
		v[q1[t]][q2[t]][q3[t]]=1;
		int n1=0,n2=0,n3=0;
		while (h<t)
		{
			h++;
			if (q1[h]!=q2[h])
				for (int i=0;i<=2;i++) if (i!=q1[h]&&i!=q2[h])
				{
					n1=i,n2=i,n3=q3[h];
					if (!v[n1][n2][n3]) v[n1][n2][n3]=1,q1[++t]=n1,q2[t]=n2,q3[t]=n3;
				}
			if (q3[h]!=q2[h])
				for (int i=0;i<=2;i++) if (i!=q3[h]&&i!=q2[h])
				{
					n3=i,n2=i,n1=q1[h];
					if (!v[n1][n2][n3]) v[n1][n2][n3]=1,q1[++t]=n1,q2[t]=n2,q3[t]=n3;
				}
		}
		printf("%d",t);
		return 0;
	}
	mo%=3;
	for (int i=0;i<3;i++){ans+=dp(2,i,i,0);if (ans>=mod) ans-=mod;}
	ans+=p;
	printf("%d",ans);
} 

Measured memory_bytes: 36736
//k_tourist
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
#include<bits/stdc++.h>
#define mod 1000000007
#define ll long long
#define mx 500005
#define non __builtin_popcount
#define ml map<ll, ll> 
#define uml unordered_map<ll, ll>
#define ms map<string , ll> 
#define all(a) (a).begin(),(a).end()
#define ff first
#define ss second
#define pl pair<ll, ll>
#define vl vector<ll>
#define vll vector<pl>
#define tpl pair<ll, pl>
#define vlll vector<tpl>
#define vs vector<string>
#define pb push_back
#define mk make_pair
#define M_PI 3.14159265358979323846
#define endl '\n'
#define fst ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define si(x) scanf("%d",&x)
#define sl(x) scanf("%I64d",&x)
#define inf ((ll)1e18 + 1)
#define bs binary_search
#define pq priority_queue
#define ub upper_bound
#define lb lower_bound
#define pow powr
#define sp(a) setprecision(a)
#define rep(i,a,b)  for (i=(a);i<(b);i++)
#define nrep(i,a,b) for (i=(a);i>(b);i--)
using namespace std;
using namespace __gnu_pbds;  

typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>  ordered_set;
 
ll powr(ll a,ll b)
{
	ll res=1;
	while(b)
	{
		if(b&1)res=(res*a)%mod;
		a=(a*a)%mod;
		b>>=1;
	}
	return res;
}

void flag(ll fl){

	if(fl)
	cout<<"NO";
	else
	cout<<"YES";
}


vl gr[mx];
ll vis[mx], lev[mx];

void bfs(ll nd){

    lev[nd]= 0;

    queue<ll> q;

    q.push(nd);
    vis[nd]= 1;

    while(!q.empty()){



        nd= q.front();

        q.pop();

        // if(vis[nd])
        // continue;
        // vis[nd] = 1;

        // q.pop();

        for(ll ch : gr[nd]){

            if(!vis[ch]){

                lev[ch]= lev[nd] +1;
                q.push(ch);

                vis[ch]= 1;

            }
        }
    }

}

void graph(ll n, ll m){

    ll i, j;

    rep(i, 1, n+1)
    {
        vis[i]= 0;
        gr[i].clear();
    }

    rep(i, 1, n){

        gr[i].pb(i+1);
        gr[i+1].pb(i);
    }
}

ll ann[mx];

void bta_de_yarr(){

	ll n, i, j, m, ans, x, y;

    cin>>n>>x>>y;

    graph(n, n-1);

    gr[x].pb(y);
    gr[y].pb(x);

    // rep(i, 1, n+1)
    // {
    //     vis[i]= 0;
    //     // gr[i].clear();
    //     lev[i] = 0;
    // }

    rep(i, 1, n+1){

        rep(j, 1, n+1){
            vis[j]= 0;
            lev[j]= 0;
        }

        bfs(i);

        // rep(j, 1, n+1)
        // cout<<lev[j]<<" ";

        // cout<<endl;

        rep(j, 1, n+1)
        ann[lev[j]]++;
    }

    rep(i, 1, n){
        ann[i]/=2;
        cout<<ann[i]<<endl;
    }



	// cout<<ans;
	// flag(fl);
	//cout<<endl;
}

int main(){
    fst

	// freopen("input.txt","r",stdin);
    // freopen("output.txt","w",stdout);
	ll t, i;
    t= 1;
	// cin>>t;
    
    rep(i, 1, t+1){

        // cout<<"Case #"<<i<<":"<<" ";
        bta_de_yarr();
    }
    return 0;
}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<bool> VB;
typedef vector<double> VD;
typedef vector<string> VS;
typedef vector<char> VC;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a)*(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define LB lower_bound
#define UB upper_bound

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL INF = 1e9;
const LL MOD = 1e9+7;

//other
//-------------------------------------------
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define FI first
#define SE second

//memo
// setprecision()

int main() {
  int N,minA=INF,ans=0;
  cin >> N;
  VI P(N);
  REP(i,N) {
    cin >> P.at(i);
  }
  REP(i,N){
    chmin(minA,P.at(i));
    
    if(P.at(i)<=minA)ans++;
//    cout << ans << endl;
  }
  
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define fr freopen("in.txt","r",stdin);freopen("out.txt","w",stdout);
long long int arr[100000+5],dp[100000+5],n,k;
int main(){
	//fr
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cin >> n >> k;
	for(int i=1; i<=n; i++){
		cin >> arr[i];
	}
	for(int i=0; i<100000+5; i++){
		dp[i]=999999999999;
	}
	dp[1]=0;
	dp[2]=abs(arr[2]-arr[1]);
	for(int i=1; i<=n; i++){
		for(int j=1; j<=k; j++){
			if(i+j<=n){
				dp[i+j]=min(dp[i+j],dp[i]+abs(arr[i]-arr[i+j]));
			}
			else{
				break;
			}
		}
	}
	cout << dp[n];
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int P = 1e9+7;
const int N = 4010;
int n,m,k,ans;
int f[N][N],g[N][N];
inline void add(int &x,int y){x=(x+y)%P;}
int main(){
	scanf("%d%d%d",&n,&m,&k);
	f[0][0]=1;
	for(int i=1;i<N;i++){
		int t = 0;
		for(int j=0;j<N;j++){
			// f[i-1][k] k>=j-K, k<=j
			add(t,f[i-1][j]);
			if(j-k>=0) add(t,-f[i-1][j-k]);
			add(f[i][j],t);
		}
	}
	for(int i=1;i<N;i++){
		int t = 0;
		for(int j=1;j<N;j++){
			// f[i-1][k] k>=j-K, k<=j
			add(t,f[i-1][j-1]);
			if(j-k>=0) add(t,-f[i-1][j-k]);
			add(g[i][j],t);
		}
	}
	//cout<<g[3][2]<<endl;
	for(int w = 1;w*(k-1)<=n+m-1;w++){
		int t = n%(k-1);
		for(int i=0;1;i++){
			int n2 = i*(k-1)+t;
			if(n2>n) break;
			if((k-1)*w-n2+1>m) continue;
			add(ans,g[w][n2]);
		}
	}
	ans = (ans+P)%P;
	printf("%d\n",ans);
	return 0;
}

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

#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))

typedef long long LL;

int main(){
  int n;
  string s;
  int len[5]={5,7,5,7,7};
  int count;
  int now;
  int ans;
  while(1){
    cin >> n;
    if(n==0) return 0;
    vector<int> w(n);
    for(int i=0;i<n;i++){
      cin >> s;
      w[i]=s.length();
    }
    ans=-1;
    for(int i=0;i<n;i++){
      count=0;
      now=0;
      for(int j=i;j<n;j++){
        count+=w[j];
        if(count==len[now]){
          now++;
          count=0;
          if(now==5){
            ans=i;
          }
        }else if(count>len[now]){
          break;
        }
      }
      if(ans!=-1){
        break;
      }
    }
    cout << ans+1 << endl;
  }
  return 0;
}



Measured memory_bytes: 3132
#include <bits/stdc++.h>
using namespace std;
#define repl(i, l, r) for (ll i = (l); i < (r); i++)
#define rep(i, n) repl(i, 0, n)
#define CST(x) cout << fixed << setprecision(x)
using ll = long long;
const ll MOD = 1000000007;
const int inf = 1e9 + 10;
const ll INF = 4e18 + 10;
const int dx[9] = {1, 0, -1, 0, 1, -1, -1, 1, 0};
const int dy[9] = {0, 1, 0, -1, 1, 1, -1, -1, 0};
int main() {
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);

	ll l, r;
	cin >> l >> r;
	if (r - l + 1 >= 2019)
		cout << 0 << endl;
	else {
		ll ans = INF;
		repl(i, l, r + 1) repl(j, i + 1, r + 1) ans = min(ans, i * j % 2019);
		cout << ans << endl;
	}
	return 0;
}

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


int main(){
  int r,g,b;
  cin >> r >> g >> b;
  int ans=r*100+g*10+b;
  if(ans%4==0){
    cout << "YES" << endl;
  }else{
    cout << "NO" << endl;
  }
  return 0;
}


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

vector<vector<char>> rotate(ll H, ll W, const vector<vector<char>> &S) {
  const ll INF = 1LL << 60;
  ll miny = INF, minx = INF, maxy = -INF, maxx = -INF;
  vector<pair<ll, ll>> p;
  REP(i, 0, H) REP(j, 0, W) {
    if (S[i][j] == '#') {
      ll y = j + i, x = j - i;
      p.push_back(make_pair(y, x));
      miny = min(miny, y);
      minx = min(minx, x);
      maxy = max(maxy, y);
      maxx = max(maxx, x);
    }
  }

  ll h = p.size() > 0 ? maxy - miny + 1 : 1;
  ll w = p.size() > 0 ? maxx - minx + 1 : 1;
  vector<vector<char>> s(h, vector<char>(w, '.'));
  REP(i, 0, p.size()) {
    s[p[i].first - miny][p[i].second - minx] = '#';
  }
  return s;
}

int main(void) {
  ll H, W;
  cin >> H >> W;
  vector<vector<char>> S(H, vector<char>(W));
  REP(i, 0, H) REP(j, 0, W) cin >> S[i][j];

  S = rotate(H, W, S);
  H = S.size();
  W = S[0].size();

  vector<vector<ll>> row(H, vector<ll>(W + 1));
  REP(i, 0, H) REP(j, 0, W) row[i][j + 1] = row[i][j] + (S[i][j] == '#' ? 1 : 0);

  vector<vector<ll>> col(W, vector<ll>(H + 1));
  REP(i, 0, W) REP(j, 0, H) col[i][j + 1] = col[i][j] + (S[j][i] == '#' ? 1 : 0);

  ll ans = 0, ans2 = 0;
  REP(i, 0, H) REP(j, 0, W) if (S[i][j] == '#') {
    REP(x, j + 1, W) if (S[i][x] == '#') {
      ll t = x - j;
      if (0 <= i - t && i - t < H) {
        ans += row[i - t][x + 1] - row[i - t][j];
        if (S[i - t][x] == '#') ans2++;
        if (S[i - t][j] == '#') ans2++;
      }
      if (0 <= i + t && i + t < H) {
        ans += row[i + t][x + 1] - row[i + t][j];
        if (S[i + t][x] == '#') ans2++;
        if (S[i + t][j] == '#') ans2++;
      }
    }
    REP(y, i + 1, H) if (S[y][j] == '#') {
      ll t = y - i;
      if (0 <= j - t && j - t < W) {
        ans += col[j - t][y + 1] - col[j - t][i];
        if (S[y][j - t] == '#') ans2++;
        if (S[i][j - t] == '#') ans2++;
      }
      if (0 <= j + t && j + t < W) {
        ans += col[j + t][y + 1] - col[j + t][i];
        if (S[y][j + t] == '#') ans2++;
        if (S[i][j + t] == '#') ans2++;
      }
    }
  }
  cout << ans - ans2 / 2 << endl;
}

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

ll dp[3030][3030][4];
int V[3030][3030];

void solve() {
    int r, c, k;
    cin >> r >> c >> k;
    rep(i, k) {
        int R, C, v;
        cin >> R >> C >> v;
        V[R][C] = v;
    }
    for (int i = 1; i <= r; i++) for (int j = 1; j <= c; j++) {
        if (V[i][j]) {
            rep(a, 3) {
                chmax(dp[i][j + 1][a + 1], dp[i][j][a] + V[i][j]);
                chmax(dp[i + 1][j][0], dp[i][j][a] + V[i][j]);
            }
        }
        rep(a, 4) {
            chmax(dp[i][j + 1][a], dp[i][j][a]);
            chmax(dp[i + 1][j][0], dp[i][j][a]);
        }
    }

    ll ans = dp[r][c][3];
    rep(a, 3) {
        if (V[r][c]) {
            chmax(ans, dp[r][c][a] + V[r][c]);
        } else {
            chmax(ans, dp[r][c][a]);
        }
    }
    cout << ans << endl;
}

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


Measured memory_bytes: 323328
import java.util.*;

public class Main {

    private static int N, Q;
    private static String s;
    private static char[] t;
    private static char[] d;
    private static boolean searchForLeft;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        N = sc.nextInt();
        Q = sc.nextInt();
        s = " " + sc.next() + " ";
        t = new char[Q];
        d = new char[Q];
        for (int q = 0; q < Q; q += 1) {
            t[q] = sc.next().charAt(0);
            d[q] = sc.next().charAt(0);
        }

        searchForLeft = true;
        int rightmost = binarySearch(0, N);
        searchForLeft = false;
        int leftmost = binarySearch(0, N);
        int nSurvive = leftmost - rightmost - 1;
        if (nSurvive < 0) {
            System.out.println(0);
        } else {
            System.out.println(nSurvive);
        }
    }

    private static int binarySearch(int left, int right) {
        if (right - left <= 1) {
            if (searchForLeft) { // Search for `finalPosition == -1`
                if (finalPosition(left) == -1) {
                    return left;
                } else {
                    return left - 1;
                }
            } else {            // Search for `finalPosition == N`
                if (finalPosition(left) == N) {
                    return left;
                } else {
                    return left + 1;
                }
            }
        }

        int middle = left + (right - left) / 2;
        int finalPosition = finalPosition(middle);
        if (searchForLeft) {        // Search for `finalPosition == -1`
            if (finalPosition == -1) {
                return binarySearch(middle, right);
            } else {
                return binarySearch(left, middle);
            }
        } else {                // Search for `finalPosition == N`
            if (finalPosition == N) {
                return binarySearch(left, middle);
            } else {
                return binarySearch(middle, right);
            }
        }
    }

    private static int finalPosition(int index) {
        for (int q = 0; q < Q; q += 1) {
            if (t[q] == s.charAt(index + 1)) {
                index += d[q] == 'R' ? 1 : -1;
            }
        }
        return index;
    }

}


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

int main()
{
    ios::sync_with_stdio(false);

    int N; cin >> N;

    auto initial = vector<int>(2*N-1);
    for (auto& x : initial)
        cin >> x;

    const auto works = [&](const int cutoff)
    {
        auto classes = vector<int>(2*N-1);
        for (auto i = 0; i < 2*N-1; i++)
            classes[i] = initial[i] >= cutoff;

        const auto middle = N-1;
        for (auto i = middle, j = middle, expected = classes[middle]; i >= 0; i--, j++, expected = !expected)
        {
            if (classes[i] != expected) return classes[i];
            if (classes[j] != expected) return classes[j];
        }
        return classes[0];
    };

    auto lower = 1, upper = 2*N-1;
    while (lower < upper)
    {
        const auto guess = (lower + upper + 1) / 2;
        if (works(guess)) lower = guess;
        else upper = guess-1;
    }

    cout << lower << endl;
}


Measured memory_bytes: 1808
package main

import "fmt"

func main() {
	var N int
	fmt.Scan(&N)

	count := 0

	if N >= 105 {
		count = count + 1
	}

	if N >= 135 {
		count = count + 1
	}

	if N >= 165 {
		count = count + 1
	}

	if N >= 189 {
		count = count + 1
	}

	if N >= 195 {
		count = count + 1
	}

	fmt.Println(count)

}


Measured memory_bytes: 512
fun main(args: Array<String>){
    var a = readLine()!!.split(" ")
    var (v, w)= readLine()!!.split(" ").map { it.toInt() }
    val r = readLine()

    if(a[0] == r){
        v--
    }else{
        w--
    }

    println("$v $w")
}

Measured memory_bytes: 37808
import re

def rot(i,s):
  s0 = 'abcdefghijklmnopqrstuvwxyz'
  sr = s0[i:] + s0[:i]
  s1 = '' 
  for i in range(len(s)):
      if s[i] in s0:
          s1 = s1 + sr[s0.find(s[i])]
      else:
          s1 = s1 + s[i]
  return(s1)

def cae(s):
  for i in range(26):
      ro =rot(i,s)
      if re.search(r'the',ro) or re.search(r'this',ro) or re.search(r'that',ro):
        return(rot(i,s))

if __name__ == "__main__":
    while True:
        try:
            s = input()
            print(cae(s))
        except:
            break

Measured memory_bytes: 7588
#include<bits/stdc++.h>
#include<string>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <stdlib.h>
#include<string>
#define mp make_pair
#define ss second
#define ff first
#define pb push_back
#define io ios_base::sync_with_stdio;cin.tie(0);cout.tie(0)
#define READ freopen("input.txt","r", stdin)
#define mem(a,b)     memset(a, b, sizeof(a))
#define snd(a) scanf("%d",&a)
#define snl(a) scanf("%lld",&a)
#define snul(a) scanf("%ull",&a)
#define rep(i,k,n) for(int i=k;i<n;i++)
#define rev(j,n,k) for(int j=n;j>=k;j--)
#define TC int tc;cin>>tc;while(tc--)
#define FastRead ios_base::sync_with_stdio(false);cin.tie(NULL);

#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) ((a / __gcd(a, b) ) * b)

#define PI 2*acos(0.0)
#define MAX 1000000000
#define inf 1e18
#define MOD 1000000007
#define case(i) "Case "<<i++<<": "
#define nscase(i) "Case "<<i++<<":"
#define base(n,b) floor(log(n)/log(b))+1
#define onecnt(x) __builtin_popcount(x)
#define to_binary(n) bitset<8>(n).to_string()
#define endl '\n'
#define esc cout<<"\n"

/*------------------------------Graph Moves----------------------------*/
///const int fx[]= {+1,-1,+0,+0};
///const int fy[]= {+0,+0,+1,-1};
///const int fx[]= {+0,+0,+1,-1,-1,+1,-1,+1};  // Kings Move
///const int fy[]= {-1,+1,+0,+0,+1,+1,-1,-1}; // Kings Move
///const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
///const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*---------------------------------------------------------------------*/

using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<long,long> pll;
typedef std::map<long long,int> mli;
typedef std::map<long long,long long> mll;
typedef std::map<int,int> mii;
using namespace __gnu_pbds;
typedef tree<
ll,
null_type,//set to another type while using map
less<ll>,
rb_tree_tag,
tree_order_statistics_node_update> ordered_set;

template <typename T>
std::string toString( T Number )
{
    std::ostringstream ss;
    ss << Number;
    return ss.str();
}


const ll ten5=100000;
const ll ten6 =1000000;
const ll ten7 =10000000;
const ll ten8 =100000000;
const ll ten9 =1000000000;
const ll mod=1000000007;


int main()
{
    io;

    int n,i,j,k=0;
    cin>>n;
    string s,t;
    cin>>s;
    k=1;
    rep(i,1,n)
    {
        if(s[i]!=s[i-1])k++;
    }
    cout<<k<<endl;

    return 0;
}


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

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

    vector<vector<int>> vec(m);
	for (int i = 0; i < m; ++i) {
		int k;
        cin >> k;
		vec[i].resize(k);
		for (int j = 0; j < k; ++j) {
			cin >> vec[i][j];
			--vec[i][j];
		}
	}

    vector<int> p(m);
    for(int i = 0; i < m; ++i){
        cin >> p[i];
    }

    int ans = 0;
    for(int i = 0; i < (1 << n); ++i){
        int flag = 0;
        for(int j = 0; j < m; ++j){
            int c = 0;
            for(int k : vec[j]){
                if ((i >> k) & 1) {
					++c;
				}
            }
            c %= 2;
            if(c != p[j]){
                flag = 1;
            }
        }
        if(flag == 0){
            ans++;
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <stdio.h>
#include <tuple>
#include <bitset>
#include <cfloat>
#include <fstream>
#include <limits.h>
#include <list>
#include <math.h>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <numeric>
#include <utility>
#include <sstream>
// *テンプレート*
#define int long long
#define rep(i, n) for (int i = 0; i < (n); i++)
#define P pair<int, int>
#define sz(x) x.size()
#define EPS (1e-10)
// aよりbの方が小さかったら、aの値をbの値に置き換える。(swapではない！)
template<class T> inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
// aよりbの方が大きかったら、aの値をbの値に置き換える。
template<class T> inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}

using namespace std;
typedef long long ll;
using Graph = vector<vector<int>>;
//最大公約数
ll gcd(ll a, ll b) {
	if (a < b)swap(a, b);
	if (b == 0) return a;
	return gcd(b, a % b);
}
//最小公倍数
ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}
// 素数かどうか判定
bool prime(int n) {
	for (int i = 2; i <= sqrt(n); i++) {
		if (n%i == 0)return false;
	}
	return n != 1;
}

const long long MOD = 1000000007;
const long long INF = 1LL << 60;
// *テンプレートここまで*

// pair -> vector<pair<int,int>> 
//		   AandB.push_back(make_pair(a[i],b[i]))

int cnt[26];
vector<char>v;

signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	string s; cin >> s;
	if (s == "zyxwvutsrqponmlkjihgfedcba") {
		cout << -1 << endl; return 0;
	}
	if (s.size() != 26) {
		rep(i, s.size())cnt[s[i] - 'a']++;
		rep(i, 26) {
			if (cnt[i] != 1) {
				cout << s << (char)('a' + i) << endl; return 0;
			}
		}
	}
	v.push_back(s[25]);
	for (int i = 24; i >= 0; i--) {
		sort(v.begin(), v.end());
		if (s[i] < s[i + 1]) {
			if (i == 0) {
				cout << (char)(s[0] + 1) << endl; return 0;
			}
			cout << s.substr(0, i);
			rep(j, v.size()) {
				if (s[i] < v[j]) {
					cout << v[j] << endl; return 0;
				}
			}
		}
		v.push_back(s[i]);
	}
	return 0;
}

Measured memory_bytes: 256
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  n=I()
  for i in range(1,10):
    for j in range(1,10):
      if n==i*j:
        return 'Yes'
  return 'No'

# main()
print(main())


Measured memory_bytes: 6860
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
using namespace std;

int main()
{
  cin.tie(0);
  int x;
  cin >> x;
  if (x == 7 || x == 5 || x == 3) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}

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

using namespace std;
using ll = long long;
using ull = unsigned long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;

#define REP(i, n, m) for(ll i=n; i<(ll)m; ++i)
#define IREP(i, n, m) for(ll i=n-1; i>=m; --i)
#define rep(i, n) REP(i, 0, n)
#define irep(i, n) IREP(i, n, 0)
#define all(v) v.begin(), v.end()
#define vprint(v) for(auto e:v){cout<<e<<" ";};cout<<endl;
#define vvprint(vv) for(auto v:vv)vprint(v);

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(20);

    ull A;
    double B;
    cin >> A >> B;
    ull C = B*100+0.1;

    cout << A*C/100 << endl;
}


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

using namespace std;

long long n, a[500000];

void Process()
{
    int cou = 1, res = 0;       a[n+1] = 1000000001;

    for (int i=1; i<=n; i++)
        if (a[i] >= a[i+1]) cou++;
            else
            {
                res = max(res, cou - 1);
                cou = 1;
            }

    cout << res;
}

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

    //freopen("abc.txt", "r", stdin);

    cin >> n;
    cout << n*(n-1)/2;
}

int main()
{
    Input();
    //Process();
    return 0;
}


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

#define size 500
int mat[size][size];
bool isFriend2[size];
int n;

void dfs(int cur, int rem) {
	if(rem == 0) return;
	for(int i = 0; i < n; i++) {
		if(mat[cur][i]) {
			isFriend2[i] = true;
			dfs(i, rem-1);
		}
	}
}

int main() {
	while(true) {
		int m;
		cin >> n >> m;
		if (n == 0 && m == 0) break;
		
		for(int i = 0; i < n; i++) {
			for(int j = 0; j < n; j++) {
				mat[i][j] = 0;
			}
			isFriend2[i] = false;
		}
		for(int i = 0; i < m; i++) {
			int a, b;
			cin >> a >> b;
			a--; b--;
			mat[a][b] = mat[b][a] = 1;
		}
		dfs(0, 2);
		int count = 0;
		for(int i = 1; i < n; i++) {
			if(isFriend2[i]) count++;
		}
		cout << count << endl;
		
	}
	return 0;
}

Measured memory_bytes: 0
fun main() {
  val N = readInt()
  var cnt = 0L
  for (a in 1 until N) {
    cnt += (N - 1) / a
  }
  println(cnt)
}

fun readString() = readLine()!!
fun readStrings() = readString().split(" ")
fun readInt() = readString().toInt()
fun readLong() = readString().toLong()
fun readInts() = readStrings().map { it.toInt() }
fun readLongs() = readStrings().map { it.toLong() }


Measured memory_bytes: 34572
#include <algorithm>
#include <iostream>
#include <numeric>
#include <string>
#include <utility>
#include <vector>

class Info {
  public:
    int n;
    bool is_end;
    int children[26];
    Info(int n = 0) {
      this->n = n;
      is_end = false;
      for (int i = 0; i < 26; ++i) {
        children[i] = -1;
      }
    }
};

int main() {
  int n, q, k;
  std::vector<std::vector<std::vector<int>>> nums;
  int nums2[100000] = {};
  std::string s[100000];
  std::string p;
  std::vector<Info> trie;
  trie.push_back(Info());
  std::cin >> n;
  trie.reserve(410000);
  nums.resize(n, std::vector<std::vector<int>>(26, std::vector<int>(26, 0)));
  for (int ni = 0; ni < n; ++ni) {
    int ptr = 0;
    std::cin >> s[ni];
    for (char c : s[ni]) {
      if (trie[ptr].children[c - 'a'] < 0) {
        trie[ptr].children[c - 'a'] = trie.size();
        trie.push_back(Info());
      }
      ++trie[ptr].n;
      ptr = trie[ptr].children[c - 'a'];
    }
    ++trie[ptr].n;
    trie[ptr].is_end = true;
  }
  for (int ni = 0; ni < n; ++ni) {
    int ptr = 0;
    for (auto c : s[ni]) {
      for (int a = 0; a < 26; ++a) {
        int x = trie[ptr].children[a];
        if (x >= 0 and 'a' + a != c) {
          nums[ni][a][c - 'a'] += trie[x].n;
        }
      }
      if (trie[ptr].is_end) {
        ++nums2[ni];
      }
      ptr = trie[ptr].children[c - 'a'];
    }
  }
  std::cin >> q;
  for (int qi = 0; qi < q; ++qi) {
    int ans = 1;
    std::cin >> k >> p;
    for (int a = 0; a < 26; ++a) {
      for (int b = a + 1; b < 26; ++b) {
        ans += nums[k - 1][p[a] - 'a'][p[b] - 'a'];
      }
    }
    ans += nums2[k - 1];
    std::printf("%d\n", ans);
  }
  return 0;
}

Measured memory_bytes: 365696
#include <iostream>
#include <string>
#include <cstring>
using namespace std;

const int MOD = 1000000007;
string S;

void add(long long &a, long long b) {
  a += b;
  if (a >= MOD) a -= MOD;
}

long long dp[210000][5];

int main() {
  cin >> S;
  memset(dp, 0, sizeof(dp));
  dp[0][0] = 1;
  for (int i = 0; i < S.size(); ++i) {
    for (int j = 0; j < 5; ++j) {
      if (S[i] != '?') add(dp[i+1][j], dp[i][j]);
      else add(dp[i+1][j], dp[i][j] * 3 % MOD);
    }
    if (S[i] == 'A' || S[i] == '?') add(dp[i+1][1], dp[i][0]);
    if (S[i] == 'B' || S[i] == '?') add(dp[i+1][2], dp[i][1]);
    if (S[i] == 'C' || S[i] == '?') add(dp[i+1][3], dp[i][2]);  
  }
  cout << dp[S.size()][3] << endl;
}

Measured memory_bytes: 8704
#include <iostream>
#include <map>
#include <string>
#include <utility>
#include <list>
#include <math.h>
#include <vector>
#include <algorithm>

using namespace std;
typedef long long ll;

int main() {
  ll M, K;
  cin >> M >> K;
  
  if (M == 0) {
    if (K == 0) {cout << K << " " << K;}
    else {cout << -1;}
    
    return 0;
  }
  if (M == 1) {
    if (K == 0) {
      cout << 0 << " " << 0 << " " << 1 << " " << 1;
    }
    else {
      cout << -1;
    }
    return 0;
  }
  ll max = pow(2, M) - 1;
  if (max < K) {
    cout << -1;

    return 0;
  }
  
  for (int i = 0; i <= max; i++ ) {
    if (i != K) {
      cout << i << " "; 
    }
  }
  cout << K << " ";
  for (int i = max; i >= 0; i-- ) {
    if (i != K) {
      cout << i << " "; 
    }
  }
  cout << K << " ";
  
  
  return 0;
}


Measured memory_bytes: 1792
#include <iostream>

using namespace std;

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

    int p[50];

    for(int i = 0;i < N;++i)
        cin >> p[i];

    int cont = 0;

    for(int i = 0;i < N;++i)
        if(p[i] != i + 1)
            ++cont;

    if(cont == 0 || cont == 2)
        cout << "YES" << endl;
    else
        cout << "NO" << endl;

    return 0;
}


Measured memory_bytes: 256
main :: IO ()
main = do
    (h:w:k:_) <-  map read . words <$> getLine :: IO [Int]
    input <- coord h
    let permX = perm w
        permY = perm h
        ans   = count k $ [check input ys xs | xs <- permX, ys <- permY]
    print ans

coord :: Int -> IO [Bool]
coord 0 = pure []
coord n = (++) <$> convert <*> coord (n-1)
  where
    convert = map (== '#') <$> getLine

perm :: Int -> [[Bool]]
perm 1 = [[True],[False]]
perm n = (++) <$> map ((:) True) <*> map ((:) False) $ perm (n-1)

check :: [Bool] -> [Bool] -> [Bool] -> Int
check ls ms ns = sum $ map (\result -> if result then 1 else 0) $ zipWith (&&) ls $ intersection ms ns
  where
    intersection xs ys = [x && y | x <- xs, y <- ys]

count :: (Eq a) => a -> [a] -> Int
count x xs = sum $ change x xs
  where
    change x = map ((\m n -> if m == n then 1 else 0) x)


Measured memory_bytes: 4944
N = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]

a_cnt = 0
b_cnt = 0
for i in range(N):
    if a[i] >= b[i]:
        b_cnt += a[i] - b[i]
    else:
        if (b[i] - a[i]) % 2 == 0:
            a_cnt += b[i] - a[i]
        else:
            a_cnt += b[i] - a[i] - 1
if b_cnt * 2 <= a_cnt:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 4600
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0; i<(n); i++)
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; }

int main(){
    ll n; cin>>n;
    string s; cin>>s;
    vector<ll> r,g,b;
    rep(i,n){
        if(s[i]=='R') r.push_back(i);
        else if(s[i]=='G') g.push_back(i);
        else if(s[i]=='B') b.push_back(i);
    }
    ll res=r.size()*g.size()*b.size();
    for(ll i: r){
        for(ll j: g){
            if(i>j) continue;
            ll k=2*j-i;
            if(binary_search(b.begin(), b.end(), k)) res--;
        }
    }

    for(ll i: g){
        for(ll j: r){
            if(i>j) continue;
            ll k=2*j-i;
            if(binary_search(b.begin(), b.end(), k)) res--;
        }
    }

    for(ll i: g){
        for(ll j: b){
            if(i>j) continue;
            ll k=2*j-i;
            if(binary_search(r.begin(), r.end(), k)) res--;
        }
    }

    for(ll i: b){
        for(ll j: g){
            if(i>j) continue;
            ll k=2*j-i;
            if(binary_search(r.begin(), r.end(), k)) res--;
        }
    }

    for(ll i: r){
        for(ll j: b){
            if(i>j) continue;
            ll k=2*j-i;
            if(binary_search(g.begin(), g.end(), k)) res--;
        }
    }

    for(ll i: b){
        for(ll j: r){
            if(i>j) continue;
            ll k=2*j-i;
            if(binary_search(g.begin(), g.end(), k)) res--;
        }
    }
    cout<<res<<endl;
    return 0;
}

Measured memory_bytes: 3712