akhauriyash/Code-Regression huggingface dataset:
#include <iostream>      // cout, endl, cin
#include <string>        // string, to_string, stoi
#include <vector>        // vector
#include <algorithm>     // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility>       // pair, make_pair
#include <tuple>         // tuple, make_tuple
#include <cstdint>       // int64_t, int*_t
#include <cstdio>        // printf
#include <map>           // map
#include <cmath>         // sqrt
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <deque>         // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset>        // bitset
#include <bits/stdc++.h> // isupper, islower, isdigit, toupper, tolower
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, n) for (int i = (a); i < (n); i++)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> Pl;
typedef pair<int, int> P;
typedef tuple<ll, ll, string> Tlls;

// Greatest Common Divisor (最大公約数)
ll gcd(ll a, ll b)
{
  // Eucledean algorithm
  while (a)
  {
    if (a < b)
    {
      std::swap(a, b);
    }
    a %= b;
  }
  return b;
}

// Least Common Multiple 最小公倍数
ll lcm(ll a, ll b)
{
  return a / gcd(a, b) * b;
}

// key: value of prime factor素因数分解
// value: number of prime factor
map<ll, ll> prime_factorization(ll n)
{
  map<ll, ll> prime_factors;
  for (ll i = 2; i * i <= n; i++)
  {
    while (n % i == 0)
    {
      prime_factors[i]++;
      n /= i;
    }
  }
  if (n != 1)
    prime_factors[n] = 1;
  return prime_factors;
}

// 約数リスト約数の列挙
vector<ll> get_divisors(const ll n)
{
  vector<ll> divs;
  for (ll i = 1; i < (ll)sqrt((ld)n) + 1; i++)
  {
    if (n % i == 0)
    {
      divs.push_back(i);
      if (i != n / i)
      {
        divs.push_back(n / i);
      }
    }
  }

  // 必要に応じてソート
  // sort(divs.begin(), divs.end());

  return divs;
}

int main()
{
  ll K, A, B;
  cin >> K >> A >> B;
  rep2(i, A, B + 1)
  {
    if (i % K == 0)
    {
      cout << "OK" << endl;
      return 0;
    }
  }

  cout << "NG" << endl;

  return 0;
}


Measured memory_bytes: 3692
#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;
typedef unsigned long long ull;
typedef long double ld;
const ll mod = 1000000007;
//const ll mod = 998244353;
const int inf = 1e9 + 10;
const ll INF = 1e18;
const ld EPS = 1e-10;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }

#define P pair<ll, ll>

int main() {
  ll w, h;
  cin >> w >> h;
  vector<ll> p(w), q(h);
  rep(i, w) cin >> p[i];
  rep(i, h) cin >> q[i];

  ll ans = 0, res = (w + 1) * (h + 1) - 1, resx = h + 1, resy = w + 1;
  priority_queue<P, vector<P>, greater<P>> pq;
  rep(i, w) pq.push(make_pair(p[i], 0));
  rep(i, h) pq.push(make_pair(q[i], 1));
  while (res > 0) {
    P a = pq.top();
    pq.pop();
    if (a.second == 0) {
      ans += a.first * min(res, resx);
      res -= resx;
      resy--;
    }
    else {
      chmin(resy, res);
      ans += a.first * min(res, resy);
      res -= resy;
      resx--;
    }
  }
  cout << ans << endl;
  




  
  return 0;
}

Measured memory_bytes: 8048
#include<bits/stdc++.h>
using namespace std;
int main(){
    long long int N,K,Q,A[100002],sum=0;
    map<int,int> mp;
    cin >> N >> K >> Q;
    for(int i=0;i<Q;i++){
        cin >> A[i];
        mp[A[i]]++;
        }
    for(int i=0;i<N;i++)
        cout << (K-Q+mp[i+1] > 0 ? "Yes" : "No") << endl;
    return 0;
}

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

using namespace std;

/// 17:19

const int Nmax = 2e5 + 5;

vector< vector< pair<int*, int> > > stk;
string ans;

bool high[Nmax];
int cost[Nmax], a[Nmax];
int n, i;

class AIB
{
    int a[Nmax];
    int ub(int x) { return (x&(-x)); }

public:
    int query(int x)
    {
        int ans = a[0];
        for(; x<=n; x+=ub(x)) ans = max(ans, a[x]);
        return ans;
    }

    void update(int p, int x)
    {
        for(; p; p-=ub(p))
            if(a[p] < x)
            {
                stk.back().push_back({a+p, a[p]});
                a[p] = x;
            }
    }

    void init(int val)
    {
        int i;
        for(i=0; i<=n; ++i) a[i] = val;
    }

} aib[2];

void build()
{
    int i, x, y;
    aib[0].init(0);
    aib[1].init(-1e9);

    for(i=n; i; --i)
    {
        stk.emplace_back();
        x = aib[0].query(a[i]);
        y = aib[1].query(a[i]);

        aib[cost[i]&1].update(a[i], x + cost[i]);
        aib[1^(cost[i]&1)].update(a[i], y + cost[i]);
    }
}

void refresh()
{
    for(auto it = stk.back().rbegin(); it != stk.back().rend(); ++it)
        *it->first = it->second;
    stk.pop_back();
}

bool check(int target, int last)
{
    if(target < 0) return 0;
    return aib[target&1].query(last+1) >= target;
}

