akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

const int N = 100010;
vector<int> G[N];

int par[N];
void dfs(int x){
    for(int e:G[x])if(e!=par[x]){
        par[e] = x;
        dfs(e);
    }
}

bool b[N]={};
int vis[N]={};

bool solve(){
    int n,u,v;
    scanf(" %d %d %d", &n, &u, &v);
    --u;
    --v;
    rep(i,n-1){
        int x,y;
        scanf(" %d %d", &x, &y);
        --x;
        --y;
        G[x].pb(y);
        G[y].pb(x);
    }

    // if(n%2==1) return false;

    par[u] = -1;
    dfs(u);

    int tt = v;
    while(tt!=u){
        b[tt] = true;
        tt = par[tt];
    }

    int R=1, B=1;
    vis[u] = 1;
    vis[v] = 2;

    int now = u;
    while(R<n/2){
        int ch=0;
        for(int e:G[now])if(par[now]!=e && !vis[e]) ++ch;

        if(ch==0) break;
        else if(ch==1){
            for(int e:G[now])if(par[now]!=e && !vis[e]){
                ++R;
                vis[e] = 1;
                now = e;
            }
        }
        else if(ch==2){
            for(int e:G[now])if(par[now]!=e && !vis[e]){
                if(!b[e]){
                    ++R;
                    vis[e] = 1;
                    now = e;
                    break;
                }
            }
        }
        else return false;
    }

    while(B<n/2){
        int ct = 0;
        for(int e:G[v])if(vis[e]==0) ++ct;
        if(ct==0) break;
        if(ct>=2) return false;

        for(int e:G[v])if(vis[e]==0){
            ++B;
            vis[e] = 2;
            v = e;
        }
    }

    rep(i,n)if(vis[i]==0) return false;
    return R==B;
}

int main(){
    cout << (solve()?"Yes":"No") << endl;
    return 0;
}



Measured memory_bytes: 14240
package main

import (
	"fmt"
	"math"
)

func abs(x float64) float64 {
	if x < 0 {
		return -x
	} else {
		return x
	}
}

func getSquaring(x float64) float64 {
	return x*x
}

func getQube(x float64) float64 {
	return x*x*x
}

func main() {
	var n, ans float64
	fmt.Scan(&n)
	n_int := int(n)
	x := make([]float64, n_int)
	y := make([]float64, n_int)
	for i := range x {
		fmt.Scan(&x[i])
	}
	for i := range y {
		fmt.Scan(&y[i])
	}

	// p == 1
	ans = 0
	for i := 0; i < n_int; i++ {
		ans += abs(x[i] - y[i])
	}
	fmt.Printf("%f\n", ans)

	// p == 2
	ans = 0
	for i := 0; i < n_int; i++ {
		ans += getSquaring(abs(x[i] - y[i]))
	}
	fmt.Println(math.Sqrt(ans))

	// p == 3
	ans = 0
	for i := 0; i < n_int; i++ {
		ans += getQube(abs(x[i] - y[i]))
	}
	fmt.Println(math.Cbrt(ans))

	// p == +Inf
	ans = -1
	for i := 0; i < n_int; i++ {
		ans = math.Max(ans, abs(x[i] - y[i]))
	}
	fmt.Printf("%f\n", ans)
}


Measured memory_bytes: 1164
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <utility>
#include <cmath>
#include <tuple>
#include <queue>
#include <bitset>
#include <set>
#include <map>
#include <list>

using ll = long long;
using ld = long double;
using namespace std;
const int INF = 1e9+100;
const ll INF64 = 7e18l;
const int mod = 1000000007;
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define ALL(a) (a).begin(), (a).end()
#define FIN ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);


int main(){
    FIN;
    ll n; cin >> n;
    vector<ll> a(n),b(n),c(n);
    for(ll i=0;i<n;i++) cin >> a[i];
    for(ll i=0;i<n;i++) cin >> b[i];
    for(ll i=0;i<n;i++) cin >> c[i];
    sort(ALL(a));
    sort(ALL(b));
    sort(ALL(c));

    ll ans = 0;

    for(ll i=0;i<n;i++){
        auto A = lower_bound(ALL(a),b[i]);
        auto B = upper_bound(ALL(c),b[i]);
        //cout << A - a.begin() << " " << c.end() - B << endl;
        ans += (A - a.begin()) * (c.end() - B);
    }

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


Measured memory_bytes: 5472
package main

import (
   "fmt"
)

func solution(n int) int {
   out := 0
   for i := 1; i <= n; i++ {
        out += i * g(n/i)
   }
   return out
}

func g(n int) int {
   return n * (n + 1) / 2
}

func main() {
   var n int
   fmt.Scan(&n)
   fmt.Println(solution(n))
}

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

using namespace std;

typedef long long ll;
typedef pair<int, int> pii ;
const int mod = 1e9 + 7;

ll binPow(ll x, ll y, ll md = mod){
    ll res = 1;
    x %= mod;
    while(y){
        if(y & 1){
            res = (res * x) % mod;
        }
        y >>= 1;
        x = (x * x) % mod;
    }
    return res;
}

void solve(){
    int n, k;
    cin >> n >> k;
    int ans = pow((k -1), (n - 1)) *k;cout << ans << "\n";
}

int main() {
#ifndef ONLINE_JUDGE
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    solve();
    return 0;
}



Measured memory_bytes: 256
#include<iostream>
using namespace std;
#include<vector>
#include<cmath>
#define int long long int
#define mod 1000000007
#define inf 20001
int function(char mat[101][101],int x1,int y1,int x2,int y2,int n,int m,bool visited[101][101])
{
	if(x1<0||x1>n||y1<0||y1>m)
	    return inf;
	if(x1==x2&&y1==y2)
	{
		return 0;
	}
	if(visited[x1][y1])
	    return inf;
	else
	{
		visited[x1][y1]=true;
		int answer=0;
		if(mat[x1][y1]=='1')
		  answer++;
	    int a=answer+function(mat,x1+1,y1,x2,y2,n,m,visited);
	    int b=answer+function(mat,x1-1,y1,x2,y2,n,m,visited);
	    int c=answer+function(mat,x1,y1+1,x2,y2,n,m,visited);
	    int d=answer+function(mat,x1,y1-1,x2,y2,n,m,visited);
	    return min(min(a,b),min(c,d));
	}
}
int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
    int n,t;
    cin>>n>>t;
    int j,arr[n+1];
    for(j=0;j<n;j++)
       cin>>arr[j];
    arr[n]=100000000000000;
    int answer=0;
    int curr=0;
    for(j=0;j<n;j++)
    {
		curr=t;
		if(arr[j+1]-arr[j]>t)
		{
			answer+=curr;
			curr=0;
		}
		else
		{
			answer+=arr[j+1]-arr[j];
			curr=0;
		}
	}
	cout<<answer<<endl;
    
}


