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

// 2つの整数の場合
long long GetLeastCommonMultiple(long long a, long long b) {
	long long m = a;
	long long n = b;
	long long temp;

	while (m % n != 0) {
		temp = n;
		n = m % n;
		m = temp;
	}
	return a / n * b;
}

int main()
{
    ll a, b; cin >> a >> b;

	ll ans = GetLeastCommonMultiple(a, b);

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

Measured memory_bytes: 256
N = int(input())
job = []
sum = 0
result = "Yes"
for _ in range(N):
    cost, limit = map(int, input().split())
    job.append((limit,cost))

job.sort()
for i,j in job:
    sum += j
    if i < sum:
        result = "No"
        break

print(result)


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

#define increment(a, b) (a == '.' && b == '#')

int find_root(int h, int w)
{
    
  unsigned int dp[h][w];
  string s[h];
  REP(i, h)
  {
    cin >> s[i];
    REP(j, w)
    {
      dp[i][j] = -1;
    }
  }
  
  dp[0][0] = (s[0][0] == '#');
  
  REP(i, h)
  {
    REP(j, w)
    {
      if(i != h-1)
      {
		dp[i+1][j] = dp[i][j] + increment(s[i][j], s[i+1][j]);
      }
      if(j != w-1)
      {
	  	dp[i][j+1] = min(dp[i][j+1], dp[i][j] + increment(s[i][j], s[i][j+1]));
      }
    }
  }
    
  return dp[h-1][w-1];
}

int main()
{
  int h,w;
  cin >> h >> w;
  
  cout << find_root(h, w) << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int N=2e5+5;

bool arr[N];
int solve()
{
    long long d,t,s;
    cin>>d>>t>>s;
    long long tt=(d+s-1)/s;
    if(tt>t)
        cout<<"No";
    else
        cout<<"Yes";
    return 0;
}

int main()
{

#ifndef ONLINE_JUDGE
    freopen("input.txt" ,"r" ,stdin);
    freopen("output.txt" ,"w" ,stdout);
#endif

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

    // int t;
    // cin>>t;
    // while(t--)
    solve();

    return 0;
}

Measured memory_bytes: 3644
#include<stdio.h>
#include<string.h>
#define LEN 100005


typedef struct pp{
  char name[100];
  int t;
}P;

P Q[LEN+1],Print[LEN+1];
int head = 1, tail, n;

void enqueue(P x){
  
  Q[tail] = x;

  if((tail +1) == LEN)
    tail = 0;
  else
    tail++;

}

P dequeue(){

  P x;
  x = Q[head];
  if((head + 1) == LEN)
    head = 0;
  else
    head++;
  
  return x; 

}


int main(){
  int elaps = 0, c,tmp;
  int i, q,time=0;
  P u;
  scanf("%d %d", &n, &q);

  for ( i = 1; i <= n; i++){
    scanf("%s", Q[i].name);
    scanf("%d", &Q[i].t);
  }
  tail = n+1;
  
  while(elaps < n){
    
    u = dequeue();
    c = u.t-q;
  
  
    if(c  <=  0){
      tmp = u.t;
      u.t += time;
      time+=tmp;
	Print[elaps] = u;
      elaps++;
  
    }else{
      u.t=c;
    time += q;
    enqueue(u);
    }
  }

  for(i = 0;i <elaps;i++)
    printf("%s %d\n",Print[i].name,Print[i].t);
  
  
  return 0;
}

Measured memory_bytes: 16976
#!/usr/bin/env python
# -*- coding: utf-8 -*-

while True:
    try:
        input_s = input()
    except:
        break

    s_list = [input_s[i:i+3] for i in range(len(input_s[:-2]))]

    n_joi = 0
    n_ioi = 0
    for s in s_list:
        if s == 'JOI':
            n_joi += 1
        if s == 'IOI':
            n_ioi += 1

    print(n_joi)
    print(n_ioi)

Measured memory_bytes: 7352
import sys
def thk(n):
    return 2**(n+2)-3
def pt(n):
    return 2**(n+1)-1
def ban(n):
    return 2**(n+1)-2

N,X = map(int, input().split(' '))
ans = 0

while(True):
    if X == 0:
        break
    elif X == thk(N)//2+1:
        ans += pt(N-1)+1
        break
    elif X == thk(N):
        ans += 2*pt(N-1)+1
        break
    elif X > thk(N)//2+1:
        ans += pt(N-1)+1
        X -= thk(N)//2+1
        N -= 1
    else:
        X -= 1
        N -= 1

print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define FOR(i,bg,ed) for(ll i=(bg);i<(ed);i++)
#define REP(i,n) FOR(i,0,n)
#define MOD 1000000007
#define int long long
using namespace std;
typedef long long ll;
typedef vector<vector<ll>> mat;
const int INF = 1e9;

int H, W;
int N;
int a[10101];
int ans[110][110];

signed main()
{
    cin >> H >> W;
    cin >> N;
    REP(i,N) cin >> a[i];

    int now = 0;

    REP(i,H) {
        if (i % 2 == 0) {
            REP(j,W) {
                ans[i][j] = now + 1;
                a[now]--;
                if (a[now] == 0) now++;
            }
        } else {
            for (int j=W-1; j>=0; j--) {
                ans[i][j] = now + 1;
                a[now]--;
                if (a[now] == 0) now++;
            }
        }
    }

    REP(i,H) {
        REP(j,W) {
            cout << ans[i][j];
            if (j == W - 1) cout << endl;
            else cout << " ";
        }
    }
}


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

int main() {
    int n;
    cin >> n;
    string s;
    cin >> s;
    long long cntr = 0;
    long long cntg = 0;
    long long cntb = 0;
    for(int i = 0; i < n; ++i) {
        if(s[i] == 'R') ++cntr;
        else if(s[i] == 'G') ++cntg;
        else if(s[i] == 'B') ++cntb;
    }
    long long cntrgb = 0;
    for(int t = 1; t < n; ++t) {
        for(int i = 0; i < n; ++i) {
            if(i+2*t < n && s[i] != s[i+t] && s[i] != s[i+2*t] && s[i+t] != s[i+2*t]) {
                ++cntrgb;
            }
        }
    }
    long long ans = cntr*cntg*cntb-cntrgb;
    cout << ans << endl;
    return 0;
}

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

using AB = std::pair<int, int>;
std::istream &operator>>(std::istream &is, AB &p) {
    is >> p.first >> p.second;
    return is;
}

int main() {
    using std::cin;
    using std::cout;
    using std::vector;

    int H, N;
    cin >> H >> N;

    vector<AB> ab(N);
    for (AB &aibi : ab) cin >> aibi;
    // 消費魔力の昇順にソート
    std::sort(ab.begin(), ab.end(),
              [](const AB &p1, const AB &p2) { return p1.second < p2.second; });

    int max_A = 0;
    for (const AB abi : ab) max_A = std::max(abi.first, max_A);
    constexpr int INF = 2000000000;
    // dp[i] : iのダメージを与えるのに必要な最小消費魔力
    vector<int> dp(H + max_A);  // dp.size() <= 2e4
    std::fill(dp.begin(), dp.end(), INF);
    dp.at(0) = 0;
    for (const AB abi : ab) {  // ab.size() <=1e3
        int Ai = abi.first;
        int Bi = abi.second;
        for (int i = 1; i <= std::min(Ai, H + max_A - 1); ++i) {
            dp.at(i) = std::min(dp.at(i), Bi);
        }
        for (int i = Ai + 1; i < H + max_A; ++i) {
            dp.at(i) = std::min(dp.at(i), dp.at(i - Ai) + Bi);
        }
    }

    cout << dp.at(H) << '\n';
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();

		long p = 1;
		int r = 0;
		while (p <= n) {
			p *= k;
			r++;
		}

		System.out.println(r);

	}

}


Measured memory_bytes: 35644
N = int(input())
A = list(map(int, input().split()))

mina = 10**10
maxa = -10**10
for i, a in enumerate(A):
    if a < mina:
        l = i+1
        mina = a
    if a > maxa:
        r = i+1
        maxa = a


if maxa <= 0:
    print(N-1)
    for n in range(N, 1, -1):
        print(n, n-1)
elif mina >= 0:
    print(N-1)
    for n in range(1, N):
        print(n, n+1)
else:
    print(2*N-1)
    if abs(maxa) > abs(mina):
        for i in range(1, N+1):
            print(r, i)
        for n in range(1, N):
            print(n, n+1)
    else:
        for i in range(N, 0, -1):
            print(l, i)
        for n in range(N, 1, -1):
            print(n, n-1)

Measured memory_bytes: 3064
N = int(input())
S = input()

d = [0] * N
if S[0] == "(":
    d[0] = 1
else:
    d[0] = -1
for i in range(1,N):
    d[i] = d[i-1]
    if S[i] == "(":
        d[i] += 1
    else:
        d[i] -= 1
        
x = max(-min(d), 0)
S = "(" * x + S + ")" * (d[N-1] + x)
print(S)      

Measured memory_bytes: 3064
#include <iostream>

using namespace std;

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

    int n, num;
    int sum = 0;

    // Get number
    cin >> n;

    // Save the input
    num = n;

    // Separete Digits and sums
    while (n > 0)
    {
        sum += n % 10;
        n = n / 10;
    }

    // Check if S(n) divides n
    if (num%sum == 0)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
    
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>

int main(){
    int x;
    std::cin >> x;
    
    int t = 0;
    while (t * (t + 1) / 2 < x)
    {
        t++;
    }
    
    std::cout << t << std::endl;

    return 0;
}

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

int main()
{
	int n;
	int x;
	scanf("%d", &n);
	int c = 0;
	for(int i = 1; i <= n; i++) {
		scanf("%d", &x);
		if(i % 2 && x % 2)c++;
	}
	printf("%d", c);
}


Measured memory_bytes: 3764
// Copyright lzt
#include<stdio.h>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<cmath>
#include<iostream>
#include<queue>
#include<string>
#include<ctime>
using namespace std;
typedef long long ll;
typedef std::pair<int, int> pii;
typedef long double ld;
typedef unsigned long long ull;
typedef std::pair<long long, long long> pll;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define rep(i, j, k)  for (register int i = (int)(j); i <= (int)(k); i++)
#define rrep(i, j, k) for (register int i = (int)(j); i >= (int)(k); i--)
#define Debug(...) fprintf(stderr, __VA_ARGS__)

inline ll read() {
  ll x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch <= '9' && ch >= '0') {
    x = 10 * x + ch - '0';
    ch = getchar();
  }
  return x * f;
}

