akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <math.h>
using namespace std;
void ABC155(void);

int main(void){
    ABC155();
}

void ABC155(){
    int n,a,i,ans=1;
    cin>>n;
    for(i=0;i<n;i++){
        cin>>a;
        if(a%2==0){
            if(a%3!=0&&a%5!=0)ans=0;
        }
    }
    if(ans)cout<<"APPROVED"<<endl;
    else cout<<"DENIED"<<endl;
}

Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
ans = 0
ans = A[0] + sum(A[1:N//2])*2
if N % 2 == 1:
    ans += A[N//2]
# print(A[1:N//2])
# スコアを獲得できるのはN-1回
print(ans)


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

int main() {
	int i, j, N, d[101], max = 0;
	int tmp, tmpmax;
	scanf("%d", &N);
	for (i=0; i < N ;i++) {
		scanf("%d", &d[i]);
		if (max < d[i]) {
			tmp = i;
			max = d[i];
		}
	}
	
	d[tmp] = 102;
	for (i=0; i < N ;i++) {
		tmp = -1, tmpmax = 0;
		for (j=0; j < N ;j++) {
			if (max > d[j] && tmpmax < d[j]) {
				tmpmax = d[j];
				tmp = j;
			}
		}
		if (tmp == -1) break;
		max = tmpmax;
		d[tmp] = 102;
	}
	printf("%d\n", i+1);
	return 0;
}

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

int main() {
    int N;  cin >> N;
    map<string, int> mp;
    for (int i = 0; i < N; ++i) {
        string s;  cin >> s;
        ++mp[s];
    }
    cout << (mp.size() == 3 ? "Three" : "Four") << endl;
}


Measured memory_bytes: 256
#include <iostream>
main(){int n,c,t,f,i,m;for(;;){std::cin>>n;if(!n){break;}c=t=f=0;for(i=1;i<=n;i++){m=i;while(m%2==0){t++;m/=2;}m=i;while(m%5==0){f++;m/=5;}}std::cout<<(t<f?t:f)<<"\n";}}

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

using namespace std;

#define run_forrest_run ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define watch(x) cout << (#x) << " is " << (x) << endl
#define pb push_back
#define mp make_pair
#define ll long long
#define ull unsigned long long
#define vi vector <int>
#define sz(a) (int)a.size()
#define fi first
#define se second
#define si set <int>
#define all(x) (x).begin(),(x).end()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
int gcd(int a,int b){if(b==0)return a;else return gcd(b,a%b);}
int lcm(int a,int b){return abs(a*b)/gcd(a,b);} 

const int inf = 1e9;	
const int mod = inf + 7;

const int N = 205000;
vector <int> g[N];
vector <bool> visited(N);
vector <int> color(N);
int dp[1010][1010];

int main()
{
	run_forrest_run;
 	int n,m;
 	cin >> n >> m;
 	char a[n][m];
 	for (int i = 0; i < n; i++)
 	{
 		for (int j = 0; j < m; j++)
 		{
 			cin >> a[i][j];
 		}
 	}
 	dp[0][0] = 1;
 	for (int i = 0; i < n; i++)
 	{
 		if (a[i][0] == '#')
 			break;
 		else dp[i][0] = 1;
 	}
 	for (int j = 0; j < m; j++)
 	{
 		if (a[0][j] == '#')
 			break;
 		else dp[0][j] = 1;
 	}
 	for (int i = 1; i < n; i++)
 	{
 		for (int j = 1; j < m; j++)
 		{
 			if (a[i][j] == '#')
 				continue;
 			dp[i][j] = (dp[i-1][j] + dp[i][j-1]) % mod;
 		}
 	}
 	cout << dp[n-1][m-1] % mod;
}


Measured memory_bytes: 10880
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<iostream>
#include<string>

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

int a[200000],n,b;

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin>>n;
    REP(i,n)cin>>a[i];
    REP(i,n)b^=a[i];
    REP(i,n){cout<<(a[i]^b)<<"\n";}
    return 0;
}

Measured memory_bytes: 4392
n   = int(input())
a_s = list(map(int, input().split()))

s = 0

for a in a_s:
    s = s ^ a

print(' '.join([ str(s ^ a) for a in a_s ]))

# 00 ^ 05 ^ 07 ^ 22 | 20
# 26 ^ 00 ^ 07 ^ 22 | 11
# 26 ^ 05 ^ 00 ^ 22 | 09
# 26 ^ 05 ^ 07 ^ 00 | 24

# 26 ^ 05 ^ 07 ^ 22 | 14

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

using namespace std;
using ll = long long;

//cout << std::fixed << std::setprecision(15) << y << endl;

int main() {
    int n = 0;
    cin >> n;
    
    vector<ll> b(n - 1);
    for(int i = 0;i < n - 1;i++){
        cin >> b[i];
    }
    ll sum = b[0] + b[n - 2];
    for(int i = 0;i < n - 2;i++){
        sum += min(b[i],b[i + 1]);
    } 
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <math.h>
#include <cmath>
#include <queue>
#include <stack>
#include <list>
#include <functional>
#include <numeric>
#include <iostream>
#include <string>
#include <time.h>

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

int N, M;
vector<vector<int>> edges;
bool f[112345];

int main() {

	scanf("%d%d", &N, &M);
	edges.resize(N);
	rep(i, M) {
		int x, y;
		scanf("%d%d%*d", &x, &y);
		--x; --y;
		edges[x].push_back(y);
		edges[y].push_back(x);
	}

	int ans = 0;
	rep(i, N) {
		if (!f[i]) {
			ans++;
			f[i] = true;
			queue<int> q;
			q.push(i);
			while (!q.empty()){
				int c = q.front();
				q.pop();
				for (auto vet : edges[c]) {
					if (!f[vet]) {
						f[vet] = true;
						q.push(vet);
					}
				}
			}
		}
	}

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

	return 0;
}


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

using namespace std;

int main()
{
	long long n,k;
	cin >> n >> k;
	long long array[100005] = {0};
	int i,j;
	for (i=0;i<n;i++)
	{
		int a,b;
		cin >> a >> b;
		array[a] += b;
	}
	long long sum=0;
	for (i=0;i<100005;i++)
	{
		sum += array[i];
		if (sum>=k)
		{
			cout << i;
			break;
		}
	}



	return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

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

  int n, m, q;
  cin >> n >> m >> q;
  vector<vector<int>> v(501, vector<int>(501, 0));
  vector<vector<int>> acc = v;
  rep(i, 0, m) {
    int l, r;
    cin >> l >> r;
    v[l][r]++;
  }

  rep(i, 1, n + 1) {
    rep(j, 1, n + 1) { acc[i][j] = acc[i][j - 1] + v[i][j]; }
  }

  while (q--) {
    int p, q;
    cin >> p >> q;
    int ans = 0;
    rep(i, p, q + 1) ans += acc[i][q] - acc[i][p - 1];
    cout << ans << endl;
  }

  cout << endl;
}


Measured memory_bytes: 2944
import java.util.*;
public class Main{
	public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int k = sc.nextInt();
        
        if(k%2==0){
            System.out.println((k/2)*(k/2));
        }else{
            System.out.println(((k-1)/2)*((k+1)/2));
        }
    }
}


Measured memory_bytes: 23892
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define rrep(i,n) for(int i=1;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int inf = 1001001001;
const int mod = 1000000007;

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

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll n, X;
	cin >> n >> X;
	vector<ll> x(n);
	rep(i, n) cin >> x[i];
	x.emplace_back(X);
	sort(all(x));
	ll ans = x.back() - x.front();
	rep(i, n - 1) {
		ans = gcd(ans, x[i + 1] - x[i]);
	}
	cout << ans << endl;
	return 0;
}


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

int main(){
	int n,a[100],counter;
	cin>>n;
	for(int i=0;i<n;i++) cin>>a[i];
	while(n!=0){
		if(n-1==0){
			cout<<a[0]<<endl;
			break;
		}
		cout<<a[n-1]<<" ";
		n--;
	}
	return 0;
}

Measured memory_bytes: 3068
import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) throws Exception {
        MyScanner scan = new MyScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));

        String number = scan.next();
        for (int i = 1; i < number.length(); i++) {
            if (number.charAt(i) == number.charAt(i - 1)) {
                out.println("Bad");
                out.close();
                return;
            }
        }
        out.println("Good");
        out.close();
    }


    //-----------PrintWriter for faster output---------------------------------
    public static PrintWriter out;

    //-----------MyScanner class for faster input----------
    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }
    //--------------------------------------------------------

}

