akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <map>

using namespace std;

void solve()
{
	int N;
	cin >> N;
	map<int, int> A;
	for (int i = 0; i < N; ++i)
	{
		int a;
		cin >> a;
		++A[a];
	}
	unsigned long long int ans = 1;
	map<int, int>::iterator it = A.begin();
	while (it != A.end())
	{
		if (N % 2 == 1)
		{
			if (it->first == 0)
			{
				if (it->second != 1)
				{
					cout << 0 << endl;
					return;
				}
			}
			else
			{
				if (it->second != 2)
				{
					cout << 0 << endl;
					return;
				}
				ans = (ans * 2) % 1000000007;
			}
		}
		else
		{
			if (it->second != 2)
			{
				cout << 0 << endl;
				return;
			}
			ans = (ans * 2) % 1000000007;
		}
		++it;
	}
	cout << ans << endl;
}

int main()
{
	solve();
	return(0);
}

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

int main(){
	int n,k;cin>>n>>k;
	if((n+1)/2>=k)puts("YES");
	else puts("NO");
}

Measured memory_bytes: 256
//#include <algorithm>
//#include <cstdio>
//#include <functional>
#include <iostream>
//#include <cfloat>
//#include <climits>
//#include <cstdlib>
//#include <cstring>
//#include <cmath>
//#include <map>
//#include <queue>
//#include <set>
//#include <sstream>
//#include <stack>
//#include <string>
//#include <time.h>
#include <vector>
//#include <random>
//#include <unordered_set>
//#include <complex>
//#include <string.h>
#define rt0 return 0
#define rep(i,n) for(int i=0;i<n;i++)
#define LL long long
#define pii pair<int,int>
using namespace std;
bool prm(int a)
{
	int cnt=0;
	for(int i=1;i<=a;i++) if(a%i==0) cnt++;
	return cnt==2;
}
int main()
{
	int n;
	cin>>n;
	int j=0;
	for(int i=11;;i+=10)
	{
		if(prm(i)) cout<<i<<" ",j++;
		if(j==n) break;
	}
    rt0;
}

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

int main()
{
    string str;

    cin>>str;

    int tbl[26];

    for(int i=0;i<26;i++){
        tbl[i]=0;
    }

    for(int i=0;i<str.size();i++){
        tbl[str[i]-(int)('a')]+=1;
    }
    
    for(int i=0;i<26;i++){
        if(tbl[i]%2!=0){
            cout<<"No"<<endl;
            return 0;
        }
    }

    cout<<"Yes"<<endl;


    return 0;
}

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


int main(){
    
    int N = 0;
    int valueA = 0;
    int A[1000000] = {0};
    
    cin >> N;
    for (int i = 0; i < N - 1; i++) {
        cin >> valueA;
        A[valueA - 1] = A[valueA - 1] + 1;
    }
    
    for (int i = 0; i < N; i++) {
        cout << A[i] << endl;
    }
    
    return 0;
}


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

int main() {
  string S, T;
  cin >> S >> T;
  int ans = 0;
  if (S.at(0) == T.at(0)) {
    ans += 1;
  }
  if (S.at(1) == T.at(1)) {
    ans += 1;
  }
  if (S.at(2) == T.at(2)) {
    ans += 1;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		solve();
	}

	public static void solve() {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
		Integer n = sc.nextInt();
        Integer a = sc.nextInt();
        sc.close();
        out.println(n * n - a);
        out.flush();
	}
}

Measured memory_bytes: 21716
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define per1(i,n) for(int i=n;i>0;i--)
#define all(v) v.begin(), v.end()
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<ll> vec;
typedef vector<vec> mat;
random_device rnd;
mt19937 mt(rnd());
uniform_int_distribution<> rand365(1,365);
uniform_int_distribution<> rand26(1,26);
ll D,c[30];
vec s[400];
vec ans(400);
ll loop=200000,temp;
ll score(vec A){
    ll ans=0,last[30]={0};
    rep1(i,D){
        ans+=s[i][A[i]];
        last[A[i]]=i;
        rep1(j,26) ans-=c[j]*(i-last[j]);
    }
    return ans;
}

void input(){
    cin>>D;
    rep1(i,26) cin>>c[i];
    int S;
    rep1(i,D){
        s[i].push_back(0);
        rep(j,26) cin>>S,s[i].push_back(S);
    }
}

double fire(int a,double temp){
    temp=(1-a/loop)/3;
    return temp;
}

void solve(){
    rep1(i,D){
        ans[i]=max_element(all(s[i]))-s[i].begin();
    }
    ll now=score(ans);
    rep(test,loop){
        temp=fire(test,temp);
        int d=rand365(mt),q=rand26(mt),preq;
        preq=ans[d];
        ans[d]=q;
        ll a=score(ans);
        if(a>now) now=a;
        else{
            if(temp>(double)mt()/2/INT_MAX) now=a;
            ans[d]=preq;
        }
    }
}
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    input();
    solve();
    rep1(i,D) cout<<ans[i]<<"\n";
}


