akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007 
typedef long long ll;

int main(void)
{
	ios_base::sync_with_stdio(false);    
	cin.tie(NULL);
	cout.tie(NULL);
	
	double r;
	cin>>r;
	double pi=3.141592653589793238;
	
	cout<<fixed<<setprecision(20)<<2*pi*r<<"\n";
	
	return 0;
}

Measured memory_bytes: 3796
#include<bits/stdc++.h>
#define LL long long
#define M 1000005 
using namespace std;
const int P=1e9+7; 
int  A[105][105];
int main(){
	int n,m;
	cin>>n>>m;
	for(int i=1;i<=n;i++)
		for(int j=1;j<=m;j++)cin>>A[i][j];
	int ans=0;
	for(int i=1;i<=n;i++){
		for(int j=i+1;j<=n;j++){
			int s=0;
			for(int k=1;k<=m;k++)
				s+=(A[i][k]-A[j][k])*(A[i][k]-A[j][k]); 
			int p=sqrt(s+0.5);
			if(p*p==s)ans++;
		}
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 256
// D - Sum of Large Numbers
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

ll sigma_n(ll s, ll e){
	s--;
	return e*(e+1)/2 - s*(s+1)/2;
}
ll sigma_n2(ll s, ll e){
	s--;
	return e*(e+1)*(2*e+1)/6 - s*(s+1)*(2*s+1)/6;
}

int main(){
	ll n, n2, c, ans, N, K, MOD = 1'000'000'007;
	cin>>N>>K;
	n = sigma_n(K, N+1);
	n2 = sigma_n2(K, N+1);
	c = N - K + 2;
	ans = (N*n%MOD + n - n2 + c) % MOD;
	ans = (ans + MOD) % MOD;
	cout<< ans <<endl;
}

Measured memory_bytes: 3596
//#pragma GCC optimize("03")
//#pragma GCC target("avx2")
 
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <iomanip>
#include <utility>
#include <unordered_map>
#include <unordered_set>
#define mp make_pair
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define sqr(a) (a)*(a)
#define um unordered_map 
#define us unordered_set
using namespace std;
 
hash<string> hfn;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pld;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef double dbl;
typedef unsigned int ui;
const int inf = 2e9;
const ll mod = 1e9 + 7;
const ld eps = 1e-7;
const ll biginf = 1e18;
const ld pi = acosl(-1);

void solve()
{
  int n;
  cin >> n;
  vector<int> a(n), b(n), c(n);
  for(int i = 0; i < n; i++)
  {
    cin >> a[i] >> b[i] >> c[i];
  }
  vector<vector<int> > dp(n, vector<int>(3, 0));
  dp[0][0] = a[0];
  dp[0][1] = b[0];
  dp[0][2] = c[0];
  int maxx = max(a[0], max(b[0], c[0]));
  if(n == 1)
  {
    cout << maxx;
    return;
  }
  dp[1][0] = maxx + a[1];
  dp[1][1] = maxx + b[1];
  dp[1][2] = maxx + c[1];
  for(int i = 2; i < n; i++)
  {
    dp[i][0] = a[i] + max(dp[i-1][1], dp[i-1][2]);
    dp[i][1] = b[i] + max(dp[i-1][0], dp[i-1][2]);
    dp[i][2] = c[i] + max(dp[i-1][0], dp[i-1][1]);
  }
  cout << max(dp[n-1][0], max(dp[n-1][1], dp[n-1][2]));
}
 
void multisolve()
{
  int t;
  cin >> t;
  while(t--)
    solve();
}
 
int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  //freopen("hull.in", "r", stdin);
  //freopen("hull.out", "w", stdout);
  solve();
  //multisolve();
}

Measured memory_bytes: 6912
#![allow(non_snake_case)]

fn read_line() -> String {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

fn main() {
    let mut N: i32 = read_line().parse().unwrap();
    if N == 0 {
        println!("0");
    } else {
        let mut ans = String::new();
        while N != 0 {
            let d = N.abs() % 2;
            ans.push_str(&d.to_string());
            N = (N - d) / (-2);
        };
        println!("{}", ans.chars().rev().collect::<String>());
    }
}


Measured memory_bytes: 4352
n = int(input())
h = list(map(int,input().split()))
a = []
p = [0]*n
c = 0
for i in range(0,n-1):
  if(h[i] >= h[i+1]):
    p[i] = 1
    
for i in range(0,n):
  if(p[i] != 0):
    c += 1
  else:
    a.append(c)
    c = 0
print(max(a))
    

Measured memory_bytes: 63984
#include <stdio.h>
#include <algorithm>

using namespace std;

int n;
int a[12000] , b[12000];
int ans[120000] , cnt;
bool check ( int p ) {
	int i;
	for ( i = 0 ; i <= n ; i++ ) b[i] = a[i];
	for ( i = n ; i >= p ; i-- ) {
		b[i-p+1] = (b[i-p+1]+b[i]) % p;
	}
	for ( i = 0 ; i < p ; i++ ) if ( b[i] % p != 0 ) return false;
	return true;
}
void work () {
	int i , j , t , t2;
	scanf ( "%d" , &n );
	for ( i = n ; i >= 0 ; i-- ) {
		scanf ( "%d" , &a[i] );
		if ( i == n ) t = abs(a[n]);
		else t = __gcd ( t , abs(a[i]) );
	}
	t2 = t;
	for ( i = 2 ; i * i <= t2 ; i++ ) {
		if ( t % i == 0 ) {
			ans[++cnt] = i;
			while ( t % i == 0 ) t = t / i;
		}
	}
	if ( t != 1 ) ans[++cnt] = t;
	for ( i = 2 ; i <= n ; i++ ) {
		for ( j = 2 ; j < i ; j++ ) {
			if ( i % j == 0 ) break;
		}
		if ( j == i ) {
			if ( check ( i ) ) ans[++cnt] = i;
		}
	}
	sort ( ans + 1 , ans + 1 + cnt );
	for ( i = 1 ; i <= cnt ; i++ )
		if ( i == 1 || ans[i] != ans[i-1] ) printf ( "%d\n" , ans[i] );
}
int main () {
	work ();
	return 0;
}


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

int main() {
    int n, k;
    cin >> n >> k;
    vector<int> v(n);
    for (int i = 0; i < n; i++) cin >> v[i];

    long long mx = -(1e10);
    for (int a = 0; a <= min(n, k); a++) {
        priority_queue<int, vector<int>, greater<int>> ans;
        for (int b = 0; b <= min(n, k) - a; b++) {
            //左
            for (int i = 0; i < a; i++) ans.push(v[i]);
            //右
            for (int i = 0; i < b; i++) ans.push(v[n - 1 - i]);
            //捨てる
            for (int i = 0; i < k - (a + b); i++) {
                if (ans.empty() || ans.top() >= 0) break;
                ans.pop();
            }

            long long sum = 0;
            while (!ans.empty()) {
                sum += ans.top();
                ans.pop();
            }
            mx = max(mx, sum);   
        }
    }

    cout << mx << endl;
    return 0;
}

Measured memory_bytes: 256
# input
X = int( input() )
maxA = 1000
pow5 = list()
for aa in range(maxA):
    pow5.append( aa**5 )
    
# calc    
ans = False
for ii in range(maxA):  
    if( ans==False ):
        X1 = X - pow5[ii]
        X2 = X + pow5[ii]
        if( X1 in pow5 ):
            b = - ii
            a = pow5.index( X1 )
            ans = True
        
    if( ans==False ):
        if( X2 in pow5 ):
            b = ii
            a = pow5.index( X2 )
            ans = True

# out
if(ans):
    print( str(a)+' '+str(b) )

Measured memory_bytes: 9124
using System;
using System.Collections.Generic;
using System.Linq;

class Procon
{
    public Procon() { }
    static void Main(string[] agrs)
    {
        new Procon().Do();
    }

    Scanner cin;

    public void Do()
    {
        cin = new Scanner();
        long N = cin.nextInt();
        Console.WriteLine(dfs(N, 0));
    }

    long dfs(long N, long cur)
    {
        if (cur > N)
        {
            return 0;
        }

        long tmp = 0;
        tmp += dfs(N, cur * 10 + 7);
        tmp += dfs(N, cur * 10 + 5);
        tmp += dfs(N, cur * 10 + 3);

        bool have3 = false;
        bool have5 = false;
        bool have7 = false;
        while (true)
        {
            if (cur == 0)
            {
                break;
            }
            if (cur % 10 == 3)
            {
                have3 = true;
            }
            if (cur % 10 == 5)
            {
                have5 = true;
            }
            if (cur % 10 == 7)
            {
                have7 = true;
            }
            cur /= 10;
        }
        if (have3 && have5 && have7)
        {
            tmp++;
        }
        return tmp;
    }
}

class Scanner
{
    string[] s;
    int i;
    int max_i;

    public Scanner()
    {
        s = new string[0];
        max_i = 0;
        i = 0;
    }

    public string nextString()
    {
        if (i >= s.Length)
        {
            s = Console.ReadLine().Split(' ');
            max_i = s.Length;
            i = 0;
            if (max_i == 0)
            {
                return "";
            }
            return s[i++];
        }
        else
        {
            return s[i++];
        }
    }

    public int nextInt()
    {
        return int.Parse(nextString());
    }


    public long nextLong()
    {
        return long.Parse(nextString());
    }

    public double nextDouble()
    {
        return double.Parse(nextString());
    }

    public string[] arrayString()
    {
        return Console.ReadLine().Split(' ');
    }

    public int[] arrayInt()
    {
        string[] str = Console.ReadLine().Split(' ');
        int[] array = new int[str.Length];
        for (int i = 0; i < str.Length; i++)
        {
            array[i] = int.Parse(str[i]);
        }
        return array;
    }

    public long[] arrayLong()
    {
        string[] str = Console.ReadLine().Split(' ');
        long[] array = new long[str.Length];
        for (int i = 0; i < str.Length; i++)
        {
            array[i] = long.Parse(str[i]);
        }
        return array;
    }

    public double[] arrayDouble()
    {
        string[] str = Console.ReadLine().Split(' ');
        double[] array = new double[str.Length];
        for (int i = 0; i < str.Length; i++)
        {
            array[i] = double.Parse(str[i]);
        }
        return array;
    }
}


Measured memory_bytes: 11220
#include <vector> 
#include <list> 
#include <map> 
#include <set> 
#include <deque> 
#include <queue> 
#include <stack> 
#include <bitset> 
#include <algorithm> 
#include <functional> 
#include <numeric> 
#include <utility> 
#include <sstream> 
#include <iostream> 
#include <iomanip> 
#include <cstdio> 
#include <cmath> 
#include <cstdlib> 
#include <cctype> 
#include <string> 
#include <cstring> 
#include <ctime> 

using namespace std;

#define _int64 long long

int a[600][600];
int aa[600][600];

int main()
{
  int i,j,m,n,x,y,f,w;
  scanf("%d%d%d%d",&m,&n,&x,&y);
  if ((m%x==0)&&(n%y==0))
  {
    printf("No\n");
    return 0;
  }
  w=999999999/(x*y-1);
  printf("Yes\n");
  for (i=0;i<m;i++)
    for (j=0;j<n;j++)
    {
      if (((i+1)%x==0)&&((j+1)%y==0))
        a[i][j]=-(w*(x*y-1)+1);
      else a[i][j]=w;
    }
  for (i=0;i<m;i++)
  {
    for (j=0;j<n;j++)
    {
      if (j!=0) printf(" ");
      printf("%d",a[i][j]);
    }
    printf("\n");
  }
  return 0;
}

Measured memory_bytes: 4096
#include<bits/stdc++.h>
using namespace std;
#define pi acos(-1.0)
#define MOD 1000000007
#define pb push_back
#define cy cout<<"Yes\n"
#define cn cout<<"No\n"
typedef unsigned long long int ull;
typedef long long int ll;

int a[500005];
const int M=1e4;
ll cnt[M];
int main()
{
    ll x,k,d;
    cin>>x>>k>>d;
    x=abs(x);
    ll val=x/d;
    if(k>val)
    {
        if((k-val)%2)
         {
             val++;
         }
    }
    else
        val=k;
    x-=(val*d);
    cout<<abs(x)<<endl;
}


Measured memory_bytes: 3624
using System;
using System.Collections.Generic;
using System.Linq;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            //[summary]C - Build Stairs
            int N = int.Parse(Console.ReadLine());
            var H = ReadLine();

            if (CanBuild(N, H))
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }          
        }

        static bool CanBuild(int N, List<int> H)
        {
            if (N > 1)
            {
                var isOperated = new bool[N];

                while (true)
                {                    
                    int count = 0;
                    
                    for (int i = 0; i < N - 1; i++)
                    {
                        if (H[i] > H[i + 1])
                        {
                            if (!isOperated[i])
                            {
                                H[i]--;
                                isOperated[i] = true;
                                count++;
                            }                            
                        }
                    }

                    if (count == 0)
                    {
                        break;
                    }
                }

                for (int i = 0; i < N - 1; i++)
                {
                    if (H[i] > H[i + 1])
                    {
                        return false;
                    }
                }
            }

            return true;
        }

        static List<int> ReadLine()
        {
            var line = Console.ReadLine();
            var arr = line.Split(' ');

            return arr.Select(x => int.Parse(x)).ToList();
        }
    }
}

