akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
using namespace std;

int main(){
    int n, k;
    cin >> n >> k;

    int p[n];
    for(int i=0;i<n;i++){
        cin >> p[i];
    }
    int tmp;
    for(int i=0;i<n;i++){
        for(int j=i+1;j<n;j++){
            if(p[i] > p[j]){
                tmp = p[i];
                p[i] = p[j];
                p[j] = tmp;
            }
        }
    }
    int sum=0;
    for(int i=0;i<k;i++){
        sum+=p[i];
    }
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
int main()
{
	string s;
	cin>>s;
	int sum;
	int c;
	for(int bit=0;bit<(1<<3);bit++){
		sum=s[0]-'0';
		for(int i=0;i<3;i++){
			if(bit&(1<<i)){
				sum+=s[i+1]-'0';
			}
			else{
				sum-=s[i+1]-'0';
			}
		}
		if(sum==7){c=bit;break;}
	}
	cout<<s[0];
	for(int i=0;i<3;i++){
		if(c&(1<<i)){
			cout<<"+";
		}
		else{
			cout<<"-";
		}
		cout<<s[i+1];
	}
	cout<<"=7"<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define PI 3.141592653589793
#define rep(i, n) for (int i = 0; i < (n); i++)
#define REP(i, a, n) for (int i = a; i < (n); i++)
#define rrep(i, n, k) for (int i = (n); i >= (k); i--);
#define all(x) (x).begin(), (x).end()
#define vi vector<int>
template<class T> istream &operator>>(istream&is,vector<T>&v){for(auto &elemnt:v)is>>elemnt;return is;}
template<class T,class U> istream &operator>>(istream&is,pair<T,U>&p){is>>p.first>>p.second;return is;}
template<class T>vector<T> make_vector(size_t a){return vector<T>(a);}
template<class T, class... Ts>auto make_vector(size_t a, Ts... ts){return vector<decltype(make_vector<T>(ts...))>(a, make_vector<T>(ts...));}
const int inf = 6e18;
const int mod = 1e9 + 7;

signed main() {
    int H, W;
    cin >> H >> W;
    int N;
    cin >> N;
    int a = (N / H) + (N % H != 0), b = (N / W) + (N % W != 0);
    cout << min(a, b) << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <string.h>
#include <vector>

using namespace std;

namespace {

class Dictionary {
 private:
  struct Node {
    Node* children[4];
    char flags[4];

    Node() {
      children[0] = NULL;
      children[1] = NULL;
      children[2] = NULL;
      children[3] = NULL;
      flags[0] = 0;
      flags[1] = 0;
      flags[2] = 0;
      flags[3] = 0;
    }
  };

 public:
  Dictionary()
      : root_(new Node),
        block_size_(1048576),
        pool_index_(0),
        block_index_(0) {
    pool_.push_back(new Node[block_size_]);
  }

  ~Dictionary() {
    for (size_t i = 0; i < pool_.size(); ++i) {
      delete[] pool_[i];
    }
    delete root_;
  }

  void insert(const char* k, size_t n) {
    Node* p = root_;
    int id = 0;
    for (size_t i = 0; i < n; ++i) {
      const char c = k[i];
      id = Id(c);
      if (!p->children[id]) {
        p->children[id] = Alloc();
      }
      p = p->children[id];
    }
    p->flags[id] = 1;
  }

  bool find(const char* k, size_t n) const {
    Node* p = root_;
    int id = 0;
    for (size_t i = 0; i < n; ++i) {
      const char c = k[i];
      id = Id(c);
      p = p->children[id];
      if (!p) {
        return false;
      }
    }
    if (!p) {
      return false;
    }
    return p->flags[id];
  }

 private:
  Node* root_;

  static int Id(char c) {
      switch (c) {
        case 'A':
          return 0;
        case 'C':
          return 1;
          break;
        case 'G':
          return 2;
          break;
        case 'T':
          return 3;
          break;
      }
      // should not reach here.
      return 0;
  }

  Node* Alloc() {
    if (block_index_ >= block_size_) {
      pool_.push_back(new Node[block_size_]);
      pool_index_++;
      block_index_ = 0;
    }
    Node* r = &pool_[pool_index_][block_index_];
    block_index_++;
    return r;
  }

  size_t block_size_;
  size_t pool_index_; // pos in pool
  size_t block_index_; // pos in the block
  vector<Node* > pool_;
};

} // namespace

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

  Dictionary d;
  char op[7];
  char str[13];
  for (int i = 0; i < n; ++i) {
    scanf("%s ", op);
    scanf("%s", str);
    const char c = op[0];
    const size_t len = strnlen(str, 13);
    if (c == 'i') {
      d.insert(str, len);
      continue;
    }

    if (d.find(str, len)) {
      printf("yes\n");
    } else {
      printf("no\n");
    }
  }

  return 0;
}

Measured memory_bytes: 41952
using System;
using System.Collections.Generic;
using System.Linq;
using BitArray = System.Collections.BitArray;
using BigInteger = System.Numerics.BigInteger;

namespace AtCoderProject
{
    public class Program
    {
        public object Calc()
        {
            return consoleReader.String.GroupBy(c => c).All(g => g.Count() == 2) ? "Yes" : "No";
        }

        #region いつもの
        private readonly ConsoleReader consoleReader;
        public Program(ConsoleReader consoleReader) { this.consoleReader = consoleReader; }
        static void Main() => Console.WriteLine(new Program(new ConsoleReader()).Calc()); static string AllLines<T>(IEnumerable<T> source) => string.Join("\n", source);
        #endregion
    }

#pragma warning disable
    public class ConsoleReader { public class SplitLine { string[] splited; public SplitLine(string line) { splited = line.Split(); } public string[] String => splited.ToArray(); public int[] Int => splited.Select(int.Parse).ToArray(); public long[] Long => splited.Select(long.Parse).ToArray(); public ulong[] ULong => splited.Select(ulong.Parse).ToArray(); public double[] Double => splited.Select(double.Parse).ToArray(); } public class RepeatLine { ConsoleReader reader; int num; public RepeatLine(ConsoleReader reader, int num) { this.reader = reader; this.num = num; } public IEnumerable<string> String { get { for (int i = 0; i < num; i++) yield return reader.String; } } public IEnumerable<int> Int { get { for (int i = 0; i < num; i++) yield return reader.Int; } } public IEnumerable<long> Long { get { for (int i = 0; i < num; i++) yield return reader.Long; } } public IEnumerable<string[]> SplitString { get { for (int i = 0; i < num; i++) yield return reader.Split.String; } } public IEnumerable<int[]> SplitInt { get { for (int i = 0; i < num; i++) yield return reader.Split.Int; } } } public virtual string String => Console.ReadLine(); public int Int => int.Parse(String); public long Long => long.Parse(String); public ulong ULong => ulong.Parse(String); public double Double => double.Parse(String); public SplitLine Split => new SplitLine(String); public RepeatLine Repeat(int count) => new RepeatLine(this, count); }
}

Measured memory_bytes: 13268
#include <cstdio>
#include <iostream>
#include <string>
#include <sstream>
#include <stack>
#include <algorithm>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <cstdlib>
#include <bitset>
#include <tuple>
#include <assert.h>
#include <deque>
#include <bitset>
#include <iomanip>
#include <limits>
#include <chrono>
#include <random>
#include <array>
#include <unordered_map>
#include <functional>
#include <complex>

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

constexpr long long MAX = 5100000;
constexpr long long INF = 1LL << 60;
constexpr int inf = 1 << 28;
constexpr long long mod = 1000000007LL;
//constexpr long long mod = 998244353LL;

using namespace std;
typedef unsigned long long ull;
typedef long long ll;

int main()
{
	/*
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	*/
	int kkt = 89;
	while (kkt) {
		ll R0, W0, C, R; scanf("%lld %lld %lld %lld", &R0, &W0, &C, &R);
		if (R0 == 0 && W0 == 0 && C == 0 && R == 0) break;
		if (R0 >= W0 * C) puts("0");
		else {
			cout << (W0 * C - R0 + R - 1) / R << "\n";
		}
	}
	return 0;

}


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

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#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, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

template<class T> bool umin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool umax(T &a, T b) { return a < b ? (a = b, true) : false; }

using namespace std;

int main(int argc, char** argv) 
{
#ifdef HOME
	if(IsDebuggerPresent())
	{
		freopen("../in.txt", "rb", stdin);
		freopen("../out.txt", "wb", stdout);
	}
#endif
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.precision(10);
	cout << fixed;
	int N;
	cin >> N;
	vector<uint64_t> A(N), h(N+1);
	forn(i, N)
	{
		cin >> A[i];
		h[A[i]]++;
	}

	uint64_t su = 0;

	forn(i, N + 1)
	{
		su += h[i] * (h[i] - 1) / 2;
	}

	forn(i, N)
	{
		uint64_t act = A[i];
		uint64_t res = su - h[act] * (h[act] -1) /2 + (h[act] - 2) * (h[act] - 1) / 2;
		cout << res << endl;
	}

	return 0;
}


Measured memory_bytes: 5760
int = int(input()) #iを取得し、intに値を入れる

if int % 10 == 2 or int % 10 == 4 or int % 10 == 5 or int % 10 == 7 or int % 10 == 9:
  print('hon')
elif int % 10 == 0 or int % 10 == 1 or int % 10 == 6 or int % 10 == 8:
  print('pon')
elif int % 10 == 3:
  print('bon')

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

using namespace std;

const int OO = 1e9;
const double EPS = 1e-9;

#define ndl cout << '\n'
#define sz(v) int(v.size())
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define present(a, x) (a.find(x) != a.end())
#ifdef LOCAL
#define db(...) ({cout << "> Line " << __LINE__  \
		<< ": "; _db(#__VA_ARGS__, __VA_ARGS__);})
#define RNG() rng()
#else
#define db(...) true
#define RNG() true
#endif

template<class T>
void _db(const char *dbStr, T e) {
	cout << dbStr << " = " << e << endl;
}
template<class T, class... L>
void _db(const char *dbStr, T e, L... r) {
  while(*dbStr != ',') cout << *dbStr++;
  cout << " = " << e << ','; _db(dbStr + 1, r...);
}
template<class S, class T>
ostream& operator<<(ostream& o, const map<S, T>& v) {
	o << "["; int i = 0;
	for (const pair<S, T>& pr : v) o << (!i++ ? "" : ", ") << "{"
	<< pr.fs << " : " << pr.sc << "}"; return o << "]";
}
template<template <class, class...> class S, class T, class... L>
ostream& operator<<(ostream& o, const S<T, L...>& v) {
	o << "["; int i = 0;
	for (const auto& e : v) o << (!i++ ? "" : ", ") << e;
	return o << "]";
}
template<class S, class T>
ostream& operator<<(ostream& o, const pair<S, T>& pr) {
	return o << "(" << pr.fs << ", " << pr.sc << ")";
}
ostream& operator<<(ostream& o, const string& s) {
	for (const char& c : s) o << c;
	return o;
}

template<class T> using V = vector<T>;
template<class T> using VV = V<V<T>>;
template<class T> using VVV = VV<V<T>>;
using ll = long long;
using pii = pair<int, int>;
using vi = V<int>;
using vii = V<pii>;
using vvi = VV<int>;
using mii = map<int, int>;
using umii = unordered_map<int, int>;
using si = set<int>;
using usi = unordered_set<int>;





int main() {
	#ifdef LOCAL
	auto stTime = clock();
//	freopen("in.txt", "r", stdin);
	mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
	#endif
	ios::sync_with_stdio(false);
	cout.precision(10);
	cin.tie(0);

	int N;

	string s, t;

	cin >> N >> s >> t;

	for (int i = 0; i < N; ++i) {
		cout << s[i] << t[i];
	}
	ndl;



	#ifdef LOCAL
	cout << "\n\n\nExecution time: " <<
		(clock() - stTime) * 1e3 / CLOCKS_PER_SEC << " ms" << endl;
	#endif
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

#define N 1000

int main()
{
  int i, j, n, v, ct;
  int array[N];

  scanf("%d", &n);

  for( ct=0; ct<n; ct++){
    scanf("%d", &array[ct]);
  }   

  for( ct=0; ct<n-1; ct++){
    printf("%d ", array[ct]);
  }
  printf("%d\n", array[n-1]);

  for( i=1; i<=n-1; i++){
    v = array[i];

    j = i - 1;

    while( j >= 0 && array[j] > v ){
      array[j+1] = array[j];

      j--;
    }

    array[j+1] = v;

    for( ct=0; ct<n-1; ct++){
      printf("%d ", array[ct]);
    }
    printf("%d\n", array[n-1]);

  }

  return 0;
}

Measured memory_bytes: 600
#include "bits/stdc++.h"
using namespace std;

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

    set< pair<char, char> > st;

    for (int i = 0; i < (int) a.size(); i++) {
        if(a[i] == b[i]) continue;
        char c1 = a[i], c2 = b[i];
        if(st.count(make_pair(c1, c2))) break;
        st.emplace(c1, c2);

        for(int j = 0; j < (int) a.size(); ++j) {
            if(a[j] == c1) a[j] = c2;
            else if(a[j] == c2) a[j] = c1;
        }
    }
    if(a == b) puts("Yes");
    else puts("No");
}

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

int main() {
	int n, k;
	string ss;
	
	cin >> n >> ss >> k;

	char s = ss[k-1];

	REP(i, n) {
		if (s != ss[i])		ss[i] = '*';
	}
	
	cout << ss << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <limits.h>
#include <queue>
#include <cmath>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
#define REP(i, n) for(int i=0; i<n; i++)
#define FOR(i, m, n) for(int i = m;i < n;i++)

ll A[100100];
ll ASUM[100100];
ll X[100100];
int main(){
    int N;
    cin >> N;
    REP(i,N){
        ll a;
        cin >> a;
        A[i] = a;
    }
    sort(A,A+N);
    ASUM[0] = A[0];
    FOR(i,1,N){
        ASUM[i] = ASUM[i-1] + A[i];
    }

    ll thres = ceil((double)A[N-1]/2);
    ll* p = A+N-1;
    while(1){
        //cout << thres << endl;
        ll* pp = lower_bound(A, A+N, thres);
        if(p == pp) break;
        p = pp;
        //cout << *pp << endl;
        thres = ceil((double)*pp/2);
    }
    //cout << thres << endl;

    REP(i,N){
        int num = upper_bound(A,A+N,A[i]*2) - A;
        X[i] = ASUM[num-1];
    }

    //REP(i,N){
    //    cout << X[i] << endl;
    //}

    ll ans = 0;
    REP(i,N){
        ll x = X[i];
        if(x >= thres) ans++;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 2560
(function(stdin) {
'use strict';

  var inputs = stdin.toString().trim().split('\n');
  var lines  = inputs.map(function(v) {
    return v.split(' ').map(Number);
  });
  var result = (function(lines) {

    return lines.map(function add(v) {
      return v[0] + v[1];
    }).join('\n');

  })(lines);

  console.log(result);
})(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 15668
package main

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

// I/O
type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

func (s *Scanner) nextStr() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextFloat() float64 {
	f, e := strconv.ParseFloat(s.nextStr(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func (s *Scanner) nextFloatSlice(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextFloat()
	}
	return res
}

// Arithmetic
func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

// Sort
type RuneSlice []rune

func (a RuneSlice) Len() int           { return len(a) }
func (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }
func (a RuneSlice) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

func main() {
	sc := NewScanner()
	wtr := bufio.NewWriter(os.Stdout)
	S := sc.nextRuneSlice()
	ans := 0
	cur := S[0]
	for i := 1; i < len(S); i++ {
		if cur != S[i] {
			ans++
			cur = S[i]
		}
	}

	fmt.Fprintln(wtr, ans)
	wtr.Flush()
}


Measured memory_bytes: 1408
#include<bits/stdc++.h>
using namespace std;
int N,W;
int v[110];
int w[110];
int dp[110][10010];
int main(){
	cin>>N>>W;
	for(int i=1;i<=N;i++){
		cin>>v[i]>>w[i];
	} 
	for(int i=0;i<=N;i++){
		dp[i][0]=0;
	}
	for(int j=1;j<=W;j++){
		dp[0][j]=-(1<<30);
	}
	int temp;
	for(int i=1;i<=N;i++){
		for(int j=1;j<=W;j++){
			if(j-w[i]<0){
				temp=-(1<<30);
			}
			else{
				temp=dp[i-1][j-w[i]]+v[i];
			}
			dp[i][j]=max(dp[i-1][j],temp);
		}
	}
	int Max=dp[N][W]; 
	for(int j=1;j<W;j++){
		if(dp[N][j]>Max){
			Max=dp[N][j];
		}
	}
	cout<<Max<<endl;
	
	return 0;
} 



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

int main() {
  int x,y;
  cin >> x >> y;

  int a = 4*x - y;
  int b= y-2*x;

  if(((a==0 && b>0)||(a>0 && b==0)||(a>0 && b>0)) && a%2==0 && b%2==0){
  cout << "Yes" << endl;
  }
  else{
      cout << "No" << endl;
  }
}

Measured memory_bytes: 3616
// 🐋💭
import Foundation

func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func readInt() -> Int {
    return Int(readLine()!)!
}

func readDoubles () -> [Double] {
    return readLine()!.split(separator: " ").map { Double($0)! }
}

func readDouble() -> Double{
    return Double(readLine()!)!
}
///最大公約数を返す
func gcd(_ m:Int, _ n:Int) -> Int {
    if n == 0 {return m}
    return gcd(n, m % n)
}

///素数判定(試し割り)
func isPrime(_ x:Int) -> Bool {
    if x <= 1 || x % 2 == 0 { return false }
    if x == 2 { return true }
    for i in stride(from: 3, to: Int(ceil(sqrt(Double(x)))), by: 2){
        if x % i == 0 {
            return false
        }
    }
    return true
}

//https://program-life.com/669
///実行速度の計測
func exectionTime(action: () -> Void) {
    let startDate = Date()
    action()
    let endDate = Date()
    print(endDate.timeIntervalSince(startDate))
}

// https://melheaven.hatenadiary.jp/entry/atcoder144
///約数の配列を返す
func makeDivisors(_ n:Int) -> [Int] {
    var divisors = [Int]()
    for i in 1..<Int(pow(Double(n), 0.5)) + 1 {
        if n % i == 0{
            divisors.append(i + n / i)
        }
    }
    
    return divisors
}

//https://riptutorial.com/ja/swift/example/14738/インデックスを知らずに配列から要素を削除する
extension Array where Element: Equatable {
    
    mutating func remove(_ element: Element) {
        _ = index(of: element).flatMap {
            self.remove(at: $0)
        }
    }
}

func binarySearch(rifgt:Int, key:Int, ary:[String]) -> Int{
    var left = 0
    var right = rifgt
    
    while abs(right - left) > 1 {
        let mid = left + (right - left) / 2
        
        if Int(ary[mid])! < key {
            left = mid
            
        } else {
            right = mid
        }
    }
    return left
}

func arrangement (prev:String, ary:[String], returnVal:[String]) -> [String] {
    var returnVal = returnVal
    if ary.count == 0 {
        returnVal.append(prev)
        return returnVal
    }
    
    for s in ary {
        let wprev = prev + s
        var wary = ary
        wary.remove(s)
        returnVal = arrangement(prev: wprev, ary: wary, returnVal: returnVal)
    }
    return returnVal
}

func main() {
    let n = readInt()
    var dicA = [Int: Int]()
    for i in 0..<n {
        dicA[i] = readInt()
    }
    
    let dicASorted = dicA.sorted { $0.value > $1.value }
    for i in 0..<n {
        for d in dicASorted {
            if d.key == i {
                continue
            } else {
                print(d.value)
                break
            }       
        }
    }
}
main()


Measured memory_bytes: 25744
#include <iostream>
#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll abs1(ll x)
 {
     return x>0? x:-1*x;
 }

int main(){
   
   ll x,k,d;
   cin>>x>>k>>d;
   x=abs1(x);
   ll q=x/d;
   ll ans=x-d*q;
   ll r=x%d;
   if(k<=q)
    cout<<x-d*k<<endl;
  else
   {
       ll lt=k-q;
       if(lt%2==0)
        cout<<abs1(ans)<<endl;
        else
        cout<<abs1(d-ans)<<endl;
       //cout<<min(abs1(ans),abs1(d-ans))<<endl;
   }
}


Measured memory_bytes: 3616
import math

A,B,H,M = map(int,input().split())

Ar = ((2 * math.pi) * (60 * H + M)) / 720
Br = ((2 * math.pi) * M) /60
C = abs(math.pi - (Ar - Br))

D = math.sqrt(((A + (math.cos(C) * B)) ** 2) + (math.sin(C) * B) ** 2)

print(D)


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

using namespace std;

typedef long long ll;

#define newline cout<<"\n"
#define deb(x) cout<<#x<<" "<<x<<endl;

template<typename... T>
void read(T&... args){
    ((cin>>args), ...);
}

template<typename... T>
void write(T... args){
    ((cout<<args<<" "), ...);
}

void printarr(vector<int> &v){
    for(int x: v){
        cout<<x<<" ";
    }
    newline;
}

const int MOD = 1e9+7;
const int nax = 1e7+7;

int main(){
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    
    int d, n; cin>>d>>n;
    
    int cnt = 0;
    int ans = 0;

    while(cnt<n){
        ans ++;
        int tmp = 0;
        int x = ans;
        while(x%100==0){
            tmp++;
            x/=100;
        }
        if(tmp==d){
            cnt++;
        }
        // if(cnt==n){
        //     break;
        // }
    }

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

Measured memory_bytes: 3612
using System;
using System.Collections.Generic;
using System.Linq;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            //[summary]B - Increment Decrement
            int n = int.Parse(Console.ReadLine());
            string s = Console.ReadLine();

            //"x"の初期値は0
            var x = new List<int>() { 0 };
            int calc = 0;

            foreach(var c in s)
            {
                if (c == 'I')
                {
                    calc++;
                }
                else
                {
                    calc--;
                }

                x.Add(calc);
            }

            Console.WriteLine(x.Max());
        }
    }
}

Measured memory_bytes: 13268
#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <iomanip>
using namespace std;

#define rep(i, s) for (int i = 0; i < s; ++i)
#define all(v) (v.begin(), v.end())
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define VEC(a, n) vector<int>a(n)
#define PQ(a) priority_queue<int>a
#define PQmin(a) priority_queue< int, :vector<int>, greater<int> >a
#define PAIR pair<int, int>
/*
sort(sp.begin(), sp.end(), [](PAIR l, PAIR r){
        return l.first<r.first || (l.first==r.first && l.second > r.second);
        });
*/

typedef long long  ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

// int main() {
//     int n;
//     cin>>n;
//     vector<int>p(n);
//     vector<int>q(n);
//     for(int i=0;i<n;i++){
//         cin>>p.at(i);
//         q.at(i)=p.at(i);
//     }
//     sort(q.begin(),q.end());
//     int ans=0;
//     for(int i=0;i<n;i++){
//         if(q.at(i)!=p.at(i)){
//             ans++;
//         }
//     }
//     if(ans==0 || ans==2){
//         cout<<"YES"<<endl;
//     }
//     else{
//         cout<<"NO"<<endl;
//     }





//     return 0;
// }
int main(){
  int n,tem,p[51], ans=0;
  bool flg=true;
  cin>>n;
  for (int i = 0; i < n; i++) {
    cin>>p[i];
  }

  for(int k=0; k<n; k++){
    // cout<<p[k]<<" ";
    if(p[k]!=k+1) flg=false;
  }
  if(flg){
    ans=1;
    cout<<"YES"<<endl;
    return 0;
  }


  for(int i=0; i<n; i++) {
    for(int j=i+1; j<n; j++) {
      tem=p[j];
      p[j]=p[i];
      p[i] =tem;
      flg=true;
      for(int k=0; k<n; k++){
        // cout<<p[k]<<" ";
        if(p[k]!=k+1) flg=false;
      }
      if(flg){
        ans=1;
        // cout<<"YES"<<endl;
      }
      // else cout<<"NO"<<endl;
      tem=p[j];
      p[j]=p[i];
      p[i] =tem;
    }
  }
cout<<((ans==1)?"YES":"NO")<<endl;;
}


Measured memory_bytes: 256
import itertools
import numpy as np

bit_base = 2#bit_base^nの全探査になる. 
def Base_10_to_n(X, n):#10進数をbit_base進数に変換
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out

def main():
  N, M = map(int, input().split())
  cake = []
  for i in range(N):
    cake.append(list(map(int, input().split())))
  cake = np.array(cake)
  ans = 0
  n = 3
  for i in range(bit_base**n):
    s = Base_10_to_n(i, bit_base)
    s = s.zfill(n)
    cake_temp = cake.copy()
    for num, j in enumerate(s):
      if j == '0':
        cake_temp[:, num] *= -1
    cake_temp = np.sum(cake_temp, axis = 1)
    cake_temp = sorted(cake_temp)
    ans = max(sum(cake_temp[-M:]), ans)
  if M == 0:
    ans = 0
  print(ans)
  
if __name__ == "__main__":
  main()
  

Measured memory_bytes: 12540
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
int main() {
  int D, T, S;
  cin >> D >> T >> S;
  if(D <= T * S) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

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

/* 
   requirement
   Val : default / copy constructor
   Map : Val operator() (Val, Val)
*/
template<class Val, class Map>
struct SegmentTree {
    int n;
    Map mp;
    vector<Val> data;
    const Val Id; // identity element
    explicit SegmentTree(int n_, const Val& id_ = Val())
        : mp(Map()), Id(id_) { init(n_);}
    void init(int n_) {
        for(n = 1; n < n_; n <<= 1);
        data.assign(2 * n - 1, Id);
    }
    void update(int k, Val a) {//0-indexed
        k += n - 1;
        data[k] = a;
        while(k > 0) {
            k = (k - 1) >> 1;
            data[k] = mp(data[k * 2 + 1], data[k * 2 + 2]); 
        }
    }
    Val __query(int a, int b, int k, int l, int r) {
        if(r <= a || b <= l) return Id;
        if(a <= l && r <= b) return data[k];
        else {
            Val val_l = __query(a, b, k * 2 + 1, l, (l + r) >> 1);
            Val val_r = __query(a, b, k * 2 + 2, (l + r) >> 1, r);
            return mp(val_l, val_r);
        }
    }
    Val query(int a, int b) { //[a, b)
        return __query(a, b, 0, 0, n);
    }
};

template<class T>
struct updmin {
    T operator () (const T& l, const T& r) { return min(l, r);}
};

using i64 = long long;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n, q;
    cin >> n >> q;
    SegmentTree<int, updmin<int>> seg(n, 2147483647);
    while(q--) {
        int k, u, v;
        cin >> k >> u >> v;
        if(k)
            cout << seg.query(u, v + 1) << endl;
        else
            seg.update(u, v);
    }
    return 0;
}

Measured memory_bytes: 3896
#include <cmath>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <iterator>      // std::next prev


using namespace std;


int main() {   
    std::ios::sync_with_stdio(false);
	string a,b,c;
	cin>>a>>b>>c;
	cout<<(char)toupper(a[0])<<(char)toupper(b[0])<<(char)toupper(c[0]);
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
	int sosuu[50000];
	int sosuulist[50000];
	int i,j;
	int n;
	int count;
	int aikata;
	for(i=0;i<50000;i++)sosuu[i]=1;
	sosuu[0]=0;
	for(i=1;i*i<50000;i++) {
		if(sosuu[i]==0)continue;
		for(j=i+i+1;j<50000;j+=i+1) {
			sosuu[j]=0;
		}
	}
	for(i=0,j=0;i<50000;i++) {
		if(sosuu[i]) {
			sosuulist[j]=i+1;
			j++;
		}
	}
	while(1) {
		scanf("%d",&n);
		if(n==0)break;
		count=0;
		for(i=0;sosuulist[i]<=n/2;i++) {
			aikata=n-sosuulist[i];
			if(sosuu[aikata-1])count++;
		}
		printf("%d\n",count);
	}
	return 0;
}

Measured memory_bytes: 0
def solve():
    N = int(input())
    A = list(map(int, input().split()))
    ans = 1000
    for i in range(1, N):
        x, y = A[i-1], A[i]
        if (x < y):
            ans = y*(ans//x) + ans % x
    print(ans)


if __name__ == "__main__":
    solve()

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

int main(){
    int d; cin >> d;
    if(d == 25) cout << "Christmas" << endl;
    if(d == 24) cout << "Christmas Eve" << endl;
    if(d == 23) cout << "Christmas Eve Eve" << endl;
    if(d == 22) cout << "Christmas Eve Eve Eve" << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
using namespace std;
bool SOSU[1000001];
bool ARU[1000001];
void solve(){
	SOSU[0]=true,SOSU[1]=true;
	for(int i=2;i<1000001;i++){
		if(SOSU[i]==false){
			for(int j=2;i*j<1000001;j++){
				SOSU[i*j]=true;
			}
		}
	}
}
int main(){
	fill(SOSU,SOSU+1000000,false);
	solve();
	int n,x,sum,a[30];
	while(1){
	fill(ARU,ARU+1000000,false);
	cin >> n >> x;
	if(n==0&&x==0)break;
	sum=0;
	for(int i=0;i<n;i++){
		cin >> a[i];
	}
	ARU[0]=true;
	for(int i=0;i<=x;i++){
		if(ARU[i]==true){
				for(int j=0;j<n;j++){
					if(i+a[j]<=x)
					ARU[i+a[j]]=true;
				}
		}
	}
	int flg=0;
	for(int i=x;i>=1;i--){
		if(ARU[i]==true && SOSU[i]==false){
			cout  << i << endl;
			flg=1;
			break;
		}
	}
	if(flg==0)printf("NA\n");
}
}

Measured memory_bytes: 3108
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using pii = pair<int,int>;
const long long INF = 1LL << 60;

int h,w,k;
char c[6][6];

int main()
{
  cin >> h >> w >> k;
  rep(i,h) rep(j,w) cin >> c[i][j];
  
  int ans = 0;
  for(int maskR = 0; maskR < (1<<h); maskR++)
    for(int maskC = 0; maskC < (1<<w); maskC++)
    {
      int black = 0;
      rep(i,h) rep(j,w)
      {
        if(((maskR >> i) & 1) == 0 && ((maskC >> j) & 1) == 0 
           && c[i][j] == '#') black++;
      }
      if(black == k) ans++;
    }
  cout << ans << endl;
}

Measured memory_bytes: 3636
from heapq import heappop, heappush
from time import time

X,Y,Z,K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

A.sort(reverse=True)
A.append(-float('inf'))
B.sort(reverse=True)
B.append(-float('inf'))
C.sort(reverse=True)
C.append(-float('inf'))

hq = []
count = 0
queued = set()
heappush(hq,(-(A[0]+B[0]+C[0]),time(),0,0,0))
queued.add((0,0,0))
while True:
  d,_,i,j,k = heappop(hq)
  #print(-d,i,j,k)
  print(-d)
  count += 1
  if count >= K:
    break
  for l in [i,i+1]:
    for m in [j,j+1]:
      for n in [k,k+1]:
        if (l,m,n) in queued:
          continue
        else:
          heappush(hq,(-(A[l]+B[m]+C[n]),time(),l,m,n))
          queued.add((l,m,n))

Measured memory_bytes: 5356
// 2011/02/18 Tazoe

#include <iostream>
using namespace std;

int main()
{
	while(true){
		int b, r, g, c, s, t;
		cin >> b >> r >> g >> c >> s >> t;
		if(b==0&&r==0&&g==0&&c==0&&s==0&&t==0)
			break;

		int med = 100;		// _ÌiúlÍ100j

		med += (15+(15-2)*5)*b;		// rbO{[iXÉæé
		med += (15+(15-2)*3)*r;		// M[{[iXÉæé
		med += 7*g;			// uhEÉæé
		med += 2*c;			// `F[Éæé

		med -= 3*(t-5*b-3*r-s);		// Q[Éæé¸

		cout << med << endl;
	}

	return 0;
}

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

int gcd(int a, int b)
{
    if (a % b == 0)
    {
        return b;
    }
    else
    {
        return gcd(b, a % b);
    }
}

int main()
{
    int n;
    cin >> n;
    vector<int> x(n + 1);
    vector<int> a(n);
    for (int i = 0; i < n + 1; i++)
    {
        cin >> x.at(i);
    }
    sort(x.begin(), x.end());
    for (int i = 0; i < n; i++)
    {
        a.at(i) = x.at(i + 1) - x.at(i);
    }
    int memo = a.at(0);
    for (int i = 0; i < n; i++)
    {
        memo = gcd(memo, a.at(i));
    }
    cout << memo << endl;
}


Measured memory_bytes: 1024
#include<iostream>
#include<string>
#include <algorithm>
using namespace std;
 
int main(){
    int N,K,i=0,min=0;

  	cin >> N >> K;
    int p[N],l;
    while(i<N){
        cin >> l;
        p[i] = l;
        i++;
    }
    sort(p,p+N);
    for(i=0;i<K;i++){
        min+=p[i];
    }
    cout << min <<endl;
   return 0;
   
  
  
}

Measured memory_bytes: 3576
#include<bits/stdc++.h>
using namespace std;
int n,k;
int main(){
    cin>>n;
    for(int i=0;i<300;i++){
        for(int u=0;u<300;u++){
            if((i*4)+(u*7)==n)k=1;
        }
    }
    if(k==1)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}


Measured memory_bytes: 256
n = int(input())
nPowTen = pow(10,n,pow(10,9) + 7)
nPowNine = pow(9,n,pow(10,9) + 7)
nPowEight = pow(8,n,pow(10,9) + 7)

print((nPowTen - nPowNine - nPowNine +nPowEight) % (pow(10,9) + 7))

Measured memory_bytes: 9188
#include <algorithm>  //min, max, sort, unique, fill
#include <iostream>
#include <numeric>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>  //pair, swap,
#include <vector>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using VI = vector<ll>;
using VB = vector<bool>;
using VP = vector<P>;
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define REP(i, n) for (ll i = 0; i < (n); i++)

static const ll kIntMax = numeric_limits<ll>::infinity();
static const double kFloatMax = numeric_limits<double>::infinity();

vector<ll> vi;

int main() {
  ll n;
  cin >> n;

  ll x6 = 6;
  ll x9 = 9;
  while (x6 <= n || x9 <= n) {
    if (x6 <= x9) {
      vi.push_back(x6);
      x6 *= 6;
    } else {
      vi.push_back(x9);
      x9 *= 9;
    }
  }

  VI dp = VI(100000, 0);
  REP(i, 6) dp[i] = i;
  ll min = 0;

  for (ll i = 6; i <= n; i++) {
    min = 1000000ll;
    for (auto itr = vi.begin(); itr != vi.end(); itr++) {
      if (*itr > i) break;
      min = (dp[i - *itr] + 1ll < min) ? dp[i - *itr] + 1ll : min;
    }
    dp[i] = min;
  }

  cout << dp[n] << endl;

  return 0;
}


Measured memory_bytes: 1024
#include<stdio.h>
int main(void){
    int w,h,x,y,r;
    scanf("%d %d %d %d %d",&w,&h,&x,&y,&r);
    if((x-r)<0||(x+r)>w||(y-r)<0||(y+r)>h){
        printf("No\n");
    }
    else{
        printf("Yes\n");
    }
    return 0;
}


Measured memory_bytes: 2112
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)n; i++)
#define rep1(i, n) for (ll i = 1; i <= (ll)n; i++)
#define PI 3.14159265358979323846
#define vll vector<long long>
#define vvll vector<vector<long long>>
#define pll pair<long long, long long>
using namespace std;
using ll = long long;
using ld = long double;

// グローバル変数（入力）
ll n, q;
vll a, b, c;

void input() {
  cin >> n;
  rep(i, n) {
    ll A;
    cin >> A;
    a.push_back(A);
  }
  cin >> q;
  rep(i, q) {
    ll B, C;
    cin >> B >> C;
    b.push_back(B);
    c.push_back(C);
  }
}

void solve() {
  vll d(100010,0);
  ll sum = 0;
  rep(i, n) { sum += a[i]; }
  rep(i, n) { d[a[i]]++; }
  rep(i, q) {
    ll x = d[b[i]];
    sum += x * (c[i] - b[i]);
    d[c[i]] += x;
    d[b[i]] -= x;
    cout << sum << endl;
    /*
    cout << "i:" << i+1 << endl;
    rep(j,q){
      cout << "  d[" << b[j] << "]=" << d[b[j]] << endl;
      cout << "  d[" << c[j] << "]=" << d[c[j]] << endl;
    }
    */
  }
}

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


Measured memory_bytes: 6664
//#include "stdafx.h"
#include <iostream>
#include <set>
#include <queue>
#include <vector>
#include <algorithm>
#include <math.h>
#include <cmath>
#include <string>
#include <cstring>
#include <functional>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
#include <tuple>
#include <numeric>

using namespace std;

/*-----------------------------------------------------------------------------
　定義
 -------------------------------------------------------------------------------*/
#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define INF						2e9
#define MOD						(1000 * 1000 * 1000 + 7)
#define Ceil(x, n)				(((((x))+((n)-1))/n))		/* Nの倍数に切り上げ割り算 */
#define CeilN(x, n)				(((((x))+((n)-1))/n)*n)		/* Nの倍数に切り上げ */
#define FloorN(x, n)			((x)-(x)%(n))				/* Nの倍数に切り下げ */
#define IsOdd(x)				(((x)&0x01UL) == 0x01UL)			
#define IsEven(x)				(!IsOdd((x)))						
#define	BitSetV(Val,Bit)		((Val) |= (Bit))			
#define	BitTstV(Val,Bit)		((Val) & (Bit))				
#define ArrayLength(x)			(sizeof( x ) / sizeof( x[ 0 ]))
#define MAX_DWORD				(0xFFFFFFFF)
#define	MAX_SDWORD				((SDWORD)0x7FFFFFFF)
#define	MIN_SDWORD				((SDWORD)0x80000000)
#define	MAX_QWORD				((QWORD)0xFFFFFFFFFFFFFFFF)
#define	MIN_QWORD				((QWORD)0x0000000000000000)
#define	MAX_SQWORD				((SQWORD)0x7FFFFFFFFFFFFFFF)
#define	MIN_SQWORD				((SQWORD)0x8000000000000000)
#define M_PI					3.14159265358979323846
#define deg_to_rad(deg)			(((deg)/180)*M_PI)
#define rad_to_deg(rad)			((rad*180)/M_PI)
#define prique(T)				priority_queue<T, vector<T>, greater<T>>

typedef long					SDWORD;
typedef long long				SQWORD;
typedef unsigned long			DWORD;
typedef unsigned long long int	QWORD;
typedef pair<int, int> P;

/*-----------------------------------------------------------------------------
　処理
 -------------------------------------------------------------------------------*/
#define N_MAX	(200 * 1000)
#define K_MAX	(10)
#define M_MAX	(10)
#define H_MAX	(1000)
#define W_MAX	(1000)

int main()
{
	int N, Q;
	string S;
	cin >> N >> Q >> S;

	static int acCnt[N_MAX];
	for (int i = 0; i < N - 1; i++) {
		if (S[i] == 'A' && S[i + 1] == 'C') {
			acCnt[i + 1] = acCnt[i] + 1;
		} else {
			acCnt[i + 1] = acCnt[i];
		}
	}

	static int ans[N_MAX];
	for (int i = 0; i < Q; i++) {
		int l, r;
		cin >> l >> r;
		l--; r--;
		ans[i] = acCnt[r] - acCnt[l];
	}
	for (int i = 0; i < Q; i++) {
		cout << ans[i] << endl;
	}
	cout << endl;
	return 0;
}



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

int main() {
  int n;
  cin >>n  ;
  
  int h;
  cin >> h;
  int m=h;
  int r=1;
  for(int i=1;i<n;i++){
       cin >> h;
       if(h>=m){
	        r++;
			m=h;
	   }
  
  }
  cout <<  r<< endl;
}


Measured memory_bytes: 256
#include<stdio.h>

int con(int a,int b){
    if(a>b){
       return b; 
    }else{
        return a;
    }
}

int main(void){
    int n;
    int count=0;
    int a[200000];
    int min=__INT_MAX__;

    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%d",&a[i]);
    }

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

    printf("%d",count);
}

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

using namespace std;

#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

inline int toInt(string s) {int v; istringstream sin(s);sin>>v; return v;}

typedef long long ll;
 
int main(){
    int N, M;
    string s[100], t[100];

    cin >> N;

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

    cin >> M;

    for(int i = 0; i < M; i++) cin >> t[i];

    sort(s, s+N);
    sort(t, t+M);

    int total = 1, ans = 0;

    for(int i = 0; i < N; i++){

        if(s[i] == s[i+1]){
            total++;
            continue;
        }

        for(int j = 0; j < M; j++){
            if(s[i] == t[j]) total--;
        }
        

        if(ans < total) ans = total;

        total = 1;
    }

    cout << ans << endl;


    return 0;
}

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

int main()
{
    int n;
    cin>>n;
    int a[n+10];
    for(int i=0;i<n;i++)
        cin>>a[i];
    int ans=0;
    for(int i=0;i<n-2;i++)
    {
        for(int j=i+1;j<n-1;j++)
        {
            for(int k=j+1;k<n;k++)
            {
                if(a[i]==a[j] || a[j]==a[k] || a[i]==a[k])
                    continue;
                if(a[i]+a[j]>a[k] && a[i]+a[k]>a[j] && a[j]+a[k]>a[i])
                    ans++;
            }

        }

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


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

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

int main()
{
	string S;
	int len;

	cin >> S;
	len = S.length();

	cout << S.substr(0, len - 8) << endl;

	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>	
#include<cmath>
using namespace std;
int main() {
	int n, m, a, b;
	for (int h = 0; h < 100; h++) {
		int c = 0, sum = 0; int test[123456] = { 0 };
		cin >> n;
		if (n == 0) {
			cin >> n; return 0;
		}
		cin >> m;
		for (int i = 0; i < m; i++) {
			cin  >> a >> b;
			sum += b - a;
		}
		if (sum >= n) {
			cout << "OK" << endl;
		}
		else {
			cout << n - sum << endl;
		}
	}
	cin >> n;
}


Measured memory_bytes: 3092
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <functional>
#include <climits>
#include <cstring>
#include <cmath>
#include <cstdlib>

using namespace std;

#define int long long

#define rep(i, n) for (int i=0;i<(int)n;++i)
#define rep1(i, n) for (int i=1;i<=(int)n;++i)
#define unless(a) if(!(a))
#define all(a) begin(a),end(a)
#define fst first
#define scd second
#define PB emplace_back
#define PPB pop_back

using ll=long long;
using vi=vector<int>;
using pii=pair<int, int>;

constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); };

bool chmin(int&a,int b){return a>b?(a=b,true):false;}
bool chmax(int&a,int b){return a<b?(a=b,true):false;}
int read(){int a;scanf("%lld",&a);return a;}

const int inf = TEN(9) + 10;
const int mod = TEN(9) + 7;

signed main()
{
	int n; cin >> n;
	vi a(n);rep(i,n)cin>>a[i];
	if (n == 1) {
		cout << 1 << endl;
		return 0;
	}

	bool yet = true, increasing = false, decreasing = false;

	int ans = 1;

	rep(i, n - 1) {
		if (a[i] < a[i + 1]) {
			if (yet) {
				increasing = true;
				yet = false;
			} else if (decreasing) {
				decreasing = false;
				yet = true;
				ans++;
			}
		}
		if (a[i] > a[i + 1]) {
			if (yet) {
				decreasing = true;
				yet = false;
			} else if (increasing) {
				increasing = false;
				yet = true;
				ans++;
			}
		}
		if (a[i] == a[i + 1]) {
			
		}
	}

	cout << ans << endl;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
int main(){
	long long n,x;
	cin>>n>>x;
	long long all=(1LL<<(n+2))-3;
	long long pat[51];
	pat[0]=1;
	for(int i=0;i<n;i++){
		pat[i+1]=pat[i]*2+1;
	}
	long long idx=n;
	long long ans=0;
	while(x>0){
      	if(idx==0){
          	ans++;
          	break;
        }else if((all+1)/2==x){
			ans+=pat[idx-1]+1;
			break;
		}else if((all+1)/2<x){
			ans+=pat[idx-1]+1;
			x-=(all+1)/2;
		}else{
          	x--;
		}
		all-=3;
		all/=2;
		idx--;
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
int x[100010],y[100010];
vector<int> X[100010], Y[100010];
bool usedX[100010], usedY[100010];
set<int> stX, stY;

void dfs(int _x, int _y) {
    // cout << _x << " " << _y << endl;
    stX.insert(_x);
    stY.insert(_y);
    if (!usedX[_x]) {
        usedX[_x] = 1;
        for (int i = 0; i < X[_x].size(); i++) {
            dfs(_x, X[_x][i]);
        }
    }
    if (!usedY[_y]) {
        usedY[_y] = 1;
        for (int i = 0; i < Y[_y].size(); i++) {
            dfs(Y[_y][i], _y);
        }
    }
}

int main() {
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> x[i] >> y[i];
        X[x[i]].push_back(y[i]);
        Y[y[i]].push_back(x[i]);
    }
    ll ans = 0;
    for (int i = 0; i < n; i++) {
            // cout << "test: " << x[i] << " " << y[i] << endl;
        if (!usedX[x[i]] && !usedY[y[i]]) {
            stX.clear();
            stY.clear();
            dfs(x[i], y[i]);
            ans += (ll)stX.size() * (ll)stY.size();
        }
    }
    cout << ans - n << endl;
    return 0;
}


Measured memory_bytes: 16768
#include <climits>
#include <cmath>
#include <iostream>
#include <vector>

using namespace std;

int main() {
    int n, k;
    cin >> n >> k;

    vector<int> h(n);
    for (int i = 0; i < n; ++i)
        cin >> h[i];

    vector<int> dp(n, INT_MAX);
    dp[0] = 0;
    for (int i = 1; i < n; ++i) {
        for (int j = 1; j <= k; ++j) {
            if (i - j < 0)
                break;

            dp[i] = min(dp[i], dp[i - j] + abs(h[i] - h[i - j]));
        }
    }

    cout << dp[n - 1] << '\n';
}


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

int main(){
    int n,m,a[10],s,c;
    map<int ,int>q;
    cin>>n>>m;
    int flag=1;
    memset(a,-1,sizeof(a));
    while(m--){
        cin>>s>>c;
        if(q[s]==0){
            q[s]=c;
            a[s]=c;
        }
        else{
            if(q[s]!=c) flag=0;
        }
    }
    if(a[1]==0 && n>1) flag=0;
    if(flag==0) puts("-1");
    else{
            if(n>1){
        for(int i=1;i<=n;i++){
            if(a[i]==-1 && i==1) cout<<1;
            else if(a[i]==-1 && i>1) cout<<0;
            else cout<<a[i];
        }
            }
            else{
                if(a[1]==-1) cout<<0;
                else cout<<a[1];
            }
    }
    return 0;
}


Measured memory_bytes: 256
using System;
class rectangle
{
    public static void Main()
    {
        int a, b;
        string[] rec = Console.ReadLine().Split(' ');
        a = int.Parse(rec[0]);
        b = int.Parse(rec[1]);
        int c = a * b;
        int d = 2 * (a + b);
        Console.WriteLine("{0} {1}",c,d);
    }
}

Measured memory_bytes: 9112
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);

    int x = sc.nextInt();
    int y = sc.nextInt();
    int ax2 = 4*x - y;
    int bx2 = -2 * x + y;

    if((ax2 % 2) == 0 && (bx2 % 2) == 0 && ax2 >= 0 && bx2 >= 0){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
    
    return;
  }
}

Measured memory_bytes: 35868
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <iterator>  // std::back_inserter()
#include <set>
#include <algorithm>  // std::copy()
#include <functional>  // std::greater<T>()
#include <utility>  // std::swap()
#include <numeric>  // accumulate(ALL(vec), 0)  0 は初期値
#include <cmath>
#include <climits>  // INT_MIN
#include <cctype>  // std::isdigit()
using namespace std;

#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, n) for (int i=0; i < (int)(n); i++)  // 0 ~ n-1
#define REPN(i, n) for (int i=1; i <= (int)(n); i++)  // 1 ~ n
#define MIN(vec) min_element(ALL((vec)))  // イテレータのため、値を取り出すときは * を先頭につける
#define MAX(vec) max_element(ALL((vec)))
#define IDX(vec, element_iter) distance((vec).begin(), element_iter)
#define SUM(vec) accumulate(ALL((vec)), 0)  // 0 は初期値
#define COPY(vec1, vec2) copy(ALL(vec1), back_inserter(vec2))  // vec1をvec2にコピーする vec2は空にしておく必要あり
typedef long long ll;

const int MOD = 1000000007;  // 1 000 000 007


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

    // input
    int A, B, C;
    cin >> A >> B >> C;
    if (A == B) {
        if (B == C) {
            cout << 1 << "\n";
        } else {
            cout << 2 << "\n";
        }
    } else if (A != B) {
        if (B == C || A == C) {
            cout << 2 << "\n";
        } else {
            cout << 3 << "\n";
        }
    }
    return 0;
}


Measured memory_bytes: 256
n=int(input())
l=list(map(int,input().split()))

count=0
for i in range (n-2):
    for j in range (i+1,n-1):
        if l[i]==l[j]:
            continue
        for k in range (j+1,n):
            
            if l[k]==l[i] or l[k]==l[j]:
                continue
            if l[k]<l[i]+l[j] and l[i]<l[j]+l[k] and l[j]<l[k]+l[i] :
                count+=1
print(count)
    



Measured memory_bytes: 9180