Measured memory_bytes: 21076
t=13
S=input()
d=[0]*t
d[0]=1
for i in range(len(S)):
  n=[0]*t
  for j in range(t):
    for k in range(10):
      if S[i]=='?' or int(S[i])==k:n[(10*j+k)%t]+=d[j]
  for j in range(t): d[j]=n[j]%(10**9+7)
print(d[5])

Measured memory_bytes: 42604
d = dict()
for i in range(16):
    v = "{:04b}".format(i)
    k = i/16
    d[k] = v
    
while True:
    p = float(input())
    if p < 0:
        break
    
    i = int(p)
    f = p - i
    if f not in d:
        print("NA")
    else:
        print("{:08b}".format(i),end="")
        print(".",end="")
        print(d[f])


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

#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)
#define unless(p) if(!(p))
#define until(p) while(!(p))

using ll = std::int64_t;
using P = std::tuple<int,int>;

template <typename T>
std::tuple<T, T, T> extgcd(T a, T b){
    T s1 = 1, t1 = 0, s2 = 0, t2 = 1;
    while(b != 0){
        std::tie(s1, t1, s2, t2) = std::make_tuple(s2, t2, s1 - (a / b) * s2, t1 - (a / b) * t2);
        std::tie(a, b) = std::make_tuple(b, a % b);
    }
    return std::make_tuple(s1, t1, a);
}

template <typename T>
T mod_expt(T a, std::int64_t n, T mod){
    T power {1};
    while(n > 0){
        if(n & 1){power = power * a % mod;}
        a = a * a % mod;
        n >>= 1;
    }
    return power;
}

// 注意: a と mod が互いに素である必要がある
template <typename T>
T mod_inverse(T a, T mod){
    T b;
    std::tie(b, std::ignore, std::ignore) = extgcd(a, mod);
    if(b < 0){b += mod;}
    return b;
}

ll L, A, B, M;

ll f(ll x, ll n){
    if(n == 0){
        return 0;
    }

    if(n % 2 == 0){
        return f(x, n / 2) * (1ll + mod_expt(x, n / 2, M)) % M;
    }

    return (1ll + f(x, n - 1) * x % M) % M;
}

ll g(ll x, ll n){
    if(n == 0){
        return 0;
    }

    if(n % 2 == 0){
        return (g(x, n / 2) * (1ll + mod_expt(x, n / 2, M)) % M + (n / 2) % M * f(x, n / 2) % M) % M;
    }

    return ((n - 1) % M + g(x, n - 1) * x % M) % M;
}

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

    std::cin >> L >> A >> B >> M;

    ll l = 0, ten = 1;
    ll res = 0;

    for(int i=1;i<=18;++i){
        ll s = A + B * l;

        unless(ten <= s && s < ten * 10){
            ten *= 10;
            continue;
        }

        ll r = std::min((ten * 10 - A + B - 1) / B, L), n = r - l;

        ll a = res * mod_expt(ten * 10 % M, n, M) % M,
            b = A % M * f(ten * 10 % M, n) % M,
            c = B % M * (g(ten * 10 % M, r) + M - g(ten * 10 % M, l) * mod_expt(ten * 10 % M, n, M) % M) % M;
        res = (a + b + c) % M;

        l = r;
        ten *= 10;
    }

    std::cout << res << std::endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#define NUMBER 10
static int cmp_int(const void* v1, const void* v2) {
   const int _v1 = *((const int*)v1);
   const int _v2 = *((const int*)v2);
   if ( _v1 > _v2 )
      return 1;
   else if ( _v1 < _v2 )
      return -1;
   else 
      return 0;
}
int main(void) {
   int data[NUMBER];
   int i;
   for(i=0; i<NUMBER; i++) {
      scanf("%d", &data[i]);
   }
   qsort(data, NUMBER, sizeof(int), cmp_int);
   for (i = NUMBER-1; i > NUMBER-4; i--) {
      printf("%d\n", data[i]);
   }
   return(0);
}

