akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <iomanip>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <utility>
#include <string>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <numeric>

using namespace std;

typedef uint64_t u64;
typedef int64_t s64;
typedef uint32_t u32;
typedef int32_t s32;
typedef vector<s32> vs32;
typedef vector<u32> vu32;
typedef vector<s64> vs64;
typedef vector<u64> vu64;

const double PI=3.14159265358979323846;

#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) > (y) ? (y) : (x))

#define rep(i, N) for(int i = 0; i < N; ++i)

#define CEIL(x, y) (((x) + (y) - 1) / (y))
#define MOD 1000000007ULL

#define IN(l, r, x) ((l) <= (x) && (x) < (r))


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

    int n;
    cin >> n;

    s64 cnt[10][10];
    rep (i, 10) rep (j, 10) cnt[i][j] = 0;
    rep (i, n + 1)
    {
        int u = i;
        while (u >= 10) u /= 10;
        ++cnt[u][i % 10];
    }

    int ans = 0;
    for (int i = 1; i < 10; ++i)
    {
        for (int j = 1; j < 10; ++j)
        {
            ans += cnt[i][j] * cnt[j][i];
        }
    }

    cout << ans << "\n";
    return 0;
}



Measured memory_bytes: 3620
using System;
 
class Program{
	static void Main(){
		int n;
		while((n = int.Parse(Console.ReadLine())) != 0){
			int max = -100001;
			int sum = 0;
			
			while(n-- > 0){
				int m = int.Parse(Console.ReadLine());
				sum += m;
				if(sum > max) max = sum;
				if(sum < 0) sum = 0;
			}
			Console.WriteLine(max);
		}
	}
}

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

int main() {
  int N, K;
  cin >> N;
  cin >> K;
  int A = 1;
  
  int i = 0;
  while (i < N) {
    if (2 * A <= A + K) {
      A *= 2;
    }
    else
      A += K;
    i++;
  }
  cout << A << endl;
}

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

int main() {
  string s;
  cin >> s;
  
  int ans = 0;
  for (int i = 0; i < s.size() - 1; i++) if (s[i] != s[i+1]) ans++;
  
  cout << ans << endl;
  
  return 0;
}

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

int N;
const int MAX_N = 3000;
int a[MAX_N];

int main() {
    cin >> N;
    for (int i = 0; i < N; i++) cin >> a[i];

    int ans = 0;
    for (int i = 0; i < N; i++) ans += a[i] - 1;
    cout << ans << endl;

    return 0;
}

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

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

    long long c[n];
    long long a[n][m];
    long long tisiki[m];//知識量

    for (int i = 0; i < n; i++)
    {
        cin >> c[i];
        for (int j = 0; j < m; j++)
        {
            cin >> a[i][j];
        }

    }
    long long money;
    long long min = 10000000;//宰相学

    //ビット全探索
    for (long long bit = 0; bit < (1<<n); bit++)
    {
        money = 0;
        //初期化
        for (int i = 0; i < m; i++)
        {
            tisiki[i] = 0;
        }

        //額と知識量をたす
        for (int i = 0; i < n; i++)//n番目使うかどうか
        {
            if (bit & (1<<i))
            {
                money += c[i];

                for (int j = 0; j < m; j++)
                {
                    tisiki[j] += a[i][j];
                }
                
            }

            
        }

        int douyo = 0;
        for (int i = 0; i < m; i++)
        {
            if (tisiki[i] < x)//どっかで知識不足なら離脱
            {
                douyo = 1;
            }

        }
            if (douyo == 0)
            {
                //知識全て足りたらmin更新
                if(min > money){
                    min = money;
                }
                
            }
            
            
        
        
    }

    if (min == 10000000)
    {
        cout << -1 << endl;
        return 0;
    }else
    {
        cout << min << endl;
    }
    
    
    


}

Measured memory_bytes: 3640
//Use valgrind once if the submission doesn't go through. It can detect uninitialized variables and see where they could be an issue.
#include <bits/stdc++.h>
#include <numeric>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

int main(){

	ios_base::sync_with_stdio(false);
    	cin.tie(NULL);

	int primes[]={2 ,3 ,5 ,7 ,11 ,13 ,17 ,19 ,23,29 ,31 ,37 ,41 ,43 ,47 ,53 ,59 ,61 ,67,71 ,73 ,79 ,83 ,89 ,97 ,101 ,103 ,107 ,109,113 ,127 ,131 ,137 ,139 ,149 ,151 ,157 ,163 ,167,173 ,179 ,181 ,191 ,193 ,197 ,199 ,211 ,223 ,227,229 ,233 ,239 ,241 ,251 ,257 ,263 ,269 ,271 ,277,281 ,283 ,293 ,307 ,311 ,313 ,317 ,331 ,337 ,347,349 ,353 ,359 ,367 ,373 ,379 ,383 ,389 ,397 ,401,409 ,419 ,421 ,431 ,433 ,439 ,443 ,449 ,457 ,461,463 ,467 ,479 ,487 ,491 ,499 ,503 ,509 ,521 ,523,541 ,547 ,557 ,563 ,569 ,571 ,577 ,587 ,593 ,599,601 ,607 ,613 ,617 ,619 ,631 ,641 ,643 ,647 ,653,659 ,661 ,673 ,677 ,683 ,691 ,701 ,709 ,719 ,727,733 ,739 ,743 ,751 ,757 ,761 ,769 ,773 ,787 ,797,809 ,811 ,821 ,823 ,827 ,829 ,839 ,853 ,857 ,859,863 ,877 ,881 ,883 ,887 ,907 ,911 ,919 ,929 ,937,941 ,947 ,953 ,967 ,971 ,977 ,983 ,991 ,997}, count[sizeof(primes)/sizeof(int)]={0};
	int n,mc{0},tgcd{0};
	bool p;
	cin>>n;
	vector<int> a(n);
	for(auto &i:a){
		cin>>i;
		tgcd=gcd(tgcd,i);
		for(int j=0;j<sizeof(primes)/sizeof(int);++j){
			if(i%primes[j]==0){
				mc=max(mc,++count[j]);
				while(i%primes[j]==0){
					i/=primes[j];
				}
			}
		}
	}
	p=mc<2;
	sort(a.begin(),a.end());
	for(int i=1;i<a.size();++i){
		p=p&&(a[i]==1||a[i]!=a[i-1]);
	}
	if(p){
		cout<<"pairwise coprime"<<endl;
	}
	else if(tgcd==1){
		cout<<"setwise coprime"<<endl;
	}
	else{
		cout<<"not coprime"<<endl;
	}
}