const int maxn = 200200;
int n, m;
int l[maxn], r[maxn], a[maxn];
ll sum[maxn];
vector<int> vec[maxn];

#define lc (i << 1)
#define rc (i << 1 | 1)
struct Node {
  int l, r;
  ll val, tag;
} tr[maxn << 2];

void build(int i, int l, int r) {
  tr[i].l = l; tr[i].r = r;
  if (tr[i].l == tr[i].r) return;
  int md = (l + r) >> 1;
  build(lc, l, md); build(rc, md + 1, r);
}
void pushdown(int i) {
  if (!tr[i].tag) return;
  tr[lc].val += tr[i].tag;
  tr[rc].val += tr[i].tag;
  tr[lc].tag += tr[i].tag;
  tr[rc].tag += tr[i].tag;
  tr[i].tag = 0;
}
void add(int i, int l, int r, ll v) {
  if (tr[i].l >= l && tr[i].r <= r) {
    tr[i].val += v; tr[i].tag += v;
    return;
  }
  if (tr[i].l > r || tr[i].r < l) return;
  pushdown(i);
  add(lc, l, r, v); add(rc, l, r, v);
  tr[i].val = max(tr[lc].val, tr[rc].val);
}
ll ask(int i, int l, int r) {
  if (tr[i].l >= l && tr[i].r <= r) return tr[i].val;
  if (tr[i].l > r || tr[i].r < l) return -1e18;
  pushdown(i);
  return max(ask(lc, l, r), ask(rc, l, r));
}

void work() {
  n = read(), m = read();
  rep(i, 1, m) {
    l[i] = read(), r[i] = read();
    a[i] = read(); sum[l[i]] += a[i]; vec[r[i]].pb(i);
  }
  build(1, 0, n);
  ll ans = 0;
  rep(i, 1, n) {
    add(1, 0, i - 1, sum[i]);
    ll nw = ask(1, 0, i - 1);
    ans = max(ans, nw);
    add(1, i, i, nw);
    rep(j, 0, vec[i].size() - 1) {
      int x = vec[i][j];
      add(1, 0, l[x] - 1, -a[x]);
    }
  }
  printf("%lld\n", ans);
}

