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

int main() {
    ll a, b, c, d, e, f;
    cin >> a >> b >> c >> d >> e >> f;

    ll water = 0;  // 水の量
    ll sugar = 0;  // 砂糖の量
    ll maxWater = 0;  // 水の量の最大値
    ll maxSugar = 0;  // 砂糖の量の最大値
    double maxNoudo = 0;  // 砂糖水の濃度の最大値
    // 操作1をi回行う
    exrep(i, 0, f/(100*a)) {
        // 操作2をj回行う
        exrep(j, 0, f/(100*b)) {
            water = 100*(a*i + b*j);
            ll genkaiSugar = (water/100)*e;
            // 操作3をk回行う
            exrep(k, 0, genkaiSugar/c) {
                // 操作4をl回行う
                exrep(l, 0, genkaiSugar/d) {
                    sugar = c*k + d*l;
                    if(water + sugar > f || water == 0) {
                        break;
                    }
                    double noudo = (double)(100*sugar)/(water + sugar);
                    if(genkaiSugar >= sugar && noudo >= maxNoudo) {
                        maxWater = water;
                        maxSugar = sugar;
                        maxNoudo = noudo;
                    }
                }
            }
        }
    }
    
    cout << maxWater + maxSugar << " " << maxSugar << endl;
    re0;
}

Measured memory_bytes: 256
nk = list(map(int,input().split()))
a = list(map(int,input().split()))

cli = []
for i in range(nk[0]+1):
	cli.append(0)

for i in range(nk[0]):
	cli[a[i]] += 1

c = sorted(cli, reverse = True)

m = 0
for i in range(nk[1]):
	m += c[i]

ans = nk[0] - m
if ans < 0:
	ans = 0
	
print(ans)


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

#define REP(i, n) for(int i = 0; i < n; ++i)
#define rREP(i, n) for(int i = n-1; i >= 0; --i)

using namespace std;

int main()
{
    int A, B;
    cin >> A >> B;

    int cnt = 0;

    for (int i = A; i < B+1; ++i){
        string s = to_string(i);
        if (s[0] == s[4] && s[1] == s[3])
            cnt++;
    }
    
    cout << cnt << endl;
}

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

using namespace std;
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (n); i++)
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec){os << "["; for (const auto &v : vec) {os << v << ","; } os << "]"; return os; }
template <typename T, typename U> ostream &operator<<(ostream &os, const pair<T, U> &p) {os << "(" << p.first << ", " << p.second << ")"; return os;}

vector<int> L;
int N, A, B, C;

int dfs(int i, vector<int> &choose) {
    if (i == N) {
        vector<int> sum(4);
        int cost = -30;
        for(int i = 0; i < choose.size(); i++) {
            sum[choose[i]] += L[i];
            if (choose[i]) cost += 10;
        }
        if (!sum[1] || !sum[2] || !sum[3]) return 1 << 29;
        return cost + abs(sum[1] - A) + abs(sum[2] - B) + abs(sum[3] - C); 
    } else {
        int ret = 1 << 29;
        for(int k = 0; k < 4; k++) {
            choose.push_back(k);
            ret = min(ret, dfs(i + 1, choose));
            choose.pop_back();
        }
        return ret;
    }
}

void solve() {
    cin >> N >> A >> B >> C;
    L.resize(N);
    for (int i = 0; i < N; i++) {
        cin >> L[i];
    }
    vector<int> choose;
    cout << dfs(0, choose) << endl;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(16);
    solve();
    return 0;
}

Measured memory_bytes: 256
import math
import collections
from sys import exit
from itertools import product

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n = ii()
p = [ii() for i in range(n)]
p.sort()
p[-1] //= 2
print(sum(p))

Measured memory_bytes: 9412
#include <bits/stdc++.h>
//#include "rail.h"
#define F first
#define S second
#define P push
#define pb push_back
#define MEM(dp,i) memset(dp,i,sizeof(dp))
#define W while
#define R return
#define C continue
#define SI size()
#define ll long long
#define ld long double
#define pll pair<ll,ll>
#define pii pair<int,int>
#define SF(x) scanf("%Id",&x)
#define SF2(x,y) scanf("%Id%Id",&x,&y)
#define SF3(x,y,z) scanf("%I64d%I64d%I64d",&x,&y,&z)
#define SF4(x,y,z,o) scanf("%I64d%I64d%I64d%I64d",&x,&y,&z,&o)
#define all(v) v.begin(),v.end()

using namespace std;
const long long INF = 1e16;
const long long MOD = 1e9+7;
const int MAX=100015;
vector<int> adj[MAX];
vector<pii> v;
int G[MAX];
bool vis[MAX];
int cur[MAX];
int g=0;
void DFS(int ver){
    if(vis[ver])R;
    vis[ver]=1;
    G[ver]=g;
    for(auto i : adj[ver]){
        DFS(i);
    }
}
bool bol[100005];
int main(){
    int n,m;
    cin>>n>>m;
    if(m*2<n-2){cout<<"Impossible"; R 0;}
    int x;
    for(int i=0;i<n;i++){
        cin>>x;
        v.pb({x,i});
    }
    sort(v.begin(),v.end());
    for(int i=0;i<m;i++){
        int a,b;
        cin>>a>>b;
        adj[a].pb(b);
        adj[b].pb(a);
    }
    for(int i=0;i<n;i++){
        if(vis[i])continue;
        DFS(i);
        g++;
    }
    for(int i=0;i<g;i++)bol[i]=1;
    ll d=g+g-2,res=0,z,sum=g;
    for(auto i : v){
        if(d==0)break;
        x=G[i.S];
        if(cur[x]>=g-1)continue;
        if(bol[x]==0){
            if(sum==d)continue;
        }
        else{
            sum--;
            bol[x]=0;
        }
        cur[x]++;
//        cout<<i.S<<endl;
        z=i.F;
        res+=z;
        d--;
    }
    cout<<res;
}


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

