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

using namespace std;
typedef long long ll;
#define int ll

#define REP(i,n) for(int i=0;i<n;++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 0
#  define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#  define DBG(fmt, ...)
#endif

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const double DINF = std::numeric_limits<double>::infinity();
const int MOD = 1000000007;
#define MAX_N 100010

template< typename T >
class CumulativeSum
{
public:
    CumulativeSum() {}
    CumulativeSum(int sz) : m_Data(sz, T(0)) {};

    void Init(int sz) { m_Data.assign(sz, T(0)); }

    // k に x を加える O(1)
    void Add(int k, T x) {
        assert(static_cast<int>(m_Data.size()) >= k);
        if(static_cast<int>(m_Data.size()) <= k) { m_Data.push_back(x); }
        else { m_Data[k] = (m_Data[k] + x); }
    }

    // 累積和の構築 O(m_Data.size())
    void Build() {
        for(int i = 1; i < static_cast<int>(m_Data.size()); i++) {
            m_Data[i] = (m_Data[i] + m_Data[i - 1]);
        }
    }

    // 区間 [0, k] の和を返す O(1)
    // 閉区間なので k が含まれることに注意
    T Query(int k) {
        if(k < 0) { return T(0); }
        return (m_Data[min(k, static_cast<int>(m_Data.size()) - 1)]);
    }

    // 区間 [l, h] の和を返す O(1)
    // 閉区間なので k が含まれることに注意
    T Query(int l, int h) {
        return (this->Query(h) - this->Query(l-1));
    }
private:
    vector< T > m_Data;
};

ll N, K;
string S;

// first: 0 なら false second: 連続する数
vector< pair<bool, ll> > a_s;

signed main()
{
    cin >> N >> K >> S;
    bool isOne = true;
    if(S[0] == '0') { isOne = false; }

    ll cur = 0;
    char prev = S[0];
    REP(i, S.length()) {
        if(S[i] != prev) {
            a_s.push_back({isOne, cur});
            isOne = !isOne;
            cur = 1;
        }
        else {
            cur++;
        }
        prev = S[i];
    }
    a_s.push_back({isOne, cur});

    // DEBUG
    for(auto& tmp : a_s) {
        DBG("%c %lld\n", tmp.first ? '1' : '0', tmp.second);
    }

    CumulativeSum<ll> cs(a_s.size());
    CumulativeSum<ll> cs_val(a_s.size());
    REP(i, a_s.size()) {
        if(!a_s[i].first) {
            cs.Add(i, 1);
        }
        cs_val.Add(i, a_s[i].second);
    }
    cs.Build();
    cs_val.Build();

    ll ans = 0;
    ll lb = 0, rb = 0;
    while( lb <= rb ) {
        ans = max(ans, cs_val.Query(lb, rb));
        if(rb < a_s.size() && cs.Query(lb, rb+1) <= K) { rb++; }
        else { lb++; }
    }

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

    return 0;
}


Measured memory_bytes: 3568
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define ALL(c) (c).begin(), (c).end()
#define SUM(x) std::accumulate(ALL(x), 0LL)
#define MIN(v) *std::min_element(v.begin(), v.end())
#define MAX(v) *std::max_element(v.begin(), v.end())
#define EXIST(v, x) (std::find(v.begin(), v.end(), x) != v.end())
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; }
const int INF = 1e9;
const long long INFL = 1LL<<60;

bool check(string s, vector<bool>& ans) {
  for (int i = 1; i < s.size() - 1; i++) {
    if ((ans[i] && s[i] == 'o') || (!ans[i] && s[i] == 'x')) {
      ans[i+1] = ans[i-1];
    } else {
      ans[i+1] = !ans[i-1];
    }
  }
  if ((ans.back() && s.back() == 'o') || (!ans.back() && s.back() == 'x')) {
    if (ans[ans.size() - 2] != ans[0]) return false;
  } else {
    if (ans[ans.size() - 2] == ans[0]) return false;
  }
  if ((ans[0] && s[0] == 'o') || (!ans[0] && s[0] == 'x')) {
    if (ans[1] == ans.back()) return true;
    else return false;
  } else {
    if (ans[1] == ans.back()) return false;
    else return true;
  }
}


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

  int n; cin >> n;
  string s; cin >> s;

  for (int i = 0; i < 4; i++) {
    vector<bool> ans(n, false);
    ans[0] = ((i>>0) & 1);
    ans[1] = ((i>>1) & 1);
    if (check(s, ans)) {
      for (bool x : ans) {
        if (x) cout << "S";
        else cout << "W";
      }
      cout << endl;
      return 0;
    }
  }

  cout << "-1" << endl;

  return 0;
}


Measured memory_bytes: 640
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <numeric>
#include <vector>
#include <string>
#include <bitset>
#include <stack>
#include <queue>
#include <tuple>
#include <regex>
#include <cmath>
#include <map>
#include <set>
#include <functional>
#include <cstring>

using namespace std;

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

using ll = long long;
using Pint = pair<int, int>;
using Pll  = pair<ll, ll>;

#define eb emplace_back
#define pb push_back
#define mp make_pair

#define F first
#define S second

#define popcnt __builtin_popcountll

#define rep( i, n ) for ( ll i = 0; i < (ll)( n ); ++i )
#define reps( i, n ) for ( ll i = 1; i <= (ll)( n ); ++i )
#define rrep( i, n ) for ( ll i = (ll)( ( n ) - 1 ); i >= 0; --i )
#define rreps( i, n ) for ( ll i = (ll)( ( n ) ); i > 0; --i )
#define arep( i, v ) for ( auto &&i : ( v ) )

#define ALL( c ) ( c ).begin(), ( c ).end()
#define RALL( c ) ( c ).rbegin(), ( c ).rend()
#define UNIQUE( c ) ( c ).erase( unique( ( c ).begin(), ( c ).end() ), ( c ).end() )