Measured memory_bytes: 604
#!/usr/bin/env python3
import sys


def solve(a: int, s: str):
    if a >= 3200:
        print(s)
    else:
        print('red')


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    a = int(next(tokens))  # type: int
    s = next(tokens)  # type: str
    solve(a, s)

if __name__ == '__main__':
    main()


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

#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)

const int MAX_N = 6100000;
ll MOD = 998244353;
ll inv[MAX_N + 10];
ll fac[MAX_N + 10], facInv[MAX_N + 10];
class MATH{
public:
	MATH(){
		inverse();
		factroial();
	}
	ll nCk(ll n, ll k){// n! / k!*(n-k)!
		if(k < 0 || k > n) return 0;
		ll ret = fac[n];
		(ret *= facInv[k]) %= MOD;
		(ret *= facInv[n - k]) %= MOD;
		return ret;
	}
	ll nHk(ll n, ll k){// nHk = n+k-1 C k = (n+k-1)! / k! * (n-1)!
		if(n == 0 && k == 0) return 1;
		ll ret = fac[n + k - 1];
		(ret *= facInv[k]) %= MOD;
		(ret *= facInv[n - 1]) %= MOD;
		return ret;
	}
	ll nPk(ll n, ll k){//nPk = n! / (n-k)!
		if(k < 0 || k > n) return 0;
		ll ret = fac[n];
		(ret *= facInv[n - k]) %= MOD;
		return ret;
	}
private:
	void inverse(void){
		inv[1] = 1;
		for (int i = 2; i <= MAX_N; ++i){
			// inv[i] = MOD - (MOD / i) * inv[MOD % i] % MOD;
			inv[i] = inv[MOD % i] * (MOD - MOD / i) % MOD;
		}
	}
	void factroial(void){
		fac[0] = facInv[0] = 1;
		for (int i = 1; i <= MAX_N; ++i){
			fac[i] = (fac[i - 1] * i) % MOD;
			facInv[i] = (facInv[i - 1] * inv[i]) % MOD;
		}
	}
};

int main(void) {
	ll n, a, b, k;
	cin >> n >> a >> b >> k;
	MATH ma;

	ll ret = 0;
	for (ll i = 0; i <= 2 * n; ++i) {
		ll red = i;
		if ((k - red * a) % b != 0) continue;
		ll blue = (k - red * a) / b;
		ll ans = ma.nCk(n, red) * ma.nCk(n, blue) % MOD;
		(ret += ans) %= MOD;
	}
	printf("%lld\n", ret);
	return 0;
}

Measured memory_bytes: 143232
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using std::cerr;
using std::cin;
using std::cout;
using std::endl;

int main(void) {
  cout << std::fixed << std::setprecision(10);
  cin.tie(0);
  std::ios::sync_with_stdio(false);
  
  int n,a,b;
  cin>>n>>a>>b;
  cout<<std::min(b,a*n)<<endl;

  return 0;
}


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

const int MAXN=2e5+5;
int INF=2e9+5;
int A[MAXN];

int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++)cin>>A[i];
	
	int minn=A[0];
	int maxn=-INF;
	for(int i=1;i<n;i++){
		maxn=max(maxn,A[i]-minn);
		minn=min(minn,A[i]);
	}
	cout<<maxn<<endl;
	return 0;
}


Measured memory_bytes: 3880
import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd # 最大公約数
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) # 最小公倍数
# list(map(int, input().split()))
# map(int, input().split())
# int(input())
# input().split()
# mojiretu = ','.join(str_list)
# sorted(input())

n = int(input())
a = list(map(int, input().split()))
now = a[n-1]
for i in range(n-2, -1, -1):
    if now > a[i]:
        now = a[i]
    elif now == a[i]:
        now = a[i]
    elif a[i] - now == 1:
        now = a[i] - 1
    else:
        print('No')
        sys.exit()
print('Yes')

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

int main(){
    deque<char> s;
    string str;
    cin >> str;
    int len = str.length();
    rep(i, len){
        s.push_back(str.at(i));
    }
    int q;
    cin >> q;
    vector<int> qu(q), f(q);
    vector<char> c(q);
    bool rev_flag = false;
    rep(i, q){
        cin >> qu.at(i);
        if(qu.at(i) == 2){
            cin >> f.at(i) >> c.at(i);
            if(f.at(i) == 1){
                rev_flag?s.push_back(c.at(i)):s.push_front(c.at(i));
            }
            else {
                rev_flag?s.push_front(c.at(i)):s.push_back(c.at(i));
            }
        }
        else {
            rev_flag?rev_flag=false:rev_flag=true;
        }
    }
    while(!s.empty()){
        if(rev_flag){
            cout << s.back();
            s.pop_back();
        }
        else {
            cout << s.front();
            s.pop_front();
        }
    }
    cout << endl;
    return 0;
}

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

const int INF=100000000;