Measured memory_bytes: 7144
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace atcoder
{
	class Program
	{
		static void Main(string[] args)
		{
			String input = Console.ReadLine();
			bool[] table = new bool[26];
			for (int i = 0; i < input.Length; i++)
			{
				table[(int)input[i] - 97] = true;
			}
			bool none = true;
			for (int i = 0; i < table.Length; i++)
			{
				if (!table[i])
				{
					Console.WriteLine((char)(i + 97));
					none = false;
					break;
				}
			}
			if (none) Console.WriteLine("None");
		}
	}
}


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

const long long MAXN = 100100;

long long dp[MAXN];

int main() {
    int n,k;
    cin>>n>>k;
    for(int i=0;i<=100000;i++){
        dp[i] = 1000000001;
    }
    dp[0] = 0;
    for(int i=0;i<n;i++){
        int w,v;
        cin>>w>>v;
        for(int j=100000;j>=0;j--){
            if(j-v<0){
              //  cout<<dp[j]<<" "<<dp[j-v+1]+w<<endl;
                break;
            }

            if(dp[j]>dp[j-v]+w && dp[j-v]+w<=k){
                dp[j] = dp[j-v]+w;
            }
        }
    }
    for(int i=100000;i>=0;i--){
        if(dp[i]!=1000000001 && dp[i]<=k){
            cout<<i;
            return 0;
        }
    }
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int n;
double dp[309][309][309];
double dfs(int a,int b,int c) {
	if(dp[a][b][c]>-1) return dp[a][b][c];
	dp[a][b][c]=(double)n/(double)(a+b+c)+(a>0?dfs(a-1,b,c)*(double)a/(double)(a+b+c):0)+(b>0?dfs(a+1,b-1,c)*(double)b/(double)(a+b+c):0)+(c>0?dfs(a,b+1,c-1)*(double)c/(double)(a+b+c):0);
	return dp[a][b][c];
}
int main() {
	int a[309],cnt[4]={0};
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin>>n;
	for(int i=0;i<n;i++) {
		cin>>a[i];
		cnt[a[i]]++;
	}
	for(int i=0;i<=n;i++)
		for(int j=0;j<=n;j++)
			for(int k=0;k<=n;k++)
				dp[i][j][k]=-1;
	dp[0][0][0]=0;
	cout<<setprecision(15)<<dfs(cnt[1],cnt[2],cnt[3])<<endl;
	return 0;
}

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


int main() {
    int n,m;
    cin >> n >> m;
    vector<bool>ac(n + 1,false);
    vector<int>wa(n + 1,0);
    int pc = 0,sc = 0;
    for(int i = 0;i < m;i++){
        int p;
        string s;
        cin >> p >> s;
        if(!ac[p]){
            if(s == "AC"){
                ac[p] = true;
                sc += wa[p];
                pc++;
            }else{
                wa[p]++;
            }
        }
    }
    cout << pc << " " << sc;
}

Measured memory_bytes: 3724
// God put a smile upon your face <3

#include <bits/stdc++.h>

#define slld(longvalue) scanf("%lld", &longvalue)

#define ll long long
#define ull unsigned long long
#define pll pair < long long, long long >

#define fastio ios_base:: sync_with_stdio(false); cin.tie(0); cout.tie(0)

#define pb push_back

#define bug printf("BUG\n")

#define mxlld LLONG_MAX
#define mnlld -LLONG_MAX

#define mxd 2e8
#define mnd -2e8

#define pi 3.14159265359

using namespace std;

bool check(ll n, ll pos)
{
	return n & (1LL << pos);
}

ll Set(ll n, ll pos)
{
	return n = n | (1LL << pos);
}

ll freq[200005];

ll calc(ll x)
{
	return max(0LL, x * (x - 1)) / 2;
}

ll arr[200005];

int main()
{
    ll i, j, k, l, m, n, o, r, q;
    ll testcase;
    ll input, flag, tag, ans;

//    freopen("input.txt", "r", stdin);

//    freopen("output.txt", "w", stdout);

    while(cin >> n)
    {
		memset(freq,0,sizeof freq);

		for(ll i = 0; i < n; i++)
		{
			cin >> arr[i];

			freq[arr[i]]++;
		}

		ans = 0;

		for(ll i = 1; i <= n; i++)
		{
			ans += calc(freq[i]);
		}

		for(ll i = 0; i < n; i++)
		{
			ans -= calc(freq[arr[i]]);
			ans += calc(freq[arr[i]] - 1);

			cout << ans << "\n";

			ans -= calc(freq[arr[i]] - 1);
			ans += calc(freq[arr[i]]);

		}
    }


}





Measured memory_bytes: 6768
/*
internationalization という英単語は、i18n と略されることがあります。 これは、先頭文字 i と末尾文字 n の間に 
18 文字が挟まっていることに由来します。
長さ 3 以上の英小文字のみからなる文字列 
s が与えられます。 同様の規則によって 
s を略してください。
*/
#include <iostream>
#include <string>
using namespace std;

int main() {
    string s;
    cin >> s;
    int l = s.length();
    cout << s.substr(0,1)  + to_string(l - 2) + s.substr(l-1) << endl;
}

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

#define ll long long
using namespace std;
const int N = 2e3 + 5, mod = 998244353;
bool vis[N];
vector<int> g[N];
vector<pair<int, int> > ans[N];
int n;

void bfs(int node) {
    memset(vis, 0, sizeof vis);
    queue<pair<int, int> > q;
    q.push({node, 0});
    while (!q.empty()) {
        int cur = q.front().first;
        int level = q.front().second;
        if (cur < node)
            ans[level].push_back({node, cur});
        q.pop();
        for (auto child : g[cur]) {
            if (!vis[child]) {
                vis[child] = 1;
                q.push({child, level + 1});
            }
        }
    }
}

int main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int x, y;
    cin >> n >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
    for (int i = 1; i < n; i++) g[i].push_back(i + 1), g[i + 1].push_back(i);
    for (int i = 1; i <= n; i++) bfs(i);
    for (int i = 1; i < n; i++)
        cout << ans[i].size() << "\n";
    return 0;
}

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