int main()
{
   /// freopen("input", "r", stdin);
    cin.sync_with_stdio(false);

    cin >> n;
    for(i=1; i<=n; ++i) cin >> a[i];

    int Max = 0, cnt = 0;
    for(i=1; i<=n; ++i)
    {
        if(a[i] > Max) Max = a[i], high[i] = 1, ++cnt;
        cost[i] = high[i] + 1;
    }

    /*

    if((n&1) && cnt == n)
    {
        cout << "-1\n";
        return 0;
    }

    */

    build();

    if(!check(cnt, 0))
    {
        cout << "-1\n";
        return 0;
    }

    int last1 = 0, last2 = 0, dif = 0, new_dif, new_last, new_cnt;

    for(i=1; i<=n; ++i)
    {
        refresh();

        new_last = last1, new_dif = dif, new_cnt = cnt;

        if(a[i] > new_last)
        {
            --new_dif;
            if(high[i]) --new_cnt;
            new_last = a[i];
        }

        if(check(new_cnt - new_dif, last2) || check(new_cnt + new_dif, new_last))
        {
            ans.push_back('0');
            last1 = new_last, dif = new_dif, cnt = new_cnt;
        }
        else
        {
            ans.push_back('1');
            if(a[i] > last2)
            {
                last2 = a[i];
                if(high[i]) --cnt;
                ++dif;
            }
        }
    }

    assert(!dif);
    cout << ans << '\n';
    return 0;
}


Measured memory_bytes: 88748
N,M,X,Y= map(int, input().split())
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]

flag=False

xmax = max(x)
ymin = min(y)

if X >= ymin:
    flag = True

if Y <= xmax:
    flag = True

if ymin - xmax <= 0:
    flag = True

if flag == False:
    print("No War")

else:
    print("War")

Measured memory_bytes: 3064
D=int(input())
c=list(map(int,input().split()))
s=[list(map(int,input().split())) for i in range(D)]
lastday=[0 for j in range(26)]
points=[0 for i in range(D)]
t=[0 for i in range(D)]

# first day
lastday=[lastday[i]+1 for i in range(26)]
minus=[x*y for (x,y) in zip(c,lastday)]
firstday=minus.index(max(minus))
lastday[firstday]=0
t[0]=firstday+1

for days in range(1,D):
    temp=[x*y for (x,y) in zip(c,lastday)]
    totalminus=sum(temp)
    if max(s[days])<totalminus:
        today=temp.index(max(temp)) 
    else:
        today=s[days].index(max(s[days]))
    lastday=[lastday[i]+1 for i in range(26)]
    lastday[today]=0
    t[days]=today+1
    
for ts in t:
    print(ts)


Measured memory_bytes: 9552
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>

using namespace std;

//-------------------- Debugging Functions --------------------//

inline void print() {
    cout << '\n';
}
template <typename First, typename... Rest>
void print(const First &first, const Rest &... rest) {
    cout << first << ' ';
    print(rest...);
}

//------------------------- Libraries -------------------------//

//--------------------------- Solve ---------------------------//

const long long INF = 1LL<<60;

int N;
long long a[405];       // 累積和
long long dp[405][405];
bool flag[405][405];

long long rec(int l, int r) {
    if (l == r) return 0;
    if (flag[l][r]) return dp[l][r];
    flag[l][r] = true;

    long long res = INF;
    for (int i = l; i < r; i++) {
        res = min(res, rec(l, i) + rec(i+1, r));
    }
    long long sum = a[r] - (l ? a[l-1] : 0);
    res += sum;

    return dp[l][r] = res;    
}

void solve() {
    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> a[i];
        if (i) a[i] += a[i-1];
    }

    cout << rec(0, N-1) << '\n';
}

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

    solve();

    return 0;
}

Measured memory_bytes: 5104
# abc146_a.py
# https://atcoder.jp/contests/abc146/tasks/abc146_a

# A - Can't Wait for Holiday /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 100点

# 問題文
# 今日の曜日を表す文字列 Sが与えられます。
# Sは SUN,MON,TUE,WED,THU,FRI,SAT のいずれかであり、それぞれ日曜日、月曜日、火曜日、水曜日、木曜日、金曜日、土曜日を表します。
# 次の日曜日 (あす以降) が何日後か求めてください。

# 制約
#     Sは SUN,MON,TUE,WED,THU,FRI,SAT のいずれか

# 入力
# 入力は以下の形式で標準入力から与えられる。
# S

# 出力
# 次の日曜日が何日後か出力せよ。

# 入力例 1
# SAT

# 出力例 1
# 1

# 今日は土曜日です。よって、次の日曜日は 1日後です。

# 入力例 2
# SUN

# 出力例 2
# 7

# 今日は日曜日です。よって、次の日曜日は 7日後です。


global FLAG_LOG
FLAG_LOG = False


def log(value):
    # FLAG_LOG = True
    # FLAG_LOG = False
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    S = lines[0]
    # N = int(lines[0])
    # N, M = list(map(int, lines[0].split()))
    # values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[2].split()))
    # values = list()
    # for i in range(N):
    #     values.append(int(lines[i]))
    # valueses = list()
    # for i in range(N):
    #     valueses.append(list(map(int, lines[i+1].split())))

    if S == 'SUN':
        result = 7
    if S == 'MON':
        result = 6
    if S == 'TUE':
        result = 5
    if S == 'WED':
        result = 4
    if S == 'THU':
        result = 3
    if S == 'FRI':
        result = 2
    if S == 'SAT':
        result = 1

    return [result]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['SAT']
        lines_export = [1]
    if pattern == 2:
        lines_input = ['SUN']
        lines_export = [7]
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()


Measured memory_bytes: 9092
/*
AUTHOR: Aman Raj
LANG: C++
*/

using namespace std;

typedef   long long  int ll;
#include <bits/stdc++.h>


//setbase - cout << setbase (16); cout << 100 << endl; Prints 64
//setfill -   cout << setfill ('x') << setw (5); cout << 77 << endl; prints xxx77
//setprecision - cout << setprecision (14) << f << endl; Prints x.xxxx
//cout.precision(x)  cout<<fixed<<val;  // prints x digits after decimal in val
#define fast  ios_base::sync_with_stdio(false); cin.tie(0);  cout.tie(0);
#define all(a) a.begin(),a.end()
//#define mod 998244353


#define mod   1000000007

#define inf 1e18
//#define mod 3
#define flush fflush(stdout)

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef cc_hash_table<ll, ll, hash< ll > > ht;

// find_by_order()  // order_of_key
typedef tree<
    ll,
    null_type,
    less<ll>,
    rb_tree_tag,
    tree_order_statistics_node_update>
    ordered_set;