int main() {
  #ifdef LZT
    freopen("in", "r", stdin);
  #endif

  work();

  #ifdef LZT
    Debug("My Time: %.3lfms\n", (double)clock() / CLOCKS_PER_SEC);
  #endif
}


Measured memory_bytes: 29824
N,K=map(int,input().split())
s=input()
ans=0
l1=[]
l2=[]
for i in range(N-1):
  if s[i:i+2]=='LR':
    l1.append(i)
  elif s[i:i+2]=='RL':
    l2.append(i)
  elif s[i]=='L' and s[i+1]=='L':
    ans+=1
  elif s[i]=='R' and s[i+1]=='R':
    ans+=1

while K>0 and len(s)-2>ans:
  ans+=2
  K-=1
if len(s)-2<=ans and K>=1:
  ans=len(s)-1
print(ans)

Measured memory_bytes: 7168
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws Exception {
        try (Scanner sc = new Scanner(System.in)) {
            int A = sc.nextInt();
            int B = sc.nextInt();

            if (A >= 13) {
                System.out.println(B);
            } else if (A >= 6) {
                System.out.println(B / 2);
            } else {
                System.out.println(0);
            }
        }
    }

}


Measured memory_bytes: 23764
#include <iostream>
#include <string>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
using namespace std;

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

int main(){
    int N;
    cin >> N;
    map<ll, int> mp;
    rep(i, N){
        ll a;
        cin >> a;
        mp[a]++;
    }
    int cnt = 0;
    for(auto p : mp){
        if(p.second % 2 == 1) cnt++;
    }
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 6528
#include <iostream>
#include <algorithm>
#include <set>

struct people
{
	int a, b, c;
};

bool compare(people x, people y)
{
	return x.a - x.b < y.a - y.b;
}

int main()
{
	int x, y, z;
	std::cin >> x >> y >> z;
	int n = x + y + z;
	
	long long int ans = 0, silver[100010] = { 0 }, gold[100010] = { 0 };
	people guy[100010] = { 0 };
	
	for (int i = 0; i < n; ++i)
	{
		std::cin >> guy[i].a >> guy[i].b >> guy[i].c;
		guy[i].a -= guy[i].c;
		guy[i].b -= guy[i].c;
		
		ans += guy[i].c;
		guy[i].c = 0;
	}
	
	std::sort(guy, guy + n, compare);
	
	std::multiset<int> s;
	long long int curSum = 0;
	for (int i = 0; i < n; ++i)
	{
		curSum += guy[i].b;
		s.insert(guy[i].b);
		
		if (s.size() > y)
		{
			curSum -= *s.begin();
			s.erase(s.begin());
		}
		
		silver[i] = curSum;
	}
	
	curSum = 0;
	s.clear();
	for (int i = n - 1; i >= 0; --i)
	{
		curSum += guy[i].a;
		s.insert(guy[i].a);
		
		if (s.size() > x)
		{
			curSum -= *s.begin();
			s.erase(s.begin());
		}
		
		gold[i] = curSum;
	}
	
	long long int ans2 = 0;
	
	for (int i = y - 1; i < n - x; ++i)
		ans2 = std::max(ans2, ans + gold[i + 1] + silver[i]);
	
	std::cout << ans2;
}

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

#define sz(s) (int)(s).size()
#define re(i, n) for (int i = 1; i <= n; i ++)
#define pb push_back
#define finish(x) return cout << x << endl, 0
#define MP make_mair
#define trav(x, a) for(auto& x: a)
#define all(x) (x).begin,(x).end()
#define Sor(x) sort(all(x))
#define REV(x) reverse(all(x))
#define F first
#define S second
#define I insert
#define N 222222
#define MOD 100000007

using namespace std;

typedef long long ll;
vector <ll> vll;
template <class T> bool umin(T& a, T b) {if(a>b){a = b; return 1;}return 0;}
template <class T> bool umax(T& a, T b) {if(a<b){a=b; return 1;}return 0;}
template <class T, class TT> bool pal(T a, TT n){int k = 0; for(int i =0; i <= n / 2; i ++){if(a[i]!=a[n-i-1]){k=1;break;}}return k?0:1;}

ll powmod(ll a, ll b, ll m = MOD){ll r = 1;while(b>0){if(b&1)r=r*a%m;a=a*a%m;b>>=1;}return r;}

map<string, int> mp;
int main()
{	
	int n, mx = 0;
	cin >> n;
	while (n --)
	{
		string s;
		cin >> s;
		mp[s] ++;
	}
	set<string> se;
	for (auto it : mp)
	{
		mx = max(mx, it.second);
	}
	for (auto it : mp)
	{
		if (it.second == mx)
		{
			se.insert(it.first);
		}
	}
	for (auto it :se)
	{
		cout << it << '\n';
	}









	getchar();
	getchar();
	return 0;
}

Measured memory_bytes: 34560
n, m = gets.split.map(&:to_i)

a = []
n.times do |i|
	a[i] = gets.split.map(&:to_i)
end

b = []
m.times do |j|
	b.push(gets.chomp.to_i)
end

c = []
n.times do |i|
	c[i] = 0
end

n.times do |i|
	m.times do |j|
		c[i] += a[i][j] * b[j]
	end
	puts c[i]
end

Measured memory_bytes: 6132
local n, m = io.read("*n", "*n")
local t = {}
for i = 1, n do
  t[i] = {}
end
local x = {}
local y = {}
local p = {}
for i = 1, m do
  x[i] = 1
  local pi, yi = io.read("*n", "*n")
  y[i] = yi
  p[i] = pi
  table.insert(t[pi], i)
end
for i = 1, n do
  table.sort(t[i], function(a, b) return y[a] < y[b] end)
  for j = 1, #t[i] do
    local z = t[i][j]
    x[z] = j
  end
end
for i = 1, m do
  print(string.format("%06d%06d", p[i], x[i]))
end


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

template<class S>S sum(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
ll min(int a,ll b){return min((ll)a,b);} ll min(ll a,int b){return min(a,(ll)b);}
template <class S> void print(vector<S> &v){for(ll i=0; i<(ll)v.size(); i++){cerr << v[i] << ' ';}cerr << endl;}
template <class S> void print(vector<vector<S>> &v) {for (ll i = 0; i < (ll)v.size(); i++) {for (ll j = 0; j < (ll)v[i].size(); j++) {cerr << v[i][j] << ' ';}cerr << endl;}}

int main(){
	int n,k; cin >> n >> k;
	string s; cin >> s;
	s[k-1] += ('a'-'A');
	cout << s << endl;
}

Measured memory_bytes: 3632
def main():
    n, m, x = map(int, input().split())
    a_ = [int(i) for i in input().split()]

    p1 = 0
    for i in range(x, 0, -1):
        if i in a_:
            p1 += 1

    p2 = 0
    for i in range(x, n):
        if i in a_:
            p2 += 1

    print(min([p1, p2]))


if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
int N, M, Q; 
long long sum;
pair<long long, pair<int, int>> E[400010]; 
vector<pair<int, long long>> G[4010]; 
int par[4010]; 
int depth[4010]; 
int sz[4010]; 
void init(){
	for(int i = 0; i < N; i++){
		par[i] = i; depth[i] = 0; sz[i] = 1; 
	}
}
int find(int x){
	if(par[x] == x){
		return x;
	}
	else{
		return par[x] = find(par[x]); 
	}
}
void unite(int x, int y){
	x = find(x); 
	y = find(y); 
	if(x == y) return;
	else if(depth[x] < depth[y]){
		par[x] = y; 
		sz[y] += sz[x]; 
	}else{
		par[y] = x; 
		sz[x] += sz[y];  
		if(depth[x] == depth[y]) depth[x] ++; 
	}
}
bool same(int x, int y){
	return find(x) == find(y); 
}
int siz(int x){
	return sz[find(x)]; 
}
long long mx[4010][4010]; 
void dfs(int r, int v, int p, long long m){
	mx[r][v] = m; 
	for(auto a : G[v]){
		if(a.first == p) continue; 
		long long tmp = m; 
		dfs(r, a.first, v, max(m, a.second)); 
		m = tmp; 
	}
}
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0); 
	cin >> N >> M; 	
	for(int i = 0; i < M; i++){
		cin >> E[i].second.first >> E[i].second.second >> E[i].first; 
		E[i].second.first --; E[i].second.second --; 
	}
	sort(E, E+M); 
	init();  
	for(int i = 0; i < M; i++){
		int a = E[i].second.first; int b = E[i].second.second; 
		if(same(a, b)) continue; 
		unite(a, b); 
		G[a].emplace_back(b, E[i].first); 
		G[b].emplace_back(a, E[i].first); 
		sum += E[i].first; 
	}
	for(int i = 0; i < N; i++) dfs(i, i, -1, 0);
	cin >> Q; 
	while(Q--){
		int S, T; cin >> S >> T; 
		S--; T--; 
		cout << sum - mx[S][T] << "\n"; 
	}
}

