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

#define EQ(a,b) (abs((a)-(b)) < EPS)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define fs first
#define sc second
#define pb push_back
#define sz size()
#define all(a) (a).begin(),(a).end()

using namespace std;
typedef double D;
typedef complex<D> P;
typedef pair<P,P> L;

const D EPS = 1e-8;
const D PI = acos(-1);
//for vector
inline D dot(P x, P y){return real(conj(x)*y);}
inline D cross(P x, P y){return imag(conj(x)*y);}

//rotate a point counter-clockwise on the origin
inline P rotate(P v, D s){
  return P(real(v)*cos(s) - imag(v)*sin(s), real(v)*sin(s) + imag(v)*cos(s) );
}

inline int ccw(P a,P b,P c){
  b -= a;c -= a;
  if (cross(b,c)>EPS) return 1;   //counter clockwise
  if (cross(b,c)<-EPS) return -1; //clockwise
  if (dot(b, c)<-EPS) return 2;   //c--a--b on line
  if (abs(b)+EPS<abs(c)) return -2;   //a--b--c on line
  return 0;                       //on segment
}

inline bool is_cp(L a,L b){
  if(ccw(a.fs,a.sc,b.fs)*ccw(a.fs,a.sc,b.sc)<=0)
    if(ccw(b.fs,b.sc,a.fs)*ccw(b.fs,b.sc,a.sc)<=0)return true;
  return false;
}

inline D seg_p_dis(L a,P x){
  if(dot(a.sc-a.fs,x-a.fs)<EPS)return abs(x-a.fs);
  if(dot(a.fs-a.sc,x-a.sc)<EPS)return abs(x-a.sc);
  return abs(cross(a.sc-a.fs,x-a.fs))/abs(a.sc-a.fs);
}

inline D seg_seg_dis(L a,L b){
  D res = 1e10;
  res = min(res,seg_p_dis(a,b.fs));
  res = min(res,seg_p_dis(a,b.sc));
  res = min(res,seg_p_dis(b,a.fs));
  res = min(res,seg_p_dis(b,a.sc));
  return res;
}

D g[111][111],d[111];
L stars[111][5];
P v[5],c,p;
int n,m,l,x,y,a,r;
bool use[111];

int main(){
  while(scanf("%d%d%d",&n,&m,&l), n){
    for(int i=0;i<n;i++){
      scanf("%d%d%d%d",&x,&y,&a,&r);
      c = P(x,y), p = P(0,r);
      for(int j=0;j<5;j++)v[j] = c+rotate(p,PI*(a+j*72)/180);
      for(int j=0;j<5;j++)stars[i][j] = L(v[j],v[(j+2)%5]);
    }

    for(int i=0;i<n;i++){
      for(int j=i+1;j<n;j++){
	D dis = 1e9;
	for(L a : stars[i]){
	  for(L b : stars[j]){
	    if(is_cp(a,b)){
	      dis = 0;
	      break;
	    }else dis = min(dis, seg_seg_dis(a,b));
	  }
	}
	g[i][j] = g[j][i] = dis;
      }
      g[i][i] = 0;
    }

    for(int i=0;i<n;i++)d[i] = 1e9;
    d[m-1] = 0;
    memset(use,0,sizeof(use));

    for(;;){
      int v = -1;
      for(int u=0;u<n;u++){
	if(!use[u] && (v<0 || d[v] > d[u]))v = u;
      }

      if(v<0 || v==l-1)break;
      use[v] = 1;

      for(int u=0;u<n;u++){
	d[u] = min(d[u],d[v]+g[u][v]);
      }
    }

    printf("%.9lf\n",d[l-1]);
  }
}	

Measured memory_bytes: 1340
#include <stdio.h>
#include <stdlib.h>
typedef long long ll;
#define rep(i,a,b,c) for(ll i=(a);i<(b);i+=(c))
int up(const void *a, const void *b){return *(ll*)a-*(ll*)b;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),up);}


int main(void){
    ll N;
    scanf("%lld",&N);
    ll a[N+5];
    rep(i,0,N,1){
        scanf("%lld",&a[i]);
    }
    sortup(a,N);
    ll low=1,high=1;
    rep(i,0,N,1){
        if(a[i]<400&&400<=a[i+1]){low++;high=low;}
        else if(a[i]<800&&800<=a[i+1]){low++;high=low;}
        else if(a[i]<1200&&1200<=a[i+1]){low++;high=low;}
        else if(a[i]<1600&&1600<=a[i+1]){low++;high=low;}
        else if(a[i]<2000&&2000<=a[i+1]){low++;high=low;}
        else if(a[i]<2400&&2400<=a[i+1]){low++;high=low;}
        else if(a[i]<2800&&2800<=a[i+1]){low++;high=low;}
        else if(a[i]<3200&&3200<=a[i+1]){high=low+(N-i-1);}
        else if(3200<=a[0]){
            low=1;
            high=N;
        }
    }
    printf("%lld %lld\n",low,high);
    return 0;
}

Measured memory_bytes: 1716
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0130