template<typename T = ll> constexpr T MAX = numeric_limits<T>::max();
template<typename T> T gcd( const T a, const T b ) { return ( b ? gcd( b, a % b ) : a ); }
template<typename T> T lcm( const T a, const T b ) { return ( a / gcd( a, b ) * b ); }

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

	ll t1 = 0;
	rep( i, s.size() - t.size() + 1 )
	{
		ll t2 = 0;
		rep( j, t.size() )
		{
			if ( s[i + j] == t[j] )
				++t2;
		}
		chmax( t1, t2 );
	}

	cout << max( (ll)t.size() - t1, 0LL ) << endl;

	return ( 0 );
}


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


int main() {

  int A, B, K;
  cin >> A >> B >> K;

  vector<int> answer;

  for (int i = 1; i <= 100; i++) {
    if (A % i == 0 && B % i == 0) {
      answer.push_back(i);
    }
  }

  sort(answer.begin(), answer.end(), std::greater<int>());

  cout << answer[K - 1] << endl;

}

Measured memory_bytes: 256
#include <iostream>
#include <string>

using lint = long long;

void solve() {
    lint a;
    std::string s;
    std::cin >> a >> s;

    auto t = s.substr(s.length() - 2);
    s = s.substr(0, s.length() - 3);

    lint b = std::stoll(s) * 100 + std::stoll(t);

    std::cout << a * b / 100 << "\n";
}

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

    solve();

    return 0;
}


Measured memory_bytes: 3644
import java.util.Scanner;

public class Main {

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int count=0;
	for(int i=1;i<=n;i++) {
		String temp = Integer.toString(i);
		if(temp.length()%2==1)count++;
	}
	System.out.println(count);
    }

}


Measured memory_bytes: 27732
///
// File:  b.go
// Author: ymiyamoto
//
// Created on Thu Apr 26 09:52:29 2018
//
package main

import (
	"fmt"
)

var N, X int
var ms []int

func main() {
	fmt.Scan(&N, &X)
	ms = make([]int, N)

	total := 0
	min := 1 << 30
	for i := range ms {
		fmt.Scan(&ms[i])
		total += ms[i]
		if ms[i] < min {
			min = ms[i]
		}
	}
	fmt.Println(N + (X-total)/min)
}


Measured memory_bytes: 512
#include <stdio.h>

int A[500000];
int H;

void maxHeapify(int A[],int i)
{
  
  int l, r, largest, a;
  
  l = i*2+1;
  r = i*2+2;
  // 左の子、自分、右の子で値が最大のノードを選ぶ
  if(l<=H && A[l]>A[i]){
    largest = l;
  }
  else{
    largest = i;
  }
  if(r<=H && A[r]>A[largest]){
    largest = r;
  }

  if(largest!=i){ // i の子の方が値が大きい場合
    a = A[largest];
    A[largest] = A[i];
    A[i] = a;
    maxHeapify(A, largest); // 再帰的に呼び出し
  }

}

void buildMaxHeap(int A[])
{

  int i;
  
  for(i=H/2;i>=0;i--){
    maxHeapify(A, i);
  }

}

int main()
{

  int i;

  scanf("%d",&H);
  for(i=0;i<H;i++){
    scanf("%d",&A[i]);
  }
  
  buildMaxHeap(A);

  for(i=0;i<H;i++){
    printf(" %d",A[i]);
  }
  printf("\n");

}
    



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

int main(void){
    int n;
    cin >> n;
    double ans =0;
    vector<double> bit;
    vector<ll> yen;
    rep(i,n){
        double x =0;
        cin >> x;
        string s;
        cin >> s;
        if(s=="JPY"){
            yen.push_back(x);
        }
        else{
            bit.push_back(x);
        }
    }
    rep(i,yen.size()){
        ans += yen[i];
    }
    rep(i,bit.size()){
        ans += bit[i] * 380000;
    }
    
    cout << ans << endl;
    
    return 0;
}






































Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class Main {

	public static void main(String[] args) throws IOException {

		ArrayList<String> datas = new ArrayList<String>();
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

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

		
		while (true) {

			String s1 = new String(in.readLine());
			
			if(s1.equals("0")) break;
			
			String s2 = new String(in.readLine());

			boolean f = true;
			boolean ulf = false;
			boolean urf = false;

			String[] strs = s2.split(" ");
			int count = 0;

			for (String data : strs) {
				if (f) {
					if (data.equals("lu")) {
						ulf = true;
					} else if (data.equals("ru")) {
						urf = true;
					} else if (data.equals("ld")) {
						ulf = false;
					} else if (data.equals("rd")) {
						urf = false;
					}
					if (ulf && urf) {
						f = false;
						count++;
					}

				} else {
					if (data.equals("lu")) {
						ulf = true;
					} else if (data.equals("ru")) {
						urf = true;
					} else if (data.equals("ld")) {
						ulf = false;
					} else if (data.equals("rd")) {
						urf = false;
					}
					if (!ulf && !urf) {
						f = true;
						count++;
					}
				}
			}
			result.add(count);
		}
		for(Integer tes :result)
		System.out.println(tes);
	}
}


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

int main(){

  int N, K, x, cnt = 0;
  cin >> N >> K;
  for(int i = 0; i < N; i++){
    cin >> x;
    if(x <= abs(K-x)){
      cnt += 2 * x;
    }
    else{
      cnt += 2 * abs(K-x);
    }
  }

  cout << cnt << endl;

  return 0;
}

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

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(), (x).end()

typedef long long ll;
typedef long double ld;

const int INF = 1e9;
const ld EPS = 1e-8;

ll solve(const vector<ll>& a, int k) {
  ll acc = 0, res = 0;
  REP(i,a.size()) {
    acc += a[i];
    if((i + k) % 2 == 1 && acc >= 0) {
      res += acc + 1;
      acc = -1;
    }else if((i + k) % 2 == 0 && acc <= 0) {
      res += 1 - acc;
      acc = 1;
    }
  }
  return res;
}

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

  ll res = min(solve(a, 0), solve(a, 1));
  cout << res << endl;
  return 0;
}



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

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define fi first
#define se second
#define v(T) vector<T>
#define imposs      \
  {                 \
    cout << "-1\n"; \
    return 0;       \
  }
#define LL_MAX LLONG_MAX
#define LL_MIN LLONG_MIN