N, M = map(int, input().split())
L, R = 0, N
for i in range(M):
  l, r = map(int,input().split())
  L = max(L, l)
  R = min(R, r)
  if L > R:
    print(0)
    exit()
print(R-L+1)

Measured memory_bytes: 3064
# 18, 0, -1044

n, l = gets.split.map &:to_i
azi = []
n.times do |i|
  azi << l + i
end
arr = []
honazi = azi.inject(:+)
azi.size.times do |i|
  if i == 0

    arr << [
      azi[1..-1].inject(:+),
      honazi - azi[1..-1].inject(:+)
    ]
    next
  end
  arr << [
    (azi[0..(i-1)] + azi[(i+1)..-1]).inject(:+),
    honazi - (azi[0..(i-1)] + azi[(i+1)..-1]).inject(:+)
  ]
end
arr.sort_by!{|a|a[1].abs}
p arr[0][0]


Measured memory_bytes: 1916
function Main(input) {
  input = input.replace(/\n/g, ' ').split(" ");
  var a = input[0];
  var b = input[1];
  var ans = 10000000;
  for(var i=0;i<a.length-(b.length-1);i++){
    var p = 0;
    for(var l=0;l<b.length;l++){
      var t =a.charAt(i+l);
      var s =b.charAt(l);
      if(t!=s)p++;
    }
    if(ans>p)ans=p;
  }
  console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 32388
#include<iostream>
#include<stdlib.h>
#include<math.h>
#include<algorithm>
#include<string.h>
using namespace std;

int main()
{
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(0);
	string s; cin >> s; int n = s.length(); bool x = true;
	for (int i = 97; i <=122; i++)
	{
		 x = true;
		for (int j = 0; j < n; j++)
		{

			if (char(i) == s[j])
			{
				x = false;
				continue;

			}

		}
	
		if (x== true)
		{
			cout<<char(i)<<endl;
			return 0;
		}
	}
	if (x == false) {
		cout << "None" << endl;
		return 0;
	}
}


Measured memory_bytes: 3792
#!/usr/bin/env python

n = int(input())
s = input()

total_E = s.count('E')
total_W = n-total_E

right_E = []
tmp_E = total_E
tmp_W = 0 
for i in range(n):
    if s[i] == 'E':
       tmp_E -= 1 
    right_E.append(tmp_E)

left_W = [0] 
for i in range(1,n):
    if s[i-1] == 'W':
       tmp_W += 1 
    left_W.append(tmp_W)

candidates = []
for i in range(n):
    candidates.append(right_E[i]+left_W[i])

#print('candidates =', candidates)
#print('right_E =', right_E)
#print('left_W =', left_W)
ans = min(candidates)
print(ans)


Measured memory_bytes: 35588
#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<int,int>
#define keta(a)  fixed << setprecision(a)
constexpr auto INF = 100000000000;
constexpr auto mod = 1000000007;
//辞書順はnext_permutation( begin( v ), end( v ) );やで！
struct edge { int to, cost; };

//sは初めの点、vは頂点size、dは最短距離を求める(初期化はINF),Gは有向グラフ
void dijkdtra(int s, int v, vector<int>& d, whei(edge)& G) {
	priority_queue<Pint, vector<Pint>, greater<Pint>> que;//firstが距離、secondが頂点
	d[s] = 0;//スタートの距離はもちろんzero
	que.push(Pint(0, s));
	while (!que.empty()) {
		Pint p = que.top();
		que.pop();
		int V = p.second;
		if (d[V] < p.first)continue;
		for (int i = 0; i < G[V].size(); i++) {
			edge e = G[V][i];
			if (d[e.to] > d[V] + e.cost) {
				d[e.to] = d[V] + e.cost;
				que.push(Pint(d[e.to], e.to));
			}
		}
	}
}


int main() {
	int n;
	cin >> n;
	whei(int) a(2, hei(int)(n, 0));
	int ans = 0;
	rep(i, 0, 2)rep(j, 0, n)cin >> a[i][j];
	rep(i, 0, n) {
		int sum = 0;
		rep(j, 0, i+1) {
			sum += a[0][j];
		}
		rep(j, i, n) {
			sum += a[1][j];
		}
		ans = max(ans, sum);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <climits>
#include <iomanip>
#include <bitset>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <list>
#include <map>

using namespace std;

int main() {
  int n;
  cin >> n;
  int arr[n];
  long long sum = 0;
  int miny = 2e9;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    sum += arr[i];
    if (arr[i] % 10 != 0) {
      miny = min(miny, arr[i]);
    }
  }
  if (sum % 10 == 0) {
    if (miny == 2e9) {
      cout << 0 << endl;
      return 0;
    }
    sum -= miny;
  }
  cout << sum << endl;
  return 0;
}


Measured memory_bytes: 256
Q = int(input())
lr = [list(map(int, input().split())) for _ in range(Q)]


def IsPrime(x):
    if x == 2:
        return True
    elif x % 2 == 0:
        return False
    else:
        for i in range(3, int(x**0.5)+2, 2):
            if x%i == 0:
                return False
        else:
            return True
        

like = [False] * (10**5+1)
for i in range(3, 10**5, 2):
    like[i] = IsPrime(i) and IsPrime((i+1)//2)

ans = [0]*(10**5+1)
tmp = 0
for i in range(10**5+1):
    if like[i] == True:
        tmp += 1
    ans[i] = tmp

for i in lr:
    print(ans[i[1]]-ans[i[0]-1])

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

#define fi first
#define se second
#define pb push_back
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define MOD 1000000007

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; }

vector<int> dist(100110, 1e9);

vector<vector<int>> P(101010,vector<int>());
vector<int> ans(100010);
int N;

void dijkstra(int s) {
	priority_queue<pii, vector<pii>, greater<pii>> que;
	que.push(pii(0,s));
	while(!que.empty()) {
		pii p = que.top();
		que.pop();
		int v = p.se;
		if(dist[v] < p.fi) continue;
		//cout << "v:" << v << endl;
		for(auto k : P[v]) {
			//cout << k << endl;
			if(dist[k] > dist[v] + 1) {
				dist[k] = dist[v] + 1;
				ans[k] = v;
				que.push(pii(dist[k], k));
			}
		}
		//rep(i,N) cout << dist[i] << " ";
		//cout << endl;
	}
}

int main() {
	int M;
	cin >> N >> M;
	vector<bool> visited(N, false);
	int a,b;
	rep(i,M) {
		cin >> a >> b;
		a--,b--;
		P[a].pb(b);
		P[b].pb(a);
	}
	dist[0] = 0;
	dijkstra(0);
	bool flag = true;
	/*queue<pii> q;
	q.push(pii(0,0));
	while(!q.empty()) {
		pii c = q.front();
		q.pop();
		int cq = c.fi;
		int pl = c.se;
		if(dist[cq] < pl) continue;
		pl++;
		for(auto k : P[cq]) {
			q.push(pii(k, pl));
		}
	}*/

	if(!flag) {
		cout << "No" << endl;
		return 0;
	}
	cout << "Yes" << endl;
	for(int i=1; i<N; i++) cout << ans[i]+1 << endl;

  return 0;
}


Measured memory_bytes: 11336
package main

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

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

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

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

// min, max, asub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

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

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

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

func main() {
	sc.Split(bufio.ScanWords)
	sc.Buffer([]byte{}, 1000000)

	X := getInt()

	for i := -1000; i < 1000; i++ {
		for j := -1000; j < 1000; j++ {
			x := i*i*i*i*i - j*j*j*j*j
			if x == X {
				out(i, j)
				return
			}
		}
	}
}


Measured memory_bytes: 1756
import java.util.*;
import static java.util.Arrays.*;
import static java.lang.Math.*;

// AOJ 0047
public class Main {

	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int[] cup = {1, 0, 0};
		while (sc.hasNext()) {
			String[] ss = sc.next().split(",");
			int i1 = new Integer(ss[0].charAt(0) - 'A'), i2 = new Integer(ss[1].charAt(0) - 'A');
//			System.out.println(i1 + " " + i2);
			int tmp = cup[i1];
			cup[i1] = cup[i2];
			cup[i2] = tmp;
		}
		int idx = 0;
		for (idx = 0; ; idx++)
			if (cup[idx] == 1) break;
		System.out.printf("%c", idx + 'A');
		System.out.println();
	}
}

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

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

    vector <double> A(N);
    for(int i=0; i < N; i++){
        cin >> A.at(i);
    }

    double answer = 0;

    for(int i=0 ; i < N; i++){
        answer += 1 / A.at(i);
    }


    cout << 1 / answer << endl;

}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
#include <iomanip>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<long double> VD;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<VD> VVD;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