Measured memory_bytes: 3776
#include<stdio.h>
#include<stdlib.h>
int main()
{
	long long a[10]={},ans=0,temp=0;
	for(int i=1;i<=7;i++)
		scanf("%lld",&a[i]);
	//3 6 7号方块不可能拼出高为2的矩形 直接pass
	ans+=(a[1]/2)*2; //每两个一方块可以拼成单位为2的矩形
	ans+=a[2]; //一个方形方块就是一个单位
	ans+=(a[4]/2)*2; //每两个J方块可以组成单位为2的矩形
	ans+=(a[5]/2)*2; //每两个L方块可以组成单位为2的矩形
	if(a[1]>0&&a[4]>0&&a[5]>0){
		a[1]--; a[4]--; a[5]--;
		temp+=(a[1]/2)*2; //每两个一方块可以拼成单位为2的矩形
		temp+=a[2]; //一个方形方块就是一个单位
		temp+=(a[4]/2)*2; //每两个J方块可以组成单位为2的矩形
		temp+=(a[5]/2)*2; //每两个L方块可以组成单位为2的矩形
		temp+=3;
	}
	ans=ans>temp?ans:temp;
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 128
S = raw_input()

n = 0
s = 0
e = 0
w = 0

if 'N' in S:
    n = 1
if 'S' in S:
    s = 1
if 'E' in S:
    e = 1
if 'W' in S:
    w = 1

ns = (n+s)%2
ew = (e+w)%2

print 'Yes' if ns+ew == 0 else 'No'


Measured memory_bytes: 2568
use std::io::Write;
use std::collections::HashMap;

#[allow(unused)]
macro_rules! debug {
    ($($format:tt)*) => (write!(std::io::stderr(), $($format)*).unwrap());
}
#[allow(unused)]
macro_rules! debugln {
    ($($format:tt)*) => (writeln!(std::io::stderr(), $($format)*).unwrap());
}

fn main() {
    let n: u8 = {
        let mut s = String::new();
        std::io::stdin().read_line(&mut s).unwrap();
        let s = s.trim_right().to_owned();
        s.parse().unwrap()
    };


    let s = {
        let mut s = String::new();
        std::io::stdin().read_line(&mut s).unwrap();
        let s = s.trim_right().to_owned();
        s
    };

    let ans: String = s.chars().map(|c| shift(c, n)).collect();
    println!("{}", ans);
}

fn shift(c: char, n: u8) -> char {
    let a = 'A' as u8;
    let code_c = c as u8;
    let diff = code_c - a + n;
    (a + (diff % 26)) as char
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn one() {
        assert_eq!('B', shift('A', 1));
        assert_eq!('C', shift('B', 1));
    }

    #[test]
    fn two() {
        assert_eq!('C', shift('A', 2));
    }

    #[test]
    fn z() {
        assert_eq!('A', shift('Z', 1));
    }
}


Measured memory_bytes: 4352
#include<iostream>
#include<algorithm>
#include<math.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,n0,n) for(int i=n0;i<n;i++)
#define Com(i,j,n) for(int i=0;i<n-1;i++)for(int j=i+1;j<n;j++)
#define W(x) cout<<x<<endl;
#define Debug(x) cout<<"#DEBUG "<<x<<endl;
using namespace std;

int main()
{
    int h,w;
    cin>>h>>w;
    int a[h+2][w+2];
    rep(i,w+2)
    {
        a[0][i]=0;
        a[h+1][i]=0;
    }
    rep(i,h+2)
    {
        a[i][0]=0;
        a[i][w+1]=0;
    }
    char c;
    rep(i,h)
    {
        rep(j,w)
        {
            cin>>c;
            if(c=='.')
            {
                a[i+1][j+1]=0;
            }
            else a[i+1][j+1]=1;
        }
    }
    bool f=true;
    rep(i,h)
    {
        rep(j,w)
        {
            if(a[i+1][j+1]==1)
            {
                if(a[i][j+1]==1||a[i+2][j+1]==1||a[i+1][j]==1||a[i+1][j+2]==1)
                {}
                else f=false;
            }
        }
    }
    if(f) W("Yes")
    else W("No")
    return 0;
}

Measured memory_bytes: 256
/*
  AUTHOR:SOURABH
  CREATED:23:06:20
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define ordered_set tree<pii , null_type, less< pii >, rb_tree_tag, tree_order_statistics_node_update>
#define ll long long int
#define ld long double
#define fi first
#define se second
#define pb push_back
#define pob pop_back
#define W while
#define fn(i,x) for(i=0;i<x;i++)
#define fs(i,s,x) for(i=s;i<x;i++)
#define fr(i,x) for(i=x;i>=0;i--)
#define fit(it,s) for(it=s.begin();it!=s.end();it++)
#define mp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vii vector<int>
#define vll vector<ll>
#define mii map<int,int>
#define mll map<ll,ll>
#define mod 1000000007
#define MAX 100005
#define M 32

using namespace std;
using namespace __gnu_pbds;

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

    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);

    ll t,n,m,k,i,j,curr,rem,ans;
    t=1;
    //cin>>t;
    W(t--)
    {
        cin>>n>>m>>k;
        vll a(n),b(m),pre(m);
        fn(i,n)
        cin>>a[i];
        fn(i,m)
        cin>>b[i];
        pre[0]=b[0];
        fs(i,1,m)
        pre[i]=pre[i-1]+b[i];
        curr=ans=0;
        rem=k;
        j=upper_bound(pre.begin(),pre.end(),rem)-pre.begin();
        ans=max(j,ans);
        fn(i,n)
        {
            curr+=a[i];
            if(curr>k)
            break;
            rem=k-curr;
            j=upper_bound(pre.begin(),pre.end(),rem)-pre.begin();
            ans=max(i+1+j,ans);
        }
        cout<<ans;
    }
    return 0;
}




























Measured memory_bytes: 7940
#include <iostream>
#include <bitset>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <regex>
using namespace std;
using ll = long long int;
using dd = long double;
const ll MOD = 1e9 + 7;

vector<string> dfs(string s, ll depth, vector<char> symbol)
{
    vector<string> ret;
    if (depth == 0)
    {
        ret.push_back(s);
        return ret;
    }

    for (ll i = 0; i < symbol.size(); i++)
    {
        auto vec = dfs(s + symbol[i], depth - 1, symbol);
        for (auto &&e : vec)
        {
            ret.push_back(e);
        }
    }
    return ret;
}

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

enum Tenki
{
    Sunny,
    Cloudy,
    Rainy
};

int main()
{
    ll n, m;
    cin >> n >> m;
    cout << (n-1) * (m-1) << endl;
}

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

int main() {
	long int n, max_old=0,max_new=0;
	long int left=0,right=0;

	scanf("%ld",&n);
	for (int i = 1; i <= n; i++) {
		scanf("%ld", &right);
		
		if (left >= right) {
			max_new++;
			//printf("max_new=%ld\n", max_new);
		}
		else {
			//printf("max_new=%ld\n", max_new);
			if (max_old <= max_new) {
				max_old = max_new;
			}
			max_new = 0;
		}
		left = right;
		//printf("left=%ld\n", left);
	}
	if (max_old <= max_new)
		printf("%ld", max_new);
	else printf("%ld", max_old);
}


Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<set>
#include<string>
#include<map>
#include<string.h>
#include<complex>
#include<math.h>
#include<queue>
#include <functional>
#include<time.h>
#include <stack>
#include<iomanip>
using namespace std;
#define rep(i,a,n) for(int i=(a);i<(n);i++)
#define ll long long
#define llint long long int
#define reverse(v)  reverse(v.begin(), v.end());
#define Yes(ans) if(ans)cout<<"Yes"<<endl; else cout<<"No"<<endl;
#define YES(ans) if(ans)cout<<"YES"<<endl; else cout<<"NO"<<endl;
#define hei(a) vector<a>
#define whei(a) vector<vector<a>>
#define UF  UnionFind 
#define Pint pair<ll,ll>
#define keta(a)  fixed << setprecision(a)
#define ld long double
constexpr auto INF = (ll)1000000000000;
constexpr auto mod = 1000000007;
//辞書順はnext_permutation( begin( v ), end( v ) );やで！
struct edge { ll to, cost; };

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

long long modpow(long long a, long long n, long long mod) {
	long long res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}

// mod. m での a の逆元 a^{-1} を計算するよ！
long long modinv(long long a, long long m) {
	long long b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}


//aCbをmod.mで割った余りを求める
ll int c(ll int a, ll int b, ll int m) {
	ll int ans = 1;
	for (ll int i = 0; i < b; i++) {
		ans *= a - i;
		ans %= m;
	}
	for (ll int i = 1; i <= b; i++) {
		ans *= modinv(i, m);
		ans %= m;
	}
	return ans;
}
struct UnionFind {
	vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

	UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
		for (int i = 0; i < N; i++) par[i] = i;
	}
	int size(int a) {
		return par[root(a)];
	}

	int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
		if (par[x] == x) return x;
		return par[x] = root(par[x]);
	}

	void unite(int x, int y) { // xとyの木を併合
		int rx = root(x); //xの根をrx
		int ry = root(y); //yの根をry
		if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
		par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
	}

	bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
		int rx = root(x);
		int ry = root(y);
		return rx == ry;
	}
};
whei(edge) G(101);
void dijksra(ll s,vector<ll>&d) {  //d[i]はSからの最短距離(初期化はINF)
	priority_queue<Pint, vector<Pint>, greater<Pint>> que;
	que.push(Pint(0, s));
	d[s] = 0;  
	while (!que.empty()) {
		Pint P = que.top();
		que.pop();
		int v = P.second;
		for (auto x : G[v]) {
			if (d[x.to] > d[v] + x.cost) {
				d[x.to] = d[v] + x.cost;
				que.push(Pint(d[x.to], x.to));
			}
		}
	}
}

int main(){
	int n,p;
	cin >> n >> p;
	hei(int) a(n);
	rep(i, 0, n) {
		cin >> a[i];
		a[i] %= 2;
	}
	ll dp[51][2] = { 0 };
	dp[0][0] = 1;
	rep(i, 0, n) {
		rep(j, 0, 2) {
			dp[i + 1][(j + a[i]) % 2] += dp[i][j];
			dp[i + 1][j] += dp[i][j];
		}
	}
	cout << dp[n][p] << endl;
	return 0;
}


Measured memory_bytes: 256
def c_rectangle_cutting(W, H, X, Y):
    if (W % 2 == 0 and H % 2 == 0) and (X == W // 2 and Y == H // 2):
        return '{} {}'.format(H * W / 2, 1)
    return '{} {}'.format(H * W / 2, 0)

W, H, X, Y = [int(i) for i in input().split()]
print(c_rectangle_cutting(W, H, X, Y))

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

int main(){
	int input,h,m,s;
	cin >> input;
  /* s%3600  */
	s = input%60;
	m = (input - s)/60%60;
	h = (input - s - m*60)/3600;

	cout << h << ":" << m << ":" << s << endl;
}