string str,target1="JOI",target2="IOI";
long long int ans1,ans2,a;

int main(){

    while(cin >> str){

    for(int i=0;i<str.size();i++){
        if(str[i]=='J'){
            if(str[i+1]=='O'&&str[i+2]=='I')ans1++;
        }
    }

    for(int i=0;i<str.size();i++){
        if(str[i]=='I'){
            if(str[i+1]=='O'&&str[i+2]=='I')ans2++;
        }
    }

    cout << ans1 << endl;
    cout << ans2 << endl;

    ans1=0,ans2=0;

    }

return  0;
}

Measured memory_bytes: 1204
#include<stdio.h>
int main()
{
int n,d,x,i,j;
scanf("%d%d%d",&n,&d,&x);
int mem[105];
for(i=1;i<=n;i++)
scanf("%d",&mem[i]);
int sum=x+n;
for(i=1;i<=n;i++)
{
    for(j=1;;j++)
        if(j*mem[i]+1<=d)
        sum++;
        else
        break;
}
printf("%d",sum);
return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
typedef long long LL;
int N;

LL check(int a,int b, int c){
	a--;
	b--;
	c--;
	LL now=0;
	REP(i,a){
		REP(j,10){
			if(j%2==0){
				now+=20;
			}else{
				if(i%3==2){
					now+=20;
				}else{
					now+=19;
				}
			}
		}
	}
	REP(i,b){
		if(i%2==0){
			now+=20;
		}else{
			if(a%3==2){
				now+=20;
			}else{
				now+=19;
			}
		}
	}
	now+=c;
	return now;
}

int main(){
	cin>>N;
	LL now=check(1000,1,1);
	REP(k,N){
		int y,m,d;
		cin>>y>>m>>d;
		//cout<<"aa"<<check(y,m,d)<<endl;
		cout<<now-check(y,m,d)<<endl;
	}
}


Measured memory_bytes: 3064
<?php
	$n = trim(fgets(STDIN));
	$s = trim(fgets(STDIN));
	$count = 0;
	//$a = explode(" ",trim(fgets(STDIN)));
	for($i = 0; $i<= strlen($s); ++$i){
		if($s[$i] == "("){
			++$count;
		}
		else if($s[$i] == ")"){
			--$count;
		}
		if($count < 0){
			$s = "(" . $s;
			++$i;
			$count = 0;
		}
	}
	while($count > 0)
	{
		$s = $s . ")";
		--$count;
	}
	echo $s;
?>

Measured memory_bytes: 3576
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <set>
#include <queue>
#include <map>
#include <numeric>
#include <functional>
#include <math.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;

#define INF ((int)1e9)
#define INFLL ((ll)1e18)
#define MOD (1000000007LL)


int main(int argc, const char * argv[]) {
    ios_base::sync_with_stdio(false);
    int N;
    string S, T;
    cin >> N >> S >> T;
    for (int n = 0; n < N; ++n) {
        cout << S[n] << T[n];
    }
    cout << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
#include <chrono>
#include <utility>

using namespace std;

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

constexpr int cm = 1<<17;
char buff[cm], *ci = buff + cm, ct;

inline char readchar() {
  if (ci - buff == cm) {
    fread(buff, 1, cm, stdin);
    ci = buff;
  }
  return *ci++;
}

inline int readint() {
  int num = 0;
  if (ci - buff + 16 > cm) {
    while ((ct = readchar()) >= '0') {
      num = (num << 3) + (num << 1) + ct - '0';
    }
  } else {
    while ((ct = *ci++) >= '0') {
      num = (num << 3) + (num << 1) + ct - '0';
    }
  }
  return num;
}

int main(){
  auto start = chrono::system_clock::now();

  int n = readint();

  vector<queue<int>> v(1002, queue<int> ());
  rep(i, n) {
    rep(j, n - 1) {
      int a = readint();
      v[i + 1].emplace(a);
    }
  }

  for (int day = 1; day <= n * (n - 1) / 2; ++day) {
    bool done[1002] = {};
    for (int i = 1; i <= n; ++i) {
      if (done[i]) continue;
      if (v[i].empty()) continue;
      int next = v[i].front();
      if (done[next]) continue;
      if (v[next].front() == i) {
        v[i].pop(); v[next].pop();
        done[i] = done[next] = true;
      }
    }
    if (all_of(done, done + n, [](const bool& x){return x == false;})){
      printf("-1");
      return 0;
    }
    if (all_of(v.begin(), v.end(), [](const queue<int>& x){return x.empty();})) {
      printf("%d", day);
      return 0;
    }
    auto now = chrono::system_clock::now();
    auto dur = now - start;
    auto msec = chrono::duration_cast<chrono::milliseconds>(dur).count();
    if (msec >= 27) {
      printf("%d", n * (n - 1) / 2);
      return 0;
    }
  }

  return 0;
}


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

using namespace std;

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

int main(){
	while(true){
		int w, h;
		cin >> w >> h;
		if(w == 0 && h == 0){ break; }
		int x = 1, y = 1, dir = 0;
		while(true){
			string command;
			cin >> command;
			if(command == "STOP"){
				break;
			}else if(command == "LEFT"){
				dir = (dir + 3) % 4;
			}else if(command == "RIGHT"){
				dir = (dir + 1) % 4;
			}else if(command == "FORWARD"){
				int amount;
				cin >> amount;
				x += dx[dir] * amount;
				y += dy[dir] * amount;
			}else if(command == "BACKWARD"){
				int amount;
				cin >> amount;
				x -= dx[dir] * amount;
				y -= dy[dir] * amount;
			}
			if(x < 1){ x = 1; }
			if(x > w){ x = w; }
			if(y < 1){ y = 1; }
			if(y > h){ y = h; }
		}
		cout << x << " " << y << endl;
	}
	return 0;
}

Measured memory_bytes: 0
import sys
input = sys.stdin.readline
from collections import Counter

def main():
    n = int(input())

    A = sorted(map(int, input().split()))
    counter = Counter(A)

    if not A:
        print(0)
        return

    ans = 0
    maxi = max(A)
    cache = set()
    for a in A:
        if a in cache:
            continue

        x = a
        while x <= maxi:
            cache.add(x)
            x += a

        if counter[a] == 1:
            ans += 1

    print(ans)

main()


Measured memory_bytes: 102872
#!/usr/bin/perl -w
#https://atcoder.jp/contests/abc147/tasks/abc147_b

my @string = split(//,<>);
my $length = @string;
$length--;
my $ans = 0;

for (my $i = 0; $i < $length / 2; $i++) {
  if ($string[$i] ne $string[($length-1-$i)]) {
    $ans++;
  }
}

print "$ans\n";


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < n; i++)
#define REPR(i, n) for(ll i = n; i >= 0; i--)
#define FOR(i, m, n) for (ll i = m; i < n; i++)
#define INF LLONG_MAX
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;

int D;
long long G;
vector<ll> p, c;

int main()
{
    cin >> D >> G;
    p.resize(D); c.resize(D);
    for (int i = 0; i < D; ++i) cin >> p[i] >> c[i];

    ll res = 1<<29;
    for (size_t bit = 0; bit < (1<<D); bit++)
    {
        ll sum = 0;
        ll num = 0;
        for (size_t i = 0; i < D; i++)
        {
            if (bit & (1<<i)) sum += c[i] + p[i] * 100 * (i+1), num += p[i];
        }

        if (sum >= G) res = min(res, num);
        else {
            for (int i = D-1; i >= 0; --i) {
                if (bit & (1<<i)) continue;
                for (int j = 0; j < p[i]; ++j) {
                    if (sum >= G) break;
                    sum += 100 * (i+1);
                    ++num;
                }
            }
            res = min(res, num);
        }
        
    }
    cout << res << endl;
    
    return 0;
}

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

//template
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(a);i>(b);i--)
#define ALL(v) (v).begin(),(v).end()
typedef long long int ll; typedef pair<ll, ll> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<typename A,size_t N,typename T>void Fill(A(&array)[N],const T &val){fill((T*)array, (T*)(array+N), val);}
const int inf = INT_MAX / 2; const ll INF = LLONG_MAX / 2;
//template end



int main(){
    string s; cin>>s;
    bool f=1;
    rep(i,0,s.size()){
        if(i&1&&s[i]=='R')f=0;
        if(!(i&1)&&s[i]=='L')f=0;
    }
    printf(f?"Yes":"No");
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
int main() {
	
	int64_t N;
	std::cin >> N;
	int64_t ans=0;
	for(int64_t i=1;i*i<N;++i)
		if(N%i==0&&N/i-1>i)
			ans += N/i-1;
	std::cout << ans << std::endl;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void){
	int H,W;
	while(1) {
		scanf("%d %d",&H,&W);
		if (H + W == 0) break;
		for(int i=0;i<H;i++){
			for(int j=0;j<W;j++){
				if(i==0||i==H-1||j==0||j==W-1) printf("#");
				else			printf(".");
			}
			printf("\n");
		}

		printf("\n");
	}
	return 0;
}

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

public class Main{
	
	static long mod=(long)1e9+7;
	
	public static void main(String[] args) throws IOException {
		Writer out=new Writer(System.out);
		Reader in=new Reader(System.in);
		int ts=1;
		
		outer: while(ts-->0) {	
			int n=in.nextInt();
			long a[]=in.readLongArray(n);
			long pro=1;
			sort(a);
			for(long i: a) {
				if(i!=0 && pro>(long)1e18/i) {
					out.println(-1);
					continue outer;
				}
				pro=pro*i;
			}
			out.println(pro);
		}
		out.close();		
		
	}

	static boolean tri(int a, int b, int c) {
		if(c<a+b && c>abs(a-b)) return true;
		return false;
	}
	
	
/*********************************** UTILITY CODE BELOW **************************************/	
		
	static int abs(int a) {
		return a>0 ? a : -a;
	}
	
	static int max(int a, int b) {
		return a>b ? a : b;
	}
	
	static int pow(int n, int m) {
		if(m==0) return 1;
		int temp=pow(n,m/2);
		long res=(((long)temp*temp)%mod);
		if(m%2==0) return (int)res;
		return (int)((res*n)%mod);
	}
	
	static class Pair{
		int u, v;
		
		Pair(int u, int v){this.u=u; this.v=v;}
		
		static void sort(Pair [] coll) {		
			List<Pair> al=new ArrayList<>(Arrays.asList(coll));
			Collections.sort(al,new Comparator<Pair>() {
				public int compare(Pair p1, Pair p2) {
					return p1.u-p2.u;
				}	
			});
			for(int i=0; i<al.size(); i++) {
				coll[i]=al.get(i);
			}
		}
		
	}
	
	static void sort(int[] a) {
		ArrayList<Integer> list=new ArrayList<>();
		for (int i:a) list.add(i);
		Collections.sort(list);
		for (int i=0; i<a.length; i++) a[i]=list.get(i);
	}
	
	static void sort(long a[]) {
		ArrayList<Long> list=new ArrayList<>();
		for(long i: a) list.add(i);
		Collections.sort(list);
		for(int i=0; i<a.length; i++) a[i]=list.get(i);
	}
	
	static int [] array(int n, int value) {	
		int a[]=new int[n];
		for(int i=0; i<n; i++) a[i]=value;
		return a;
	}
	
	static class Reader{
		
		BufferedReader br;
		StringTokenizer to;
		
		Reader(InputStream stream){
			br=new BufferedReader(new InputStreamReader(stream));
			to=new StringTokenizer("");
		}
		
		String next() {
			while(!to.hasMoreTokens()) {
				try {
					to=new StringTokenizer(br.readLine());	
				}catch(IOException e) {}
				
			}
			return to.nextToken();
			
		}
		
		int nextInt() {
			return Integer.parseInt(next());
		}
		
		long nextLong() {
			return Long.parseLong(next());
		}
		
		int [] readArray(int n) {
			int a[]=new int[n];
			for(int i=0; i<n ;i++) a[i]=nextInt();
			return a;
		}
		long [] readLongArray(int n) {
			long a[]=new long[n];
			for(int i=0; i<n ;i++) a[i]=nextLong();
			return a;
		}
		
	}
	
	static class Writer extends PrintWriter{
		Writer(OutputStream stream){
			super(stream);
		}
		void println(int [] array) {
			for(int i=0; i<array.length; i++) {
				print(array[i]+" ");
			}
			println();
		}
		void println(long [] array) {
			for(int i=0; i<array.length; i++) {
				print(array[i]+" ");
			}
			println();
		}
	}
	
}

Measured memory_bytes: 57276
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();// nこの希望
		long a[] = new long[n + 1];
		long ru[] = new long[n +1];
		a[0] = 0;
		ru[0] = 0;
		for (int i = 1; i <= n; i++) {
			a[i] = sc.nextLong();
			ru[i] = ru[i - 1] + a[i];
			}

		Arrays.sort(ru);

		long sta, gol;
		sta = 0;
		gol = 0;
		long a1, ans;
		ans = 0;

		for (int i = 1; i <= n ; i++) {
			if (ru[i - 1] - ru[i] != 0) {
				gol = i;

				a1 = gol - sta;

				ans = ans + cou(a1);
				sta = gol;

			}
		}
		a1=n+1-sta;
		ans=ans+cou(a1);
		System.out.println(ans);
	}

	public static long cou(long a) {
		long c;
		c = a * (a - 1);

		c = c / 2;
		return c;
	}

}