template<typename T> void chmin(T &a, T b) { if (a > b) a = b; }
template<typename T> void chmax(T &a, T b) { if (a < b) a = b; }

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }
#define INF 1LL<<60

int main() {
    char c;
    cin >> c;
    cout << char(c + 1) << endl;
    return 0;
}

Measured memory_bytes: 3572
//台湾旅行中
import java.util.Scanner;

public class Main {

	public static void main(String args[]) {

		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();

		System.out.println(Math.max(Math.max(A+B, A-B), A*B));
	}
}


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

using namespace std;

const int MX = 200000;

int a[MX];

int main() {
	int n;
	ignore = scanf("%d", &n);
	for (int i = 0; i < n; i++) ignore = scanf("%d", a + i);
	
	for (int i = 0; i + 1 < n; i++)
		if (a[i] + 1 < a[i + 1]) {
			printf("%d\n", -1);
			return 0;
		}
	
	if (a[0] != 0) {
		printf("%d\n", -1);
		return 0;
	}
	
	long long ans = 0;
	for (int i = n, p = -1; i >= 0; i--) {
		if (a[i] >= p) ans += a[i];
		p = a[i];
	}
	
	printf("%lld\n", ans);
	
	return 0;
}


Measured memory_bytes: 1024
/*  -*- coding: utf-8 -*-
 *
 * d.cc: D: Katana Thrower
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int MAX_N = 100000;

/* typedef */

/* global variables */

int bs[MAX_N];

/* subroutines */

/* main */

int main() {
  int n, h;
  scanf("%d%d", &n, &h);

  int maxa = 0;
  for (int i = 0; i < n; i++) {
    int ai;
    scanf("%d%d", &ai, &bs[i]);
    if (maxa < ai) maxa = ai;
  }
  sort(bs, bs + n);

  int cnt = 0;
  for (int i = n - 1; h > 0 && i >= 0 && bs[i] > maxa; i--)
    cnt++, h -= bs[i];

  if (h > 0) cnt += (h + maxa - 1) / maxa;

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


Measured memory_bytes: 640
#include <iostream>
#include <string.h>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

using namespace std; 

int main () {
  int n;
  cin >> n;
  int a[n];
  float medium = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i]; 
    medium += a[i]; 
  }
  medium = (float) medium / (float ) n;
  vector<float> p;
  for (int i = 0; i < n; i++) {
    if (a[i] <= medium){ 
      p.push_back(medium - a[i]);  
    }
    else {
      p.push_back(a[i] - medium);  
    }
  }
  float min = -1;
  int ans = -1;
  for (int i = 0; i < n; i++) {
    if (min == -1 || min > p[i]) {
      min = p[i];
      ans = i;  
    }  
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>

#define REP(i,n) for(int i=0;i<n;++i)
#define REPR(i,n) for(int i=n;i>=0;--i)
#define REPI(itr,v) for(auto itr=v.begin();itr!=v.end();++itr)
#define REPIR(itr,v) for(auto itr=v.rbegin();itr!=v.rend();++itr)
#define FOR(i,a,b) for(int i=a;i<b;++i)
#define SORT(v,n) sort(v, v+n)
#define SORTV(v) sort(v.begin(), v.end())
#define ALL(v) v.begin(),v.end()
#define llong long long
#define INF 999999999
#define SUR 1000000007
#define pb(a) push_back(a)
#define pf(a) push_front(a)
#define MP make_pair
#define SV(n,v) {int tmp;for(int i=0;i<n;++i){scanf("%d", &tmp);v.push_back(tmp);}}
int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};