Measured memory_bytes: 27996
#include<bits/stdc++.h>
#define mt make_tuple
#define mp make_pair
#define pu push_back
#define INF 1000000001
#define MOD 1000000007
#define EPS 1e-6
#define ll long long int
#define ld long double
#define fi first
#define se second
#define all(v) v.begin(),v.end()
#define pr(v) { for(int i=0;i<v.size();i++) { v[i]==INF? cout<<"INF " : cout<<v[i]<<" "; } cout<<endl;}
#define t1(x)                cerr<<#x<<" : "<<x<<endl
#define t2(x, y)             cerr<<#x<<" : "<<x<<" "<<#y<<" : "<<y<<endl
#define t3(x, y, z)          cerr<<#x<<" : " <<x<<" "<<#y<<" : "<<y<<" "<<#z<<" : "<<z<<endl
#define t4(a,b,c,d)          cerr<<#a<<" : "<<a<<" "<<#b<<" : "<<b<<" "<<#c<<" : "<<c<<" "<<#d<<" : "<<d<<endl
#define t5(a,b,c,d,e)          cerr<<#a<<" : "<<a<<" "<<#b<<" : "<<b<<" "<<#c<<" : "<<c<<" "<<#d<<" : "<<d<<" "<<#e<<" : "<<e<<endl
#define t6(a,b,c,d,e,f)          cerr<<#a<<" : "<<a<<" "<<#b<<" : "<<b<<" "<<#c<<" : "<<c<<" "<<#d<<" : "<<d<<" "<<#e<<" : "<<e<<" "<<#f<<" : "<<f<<endl
#define GET_MACRO(_1,_2,_3,_4,_5,_6,NAME,...) NAME
#define t(...) GET_MACRO(__VA_ARGS__,t6,t5, t4, t3, t2, t1)(__VA_ARGS__)
#define _ cerr<<"here"<<endl;
#define __ {ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);}