Measured memory_bytes: 87352
#include <bits/stdc++.h>
using namespace std;
// #define int long long   // <-----!!!!!!!!!!!!!!!!!!!
 
#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define printV(v) for(auto&& x : v){cout << x << " ";} cout << endl
#define printVV(vv) for(auto&& v : vv){for(auto&& x : v){cout << x << " ";}cout << endl;}
#define printP(p) cout << p.first << " " << p.second << endl
#define printVP(vp) for(auto&& p : vp) printP(p);
 
typedef long long ll;
typedef pair<int, int> Pii;
typedef tuple<int, int, int> TUPLE;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<Pii> vp;
const int inf = 1e9;
const int mod = 1e9 + 7;
typedef vector<vector<int>> Graph;
 
typedef complex<ll> P;
 
ll cross(P a, P b) {
    return imag(conj(a) * b);
}
 
bool cmp_x(const P& p, const P& q) {
    return p.real() != q.real() ? p.real() < q.real() : p.imag() < q.imag();
}
 
vector<ll> lower_convex_area(const vector<P>& p) {
    int n = p.size();
    int k = 0;
 
    vector<ll> area(n + 1, 0);
    vector<P> h(n);
 
    rep(i, n) {
        area[i + 1] += area[i];
        while (k > 1 && cross(h[k - 1] - h[k - 2], p[i] - h[k - 1]) < 0) {
            if (k > 2) area[i + 1] -= cross(h[k - 2] - h[0], h[k - 1] - h[0]);
            k--;
        }
        h[k++] = p[i];
        if (k > 2) area[i + 1] += cross(h[k - 2] - h[0], h[k - 1] - h[0]);
    }
 
    return area;
}
 
