akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>

int main( void ) {
	int i, j, data[ 10 ], head = 0, prev[ 10 ] = { 100, 0, 1, 2, 3, 4, 5, 6, 7, 8 }, next[ 10 ] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 100 }, top3[ 3 ];

	scanf( "%d %d %d %d %d %d %d %d %d %d", &data[ 0 ], &data[ 1 ], &data[ 2 ], &data[ 3 ], &data[ 4 ], &data[ 5 ], &data[ 6 ], &data[ 7 ], &data[ 8 ], &data[ 9 ] );

	for ( i = 0; i < 3; i++ ) {
		int idx = head;

		for ( j = head; j != 100; j = next[ j ] )
			if ( data[ idx ] < data[ j ] )
				idx = j;
		top3[ i ] = data[ idx ];

		if ( prev[ idx ] == 100 ) {
			head = next[ idx ];
			prev[ next[ idx ] ] = 100;
		} else if ( next[ idx ] == 100 )
			next[ prev[ idx ] ] = 100;	
		else {
			next[ prev[ idx ] ] = next[ idx ];
			prev[ next[ idx ] ] = prev[ idx ];
		}
	}

	printf( "%d\n%d\n%d\n", top3[ 0 ], top3[ 1 ], top3[ 2 ] );

	return 0;
}

Measured memory_bytes: 600
package main

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

var scanner = bufio.NewScanner(os.Stdin)

type chair struct {
	group_id, rest_time int
}

type info struct {
	group_id, num, wait_sum, before_go int
	fixed                              bool
}

func main() {
	ans := make([]int, 100)
	chair := make([]chair, 17)
	for i := 0; i < 17; i++ {
		chair[i].group_id = -1
	}
	info := make([]info, 100)
	for i := 0; i <= 99; i++ {
		info[i].group_id = i
		info[i].before_go = 5 * i
		info[i].wait_sum = 0
		if i%5 == 1 {
			info[i].num = 5
		} else {
			info[i].num = 2
		}
		info[i].fixed = false
	}
	count := 0
	FLG := 0
	tmp_num := 0
	isOK := false
	waitFLG := false
	for {
		for i := 0; i < 17; i++ {
			if chair[i].group_id != -1 {
				chair[i].rest_time--
				if chair[i].rest_time <= 0 {
					chair[i].group_id = -1
				}
			}
		}
		waitFLG = false
		count = 0
		for i := 0; i < 100; i++ {
			if info[i].fixed {
				continue
			}
			if waitFLG == false && info[i].before_go == 0 {
				FLG = -1
				tmp_num = info[i].num
				for k := 0; k <= 17-tmp_num; k++ {
					isOK = true
					for p := 0; p < tmp_num; p++ {
						if chair[k+p].group_id != -1 {
							isOK = false
							break
						}
					}
					if isOK {
						FLG = k
						break
					}
				}
				if FLG != -1 {
					for k := FLG; k < FLG+tmp_num; k++ {
						chair[k].group_id = info[i].group_id
						chair[k].rest_time = 17*(i%2) + 3*(i%3) + 19
						info[i].fixed = true
					}
				} else {
					waitFLG = true
					info[i].wait_sum++
					count++
				}
			} else {
				if info[i].before_go == 0 {
					info[i].wait_sum++
				} else {
					info[i].before_go--
				}
				count++
			}
		}
		if count == 0 {
			break
		}
	}
	for i := 0; i <= 99; i++ {
		ans[i] = info[i].wait_sum
	}
	for scanner.Scan() {
		n, _ := strconv.Atoi(scanner.Text())
		fmt.Println(ans[n])
	}
}



Measured memory_bytes: 1064
#include<bits/stdc++.h>
using namespace std;
int64_t c(int a,int b,vector<int64_t> &f,vector<int64_t> &fi,int p){
  if(b<0||a<0||a-b<0)
    return 0;
  return f.at(a)*fi.at(b)%p*fi.at(a-b)%p;
}
int main(){
  int n;
  cin>>n;
  int p=1000000007;
  vector<int64_t> f(n+1,1);
  for(int i=1;i<=n;i++)
    f.at(i)=f.at(i-1)*i%p;
  vector<int64_t> fi(n+1,1);
  int q=p-2;
  vector<int> b;
  while(q>0){
    b.push_back(q%2);
    q/=2;
  }
  reverse(b.begin(),b.end());
  for(int d:b){
    fi.at(n)=fi.at(n)*fi.at(n)%p;
    if(d==1)
      fi.at(n)=fi.at(n)*f.at(n)%p;
  }
  for(int i=n;i>=1;i--)
    fi.at(i-1)=fi.at(i)*i%p;
  vector<int> a(n+1);
  set<int> s;
  int x;
  for(int i=0;i<n+1;i++){
    cin>>a.at(i);
    if(s.count(a.at(i)))
      x=a.at(i);
    s.insert(a.at(i));
  }
  vector<int> lr(2);
  int j=0;
  for(int i=0;i<n+1;i++){
    if(a.at(i)==x){
      lr.at(j)=i;
      j++;
    }
  }
  int w=n+1-(lr.at(1)-lr.at(0)+1);
  for(int i=1;i<=n+1;i++)
    cout<<(c(n-1,i,f,fi,p)+2*c(n-1,i-1,f,fi,p)-c(w,i-1,f,fi,p)+p+c(n-1,i-2,f,fi,p))%p<<endl;
}

Measured memory_bytes: 7808
import java.util.Scanner;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		float sum = 0;
		for(int i=1; i<=N; i++) {
			sum+=1/(sc.nextFloat());
		}
		System.out.println(1/sum);
	}
}	


Measured memory_bytes: 25300
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define REP(i, n)  FOR(i, 0, n)
#define ASC(c) sort((c).begin(), (c).end())
#define DESC(c) sort((c).begin(), (c).end(), greater<int>())

#define DUMP(x)  cerr << #x << " = " << (x) << endl;
#define DEBUG(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

typedef long long ll;
typedef unsigned long long ull;
struct edge { int u, v; ll w; };
 
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