int main() {
  int n,m; cin>>n>>m;
  vector<vector<int>> dist(n, vector<int>(n));
  vector<int> a(m), b(m), c(m);
  for (int i=0;i<n;i++) {
    for (int j=0;j<n;j++) {
      if (i==j) dist[i][j]=0;
      else dist[i][j]=INF;
    }
  }
  for (int i=0;i<m;i++) {
    cin>>a[i]>>b[i]>>c[i];
    a[i]--;
    b[i]--;
    dist[a[i]][b[i]]=dist[b[i]][a[i]]=c[i];
  }
  for (int k=0;k<n;k++) {
    for (int i=0;i<n;i++) {
      for (int j=0;j<n;j++) {
        dist[i][j]=min(dist[i][j], dist[i][k]+dist[k][j]);
      }
    }
  }
  int ans=0;
  for (int i=0;i<m;i++) {
    if (c[i]>dist[a[i]][b[i]]) ans++;
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip> 
#include <cstdlib>
#include <cmath>
#include<map>
#include<string.h>
#include <algorithm>
#include <bits/stdc++.h> 
#include<vector>

using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repb(i,a,b) for(int i=a;i>=b;i--)
#define replb(i,a,b) for(ll i=a;i>=b;i--)
#define repl(i,a,b) for(ll i=a;i<b;i++)
#define repv(arr)  for(auto it=arr[i].begin();it!=arr[i].end();it++)  
#define vi vector<int>
#define vb vector<bool>
#define vs vector<string>
#define vl vector<long long int>
#define Vi vector<vector<int>>
#define sortA(arr)   sort(arr.begin(),arr.end())
#define ssort stable_sort(arr.begin(),arr.end())
#define search(arr,c)  binary_search(arr.begin(),arr.end(),c)
#define pb   push_back
#define ll long long
#define LCM(a,b) boost::math::lcm(a,b)
#define cl_bf cin.ignore(numeric_limits<streamsize>::max(), '\n');
#define castl static_cast<ll>

int main(){
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    ll n,m,x,ans;cin>>n>>m;vl v;
    rep(i,0,m){
        cin>>x;v.pb(x);
    }
    if(!v.empty())sortA(v);
    if(m==0)ans=n;
    else{
    ll min=abs(v[0]-1-n);ans=v[0]-1;
    rep(i,0,m-1){
        rep(j,v[i]+1,v[i+1])
        if(abs(j-n)<min){
            min=abs(j-n);
            ans=j;
        }
    }
    //cout<<min;
    if(abs(v[m-1]+1-n)<min){ans=v[m-1]+1;}
    }
    cout<<ans;
    return 0;
}

Measured memory_bytes: 3644
n=int(input())
# n=5
L=list(map(int,input().split()))
# L=[4,4,9,7,5]


cnt=0

for i in range(n):
    for j in range(n):
        for k in range(n):
            if L[i]<L[j]:
                if L[j]<L[k]:
                    if i!=j:
                        if i!=k:
                            if j!=k:
                                if L[k]<L[i]+L[j]:
                                    cnt+=1

print(cnt)



Measured memory_bytes: 9100
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())

struct mint {
    const int mod = 1e9 + 7;
    long long x;
    
    mint (long long x = 0) : x((x % mod + mod) % mod) {
        
    }
    
    mint& operator=(const long long a) {
        x = a % mod;
        return *this;
    }
    
    mint& operator=(const mint a) {
        x = a.x % mod;
        return *this;
    }
    
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    
    mint operator+(const mint a) const {
        mint res(*this);
        return res += a;
    }
    
    mint& operator-=(const mint a) {
        if ((x += (mod - a.x)) >= mod) x -= mod;
        return *this;
    }
    
    mint operator-(const mint a) const {
        mint res(*this);
        return res -= a;
    }
    
    mint& operator*=(const mint a) {
        (x *= a.x) %= mod;
        return *this;
    }
    
    mint operator*(const mint a) const {
        mint res(*this);
        return res *= a;
    }
    
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }
    
    mint inv() const {
        return pow(mod - 2);
    }
    
    mint& operator/=(const mint a) {
        return (*this) *= a.inv();
    }
    
    mint operator/(const mint a) const {
        mint res(*this);
        return res /= a;
    }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // std::ifstream in("input.txt");
    // std::cin.rdbuf(in.rdbuf());
    ll n;
    cin >> n;
    vector<ll> c(n);
    rep(i, n) cin >> c[i];
    sort(all(c));
    vector<mint> e(n + 1);
    rep(i, n + 1) {
        if (i == 0) e[i] = 1;
        else e[i] = e[i - 1] * 2;
    }
    mint ans = 0;
    rep(i, n) {
        ll l = i, r = n - i - 1;
        mint tmp = e[r];
        if (r > 0) tmp += e[r - 1] * r;
        tmp *= e[l];
        tmp *= c[i];
        ans += tmp;
    }
    ans *= e[n];
    cout << ans.x << endl;
    return 0;
}


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

int main() {
    int64_t W,H,x,y;
    cin >> W >> H >> x >> y;
    
    long double S = W * H * 0.5;
    
    int multi;
    if ( W % 2 == 0 and H % 2 == 0 and W / 2 == x and H / 2 == y ){
        multi = 1;
    } else {
        multi = 0;
    }
    cout << S << " " << multi << endl;
    
    return 0;
}


Measured memory_bytes: 256
include Math

a, b, x = gets.split.map(&:to_f)

min_r = 0.0
max_r = 90.0
1000.times do
  r = (min_r + max_r) / 2
  t = r * PI / 180.0
  y =
    if sin(t)*b > cos(t)*a
      (a*b - a*a/(2*tan(t))) * a
    else
      (tan(t)*b*b/2) * a
    end

  if x <= y
    max_r = r
  else
    min_r = r
  end
end

puts("%2.010f" % (90 - max_r))

Measured memory_bytes: 1788
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author tatsumack
 */

#include <iostream>
#include <fstream>

#include <iostream>
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>

#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <queue>
#include <unordered_map>
#include <unordered_set>

#define int long long
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPS(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF 1001001001001001001ll
#define fcout cout << fixed << setprecision(12)

using namespace std;

typedef pair<int, int> P;

class BTaxRate {
public:
    static constexpr int kStressIterations = 0;
    static void generateTest(std::ostream& test) {
    }

    void solve(std::istream& cin, std::ostream& cout) {
        int N;
        cin >> N;
        FOR(x, 1, 50000) {
            double val = 1.08 * x;
            if ((int) val == N) {
                cout << x << endl;
                return;
            }
        }
        cout << ":(" << endl;
    }
};


signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    std::istream& in(std::cin);
    std::ostream& out(std::cout);

    BTaxRate solver;
    solver.solve(in, out);
    return 0;
}


Measured memory_bytes: 256
/*  
    Shiny, shiny, shiny boots of leather
    Whiplash girlchild in the dark
    Comes in bells, your servant, don't forsake him
    Strike, dear mistress, and cure his heart
    _________________________
    _________________________
    168 Hours of Solitude
    Quarantine_Day : 7
*/


#include<bits/stdc++.h>

using namespace std;

typedef long long int       LL;
typedef vector<int>         VI;
typedef vector<LL>          VL;

#define pb(n)           push_back(n)
#define GSORT(v)        sort(v.begin(), v.end(), greater<lint>())
#define SORT(v)         sort(v.begin(), v.end());
#define REV(v)          reverse(v.begin(), v.end());
#define db(a)           cout<<#a<<" = "<<a<<endl;
#define FIN             freopen("in.txt","r",stdin);
#define FOUT            freopen("out.txt","w",stdout);
#define REP(i,a,b)      for(int i = int(a); i <= int(b); i++)
#define fastIO()        ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