signed main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
 
    int n;
    cin >> n;
    vector<P> p;
    rep(i, n) {
        ll x, y;
        cin >> x >> y;
        p.emplace_back(x, y);
    }
 
    sort(all(p), cmp_x);
    auto lowerleft = lower_convex_area(p);
 
    rep(i, n) p[i] = P(p[i].real(), p[i].imag() * -1);
    auto upperleft = lower_convex_area(p);
 
    rep(i, n) p[i] = P(p[i].real() * -1, p[i].imag());
    sort(all(p), cmp_x);
    auto upperright = lower_convex_area(p);
 
    rep(i, n) p[i] = P(p[i].real(), p[i].imag() * -1);
    auto lowerright = lower_convex_area(p);
 
    rep(i, n) p[i] = P(p[i].real() * -1, p[i].imag());
    sort(all(p), cmp_x);
 
    ll ans = lowerleft[n] + upperleft[n] + lowerright[0] + upperright[0];
    rep2(i, 1, n) {
        if (p[i].real() != p[i - 1].real()) {
            ans = min(ans, lowerleft[i] + upperleft[i] + lowerright[n - i] + upperright[n - i]);
        }
    }
    cout << (ans + 1) / 2 << endl;
 
}

Measured memory_bytes: 9012
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  while(cin>>n,n){
    int a[n];
    for(int i=0;i<=n;i++)
      cin>>a[i];
    for(int i=0;i<=n;i++){
      int p=0,c;
      for(int j=1;j<=n;j++){
        int pp=0,cc=0;
        if(j==i)continue;
        if(j-1==i){
          if(j-1>0){
            if(p==0)c=a[j]-a[j-2],p++;
            else pp=a[j]-a[j-2],cc++;
          }
        }
        else{
          if(!p)c=a[j]-a[j-1],p++;
          else pp=a[j]-a[j-1],cc++;
        }
        //cout<<c<<pp<<endl;
        if(cc&&c!=pp)goto L;
      }
      cout<<a[i]<<endl;
      break;
      L:;
    }
  }
}

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

using namespace std;

int main()
{
    int h,w,n;
    cin >> h >> w >> n;
    int ans = 0;
    if(h >= w){
        
        int sum = 0;
        while(sum < n){
            sum += h;
            ans++;
        }
    } else {
        int sum = 0;
        while(sum < n){
            sum += w;
            ans++;
        }
    }
    
    cout << ans << endl;
    
    
    return 0;
}

Measured memory_bytes: 256
import Control.Monad
import Data.List
import qualified Data.Vector as V
import qualified Data.Vector.Unboxed as UV

import Data.Array
import Data.Array.ST
import Control.Monad.ST

main=interact $ f.take 2.lines

f [s,t]=runST $ do
    dp <- newArray ((0,0),(ls,lt)) (0,"") :: ST s (STArray s (Int,Int) (Int,String))
    forM_ [(i,j,si,tj)|(i,si)<-zip [1..ls] s, (j,tj)<-zip [1..lt] t] $ \(i,j,si,tj)->
        if si == tj
            then writeArray dp (i,j) =<< (inc si) <$> readArray dp (i-1,j-1)
            else writeArray dp (i,j) =<< cp <$> readArray dp (i-1,j) <*> readArray dp (i,j-1)
    reverse.snd <$> readArray dp (ls,lt)
        where
        ls = length s
        lt = length t
        inc c (n,s) = (n+1, c:s)
        cp (a,sa) (b,sb) | a>b = (a,sa) | a<=b = (b,sb)

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