int main() {
    ll h, w; cin >> h >> w;
    if (h == 1 || w == 1) { 
        cout << 1 << endl;
        return 0;
    }
    if (h * w % 2 == 1) cout << (h * w / 2) + 1 << endl;
    else cout << h * w / 2 << endl;
}


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

int main()
{
	string s;
	int k;

	cin >> k;
	cin >> s;
	if (s.size()<=k)
	{
		cout << s << endl;
	}
	else
	{
		for (int i=0;i<k;++i)
		{
			cout << s[i];
		}
		cout << "..." << endl;
	}
}







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

int main() {
    int n, k; cin >> n >> k;
    int mod = 1e9+7;
    vector<int64_t> a(n+2);
    rep(i,n+2){
        a[i] = n*i-(i-1)*i+1;
    }

    int64_t ans = 0;
    for(int i = k; i <= n+1; i++){
        ans += a[i];
        ans %= mod;
    }

    cout << ans << endl;
}


Measured memory_bytes: 4788
#include<bits/stdc++.h>
#define int long long
#define P pair<int,int>
#define F first
#define S second
#define f(i,n) for(int i=0;i<(n);i++)
#define INF LLONG_MAX/3
#define mod 1000000007
#define pie 3.141592653589793238462643383279
#define prique priority_queue
using namespace std;
int x[26];
signed main(){
	int a;
	string s;
	cin>>a>>s;
	int ans=1;
	f(i,a){
		f(j,26){
			if(s[i]=='a'+j) x[j]++;
		}
	}
	f(i,26){
		ans*=x[i]+1;
		ans%=mod;
	}
	cout<<ans-1<<endl;
    return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define mod 1000000007
#define pb push_back
#define ll long long
#define ld long double
#define ft first
#define sd second
using namespace std;

const int N = 1e5 + 9;
int a[N];
int dp[N];
int nn;

bool solve(int n) {
    if(n == 0) return 1;
    int &ret = dp[n];
    if(ret != -1) return ret;
    ret = 0;
    for(int i = 1; i <= nn && a[i] <= n; i++) {
        if(solve(n - a[i]) == 1) return 0;
    }
    return ret = 1;
}

signed main() {

    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    memset(dp, -1, sizeof dp);
    int k; cin >> nn >> k;
    for(int i = 1; i <= nn; i++) {
        cin >> a[i];
    }
    solve(k);
    cout << (!solve(k) ? "First" : "Second");
    
    return 0;
}

Measured memory_bytes: 5376
#include <bits/stdc++.h>
using namespace std;
#define pr(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
#define all(v) (v).begin(), (v).end()
#define int long long
#define sz(v) (int)(v).size()
#define mod 1000000007 // ((a- b)% mod+ mod)% mod

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << endl;
	err(++it, args...);
}

const int N= 200001;
int n, m, f[N];

int find(int n) {
        if (f[n] < 0)
                return n;

        return f[n] = find(f[n]);
}

void union_(int x, int y) {
        x = find(x);
        y = find(y);
        if (x == y)
                return;
        if (-f[x] >= -f[y]) { f[x] += f[y]; f[y] = x; }
        else { f[y] += f[x]; f[x] = y; }
}

void solve() {
        cin >> n>> m;
        for (int i= 0; i<= n; i++) f[i]= -1;
        for (int i= 0; i< m; i++) {
                int u, v; cin >> u>> v;
                union_(u, v);
        }

        int mx= 0;

        for (int i= 1; i<= n; i++) {
                int siz = -f[find(i)];
                mx= max(mx, siz);
        }

        cout << mx<< "\n";
}

int32_t main(){
ios::sync_with_stdio(0), cin.tie(NULL), cout.tie(NULL);
        int T= 1;
        //cin >> T;
        while ( T-- ) {
                solve();
        }
return 0;
}


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

using namespace std;
using vi = vector<int>;
using ll = long long;

int main(void)
{
    int        n, m, u, v;
    vector<vi> edge_exists;
    vi         node_seq;
    cin >> n >> m;

    edge_exists.resize(n + 1, vi(n + 1, false));

    for (int i = 1; i <= n; ++i)
        node_seq.push_back(i);

    for (int i = 0; i < m; ++i)
    {
        cin >> u >> v;
        edge_exists[u][v] = edge_exists[v][u] = true;
    }

    ll ans = 0;
    do
    {
        bool is_hamiltonian = true;
        for (int i = 1; is_hamiltonian and i < n; ++i)
        {
            u = node_seq[i - 1], v = node_seq[i];
            if (not edge_exists[u][v])
                is_hamiltonian = false;
        }
        ans += is_hamiltonian;
    } while (next_permutation(next(node_seq.begin()), node_seq.end()));

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3552
// 見せてやるぜ、奇跡ってやつをよぉ……
#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>
#include <functional>
#include <cassert>
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; }
#define DEBUG_VLL(vec) REP(sz, vec.size()) cerr<<vec[sz]<<(sz==vec.size()-1?'\n':' ');

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll h, w, k; cin >> h >> w >> k;
    vll str(h, 0);
    vvll cake(h, vll(w, 0));
    ll tmpk = 1;
    REP(i, h) {
        string s;
        cin >> s;
        REP(j, w) {
            if (s[j] == '#') {
                cake[i][j] = tmpk;
                tmpk++;
                str[i]++;
            }
        }
    }

    if (w >= 2) {
        REP(i, h) rep(j, 1, w) {
            if (cake[i][j - 1] != 0 && cake[i][j] == 0) cake[i][j] = cake[i][j - 1]; 
        }
        REP(i, h) for (ll j = w - 2; j >= 0; j--) {
            if (cake[i][j + 1] != 0 && cake[i][j] == 0) cake[i][j] = cake[i][j + 1];
        }
    }

    if (h >= 2) {
        rep(i, 1, h) REP(j, w) {
            if (cake[i - 1][j] != 0 && cake[i][j] == 0) cake[i][j] = cake[i - 1][j];
        }
        for (ll i = h - 2; i >= 0; i--) {
            REP(j, w) if (cake[i + 1][j] != 0 && cake[i][j] == 0) cake[i][j] = cake[i + 1][j];
        }
    }

    REP(i, h) REP(j, w) {
        cout << cake[i][j] << (j == w - 1? '\n': ' ');
    }
    return 0;
}