Measured memory_bytes: 3132
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e18;
const ll MOD = 1e9 + 7;
#define all(v) v.begin(), v.end()
#define repi(i, n, init) for (ll i = init; i < (n); i++)
#define repd(i, n, init) for (ll i = (n); i >= init; i--)
#define repm(i, m) for (auto i = m.begin(); i != m.end(); i++)
#define repb(bit, n, init) for (ll bit = init; bit < (1 << n); ++bit)

int main()
{
    ll n;
    cin >> n;
    ll b, f, r, v;
    vector<vector<vector<ll>>> dormitory(4, vector<vector<ll>>(3, vector<ll>(10, 0)));
    repi(i, n, 0)
    {
        cin >> b >> f >> r >> v;
        dormitory.at(b - 1).at(f - 1).at(r - 1) += v;
    }
    ll cnt = 0;
    for (auto b : dormitory)
    {
        for (auto f : b)
        {
            for (auto r : f)
            {
                cout << " " << r;
            }
            cout << endl;
        }
        cout << (cnt++ != 3?"####################\n":"");
    }
    return 0;
}


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

using namespace std;

#define INF 1000000007
#define LINF (1LL << 62)
#define PI 3.14159265358979

typedef long long i64;
typedef pair<i64,i64> P;

inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }

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



int n, a[202020];
void solve(){
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> a[i];
		a[i] -= i+1;
	}
	sort(a,a+n);
	
	i64 cnt = 0;
	for(int i = 0; i < n; i++){
		cnt += abs(a[n/2]-a[i]);
	}
	cout << cnt << endl;
}

int main(){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	int t = 1;
	//cin >> t;
	while(t--){
		solve();
	}
	
	return 0;
}

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