ll power1(ll a, ll b)//a raised to power b
   {  if(b<=0) return 1; if(b==1) return a;
       ll c=power1(a,b/2);
        c*=c;c%=mod;if(b%2==1) c*=a;c%=mod;
        return c;
   }
   ll mi(ll a,ll m)
   { ll c= power1(a,m-2);

     return c;
   }



 struct less_then_greater {
    template<typename T, typename U>
    bool operator()(T const& lhs, U const& rhs) const {
        if (lhs.first < rhs.first) return true;
        if (rhs.first < lhs.first) return false;
        return lhs.second > rhs.second;
    }
};

 /*std::priority_queue<std::pair<int, int>,
                    std::vector<std::pair<int, int>>,
                    less_then_greater
                    > pq;*/


  int main()
{  fast;
    ll x;cin>>x;
    x=1-x;cout<<x<<endl;
   return 0;
}


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

int main() {
    long long x;
    cin >> x;
    long long n = 100;

    int ans = 0;
    while(true) {
        n = (long long) (n * 1.01);
        ans++;
        if(n >= x) break;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3624
// ABC144A.cpp
#include <iostream>

using namespace std;
int main()
{
	int A, B,ans;
	cin >>A >> B;
	if (A<10&&B<10)
	{
		ans = A * B;
	}
	else
	{
		ans = -1;
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <map>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <set>
#include <vector>
#include <queue>
#include <list>
#include <numeric>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <math.h>
#include <stack>
#include <climits>
#include <bitset>

using namespace std;
typedef long long ll;

//最小公倍数
ll gcd(ll x, ll y) {
  ll tmp = 0;
  if (x < y){
    tmp=x;
    x=y;
    y=tmp;
  }
  while (y > 0) {
    ll r = x % y;
    x = y;
    y = r;
  }
  return x;
}

//最大公倍数
ll lcm(ll x,ll y){
  return x/gcd(x,y)*y;
}

//階乗
ll kaijo(ll k){
    ll sum = 1;
    for (ll i = 1; i <= k; ++i)
    {
        sum *= i;
        sum%=1000000000+7;
    }
    return sum;
}

//for(int i = ; i < ; i++){}


int main(){
  int n;
  cin>>n;
  if(n<10)cout<<n<<endl;
  else if(10<=n&&n<100)cout<<9<<endl;
  else if(100<=n&&n<1000)cout<<9+(n+1)-100<<endl;

  else if(1000<=n&&n<10000)cout<<909<<endl;
  else if(10000<=n&&n<100000)cout<<909+(n+1)-10000<<endl;
  else cout<<90909<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <utility>
#include <tuple>
#include <algorithm>
#include <numeric>
#include <cstdio>
#include <cmath>
#define rep(i, n) for(int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

int main() {
  ll X, Y;
  cin >> X >> Y;
  if (abs(X-Y) >= 2)
    cout << "Alice" << endl;
  else
    cout << "Brown" << endl;
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(void)
{
  //宣言
  unsigned int N,n;
  unsigned int AC=0,WA=0,TLE=0,RE=0;
  char si[4];
  char check[4] = {'A','W','T','R'};
  //入力
  scanf("%d",&N);
  for(n=0;n<N;n++)
  {
  	scanf("%s",si);
    if(si[0]==check[0])
    {
    	AC++;
    }else if(si[0]==check[1]){
      WA++;
    }else if(si[0]==check[2]){
      TLE++;
    }else if(si[0]==check[3]){
      RE++;
    }
  }
  //出力
  printf("AC x %d\n",AC);
  printf("WA x %d\n",WA);
  printf("TLE x %d\n",TLE);
  printf("RE x %d",RE);

  return 0;
}

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

using namespace std;
using ll =long long;
using vl=vector<ll>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;

const ll oo =0x3f3f3f3f3f3f3f3fLL;
const double eps=1e-9;

#define sz(c) ll((c).size())
#define all(c) begin(c),end(c)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define FOR(i,a,b) for(ll i=(a); i<(b); i++)
#define FORD(i,a,b) for(ll i=ll(b)-1;i>=(a);i--)
#define TR(X) ({if(1) cerr << "TR: " << (#X) << " = " << (X) << endl; })

int main(){ cin.sync_with_stdio(0);
    ll N; cin >> N;

    vector<pll> more_open, more_close;
    FOR(i, 0, N) {
        string S; cin >> S;

        ll open = 0, close = 0;
        for (char c : S)
        {
            if (c == '(') open ++;
            else open --;
            close = min(close, open);
        }

        close = -close;
        open += close;

        if (open >= close) {
            more_open.eb(close, open);
        } else if (open < close) {
            more_close.eb(close, open);
        }
    }

    sort(all(more_open));
    // sort(more_close.rbegin(), more_close.rend());
    // sort(all(more_close));
    // reverse(all(more_close));
    // sort(all(more_open), [](const pll& a, const pll& b) {
    //         ll adiff = a.xx - a.yy;
    //         ll bdiff = b.xx - b.yy;
    //         return adiff < bdiff;
    //         });

    sort(all(more_close), [](const pll& a, const pll& b) {
            if (a.yy == b.yy) {
                return a.xx < b.xx;
            }
            return a.yy < b.yy;
            });
    reverse(all(more_close));

    ll total_open = 0;

    bool possible = true;

    for (auto &v : {more_open, more_close}) {
        for (auto p : v) {
            ll open, close;
            tie(close, open) = p;

            total_open -= close;
            if (total_open < 0) possible = false;
            total_open += open;
        }
    }

    if (total_open != 0) {
        possible = false;
    }

    if (possible) cout << "Yes" << endl;
    else cout << "No" << endl;


    // Use all with open > close ORDERED BY close ASC (if not possible, it is impossible)
    // Reached max all_open number
    // Use all with open = close;
    // Use all with open < close ORDERED BY open DESC

} //cin.tie(0) bei schnellem Wechseln



Measured memory_bytes: 34624
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main() {
	long a, b,sum=0;
	char op;
	scanf("%ld %c %ld", &a, &op, &b);
	if (op == '+') {
		sum = a + b;
	}
	else {
		sum = a - b;
	}
	printf("%ld", sum);
}

Measured memory_bytes: 128
#include <iostream>

using namespace std;

int main()
{
    int N, p[16], maxp = 0, sump = 0;

    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> p[i];
        maxp = max(maxp, p[i]);
        sump += p[i];
    }
    cout << sump - maxp / 2 << endl;
}

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

using namespace std;

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

void solve() {
  int n;
  cin >> n;
  set<int> s;
  s.insert(n);
  for(int i = 2; true; i++) {
    if(n%2) n = 3*n+1;
    else n /= 2;
    if(s.count(n)) {
      cout << i << endl;
      break;
    }
    s.insert(n);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#ifdef __DEBUG__
    #define DBG(X) cout << #X << " = " << (X) << endl;
    #define SAY(X) cout << (X) << endl;
#else
    #define DBG(X)
    #define SAY(X)
#endif

using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

int dx[]={1, 0, -1, 0, 1,-1, 1,-1};
int dy[]={0, 1, 0, -1, 1, 1,-1,-1};
const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);

inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const map<T, S> p) { for (auto el : p) cout << "[" << el.first << ";" << el.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const deque<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const set<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

int N,K;
vector<int> A;
void input(){
    fast_io();
    cin >> N >> K;
    A = fetch_vec<int>(N);
}

// 普通にimos法やん・・・
int solve(){
    for (int k = 0; k < min(K,100); k++)
    {    
        vector<int> ret(N,0);
        for (int i = 0; i < N; i++)
        {
            ret[max(0,i-A[i])]++;
            if(i+A[i]+1<N) ret[i+A[i]+1]--;
        }
        for (int i = 0; i < N-1; i++)
        {
            ret[i+1] += ret[i];
        }
        A = ret;
    }
    cout << A << endl;
    
    
    return 0;
}   

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

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

using namespace std;

int main() {
	int N;
	vector<long long> An;
	cin >> N ;
	for (int n = 0;n <= N;++n) {
		long long m;
		cin >> m;
		An.push_back(m);
	}
	vector<long long> Bn;
	//A0 + B0 = 1
	//Bd <= Ad+1 + Bd+1 <=2Bd
	//Bd <= Ad+1,,,,,,,,,,AN

	vector<long long> Cn; //N + 1 - nから最後まで足す
	Cn.push_back(0);
	for (int m = 1; m <= N; ++m) {
		Cn.push_back(Cn[m-1]+An[N-m+1]);
	}
	if (N == 0) {
		if (1 != An[0]) {
			cout << -1 << endl;
		}
		else {
			cout << 1 << endl;
		}
		return 0;
	}

	if (0 != An[0]) {
		cout << -1 << endl;
		return 0;
	}
	Bn.push_back(1-An[0]);

	for (int n = 1; n <= N; ++n) {
		long long min = Bn[n-1] - An[n];
		long long max1 = 2 * Bn[n-1] - An[n];
		long long max2 = Cn[N-n];
		if (max2 < min) {
			cout << -1 << endl;
			return 0;
		}
		long long max = 0;
		if (max2 > max1) {
			max = max1;
		}
		else {
			max = max2;
		}

		if (max >= 0) {
			Bn.push_back(max);
		}
		else {
			cout << -1 << endl;
			return 0;
		}
	}

	long long nAns = 0;
	for (int n = 0; n <= N; ++n) {
		nAns += An[n];
		nAns += Bn[n]; 
	}
	cout << nAns << endl;


	return 0;
}


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

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>
#include<iomanip>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<int, double> pid;
typedef pair<double, int> pdi;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

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

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

int COL[4][40];
int D[40][40];
int RES[4][40];

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

	int N, C;
	cin >> N >> C;
	int A;
	rep(i, 0, C)rep(j, 0, C)
	{
		cin >> D[i][j];
	}

	rep(i, 1, N + 1)rep(j, 1, N + 1)
	{
		cin >> A;
		COL[(i + j) % 3][A - 1]++;
	}

	rep(i, 0, 3)
	{
		rep(j, 0, C)
		{
			rep(k, 0, C)
			{
				if (j == k)continue;
				RES[i][j] += D[k][j] * COL[i][k];
			}
		}
	}

	int ans = INF;
	rep(i, 0, C*C*C)
	{
		vector<int> cnt(C);
		int ti = i;
		int res = 0;
		rep(j, 0, 3)
		{
			res += RES[j][ti%C];
			cnt[ti%C]++;
			ti /= C;
		}
		bool ok = true;
		rep(j, 0, C)
		{
			if (cnt[j] > 1)
			{
				ok = false;
				break;
			}
		}
		if (!ok)continue;
		chmin(ans, res);
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
//verma_ankit484

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

typedef long long ll;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define pb push_back
const ll mod = (ll) 1e9+7;

using namespace std;
using namespace __gnu_pbds;

#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>


int main() {
  IOS
  #ifdef AV
  freopen("int.txt", "r", stdin);
  #endif
  ll m1, d1, m2, d2;
  cin >> m1 >> d1 >> m2 >> d2;
  if (m1 == 2) {
    if (d1 == 28) {
      cout << 1 << endl;
    } else {
      cout << 0 << endl;
    }
    return 0;
  }
  if (m1 <= 7) {
    if (m1%2 != 0) {
      if (d1 == 31) {
        cout << 1 << endl;
      } else {
        cout << 0 << endl;
      }
    } else {
      if (d1 == 30) {
        cout << 1 << endl;
      } else {
        cout << 0 << endl;
      }
    }
  } else {
    if (m1%2 != 0) {
      if (d1 == 30) {
        cout << 1 << endl;
      } else {
        cout << 0 << endl;
      }
    } else {
      if (d1 == 31) {
        cout << 1 << endl;
      } else {
        cout << 0 << endl;
      }
    }
  }
  return 0;
}


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

int main(){
	int H,W,i,j;
	
	while(1){
		cin>>H>>W;
		if(H==0 && W==0){
			break;
		}
		for(i=0;i<H;i++){
			for(j=0;j<W;j++){
				if(j==0||j==W-1||i==0||i==H-1){
					cout<<'#';
				}else{
					cout<<'.';
				}
			}
		cout<<endl;
		}
	cout<<endl;
	}
	return 0;
}

Measured memory_bytes: 3076
'''
研究室PCでの解答
'''
import math
#import numpy as np
import queue
import bisect
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)
mod = 10**9+7
dir = [(-1,0),(1,0),(0,-1),(0,1)]
alp = "abcdefghijklmnopqrstuvwxyz"


def main():
    n,m,d = map(int,ipt().split())
    if d == 0:
        print((m-1)/n)
    else:
        print((n-d)*(m-1)*2/(n**2))

    return None

if __name__ == '__main__':
    main()


Measured memory_bytes: 74908
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;


int main(){
	ll h,n;cin>>h>>n;
	ll maxA = -1;
	vector<ll> a(n + 1);
	vector<ll> b(n + 1);
	vector<vector<ll>> dp(n + 1,vector<ll>(h + 1,LINF));
	for(int i = 1; i < n + 1; i++) {
		cin>>a[i]>>b[i];
		if (a[i] > maxA){
			maxA = a[i];
		}
	}
	dp[0][0] = 0;
	for(int i = 1; i <= n; i++) {
		for(ll j = 0; j <= h; j++) {
			dp[i][j] = min(dp[i][max(0LL,j - a[i])] + b[i],dp[i - 1][j]);
			// else{
			// 	dp[i][j] = min(dp[i][j],dp[i - 1][j]);
			// }
		}


	}
	// for(int i = 0; i <= n; i++) {
	// 	for(int j = 0; j <=h; j++) {
	// 		cout << dp[i][j] << " ";
	// 	}
	// 	cout << endl;
	// }
	cout << dp[n][h] << endl;
	return 0;
}

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

int main() {
  unsigned N;
  std::cin >> N;
  std::vector<int> a(N + 1);
  for (unsigned i = 0; i < N; ++i) {
    std::cin >> a[i];
  }
  a[N] = 0;
  std::sort(a.begin(), a.end());
  int ans = 24;
  for (unsigned i = 0; i + 2 <= N; i += 2) {
    ans = std::min(ans, a[i + 2] - a[i]);
  }
  for (unsigned i = 1; i + 2 <= N; i += 2) {
    ans = std::min(ans, a[i + 2] - a[i]);
  }
  ans = std::min(a[1] + a[0], ans);
  ans = std::min(24 - (a[N] + a[N - 1]), ans);
  std::cout << ans << std::endl;
}


Measured memory_bytes: 256
import java.util.*;
import java.math.*;
import java.io.*;
import java.lang.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int[] l = new int[n];
        int res = 0;
        for (int i = 0; i < n; i++) {
            l[i] = sc.nextInt();
        }
        Arrays.sort(l);
        for (int i = 0; i < k; i++) {
            res += l[l.length - 1 - i];
        }
        System.out.println(res);
        sc.close();
    }
}

class io {
    public static void br() {
        System.out.println("");
    }

    public static void YesNo(boolean f) {
        System.out.println(f ? "Yes" : "No");
    }

    public static void YESNO(boolean f) {
        System.out.println(f ? "YES" : "NO");
    }

}

class Algo {
    public static boolean isOdd(int n) {
        return n % 2 == 1;
    }

    public static boolean isEven(int n) {
        return n % 2 == 0;
    }


}



Measured memory_bytes: 23252
#include "bits/stdc++.h"
using namespace std;
using ll     = long long;
using pii    = pair<int, int>;
using pll    = pair<ll, ll>;
using vi     = vector<int>;
using vl     = vector<ll>;
using vvi    = vector<vi>;
using vvl    = vector<vl>;
const ll INF = 1LL << 60;
const ll MOD = 1000000007;
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;
}
template <class C>
void print(const C &c, std::ostream &os = std::cout) {
    std::copy(std::begin(c), std::end(c), std::ostream_iterator<typename C::value_type>(os, " "));
    os << std::endl;
}

int main() {
    int n;
    cin >> n;
    deque<int> t(n), v(n);
    int tsum = 0;
    for (int i = 0; i < n; ++i) {
        cin >> t[i];
        tsum += t[i];
    }
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
    t.push_front(0);
    t.push_back(0);
    v.push_front(0);
    v.push_back(0);
    vector<double> vel(tsum * 2 + 1);
    int tcurr = 0;
    int idx   = 0;
    for (int i = 0; i < n + 2; ++i) {
        for (int j = 0; j < t[i] * 2; ++j) {
            vel[idx] = v[i];
            idx++;
        }
    }
    for (int i = 0; i < n + 1; ++i) {
        tcurr += t[i] * 2;
        vel[tcurr] = min(v[i], v[i + 1]);
    }
    for (int i = 1; i <= tsum * 2; ++i) {
        chmin(vel[i], vel[i - 1] + 0.5);
    }
    for (int i = tsum * 2 - 1; i >= 0; --i) {
        chmin(vel[i], vel[i + 1] + 0.5);
    }
    double ret = 0;
    for (int i = 1; i <= tsum * 2; ++i) {
        ret += (vel[i] + vel[i - 1]) / 4.0;
    }
    cout << fixed << setprecision(10) << ret << "\n";
    return 0;
}

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

using namespace std;
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
constexpr int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
constexpr int dy[] = {0, -1, 0, 1, 1, -1, -1, 1};

template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec){os << "["; for (const auto &v : vec) {os << v << ","; } os << "]"; return os; }
template <typename T, typename U> ostream &operator<<(ostream &os, const pair<T, U> &p) {os << "(" << p.first << ", " << p.second << ")"; return os;}

double len(int x1, int y1, int x2, int y2) {
    return sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
}

void solve() {
    double x1, y1, x2, y2, x3, y3;
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
    double a = len(x1, y1, x2, y2);
    double b = len(x2, y2, x3, y3);
    double c = len(x3, y3, x1, y1);

    double s = (a + b + c) / 2;
    double S = sqrt(s * (s - a) * (s - b) * (s - c));
    // (a + b + c) * r / 2 == S
    // r = S * 2 / (a + b + c)
    double r = 2 * S / (a + b + c);
    double m = max({a, b, c});
    // (1 - x/r) * m == 2x
    // m - (m/r) x - 2x = 0
    // m = (m/r + 2)x
    // x = m / (m/r + 2)

    double x = m / ((m / r) + 2);
    cout << x << endl; 
}

int main() {
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(16);
    solve();
    return 0;
}

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

typedef tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update>	tree_set;
typedef long long ll;
typedef long double ld;
void fast()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
}

ll mod=1e9 + 7;

int main()
{
    fast();
    ll l,r;
    cin>>l>>r;

    ll div = 2019;

    if(l/div != r/div)
    {
        cout<<"0";
        return 0;
    }

    ll ans = LLONG_MAX;
    for(ll i=l;i<=r;i++)
    {
        for(ll j=i+1;j<=r;j++)
        {
            ll val = i%div;
            val = (val * (j%div) )%div;;
            ans = min(ans, val%div);
        }
    }

    cout<<ans;

}


Measured memory_bytes: 256
import java.util.*;
class Main{
  public static void main(String[] args){
    Scanner scan=new Scanner(System.in);
    HashMap<String,Integer> week=new HashMap<String,Integer>();
    String S=scan.nextLine();
    week.put("MON",0);
    week.put("TUE",1);
    week.put("WED",2);
    week.put("THU",3);
    week.put("FRI",4);
    week.put("SAT",5);
    week.put("SUN",6);

    for(int value:week.values()){
      if(value==week.get(S)){
        int ans=6-value;
        if(ans>0){
          System.out.println(ans);
         }
        else{
          System.out.println(ans+7);
       }
       break;
      }
      }
    }
}

Measured memory_bytes: 21204
#include <cstdio>

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

    if(n == 100)
        n++;

    printf("%d", n);
    for(int zero = 1; zero <= 2*power_of_100; zero++) printf("0");

    return 0;
}