typedef unsigned int uint;
typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef set<int> si;
typedef multiset<int> msi;
template <typename T>
string join(const v(T) & v)
{
  stringstream s;
  rep(i, sz(v)) s << ' ' << v[i];
  return s.str().substr(1);
}
template <typename T>
inline ostream &operator<<(ostream &o, const v(T) & v)
{
  if (sz(v))
    o << join(v);
  return o;
}

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

  string s;
  cin >> s;
  rep(i, sz(s))
  {
    if (s[i] == '?')
    {
      s[i] = 'D';
    }
  }
  cout << s << '\n';
  return 0;
}


Measured memory_bytes: 3780
#include <bits/stdc++.h>
#define FI first
#define SE second
#define EPS 1e-9
#define ALL(a) a.begin(),a.end()
#define SZ(a) int((a).size())
#define MS(s, n) memset(s, n, sizeof(s))
#define FOR(i,a,b) for (int i = (a); i <= (b); i++)
#define FORE(i,a,b) for (int i = (a); i >= (b); i--)
#define FORALL(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define WHATIS(x) cout << #x << " is " << x << endl;
#define ERROR(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
//__builtin_ffs(x) return 1 + index of least significant 1-bit of x
//__builtin_clz(x) return number of leading zeros of x
//__builtin_ctz(x) return number of trailing zeros of x

using namespace std;
using ll = long long;
using ld = double;
typedef pair<int, int> II;
typedef pair<ll, II> III;
typedef complex<ld> cd;
typedef vector<cd> vcd;

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cout << *it << " = " << a << endl;
    err(++it, args...);
}

const ll MODBASE = 1000000007LL;
const int MAXN = 10;
const int MAXM = 110;
const int MAXK = 510;

int n, a, b, c, d[MAXN];

int main() {
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    cin >> n >> a >> b >> c;
    FOR(i,1,n) cin >> d[i];
    sort(d+1, d+n+1);
    int res = 1000000000;
    FOR(mask,1,(1<<n)-1) {
        int bits = __builtin_popcount(mask);
        if (bits >= 3) {
            vector<int> A;
            int sum = 0;
            FOR(i,1,n)
                if (mask & (1<<(i-1))) {
                    A.emplace_back(d[i]);
                    sum += d[i];
                }
            do {
                int sum1 = 0, sum2 = 0, sum3 = 0;
                int cnt1 = 0, cnt2 = 0, cnt3 = 0;
                int dem = 0;
                FOR(i,0,SZ(A)-3) {
                    sum1 += A[i];
                    cnt1++;
                    sum2 = 0;
                    cnt2 = 0;
                    FOR(j,i+1,SZ(A)-2) {
                        sum2 += A[j];
                        cnt2++;
                        sum3 = sum - sum1 - sum2;
                        cnt3 = SZ(A) - cnt1 - cnt2;
                        dem = abs(a - sum1) + abs(b - sum2) + abs(c - sum3) + (cnt1 + cnt2 + cnt3 - 3) * 10;
                        res = min(res, dem);
                    }

                }
            } while (next_permutation(ALL(A)));
        }
    }
    cout << res;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(c) c.begin(),c.end()
typedef long long ll;
const int N=1e6;
int n,k,x;
string s;
vector<int>v;
int dp[N];

int main(){

	scanf("%d%d",&n,&k);
	for(int i =0;i<n;i++){
		scanf("%d",&x);
		v.push_back(x);
	}
	for(int i =0;i<n;i++)
		dp[i]=1000000000;
	dp[n-1]=0;
	for(int i=n-1;i>0;i--){
		for(int j=1;j<=k;j++){
			if(i-j>=0){
				dp[i-j]=min(dp[i-j],dp[i]+abs(v[i-j]-v[i]));
			}
		}
	}
	cout << dp[0]<<endl;
	return 0;
}

Measured memory_bytes: 1144
#include <bits/stdc++.h>
typedef unsigned long long ull;
typedef long long ll;
#define __TRUE "Yes"
#define __FALSE "No"
#define cout(x) cout << (x) << endl
#define MAX 100001
using namespace std;

int main() {
  ll N;
  cin >> N;
  vector<ull> A(N);
  for(int i=0;i<N;i++) {
    cin >> A[i];
  }

  ull ans=0;
  sort(A.begin(),A.end());
  if(N%2==0){
    for(int i=N/2;i<N;i++) {
      ans += 2*A[i];
    }
    for(int i=0;i<N/2;i++) {
      ans -= 2*A[i];
    }
    ans = ans-A[N/2]+A[N/2-1];
  } else{
    ull ansYama=0;
    for(int i=N/2+1;i<N;i++) {
      ansYama += 2*A[i];
    }
    for(int i=0;i<=N/2;i++) {
      ansYama -= 2*A[i];
    }
    ansYama += (A[N/2]+A[N/2-1]);

    ull ansTani=0;
    for(int i=N/2;i<N;i++) {
      ansTani += 2*A[i];
    }
    for(int i=0;i<N/2;i++) {
      ansTani -= 2*A[i];
    }
    ansTani -= (A[N/2]+A[N/2+1]);

    ans=max(ansTani, ansYama);
  }
  cout << ans << endl;
}

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

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

    int max_num=0;
    int tmp_count=0;
    int end_flag=0;

    for(int i=0;i<N-2;){
        tmp_count=0;
        for(int j=i;;j++){
            if(H[j]>=H[j+1]){
                tmp_count++;
            }else{
                i=j+1;
                break;
            }
            if(j+1==N-1){
                end_flag=1;
                break;
            }
        }
        max_num=max(tmp_count,max_num);
        if(end_flag)break;
    }
    cout<<max_num<<endl;
    return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<typename T> using gpp_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T, typename L> using gpp_map = tree<T, L, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T> using gpp_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;*/
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define all(v) v.begin(),v.end()
#define SZ(v) ((int)v.size())
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define Max(a, b) a = max(a, b)
#define Min(a, b) a = min(a, b)
#define bit(n) (1LL<<(n))
#define bit_exist(x, n) ((x >> n) & 1)
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v) { cout << #v << "=" << endl; REP(i_debug, v.size()){ cout << v[i_debug] << ","; } cout << endl; }
#define mdebug(m) { cout << #m << "=" << endl; REP(i_debug, m.size()){ REP(j_debug, m[i_debug].size()){ cout << m[i_debug][j_debug] << ","; } cout << endl;} }
#define Return(ans) { cout << (ans) << endl; return 0; }
#define pb push_back
#define f first
#define s second
#define int long long
#define INF 1000000000000000000
template<typename T> istream &operator>>(istream &is, vector<T> &v){ for (auto &x : v) is >> x; return is; }
template<typename T> ostream &operator<<(ostream &os, vector<T> &v){ for(int i = 0; i < v.size(); i++) { cout << v[i]; if(i != v.size() - 1) cout << endl; }; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, pair<T1, T2> p){ cout << '(' << p.first << ',' << p.second << ')'; return os; }
template<typename T> void Out(T x) { cout << x << endl; }
template<typename T1, typename T2> void Ans(bool f, T1 y, T2 n) { if(f) Out(y); else Out(n); }
 
using vec = vector<int>;
using mat = vector<vec>;
using Pii = pair<int, int>;
using PiP = pair<int, Pii>;
using PPi = pair<Pii, int>;
using bools = vector<bool>;
using pairs = vector<Pii>;
 
//int dx[4] = {1,0,-1,0};
//int dy[4] = {0,1,0,-1};
//char d[4] = {'D','R','U','L'};
 
const int mod = 1000000007;
//const int mod = 998244353;
//#define Add(x, y) x = (x + (y)) % mod
//#define Mult(x, y) x = (x * (y)) % mod

#include <bits/stdc++.h>
using namespace std;
signed main(){
    string S; cin>>S;
    int ans = 0;
    int SS = S.size();
    FOR(i,1,(SS+1)/2){
        bool K = true;
        REP(j,i){
            if(S[j]!=S[j+i]) K = false;
        }
        if(K) ans = 2*i;
    }
    Out(ans);
}


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

int main() {
    int a, b; cin >> a >> b;
    if (a + b == 15) return !(cout << "+" << endl);
    if (a * b == 15) return !(cout << "*" << endl);
    cout << "x" << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
const ll N = 1e6, inf = 1e9;

ll ar[N], br[N];
vector<ll>v, ans;
map<ll, ll>mp;
int main()
{
    ll h, w, n, tot = 0, i = 1;
    cin>>h>>w>>n;
    if( h < w) swap(h, w);
    while(1)
    {
        tot += h;
        if(tot >= n)
        {
            cout<<i<<"\n";
            return 0;
        }
        i++;
    }
    return 0;
}


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

public class Main{
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		long n = in.nextLong();
		long k = in.nextLong();
		long ans = 0l;
		long M = 1000000007;
		for(long m = n+1; m>=k; m--){
			long s = (m*(n-m+1)+1)%M;
			ans += s;
			ans = ans%M;
		}
		System.out.println(ans);
	}

}

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

int main() {
    int n;
    cin >> n;
    vector<ll> R(n);
    rep(i, n) cin >> R[i];
    ll maxv = R[1] - R[0];
    ll minv = R[0];
    for (int i = 1; i < n; i++) {
        maxv = max(maxv, R[i] - minv);
        minv = min(minv, R[i]);
    }
    cout << maxv << endl;
    return 0;
}


Measured memory_bytes: 4352
import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter
# a.sort(key=itemgetter(i)) # i番目要素でsort
from functools import lru_cache
# @lru_cache(maxsize=None)
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7


def inp():
    '''
    一つの整数
    '''
    return int(input())


def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))