Measured memory_bytes: 133632
#include<bits/stdc++.h>
using namespace std;
char a[10000],b[10000],c[10000];
int main()
{
	int i,j,k,t;
	scanf("%s",a);
	scanf("%s",b);
	for(i=0;i<strlen(a);i++)
	{
		k=0;
		for(j=strlen(b)-i;j<strlen(b);j++,k++)
		{
			c[k]=b[j];
		}
		for(t=0;t<j-i;t++,k++)
		{
			c[k]=b[t];
		}
		if(strcmp(c,a)==0)
		{
			printf("Yes");
			return 0;
		}
	}
	printf("No");
	return 0;
} 

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <numeric>
#include <iostream>

using namespace std;

#define FOR(i, a, b)   for(int i = (a); i < (b); ++i)
#define RFOR(i, a, b)  for(int i = (a); i > (b); --i)
#define rep(i, n)	   for(int i = 0; i < (n); ++i)
#define all(c)		   begin(c), end(c)
#define rall(c)		   rbegin(c), rend(c)
#define SZ(a)		   ((ll) a.size())

typedef long long		   ll;
typedef unsigned long long ull;


int main(){
	char x,y;
	scanf("%c %c",&x,&y);
	if(x<y) printf("<");
	else if(x>y) printf(">");
	else printf("=");
	return 0;
}


Measured memory_bytes: 764
#pragma gcc optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = 1e9 + 7;

int main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int n; ll k;
    cin >> n >> k;
    vector<vector<ll>> a(n, vector<ll>(n));
    for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j)
        cin >> a[i][j];
    vector<vector<ll>> res(n, vector<ll>(n));
    for (int i = 0; i < n; ++i) res[i][i] = 1;
    auto mul = [&] (const vector<vector<ll>>& a, const vector<vector<ll>>& b) {
        vector<vector<ll>> c(n, vector<ll>(n));
        for (int i = 0; i < n; ++i)
        for (int k = 0; k < n; ++k)
        for (int j = 0; j < n; ++j)
            (c[i][j] += a[i][k] * b[k][j] % MOD) %= MOD;
        return c;
    };
    for(; k; k >>= 1, a = mul(a, a))
        if (k & 1) res = mul(res, a);
    ll ans = 0;
    for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j)
        (ans += res[i][j]) %= MOD;
    cout << ans << '\n';
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define OJ \
        freopen("input.txt","r",stdin); \
        freopen("output.txt","w",stdout);

int main()
{ 
   
//  OJ;
   ios_base::sync_with_stdio(false);
   cin.tie(NULL);
 ll int n;
  string s;
  cin>>n;
  while(n>0)
  {
     n--;
     s+='a'+n%26;
      n/=26;
  }
  for(int i=s.size()-1;i>=0;i--)
  {
      cout<<s[i];
  }
}

Measured memory_bytes: 3620
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<map>
#include<cstdio>
#include<stack>
#include<queue>
#include<fstream>
#include<cstdio>
#include<deque>
#include<iomanip>