using namespace std;

typedef pair<int,int> pii;

int a[5];
llong solve(bool used[5], llong sum){
  int cnt = 0;
  REP(i,5){
    if(used[i])
      cnt++;
  }
  if(cnt == 5){
    return sum;
  }

  while(sum % 10 != 0){
    sum++;
  }

  llong res = INF;
  REP(i,5){
    if(!used[i]){
      used[i] = true;
      res = min(res, solve(used, sum+a[i]));
      used[i] = false;
    }
  }
  return res;
}

int main(){

  REP(i,5){
    cin >> a[i];
  }
  bool used[5] = {};

  cout << solve(used, 0) << endl;;
  return 0;
}

Measured memory_bytes: 256
import math
a, b, x = map(int, input().split())
s = a ** 2.0
v = s * b
if v == x:
    print(0)
    exit()
elif x >= v / 2.0:
    print(math.degrees(math.atan((v-x)*2.0/s/a)))
else:
    print(90-math.degrees(math.atan(2 * x / (a*b) / b)))

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

using namespace std;
using ll = long long;
string s;
ll sum;
int main(){
    ios::sync_with_stdio(0);cin.tie(0);
    cin>>s;
    for(char c : s) sum += c-'0';
    cout<<(sum % 9 ? "No" : "Yes");
}


Measured memory_bytes: 3736
#pragma GCC optimize(3)
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
bool Finish_read;
template<class T>inline void read(T &x){Finish_read=0;x=0;int f=1;char ch=getchar();while(!isdigit(ch)){if(ch=='-')f=-1;if(ch==EOF)return;ch=getchar();}while(isdigit(ch))x=x*10+ch-'0',ch=getchar();x*=f;Finish_read=1;}
template<class T>inline void print(T x){if(x/10!=0)print(x/10);putchar(x%10+'0');}
template<class T>inline void writeln(T x){if(x<0)putchar('-');x=abs(x);print(x);putchar('\n');}
template<class T>inline void write(T x){if(x<0)putchar('-');x=abs(x);print(x);}
/*================Header Template==============*/
int n,v;
int main() {
	read(n);read(v);
	for(int i=0;i<=n;i++)
		for(int j=0;i+j<=n;j++)
			if(i*10000+j*5000+(n-i-j)*1000==v) {
				printf("%d %d %d\n",i,j,n-i-j);
				return 0;
			}
	puts("-1 -1 -1");
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
#define reps(i,s,n) for(ll (i)=(s);(i)<(n);++(i))
#define rep(i,n) reps(i,0,n)
#define reptr(i,n) for(ll (i)=(n);(i)>=0;--(i))
#define All(x) (x).begin(),(x).end()
#define Rall(a) (a).rbegin(), (a).rend()
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>
#define mp make_pair
#define pb push_back
const ll MOD=1e9+7;
const ll INF=1e10+1;
using namespace std;

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

ll N;
vector<bool> used;
vector<vector<pair<ll,ll> > > node;
//vector<vector<ll> > l;
vector<bool> color;

void dfs(ll id,ll value);

int main(){
	cin >> N;
	used = vector<bool>(N+1,false);
	node = vector<vector<pair<ll,ll> > >(N+1);
	//l = vector<vector<ll> >(N+1,vector<ll>(N+1,INF));
	color = vector<bool>(N+1, 0);

	for(ll i=0;i<N-1;i++){
		ll u,v,w;
		cin >> u >> v >> w;
		node[u].pb({v,w});
		node[v].pb({u,w});
	}

	color[1] = 1;
	dfs(1,0);

	for(ll i=1;i<=N;i++){
		if(color[i]) putchar('1');
		else putchar('0');
		putchar('\n');
	}
}

void dfs(ll id,ll value)
{
	used[id]=true;
	for(ll key=0;key<node[id].size();key++)
	{	
		ll nxnode = node[id][key].first;
		if(used[nxnode]) continue;

		ll nxvalue = value + node[id][key].second;
		if(used[nxnode]==false){
			if(nxvalue % 2 == 0){
				color[nxnode] = 1;
			}
			dfs(nxnode,nxvalue);
		}
	}
}

Measured memory_bytes: 9344
#include <stdio.h>
#include <math.h>
int main(void){
  int n,a[1000];
  scanf("%d",&n);
  int i,j,min=1E9;
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
  }
  for(i=-100;i<=100;i++){
    int cost=0;
    for(j=0;j<n;j++){
      cost+=(a[j]-i)*(a[j]-i);
    }
    if(min>cost) min=cost;
  }
  printf("%d",min);
  return 0;
}

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

int main(void){
    int n;
    long long int sum=0;
    cin>>n;
    for(int i=1;i<=n;i++){
        if(i%3==0){
            
        }else if(i%5==0){
            
        }else{
            sum+=i;
        }
    }
    cout<<sum;
}

Measured memory_bytes: 3620
class Main{
    public static void main(String[] a){

       for ( int i=1; i<=9;i++)
      {
            for (int j=1; j<=9;j++)
            {
                  System.out.println(i + "x" +j +"="+i*j);
             }//end j
      }//end i

    }
}

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

#define ll long long
#define endl "\n"
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define f first
#define s second
#define vecll vector<ll>
#define pairll pair<ll,ll>
#define vecpairll vector<pair<ll,ll>>
#define mapllll map<ll,ll>
#define mapstrll map<string,ll>
#define mapllvecll map<ll,vecll>
#define setll set<ll>
#define fio ios_base::sync_with_stdio (false); cin.tie (NULL); cout.tie(NULL);

using namespace std;

ll const N=1e5+5;
ll const inf=1e18+5;
ll const MOD=1e9+7;

ll t,n,m,x,y,z,w,k;