int main(int argc, char const *argv[]) {
    int N, count=0;
    cin >> N;
    vector<int> P(N);
    
    for (int i=0; i<N; i++) {
        cin >> P.at(i);
    }

    for (int i=1; i<N-1; i++) {
        vector<int> check(3);
        check.at(0) = P.at(i-1);
        check.at(1) = P.at(i);
        check.at(2) = P.at(i+1);

        sort(check.begin(), check.end());
        if (check.at(1) == P.at(i)) {
            count++;
        }
    }
    
    cout << count << endl;

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
string s;
int a[100010],x=1,n,b[100010]={1};
int main(){
	cin>>s;n=s.size();
	for (int i=0;i<n;){
		int num=0,sum=0,j;
		while (i<n&&s[i]=='R') num++,i++;
		j=i;
		while (i<n&&s[i]=='L') sum++,i++;
		if (num==sum)
			a[j-1]=(num+sum)/2,a[j]=(num+sum)/2;
		else if (num<sum){
			a[j-1]=(sum+num)/2;a[j]=(sum+num+1)/2;
			if (sum%2==0) swap(a[j-1],a[j]);
		}
		else{
			a[j-1]=(sum+num+1)/2;a[j]=(sum+num)/2;
			if (num%2==0) swap(a[j-1],a[j]);
		}
	}
	for (int i=0;i<n;i++) cout<<a[i]<<' ';
	return 0;
}

Measured memory_bytes: 1024
from collections import deque


def solve(maze, init_y, init_x, H, W):
    distances = [[-1 for _ in range(W)] for _ in range(H)]
    distances[init_y][init_x] = 0

    def is_inside(y, x):
        return 0 <= x < W and 0 <= y < H

    def need_to_search(y, x):
        return maze[y][x] != "#" and distances[y][x] == -1

    four_directions = [
        (-1, 0),
        (1, 0),
        (0, -1),
        (0, 1),
    ]

    q = deque()
    q.appendleft([init_y, init_x])

    while q:
        y, x = q.pop()
        d = distances[y][x]

        for dy, dx in four_directions:
            ny, nx = y+dy, x+dx
            if not is_inside(ny, nx):
                continue
            if need_to_search(ny, nx):
                q.appendleft([ny, nx])
                distances[ny][nx] = d+1

    farthest = 0
    for i in range(H):
        for j in range(W):
            if maze[i][j] != "#":
                farthest = max(farthest, distances[i][j])
    return farthest


def main():
    H, W = map(int, input().split())
    maze = [input() for _ in range(H)]

    farthest = 0
    for i in range(H):
        for j in range(W):
            if maze[i][j] == "#":
                continue
            distance = solve(maze, i, j, H, W)
            farthest = max(distance, farthest)

    print(farthest)


if __name__ == '__main__':
    main()


Measured memory_bytes: 3316
module SS = Set.Make(String);;

let _ =
  let n = read_int () and
      s = SS.empty
  in
  let rec read s = function
      0 -> ()
    | i ->
       let line = read_line () |> Str.split (Str.regexp " ") |> Array.of_list in
       if line.(0) = "insert" then
         read (SS.add line.(1) s) (i-1)
       else if line.(0) = "find" then
         begin
           if SS.mem line.(1) s then print_endline "yes"
           else print_endline "no"
          ;read s (i-1)
         end
  in read s n;;

Measured memory_bytes: 37240
# -*- coding:utf-8 -*-
#ICPC得点集計ソフトウェア
import sys
def solve(n):
	nums = []
	for i in xrange(n):
		temp = input()
		nums.append(temp)
	nums.sort()
	sum = 0
	for i in xrange(1,n-1):
		sum += nums[i]
	return sum / (n-2)


if __name__ == "__main__":
	while 1:
		N = input()
		if N == 0:
			sys.exit()
		else:
			print solve(N)

Measured memory_bytes: 4228
#include <iostream>

using namespace std;
int n,q,m;
int A[20];
bool solve(int i,int m){
    if(m==0)
        return true;
    if(i>=n){
        return false;
    }
    bool res= solve(i+1,m)||solve(i+1,m-A[i]);
    return res;
}
int main()
{
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>A[i];
    }
    cin>>q;
    for(int i=0;i<q;i++){
        cin>>m;
        bool flag = solve(0,m);
        if(flag == true){
            cout<<"yes"<<endl;
        }else{
            cout<<"no"<<endl;
        }
    }
    return 0;
}



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

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
  
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n;
    cin>>n;
    long long int dp[n+1][3];
    dp[0][0]=0;
    dp[0][1]=0;
    dp[0][2]=0;
    long long int a,b,c;
    for (int i=1;i<=n;i++){
        cin>>a>>b>>c;
        dp[i][0]=max(dp[i-1][1],dp[i-1][2])+a;
        dp[i][1]=max(dp[i-1][0],dp[i-1][2])+b;
        dp[i][2]=max(dp[i-1][0],dp[i-1][1])+c;
    }
    cout<<max(max(dp[n][0],dp[n][1]),dp[n][2])<<"\n";
	return 0;
}

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


int main()
{
	int i, j, k, ans,l, m,sum,flag;
	sum = 0;
	flag = 0;
	ans = 0;
	long long int N,M,K;
	cin >> N>>K;
	vector<int>A(N);
	for (i = 0; i<N; i++) {
		cin >> A[i];
		
	}
	for (i = 0; i < N; i++) {
		if (A[i] != 1) {
			ans++;
		}
		else
			break;
	}

		if ((N - 1) % (K - 1) == 0) {
			cout << (N - 1) / (K - 1) << endl;
		}
		else
			cout << (N - 1) / (K - 1) + 1 << endl;

    return 0;
}



Measured memory_bytes: 640
package main

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

func main() {
	n := readInt()

	m, cnt, pre := 0, 0, 0
	for i := 0; i < n; i++ {
		h := readInt()
		if h <= pre {
			cnt++
		} else {
			m = max(m, cnt)
			cnt = 0
		}
		pre = h
	}
	m = max(m, cnt)

	fmt.Println(m)
}

// sort ------------------------------------------------------------

type xxx struct {
	x int
}

type sortArray []xxx

func (s sortArray) Len() int           { return len(s) }
func (s sortArray) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
func (s sortArray) Less(i, j int) bool { return s[i].x < s[j].x }

// -----------------------------------------------------------------

var (
	readString func() string
	readBytes  func() []byte
)

func init() {
	readString, readBytes = newReadString(os.Stdin)
}

func newReadString(ior io.Reader) (func() string, func() []byte) {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	f1 := func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
	f2 := func() []byte {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Bytes()
	}
	return f1, f2
}

func readInt() int {
	return int(readInt64())
}