Measured memory_bytes: 1792
#include <stdio.h>

#define N 44

int main(){

  int i;
  int n = 0;
  int fib[N];
 
  scanf("%d",&n);

  if(N < n || n < 0) return 0;

  fib[0] = fib[1] = 1;

  for(i = 0; i+2 <= n; i++){
    fib[i+2] = fib[i]+fib[i+1];
  }

  printf("%d\n",fib[n]);

  return 0;
}

Measured memory_bytes: 596
import math
n = int(input())
mx = 1000000000
# mx = 7
if n<mx:
    print(0, 0, 1, 0, 1, n)
else:
    mul = math.ceil((n*1.0)/mx)
    x3= mx*mul-n
    print(0,0,mx,1,x3,mul)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define lint long long
#define st first
#define nd second
#define INF 0x3f3f3f3f

using namespace std;


vector<int> divisors(int n) {
    vector<int> result, aux;
    for (int i = 1; i*i <= n; ++i) 
        if (n % i == 0) {
            result.push_back(i);
            if (i*i != n) aux.push_back(n/i);
        }
    for (int i = aux.size()-1; i+1; --i) result.push_back(aux[i]);
    return result;
}


int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	int n; cin>>n;
	vector<int> a(n);
	map<int,int> cont;
	for(auto &x:a){
		cin>>x;
		cont[x]++;	
	}
	
	lint ans = n;
	
	
	
	
	for(int &x:a){
		vector<int> div = divisors(x);
		for(int &y:div){
			//cerr<<x<<" "<<y<<"\n";
			if((x != y && cont.count(y)) || (x==y && cont[y]>1)){ 
				ans--;
				break;
			}
		}
	
	}
	
	cout<<ans<<"\n";
	return 0;	
}


Measured memory_bytes: 13392
N = int(input())
P = [list(map(int,input().split())) for n in range(N)]
x,y,h = list(filter(lambda x:x[2],P))[0]

for i in range(101):
  for j in range(101):
    H = h+abs(x-i)+abs(y-j)
    if all(max(H-abs(t[0]-i)-abs(t[1]-j),0)==t[2] for t in P):
      print(i,j,H)

Measured memory_bytes: 9040
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <stack>
#include <queue>
#include <bitset>     //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>        //do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)

#define ST first
#define ND second
#define PB push_back
#define PF push_front
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double
#define pii pair<int,int>
#define pll pair<LL,LL>
#define vi vector<int>
#define vl vector<LL>
#define vii vector<vi>
#define vll vector<vl>

const double pi = 3.14159265358979323846264;
const int mod=1000000007;

int main(){
	int n;
    cin>>n;
    int mn=mod,ans=0;
    FOR(i,0,n){
        int p;
        cin>>p;
        if(mn>p)ans++;
        mn=min(mn,p);
    }
    cout<<ans;
}


Measured memory_bytes: 256
n, m = map(int, input().split())
A = [list(map(int, input().split())) for i in range(m)]
A.sort()
*v_min, = range(n)
*v_max, = range(n)

for _, y in A:
    v_max[y-1] = v_max[y]
    v_min[y] = v_min[y-1]

print(*[v_max[i] - v_min[i] + 1 for i in range(n)])

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

using namespace std;


typedef long long ll;
ll mod=1e9+0LL;
ll MOD=1e18+0LL;
double pi=acos(-1);


int main()
{
    int cs=1;
    //scanf("%d",&cs);
    while(cs--)
    {
        int i,j,n,m;
        scanf("%d %d",&n,&m);
        //bool b[n+1][n+1];
        vector<int>v[n+1];

        while(m--){
            int c,d;
            scanf("%d %d",&c,&d);
            v[c].push_back(d);
            v[d].push_back(c);
        }
        int a[n+1];
        memset(a,-1,sizeof(a));
        if(v[1].size()==0)
        {
            printf("No");
            return 0;
        }
        queue<int>q;
        q.push(1);
        while(!q.empty())
        {
            int u=q.front();
            q.pop();
            for(j=0;j<v[u].size();j++)
            {
                int node=v[u][j];
                if(a[node]!=-1)
                {
                    continue;
                }
                    a[node]=u;
                    q.push(node);
            }
        }
            printf("Yes\n");
            for(i=2;i<=n;i++)
            {
                printf("%d\n",a[i]);
            }

    }
}

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

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;

#define F first
#define S second
#define PB push_back
#define MP make_pair
#define what_is(x) cerr << #x << " is " << x << endl;
#define MT make_tuple
#define eb emplace_back
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))

#define REP(i,a,b) for (int i = a; i <= b; i++)
#define FOR(i,n) for (int i=0;i < n ; i++)
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << endl;
	err(++it, args...);
}
clock_t startTime;
long double getTime(){
	return (long double)(clock()-startTime)/CLOCKS_PER_SEC;
}

int main(){
	startTime=clock();
	ll n;
	cin >> n;
	ll m=sqrt(n);
	ll sum=0;
	// n= m q + q = q(m+1) with q < m 
	// this is same as n= a . b with a < b-1 then we sum over such b-1
	for(int i=1; i <= m;i++){
		if(n%i==0) sum+=n/i -1;
	} 
	if(n==m*(m+1)) sum-=m;
	if(n==m*m) sum-=m-1;
	cout << sum;
	return 0;
}

Measured memory_bytes: 3584
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#include<cstring>
#define SZ(x) ((int)(x).size())

int const N = 1e5 + 5;

int a[N];
int n;

bool chk(std::string const& s) {
	for(int i = 0, j = SZ(s) - 2; i <= j; ++i, --j) {
		if(s[i] != s[j])
			return 0;
	}
	return 1;
}