#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define EPS (1e-8)
#define equals(a,b) (fabs((a)-(b))<EPS)

using namespace std;

class Point{
public:
  double x,y;

  Point(double x = 0,double y = 0): x(x),y(y){}
  Point operator + (Point p){return Point(x+p.x,y+p.y);}
  Point operator - (Point p){return Point(x-p.x,y-p.y);}
  Point operator * (double a){return Point(a*x,a*y);}
  Point operator / (double a){return Point(x/a,y/a);}
  bool operator < (const Point& p) const{ return !equals(x,p.x)?x<p.x:(!equals(y,p.y)&&y<p.y); }
  bool operator == (const Point& p)const{ return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS; }

};

Point rotate(Point a,double rad){ return Point(cos(rad)*a.x - sin(rad)*a.y,sin(rad)*a.x + cos(rad)*a.y); }

const double DINF = 1e20;
int n;
Point ps[2][1010],tmp[1010];

inline double getDist(Point p){ return sqrt(p.x*p.x+p.y*p.y); }

bool comp_arg(const double &a,const double &b) { return !equals(fabs(a),fabs(b)) && fabs(a) < fabs(b); }

void compute(){
  Point grv[2] = {Point(),Point()};
  rep(i,2) rep(j,n) grv[i] = grv[i] + ps[i][j];
  rep(i,2) grv[i] = grv[i] / (double)n;
  rep(i,2) rep(j,n) ps[i][j] = ps[i][j] - grv[i];
  sort(ps[0],ps[0]+n);
  sort(ps[1],ps[1]+n);

  vector<double> arg_buf;
  rep(i,n) rep(j,n) {
    double dist[2] = { getDist(ps[0][i]), getDist(ps[1][j]) };
    if( !equals(dist[0],dist[1]) ) continue;
    double arg = atan2(ps[0][i].y,ps[0][i].x) - atan2(ps[1][j].y,ps[1][j].x);
    arg_buf.push_back(arg);
  }

  sort(arg_buf.begin(),arg_buf.end(),comp_arg);
  arg_buf.erase(unique(arg_buf.begin(),arg_buf.end()),arg_buf.end());

  rep(i,(int)arg_buf.size()){
    double arg = arg_buf[i];
    rep(j,n) tmp[j] = rotate(ps[1][j],arg);
    sort(tmp,tmp+n);
    bool failed = false;
    rep(j,n) if( !( tmp[j] == ps[0][j] ) ) { failed = true; break; }
    if( !failed ) { printf("%.11lf\n",fabs(arg)); break; }
  }

}

int main(){
  while( cin >> n, n ){
    rep(i,2) rep(j,n) cin >> ps[i][j].x >> ps[i][j].y;
    compute();
  }
  return 0;
}

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

int main() {
	int a, b, d, r;
	double f;
	cin >> a >> b;
	
	d = a/b;
	r = a%b;
	f = (double) a/b;
	
	printf("%d %d %f", d, r, f);

   	return 0;
}

Measured memory_bytes: 3196
#pragma GCC optimize("O3")

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <iomanip>
#include <numeric>
#include <bitset>
#include <cassert>
#include <random>
#include <unordered_set>
#include <unordered_map>

#define sz(a) (int)((a).size())
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define mp make_pair

using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using vi = vector<int>;

int32_t main() {
	ios::sync_with_stdio(0), cin.tie(0);
	int n;
	cin >> n;
	n++;
	vector<ll> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	vector<ll> s(n);
	s[n - 1] = a[n - 1];
	for (int i = n - 2; i >= 0; i--) {
		s[i] = s[i + 1] + a[i];
	}
	ll free_ver = 1;
	ll ans = 0;
	const ll inf = 1e18 + 228;
	for (int i = 0; i < n; i++) {
		if (free_ver < a[i]) {
			cout << -1;
			return 0;
		}
		free_ver -= a[i];
		ans += a[i];
		ans += min(free_ver, (i + 1 < n ? s[i + 1] : 0LL));
		free_ver *= 2;
		if (free_ver >= inf) {
			free_ver = inf;
		}
	}
	cout << ans;
}


Measured memory_bytes: 4768
#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <sstream>
#include <set>
#include <tuple>
#include <algorithm>
#include <memory>
#include <numeric>
#include <queue>
#include <functional>
#include <cmath>
#include <cstring>
#include <map>
#include <unordered_map>
#include <sstream>
#include <iomanip>

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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<ll, P> PP;

const ll INF = 1LL << 60;
const ll MOD = 1000000007;

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

	ll a;
	cin >> a;

	ll ans = a + a * a + a * a * a;

	cout << ans << endl;
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
#include <numeric>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep2(i, a, n) for (int i = (a); i < (n); ++i)
using namespace std;
using ll = long long;
using uint = unsigned int;
const ll mod = (ll)1e9 + 7;


int main() {
  int a;
  cin >> a;
  cout << a + a * a + a * a * a << endl;
  return 0;
}


Measured memory_bytes: 3600
// マニ

#include<bits/stdc++.h>
#define ll            long long 
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define pb          push_back
#define mp          make_pair
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define rep(i,a,b)  for(ll int i=a;i<b;i++)
#define rrep(i,a,b) for(ll int i=a;i>=b;i--)
#define all(a)      (a).begin(),(a).end()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define PI 3.14159265358979323846
#define tr(i, cont) for(auto i=cont.begin();i!=cont.end();i++)
#define ios            ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define trace(x)                 cerr << #x << ": " << x << "\n";
#define trace1(x)                cerr << #x << ": " << x << "\n";
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << "\n";
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << "\n";
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << "\n";
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << "\n";
#define ar array
#define endl "\n"
using namespace std;