using namespace std;
template<class A, class B> ostream& operator<<(ostream& out, const pair<A, B> &a){ return out<<"("<<a.first<<", "<<a.second<<")";}
template <int> ostream& operator<<(ostream& os, const vector<int>& v) { os << "["; for (int i = 0; i < v.size(); ++i) { if(v[i]!=INF) os << v[i]; else os << "INF";if (i != v.size() - 1) os << ", "; } os << "]\n"; return os; } 
template <typename T> ostream& operator<<(ostream& os, const vector<T>& v) { os << "["; for (int i = 0; i < v.size(); ++i) { os << v[i]; ;if (i != v.size() - 1) os << ", "; } os << "]\n"; return os; } 


int main()
{
  __;
  int n;
  cin >> n;
  vector<ll> v(n);
  for(int i=0;i<n;i++) cin >> v[i];

  map<ll,ll> d;
  for(int i=0;i<n;i++) d[v[i]]++;

  ll cnt = 0;
  for(auto it : d)
  {
    cnt += (it.se * (it.se-1))/2;
  }

  for(int i=0;i<n;i++)
  {
    ll a = d[v[i]];
    cnt -= (a*(a-1)) / 2;
    cnt += ((a-1)*(a-2))/2;
    cout << cnt << endl;
    cnt -= ((a-1)*(a-2))/2;
    cnt += (a*(a-1)) / 2;
  }
  return 0;
}


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

int main() {
  int N,K;
  cin >> N >> K;
  vector<int> V(N);
  rep(i,N) cin >> V.at(i);
  int ans = -1003006009;
  for(int l=0;l<=K;l++){
    for(int r=0;r<=K-l;r++){
      if(l+r>N) continue;
      int d=K-l-r;
      int now=0;
      vector<int> s;
      for(int i=0;i<=l-1;i++){
        now += V[i];s.push_back(V[i]);
      }
      for(int i=N-r;i<=N-1;i++){
        now += V[i];s.push_back(V[i]);
      }
      sort(s.begin(),s.end());
      for(int i=0;i<=d-1;i++){
        if(i>=s.size()) break;
        if(s.at(i)>0) break;
        now -= s.at(i);
      }
      ans = max(ans,now);
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
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();
        int c = sc.nextInt();

        StringBuffer sb = new StringBuffer();
        if (a < b && b < c) {
            sb.append("Yes");
        } else {
            sb.append("No");
        }

        System.out.println(sb);
    }
}

Measured memory_bytes: 17160
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
  string str;
  cin>>str;
  if(str=="SUN"){cout<<7<<endl;}
  if(str=="MON"){cout<<6<<endl;}
  if(str=="TUE"){cout<<5<<endl;}
  if(str=="WED"){cout<<4<<endl;}
  if(str=="THU"){cout<<3<<endl;}
  if(str=="FRI"){cout<<2<<endl;}
  if(str=="SAT"){cout<<1<<endl;}
}

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


qualified = 0
qualified_oversea = 0
for i, symbol in enumerate(s):
	if symbol == 'c':
		print("No")
	elif symbol == 'a':
		if qualified < a + b:
			print("Yes")
			qualified += 1
		else:
			print("No")
	elif symbol == 'b':
		if qualified < a + b and qualified_oversea < b:
			print("Yes")
			qualified += 1
			qualified_oversea += 1
		else:
			print("No")
		

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

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

    vector<int> a;
    int k;
    for(int i = 0; i < m; i++){
        cin >> k;
        a.push_back(k);
    }

    ll dp[n + 1];
    for(int i = 0; i <= n; i++){
        dp[i] = 0;
    }

    int now = 0;
    int flag = 0;
    auto itr = find(a.begin(), a.end(), 1);
    if(itr == a.end()){
        dp[1] = 1;
    }else{
        dp[1] = 0;
    }
    itr = find(a.begin(), a.end(), 2);
    if(itr == a.end()){
        dp[2] = dp[1] + 1;
    }else{
        dp[2] = 0;
        flag = 1;
    }

    if(dp[1] != 0 || dp[2] != 0){
        for(int i = 3; i <= n; i++){
            itr = find(a.begin(), a.end(), i);
            if(itr == a.end()){
                dp[i] = dp[i - 1] + dp[i - 2];
                dp[i] = dp[i] % 1000000007;
                flag = 0; 
            }else{
                if(flag == 0){
                    flag = 1;
                }else{
                    flag = 2;
                    break;
                }
            }
        }
    }

    if(flag == 2){
        cout << 0 << endl;
    }else{
        cout << dp[n] << endl; 
    }
}