Measured memory_bytes: 128
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

#define LINE_BUF_SIZE 100

int main(){

    int i,j,k;
    int v;
    int c[3][3];
    int sum,sum1;

    sum=0;
    sum1 = 0;
    
    for(i=0;i<3;i++){
        for(j=0;j<3;j++){
            //if(j != 3){
                scanf("%d", &v);
                c[i][j] = v;
                sum += v;
            //}
        }
    }

    sum1 = c[1][1] + c[1][2] + c[2][1] + c[2][2];

    if(sum % 3 == 0 && sum1 % 2 == 0){
        printf("Yes");
    }

    else{
        printf("No");
    }

    return 0;

}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#ifdef ENABLE_DEBUG
#define dump(a) cerr<<#a<<"="<<a<<endl
#define dumparr(a,n) cerr<<#a<<"["<<n<<"]="<<a[n]<<endl
#else
#define dump(a) 
#define dumparr(a,n) 
#endif
#define FOR(i, a, b) for(ll i = (ll)a;i < (ll)b;i++)
#define For(i, a) FOR(i, 0, a)
#define REV(i, a, b) for(ll i = (ll)b-1LL;i >= (ll)a;i--)
#define Rev(i, a) REV(i, 0, a)
#define REP(a) For(i, a)
#define SIGN(a) (a==0?0:(a>0?1:-1))