using namespace std;
#define ok1 printf("ok1\n");
#define ok2 printf("ok2\n");
#define M 1000000000000000000LL
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(g);(i)--)
#define all(a) (a).begin(),(a).end()
#define reall(a) (a).rbegin(),(a).rend()
#define pb push_back
#define pf push_front
#define MIN(a,b) a=min((a),(b))
#define MAX(a,b) a=max((a),(b))
#define SIZE(v) (int)v.size()
const double pi = acos(-1.0);

typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef deque<ll> dll;
ll mod = 1e9 + 7;


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

	string s;
	cin >> s;
	string x[2] = { "+","-" };
	int a, b, c, d;
	a = s[0] - '0';
	b = s[1] - '0';
	c = s[2] - '0';
	d = s[3] - '0';

	for (int i = 0; i < 2; i++) {
		for (int j = 0; j < 2; j++) {
			for (int k = 0; k < 2; k++) {
				int ans = a;
				if (i == 0) ans += b;
				else ans -= b;
				if (j == 0) ans += c;
				else ans -= c;
				if (k == 0) ans += d;
				else ans -= d;
				if (ans == 7) {
					cout << a << x[i] << b << x[j] << c << x[k] << d << "=7" << endl;
					return 0;
				}
			}
		}
	}
	cout << "-1" << endl;
	return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;

class hoge{
    public:
    string s;
    int p;
    int idx;
    bool operator < (const hoge &h)const{
        if(s != h.s)return s < h.s;
        return -p < -h.p;
    }
};

int main(){
    
    ll N;
    cin >> N;
    vector<hoge>v(N);
    for(int i = 0; i < N; i++){
        cin >> v[i].s >> v[i].p;
        v[i].idx = i + 1;
    }
    sort(v.begin(), v.end());
    for(int i = 0; i < N; i++){
        cout << v[i].idx << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long int ll;

ll dp[110][21];

int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	int n; cin >> n;
	vector<int> a(n);
	for(int i=0;i<n;i++){
		cin >> a[i];
	}
	dp[0][a[0]]=1;
	for(int i=0;i<n-2;i++){
		for(int j=0;j<=20;j++){
			if(dp[i][j]==0)continue;
			if(j+a[i+1]<=20){
				dp[i+1][j+a[i+1]]+=dp[i][j];
			}
			if(j-a[i+1]>=0){
				dp[i+1][j-a[i+1]]+=dp[i][j];
			}
		}
	}
	cout << dp[n-2][a[n-1]] << endl;
}


Measured memory_bytes: 3212
N = int(input())
cnt = [[0] * 10 for _ in range(10)]
for i in range(1, N+1):
    i = str(i)
    l = int(i[0])
    r = int(i[-1])
    cnt[l][r] += 1
ans = 0
for l in range(10):
    for r in range(10):
        ans += cnt[l][r] * cnt[r][l]
print(ans)

Measured memory_bytes: 3064
def main():
    N = int(input())
    B = [(b, i) for i, b in enumerate(map(int,input().split()))]
    B.sort()
    m2 = B[N//2][0]
    m1 = B[N//2-1][0]
    if m1 == m2:
        for i in range(N):
            print(m1)
        return

    ans = [0] * N
    for b, i in B:
        if b <= m1:
            ans[i] = m2
        else:
            ans[i] = m1
    print('\n'.join(map(str,ans)))
    # print(B)
# 1 2 2 2 
# 1 1 1 1 
main()

Measured memory_bytes: 122112
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <tuple>
#include <vector>

using namespace std;
typedef long long int ll;
typedef vector<int> vi;
typedef vector<vi> vvi;

#define INF (1e9)

int H, W;

int main() {
    cin >> H >> W;

    vector<string> S(H);
    for (int i = 0; i < H; i++) {
        cin >> S[i];
    }

    vvi addresR(H, vi(W, 0));
    vvi countR(H, vi(W, 0));
    for (int i = 0; i < H; i++) {
        int k = 0;
        for (int j = 0; j < W; j++) {
            if (S[i][j] == '.') {
                addresR[i][j] = k;
                countR[i][k]++;
            } else {
                k++;
            }
        }
    }

    vvi addresC(H, vi(W, 0));
    vvi countC(H, vi(W, 0));
    for (int j = 0; j < W; j++) {
        int k = 0;
        for (int i = 0; i < H; i++) {
            if (S[i][j] == '.') {
                addresC[i][j] = k;
                countC[k][j]++;
            } else {
                k++;
            }
        }
    }

    int ans = 0;
    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            if (S[i][j] != '.')
                continue;
            int x = countR[i][addresR[i][j]];
            x += countC[addresC[i][j]][j];
            ans = max(ans, x - 1);
        }
    }

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


Measured memory_bytes: 69248
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextString() string {
	if !sc.Scan() {
		panic("failed scan string")
	}
	return sc.Text()
}

func nextInt() int {
	if !sc.Scan() {
		panic("failed scan int")
	}
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	sc.Split(bufio.ScanWords)

	n := nextInt()
	max := 100
	var sum int
	for i := 0; i < n; i++ {
		p := nextInt()
		if p > max {
			max = p
		}
		sum += p
	}
	fmt.Println(sum - (max / 2))
}


Measured memory_bytes: 640
import java.util.*;
public class Main
{
  public static void main(String[] args)
  {
    Scanner input = new Scanner(System.in);
    String s = input.next();
    
    int i=0,j=s.length()-1;
    int g = 0;
    while(i<j)
    {
      if(s.charAt(i)!=s.charAt(j))
        	g++;
      i++;
      j--;
    }
    
    System.out.println(g);
   }
}


Measured memory_bytes: 22996
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str;


		while((str=br.readLine()) != null){
			int d = Integer.parseInt(str);
			int area=0;

			for(int i=0; i<600; i += d){
				area += (i*i*d);
			}

			System.out.println(area);

		}
	}

}

Measured memory_bytes: 16868
#include <bits/stdc++.h>
#define fi first
#define se second
#define REP(i, a, b) for (int i = (a); i <= (b); ++i)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORD(i, a, b) for(int i = (a); i > (b); --i)
#define REPD(i, a, b) for(int i = (a); i >=(b); --i)
#define TR(it, a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); ++it)
#define endl '\n'
#define mp make_pair
#define pb push_back
#define ins insert
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define unmap unordered_map
#define lb lower_bound //first pos >= val
#define ub upper_bound // first pos > val
#define debug(a) cout << a << endl
using namespace std;

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