Measured memory_bytes: 1536
N,M = map(int,input().split())
Likes = [True] * M
count = [0] * M
nums = 0
for n in range(N):
    KA = list(map(int,input().split()))[1:]
    for i in KA:
        count[i-1] += 1
for i,j in enumerate(count):
    if j == N:
      nums +=1
print(nums)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
    
using namespace std;
typedef long long ll;
    
int main()
{
    int N;
    cin >> N;
    unordered_map<string, int> s;
    vector<string> ss;
    for (int i = 0; i < N; i++) {
        string tmp;
        cin >> tmp;
        ss.push_back(tmp);
        auto itr = s.find(tmp);
        if (itr != s.end()) {
            s[tmp] = s[tmp] + 1;
        } else {
            s[tmp] = 1;
        }
    }
    // for (auto pair:s) {
    //     cout << pair.first << " " << pair.second << "\n";
    // }
    
    int M;
    cin >> M;
    unordered_map<string, int> t;
    for (int i = 0; i < M; i++) {
        string tmp;
        cin >> tmp;
        auto itr = t.find(tmp);
        if (itr != t.end()) {
            t[tmp] = t[tmp] + 1;
        } else {
            t[tmp] = 1;
        }
    }

    int ans = 0;

    for (string stmp : ss) {
        auto sitr = s.find(stmp);
        int plus = sitr->second;

        auto titr = t.find(stmp);
        int minus = 0;
        if (titr != t.end()) {
            minus = titr->second;
        }

        int anstmp = plus - minus;
        if (ans < anstmp) { ans = anstmp; }
    }

    cout << ans;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back

int main() {
    int n; cin>>n;
    int x,y,r=0,f=0;
    while(n--){
        cin>>x>>y;
        if(x==y)
        r++;
        else
        r=0;
        if(r==3)
        f=1;
    }
    if(f==1) cout<<"Yes";
    else cout<<"No";
}

Measured memory_bytes: 3632
#!/usr/bin/env python2

import sys

input = iter(sys.stdin.readlines()).next


def main():
   N = int(input())
   if N % 10 in [2, 4, 5, 7, 9]:
      res = 'hon'
   elif N % 10 in [0, 1, 6, 8]:
      res = 'pon'
   else:
      res = 'bon'
   print(res)

   return 0

if __name__ == '__main__':
   sys.setrecursionlimit(10000)
   main()


Measured memory_bytes: 84724
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){
	return o<<"("<<p.fs<<","<<p.sc<<")";
}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){
	o<<"{";
	for(const T& v:vc) o<<v<<",";
	o<<"}";
	return o;
}
using ll = long long;
template<class T> using V = vector<T>;
template<class T> using VV = vector<vector<T>>;
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n-1); }

#ifdef LOCAL
#define show(x) cerr << "LINE" << __LINE__ << " : " << #x << " = " << (x) << endl
#define dump(x) cerr << "LINE" << __LINE__ << " : " << #x << " = {";  \
	for(auto v: x) cerr << v << ","; cerr << "}" << endl;
#else
#define show(x) true
#define dump(x) true
#endif

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);		//DON'T USE scanf/printf/puts !!
	cout << fixed << setprecision(20);
	
	string s,t; cin >> s >> t;
	int a = 0;
	rep(i,3) if(s[i] == t[i]) a++;
	cout << a << endl;
}


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

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

    vector<long> flag(N+1, 0);
    long a = 0;
    for(long i = 0; i < M; i++){
        cin >> a;
        flag[a]++;
    }

    vector<long long> dp(N+1, 0);
    dp[1] = 1;
    dp[2] = 2;
    if(flag[1]){
        dp[1]--;
        dp[2]--;
    }
    if(flag[2]){
        dp[2] = 0;
    }
    for(long j = 3; j <= N; j++){
        if(flag[j]){
            continue;
        }else{
            dp[j] = (dp[j-1] + dp[j-2]) % LEN; 
        }
    }

    cout << dp[N] << endl;

    return 0;
}

Measured memory_bytes: 1792
from math import ceil
from fractions import Fraction

n, k, *aa = map(Fraction, open(0).read().split())

imp_length = 0
psbl_length = max(aa)

while psbl_length - imp_length > 1:
    mid = (psbl_length + imp_length) // 2
    cost = sum(ceil(a / mid) - 1 for a in aa)
    if cost <= k:
        psbl_length = mid
    else:
        imp_length = mid

print(psbl_length)

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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    long long A;
    double B;
    cin >> A >> B;
    int B100 = (B + 1E-3) * 100;
    long long res = (A * B100) / (long long)100;
    cout << res << '\n';
    return 0;
}

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

using namespace std;

#define MAX_N 3003

int n;

double ps[MAX_N], dp[MAX_N][MAX_N * 2];
bool v[MAX_N][MAX_N * 2];

double f_imp(int, int);

double f(int p, int hmt)
{
	if (!v[p][hmt + n])
	{
		v[p][hmt + n] = true;
		dp[p][hmt + n] = f_imp(p, hmt);
	}
	return dp[p][hmt + n];
}

double f_imp(int p, int hmt)
{
	if (p == n)
	{
		if (hmt == 0)
		{
			int err = 0;
			err = 10 / err;
		}
		return hmt > 0 ? 1 : 0;
	}
	return f(p + 1, hmt + 1) * ps[p] + f(p + 1, hmt - 1) * (1 - ps[p]);
}

int main()
{
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		scanf("%lf", ps + i);
	}
	printf("%.10lf\n", f(0, 0));
}


Measured memory_bytes: 158336
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  int n;
  while (cin >> n, n) {
    for (int i = 0; i < n; i++) {
      int x[3], y[3], z[3], w[3];
      for (int j = 0; j < 2; j++) {
        cin >> x[j] >> y[j] >> z[j] >> w[j];
      }
      x[2] = x[0] * x[1] - y[0] * y[1] - z[0] * z[1] - w[0] * w[1];
      y[2] = y[0] * x[1] + x[0] * y[1] - w[0] * z[1] + z[0] * w[1];
      z[2] = z[0] * x[1] + w[0] * y[1] + x[0] * z[1] - y[0] * w[1];
      w[2] = w[0] * x[1] - z[0] * y[1] + y[0] * z[1] + x[0] * w[1];
      cout << x[2] << " " << y[2] << " " << z[2] << " " << w[2] << endl;
    }
  }

  return 0;
}