int main()
{
    fio

    cin>>x>>y;
    
    if(x != 1 && y != 1)    cout<<1;
    if(x != 2 && y != 2)    cout<<2;
    if(x != 3 && y != 3)    cout<<3;
    
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define ip pair<ll,ll>
// const ll INF = 1000000000000000000;
const ll MOD = 1000000007;

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

	string k;
	cin>>k;
	int d;
	cin>>d;
	int n = k.length();
	// dp[m][r] - number of m digit numbers with 0-9 with sum r mod d.
	ll dp[n][d];
	memset(dp,0,sizeof(dp));
	dp[0][0] = 1;
	for(int i=1;i<n;i++){
		for(int j=0;j<d;j++){
			dp[i][j] = 0;
			for(int k=0;k<10;k++)
				dp[i][j] += dp[i-1][(j+d-k%d)%d];
			dp[i][j] %= MOD;
		}
	}

	ll ans = 0;
	ll cur = 0;
	for(int i=0;i<n;i++){
		int idx = (int)(k[i]-'0');
		for(int j=0;j<idx;j++){
			ans += dp[n-1-i][(d-cur)%d];
			++cur;
			if(cur >= d)
				cur -= d;
		}
		ans %= MOD;
	}

	if(cur%d != 0)
		ans = (ans+MOD-1)%MOD;

	cout<<ans%MOD<<endl;
}


Measured memory_bytes: 8064
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define REP(i, n) for (int i = 0; i < (int)n; ++i)
#define RREP(i, n) for (int i = (int)n - 1; i >= 0; --i)
#define FOR(i, s, n) for (int i = s; i < (int)n; ++i)
#define RFOR(i, s, n) for (int i = (int)n - 1; i >= s; --i)
#define ALL(a) a.begin(), a.end()
#define IN(a, x, b) (a <= x && x < b)
template<class T>istream&operator >>(istream&is,vector<T>&vec){for(T&x:vec)is>>x;return is;}
template<class T>inline void out(T t){cout << t << "\n";}
template<class T,class... Ts>inline void out(T t,Ts... ts){cout << t << " ";out(ts...);}
template<class T>inline bool CHMIN(T&a,T b){if(a > b){a = b;return true;}return false;}
template<class T>inline bool CHMAX(T&a,T b){if(a < b){a = b;return true;}return false;}
constexpr int INF = 1e18;


signed main() {
    int N;
    string s;
    cin >> N >> s;
    int l = 0, r = N - 1;
    int ans = 0;
    while(l < r) {
        //out(l, r);
        while(l + 1 < N && s[l] == 'R') ++l;
        while(r - 1 >= 0 && s[r] == 'W') --r;
        if(l < r && s[l] == 'W' && s[r] == 'R') {
            ++ans;
            swap(s[l], s[r]);
            l++;--r;
        }else break;
    }
    out(ans);
}

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

using namespace std;

int main()
{
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
#endif // LOCAL
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    vector <long long> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    vector <long long> ans(n);
    ans[0] = 0;
    for (int i = n - 1; i >= 0; i--) {
        if (i & 1) ans[0] -= a[i];
        else ans[0] += a[i];
    }
    for (int i = 0; i < n - 1; i++) {
        ans[i + 1] = 2 * a[i] - ans[i];
    }
    for (int i = 0; i < n; i++) {
        cout << ans[i] << " ";
    }
    return 0;
}


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

int main() {
  for (int i = 0; i < 12; i++) {
    char c;
    scanf("%c", &c);
    if (i == 0 || i == 5 || i == 10) {
      printf("%c", c);
    }
  }
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<functional>
#include<map>
#include<cstdlib>
#include<complex>
#include<numeric>
#include<set>

using namespace std;
using Int = long long;
Int INF = 1LL << 60;
const Int MOD = 1000000007;

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	Int N;
	cin >> N;

	//vector<Int> F(N);
	//Int temp;
	//for (Int i = 0; i < N; i++) {
	//	for (Int j = 0; j < 10; j++) {
	//		cin >> temp;
	//		if (temp) {
	//			F[i] += (1LL << j);
	//		}
	//	}
	//}

	vector<vector<Int>> F(N, vector<Int>(10, 0));
	for (Int i = 0; i < N; i++) {
		for (Int j = 0; j < 10; j++) {
			cin >> F[i][j];
		}
	}

	vector<vector<Int>> P(N, vector<Int>(11, 0));
	for (Int i = 0; i < N; i++) {
		for (Int j = 0; j < 11; j++) {
			cin >> P[i][j];
		}
	}

	Int ans = -INF;
	Int temp;
	Int count;
	for (Int bit = 1; bit < (1LL<<10); bit++) {
		temp = 0;
		for (Int i = 0; i < N; i++) {
			count = 0;
			for (Int j = 0; j < 10; j++) {
				if ((bit >> j & 1) && F[i][j]) {
					count++;
				}
			}
			temp += P[i][count];
		}
		ans = max(ans, temp);
	}

	//Int ans = -INF;
	//Int temp2;//bit用
	//Int temp3;//答え用
	//Int count;
	//for (Int i = 1; i < (1LL<<10); i++) {
	//	temp3 = 0;
	//	for (Int j = 0; j < N; j++) {
	//		count = 0;
	//		temp2 = i & F[j];
	//		for (Int k = 0; k < 10; k++) {
	//			if (temp2 & (1LL << k))count++;
	//		}
	//		temp3 += P[j][count];
	//	}
	//	ans = max(ans, temp3);
	//}
	cout << ans << endl;
}

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

typedef long long ll;
typedef long double ld;
typedef vector<vector<int>> Graph;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
#define pi 3.14159265359
#define inf 2147483647
#define INF 9223372036854775807
#define mod 1000000007
#define mod2 998244353