typedef long long int ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<ll, ll> pll;
typedef pair<ll,pll> ppll;
typedef vector<ll> vll;
typedef long double ld;
typedef pair<ld,ld> pdd;

const ll INF=(1LL<<50);
#if __cplusplus<201700L
ll gcd(ll a, ll b) {
  if(a < b) return gcd(b, a);
  ll r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}
#endif
template<class T>
bool chmax(T& a,const T& b){
  if(a<b){
    a=b;
    return true;
  }
  return false;
}
template<class T>
bool chmin(T& a,const T& b){
  if(a>b){
    a=b;
    return true;
  }
  return false;
}
template<class S,class T>
std::ostream& operator<<(std::ostream& os,pair<S,T> a){
  os << "(" << a.first << "," << a.second << ")";
  return os;
}
template<class T>
std::ostream& operator<<(std::ostream& os,vector<T> a){
  os << "[ ";
  REP(a.size()){
    os<< a[i] << " ";
  }
  os<< " ]";
  return os;
}



int main(){
  cout<<setprecision(1000);
  ll N;
  cin>>N;
  vector<ll> A(N);
  REP(N){
    cin>>A[i];
  }
  map<ll,ll> minus,plus;
  auto inc=[](map<ll,ll> &x,ll i){
    if(x.count(i)){
      ++x[i];
    }else{
      x[i]=1;
    }
  };
  REP(N){
    inc(minus,i-A[i]);
    inc(plus,i+A[i]);
  }
  ll ans=0;
  for (auto &&i : minus)
  {
    if(plus.count(i.first)){
      ans+=plus[i.first]*i.second;
    }
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 27944
#include <iostream>

using namespace std;

int main() {
  int N, A, B;
  cin >> N >> A >> B;
  int total = 0;
  for (int i = 1; i <= N; i++) {
    int sum = i / 10000 + (i - (i / 10000) * 10000) / 1000 +
	      (i - (i / 1000) * 1000) / 100 + (i - (i / 100) * 100) / 10 +
	      (i - (i / 10) * 10);
    if (A <= sum && sum <= B) {
      total += i;
    }
  }
  cout << total << endl;
}


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

using namespace std;

int main(void) {
  
  int K;
  cin >> K;
  
  int g;
  int ans = 0;
  for (int a=1; a<=K; a++) {
      for (int b=1; b<=K; b++) {
          for (int c=1; c<=K; c++) {
              g = gcd(gcd(a,b),c);
              ans += g;
          }
      }
  }
  
  cout << ans << endl;

}


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

int main(int argc, char **argv)
{
	int n; cin >> n;
	vector<int> p(n);
	for (int i = 0; i < n; ++i) cin >> p[i];

	int before_min{INT_MAX};

	int count{0};
	for (int i = 0; i < n; ++i)
	{
		before_min = min(p[i], before_min);
		if (before_min == p[i])
			++count;
	}

	std::cout << count << std::endl;
}


Measured memory_bytes: 1024
n = int(input())
s = []
for i in range(n):
    s.append(input())

m = int(input())
t = []
for i in range(m):
    t.append(input())

ans = 0
targets = list(set(s))
for target in targets:
    ans = max(ans, s.count(target) - t.count(target))

print(ans)


Measured memory_bytes: 3060
from math import cos, sin, radians, sqrt
a, b, c = input().split()
a, b = float(a), float(b)
theta = radians(int(c))
h = b * sin(theta)
S = a * h / 2
c = sqrt(a*a + b*b - 2*a*b*cos(theta))
print(f'{S:.8f}')
print(f'{a+b+c:.8f}')
print(f'{h:.8f}')


Measured memory_bytes: 5728
#include <iostream>
#include <queue>
#include <map>
#include <cmath>
#include <algorithm>
#include <queue>
#include <cstdarg>
#include <set>
#include <limits>
#include <iomanip>

using namespace std;
#define INF 2e9 + 9
#define MOD 1000000007
#define ALL(v) v.begin() , v.end()
#define Int int64_t
#define pll pair<Int,Int>
template<class T> using pql = priority_queue<T, vector<T>>;
template<class T> using pq = priority_queue<T, vector<T>, greater<T>>;
#define ll(n) Int n; cin >> n;
#define LL(...) Int __VA_ARGS___; cin >> __VA_ARGS___;
#define OUT(...) cout << __VA_ARGS___;
#define RP(n, i, s) for(Int i = s ;i < n ;i++)
#define REP(n, i) for (Int i = 0; i < n; i++)
#define REPe(n, i) for (Int i = 1; i <= n; i++)
#define RPe(n, i, s) for (Int i = s; i <= n; i++)
#define upd_max(maxer, updater) if (maxer < updater) maxer = updater;

void ansYes(bool flag){
    if (flag) cout << "Yes" << endl; else  cout << "No" << endl;
}

void ansYES(bool flag){
    if (flag) cout << "YES" << endl; else  cout << "NO" << endl;
}

struct node {
    Int to;
    Int length;
};


vector<Int> divisor(Int n) {
    vector<Int> ret;
    for (Int i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) ret.push_back(n / i);
        }
    }
    return (ret);
}