int main(){
    ios;
    ll n,k;
    cin>>n>>k;
    vi v(n);
    rep(i,0,n){
        cin>>v[i];
    }
    sort(all(v));
    if(v[n-1]<=0){
        if(k&1){
            ll maxProd=1;
            rep(i,0,k){
                maxProd = (maxProd*v[n-1-i]+hell)%hell;
            }
            cout<<(maxProd+hell)%hell;
        }
        else{
            ll maxProd=1;
            rep(i,0,k){
                maxProd = (maxProd*v[i]+hell)%hell;
            }
            cout<<(maxProd+hell)%hell;
        }
    }
    else{
        ll maxProd=((k&1)?v[n-1]:1);
        if(k&1){
            k--;
            n--;
        }
        ll i=0,j=n-1;
        trace2(i,j);
        rep(x,0,k/2){
            ll lp=(v[i]*v[i+1]);
            ll rp=(v[j]*v[j-1]);
            // trace2(lp,rp);
            if(lp>rp){
                maxProd=(maxProd*(lp%hell)+hell)%hell;
                i+=2;
            }
            else{
                maxProd=(maxProd*(rp%hell)+hell)%hell;
                j-=2;
            }
        }
        cout<<(maxProd+hell)%hell;
    }
}


Measured memory_bytes: 4744
using System;
class Program
{
	static void Main(string[] args)
	{
		string[] input = Console.ReadLine().Split(' ');
		int a = int.Parse(input[0]);
		int b = int.Parse(input[1]);
		int h = int.Parse(input[2]);
		int m = int.Parse(input[3]);

		double pi = Math.PI;
		double theta = (double)h/6 - (double)m*11/360;
		theta *= pi;
		double ans2 = a*a + b*b - 2*a*b*Math.Cos(theta);
		Console.WriteLine(Math.Sqrt(ans2));
		
	}

}



Measured memory_bytes: 27924
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
    int a;
    cin >> a;
    int b;
    cin >> b;
    int c;
    cin >> c;

    if( (a < c && c < b)
        ||(b < c && c < a)){
      cout << "Yes" << endl;
    }
    else{
      cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

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

  int s=0;
  int temp=n;
  for(int i=0; i<10; i++){
    s = s + temp%10;
    temp /= 10;
  }

  if( n%s == 0){
    puts("Yes");
  }else{
    puts("No");
  }
  return 0;
}


Measured memory_bytes: 128
use std::cmp::*;

macro_rules! input {
  ($($r:tt)*) => {
    let stdin = std::io::stdin();
    let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
    let mut next = move || -> String{
      bytes
        .by_ref()
        .map(|r|r.unwrap() as char)
        .skip_while(|c|c.is_whitespace())
        .take_while(|c|!c.is_whitespace())
        .collect()
    };
    input_inner!{next, $($r)*}
  };
}

macro_rules! input_inner {
  ($next:expr) => {};
  ($next:expr, ) => {};

  ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
    let $var = read_value!($next, $t);
    input_inner!{$next $($r)*}
  };
}

macro_rules! read_value {
  ($next:expr, ( $($t:tt),* )) => {
    ( $(read_value!($next, $t)),* )
  };

  ($next:expr, [ $t:tt ; $len:expr ]) => {
    (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
  };

  ($next:expr, chars) => {
    read_value!($next, String).chars().collect::<Vec<char>>()
  };

  ($next:expr, usize1) => {
    read_value!($next, usize) - 1
  };

  ($next:expr, [ $t:tt ]) => {{
    let len = read_value!($next, usize);
    (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
  }};

  ($next:expr, $t:ty) => {
    $next().parse::<$t>().expect("Parse error")
  };
}

fn main() {
  let stack_size = 104_857_600;
  let thd = std::thread::Builder::new().stack_size(stack_size);
  thd.spawn(|| work()).unwrap().join().unwrap();
}

fn work() {
  input! {
    n: usize,
    a: [i64; n + 1],
    b: [i64; n],
  }

  let mut p = a[0];
  let mut ans : i64 = 0;
  for i in 0..n {
    let mut o1 = min(p, b[i]);
    ans += o1;

    let o2 = min(a[i + 1], b[i] - o1);
    ans += o2;

    p = a[i + 1] - o2;
  }

  print!("{}\n", ans);
}


Measured memory_bytes: 10620
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>

int extractMax(int []);
void insert(int [], int);
void increaseKey(int [], int, int);
void maxHeapify(int [], int);
int parent(int);
int left(int);
int right(int);

int A[1000000], H = 0;

int main(){
  char s[10];
  int k;

  while(1){
    scanf("%s", s);
    
    if(s[0] == 'e' && s[1] == 'n') break;
    else if(s[0] == 'e') printf("%d\n", extractMax(A));
    else if(s[0] == 'i'){
      scanf("%d", &k);
      insert(A, k);
    }
  }
  
  return 0;
}

int extractMax(int A[]){
  int max;
  
  if(H < 1) exit(1);
  
  max = A[1];
  A[1] = A[H];
  H--;
  maxHeapify(A, 1);
  return max;
}

void insert(int A[], int key){
  H++;
  A[H] = INT_MIN;
  increaseKey(A, H, key);
}

void increaseKey(int A[], int i, int key){
  int temp;
  
  if(key < A[i]) exit(1);
  A[i] = key;
  while(i > 1 && A[parent(i)] < A[i]){
    temp = A[i];
    A[i] = A[parent(i)];
    A[parent(i)] = temp;
    i = parent(i);
  }
}

void maxHeapify(int A[], int i){
  int l = left(i);
  int r = right(i);
  int large, temp;

  if(l <= H && A[l] > A[i]) large = l;
  else large = i;

  if(r <= H && A[r] > A[large]) large = r;

  if(large != i){
    temp = A[i];
    A[i] = A[large];
    A[large] = temp;
    maxHeapify(A, large);
  }
}

int parent(int i){ return i/2; }

int left(int i){ return i*2; }

int right(int i){ return i*2+1; }



Measured memory_bytes: 5640
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cout.tie(0);
cin.tie(NULL);
long long n,a,b;
cin>>n>>a>>b;
long long x=(n/(a+b))*a;
x+=min(n%(a+b),a);
cout<<x;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
using namespace std;
int main()
{
	int d;
	cin >> d ;
	switch (d) {
	case 22:
		cout << "Christmas Eve Eve Eve" << endl;
		break;
	case 23:
		cout << "Christmas Eve Eve" << endl;
		break;
	case 24:
		cout << "Christmas Eve" << endl;
		break;
	case 25:
		cout << "Christmas" << endl;
		break;
	}
	return 0;
}

Measured memory_bytes: 256
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//int n=sc.nextInt();
		int ans = 0;
		String s = sc.nextLine();
		List<String> a = Arrays.asList(s.split(""));
		String[] array = a.toArray(new String[a.size()]);
		String hikaku = "R";
		
		for(int i=0;i<3;i++) {
			if(array[i].equals("R")){
				ans++;
			}
			else if(i==1 && ans==1){
				break;
			}
		}
		
		System.out.println(ans);
	}
}