def str_inp():
    '''
    文字列をリストとして読み込む
    '''
    return list(input()[:-1])


n = inp()
ans = 0
for i in range(2, 10**6 + 1):
    for j in range(1, 40):
        x = i**j
        if n % x == 0:
            ans += 1
            n //= x
        else:
            while n % i == 0:
                n //= i
            break
if n > 10**6:
    ans += 1
print(ans)


Measured memory_bytes: 68860
#include <string>
#include <iostream>
#include <algorithm>

using namespace std;

bool is_prime(long long n, long long k)
{
	if (n < k * k) { return true; }

	if (n % k == 0) { return false; }

	return is_prime(n, k + 1);
}

string solve(int n, int k)
{
	if (k < 0)
	{
		if (n == 1)
		{
			return "11";
		}
		else
		{
			return string(2 * n, '9');
		}
	}

	for (long long i = stoll(string(n, '9')); to_string(i).size() == n; i--)
	{
		string S = to_string(i);

		string T = to_string(i) + to_string(k); reverse(S.begin(), S.end());

		T += S;

		if (is_prime(stoll(T), 2) == true)
		{
			return T;
		}
	}

	return string(n, '9') + to_string(k) + string(n, '9');
}

int main()
{
	int n, c;

	cin >> n >> c;

	cout << solve(n, c) << endl;

	return 0;
}

Measured memory_bytes: 3252
#include <algorithm>
#include<cfenv>
#include <cmath>
#include <complex>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <ios>
#include <iostream>
#include <list>
#include <map>
#include<numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <utility>
#include <vector>
#define itn int
#define retrun return
using namespace std;
typedef long long llong;
typedef unsigned long long ullong;
vector<llong> AllDivisors(llong N) {
	vector<llong> ANS;
	for (llong i = 1; i * i <= N; i++) {
		if (N % i == 0) {
			ANS.push_back(i);
			if (N / i != i)ANS.push_back(N / i);
		}
	}
	sort(ANS.begin(), ANS.end());
	return ANS;
}
bool IsPrime(llong N) {
	for (llong i = 2; i * i <= N; i++) {
		if (N % i == 0) return false;
	}
	return true;
}
pair<llong, llong> Reduction(pair<llong, llong> A) {
	llong tmp = gcd(A.first, A.second);
	auto p = make_pair(A.first / tmp, A.second / tmp);
	return p;
}
//ここまで共通
llong K;
int main() {
	cin >> K;
	llong M = 7;
	for (llong i = 0; i <= K + 2; i++) {
		if (M % K == 0) {
			cout << i+1 << endl;
			return 0;
		}
		M %= K;
		M *= 10;
		M += 7;
	}
	cout << -1 << endl;
}