/*
vector<vector<int>> to;
vector<int> flag;
vector<int> c;


Int dfs(int from, int mae) {
    flag[from] = 1;
    Int mini = 0;
    for (auto next : to[from]) {
        if (next == mae) continue;
        if (flag[next] == 1) {
            return -1;
        } else {
            mini = min(mini, dfs(next, from));
        }
    }
    return mini;
}*/

int dx8[8] = {0, -1, -1, -1, 0, 1, 1, 1};
int dy8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};

int nanko(string s,Int n,Int i){
    Int length = min(n - i - 1,i);
    Int ans = 0;
    for (int k = i-length;k < i;k++){
        if (s.at(k) == 'R' && s.at(i +  (i - k) == 'B')) ans++;
    }
    return ans;
}

int main() {
    Int a, b , c;
    cin >> a >> b >> c;
    if (a + b + c >= 22) {
        cout << "bust" << endl;
    }else{
        cout << "win" << endl;
    }

}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
    int a,b;
    cin>>a>>b;
    if(a>b) cout<<"a > b"<<endl;
    else if(a<b) cout<<"a < b"<<endl;
    else if(a==b) cout<<"a == b"<<endl;
    return 0;
}


Measured memory_bytes: 3092
n, m, l = map(int, input().split())

A = [list(map(int, input().split())) for col in range(n)]
B = [list(map(int, input().split())) for col in range(m)]
C = []
for row in range(n):
    cRow = []
    for col in range(l):
        sumC = 0
        for cal in range(m):
            sumC += A[row][cal] * B[cal][col]
        cRow.append(sumC)
    C.append(cRow)