Measured memory_bytes: 3188
import sys
from pprint import pprint
import math

n = int(sys.stdin.readline().strip())
n_max = 10 ** 18

if n % 2 == 1:
    print(0)
else:
    ans = 0
    d = 2
    while d * 5 <= n_max:
        d *= 5
        ans += int((n // d))
    print(ans)

Measured memory_bytes: 38384
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;

int s_val[100010];
int t_val[100010];

int main(){
  string S,T;
  cin>>S;
  cin>>T;
  int N=S.size();
  int M=T.size();

  s_val[0]=0;
  for(int i=0;i<N;i++){
      int nex=0;
      if(S[i]=='A') nex=1;
      else nex=2;
      s_val[i+1]=(s_val[i]+nex)%3;
  }

  t_val[0]=0;
  for(int i=0;i<M;i++){
      int nex=0;
      if(T[i]=='A') nex=1;
      else nex=2;
      t_val[i+1]=(t_val[i]+nex)%3;
  }

  int Q;
  cin>>Q;
  for(int i=0;i<Q;i++){
      int a,b,c,d;
      cin>>a>>b>>c>>d;

      int s=s_val[b]-s_val[a-1];
      s=(s+3)%3;
      int t=t_val[d]-t_val[c-1];
      t=(t+3)%3;

      if(s==t) cout<<"YES"<<endl;
      else cout<<"NO"<<endl;
  }

  return 0;
}


Measured memory_bytes: 1792
N = int(input())

myList = [[0, "a"]]

alfList = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]

if N == 1:
    print("a")
else:
    for indx in range(1,N):
        newMyList = []
        for strItem in myList:
            for addIndx in range(strItem[0] + 2):
                newNum = max(addIndx, strItem[0])
                newMyList.append([newNum, strItem[1] + alfList[addIndx]])
        myList = newMyList
    
    for indx in range(len(myList)):
        print(myList[indx][1])



Measured memory_bytes: 25716
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int A[3];
  for(int i=0;i<3;i++){
    cin>>A[i];
  }
  int count=0;
  for(int i=0;i<3;i++){
    count=0;
    for(int j=i+1;j<3;j++){
      if(A[i]==A[j]){
        A[i]=-1;
        A[j]=-1;
      }
    }
    if(A[i]!=-1){
      cout<<A[i]<<endl;
    }
  }
  
 return 0; 
}

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

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

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

using namespace std;

int main() {
    int n;  cin >> n;
    string s;   cin >> s;
    if (n%2 == 1) {
        cout << "No" << endl;
        return 0;
    }

    string t = s.substr(0, n/2);
    string l = s.substr(n/2, n/2);

    if (t == l)
        cout << "Yes" << endl;
    else 
        cout << "No" << endl;

    return 0;
}

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


class Program
{


    static void Main(string[] args)
    {
        Solve();
    }

    static void Solve()
    {
        Scan sc = new Scan();
        write wr = new write();

        var s = sc.chararr;
        Array.Sort(s);

        var a = new string(s);

        if (a == "abc")
        {
            wr.wri("Yes");
        }
        else wr.wri("No");

        

    }


}
    class Scan
    {
        public string str => Console.ReadLine();

        public string[] strarr => str.Split(' ');

        public long[] longarr => strarr.Select(long.Parse).ToArray();
        public int[] intarr => strarr.Select(int.Parse).ToArray();
        public char[] chararr => str.ToArray();


}



class write
{
    public void wri<Type>(Type x)
    {
        Console.WriteLine(x);
    }
}


Measured memory_bytes: 13396
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<deque>
using namespace std;
#define ll long long
const int mod = 1000000007;
const ll INF = 1000000000000000000;


int main()
{
	int N;
	string S;
	cin >> N >> S;
	int ans = 0;
	int i = 0, j = N - 1;
	while (true) {
		while (S[i] != 'W' && i < N) i++;
		while (S[j] != 'R' && j > 0) j--;
		if (i >= j) break;
		ans++;
		i++; j--;
	}
	cout << ans << endl;
}


Measured memory_bytes: 3748
A = int(input())
B = int(input())
C = int(input())
X = int(input())

count = 0
for i in range(A+1):
    for j in range(B+1):
        for k in range(C + 1):
            if i * 500 + j * 100 + k * 50 == X:
                count += 1
print(count)

Measured memory_bytes: 67176
#include <stdio.h>

#define Mod 1000000007

long long div_mod(long long x, long long y, long long z)
{
	if (x % y == 0) return x / y;
	else return (div_mod((1 + x / y) * y - x, (z % y), y) * z + x) / y;
}

long long combination(int n, int k)
{
	int i;
	long long x, y;
	for (i = n, x = 1; i >= n - k + 1; i--) x = x * i % Mod;
	for (i = 2, y = 1; i <= k; i++) y = y * i % Mod;
	return div_mod(x, y, Mod);
}

int main()
{
	int r[2], c[2];
	scanf("%d %d %d %d", &(r[0]), &(c[0]), &(r[1]), &(c[1]));
	printf("%lld\n", (combination(r[1] + c[1] + 2, r[1] + 1) + combination(r[0] + c[0], r[0]) - combination(r[0] + c[1] + 1, r[0]) - combination(r[1] + c[0] + 1, c[0]) + Mod * 2) % Mod);
	fflush(stdout);
	return 0;
}

Measured memory_bytes: 1732
//#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define bit(n,k) (((ll)n>>(ll)k)&1) /*nのk bit目*/
const long long INF= 1e+18+1;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll> >vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
const ll MOD=1000000007LL;
//const ll MOD=998244353LL;
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
vl dx={-1,-1,-1,0,0,1,1,1};
vl dy={1,-1,0,1,-1,1,0,-1};