const ll maxN = 1e18;
const ll minN = -1e18;
const ll MOD = 1e9 + 7;
const ll MOD1 = 998244353;
const int bignumlen = 2200;
const int Blen = 8;
const ll base = 100000000;
const int baseHash = 31;
const ld PI = acos(-1);

//Remember limit for IT, etc...
const ll limit = 2e5 + 5;
const ll limit1 = 1e6 + 5;
//If TLE let's use int instead of ll

ll k;
ll d = 0;
ll a[limit];

void bfs() {
    queue <ll> q;
    REP(i, 1, 9) q.push(i);

    while (!q.empty()) {
        ll cur = q.front();
        q.pop();

        d++;
        a[d] = cur;
        if (d == k) return;

        if (cur % 10 != 0)
            q.push(cur * 10 + cur % 10 - 1);
        q.push(cur * 10 + cur % 10);
        if (cur % 10 != 9)
            q.push(cur * 10 + cur % 10 + 1);
    }
}

void solveProblem() {
    bfs();
    cout << a[k];
}

void fastInput() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}

void readInput() {
    cin >> k;
}

int main() {
    fastInput();
    readInput();
    solveProblem();
}



Measured memory_bytes: 2560
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class Main {

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");

		int n = Integer.parseInt(str[0]);
		int m = Integer.parseInt(str[1]);

		int h[] = new int[n];

		str = br.readLine().split(" ");
		for (int i = 0; i < n; i++) {
			h[i] = Integer.parseInt(str[i]);
		}

		ArrayList<ArrayList<Integer>> edge = new ArrayList<>();

		for (int i = 0; i < n; i++)
			edge.add(new ArrayList<>());

		for (int i = 0; i < m; i++) {
			str = br.readLine().split(" ");
			int a = Integer.parseInt(str[0]) - 1;
			int b = Integer.parseInt(str[1]) - 1;

			edge.get(a).add(b);
			edge.get(b).add(a);
		}

		int ans = 0;
		for (int i = 0; i < n; i++) {
			boolean flag = false;
			for (int j = 0; j < edge.get(i).size(); j++) {
				int id = edge.get(i).get(j);
				if (h[i] <= h[id]) {
					flag = true;
					break;
				}
			}
			if (!flag) {
				ans++;
			}
		}

		System.out.println(ans);
	}
}


Measured memory_bytes: 66632
import java.util.*;
import java.io.*;
import java.awt.geom.*;
import java.math.*;

public class Main {

	static final Scanner in = new Scanner(System.in);
	static final PrintWriter out = new PrintWriter(System.out,false);

	static boolean solve() {
		double q = in.nextInt();
		if (q == -1) return false;
		double x = q/2;
		while (Math.abs(x*x*x-q) >= 0.00001*q) {
			x = x - (x*x*x-q)/(3*x*x);
		}
		out.printf("%.8f\n",x);
		return true;
	}

	public static void main(String[] args) {
		long start = System.currentTimeMillis();

		while(solve());
		out.flush();

		long end = System.currentTimeMillis();
		//trace(end-start + "ms");
		in.close();
		out.close();
	}

	static void trace(Object... o) { System.out.println(Arrays.deepToString(o));}
}

Measured memory_bytes: 26372
# coding: utf-8
# Your code here!
import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
read = sys.stdin.read

#n,*w = [int(i) for i in read().split()]
#n,*t = map(int,read().split())

n = int(input())
#s = input()
#a,b = [int(i) for i in readline().split()]