int main() {
	std::string s;
	std::cin >> s;
	n = SZ(s);
	if(*s.begin() == '0' || s[n - 1] == '1' || ::chk(s) == 0) {
		puts("-1");
		return 0;
	}

	auto it = s.end() - 1;

	static int fa[N];
	memset(fa, 0, sizeof(fa));
	for(int i = 1; i <= n; ++i) {
		it--;
		if(*it == '0') 
			continue;
		for(int j = i - 1; j >= 1; --j) {
			if(fa[j] != 0) 
				break;
			fa[j] = i;
		}
	}

	for(int i = n - 1; i >= 1; --i) {
		if(fa[i] != 0)
			break;
		fa[i] = n;
	}

	for(int i = 1; i < n; ++i) 
		std::cout << i << ' ' << fa[i] << '\n';
	return 0;
}


Measured memory_bytes: 2048
#include <iostream>
#include <string>
#include <map>
#include <vector>
using namespace std;

typedef map<char,string> M;

map<char,string> s;
map<string,char> g;
int main()
{
    s['A'] = "00000";
    s['B'] = "00001";
    s['C'] = "00010";
    s['D'] = "00011";
    s['E'] = "00100";
    s['F'] = "00101";
    s['G'] = "00110";
    s['H'] = "00111";
    s['I'] = "01000";
    s['J'] = "01001";
    s['K'] = "01010";
    s['L'] = "01011";
    s['M'] = "01100";
    s['N'] = "01101";
    s['O'] = "01110";
    s['P'] = "01111";
    s['Q'] = "10000";
    s['R'] = "10001";
    s['S'] = "10010";
    s['T'] = "10011";
    s['U'] = "10100";
    s['V'] = "10101";
    s['W'] = "10110";
    s['X'] = "10111";
    s['Y'] = "11000";
    s['Z'] = "11001";
    s[' '] = "11010";
    s['.'] = "11011";
    s[','] = "11100";
    s['-'] = "11101";
    s['\''] = "11110";
    s['?'] = "11111";
    g["100101"] = 'A';
    g["10011010"] = 'B';
    g["0101"] = 'C';
    g["0001"] = 'D';
    g["110"] = 'E';
    g["01001"] = 'F';
    g["10011011"] = 'G';
    g["010000"] = 'H';
    g["0111"] = 'I';
    g["10011000"] = 'J';
    g["0110"] = 'K';
    g["00100"] = 'L';
    g["10011001"] = 'M';
    g["10011110"] = 'N';
    g["00101"] = 'O';
    g["111"] = 'P';
    g["10011111"] = 'Q';
    g["1000"] = 'R';
    g["00110"] = 'S';
    g["00111"] = 'T';
    g["10011100"] = 'U';
    g["10011101"] = 'V';
    g["000010"] = 'W';
    g["10010010"] = 'X';
    g["10010011"] = 'Y';
    g["10010000"] = 'Z';
    g["101"] = ' ';
    g["000000"] = '\'';
    g["000011"] = ',';
    g["10010001"] = '-';
    g["010001"] = '.';
    g["000001"] = '?';

    string str;
    while (getline(cin, str)) {
        string v;
        for (int i = 0; i < str.size(); i++)
            v += s[str[i]];
        for (int i = 0; i < v.size(); i++) {
            string y = "";
            for (int j = i; j < v.size(); j++) {
                y += v[j];
                if (g.find(y) != g.end()) {
                    cout << g[y];
                    i += y.size() -1;
                }
            }
        }
        cout << endl;
    }

    return 0;
}

Measured memory_bytes: 1204
#include <stdio.h>
#include <iostream>
#include <string>
#include <math.h>
using namespace std;

int main(void)
{

	string S;
	cin >> S;

	long long unsigned int K;
	cin >> K;
	
	int y = 1;
	int i = 0;

	
	for (i=0; i<S.length(); i++){
		if (S[i] != '1' && i<K) {
			break;
		}
	}

	if (i < K){
		cout << S.substr(i,1) << endl;
	}else{
		cout << "1";
	}

		
	
	return 0;
}



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

using namespace std;

int main() {
    int sum = 0;
    for (int i = 0; i < 5; ++i) {
        int s;
        cin >> s;
        if (s < 40) s = 40;
        sum += s;
    }
    cout << sum / 5 << '\n';
}


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

using namespace std;

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

    int n, d;
    cin >> n >> d;

    cout << n / (d * 2 + 1) + (n % (d * 2 + 1) != 0) << '\n';

    return 0;
}

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

int main() {
    int N, X, i, key, flag = 0;
    double ans1, ans2;
    cin >> N;
    
    ans1 = N / 1.08;
    ans2 = (N + 1) / 1.08;
    key = N / 1.08;
    for (i = key; i < ans2; i++) {
        if (i >= ans1) {
            X = i;
            cout << X << endl;
            flag++;
        }
    }
    if (flag == 0) cout << ":(" << endl;
}

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

class Program
{
    static string InputPattern = "InputX";

    static List<string> GetInputList()
    {
        var WillReturn = new List<string>();

        if (InputPattern == "Input1") {
            WillReturn.Add("3");
            WillReturn.Add("6");
            WillReturn.Add("2");
            WillReturn.Add("6");
            //1
        }
        else if (InputPattern == "Input2") {
            WillReturn.Add("4");
            WillReturn.Add("2");
            WillReturn.Add("5");
            WillReturn.Add("5");
            WillReturn.Add("2");
            //0
        }
        else if (InputPattern == "Input3") {
            WillReturn.Add("6");
            WillReturn.Add("12");
            WillReturn.Add("22");
            WillReturn.Add("16");
            WillReturn.Add("22");
            WillReturn.Add("18");
            WillReturn.Add("12");
            //2
        }
        else {
            string wkStr;
            while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
        }
        return WillReturn;
    }

    static void Main()
    {
        List<string> InputList = GetInputList();
        int[] AArr = InputList.Skip(1).Select(X => int.Parse(X)).ToArray();

        var wkSet = new HashSet<int>();
        foreach (int EachInt in AArr) {
            if (wkSet.Contains(EachInt)) {
                wkSet.Remove(EachInt);
            }
            else wkSet.Add(EachInt);
        }
        Console.WriteLine(wkSet.Count);
    }
}


Measured memory_bytes: 26716
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;
typedef pair<ll, ll> P;
#define INF 10000000000000
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep1(i, n) for(ll i = 1; i < (ll)(n); i++)
#define repN_1(i, n) for(ll i = 0; i < (ll)(n - 1); i++)
#define repM(i, n) for(ll i = (ll)(n - 1); i >= 0; i--)
#define repM1(i, n) for(ll i = (ll)(n - 1); i > 0; i--)
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }

int main()
{
	cout << fixed << setprecision(18);

	ll n;
	cin >> n;
	vector<ll> a(n), b(n);
	rep(i, n)
		cin >> a[i] >> b[i];

	sort(a.begin(), a.end());
	sort(b.begin(), b.end());

	ll ans;
	if (n % 2 == 1) {
		ans = b[(n + 1) / 2 - 1] - a[(n + 1) / 2 - 1] + 1;
	}
	else {
		double tmp_a = (a[n / 2 - 1] + a[(n / 2 + 1) - 1]) * 0.5;
		double tmp_b = (b[n / 2 - 1] + b[(n / 2 + 1) - 1]) * 0.5;

		ll aa = tmp_a * 10 + 0.5;
		ll bb = tmp_b * 10 + 0.5;

		ans = (bb - aa) / 5 + 1;
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 6412
import java.util.*

class Scanner(`in`: java.io.InputStream) {
    private val reader = java.io.BufferedReader(java.io.InputStreamReader(`in`))
    private var tokenizer: StringTokenizer? = null

    fun next(): String {
        if (tokenizer?.hasMoreTokens() != true) {
            tokenizer = StringTokenizer(reader.readLine())
        }
        return tokenizer!!.nextToken()
    }

    fun nextLine(): String {
        return if (tokenizer?.hasMoreTokens() != true) {
            reader.readLine()
        } else tokenizer!!.nextToken("\n")
    }
}

fun dprint(v: Any?, indent: Int = 0) {
    val indentStr = (1..indent).joinToString("") { " " }
    when (v) {
        is Iterable<*> -> {
            System.err.println("$indentStr[")
            v.forEach { dprint(it, indent + 1) }
            System.err.println("$indentStr]")
        }
        is Array<*> -> {
            System.err.println("$indentStr[")
            v.forEach { dprint(it, indent + 1) }
            System.err.println("$indentStr]")
        }
        is IntArray -> System.err.println(indentStr + "[" + v.joinToString(",") + "]")
        is LongArray -> System.err.println(indentStr + "[" + v.joinToString(",") + "]")
        is DoubleArray -> System.err.println(indentStr + "[" + v.joinToString(",") + "]")
        else -> System.err.println(indentStr + v)
    }
}

fun <A : Comparable<A>> min(a: A, b: A) = if (a < b) a else b
fun <A : Comparable<A>> min(vararg a: A) = a.reduce { acc, x -> min(acc, x) }
fun <A : Comparable<A>> max(a: A, b: A) = if (a > b) a else b
fun <A : Comparable<A>> max(vararg a: A) = a.reduce { acc, x -> max(acc, x) }

////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////

fun main(args: Array<String>) {
    val pw = java.io.PrintWriter(System.out)
    val sc = Scanner(System.`in`)
//    for (t in 1..sc.next().toInt()) {
    Problem.solve(sc, pw)
//    }
    pw.flush()
}

object Problem {
    fun solve(sc: Scanner, pw: java.io.PrintWriter) {
        val H = sc.next().toInt()
        val W = sc.next().toInt()
        val A = Array(H) { sc.next().map { it == '#' }.toBooleanArray() }
        for (h in 0 until H) {
            for (w in 0 until W) {
                if (A[h][w]) {
                    if (!(h > 0 && A[h - 1][w] || w > 0 && A[h][w - 1] || h < H - 1 && A[h + 1][w] || w < W - 1 && A[h][w + 1])) {
                        pw.println("No")
                        return
                    }
                }
            }
        }
        pw.println("Yes")
    }
}


Measured memory_bytes: 31136
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] a = new int[N];
		for (int i = 0; i < N; i++) {
			a[i] = sc.nextInt();
		}
		sc.close();

		int cnt = 0;
		for (int i = 1; i <= N; i++) {
			if (i % 2 == 1 && a[i - 1] % 2 == 1) {
				cnt++;
			}
		}

		System.out.println(cnt);
	}
}


Measured memory_bytes: 35724
import java.util.*;

public class Main {
    static long MOD = 1000000007;
    
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        boolean[] ng = new boolean[n+1];
        for (int i = 0; i < k; i++) {
            int num = sc.nextInt();
            ng[num] = true;
        }
        
        long[] dp = new long[n+1];
        dp[0] = 1;
        dp[1] = 1;
        for (int i = 2; i <= n; i++) {
            if (!ng[i-1]) {
                dp[i] += dp[i-1];
                dp[i] %= MOD;
            }
            if (!ng[i-2]) {
                dp[i] += dp[i-2];
                dp[i] %= MOD;
            }
        }
        System.out.println(dp[n]);
    }
}

Measured memory_bytes: 49076
#include <stdio.h>
#include <string.h>
#define maxn 200010
char s[maxn],t[maxn];
int main(){
	int i,n,cnt=0;
	scanf("%s%s",s,t);
	n=strlen(s);
	for(i=0;i<n;i++)
		if(s[i]!=t[i])cnt++;
	printf("%d\n",cnt);
	return 0;
}

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

#define INF 1001001001
#define LINF 1001001001001001001
#define MOD 1000000007
#define MOD2 998244353

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

#define rep(i,n) for(int i=0,_i=(n);i<_i;++i)
#define rep1(i,a,b) for(int a_=(a),b_=(b),i=a_;i<b_;++i)
#define repr(i,n) for(int _i=(n),i=_i;i>0;--i)

#define db(x) cerr<<#x<<" = "<<x<<" ";
#define db2(x,y) cerr<<"("<<#x<<", "<<#y<<") = ("<<x<<", "<<y<<") ";
#define db3(x,y,z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = ("<<x<<", "<<y<<", "<<z<<") ";
#define ln cout<<endl;

#define all(a)  (a).begin(),(a).end()
#define dig(n)  to_string(n).length()

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define se second
#define fi first

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<pii,pii> ppii;

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

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

