akhauriyash/Code-Regression huggingface dataset:
import sys
readline = sys.stdin.readline

def main():
    A, B, C, D, E, F = map(int, readline().rstrip().split())
    X = set()
    for a in range(F//(100*A)+1):
        for b in range(F//(100*B)+1):
            if 100 * a * A + 100 * b * B <= F:
                X.add(100 * a * A + 100 * b * B)
    X.remove(0)

    Y = set()
    for c in range(F//C+1):
        for d in range(F//D+1):
            if c * C + d * D <= F/2:
                Y.add((c * C + d * D))

    ans = (0, 0)
    max_dens = -1
    for x in X:
        for y in Y:
            if x + y > F:
                continue
            if y * 100 <= x * E:
                dens = y/(x+y)
                if dens > max_dens:
                    ans = (x+y, y)
                    max_dens = dens
    print(*ans)

if __name__ == '__main__':
    main()

Measured memory_bytes: 3188
#include<stdio.h>
#include<stdlib.h>
#define min(a,b) ((a)<(b)?(a):(b))

int main(){
	int n,i,j;
	int w[100];
	scanf("%d",&n);
	for(i=0;i<n;i++)scanf("%d",&w[i]);
	int sum=0,ans=100000000,sums=0;
	for(i=0;i<n;i++)sum+=w[i];
	for(i=0;i<n;i++){
		sums+=w[i];
		ans=min(ans,abs(sum-sums-sums));
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 128
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int res = Integer.MAX_VALUE;
        int n = sc.nextInt();
        int[] AS = new int[n + 1];
        AS[0] = 0;
        for(int i = 1; i <= n; i++) {
            AS[i] = AS[i-1] +  sc.nextInt();
        }
        for(int i = 1; i < n; i++) res = Math.min(res, Math.abs(2 * AS[i] - AS[n]));
        System.out.println(res);
    }
}


Measured memory_bytes: 23764
import scala.io.StdIn.readLine
import scala.collection.mutable.HashMap

object Main extends App {
  val m = HashMap.empty[Int,Int]
  val m2 = HashMap.empty[Int,Int]
  Iterator.continually(readLine).takeWhile(_!="").foreach { s =>
    val n = s.split(",").map(_.toInt)
    if(m contains n(0)) m(n(0)) += 1 else m += (n(0) -> 1)
  }

  Iterator.continually(readLine).takeWhile(_!=null).foreach { s =>
    val n = s.split(",").map(_.toInt)
    if(m contains n(0)) {
      if(m2 contains n(0)) m2(n(0)) += 1 else m2 += (n(0) -> (m(n(0)) + 1))
    }
  }
  m2.toSeq.sorted.foreach { case (x,y) => println(x + " " + y) }
}

Measured memory_bytes: 44016
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n, a, b, i=0, j=1, bcount=0;
    cin >> n >> a >> b;
    string s;
    cin >> s;
    while(i<n){
        if(s[i] == 'c'){
            cout<<"No"<<endl;
        }
        else if(s[i] == 'a'){
            if(j <= a + b){
                cout<<"Yes"<<endl;
                j++;
            }    
            else
                cout<<"No"<<endl;
        }
        else if(s[i] == 'b'){
            bcount++;
            if(j <= a + b && bcount <= b){
                cout<<"Yes"<<endl;
                j++;
            }    
            else
                cout<<"No"<<endl;    
        }
        i++;
    }
    return 0;
}

Measured memory_bytes: 3732
h,w = map(int,input().split())
s = [list(str(input())) for _ in range(h)]

def plus(x,y):

    if (0 <= x < h) and (0 <= y < w):
        #print(x,y)
        if s[x][y] == '.':
            s[x][y] = 1
        elif s[x][y] != '#':
            s[x][y] += 1

for i in range(h):
    for j in range(w):
        if s[i][j] == '.':
            s[i][j] = 0
        if s[i][j] == "#":
            for k in range(-1,2):
                for l in range(-1,2):
                    plus(i+k,j+l)

for i in s:
    print(*i,sep='')

Measured memory_bytes: 3444
#include<iostream>                                                                 
#include<algorithm>                                                                
                                                                                   
int main(void){                                                                    
  int munt[10] ,i;                                                                 
                                                                                   
  for(i=0;i<10;i++){                                                               
    std::cin >> munt[i];                                                           
  }                                                                                
  std::sort(munt,munt +10);                                                        
  for(i=9;i>6;i--){                                                                
    std::cout << munt[i] << std::endl;                                             
  }                                                                                
                                                                                   
  return 0;                                                                        
}

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

using ll = long long;
using ull = unsigned long long;
using ld = long double;

#define MOD 1000000007LL

#define rep(i, n) for(ll (i) = 0LL;(i) < (ll)(n);(i)++)
#define rep2(i, s, e) for(ll (i) = (ll)(s);(i) < (ll)(e);(i)++)
#define repi(i, n) for(ll (i) = 0LL;(i) <= (ll)(n);(i)++)
#define repi2(i, s, e) for(ll (i) = (ll)(s);(i) <= (ll)(e);(i)++)
#define per(i, n) for(ll (i) = (ll)(n) - 1LL;(i) >= 0LL;(i)--)
#define per2(i, s, e) for(ll (i) = (ll)(s) - 1LL;(i) >= (ll)(e);(i)--)
#define peri(i, n) for(ll (i) = (ll)(n);(i) >= 0LL;(i)--)
#define peri2(i, s, e) for(ll (i) = (ll)(s);(i) >= (ll)(e);(i)--)
#define iter(i, it) for(auto &(i): (it))

template<typename T, typename U> ostream& operator<<(ostream &s, const pair<T, U> m) {
    cout << "(" << m.first << ", " << m.second << ")";
    return s;
}
template<typename T, typename U> ostream& operator<<(ostream &s, const map<T, U> m) {
    ll c = 0;
    cout << "{ ";
    iter(i, m) cout << i << (c++ == m.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const vector<T> &v) {
    cout << "{ ";
    rep(i, v.size()) cout << v[i] << (i == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const list<T> &v) {
    ll c = 0;
    cout << "{ ";
    iter(i, v) cout << i << (c++ == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}

int main(void) {
    ll N, K, S;
    cin >> N >> K >> S;
    rep(i, N) {
        if(i < K) {
            cout << S;
        } else {
            if(S == 1000000000) cout << '1';
            else cout << 1000000000;
        }
        cout << ' ';
    }
    cout << endl;
    return 0;
}


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

int main() {

    int W,H,x,y,r;
    cin >> W >> H >> x >> y >> r;

    if ( x >= r && y >= r && (W-x) >= r && (H-y) >= r ) 
        cout << "Yes" << endl;
    else 
        cout << "No" << endl;

    return 0;
}



Measured memory_bytes: 3092
#include<bits/stdc++.h>
using namespace std;
int main()
{long long int x;
 cin>>x;
 long long int sum;
 sum=0;
 if(x>=500)
 {int y=x/500;
  int h=x%500;
  int r=h/5;
  sum=((y*1000)+(r*5));
  cout<<sum;}
 else
 {int r=x/5;
  sum=r*5;
  cout<<sum;}
}
   


Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long int LL;
typedef long double dd; 
#define endl "\n"
int dx[4]={1,-1,0,0};
int dy[4]={0,0,-1,1};
LL dp[2000001];
LL mod=1e9+7;
using namespace std;
bool isPrime(LL n) {
  LL j; 
  for( j=2;j<=sqrt(n);j++){
    if(n%j==0){
      break;  
    } 
  }
  if(j>sqrt(n)){
    return 1; 
  }
  else{
    return 0; }
}
LL modexpo(LL a, LL b) {
  LL ans=1;
  while(b>0){
    if((b&1)==1){
      ans=(ans*a)%mod;
    }
    b=b>>1;
    a=(a*a)%mod;
  }
  return ans; 
}
void solve(LL k){
string a, b; 
cin>>a>>b; 
LL mini=INT_MAX,c=0,d=0;
//cout<<a.size()<<b.size()<<endl; 
for(LL i=0;i<a.size();i++){
  if(i<=a.size()-b.size()){
  for(LL j=i;j<a.size();j++){
    if(a[j]!=b[d]){
      c++;
    }
    if(d<b.size()-1){
      d++;
    }
    else{
      break; 
      }
  }
  mini=min(mini,c);
  d=0;
  c=0;
}
}
cout<<mini<<endl; 
}
int main(){
  ios_base::sync_with_stdio(false);
    cin.tie(NULL);
 LL t=1;
//cin>>t;
 LL k=1;
while(k<=t){
   solve(k);
  k++;
  }
   return 0;
   }

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back
#define ppb pop_back
#define INF 1e18
typedef long long ll;

using namespace std;

int main(int argc,char* argv[])
{
    int n;
    cin>>n;
    if(n%2 == 1){cout << 0 << endl; return 0;}
    vector<int> prob(n);
    rep(i,n)cin>>prob[i];
    sort(all(prob));
    int num = prob[n/2] - prob[n/2-1];
    if(num<=0){cout<<0<<endl;return 0;}
    else cout<<num<<endl;
    return 0;
}

Measured memory_bytes: 640
#include<stdio.h>
#define N 101

int main(){
  
  int M[N][N];
  int i,j,n,u,k,v;

  scanf("%d",&n);

  for(i=1;i<=n;i++){
    for(j=1;j<=n;j++){
      M[i][j]=0;
    }
  }

  for(i=1;i<=n;i++){
    scanf("%d",&u);
    scanf("%d",&k);
    for(j=0;j<k;j++){
      scanf("%d",&v);
      M[i][v] = 1;
    }
  }

  for(i=1;i<=n;i++){
    for(j=1;j<=n;j++){
      if(j==n) printf("%d",M[i][j]);
      else printf("%d ",M[i][j]);
    }
    printf("\n");
  }

  return 0;
}



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

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}

using ll=long long;
using R=long double;
const R EPS=1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max(x,0.0L));}

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

// Problem Specific Parameter:

int main(void){
	int n,m;
	cin >> n >> m;

	const int trial = 1900 * m + 100 * (n-m);
	cout << trial * (1<<m) << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
//typedef long long int ll;
using namespace std;
void solve()
{
    int n;
    cin >> n;
    int cac=0;
    int cwa=0;
    int ctle=0;
    int cre=0;
    for(int i=0;i<n;++i)
    {
        string s;
        cin >> s;
        if(s=="AC")
        {
            cac++;
        }
        else if(s=="RE")
        {
            cre++;
        }
        else if(s=="TLE")
        {
            ctle++;
        }
        else if(s=="WA")
        {
            cwa++;
        }
    }
    cout << "AC x " << cac << endl;
    cout << "WA x " << cwa << endl;
    cout << "TLE x " << ctle << endl;
    cout << "RE x " << cre << endl;

}
int main()
{
  /*int t;
    cin >> t;
    while(t--)
    {
        solve();
    }
  */ solve();
    return 0;
}

Measured memory_bytes: 3624
import numpy as np

N = int(input())
XY =  np.array([list(map(int,input().split())) for _ in [0]*N])

ans = 0
for m in range(100):
    th = 2*np.pi*m/100
    r = np.array([np.cos(th),np.sin(th)])
    check = XY.dot(r)>=0
    ans = max(ans,np.linalg.norm(np.sum(XY[check],axis=0)))
print(ans)


Measured memory_bytes: 21632
#from https://ikatakos.com/pot/programming_algorithm/contest_history/atcoder/2019/0106_educational_dp_3
from  itertools import accumulate
mod=1000000007
n=int(input())
s=input()
dp=[1]*n
for i in range(n-1):
    if s[i]==">":
        dp.reverse()
        dp=list(accumulate(dp[:-1]))
        dp.reverse()
    else:
        dp=list(accumulate(dp[:-1]))
    for j in range(len(dp)):
        dp[j]%=mod
print(dp[0])


Measured memory_bytes: 43100
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define vll vector<ll>
#define vi vector<int>
#define vvll vector<vll>
#define wh(t) while(t--)
#define fi(n) for(ll i = 0; i < n; i++)
#define fj(n) for(ll j = 0; j < n; j++)
#define fu(i,s,e) for(ll i = s; i <=e; i++)
#define fd(i,s,e) for(ll i = s; i >=e; i--)
#define mp make_pair
#define pb push_back
#define pii pair<int, int>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define fr first
#define se second
#define sll stack<ll>
#define qll queue<ll>
using namespace std;
const ll M = 1e9+7;
//const ll M = 998244353;

ll pmp(ll x,ll n){ll a = 1;while(n > 0){if(n & 1) a = (a * x)%M;x = (x * x)%M;n = n>>1;}return a;}

void solve(){
	ll n,x,t;
	cin >> n >> x >> t;
	cout << t*((n+x-1)/x) << endl;
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	#ifndef ONLINE_JUDGE
	//freopen("input.txt", "r", stdin);
	#endif
	ll t;
	t = 1;
	//cin >> t;
	wh(t){
		solve();
	}
	cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
	return 0;
}

Measured memory_bytes: 3800
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

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

#define pb push_back

const int MAXN = 1e5 + 10;

int n, m;
int u, v;
int vis[MAXN];
vector <int> adj[MAXN];
deque <int> par;

void dfs(int root) {
    for (auto y: adj[root])
        if (!vis[y]) {
            vis[y] = true;
            par.push_front(y);
            dfs(y);
            break;
        }
}
void dfs_2(int root) {
    for (auto y: adj[root])
        if (!vis[y]) {
            vis[y] = true;
            par.pb(y);
            dfs_2(y);
            break;
        }
}

int main() {
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    cin >> n >> m;
    for (int i = 0; i < m; i++) {
        cin >> u >> v;
        adj[u].pb(v);
        adj[v].pb(u);
    }
    
    vis[1] = true;
    par.push_front(1);
    dfs(1);
    dfs_2(1);
    
    int sz = par.size();
    cout << sz << '\n';
    for (auto y: par)
        cout << y << ' ';
    return 0;
}

Measured memory_bytes: 7168
#include <bits/stdc++.h>
#define all(vec) vec.begin(),vec.end()
#define mp make_pair
using namespace std;
using ll=long long;
using P=pair<int,int>;
const ll INF=1LL<<30;
const ll LINF=1LL<<61;
const double eps=1e-5;
const ll MOD=1e9+7;
string s;
int d,n;
ll dp[10010][110][2];
ll dfs(int i,int sum,bool f){
    if(dp[i][sum][f]!=-1)return dp[i][sum][f];
    if(i==n){
        if(sum==0){
            return 1LL;
        }else{
            return 0LL;
        }
    }
    int a=s[i]-'0';
    ll res=0;
    if(f){
        for(int j=0;j<a;j++){
            res+=dfs(i+1,(sum+j)%d,false);
            res%=MOD;
        }
        res+=dfs(i+1,(sum+a)%d,f);
        res%=MOD;
    }else{
        for(int j=0;j<10;j++){
            res+=dfs(i+1,(sum+j)%d,false);
            res%=MOD;
        }
    }
    return dp[i][sum][f]=res;
}
int main(){
    cin>>s;
    memset(dp,-1,sizeof(dp));
    n=s.length();
    cin>>d;
    cout<<(dfs(0,0,1)-1+MOD)%MOD<<endl;
}   


Measured memory_bytes: 18304
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr long long int MOD = 1000000007;

int main(void){
    ll N, P; cin >> N >> P;
    vector<pair<ll, ll>> factorize;
    
    ll num_P = P;
    for(ll i = 2; i * i <= P; i++){
        if (num_P % i != 0) continue;
        ll ex = 0;
        while(num_P % i == 0){
            ex++;
            num_P /= i;
        }
        factorize.push_back({i, ex});
    }
    if (num_P != 1) factorize.push_back({num_P, 1});
    
    ll ans = 1;
    for(auto p : factorize){
        ans *= pow(p.first, p.second / N );
    }
    cout << ans << endl;
}


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

bool *table_manager;

bool can_move();
bool can_express(const std::vector<int>&, const int);

int main()
{
    table_manager = new bool[40000];
    if (can_move()) printf("Yes\n");
    else printf("No\n");

    delete[] table_manager;
    return 0;
}

bool can_move()
{
    std::vector<int> s[2];
    s[0].push_back(0); s[1].push_back(0);
    int x, y;
    {
        std::string s_in;
        std::cin >> s_in >> x >> y;
        int direction{};
        bool flag{};
        for (int i = 0; i < s_in.size(); i++)
        {
            if (s_in[i] == 'F')
            {
                if (flag)
                    s[direction].back()++;
                else
                {
                    x--;
                    if (i + 1 != s_in.size() && s_in[i + 1] == 'T')
                        flag = true;
                }
            }
            else
            {
                direction = !direction;
                if (s[direction].back() != 0)
                    s[direction].push_back(0);
                flag = true;
            }
        }
    }
    return can_express(s[0], x) && can_express(s[1], y);
}

bool can_express(const std::vector<int>& command, const int coop)
{
    std::fill(table_manager, table_manager + 40000, false);
    bool *table = table_manager + 10000, *pre_table = table_manager + 30000;
    pre_table[0] = true;

    for (const auto & acommand : command)
    {
        for (int i = -9000; i < 9000; i++)
        {
            if (!pre_table[i]) continue;
            table[i + acommand] = table[i - acommand] = true;
        }
        std::swap(table, pre_table);
        std::fill(table - 10000, table + 10000, false);
    }
    if (pre_table[coop]) return true;
    else return false;
}

Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>

using namespace std;

const int maxn = 200002;

int n, evenFreq[maxn], oddFreq[maxn], evenMax, oddMax, evenSecondMax, oddSecondMax;

vector<int> evenBest, oddBest;

int main()
{
	cin >> n;

	int v, maxv = 0, minv = 200000;
	for (int i = 1; i <= n; ++i) {
		cin >> v;

		if (i%2)
			++oddFreq[v];
		else
			++evenFreq[v];

		if (v > maxv)
			maxv = v;
		if (v < minv)
			minv = v;
	}

	for (int i = minv; i <= maxv; ++i) {
		if (evenFreq[i] > evenMax) {
			evenSecondMax = evenMax;

			evenMax = evenFreq[i];
			evenBest = vector<int>(1, i);
		} else if (evenFreq[i] == evenMax) {
			evenBest.push_back(i);
		} else if (evenFreq[i] > evenSecondMax) {
			evenSecondMax = evenFreq[i];
		}

		if (oddFreq[i] > oddMax) {
			oddSecondMax = oddMax;
			
			oddMax = oddFreq[i];
			oddBest = vector<int>(1, i);
		} else if (oddFreq[i] == oddMax) {
			oddBest.push_back(i);
		} else if (oddFreq[i] > oddSecondMax) {
			oddSecondMax = oddFreq[i];
		}
	}

	int ans = n - evenMax - oddMax;
	if (evenBest.size() == 1 && oddBest.size() == 1 && evenBest[0] == oddBest[0])
		ans = n - max(evenMax + oddSecondMax, oddMax + evenSecondMax);
	
	
	cout << ans << endl;

	return 0;
}

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

using namespace std;
typedef long long ll;
typedef pair<int,int>pa;
map<int,int>mp;
const int N=2e5+100;
int dp[50][500][500];///前n个a有i，b有j的最小花费
int a[50],b[50],c[50];
int inf=0x3f3f3f3f;
int main()
{
    ios::sync_with_stdio(0);cin.tie(0);
    int n,m1,m2;
    cin>>n>>m1>>m2;
    for(int i=1;i<=n;i++){
        cin>>a[i]>>b[i]>>c[i];
    }
    memset(dp,0x3f,sizeof dp);
    dp[1][0][0]=0;
    for(int i=1;i<=n;i++){
       for(int j=0;j<=400;j++){
        for(int k=0;k<=400;k++){
            if(dp[i][j][k]==inf) continue;
           dp[i+1][j][k]=min(dp[i+1][j][k],dp[i][j][k]);
           dp[i+1][j+a[i]][k+b[i]]=min(dp[i+1][j+a[i]][k+b[i]],dp[i][j][k]+c[i]);
       }
     }
    }
    int ans=inf;
    for(int i=1;i<=400;i++){
        if(i*m1<=400&&i*m2<=400){
            ans=min(ans,dp[n+1][i*m1][i*m2]);
        }
    }
    if(ans!=inf)
    cout<<ans<<endl;
    else cout<<-1<<endl;
    return 0;
}


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

typedef long long ll;
#define rep(i,x) for(int i=0;i<x;i++)
#define put(ans)    cout << ans << endl;

int main(){
    int x;
    cin >> x;
    cout << setprecision(15) << pow(x,3) << endl;

    return 0;
}


Measured memory_bytes: 3440
#include<iostream>
#include<cstdlib>
#include<string>
#include<cmath>
#include<cstdio>
#include<algorithm>
#include<array>
#include<vector>
#include<cctype>
#include <chrono>
#define long long ll

#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
int main()
{
    int i,j=1,c=2,k=0,n=20,m;
int a;
string s,t;
cin>>s>>t;
for(i=0,j=0;i<s.size();i++)
{
    if(s[i]!=t[i])
    {
        j++;
    }
}
cout<<j;
}



Measured memory_bytes: 3920
#include <cstdio>

int main(){
    int a, b;
    scanf("%d", &a);
    scanf("%d", &b);
    if (a < b) {
        printf("a < b\n");
    }
   else if (a > b) {
        printf("a > b\n");
    }
    else {
        printf("a == b\n");
    }
}


Measured memory_bytes: 2680
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut 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! {
        k: u32,
        s: u32,
    };
    let mut count: u32 = 0;
    for x in 0..s + 1 {
        for y in 0..s - x + 1 {
            let z = s - x - y;
            if x <= k && y <= k && z <= k {
                count += 1;
            }
        }
    }
    println!("{}", count);
}


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

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

	int snum = s.size();
	int half = snum / 2;
	int j = snum - 1;
	int ret = 0;
	for (int i = 0; i < half; ++i) {
		if (s[i] != s[j]) {
			++ret;
		}
		--j;
	}

	cout << ret << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define maxn 2005
#define maxl 1000000000

using namespace std;

#define st first
#define nd second
#define ALL(x) (x).begin(), (x).end()

template <class T>
void mini(T& l, T r) {
  l = min(l, r);
}
template <class T>
void maxi(T& l, T r) {
  l = max(l, r);
}

using LL = long long;
using LD = long double;
using ULL = unsigned long long;
const int dx[] = {0, -1, 1, 0, -1, -1, 1, 1},
          dy[] = {-1, 0, 0, 1, -1, 1, -1, 1};
const int INF = 1e9;
const LL MOD = 1e9 + 7;

int t, T;

void Solve() {
  // TODO
  int n, k;
  cin >> n >> k;
  string p;
  cin >> p;
  int cnt = 0;
  for (int i = 1; i < n; i++) {
    if (p[i] != p[i - 1]) cnt++;
  }
  int tmp = k - min(k, cnt / 2);
  if (cnt & 1 && tmp) {
    cnt--;
    k--;
  }
  cnt -= 2 * min(k, cnt / 2);
  cout << n - 1 - cnt << '\n';
  return;
}

void Prepare() {
  // TODO
  return;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  // Prepare();
  // cin >> T;
  // for (t = 1; t <= T; t++) {
  //   printf("Case #%d: ", t);
  Solve();
  // }
  return 0;
}

Measured memory_bytes: 512
''''atcoder beginner contest-170'''

import math
from collections import defaultdict
def r():
    return int(input())
def rm():
    return map(int,input().split())
def rl():
    return list(map(int,input().split()))

'''C'''
x,n=rm()
l=True
try:
    a=rl()
except:
    a=[]
b=defaultdict(int)
for i in a:
    b[i]=1
mini=math.inf
value=-1
for j in range(-101,201):
    if b[j]!=1:
        if abs(x-j)<mini:
            mini=abs(x-j)
            value=j
print(value)

Measured memory_bytes: 9492
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define repr(i, n) REPR(i, n, 0)
#define REPR(i, s, e) for(int i=(int)(s-1); i>=(int)(e); i--)
#define pb push_back
#define all(r) r.begin(),r.end()
#define rall(r) r.rbegin(),r.rend()
#define fi first
#define se second

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const ll INF = 1e9;
const ll MOD = 1e9 + 7;
double EPS = 1e-8;

template<typename T> T chmax(T& a, const T& b){return a = (a > b ? a : b);}
template<typename T> T chmin(T& a, const T& b){return a = (a < b ? a : b);}

int main(){
    int n;
    cin >> n;
    vector<vector<pii>> es(n);
    rep(i, n-1) {
        int a, b, c;
        cin >> a >> b >> c;
        --a;
        --b;
        es[a].push_back(make_pair(b, c));
        es[b].push_back(make_pair(a, c));
    }
    vector<int> col(n, -1);
    queue<int> q;
    q.push(0);
    col[0]=0;
    while(!q.empty()) {
        auto p = q.front();
        q.pop();
        for(auto&& e : es[p]) {
            int to = e.fi;
            if(col[to] == -1) {
                if(e.se&1) col[to] = !col[p];
                else col[to] = col[p];
                q.push(to);
            }
        }
    }
    rep(i, n) {
        cout << col[i] << endl;
    }
    return 0;
}

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

int n;
vector<double> p;
vector<vector<double>> dp;

double solve(int c, int h) {
	if (c == n) {
		if (h >= (n + 1) / 2) {
			return 1.0;
		} else {
			return 0.0;
		}
	}
	if (dp[c][h] != -1.0) {
		return dp[c][h];
	}
	return dp[c][h] = p[c] * solve(c + 1, h + 1) + (1.0 - p[c]) * solve(c + 1, h);
}

int main() {
	ios_base::sync_with_stdio(false);

	cin >> n;
	p.resize(n);
	dp.resize(n, vector<double> (n + 1, -1.0));
	for (int i = 0; i < n; i++) {
		cin >> p[i];
	}
	double answer = solve(0, 0);
	cout << fixed << setprecision(12) << answer;

	return 0;
}

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

int main(){
	int N,L;
	cin>>N>>L;
	int mina=100000;
	int data[200];
	int ans=0;
	int sum=0;
	for(int i=0;i<N;i++){
		data[i]=L+i;
		if(mina>abs(data[i])){
			ans=data[i];
			mina=abs(data[i]);
		}
		sum+=data[i];
	}
	cout<<sum-ans<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
#define equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll mod2 = 998244353;
const ll INF = 1e18;
const long double EPS = 1e-10;
const int MAX = 1e5;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, n) cin >> a[i];

  int ans = n;
  vector<int> c(MAX, 0);
  rep(i, n) c[a[i] - 1]++;
  
  bool flag = false;
  rep(i, MAX) {
    if (c[i] < 2) continue;
    if (c[i] & 1) ans -= c[i] - 1;
    else {
      ans -= c[i] - 2;
      if (!flag) ans -= 2;
      flag ^= 1;
    }
  }
  cout << ans << endl;


  
  return 0;
}

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

int main() {
  string s;
  cin >> s;
  vector<long> c(26);
  for (int i=0; i<s.size(); i++)
    c.at(s.at(i) - 'a')++;
  bool is_e = false;
  for (int i=0; i<26; i++){
    if (c.at(i) == 0) {
      cout << (char)(i+'a') << endl;
      is_e = true;
      break;
    }
  }
  if (!is_e) cout << "None" << endl;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define vi vector<int>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int> >
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define INF 1000000000
#define eps 1e-7
#define mod 1000000007
#define int ll
using namespace std;

signed main(void) {
    int N;
    string A, B, C;
    cin >> N >> A >> B >> C;
    int ans = 0;
    rep(i, N) {
        if (A[i] == B[i] && B[i] != C[i]) {
            ans++;
        } else if (A[i] != B[i] && B[i] == C[i]) {
            ans++;
        } else if (A[i] == C[i] && B[i] != C[i]) {
            ans++;
        } else if (A[i] != C[i] && A[i] != B[i] && B[i] != C[i]) {
            ans += 2;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define ub              upper_bound
#define lb              lower_bound
#define isrt            insert
#define clr             clear
#define rsz             resize
#define ff              first
#define ss              second
#define lli             long long int
#define pb              push_back
#define pf              push_front
#define mkp              make_pair
#define pii             pair<lli,lli>
#define vi              vector<int>
#define mii             map<lli,lli>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define INF             1e9
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define all(v)          v.begin(),v.end()
#define endl            "\n"


typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

lli maxm(lli a, lli b)
{
    return (a >= b ? a : b);
}


lli minm(lli a, lli b)
{
    return (a <= b ? a : b);
}

lli power(lli x, lli y, lli p)
{
    lli res = 1;

    x = x % p;
    if (x == 0)
        return 0;

    while (y > 0)
    {

        if (y & 1)
            res = (res * x) % p;


        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}

lli nCrmodp(lli n, lli r, lli p)
{
    if (r == 0)
        return 1;
    if (r == 1)
        return n;


    lli pro = 1, k = n;
    while (k > r)
    {
        pro *= k;
        pro %= p;
        --k;
    }

    k = 2;
    while (k <= (n - r))
    {
        pro *= power(k, (p - 2), p);
        pro %= p;
        ++k;
    }

    return pro;
}


string num_str(lli n, lli k)
{
    string str = "";
    lli x = n;
    while (x != 0)
    {
        string s = to_string(x % k);
        str = s + str;
        x /= k;
    }

    return str;
}


lli first_big(lli n, lli k, lli arr[])
{
    lli l = 0;
    lli r = n - 1;

    lli leftGreater = n;

    while (l <= r) {
        lli m = l + (r - l) / 2;

        if (arr[m] > k) {
            leftGreater = m;
            r = m - 1;
        }

        else
            l = m + 1;
    }

    return leftGreater;
}

void c_p_c()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

int main()
{
    c_p_c();

    lli k, pro = 1;
    cin >> k;
    k *= 9;

    if (k % 2 == 0 || k % 5 == 0)
        cout << "-1\n";

    else
    {
        lli ans = 0;
        for (lli i = 1; i <= 1000010; ++i)
        {
            pro *= 10;
            pro %= k;

            lli s = pro;
            s -= 1;
            s *= 7;
            s %= k;

            if (s == 0)
            {
                ans = i;
                break;
            }
        }
        cout << ans << endl;

    }
    return 0;
}

Measured memory_bytes: 3632
n = int(input())
p = list(map(int,input().split()))
a = [1+30000*i for i in range(n)]
b = [1+30000*i for i in range(n-1,-1,-1)]
t = 0
for x in p:
  a[x-1] += t
  t += 1
print(" ".join(map(str,a)))
print(" ".join(map(str,b)))

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

int main(){
    int n, i;
    cin >> n;
    char s[n];
    cin >> s;
    int rCnt=0, bCnt=0;
    for(i=0;i<n;i++){
        if(s[i]=='R'){
            rCnt++;
        }else
        {
            bCnt++;
        }
    }
    if (rCnt>bCnt) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;

}

Measured memory_bytes: 256
#include<iostream>
#include<cmath>
using namespace std;
int a,b;
int c[5],d;
int main()
{
	cin>>a>>b;d=1;
	while(b)
	{
	 c[d++]=b%10;
	 b/=10;	
	}
	for(int i=d-1;i>=1;i--)
	a=a*10+c[i];
	d=sqrt(a);
	if(d*d==a)cout<<"Yes";
	else cout<<"No";
	
}

Measured memory_bytes: 256
#include <stdio.h>
main(){
  long long int a,b,tmp=0,x,y,ans=0;
  while(scanf("%lld %lld",&a,&b)!=EOF){
    x=a; y=b;
    if(x<y){
      tmp=x;
      x=y;
      y=tmp;
    }
    while(y!=0){
      tmp=y;
      y=x%y;
      x=tmp;
    }
    printf("%lld %lld\n",x,a*b/x);
  }
  return 0;
}

Measured memory_bytes: 596
N, M = map(int, input().split())
import heapq

As = list(map(lambda x : -1 * int(x), input().split()))

heapq.heapify(As)

for i in range(M):
  tmp = heapq.heappop(As)
  tmp = (-1 * tmp) // 2 * (-1) 
  heapq.heappush(As, tmp)
  
print(-1 * sum(As))


Measured memory_bytes: 14380
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define pb push_back

int main()
{
    ll n, m, i, j, x, y, dx, dy, t;
    vector < string > v;
    string s = "", s1;
    cin >> n >> m;
    if(n < m)
    {
        for(i = 0; i < m; i++)
        {
            cout << n;
        }
    }
    else
    {
        for(i = 0; i < n; i++)
        {
            cout << m;
        }
    }
    cout << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <cmath>

using namespace std;
#define PI 3.1415926535897932384626433832795
#define MOD (1000000007)
#define EPS (1e-15)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repc(i, s, n) for (int i = (s); i <= (n); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define rrepc(i, s, n) for (int i = (s); i >= (n); i--)
#define bet(x, a, b) (a) <= (x) && (x) < (b)
typedef long long ll;
typedef unsigned long long ull;

int r[7][7];

void setr(void)
{
	r[1][2] = 3;
	r[1][3] = 5;
	r[1][5] = 4;
	r[1][4] = 2;

	r[2][1] = 4;
	r[2][3] = 1;
	r[2][4] = 6;
	r[2][6] = 3;

	r[3][1] = 2;
	r[3][2] = 6;
	r[3][5] = 1;
	r[3][6] = 5;

	r[4][1] = 5;
	r[4][2] = 1;
	r[4][5] = 6;
	r[4][6] = 2;

	r[5][1] = 3;
	r[5][3] = 6;
	r[5][4] = 1;
	r[5][6] = 4;

	r[6][2] = 4;
	r[6][3] = 2;
	r[6][4] = 5;
	r[6][5] = 3;
}

class dice {
public:
	int f, l, d;
	int v[7];

	dice(void) {
		f = 1;
		l = 4;
		d = 2;
	}
	void rot(char c)
	{
		int pf = f, pl = l, pd = d;

		if (c == 'W') set(7 - pl, pf, pd);
		else if (c == 'S') set(7 - pd, pl, pf);
		else if (c == 'E') set(pl, 7 - pf, pd);
		else set(pd, pl, 7 - pf);
	}
	int front(void)
	{
		return v[f];
	}
private:
	void set(int fv, int lv, int dv) {
		f = fv;
		l = lv;
		d = dv;
	}
};

bool same(dice& d1, dice& d2)
{
	bool ret = false;

	repc(u, 1, 6) repc(f, 1, 6) {
		if (f == u) continue;
		if (f == 7 - u) continue;
		if (d1.v[1] == d2.v[u] &&
			d1.v[2] == d2.v[f] &&
			d1.v[3] == d2.v[r[u][f]]) {
			if (d1.v[6] == d2.v[7 - u] &&
				d1.v[5] == d2.v[7 - f] &&
				d1.v[4] == d2.v[7 - r[u][f]]) ret = true;
			}
	}

	return ret;
}

dice d[100];

int main()
{
	int n;
	bool ans = true;

	setr();
	
	cin >> n;
	rep(i, n) repc(j, 1, 6) cin >> d[i].v[j];

	repc(i, 0, n - 2) repc(j, i + 1, n - 1) {
		if (same(d[i], d[j])) ans = false;
	}

	cout << (ans ? "Yes" : "No") << endl;

	return 0;
}



Measured memory_bytes: 3100
#include <bits/stdc++.h>
using namespace std;
 
 
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
 
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
 
#define rep(i, n)    for(int i = 0; i < (n); ++i)
#define repA(i, a, n)  for(int i = a; i <= (n); ++i)
#define repD(i, a, n)  for(int i = a; i >= (n); --i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
#define fill(a)  memset(a, 0, sizeof (a))
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

void pre(){


}

vi g[100009], p;
int u=0;
string s;

int last(int c){
    assert(c>0);
    int l=lower_bound(all(p), c)-p.begin();
    if(p[l] > c) l--;
    return p[l];
}

int solve(int i){
    if(i == 0) return u++;

    if(s[i-1] == '1'){
        int v=solve(i-1);
        g[u].pb(v);
        g[v].pb(u);
        return u++;
    }
    else{
        int c=i;
        int ou = u++;
        while(c>0){
            int l = last(c);
            int v = solve(l-1);
            g[ou].pb(v);
            g[v].pb(ou);
            c -= l;
        }
        assert(c==0);
        return ou;
    }
    return -1;
}

void dfs(int u, int p){
    trav(v,g[u]) if(v!=p){
        cout << u+1 << ' ' << v+1 << '\n';
        dfs(v,u);
    }
}

int main() {
	cin.sync_with_stdio(0); cin.tie(0);
	cin.exceptions(cin.failbit);
	pre();

    cin>>s;
    int n=sz(s);
    rep(i,n)if(s[i]=='1') p.pb(i+1);

    if(s[n-1]=='1' || s[0]=='0'){cout << -1; return 0;}
    repA(i,0,n-2)if(s[i] != s[n-i-1-1]){cout << -1; return 0;}

    int v=solve(n-2);
    g[v].pb(u);
    g[u].pb(v);
    u++;

    dfs(0,-1);

	return 0;
}
 



Measured memory_bytes: 15176
X, Y = map(int, raw_input().split())

ans = 0
if X==3: ans += 100000
if X==2: ans += 200000
if X==1: ans += 300000
if Y==3: ans += 100000
if Y==2: ans += 200000
if Y==1: ans += 300000
if X==1 and Y==1: ans += 400000
print ans


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

int main(){
    char b;
    cin>>b;
    char ans;
    if(b=='A') ans='T';
    if(b=='T') ans='A';
    if(b=='G') ans='C';
    if(b=='C') ans='G';
    cout<<ans;
}

Measured memory_bytes: 256
fun main(omkar: Array<String>) {
    val line = readLine()!!
    val six = line.indexOf(' ')
    val n = line.substring(0, six).toInt()
    val m = line.substring(six + 1).toInt()
    val grid = Array(n) { readLine()!! }
    val dp1 = Array(n) { IntArray(m) { Int.MAX_VALUE } }
    val dp2 = Array(n) { IntArray(m) { Int.MAX_VALUE } }
    dp1[0][0] = if (grid[0][0] == '.') 0 else 1
    dp2[0][0] = 1
    for (y in 0 until n) {
        for (x in 0 until m) {
            if (grid[y][x] == '.') {
                if (y > 0) {
                    dp1[y][x] = dp1[y - 1][x]
                }
                if (x > 0) {
                    dp1[y][x] = Math.min(dp1[y][x], dp1[y][x - 1])
                }
                dp2[y][x] = dp1[y][x] + 1
            } else {
                if (y > 0) {
                    dp2[y][x] = dp2[y - 1][x]
                }
                if (x > 0) {
                    dp2[y][x] = Math.min(dp2[y][x], dp2[y][x - 1])
                }
                dp1[y][x] = dp2[y][x]
            }
        }
    }
    println(dp1[n - 1][m - 1])
}

Measured memory_bytes: 33608
import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val n = sc.nextInt()
    val k = sc.nextInt()
    sc.nextLine()
    val as = sc.nextLine().split(" ").map(_.toInt)

    println(as.groupBy(identity)
      .mapValues(_.length)
      .values
      .toList
      .sorted
      .dropRight(k)
      .sum)
  }
}


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

int main(){
  int N;cin>>N;
  double x;
  string u;
  double ans=0;
  REP(i,N){
    cin>>x>>u;
    if(u=="BTC"){
      x*=380000;
    }
    ans+=x;
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 256
/*
      author  : nishi5451
      created : 14.08.2020 21:59:27
*/

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


int main(){
    int n;
    cin >> n;
    if( (n/100)*111 >= n){
        cout << (n/100)*111 << endl;
        return 0;
    }
    else{
        cout << (n/100+1)*111 << endl;
    }
    return 0;
}

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

using namespace std;

vector<int> directions;
vector<vector<int>> relations;
vector<bool> isVisited;

int N,M;

void bfs(){
    // cout << "\nbfs start!" << endl;
    queue<int> que;
    que.push(1);
    while(!que.empty()){
        int q = que.front();
        que.pop();
        for(int i : relations.at(q)){
            if(isVisited.at(i))continue;
            directions.at(i) = q;
            isVisited.at(i) = true;
            que.push(i);
        }

        // for(int i=1; i<=N; i++){
        //     if(i > relations.at)
        //     if(!isVisited.at(i) && relations.at(q).at(i)){
        //         // cout << i << " ";
        //         directions.at(i) = q;
        //         isVisited.at(i) = true;
        //         que.push(i);
        //     }
        // }
        // cout << endl;
    } 
}

void show_isVisited(){
    cout << "isVisited" << endl;
    for(int i=1; i<=N; i++)cout << (isVisited.at(i) ? 1 : 0);
    cout << endl;
}

void show_directions(){
    cout << "directions" << endl;
    for(int i=1; i<=N; i++)cout << directions.at(i) << " ";
    cout << endl;
}

void show_relations(){
    cout << "relations" << endl;
    for(auto relation : relations){
        for(auto r : relation)cout << r << " ";
        cout << endl; 
    }
}

int main(){
    cin >> N >> M;

    // init
    directions = vector<int>(N+1);
    // directions.at(1) = 0;
    relations = vector<vector<int>>(N+1, vector<int>(0));
    isVisited = vector<bool>(N+1, false);
    isVisited.at(1) = true;

    for(int i=0; i<M; i++){
        int a,b;
        cin >> a >> b;
        relations.at(a).push_back(b);
        relations.at(b).push_back(a);
    }

    // show_relations();

    bfs();

    // show_isVisited();
    // show_directions();

    bool res = true;
    for(int i=1; i<=N; i++){
        if(!isVisited.at(i)){
            res = false;
            break;
        }
    }

    if(res){
        cout << "Yes" << endl;
        for(int i=2; i<=N; i++)cout << directions.at(i) << endl;
    }else{
        cout << "No" << endl;
    }
}

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

int main(){
  int N,Y;
  cin >> N >> Y;
  for(int i=0; i<=N; i++){
    for(int j=0; j<=N-i; j++){
      int k = N-i-j;
      if (k<=N && k>=0 && 10000*i+5000*j+1000*k == Y){
        cout << i << " " << j << " " << k <<endl;
        return 0;
      }
    }
  }
  cout << -1 << " " << -1 << " " << -1 <<endl;
  return 0;
  
}


Measured memory_bytes: 256
// #pragma GCC target("avx2")  // CPU 処理並列化
// #pragma GCC optimize("O3")  // CPU 処理並列化
// #pragma GCC optimize("unroll-loops")  // 条件処理の呼び出しを減らす
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
#include<numeric>
using namespace std;
const long long mod=998244353;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const double EPS=1e-10;
const double INF=1e+10;
const double PI=acos(-1.0);
const int C_SIZE = 3121000;
long long fact[C_SIZE];
long long finv[C_SIZE];
long long inv[C_SIZE];
long long Comb(int a,int b){
 	if(a<b||b<0)return 0;
 	return fact[a]*finv[b]%mod*finv[a-b]%mod;
}
void init_C(int n){
	fact[0]=finv[0]=inv[1]=1;
	for(int i=2;i<n;i++){
		inv[i]=(mod-(mod/i)*inv[mod%i]%mod)%mod;
	}
	for(int i=1;i<n;i++){
		fact[i]=fact[i-1]*i%mod;
		finv[i]=finv[i-1]*inv[i]%mod;
	}
}
long long pw(long long a,long long b){
	if(a<0LL)return 0;
	if(b<0LL)return 0;
	long long ret=1;
	while(b){
		if(b%2)ret=ret*a%mod;
		a=a*a%mod;
		b/=2;
	}
	return ret;
}
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
double ABS(double a){return max(a,-a);}
int sig(double r) { return (r < -EPS) ? -1 : (r > +EPS) ? +1 : 0; }
// ここから編集しろ
long long gcd(long long a,long long b){
	while(a){b%=a;swap(a,b);}return b;
}
int t[210];
int main(){
	for(int i=1;i<210;i++){
		for(int j=i;j<210;j+=i)t[j]++;
	}
	int a;scanf("%d",&a);
	int ret=0;
	for(int i=1;i<=a;i+=2)if(t[i]==8)ret++;printf("%d\n",ret);
}

Measured memory_bytes: 128
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };

int INF = INT_MAX / 2;
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

int main() {
	int N, M; cin >> N >> M;
	vector<int> a(M);
	for (int& x: a) cin >> x;
	int odd = 0;
	for (int x: a)
		if (x % 2)
			odd++;
	if (odd >= 3) {
		cout << "Impossible" << endl;
		return 0;
	}
	for (int i = 0; i < M; i++)
		if (a[i] % 2) {
			if (a[0] % 2 == 0) swap(a[0], a[i]);
			else swap(a[M - 1], a[i]);
		}
	vector<int> b;
	for (int i = 0; i < M; i++) {
		int x = a[i];
		if (i == 0) x--;
		else if (i == M - 1) x++;
		if (x) b.push_back(x);
	}
	if (M == 1) b.push_back(1);
	for (int x: a) cout << x << ' ';
	cout << endl;
	cout << b.size() << endl;
	for (int x: b) cout << x << ' ';
	cout << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<set>
#include<iomanip>
#define rep(i, a, n) for(int i = a; i < n; i++)
using namespace std;
int main(){
  string s;
  cin >> s;
  if(s == "SUN"){
    cout << "7\n";
    return 0;
  }
  if(s == "MON"){
    cout << "6\n";
    return 0;
  }
  if(s == "TUE"){
    cout << "5\n";
    return 0;
  }
  if(s == "WED"){
    cout << "4\n";
    return 0;
  }
  if(s == "THU"){
    cout << "3\n";
    return 0;
  }
  if(s == "FRI"){
    cout << "2\n";
    return 0;
  }
  if(s == "SAT"){
    cout << "1\n";
    return 0;
  }
  
}

Measured memory_bytes: 3588