Measured memory_bytes: 1528
#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <regex>
#include <sstream>
#include <string>
#include <thread>
#include <tuple>
#include <type_traits>
#include <vector>

#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;

ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

int main() {
    ios::sync_with_stdio(false);
    int h1, m1, h2, m2, k;
    cin >> h1 >> m1 >> h2 >> m2 >> k;
    int st, ed;
    st = h1 * 60 + m1;
    ed = h2 * 60 + m2;

    if (ed - st - k >= 0)
        cout << ed - st - k << endl;
    else
        cout << 0 << endl;

    return 0;
}


Measured memory_bytes: 3144
D,G = map(int,input().split())
p = [0]*int(D)
c = [0]*int(D)
for i in range(D):
  p[i],c[i] = map(int,input().split())
ans = 1e9
for i in range(2**D):
  s = 0
  num = 0
  rest_max = -1
  for j in range(D):
    if (i>>j)&1:
      s += 100 * (j+1) * p[j] + c[j]
      num += p[j]
    else:
      rest_max = j
  if s<G:
    s1 = 100 * (rest_max + 1)
    need = int((G - s + s1 - 1) / s1)
    if need >= p[rest_max]:
      continue
    num += need
  ans = min(ans, num)
print(ans)

Measured memory_bytes: 3064
def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X%n)
    return str(X%n)
    
N,K=(int(x) for x in input().split())
ksinstr = Base_10_to_n(N, K)
ketasuu = len(list(ksinstr))
print(ketasuu)

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

int main(){
    double W, H, x, y, ans1;
    bool ans2;
    cin >> W >> H >> x >> y;
    ans1 = W*H/2.0;
    ans2 = (W/2==x && H/2==y);
    
    cout << ans1 << " "<<ans2<< endl;	
}


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


int main() {

    vector<vector<int>> vec(3, vector<int>(3));
    for (int i = 0; i < 3; ++i) {
        for (int j = 0; j < 3; ++j) {
            cin >> vec.at(i).at(j);
        }
    }

    bool ans = true;
    for (int i = 0; i < 2; ++i) {
        for (int j = 0; j < 2; ++j) {
            if (vec.at(i+1).at(j+1) - vec.at(i).at(j+1) != vec.at(i+1).at(j) - vec.at(i).at(j)) {
                ans = false;
            }
        }
    }
    for (int i = 0; i < 2; ++i) {
        for (int j = 0; j < 2; ++j) {
            if (vec.at(i+1).at(j+1) - vec.at(i+1).at(j) != vec.at(i).at(j+1) - vec.at(i).at(j)) {
                ans = false;
            }
        }
    }

    if (ans) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#include <list>
// #include <boost/multiprecision/cpp_int.hpp>
// #include <boost/multiprecision/cpp_dec_float.hpp>

using namespace std;
// using namespace boost::multiprecision;

typedef long long ll;
typedef long double ld;

#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
#define mii map<int,int>
#define mis map<int,string>
#define msi map<string,int>
#define mll map<ll,ll>
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rep1(i,n) for(int i=1; i<=(int)(n); i++)
#define all(c) c.begin(),c.end()
#define srta(a) sort(all(a))
#define srtd(a) sort(all(a),greater<型>())
#define rvs(s) reverse(all(s))
#define psb push_back
#define ppb pop_back
#define ers erase
#define isu isupper
#define isl islower
#define lb(a,k) lower_bound(all(a),k)
#define ub(a,k) upper_bound(all(a),k)
#define bs(a,k) binary_search(all(a),k)
#define popcount __builtin_popcount
#define popcountll __builtin_popcountll

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

const int I_INF = 1001001001;
const ll LL_INF = 1001001001001001001;
const ld EPS = 0.001;

int main() {
    char C;
    cin >> C;

    char ans = C + 1;
    cout << ans << endl;
}


Measured memory_bytes: 3584
#include <bits/stdc++.h>
#include <random>
#include <chrono>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long int
#define ld long double
#define ull unsigned ll
#define pb push_back
#define popb pop_back
#define mt make_tuple
#define eb emplace_back
#define mp make_pair
#define ff first
#define ss second
#define pii pair <int,int>
#define piii pair <pii,int>
#define piiii pair <pii,pii>
#define pll pair <ll,ll>
#define plll pair <pair <ll, ll>, ll>
#define rep0(i,n) for(ll i=0;i<(ll)n;i++)
#define rep1(i,n) for(ll i=1;i<=(ll)n;i++)
#define rep(i,x,y) for(ll i=(ll)x;i<=(ll)y;i++)
#define reprev(i,n) for(ll i=(ll)n;i>=0;i--)
#define all(c) c.begin(),c.end()
#define print(a) rep0(i,a.size()) cout << a[i] << " "
#define hi() cout << "\nHello, I am error. Can you find me? :):):)\n"
#define Randomize mt19937 rng(chrono::steady_clock::now().time_since_eppoch().count())
 
using namespace __gnu_pbds;
using namespace std;
using ordered_set =  tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>;

// FOR DEBUGGING
vector<string> vec_splitter(string s) {
	s += ',';
	vector<string> res;
	while(!s.empty()) {
		res.push_back(s.substr(0, s.find(',')));
		s = s.substr(s.find(',') + 1);
	}
	return res;
}

void debug_out(
vector<string> __attribute__ ((unused)) args,
__attribute__ ((unused)) int idx, 
__attribute__ ((unused)) int LINE_NUM) { cerr << endl; } 
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
	if(idx > 0) cerr << ", ";
	else cerr << "Line(" << LINE_NUM << ") ";
	stringstream ss; ss << H;
	cerr << args[idx] << " = " << ss.str();
	debug_out(args, idx + 1, LINE_NUM, T...);
}

