akhauriyash/Code-Regression huggingface dataset:
fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val l = readLine()!!.split(" ").map { it.toInt() }
    var variable = 0
    var colors = mutableListOf(0, 0, 0, 0, 0, 0, 0, 0)
    l.forEach{
        when(it){
            in 1 .. 399 -> colors[0] = 1
            in 400 .. 799 -> colors[1] = 1
            in 800 .. 1199 -> colors[2] = 1
            in 1200 .. 1599 -> colors[3] = 1
            in 1600 .. 1999 -> colors[4] = 1
            in 2000 .. 2399 -> colors[5] = 1
            in 2400 .. 2799 -> colors[6] = 1
            in 2800 .. 3199 -> colors[7] = 1
            in 3200 .. 4800 -> variable += 1
        }
    }
    if (colors.sum() == 0){
        println("1 " + variable)
    }
    else {
        println(colors.sum().toString() + " " + (colors.sum() + variable))
    }
}

Measured memory_bytes: 37716
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    int n;
    scanf("%d",&n);
    int c=0;
    if(n%2==0)
    {
        c=(n/2)-1;
    }
    else
    {
        c=n/2;
    }
    printf("%d\n",c);
    return 0;
}


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

int main()
{
    int n,a,b;
    cin >> n >> a >> b;
    int SUM=0;
    for(int i=1;i<=n;i++){
        int num=i,sum=0;
        while(num!=0){
            sum += num%10;
            num/=10;
        }
        if(a <= sum && sum <= b)
            SUM+=i;
    }
    cout << SUM << endl;
    return 0;
}

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

using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, n) for (int i = 1; i < (n)i++)
#define all(x) (x).begin(), (x).end()
#define rv(s) reverse((s).begin(), (s).end())
#define pii pair<int, int>
#define abs(a) llabs(a)
#define int long long
#define re(s) reverse((s).begin(), (s).end())
#define setout(n, x) setw(n) << setfill(x)
#define Fixed fixed << setprecision(10);
const long long mod = 1e9 + 7;

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

   int a,b,c;
   cin>>a>>b>>c;

   if(a+b+c >=22) cout<<"bust"<<'\n';
   else cout<<"win"<<'\n';
}

Measured memory_bytes: 256
/*よくばりセット2019/07/13 */
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#define MOD 1000000007
typedef long long int ll;
void llswap(ll *x,ll *y){ll temp;temp=*x;*x=*y;*y=temp;}
void swap(int *x,int *y){int tmp;tmp=*x;*x=*y;*y=tmp;}
int max(int x,int y){return x>y?x:y;}
int min(int x,int y){return x>y?y:x;}
ll llmax(ll x,ll y){return x>y?x:y;}
ll llmin(ll x,ll y){return x>y?y:x;}
int asc(const void *a,const void *b){return *(int*)a-*(int*)b;}
int desc(const void *a,const void *b){return *(int*)b-*(int*)a;}

int main(){
    int h,r;
    scanf("%d %d",&h,&r);
    
    if(h<0){
        if(r==abs(h)){
            printf("0\n");
        }else{
            printf("-1\n");
        }
    }else{
        printf("1\n");
    }
    return 0;
}


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

#define ll long long
#define ld long double
#define ull unsigned long long
#define pw(x) (1LL << (x))

#define db(x) cerr << #x << " = " << x << endl
#define db2(x, y) cerr << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")\n"
#define db3(x, y, z) cerr << "(" << #x << ", " << #y << ", " << #z << ") = (" << x << ", " << y << ", " << z << ")\n"

using namespace std;

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

    int a, b;
    char op;

    cin >> a >> op >> b;

    if (op == '+')
        cout << a + b;
    else
        cout << a - b;

    return 0;
}

Measured memory_bytes: 256
//0:何もしない  1:数値へ変換  2:半角SPで分割  3:改行で分割  4:半角SPで分割し、数値配列へ
//5:改行で分割し、数値配列へ  6:1文字に分割  7:1文字に分割し、数値配列へ
function myconv(i, no){
  switch(no){
    case 0: return i;
    case 1: return parseInt(i);
    case 2: return i.split(" ");
    case 3: return i.split("\n");
    case 4: return i.split(" ").map((a)=>Number(a));
    case 5: return i.split("\n").map((a)=>Number(a));
    case 6: return i.split("");
    case 7: return i.split("").map((a)=>Number(a));
  }}
function Main(input) {
  const S = myconv(input, 6);
  const len = S.length;
  const setLen = [...new Set(S)].length;

  if (len == setLen) {
    console.log('yes');
  } else {
    console.log('no');
  }
};
Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());

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

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

    int N, X;
    std::cin >> N >> X;
    int ans = 1;
    int pos = 0;
    for (int i = 0; i < N; ++i) {
        int L;
        std::cin >> L;
        pos += L;
        if (pos <= X)++ans;
        else break;
    }
    std::cout << ans << std::endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#define TEST cout << "ococo" << endl;
using namespace std;

int main(void){
	int a,b,c;
	string str;
	cin >> a >> b;
	if(a % 2 == b % 2)cout << (a + b) / 2 << endl;
	else cout << "IMPOSSIBLE" << endl;
	return 0;
}

Measured memory_bytes: 764
L, R = map(int, input().split())

minimum=2019
z=0
for i in range(L, R+1):
    for j in range(i+1, R+1):
        tmp = (i*j)%2019
        if minimum>tmp:
            minimum = tmp
        if minimum==0:
            z=1
            break
    if z==1:
        break
    
print(minimum)