for row in range(n):
    print(*C[row])



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

int main(){
 long long  int n;
  cin>>n;
  
long long int b[100010]={0},c[100010]={0};
  
  for(int i=0;i<n;i++){
    int a; cin>>a;
    if(i%2==0){
      b[a]++;
    }else{
      c[a]++;
    }
  }
  
  int bi=0,ci=0,ans=0,ant=0,f=0;
  for(int i=0;i<100001;i++){
    if(b[bi]<b[i]){
      bi =i;
    }if(c[ci]<c[i]){
      ci =i;
    }
  }
  if(bi==ci){
    int si=0,ti=0;
    for(int i=0;i<100001;i++){
      if(b[si]< b[i] && i!=bi){
        si =i;
      }if(c[ti]<c[i] && i!=ci){
        ti =i;
      }
    }
    cout<<n-max(b[bi]+c[ti],b[si]+c[ci])<<endl;
  }else{
    cout<<n-b[bi]-c[ci]<<endl;
  }
}


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

int main()
{
    int N;
    cin >> N;
    string S;
    for (int i = 0; i < N; i++)
    {
        cin >> S;
        if (S[0] == 'Y')
        {
            cout << "Four" << endl;
            return 0;
        }
    }
    cout << "Three" << endl;
}


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

int main(){
	int N; cin >> N;
	vector<int> L(N);

	for(int i = 0; i < N; ++i) cin >> L[i];

	sort(L.begin(), L.end(), greater<int>());

	int sum = 0;
	for(int i = 1; i < N; ++i) sum += L[i];
	if(sum > L[0]) cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<stdlib.h>
#include<vector>
#include<algorithm>
#include<utility>
#include<string>
#include<cstring>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<iterator>
//#include<math.h>

using namespace std;
#define int long long
/*                      */    //#undef int
#define INF 1000000009
#define INFL 1000000000000000018ll
#define mod 1000000007ll
#define pb push_back
#define fi first
#define se second
#define mk(a, b) make_pair(a, b)
typedef pair<int, int> PA;
typedef priority_queue<int> PQ;
typedef priority_queue<PA, vector<PA>, greater<PA> >PQG;

int n, h, a[100005], b[100005];

signed main()
{
    cin >> n >> h;
    for(int i = 0; i < n; i++){
        cin >> a[i] >> b[i];
    }
    sort(a, a + n);
    sort(b, b + n);
    int mx = a[n - 1];
    int katana = n - 1;
    int cnt = 0;
    while(katana >= 0 && b[katana] > mx && h > 0){
        h -= b[katana];
        katana--;
        cnt++;
    }
    cout << cnt + max((h + mx - 1) / mx, 0ll) << endl;

    return 0;
}
/*


*/


Measured memory_bytes: 1792
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>
#include <functional>
typedef long long ll;
using namespace std;
#define int long long

//素数判定
inline bool IsPrime(int p) {
	if (p == 1) return false;
	for (int i = 2; i <= sqrt(p); i++) {
		if (p%i == 0) return false;
	}
	return true;
}

//10進数の自然数の桁数を返す
inline int GetDigit(int num) {
	return (int)log10(num) + 1;
}

//各位の和を返す
int GetDigitsSum(int num) {
	int N = 0;
	while (num > 0) {
		N += num % 10;
		num /= 10;
	}
	return N;
}

//互除法
ll gcd(ll a, ll b) {
	if (a < b) {
		return gcd(b, a);
	}
	else if (a%b) {
		return gcd(b, a%b);
	}
	else {
		return b;
	}
}

//最小公倍数
ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b; // Be careful not to overflow

}