int main()
{
    string a, b, c;
    cin>>a>>b>>c;
    cout<<a[0]<<b[0]<<c[0]<<endl;

    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
using namespace std;
const int N=200200;
int i,j,k,n,m,ch,num,v,a,b,c,Hn;
long long ans;
int f[N];
struct cc { int a,b,c,fg;} t,H[N];
void R(int &x) {
	x=0;ch=getchar();
	while (ch<'0' || '9'<ch) ch=getchar();
	while ('0'<=ch && ch<='9') x=x*10+ch-'0',ch=getchar();
}
void W(long long x) {
	if (x>=10) W(x/10);
	putchar(x%10+'0');
}
bool cmp(const cc &a,const cc &b) {
	return a.c<b.c;
}
void S(int x,int y) {
	t=H[x];H[x]=H[y];H[y]=t;
}
void up(int x) {
	while (x>1 && H[x].c<H[x>>1].c) S(x,x>>1),x>>=1;
}
void down(int x) {
	while ((x<<1)<=Hn) {
		int k=x<<1;
		if (k<Hn && H[k|1].c<H[k].c) k|=1;
		if (H[k].c<H[x].c) {
			S(k,x);
			x=k;
		}
		else break;
	}
}
int getf(int x) {
	if (f[x]==x) return x;
	return f[x]=getf(f[x]);
}
int main() {
	R(n);R(m);
	if (n<=500 && m<=500) {
		for (i=1;i<=n;i++) f[i]=i;
		for (i=1;i<=m;i++) {
			R(a);R(b);R(c);
			a++;b++;Hn=i;
			H[i].a=a;H[i].b=b;H[i].c=c;
			up(i);
		}
		num=1;
		while (num<n) {
			t=H[1];
			if (getf(t.a)==getf(t.b)) {
				t.c++;
				k=t.b;t.b=t.a;t.a=k;
				if (++t.b>n) t.b-=n;
				H[1]=t;
				down(1);
			}
			else {
				f[f[t.a]]=f[t.b];
				ans+=t.c;
				num++;
				t.c++;
				k=t.b;t.b=t.a;t.a=k;
				if (++t.b>n) t.b-=n;
				H[1]=t;
				down(1);
			}
		}
		W(ans);puts("");
		return 0;
	}
	for (i=1;i<=n;i++) f[i]=i;
	for (i=1;i<=m;i++) {
		R(a);R(b);R(c);
		a++;b++;Hn=i;
		if (a==b) {
			H[i].fg=1;
			c++;
			k=b;b=a;a=k;
			if (++b>n) b-=n;
		}
		H[i].a=a;H[i].b=b;H[i].c=c;
		up(i);
	}
	num=1;
	while (num<n) {
		t=H[1];
		if (getf(t.a)==getf(t.b)) {
			if (t.fg) {
				H[1]=H[Hn--];
				down(1);
				continue;
			}
			t.fg=1;
			t.c++;
			k=t.b;t.b=t.a;t.a=k;
			if (++t.b>n) t.b-=n;
			H[1]=t;
			down(1);
		}
		else {
			f[f[t.a]]=f[t.b];
			ans+=t.c;
			num++;
			if (t.fg) {
				t.c++;
				k=t.b;t.b=t.a;t.a=k;
				if (++t.b>n) t.b-=n;
				t.c++;
				k=t.b;t.b=t.a;t.a=k;
				if (++t.b>n) t.b-=n;
			}
			else {
				t.c++;
				k=t.b;t.b=t.a;t.a=k;
				if (++t.b>n) t.b-=n;
			}
			H[1]=t;
			down(1);
		}
	}
	W(ans);puts("");
}

Measured memory_bytes: 4352
#include<stdio.h>
int main(void)
{
	int a[3],min[2],x,i,j;
	for(i=0; i<3; i++)
	scanf("%d", &a[i]);
	for(i=0; i<2; i++)
	{
		min[i]=101;
		for(j=0; j<3; j++)
		{
			if(min[i]>a[j])
			{
				min[i]=a[j];
				x=j;
			}
		}
		a[x]=101;
	}
	printf("%d\n", min[0]+min[1]);
	
	return 0;
}

Measured memory_bytes: 128
#include <stdio.h>
int main(){
  int n;
  int a, b, c;
  scanf("%d",&n);
  
  a=n / 100;
  b=(n % 100) / 10;
  c=n%10;
  
  if(a== 7 || b== 7 || c== 7 ){
    printf("Yes");
  }else{
    printf("No");
  }
  
  return 0;
}

Measured memory_bytes: 1704
object Main {
  def main(args: Array[String]): Unit = {
    import scala.io.StdIn.readLine
    val Array(datN, datK) = readLine.split(" ").map(_.toInt)
    val datA = for(i <- 1 to datK) yield {
      readLine
      readLine.split(" ").map(_.toInt)
    }

    val tableA = for(i <- 1 to datN) yield i
    val ans = tableA.map(e => (e, datA.flatMap(x => x).contains(e))).filter(e => e._2 == false).length

    println(ans)
  }
}


Measured memory_bytes: 56460
//package first_beginner;

import java.util.*;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in) ;
		int len = in.nextInt() ;
		String line = in.next() ;
		int index = in.nextInt() ;
		char flag = line.charAt(index-1) ;
		for(int i=0;i<len;i++) {
			if(line.charAt(i)!=flag) {
				System.out.print("*");
			}else {
				System.out.print(flag);
			}
		}
	}

}


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