int main(){

    bool flag=false;
    ll ans=0,sum=0;

    ll x;
    cin>>x;

    ans += 1000*(x/500);
    x %= 500;
    ans += 5*(x/5);

    cout<<ans<<endl;

    //cout <<fixed<<setprecision(16)<< << endl;

    //if(flag)cout << "Yes" <<endl;
    //else cout << "No" <<endl;

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long 
#define mp make_pair 
#define f(i,n) for(int i=0;i<n;i++) 
#define F first 
#define S second 
#define pb push_back 

using namespace std;

const int MAX = 10000001; 
  
// array to store prime factors 
int factor[MAX] = { 0 }; 
  
// function to generate all prime factors 
// of numbers from 1 to 10^6 
void gs() 
{ 
    factor[1] = 1; 
  
    // Initializes all the positions with their value. 
    for (int i = 2; i < MAX; i++) 
        factor[i] = i; 
  
    // Initializes all multiples of 2 with 2 
    for (int i = 4; i < MAX; i += 2) 
        factor[i] = 2; 
  
    // A modified version of Sieve of Eratosthenes to 
    // store the smallest prime factor that divides 
    // every number. 
    for (int i = 3; i * i < MAX; i++) { 
        // check if it has no prime factor. 
        if (factor[i] == i) { 
            // Initializes of j starting from i*i 
            for (int j = i * i; j < MAX; j += i) { 
                // if it has no prime factor before, then 
                // stores the smallest prime divisor 
                if (factor[j] == j) 
                    factor[j] = i; 
            } 
        } 
    } 
} 
  
// function to calculate number of factors 
int fs(int n) 
{ 
    if (n == 1) 
        return 1; 
  
    int ans = 1; 
  
    int dup = factor[n]; 
  
    int c = 1; 
   
    int j = n / factor[n]; 
  
    while (j != 1) { 
        if (factor[j] == dup) 
            c += 1; 
  
        else { 
            dup = factor[j]; 
            ans = ans * (c + 1); 
            c = 1; 
        } 
  
        // prime factorizes a number 
        j = j / factor[j]; 
    } 
  
    // for the last prime factor 
    ans = ans * (c + 1); 
  
    return ans; 
} 


void test(){
	gs();
	ll n;
	cin>>n;
	ll s = 0;
	for(ll i=1;i<=n;i++){
		s = s + (fs(i)*i);
	}
	cout<<s<<"\n";
}

int main(){
	std::ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int tests=1;
//	cin>>tests;
	while(tests--){
		test();
	}
}

Measured memory_bytes: 42696
#include<bits/stdc++.h>
using namespace std;
int a,b;
int main(){
	cin>>a>>b;
	if(a<=0&&b>=0) cout<<"Zero"<<endl;
	else if(a>0&&b>0) cout<<"Positive"<<endl;
	else if((b-a)%2) cout<<"Positive"<<endl;
	else cout<<"Negative"<<endl;
	return 0;
}

Measured memory_bytes: 764
#include<algorithm>
#include<iomanip>
#include<iostream>
#include<map>
#include<set>
#include<stack>
#include<string>
#include<vector>
#include<bitset>
#include<cmath>
#define FOR(i,a,b) for(int i=(a); i<int(b); ++i)
#define RFOR(i,a,b) for(int i=(b)-1; i>=int(a); --i)
#define rep(i,n) FOR(i,0,n)
#define rep1(i,n) FOR(i,1,int(n)+1)
#define rrep(i, n) RFOR(i, 0, n)
#define rrep1(i, n) RFOR(i, 1, int(n) + 1)
#define all(c) begin(c), end(c)
#define al(d) d.begin(),d.end()
template <typename T>
using vec = std::vector<T>;
using vi = vec<int>;
using vvi = vec<vi>;
using pii = std::pair<int, int>;
using ll = long long;
using ld = long double;
using namespace std;
const int MOD = 1000000007;

template <typename T>
void putv(vector<T>& V){
	// cout << "The elements in the vector are: " << endl;
	for(auto x: V)
		cout << x << " ";
	cout << endl;
}
template <class T>
vector<T> getv(int n){
	vector<T> vec;
	rep(i,n){
		T input;
		cin >> input;
		vec.emplace_back(input);
	}
	return vec;
}

using AdjList = vector<vector<int>>;
using Weight = int;
using Flow = int;
struct Edge {
	int src, dst;
	Weight weight;
	Flow cap;
	Edge() : src(0), dst(0), weight(0) {}
	Edge(int s, int d, Weight w) : src(s), dst(d), weight(w) {}
};
using Edges = std::vector<Edge>;
using Graph = std::vector<Edges>;
using Array = std::vector<Weight>;
using Matrix = std::vector<Array>;
void add_edge(Graph &g, int a, int b, Weight w = 1) {
	g[a].emplace_back(a, b, w);
	g[b].emplace_back(b, a, w);
}
void add_arc(Graph &g, int a, int b, Weight w = 1) { g[a].emplace_back(a, b, w); }
// Recieve edge(=(int,int)) as an adj list.
AdjList getadj(int N, int M){
	// Initialize all lists of the graph as a empty vector.
	vector<int> init;
	vector<vector<int>> graph(N,init);
	rep(i,M){
		int a, b;
		cin >> a >> b;
		graph[a-1].emplace_back(b-1);
		graph[b-1].emplace_back(a-1);
	}
// rep(i,N)
// 	putv(graph[i]);
	return graph;
}

ll Manhattan_dist(ll x1, ll y1, ll x2, ll y2){
	return abs(x1-x2) + abs(y1-y2);
}
void out(bool ans){
	if(ans == true) cout << "yes" << endl;
	else cout << "no" << endl;
}
void Out(bool ans){
	if(ans == true) cout << "Yes" << endl;
	else cout << "No" << endl;
}
void OUT(bool ans){
	if(ans == true) cout << "YES" << endl;
	else cout << "NO" << endl;
}
ll gcd(const ll a, const ll b){
	return (b==0) ? a : gcd(b,a%b);
}
// $\min\{s\in\mathbb{N}:p^s|n\}$
ll hmt_p_divide_n(ll p, ll n){
	ll s = 0;
	while(n%p == 0){
		n /= p;
		s++;
	}
	return s;
}



// 解説の実装
int dp[100010];
int main(){
	dp[0] = 0;
	for(int n = 1; n<=100000; n++){
		dp[n] = 100000;
		int power = 1;
		while(power <= n){
			dp[n] = min(dp[n], dp[n-power]+1);
			power *= 6;
		}
		power = 9;
		while(power <= n){
			dp[n] = min(dp[n], dp[n-power]+1);
			power *= 9;
		}
	}
	int N;
	cin >> N;
	cout << dp[N] << endl;
	return 0;
}


Measured memory_bytes: 640
n, m = map(int,input().split())
k = []

for i in range(n):
    k.append(list(map(int, input().split())))

dict = {}

for i in range(n):
    for j in range(1, len(k[i])):
        if(str(k[i][j]) in dict):
            dict[str(k[i][j])] += 1
        else:
            dict[str(k[i][j])] = 1

cnt = 0

for value in dict.values():
    if(value == n):
        cnt += 1
print(cnt)

Measured memory_bytes: 3064
/*input
10 9 10 10
*/
#include <bits/stdc++.h>
using namespace std; 
#define int long long int
#define max(x, y) ((x) > (y) ? (x) :(y))
#define pii pair< int , int> 
#define vi vector<int>
#define fore( i ,st) for ( int i= 0 ; i < (int)(st) ; i ++)
#define REP( i , st , en ) for ( int i =st; i < (int)en; i++)
#define REPD( i , en , st ) for ( int i =en; i >= (int)st; i--)
#define SZ(a) (int)a.size()
#define all(v) v.begin() , v.end()
#define pb push_back
#define F first
#define S second
#define bitch_i_m_on_fiyaah_yeahhhh ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

// const int mod = 998244353;
const int mod = 1e9+7;
ostream& operator << ( ostream&  o, vector<int> s){for ( int i = 0;  i < (int)s.size() ; i++)o << s[i] << " ";o << "\n";return o;}
void  add( int &a, int b){a = a + b;if ( a< 0 ) a += mod; if ( a> mod ) a-= mod;}
void sub( int &a, int b){a = a - b;if ( a < 0) a += mod;}
int mul( int a , int b){return ((a %mod) * (b %mod) ) %mod;}
int exp( int a , int pow){ return (pow == 0 ? 1 : ( pow & 1  ? mul ( a ,exp( mul(a, a) , pow /2) ) : exp(mul(a ,a) , pow/2)));}
int gcd(int a, int b) { return b ? gcd(b, a%b) : a; }
// const int inf = 1e18;
const int maxn = 2e5 + 5;

vector<int> cnt[maxn];

void solve(int test ) 
{		
	int a , b , c , d;
	cin >> a >> b >> c >> d;
	int t1 = (c + b -1 ) / b ; 
	int t2 = ( a + d -1) / d;
	if ( t1 <= t2){
		cout << "Yes";
	}
	else
		cout << "No";

}
signed main(){
	bitch_i_m_on_fiyaah_yeahhhh
	int t =1; 
	// cin >> t;
	for ( int i = 0 ; i < t; i++)
	solve(i+1 );
}

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

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

	string s; cin >> s;
	if((s[2] == s[3]) && (s[4] == s[5])){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i<(int)(n); ++i)
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using Graph = vector<vi>;  // vi <=> vl
using vb = vector<bool>;
using boolGraph = vector<vb>;
using P = pair<int, int>;  // int <=> ll
const int MOD = 1e9+7;
const double EPS = 1e-9;

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

  ll ans;
  if (N == 2 || M == 2) ans = 0;
  else if (N == 1 && M == 1) ans = 1;
  else if (N == 1 || M == 1) ans = N*M - 2;
  else ans = (N-2) * (M-2);

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define o(a) cout << a << endl
#define int long long
#define fi first
#define se second
using namespace std;
typedef pair<int, int> P;

int dy[200010] = {};
int dx[200010] = {};

signed main(){
    int n, H, W, x, y, w;
    cin >> n >> W >> H;
    rep(i, 0, n){
        cin >> x >> y >> w;
        dx[max((int)0, x - w)]++;
        dx[x + w]--;
        dy[max((int)0, y - w)]++;
        dy[y + w]--;
    }
    rep(i, 1, W) dx[i] += dx[i - 1];
    rep(i, 1, H) dy[i] += dy[i - 1];
    bool f = true, g = true;
    rep(i, 0, W) if(dx[i] == 0) f = false;
    rep(i, 0, H) if(dy[i] == 0) g = false;
    cout << ((f || g) ? "Yes" : "No") << endl;
}

Measured memory_bytes: 6208
/**
 *   @FileName	c.cpp
 *   @Author	kanpurin
 *   @Created	2020.09.13 23:37:48
**/

#include "bits/stdc++.h" 
using namespace std; 
typedef long long ll;

template< int MOD >
struct mint {
public:
    long long x;
    mint(long long x = 0) :x((x%MOD+MOD)%MOD) {}
    mint(std::string &s) {
        long long z = 0;
        for (int i = 0; i < s.size(); i++) {
            z *= 10;
            z += s[i] - '0';
            z %= MOD;
        }
        this->x = z;
    }
    mint& operator+=(const mint &a) {
        if ((x += a.x) >= MOD) x -= MOD;
        return *this;
    }
    mint& operator-=(const mint &a) {
        if ((x += MOD - a.x) >= MOD) x -= MOD;
        return *this;
    }
    mint& operator*=(const mint &a) {
        (x *= a.x) %= MOD;
        return *this;
    }
    mint& operator/=(const mint &a) {
        long long n = MOD - 2;
        mint u = 1, b = a;
        while (n > 0) {
            if (n & 1) {
                u *= b;
            }
            b *= b;
            n >>= 1;
        }
        return *this *= u;
    }
    mint operator+(const mint &a) const {
        mint res(*this);
        return res += a;
    }
    mint operator-() const {return mint() -= *this; }
    mint operator-(const mint &a) const {
        mint res(*this);
        return res -= a;
    }
    mint operator*(const mint &a) const {
        mint res(*this);
        return res *= a;
    }
    mint operator/(const mint &a) const {
        mint res(*this);
        return res /= a;
    }
    friend std::ostream& operator<<(std::ostream &os, const mint &n) {
        return os << n.x;
    }
    friend std::istream &operator>>(std::istream &is, mint &n) {
        long long x;
        is >> x;
        n = mint(x);
        return is;
    }
    bool operator==(const mint &a) const {
        return this->x == a.x;
    }
    mint pow(long long k) const {
        mint ret = 1;
        mint p = this->x;
        while (k > 0) {
            if (k & 1) {
                ret *= p;
            }
            p *= p;
            k >>= 1;
        }
        return ret;
    }
};
const int MOD = 1e9 + 7;
int main() {
    int n;cin >> n;
    vector<vector<vector<mint<MOD>>>> dp(n+1,vector<vector<mint<MOD>>>(2,vector<mint<MOD>>(2,0)));
    dp[0][0][0] = 1;
    for (int i = 0; i < n; i++) {
        dp[i + 1][0][0] = dp[i][0][0] * 8;
        dp[i + 1][0][1] = dp[i][0][0] + dp[i][0][1] * 9;
        dp[i + 1][1][0] = dp[i][0][0] + dp[i][1][0] * 9;
        dp[i + 1][1][1] = dp[i][0][1] + dp[i][1][0] + dp[i][1][1] * 10;
    }
    cout << dp[n][1][1] << endl;
    return 0;
}

Measured memory_bytes: 151348
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,S;
  cin>>N;
  vector<int>a(N);
  for(int i=0;i<N;i++)cin>>a.at(i);
  sort(a.begin(),a.end());
  S=1;
  for(int i=1;i<N;i++)if(a.at(i-1)!=a.at(i))S++;
  cout<<S<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
int a,b,n;
signed main(){
	scanf("%lld%lld%lld",&a,&b,&n);
	if(b-1<=n)printf("%lld\n",(a*(b-1))/b);
	else printf("%lld\n",(a*n)/b);
	return 0;
}

Measured memory_bytes: 3824
#include <iostream>
#include <algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<iomanip>
#include<map>
#define sqr(x) (x)*(x)
#define fz1(i,n) for (i=1;i<=n;i++)
#define fd1(i,n) for (i=n;i>=1;i--)
#define fz0g(i,n) for (i=0;i<=n;i++)
#define fd0g(i,n) for (i=n;i>=0;i--)
#define fz0k(i,n) for (i=0;i<n;i++)
#define fd0k(i,n) for (i=(long long)(n-1);i>=0;i--)
#define fz(i,x,y) for (i=x;i<=y;i++)
#define fd(i,y,x) for (i=y;i>=x;i--)
#define ff(c,itr) for (__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
#define rdst(st,len) {char ss[len];scanf("%s",ss);(st)=ss;}
using namespace std;
map<long long,long long> rg;
long long n,m,i,j,pre,lst=1,ans,xs[100005],cs[100005],vis[100005],mx=1e9,x,y,z;
vector<long long> bi[100005],s[100005];
void dfs2(long long x)
{
	if (vis[x]) return;
	vis[x]=1;
	if (cs[x]<1)
	{
		cout<<0;
		exit(0);
	}
	long long i;
	for (i=0;i<bi[x].size();i++)
	{
		if (vis[bi[x][i]])
		{
			if (cs[bi[x][i]]!=s[x][i]-cs[x])
			{
				cout<<0;
				exit(0);
			}
		}
		cs[bi[x][i]]=s[x][i]-cs[x];
		dfs2(bi[x][i]);
	}
}
void check(long long x,long long f1,long long g1,long long f2,long long g2){
	if (f1==f2)
	{
		if (g1==g2) return;
		cout<<0;
		exit(0);
	}
	if (g1==g2)
	{
		if (f1==f2) return;
		cout<<0;
		exit(0);
	}
	if ((g1-g2)%(f1-f2)!=0)
	{
		cout<<0;
		exit(0);
	}
	memset(xs,0,sizeof(xs));
	memset(cs,0,sizeof(cs));
	memset(vis,0,sizeof(vis));
	cs[1]=(g1-g2)/(-(f1-f2));
	dfs2(1);
	cout<<1;
	exit(0);
}
void dfs(long long x)
{
	if (vis[x]) return;
	vis[x]=1;
	long long i,j;
	for (i=0;i<bi[x].size();i++)
	{
		if (vis[bi[x][i]])
		{
			for (j=1;j<=1;j++)
			{
				long long f1=-xs[x],f2=xs[bi[x][i]],g1=s[x][i]-cs[x],g2=cs[bi[x][i]];
				if (g1==g2)
				{
					if (f1==f2) break;
					cout<<0;
					exit(0);
				}
				if (f1==f2)
				{
					cout<<0;
					exit(0);
				}
				if ((g1-g2)%(f1-f2)!=0)
				{
					cout<<0;
					exit(0);
				}
				memset(xs,0,sizeof(xs));
				memset(cs,0,sizeof(cs));
				memset(vis,0,sizeof(vis));
				cs[1]=(g1-g2)/(-(f1-f2));
				dfs2(1);
				cout<<1;
				exit(0);
			}
		}
		xs[bi[x][i]]=-xs[x];
		cs[bi[x][i]]=s[x][i]-cs[x];
		dfs(bi[x][i]);
	}
}
void adrg(long long l,long long r)
{
	if (l>r) return;
	l=max(l,1ll);
	r=min(r,mx);
	rg[l]++;rg[r+1]--;
}
int main()
{
	rg[1]++;rg[mx+1]--;
	cin>>n>>m;
	while (m--)
	{
		cin>>x>>y>>z;
		bi[x].push_back(y);
		s[x].push_back(z);
		bi[y].push_back(x);
		s[y].push_back(z);
	}
	xs[1]=1;cs[1]=0;
	dfs(1);
	for (i=1;i<=n;i++)
	{
		long long lim=1-cs[i];
		if (xs[i]==1) adrg(1,-cs[i]); else adrg(cs[i],mx);
	}
	ff(rg,it)
	{
		if (pre==1) ans+=it->first-lst;
		pre+=it->second;
		lst=it->first;
	}
	printf("%lld",ans);
	return 0;
}

Measured memory_bytes: 23040
N = int(input())
S_dic = {}

for n in range(N):
    S = input()

    if S in S_dic:
        S_dic[S] += 1
    else:
        S_dic[S] = 1


# 最大のvalueを取得する
max_value = max(S_dic.values())

max_S_list = [k for k, v in S_dic.items() if v == max_value]
max_S_list = sorted(max_S_list)

for max_S in max_S_list:
    print(max_S)



Measured memory_bytes: 32988
while True:
    try:
        inVal = int(input())
        count = 0;
        for a in range(10):
            for b in range(10):
                for c in range(10):
                    for d in range(10):
                        if a + b + c + d == inVal:
                            count = count + 1
        print(count)
    except EOFError:
        break


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

int main(){

  int n, d[100]={}, x;

  cin>>n;
  for(int i=0;i<n;i++){
    cin>>x;
    d[x-1]=1;
  }

  int ans=0;
  for(int i=0;i<100;i++){
    if(d[i]) ans++;
  }

  cout<<ans<<endl;

  return 0;
}


Measured memory_bytes: 256
/****************************************************************************
Is this the real life? Is this just fantasy?
Caught in a landslide, no escape from reality
Open your eyes, look up to the skies and see
I'm just a poor boy, I need no sympathy
Because I'm easy come, easy go, little high, little low
Any way the wind blows doesn't really matter to me, to me!!!
--------------------------------------------------
CP is quite cool.It becomes cooler when you enjoy learning new things
******************************************************************************/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define mp make_pair
#define endl "\n"
#define rep(i,n) for(int i=0;i<n;i++)
#define pi pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#define vpi vector<pair<int,int>>
#define vll vector<ll>
#define vb vector<bool>
#define all(x) x.begin(),x.end()
#define sz(a) a.size()
#define ff first
#define ss second
#define debug(x) cout<<#x<<" = "<<x<<endl;
const int mod=1e9+7;

void solve()
{
  int n,x,t;
  cin>>n>>x>>t;
  int ans=t*ceil(1.0*n/x);

  cout<<ans<<endl;
} 

int main()
{

  #ifndef ONLINE_JUDGE
  freopen("input.txt","r",stdin);
  freopen("output.txt","w",stdout);
  #endif

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

  int t=1;
  // cin>>t;
  while(t--)
  {
    solve();
  }

  return 0;
}


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

using namespace std;
typedef long long ll;
#define REP(i,n) for(ll i=0;i<n;i++)
#define IREP(i,n) for(ll i=1;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define DEBUG(x) cerr << x << "\n"

#define A_MAX 9000000000

int main(){
    ll n,temp,tempa;
    vector<ll> a;
    cin >> n;
    REP(i,n){
        tempa = 0;
        cin >> temp;
        while(temp % 2 == 0){
            temp /= 2;
            tempa++;
        }
        a.push_back(tempa);
    }
    cout << *min_element(a.begin(),a.end()) << "\n";
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    
    public static final int N = 3;

    public static void main(String[] args) {
       
        Scanner sc = new Scanner(System.in);
        
        // W H x y r
        
        int W = sc.nextInt();
        int H = sc.nextInt();
        int x = sc.nextInt();
        int y = sc.nextInt();
        int r = sc.nextInt();
        
        if(r<=x && r<=y && x+r<=W && y+r<=H){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
        
    }
    
}


Measured memory_bytes: 26344
a,b = map(int,input().split())
count = 0

if a > b:
    count = count + a
    a = a - 1
elif a <= b:
    count = count + b
    b = b - 1


if a > b:
    count = count + a
    a = a - 1
elif a <= b:
    count = count + b
    b = b - 1

print(count)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD=1000000007;
#define INF 1LL<<30
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()

// O(HW)
int H,W;
char maze[30][310];
int d[30][30];
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int bfs(int sx,int sy,int gx,int gy){
    queue<pair<int,int>> que;
    rep(i,H){
        rep(j,W){
            d[i][j]=INF;
        }
    }
    que.push(make_pair(sx,sy)); // (0,0)スタート
    d[sx][sy]=0;
    while(!que.empty()){
        pair<int,int> p=que.front();
        que.pop();
        for(int i=0;i<4;i++){
            int nx=p.first+dx[i];
            int ny=p.second+dy[i];
            if(0<=nx && nx<H && 0<=ny && ny<W && maze[nx][ny]!='#' && d[nx][ny]==INF){
                que.push(make_pair(nx,ny));
                d[nx][ny]=d[p.first][p.second]+1;
            }
        }
    }

    return d[gx][gy];
}

int main(){
    cin>>H>>W;
    rep(i,H) rep(j,W) cin>>maze[i][j];

    int ans=0;
    rep(i,H){
        rep(j,W){
            rep(k,H){
                rep(l,W){
                    if(maze[i][j]=='#' || maze[k][l]=='#') continue;
                    ans=max(ans,bfs(i,j,k,l));
                }
            }
        }
    }

    cout<<ans<<endl;
}


Measured memory_bytes: 3640
#include<bits/stdc++.h>
using namespace std;
int main(){
    int h,w;
    cin >> h >> w;
    vector<string>a(h);
    for(int i=0;i<h;i++){
        cin >> a[i];
    }
	vector<bool> row(h, false);
	vector<bool> col(w, false);
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            if(a[i][j]=='#'){
                row[i]=true;
                col[j]=true;
            }
        }
    }
    for (int i = 0; i < h; i++) {
		if (row[i]) {
			for (int j = 0; j < w; j++) {
				if (col[j]) {
					cout << a[i][j];
				}
			}
			cout << endl;
		}
	}


}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
using namespace std;