#ifndef XOX
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
#else
#define debug(...) 42
#endif

const int mod = 1e9+7;
const long double pi = acos(-1);
const ll INF = 1e15;

ll power(ll x, ll y){
	x %= mod;
	ll ans = 1;
	while(y){
		if(y&1) ans = (ans*x)%mod;
		y /= 2;
		x = (x*x)%mod;
	}
	return ans;
}

void solve(){

	string s;
	cin >> s;
	int n = s.size() + 1;
	vector <int> a(n,0);

	rep0(i,n-1){
		if(s[i]=='<'){
			if(a[i+1]<a[i]+1) a[i+1] = a[i] + 1;
		}
	}

	reprev(i,n-2){
		if(s[i]=='>'){
			if(a[i]<a[i+1]+1) a[i] = a[i+1] + 1;
		}
	}

	ll sum = 0;
	rep0(i,n) sum += a[i];
	cout << sum;

	return;
}

int main(){

	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);

	int TC = 1,t = 0;
	// cin >> TC;
	while(t++ < TC){
		// cout << "Case #" << t << ": ";
		solve();
		// cout << "\n";
	}

	cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";

	return 0; 
}

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

int main(){
    string s;

    cin >> s;
    int l = s.size();

    int x = 0;
    for (int i = 0; i < l/2; i++){
        if (s[i] != s[l - i - 1]) x++;
    }

    cout << x << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>

typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

using namespace std;

#define rep(i, a, b) for (int i = a; i < b; i++)
#define rrep(i, a, b) for (int i = a; i <= b; i++)
#define all(a)  begin((a)),end((a))
#define uniq(c) (c).erase(unique(all((c))), end((c)))
#define each(i, map) for (auto& i : map)

int main()
{
    int X, Y; cin >> X >> Y;

    rrep (x, 0, X) {
        int y = Y - 4 * x;  // 鶴の足の本数
        if (y % 2 != 0) continue;
        if ((y / 2) + x == X) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
}


Measured memory_bytes: 3584
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(int (i) = (s);(i) <= (e);(i)++)
#define all(x) x.begin(),x.end()

struct edge{
  int i;
  int j;
  i64 l;
};

int main(){
  i64 L;
  cin >> L;

  L--;

  int N = 1;
  vector<edge> G;

  i64 now = 1;
  int cnt = 1;
  while(now * 2 - 1 <= L && cnt <= 19){
    G.push_back({cnt,cnt + 1,0LL});
    G.push_back({cnt,cnt + 1,now});
    now <<= 1;
    cnt++;
    N = max(cnt,N);
  }


  if(L - now >= 0){
    i64 add = now;
    while(add <= L){
      int c = 1;
      i64 shi = 1;
      while(shi * 2 - 1  + add <= L && c + 1 <= 19){
        shi <<= 1;
        c++;
      }
      G.push_back({c,N,add});
      add += shi;
    }
  }
  assert(G.size() <= 60);
  cout << N << " " << G.size() << endl;
  for(auto e : G){
    cout << e.i << " " << e.j << " " << e.l << endl;
  }
}


Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var S, T string
	var cnt int
	fmt.Scan(&S, &T)
	for i := 0; i < len(S); i++ {
		if S[i:i+1] == T[i:i+1] {
			cnt++
		}
	}
	fmt.Println(cnt)
}

Measured memory_bytes: 512
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<set>
#include<iomanip>
#define rep(i, a, n) for(int i = a; i < n; i++)
using namespace std;
int main(){
  vector<int> v(9, -1);
  rep(i, 0, 9) cin >> v[i];
  
  int n;
  cin >> n;
  
  vector<int> vv(n, -1);
  rep(i, 0, n){
    cin >> vv[i];
    rep(j, 0, 9){
      if(vv[i] == v[j]){
        v[j] = -1;
        break;
      }
    }
  }
  int f = 0;
  if(v[4] == -1){
    if(v[2] == -1 && v[6] == -1){
      f++;
    }
    else if(v[0] == -1 && v[8] == -1){
      f++;
    }
    else if(v[1] == -1 && v[7] == -1){
      f++;
    }
    else if(v[3] == -1 && v[5] == -1){
      f++;
    }
    
    if(f > 0){
      cout << "Yes\n";
      return 0;
    }
  }
  
  if(v[0] == -1){
    if(v[2] == -1 && v[1] == -1){
      f++;
    }
    else if(v[3] == -1 && v[6] == -1){
      f++;
    }
    if(f > 0){
      cout << "Yes\n";
      return 0;
    }
  }
  
  if(v[8] == -1){
    if(v[2] == -1 && v[5] == -1){
      f++;
    }
    else if(v[7] == -1 && v[6] == -1){
      f++;
    }
    if(f > 0){
      cout << "Yes\n";
      return 0;
    }
  }
  
  cout << "No\n";
}
  

Measured memory_bytes: 3632
#include<iostream>
using namespace std;
int main()
{
	int x;
	cin>>x;
	if(x>=400 && x<=599)
		cout<<"8"<<endl;
	else if(x>=600 && x<=799)
		cout<<"7"<<endl;
	else if(x>=800 && x<=999)
		cout<<"6"<<endl;
	else if(x>=1000 && x<=1199)
		cout<<"5"<<endl;
	else if(x>=1200 && x<=1399)
		cout<<"4"<<endl;
	else if(x>=1400 && x<=1599)
		cout<<"3"<<endl;
	else if(x>=1600 && x<=1799)
		cout<<"2"<<endl;
	else if(x>=1800 && x<=1999)
		cout<<"1"<<endl;

	return 0;
}

Measured memory_bytes: 3576
#include <bits/stdc++.h>
using namespace std;
int main(){
  while (1){
    int p, q;
    cin >> p >> q;
    if (p == 0 && q == 0){
      break;
    }
    vector<tuple<int, int, int, int>> pr(p);
    int a = 0, b = 0, c = 0;
    for (int i = 0; i < p; i++){
      string S;
      cin >> S;
      int cnt = 0;
      while (S[cnt] == '.'){
        cnt++;
      }
      pr[i] = make_tuple(a, b, c, cnt);
      int L = S.size();
      for (int j = 0; j < L; j++){
        if (S[j] == '('){
          a++;
        }
        if (S[j] == ')'){
          a--;
        }
        if (S[j] == '{'){
          b++;
        }
        if (S[j] == '}'){
          b--;
        }
        if (S[j] == '['){
          c++;
        }
        if (S[j] == ']'){
          c--;
        }
      }
    }
    vector<tuple<int, int, int>> I;
    for (int i = 1; i <= 20; i++){
      for (int j = 1; j <= 20; j++){
        for (int k = 1; k <= 20; k++){
          bool ok = true;
          for (int l = 0; l < p; l++){
            int A = get<0>(pr[l]);
            int B = get<1>(pr[l]);
            int C = get<2>(pr[l]);
            int s = get<3>(pr[l]);
            if (A * i + B * j + C * k != s){
              ok = false;
            }
          }
          if (ok){
            I.push_back(make_tuple(i, j, k));
          }
        }
      }
    }
    int cnt = I.size();
    vector<int> ans(q);
    int a2 = 0, b2 = 0, c2 = 0;
    for (int i = 0; i < q; i++){
      string s;
      cin >> s;
      set<int> st;
      for (int j = 0; j < cnt; j++){
        int R = get<0>(I[j]);
        int C = get<1>(I[j]);
        int S = get<2>(I[j]);
        st.insert(a2 * R + b2 * C + c2 * S);
      }
      if (st.size() == 1){
        ans[i] = *st.begin();
      } else {
        ans[i] = -1;
      }
      int L = s.size();
      for (int j = 0; j < L; j++){
        if (s[j] == '('){
          a2++;
        }
        if (s[j] == ')'){
          a2--;
        }
        if (s[j] == '{'){
          b2++;
        }
        if (s[j] == '}'){
          b2--;
        }
        if (s[j] == '['){
          c2++;
        }
        if (s[j] == ']'){
          c2--;
        }
      }
    }
    for (int i = 0; i < q; i++){
      cout << ans[i];
      if (i < q - 1){
        cout << ' ';
      }
    }
    cout << endl;
  }
}


Measured memory_bytes: 3264
import math
N, K = map(int, input().split())

coin_prob = .5

log2 = math.log(2)
logk = math.log(K)
left = logk / log2
def calc(i):
  return max(math.ceil(left - (math.log(i) / log2)), 0)

ans = 0
for i in range(1, N+1):
  n = calc(i)
  ans += coin_prob ** n

print(ans / N)


Measured memory_bytes: 3060
num = gets.to_i
arr = num.times.map { gets.split(' ').map(&:to_i) }

pa = nil
pb = nil
arr.each do |(a, b)|
  if pa.nil?
    pa, pb = a, b
    next
  end

  div = [(pa + a - 1) / a, (pb + b - 1) / b].max
  #div = [((pa.to_f) / a).ceil, ((pb.to_f) / b).ceil].max
    # if pa * b > pb * a
    #   ((pa.to_f) / a).ceil
    # else
    #   ((pb.to_f) / b).ceil
    # end
  pa = a * div
  pb = b * div
end
p pa + pb


Measured memory_bytes: 2044
#define LOCAL

#include <map>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <vector>
#include <numeric>
#include <algorithm>
#include <iostream>
#include <string>
#include <cstring>
#include <sstream>
#include <functional>
#include <queue>
#include <deque>
#include <stack>
#include <cmath>
#include <iomanip>

using namespace std;

// From Errichto's Youtube stream
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

using int64 = long long;

/////////////////////
// Code starts here//
/////////////////////
int N;
vector<int> A;
map<int, int> first;
map<int, int> cnt;
set<int> S;
vector<int> V;
vector<int64> result;


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

    cin >> N;
    A.resize(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
        if (!first.count(A[i])) {
            first[A[i]] = i;
        } else {
            first[A[i]] = min(i, first[A[i]]);
        }
        S.insert(A[i]);
        cnt[A[i]]++;
    }

    V = vector<int>(S.begin(), S.end());
    result.resize(N);

    int cur_first = first[V.back()];
    int cur_h = A[cur_first];
    int columns = cnt[A[cur_first]];

    //debug() << "start: " << cur_first << " " << cur_h << " " << columns;

    for (int i = V.size() - 2; i >= 0; i--) {
        auto new_first = first[V[i]];
        auto new_h = A[new_first];
        auto new_columns = cnt[A[new_first]];

        //debug() << new_first << " " << new_h << " " << new_columns;

        if (new_first > cur_first) {
            result[cur_first] += (int64)columns * (cur_h - new_h);
            columns += new_columns;
            cur_h = new_h;
        } else {
            result[cur_first] += (int64)columns * (cur_h - new_h);
            columns += new_columns;
            cur_first = new_first;
            cur_h = new_h;
        }
    }

    //debug() << "final: " << columns << " " << cur_h;

    result[cur_first] += (int64)columns * (cur_h - 0);

    for (int i = 0; i < N; i++)
        cout << result[i] << "\n";

    return 0;
}