int main(){
  ll i,o,t,j,l,s,z;cin>>i>>o>>t>>j>>l>>s>>z;
  ll ans=0;
  ans+=o;
  if(i==0||j==0||l==0){
    ans+=i/2*2;
    ans+=j/2*2;
    ans+=l/2*2;
  }
  else {
    if(i%2==j%2&&j%2==l%2){
      ans+=i+j+l;
    }
    else {
      ans+=i+j+l-1;
    }
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 384
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from fractions import Fraction
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations, accumulate
from operator import add, mul, sub, itemgetter, attrgetter


import sys
# sys.setrecursionlimit(10**6)
# readline = sys.stdin.buffer.readline
readline = sys.stdin.readline

INF = 2**62-1


def read_int():
    return int(readline())


def read_int_n():
    return list(map(int, readline().split()))


def read_float():
    return float(readline())


def read_float_n():
    return list(map(float, readline().split()))


def read_str():
    return readline().strip()


def read_str_n():
    return readline().strip().split()


def ep(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.perf_counter()
        ret = f(*args, **kwargs)
        e = time.perf_counter()

        ep(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(T, A, B):
    P = (A[0] - B[0]) * T[0]
    Q = (A[1] - B[1]) * T[1]

    if P > 0:
        P *= -1
        Q *= -1

    if P+Q == 0:
        return 'infinity'
    elif P+Q < 0:
        return 0

    S = -P // (P + Q)
    T = -P % (P + Q)
    return S * 2 + (1 if T != 0 else 0)


def main():
    T = read_int_n()
    A = read_int_n()
    B = read_int_n()
    print(slv(T, A, B))


if __name__ == '__main__':
    main()


Measured memory_bytes: 83668
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ul;
typedef signed long long ll;
ul over = 1000000007;

mt19937 mt(time(nullptr));
// uniform_int_distribution< int > rand_int(0, 10) // rand[0, 10] inclusive

bool isexp = false;

int main(void)
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed;
  int m;
  ul k;
  cin >> m >> k;
  ul m2=1;
  for (int i=0; i<m; ++i) m2*=2;
  if (isexp) {
    vector< ul > v(m2*2);
    for (int i=0; i<m2; ++i) {
      v[i*2] = i;
      v[i*2+1] = i;
    }
    do {
      bool flg = true;
      for (int i=0; i<m2*2; ++i) {
        for (int j=i+1; j<m2*2; ++j) {
          if (v[i]!=v[j]) continue;
          ul txor = 0;
          for (int k=i; k<=j; ++k) txor ^= v[k];
          if (txor != k) {
            flg = false;
            break;
          }
        }
        if (!flg) break;
      }
      if (flg) {
        for (int i=0; i<m2*2; ++i) {
          cout << v[i] << " ";
        }
        cout << endl;
        //break;
      }
    } while ( next_permutation(v.begin(), v.end()) );
  }

  if (k==0) {
    for (int i=0; i<m2; ++i) cout << i << " " << i << " ";
    cout << endl;
    return 0;
  }
  if (m==1) {
    cout << -1 << endl;
    return 0;
  }
  if (k>=m2) {
    cout << -1 << endl;
    return 0;
  }
  ul w, x, y, z;
  if (k==1) {
    w=0; x=2; y=3; z=k;
  } else {
    w=0, x=1; y=(k^1), z=k;
  }
  vector< bool > ok(m2, false);
  ok[w] = true; ok[x] = true; ok[y] = true; ok[z] = true;
  cout << w << " " << z << " " << x << " " << y << " " << z << " " << w << " " << y << " " << x << " ";
  for (ul i=2; i<m2; i+=2) {
    if (ok[w^i] || ok[x^i] || ok[y^i] || ok[z^i]) continue;
    cout << (w^i) << " " << (z^i) << " " << (x^i) << " " << (y^i) << " " << (z^i) << " " << (w^i) << " " << (y^i) << " " << (x^i) << " ";
    ok[w^i] = true; ok[x^i] = true; ok[y^i] = true; ok[z^i] = true;
  }
  cout << endl;
  return 0;
}


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


int main(void){
   string S;
   cin >> S;
   
   bool kaibun1=true;
   bool kaibun2=true;
   bool kaibun3=true;
   int N=S.size();
   
   
   for (int i=0;i<N;i++) {
       if (S[i] != S[N-1-i]) {
           kaibun1 = false;
           break;
       }
   }
   
   for (int i=0;i<(N-1)/2;i++) {
       if (S[i] != S[(N-1)/2-1-i]) {
           kaibun2 = false;
           break;
       }
   }
   
   for (int i=0;i<(N-1)/2;i++) {
       if (S[(N+3)/2-1+i] != S[N-1-i]) {
           kaibun3 = false;
           break;
       }
   }
   if (kaibun1==true&&kaibun2==true&&kaibun3==true) {
       cout << "Yes" << endl;
   }
   else {
       cout << "No" << endl;
   }
   
}




Measured memory_bytes: 3592
n, m = io.read("*n", "*n")
a = {}
asum = 0
for i = 1, n do
  a[i] = io.read("*n")
  asum = asum + a[i]
end
c = 0
for i = 1, n do
  if asum <= a[i] * 4 * m then
    c = c + 1
  end
end
print(m <= c and "Yes" or "No")


Measured memory_bytes: 2676
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cassert>
typedef long long lint;
const int N=1e5+5;
int n,pos[N];

namespace utils{
	template <class T> inline void apn(T &x,const T y){x=x<y?x:y;}
	template <class T> inline void apx(T &x,const T y){x=x>y?x:y;}
	template <class T> inline T cabs(const T &x){return x<0?-x:x;}
	inline int nxi(){
		int x=0;
		char c;
		while(((c=getchar())>'9'||c<'0')&&c!='-');
		const bool f=c=='-'&&(c=getchar());
		while(x=x*10-48+c,(c=getchar())>='0'&&c<='9');
		return f?-x:x;
	}
}
using namespace utils;

int main(){
	n=nxi();
	for(int i=1; i<=n; ++i){
		pos[i]=nxi();
	}
	int ans=0;
	for(int i=0; i<=n; ++i){
		ans+=cabs(pos[i+1]-pos[i]);
	}
	for(int i=1; i<=n; ++i){
		int dlt=cabs(pos[i+1]-pos[i-1])-cabs(pos[i]-pos[i-1])-cabs(pos[i+1]-pos[i]);
		printf("%d\n",ans+dlt);
	}
	return 0;
}


Measured memory_bytes: 1664
#include<bits/stdc++.h>
#define m 1000000007
using namespace std;
/*long long int F[1000000];
long long int fact(long long int h)
{   
    if(F[h]!=-1)
    {return F[h];}
    if(h==0)
    {
        F[h]=1;
        return 1;
    }  
    F[h]=((h%m)*((fact(h-1))%m))%m;
    return F[h];
    
}
long long int power(long long int x,long long int y)
{
	int res=1;
	x=x%m;
	while(y>0)
	{
		if(y&1)
			res=(res*x)%m;
		y=y>>1;
		x=(x*x)%m;
	}
	return res;
}*/
int main()
{   
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long long t,i,p=0,k=0;
    string n;
    
    /*for(i=0;i<1000000;i++)
    {F[i]=-1;}*/
    cin>>t;
    string a[t]={};
    long long b[t]={0};
    for(i=0;i<t;i++)
    {
        cin>>a[i]>>b[i];
        
    }
    cin>>n;
    for(i=0;i<t;i++)
    {
        if(k==1)
        {p=p+b[i];}
        if(a[i]==n)
        {k=1;}

    }
    cout<<p<<endl;
}    

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
using namespace std;
long long a[111111],dp[111111];
int main(){
	int n;
	cin >> n;
	for(int i=1;i<=n;i++){
		cin >> a[i];
	}
	dp[2]=abs(a[2]-a[1]);
	for(int i=3;i<=n;i++){
		if(dp[i-1]+abs(a[i]-a[i-1])<dp[i-2]+abs(a[i]-a[i-2])){
			dp[i]=dp[i-1]+abs(a[i]-a[i-1]);
		}else{
			dp[i]=dp[i-2]+abs(a[i]-a[i-2]);
		}
	}
	cout << dp[n];
}


Measured memory_bytes: 5140
def solve():
    s = input()
    t = input()

    for _ in range(len(s)):
        if s == t:
            print('Yes')
            break
        s = rotate(s)
    else:
        print('No')


def rotate(string):
    return string[1:] + string[0]


def model():
    s = input()
    t = input()
    # "abc" in "abcabc"
    if s in t * 2:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    # solve()
    model()


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

using namespace std;

typedef long long ll;

#define INF 10000000
#define mp make_pair
#define fi first
#define se second

int main(){

    ios_base::sync_with_stdio(false);cin.tie(0);
    int x,a,b;
    cin >> x >> a >> b;
    if(abs(a-x) < abs(b-x)){
        cout << "A";
    }
    else{
        cout << "B";
    }
    return 0;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self,x):
        if(self.parents[x] < 0):
            return x
        self.parents[x] = self.find(self.parents[x])
        return self.parents[x]

    def size(self, x):
        return self.parents[ self.find(x) ] * -1

    def same(self, x, y):
        x_root = self.find(x)
        y_root = self.find(y)
        return (x_root == y_root)

    def union(self,x,y):
        x_root = self.find(x)
        y_root = self.find(y)
        if(x == y):
            return

        if( self.parents[x_root] <= self.parents[y_root] ):
            self.parents[x_root] += self.parents[y_root]
            self.parents[y_root] = x_root
        else:
            self.parents[y_root] += self.parents[x_root]
            self.parents[x_root] = y_root

    def members(self,x):
        root = self.find(x)
        ret = [ i for i in range(self.n) if self.find(i) == root ]
        return ret

    def roots(self):
        ret = [ i for i in range(self.n) if self.parents[i] < 0]
        return ret

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

n = int(input())
xs = []
ys = []
for i in range(n):
    x,y = map(int, input().split())
    xs.append([x,i])
    ys.append([y,i])

xs.sort()
ys.sort()

edges = []
for tmp in [xs,ys]:
    for i in range(n-1):
        tmp_0 = tmp[i]
        tmp_1 = tmp[i+1]
        edges.append([ tmp_1[0] - tmp_0[0], tmp_1[1], tmp_0[1] ])

edges.sort()

ans = 0
uf = UnionFind(n)

for edge in edges:
    cost, a, b = edge
    if uf.same(a,b) == False:
        uf.union(a,b)
        ans += cost

    if( uf.size(a) == n):
        print(ans)
        exit()

Measured memory_bytes: 61272
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> VI;
typedef vector<VI> VVI;
typedef pair<ll, ll> P;
#define FOR(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define PRINT(V) for (auto v : (V)) cout << v << " "
#define ALL(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
const ll INF = numeric_limits<ll>::max();
int main()
{
    int n; cin >> n;
    n = (10000 - n)%1000;
    cout << n << endl;
    return 0;
}

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

namespace GreatOceanView
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            int[] H = new int[N];
            string[] strH = new string[N];
            int count = 0;

            strH = Console.ReadLine().Split(' ');

            for (int i = 0;i < N; i++)
            {
                H[i] = int.Parse(strH[i]);
            }

            for(int i = 0;i < N; i++)
            {
                if(i == 0)
                {
                    count++;
                    continue;
                }
                bool flag = true;
                for(int j = i - 1; j >= 0; j--)
                {
                    if(H[j] > H[i])
                    {
                        flag = false;
                    }
                }
                if (flag)
                {
                    count++;
                }
            }
            Console.WriteLine($"{count}");
        }
    }
}


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