//異なるn個からr個の整数を取り出す組合せの数を求める
int combination(int n, int r) {
	if (r == 0 || n == r) {
		return 1;
	}
	else if (r == 1) {
		return n;
	}
	else {
		return combination(n - 1, r - 1) + combination(n - 1, r);
	}

}

//Ｏ(√n)
//素因数分解
map<int, int> prime_factor(int n) {
	map<int, int> res; // map[i]:=ｎを素因数分解したときiは何乗か。
	for (int i = 2; i * i <= n; i++) {
		if (n % i == 0) {
			while (n % i == 0) {
				res[i]++;
				n /= i;
			}
		}
	}
	if (n != 1)
		res[n] = 1;
	return res;
}

//Ｏ(√n)
//素因数分解
map<int, int> prime_factor_ver2(int n, map<int, int> res) {
	for (int i = 2; i * i <= n; i++) {
		if (n % i == 0) {
			while (n % i == 0) {
				res[i]++;
				n /= i;
			}
		}
	}
	if (n != 1)
		res[n]++;
	return res;
}


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

	bool x = false;
	vector<int> A;
	for (int i = 0; i < 3; i++)
	{
		int tmp;
		cin >> tmp;
		A.push_back(tmp);

		if (tmp % 2==0) {
			x = true;
		}

	}

	if (x) {
		cout << 0 << endl;
		return 0;
	}

	sort(A.begin(), A.end());
	cout << A[0] * A[1] << endl;

	return 0;
}


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

int	main( void )
{
    int A, B;
    char S[10], T[10], U[10];
    
    scanf("%s %s", &S, &T);
    scanf("%d %d", &A, &B);
    scanf("%s", &U);
    
    if(strcmp(S, U)==0){
        A=A-1;
    }else if(strcmp(T, U)==0){
        B=B-1;
    }else{
        return 0;
    }
    printf("%d %d", A, B);
    
	return 0;
}


Measured memory_bytes: 128
#インプットdata
input_data = input()

#初期値
stack_list = list()
area_list = list()
area_sum = 0

#計算の実行
for i in range(len(input_data)):
    if input_data[i] == "\\":
        stack_list.append(i)
    elif len(stack_list) > 0 and input_data[i] == "/":
        temp_area = i - stack_list[-1]
        area_sum += temp_area
        if len(area_list) == 0 or area_list[-1][0] < stack_list[-1]:
            area_list.append([stack_list[-1], temp_area])
        else:
            area_list[-1][0] = stack_list[-1]
            area_list[-1][1] += temp_area
            temp_len = len(area_list)
            for j in range(temp_len-1, 0, -1):
                if area_list[j-1][0] > area_list[j][0]:
                    area_list[j-1][0] = area_list[j][0]
                    area_list[j-1][1] += area_list[j][1]
                    del area_list[j]
                else:
                    break
        del stack_list[-1]

#結果の表示
print(area_sum)
print(len(area_list), end="")
for i in range(len(area_list)):
    print(f" {area_list[i][1]}", end="")
print("")



Measured memory_bytes: 6584
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<iomanip>
#include<set>
#include<queue>

using namespace std;

int main()
{
	int n;
	cin >> n;
	for(int i=1;i<=n;i++)
	{
		if(360*i%n==0)
		{
			cout <<(360*i)/n << endl;
			return 0;
		}
	}




}

Measured memory_bytes: 3160
def substitute(text, a, b):
    pos = 0
    newText = text
    L1 = len(a)
    L2 = len(b)
    while True:
        idx = newText.find(a, pos)
        if idx < 0:
            return newText
        newText = newText[:idx] + b + newText[idx + L1:]
        pos = idx + L2
    return newText

def transform(orig, goal, count):
    global subs
    global minCount

    if len(orig) > len(goal):
        return

    if orig == goal:
        minCount = min(minCount, count)
        return
    
    for key in subs:
        newStr = substitute(orig, key, subs[key])
        if newStr != orig:
            transform(newStr, goal, count + 1)

if __name__ == '__main__':
    while True:
        N = int(input())
        if N == 0:
            break

        subs = {}
        for _ in range(N):
            a, b = input().strip().split()
            subs[a] = b
        
        orig = input().strip()
        goal = input().strip()

        minCount = 999999999
        transform(orig, goal, 0)

        if minCount == 999999999:
            print(-1)
        else:
            print(minCount)


Measured memory_bytes: 5604