Measured memory_bytes: 16640
#include <iostream>
#include <string>
#include <algorithm>
#include <iterator>
#include <functional>
#include <vector>
#include <math.h>
#include <typeinfo>
#include <numeric>
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
using namespace std;

void func(string S)
{
	int tmp = 0;
	vector<int> n(S.length(), 0);

	for (int i = 0; i < S.length(); i++)
	{
		if (S[i] == 'L')
		{
			tmp = i;
			break;
		}
	}

	n[tmp] = S.length() / 2;
	n[tmp - 1] = n[tmp];

	if (S.length() % 2 != 0)
	{
		if (tmp % 2 == 0)
		{
			n[tmp] += 1;
		}
		else
		{
			n[tmp - 1] += 1;
		}
	}

	for (int i = 0; i < n.size(); i++)
	{
		cout << n[i] << " ";
	}
}

int main()
{
	string S;
	cin >> S;

	int begin = 0;
	string subs = "";
	int sz = 0;
	for (int i = 1; i < S.length(); i++)
	{
		sz++;
		if (S[i - 1] == 'L' && S[i] == 'R')
		{
			subs = S.substr(begin, sz);

			func(subs);

			begin = i;
			sz = 0;
		}
		
	}

	subs = S.substr(begin, sz+1);
	func(subs);

	cout << endl;

	return 0;
 
}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = ll(A); I < ll(B); ++I)
#define FORR(I,A,B) for(ll I = ll((B)-1); I >= ll(A); --I)
#define TO(x,t,f) ((x)?(t):(f))
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //xi>=v  x is sorted
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //xi>v  x is sorted
#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted
#define REV(x) (reverse(x.begin(),x.end())) //reverse
ll gcd(ll a,ll b){if(a%b==0)return b;return gcd(b,a%b);}
ll lcm(ll a,ll b){ll c=gcd(a,b);return ((a/c)*(b/c)*c);}
#define NEXTP(x) next_permutation(x.begin(),x.end())
const ll INF=ll(1e16)+ll(7);
const ll MOD=1000000007LL;
#define out(a) cout<<fixed<<setprecision((a))
//tie(a,b,c) = make_tuple(10,9,87);
#define pop_(a) __builtin_popcount((a))
ll keta(ll a){ll r=0;while(a){a/=10;r++;}return r;}
ll ketawa(ll a){ll r=0;while(a){r+=a%10;a/=10;}return r;}