Measured memory_bytes: 3596
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <climits>
#include <iomanip>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
int main(){
  int n = 0;
  cin >> n;
  int all = 0;
  vector<int> num(n);
  for(int i = 0;i < n;i++){
    cin >> num[i];
    all += num[i];
  }
  int res = 0;
  sort(num.begin(),num.end());
  if(all % 10 != 0)res = all;
  else{
  for(int i = 0;i < n;i++){
    if((all - num[i]) % 10 != 0){
      res = all - num[i];
      break;
    }
  }
  }
  cout << res << endl;
}

Measured memory_bytes: 256
a = int(input())
b = int(input())
c = int(input())
x = int(input())

ct = 0

for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if 500*i + 100*j + 50*k == x:
        ct += 1
        
print(ct)

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

typedef pair<int, int> ii;
typedef pair<ll, ll> pll;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int d;
	cin >> d;
	vector<int> c(26);
	for (int i = 0 ; i < 26 ; i++) {
		cin >> c[i];
	}
	vector<vector<int>> s(d, vector<int>(26));
	for (int i = 0 ; i < d ; i++) {
		for (int j = 0 ; j < 26 ; j++) {
			cin >> s[i][j];
		}
	}
	for (int i = 0 ; i < d ; i++) {
		cout << 1 << "\n";
	}

	return 0;
}


Measured memory_bytes: 3712
#include <iostream>
#include <vector>
#include <climits>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <bitset>
#include <utility>
#include <numeric>
#include <queue>
#include <stack>

using ll = long long;
using namespace std;

constexpr int MOD = 1e9 + 7;
constexpr ll MOD_LL = ll(1e9 + 7);

template<typename T>
T modpow(T a, T p, T mod) {
	T ret = 1;
	while( p ) {
		if( p & 1 ) {
			ret *= a;
			ret %= mod;
		}
		
		a *= a;
		a %= mod;
		p >>= 1;
	}
	
	return ret;
}

int main(void) {
	ll m, n;
	cin >> m >> n;
	
	cout << modpow(m, n, MOD_LL) << endl;
	
	return 0;
}



Measured memory_bytes: 3092
#include<stdio.h>

int main(void){
    int N;
    char S[100005];
    scanf("%d",&N);
    scanf("%s",S);

    int i;
    int ans=1;
    for(i=1;i<N;i++){
        if(S[i]!=S[i-1]){
            ans++;
        }
    }

    printf("%d",ans);

    return 0;
}

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

int main(){
	int N;
	cin >> N;
	double x[N], ans = 0;
	string u[N];
	for(int i=0; i<N; i++){
		cin >> x[i] >> u[i];
		if(u[i] == "JPY") ans += x[i];
		else ans += x[i] * 380000.0;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <stack>
#include <functional>
#include <set>
#include <map>
#include <deque>
#define WMAX 10000
#define HMAX 10000
#define MMAX 52

//コメントアウトするとdebug()を実行しない
#define DEBUG

using namespace std;
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

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

int A[MMAX],B[MMAX],C[MMAX] = {},N,M,W,H,ans,dp[HMAX][WMAX];
string S;
static const int dx[8] = {0,1,1,1,0,-1,-1,-1},
					dy[8] = {1,1,0,-1,-1,-1,0,1};

void solve(){
	for (int i = 0; i < M; ++i)
	{
		C[A[i]]++;
		C[B[i]]++;
	}
}

void debug(){

}

void answer(){
	for (int i = 0; i < N; ++i)
	{
		cout << C[i+1] << "\n";
	}
}

int main(){
	cin >> N >> M;
	for (int i = 0; i < M; ++i)
	{
		cin >> A[i] >> B[i];
	}
	solve();
	#ifdef DEBUG
	debug();
	#endif
	answer();

	return 0;
}

Measured memory_bytes: 256
//Name: Pankaj Mandrawal (pankaj_m05)
//Problem: Lucky 7
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define INF LLONG_MAX
#define NINF LLONG_MIN
#define mod 10000000009
#define sz(c) int((c).size())
#define sortall(x) sort(all(x))         
#define PI 3.1415926535897932384626     
#define all(c) (c).begin(), (c).end()
#define clr(x) memset(x, 0, sizeof(x))  
#define MAX32 numeric_limits< int >::max() 
#define MIN32 numeric_limits< int >::min()
#define rall(c) (c).rbegin(), (c).rend()
#define deb(x) cerr << #x << " = " << x << endl
#define forn(i, n) for(int i = 0; i < (int)n; ++i)
#define for1(i, n) for(int i = 1; i <= (int) n; ++i)
#define ford(i, n) for(int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, l, r) for(int i = (int)(l); i < (int)(r); ++i)
#define tr(c, it) for(typeof(c).begin() it = c.begin(); it != c.end(); it++)
#define deb2(x, y) cerr << #x << " = " << x << "," << #y << " = " << y << endl

using namespace std;

typedef long long ll;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef vector< ll > vill;
typedef pair < int, int > pi;
typedef unsigned long long int ull;

ll mypow(ll x, ll y) { 
    if (y == 0) 
        return 1; 
    ll p = mypow(x, y / 2) % mod; 
    p = (p * p) % mod; 
    if (!(y & 1)) 
        return p;
    return (p * x) % mod; 
} 

void plssolve() {
	string s; cin >> s;
	if(s.find('7') != string::npos)
		cout << "Yes" << '\n';
	else
		cout << "No" << '\n';
}

int main(void) {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.precision(10);
    cout << fixed;
    int t = 1;
    // cin >> t;
    while(t--) {
        plssolve();
    }
    return 0;
}

Measured memory_bytes: 3656
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sn = new Scanner(System.in);

		int a = sn.nextInt();
		int b = sn.nextInt();
		int c = sn.nextInt();

		List<Integer> list = new ArrayList<Integer>();
	    list.add(a);
	    list.add(b);
	    list.add(c);

	    Collections.sort(list);

		System.out.println(list.get(0) + list.get(1));
	}
}