def get(x):
    if x == 1:
        return 1
        
    return 1+2*get(x//2)




print(get(n))

Measured memory_bytes: 3060
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

int main(){
  int N;
  cin>>N;
  vector<int>a(N);
  for(int i=0;i<N;i++)
    cin>>a[i];
  sort(a.begin(),a.end());
  cout<<a[N-1]-a[0]<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define rep1(i,n) for (int i = 1; i <= (n); i++)
#define repm(i,m,n) for (int i = m; i < (n); i++)
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;

int main() {
  vi A(3);
  rep(i,A.size()) cin >> A.at(i);
  
  sort(A.begin(), A.end());
  
  cout << A.at(2)-A.at(0) << endl; 
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <tuple>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <numeric>
#include <string.h>
using namespace std;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<29;
const long long INFL = 1e18;
const int MOD = 1000000007;
const int MAX = 210000;

int gcd(int a, int b) {
    return b != 0 ? gcd(b, a % b) : a;
}

//逆元を求める関数
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;
}

void solve() {
	int a; cin >> a;
	int b; cin >> b;
	int c; cin >> c;
	int x; cin >> x;
	int ans = 0;
	for (int i = 0; i <= a; ++i) {
		for (int j = 0; j <= b; ++j) {
			for (int k = 0; k <= c; ++k) {
				int money = (500 * i + 100 * j + 50 * k) ;
				if (money == x) {
					ans++;
				}
			}
		}
	}
	cout << ans << endl;
    return;
}

int main() {
    solve();
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main() {
	char A[50][50];
	char B[50][50];
	bool can = false;
	int M, N;



	cin >> M >> N;
	for (int i = 0; i < M; i++)
	{
		for (int j = 0; j < M; j++)
		{
			cin >> A[i][j];
		}
	}

	for (int i = 0; i < N; i++)
	{
		for (int j = 0; j < N; j++)
		{
			cin >> B[i][j];
		}
	}

	for (int i = 0; i < M; i++)
	{
		for (int j = 0; j < M; j++)
		{
			bool flg = true;
			for (int x = 0; x < N; x++)
			{
				for (int y = 0; y < N; y++)
				{
					if (A[i + x][j + y] != B[x][y]) {
						flg = false;
					}
				}
			}
			if (flg) {
				can = true;
			}
		}
	}
	if (can) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
using System.Collections.Generic;
using System;
using static System.Console;

namespace atcoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var str = Input.read;
            int front = int.Parse(str.Substring(0, 2));
            int backk = int.Parse(str.Substring(2));

            if (Ismanth(front) && Ismanth(backk))
            {
                System.Console.WriteLine("AMBIGUOUS");
            }
            else if (!Ismanth(front) && !Ismanth(backk))
            {
                System.Console.WriteLine("NA");
            }
            else if (Ismanth(front))
            {
                System.Console.WriteLine("MMYY");
            }
            else
            {
                System.Console.WriteLine("YYMM");
            }
        }
        private static bool Ismanth(int num)
        {
            if (num == 0)
                return false;
            if (num < 13)
                return true;
            return false;

        }

        public class Input
        {

            public static string read => ReadLine();
            public static int[] ar => Array.ConvertAll(read.Split(' '), int.Parse);
            public static int num => Convert.ToInt32(read);
            public static long[] arL => Array.ConvertAll(read.Split(' '), long.Parse);
            public static long numL => Convert.ToInt64(read);
            public const string Alfa = "abcdefghijklmnopqrstuvwxyz";
            public const int MOD = 1000000007;
        }
    }
}


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

#define int         long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define rep(i,a,b)  for(int i=a;i<b;i++)
using namespace std;
int n,ans;
void solve(){
	cin>>n;
	rep(i,1,n+1){
		rep(j,1,n+1){
			rep(k,1,n+1){
				ans+=__gcd(__gcd(i,j),k);
			}
		}
	}
	cout<<ans<<endl;
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}

Measured memory_bytes: 3648
/***********************
*  Author: xuziyuan    * 
***********************/

#include <bits/stdc++.h>

#define rt0 return 0
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define replet(c) for(char c='a';c<='z';c++) 
#define LL long long
#define pii pair <int,int>
#define pb push_back
#define fi first
#define se second
#define mpr make_pair
#define sqr(a) ((a)*(a))

using namespace std;

const LL MOD=1e9+7;

int n,p;
string s;
vector <pair <string,pii> > v;

bool cmp(pair <string,pii> a,pair <string,pii> b)
{
	if(a.fi<b.fi) return true;
	if(b.fi<a.fi) return false;
	return a.se.fi>b.se.fi;
}

int main()
{
	cin>>n;
	rep(i,n)
	{
		cin>>s>>p;
		v.pb({s,{p,i+1}});
	}
	sort(v.begin(),v.end(),cmp);
	rep(i,n) cout<<v[i].se.se<<endl;
	rt0;
}

Measured memory_bytes: 256
N, Q = map(int, input().split())
S = input()
t = [0] * (N + 1)
for i in range(N):
  t[i + 1] = t[i] + (1 if S[i : i + 2] == 'AC' else 0)
for i in range(Q):
  l, r = map(int, input().split())
  print(t[r-1] - t[l-1])

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

using namespace std;
#define all(a)a.begin(),a.end()
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod = int(1e9)+7;
using P = pair<ll,ll>;

int main(){
    long double a,b;
    cin>>a>>b;
    long double ans=a*b;
    cout <<(ll)ans<<endl;
    return 0;
}

Measured memory_bytes: 3732
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define fi first
#define se second

int a[4]={0,0,-1,1};
int b[4]={1,-1,0,0};

int main(){
    int h,w;
    ll ans=0;
    cin >> h >> w;
    queue<int> q,r;
    vector<vector<char>> v(h,vector<char>(w));
    for(int i=0;i < h;i++)
    {
        for(int j=0;j < w;j++)
        {
            cin >> v.at(i).at(j);

            if(v.at(i).at(j)=='#'){
                q.push(i);
                q.push(j);
            }
        }
    }
    bool flag2=true;
    bool flag = false;

    while(q.size()>0 || r.size()>0){
        flag = false;
        
        while(q.size()>0 && flag2==true){
            int x=q.front();
            q.pop();
            int y=q.front();
            q.pop();
        for(int i=0;i < 4;i++)
        {
            
            if(0<= x+a[i] && x+a[i]<h && 0<=y+b[i] && y+b[i]<w && v.at(x+a[i]).at(y+b[i])=='.'){
                r.push(x+a[i]);
                r.push(y+b[i]);
                v.at(x+a[i]).at(y+b[i])='#';
                flag = true;
            }
        }
        }
        if(flag){ans++;}
        
        flag2 = false;

        
        while(r.size()>0 && flag == true){
            int x=r.front();
            r.pop();
            int y=r.front();
            r.pop();
        for(int i=0;i < 4;i++)
        {   
            if(0<= x+a[i] && x+a[i]<h && 0<=y+b[i] && y+b[i]<w && v.at(x+a[i]).at(y+b[i])=='.'){
                q.push(x+a[i]);
                q.push(y+b[i]);
                v.at(x+a[i]).at(y+b[i])='#';
                flag2 = true;
            }
        }
        }
        if(flag2){ans++;}

    }
    cout << ans << endl;
}

Measured memory_bytes: 9488
#include <iostream>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <iterator>
#include <math.h>
#include <cstdlib>
#include <cmath>

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define dump(x)  cerr << #x << " = " << (x) << endl;
using namespace std;
int main(){
  string str;
  cin >> str;
  int ans = 700;
  FOR(i,0,3){
    if(str[i] == 'o') ans += 100;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
n,s=map(int,input().split())
a=list(map(int,input().split()))
mod=998244353
import numpy as np
dp=np.zeros((n+1,3001),int)
# dp[j]:総和がjになるようにできる空でない部分集合の個数。
dp[0][0]=1 # 遷移用、実際は0

for i in range(n):
  dp[i+1]+=dp[i]*2
  dp[i+1,a[i]:]+=dp[i,:-a[i]]
  dp[i+1]%=mod
print(dp[n][s])

#print(dp)

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

int main() {
    string s;
    cin >> s;
    int result = 0;
    string prev, current;
    for (int i = 0; i <= s.size(); i++) {
        if (!current.empty() && current != prev) {
            result++;
            prev = current;
            current.clear();
        }
        current.push_back(s[i]);
    }
    cout << result;
    return 0;
}

Measured memory_bytes: 640
import java.util.Scanner;

class Main
{
	public static void main(String[] args)
	{
		Scanner sc=new Scanner(System.in);
		int N=sc.nextInt(),K=sc.nextInt();
		int[] x=new int[N];
		int max=0;
		for(int i=0;i<N;i++)
		{
			x[i]=sc.nextInt();
			max=((int)Math.abs(x[i])<=(int)Math.abs(x[i]-K))?max+2*(int)Math.abs(x[i]):max+2*(int)Math.abs(x[i]-K);
		}
		System.out.println(max);
	}
}


Measured memory_bytes: 21460
#include<iostream>
#include<string>
using namespace std;
int main(){
	int n;
	int y,m,d;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>y>>m>>d;
		long long count;
		count=(y-1)*195;
		count+=(y-1)/3*5;
		count+=(m-1)*20;
		if(y%3!=0)
			count-=(m-1)/2;
		count+=d;
		cout<<196471-count<<endl;
	}
    return 0;
}

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

class Program {
    static void Main() {
        while(true) {
            string[] stdin = Console.ReadLine().Split();
            if(stdin[1] == "?") break;
            int a = int.Parse(stdin[0]);
            int b = int.Parse(stdin[2]);
            if(stdin[1] == "+") Console.WriteLine(a + b);
            else if(stdin[1] == "-") Console.WriteLine(a - b);
            else if(stdin[1] == "*") Console.WriteLine(a * b);
            else if(stdin[1] == "/") Console.WriteLine(a / b);
        }
    }
}


Measured memory_bytes: 15984
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define EFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i, n) FOR(i,0,n)

int main(void){
    ll a,b,c,d;
    ll ans = 0;
    cin >> a >> b >> c >> d;
    ans = max({a*c,a*d,b*c,b*d});
    cout << ans << endl; 
    return 0;
}

Measured memory_bytes: 3668
#include <bits/stdc++.h>
#define err(args...) {}
#ifdef DEBUG
#include "_debug.cpp"
#endif
using namespace std;
using ll = long long;
using ld = long double;
template <typename T> using lim = numeric_limits<T>;
template <typename T> istream& operator>>(istream& is, vector<T>& a) { for(T& x : a) { is >> x; } return is; }
template <typename T> struct grid : public vector<vector<T>> {
    int n, m;
    grid(int n, int m) : vector<vector<T>>(n, vector<T>(m)), n(n), m(m) {}
    grid(int n, int m, T zero) : vector<vector<T>>(n, vector<T>(m, zero)), n(n), m(m) {}
    grid(const grid& a) : vector<vector<T>>(a), n(a.n), m(a.m) {}
};
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n, W;
    cin >> n >> W;
    vector<ll> w(n + 1), v(n + 1);
    for(int i = 1; i <= n; i++) {
        cin >> w[i] >> v[i];
    }
    ll V = accumulate(v.begin(), v.end(), 0ll);
    grid<ll> opt(n + 1, V + 1);
    for(int i = 0; i <= n; i++) {
        for(int c = 0; c <= V; c++) {
            if(i == 0 and c == 0) {
                opt[i][c] = 0;
            } else if(i == 0 and c > 0) {
                opt[i][c] = lim<ll>::max();
            } else {
                opt[i][c] = opt[i - 1][c];
                if(c - v[i] >= 0 and opt[i - 1][c - v[i]] < lim<ll>::max()) {
                    opt[i][c] = min(opt[i][c], opt[i - 1][c - v[i]] + w[i]);
                }
            }
        }
    }
    ll ans = 0;
    for(int c = 0; c <= V; c++) {
        if(opt[n][c] <= W) {
            ans = c;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 80256
#[allow(dead_code)]
fn main() {
    let n = i::u();
    let a = i::uv(n);
    let mut i = 1;
    for &k in &a {
        if k == 0 {
            println!("{}", 0);
            return;
        }
    }
    for k in a {
        if i > 1_000_000_000_000_000_000 / k {
            println!("{}", -1);
            return;
        }
        i = i * k;
    }
    if i > 1_000_000_000_000_000_000 {
        println!("{}", -1);
        return;
    }
    println!("{}", i);
}

#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::io::*;
#[allow(unused_imports)]
use std::num::*;
#[allow(unused_imports)]
use std::str::*;

#[allow(dead_code)]
mod i {
    use super::*;

    pub fn read<T: FromStr>() -> T {
        stdin()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>()
            .parse::<T>()
            .ok()
            .unwrap()
    }
    pub fn str() -> String {
        read()
    }
    pub fn s() -> Vec<char> {
        str().chars().collect()
    }
    pub fn i() -> i64 {
        read()
    }

    pub fn u() -> usize {
        read()
    }

    pub fn u2() -> (usize, usize) {
        (read(), read())
    }

    pub fn u3() -> (usize, usize, usize) {
        (read(), read(), read())
    }

    pub fn u4() -> (usize, usize, usize, usize) {
        (read(), read(), read(), read())
    }

    pub fn u5() -> (usize, usize, usize, usize, usize) {
        (read(), read(), read(), read(), read())
    }

    pub fn u6() -> (usize, usize, usize, usize, usize, usize) {
        (read(), read(), read(), read(), read(), read())
    }

    pub fn f() -> f64 {
        read()
    }

    pub fn c() -> char {
        read::<String>().pop().unwrap()
    }

    pub fn iv(n: usize) -> Vec<i64> {
        (0..n).map(|_| i()).collect()
    }

    pub fn iv2(n: usize) -> Vec<(i64, i64)> {
        (0..n).map(|_| iv(2)).map(|a| (a[0], a[1])).collect()
    }

    pub fn iv3(n: usize) -> Vec<(i64, i64, i64)> {
        (0..n).map(|_| iv(3)).map(|a| (a[0], a[1], a[2])).collect()
    }

    pub fn uv(n: usize) -> Vec<usize> {
        (0..n).map(|_| u()).collect()
    }

    pub fn uv2(n: usize) -> Vec<(usize, usize)> {
        (0..n).map(|_| uv(2)).map(|a| (a[0], a[1])).collect()
    }

    pub fn uv3(n: usize) -> Vec<(usize, usize, usize)> {
        (0..n).map(|_| uv(3)).map(|a| (a[0], a[1], a[2])).collect()
    }

    pub fn uv4(n: usize) -> Vec<(usize, usize, usize, usize)> {
        (0..n)
            .map(|_| uv(4))
            .map(|a| (a[0], a[1], a[2], a[3]))
            .collect()
    }

    pub fn fv(n: usize) -> Vec<f64> {
        (0..n).map(|_| f()).collect()
    }

    pub fn cmap(h: usize) -> Vec<Vec<char>> {
        (0..h).map(|_| s()).collect()
    }
}


Measured memory_bytes: 2796