Measured memory_bytes: 39024
#include <iostream>
#include <string>
using namespace std;
int main(){
    string S, T;
    cin >> S;
    cin >> T;
    bool check=false;
    int ct,cs;

    for(int j=S.length()-T.length(); j>=0; j--){
        for(int i=0; i<T.length(); i++){
            if(T[i]==S[j] || S[j]=='?'){
                for(int k=0; k<T.length(); k++){
                    if(S[j+k-i]!='?' && S[j+k-i]!=T[k]){
                        break;
                    }else if(k==T.length()-1){
                        check=true;
                        cs=j;
                        ct=i;
                        goto LABEL;
                    }
                }
            }
        }
    }
    LABEL:

    string ans=S;
    if(check){
        for(int i=0; i<T.length(); i++){
            ans[cs+i-ct]=T[i];
        }
        for(int i=0; i<S.length(); i++){
            if(ans[i]=='?')ans[i]='a';
        }
        cout << ans <<endl;
    }else{
        cout << "UNRESTORABLE\n";
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <stdio.h>
using namespace std;
int main(void){
    
    long a, b;
    cin >> a >> b;
    
    int waru = a / b;
    int amari = a % b;
    double syousu = (double)a / b;
    
    //cout << waru << " " << amari << " " << setprecision(12) << syousu << endl;
    printf("%d %d %.10f\n", waru, amari, syousu);
    
}



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

int main() {
  string c;
  cin >> c;
  
  if (c == "a" || c == "i" || c == "u" || c == "e" || c == "o" ) {
    cout << "vowel" << endl;
  }
  
  else {
    cout << "consonant" << endl;
  }
}


Measured memory_bytes: 256
n, m = map(int, input().split())
h = list(map(int, input().split()))
a = []
b = []

for i in range(m):
    A, B = [int(i) for i in input().split()]
    a.append(A)
    b.append(B)

obser = {}

for i in range(1, n+1):
    obser[i] = []

for i in range(m):
    obser[a[i]].append(b[i])
    obser[b[i]].append(a[i])
    
ans = 0

for i in range(1, n+1):
    target_height = h[i-1]
    invest_obser = obser[i]
    count = 0
    for obs in invest_obser:
        if target_height > h[obs-1]:
            count += 1
    if len(invest_obser) == count:
        ans += 1

print(ans)
    

Measured memory_bytes: 39448
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
#define sp(n) cout << fixed << setprecision(n)
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;
using namespace std;
const ll inf=1e9;
int main(void){
    int n,m,R;cin>>n>>m>>R;
    vector<int> r(R);
    rep(i,R){
        cin>>r[i];
        r[i]--;
    }
    sort(r.begin(),r.end());
    vector<vector<ll>> t(n,vector<ll>(n,inf));
    rep(i,m){
        int a,b;ll c;cin>>a>>b>>c;a--;b--;
        t[a][b]=t[b][a]=c;
    }
    rep(i,n)t[i][i]=0;
    rep(k,n)rep(i,n)rep(j,n)chmin(t[i][j],t[i][k]+t[k][j]);
    ll res=1e18;
    do{
        ll buf=0;
        rep(i,R-1)buf+=t[r[i+1]][r[i]];
        chmin(res,buf);
    }while(next_permutation(r.begin(),r.end()));
    cout<<res<<endl;
}

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


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

    int n;
    cin >> n;
    double p;
    double dp[n + 1][n + 1] = {0};
    dp[0][0] = 1;

    rep(i,n){
        cin>>p;
    rep(j,i+1){
        dp[i + 1][j + 1] += dp[i][j] * p;
        dp[i + 1][j] += dp[i][j] * (1- p);
    }
    }
    
    double ans = 0;
    forx(i, (n+1)/2, n+1) ans += dp[n][i];

    cout<< setprecision(12)<<ans<<endl;

    return 0;
}


Measured memory_bytes: 70528
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <cmath>
#include <iomanip> 
using namespace std;

int main() {
	int a, b, h, m;
	cin >> a >> b >> h >> m;
	if (60*(h * 60 + m )== m * 720 ) {
		cout << abs(a-b) << endl;
		return 0;
	}
	if ((60 * (h * 60 + m) - m * 720 == 21600)) {
		cout << a+b <<endl;
		return 0;
	}
	double a_cita = 2 * M_PI * (h * 60 + m) / 720;
	double b_cita = 2 * M_PI * m / 60;
	double actan_ab;
	if (a_cita > b_cita) {
		actan_ab = a_cita - b_cita;
	}
	else {
		actan_ab = b_cita - a_cita;
	}
	if (actan_ab > M_PI) {
		actan_ab = 2* M_PI - actan_ab;
	}

	cout << std::fixed << std::setprecision(15) << sqrt(a * a + b * b - 2 * a*b*cos(actan_ab)) << endl;

}

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

int main(){
  int n;
  cin>>n;
  vector<long long int> a(3*n);
  for(int i=0;i<3*n;i++){
    cin>>a[i];
  }
  vector<long long int> lef(3*n,0); //[0,i)
  priority_queue<long long int,vector<long long int>,greater<long long int>> que;
  long long int sum=0;
  for(int i=0;i<n;i++){
    sum+=a[i];
    que.push(a[i]);
  }
  lef[n]=sum;
  for(int i=n;i<=2*n-1;i++){
    long long int val=que.top();
    que.pop();
    que.push(max(val,a[i]));
    sum+=max(val,a[i])-val;
    lef[i+1]=sum;
  }
  vector<long long int> rig(3*n,0); //[i,3*n)
  priority_queue<long long int> q;
  sum=0;
  for(int i=3*n-1;i>=2*n;i--){
    sum+=a[i];
    q.push(a[i]);
  }
  rig[2*n]=sum;
  for(int i=2*n-1;i>=n;i--){
    long long int val=q.top();
    q.pop();
    q.push(min(val,a[i]));
    sum+=min(val,a[i])-val;
    rig[i]=sum;
  }
  long long int res=-1e16;
  for(int i=n;i<=2*n;i++){
    res=max(res,lef[i]-rig[i]);
  }
  cout<<res<<endl;
  return 0;
}


Measured memory_bytes: 9608
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>

using namespace std;

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

#define all(v) v.begin(),v.end()
#define INF 1<<30
#define mp make_pair
#define pb push_back

#define fi first
#define se second

#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
typedef vector<pair<int, int> > vp;

typedef long long ll;

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

int main(){
  while(1){
    int w,h;
    int aa=0;
    int bb=0;
    string a[55];
    string b[55];
    cin >> w >> h;
    if(w==0)break;
    rep(i,h){
      cin >> a[i];
      b[i] = a[i];
    }
    bool f = true;
    rep(y,h){
      rep(x,w){
        if(a[y][x]=='W'||a[y][x]=='B') f = false;
      }
    }
    if(f){
      cout << 0 << " " << 0 << endl;
      continue;
    }
    rep(y,h){
      rep(x,w){
        if(a[y][x]=='W'){
          
          queue<pii> que;
          que.push(mp(x,y));
          
          while(!que.empty()){
            int yy = que.front().se;
            int xx = que.front().fi;
            a[yy][xx]='w';
            que.pop();
            rep(i,4){
              if(yy+dy[i]>=0 &&
                 xx+dx[i]>=0 &&
                 yy+dy[i]<h &&
                 xx+dx[i]<w &&
                 
                a[yy+dy[i]][xx+dx[i]]=='.'){
                que.push(mp(xx+dx[i],yy+dy[i]));
              }
            }
          }
        }
      }
    }
    rep(y,h){
      rep(x,w){
        if(a[y][x]=='.'){
          bb++;
        }
      }
    }
    rep(y,h){
      rep(x,w){
        if(b[y][x]=='B'){
          
          queue<pii> que;
          que.push(mp(x,y));
          
          while(!que.empty()){
            int yy = que.front().se;
            int xx = que.front().fi;
            b[yy][xx]='b';
            que.pop();
            rep(i,4){
              if(yy+dy[i]>=0 &&
                 xx+dx[i]>=0 &&
                 yy+dy[i]<h &&
                 xx+dx[i]<w &&
                 
                b[yy+dy[i]][xx+dx[i]]=='.'){
                que.push(mp(xx+dx[i],yy+dy[i]));
              }
            }
          }
        }
      }
    }
    rep(y,h){
      rep(x,w){
        if(b[y][x]=='.'){
          aa++;
        }
      }
    }
    cout<<bb << " "<<aa<<endl;
  }
  return 0;
}

Measured memory_bytes: 55684
mod = 998244353
fact = [1]*(2*10**5+1)
for n in range(2*10**5):
    fact[n+1] = (n+1)*fact[n]
    fact[n+1] %= mod

factinv = [1]*(2*10**5+1)
for n in range(2*10**5):
    factinv[n+1] = pow(fact[n+1],mod-2,mod)

def comb(n,k):
    return fact[n]*factinv[k]*factinv[n-k]%mod

N,M,K = map(int,input().split())

pm = [1]*(N+1)
for i in range(N):
    pm[i+1] = pm[i]*(M-1)%mod

ans = 0
for k in range(K+1):
    ans += M*pm[N-k-1]*comb(N-1,k)
    ans %= mod
print(ans)

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

int main() {
    int n;
    cin >> n;
    int p = 0;
    vector<int> ans;
    for (int i = 1; i <= n; i++) {
        p += i;
        ans.emplace_back(i);
        if (p >= n) break;
    }
    
    for (const auto &e : ans) {
        if (e != p - n) cout << e << '\n';
    }
    return 0;
}

Measured memory_bytes: 384
#include<stdio.h>
int main(void)
{
	int a,b;
	scanf("%d %d",&a,&b);
	if(a<b){
		printf("a < b\n",a,b);
	}
	if(a>b){
		printf("a > b\n",a,b);
	}
	if(a==b){
		printf("a == b\n",a,b);
	}
	return 0;
}

Measured memory_bytes: 1008
n = int(input())
p = list(map(int,input().split()))
ans = [i for i in range(1,n+1)]
cha = 0
for i in range(n):
  if p[i] != ans[i]:
    cha += 1
    if cha > 2:
      print("NO")
      exit()
print("YES")

Measured memory_bytes: 9080
rate = gets().chomp().to_i
if rate >= 400 && rate <= 599
  p 8
elsif rate >= 600 && rate <= 799
  p 7
elsif rate >= 800 && rate <= 999
  p 6
elsif rate >= 1000 && rate <= 1199
  p 5
elsif rate >= 1200 && rate <= 1399
  p 4
elsif rate >= 1400 && rate <= 1599
  p 3
elsif rate >= 1600 && rate <= 1799
  p 2
elsif rate >= 1800 && rate <= 1999
  p 1
end

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


// dp[i][w] := i <= N番目まで見て重さw以下の価値の最大値
long long dp[101][100001];
int N, W;

int main(){
    cin >> N >> W;
    for(int i = 1; i <= N; i++){
        int w, v;
        cin >> w >> v;
        for(int j = 0; j <= W; j++){
            dp[i][j] = dp[i - 1][j];
            if(j > 0){
                dp[i][j] = max(dp[i][j], dp[i][j - 1]);
            }
            if(j - w >= 0){
                dp[i][j] = max(dp[i][j], dp[i - 1][j - w] + v);
            }
        }
    }
    cout << dp[N][W] << endl;
}


Measured memory_bytes: 78336
#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <iomanip>
#include <set>
using namespace std;

#define rep(i, s) for (int i = 0; i < s; ++i)
#define all(v) (v.begin(), v.end())
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define VEC(a, n) vector<int>a(n)
#define PQ(a) priority_queue<int>a
#define PQmin(a) priority_queue< int, :vector<int>, greater<int> >a
#define PAIR pair<int, int>
/*
sort(sp.begin(), sp.end(), [](PAIR l, PAIR r){
        return l.first<r.first || (l.first==r.first && l.second > r.second);
        });
*/

typedef long long  ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

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

int main() {
    int a;
    string s;
    cin>>a;
    cin>>s;
    if(a>=3200){
        cout<<s<<endl;
    }
    else{
        cout<<"red"<<endl;
    }





    return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;


static class AT {
    static int N;
    static int[] A;
    static void Main() {
        N = int.Parse(Console.ReadLine());
        A = new int[N];
        for(int i = 0; i < N; i++) {
            A[i] = int.Parse(Console.ReadLine());
        }
        long cnt = 0;
        for(int i = A.Length - 1; i >= 0; i--) {
            if (A.Length - 1==i) {
                cnt += A[i] / 2;
                A[i] %= 2;
            }
            else {
                
                if (A[i + 1] == 1) {
                    if (A[i] != 0) {
                        cnt++;
                        A[i]--;
                    }
                }
                cnt += A[i] / 2;
                A[i] %= 2;
            }
            
        }
        Console.WriteLine(cnt);
    }
}


Measured memory_bytes: 7128
#include <stdio.h>
#include <algorithm>
using namespace std;

const long long mod = 1000000007;

long long fpow(long long a, long long p)
{
	long long r = 1;
	while (p){
		if (p & 1) r = r * a % mod;
		a = a * a % mod;
		p /= 2;
	}
	return r;
}

int f(int x)
{
	if (x >= 100000000) return 9;
	if (x >= 10000000) return 8;
	if (x >= 1000000) return 7;
	if (x >= 100000) return 6;
	for (int d=1,p=1;;d++,p*=10){
		if (p <= x && x < p * 10) return d;
	}
	return -1;
}

void test(long long &ans, int l, int m)
{
	if (l <= 8) return;
	ans = (ans + fpow(10,l-1) * 9 - m + 1 + mod) % mod;
}

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

	long long ans = 0;

	for (int i=1,j=1,s=0;i<100000000;i++){
		while (s < S) s += f(j++);
		if (s == S) ans = (ans + 1) % mod;
		s -= f(i);
	}

	for (int i=1;i*i<=S;i++) if (S % i == 0){
		test(ans,i,S/i);
		if (S != i * i) test(ans,S/i,i);
	}

	for (int s=9;s<=S/2;s++){
		long long low = (S+1+s)/(s+1);
		long long upp = (S-1)/s;
		if (low <= upp) ans = (ans + upp - low + 1) % mod;
	}

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

	return 0;
}

Measured memory_bytes: 128
from bisect import bisect_left
N=int(input())
inp=[int(i)for i in input().split()]
inp.sort()
ma=inp[-1]
idx = bisect_left(inp[0:-1], ma//2)
# print(inp, inp[idx], ma//2)
if idx >= len(inp)-1:
    # print("d1", inp[idx], inp[idx + 1])
    if idx >= len(inp)-1:
        print(ma, inp[idx-1])
    else:
        print(ma, inp[idx])
elif abs(inp[idx] - ma//2) < abs(ma//2 - inp[idx - 1]) or abs(ma - inp[idx] - ma//2) < abs(ma//2 - inp[idx - 1]):
    # print("d2", inp[idx], inp[idx-1])
    print(ma, inp[idx])
else:
    # print("d3", inp[idx], inp[idx-1])
    print(ma, inp[idx-1])


Measured memory_bytes: 14052
s = input()
N = len(s)
ok = True
if s[:] != s[::-1]:
    ok = False

if s[:N//2] !=  s[:N//2][::-1]:
    ok = False
#print(s[:N//2], s[:N//2][::-1])

if s[N//2+1:] != s[N//2+1:][::-1]:
    ok = False

#print(s[N//2+1:] , s[N//2+1][::-1])
if ok:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair <int, int> P;

int N;

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

	ll sum = 0; cin >> N;
	for (int i = 1; i < N; i++) {
		sum += i;
	}
	cout << sum;
}

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

using namespace std;

#define ll long long 
#define ld long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mkp make_pair
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define ff first
#define ss second
#define endl "\n"
#define MOD 1000000007
#define MOD1 998244353
#define inf LLONG_MAX

ll GCD(ll x,ll y){if(y==0)return x;return GCD(y,x%y);}
ll LCM(ll x,ll y){return (x*y)/(GCD(x,y));}
ll LOGK(ll x,ll k){if(x>=k)return 1+LOGK(x/k,k);return 0;}
ll MPOW( ll a, ll b, ll m) { if(b==0) return 1; ll x=MPOW(a,b/2,m); x=(x*x)%m; if(b%2==1) x=(x*a)%m; return x;}
ll MINV(ll a,ll m) {return MPOW(a,m-2,m);}

class pnc{
  ll FACT_MAX,MODU;
  vector<ll> fact;
public:
  pnc( ll n, ll m) { FACT_MAX = n; fact.resize(FACT_MAX); MODU = m; MFACT_INIT(MODU);}
  void MFACT_INIT( ll m) { fact[0]=1; for(ll i=1;i<FACT_MAX;++i) fact[i]=(i*fact[i-1])%MODU;}
  ll MFACT( ll n) { return fact[n];}
  ll PERM( ll n, ll r) { return (fact[n]*::MINV(fact[n-r],MODU))%MODU;}
  ll COMB( ll n , ll r) { return (PERM(n,r)*::MINV(fact[r],MODU))%MODU;}
};

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

    ll test=1;
    //cin>>test;
    while(test--)
    {
        ll a,b;
        cin>>a>>b;
        
        cout<<a*b;
    }
}













Measured memory_bytes: 3648
#pragma GCC optimize(2) 
#include<iostream>
 
using namespace std;
const int mod=998244353;
long long a[100010];
long long n,x;
long long ksm(long long a,long long b){
	long long res=1;
	while(b){
		if(b&1){
			res*=a;
			res%=mod;
		}
		a*=a;
		a%=mod;
		b>>=1;
	}
	return res;
}
 
int main(){
	//scanf("%lld",&n);
	cin>>n;
	int flag=0;
//	scanf("%lld",&x);
	cin>>x;
	int ans=x;
	if(x!=0) flag=1;
	for(int i=1;i<n;i++){
//		scanf("%lld",&x);
		cin>>x;
		a[x]++;
		if(x==0) flag=1;
		if(x>ans){
			ans=x;
		}
	}
	if(flag){
	//	printf("0\n");
		cout<<0<<"\n";
	}
	else{
	long long sum=1;
		for(int i=1;i<ans;i++){
			if(a[i]==0){
				flag=1;
				break;
			}
			sum*=ksm(a[i],a[i+1]);
			sum%=mod;
		}
		if(flag) cout<<0<<"\n";//printf("0\n");
		else  cout<<sum<<"\n";//printf("%lld\n",sum);
	}
	return 0;
} 

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

using ll = long long;
const ll INF = 1LL << 50;


int main(void) {
    int N, M;
    cin >> N >> M;
    
    const int NMAX = 1000;
    const int MMAX = 2000;
    int a[MMAX], b[MMAX];
    ll c[MMAX];
    
    for (int i = 0; i < M; ++i) {
        cin >> a[i] >> b[i] >> c[i];
        c[i] = -c[i];
    }
    
    ll dist[NMAX];
    
    for (int i = 0; i < N; ++i) {
        dist[i] = INF; 
    }
    
    dist[0] = 0;
    
    
    for (int loop = 0; loop < N - 1; ++ loop) {
        for (int i = 0; i < M; ++i) {
            
            if (dist[a[i] - 1] == INF) continue;
            
            if (dist[b[i] - 1] > dist[a[i] - 1] + c[i]) {
                dist[b[i] - 1] = dist[a[i] - 1] + c[i];
            }
        }
    }
    
    ll ans = dist[N - 1];
    
    
    bool negative[NMAX];
    
    for (int i = 0; i < N; ++i) {
        negative[i] = false;
    }
    
    for (int loop = 0; loop < N ; ++ loop) {
        for (int i = 0; i < M; ++i) {
            if (dist[a[i] - 1] == INF) continue;
            
            if (dist[b[i] - 1] > dist[a[i] - 1] + c[i]) {
                dist[b[i] - 1] = dist[a[i] - 1] + c[i];
                negative[b[i] - 1] = true;
            }
            
            if (negative[a[i] - 1] == true) {
                negative[b[i] - 1] = true;
            }
        }
    }
    
    
    if (negative[N - 1])
        cout << "inf" << endl;
    else
        cout << -ans << endl;
    
    return 0;
}

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

int main() {
  
  int N, M; cin >> N >> M;
  
  vector<int> vecA(N); vector<int> vecB(N);
  
  for (int i = 0; i < N; i++) {
    int a, b; cin >> a >> b;
    vecA[i] = a; vecB[i] = b;
  }
  
  vector<int> vecC(M); vector<int> vecD(M);
  
  for (int i = 0; i < M; i++) {
    int c, d; cin >> c >> d;
    vecC[i] = c; vecD[i] = d;
  }
  
  for (int i = 0; i < N; i++) {
    
    int tmp = 400000001; int ans;
    
    for (int j = 0; j < M; j++) {
      
      int distance = abs(vecA[i] - vecC[j]) + abs(vecB[i] - vecD[j]);
      
      if (distance < tmp) {
        tmp = distance; ans = j + 1;
      }
      
    }
    
    cout << ans << endl;
    
  }
  
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
  
int main () {
    long long X;
    cin >> X;

    int cnt = 0;
    long long tmp = 100;
    while(1) {
        tmp *= 1.01;
        cnt++;
        if(tmp >= X) {
            cout << cnt << endl;    
            return 0;
        }
    }
}

Measured memory_bytes: 3636
N, Y = [int(item) for item in input().split()]

y = Y //1000
is_search = True

for i in range(N+1):
    for j in range(N+1):
        k = N -(i+j)
        temp_price = 10*i + 5*j + k

        if temp_price == y and 0 <= k <= N:
            print(i,j,k)
            is_search = False
            break

    if not is_search:
        break

if is_search:
    print('-1 -1 -1')

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

#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i, x, n) for(int i = x; i >= n; i--)
#define rrep(i, n) RREP(i,n,0)
#define pb push_back
#define show_table(n, k, table) rep(i,n){ rep(j,k) cout << table[i][j] << " "; cout << endl;}

using namespace std;

template<class T> inline void chmax(T& a,T const& b){a=max(a,b);}
template<class T> inline void chmin(T& a,T const& b){a=min(a,b);}

using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;

const int mod=1e9+7,INF=1<<30;
const double EPS=1e-12,PI=3.1415926535897932384626;
const ll lmod = 1e9+7,LINF=1LL<<60;
const int MAX_N = 100005;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N,K; cin >> N >> K;
  vector<P> a(N);
  rep(i,N){
    cin >> a[i].second;
    a[i].first = a[i].second % K;
  }
  sort(ALL(a));
  vi same(K),cnt(K);
  rep(i,N) cnt[a[i].first]++;
  rep(i,N-1){
    if(a[i].second==a[i+1].second){
      same[a[i].first]++;
      i += 1;
    }
  }
  int ans = 0;
  // rep(i,K) cout << same[i] << " ";
  // cout << "" << endl;
  // rep(i,K) cout << cnt[i] << " ";
  // cout << "" << endl;
  ans += cnt[0]/2;
  int l = 1, r = K-1;
  while(l<=r){
    if(l==r) ans += cnt[l]/2;
    // else if(abs(same[l]-same[r])<=1) ans += min(cnt[l],cnt[r]);
    else{
      int c1,c2,s1,s2;
      c1 = cnt[l]; c2 = cnt[r]; s1 = same[l]; s2 = same[r];
      if(c1<c2) swap(c1,c2), swap(s1,s2);
      ans += c2 + min((c1-c2)/2,s1);
    }
    // cout << l <<" "<< ans << endl;
    l++; r--;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 1792
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE BinaryLiterals #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE NumDecimals #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}

import Control.Applicative
import Control.Arrow
import Control.Monad
import Control.Monad.ST

import Data.Char
import Data.List
import Data.Maybe

import qualified Data.ByteString.Char8 as B

import Data.Array.ST.Safe
import Data.STRef

import Debug.Trace
import Text.Printf

readInt = readLn :: IO Int
readInts = map ( fst . fromJust . B.readInt ) . B.words <$> B.getLine
readNInts = readInt >>= flip replicateM readInt

which a b f = if f then a else b
mp [ a, b ] = ( a, b )

main = do
	[ a, b, k ] <- readInts
	print $ ( !! ( k - 1 ) ) $ reverse $ [ x | x <- [ 1 .. min a b ], a `mod` x == 0, b `mod` x == 0 ]

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


int main() {

    int num1, num2;
    int product;
    cin >> num1 >> num2;
    product = num1*num2;
    if (product % 2 == 0) {
        cout << "Even\n";
    }
    else {
        cout << "Odd\n";
    }
    
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define ll long long
#define ll_MAX LONG_LONG_MAX
#define ll_MIN LONG_LONG_MIN
#define pi pair<int,int>
#define endl "\n"
#define MAXN 100005
using namespace std;

void solve()
{
    
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	cout.tie(NULL);
    solve();
    ll n;
    cin>>n;
    if(n%1000==0)
    {
        cout<<0<<'\n';
        return 0;
    }
    ll t = n/1000 + 1;
    cout<<t*1000 - n<<'\n';
}

Measured memory_bytes: 3652
#include <cstdio>
#include <cstdint>
#include <vector>
#include <map>
#include <algorithm>
#include <utility>

int main() {
  size_t n;
  scanf("%zu", &n);

  std::map<int, int> even, odd;
  for (size_t i = 0; i < n; i += 2) {
    int v;
    scanf("%d", &v);
    ++even[v];
    scanf("%d", &v);
    ++odd[v];
  }

  std::vector<std::pair<int, int>> evenf, oddf;
  for (const auto& p: even) evenf.emplace_back(p.second, p.first);
  for (const auto& p: odd) oddf.emplace_back(p.second, p.first);

  std::sort(evenf.rbegin(), evenf.rend());
  std::sort(oddf.rbegin(), oddf.rend());

  if (evenf.size() == 1 && oddf.size() == 1) {
    if (evenf[0].second != oddf[0].second) {
      puts("0");
    } else {
      printf("%zu\n", n/2);
    }
    return 0;
  }

  if (evenf.size() > oddf.size())
    std::swap(evenf, oddf);

  if (evenf.size() == 1) {
    if (evenf[0].second != oddf[0].second) {
      printf("%zu\n", n/2-oddf[0].first);
    } else {
      printf("%zu\n", n/2-oddf[1].first);
    }
    return 0;
  }

  if (evenf[0].second != oddf[0].second) {
    printf("%zu\n", n-evenf[0].first-oddf[0].first);
  } else {
    printf("%zu\n", n-std::max(evenf[0].first+oddf[1].first, evenf[1].first+oddf[0].first));
  }
}


Measured memory_bytes: 6140
n = int(input())

s = input()

now =0
right = 0
for i in range(n):
    if(s[n-1-i]=='('):
        now+=1
    else:
        now-=1
    if(right<now):
        right=now
left=0
now=0
for i in range(n):
    if(s[i]=='('):
        now-=1
    else:
        now+=1
    if(left<now):
        left=now

print('('*left +s+ ')'*right)

Measured memory_bytes: 38384
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define _GLIBCXX_DEBUG
#define all(x) x.begin(), x.end()
using namespace std;
typedef long long ll;
typedef pair<int, int> pair;
const int inf = 1000000000; //10^9
const ll inff = 1000000000000000000; //10^18

int main(){
    string s;
    cin >> s;
    cout << "2018/01/" << s[8] << s[9] << endl;

    return 0;
}

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

#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

using namespace std;

typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
typedef long double ld;

const ll mod = (ll)1e9 + 7;
const ll mxN = 200200;




int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.precision(20);
	cout << fixed;
	ll ans=0;
	ll n;
	cin>>n;
	vll A(n);
	for(int i=0;i<n;i++)
		cin>>A[i];
	sort(all(A));
	for(int i=0;i<n;++i)
		i&1?ans-=A[i]:ans+=A[i];
	cout<<abs(ans)<<"\n";

}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) FOR(i,0,n)
#define repr(i,n) for(int i=(n)-1;0<=i;--i)
#define each(e,v) for(auto&& e:(v))
#define all(v) begin(v),end(v)
#define DUMP(x) cerr<<#x<<": "<<(x)<<endl
#define DEBUG(x) cerr<<#x<<": "<<(x)<<" (L"<<__LINE__<<")"<<endl
using namespace std;
using vint = vector<int>;
using vdouble = vector<double>;
using vstring = vector<string>;
using ll = long long;
template <class T> void chmin(T& a, const T& b) { a = min(a, b); }
template <class T> void chmax(T& a, const T& b) { a = max(a, b); }

int main() {
    int N; cin >> N;
    vint s(N); rep(i, N) cin >> s[i];
    int sum = accumulate(all(s), 0);
    s.push_back(0);
    sort(all(s));
    FOR(i, 1, N) {
        if(sum % 10 != 0) break;
        sum -= s[i];
        sum += s[i-1];
    }
    if(sum % 10 == 0) sum = 0;
    cout << sum << endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
    #include<set>
    using namespace std;
    int main(){
        int n;
        cin>>n;
        int A[100];
        for(int i=0;i<n;i++) cin>>A[i];
        set<int> C;
        for(int i=0;i<n;i++) C.insert(A[i]);
        cout<<C.size();
    }

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

using namespace std;

typedef long long ll;
typedef long double Double;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

// chmax, chmin
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;
}

struct P {
    long long x;
    long long y;
};

void solve(long long N, std::vector<long long> x, std::vector<long long> y) {
    vector<P> ps;
    for (int i = 0; i < N; i++) {
        ps.push_back({x[i], y[i]});
    }
    sort(ps.begin(), ps.end(), [&](P a, P b) {
        return atan2(a.y, a.x) < atan2(b.y, b.x);
    });
    long long ans = 0;
    for (int i = 0; i < N; i++) {
        long long totX = 0, totY = 0;
        for (int j = 0; j < N; j++) {
            totX += ps[(i + j) % N].x;
            totY += ps[(i + j) % N].y;
            ans = max(totX * totX + totY * totY, ans);
        }

    }
    printf("%.15lf\n", sqrt(ans));
}

int main() {
    long long N;
    scanf("%lld", &N);
    std::vector<long long> x(N);
    std::vector<long long> y(N);
    for (int i = 0; i < N; i++) {
        scanf("%lld", &x[i]);
        scanf("%lld", &y[i]);
    }
    solve(N, std::move(x), std::move(y));
    return 0;
}


Measured memory_bytes: 384
#include "bits/stdc++.h"
using namespace std;
#define repr(i,a,b) for(long long i=(long long)(a);i<(long long)(b);i++)
#define rep(i,n) repr(i,0,n)
#define reprrev(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define reprev(i,n) reprrev(i,0,n)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define mp make_pair
#define mt make_tuple
#define MOD 1000000007
#define PI 3.1415926535
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> Pi;
typedef pair<ll, ll> Pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<Pi> vPi;
typedef vector<Pll> vPll;
typedef vector<vector<int>> vvi;
typedef vector<vector<bool>> vvb;
typedef vector<vector<ll>> vvll;
typedef vector<vector<char>> vvc;
typedef vector<vector<string>> vvs;
typedef vector<vector<double>> vvd;
typedef vector<vector<Pi>> vvPi;
typedef priority_queue<int, vector<int>, greater<int>> pqli;
typedef priority_queue<ll, vector<ll>, greater<ll>> pqlll;
typedef priority_queue<Pi, vector<Pi>, greater<Pi>> pqlP;
string YN(bool y) { return (y?"YES":"NO"); }
string yn(bool y) { return (y?"Yes":"No"); }
string ON(bool y) { return (y?"OK":"NG"); }
//組合せの数の計算(nCr)
long long Comb(int n, int r)
{
	//n, rが負またはn<rの時は失敗
	if(n<0||r<0||n<r) return 0;

	//nCr=nCn-r
	r=(r<n-r)?r:(n-r);

	//r=0,1の時は計算する必要がない
	if(r==0) return 1;
	if(r==1) return n;

	vector<int> numerator(r), denominator(r);

	for(int k=0; k<r; k++){
		numerator[k]=n-r+k+1;
		denominator[k]=k+1;
	}

	for(int p=2; p<=r; p++){
		int pivot=denominator[p-1];
		if(pivot>1){
			int offset=(n-r)%p;
			for(int k=p-1; k<r; k+=p){
				numerator[k-offset]/=pivot;
				denominator[k]/=pivot;
			}
		}
	}

	long long result=1;
	for(int k=0; k<r; k++){
		if(numerator[k]>1) result*=numerator[k];
	}
	return result;
}
int main(void)
{
	int n;

	cin>>n;

	int hist[101]={};

	repr(i, 2, n+1){
		int temp=i;
		repr(j, 2, 100){
			while(1){
				if(temp%j==0){
					hist[j]++;
					temp/=j;
				} else{
					break;
				}
			}
		}
	}

	int th74=0, th24=0, th14=0, th4=0, th2=0;
	rep(i, 101){
		if(hist[i]>=74) th74++;
		if(hist[i]>=24) th24++;
		if(hist[i]>=14) th14++;
		if(hist[i]>=4) th4++;
		if(hist[i]>=2) th2++;
		//cout<<hist[i]<<endl;
	}

	cout<<Comb(th74, 1)+Comb(th24, 1)*Comb(th2-1, 1)+Comb(th14, 1)*Comb(th4-1, 1)+Comb(th4, 2)*Comb(th2-2, 1)<<endl;
}


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

typedef long lint;
typedef long long llint;
typedef pair<int, int> pint;
typedef pair<long long, long long> pllint;

// static const int MAX = 1e6;
// static const int NIL = -1;
// static const llint INF = 1<<21;
// static const llint MOD = 1e9 + 7;

bool compPair(const pint& arg1, const pint& arg2) { return arg1.first > arg2.first; }
template<class T> void chmax(T& a, T b) { if (a < b) { a = b; } }
template<class T> void chmin(T& a, T b) { if (a > b) { a = b; } }

int main(void) {
    int h, w;
    cin >> h >> w;

    vector<vector<char>> s(h, vector<char>(w));
    for(int ih=0;ih<h;ih++) {
        for(int iw=0;iw<w;iw++) {
            cin >> s.at(ih).at(iw);
        }
    }

    int ans;
    for(int ih=0;ih<h;ih++) {
        for(int iw=0;iw<w;iw++) {
            ans = 0;
            if(s.at(ih).at(iw)=='.') {
                if(ih!=0) {
                    if(s.at(ih-1).at(iw)=='#') ans++;
                }
                if(ih!=h-1) {
                    if(s.at(ih+1).at(iw)=='#') ans++;
                }
                if(iw!=0) {
                    if(s.at(ih).at(iw-1)=='#') ans++;
                }
                if(iw!=w-1) {
                    if(s.at(ih).at(iw+1)=='#') ans++;
                }
                if(ih!=0&&iw!=0) {
                    if(s.at(ih-1).at(iw-1)=='#') ans++;
                }
                if(ih!=h-1&&iw!=0) {
                    if(s.at(ih+1).at(iw-1)=='#') ans++;
                }
                if(ih!=0&&iw!=w-1) {
                    if(s.at(ih-1).at(iw+1)=='#') ans++;
                }
                if(ih!=h-1&&iw!=w-1) {
                    if(s.at(ih+1).at(iw+1)=='#') ans++;
                }
                cout << ans;
            }
            else {
                cout << '#';
            }
        }
        cout << endl;
    }
    return 0;
}


Measured memory_bytes: 256
import std.stdio, std.conv, std.string;
import std.algorithm, std.array, std.container;
import std.numeric, std.math;
import core.bitop;

T RD(T)() { static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res.to!T; }
string RDR()() { return readln.chomp; }

long mod = pow(10, 9) + 7;
long moda(long x, long y) { return (x + y) % mod; }
long mods(long x, long y) { return ((x + mod) - (y % mod)) % mod; }
long modm(long x, long y) { return (x * y) % mod; }

void main()
{
	auto A = RD!ulong;
	auto B = RD!ulong;
	auto C = RD!ulong;

	auto ab = A % 2 == B % 2;
	auto bc = B % 2 == C % 2;
	ulong ans;
	if (!ab) 
	{
		if (bc) ++B;
		else	++A;
		++C;
		++ans;
	}
	else if (!bc)
	{
		if (ab) ++B;
		else	++C;
		++A;
		++ans;
	}
	ulong[] arr = [A, B, C];
	arr.sort();
	ans += (arr[2] - arr[0]) / 2;
	ans += (arr[2] - arr[1]) / 2;

	writeln(ans);
	stdout.flush();
}

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

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

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

    string s;
    cin >> s;

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

Measured memory_bytes: 256
/**
    __author__ : srv_twry
**/

#include<bits/stdc++.h>
using namespace std;

typedef pair<int, int> ii;
typedef pair<int, ii> iii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vll;
typedef pair<ll,ll> lll;

const ll MOD = 1000000007;
const ll INF = 1e9+5;
const double eps = 1e-7;
const double PI = acos(-1.0);

#define FOR(i,a,b) for(long long i = (long long)(a); i < (long long)(b); i++)
#define RFOR(i,a,b) for(long long i = (long long)(a); i >= (long long)(b); i--)
#define ull unsigned long long
#define deb(x )     cerr << #x << " = "<< x << endl;
#define endl    "\n"
#define coud(a,d) cout << fixed << showpoint << setprecision(d) << a;
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define fill(x, y) memset(x, y, sizeof(y))
#define all(x) (x).begin(), (x).end()

inline void debug_vi(vi a) {FOR(i, 0, a.size()) cout<<a[i]<<" ";}
inline void debug_vll(vll a) {FOR(i, 0, a.size()) cout<<a[i]<<" ";}

bool ge(const ll& a, const ll& b) { return a >= b; }
bool le(const ll& a, const ll& b) { return a <= b; }
bool eq(const ll& a, const ll& b) { return a == b; }
bool gt(const ll& a, const ll& b) { return a > b; }
bool lt(const ll& a, const ll& b) { return a < b; }
int sgn(const ll& x) { return le(x, 0) ? eq(x, 0) ? 0 : -1 : 1; }
/*----------------------------------------------------------------------*/

int main(){
    std::ios::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    string s;
    cin>>s;
    if (s[0] == 'R')
    {
    	cout<<"Sunny";
    } else if(s[0] == 'S') {
    	cout<<"Cloudy";
    } else {
    	cout<<"Rainy";
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <iomanip>
#include <queue>
#include <map>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define RREP(i, n) for(int i = n-1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
#define INF 1e10
typedef long long ll;
typedef long double ld;
int main(){
    ll d,g; cin>>d>>g;
    vector<pair<ll,ll>> v(d);
    REP(i,d){
        cin>>v[i].first>>v[i].second;
    }
    ll ans=INF;
    REP(bit,1<<d){
        ll point=0;
        ll big=-1;
        ll prbnumsum=0;
        REP(i,d){
            if(bit & 1<<i){
                ll prbnum=v[i].first, cmp=v[i].second;
                point+=100*(i+1)*prbnum+cmp;
                prbnumsum+=prbnum;
            }else{
                if(big<i)big=i;
            }
        }
        if(g<=point && ans>prbnumsum)ans=prbnumsum;
        else if(g>point){
            REP(i,v[big].first){
                point+=100*(big+1);
                prbnumsum++;
                if(g<=point && ans>prbnumsum)ans=prbnumsum;
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}


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

int main() {
  vector<int> num(3);
  
  for (int i=0; i<3; i++){
  	cin >> num.at(i);
  }
  
  cout << num.at(2) << " " << num.at(0) << " " << num.at(1) << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
#define ins insert
#define sz(x) (long long)x.size()
typedef long long ll;
typedef long double ld;
const int N = 1e5 + 5;
const ld pi = 3.141592653;
const ll MOD = 1e9 + 7;
const ll mod = 998244353;
const ll INF = __LONG_LONG_MAX__;

using namespace std;

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

int main()
{
        ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
        int T = 1;
        //cin>>T;
        while(T--)
        {
                ll n, i, ans=0, d;
                cin>>n>>d;
                for(i=0; i<n; i++){
                        ll x, y;
                        cin>>x>>y;
                        if( x*x + y*y <= d*d) ans++;
                }
                cout<<ans;
        }
        return 0;
}

Measured memory_bytes: 3660
import sys, math
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
from itertools import combinations, permutations, product
from heapq import heappush, heappop
from functools import lru_cache
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mat = lambda x, y, v: [[v]*y for _ in range(x)]
ten = lambda x, y, z, v: [mat(y, z, v) for _ in range(x)]
mod = 1000000007
sys.setrecursionlimit(1000000)

X = ri()

if X >= 30:
	print('Yes')
else:
	print('No')

Measured memory_bytes: 68156
from collections import Counter
import sys
def main():
    input = sys.stdin.readline
    N = int(input())
    A = list(map(int, input().split()))

    ans = 0
    A.sort(reverse=True)
    C = Counter(A)
    for a in A:
        if C[a] == 0: continue
        C[a] -= 1
        p = (1 << a.bit_length()) - a
        if p in C and C[p] > 0:
            ans += 1
            C[p] -= 1
    print(ans)

if __name__ == '__main__':
    main()

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

int main() {
  while(1) {
    int w, h;
    cin >> w >> h;
    if(w == 0 && h == 0) break;

    int x = 1;
    int y = 1;
    int d[4][2] = {{1,0},{0,1},{-1,0},{0,-1}};
    int pd = 1;
    while(1) {
      string str;
      cin >> str;
      if(str == "FORWARD" || str == "BACKWARD") {
	int l;
	cin >> l;
	if(str == "BACKWARD") {
	  l *= -1;
	}
	x += d[pd][0] * l;
	y += d[pd][1] * l;
	if(x < 1) x = 1;
	if(x > w) x = w;
	if(y < 1) y = 1;
	if(y > h) y = h;
      }

      if(str == "RIGHT") {
	pd = (pd+3)%4;
      }
      if(str == "LEFT") {
	pd = (pd+1)%4;
      }
      if(str == "STOP") {
	cout << x << ' ' << y << endl;
	break;
      }
    }
  }
  return 0;
}

Measured memory_bytes: 0
/**
 *    Coded by : lucky_21
 *               --------Lokesh Singh
**/

#include<bits/stdc++.h>
using namespace std;

#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
template<class T> using oset=tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;

#define     F           first
#define     S           second
#define     pb          push_back
#define     lb          lower_bound
#define     ub          upper_bound
#define     pii         pair<int,int>
#define     all(x)      x.begin(),x.end()
#define     fix         fixed<<setprecision(10)
#define     rep(i,a,b)  for(int i=int(a);i<=int(b);i++)
#define     repb(i,b,a) for(int i=int(b);i>=int(a);i--)
#define     FastIO      ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)

typedef double db;
typedef long long ll;

const int N=1e5+5;
const int mod=1e9+7;

int n,k,dp[N][2],a[105];
bool rec(int x,int turn){
    if(x<0) return 1;
    int &cache=dp[x][turn];
    if(cache!=-1) return cache;
    cache=0;
    rep(i,1,n) cache|=rec(x-a[i],turn^1)==0;
    return cache;
}
signed main(){
    FastIO;
    cin>>n>>k;
    rep(i,1,n) cin>>a[i];
    memset(dp,-1,sizeof dp);
    cout<<(rec(k,0)?"First":"Second");
    return 0;
}


Measured memory_bytes: 5760
package main

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

func solve() {
	n := scanInt()
	x := []int{}
	y := []int{}
	nums := []int{}
	for i := 0; i < n; i++ {
		nums = append(nums, i)
		x = append(x, scanInt())
		y = append(y, scanInt())
	}
	sum := 0.0
	for _, v := range Permute(nums) {
		for i := 0; i < n-1; i++ {
			sum += math.Sqrt(math.Pow(float64(x[v[i+1]]-x[v[i]]), 2) + math.Pow(float64(y[v[i+1]]-y[v[i]]), 2))
		}
	}
	fmt.Println(sum / float64(factorial(n)))
	return
}

var sc = bufio.NewScanner(os.Stdin)

func scanString() string {
	sc.Scan()
	return sc.Text()
}
func scanInt() int {
	sc.Scan()
	a, err := strconv.Atoi(sc.Text())
	if err != nil {
		fmt.Println(err)
	}
	return a
}
func scanFloat64() float64 {
	f, _ := strconv.ParseFloat(scanString(), 64)
	return f
}
func Permute(nums []int) [][]int {
	n := factorial(len(nums))
	ret := make([][]int, 0, n)
	permute(nums, &ret)
	return ret
}

func permute(nums []int, ret *[][]int) {
	*ret = append(*ret, makeCopy(nums))

	n := len(nums)
	p := make([]int, n+1)
	for i := 0; i < n+1; i++ {
		p[i] = i
	}
	for i := 1; i < n; {
		p[i]--
		j := 0
		if i%2 == 1 {
			j = p[i]
		}

		nums[i], nums[j] = nums[j], nums[i]
		*ret = append(*ret, makeCopy(nums))
		for i = 1; p[i] == 0; i++ {
			p[i] = i
		}
	}
}

func factorial(n int) int {
	ret := 1
	for i := 2; i <= n; i++ {
		ret *= i
	}
	return ret
}
func makeCopy(nums []int) []int {
	return append([]int{}, nums...)
}

func gcd(a int, b int) int {
	if b == 0 {
		return a

	}

	return gcd(b, a%b)
}
func main() {
	sc.Split(bufio.ScanWords)
	solve()
}


Measured memory_bytes: 4224