int main(){
string a;
  cin>>a;
int b,c,d,e;
  b=999999,c=0;
for(int i=0;i<a.size();i++){
  if(a[i]=='C'){
  b=i;
    break;
  }
}
  for(int i=b;i<a.size();i++){
  if(a[i]=='F'){
  c=i;
    break;
  }
  }
if(c==0){
cout<<"No"<<endl;
}
  else{
  cout<<"Yes"<<endl;
  }
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int a = scan.nextInt();
        int b = scan.nextInt();
        System.out.println(solve(a, b));
    }
    public static String solve(int a, int b) {
        if (a + b == 15) {
            return "+";
        }
        if (a * b == 15) {
            return "*";
        }
        return "x";
    }
}


Measured memory_bytes: 21332
import java.util.*;

public class Main {
  
 public static void main(String[] args) {
   final Scanner sc = new Scanner(System.in);
   final int X = sc.nextInt();
   for (int i = 1; i <= 360; ++i) {
     if ((i*X) % 360 == 0) {
       System.out.println(i);
       return;
     }
   }   
 }  
}

Measured memory_bytes: 35644
N,Q = list(map(int, input().split()))
S = str(input())
lr=[]
for i in range(Q):
    lr.append(list(map(int, input().split())))


count=[0 for i in range(N)]
ind=0
for i in range(N-1):
    if S[i]=="A" and S[i+1]=="C":
        ind+=1
    count[i+1]+=count[i+1]+ind