int main() {
    cout << fixed << setprecision(10);
    long long N;
    cin >> N;
    double outcomes = 0;
    for (long long i = 1; i <= N; ++i) {
        if (i % 2 != 0) {
            outcomes += 1;
        }
    }
    double proba = outcomes / N;
    cout << proba << endl;
    return 0;
}


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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	int A;
	cin>>A;
	cout<<3*A*A<<endl;
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(){
int a[30],b[30];
int i,j;
for(i=0;i<30;i++){
a[i]=i+1;
}
for(i=0;i<28;i++){
scanf("%d",&b[i]);
for(j=0;j<30;j++){
if(b[i]==a[j]){
a[j]=0;
}
}
}
for(i=0;i<30;i++){
if(a[i]==0)continue;
else{
printf("%d\n",a[i]);
}
}
return 0;
}

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

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>
#include<iomanip>
#include<unordered_set>
#include<unordered_map>
#include<bitset>
#include<complex>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

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

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD =  (int)1e9 + 7;
const double EPS = 1e-9;

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

	int K,Q;
	cin>>K>>Q;
	vector<int> A(K);

	rep(i,0,K)cin>>A[i];

	int n,x,m;
	rep(i,0,Q)
	{
		cin>>n>>x>>m;
		int sum=x%m,zc=0;
		rep(j,0,K)
		{
			sum+=max(0LL,(n-1-j+K-1)/K)*(A[j]%m);
			if(A[j]%m==0)
			{
				zc+=max(0LL,(n-1-j+K-1)/K);
			}
		}
		cout<<n-1-zc-sum/m<<endl;
	}
	
	return 0;
}

Measured memory_bytes: 384
#include<cctype>
#include<string>
#include<iostream>
#include<algorithm>

using namespace std;

int rotx(string &dice){
	char t=dice[0];
	dice[0]=dice[1];
	dice[1]=dice[5];
	dice[5]=dice[4];
	dice[4]=t;
}

int roty(string &dice){
	char t=dice[0];
	dice[0]=dice[3];
	dice[3]=dice[5];
	dice[5]=dice[2];
	dice[2]=t;
}

int rotz(string &dice){
	char t=dice[1];
	dice[1]=dice[3];
	dice[3]=dice[4];
	dice[4]=dice[2];
	dice[2]=t;
}

void next(string &dice,int i){
	if(i%4==0){
		if(i%8==0)	rotx(dice);
		else		roty(dice);
	}
	rotz(dice);
}

int main(){
	string dice[8];
	while(1){
		for(int i=0;i<8;i++)	cin>>dice[i];
		if(dice[0]=="0")	break;

		char co[128];
		for(int c='A';c<='Z';c++)	co[c]=tolower(c);
		for(int c='a';c<='z';c++)	co[c]=toupper(c);

		bool exist[8][128]={};
		for(int i=0;i<8;i++)for(int j=0;j<6;j++)	exist[i][dice[i][j]]=true;

		bool ok=false;
		int i[]={0,1,2,3,4,5,6,7};
		int a,b,c,d,e,f,g,h;
		string diceA,diceB,diceC,diceD,diceE,diceF,diceG,diceH;
		do{
			a=i[0];	b=i[1];	c=i[2];	d=i[3];
			e=i[4];	f=i[5];	g=i[6];	h=i[7];
			diceA=dice[a];	diceB=dice[b];	diceC=dice[c];	diceD=dice[d];
			diceE=dice[e];	diceF=dice[f];	diceG=dice[g];	diceH=dice[h];

			for(int ia=0;ia<24;ia++,next(diceA,ia)){
				for(int ib=0;ib<24;ib++,next(diceB,ib)){
					if(co[diceA[2]]!=diceB[3])	continue;
					for(int ic=0;ic<24;ic++,next(diceC,ic)){
						if(co[diceB[4]]!=diceC[1])	continue;
						for(int id=0;id<24;id++,next(diceD,id)){
							if(co[diceA[4]]!=diceD[1] || co[diceC[3]]!=diceD[2])	continue;
							for(int ie=0;ie<24;ie++,next(diceE,ie)){
								if(co[diceA[5]]!=diceE[0])	continue;
								for(int iF=0;iF<24;iF++,next(diceF,iF)){
									if(co[diceB[5]]!=diceF[0] || co[diceE[2]]!=diceF[3])	continue;
									for(int ig=0;ig<24;ig++,next(diceG,ig)){
										if(co[diceC[5]]!=diceG[0] || co[diceF[4]]!=diceG[1])	continue;
										for(int ih=0;ih<24;ih++,next(diceH,ih)){
											if(co[diceD[5]]!=diceH[0] || co[diceE[4]]!=diceH[1] || co[diceG[3]]!=diceH[2])	continue;
											ok=true;
											goto FOUND;
										}
									}
								}
							}
						}
					}
				}
			}
		}while(next_permutation(i+1,i+8));

		FOUND:
		cout<<(ok?"YES":"NO")<<endl;
	}

	return 0;
}

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

int main() {
    int len;
    string s;
    vector<int> ans;
    cin >> s;
    len = s.length();
    ans.assign(len, 1);
    
    for(int i = 0; i < len; i++){
        if(s[i] == 'R'){
            if(s[i+1] == 'R'){
                ans[i+2] += ans[i];
                ans[i] = 0;
            }
        }
    }
    for(int i = len-1; i >= 0; i--){
        if(s[i] == 'L'){
            if(s[i-1] == 'L'){
                ans[i-2] += ans[i];
                ans[i] = 0;
            }
        }
    }
    for(int i=0;i<len;i++){
        cout << ans[i] << " ";
    }
    cout << endl;
	return 0;
}

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

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define en '\n'
#define fs first
#define sd second

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll a, b, c, k;
    cin >> a >> b >> c >> k;
    ll res = min(a, k);
    k -= min(a, k);
    k -= min(b, k);
    res -= min(c, k);
    k -= min(c, k);
    cout << res << en;
}

Measured memory_bytes: 3652
from sys import stdin
# from line_profiler import LineProfiler