Measured memory_bytes: 21844
import scala.collection.mutable.ArrayBuffer

object Main {
  def main(args: Array[String]): Unit = {
    solve
  }

  def solve(): Unit = {
    val sc = new java.util.Scanner(System.in)
    val h, w = sc.nextInt
    sc.nextLine
    val s = new Array[Array[Char]](h)
    for (i <- 0 until h) {
      s(i) = sc.nextLine.toCharArray
    }

    val INF = 1001001001
    val DI = Array(-1, 0, 1, 0)
    val DJ = Array(0, -1, 0, 1)

    var ans = 0

    for (si <- 0 until h; sj <- 0 until w) {
      // すべてのマスをスタート地点にしてチェックしていく（幅優先探索）

      if (s(si)(sj) != '#') {
        val dist = ArrayBuffer.fill[ArrayBuffer[Int]](h)(ArrayBuffer.fill[Int](w)(INF))
        dist(si)(sj) = 0
        val queue = new scala.collection.mutable.Queue[(Int, Int)]
        queue.enqueue((si, sj))

        while (!queue.isEmpty) {
          val point = queue.dequeue
          val ci = point._1
          val cj = point._2

          for (i <- 0 until 4) {
            val ni = ci + DI(i)
            val nj = cj + DJ(i)
            if (
              ((ni >= 0 && ni < h) && (nj >= 0 && nj < w)) // 枠内に収まる
                && s(ni)(nj) != '#' // 到達不可能マスではない
                && dist(ni)(nj) == INF // 未到達マスでである
            ) {
              dist(ni)(nj) = dist(ci)(cj) + 1
              queue.enqueue((ni, nj))
            }
          }
        }

        for (i <- 0 until h; j <- 0 until w) {
          if (dist(i)(j) != INF) {
            ans = math.max(ans, dist(i)(j))
          }
        }
      }
    }
    println(ans)
  }
}


Measured memory_bytes: 44736
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mit map<int,int>::iterator
#define sit set<int>::iterator
#define itrm(g,x) for(mit g=x.begin();g!=x.end();g++)
#define itrs(g,x) for(sit g=x.begin();g!=x.end();g++) 
#define ltype int
#define rep(i,j,k) for(ltype (i)=(j);(i)<=(k);(i)++)
#define pii pair<int,int>
#define fi first
#define se second
#define mpr make_pair
#define pb push_back
#define fastio ios::sync_with_stdio(false)
const int inf=0x3f3f3f3f,
mod=1000000007;
const double pi=3.1415926535897932,
eps=1e-6;
int f[100005],n,m,ans;vector<int> v[100005];
int dfs(int x){
    if(f[x]!=-1) return f[x];
    int cur=0;
    rep(i,0,(int)v[x].size()-1) cur=max(cur,dfs(v[x][i])+1);
    return f[x]=cur;
}
int main()
{
    scanf("%d%d",&n,&m);
    rep(i,1,m){
        int t1,t2;
        scanf("%d%d",&t1,&t2);
        v[t1].pb(t2);
    }
    rep(i,1,n) f[i]=-1;
    rep(i,1,n) ans=max(ans,dfs(i));
    printf("%d\n",ans);
    return 0;
}

Measured memory_bytes: 8832
#define _USE_MATH_DEFINES
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>

using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 29;
const int MOD = 1e9 + 7;

int main() {
  int n, X;
  scanf("%d%d", &n, &X);
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
    a[i] = abs(a[i] - X);
  }
  int ret = a[0];
  for (int i = 1; i < n; ++i) {
    ret = __gcd(ret, a[i]);
  }
  printf("%d\n", ret);
  return 0;
}


Measured memory_bytes: 640
#pragma GCC optimize("O3")
#include<iostream>
#include<algorithm>
#include<string>
#include<cmath>
#include<set>
#include<vector>
#include<sstream>
#include<queue>
#include <iomanip>
#include <fstream>
#include<unordered_set>
#include<stack>
#include <map>
#include<time.h>
#include <chrono>
constexpr auto INF = 9223372036854775807;
typedef long long int ll;
typedef unsigned long long int ull;
typedef unsigned long int ul;
#define f(i,a,b) for(ll i=(ll)a;i<(ll)b;i+=1)
#define rf(i,a,b) for(ll i=(ll)a;i>=(ll)b;i-=1)
#define endl '\n'
#define N 1000000007 // prime modulo value 
#define all(x) x.begin(),x.end()
using namespace std;
#define MAX 1000001 
#define M 998244353
ll inverse(ll n)
{
	ll modu = M;
	ll m = modu;
	ll a = 0, b = 1;
	if (modu == 1)
		return 0;
	while (n > 1)
	{
		ll quo = n / modu;
		ll temp = modu;
		modu = n % modu, n = temp;
		temp = a; 
		a = b - (quo * a);
		b = temp;
	}
	if (b < 0)
		b += m;
	return b;
}
int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	ll n, m,c_ac=0,c_wa=0;
	cin >> n >> m;
	vector<ll> ac(n+1, 0);
	vector<ll> wro(n + 1, 0);
	f(i, 0, m)
	{
		ll q;
		cin >> q;
		string ans;
		cin >> ans;
		if (ac[q] == 0)
		{
			if (ans == "AC")
			{
				c_ac += 1;
				ac[q] = 1;
			}
			else
			{
				wro[q] += 1;
			}
		}
	}
	f(i, 1, n + 1)
	{
		if (ac[i] == 1)
		{
			c_wa += wro[i];
		}
	}
	cout << c_ac << " " << c_wa;
	return 0;
}


Measured memory_bytes: 1792
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    int times4 = 0;
    int times2 = 0;
    int other = 0;
    rep(i, N) {
        int num; cin >> num;
        if (num % 4 == 0) times4++;
        else if (num % 2 == 0) times2++;
        else other++;
    }
    if (times2 != 0) other++;
    if ((times4 + other) % 2 == 1) other--;
    if (times4 >= other) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