int main(){
  int x,ans=0;
  cin >> x;
  ans += (x/500) * 1000 + (x%500)/5 * 5;
  cout << ans << endl;
}

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

int main() {
    int n, m, in, sum(0);
    cin >> n >> m;
    while (m--) {
        cin >> in;
        sum += in;
    }
    if (sum > n) { cout << -1 << "\n";}
    else cout << n - sum << "\n";
}

Measured memory_bytes: 3612
#include <iostream>
#include <vector>
#include <numeric>
#include <math.h>
#include <algorithm> 
#include <string>

#define rep(i,n) for(int (i) = 0;(i) < (n);(i)++)
#define sum(n) accumulate((n).begin(), (n).end(), 0)
using namespace std;


int main(){
	int n;
	cin >> n;
	rep(i,26) {
		rep(j,15) {
			if (i*4+j*7 == n) {
				cout << "Yes" << endl;
				return 0;
			}
		}
	}
	cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define MAX 1000000
vector< bool > prime( MAX+1, true);
 
void get_prime(int n){
  if(n >= 0) prime[0] = false;
  if(n >= 1) prime[1] = false;
   
  for(int i = 2; i * i <= n; i++){
    if(prime[i]){
      for(int j = i + i; j <= n; j += i) prime[j] = false;
    }
  }
}

int main(){
  get_prime(MAX);
  int a,d,n;
  while(cin >> a >> d >> n , a){
    int cnt = 0;
    int idx = 0;
    while(cnt != n){
      if(prime[a+idx*d]) cnt++;
      idx++;
    }
    cout << a+(idx-1)*d << endl;
  }
}

Measured memory_bytes: 1316
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define rep(i,N) for(int i=0;i<(int)N;i++)
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
static inline void PUT(char c)
{
  static char buf[1<<15],*ptr=buf;
  if(ptr==buf+strlen(buf)||c==0){fwrite(buf,1,ptr-buf,stdout),ptr=buf;}*ptr++=c;
}
static inline int IN(void)
{
  int x=0,f=0,c=getchar();while(c<48||c>57){f^=c==45,c=getchar();}
  while(c>47&&c<58){x=x*10+c-48,c=getchar();}return f?-x:x;
}
static inline void OUT(int a)
{
  if(a<0)PUT('-'),a=-a;
  int d[40],i=0;do{d[i++]=a%10;}while(a/=10);
  while(i--){PUT(d[i]+48);}PUT('\n');
}
const int qsz=5e4;int qLen,qHead,Q[50000];
static inline void PUSH(int n){Q[(qHead+qLen)%qsz]=n;qLen++;}
static inline int POP(void){int q=Q[qHead];qLen--;qHead=(qHead+1)%qsz;return q;}
int H,W,grid[1000][1000];
const int dx[24]={0,1,0,-1,0,0,1,1,1,1,-1,-1,-1,-1,2,2,2,2,2,-2,-2,-2,-2,-2};
const int dy[24]={1,0,-1,0,2,-2,1,2,-1,-2,1,2,-1,-2,0,1,2,-1,-2,0,1,2,-1,-2};
static inline int f(int x,int y){return W*x+y;}
static inline void DFS(int x,int y)
{
  if(x>=0&&x<H&&y>=0&&y<W&&!grid[x][y])
  {
    grid[x][y]=1;PUSH(f(x,y));rep(i,4){DFS(x+dx[i],y+dy[i]);}
  }
}
int main(void)
{
  int C[2],D[2],step=0;H=IN(),W=IN(),C[0]=IN()-1,C[1]=IN()-1,D[0]=IN()-1,D[1]=IN()-1;
  rep(i,H){char str[1001];if(!scanf("%s",str)){return -1;}rep(j,W){grid[i][j]=(str[j]=='#');}}
  PUSH(f(C[0],C[1]));
  while(qLen)
  {
    int size=qLen;
    while(size--){int x=POP();DFS(x/W,x%W);}
    size=qLen;
    while(size--)
    {
      int z=POP(),x=z/W,y=z%W;
      if(x==D[0]&&y==D[1]){return OUT(step),0;}
      rep(i,20)
      {
        int nx=x+dx[4+i],ny=y+dy[4+i];
        if(nx>=0&&nx<H&&ny>=0&&ny<W&&!grid[nx][ny]){PUSH(f(nx,ny));}
      }
    }
    step++;
  }
  return puts("-1"),0;
}

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

int main() {
  int n;
  int ans = 0;
  cin >> n;
  vector<int> num(n);

  for(int i = 0; i < n; i++) {
    cin >> num.at(i);
  }
  sort(num.begin(), num.end());
  num.erase(unique(num.begin(), num.end()), num.end());

  cout << num.size() <<endl;
}

Measured memory_bytes: 256
Module Module1

    Sub Main()

        Dim tmp() As String = Split(Console.ReadLine())
        Dim N As Integer = CInt(tmp(0))
        Dim K As Integer = CInt(tmp(1))

        Dim tmp2() As String = Split(Console.ReadLine())

        Dim c As Integer
        Dim ans As Integer = 0

        For c = 0 To N - 1
            If CInt(tmp2(c)) >= K Then
                ans += 1
            End If
        Next

        Console.WriteLine(ans)
        Console.Read()

    End Sub

End Module


Measured memory_bytes: 19424
#include <iostream>
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int sz = 2e5+5;
ll int arr[sz]={0},arr1[sz]={0};
//ll int arr[100][100]= {0};
int prime[10005]= {0};
vector <ll int> vec,vec1,vec2;
//vector <pair <int,int>> vec;
set<ll int>st;

int main()
{
    ll int a,b,x;
    cin>>a>>b>>x;

    ll int k = b/x;
    ll int l = a/x;
    k++, l++;
    if(a%x==0)
        l--;

    cout<<k-l<<endl;

}


Measured memory_bytes: 3624
#include<cstdio>
#define MAX 10000
#define NIL -1

struct Node {int parent, left, right;};

Node T[MAX];
int n, D[MAX], H[MAX];

void setDepth(int u, int d){
  if (u == NIL) return;
  D[u] = d;
  if (T[u].left != NIL) setDepth(T[u].left, d + 1);
  if (T[u].right != NIL) setDepth(T[u].right, d + 1);
}

int setHeight(int u){
  int h1 = 0, h2 = 0;
  if (T[u].left != NIL) h1 = setHeight(T[u].left) + 1;
  if (T[u].right != NIL) h2 = setHeight(T[u].right) + 1;
  return H[u] = h1 > h2 ? h1 : h2;
}

int getSibling(int u){
  if (T[u].parent == NIL) return NIL;
  if (T[T[u].parent].left != u && T[T[u].parent].left != NIL) return T[T[u].parent].left;
  if (T[T[u].parent].right != u && T[T[u].parent].right != NIL) return T[T[u].parent].right;
  return NIL;
}

void print(int u){
  printf("node %d: ", u);
  printf("parent = %d, ", T[u].parent);
  printf("sibling = %d, ", getSibling(u));
  int deg = 0;
  if (T[u].left != NIL) deg++;
  if (T[u].right != NIL) deg++;
  printf("degree = %d, ", deg);
  printf("depth = %d, ", D[u]);
  printf("height = %d, ", H[u]);
  if (T[u].parent == NIL) printf("root\n");
  else if (T[u].left == NIL && T[u].right == NIL) printf("leaf\n");
  else printf("internal node\n");
}

int main(){
  int v, l, r, root = 0;

  scanf("%d", &n);
  for (int i=0; i<n; i++) T[i].parent = NIL;

  for (int i=0; i<n; i++){
    scanf("%d %d %d", &v, &l, &r);
    T[v].left = l;
    T[v].right = r;
    if (l != NIL) T[l].parent = v;
    if (r != NIL) T[r].parent = v;
  }

  for (int i=0; i<n; i++) if (T[i].parent == NIL) root = i;

  setDepth(root, 0);
  setHeight(root);

  for (int i=0; i<n; i++) print(i);

  return 0;
}



Measured memory_bytes: 2696
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <cstring>
#include <map>
#include <set>
#include <queue>
#include <math.h>
#include <unordered_map>
#include <algorithm>

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
inline int gcd(int a,int b){return b?gcd(b,a%b):a;}
inline int lcm(int a,int b){return a*b/gcd(a,b);}
typedef long long ll;
typedef std::vector<int> VI;
typedef std::pair<int, int> PII;

using namespace std;

int main()
{
  int A, B, C;
  cin >> A >> B >> C;
  C = C-(A-B);
  if (C < 0) C = 0;
  cout << C << endl;
  return 0;
}


Measured memory_bytes: 256
s[2],a[20];main(i,j,n,N,m){for(;scanf("%d",&n),n;printf("%d\n",m)){for(i=0;i<n;i++)scanf("%d",a+i);for(i=0,m=99999999,N=1<<n;i<N;j=abs(*s-s[1]),m=m<j?m:j,i++)for(*s=s[1]=j=0;j<n;j++)s[(i>>j)&1]+=a[j];}exit(0);}

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

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<char, ll> pcl;

#define m0(x) memset(x, 0, sizeof(x))
#define all(x) x.begin(), x.end()
#define asort(x) sort(all(x));
#define dsort(x, t) sort(x.begin(), a.end(), greater<t>());
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());
#define MINS(m, s) m.insert(mp(s, 1));
#define MFIN(m, s) m.find(s) != m.end()
#define mp make_pair
#define pb push_back
#define INF (1 << 29)
const int mod = 1000000007;