int main() {

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

  char s[4];
  cin >> s;

  if (s[0] == '7' || s[1] == '7' || s[2] == '7'){
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
   
}


Measured memory_bytes: 3640
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
    static PrintWriter out;
    static CF_Reader in;

    public static void main(String[] args) throws IOException {
        out = new PrintWriter(new OutputStreamWriter(System.out));
        in = new CF_Reader();

        int n = in.intNext(), k = in.intNext();

        long[] prev = new long[k + 1];
        for (int i = 0; i < n; i++) {
            int weight = in.intNext();
            long cost = in.longNext();
            long[] dp = new long[k + 1];
            for (int j = 1; j <= k; j++) {
                if (j < weight) dp[j] = prev[j];
                else dp[j] = Math.max(prev[j], cost + prev[j - weight]);
            }
            prev = dp;
        }
        out.println(prev[k]);

        out.close();
    }

    static class CF_Reader {
        BufferedReader br;
        StringTokenizer st;

        public CF_Reader() throws IOException {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine().trim());
            return st.nextToken();
        }

        long longNext() throws IOException {
            return Long.parseLong(next());
        }

        int intNext() throws IOException {
            return Integer.parseInt(next());
        }

        double doubleNext() throws IOException {
            return Double.parseDouble(next());
        }

        char charNext() throws IOException {
            return next().charAt(0);
        }

        public int[] nextIntArray(final int n) throws IOException {
            final int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = intNext();
            return a;
        }

        public long[] nextLongArray(final int n) throws IOException {
            final long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = longNext();
            return a;
        }

        String line() throws IOException {
            return br.readLine().trim();
        }
    }
}


Measured memory_bytes: 59184
s = input()
ans = 'YES'
 
while len(s) > 0:
    if s.endswith('dreamer'):
        s = s[:-7]
    elif s.endswith('dream'):
        s = s[:-5]
    elif s.endswith('eraser'):
        s = s[:-6]
    elif s.endswith('erase'):
        s = s[:-5]
    else:
        ans = 'NO'
        break
 
print(ans)

Measured memory_bytes: 3188