"""
import sys
from sys import stdin
input = stdin.readline
from collections import deque


def bfs(u, result, out_edge, in_degree, processed):
    # ?????????????????????????????¨??????????????¢??°
    q = deque()
    q.append(u)
    processed[u] = True
    while q:
        u = q.popleft()
        result.append(u)
        for e in out_edge[u]:
            in_degree[e] -= 1   #  ?????¨?????????????????????(u)?????????????????¨???u?????\?¶????(e)????????\????¬???°???1???????????¨?????????
            if in_degree[e] == 0 and processed[e] == False: #  ??\????¬???°???1??????????????????0???????????°??????????????????????¬??????????????£??????????
                processed[e] = True
                q.append(e)


def solve(V, in_degree, out_edge):
    # ????????????????????????????????????????????????
    result = []
    processed = [False for _ in range(V)] #  ???????????????????????????????????????????????°
    for i, u in enumerate(in_degree):
        if u == 0 and processed[i] == False: #  ??\????¬???°???0???????????????
            bfs(i, result, out_edge, in_degree, processed)
    return result


def decode_txt(S):
    # ??\????????????????????????????§£???????????¨???????????±??¨?????´?????????????????±?????????
    es = set()
    cars = set()                #  ??????(?????????)?????°
    l = len(S)

    # ???????????????l -> ??? <- ?????¨???????????±?????????
    for i in range(l):
        if not 'a' <= S[i] <='z':
            continue
        s = S[i]
        try:
            t = S[i+3]
        except IndexError:
            break
        cars.add(s)
        cars.add(t)
        if S[i+1] == '-':
            es.add((s, t))
        else:
            es.add((t, s))
    return es, cars


def main(args):
    n = int(input())
    for _ in range(n):
        S = input().strip()
        if len(S) < 4:
            print(S)
            continue

        es_txt, cars = decode_txt(S)

        V = len(cars)
        num = 0
        mapping = dict()
        for c in cars:
            mapping[c] = num
            num += 1

        rev_mapping = dict(zip(mapping.values(), mapping.keys()))
        es = []
        for s, t in es_txt:
            es.append([mapping[s], mapping[t]])


        in_degree = [0 for _ in range(V)] #  ????????????????????\????¬???°
        out_edge = [[] for _ in range(V)] #  ???????????????????????????(??\?¶?)?????????????????????
        for s, t in es:
            out_edge[s].append(t)
            in_degree[t] += 1

        result = solve(V, in_degree, out_edge)
        txt = [rev_mapping[x] for x in result] #  ??°???????????????????????? (???: 0->'a')
        print(''.join(txt))


if __name__ == '__main__':
    main(sys.argv[1:])

Measured memory_bytes: 8092
#include<iostream>
#include<vector>
#include<algorithm>
#include<complex>
#include<string.h>
#include<string>
using namespace std;
typedef long long int llint;
int main() {
	int h, w;
	string s[100];
	cin >> h >> w;
	for (int i = 0;i < h;i++) {
		cin >> s[i];
	}
	for (int i = 0;i < h;i++) {
		cout << s[i] << endl << s[i] << endl;
	}
	return 0;
}

Measured memory_bytes: 256
N = int(input())
H = list(map(int, input().split()))

buff = [0 for i in range(N)]
c = 0
for i in range(1,N):
    if H[i] <= H[i-1]:
        buff[i] = 1

# print(buff)

ans = 0
c = 0
a = 0
for i in range(N):
    if buff[i]:
        c+= 1
        a += 1
        # print(a, c)
    else:
        ans = max(c, ans)
        c = 0

    ans = max(c, ans)
print(ans)

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

int main() {
  int n, m;
  cin>>n>>m;
  string a[n], b[m];
  for (int i=0; i<n; i++) cin>>a[i];
  for (int i=0; i<m; i++) cin>>b[i];

  for (int i=0; i<=n-m; i++) {
    for (int j=0; j<=n-m; j++) {
      bool flag = true;
      for (int k=0; k<m; k++) {
        for (int l=0; l<m; l++) {
          if (a[i+k][j+l] != b[k][l]) {
            flag = false;
            break;
          }
        }
      }
      if (flag) {
        cout<<"Yes"<<endl;
        return 0;
      }
    }
  }
  cout<<"No"<<endl;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(vec) vec.begin(), vec.end()
#define eb emplace_back
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
constexpr ll INF = (1LL << 30) - 1LL;
constexpr ll LINF = (1LL << 60) - 1LL;
constexpr ll MOD = 1e9 + 7;
template <class T>
void chmin(T &a, T b) { a = min(a, b); }
template <class T>
void chmax(T &a, T b) { a = max(a, b); }
int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    int k, n;
    cin >> k >> n;
    vector<int> a(n);
    int res = INF;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    for (int i = 0; i < n; i++) {
        if (i + 1 == n) {
            chmin(res, k - (k + a[0] - a[i]));
        } else {
            chmin(res, k - (a[i + 1] - a[i]));
        }
    }
    cout << res << endl;
}

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

int main() {
  ll a,b,v,w,t;
  cin >> a >> v >> b >> w >> t;
  if(a < b){
    if(a+v*t >= b+w*t) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  else{
    if(a-v*t <= b-w*t) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define inf 10e17
#define rep(i,n) for(long long i=0; i<n; i++)
#define repr(i,n,m) for(long long i=m; i<n; i++)
#define mod 1000000007
#define sorti(x) sort(x.begin(), x.end())
#define sortd(x) sort(x.begin(), x.end(), std::greater<long long>())
#define debug(x) std::cerr << (x) << std::endl;
#define roll(x) for (auto&& itr : x) { cerr << (itr) << " "; }

template <class T> inline void chmax(T &ans, T t) { if (t > ans) ans = t;}
template <class T> inline void chmin(T &ans, T t) { if (t < ans) ans = t;}

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

  int a;
  cin >> a;
  cout << a + a*a + a * a * a << endl;
}

Measured memory_bytes: 3644
#include <bits/stdc++.h>
#define int long long
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define INF LLONG_MAX/3
#define eps LDBL_EPSILON
#define moder 1000000007
#define pie 3.141592653589793238462643383279
#define P std::pair<int,int>
#define prique priority_queue
using namespace std;
int a,b;
signed main(){
	cin>>a>>b;
	if(a%2&&b%2)cout<<((ll)((b-a)/2%2?1:0)^a)<<endl;
	else if(a%2&&!(b%2))cout<<((ll)((b-a)/2%2?1:0)^a^b)<<endl;
	else if(!(a%2)&&b%2)cout<<(ll)((b-a+1)/2%2?1:0)<<endl;
	else cout<<((ll)((b-a)/2%2?1:0)^b)<<endl;
	return 0;
}

Measured memory_bytes: 256
//Ace
#include<bits/stdc++.h>
using namespace std;
using in = long long;
using str = string;
using pi = pair<in,in>;
using vi = vector<in>;
#define F first
#define S second
#define pb push_back
#define rep(i,k,n) for (in i = k; i < n; ++i)
#define repr(i,k,n) for (in i = k; i >= n; --i)
#define sz(x) (in)x.size()
#define all(x) begin(x), end(x)
const int MOD = 1e9 + 7;
const in N = 1e3+1;
in n, w;
in mx, my;
in dx, dy;
str g[N];
in vis[N][N];
in dist[N][N];

map<pi,in> dir;

in valid(in x, in y){
    return (x>=0&&x<n&&y>=0&&y<w);
}

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

    memset(vis, 0, sizeof(vis));
    rep(i, 0, N)
        rep(j, 0, N)dist[i][j] = INT_MAX;

    rep(i, 0, 5){
        rep(j, 0, 5){
            in dx = abs(i-2);
            in dy = abs(j-2);

            if(dx+dy<=1){
                if(dx+dy!=0)
                    dir[{i-2, j-2}]=0;
            }
            else{
                dir[{i-2, j-2}] = 1;
            }
        }
    }

    cin>>n>>w;
    cin>>mx>>my;
    cin>>dx>>dy;

    rep(i, 0, n)cin>>g[i];

    priority_queue<pair<in,pi>, vector<pair<in,pi>>, greater<pair<in,pi>>> q;
    q.push({0, {mx-1, my-1}});
    dist[mx-1][my-1]=0;

    while(!q.empty()){
        pair<in,pi> node = q.top();
        q.pop();
        in d = dist[node.S.F][node.S.S];
        vis[node.S.F][node.S.S]=1;
        if(node.S.F == dx-1 && node.S.S == dy-1){
            cout<<d;
            return 0;
        }
        for(auto i:dir){
            in xn = node.S.F + i.F.F;
            in yn = node.S.S + i.F.S;
            if(valid(xn, yn) && vis[xn][yn]==0 && g[xn][yn]=='.'){
                if(dist[xn][yn] > d+i.S){
                    dist[xn][yn] = d+i.S;
                    q.push({dist[xn][yn], {xn, yn}});
                }
            }
        }
    }
    cout<<-1;

    return 0 ;
}

Measured memory_bytes: 20576
#include<iostream>
#include <cstring>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;


const int MAX = 1000000;
const int MOD = 1000000007;

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;
}

int main(){
  int N, M; cin >> N >> M;
  COMinit();
  ll igai = 0;
  for(int i=1; i<=N; i++){
    ll tmp = ((((((COM(N,i)*COM(M, i))%mod*fac[i])%mod*(COM(M-i, N-i)))%mod*fac[N-i])%mod*COM(M-i, N-i))%mod*fac[N-i])%mod;
    if(i%2) igai+=tmp;
    else igai-=tmp;
    if(igai<0) igai+=mod;
    igai%=mod;
  }
  //cout << igai << endl;
  ll all = (((COM(M, N)*fac[N]%mod)*COM(M, N))%mod*fac[N])%mod;
  all-=igai;
  if(all<0) all+=mod; all%=mod;
  cout << all << endl;
}
    

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

#define rep(i,n) for(signed i=0;i<n;++i)
#define int long long
#define str string
#define debg(a) cout<<#a<<":"<<a<<endl;
#define vint vector<signed>
#define all(a) a.begin(),a.end()
#define pb(a) push_back(a)
#define yn(a) cout<<((a)?"Yes":"No")<<endl;
#define YN(a) cout<<((a)?"YES":"NO")<<endl;
#define call(a) for(auto i:(a))cout<<i<<" ";cout<<endl;
#define ENDL printf("\n");
signed main(){
  int n,m;
  cin>>n>>m;
  int res=0,cnt=1;
  rep(i,m)cnt*=2;
  res+=1900*cnt*m;
  res+=(n-m)*100*cnt;
  cout<<res<<endl;
  
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int K,T;
  int dex;
  int maxv = INT_MIN;
  cin >> K >> T;
  while(T--) {
    cin >> dex;
    maxv = max(maxv,dex);
  }
  cout << max(0,2 * maxv - K - 1) << endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include <cmath>
#include <iomanip>

using namespace std;

int main(){
  int d,n;
  cin>>d>>n;
  
  if(n==100) cout<<std::setprecision(7)<<pow(100,d)*101;
  else cout<<std::setprecision(7)<<pow(100,d)*n;
  
  return 0;
}

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

using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(int i=n; i>-1; --i)
#define ALL(a) (a).begin(),(a).end()
#define FILL(a,n,x); REP(i,(n)){ (a)[i]=(x); }
#define CINA(a,n); REP(i,(n)){ cin >> (a)[i]; }
#define FILL2(a,n,m,x); REP(i,(n)){ REP(j,(m)){(a)[i][j]=(x);} }
#define CINA2(a,n,m); REP(i,(n)){ REP(j,(m)){cin >> (a)[i][j];} }
#define Liny "Yes\n"
#define Linn "No\n"
#define LINY "YES\n"
#define LINN "NO\n"

//cout << setfill('0') << right << setw(4) << 12; // "0012"
int keta(ll x){ if(x<10){return 1;} else{return keta(x/10) + 1;}}
int keta_wa(ll x){ if(x<10){return x;} else{return keta_wa(x/10) + x%10;} }
int ctoi(char c){ return ( (c>='0' && c<='9')? c - '0': 0 );}
int __stoi(string s){ return atoi(s.c_str()); }
ll sum(ll a[],ll N){ return accumulate(a,a+N,0LL);}
ll gcd(ll a,ll b){if(a<b)swap(a,b); return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){if(a<b){swap(a,b);} return a/gcd(a,b)*b;}
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;} }
template<class T> bool isIn(T a,vector<T> v){ for(T x:v){ if(a==x){return true;}} return false;}
string strReplace(string s,string target, string replacement){
    if (!target.empty()) {
      std::string::size_type pos = 0;
      while ((pos = s.find(target, pos)) != std::string::npos) {
        s.replace(pos, target.length(), replacement);
        pos += replacement.length();
      }
    }
    return s;
}
const ll MOD = 1e9+7;
#define pii pair<int,int>
#define pll pair<ll,ll>
#define MP make_pair


int main(){
    string s; cin>>s;
    int N = s.size();
    
    int i = 0;
    int j = N-1;
    bool ok = true;
    int ans = 0;
    while(i<j){
        if(s[i]==s[j]){
            ++i;
            --j;
        }else if(s[i]=='x'){
            ++i;
            ++ans;
        }else if(s[j]=='x'){
            --j;
            ++ans;
        }else{
            ok = false;
            break;
        }
    }
    if(ok){
        cout << ans << "\n";
    }else{
        cout << -1 << "\n";
    }
}

Measured memory_bytes: 512
import java.util.Scanner;

public class Main {

	/*
	 * 文字列を分割して回数を数える
	 */
	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);

		String yosou = s.next();
		String kekka = s.next();

		s.close();

		String[] yosou1 = yosou.split("");
		String[] kekka1 = kekka.split("");
		int count = 0;
		for (int i = 0; i < 3; i++) {
			if (yosou1[i].equals(kekka1[i])) {
				count++;
			}
		}
		System.out.println(count);

	}

}


Measured memory_bytes: 23252
#include<iostream>
#include<vector>
#include<cstdio>
#include<string>
#include<cmath>
#include<math.h>
#include<algorithm>
#include<string.h>
#include <iomanip>
#include <sstream>
using namespace std;

int main() {
  int N, M;
  int X, Y;
  int ans = 0;
  string s;

  cin >> N >> M >> X >> Y;

  vector<int> x(N);
  vector<int> y(M);
  for(int i = 0; i < N; i++){
    cin >> x[i];
  }
  for(int i = 0; i < M; i++){
    cin >> y[i];
  }

  sort(x.begin(), x.end());
  sort(y.begin(), y.end());

  int xmax = x[N-1];
  int ymin = y[0];
  // cout << "xmax = " << xmax << endl;
  // cout << "ymin = " << ymin << endl;

  if( xmax < ymin ){
    for(int i = 1; i <= abs(ymin - xmax); i++){
      if(X < (xmax+i) && (xmax+i) < Y){
        ans++;
      }
      // cout << xmax +1 << endl;
    }
  }
  if(ans > 0){
    cout << "No War" << endl;
  }else{
    cout << "War" << endl;
  }

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define endl "\n"

const int timeLimit = 1985;

i64 xor128()
{
  static i64 x = 123456789, y = 362436069, z = 521288629, w = 88675123;
  i64 t = (x ^ (x << 11));
  x = y;
  y = z;
  z = w;
  return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}

i64 D;
i64 c[26];
i64 s[365][26];
vector<i64> ans;

i64 eval(vector<i64> &ans)
{
  i64 score = 0;
  i64 last[26] = {};
  for (i64 i = 0; i < D; i++)
  {
    score += s[i][ans[i]];
    last[ans[i]] = i + 1;
    for (i64 j = 0; j < 26; j++)
      score -= c[j] * (i + 1 - last[j]);
  }
  return score;
}

void solve()
{
  chrono::system_clock::time_point start = chrono::system_clock::now();
  i64 bestScore = -1e18, nowScore = -1e18, loop = 0;
  double C = timeLimit * 100, forceLine;
  i64 currentTime;
  vector<i64> now = ans;
  while ((currentTime = chrono::duration_cast<chrono::microseconds>(chrono::system_clock::now() - start).count() / 1000) < timeLimit)
  {
    i64 t[3] = {xor128() % D, xor128() % 26};
    t[2] = now[t[0]];
    now[t[0]] = t[1];
    i64 score = eval(now);
    forceLine = (timeLimit - currentTime) / C;
    if (bestScore < score)
    {
      ans = now;
      bestScore = score;
    }
    if (nowScore < score || forceLine * 1000 > rand() % 1000)
    {
      nowScore = score;
    }
    else
    {
      now[t[0]] = t[2];
    }
    loop++;
  }
  cerr << "score: " << bestScore + (i64)(1e6) << endl
       << "loop: " << loop << endl;
}

void init()
{
  for (i64 i = 0; i < D; i++)
    ans[i] = xor128() % 26;
}

void input()
{
  cin >> D;
  for (i64 i = 0; i < 26; i++)
    cin >> c[i];
  for (i64 i = 0; i < D; i++)
    for (i64 j = 0; j < 26; j++)
      cin >> s[i][j];
  ans.resize(D);
}

void output()
{
  for (i64 i = 0; i < D; i++)
    cout << ans[i] + 1 << endl;
}

int main()
{
  input();
  init();
  solve();
  output();
  return 0;
}


Measured memory_bytes: 3680
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
#define int long long

signed main() {
  int d, n;
  cin >> d >> n;
  if (n == 100) n++;
  for (int i = 0; i < d; i++) {
    n *= 100;
  }
  cout << n << endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define fs first
#define sc second
#define task "tst"
using namespace std;

const ll N = 1e5 + 9;
const ll mod = 1e9 + 7;
typedef pair<ll,ll> LL;
set<ll> s;
ll n,a[N],i,ans[N];
unordered_map<ll,LL> mp;
int main(){
    //ios_base::sync_with_stdio(0);
    //cin.tie(0), cout.tie(0);
    if (fopen(task".inp", "r")){
        freopen(task".inp", "r", stdin);
        //freopen(task".out", "w", stdout);
    }
    s.insert(0);
    cin>>n;
    for (i = 1;i <= n;i++){
        cin>>a[i]; s.insert(a[i]);
    }
    for (i = n;i > 0;i--){
        mp[a[i]].fs = i;
        mp[a[i]].sc++;
    }
    mp[0].fs = mp[0].sc = 0;
    while(s.size() > 1){
        //cout<<1;
        ll t = *prev(s.end()); s.erase(t);
        ll p = *prev(s.end()),q = t - p;
        ll pos = mp[t].fs;
        //cout<<t<<" "<<pos<<"\n";
        ans[pos] += q*(mp[t].sc);
        mp[p].fs = min(mp[t].fs,mp[p].fs); mp[p].sc += mp[t].sc;
    }
    for (i = 1;i <= n;i++) cout<<ans[i]<<"\n";
}



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

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc1 = new Scanner(System.in);

		int n = sc1.nextInt();

		int[] a = new int[n];

		for (int i = 0 ; i < n ; i++ ) {
			a[i] = sc1.nextInt();
		}

		Arrays.sort(a);

		//rの最大値
		double m = (double)a[n-1] / 2;
		//System.out.println("m=" + m);
		//rの最大値からの差分
		double c;
		//rが最大となるa
		int b = a[0];

		for (int i = 0 ; i < n-1 ; i++ ) {
			double x = m - a[i];
			c = Math.abs(x);
			if (c <= Math.abs(m-b)) {
				b = a[i];
				//System.out.println("c=" + c + ",b=" + b);
			}
		}

		System.out.println(a[n-1] + " " + b);

		sc1.close();

	}


}


Measured memory_bytes: 49928
#define _GLIBCXX_DEBUG//TLEの原因になるので注意！！！！！！！！！！！
#include<cmath>
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
vector<int> arr;
stack<int> st;
queue<int> qu;
queue<pair<int,int> > qu2;
priority_queue<int> pq;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rep2(i,n) for(int i=1; i<=(int)(n); i++)
#define mins(x,y) x=min(x,y)
#define maxs(x,y) x=max(x,y)
typedef set<int> set_t;
typedef set<string> set_g;
typedef complex<double> xy_t;
static const int NIL = -1;
static const int INF = 1000000007;
#define mp make_pair
#define sz(x) int(x.sise())
#define mod 1000000007
#define reps(i,s,n) for(int i = s; i < n; i++)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
deque<int> deq;
#define fi first
#define se second
//#define int long long

//cerrはコメントアウトしなくても通る//ただしTLEを引き起こすことがある

ll N,M,H,W,K,Q,A,B;
string S;
//const ll MOD = 998244353;
const ll MOD = (1e+9) + 7;
//const ll INF = 1LL << 60;
//typedef pair<ll,ll> P;
typedef pair<int, int> P;
bool chmx(int &a, int b) {
	if (b > a) {
		a = b;
		return true;
	}
	return false;
}

bool chmn(int &a, int b) {
	if (b < a) {
		a = b;
		return true;
	}
	return false;
}

int main(){
    double n,m,d;
    cin >> n>> m>> d;
    int nn=n;
    //にぶたん　dp??
    //絶対値　c なる組み合わせは　d　m-1かな
    //m-1の絶対値が存在しえる　期待値の線形性より
    double ans=0;
    //rep(d,nn){
    if(d==0)ans+=1/n;
    else ans+=2*(n-d)/(n*n);
    //}
    ans*=(m-1);
    printf("%.10lf\n",ans);
    return 0;
}



Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>

int compare(const void *a, const void *b) {
    if( *(long long*)a - *(long long*)b < 0 )
        return -1;
    if( *(long long*)a - *(long long*)b > 0 )
        return 1;
    return 0;
}

int main (void)
{
    long long N, K;
    long long h[(int)1e5];
    long long i, min = (int)1e9;

    scanf("%lld %lld", &N, &K);

    for (i = 0; i < N; i++) {
        scanf("%lld", &h[i]);
    }

    qsort(h, N, sizeof(long long), compare);

    for (i = 0; i <= (N - K); i++) {
        if ((h[i + K - 1] - h[i]) < min) min = h[i + K - 1] - h[i];
    }

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

}


Measured memory_bytes: 1788
import scala.io.StdIn.readLine

object Main extends App {
  val s = readLine()
  val len = s.length
  
  val result = (0 to len - 3).map { i =>
    val x = s.take(i + 3).takeRight(3).toInt
    (x - 753).abs
  }.min
  println(result)
}

Measured memory_bytes: 54732
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
#include <deque>
#include <iomanip>
#include <limits>
#include <fstream>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define CLR(mat) memset(mat, 0, sizeof(mat))
typedef long long ll;
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  int a,b,c,d,e,f;
  cin>>a>>b>>c>>d>>e>>f;
  cout<<a+b+c+d-min(a,min(b,min(c,d)))+max(e,f)<<endl;
}


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

int main() {
    int n, k;
    cin >> n >> k;
    int ans = 1;
    while (n>=k) {
        n /= k;
        ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back
#define INF (1e9+1)
//#define INF (1LL<<59)

vector<ll> prime_factorization(ll n){
	vector<ll> ret;
	
	for(ll div=2;div<=1+sqrt(n);div++){
		while(n%div==0){
			ret.pb(div);
			n/=div;
		}
	}
	if(n!=1)ret.pb(n);
	return ret;
}

int main(){
	int n;
	cin>>n;
	cout<<n<<":";
	vector<ll> res = prime_factorization(n);
	
	rep(i,res.size())cout<<" "<<res[i];
	cout<<endl;
}

Measured memory_bytes: 3156
import math

def make_prime_list_2(num):
    if num < 2:
        return []

    # 0のものは素数じゃないとする
    prime_list = [i for i in range(num + 1)]
    prime_list[1] = 0 # 1は素数ではない
    num_sqrt = math.sqrt(num)

    for prime in prime_list:
        if prime == 0:
            continue
        if prime > num_sqrt:
            break

        for non_prime in range(2 * prime, num, prime):
            prime_list[non_prime] = 0

    return [prime for prime in prime_list if prime != 0]

if __name__ == "__main__":
    N = int(input())
    if (N < 105):
        print(0)
    elif (N < 107):
        print(1)
    else:
        c = 1
        for j in range(107, N+1):
            num = j
            num_sqrt = math.floor(math.sqrt(num))
            prime_list = make_prime_list_2(num_sqrt)

            divisor_num = 1
            for prime in prime_list:
                count = 1
                while num % prime == 0:
                    num //= prime
                    count += 1
                divisor_num *= count
            if num != 1:
                divisor_num *= 2

            if divisor_num == 8 and j % 2 == 1:
                c = c + 1

            if j == N:
                print(c)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return 1;
    }
    return 0;
}
typedef long long int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define MOD (1000000007)
#define ALL(v) (v).begin(), (v).end()
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

//-------------------------------------

bool check(string MM)
{ // MMのみしらべればよい
    if (MM[0] == '0')
    {
        if (MM[1] == '0')
        {
            return false;
        }
        return true;
    }
    int tmp = stoi(MM);
    if (tmp > 12)
    {
        return false;
    }
    return true;
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    string front = s.substr(0, 2);
    string back = s.substr(2, 2);
    bool flg1 = check(front);
    bool flg2 = check(back);
    if (flg1)
    {
        if (flg2)
        {
            cout << "AMBIGUOUS" << endl;
        }
        else
        {
            cout << "MMYY" << endl;
        }
    }
    else
    {
        if (flg2)
        {
            cout << "YYMM" << endl;
        }
        else
        {
            cout << "NA" << endl;
        }
    }
}

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

bool comp(pair<int, int> &a, pair<int,int> &b) {
	if (a.first==b.first)
		return a.second > b.second;
	return a.first < b.first;
}

int main() {
	int n,m; cin>>n>>m;
	vector<pair<int,int>> requests(m);
	for (int i=0; i<m; i++)
		cin>>requests[i].first>>requests[i].second;
	sort(requests.begin(),requests.end());

	int ans=0;
	int last=0;
	for (int i=0; i<m; i++) {
		if (requests[i].first >= last) {
			ans++;
			last = requests[i].second;
		}
		if (requests[i].second < last)
			last = requests[i].second;
	}
	cout << ans << endl;
	return 0;
}


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

using ll = long long;
#define ALL(c) (c).begin(), (c).end()
const int MOD = 1000000007;

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

    ll total = 0;
    for (int i = 0; i < n; i++) {
        auto f = lower_bound(ALL(a), b[i]);
        auto s = upper_bound(ALL(c), b[i]);
        total += (ll)(f - a.begin()) * (ll)(c.end() - s);
    }
    cout << total << endl;

}


Measured memory_bytes: 1408
#!/usr/bin/python3
# -*- coding:utf-8 -*-

def main():
  n = int(input())
  Ds = list(map(int, input().strip().split()))
  ans = 0
  for i in range(n):
    for j in range(i+1, n):
      ans += Ds[i] * Ds[j]
  print(ans)
  
  
if __name__=='__main__':
  main()



Measured memory_bytes: 2940
#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
#define mod 1000000007
using namespace std;

void solve()
{
    
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	cout.tie(NULL);
    solve();
    ll x,k,d;
    cin>>x>>k>>d;
    x = abs(x);
    ll moves = min(k, x/d);
    k -= moves;
    x -= moves*d;
    if(k%2==0)
    {
        cout<<x<<'\n';
    }
    else
    {
        cout<<(d-x)<<'\n';
    }
    
}

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

namespace Atc_0033
{
    class Program
    {
        static void Main(string[] args)
        {
            var s = Console.ReadLine();

            int N = int.Parse(s);

            if (N == 1)
            {
                Console.WriteLine("Hello World");
                return;
            }

            int A = int.Parse(Console.ReadLine());
            int B = int.Parse(Console.ReadLine());

            Console.WriteLine(A + B);
        }
    }
}


Measured memory_bytes: 27508
//ARC059-D(アンバランス)
#include<iostream>
#include<string>
using namespace std;

string s;

int main(){
    cin>>s;
    int si=s.size();
    
    char a=s[0];
    char b=s[1];
    if(a==b){
        cout<<"1 2"<<endl;
        return 0;
    }
    for(int i=2; i<s.size(); i++){
        char c=s[i];
        if(a==c){
            cout<<i-1<<" "<<i+1<<endl;
            return 0;
        }else if(b==c){
            cout<<i<<" "<<i+1<<endl;
            return 0;
        }
        a=b;
        b=c;
    }
    cout<<"-1 -1"<<endl;
    return 0;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
#define arep(i,x,n) for(int i=int(x);i<(int)(n);i++)
#define rep(i,n) for(long long i = 0;i < n;++i)
#define rrep(i,n) for(int i=int(n);i>0;i--)
#define fs first
#define sc second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pi 3.141592653589793
#define eps 0.00000001
#define INF 1e9+5  
using ll = long long; 
using P=pair<int,int>;
using lP=pair<ll,ll>;
using fP=pair<double,double>;
using PPI=pair<P,int>;
//ll const mod=998244353;
ll const mod=1e9+7;
const ll MAX=1000005;
using vi=vector<int>;
using vl=vector<ll>;
using vc=vector<char>;
using vd=vector<double>;
using vs=vector<string>;
using vp=vector<P>;
using vb=vector<bool>;
using vvi =vector<vector<int>>;
using vvl =vector<vector<ll>>;
using vvd=vector<vector<double>>;
using vvc=vector<vector<char>>;
using vvp =vector<vector<P>>;
using vvb=vector<vector<bool>>;
template <typename T>
bool chmax(T &a, const T b){if(a < b){a = b; return true;} return false;}
template <typename T>
bool chmin(T &a, const T b){if(a > b){a = b; return true;} return false;}

ll gcd(ll a,ll b){
    if(b==0)return a;
    return gcd(b,a%b);
}
//////////////////////////////////////
int main(){
    int a;
    cin>>a;
    cout<<a+a*a+a*a*a<<endl;
    return 0;
}

Measured memory_bytes: 3636
//#include <tourist>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = 1e9;
const ll LINF = ll(1e18);
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define debug(v)          \
    cout << #v << ":";    \
    for (auto x : v)      \
    {                     \
        cout << x << ' '; \
    }                     \
    cout << endl;
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}
//cout<<fixed<<setprecision(15);有効数字15桁
//-std=c++14
//-std=gnu++17
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
int n, k;
vector<int> a;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n >> k;
    a.resize(n);
    rep(i, n) cin >> a[i];
    rep(i, min(k, 100))
    {
        vector<int> count(n + 1, 0);
        rep(j, n)
        {
            if (j - a[j] < 0)
                count[0]++;
            else
                count[j - a[j]]++;
            if (j + a[j] + 1 > n)
                count[n]--;
            else
                count[j + a[j] + 1]--;
        }
        int sum=0;
        rep(j,n){
            sum+=count[j];
            a[j]=sum;
        }
    }
    rep(i,n)cout<<a[i]<<" ";
    cout<<"\n";
}


Measured memory_bytes: 4908
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(X,Y) ((X)>(Y)?X=(Y),true:false)
#define chmax(X,Y) ((X)<(Y)?X=(Y),true:false)
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}

int main(){
	string s;
	cin>>s;
	bool f = s[0]==s[s.size()-1] ^ s.size()%2==0;
	if(f) cout<<"Second"<<endl;
	else cout<<"First"<<endl;
	return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
// type alias
typedef long long LL;
typedef pair<int,int> II;
typedef tuple<int,int,int> III;
typedef vector<int> VI;
typedef vector<string> VS;
typedef unordered_map<int,int> MAPII;
typedef unordered_set<int> SETI;
template<class T> using VV=vector<vector<T>>;
// minmax
template<class T> inline T SMIN(T& a, const T b) { return a=(a>b)?b:a; }
template<class T> inline T SMAX(T& a, const T b) { return a=(a<b)?b:a; }
// repetition
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define REPE(i,n)  for(int i=0;i<=(n);++i)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  for(int i=0;i<(n);++i)
#define FORR(x,arr) for(auto& x:arr)
#define SZ(a) int((a).size())
// collection
#define ALL(c) (c).begin(),(c).end()
// DP
#define MINUS(dp) memset(dp, -1, sizeof(dp))
#define ZERO(dp) memset(dp, 0, sizeof(dp))
// stdout
#define println(args...) fprintf(stdout, ##args),putchar('\n');
// debug cerr
template<class Iter> void __kumaerrc(Iter begin, Iter end) { for(; begin!=end; ++begin) { cerr<<*begin<<','; } cerr<<endl; }
void __kumaerr(istream_iterator<string> it) { (void)it; cerr<<endl; }
template<typename T, typename... Args> void __kumaerr(istream_iterator<string> it, T a, Args... args) { cerr<<*it<<"="<<a<<", ",__kumaerr(++it, args...); }
template<typename S, typename T> std::ostream& operator<<(std::ostream& _os, const std::pair<S,T>& _p) { return _os<<"{"<<_p.first<<','<<_p.second<<"}"; }
#define __KUMATRACE__ true
#ifdef __KUMATRACE__
#define dump(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); __kumaerr(_it, args); }
#define dumpc(ar) { cerr<<#ar<<": "; FORR(x,(ar)) { cerr << x << ','; } cerr << endl; }
#define dumpC(beg,end) { cerr<<"~"<<#end<<": "; __kumaerrc(beg,end); }
#else
#define dump(args...)
#define dumpc(ar)
#define dumpC(beg,end)
#endif

// $ cp-batch XORWorld | diff XORWorld.out -
// $ g++ -std=c++14 -Wall -O2 -D_GLIBCXX_DEBUG -fsanitize=address XORWorld.cpp && ./a.out

/*
 
 3/16/2019
 
 11:25-
 
 */

LL A,B;

LL f(LL X) {
  if(X<0) return 0;
  LL res=0;
  REP(i,45) {
    LL cy=1LL<<(i+1);
    LL a=(X+1)/cy,b=(X+1)%cy;
    LL pow=(1LL<<i);
    LL p=pow*a+max(0LL,b-pow);
    p%=2;
//    dump(i,a,b,p);
    if(p==1LL) res|=(1LL<<i);
  }
  return res;
}
void solve() {
  LL res=f(A-1)^f(B);
  cout<<res<<endl;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout<<setprecision(12)<<fixed;
  
  cin>>A>>B;
  solve();
  
  return 0;
}


Measured memory_bytes: 256
n = int(input())
height_lst = list(map(int,input().split()))
flag = True

if n==1:
    print('Yes')
else:
    if height_lst[0]==1:
        height1 = 1
    elif height_lst[0]>1:
        height1 = height_lst[0]-1

    for i in range(1,n):
        height = height_lst[i]
        if height==1:
            possible_lst = [1]
        elif height>1:
            possible_lst = [height-1,height]

        if max(possible_lst)<height1:
            flag = False
            break
        else:
            if min(possible_lst)>=height1:
                height1 = min(possible_lst)
            else:
                height1 = max(possible_lst)

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

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

otoshidama=0.0
for i in range(n):
    inp=input().strip().split()
    x=float(inp[0])
    u=inp[1]
    if u=="JPY":
        otoshidama+=x
    elif u=="BTC":
        otoshidama+=x*380000.0
print(otoshidama)


Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define     IOS             ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define     endl            "\n"

using namespace std;
 
int32_t main()
 
{  
   #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
   #endif
    IOS;


    int a[6];
    for(int i=0;i<5;i++)
    	cin>>a[i];
    for(int i=0;i<5;i++){
    	if(a[i] == 0){
    		cout<<i+1;
    		break;
    	}
    }


    
 
}

Measured memory_bytes: 3584
#include<stdio.h>
int main(void)
{
    int n,k,x,y,a;
	scanf("%d %d %d %d",&n,&k,&x,&y);
	if(n<=k){
	    a=n*x;
		printf("%d\n",a);
	}
	else {
		a=k*x+(n-k)*y;
		printf("%d\n",a);
	}
	return 0;
}

Measured memory_bytes: 128
/*
  author: ruruvuvu
  GitHub account: colon-ku

  created at: 2020-01-26 21:10:48
*/

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

#define all(x) (x).begin(),(x).end()
#define rep(x, y) for (int x = 0; x < y; x++)
#define MOD 1000000007

typedef long long LL;
typedef long double LD;

bool compare_by_b(pair<int, int> a, pair<int, int> b)
{
    if (a.second != b.second) {
        return a.second < b.second;
    } else {
        return a.first < b.first;
    }
}

ostringstream oss_global;
string s_global = oss_global.str();

int main()
{
    LL h;
    cin >> h;

    LL a, ans;
    a = (LL)(log2(h));
    ans = pow(2, a+1) - 1;

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


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

int main() {
    int N;
    cin >> N;
    int digit_num = 0, tmp = N;
    while (tmp > 0) {
        digit_num += tmp % 10;
        tmp /= 10;
    }
    cout << (N % digit_num == 0 ? "Yes" : "No") << endl;
    return 0;
} 

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

int main() {
 int a,b,c=0,k,p,q;cin>>a>>b>>k; p=min(a,b); q=max(a,b);
  int s[q];
  
    
  for(int i=p;i>0;i--) {
    if(a%i==0 && b%i==0){
      s[c]=i; c++;
 }
  }
   
  cout<<s[k-1]<<endl;
}




Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define endl "\n"
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define F first
#define S second
#define bitcnt(v) __builtin_popcount(v)
#define all(v) v.begin(), v.end()

int n, m;
vector<vector<int>> graph;
vector<int> dp;

int dfs(int u){
	if(dp[u] != -1) return dp[u];
	int ans = 0;
	for(int v : graph[u]){
		ans = max(ans, 1 + dfs(v));
	}
	return dp[u] = ans;
}

void solution(){
	cin >> n >> m;
	graph = vector<vector<int>>(n);
	dp = vector<int>(n,-1);
	for(int i = 0; i < m; i++){
		int u,v; cin >> u >> v;
		u--, v--;
		graph[u].push_back(v);
	}
	int ans = 0;
	for(int i = 0; i < n; i++){
		if(dp[i] == -1){
			dfs(i);
		}
	}
	cout << *max_element(all(dp)) << endl;
}	


int main(){ 
	fio;
	int t;
	t = 1;
	// cin >> t;
	for(int i = 1; i <= t; i++){
		// cout << "Case #" << i << ": ";
		solution();
	} 
	return 0;
}

Measured memory_bytes: 11064
s = gets.chomp
t = gets.chomp

s_code = s.codepoints
t_code = t.codepoints

s_size = s.size
t_size = t.size

dp = Array.new(t_size + 1) { Array.new(s_size + 1, 0) }

1.upto(t_size) do |i|
  dp_prev = dp[i-1]
  dp_cur = dp[i]
  1.upto(s_size) do |j|
    i_prev = i - 1
    j_prev = j - 1

    dp[i][j] = if t_code[i_prev] == s_code[j_prev]
                 dp_prev[j_prev] + 1
               else
                 dp_prev[j] < dp_cur[j_prev] ? dp_cur[j_prev] : dp_prev[j]
               end
  end
end

result = ""
i = t_size
j = s_size
while 0 < i && 0 < j
  if dp[i - 1][j] == dp[i][j]
    i -= 1
  elsif dp[i][j - 1] == dp[i][j]
    j -= 1
  else
    i -= 1
    j -= 1
    result << s[j]
  end
end

puts result.reverse


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

int main()
{
  string s;
  cin >> s;
  size_t n = s.size();
  int alp[26] = {};
  for (int i = 0; i < n; i++) {
    int j = s[i]-'a';
    alp[j]++;
  }
  
  bool non = true;
  for (int i = 0; i < 26; i++) {
    if (alp[i] == 0) {
      cout << static_cast<char>('a' + i) << endl;
      non = false;
      break;
    }
  }
  if(non)
    cout << "None" << endl;
  return 0;
}


Measured memory_bytes: 512
import java.util.Scanner;
public class Main{
   public static void main(String[]args){
     
   Scanner sc = new Scanner(System.in);
   
    int a = sc.nextInt();
    int b = sc.nextInt(); 

    if( a<=9 &&  b<=9){
      
    System.out.println( a*b);
    } 
     else{
    System.out.println(-1);
       
    }
   }
}

Measured memory_bytes: 22484
N = int(input())
A = []
B = []
for _ in range(N):
    a, b = list(map(int, input().split()))
    A.append(a)
    B.append(b)

if N % 2== 0:
    A.sort()
    med_A = (A[N//2] + A[N//2 - 1])/2
    B.sort()
    med_B = (B[N//2] + B[N//2 - 1])/2
    print(int((med_B-med_A) * 2 + 1))
else:
    A.sort()
    med_A = A[(N-1)//2]
    B.sort()
    med_B = B[(N-1)//2]
    print(int(round(med_B) - round(med_A) + 1))

Measured memory_bytes: 25424
from itertools import permutations

N,M = list(map(int,input().split()))
P=[]
for m in range(M):
    P.append(list(map(int,input().split())))

ad={}
for _ in range(1,N+1):
    ad[_]=set()
    
for p in P:
    ad[p[0]].add(p[1])
    ad[p[1]].add(p[0])

ans=0
for p in permutations(range(2,N+1),N-1):
    ans_flag=True
    start=1
    for p_ in p:
        end=p_
#         print(start,end ,end in ad[start])
        if end not in ad[start]:
#             print('break')
            ans_flag=False
            break
        start=p_
        
    if ans_flag==True:
        ans+=1
        
print(ans)

Measured memory_bytes: 9156
inputs = STDIN.readlines.map{|line|line.strip.split()}
line = inputs.shift

n = line[0].to_i
m = line[1].to_i

d = m.div(n)

while d > 0
    if m % d == 0 then
        puts(d)
        break
    end
    d -= 1
end

Measured memory_bytes: 1788
#pragma GCC compiler("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<int> p[20];
int N,D;
bool controlla(int a,int b){
  int s=0;
  for(int i=0;i<D;i++){
    s+=(p[a][i]-p[b][i])*(p[a][i]-p[b][i]);
  }
  int k=sqrt(s);
  if(k*k==s)return 1;
  return 0;
}
int main(){
  //freopen("input.txt","r",stdin);
  //freopen("output.txt","w",stdout);
  ios_base::sync_with_stdio(0);
  cin>>N>>D;
  for(int i=0;i<N;i++){
    for(int j=0;j<D;j++){
      int a;
      cin>>a;
      p[i].push_back(a);
    }
  }
  int tot=0;
  for(int i=0;i<N;i++){
    for(int j=i+1;j<N;j++){
      tot+=controlla(i,j);
    }
  }
  cout<<tot<<endl;
  return 0;
}


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

using namespace std;

using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using vvvll = vector<vector<vector<ll>>>;
using vvvvll = vector<vector<vector<vector<ll>>>>;
using pl4 = pair<ll,ll>;
using str = string;
using vpl4 = vector<pair<ll,ll>>;

#define sz size()
#define be begin()
#define en end()
#define fi first
#define se second
#define pb push_back
#define mp make_pair

#define llin(x) ll(x);cin >> (x);
#define stin(x) str(x);cin >> (x);
#define vllin(x,n) vll(x)(n);FOR(i,0,n-1){cin >> (x)[i];}
#define vllin2(a,b,n) vll(a)(n);vll(b)(n);FOR(i,0,n-1){cin >> (a)[i] >> (b)[i];}
#define vllin3(a,b,c,n) vll(a)(n);vll(b)(n);vll(c)(n);FOR(i,0,n-1){cin >> (a)[i] >> (b)[i] >> (c)[i];}
#define vlling(x,n) (x).assign(n,0);FOR(i,0,n-1){cin >> (x)[i];}
#define vlling2(a,b,n) (a).assign(n,0);(b).assign(n,0);FOR(i,0,n-1){cin >> (a)[i] >> (b)[i];}
#define vlling3(a,b,c,n) (a).assign(n,0);(b).assign(n,0);(c).assign(n,0);FOR(i,0,n-1){cin >> (a)[i] >> (b)[i] >> (c)[i];}
#define vpl4in(x,n) vpl4(x)((n),mp(0,0));FOR(i,0,n-1){cin >> x[i].fi >> x[i].se;}
#define FOR(i,a,b) for(ll i=a;i<=b;i++)
#define rFOR(i,b,a) for(ll i=a;i>=b;i--)
#define SORT(x) sort(x.be,x.en)
#define rSORT(x) sort(x.rbegin(),x.rend())
#define say(x) cout << (x);
#define sal(x) cout << (x) << endl;
#define says(x) cout << (x) << (' ');
#define sas cout << (' ');
#define sayR(x) cout << fixed << setprecision(10) << (x);
#define salR(x) cout << fixed << setprecision(10) << (x) << endl;
#define yn(a) cout << ((a) ? "yes" : "no") << endl;
#define Yn(a) cout << ((a) ? "Yes" : "No") << endl;
#define YN(a) cout << ((a) ? "YES" : "NO") << endl;
#define Imp(a) cout << ((a) ? "Possible" : "Impossible") << endl;
#define IMP(a) cout << ((a) ? "POSSIBLE" : "IMPOSSIBLE") << endl;

ll MOD = 1000000007;

signed main()
{
    llin(n);
    vllin(h,n);
    ll k=0;
    ll p=0;
    FOR(i,1,n-1){
        if(h[i-1]>=h[i]){
            k++;
            p=max(p,k);
        }else{
            k=0;
        }
    }
    sal(p)
}

Measured memory_bytes: 1024