#define era(t) t.erase(unique(be(t)),t.end())
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;
typedef long long ll;
using namespace std;
const ll mod=1000000007,mod9=1000000009;
template <class T>inline T lcm(T a,T b){return (a*b/__gcd(a,b));}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    char a;
    cin>>a;
    if(a=='A')cout << 'T';
    if(a=='T')cout << 'A';
    if(a=='C')cout << 'G';
    if(a=='G')cout << 'C';
    cout << endl;
    return 0;
}





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

using int32 = int_fast32_t;
using int64 = int_fast64_t;

const int32 INF = 1e9;
const int32 MOD = 1e9+7;
const int64 LLINF = 1e18;

#define YES(n) cout << ((n) ? "YES\n" : "NO\n"  )
#define Yes(n) cout << ((n) ? "Yes\n" : "No\n"  )
#define ANS(n) cout << (n) << "\n"
#define REP(i,n) for(int64 i=0;i<(n);++i)
#define FOR(i,a,b) for(int64 i=(a);i<(b);i++)
#define FORR(i,a,b) for(int64 i=(a);i>=(b);i--)
#define ALL(obj) (obj).begin(),(obj).end()
#define pii pair<int32,int32>
#define pll pair<int64,int64>
#define pb(a) push_back(a)
#define mp make_pair

int64 modpow(int64 n, int64 r, int64 p){
    if(r == 0)return 1;
    if(r % 2 == 1){
        return n * modpow(n, r - 1, p) % p;
    }
    int64 x = modpow(n, r / 2, p);
    return x * x % p;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int32 n,p;
    cin >> n >> p;
    string s;
    cin >> s;
    if(p == 2 || p == 5){
        int64 ans = 0;
        REP(i,n){
            if((s[i] - '0') % p == 0){
                ans += i + 1;
            }
        }
        ANS(ans);
        return 0;
    }
    vector<int64> cnt(p,0);
    cnt[0] = 1;
    int64 cur = 0;
    FORR(i,n-1,0){
        cur += (s[i] - '0') * modpow(10,n-1-i,p) % p;
        cur %= p;
        cnt[cur]++;
    }
    int64 ans = 0;
    REP(i,p){
        ans += cnt[i] * (cnt[i] - 1) / 2;
    }
    ANS(ans);
    return 0;
}

Measured memory_bytes: 720
// 未解決

#include <bits/stdc++.h>

#include <iostream>
using namespace std;

#define EACH(i, a) for (auto &&i : a)
#define FOR(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define RFOR(i, a, b) for (int i = (int)b - 1; i >= (int)a; --i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) FOR(i, 1, int(n) + 1)
#define RREP(i, n) RFOR(i, 0, n)
#define RREPS(i, n) RFOR(i, 1, int(n) + 1)
#define ALL(x) (x).begin(), (x).end()
#define MEMSET(v, h) memset((v), h, sizeof(v))
#define debug(x) cout << #x << ": " << x << endl

#define pb push_back
#define mp make_pair
#define F first
#define S second

#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
#define INF (1L << 30)
#define MOD (1000000007)
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

template <class T>
void pv(T a, T b) {
  for (T i = a; i != b; ++i) cout << *i << " ";
  cout << endl;
}
template <class T>
void pvp(T a, T b) {
  for (T i = a; i != b; ++i)
    cout << "(" << i->first << ", " << i->second << ") ";
  cout << endl;
}
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
int in() {
  int x;
  scanf("%d", &x);
  return x;
}

using ll = long long;
#define int ll

//**********

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

  int x;
  cin >> x;
  int a = 100;
  int ans = 0;
  while (a < x && ans < 3500) {
    a = a * 101 / 100;
    // debug(a);
    ans += 1;
  }
  a /= 10000.00;
  x /= 10000.00;
  while (a < x) {
    a = a * 101 / 100;
    // debug(a);
    ans += 1;
  }
  cout << ans << endl;

  return 0;
};


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