for i,j in lr:
    print(count[j-1]-count[i-1])



Measured memory_bytes: 32288
#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <map>
#include <list>
#include <set>
#include <numeric>
#include <queue>
#include <stack>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <climits>
#include <cfloat>
#include <ctime>
#include <complex>
#include <cassert>
#include <array>
#include <bitset> 
#include <unordered_map>
#include <random>

using namespace std;
typedef long long LL;
typedef pair<int,int> P;

int deg[5];
int main() {
	for(int i=0;i<6;i++){
		int a;
		cin >> a;
		deg[a]++;
	}
	for(int i=1;i<=4;i++){
		if(deg[i]>2){
			cout << "NO" << endl;
			return 0;
		}
	}
	cout << "YES" << endl;

	return 0;
}



Measured memory_bytes: 256
def main():
    n = int(input())
    s = [input() for i in range(n)]
    seted_s = set(s[0])
    for i in s:
        seted_s = seted_s & set(i)
    from collections import defaultdict
    dicted_s = defaultdict(int)
    for i in seted_s:
        for ss in s:
            dicted_s[i] = min((dicted_s[i] if dicted_s[i] != 0 else 100),ss.count(i))

    ans = ""
    for k,v in dicted_s.items():
        ans = ans + k*v

    print("".join(sorted(ans)))

if __name__ == "__main__":
    main()

Measured memory_bytes: 38768
#include<bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
 
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("-ffloat-store")
 
#define int  long long
#define rep(i,begin,end) for(__typeof(end)i=(begin)-((begin)>(end));i!=(end)-((begin)>(end));i+=1-2*((begin)>(end)))
#define F first
#define S second
#define sz(x) ((int)x.size())
#define pb push_back
#define pf push_front
#define eb emplace_back
#define all(v) (v).begin(), (v).end()
#define mod 1000000007
#define what_is(x) cerr << #x << " is " << x <<"\n";
#define sortA(v) sort(v.begin(), v.end())
#define sortD(v) sort(v.rbegin(), v.rend())
#define PI 3.14159265358979323846
#define vout(a) for(auto x:a) cout<<x<<" ";
#define INF 2000000000000000000 //1e16
 
// #define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
 
 
// using namespace __gnu_pbds;
using namespace std;
 
using ll  = long long;
using vi  = vector<int>;
using vvi = vector<vi>;
using pii = pair<int,int>;
using vii = vector<pii>;
using mi  = multiset<int>;
using mii = multiset<pii>;
 
int lcm(int a,int b) {return (a*(b/__gcd(a,b)));}



void solve()
{
    int n,m,t,i,k,r,l,u,v,w,j,pos,sum=0,flag=0,count=0;
    string S,T,U; 
    // int z;
    cin>>n;
    vi a(n);
    rep(i,0,n) cin>>a[i];
    sortA(a);
    rep(i,0,n)
    {
        rep(j,i+1,n)
        {
            rep(k,j+1,n)
            {
                if(a[i]+a[j]>a[k]&&a[i]+a[k]>a[j]&&a[k]+a[j]>a[i]&&a[i]!=a[j]&&a[i]!=a[k]&&a[j]!=a[k])
                {
                    // cout<<i<<" "<<j<<" "<<k<<"\n";
                    count++;
                }
            }
        }
    }
    cout<<count;
}


signed main()
{
    #ifndef ONLINE_JUDGE 
       freopen("input.txt","r",stdin);
       freopen("output.txt","w",stdout);
    #endif
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int t=1;
    // cin>>t;
    while(t--)
    {
        solve();
        if(t)cout<<"\n";
    }
    return 0;
}

Measured memory_bytes: 3656
#include <cstdio>
#include <algorithm>
#include <vector>
#include <map>

int main() {
  size_t N;
  scanf("%zu", &N);

  std::map<int, int> a;
  a[8] = 0;
  for (size_t i=0; i<N; ++i) {
    int tmp;
    scanf("%d", &tmp);
    ++a[std::min(8, tmp/400)];
  }

  size_t min=std::max<size_t>(1, a.size()-1);
  size_t max=a.size()-1+a[8];
  printf("%zu %zu\n", min, max);
}


Measured memory_bytes: 256
import java.util.Iterator;
import java.util.Scanner;
import java.util.TreeMap;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		sc.close();
		int ans = 0;
		for(int i=1;i<=num;i++){
			ans += calc(i);
		}
		System.out.println(ans);

	}

	private static int calc(int num) {
		// TODO 自動生成されたメソッド・スタブ
		TreeMap<Integer, Integer> map = prime(num);

		for(Iterator<Integer> it =  map.keySet().iterator();it.hasNext();){
			int key = it.next();
			if(key %2 == 0){
				return 0;
			}
		}

		int totalPrime = 1;
		for(int value: map.values()){
			totalPrime *=(value+1);
		}
		if(totalPrime == 8){
			return 1;
		}else{
			return 0;
		}
	}

	public static TreeMap<Integer, Integer> prime(int num) {
		TreeMap<Integer, Integer> map = new TreeMap<Integer, Integer>();


		for (int i = 2; i <= num; i++) {

			if (num % i == 0) {
				if(map.containsKey(i)){
					map.put(i, map.get(i)+1);
				}else{
					map.put(i, 1);
				}
				num /= i;

				i = 1;

			}
		}
		return map;
	}

}

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

string s;
int wins=0;
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	cin>>s;
	for(int i=0;i<s.size();i++){
		if(s[i]=='o')
			wins++;
	}
	if(wins>=8 || 15-s.size()+wins>=8)
		cout<<"YES";
	else
		cout<<"NO";
	return 0;
}

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