int main() {
    int N, a;
    cin >> N;
    for(int i = 0; i < N; i++) {
        cin >> a;
        if(a % 2 == 0) {
            if(a % 3 == 0 || a % 5 == 0) {
            } else {
                cout << "DENIED" << endl;
                exit(0);
            }
        }
    }
    cout << "APPROVED" << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int mod = 1e9+7;
char s[100005];
LL pw[100005];
int main(){
    pw[0] = 1;
    for(int i=1;i<=100001;i++) pw[i] = pw[i-1]*3%mod;
    scanf("%s", s+1);
    int n = strlen(s+1);

    LL sum = 1, ans = 0;
    for(int i=1;i<=n;i++){
        if(s[i] == '1'){
            ans = (ans + sum*pw[n-i])%mod;
            sum = sum*2%mod;
        }
    }
    ans = (ans + sum)%mod;
    printf("%lld\n", ans);
}

Measured memory_bytes: 1152
#include<iostream>
#include<string>
using namespace std;
string s = "CODEFESTIVAL2016";
int main(){
	string t;
	cin>>t;
	int res=0;
	for(int i=0; i<16; i++)
		if(s[i] != t[i])
			res++;
	cout<<res<<endl;
	return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.math.*;

public class Main {
    private static Scanner sc;

    public static void main(final String[] args) {
        final Main instance = new Main();
        sc = instance.new Scanner();
        instance.solve();
    }

    private class Scanner {
        String[] s;
        int i;
        BufferedReader br;
        String regex = " ";

        public Scanner() {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        @Override
        protected void finalize() throws Throwable {
            try {
                super.finalize();
            } finally {
                destruction();
            }
        }

        private void destruction() throws IOException {
            if (br != null)
                br.close();
        }

        public String next() throws IOException {
            if (i < s.length)
                return s[i++];
            String st = br.readLine();
            while (st == "")
                st = br.readLine();
            s = st.split(regex, 0);
            i = 0;
            return s[i++];
        }

        public int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        }

        public Long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        }

        public Double nextDouble() throws NumberFormatException, IOException {
            return Double.parseDouble(next());
        }
    }

    private void solve() {
        try {

            
            int a = sc.nextInt();
            int b = sc.nextInt();

            if(a<=8 && b<=8){
                System.out.println("Yay!");

            }else{
                System.out.println(":(");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println();
    }

}


Measured memory_bytes: 21204