func readInt64() int64 {
	i, err := strconv.ParseInt(readString(), 10, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(readString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

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

func sum(a []int) int {
	var ret int
	for i := range a {
		ret += a[i]
	}
	return ret
}

func sumFloat64(a []float64) float64 {
	var ret float64
	for i := range a {
		ret += a[i]
	}
	return ret
}

func gcd(m, n int) int {
	for m%n != 0 {
		m, n = n, m%n
	}
	return n
}

func lcm(m, n int) int {
	return m / gcd(m, n) * n
}


Measured memory_bytes: 2176
import io
import sys
def solve(lista):    
    listb = []
    hantei = "true"
    for i in lista:
        if i not in listb:
            listb.append(i)
        else:
            hantei = "false"
    for i in range(len(listb)-1):
        if listb[i][-1] != listb[i+1][0]:
            hantei = "false"
    if hantei == "true":
        return("Yes")
    else:
        return("No")
# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line1 = sys.stdin.readline().rstrip()
    lista = []
    for i in range(int(line1)):
        line2 = sys.stdin.readline().rstrip()
        lista.append(line2)
    return (lista)

def main():
    a = readQuestion()
    answer = solve(a)
    print(answer)
    
if __name__ == '__main__':
    main()

Measured memory_bytes: 3064
import scala.io.StdIn.readLine

object Main{
  def main(args: Array[String]): Unit = {
    val a = readLine.split(" ").map(_.toInt)
    var W = a(0)
    var H = a(1)
    var x = a(2)
    var y = a(3)
    var r = a(4)
    var ans = "No"
    if(r <= x && r <= y && x + r <= W && y + r <= H) {
      ans = "Yes"
    }
    printf("%s\n", ans)
  }
}

Measured memory_bytes: 43964
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<vector>
#include<functional>
#include<algorithm>
#include<stdlib.h>
#include<string>
#include<string.h>
#define _USE_MATH_DEFINES
#include<math.h>
#include<deque>
#include<set>
#include<map>
#include<queue>
#include<list>
#include<iostream>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(auto i=a;i<b;i++)
#define all(_x) _x.begin(), _x.end()
#define r_sort(_x) sort(_x.begin(), _x.end(), std::greater<int>())
#define vec_cnt(_a, _n) (upper_bound(all(_a), _n) - lower_bound(all(_a), _n))
ll gcd(ll a, ll b) { return a % b == 0 ? b : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
#define INF 1 << 30
const ll mod = 1000000007;
int main() {
	int N, Y, a, b, c;
	scanf("%d%d", &N, &Y);
	Y /= 1000;
	a = Y / 10;
	b = Y / 5;
	rep(x, 0, a + 1) {
		rep(y, 0, b + 1) {
			if (N - x - y < 0)continue;
			if (Y - x * 10 - y * 5 == N - x - y) {
				printf("%d %d %d\n", x, y, N - x - y);
				return 0;
			}
		}
	}
	puts("-1 -1 -1");
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define ld long double
#define F first
#define S second
#define P pair<int,int>
#define V vector
#define pb push_back
#define mp make_pair
#define endl "\n"
#define db(...) __f(#__VA_ARGS__, __VA_ARGS__)
#define MOD 1000000007  //1e9+7

template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cout << name << " : " << arg1 << '\n'; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ',');
    cout.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}

void solve()
{
	int n; cin>>n;
	vector<int>a,b,c;
	for(int i=0,x;i<n;i++){
		cin>>x;
		a.pb(x);
	}
	for(int i=0,x;i<n;i++){
		cin>>x;
		b.pb(x);
	}
	for(int i=0,x;i<n-1;i++){
		cin>>x;
		c.pb(x);
	}
	int ans=0;
	for(int i=0;i<n;i++){
		ans+=b[a[i]-1];
		if(i>0 && a[i]-a[i-1]==1){
			ans+=c[a[i]-2];
		}
	}
	cout<<ans<<endl;
}
	
int32_t main()
{
    ios_base:: sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    //int t; cin>>t;
    //while(t--)
    solve();
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
using namespace std;
typedef long long ll;
int main()
{
    int n;
    int ls;
    cin>>n;
    if(n%2==1)
        ls=n/2+1;
    else
        ls=n/2;
    double sc=ls*1.0/n;
    cout<<sc<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<cstdlib>
#include<iostream>
#include<cstdio>
#include<algorithm>
#define MAXN 30
#define LL long long int 
using namespace std;
int b[MAXN];
int main()
{
	int n;
	cin>>n;
	for(int i=1;i<n;i++)cin>>b[i];
	b[0]=99999999;
	b[n]=99999999;
	LL ans=0;
	for(int i=1;i<=n;i++)
		ans+=min(b[i],b[i-1]);
	cout<<ans<<endl; 
	return 0;
}

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

int main() {
	int mod=1e9+7;
	int n;
	cin>>n;
	long long int dp[n+7];
	dp[1]=0;
	dp[2]=0;
	dp[3]=1;
	dp[4]=1;
	dp[5]=1;
	dp[6]=2;
	for(int i=7;i<=n;i++)dp[i]=(dp[i-3]*2+dp[i-4]+dp[i-5])%mod;
	cout<<dp[n];
	return 0;
}

Measured memory_bytes: 3596
#include <stdio.h>
#include <string.h>

typedef long long ll;
ll max(ll a, ll b){ return ( a > b )?a:b;}
ll min(ll a, ll b){ return ( a < b )?a:b;}

ll N;
int main(){
        scanf("%lld",&N);
        for(int i = 0; i <= 25; i++){
                for(int j = 0; j <= 15; j++){
                        if(4*i + j*7 == N){
                                puts("Yes");
                                return 0;
                        }
                }
        }
        puts("No");
}

Measured memory_bytes: 128
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;
 
int main()
{
    int n;
    cin>> n;
    string str;
    int a[8]; 
    vector<string>s;
    for(int i=0;i<n;i++){
       cin>>str;
       s.push_back(str);      
    }
    for(int i=0;i<n;i++){
       string str2=s[i];
       int a[8]={0};
       for(int j=0;j<8;j++){
           a[j]=str2[j]-'0';
      } 
      sort(a,a+8);
      int max=0,min=0,t=1;
      for(int i=0;i<8;i++){
          min+=a[7-i]*t;
          t*=10;
      }
      t=1;
      for(int i=0;i<8;i++){
          max+=a[i]*t;
          t*=10;
      }  
      cout<<(max-min)<<endl;
    }    
    return 0;
}

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

int main() {
	int a,b;
  	cin>> a >> b;
  
  	if(a<b){
      for(int i=0;i<b;i++){
     	cout<<a; 
      }
      cout<<endl;
    }
  	else{
      for(int i=0;i<a;i++){
     	cout<<b; 
      }
     	cout<<endl; 
    }
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long ll;

int main() {
	ll n;
	cin >> n;
	ll ans = 0;
	for (ll i = 1; i <= n - 1; i++) {
		ans += i;
	}

	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ff first
#define ss second
#define len(x) (int)(x.size())
#define all(x) x.begin(), x.end()
using namespace std;
using ll = long long;
using ii = pair<int, int>;
#define MAXN 100010
#define MAXLOGN 20
#define comp(a, b) max((a), (b))
int st[MAXN][MAXLOGN];

void init(int* bg, int*en){
	int sz = int(en-bg);
	for(int i=0; i<sz; ++i) st[i][0] = bg[i];
	for(int j=1; 1 << j <= sz; ++j)
		for(int i=0; i + (1<<j) <= sz; ++i)
			st[i][j] = comp(st[i][j-1], st[i + (1<<(j-1))][j-1]);
}
int query(int l, int r){
	int k = (int) floor(log((double)r-l+1) / log(2.0));
	return comp(st[l][k], st[r-(1<<k)+1][k]);
}

int pos[MAXN];
int vs[MAXN];

int greaterLeft(int l, int r, int x){
	if(l>r) return -1;
	int y = query(l, r);
	if(y<=x) return -1;

	++r;
	while(r-l>1){
		int k = l + (r-l)/2;
		y = query(k, r-1);
		if(y>x) l = k;
		else r = k;
	}
	return vs[l];
}
int greaterRight(int l, int r, int x){
	if(l>r) return -1;
	int y = query(l, r);
	if(y<=x) return -1;

	--l;
	while(r-l>1){
		int k = l + (r-l)/2;
		y = query(l+1, k);
		if(y>x) r = k;
		else l = k;
	}
	return vs[r];
}
int main(){
	int n;
	scanf("%d", &n);
	for(int i=0; i<n; ++i)
		scanf("%d", &vs[i]), pos[vs[i]] = i;
	init(vs, vs+n);
	ll ans = 0;
	for(int x=1; x<=n; ++x){
		int y;
		ll res = 0;

		// Left
		y = greaterLeft(0, pos[x]-1, x);
		//cout << pos[x]-1 << endl;
		//cout << x << "*(";
		if(y>x){
			int xl = greaterLeft (0, pos[y]-1, x);
			int xr = greaterRight(pos[x]+1, n-1, x);
			ll r1, r2;
			if(xl==-1) r1 = pos[y]+1;
			else r1 = pos[y]-pos[xl];
			if(xr==-1) r2 = n-pos[x];
			else r2 = pos[xr]-pos[x];
			res += r1*r2*ll(x);
		//	cout << r1 << "*" << r2;
		}
		y = greaterRight(pos[x]+1, n-1, x);
		if(y>x){
			int xl = greaterLeft (0, pos[x]-1, x);
			int xr = greaterRight(pos[y]+1, n-1, x);
			ll r1, r2;
			if(xl==-1) r1 = pos[x]+1;
			else r1 = pos[x]-pos[xl];
			if(xr==-1) r2 = n-pos[y];
			else r2 = pos[xr]-pos[y];
			res += r1*r2*ll(x);
		//	cout << " + "<< r1 << "*" << r2;
		}
		//cout << ") " << endl;
		ans += res;
	}
	cout << ans << endl;
}


Measured memory_bytes: 8832
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>

using namespace std;

const int MAXN = 100000 + 10000;

int n, m, k;
int p[MAXN], d[MAXN];
vector<int> v1, v2;
int ans[MAXN];

int main()
{
	ios::sync_with_stdio(false);
	// freopen("1.in", "r", stdin);
	// freopen("1.out", "w", stdout);

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

	for(int i = 1; i <= n; i++)
		(d[i] == 1 ? v1 : v2).push_back(p[i]);

	int tag = 0;
	if(d[1] == 1)
	{
		for(int i = 0; i < v2.size(); i++)
		{
			int d = ((v2[i] - p[1]) % m + m) % m;
			if(2 * k - 1 >= d)
				tag += (2 * k - d - 1) / m + 1;
		}
	}
	else
	{
		for(int i = 0; i < v1.size(); i++)
		{
			int d = ((p[1] - v1[i]) % m + m) % m;
			if(2 * k >= d)
				tag -= (2 * k - d) / m + 1;
		}
	}
	tag = (tag % n + n) % n;

	vector<pair<int, int> > arr;
	int np1 = ((p[1] + (d[1] == 1 ? k : -k)) % m + m) % m;
	for(int i = 1; i <= n; i++)
	{
		int np = ((p[i] + (d[i] == 1 ? k : -k)) % m + m) % m;
		arr.push_back(make_pair(((np - np1) % m + m) % m, np));
	}
	sort(arr.begin(), arr.end());
	for(int i = 0; i < arr.size(); i++)
		ans[tag + 1] = arr[i].second, tag = (tag + 1) % n;

	for(int i = 1; i <= n; i++)
		cout << ans[i] << endl;

	return 0;
}


Measured memory_bytes: 3740
#include <stdio.h>
//提出するとき問題番号変えんの忘れるわぁ
int main(void){
	long long int x, y=0,r, i=0;
	scanf("%ld",&x);
	r = x;
	r = x % 11;
	x = x - r;
	i = 2 * x / 11;
	
	i = (r == 0) ? i : i + 1;
	i = (r < 7) ? i : i + 1;
	
	printf("%ld\n",i);
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define rep(i,c) for(int i=0;i<(int)c;i++)
#define print(var) cout<<var<<endl;
#define DEBUG(var) cerr<<var<<endl;
// puts("str");

const int inf = 1000000000;//10^9

int main (){
  int N;
  int count=0;
  cin>>N;
  vector<int> A(N);
  rep(i,N) {
    cin >>A[i];
    A[i]--;
  }
  rep(i,N){
    if(A[A[i]]==i){
      count++;
    }
  }

  cout<<count/2<<endl;

  return 0;

}


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

using namespace std;

int main()
{
    long long int n,x,t;
    cin>>n>>x>>t;
  	if(n%x==0) cout<<(n/x)*t<<endl;
  	else cout<<(n/x+1)*t<<endl;
    

    return 0;
}

Measured memory_bytes: 3632
#include <iostream>
using namespace std;
int main(){
    int x,a,b;
    cin>>x>>a>>b;
  	if(b-a<=0) cout<<"delicious"<<endl;
  else if(b-a<=x)cout<<"safe"<<endl;
  else cout<<"dangerous"<<endl;
    /*if(b-a<=x&&b-a>=0) cout<<"safe"<<endl;
    else if(b-a<0) cout<<"delicious"<<endl;
    else cout<<"dangerous"<<endl;*/


}

Measured memory_bytes: 256
#import sys
#input = sys.stdin.readline
def main():
    N = int( input())
    A = list( map( int, input().split()))
    B = [ (A[i], i+1) for i in range(N)]
    B.sort()
    print( " ".join( map( str, map( lambda x:x[1], B))))
if __name__ == '__main__':
    main()


Measured memory_bytes: 24192
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.StringTokenizer;

public class Main {
	
	public static void main(String[] args) throws InterruptedException {
		FastScanner fs=new FastScanner();
		int n=fs.nextInt(), nQ=fs.nextInt();
		
		int[] a=fs.readArray(n);
		int[] lastSeen=new int[n+10];
		Arrays.fill(lastSeen, n);
		BIT bit=new BIT(n+100);
		
		Query[] queries=new Query[nQ];
		ArrayList<Query>[] queriesAt=new ArrayList[n];
		for (int i=0; i<n; i++) queriesAt[i]=new ArrayList<>();
		for (int qq=0; qq<nQ; qq++) {
			int l=fs.nextInt()-1, r=fs.nextInt()-1;
			Query q=new Query(l, r);
			queries[qq]=q;
			queriesAt[l].add(q);
		}
		
		for (int l=n-1; l>=0; l--) {
			bit.update(lastSeen[a[l]], -1);
			bit.update(l, 1);
			lastSeen[a[l]]=l;
			
			for (Query qq: queriesAt[l]) {
				qq.ans=bit.read(qq.r);
			}
		}
		PrintWriter out=new PrintWriter(System.out);
		for (Query qq:queries)
			out.println(qq.ans);
		out.close();
	}
	
	static class Query {
		int l, r, ans;
		public Query(int l, int r) {
			this.l=l;
			this.r=r;
		}
	}
	
	static class BIT {
		int n;
		int[] tree;
		
		public BIT(int n) {
			this.n = n;
			tree = new int[n + 2];
		}
		
		int read(int i) {
			i++;
			int sum = 0;
			while (i > 0) {
				sum += tree[i];
				i -= i & -i;
			}
			return sum;
		}
		
		void update(int i, int val) {
			i++;
			while (i <= n) {
				tree[i] += val;
				i += i & -i;
			}
		}

		// if the BIT is a freq array, returns the
		// index of the kth item, or n if there are fewer
		// than k items.
		int getKth(int k) {
			int e=Integer.highestOneBit(n), o=0;
			for (; e!=0; e>>=1) {
				if (e+o<=n && tree[e+o]<=k) {
					k-=tree[e+o];
					o+=e;
				}
			}
			return o;
		}
		
	}

	
	void sort(int[] a) {
		ArrayList<Integer> list=new ArrayList<>();
		for (int i:a) list.add(i);
		Collections.sort(list);
		for (int i=0; i<a.length; i++) a[i]=list.get(i);
	}
	
	
	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		
		public String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
			
		}
		
		public int nextInt() {
			return Integer.parseInt(next());
		}
		
		public int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		
		public long nextLong() {
			return Long.parseLong(next());
		}
		
		public long[] readLongArray(int n) {
			long[] a=new long[n];
			for (int i=0; i<n; i++) a[i]=nextLong();
			return a;
		}
	}

}


Measured memory_bytes: 108820
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(long long)(n);i++)
#define all(a) a.begin(), a.end()
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
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=1e9+7;
const ll INF=1e18;
const int MAX=510000;
const double pi=acos(-1);
int dx[8] = {1,0,-1,0,1,1,-1,-1};
int dy[8] = {0,1,0,-1,-1,1,1,-1};
// int d[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false); 
  vector<int>a(101);
  
  rep(i,3){
    int c;
    cin >> c;
    a[c]++;
  }
  int ans= 0;
  for(int i=1;i<=100;i++){
    if(a[i])ans++;
  }
  cout << ans << endl;

  return 0;
}


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

int main() {
  int n,c,k;
  cin>>n>>c>>k;  
  vector<int>t(n);
  int ans=0;
  rep(i,n){
    cin>>t.at(i);
  }
  sort(t.begin(),t.end());
  int ch=t.at(0);
  int co=0;
  rep(i,n){
    if(co<c&&t.at(i)<=ch+k){
      co++;
    }
    else{
      
        ch=t.at(i);
        co=1;
        ans++;
      }
      
    
  }
  ans++;
  cout<<ans<<endl;
  
}

Measured memory_bytes: 640
<?php
const INPUT_DELIMITER = " ";
const OUTPUT_DELIMITER = " ";

$input1 = fgets(STDIN);
$input2 = fgets(STDIN);
$inputArray = explode(INPUT_DELIMITER, $input2);

$nums = [];
foreach ($inputArray as $input) {
    $nums[] = (int)$input;
}

$count = 0;
for ($i = 1; $i < $input1 - 1; $i++) {
    $array = [$nums[$i-1], $nums[$i], $nums[$i+1]];
    sort($array);
    if ((int)$array[1] == (int)$nums[$i]) {
        $count++;
    }
}

echo $count;


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

int main()
{
	int n,b;
   	cin>>n>>b;
    
   	if(n>=13)
    {
      cout<<b<<endl;
    }
    
    else if(n>5 && n<13)
    {
		 cout<<b/2<<endl;
    }
    
    else 
    {
		 cout<<"0"<<endl;
    }
  
  
}



Measured memory_bytes: 256
n, k = map(int, input().split())
s = list(input())

s.append("")

current = 0
l = []
for i in range(n+1):
    if s[i] != s[current]:
        l.append(i-current)
        current = i

if s[0] == "0":
    l.insert(0, 0)
if s[-2] == "0":
    l.append(0)

cusum = [0]*(len(l)+1)
for i in range(len(l)):
    cusum[i+1] = cusum[i]+l[i]

ans = 0
for i in range(0, len(cusum), 2):
    j = i+k*2+1
    if j >= len(cusum): j = len(cusum) - 1
    ans = max(ans, cusum[j]-cusum[i])

print(ans)


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

const int END = -1;
struct StNod
{
  int m_nKey;
  int m_nParnt;
  int m_nLeft;
  int m_nRigt;

  StNod() :
    m_nKey(END), m_nParnt(END), m_nLeft(END), m_nRigt(END)
  { }
};

void fnInput(vector<StNod> &rvoNod)
{
  StNod oNod;
  int nMaxSiz;

  cin >> nMaxSiz;
  rvoNod.resize(nMaxSiz, oNod);

  for (int i = 0; i < nMaxSiz; i++)
  {
    int nNo, nLeft, nRigt;
    cin >> nNo >> nLeft >> nRigt;

    rvoNod[nNo].m_nKey  = nNo;
    rvoNod[nNo].m_nLeft = nLeft;
    rvoNod[nNo].m_nRigt = nRigt;
    if (nLeft != END)  rvoNod[nLeft].m_nParnt = nNo;
    if (nRigt != END)  rvoNod[nRigt].m_nParnt = nNo;
  }
}

void fnPreOrder(const vector<StNod> &cnrvoNod, int nx)
{
  if (nx == END)  return;

  cout << " " << nx;
  fnPreOrder(cnrvoNod, cnrvoNod[nx].m_nLeft);
  fnPreOrder(cnrvoNod, cnrvoNod[nx].m_nRigt);
}

void fnInOrder(const vector<StNod> &cnrvoNod, int nx)
{
  if (nx == END)  return;

  fnInOrder(cnrvoNod, cnrvoNod[nx].m_nLeft);
  cout << " " << nx;
  fnInOrder(cnrvoNod, cnrvoNod[nx].m_nRigt);
}

void fnPostOrder(const vector<StNod> &cnrvoNod, int nx)
{
  if (nx == END)  return;

  fnPostOrder(cnrvoNod, cnrvoNod[nx].m_nLeft);
  fnPostOrder(cnrvoNod, cnrvoNod[nx].m_nRigt);
  cout << " " << nx;
}

void fnTreeWalk(const vector<StNod> &cnrvoNod)
{
  int nx = 0;
  while (cnrvoNod[nx].m_nParnt != END)
    nx = cnrvoNod[nx].m_nParnt;

  cout << "Preorder" << endl;
  fnPreOrder(cnrvoNod, cnrvoNod[nx].m_nKey);
  cout << endl;

  cout << "Inorder" << endl;
  fnInOrder(cnrvoNod, cnrvoNod[nx].m_nKey);
  cout << endl;

  cout << "Postorder" << endl;
  fnPostOrder(cnrvoNod, cnrvoNod[nx].m_nKey);
  cout << endl;
}

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  vector<StNod> voNod;

  fnInput(voNod);
  fnTreeWalk(voNod);
  return 0;
}

Measured memory_bytes: 3144
#include <iostream>
#include <string>
using namespace std;
long sum[100010];
int main(void){
    int N,Q;
    string S;
    cin>>N>>Q>>S;
    for(int i=1;i<N;i++){
        sum[i+1]=sum[i]+(S[i-1]=='A' && S[i]=='C');
    }
    int l,r;
    while(Q--){
        cin>>l>>r;
        cout<<sum[r]-sum[l]<<endl;
    }
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n, k;
    cin >> n >> k;
    int ans = 1;
    while (n--) {
        if (ans * 2 > ans + k) {
            ans += k;
        } else {
            ans *= 2;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
using namespace std;
typedef long long ll;
int main() {
	string s;
	cin >> s;
	if (s == "SUN") 
		cout << 7 << endl;
		if (s == "MON")
			cout <<6 << endl;
		if (s == "TUE")
			cout << 5 << endl;
		if (s == "WED")
			cout << 4 << endl;
		if (s == "THU")
			cout << 3 << endl;
		if (s == "FRI")
			cout << 2 << endl;
		if (s == "SAT")
			cout <<  1 << endl;

}







Measured memory_bytes: 256
n = int(input())

def luc(x):
    x1 = 2
    x2 = 1
    if x == 1:
        return x1
    elif x == 2:
        return x2
    else:
        for i in range(x-2):
            x1,x2 = x2, x1 + x2
        return x2

print(luc(n+1))

Measured memory_bytes: 9168
#include "bits/stdc++.h"

using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
	REP(i, v.size()) { if (i)os << " "; os << v[i]; }return os;
}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
	REP(i, v.size()) { if (i)os << endl; os << v[i]; }return os;
}

const ll INF = 1LL << 60;
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

#define int long long

inline void my_io() {

	std::ios::sync_with_stdio(false);

	std::cin.tie(0);

	cout << fixed << setprecision(10);

}

signed main() {
	ll n;
	ll ans = 0;
	ll a = 0;
	ll b = 0;
	ll d = 0;
	ll e = 0;

	cin >> n;

	vector<string> v(n);

	REP(i, n) {
		cin >> v[i];
	}

	REP(i, n) {
		if (v[i][0] == 'B') {
			b++;
		}

		if (v[i][v[i].size() - 1] == 'A') {
			a++;
		}

		if (v[i][0] == 'B' && v[i][v[i].size() - 1] == 'A') {
			d++;
		}
		
		if (v[i][0] != 'B' && v[i][v[i].size() - 1] != 'A') {
			e++;
		}

		REP(j, v[i].size() - 1) {
			if (v[i][j] == 'A' && v[i][j + 1] == 'B') {
				ans++;
			}
		}
	}

	ll c = min(a, b);

	if (d == 1 && a == 1 && b == 1) {
		c = 0;
	}

	if (c > n - e - 1) {
		c = max((ll)0, n - e - 1);
	}

	cout << ans + c << endl;
}

Measured memory_bytes: 768
K = gets.to_i

def bfs01(k)
  q, v = [[1, 1]], [0] * k
  until q.empty? do
    n, c = q.shift
    return c if n == 0
    v[n] = 1
    m = (10 * n) % K; q.unshift([m, c]) if v[m] == 0
    m = (n + 1) % K; q.push([m, c + 1]) if v[m] == 0
  end
end

puts bfs01(K)

Measured memory_bytes: 9340
int main(){
  double a[50],b[50],s,t,x;
  int n,c=1,i;
  for(;scanf("%d",&n),n;printf("%d %.1lf\n",c,fabs(s-t)),c++){
    for(i=0;i<n;i++)scanf("%lf%lf",a+i,b+i);
    for(i=s=t=0;i<n-1;i++){
      if((x=cross(a[i],b[i],a[i+1],b[i+1]))>0)
        s+=fabs(x)/2.0;
      else
        t+=fabs(x)/2;
    }
    if((x=cross(a[i],b[i],a[0],b[0]))>0)
      s+=fabs(x)/2;
    else
      t+=fabs(x)/2;
  }
}

Measured memory_bytes: 0
#define NAME "a"

#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <algorithm>
#include <set>
#include <unordered_set>
#include <bitset>
#include <map>
#include <unordered_map>
#include <ctime>
#include <cctype>
#include <cassert>
#include <memory>
#include <stack>
#include <queue>
#include <deque>
#include <utility>
#include <iterator>

#define pb push_back
#define mp make_pair
#define frs first
#define snd second

using namespace std;

#ifdef WIN32
    #define lld "%I64d"
#else
    #define lld "%lld"
#endif

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;

const int INF = (int) 1e9 + 7;
const ll INFLONG = (ll) 1e18 + 7;
const double EPS = 1e-9;

typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<char> vc;
typedef vector<string> vs;

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

typedef vector<pii> vpii;
typedef vector<pil> vpil;
typedef vector<pli> vpli;
typedef vector<pll> vpll;

template <typename T>
T sqr(T a) {
    return a * a;
}

int main() {
    srand(time(0));

//    freopen(NAME".in", "r", stdin);
//    freopen(NAME".out", "w", stdout);

    int n, m;
    scanf("%d %d", &n, &m);

    for (int i = 0; i < m; i++) {
        int x;
        scanf("%d", &x);
        n -= x;
        n = max(n, -1);
    }

    printf("%d\n", n);

//    printf("%.3lf\n", (double) clock() / CLOCKS_PER_SEC);
    return 0;
}


Measured memory_bytes: 3836