int main()
{
	int id;
	double w, h;
	while (scanf("%d,%lf,%lf",&id,&w,&h) != EOF) {
		double bmi = w / (h*h);
		if (bmi >= 25.0) {
			cout << id << endl;
		}
	}
    return 0;
}

Measured memory_bytes: 3180
#include <iostream>
#include <cmath>
#include <vector>

using namespace std;

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

    vector <uint32_t> intA;
    intA.reserve(N);

    for(int i=0;i<N-1;i++){
        uint32_t temp1;
        cin>>temp1;

        intA[temp1-1]++;
    }

    for(int i=0;i<N;i++){
        cout << intA[i]<<std::endl; 
    }

}



Measured memory_bytes: 4032
using System;
using System.Collections.Generic;
using System.Numerics;
using System.Linq;

namespace AtCoderTemplate
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = Scanner.scanint[0];
            var v = Scanner.scanint;
            var c = Scanner.scanint;

            var d = new List<int>();
            for (var i = 0; i < n; i++) d.Add(v[i] - c[i]);
            d.Sort();
            var res = 0;
            for(var i = 0; i < n; i++)
            {
                if (d[i] > 0) res += d[i];
            }
            Console.WriteLine(res);
        }
    }

    public class Scanner
    {
        public static string[] scan => Console.ReadLine().Split(' ');
        public static int[] scanint => Array.ConvertAll(scan, int.Parse);
        public static long[] scanlong => Array.ConvertAll(scan, long.Parse);
        public static string[][] rescan(int n) => Enumerable.Repeat(0, n).Select(_ => scan).ToArray();
        public static int[][] rescanint(int n) => Enumerable.Repeat(0, n).Select(_ => scanint).ToArray();
        public static long[][] rescanlong(int n) => Enumerable.Repeat(0, n).Select(_ => scanlong).ToArray();

    }

    public class Ex
    {
        public static int[] subarr(int[] arr, int begin, int n) { int[] a = new int[arr.Length]; Array.Copy(arr, begin, a, 0, n); return a; }
    }
}


Measured memory_bytes: 13268
#include<stdio.h>
#include<stdlib.h>
#include<string.h>


struct node{
  int key;
  struct node *next;
  struct node *prev;
};


typedef struct node * NodePointer;


NodePointer nil;


NodePointer listSearch(int key){
  /* your code */
  NodePointer i;
  for(i=nil->next;i!=nil;i=i->next){
    if(i->key==key)return i;  
  }
  return NULL;
}

void init(){
  nil = malloc(sizeof(struct node));
  nil->next = nil;
  nil->prev = nil;
}


void printList(){
  NodePointer cur = nil->next;
  int isf = 1;
  while(1){
    if ( cur == nil ) break;
    if ( isf == 0) printf(" ");
    printf("%d", cur->key);
    cur = cur->next; isf = 0;
  }
  printf("\n");
}
void deleteNode(NodePointer t){
  /* your code */
  t->next->prev=t->prev;
  t->prev->next=t->next;
  free(t);
}
void deleteFirst(){
  NodePointer t = nil->next;
  if ( t == nil )return;
  deleteNode(t);
}
void deleteLast(){
  /* your code */
  NodePointer i;
  i=nil->prev;
  deleteNode(i);
}
void delete(int key){
  /* your code */
  NodePointer i;
  i=listSearch(key);
  if(i!=NULL)deleteNode(i);
}
void insert(int key){
  NodePointer x;
  x = malloc(sizeof(struct node));
  x->key = key;



  /* 

   your code 


  */


  x->next=nil->next;
  //  x->key = key;
  nil->next->prev=x;
  nil->next=x;
  //nil->next->prev=x;
  x->prev=nil;
}


int main(){
  int key, n, i;
  int size = 0;
  char com[20];
  int np = 0, nd = 0;
  scanf("%d", &n);
  init();
  for ( i = 0; i < n; i++ ){
    scanf("%s%d", com, &key);
    if ( com[0] == 'i' ) {
      insert(key);
      np++;
      size++;
    }
    else if ( com[0] == 'd' ) {
      if (strlen(com) > 6){
	if ( com[6] == 'F' ) deleteFirst();
	else if ( com[6] == 'L' ) deleteLast();
      }
      else { delete(key); nd++;
      }
      size--; }
  }
  printList();
  return 0;
}




Measured memory_bytes: 32972
//#include <tourist>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = 1e9;
const ll LINF = ll(1e18);
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define debug(v)          \
    cout << #v << ":";    \
    for (auto x : v)      \
    {                     \
        cout << x << ' '; \
    }                     \
    cout << endl;
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;
}
//cout<<fixed<<setprecision(15);有効数字15桁
//-std=c++14
//-std=gnu++17
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll n, m;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a,b,c;
    cin>>a>>b>>c;
    set<int>s;
    s.insert(a);
    s.insert(b);
    s.insert(c);
    cout<<s.size()<<"\n";
}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<queue>
#include<stack>
#include<cstring>
using namespace std;
int a[105];
int s;
int main(){
	for(int i = 0; i < 3; i++)
		scanf("%d", &a[i]);
		sort(a, a+3);
		s = a[0] * a[1] / 2;
			printf("%d\n", s);
}


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

#define mp make_pair
#define pb push_back

const int mod = (int)1e9+7;
using namespace std;

int fastp(int a, int b){
    int res = 1;
    a %= mod;
    while(b){
        if(b&1) res = (res * a) % mod;
        a *= a; a %= mod;
        b >>= 1;
    }
    return res%mod;
}
signed main(){
    int n,a;
    cin >> n >> a;
    if(a == n+1){
        cout << 1;
        return 0;
    }
    int s1,s2;
    s1 = s2 = 0;
    int x1 = 0;
    for(int i =0;i<a;i++){
        s1 += x1;
        x1++;
    }
    int x2 = n;
    for(int i = 0;i<a;i++){
        s2 += x2;
        x2--;
    }
    int s = 0;
    for(int i = a;i<=n;i++){
        s += (s2-s1+1+mod)%mod;
        s %= mod;
        s2 += x2;
        s1 += x1;
        x1++;
        x2--;
    }
    cout << s+1;
}


Measured memory_bytes: 3584