akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;

deque <char> deq;

int main(){
    ios_base::sync_with_stdio(false), cin.tie(0);
    cout.precision(10);
    cout << fixed;

	string s;
	cin >> s;
	for(auto c : s) deq.push_back(c);
	int q;
	cin >> q;
	bool rev = 0;
	while(q--){
        int t;
        cin >> t;
        if(t == 1){
            rev ^= 1;
            continue;
        }
        int f;
        char c;
        cin >> f >> c;
        if(f == 1){
            if(rev == 0) deq.push_front(c);
            else deq.push_back(c);
        }
        if(f == 2){
            if(rev == 0) deq.push_back(c);
            else deq.push_front(c);
        }
	}
	if(rev){
        while(!deq.empty()){
            cout << deq.back();
            deq.pop_back();
        }
	}
	else{
        while(!deq.empty()){
            cout << deq.front();
            deq.pop_front();
        }
	}
    return 0;
}


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

int main() {

    int n;
    std::cin >> n;
    std::vector<int> p(n);
    for (auto& v : p)std::cin >> v;
    int ans = 0;
    for (int i = 0; i < n - 2; ++i) {
        int m = std::min(p[i], p[i + 2]);
        int M = std::max(p[i], p[i + 2]);
        if (m < p[i + 1] && p[i + 1] < M)++ans;
    }
    std::cout << ans << std::endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <functional>

using namespace std;
typedef long long int ll;
typedef pair <int,int> P;

int main()
{
	int R,G,B,N;
	scanf("%d %d %d %d",&R,&G,&B,&N);
	int ret=0;
	for(int r=0;r*R<=N;r++)
	{
		for(int g=0;g*G<=N;g++)
		{
			if(r*R+g*G<=N&&(N-r*R-g*G)%B==0)
			{
				ret++;
			}
		}
	}
	printf("%d\n",ret);
	return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
#define   ll          long long int
#define   sz          200010
#define   sc(a)       scanf("%lld",&a)
#define   sc2(a,b)    scanf("%lld %lld",&a,&b)
#define   py          printf("Yes\n")
#define   pn          printf("No\n")
using namespace std;


int main()
{


    string s;
    ll n,i,j;
    ll d='M';

    cin>>n>>s;

    for(i=0; i<s.length(); i++)
    {
        j=s[i];
        j+=n;
        if(j>90)
        {
            j%=90;
            j+=64;
        }
        char ch=j;

        cout<<ch;
    }
    cout<<endl;


    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i, n) for(int i=0;i<(n);++i)
#define per(i, n) for(int i=(n)-1;i>=0;--i)
#define repa(i, n) for(int i=1;i<(n);++i)
#define foreach(i, n) for(auto &i:(n))
#define pii pair<int, int>
#define pll pair<long long, long long>
#define all(x) (x).begin(), (x).end()
#define bit(x) (1ll << (x))
using ll = long long;
//const ll MOD = (ll)1e9+7;
const ll MOD = 998244353;
const int INF = (ll)1e9+7;
const ll INFLL = (ll)1e18;
using namespace std;
template<class t>
using vvector = vector<vector<t>>;
template<class t>
using vvvector = vector<vector<vector<t>>>;
template<class t>
using priority_queuer = priority_queue<t, vector<t>, greater<t>>;
template<class t, class u> bool chmax(t &a, u b){if(a<b){a=b;return true;}return false;}
template<class t, class u> bool chmin(t &a, u b){if(a>b){a=b;return true;}return false;}

#ifdef DEBUG
#define OUTPUT(x) (output(x), output("\n"))
#else
#define OUTPUT(x) (void)0
#endif

ll modpow(ll x, ll b){
	ll res = 1;
	while(b){
		if(b&1)res = res * x % MOD;
		x = x * x % MOD;
		b>>=1;
	}
	return res;
}

ll modinv(ll x){
	return modpow(x, MOD-2);
}

bool was_output = false;
template<class t>
void output(t a){
	if(was_output)cout << " ";
	cout << a;
	was_output = true;
}
void outendl(){
	was_output = false;
	cout << endl;
}

int main(){
	ll ans = 0;
	ll sum = 0;
	int n;
	cin >> n;
	rep(i, n){
		ll a, b;
		cin >> a >> b;
		ans += b;
		sum += a * b;
	}
	--ans;
	cout << ans + (sum-1) / 9 << endl;
	return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
typedef  unsigned long long int ull;
typedef pair<ll,ll> P;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
//const ll mod=998244353;
const ll mod=1000000007;
//ios_base::sync_with_stdio(false);
//cin.tie(NULL);
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
V<string> s;
int h,w;
V<int> dx={-1,0,1,0},dy={0,-1,0,1};
int main(){
  cin>>h>>w;  
  s.resize(h);
  for(int i=0;i<h;i++)cin>>s[i];
  int ans=0;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
        if(s[i][j]=='#')continue;
                queue<P> q;
                q.push(P(i,j));
                V<V<int>> used(h,V<int>(w,1e5));
                used[i][j]=0;
                while(!q.empty()){
                    P now=q.front();
                    q.pop();
                    for(int r=0;r<4;r++){
                        int nx=now.fi+dx[r],ny=now.se+dy[r];
                        if(nx<0||nx>=h||ny<0||ny>=w)continue;
                        if(s[nx][ny]=='#')continue;
                        if(used[nx][ny]>used[now.fi][now.se]+1){
                        used[nx][ny]=used[now.fi][now.se]+1;
                        q.push(P(nx,ny));
                        }
                    }
                }
for(int k=0;k<h;k++)for(int d=0;d<w;d++)if(used[k][d]!=1e5)chmax(ans,used[k][d]);
            }
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
    int k;
    while(cin>>k){
    int a,b,c;
    int gcd=0;
    for(a=1;a<=k;a++){
            for(b=a+1;b<=k;b++){
                    for(c=b+1;c<=k;c++){
                       int s=0;
                       for(int i=1;i<=a;i++){
                       if(a%i==0 && b%i==0 && c%i==0){
                       if(s<i){
                           s=i;
                          }
                        }
                       }
                      gcd=gcd+(s*6);
                    }
            }
    }
    for(a=1,b=a,c=a;a<=k;a++){
                       int s=0;
                       for(int i=1;i<=a;i++){
                       if(a%i==0){
                       if(s<i){
                           s=i;
                          }
                        }
                       }
                      gcd=gcd+(s);
    }
    for(a=1,b=a;a<=k;a++){
                    for(c=1;c<=k;c++){
                       if(c==a){
                        continue;
                       }
                       int s=0;
                       int x=min(a,c);
                       for(int i=1;i<=x;i++){
                       if(a%i==0 && c%i==0){
                       if(s<i){
                           s=i;
                          }
                        }
                       }
                      gcd=gcd+(s);
                    }
    }
    for(a=1,c=a;a<=k;a++){
                    for(b=1;b<=k;b++){
                       if(b==a){
                        continue;
                       }
                       int s=0;
                       int x=min(a,b);
                       for(int i=1;i<=x;i++){
                       if(a%i==0 && b%i==0){
                       if(s<i){
                           s=i;
                          }
                        }
                       }
                      gcd=gcd+(s);
                    }
    }
    for(b=1,c=a;b<=k;b++){
                    for(a=1;a<=k;a++){
                       if(a==b){
                        continue;
                       }
                       int s=0;
                       int x=min(a,b);
                       for(int i=1;i<=x;i++){
                       if(a%i==0 && b%i==0){
                       if(s<i){
                           s=i;
                          }
                        }
                       }
                      gcd=gcd+(s);
                    }
    }
    cout<<gcd<<endl;
    }
}


Measured memory_bytes: 3632
module Main where

import Data.Functor

main :: IO ()
main = do
  { [a,b,c] <- getInts
  ; print (sum [ 1 | x <- [a .. b], mod c x == 0])
  } 

getInts :: IO [Int]
getInts = map read . words <$> getLine

putInts :: [Int] -> IO ()
putInts = putStrLn . unwords . map show

done :: IO ()
done = return ()

Measured memory_bytes: 4116
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>

using namespace std;


int main(){

	int table[30];

	for(int i = 0; i <= 29; i++)table[i] = pow(2,i);

	int N;

	scanf("%d",&N);

	int current,goal,count;

	for(int loop = 0; loop < N; loop++){
		scanf("%d %d",&current,&goal);
		count = 0;

		while(current != goal){
			count++;
			for(int i = 29; i >= 0; i--){
				if(current%table[i] == 0 && current + table[i] <= goal){
					current += table[i];
					break;
				}
			}
		}
		printf("%d\n",count);
	}

	return 0;
}

Measured memory_bytes: 2952
/**
 *    author: yuhongtao
**/
#include<iostream>
#include<string>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<deque>
#include<cstdlib>
#include<cstring>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<stack>
#include<iomanip>
#include<sstream>
using namespace std;
#define pi acos(-1.0) 
#define ms(x,n) memset(x,n,sizeof(x));
#define pb push_back
#define fi first
#define se second
typedef long long ll;//string::npos
typedef long long iint;
ll gcd(ll a,ll b){ return a%b==0?b:gcd(b,a%b); }
const int inf=2147483647;
const int maxn=2e5+5;
const int mod=1e9+7;//greater<ll>//小根堆 
//priority_queue<ll,vector<ll>,less<ll> > q;
//vector<int> vt[205];
//pair<int,int> p,tmp;
//map<int,int> m;
int main(){
	ios::sync_with_stdio(false);
	int n;
	cin>>n;
	if(n%10==3){
		cout<<"bon\n";
	}else if(n%10==0||n%10==1||n%10==6||n%10==8){
		cout<<"pon\n";
	}else{
		cout<<"hon\n";
	}
	
}

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

// macro
#define rep(i,n) for(i=0;i<n;i++)
#define ll long long
#define all(v) v.begin(), v.end()

// code starts
  
int main()
{
  int i;
  int k;cin>>k;
  vector<int> act_i(k);
  vector<int> act_n(k);
  rep(i,k)
  {
    string s;cin>>s;
    if(s=="mamoru")act_i[i]=0;
    if(s=="tameru")act_i[i]=1;
    if(s=="kougekida")act_i[i]=2;
  }
  rep(i,k)
  {
    string s;cin>>s;
    if(s=="mamoru")act_n[i]=0;
    if(s=="tameru")act_n[i]=1;
    if(s=="kougekida")act_n[i]=2;
  }
  int turn=0;
  int pow_i=0;
  int pow_n=0;
  int judge=-1;
  while(turn<k)
  {
    bool guard_i=false;
    bool atk_i=false;
    if(act_i[turn]==0)
    {
      guard_i=true;
    }
    if(act_i[turn]==1)
    {
      pow_i=min(pow_i+1,5);
    }
    if(act_i[turn]==2)
    {
      atk_i=true;
    }
    bool guard_n=false;
    bool atk_n=false;
    if(act_n[turn]==0)
    {
      guard_n=true;
    }
    if(act_n[turn]==1)
    {
      pow_n=min(pow_n+1,5);
    }
    if(act_n[turn]==2)
    {
      atk_n=true;
    }
    if(atk_i&&atk_n)
    {
      if(pow_i!=0&&pow_n!=0)
      {
        if(pow_i>pow_n)
        {
          judge=0;
          break;
        }
        else if(pow_i<pow_n)
        {
          judge=1;
          break;
        }
        else
        {
          pow_i=0;
          pow_n=0;
        }
        
      }
      else if(pow_i+pow_n>0)
      {
        if(pow_i>0)
        {
          judge=0;
          break;
        }
        else
        {
          judge=1;
          break;
        }
      }
    }
    else if(atk_i&&guard_n)
    {
      if(pow_i==5)
      {
        judge=0;
        break;
      }
      else if(pow_i==0)
      {
        judge=1;
        break;
      }
      else
      {
        pow_i=0;
      }
    }
    else if(atk_n&&guard_i)
    {
      if(pow_n==5)
      {
        judge=1;
        break;
      }
      else if(pow_n==0)
      {
        judge=0;
        break;
      }
      else
      {
        pow_n=0;
      }
      
    }
    else if(atk_i)
    {
      if(pow_i>0)
      {
        judge=0;
        break;
      }
      else
      {
        judge=1;
        break;
      }
      
    }
    else if(atk_n)
    {
      if(pow_n>0)
      {
        judge=1;
        break;
      }
      else
      {
        judge=0;
        break;
      }
      
    }
    turn++;
  }
  if(judge==0)
  {
    cout<<"Isono-kun"<<endl;
  }
  else if(judge==1)
  {
    cout<<"Nakajima-kun"<<endl;
  }
  else
  {
    cout<<"Hikiwake-kun"<<endl;
  }
  
}



Measured memory_bytes: 3208
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
const long long INF = numeric_limits<long long>::max();
typedef long long ll;
int main(void)
{
    int n, m;
    int total = 0;
    cin >> n >> m;
    vector<int> a(n);
    rep(i,n){
        cin >> a[i];
        total += a[i];
    }
    int cnt = 0;
    rep(i,n){
        if ( ((total + (4*m -1)) /(4*m)) <= a[i]) cnt++;
    }
    if (cnt >= m) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
L = [0]*26
N = int(input())
S = input()

MOD = 10**9+7

for i in range(N):
    temp = ord(S[i]) - ord("a")
    L[temp] += 1

ans = 1
for a in L:
    if a:
        ans *= (a+1)
        ans %= MOD

print(ans-1)

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

signed main() {
  string S; cin >> S;
  int ans = 0;
  rep(i, 3) if(S[i] == 'R') ans++;
  if(ans == 2 && S[1] == 'S') ans--;
  cout << ans << endl;

}


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

int main() {
    string s;
    cin >> s;
    int n = s.size();
    int A = 0;
    int B = 0;
    rep(i,n) {
        if(s[i]-'0' != i%2) A++;
        else B++;
    }
    int ans = min(A, B);
    cout << ans << endl;
    return 0;
}   

Measured memory_bytes: 3756
#include<stdio.h>

int main(){
  int N,H[1000000];
  scanf("%d",&N);
  for (int j=0;j<N;j++){
  scanf("%d",&H[j]);
  }


  H[0]-=1;
  for(int i=1;i<N;i++){
  
    if(H[i-1] <= H[i]-1){
      H[i] -=1;
    }else if(H[i-1] <= H[i])
	     H[i]=H[i];     
	     else{
	       printf("No\n");
	       return 0;
	     }	     
  } 
  
  printf("Yes\n");
  return 0;
}

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

int main(){
    int h, m, s;
    cin >> s;
    
    h = s / 3600; s %= 3600;
    m = s / 60; s %= 60;
    cout << h << ":" << m << ":" << s << endl;
    
    return 0;
}

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

int main() {
    int k, x;
    cin >> k >> x;
    int left = x - k + 1, right = x + k - 1;
    for(int i = left; i < right; i++)
        cout << i << " ";
    cout << right << endl;
    return 0;
}


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

int main() {
    string S;
    cin >> S;
    S.insert(S.begin(), ' ');
    S.insert(S.end(), ' ');
    int N = S.size();

    vector<int> ans(N);
    for (int i = 1, cnt = 0; i < N; i++) {
        if (S.at(i) == 'R') cnt++;
        else ans.at(i) += cnt / 2, ans.at(i - 1) += cnt - cnt / 2, cnt = 0;
    }
    for (int i = N - 2, cnt = 0; i >= 0; i--) {
        if (S.at(i) == 'L') cnt++;
        else ans.at(i) += cnt / 2, ans.at(i + 1) += cnt - cnt / 2, cnt = 0;
    }

    ans.at(1) += ans.at(0);
    ans.at(N - 2) += ans.at(N - 1);
    for (int i = 1; i < N - 1; i++) cout << ans.at(i) << "\n";
}

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

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <iterator>
#include <map>
#include <queue>
#define mp make_pair
#define pb push_back
#define p push
#define FOR(a,c) for(int a = 0;a<c;a++)
#define ll long long
#define abs(x) (x<0 ? (-x) : x)
#define getI(a) scanf("%d",&a)
#define getII(a,b) scanf("%d %d",&a,&b)
#define getIII(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define getL(a) scanf("%lld",&a)
#define getLL(a,b) scanf("%lld %lld",&a,&b)
#define getLLL(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define BEND(c) (c).begin(),(c).end()
#define fi first
#define se second
#define PI 3.1415926535897932384626
#define getS(a) scanf("%s",a)
#define pfi(a) printf("%d",a);
#define pfii(a,b) printf("%d%d",a,b);
#define pfl(a) printf("%lld",a);
#define pfll(a,b) printf("%lld%lld",a,b);
#define SIZE 1000000007

using namespace std;

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvl;
typedef vector<long long> vl;
typedef vector<pair<int,int>> vpi;
typedef vector<pair<long long,long long>> vpl;
typedef vector<vector<pair<long long,long long>>> vvpl;
typedef pair<int,int> pii;
typedef pair <ll,ll> pll;
const  double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MX = 200005;
/*ios_base::sync_with_stdio(false);cin.tie(0);*/

ll gcd(ll n,ll m){
    if (n==0)return m;
    return gcd(m%n,n) ;
}





int main(){
    ll n,k,q;
    cin >>n>>k>>q;
    ll cur;
    map <int,int> mm;
    for (int i = 0; i <q ; ++i) {
        cin >>cur;
        mm[cur]++;
    }
    for (int j = 1; j <=n ; ++j) {
        if((mm[j] + k - q)>0 )cout <<"Yes\n";
        else cout << "No\n";
    }
    return 0;
}

Measured memory_bytes: 5376
n = gets.chomp!.to_i
hs = gets.split(" ").map(&:to_i)

as = Array.new
#maxcount= 0
count = 0
for i in 0..n-2 do
  #count は回答を格納する変数

#while i <= n-2
    #print("hs[i]=#{hs[i]}, hs[i+1]=#{hs[i+1]}\n")
    if hs[i] >= hs[i+1]
      count += 1
    else
      as << count
      count = 0
      #break
    end
    #i+=1
  #end
  #p count
=begin
  if count > maxcount
  maxcount = count
  end
=end
end
as << count
p as.max
#p maxcount

Measured memory_bytes: 8964
#include <algorithm>
#include <array>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <iostream>
#include <vector>

using namespace std;

int depth(int64_t n)
{
    // inclusive
    int64_t left = 0;
    // exclusive
    int64_t right = 2;

    int depth = 0;
    int64_t diff = 2;

    while (!(left <= n && n < right))
    {
        if (depth % 2 == 0)
        {
            left -= diff;
        }
        else
        {
            right += diff;
        }
        diff *= 2;
        depth++;
    }
    return depth;
}

int64_t powi(int64_t base, int64_t index)
{
    int64_t ans = 1;
    for (int i = 0; i < index; i++)
    {
        ans *= base;
    }
    return ans;
}

int main()
{
    int64_t n;
    cin >> n;

    const int d = depth(n);
    vector<int> bits;
    for (int i = d; i >= 0; i--)
    {
        if (n != 0 && depth(n) == i)
        {
            bits.push_back(1);
            n -= powi(-2, i);
        }
        else
        {
            bits.push_back(0);
        }
    }
    for (auto b : bits)
    {
        cout << b;
    }
    cout << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
#define rep(i,n) for(ll i=0;i<n;i++)
#define Graph vector<vector<ll>>
#define INF (ll)(1ll<<60)
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(){
	ll a,b;cin>>a>>b;
	if((a+b)%2){
		cout<<"IMPOSSIBLE"<<endl;
		return 0;
	}
	cout<<(a+b)/2<<endl;
	return 0;
}

Measured memory_bytes: 256
N_0 = input()
N = list(N_0)
m = len(N)
ans = 0


numbers = list(range(1,m))

n = len(numbers)
box = []

for i  in range(2 ** n):
    box_0 = []
    for j in range(n):
        if ((i >> j)&1):
            box_0.append(numbers[j])
            

    box.append(box_0)

box[0]=0

for j in range(len(box)):
    M = list(N_0)
    if j == 0:
        ans+=int(N_0)
    else:
        for k in range(len(box[j])):
            if k ==0:
                M.insert(box[j][k],"+")
            else:
                M.insert(box[j][k]+k,"+")
                
            
                
        ans += eval("".join(M))
            
print("{}".format(ans))

Measured memory_bytes: 3064
//Bismillahir Rahmanir Rahim
#include <bits/stdc++.h>
using namespace std;

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

#define pb       push_back
#define all(x)   begin(x), end(x)
#define sz(x)    (int)(x).size()
#define ff       first
#define ss       second
#define mp       make_pair
#define lb       lower_bound
#define ub       upper_bound
#define tcase()  int t; cin >> t; while(t--)

const int MOD = 1e9 + 7; // 998244353;
const int MX  = 2e5 + 5;
const ll  INF = 1e18;
const ld  PI  = acos((ld) -1);

void setIO(string name = "") {
    ios_base::sync_with_stdio(0); cin.tie(0);
    if(sz(name)){
        freopen((name+".in").c_str(), "r", stdin);
        freopen((name+".out").c_str(), "w", stdout);
    }
}

int main(){

    setIO();

    double a, b;
    cin >> a >> b;

    double i;

    for(i = 1; i <= 125001; i++){
        if(floor(i * 0.08) == a && floor(i / 10) == b) break;
    }

    if(i > 125000) cout << -1;
    else cout << i;
}


Measured memory_bytes: 3856
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <functional>
#include <bitset>
#define DB cerr<<"D"<<endl
#define pb push_back
using namespace std; using ll=long long; using ld=long double; const int INF=1e9; const ll LINF=1e18; const double dINF = 1e18; const ld ldINF = 1e18; const double EPS = 1e-6;
template<typename T, typename U, typename O> void caut(T a, U b, O c){cout<<"("<<a<<","<<b<<","<<c<<") ";}
template<typename T, typename U> void caut(T a, U b){cout<<"("<<a<<","<<b<<") ";}
template<typename T> void caut(T a){cout<<"("<<a<<") ";}
using P=pair<double,int>;
const ll M = 1e9+7;

int main() {
  string s; cin>>s; int n=s.size();
  int a=-2,b=-2;
  for(int i=0;i<n-1;i++) {
    if (s[i]==s[i+1]) {
      a=i,b=i+1;
    }
  }
  for(int i=0;i<n-2;i++) {
    if (s[i]==s[i+2]) {
      a=i, b=i+2;
    }
  }
  cout<<a+1<<" "<<b+1<<endl;
}
// Thank you for making problems and running the contest

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

int main(){
  int a[4],b[4];
  while(cin>>a[0]>>a[1]>>a[2]>>a[3]>>b[0]>>b[1]>>b[2]>>b[3]){
    int ht=0;
    int br=0;
    for(int i=0;i<4;i++){
      for(int j=0;j<4;j++){
	if(a[i]==b[j]&&i==j){
	  ht++;
	  break;
	}
	else if(a[i]==b[j]){
	  br++;
	  break;
	}
      }
    }
    cout<<ht<<" "<<br<<endl;
  }
  return 0;
}

Measured memory_bytes: 1160
# -*- coding: utf-8 -*-

H, W, K = map(int, input().split())

C = []
for i in range(H):
    C.append(input())

ans = 0

for h_ in range(2 ** H):
    h_b = format(h_, '0' + str(H) + 'b')
    for w_ in range(2 ** W):
        w_b = format(w_, '0' + str(W) + 'b')
        
        b_count = 0
        for h in range(H):
            for w in range(W):
                if h_b[h] == "0" and w_b[w] == "0" and C[h][w] == "#":
                    b_count += 1
        if b_count == K:
            ans += 1

print(ans)


Measured memory_bytes: 9072
#include <bits/stdc++.h>
using namespace std;
int main(){
  int i, j, k, m, l;
  int N, K;
  long long x[50], y[50];
  long long x1, x2, y1, y2, cnt;
  long long area = LLONG_MAX;

  cin >> N >> K;

  for(i = 0; i < N; i++)
    cin >> x[i] >> y[i];

  for(i = 0; i < N; i++){
    for(j = 0; j < N; j++){
      for(k = i+1; k < N; k++){
        for(l = j+1; l < N; l++){
          x1 = max(x[i], x[k]);
          x2 = min(x[i], x[k]);
          y1 = max(y[j], y[l]);
          y2 = min(y[j], y[l]);

          cnt = 0;
          for(m = 0; m < N; m++){
            if(x[m] <= x1 && x[m] >= x2 && y[m] <= y1 && y[m] >= y2){
              cnt++;
            }
          } 
          if(cnt >= K && (x1-x2)*(y1-y2) < area)
            area = (x1-x2)*(y1-y2);
        }
      }
    }
  }

  cout << area << endl;

  return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

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

    int moves = 0;
    bool last_fixed = false;

    for (int i = 1; i <= n; i += 1) {
        int num;
        cin >> num;

        if (num != i) {
            last_fixed = false;
        } else if (last_fixed) {
            last_fixed = false;
        } else {
            moves += 1;
            last_fixed = true;
        }
    }

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


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

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

  //sの文字数だけLoopを実行する
  string ans = "";
  rep(i,s.size()) ans += "x";

  cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=1e9+7;
const int INF=1e9;
const ll LINF=(ll)1e18;

int main(){
    string s;
    cin>>s;
    for(int i=0;i<s.size();i++){
        cout<<"x";
    }
    cout<<endl;
}


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

// header area
int seni(int K, vector<int> &tlp){
    int now=1;
    int ans;
    // cout << "K: " << K << endl;
    if(K==0) return 1;
    rep(i, K){
        // cout << "now: " << now << endl;
        ans = tlp[now];
        now = ans;
    }
    // cout << " seni: " << ans << endl;
    return ans;
}

int main(){
    int N; ll K; cin >> N >> K;
    vector<int> tlp(N+1);
    for(int i=1;i<N+1;++i){
        int tmp; cin >> tmp;
        tlp[i]=tmp;
    }

    bool loop = false;
    int time = 0;
    int now = 1;
    int loop_mae=-1;
    int loop_haba=-1;
    vector<int> yoso(N+1, -1);
    while(1){
        // 遷移してその時のタイムスタンプを記録
        // cout << " now: " << now << endl;
        // cout << " time: " << time << endl;
        // cout << " yoso[now]: " << yoso[now] << endl;
        if(yoso[now] != -1){
            loop = true;
            loop_mae = yoso[now];
            loop_haba = time-yoso[now];
            break;
        }else{
            yoso[now] = time;
        }
        now = tlp[now];
        time++;
    }

    // cout << " loop_haba: " << loop_haba << endl;
    // cout << " loop_mae: " << loop_mae << endl;

    int ans=1;
    if(loop_mae > K){   // 普通に遷移してOK
        ans = seni(K, tlp); // K 回遷移した街番号を返す
    }else{
        int nokori = (K-loop_mae)%loop_haba;
        ans = seni(loop_mae+nokori, tlp); // 1からK 回遷移した街番号を返す
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4848
using System;

namespace AtCorder100_A
{
    class Program
    {
        static void Main(string[] args)
        {

            int Input=int.Parse(Console.ReadLine());
            int Output = Input;
            int b = 1;
            for (int i = 0; i < 3 ; i++)
            {
                int a = Input / b;
                switch (a%10)
                {
                    case 1:
                        Output += 8*b;
                        break;
                    case 9:
                        Output -= 8*b;
                        break;
                }
                b *= 10;
            }
            Console.WriteLine(Output);
        }
    }
}


Measured memory_bytes: 13140
from bisect import bisect_left

n, k = map(int, input().split())
x = list(map(int, input().split()))
pos = bisect_left(x, 0)
#print(bisect_left(x, 0))


if n == 1:
	print(abs(x[0]))
elif x[0] >= 0:
	print(x[k - 1])
elif x[-1] <= 0:
	print(-x[-k])
else:
	ans = float("inf")
	if pos + k <= n:
		ans = x[pos + k - 1]
	if x[pos] == 0:
		if pos - k + 1 >= 0:
			ans = min(ans, -x[pos - k + 1])
	else:
		if pos - k >= 0:
			ans = min(ans, -x[pos - k])
	for i in range(max(0, k - pos - 1), min(k - 1, n - pos)):
		#print(i)
		right = x[pos + i]
		left = -x[pos - (k - i - 1)]
		#print(right, left)
		ans = min(ans, 2 * right + left, 2 * left + right)

	print(ans)


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

int main(){
    int N;
    vector<vector<int>> V;
    cin >> N;
    for(int i=0; i<N; i++){
        int a, b;
        cin >> a >> b;
        V.push_back({a, i, 0});
        V.push_back({b, i, 1});
    }
    sort(V.begin(), V.end());
    int64_t ans = 0;
    int num[100000] = {0}, side[2] = {0};
    for(int i=0; i<N; i++){
        ans += V[i][0];
        num[V[i][1]]++;
        side[V[i][2]]++;
    }

    auto ok = [&]{
        return side[0] == 0 || side[1] == 0 || *min_element(num, num+N) == 0;
    };

    if(ok()){
        // nop
    }else{
        int m2 = V[N-2][0], m1 = V[N-1][0], M1 = V[N][0], M2 = V[N+1][0];
        num[V[N-1][1]]--;
        side[V[N-1][2]]--;
        num[V[N][1]]++;
        side[V[N][2]]++;
        if(ok()){
            ans += M1-m1;
        }else{
            ans += min(M2-m1, M1-m2);
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 12972
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
namespace Mylib{
    using namespace std;
    
}
int main(void){
    using namespace std;
    int N;
    cin >> N;
    int Employ[N];
    
    for(int i=0;i<N;i++){
        Employ[i]=0;//初期化ループ
    }
    int tempInt;
    for(int i=0;i<N-1;i++){
        cin >> tempInt;
        Employ[tempInt-1]++;
        
    }
    for(int x:Employ)cout << x << endl;
    
    return 0;
}

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

int main() {
    unsigned int n;
    cin >> n;

    vector<int> b(n-1);
    for(unsigned int i = 0; i < n-1; ++i) {
        cin >> b.at(i);
    }

    vector<int> a(n);
    a.at(0) = b.at(0);
    a.at(n-1) = b.at(n-2);
    for(unsigned int i = 1; i < n-1 ; ++i) {
        a.at(i) = min(b.at(i), b.at(i-1));
    }
    int result = accumulate(a.begin(), a.end(), 0);
    cout << result << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for(int i = int(a); i < int(b); i++)
#define rer(i, a, b) for(int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), (a).end()
#define sz(v) (int)(v).size()
#define pb push_back
#define sec second
#define fst first
#define debug(fmt, ...) Debug(__LINE__, ":", fmt, ##__VA_ARGS__)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<int, pi> ppi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> mat;
typedef complex<double> comp;
void Debug() {cerr << '\n'; }
template<class FIRST, class... REST>void Debug(FIRST arg, REST... rest){
	cerr<<arg<<" ";Debug(rest...);}
template<class T>ostream& operator<<(ostream& out,const vector<T>& v) {
	out<<"[";if(!v.empty()){rep(i,0,sz(v)-1)out<<v[i]<<", ";out<<v.back();}out<<"]";return out;}
template<class S, class T>ostream& operator<<(ostream& out,const pair<S, T>& v){
	out<<"("<<v.first<<", "<<v.second<<")";return out;}
const int MAX_N = 500010;
const int MAX_V = 100010;
const double eps = 1e-6;
const ll mod = 1000000007;
const int inf = (1 << 30) - 1;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;
mt19937 rng; //use it by rng() % mod, shuffle(all(vec), rng)
///////////////////////////////////////////////////////////////////////////////////////////////////

int a, b;

void solve() {
	cin >> a >> b;
	if(a > b) swap(a, b);
	string str;
	while(b--) str += char(a + '0');
	cout << str << "\n";
}

uint32_t rd() {
	uint32_t res;
#ifdef __MINGW32__
	asm volatile("rdrand %0" :"=a"(res) ::"cc");
#else
	res = std::random_device()();
#endif
	return res;
}

int main() {
#ifndef LOCAL
	ios::sync_with_stdio(false);
    cin.tie(0);
#endif
    cout << fixed;
	cout.precision(20);
    cerr << fixed;
	cerr.precision(6);
	rng.seed(rd());
#ifdef LOCAL
	//freopen("in.txt", "wt", stdout); //for tester
	if(!freopen("in.txt", "rt", stdin)) return 1;
#endif	
	solve();
    cerr << "Time: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
	return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
int main() {
  string str, order, p;
  int q, a, b, i;

  cin >> str;
  cin >> q;
  while(q-- > 0) {
	cin >> order >> a >> b;
	string buf;
	if(order == "print") {
	  for(i = a; i <= b; i++) {
		cout << str[i];
	  }
	  cout << endl;
	}
	else if(order == "reverse") {
	  for(i = a; i <= b; i++) {
		buf = str[i] + buf;
	  }
	  str.replace(a, b - a + 1, buf);
	}
	else if(order == "replace") {
	  cin >> p;
	  str.replace(a, b - a + 1, p);
	}
  }
  return 0;
}

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

#define ll long long
#define lp(i,n) for(int i=0; i<n; i++)
#define pb push_back
const long double pi=3.141592654;
#define OSOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;

const ll inf = 1e9 +5, mod = 1e9+7,N = 1e5+5;


int main()
{
    OSOS
	int n;
    cin>>n;
    int arr[n];
    lp(i,n)cin>>arr[i];
    int dp[n];
    dp[0] = 0;
    dp[1] = abs(arr[1] - arr[0]);
    for(int i=2; i<n; i++)
    {
    	ll o1,o2;
    	o1 = dp[i-2]+abs(arr[i-2]-arr[i]);
    	o2 = dp[i-1]+abs(arr[i-1]-arr[i]);
    	dp[i] = min(o1,o2);
    }
    cout<<dp[n-1];
}



Measured memory_bytes: 1024
n, k = map(int, input().split())
p = 10**9+7

ans = 0

for i in range(k, n+2):
    M = i * (2*n+1-i) // 2
    m = i * (i-1) // 2
    ans += (M - m + 1) % p

print(ans % p)


Measured memory_bytes: 9176
/*|In The Name Of Allah|*/

#include <bits/stdc++.h>

using namespace std;

const int N = 1e5+5;

const int mod = 1e9+7;

string s;
long long ans;
long long p2[N];
long long p3[N];

int main(){
    p2[0] = p3[0] = 1;
    for(int i = 1; i < N; i++){
        p2[i] = p2[i - 1] * 2;
        p3[i] = p3[i - 1] * 3;
        p2[i] %= mod;
        p3[i] %= mod;
    }
    int cnt1 = 0;
    cin >> s;
    for(int i = 0; i < s.size(); i++){
        if(s[i] == '1'){
            ans += (p2[cnt1] * p3[s.size() - i - 1]) % mod;
            ans %= mod;
            cnt1++;
        }
    }
    ans += p2[cnt1];
    ans %= mod;
    cout << ans << endl;
}


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

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

const int N = 2e5 + 5;

map <string, int> mp;
vector <string> vec[N];

int main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		string s;
		cin >> s;
		mp[s]++;
	}
	for (auto e : mp) {
		string s = e.first;
		vec[e.second].push_back(s);
	}
	for (int i = N - 1; i; i--) {
		if(vec[i].size() >= 1) {
			sort(vec[i].begin(), vec[i].end());
			for (auto s : vec[i])
				cout << s << "\n";
			return 0;
		}
	}
}

Measured memory_bytes: 30320
#include <cstdio>
#include <cstring>
#include <cmath>
#include <vector>
#include <list>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <iostream>
#include <sstream>
using namespace std;

typedef long long int64;

int dfs(int v, vector<vector<int> > &g, vector<bool> &visit)
{
	visit[v] = true;
	
	int ret = 1;
	
	for(int i = 0; i < g[v].size(); ++i) {
		
		int w = g[v][i];
		
		if(visit[w])
			continue;
		
		int len = dfs(w, g, visit);
		ret = max(ret, len + 1);
	}
	
	visit[v] = false;
	
	return ret;
}

int main()
{
	while(true) {
		
		vector<vector<int> > g;
		int n;
		const int nodesize = 100;
		
		scanf("%d", &n);
		if(n == 0)
			break;
		
		g.resize(nodesize);
		for(int i = 0; i < n; ++i) {
			int a, b;
			scanf("%d%d", &a, &b);
			a -= 1, b -= 1;
			g[a].push_back(b);
			g[b].push_back(a);
		}
		
		vector<bool> visit;
		visit.resize(nodesize);
		
		int ans = 0;
		
		for(int i = 0; i < nodesize; ++i) {
			int len = dfs(i, g, visit);
			ans = max(ans, len);
		}
		
		printf("%d\n", ans);
	}
	
	return 0;
}

/* はやく人権を獲得したい */
/* nullmineralが書きましたが */
/* 責任はまったくとりません */

Measured memory_bytes: 1224
#include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<n; ++i)
#define rep1(i, n) for (int i=1; i<=n; ++i)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
constexpr ll  MOD = (1e9+7);
constexpr int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
constexpr int lcm(int a, int b) { return a / gcd(a, b) * b; }

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;
}
ll factorial(ll n, ll m=2) {
    // calculate n!
    m = max(2LL, m);
    ll rtn = 1;
    for (ll i=m; i<=n; i++) {
        rtn = (rtn * i) % MOD;
    }
    return rtn;
}
ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b;
        swap(a, b);
        u -= t * v;
        swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
ll modpow(ll a, ll n) {
    ll res = 1;
    while (n > 0) {
        if (n & 1)
            res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}

template <class Abel> struct BIT {
    const Abel UNITY_SUM = 0;
    vector<Abel> dat;
    /* [1, n] */
    BIT(int n) : dat(n+1, UNITY_SUM) {}
    void init(int n) { dat.assign(n+1, UNITY_SUM); }
    /* a is 1-indexed */
    inline void add(int a, Abel x) {
        for (int i=a; i<(int)dat.size(); i+=i & -i)
            dat[i] = dat[i] + x;
    }
    /* [1, a], a is 1-indexed */
    inline Abel sum(int a) {
        Abel res = UNITY_SUM;
        for (int i=a; i>0; i-=i & -i)
            res = res + dat[i];
        return res;
    }
    /* [a, b), a and b are 1-indexed */
    inline Abel sum(int a, int b) {
        return sum(b-1) - sum(a-1);
    }
};

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll n; cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    vector<ll> cnt(60, 0);
    rep(i, n) {
        rep(j, 60) {
            cnt[j] += (a[i] >> j) % 2;
        }
    }
    ll ans = 0;
    rep(b, 60) {
        ans += (1ll << b) % MOD * cnt[b] % MOD * (n - cnt[b]) % MOD;
        ans %= MOD;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 2560
#include <iostream>
#include <vector>
#include <queue>
#include <utility>
#include <algorithm>
#define ll long long
using namespace std;

ll MX=1e15;

void dijkstra(int start, vector<vector<int>> &g, vector<vector<ll>> &cost, vector<ll> &d){
    priority_queue<pair<ll, int>, vector<pair<ll, int>>, greater<pair<ll, int>>> pq;
    int now=start, cnt=0;
    while(cnt<d.size()-2){
        for(int i=0; i<g[now].size(); ++i){
            if(d[g[now][i]]==MX){
                pq.push(make_pair(d[now]+cost[now][i], g[now][i]));
            }
        }
        while(d[pq.top().second]<MX) pq.pop();
        now=pq.top().second;
        d[now]=pq.top().first;
        pq.pop();
        ++cnt;
    }
}

int main() {
	int n, m, s, t;
	cin >> n >> m >> s >> t;
	vector<vector<int>> graph(n+1);
	vector<vector<ll>> yen(n+1), snuuk(n+1);
	for(int i=0; i<m; ++i){
	    int u, v;
	    ll a, b;
	    cin >> u >> v >> a >> b;
	    graph[u].push_back(v);
	    yen[u].push_back(a);
	    snuuk[u].push_back(b);
	    graph[v].push_back(u);
	    yen[v].push_back(a);
	    snuuk[v].push_back(b);
	}
	vector<ll> d_yen(n+1, MX), d_snuuk(n+1, MX);
	d_yen[s]=0;
	d_snuuk[t]=0;
	dijkstra(s, graph, yen, d_yen);
	dijkstra(t, graph, snuuk, d_snuuk);
	vector<ll> ans(n+1, 0);
	for(int i=n; i>0; --i) ans[i-1]=max(ans[i], MX-(d_yen[i]+d_snuuk[i]));
	for(int i=0; i<n; ++i) cout << ans[i] << endl;
	return 0;
}


Measured memory_bytes: 21556
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

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

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

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

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

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

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

fn main() {
    input! {
        n: usize,
        d: [usize; n]
    }
    let mut d = d;
    d.sort();
    d.dedup();
    println!("{}", d.len());
}


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

char A[111], B[111], C[111];

int main() {
    int N; scanf("%d",&N);
    for(int i=1; i<=N; i++) scanf(" %c",&A[i]);
    for(int i=1; i<=N; i++) scanf(" %c",&B[i]);
    for(int i=1; i<=N; i++) scanf(" %c",&C[i]);
    int ans = 0;
    for(int i=1; i<=N; i++) {
        int c = 0;
        if(A[i] == B[i]) ++c;
        if(B[i] == C[i]) ++c;
        if(C[i] == A[i]) ++c;
        if(c == 1) ans += 1;
        if(c == 0) ans += 2;
    }
    printf("%d", ans);
    return 0;
}


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



int main() {
    int n;
    cin >> n;
    
    vector<int> p1(n), p2;
    rep(i,n) cin >> p1[i];
    
    copy(p1.begin(), p1.end(), back_inserter(p2));
    sort(p2.begin(), p2.end());
    
    int cnt = 0;
    rep(i,n) {
        if(p1[i] != p2[i])
            cnt++;
    }
    
    if(cnt == 2 || cnt == 0)
        cout << "YES" << endl;
    else
        cout << "NO" << endl;
    
    
    
    
    
    return 0;
}


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

int main() {
  int A, B, C, X;
  cin >> A >> B >> C >> X;

  int ans = 0;

  for (int i = 0; i < A + 1; i++) {
    for (int j = 0; j < B + 1; j++) {
      for (int k = 0; k < C + 1; k++) {
        if (500 * i + 100 * j + 50 * k == X) ans++;
      }
    }
  }

  cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define N 200005
using namespace std;
int n;
int head[N],ver[N*2],nxt[N*2],cc[N*2],tot;
void add(int a,int b,int c)
{
    tot++;nxt[tot]=head[a];head[a]=tot;ver[tot]=b;cc[tot]=c;return ;
}
int f[N],size[N];
void dfs(int x,int fa)
{
    int mx=0;size[x]=1;
    for(int i=head[x];i;i=nxt[i])
    {
        if(ver[i]==fa)continue;
        dfs(ver[i],x);
        mx=max(mx,size[ver[i]]);
        size[x]+=size[ver[i]];
    }
    mx=max(mx,n-size[x]);
    f[x]=mx;
}
ll ans;
void dffs(int x,int fa)
{
    size[x]=1;
    for(int i=head[x];i;i=nxt[i])
    {
        if(ver[i]==fa)continue;
        dffs(ver[i],x);
        size[x]+=size[ver[i]];
        ans+=2LL*size[ver[i]]*cc[i];
    }
    return ;
}
int main()
{
    scanf("%d",&n);
    int t1,t2,t3;
    for(int i=1;i<n;i++)
    {
        scanf("%d%d%d",&t1,&t2,&t3);
        add(t1,t2,t3);add(t2,t1,t3);
    }
    dfs(1,-1);
    int mn=0x3f3f3f3f;
    for(int i=1;i<=n;i++)if(f[i]<=mn)mn=f[i];
    t1=t2=0;
    for(int i=1;i<=n;i++)
    {
        if(f[i]==mn)
        {
            if(!t1)t1=i;
            else t2=i;
        }
    }
    memset(size,0,sizeof(size));dffs(t1,-1);
    if(t2)
    {
        for(int i=head[t1];i;i=nxt[i])
        {
            if(ver[i]==t2)ans-=cc[i];
        }
    }
    else
    {
        mn=0x3f3f3f3f;
        for(int i=head[t1];i;i=nxt[i])
        {
            mn=min(mn,cc[i]);
        }
        ans-=mn;
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 10368
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,i,j,s,x,sum,a[1000];
    double avg,y;
    while(cin>>n)
    {
        sum=0;
        s=0;
        for(i=0;i<n;i++)
        {
            cin>>a[i];
            sum+=a[i];


        }
        avg=sum*1.00/n;
        x=int(avg);
        y=avg-x;
        if(y>.50)
        {
            x=x+1;
        }
        for(i=0;i<n;i++)
        {
            if(a[i]>x)
            {
                s+=(a[i]-x)*(a[i]-x);
            }
            else
            s+=(x-a[i])*(x-a[i]);
        }
        cout<<s<<endl;

    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define fo(i,a,b) for(int i=(a);i<(b);i++)
#define MOD 1000000007
#define MP make_pair
#define PB push_back
typedef long long ll;

int R, C;
string g[30][30];


int main () {
        cin >> R >> C;
        fo(i, 0, R) fo(j, 0, C) {
                cin >> g[i][j];
                if (g[i][j] == "snuke") {
                        cout << char('A' + j) << i+1 << endl;
                        return 0;
                }
        }
        return 0;
}


Measured memory_bytes: 256
import numpy as np
import sys

#入力処理、Aは行列、Bはリスト
A = []
for i in range(3):
    A.append([int(a) for a in input().split()])

B = []
for l in sys.stdin:
    if l == '\n':
        break
    l = l.rstrip('\n')
    B.append(int(l))

#穴あきか判定
for i in B:
    A = np.where(A == i, 0, A)
#なんか0番目を判定してくれないから個別に判定
A = np.where(A == B[0], 0, A)

#ビンゴ判定
bingo = False
#ななめ
if A[0][0]+A[1][1]+A[2][2] == 0 or A[0][2]+A[1][1]+A[2][0] == 0:
    bingo = True

for i in range(3):
    #よこ
    if sum(A[i]) == 0:
        bingo = True
        break

    #たて
    if A[0][i]+A[1][i]+A[2][i]==0:
        bingo = True
        break

if bingo:
    print('Yes')
else:
    print('No')



Measured memory_bytes: 12404
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii =  pair<int, int>;
using pll =  pair<long long, long long>;
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007LL;
constexpr long long INF = 1000000000LL;
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
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; }

const int MAX = 2100000;

long long fac[MAX], finv[MAX], inv[MAX];
void COMinit(){
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for(int i = 2; i < MAX; i++){
        fac[i] = fac[i-1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD/i) % MOD;
        finv[i] = finv[i-1] * inv[i] % MOD;
    }
}
long long COM(int n, int k){
    if(n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n-k] % MOD) % MOD;
}

vector<pair<long long, long long> > prime_factorize(long long N) {
    vector<pair<long long, long long> > res;
    for (long long a = 2; a * a <= N; ++a) {
        if (N % a != 0) continue;
        long long ex = 0; // 指数

        // 割れる限り割り続ける
        while (N % a == 0) {
            ++ex;
            N /= a;
        }

        // その結果を push
        res.push_back({a, ex});
    }

    // 最後に残った数について
    if (N != 1) res.push_back({N, 1});
    return res;
}

int main(){
  COMinit();
  ll A, B;
  cin >> A >> B;
  ll n = __gcd(A,B);

  vector<pll> vc = prime_factorize(n);
  
  cout << vc.size() + 1 << ln;
}
  


Measured memory_bytes: 49408