int main(int argc, char const *argv[])
{
    int A, B;
    cin >> A >> B;

    vector<int> price_a;
    vector<int> price_b;

    int maximum;
    int i;
    if (A >= B)
    {
        maximum = A * 100;
        i = A;
    }
    else
    {
        maximum = B * 100;
        i = B;
    }

    // cout << maximum << endl;
    // cout << i << endl;

    double temp_A, temp_B;
    for (; i < maximum; i++)
    {
        temp_A = i * 0.08;
        temp_B = i * 0.1;
        if (A == (int)temp_A)
        {
            // printf("A's i = %d\n", i);
            price_a.push_back(i);
        }
        if (B == (int)temp_B)
        {
            // printf("B's i = %d\n", i);
            price_b.push_back(i);
        }
    }

    int ans = -1;
    for (int i = 0; i < price_a.size(); i++)
    {
        for (int j = 0; j < price_b.size(); j++)
        {
            if (price_a.at(i) == price_b.at(j))
            {
                ans = price_a.at(i);
                cout << ans << endl;
                return 0;
            }
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
# import sys
# import math
# import decimal
# import queue
# import bisect
# import heapq
# import time
# import itertools
# import collections # queue
# from fractions import Fraction

mod = int(1e9+7)
INF = 1<<29
lINF = 1<<35

def main():
    h,w = map(int,input().split())
    if h==1 or w==1:
        print(1)
    else:
        ans = (h*w+1)//2
        print(ans)
    return

if __name__=='__main__':
    main()


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

typedef long long ll;
typedef long double ld;

#define pb push_back
#define sort(s) sort(s.begin(),s.end())
#define reverse(s) reverse(s.begin(),s.end())
#define rep(i,n) for(ll (i)=0;(i)<(n);(i)++)

const ll mod = 1e9+7;

//最大公約数
ll gcd(ll a, ll b) {
    return b ? gcd(b, a%b) : a;
}

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

//素数判定
bool isPrime(ll x){
    ll i;
    if(x < 2)return 0;
    else if(x == 2) return 1;
    if(x%2 == 0) return 0;
    for(i = 3; i*i <= x; i += 2) if(x%i == 0) return 0;
    return 1;
}

//桁和
int digsum(ll n) {
    int res = 0;
    while(n > 0) {
        res += n%10;
        n /= 10;
    }
    return res;
}

//桁数
int dignum(ll n) {
    int res = 0;
    while(n > 0) {
        res++;
        n /= 10;
    }
    return res;
}

//文字列中の特定の文字カウント
ll stringcount(string s,char c){
    return count(s.cbegin(),s.cend(),c);
}

//階乗
ll ka(ll i){
    ll res=1;
    while(i>0){
        res=res*i;
        i--;
    }
    return res;
}
 
//ncr
ll ncr(ll x,ll y){
    ll a = x;
    ll b = 1;
    if(y>(x/2)){
        y=x-y;
    }
    for(ll i=1;i<y;i++){
        a*=x-i;
        b*=i+1;
    }
    return a/b;
}

//フィボナッチ数列
ll f(ll x){
    ll dp[x+1];
    dp[1]=1;
    dp[2]=1;
    for(ll i=3;i<=x;i++){
        dp[i]=dp[i-1]+dp[i-2];
    }
    return dp[x];
}

//char->int
int ctoi(char c){
    return c-'0';
}



int main(){
    ll a,b,n;
    cin >> a >> b >> n;
    ll y = min(b-1,n);
    ll ans = a*(y)/b-(a*((y)/b));
    ans = max(ans,a*n/b-(a*(n/b)));

    
    cout << ans << endl;
}

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

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

const int MAXN = 100;

int n, arr[MAXN*2+10], ans;

int main()
{
    int i, j;
    scanf("%d", &n);
    for(i=1; i<=n*2; i++) scanf("%d", &arr[i]);
    sort(arr+1, arr+2*n+1);
    for(i=1; i<=n*2; i+=2) ans+=arr[i];
    printf("%d", ans);
}


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

int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return (a*b)/gcd(a,b);}
char chlit(char c){return c+32;}
char chbig(char c){return c-32;}

int main(){
  int a,b,c,d;cin >> a >> b >> c >> d;
  cout << a+b+c+d << endl;
  return 0;
}



Measured memory_bytes: 3096
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

const int mod = 1e9+7;
const int N = 5005;

int dp[N][N]={};

int main(){
    int n,m,k,q;
    scanf(" %d %d %d %d", &n, &m, &k, &q);

    dp[0][0] = 1;
    rep(i,N-1){
        int val = 0;
        rep(j,n){
            if( (j/k)%2==0 ){
                int idx = (0-j+n)%n;
                (val += dp[i][idx]) %= mod;
            }
        }

        int B = 2*k;
        rep(j,B){
            for(int x=j; x<n; x+=B) dp[i+1][x] = val;

            rep(x,n/k){
                int idx = (j+1-x*k+n)%n;
                if(x%2==0) val = (val+dp[i][idx])%mod;
                else val = (val-dp[i][idx]+mod)%mod;
            }
        }
    }

    rep(i,q){
        int a,b,c;
        scanf(" %d %d %d", &a, &b, &c);
        int d = c-a;
        if(d<0) d+=n;
        printf("%d\n", dp[b][d]);
    }

    return 0;
}



Measured memory_bytes: 101040
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <functional>
#define _USE_MATH_DEFINES
#include <cmath>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cfloat>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <cassert>
using namespace std;

#define EPS 1e-12
#define ull unsigned long long
#define ll long long
#define VI vector<ll>
#define PII pair<ll, ll> 
#define VVI vector<vector<ll> >
#define REP(i,n) for(int i=0,_n=(n);(i)<(int)_n;++i)
#define RANGE(i,a,b) for(int i=(int)a,_b=(int)(b);(i)<_b;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define ALLR(c) (c).rbegin(), (c).rend()
#define PB push_back
#define MP(a, b) make_pair(a, b)
#define POPCOUNT __builtin_popcount
#define POPCOUNTLL __builtin_popcountll
#define CLEAR(table, v) memset(table, v, sizeof(table));
#define PRINT1(table, D0) REP(d0, D0) cout<<table[d0]<<" "; cout<<"\n";
#define PRINT2(table, D0, D1) REP(d0, D0) { REP(d1, D1) cout<<table[d0][d1]<<" "; cout<<"\n"; }
#define PRINT3(table, D0, D1, D2) REP(d0, D0) { REP(d1, D1) { REP(d2, D2) cout<<table[d0][d1][d2]<<" "; cout<<"\n"; } cout<<"\n"; }
#define UNIFORM_DOUBLE(a, b) (((b-a)*(double)rand()/RAND_MAX)+a) // [a, b) 
#define UNIFORM_LL(a, b) (ll)UNIFORM_DOUBLE(a, b) // [a, b) 
#define IN(v, lo, hi) ((lo)<=(v) && (v)<(hi))
#define DD(v) cout<<#v<<": "<<v<<endl
template <typename T0, typename T1> std::ostream& operator<<(std::ostream& os, const map<T0, T1>& v) { for( typename map<T0, T1>::const_iterator p = v.begin(); p!=v.end(); p++ ){os << p->first << ": " << p->second << " ";} return os; }
template <typename T0, typename T1> std::ostream& operator<<(std::ostream& os, const pair<T0, T1>& v) { os << v.first << ": " << v.second << " "; return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const vector<T>& v) { for( int i = 0; i < (int)v.size(); i++ ) { os << v[i] << " "; } return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const vector<vector<T> >& v) { for( int i = 0; i < (int)v.size(); i++ ) { os << v[i] << endl; } return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const set<T>& v) { vector<T> tmp(v.begin(), v.end()); os << tmp; return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const deque<T>& v) { vector<T> tmp(v.begin(), v.end()); os << tmp; return os; }

#define MOD 1000000007LL
#define INF (1LL<<60)

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll N,K;
	while(cin>>N>>K) {
		VI w(N);
		REP(i, N) cin>>w[i];
		ll ans = 1LL<<60;
		REP(i, N) {
			ll j = i+K-1;
			if(j>=N) continue;
			ll l = min({0LL, w[i], w[j]});
			ll r = max({0LL, w[i], w[j]});
			ll lans = min(-l*2+r, -l+r*2);
			ans = min(ans, lans);
		}
		
		cout<<ans<<endl;
	}
	
	return 0;
}


Measured memory_bytes: 1024