def main():

    head = [[8,1,2,4],[1,2,4,8],[2,4,8,1],[4,8,1,2]]

    while(True):
        W,H = map(int, stdin.readline().split())
        m = [[0]*W for _ in range(H)]
        ps = []
        if not (W or H): break
        for h in range(H):
            s = stdin.readline()
            for w in range(W):
                if s[w] in [".", "X", "E", "N", "W", "S"]:
                    m[h][max(0,w-1)] |= 1
                    m[min(H-1,h+1)][w] |= 2
                    m[h][min(W-1,w+1)] |= 4
                    m[max(0,h-1)][w] |= 8
                if s[w] in ["E", "N", "W", "S"]:
                    ps.append([h,w,["E", "N", "W", "S"].index(s[w])])
                if s[w] == "X":
                    m[h][w] |= 16
        if W <= 2 or H <= 2:
            print(1)
            continue
        ttt = 0
        while(True):
            ttt += 1
            if ttt > 180: print("NA"); break
            dest = []
            positions = [a[:2] for a in ps]
            for pi,p in enumerate(ps):
                for i in range(4):
                    if head[p[2]][i] & m[p[0]][p[1]]:
                        d = head[p[2]][i]
                        if   d == 1 and not [p[0],p[1]+1] in positions: p[2] = 0; dest.append([pi,2,p[0],p[1]+1]); break
                        elif d == 2 and not [p[0]-1,p[1]] in positions: p[2] = 1; dest.append([pi,3,p[0]-1,p[1]]); break
                        elif d == 4 and not [p[0],p[1]-1] in positions: p[2] = 2; dest.append([pi,0,p[0],p[1]-1]); break
                        elif d == 8 and not [p[0]+1,p[1]] in positions: p[2] = 3; dest.append([pi,1,p[0]+1,p[1]]); break
                else:
                    dest.append([pi,(p[2]+2)&3,p[0],p[1]])
            dest = sorted(dest,key=lambda x: (x[2:],x[1]))
            dellist = []
            for pi,d,dy,dx in dest:
                if not [dy,dx] in positions: positions.append([dy,dx]); ps[pi][:2] = [dy,dx]
                if m[ps[pi][0]][ps[pi][1]] & 16: dellist.append(pi)
            for idx in sorted(dellist)[::-1]: del ps[idx]
            if not len(ps): print(ttt); break

if __name__ == "__main__":
    # prf = LineProfiler()
    # prf.add_function(main)
    # prf.runcall(main)
    # prf.print_stats()
    main()


Measured memory_bytes: 5636
use std::io::*;

fn main() {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();

    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    let mut cards: Vec<i32> = buf.split_whitespace().map(|n| n.parse().unwrap()).collect::<Vec<i32>>();
    cards.sort_by(|x, y| x.cmp(y).reverse());

    let mut alice = 0;
    let mut bob = 0;

    for (i, card) in cards.iter().enumerate() {
        if i % 2 == 0 {
            alice = alice + card;
        } else {
            bob = bob + card;
        }
    }

    let out = stdout();
    let mut out = out.lock();
    writeln!(out, "{}\n", alice - bob).unwrap();
}


Measured memory_bytes: 4352
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <fstream>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <stack>
#include <vector>
#include <set>
#include <tuple>
#include <utility>
#include <functional>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
const int INF = 1000000000;

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

	int ans = 1;
	for(int i = 0;i < d;i++)ans *= 100;
	if(n == 100){
		cout << 101 * ans << endl;
	}
	else cout << ans * n << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define f(i,j,n) for(int i=j;j<n;i++)
int main() {
    int n;
    set<string> m;
    cin>>n;
    string str;
    for(int i=0;i<n;i++) {
        cin>>str;
        m.insert(str);
    }
    cout<<m.size();
	return 0;
}

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

const int XD = 1e5 + 2;
int tab[ XD ], dp[ XD ];

int mini( int k, int i )
{
    int r = INT_MAX;
    for( int j = i - k; j < i; j++ )
        r = min( r, dp[ j ] + abs( tab[ j ] - tab[ i ] ) );
    return r;
}
int main()
{
    ios_base::sync_with_stdio( false );
    int n, k; cin >> n >> k;
    for( int i = 1; i <= n; i++ )
        cin >> tab[ i ];
    dp[ 2 ] = abs( tab[ 1 ] - tab[ 2 ] );
    for( int i = 3; i <= n; i++ )
        dp[ i ] = mini( min( i - 1, k ), i );
    cout << dp[ n ];
    return 0;
}


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

/*
,,,,
　　　　　　　　　　　　　　　　　　　　　　　　　　,.斗*''“i:i:{
　　　　　　　　　　　　　,.　｡. . . * : : : ''' : : : :” :”“ ''ｰ - 弋,,_
　　　　　 　 　 ,.斗*''“ : : : : : : : : : : : : : ' ' ' ' ' ' : : : : : : : : : : :”: '':* ｡ ,
　　　 ,.斗*''“ ” ＼：　　 ”・・． ' ' ' '　　　　　　　　 ' ' ' ' : : : : : : : : : : : : ”ミ*｡,,,,,,　　　　　　 　 　 　 ＿
　　く.　 ◎　 ﾞ:.ﾞ:..　ﾟ:,　:　───────────　　　--　　,,,,,,__ ' ' ' :.:.:.:.:.”≧s｡.　　＿,,,｡s*i:i:i:i:<
　　ﾏ*s｡ :,　 }　ﾟ:,　 :}　　　　　　　　　　　　　　　　　　　　　　　　　　　　”　''　-　”””：：”：：`*｡i:i:i:i:i:i:i;:’
　　　` .｡`　 ,　,ノ ／｡ ,,,_　　　　　　　　　　　　　　　　　　　　　　　　　　　　　＿＿`　　} }　　ﾉi:i:i:i:i:ﾂ
　　　　　 `　*　｡　　`*｡i:i:i::*=-　　　　　　　　　　　＿＿　　　　　　,,,....｡s*'i,:’　　　”`*｡＿,*’i:i:i:i:r’
　　　　　　　　　　　”　─ --　　　　｡｡｡｡｡　　 -　－`''''''''ヽ ─ '''”　　　｀ｰ“　　　　　　　`*｡i:i:i:i:i:i:
　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　`*｡i:i:::
　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　`*ﾟ:,
         fozubaoyou    no BUGs alive!
*/

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()

#define debug_interval ','
#define dump_interval endl
#define debug_toggle 1