int main() {
	ll N, K; cin >> N >> K;
	vector<ll> A(N);
	for(int i = 0; i < N; i++) cin >> A[i];
	sort(A.begin(), A.end());
	ll left = 0, right = A[N - 1] + 1;
	ll centre, ans;
	while(right - left > 1) {
		centre = (left + right) / 2;
		ll cnt = 0;
		for(int i = 0; i < N; i++) cnt += ceil((double)A[i] / (double)centre) - 1;
		if(cnt > K) left = centre;
		else {
			ans = centre;
			right = centre;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 4772
#include<iostream>

using namespace std;

int main() {
	long long int x;
	long long int g = 100;
	int count = 0;
	cin >> x;
	while (1) {
		count++;
		g *= 1.01;
		if (g >= x) {
			break;
		}
	}
	cout << count << endl;
	return 0;
}

Measured memory_bytes: 3632
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <queue>
#include <cmath>
#include <map>
using namespace std;
#pragma warning (disable: 4996)

int n, a[100009], b[100009], dist[100009], u[100009], v[100009]; vector<int>x[100009];

void dfs(int pos, int depth) {
	if (dist[pos] != -1)return;
	dist[pos] = depth;
	for (int i = 0; i < x[pos].size(); i++) dfs(x[pos][i], depth + 1);
}

int main() {
	cin >> n;
	for (int i = 0; i < n - 1; i++) { cin >> a[i] >> b[i]; x[a[i]].push_back(b[i]); x[b[i]].push_back(a[i]); }
	for (int i = 1; i <= n; i++) dist[i] = -1; dfs(1, 0); for (int i = 1; i <= n; i++)u[i] = dist[i];
	for (int i = 1; i <= n; i++) dist[i] = -1; dfs(n, 0); for (int i = 1; i <= n; i++)v[i] = dist[i];
	int r1 = 0, r2 = 0;
	for (int i = 1; i <= n; i++) {
		if (u[i] <= v[i])r1++; else r2++;
	}
	if (r1 > r2) cout << "Fennec" << endl;
	else cout << "Snuke" << endl;
	return 0;
}

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

int main(){
    int n;
    cin >> n;
    char prev;
    int ans=1;
    
    cin >> prev;
    for(int i=0;i<n-1;i++){
        char s;
        cin >> s;
        if(prev!=s) ans+=1;
        prev =s;
    }

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

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

#define REP(i, x, n) for (int i = x; i < (int)(n); i++)
#define rep(i, n) REP (i, 0, n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x.size())
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define uniq(x) x.erase(unique(x.begin(), x.end()), x.end())
#define F first
#define S second
#define mp make_pair
#define eb emplace_back

using namespace std;

typedef long long ll;

const ll INF = 1LL << 60;

int main() {
  ll N, X = INF;
  cin >> N;
  rep (i, 5) {
    ll x;
    cin >> x;
    X = min(X, x);
  }

  cout << (N / X + (N % X ? 1 : 0) + 4) << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int k,s,ans;
int main(){
	cin>>k>>s;
	for(int i=0;i<=k;i++)
		for(int j=0;j<=k;j++)
			if(s-i-j>=0&&s-i-j<=k)
				ans++;
	cout<<ans<<endl;
	return 0;
}

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

int main(void){
    string cards;
    string sub;
    int m, h, i;

    while(1){
        cin >> cards;
        if(cards == "-") break;

        int num = cards.size();
        cin >> m;

        for(i = 0; i < m; i++){
            cin >> h;
            cards += cards;
            cards = cards.substr(h, num);
        }
        cout << cards << endl;
    }
}


Measured memory_bytes: 3164
#include <bits/stdc++.h>
const int INF=1e9,MOD=1e9+7;
const long long LINF=1e18;
using namespace std;
#define int long double

//template
//main
signed main(){
  int a=0;int b=0;
  char c;
  cin>>c;c-='0';a+=c;a*=10;
  cin>>c;c-='0';a+=c;
  cin>>c;c-='0';b+=c;b*=10;
  cin>>c;c-='0';b+=c;
  for(int i=0;i<=99;i++){
    for(int j=1;j<=12;j++){
      for(int k=0;k<=99;k++){
        for(int l=1;l<=12;l++){
          if(i==a&&j==b&&k==b&&l==a){
            cout<<"AMBIGUOUS"<<endl;
            return 0;
          }
        }
      }
    }
  }
  for(int i=0;i<=99;i++){
    for(int j=1;j<=12;j++){
      if(i==a&&j==b){
        cout<<"YYMM"<<endl;
        return 0;
      }
    }
  }
  for(int i=0;i<=99;i++){
    for(int j=1;j<=12;j++){
      if(i==b&&j==a){
        cout<<"MMYY"<<endl;
        return 0;
      }
    }
  }
  cout<<"NA"<<endl;
}


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

using namespace std;

#define YES cout << "YES" << endl;
#define NO  cout << "NO"  << endl;
#define Yes cout << "Yes" << endl;
#define No  cout << "No"  << endl;
 
#define INF INT_MAX
#define MOD 1000000007
#define PI  acos(-1)

using ll  = long long;
using ull = unsigned long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define rrep(i, n) for (ll i = (n)-1; i >= 0; i--)

int main(int argc, char *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll A, B, C, K;
    cin >> A >> B >> C >> K;

    ll ans = 0;
    if (K%2) {
        ans = B-A;        
    } else {
        ans = A-B;
    }

    ll cmp = 1000000000000000000;
    if (abs(A-B) > cmp) {
        cout << "Unfair" << endl;
    } else {
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<map>
#include<iostream>
#include<set>
#include<cctype>
#include<bitset>
#define ShimaKZ 404 Not Found
#define dec(a) memset(a,-1,sizeof(a))
#define mem(a) memset(a,0,sizeof(a))
#define debug(x) cerr<<#x<<'='<<x<<endl
#define bug() cerr<<"Surprise MotherFucker"<<endl
#define FOR(i,a,b) for(int i=(a),i##_end_=(b);i<=i##_end_;++i)
#define SFOR(i,a,b) for(int i=(a),i##_end_=(b);i<i##_end_;++i)
#define DOR(i,a,b) for(int i=(a),i##_end_=(b);i>=i##_end_;--i)
#define y1 juiue
#define y2 skjda
typedef long long ll;
template<class _> _ gcd(_ a,_ b) {return !b?a:gcd(b,a%b);}
template<class _,class __> bool checkmax(_ &a,__ b) {return a<b?a=b,true:false;}
template<class _,class __> bool checkmin(_ &a,__ b) {return a>b?a=b,true:false;}
template<class _> _ lcm(_ a,_ b) {return a*b/gcd(a,b);}
template<class _,class __> _ Mod(_ a,__ b) {return (a%b+b)%b;}
using namespace std;
#define M 100086
int Fa[M];
int fa[M];
vector<int>edge[M];
bool mark[M];
void Init(int n){FOR(i,1,n)Fa[i]=i;}
int Find(int x){return x==Fa[x]?x:Fa[x]=Find(Fa[x]);}
bool same(int x,int y){return Find(x)==Find(y);}
void unite(int x,int y){Fa[Find(x)]=Find(y);}
int n,m;
struct node{
	int op;
	int vetrix;
}A[M<<1];
int anc[M];
int cnt[M];
//void dfs(int x,int f,bool itself){
//	if(itself)anc[x]=anc[f];
//	else anc[x]=f;
//	SFOR(i,0,edge[x].size()){
//		int y=edge[x][i];
//		if(mark[y])dfs(y,y,1);
//		else dfs(y,f,0);
//	}
//}
void solve(){
	FOR(i,2,n)scanf("%d",&fa[i]);
	fa[1]=1;
	mem(mark);
	mem(cnt);
	mark[1]=1;
	FOR(i,1,m){
		char s[4];
		scanf("%s%d",s,&A[i].vetrix);
		A[i].op=s[0]=='Q'?0:1;
		if(A[i].op){
			mark[A[i].vetrix]=true;
			cnt[A[i].vetrix]++;
		}
	}
	FOR(i,1,n)if(!mark[i])A[++m].vetrix=i,A[m].op=1,cnt[i]++;
	ll ans=0;
	Init(n);
	DOR(i,m,1){
		if(A[i].op){
			if(!same(A[i].vetrix,fa[A[i].vetrix])&&!--cnt[A[i].vetrix]==1)unite(A[i].vetrix,fa[A[i].vetrix]);}
		else ans+=Find(A[i].vetrix);
	}
	printf("%lld\n",ans);
}
int main(){
	while(scanf("%d%d",&n,&m)){
		if(!n&&!m)return EXIT_SUCCESS;
		solve();
	}
	return EXIT_SUCCESS;
}


Measured memory_bytes: 8068
import java.util.Scanner;

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

    int N = scanner.nextInt();
    int[] a = new int[N + 1];
    for (int i = 1; i <= N; i++) a[i] = scanner.nextInt();

    int[] b = new int[N + 1];
    for (int i = N; i >= 1; i--) {
      b[i] ^= a[i];
      for (int j = 1; j * j <= i; j++) {
        if (i % j == 0) {
          if (j < i) b[j] ^= b[i];
          int k = i / j;
          if (k != j && k < i) b[k] ^= b[i];
        }
      }
    }
    StringBuilder sb = new StringBuilder();
    int count = 0;
    for (int i = 1; i <= N; i++) {
      if (b[i] == 1) {
        sb.append(i).append(' ');
        count++;
      }
    }
    System.out.println(count);
    if (sb.length() > 0) {
      sb.setLength(sb.length() - 1);
      System.out.println(sb);
    }
  }
}


Measured memory_bytes: 77640
#include<bits/stdc++.h>
#define mk make_pair
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
string s[500];
int h,w,sum=0;
vector<int>x,y;
void del(int t1,int t2){
  vector<pair<char,pair<int,int> > >p;
  for(int i=t1;i<h;i++)if(s[i][t2]!='.'){
    p.push_back(mk(s[i][t2],mk(i,t2)));
    break;
  }
  for(int i=t1;i>=0;i--)if(s[i][t2]!='.'){
    p.push_back(mk(s[i][t2],mk(i,t2)));
    break;
  }
  for(int i=t2;i<w;i++)if(s[t1][i]!='.'){
    p.push_back(mk(s[t1][i],mk(t1,i)));
    break;
  }
  for(int i=t2;i>=0;i--)if(s[t1][i]!='.'){
    p.push_back(mk(s[t1][i],mk(t1,i)));
    break;
  }
  sort(p.begin(),p.end());
  if(p.size()>=2){
    r(i,p.size()-1){
      if(p[i].first==p[i+1].first){
        sum++;
        s[p[i].second.first][p[i].second.second]='.';
        s[p[i+1].second.first][p[i+1].second.second]='.';
      }
    }
  }
}
int main(){
  cin>>h>>w;
  r(i,h)cin>>s[i];
  r(i,h)r(j,w)if(s[i][j]!='.'){
      y.push_back(i),x.push_back(j);
      if(i+1<h)y.push_back(i+1);
      if(j+1<w)x.push_back(j+1);
    }
  r(k,26)r(i,y.size())r(j,x.size())
    if(s[y[i]][x[j]]=='.')del(y[i],x[j]);
  cout<<sum*2<<endl;
}

Measured memory_bytes: 3380
#include<bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 1, 1, -1, -1};
int dx[]={1, -1, 0, 0, 1, -1, -1, 1};

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define mp make_pair
#define fi first
#define sc second
int n;
int d[1000];
int main(){
	cin >> n;
	REP(i,n) 
		cin >> d[i];

	sort(d,d + n);

	int c = 1;
	REP(i,n-1) {
		if(d[i] != d[i + 1]) {
			c++;
		}
	}
	cout << c << endl;
	return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <utility>
#include <atcoder/lazysegtree>
using namespace std;
using namespace atcoder;

namespace{
typedef long long LL;

struct state{
	LL zeros, ones, res, ires;
};

state op(state a, state b){
	return state{
		a.zeros + b.zeros,
		a.ones + b.ones,
		a.res + b.res + a.ones * b.zeros,
		a.ires + b.ires + a.zeros * b.ones
	};
}

bool do_xor(bool a, bool b){
	return a ^ b;
}

state mapping(bool rev, state s){
	if(rev){
		swap(s.zeros, s.ones);
		swap(s.res, s.ires);
	}
	return s;
}

state e(){
	return state{};
}

bool id(){
	return false;
}

void main2(){
	int n, q;
	scanf("%d%d", &n, &q);
	lazy_segtree<state, op, e, bool, mapping, do_xor, id> st(n);
	for(int i = 0; i < n; ++i){
		int a;
		scanf("%d", &a);
		state s{};
		a ? ++s.ones : ++s.zeros;
		st.set(i, s);
	}
	for(int i = 0; i < q; ++i){
		int t, l, r;
		scanf("%d%d%d", &t, &l, &r);
		--l;
		if(t == 1){
			st.apply(l, r, true);
		}
		else{
			state s = st.prod(l, r);
			printf("%lld\n", s.res);
		}
	}
}
}

int main(){
	main2();
}


Measured memory_bytes: 25992
void main() {
	auto N = ri;
	double res = 0;
	alias Pair = Tuple!(int, "ind", int, "x", int, "y");
	Pair[] pairs;
	foreach(i; 0..N) {
		auto ip = readAs!(int[]), x = ip[0], y = ip[1];
		pairs ~= Pair(i, x, y);
	}
	ulong cnt;
	do {
		cnt++;
		//writeln(pairs);
		double tmp = 0;
		foreach(i; 0..N-1) {
			auto p1 = pairs[i], p2 = pairs[i+1];
			tmp += dis(p1.x, p2.x, p1.y, p2.y);
		}
		res += tmp;
	} while(nextPermutation(pairs));
	writefln("%.8f", res / fact(N));
}

int fact(int n) {
	if(n == 0) return 1;
	else return fact(n-1) * n;
}
double dis(double x1, double x2, double y1, double y2) {
	return sqrt(pow(x1-x2, 2) + pow(y1-y2, 2));
}

// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define inf 1072114514
#define llinf 1145141919810364364
#define mod 1000000007

int max(int a,int b){if(a>b){return a;}return b;}
int min(int a,int b){if(a<b){return a;}return b;}
int zt(int a,int b){return max(a,b)-min(a,b);}
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;}
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;}
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}
int sortfncsj(const void *a,const void *b){if(*(int *)a>*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int sortfnckj(const void *a,const void *b){if(*(int *)a<*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int llsortfncsj(const void *a,const void *b){if(*(long long *)a>*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int llsortfnckj(const void *a,const void *b){if(*(long long *)a<*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int dbsortfncsj(const void *a,const void *b){if(*(double *)a>*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}
int dbsortfnckj(const void *a,const void *b){if(*(double *)a<*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}

int main(void){
    int a,b,c;
    scanf("%d%d%d",&a,&b,&c);
    printf("%d\n",min(a+b,min(a+c,b+c)));
    return 0;
}

Measured memory_bytes: 128
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using System.Globalization;
using System.Diagnostics;
using System.Threading.Tasks;

class Sobaya
{
    static void Main(){
      new Sobaya().calc();
      return;
    }
      
    Scanner cin;
    
    void calc(){
        cin = new Scanner();
        int n = cin.nextInt();
        long[] a = cin.ArrayLong(n);
        long ans = 0;
        for(int i=0; i<n; i++){
            for(int j=i+1; j<n; j++){
                ans += a[i]*a[j];
            }
        }
        
        Console.WriteLine(ans);

    }
}




class Scanner
{
    string[] s;
    int i;
 
    char[] cs = new char[] { ' ' };
 
    public Scanner()
    {
        s = new string[0];
        i = 0;
    }
 
    public string next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }
 
    public int nextInt()
    {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextInt() + add;
        }
        return Array;
    }
 
    public long nextLong()
    {
        return long.Parse(next());
    }
 
    public long[] ArrayLong(int N, long add = 0)
    {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextLong() + add;
        }
        return Array;
    }
 
    public double nextDouble()
    {
        return double.Parse(next());
    }
 
 
    public double[] ArrayDouble(int N, double add = 0)
    {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}


Measured memory_bytes: 13140
import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Read as T
import qualified Data.Array as A
import Data.List (permutations)

main :: IO ()
main = do
  (n : _) <- map unsafeSignedDecimal . T.words <$> T.getLine :: IO [Int]
  xys <- (A.listArray (1, n) <$>) . sequence . replicate n $ unsafeListToTuple . map (fromIntegral . unsafeSignedDecimal) . T.words <$> T.getLine :: IO (A.Array Int (Double, Double))
  let
    ds = A.array ((1, 1), (n, n)) . map (\(i, j) -> ((i, j), dist (xys A.! i) (xys A.! j))) $ (,) <$> [1..n] <*> [1..n] :: A.Array (Int, Int) Double
    numerator = sum . map (sum . map (ds A.!) . (zip <$> id <*> tail)) . permutations $ [1..n] :: Double
    denominator = fromIntegral . product $ [2..n] :: Double
  print $ numerator / denominator

dist :: (Double, Double) -> (Double, Double) -> Double
dist (x0, y0) (x1, y1) = sqrt $ (x1 - x0) ^ 2 + (y1 - y0) ^ 2

unsafeListToTuple :: [a] -> (a, a)
unsafeListToTuple (x : y : _) = (x, y)

unsafeSignedDecimal :: T.Text -> Int
unsafeSignedDecimal s = case T.signed T.decimal s of
  Right (n, _) -> n


Measured memory_bytes: 2044
#include <bits/stdc++.h> 
using namespace std;
typedef long long ll;
typedef pair<int,int> p;
const int inf=(1<<30);
#define rep(i,a,n)	for(int i=a;i<n;i++)
#define rrep(i,a,n) for(int i=(a-1);i>=n;i--)
	
int main(){
	ll a,b,c;
	cin>>a>>b>>c;
	cout<<(a*b)/2<<endl;
}

Measured memory_bytes: 764