Measured memory_bytes: 35708
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-7;
const int inf=1e9;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
int main(){
	int n;
	cin>>n;
	vi in(n+2);
	rep(i,n)cin>>in[i+1];
	int out=0;
	rep(i,n+1)out+=abs(in[i]-in[i+1]);
	rep(i,n){
		cout<<out-abs(in[i]-in[i+1])-abs(in[i+2]-in[i+1])+abs(in[i]-in[i+2])<<endl;
	}
}










Measured memory_bytes: 1664
using System;
using System.Linq;

namespace ABC102_C
{
    class Program
    {
        static void Main(string[] args)
        {
            long N = long.Parse(Console.ReadLine());
            var a = Console.ReadLine().Split().Select(long.Parse).ToArray();

            for (long i = 0; i < N; i++)
                a[i] -= i + 1;

            Array.Sort(a);
            long b = a[N / 2];
            long sum = 0;
            for (long i = 0; i < N; i++)
                sum += Math.Abs(a[i] - b);

            Console.WriteLine(sum);
        }
    }
}

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

int main(){
    int N;
    cin >> N;
    cout << 0 << endl;
    string zero_sitting;
    cin >> zero_sitting;
    bool if_zero_sitting_male;
    if(zero_sitting == "Vacant"){
        return 0;
    }else{
        if_zero_sitting_male = (zero_sitting == "Male");
    }
    int left = 0, right = N - 1;
    while(true){
        int middle = (left + right) / 2;
        cout << middle << endl;
        string reply;
        cin >> reply;
        if(reply == "Vacant"){
            return 0;
        }else if((reply == "Male") ^ if_zero_sitting_male ^ (middle % 2)){
            right = middle - 1;
        }else{
            left = middle + 1;
        }
    }
}


Measured memory_bytes: 852
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
      int M[] = new int [N];
    int s =0;
    for(int i=0;i<N;i++){
      M[i]=sc.nextInt();
     s = s+1;
    if(M[i]==1){break;}}
    int x=0;
    int L=M[0];
    for(int j=0;j<s;j++){
      L =Math.min(M[j],L);
    if(L==M[j]){x=x+1;}else{x=x;}
    }
    System.out.println( x );}
}

Measured memory_bytes: 65580
#include <iostream>
#include <vector>
#include <algorithm>

typedef std::vector<int> TList;
void CountingSort(const TList& A, TList& B, int k)
{
    std::vector<int> C(k+1, 0);
    
    /* C[i] ??? i ???????????°????¨?????????? */
    for(int j = 0; j < A.size(); ++j){
        C[A[j]]++;
    }
    
    /* C[i] ??? i ??\????????°???????????°????¨??????????*/
    for(int i = 1; i <= k; ++i){
        C[i] = C[i] + C[i-1];
    }
    
    for(int j = A.size() - 1; j >= 0; --j){
        B[C[A[j]]-1] = A[j];
        C[A[j]]--;
    }
}
int main()
{
    int n;
    std::cin >> n;
    std::vector<int> A(n);
    for(int i = 0; i < n; ++i){
        std::cin >> A[i];
    }
    int k = *std::max_element(A.begin(), A.end());
    std::vector<int> B(n);
    CountingSort(A, B, k);
    for(int i = 0; i < n; ++i){
        if(i) std::cout << " ";
        std::cout << B[i];
    }
    std::cout << std::endl;
    return 0;
}

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

int main(){
    int n, k;   cin >> n >> k;
    double p=0;
    for(int i=1; i<=n; i++){
        ll tmp = i, cnt=0;
        while(tmp<=k-1){
            tmp *= 2;
            cnt += 1;
        }
        p += pow(0.5, cnt)/n;
    }
    cout << fixed << setprecision(15) << p << endl;
}




Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
int main(){
  int a, b, c;
  cin >> a >> b >> c;
  int ans = 3;
  if(a==b){
    ans--;
    if(a==c){
      ans--;
    }
  }else if(a==c){
    ans--;
  }else if(b==c){
    ans--;
  }else{}
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        n: usize,
        mut a: [usize;n],
    }
    a.sort();
    let mut alice = 0;
    let mut bob = 0;
    for i in (0..n).rev() {
        if (n-i+1) % 2 == 0 {
            alice += a[i];
        } else {
            bob += a[i];
        }
    }
    println!("{}", alice - bob);
}


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

int main () {
  int a,b;
  char op;

  cin >> a >> op >> b;
  switch (op) {
  case '+':
    cout << a+b << endl;
    break;
  case '-':
    cout << a-b << endl;
    break;

  }

  return 0;
}

Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) (v).begin(), (v).end()

int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> path(m);
  rep(i, m) {
    int a, b;
    cin >> a >> b;
    path[i] = make_pair(a, b);
  }
  vector<int> v(n);
  rep(i, n) {
    v[i] = i + 1;
  }

  int ans = 0;
  do {
    if(v[0] != 1) break; //先頭は1で固定
    bool ok_route = true;
    for(int i = 0; i < n - 1; i++) { //隣あう二つについて
      bool ok = false;
      int before = min(v[i], v[i + 1]);
      int after = max(v[i], v[i + 1]);
      for(int j = 0; j < m; j++) { // pathの検索
        int pa, pb;
        tie(pa, pb) = path[j];
        if(pa == before && pb == after) {
          ok = true;
          break;
        }
      }
      if(ok == false) {
        ok_route = false;
        break; //このvは繋がっていない
      }
    }
    if(ok_route) ans++;

  } while(next_permutation(all(v)));

  cout << ans << endl;
}


Measured memory_bytes: 256