inline int toInt(string s){int v;istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
template<class...A> inline void dump(){cout<<endl;}
template<class...A> inline void dump_rest() {cout<<endl;}
template<class T, class...A> inline void dump_rest(const T& first, const A&... rest){cout<<dump_interval<<first;dump_rest(rest...);}
template<class T,class...A> inline void dump(const T&first,const A&...rest){cout<<first;dump_rest(rest...);}
template<class...A> inline void debug(){cout<<endl;}
template<class...A> inline void debug_rest() {cout<<endl;}
template<class T, class...A> inline void debug_rest(const T& first, const A&... rest){cout<<debug_interval<<first;debug_rest(rest...);}
template<class T,class...A> inline void debug(const T&first,const A&...rest){if(debug_toggle)cout<<first,debug_rest(rest...);}

int fv,a,b,c,d,e;
int comp=101;

int main(){
    ios::sync_with_stdio(false);
    cin>>a>>b>>c;
    fv=a%b;
    for(int i=2;;i++){
      if((i*a)%b==c){
        dump("YES");
        return 0;
      }
      if((i*a)%b==fv){
        dump("NO");
        return 0;
      }
    }
}

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

int a[200050];

int main() {
	int n; scanf("%d", &n);
	for(int i = 0; i < n; i++) scanf("%d", a + i);
	for(int i = 0; i < n; i++) a[i] -= i + 1;
	sort(a, a + n);
	long long sum = 0, ps = 0, res;
	int t = -a[0];
	for(int i = 0; i < n; i++) a[i] += t;
	for(int i = 0; i < n; i++) sum += a[i];
	res = sum;
	for(int i = 0; i < n; i++) {
		int v = i ? a[i] - a[i - 1] : a[i];
		sum -= (long long)v * (n - i);
		ps += (long long)v * i;
		res = min(res, sum + ps);
	}
	printf("%lld\n", res);
	return 0;
}


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

int main() {
  int h, w, a, b;
  cin >> h >> w >> a >> b;
  vector<vector<int>> M(h, vector<int>(w, 0));
  for(int i = 0; i < b; i++){
    for(int j = 0; j < a; j++){
      M.at(i).at(j) = 1;
    }
  }
  for(int i = b; i < h; i++){
    for(int j = a; j < w; j++){
      M.at(i).at(j) = 1;
    }
  }
  for(int i = 0; i < h; i++){
    for(int j = 0; j < w; j++){
      cout << M.at(i).at(j);
      if(j == w-1){
        cout << endl;
      }
    }
  }
}


Measured memory_bytes: 5120
N = int(input())
s1 = input()
s2 = input()
mod = 1000000007

if N == 1:
    answer = 3
elif N == 2:
    answer = 6
else:
    answer = 6
    for i in range(2, N):
        if s1[i] == s2[i]:
            if s1[i - 1] == s2[i - 1]:
                answer = answer * 2 % mod
            else:
                pass
        else:
            if s1[i - 1] == s2[i - 1]:
                answer = answer * 2 % mod
            elif s1[i - 1] != s1[i]:
                answer = answer * 3 % mod
            else:
                pass

print(answer)

Measured memory_bytes: 3064
import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int m=sc.nextInt();
    String[] a = new String[n];
    String[] b = new String[m];
    for(int i=0;i<n;i++){
      a[i]=sc.next();
    }
    for(int i=0;i<m;i++){
      b[i]=sc.next();
    }
    for(int i=0;i<=n-m;i++){
      for(int j=0;j<=n-m;j++){
        if(calc(a,b,i,j)){
          System.out.println("Yes");
          return;
        }
      }
    }
    System.out.println("No");
  }
  static boolean calc(String[] a,String[] b,int y,int x){
    for(int i=0;i<b.length;i++){
      for(int j=0;j<b.length;j++){
        if(a[y+i].charAt(x+j)!=b[i].charAt(j)){
          return false;
        }
      }
    }
    return true;
  }
}

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

int main(){
    int k;
    cin>>k;
    int a,b;
    cin>>a>>b;
    int p=a/k;
    int q=b/k;
    if(p==q && a%k!=0 && b%k!=0){
        cout<<"NG"<<endl;
    }
    else{
        cout<<"OK"<<endl;
    }
    return 0;
}

Measured memory_bytes: 3620
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#pragma warning(disable : 4996)
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<unordered_map>
#include<unordered_set>
#include<time.h>
#include<random>
#include<array>


using namespace std;

#define REP(i, n) for(int i = 0;i < n;++i)
#define REPR(i, n) for(int i = n-1;i >= 0;--i)
#define FOR(i, m, n) for(int i = m;i < n;++i)
#define FORR(i, m, n) for(int i = m-1;i >= n;--i)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end())
#define ll long long
#define print(x) cout<<(x)<<'\n'
#define pe(x) cout<<(x)<<" "
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define lb(v,n) lower_bound(v.begin(), v.end(), (n))
#define ub(v,n) upper_bound(v.begin(), v.end(), (n))
#define int long long
//#define double long double
#define all(x) (x).begin(), (x).end()
#define print_space(v) REP(i,v.size())cout << v[i] << ((i == v.size() - 1) ? "\n" : " ")
template<typename T1, typename T2> inline void chmin(T1 & a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
typedef pair<int, int>P;
typedef array<int, 3> arr3;
std::random_device rd;
std::mt19937 mt(rd());
constexpr ll MOD = 998244353; constexpr int MAX = 2000020;
const double pi = acos(-1); constexpr double EPS = 1e-8;
constexpr ll INF = 1e18;

int H, W;
char A[101][101];
int dist[101][101];
void solve() {
	cin >> H >> W;
	REP(i, H) {
		REP(j, W)cin >> A[i][j];
	}
	REP(i, H + 1)REP(j, W + 1)dist[i][j] = 1e9;
	if (A[0][0] == '.')dist[0][0] = 0;
	else dist[0][0] = 1;
	priority_queue<arr3,vector<arr3>,greater<arr3>>que;
	que.push({dist[0][0], 0,0 });
	while (!que.empty()) {
		arr3 pos = que.top(); que.pop();
		int x = pos[1], y = pos[2];
		int nx = x + 1, ny = y + 1;
		if (nx < H) {
			int cost = 0;
			if (A[x][y] == '.'&&A[nx][y] == '#')cost = 1;
			if (dist[x][y] + cost < dist[nx][y]) {
				dist[nx][y] = dist[x][y] + cost;
				que.push({ dist[nx][y],nx,y });
			}
		}
		if (ny < W) {
			int cost = 0;
			if (A[x][y] == '.'&&A[x][ny] == '#')cost = 1;
			if (dist[x][y] + cost < dist[x][ny]) {
				dist[x][ny] = dist[x][y] + cost;
				que.push({ dist[x][ny],x,ny });
			}
		}
	}
	print(dist[H - 1][W - 1]);
}

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	//int q; cin >> q;
	//while (q--)
	solve();
}



Measured memory_bytes: 384